当前位置:网站首页>在线文本实体抽取能力,助力应用解析海量文本数据
在线文本实体抽取能力,助力应用解析海量文本数据
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 最新技术资讯~
边栏推荐
- 解决“Thread 1: “-[*.CollectionNormalCellView isSelected]: unrecognized selector sent to instance 0x7f”
- 网络基础和框架
- R语言dplyr包arrange函数排序dataframe数据、通过多个数据列排序dataframe数据(默认是升序排序)
- 生态 | 万里数据库与卫士通完成兼容认证 共筑网络安全生态体系
- Photon网络框架
- Is there any discount for opening an account now? Is it safe to open a mobile account?
- Install rstudio desktop and rstudio server free version
- &lt; Sicily&gt; 1000. number reversal
- Playing in Singapore in the hot summer: an inventory of indoor attractions and good places for night trips
- The R language inputs the distance matrix to the hclust function for hierarchical clustering analysis, uses the cutree function to divide the hierarchical clustering clusters, specifies the number of
猜你喜欢

安装Rstudio Desktop和Rstudio Server免费版本

Lm05 former VIX (second generation product)

数据中台稳定性的“四高” | StartDT Tech Lab 18

Ablebits Ultimate Suite for Excel

「开发者说」钉钉连接器+OA审批实现学校学生假勤场景数字化

项目测试一半,需求要变更,测试人员怎么办?

DevEco Device Tool 助力OpenHarmony设备开发

支持HomeKit、NFC:智汀智能门锁SL1仅需要149元

Unity learning day14 -- collaboration and WWW

生态 | 万里数据库与卫士通完成兼容认证 共筑网络安全生态体系
随机推荐
R language dplyr package arrange function sorts dataframe data and sorts dataframe data through multiple data columns (ascending sort by default)
Oracle database's dominant position is gradually eroded by cloud competitors
Part C - value types and reference types
New project, how to ensure the coverage of the test?
Ablebits Ultimate Suite for Excel
Operation of 2022 tool fitter (elementary) examination practice question simulation examination platform
Deep thinking: in-depth analysis of some scenes in Gaia Altman and the philosophy and perception reflected
Ecological Wanli database and Westone completed compatible certification to jointly build a network security ecosystem
涉及第三方支付接口,怎么测?
R语言dplyr包arrange函数排序dataframe数据、通过多个数据列排序dataframe数据(默认是升序排序)
An idea of using keep alive to cache data in vue3 form pages
Qt5 knowledge: string list qstringlistmodel
R语言使用构建有序多分类逻辑回归模型、ordinal.or.display函数获取有序逻辑回归模型的汇总统计信息(变量对应的优势比及其置信区间、以及假设检验的p值)、汇总统计结果保存到csv
网络基础和框架
【网站架构】10年数据库设计浓缩的绝技,实打实的设计步骤与规范
CSS magic nugget mug; Optimization of CK, ES and redisearch schemes in ten million level data query; Why does module circular dependency not lead to dead loop Sauced afternoon tea issue 13
Is there any discount for opening an account now? Is it safe to open a mobile account?
支持HomeKit、NFC:智汀智能门锁SL1仅需要149元
夏日炎炎玩转新加坡:盘点室内景点和夜游好去处
CDH邮件报警配置