当前位置:网站首页>在线文本实体抽取能力,助力应用解析海量文本数据
在线文本实体抽取能力,助力应用解析海量文本数据
2022-06-23 12:36:00 【51CTO】
随着信息化的发展,很多具有重要价值的知识隐藏分布在海量数据中,影响了人们获取知识的效率,如何处理繁杂的非结构化文本数据成为难题。
近日,HMS Core 机器学习服务,该能力可以检测出文本中是否存在比如日期、姓名、专有名词等实体信息,并将此类实体抽取出来,即自动处理非结构化自然语言文本数据的能力。例如,影视行业的应用中常常会出现大量文字的影评、资讯等内容,使用在线文本实体抽取能力即可快速提取结构信息,帮助搭建知识图谱,便于用户清晰理解。
 在线文本实体抽取能力,助力应用解析海量文本数据_问答系统](https://s8.51cto.com/images/blog/202206/23100127_62b3c977ec3fc96123.gif)
此外,文本实体抽取能力更多应用于问答系统、信息索引、知识图谱构建等领域。
问答系统
问答系统是信息检索系统的一种高级形式,它能用准确、简洁的自然语言回答用户提出的问题。在问答系统实现过程中,则需要用到文本实体抽取能力识别问题和知识库中的实体信息,再通过多种算法模型匹配出精准回答。
信息索引
使用在线文本实体抽取能力,可命名特定实体信息作为索引和超链接。比如用户在评论时提到的专有名词,可以生成超链接,便于其他用户检索了解相关内容。
知识图谱构建
知识图谱是由实体、关系和属性组成的一种数据结构,即具有有向图结构的一个知识库,文本实体抽取能力作为知识图谱构建过程中的底层能力,有着极其重要的作用。比如构建音乐知识图谱,首先需要大量的文本数据中提取出歌手、歌曲、作词、影视等相关信息,然后再进行知识图谱的搭建。 目前,华为机器学习服务在线文本实体抽取能力共支持人名、金钱、影视名、网页链接在内的16个实体类别,可根据实际语义场景应用于不同类别的App中。
集成步骤
- 开发准备
详细准备步骤可参考 华为开发者联盟官网。
- 集成和配置apigateway鉴权
基于apigateway的鉴权机制:
"paths": {
"/entityExtract": { "post": { "operationId": "entityExtract",
"parameters": [{"in": "body", "name": "req", "required": true,
"schema": { "$ref": "#/definitions/NerEnterReq" } }, {
"name": "X-Request-ID", "in": "header", "required": true,
"type": "string"
}, {"name": "X-Package-Name", "in": "header", "required": true,
"type": "string" }, ……],
"responses": {"200": { "description": "response of 200",
"schema": { "$ref": "#/definitions/ResponseEntityNerBodyVo"}}}}}
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
- 创建在线文本实体构造器
- 在线获取文本实体抽取
异步方法示例代码:
ner.asyncEntityExtract(input).addOnSuccessListener(new OnSuccessListener<RemoteNerResultItem[]>() {
@Override
public void onSuccess(RemoteNerResultItem[] remoteNerResults) {
// 成功的处理逻辑。
if(remoteNerResults != null){
// 有识别结果
}else {
// 识别结果为空
}
}
}).addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(Exception e) {
// 识别失败,获取相关异常信息。
try {
MLException mlException = (MLException) e;
// 获取错误码,开发者可以对错误码进行处理,根据错误码进行差异化的页面提示。
int errorCode = mlException.getErrCode();
// 获取报错信息,开发者可以结合错误码,快速定位问题。
String errorMessage = mlException.getMessage();
} catch (Exception error) {
// 转换错误处理。
}
}
});
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
- 11.
- 12.
- 13.
- 14.
- 15.
- 16.
- 17.
- 18.
- 19.
- 20.
- 21.
- 22.
- 23.
- 24.
- 25.
同步方法示例代码:
try {
RemoteNerResultItem[] remoteNerResults = ner.syncEntityExtract(input);
// 识别成功逻辑
if(remoteNerResults != null){
// 有识别结果
}else {
// 识别结果为空
}
} catch (MLException mlException) {
// 失败的处理逻辑。
// 获取错误码,开发者可以对错误码进行处理,根据错误码进行差异化的页面提示。
int errorCode = mlException.getErrCode();
// 获取报错信息,开发者可以结合错误码,快速定位问题。
String errorMessage = mlException.getMessage();
}
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
- 11.
- 12.
- 13.
- 14.
- 15.
- 完成后,释放资源
了解更多详情>>
访问 华为开发者联盟官网
获取 开发指导文档
华为移动服务开源仓库地址: GitHub
关注我们,第一时间了解 HMS Core 最新技术资讯~
边栏推荐
- R language uses the polR function of mass package to build an ordered multi classification logistic regression model, and uses the summary function to obtain the summary statistical information of the
- 项目测试一半,需求要变更,测试人员怎么办?
- Basic data type and corresponding packing class
- The GLM function of R language uses frequency data to build a binary logistic regression model. The input data for analysis is frequency data, which is transformed into normal sample data (split and s
- Solve "thread 1:" -[*.collectionnormalcellview isselected]: unrecognized selector sent to instance 0x7F "
- IPSec传输模式下ESP报文的装包与拆包过程
- 10-- construct binary tree according to middle order traversal and post order traversal
- R语言使用构建有序多分类逻辑回归模型、ordinal.or.display函数获取有序逻辑回归模型的汇总统计信息(变量对应的优势比及其置信区间、以及假设检验的p值)、汇总统计结果保存到csv
- 冷板式、浸没式、喷淋式液冷散热能否引领高性能计算发展?
- 群晖万兆网络配置与测试
猜你喜欢

What should testers do if the requirements need to be changed when the project is half tested?

Install rstudio desktop and rstudio server free version

唐人街徒步:在异国情调的纽约感受浓厚的中式气息

Ablebits Ultimate Suite for Excel

MySQL使用ReplicationConnection导致的连接失效分析与解决

Solve "thread 1:" -[*.collectionnormalcellview isselected]: unrecognized selector sent to instance 0x7F "

C#部分——值类型和引用类型
![[introduction to UVM== > episode_7] ~ sequence, sequence item, sequencer, driver](/img/75/cd374bab8da2c133a0207a2472581f.png)
[introduction to UVM== > episode_7] ~ sequence, sequence item, sequencer, driver

Lm05 former VIX (second generation product)
![解决“Thread 1: “-[*.CollectionNormalCellView isSelected]: unrecognized selector sent to instance 0x7f”](/img/35/65511c49eca5ae8a1896d776b479d9.jpg)
解决“Thread 1: “-[*.CollectionNormalCellView isSelected]: unrecognized selector sent to instance 0x7f”
随机推荐
理财产品长期是几年?新手最好买长期还是短期?
项目测试一半,需求要变更,测试人员怎么办?
Meta 称英国安全法将“扫描所有私人信息”,有侵犯用户隐私风险
QT knowledge: using the qgraphicspixmapitem class
Deep thinking: in-depth analysis of some scenes in Gaia Altman and the philosophy and perception reflected
&lt; Sicily&gt; 1000. number reversal
C # learning (advanced course) day14 - features
The GLM function of R language uses frequency data to build a binary logistic regression model. The input data for analysis is frequency data, which is transformed into normal sample data (split and s
Machine Learning Series 5: distance space (1)
How to test the third-party payment interface?
2022 construction worker - Equipment direction - post skill (construction worker) test question simulation test platform operation
简历的项目经历,测试人员书写要注意的几个问题
After the uncommitted transactions in the redo log buffer of MySQL InnoDB are persisted to the redo log, what happens if the transaction rollback occurs?
【系统架构】-软件架构的5大风格
【网站架构】10年数据库设计浓缩的绝技,实打实的设计步骤与规范
协程
首次曝光!唯一全域最高等级背后的阿里云云原生安全全景图
ROS observation [51]: how to integrate odometer and IMU with robots_ Localization convergence
Qt5 knowledge: DNS query
QT knowledge: detailed explanation of view frame qgraphicswidget