All Projects → Ma-Dan → rasa_bot

Ma-Dan / rasa_bot

Licence: Apache-2.0 license
整理:基于Rasa-NLU和Rasa-Core的任务型ChatBot

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to rasa bot

ModernSecurityProtectionGuide
Modern Security Protection Guide
Stars: ✭ 72 (+41.18%)
Mutual labels:  chinese
linguistics problems
Natural language processing in examples and games
Stars: ✭ 23 (-54.9%)
Mutual labels:  natural-language-understanding
pinyin data
🐼 Easy to use and portable pronunciation data for Hanzi characters.
Stars: ✭ 13 (-74.51%)
Mutual labels:  chinese
Luci
Logical Unity for Communicational Interactivity
Stars: ✭ 25 (-50.98%)
Mutual labels:  natural-language-understanding
chinese-tokenizer
Tokenizes Chinese texts into words.
Stars: ✭ 72 (+41.18%)
Mutual labels:  chinese
predict Lottery ticket
双色球+大乐透彩票AI预测
Stars: ✭ 341 (+568.63%)
Mutual labels:  chinese
embedding study
中文预训练模型生成字向量学习,测试BERT,ELMO的中文效果
Stars: ✭ 94 (+84.31%)
Mutual labels:  chinese
flask-docs-zh
Flask 文档简体中文翻译
Stars: ✭ 93 (+82.35%)
Mutual labels:  chinese
corpusexplorer2.0
Korpuslinguistik war noch nie so einfach...
Stars: ✭ 16 (-68.63%)
Mutual labels:  natural-language-understanding
ChineseNames
🀄 Chinese Name Database (1930-2008)
Stars: ✭ 99 (+94.12%)
Mutual labels:  chinese
bert extension tf
BERT Extension in TensorFlow
Stars: ✭ 29 (-43.14%)
Mutual labels:  natural-language-understanding
Vanhiupun.github.io
🏖️ Vanhiupun's Awesome Site ==> another theme for elegant writers with modern flat style and beautiful night/dark mode.
Stars: ✭ 57 (+11.76%)
Mutual labels:  chinese
stable-baselines-zh
Stable Baselines官方文档中文版
Stars: ✭ 75 (+47.06%)
Mutual labels:  chinese
ime.vim
A Vim input method engine
Stars: ✭ 74 (+45.1%)
Mutual labels:  chinese
PHP-Chinese
PHP Chinese Conversion (中文繁簡轉換)
Stars: ✭ 37 (-27.45%)
Mutual labels:  chinese
word2vec-movies
Bag of words meets bags of popcorn in Python 3 中文教程
Stars: ✭ 54 (+5.88%)
Mutual labels:  chinese
BERT-chinese-text-classification-pytorch
This repo contains a PyTorch implementation of a pretrained BERT model for text classification.
Stars: ✭ 92 (+80.39%)
Mutual labels:  chinese
fuzzychinese
A small package to fuzzy match chinese words
Stars: ✭ 50 (-1.96%)
Mutual labels:  chinese
PrivacyQA EMNLP
PrivacyQA, a resource to support question-answering over privacy policies.
Stars: ✭ 24 (-52.94%)
Mutual labels:  natural-language-understanding
deep ethereum
电子书:以太坊技术与实现
Stars: ✭ 304 (+496.08%)
Mutual labels:  chinese

整理:基于Rasa-NLU和Rasa-Core的任务型ChatBot

组件版本

  1. Python 3
  2. TensorFlow 1.8.0
  3. Keras 2.2.2
  4. jieba 0.39
  5. msgpack 0.5.6
  6. scikit-learn 0.19.1
  7. sklearn_crfsuite 0.3.6
  8. spacy 2.0.17
  9. rasa-nlu 0.13.8
  10. rasa-core 0.10.4

资料来源

  1. FastText预训练词向量,wiki训练,有两个版本可以选择,这里选择wiki训练的尺寸较小的版本,下载地址https://s3-us-west-1.amazonaws.com/fasttext-vectors/wiki.zh.vec
  2. rasa-nlu和rasa-core示例配置和语料 来自:https://github.com/zqhZY/_rasa_chatbot 这里仅整理为一个完整的包含NLU、Dialog训练和测试,ChatBot在线学习和使用的例子。

准备工作

  1. git clone https://github.com/Ma-Dan/rasa_bot
  2. 下载FastText预训练词向量wiki.zh.vec 下载后运行下列命令准备词向量 python -m spacy init-model zh rasr_bot/spacy/wiki_zh --vectors-loc wiki.zh.vec
  3. 当前版本rasa-nlu的jieba_tokenizer存在重复加载用户字典问题,使用最新版覆盖site-packages/rasa_nlu/tokenizers下的jieba_tokenizer.py
  4. (可选)使用自己训练的FastText词向量,或其他工具训练的词向量

训练和测试

Rasa-NLU训练

python bot.py train-nlu
> INFO:rasa_nlu.training_data.loading:Training data format of data/nlu.json is rasa_nlu
> INFO:rasa_nlu.training_data.training_data:Training data stats: 
> 	- intent examples: 169 (13 distinct intents)
> 	- Found intents: 'inform_other_phone', 'inform_current_phone', 'unknown_intent', 'goodbye', 'thanks', 'inform_time', 'inform_item', 'greet', 'request_management', 'confirm', 'inform_package', 'deny', 'request_search'
> 	- entity examples: 102 (4 distinct entities)
> ...
> Part I: train segmenter
> ...
> Part II: train segment classifier

Rasa-NLU测试(API调用测试,可用于前端程序调用Rasa-NLU服务)

python -m rasa_nlu.server -c data/nlu_model_config.json --path models
curl -XPOST localhost:5000/parse -d '{"q":"你好", "project":"ivr", "model":"demo"}'

Rasa-Core训练

python bot.py train-dialogue

Rasa-Core测试(API调用测试,可用于前端程序调用ChatBot服务)

python -m rasa_core.server -p 5005 -d models/dialogue -u models/ivr/demo -o out.log
curl -XPOST localhost:5005/conversations/default/parse -d '{"query":"帮我查话费"}'
curl -XPOST localhost:5005/conversations/default/continue -d '{"executed_action": "utter_greet", "events": []}'

ChatBot测试(命令行直接跟ChatBot对话)

python bot.py run

ChatBot测试

ChatBot在线学习(命令行交互训练ChatBot对话)

python bot.py run online-train

ChatBot在线学习

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].