当前位置:网站首页>在线文本实体抽取能力,助力应用解析海量文本数据
在线文本实体抽取能力,助力应用解析海量文本数据
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 is used to build ordered multi classification logistic regression model, ordinal or. The display function obtains the summary statistical information of the ordered logistic regression mode
- 深入思考:《盖亚奥特曼》中部分情景深度分析及反射出的哲理与感悟
- 生态 | 万里数据库与卫士通完成兼容认证 共筑网络安全生态体系
- Stimulsoft Ultimate Reports 2022.3.1
- R language uses the polR function of mass package to build an ordered multi classification logistic regression model, and uses exp function and coef function to obtain the corresponding odds ratio of
- 对象池框架
- [website architecture] the unique skill of 10-year database design, practical design steps and specifications
- 安装Rstudio Desktop和Rstudio Server免费版本
- QT knowledge: QT widgets widget function [02]
- 网络基础和框架
猜你喜欢

Qunhui 10 Gigabit network configuration and test

How to test the third-party payment interface?

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

Analysis and solution of connection failure caused by MySQL using replicationconnection
![ROS observation [51]: how to integrate odometer and IMU with robots_ Localization convergence](/img/45/ea591a0c320a242a32aaecde0898bf.png)
ROS observation [51]: how to integrate odometer and IMU with robots_ Localization convergence

New project, how to ensure the coverage of the test?

Ablebits Ultimate Suite for Excel

Wallys/DR6018-S/ 802.11AX MU-MIMO OFDMA / 2* GE PORTS/WIFI 6e / BAND DUAL CONCURRENT

Oracle数据库的主导地位被云竞争对手逐渐侵蚀

安装Rstudio Desktop和Rstudio Server免费版本
随机推荐
Playing in Singapore in the hot summer: an inventory of indoor attractions and good places for night trips
自己测试的范围内出现严重 BUG ,马上要上线,这种情况怎么办?
Solve "thread 1:" -[*.collectionnormalcellview isselected]: unrecognized selector sent to instance 0x7F "
理财产品长期是几年?新手最好买长期还是短期?
[website architecture] the unique skill of 10-year database design, practical design steps and specifications
&lt; Sicily&gt; 1001. Rails
C file download method
Deveco device tool helps openharmony device development
群晖万兆网络配置与测试
ROS observation [51]: how to integrate odometer and IMU with robots_ Localization convergence
C#部分——值类型和引用类型
技术分享| WVP+ZLMediaKit实现摄像头GB28181推流播放
简历的项目经历,测试人员书写要注意的几个问题
Excel-vba quick start (I. macros, VBA, procedures, types and variables, functions)
Analysis and solution of connection failure caused by MySQL using replicationconnection
深入思考:《盖亚奥特曼》中部分情景深度分析及反射出的哲理与感悟
C # learning (advanced course) day13 - Reflection
Synergetic process
Interview question: for example, how do you do interface testing at work?
涉及第三方支付接口,怎么测?