Coder Social home page Coder Social logo

trellixvulnteam / rasa_usage_jkm7 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from learnerzhang/rasa_usage

0.0 0.0 0.0 10.43 MB

基于rasa_框架实现指自然语言相关功能:实体识别、文本分类、代消解功能、关系抽取等

Shell 0.07% Python 99.64% HTML 0.25% Dockerfile 0.03%

rasa_usage_jkm7's Introduction

基于rasa的litemind自然语言处理工程

t1 指代消解 > coref

  • 组织方式

    分词-> 词性标注-> 句法分析 实体识别-> 人实体性别判断 -> 指代匹配策略

  • 目前优化点

    增加人名实体的识别精度, 人名-> 性别

t2 话单入图 > call2graph

  • 组织方式

    pass

  • 目前优化点

    pass

问题:

实体识别不够精准
1) 目前采用ltp提供的单一实体识别;
2) 缺乏其他广泛实体的识别;
3) 融合多种实体抽取工具;
姓名属性不够精确
1) 性别判断难度比较大, 模型的准确率有限;
2) 需要融入规则字典来解决常用名的性别识别;
匹配策略亟待优化
1) 采用实体-代词依赖词、上下文相似度;
2) 需要考虑其他更多可能的情景;

安装部署

  • 避免多余依赖的引入,最好是用virtualenv创建一个隔离环境

    which python3 # 查找py3的安装路径 /usr/local/bin/python3 -m virtualenv .env # 创建虚拟py3环境 virtualenv .env --python==/usr/local/bin/python3 # 创建虚拟py3环境

  • 获取当前项目的所有依赖,进入隔离环境,将项目的依赖项完整下载:

    source .env/bin/activate # 开启虚拟环境 pip install pip2pi # 离线导包工具 mkdir dependences # 存放依赖包的地方 pip2pi ./dependences --no-use-wheel -r requirements.txt # 根据requirements.txt 导出依赖包 pip2pi ./dependences -r requirements.txt # 根据requirements.txt 导出依赖包

  1. 将下载好的依赖项放在服务器,执行命令安装依赖,第一遍安装可能跳过某些依赖项,可以多次执行这个命令:

    which python3 # 查找py3的安装路径 /usr/local/bin/python3 -m virtualenv .env # 创建虚拟py3环境 pip install --no-index --find-links=./dependences -r requirements.txt # 新服务器环境下导入依赖包

服务及演示

python -m server --path models

实体抽取

http://localhost:5007/entity?text=李世民病倒了,小明说他是累病的

指代消解

http://localhost:5007/coref?text=李世民病倒了,小明说他是累病的

属性链接

http://localhost:5007/link?text=小明,男,身高180cm,上个月去北京站坐G22到**,与他同行的有30岁的小黑,他们开着一辆白色法拉利逃跑

关系抽取

http://localhost:5000/relation?text=小明生病了,他的阿姨王兰在照顾他

属性连接

先训练

python -m train -c sample_configs/config_entity_online.yml -d data/entity/example -o models/ --project entity

python -m train -c sample_configs/config_coref_online.yml -d data/entity/example -o models/ --project coref

python -m train -c sample_configs/config_link_online.yml -d data/entity/example -o models/ --project link

python -m train -c sample_configs/config_relation_online.yml -d data/entity/example -o models/ --project relation

rasa_usage_jkm7's People

Contributors

trellixvulnteam avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.