当前位置:网站首页>在线文本实体抽取能力,助力应用解析海量文本数据
在线文本实体抽取能力,助力应用解析海量文本数据
2022-06-24 12:59:00 【HMS Core】
随着信息化的发展,很多具有重要价值的知识隐藏分布在海量数据中,影响了人们获取知识的效率,如何处理繁杂的非结构化文本数据成为难题。
近日,HMS Core机器学习服务6.5.0版本新增在线文本实体抽取能力,该能力可以检测出文本中是否存在比如日期、姓名、专有名词等实体信息,并将此类实体抽取出来,即自动处理非结构化自然语言文本数据的能力。例如,影视行业的应用中常常会出现大量文字的影评、资讯等内容,使用在线文本实体抽取能力即可快速提取结构信息,帮助搭建知识图谱,便于用户清晰理解。

此外,文本实体抽取能力更多应用于问答系统、信息索引、知识图谱构建等领域。
问答系统
问答系统是信息检索系统的一种高级形式,它能用准确、简洁的自然语言回答用户提出的问题。在问答系统实现过程中,则需要用到文本实体抽取能力识别问题和知识库中的实体信息,再通过多种算法模型匹配出精准回答。
信息索引
使用在线文本实体抽取能力,可命名特定实体信息作为索引和超链接。比如用户在评论时提到的专有名词,可以生成超链接,便于其他用户检索了解相关内容。
知识图谱构建
知识图谱是由实体、关系和属性组成的一种数据结构,即具有有向图结构的一个知识库,文本实体抽取能力作为知识图谱构建过程中的底层能力,有着极其重要的作用。比如构建音乐知识图谱,首先需要大量的文本数据中提取出歌手、歌曲、作词、影视等相关信息,然后再进行知识图谱的搭建。
目前,华为机器学习服务在线文本实体抽取能力共支持人名、金钱、影视名、网页链接在内的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"}}}}}- 创建在线文本实体构造器
// 使用自定义的参数配置创建语种检测器。 MLRemoteNerSetting setting = new MLRemoteNerSetting.Factory() .setSourceLangCode("zh") .create();MLRemoteNer ner = MLNerFactory.getInstance().getRemoteNer(setting);进行文本实体抽取。- 在线获取文本实体抽取
异步方法示例代码:
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) { // 转换错误处理。 } } });同步方法示例代码:
try { RemoteNerResultItem[] remoteNerResults = ner.syncEntityExtract(input); // 识别成功逻辑 if(remoteNerResults != null){ // 有识别结果 }else { // 识别结果为空 } } catch (MLException mlException) { // 失败的处理逻辑。 // 获取错误码,开发者可以对错误码进行处理,根据错误码进行差异化的页面提示。 int errorCode = mlException.getErrCode(); // 获取报错信息,开发者可以结合错误码,快速定位问题。 String errorMessage = mlException.getMessage(); }- 完成后,释放资源
if (ner != null) { ner.stop();}了解更多详情>>
访问华为开发者联盟官网
获取开发指导文档
华为移动服务开源仓库地址:GitHub、Gitee
关注我们,第一时间了解 HMS Core 最新技术资讯~
边栏推荐
- Coinbase will launch the first encryption derivative for individual investors
- 居家办公更要高效-自动化办公完美提升摸鱼时间 | 社区征文
- Docker安装redis
- Jerry has opened a variety of decoding formats, and the waiting time from card insertion to playback is long [chapter]
- These default routes and static routes can not be configured and deployed. What kind of network workers are they!
- 杰理之TIMER0 用默认的 PA13 来检测脉宽【篇】
- 2022 Quality Officer - Equipment direction - post skills (Quality Officer) recurrent training question bank and online simulation examination
- Promotion of Project Manager
- 【sdx62】WCN685X IPA注册失败问题分析及解决方案
- Autorf: learn the radiation field of 3D objects from single view (CVPR 2022)
猜你喜欢

Activity生命周期

群晖向阿里云OSS同步

杰理之红外滤波【篇】

Huawei PC grows against the trend, and product power determines everything

《中国数据库安全能力市场洞察,2022》报告研究正式启动

10 reduce common "tricks"

Home office should be more efficient - automated office perfectly improves fishing time | community essay solicitation

每日一题day8-515. 在每个树行中找最大值

吉时利静电计宽测量范围

常识知识点
随机推荐
钛星数安加入龙蜥社区,共同打造网络安全生态
2022年烟花爆竹生产单位安全生产管理人员考试题模拟考试题库模拟考试平台操作
【R语言数据科学】(十四):随机变量和基本统计量
Jerry added an input capture channel [chapter]
Jerrys timer0 uses the default pa13 to detect the pulse width [chapter]
Huawei PC grows against the trend, and product power determines everything
Developer survey: rust/postgresql is the most popular, and PHP salary is low
Coinbase will launch the first encryption derivative for individual investors
Jerry's test mic energy automatic recording automatic playback reference [article]
2022煤矿瓦斯抽采操作证考试题及模拟考试
吉时利静电计宽测量范围
HarmonyOS-3
项目经理的晋级之路
Docker installation redis
Redis面试题
常识知识点
杰理之可能出现有些芯片音乐播放速度快【篇】
2022 Quality Officer - Equipment direction - post skills (Quality Officer) recurrent training question bank and online simulation examination
Golden age ticket: Web3.0 Security Manual
杰理之无缝循环播放【篇】