├── run.png ├── userdict └── dict.txt ├── online_train.png ├── data ├── nlu_model_config.json ├── domain.yml ├── stories.md └── nlu.json ├── models └── ivr │ └── demo │ └── metadata.json ├── README.md ├── jieba_tokenizer.py ├── bot.py └── LICENSE /run.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ma-Dan/rasa_bot/HEAD/run.png -------------------------------------------------------------------------------- /userdict/dict.txt: -------------------------------------------------------------------------------- 1 | 话费 100000 2 | 能不能 100000 3 | 这个月份 100000 4 | 办一个 100000 -------------------------------------------------------------------------------- /online_train.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ma-Dan/rasa_bot/HEAD/online_train.png -------------------------------------------------------------------------------- /data/nlu_model_config.json: -------------------------------------------------------------------------------- 1 | language: "zh" 2 | 3 | pipeline: 4 | - name: "nlp_spacy" 5 | model: "spacy/wiki_zh" 6 | - name: "tokenizer_jieba" 7 | dictionary_path: "userdict" 8 | - name: "intent_entity_featurizer_regex" 9 | - name: "intent_featurizer_spacy" 10 | - name: "ner_crf" 11 | - name: "ner_synonyms" 12 | - name: "ner_spacy" 13 | - name: "intent_classifier_tensorflow_embedding" 14 | -------------------------------------------------------------------------------- /models/ivr/demo/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "language": "zh", 3 | "pipeline": [ 4 | { 5 | "model": "spacy/wiki_zh", 6 | "case_sensitive": false, 7 | "name": "nlp_spacy", 8 | "class": "rasa_nlu.utils.spacy_utils.SpacyNLP" 9 | } 10 | ], 11 | "training_data": "training_data.json", 12 | "trained_at": "20181201-081257", 13 | "rasa_nlu_version": "0.13.8" 14 | } -------------------------------------------------------------------------------- /data/domain.yml: -------------------------------------------------------------------------------- 1 | slots: 2 | item: 3 | type: text 4 | time: 5 | type: text 6 | phone_number: 7 | type: text 8 | price: 9 | type: text 10 | 11 | intents: 12 | - greet 13 | - confirm 14 | - goodbye 15 | - thanks 16 | - inform_item 17 | - inform_package 18 | - inform_time 19 | - request_management 20 | - request_search 21 | - deny 22 | - inform_current_phone 23 | - inform_other_phone 24 | 25 | entities: 26 | - item 27 | - time 28 | - phone_number 29 | - price 30 | 31 | templates: 32 | utter_greet: 33 | - "您好!,我是机器人小热,很高兴为您服务。" 34 | - "你好!,我是小热,可以帮您办理流量套餐,话费查询等业务。" 35 | - "hi!,人家是小热,有什么可以帮您吗。" 36 | utter_goodbye: 37 | - "再见,为您服务很开心" 38 | - "Bye, 下次再见" 39 | utter_default: 40 | - "您说什么" 41 | - "您能再说一遍吗,我没听清" 42 | utter_thanks: 43 | - "不用谢" 44 | - "我应该做的" 45 | - "您开心我就开心" 46 | utter_ask_morehelp: 47 | - "还有什么能帮您吗" 48 | - "您还想干什么" 49 | utter_ask_time: 50 | - "你想查哪个时间段的" 51 | - "你想查几月份的" 52 | utter_ask_package: 53 | - "我们现在支持办理流量套餐:套餐一:二十元包月三十兆;套餐二:四十元包月八十兆,请问您需要哪个?" 54 | - "我们有如下套餐供您选择:套餐一:二十元包月三十兆;套餐二:四十元包月八十兆,请问您需要哪个?" 55 | utter_ack_management: 56 | - "已经为您办理好了{item}" 57 | 58 | actions: 59 | - utter_greet 60 | - utter_goodbye 61 | - utter_default 62 | - utter_thanks 63 | - utter_ask_morehelp 64 | - utter_ask_time 65 | - utter_ask_package 66 | - utter_ack_management 67 | - bot.ActionSearchConsume 68 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 整理:基于Rasa-NLU和Rasa-Core的任务型ChatBot 2 | 3 | ## 组件版本 4 | 1. Python 3 5 | 2. TensorFlow 1.8.0 6 | 3. Keras 2.2.2 7 | 4. jieba 0.39 8 | 5. msgpack 0.5.6 9 | 6. scikit-learn 0.19.1 10 | 7. sklearn_crfsuite 0.3.6 11 | 8. spacy 2.0.17 12 | 9. rasa-nlu 0.13.8 13 | 10. rasa-core 0.10.4 14 | 15 | ## 资料来源 16 | 1. FastText预训练词向量,wiki训练,有两个版本可以选择,这里选择wiki训练的尺寸较小的版本,下载地址[https://s3-us-west-1.amazonaws.com/fasttext-vectors/wiki.zh.vec](https://s3-us-west-1.amazonaws.com/fasttext-vectors/wiki.zh.vec) 17 | 2. rasa-nlu和rasa-core示例配置和语料 来自:[https://github.com/zqhZY/_rasa_chatbot](https://github.com/zqhZY/_rasa_chatbot) 18 | 这里仅整理为一个完整的包含NLU、Dialog训练和测试,ChatBot在线学习和使用的例子。 19 | 20 | ## 准备工作 21 | 1. git clone https://github.com/Ma-Dan/rasa_bot 22 | 2. 下载FastText预训练词向量[wiki.zh.vec](https://s3-us-west-1.amazonaws.com/fasttext-vectors/wiki.zh.vec) 23 | 下载后运行下列命令准备词向量 24 | python -m spacy init-model zh rasr_bot/spacy/wiki_zh --vectors-loc wiki.zh.vec 25 | 3. 当前版本rasa-nlu的jieba_tokenizer存在重复加载用户字典问题,使用[最新版](https://github.com/RasaHQ/rasa_nlu/raw/master/rasa_nlu/tokenizers/jieba_tokenizer.py)覆盖site-packages/rasa_nlu/tokenizers下的jieba_tokenizer.py 26 | 3. (可选)使用自己训练的FastText词向量,或其他工具训练的词向量 27 | 28 | ## 训练和测试 29 | ### Rasa-NLU训练 30 | ```shell 31 | python bot.py train-nlu 32 | > INFO:rasa_nlu.training_data.loading:Training data format of data/nlu.json is rasa_nlu 33 | > INFO:rasa_nlu.training_data.training_data:Training data stats: 34 | > - intent examples: 169 (13 distinct intents) 35 | > - 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' 36 | > - entity examples: 102 (4 distinct entities) 37 | > ... 38 | > Part I: train segmenter 39 | > ... 40 | > Part II: train segment classifier 41 | ``` 42 | ### Rasa-NLU测试(API调用测试,可用于前端程序调用Rasa-NLU服务) 43 | ```shell 44 | python -m rasa_nlu.server -c data/nlu_model_config.json --path models 45 | curl -XPOST localhost:5000/parse -d '{"q":"你好", "project":"ivr", "model":"demo"}' 46 | ``` 47 | ### Rasa-Core训练 48 | ```shell 49 | python bot.py train-dialogue 50 | ``` 51 | ### Rasa-Core测试(API调用测试,可用于前端程序调用ChatBot服务) 52 | ```shell 53 | python -m rasa_core.server -p 5005 -d models/dialogue -u models/ivr/demo -o out.log 54 | curl -XPOST localhost:5005/conversations/default/parse -d '{"query":"帮我查话费"}' 55 | curl -XPOST localhost:5005/conversations/default/continue -d '{"executed_action": "utter_greet", "events": []}' 56 | ``` 57 | ### ChatBot测试(命令行直接跟ChatBot对话) 58 | ```shell 59 | python bot.py run 60 | ``` 61 | ![ChatBot测试](./run.png) 62 | ### ChatBot在线学习(命令行交互训练ChatBot对话) 63 | ```shell 64 | python bot.py run online-train 65 | ``` 66 | ![ChatBot在线学习](./online_train.png) 67 | -------------------------------------------------------------------------------- /data/stories.md: -------------------------------------------------------------------------------- 1 | 2 | ## Generated Story 5914322956106259965 3 | * greet 4 | - utter_greet 5 | * request_search{"item": "\u7684\u60c5\u51b5"} 6 | - slot{"item": "\u6d88\u8d39"} 7 | - slot{"item": "\u7684\u60c5\u51b5"} 8 | - action_search_consume 9 | * request_search{"item": "\u6d88\u8d39"} 10 | - slot{"item": "\u6d88\u8d39"} 11 | - action_search_consume 12 | * inform_time{"time": "\u4e0a\u4e2a\u6708"} 13 | - slot{"time": "\u4e0a\u4e2a\u6708"} 14 | - action_search_consume 15 | - utter_ask_morehelp 16 | * deny 17 | - utter_goodbye 18 | - export 19 | 20 | ## Generated Story 1131691423643832225 21 | * request_search{"item": "\u6d88\u8d39"} 22 | - slot{"item": "\u6d88\u8d39"} 23 | - utter_ask_time 24 | * inform_time{"time": "\u5341\u6708\u4efd"} 25 | - slot{"time": "\u5341\u6708\u4efd"} 26 | - action_search_consume 27 | - utter_ask_morehelp 28 | * thanks 29 | - utter_thanks 30 | - export 31 | 32 | ## Generated Story -6529474466838218787 33 | * greet 34 | - utter_greet 35 | * request_search{"item": "\u6d88\u8d39"} 36 | - slot{"item": "\u6d88\u8d39"} 37 | - utter_ask_time 38 | * inform_time{"time": "\u4e0a\u6708"} 39 | - slot{"time": "\u4e0a\u6708"} 40 | - action_search_consume 41 | - utter_ask_morehelp 42 | * request_search{"time": "\u8fd8", "item": "\u6d88\u8d39"} 43 | - slot{"time": "\u8fd8"} 44 | - slot{"item": "\u6d88\u8d39"} 45 | - utter_ask_morehelp 46 | - utter_ask_time 47 | * inform_time{"time": "\u5341\u6708"} 48 | - slot{"time": "\u5341\u6708"} 49 | - action_search_consume 50 | - utter_ask_morehelp 51 | * deny 52 | - utter_goodbye 53 | * request_search{"time": "\u8fd8", "item": "\u6d41\u91cf"} 54 | - slot{"time": "\u8fd8"} 55 | - slot{"item": "\u6d41\u91cf"} 56 | - utter_ask_time 57 | * inform_time{"time": "\u516b\u6708"} 58 | - slot{"time": "\u516b\u6708"} 59 | - action_search_consume 60 | - utter_ask_morehelp 61 | * deny 62 | - utter_goodbye 63 | - utter_thanks 64 | * greet 65 | - utter_greet 66 | * goodbye 67 | - utter_goodbye 68 | - export 69 | 70 | ## Generated Story 7046379915386561772 71 | * request_search{"item": "\u6d41\u91cf"} 72 | - slot{"item": "\u6d41\u91cf"} 73 | - utter_ask_time 74 | * inform_time{"time": "\u4e0a\u4e2a\u6708"} 75 | - slot{"time": "\u4e0a\u4e2a\u6708"} 76 | - action_search_consume 77 | - utter_ask_morehelp 78 | * request_search{"item": "\u6d88\u8d39"} 79 | - slot{"item": "\u6d88\u8d39"} 80 | - utter_ask_time 81 | * inform_time{"time": "\u4e0a\u4e2a\u6708"} 82 | - slot{"time": "\u4e0a\u4e2a\u6708"} 83 | - action_search_consume 84 | - utter_ask_morehelp 85 | * request_search{"time": "\u8fd8", "item": "\u53f7\u7801"} 86 | - slot{"time": "\u8fd8"} 87 | - slot{"item": "\u6d88\u8d39"} 88 | - slot{"item": "\u53f7\u7801"} 89 | - utter_ask_time 90 | * inform_time{"time": "\u4e0a\u6708"} 91 | - slot{"time": "\u4e0a\u6708"} 92 | - action_search_consume 93 | - utter_ask_morehelp 94 | * confirm 95 | - utter_ask_morehelp 96 | * deny 97 | - utter_goodbye 98 | - export 99 | 100 | ## Generated Story 3510639764351215934 101 | * greet 102 | - utter_greet 103 | * request_search{"item": "\u4e1c\u897f"} 104 | - slot{"item": "\u4e1c\u897f"} 105 | - utter_ask_time 106 | * inform_time{"time": "\u4e09\u6708"} 107 | - slot{"time": "\u4e09\u6708"} 108 | - action_search_consume 109 | * request_search{"item": "\u6d41\u91cf"} 110 | - slot{"item": "\u6d41\u91cf"} 111 | - utter_ask_time 112 | * inform_time{"time": "\u56db\u6708"} 113 | - slot{"time": "\u56db\u6708"} 114 | - action_search_consume 115 | - utter_ask_morehelp 116 | * deny 117 | - utter_goodbye 118 | - export 119 | 120 | ## Generated Story -243931094327703933 121 | * request_management{"item": "\u5957\u9910"} 122 | - slot{"item": "\u5957\u9910"} 123 | - utter_ask_package 124 | * inform_package{"item": "\u5957\u9910\u4e09"} 125 | - slot{"item": "\u5957\u9910\u4e09"} 126 | - utter_ack_management 127 | - utter_ask_morehelp 128 | * request_search{"item": "\u6d88\u8d39"} 129 | - slot{"item": "\u6d88\u8d39"} 130 | - utter_ask_time 131 | * inform_time{"time": "\u4e09\u6708"} 132 | - slot{"time": "\u4e09\u6708"} 133 | - action_search_consume 134 | - utter_ask_morehelp 135 | * deny 136 | - utter_goodbye 137 | - export 138 | 139 | 140 | ## Generated Story -8627121140811593037 141 | * greet 142 | - utter_greet 143 | * request_management{"item": "\u6d41\u91cf"} 144 | - slot{"item": "\u6d41\u91cf"} 145 | - utter_ask_package 146 | * inform_package{"item": "\u5957\u9910\u4e00"} 147 | - slot{"item": "\u5957\u9910\u4e00"} 148 | - utter_ack_management 149 | - utter_ask_morehelp 150 | * deny 151 | - utter_goodbye 152 | * deny 153 | - utter_greet 154 | - export -------------------------------------------------------------------------------- /jieba_tokenizer.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | from __future__ import division 3 | from __future__ import print_function 4 | from __future__ import unicode_literals 5 | 6 | import glob 7 | import logging 8 | import os 9 | import shutil 10 | 11 | from rasa_nlu.components import Component 12 | from rasa_nlu.config import RasaNLUModelConfig 13 | from rasa_nlu.tokenizers import Tokenizer, Token 14 | from rasa_nlu.training_data import Message, TrainingData 15 | from typing import Any, List, Text 16 | 17 | logger = logging.getLogger(__name__) 18 | 19 | JIEBA_CUSTOM_DICTIONARY_PATH = "tokenizer_jieba" 20 | 21 | 22 | class JiebaTokenizer(Tokenizer, Component): 23 | name = "tokenizer_jieba" 24 | 25 | provides = ["tokens"] 26 | 27 | language_list = ["zh"] 28 | 29 | defaults = { 30 | "dictionary_path": None # default don't load custom dictionary 31 | } 32 | 33 | def __init__(self, component_config=None): 34 | # type: (Dict[Text, Any]) -> None 35 | """Construct a new intent classifier using the MITIE framework.""" 36 | 37 | super(JiebaTokenizer, self).__init__(component_config) 38 | 39 | # path to dictionary file or None 40 | self.dictionary_path = self.component_config.get('dictionary_path') 41 | 42 | # load dictionary 43 | if self.dictionary_path is not None: 44 | self.load_custom_dictionary(self.dictionary_path) 45 | 46 | @classmethod 47 | def required_packages(cls): 48 | # type: () -> List[Text] 49 | return ["jieba"] 50 | 51 | @staticmethod 52 | def load_custom_dictionary(path): 53 | # type: (Text) -> None 54 | """Load all the custom dictionaries stored in the path. 55 | 56 | More information about the dictionaries file format can 57 | be found in the documentation of jieba. 58 | https://github.com/fxsjy/jieba#load-dictionary 59 | """ 60 | import jieba 61 | 62 | jieba_userdicts = glob.glob("{}/*".format(path)) 63 | for jieba_userdict in jieba_userdicts: 64 | logger.info("Loading Jieba User Dictionary at " 65 | "{}".format(jieba_userdict)) 66 | jieba.load_userdict(jieba_userdict) 67 | 68 | def train(self, training_data, config, **kwargs): 69 | # type: (TrainingData, RasaNLUModelConfig, **Any) -> None 70 | for example in training_data.training_examples: 71 | example.set("tokens", self.tokenize(example.text)) 72 | 73 | def process(self, message, **kwargs): 74 | # type: (Message, **Any) -> None 75 | message.set("tokens", self.tokenize(message.text)) 76 | 77 | def tokenize(self, text): 78 | # type: (Text) -> List[Token] 79 | import jieba 80 | 81 | tokenized = jieba.tokenize(text) 82 | tokens = [Token(word, start) for (word, start, end) in tokenized] 83 | return tokens 84 | 85 | @classmethod 86 | def load(cls, 87 | model_dir=None, # type: Optional[Text] 88 | model_metadata=None, # type: Optional[Metadata] 89 | cached_component=None, # type: Optional[Component] 90 | **kwargs # type: **Any 91 | ): 92 | # type: (...) -> JiebaTokenizer 93 | 94 | meta = model_metadata.for_component(cls.name) 95 | relative_dictionary_path = meta.get("dictionary_path") 96 | 97 | # get real path of dictionary path, if any 98 | if relative_dictionary_path is not None: 99 | dictionary_path = os.path.join(model_dir, relative_dictionary_path) 100 | 101 | meta["dictionary_path"] = dictionary_path 102 | 103 | return cls(meta) 104 | 105 | @staticmethod 106 | def copy_files_dir_to_dir(input_dir, output_dir): 107 | # make sure target path exists 108 | if not os.path.exists(output_dir): 109 | os.makedirs(output_dir) 110 | 111 | target_file_list = glob.glob("{}/*".format(input_dir)) 112 | for target_file in target_file_list: 113 | shutil.copy2(target_file, output_dir) 114 | 115 | def persist(self, model_dir): 116 | # type: (Text) -> Optional[Dict[Text, Any]] 117 | """Persist this model into the passed directory.""" 118 | 119 | model_dictionary_path = None 120 | 121 | # copy custom dictionaries to model dir, if any 122 | if self.dictionary_path is not None: 123 | target_dictionary_path = os.path.join(model_dir, 124 | JIEBA_CUSTOM_DICTIONARY_PATH) 125 | self.copy_files_dir_to_dir(self.dictionary_path, 126 | target_dictionary_path) 127 | 128 | # set dictionary_path of model metadata to relative path 129 | model_dictionary_path = JIEBA_CUSTOM_DICTIONARY_PATH 130 | 131 | return {"dictionary_path": model_dictionary_path} 132 | -------------------------------------------------------------------------------- /bot.py: -------------------------------------------------------------------------------- 1 | # -*- coding: UTF-8 -*- 2 | from __future__ import absolute_import 3 | from __future__ import division 4 | from __future__ import print_function 5 | from __future__ import unicode_literals 6 | 7 | import argparse 8 | import logging 9 | import warnings 10 | 11 | from rasa_core.actions import Action 12 | from rasa_core.agent import Agent 13 | from rasa_core.channels.console import ConsoleInputChannel 14 | from rasa_core.events import SlotSet 15 | from rasa_core.interpreter import RasaNLUInterpreter 16 | from rasa_core.policies.keras_policy import KerasPolicy 17 | from rasa_core.policies.memoization import MemoizationPolicy 18 | 19 | logger = logging.getLogger(__name__) 20 | 21 | support_search = ["话费", "流量"] 22 | 23 | 24 | def extract_item(item): 25 | """ 26 | check if item supported, this func just for lack of train data. 27 | :param item: item in track, eg: "流量"、"查流量" 28 | :return: 29 | """ 30 | if item is None: 31 | return None 32 | for name in support_search: 33 | if name in item: 34 | return name 35 | return None 36 | 37 | 38 | class ActionSearchConsume(Action): 39 | def name(self): 40 | return 'action_search_consume' 41 | 42 | def run(self, dispatcher, tracker, domain): 43 | item = tracker.get_slot("item") 44 | item = extract_item(item) 45 | if item is None: 46 | dispatcher.utter_message("您好,我现在只会查话费和流量") 47 | dispatcher.utter_message("你可以这样问我:“帮我查话费”") 48 | return [] 49 | 50 | time = tracker.get_slot("time") 51 | if time is None: 52 | dispatcher.utter_message("您想查询哪个月的话费?") 53 | return [] 54 | # query database here using item and time as key. but you may normalize time format first. 55 | dispatcher.utter_message("好,请稍等") 56 | if item == "流量": 57 | dispatcher.utter_message("您好,您{}共使用{}二百八十兆,剩余三十兆。".format(time, item)) 58 | else: 59 | dispatcher.utter_message("您好,您{}共消费二十八元。".format(time)) 60 | return [] 61 | 62 | 63 | class MobilePolicy(KerasPolicy): 64 | def model_architecture(self, num_features, num_actions, max_history_len): 65 | """Build a Keras model and return a compiled model.""" 66 | from keras.layers import LSTM, Activation, Masking, Dense 67 | from keras.models import Sequential 68 | 69 | n_hidden = 32 # size of hidden layer in LSTM 70 | # Build Model 71 | batch_shape = (None, max_history_len, num_features) 72 | 73 | model = Sequential() 74 | model.add(Masking(-1, batch_input_shape=batch_shape)) 75 | model.add(LSTM(n_hidden, batch_input_shape=batch_shape)) 76 | model.add(Dense(input_dim=n_hidden, output_dim=num_actions)) 77 | model.add(Activation("softmax")) 78 | 79 | model.compile(loss="categorical_crossentropy", 80 | optimizer="adam", 81 | metrics=["accuracy"]) 82 | 83 | logger.debug(model.summary()) 84 | return model 85 | 86 | 87 | def train_nlu(): 88 | from rasa_nlu.training_data import load_data 89 | from rasa_nlu.config import RasaNLUModelConfig 90 | from rasa_nlu.model import Trainer 91 | from rasa_nlu import config 92 | 93 | training_data = load_data("data/nlu.json") 94 | trainer = Trainer(config.load("data/nlu_model_config.json")) 95 | trainer.train(training_data) 96 | model_directory = trainer.persist("models/", project_name="ivr", fixed_model_name="demo") 97 | 98 | return model_directory 99 | 100 | 101 | def train_dialogue(domain_file="data/domain.yml", 102 | model_path="models/dialogue", 103 | training_data_file="data/stories.md"): 104 | from rasa_core.featurizers import (MaxHistoryTrackerFeaturizer, 105 | BinarySingleStateFeaturizer) 106 | featurizer = MaxHistoryTrackerFeaturizer(BinarySingleStateFeaturizer(), max_history=5) 107 | agent = Agent(domain_file, 108 | policies=[MemoizationPolicy(max_history=5), KerasPolicy(featurizer)]) 109 | 110 | agent.train( 111 | training_data_file, 112 | epochs=200, 113 | batch_size=16, 114 | augmentation_factor=50, 115 | validation_split=0.2 116 | ) 117 | 118 | agent.persist(model_path) 119 | return agent 120 | 121 | def run_ivrbot_online(input_channel=ConsoleInputChannel(), 122 | interpreter=RasaNLUInterpreter("models/ivr/demo"), 123 | domain_file="data/domain.yml", 124 | training_data_file="data/stories.md"): 125 | from rasa_core.featurizers import (MaxHistoryTrackerFeaturizer, 126 | BinarySingleStateFeaturizer) 127 | featurizer = MaxHistoryTrackerFeaturizer(BinarySingleStateFeaturizer(), max_history=5) 128 | agent = Agent(domain_file, 129 | policies=[MemoizationPolicy(max_history=5), KerasPolicy(featurizer)], 130 | interpreter=interpreter) 131 | 132 | agent.train_online(training_data_file, 133 | input_channel=input_channel, 134 | batch_size=50, 135 | epochs=200, 136 | max_training_samples=300) 137 | 138 | return agent 139 | 140 | 141 | def run(serve_forever=True): 142 | agent = Agent.load("models/dialogue", 143 | interpreter=RasaNLUInterpreter("models/ivr/demo")) 144 | 145 | if serve_forever: 146 | agent.handle_channel(ConsoleInputChannel()) 147 | return agent 148 | 149 | 150 | if __name__ == "__main__": 151 | logging.basicConfig(level="INFO") 152 | 153 | parser = argparse.ArgumentParser( 154 | description="starts the bot") 155 | 156 | parser.add_argument( 157 | "task", 158 | choices=["train-nlu", "train-dialogue", "run", "online-train"], 159 | help="what the bot should do - e.g. run or train?") 160 | task = parser.parse_args().task 161 | 162 | # decide what to do based on first parameter of the script 163 | if task == "train-nlu": 164 | train_nlu() 165 | elif task == "train-dialogue": 166 | train_dialogue() 167 | elif task == "run": 168 | run() 169 | elif task == "online-train": 170 | run_ivrbot_online() 171 | else: 172 | warnings.warn("Need to pass either 'train-nlu', 'train-dialogue', 'run' or 'online-train' to use the script.") 173 | exit(1) 174 | 175 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /data/nlu.json: -------------------------------------------------------------------------------- 1 | { 2 | "rasa_nlu_data": { 3 | "common_examples": [ 4 | { 5 | "text": "帮我查一下我的流量有多少", 6 | "intent": "request_search", 7 | "entities": [ 8 | { 9 | "start": 7, 10 | "end": 9, 11 | "value": "流量", 12 | "entity": "item" 13 | } 14 | ] 15 | }, 16 | { 17 | "text": "帮我查一下我的流量这里还有多少", 18 | "intent": "request_search", 19 | "entities": [ 20 | { 21 | "start": 7, 22 | "end": 9, 23 | "value": "流量", 24 | "entity": "item" 25 | } 26 | ] 27 | }, 28 | { 29 | "text": "帮我查一下我一个月消费多少", 30 | "intent": "request_search", 31 | "entities": [ 32 | { 33 | "start": 9, 34 | "end": 11, 35 | "value": "话费", 36 | "entity": "item" 37 | } 38 | ] 39 | }, 40 | { 41 | "text": "查话费", 42 | "intent": "request_search", 43 | "entities": [ 44 | { 45 | "start": 1, 46 | "end": 3, 47 | "value": "话费", 48 | "entity": "item" 49 | } 50 | ] 51 | }, 52 | { 53 | "text": "帮我查一下我月租多少", 54 | "intent": "request_search", 55 | "entities": [ 56 | { 57 | "start": 6, 58 | "end": 8, 59 | "value": "月租", 60 | "entity": "item" 61 | } 62 | ] 63 | }, 64 | { 65 | "text": "帮我看一下这个手机的那个流量", 66 | "intent": "request_search", 67 | "entities": [ 68 | { 69 | "start": 12, 70 | "end": 14, 71 | "value": "流量", 72 | "entity": "item" 73 | } 74 | ] 75 | }, 76 | { 77 | "text": "我想问一下我是用了多少话费", 78 | "intent": "request_search", 79 | "entities": [ 80 | { 81 | "start": 11, 82 | "end": 13, 83 | "value": "话费", 84 | "entity": "item" 85 | } 86 | ] 87 | }, 88 | { 89 | "text": "帮我查一下看看我剩有多少流量", 90 | "intent": "request_search", 91 | "entities": [ 92 | { 93 | "start": 12, 94 | "end": 14, 95 | "value": "流量", 96 | "entity": "item" 97 | } 98 | ] 99 | }, 100 | { 101 | "text": "我现在还有多少话费余额啊", 102 | "intent": "request_search", 103 | "entities": [ 104 | { 105 | "start": 9, 106 | "end": 11, 107 | "value": "余额", 108 | "entity": "item" 109 | } 110 | ] 111 | }, 112 | { 113 | "text": "查一下话费余额", 114 | "intent": "request_search", 115 | "entities": [ 116 | { 117 | "start": 5, 118 | "end": 7, 119 | "value": "余额", 120 | "entity": "item" 121 | } 122 | ] 123 | }, 124 | { 125 | "text": "我那个流量还有多少", 126 | "intent": "request_search", 127 | "entities": [ 128 | { 129 | "start": 3, 130 | "end": 5, 131 | "value": "流量", 132 | "entity": "item" 133 | } 134 | ] 135 | }, 136 | { 137 | "text": "你好查下我这个流量有多少啊", 138 | "intent": "request_search", 139 | "entities": [ 140 | { 141 | "start": 7, 142 | "end": 9, 143 | "value": "流量", 144 | "entity": "item" 145 | } 146 | ] 147 | }, 148 | { 149 | "text": "喂你好你帮我查看一下我的流量", 150 | "intent": "request_search", 151 | "entities": [ 152 | { 153 | "start": 12, 154 | "end": 14, 155 | "value": "流量", 156 | "entity": "item" 157 | } 158 | ] 159 | }, 160 | { 161 | "text": "帮我查一下我上个月的流量有多少", 162 | "intent": "request_search", 163 | "entities": [ 164 | { 165 | "start": 10, 166 | "end": 12, 167 | "value": "流量", 168 | "entity": "item" 169 | }, 170 | { 171 | "start": 6, 172 | "end": 9, 173 | "value": "上个月", 174 | "entity": "time" 175 | } 176 | ] 177 | }, 178 | { 179 | "text": "恩你好啊给我查查我的流量", 180 | "intent": "request_search", 181 | "entities": [ 182 | { 183 | "start": 10, 184 | "end": 12, 185 | "value": "流量", 186 | "entity": "item" 187 | } 188 | ] 189 | }, 190 | { 191 | "text": "嗯你好啊给我查查我的流量", 192 | "intent": "request_search", 193 | "entities": [ 194 | { 195 | "start": 10, 196 | "end": 12, 197 | "value": "流量", 198 | "entity": "item" 199 | } 200 | ] 201 | }, 202 | { 203 | "text": "恩你好啊给我查查我话费的使用情况", 204 | "intent": "request_search", 205 | "entities": [ 206 | { 207 | "start": 9, 208 | "end": 11, 209 | "value": "话费", 210 | "entity": "item" 211 | } 212 | ] 213 | }, 214 | { 215 | "text": "我想看一下话费", 216 | "intent": "request_search", 217 | "entities": [ 218 | { 219 | "start": 5, 220 | "end": 7, 221 | "value": "话费", 222 | "entity": "item" 223 | } 224 | ] 225 | }, 226 | { 227 | "text": "你给我查下我的月消费情况", 228 | "intent": "request_search", 229 | "entities": [ 230 | { 231 | "start": 8, 232 | "end": 10, 233 | "value": "话费", 234 | "entity": "item" 235 | } 236 | ] 237 | }, 238 | { 239 | "text": "我的话费还剩多少", 240 | "intent": "request_search", 241 | "entities": [ 242 | { 243 | "start": 2, 244 | "end": 4, 245 | "value": "话费", 246 | "entity": "item" 247 | } 248 | ] 249 | }, 250 | { 251 | "text": "能不能看下我还剩多少钱", 252 | "intent": "request_search", 253 | "entities": [ 254 | { 255 | "start": 10, 256 | "end": 11, 257 | "value": "钱", 258 | "entity": "item" 259 | } 260 | ] 261 | }, 262 | { 263 | "text": "那个我的话费还有多少", 264 | "intent": "request_search", 265 | "entities": [ 266 | { 267 | "start": 4, 268 | "end": 6, 269 | "value": "话费", 270 | "entity": "item" 271 | } 272 | ] 273 | }, 274 | { 275 | "text": "你能给我看下我消费多少了吗", 276 | "intent": "request_search", 277 | "entities": [ 278 | { 279 | "start": 7, 280 | "end": 9, 281 | "value": "话费", 282 | "entity": "item" 283 | } 284 | ] 285 | }, 286 | { 287 | "text": "我想知道我的这个月的话费嗯嗯", 288 | "intent": "request_search", 289 | "entities": [ 290 | { 291 | "start": 10, 292 | "end": 12, 293 | "value": "话费", 294 | "entity": "item" 295 | } 296 | ] 297 | }, 298 | { 299 | "text": "你给我说我的消费多少", 300 | "intent": "request_search", 301 | "entities": [ 302 | { 303 | "start": 6, 304 | "end": 8, 305 | "value": "话费", 306 | "entity": "item" 307 | } 308 | ] 309 | }, 310 | { 311 | "text": "帮我看一下我上个月消费多少", 312 | "intent": "request_search", 313 | "entities": [ 314 | { 315 | "start": 9, 316 | "end": 11, 317 | "value": "话费", 318 | "entity": "item" 319 | }, 320 | { 321 | "start": 6, 322 | "end": 9, 323 | "value": "上个月", 324 | "entity": "time" 325 | } 326 | ] 327 | }, 328 | { 329 | "text": "帮我查一下我这个月消费多少", 330 | "intent": "request_search", 331 | "entities": [ 332 | { 333 | "start": 9, 334 | "end": 11, 335 | "value": "话费", 336 | "entity": "item" 337 | }, 338 | { 339 | "start": 6, 340 | "end": 9, 341 | "value": "这个月", 342 | "entity": "time" 343 | } 344 | ] 345 | }, 346 | { 347 | "text": "我想问一下我这个月是用了多少话费", 348 | "intent": "request_search", 349 | "entities": [ 350 | { 351 | "start": 14, 352 | "end": 16, 353 | "value": "话费", 354 | "entity": "item" 355 | }, 356 | { 357 | "start": 6, 358 | "end": 9, 359 | "value": "这个月", 360 | "entity": "time" 361 | } 362 | ] 363 | }, 364 | { 365 | "text": "我现在还有多少话费余额啊", 366 | "intent": "request_search", 367 | "entities": [ 368 | { 369 | "start": 9, 370 | "end": 11, 371 | "value": "余额", 372 | "entity": "item" 373 | }, 374 | { 375 | "start": 1, 376 | "end": 3, 377 | "value": "现在", 378 | "entity": "time" 379 | } 380 | ] 381 | }, 382 | { 383 | "text": "你好查下我这个月流量有多少啊", 384 | "intent": "request_search", 385 | "entities": [ 386 | { 387 | "start": 8, 388 | "end": 10, 389 | "value": "流量", 390 | "entity": "item" 391 | }, 392 | { 393 | "start": 5, 394 | "end": 8, 395 | "value": "这个月", 396 | "entity": "time" 397 | } 398 | ] 399 | }, 400 | { 401 | "text": "喂你好你帮我查看一下这个本月我的流量", 402 | "intent": "request_search", 403 | "entities": [ 404 | { 405 | "start": 16, 406 | "end": 18, 407 | "value": "流量", 408 | "entity": "item" 409 | }, 410 | { 411 | "start": 12, 412 | "end": 14, 413 | "value": "本月", 414 | "entity": "time" 415 | } 416 | ] 417 | }, 418 | { 419 | "text": "帮我查一下我十二月的流量有多少", 420 | "intent": "request_search", 421 | "entities": [ 422 | { 423 | "start": 10, 424 | "end": 12, 425 | "value": "流量", 426 | "entity": "item" 427 | }, 428 | { 429 | "start": 6, 430 | "end": 9, 431 | "value": "十二月", 432 | "entity": "time" 433 | } 434 | ] 435 | }, 436 | { 437 | "text": "帮我看一下我十二月消费多少", 438 | "intent": "request_search", 439 | "entities": [ 440 | { 441 | "start": 9, 442 | "end": 11, 443 | "value": "话费", 444 | "entity": "item" 445 | }, 446 | { 447 | "start": 6, 448 | "end": 9, 449 | "value": "十二月", 450 | "entity": "time" 451 | } 452 | ] 453 | }, 454 | { 455 | "text": "帮我查一下我十二月消费多少", 456 | "intent": "request_search", 457 | "entities": [ 458 | { 459 | "start": 9, 460 | "end": 11, 461 | "value": "话费", 462 | "entity": "item" 463 | }, 464 | { 465 | "start": 6, 466 | "end": 9, 467 | "value": "十二月", 468 | "entity": "time" 469 | } 470 | ] 471 | }, 472 | { 473 | "text": "我想问一下我十二月是用了多少话费", 474 | "intent": "request_search", 475 | "entities": [ 476 | { 477 | "start": 14, 478 | "end": 16, 479 | "value": "话费", 480 | "entity": "item" 481 | }, 482 | { 483 | "start": 6, 484 | "end": 9, 485 | "value": "十二月", 486 | "entity": "time" 487 | } 488 | ] 489 | }, 490 | { 491 | "text": "你好查下我十二月流量有多少啊", 492 | "intent": "request_search", 493 | "entities": [ 494 | { 495 | "start": 8, 496 | "end": 10, 497 | "value": "流量", 498 | "entity": "item" 499 | }, 500 | { 501 | "start": 5, 502 | "end": 8, 503 | "value": "十二月", 504 | "entity": "time" 505 | } 506 | ] 507 | }, 508 | { 509 | "text": "喂你好你帮我查看一下这个十二月我的流量", 510 | "intent": "request_search", 511 | "entities": [ 512 | { 513 | "start": 17, 514 | "end": 19, 515 | "value": "流量", 516 | "entity": "item" 517 | }, 518 | { 519 | "start": 12, 520 | "end": 15, 521 | "value": "十二月", 522 | "entity": "time" 523 | } 524 | ] 525 | }, 526 | { 527 | "text": "帮我查一下我六月的流量有多少", 528 | "intent": "request_search", 529 | "entities": [ 530 | { 531 | "start": 9, 532 | "end": 11, 533 | "value": "流量", 534 | "entity": "item" 535 | }, 536 | { 537 | "start": 6, 538 | "end": 8, 539 | "value": "六月", 540 | "entity": "time" 541 | } 542 | ] 543 | }, 544 | { 545 | "text": "帮我看一下我六月消费多少", 546 | "intent": "request_search", 547 | "entities": [ 548 | { 549 | "start": 8, 550 | "end": 10, 551 | "value": "话费", 552 | "entity": "item" 553 | }, 554 | { 555 | "start": 6, 556 | "end": 8, 557 | "value": "六月", 558 | "entity": "time" 559 | } 560 | ] 561 | }, 562 | { 563 | "text": "帮我查一下我六月消费多少", 564 | "intent": "request_search", 565 | "entities": [ 566 | { 567 | "start": 8, 568 | "end": 10, 569 | "value": "话费", 570 | "entity": "item" 571 | }, 572 | { 573 | "start": 6, 574 | "end": 8, 575 | "value": "六月", 576 | "entity": "time" 577 | } 578 | ] 579 | }, 580 | { 581 | "text": "我想问一下我六月是用了多少话费", 582 | "intent": "request_search", 583 | "entities": [ 584 | { 585 | "start": 13, 586 | "end": 15, 587 | "value": "话费", 588 | "entity": "item" 589 | }, 590 | { 591 | "start": 6, 592 | "end": 8, 593 | "value": "六月", 594 | "entity": "time" 595 | } 596 | ] 597 | }, 598 | { 599 | "text": "你好查下我六月流量有多少啊", 600 | "intent": "request_search", 601 | "entities": [ 602 | { 603 | "start": 7, 604 | "end": 9, 605 | "value": "流量", 606 | "entity": "item" 607 | }, 608 | { 609 | "start": 5, 610 | "end": 7, 611 | "value": "六月", 612 | "entity": "time" 613 | } 614 | ] 615 | }, 616 | { 617 | "text": "喂你好你帮我查看一下这个六月我的流量", 618 | "intent": "request_search", 619 | "entities": [ 620 | { 621 | "start": 16, 622 | "end": 18, 623 | "value": "流量", 624 | "entity": "item" 625 | }, 626 | { 627 | "start": 12, 628 | "end": 14, 629 | "value": "六月", 630 | "entity": "time" 631 | } 632 | ] 633 | }, 634 | { 635 | "text": "帮我查一下我三月的流量有多少", 636 | "intent": "request_search", 637 | "entities": [ 638 | { 639 | "start": 9, 640 | "end": 11, 641 | "value": "流量", 642 | "entity": "item" 643 | }, 644 | { 645 | "start": 6, 646 | "end": 8, 647 | "value": "三月", 648 | "entity": "time" 649 | } 650 | ] 651 | }, 652 | { 653 | "text": "帮我看一下我一月消费多少", 654 | "intent": "request_search", 655 | "entities": [ 656 | { 657 | "start": 8, 658 | "end": 10, 659 | "value": "话费", 660 | "entity": "item" 661 | }, 662 | { 663 | "start": 6, 664 | "end": 8, 665 | "value": "一月", 666 | "entity": "time" 667 | } 668 | ] 669 | }, 670 | { 671 | "text": "帮我查一下我一月消费多少", 672 | "intent": "request_search", 673 | "entities": [ 674 | { 675 | "start": 8, 676 | "end": 10, 677 | "value": "话费", 678 | "entity": "item" 679 | }, 680 | { 681 | "start": 6, 682 | "end": 8, 683 | "value": "一月", 684 | "entity": "time" 685 | } 686 | ] 687 | }, 688 | { 689 | "text": "我想问一下我一月是用了多少话费", 690 | "intent": "request_search", 691 | "entities": [ 692 | { 693 | "start": 13, 694 | "end": 15, 695 | "value": "话费", 696 | "entity": "item" 697 | }, 698 | { 699 | "start": 6, 700 | "end": 8, 701 | "value": "一月", 702 | "entity": "time" 703 | } 704 | ] 705 | }, 706 | { 707 | "text": "你好查下我二月的流量有多少啊", 708 | "intent": "request_search", 709 | "entities": [ 710 | { 711 | "start": 8, 712 | "end": 10, 713 | "value": "流量", 714 | "entity": "item" 715 | }, 716 | { 717 | "start": 5, 718 | "end": 7, 719 | "value": "二月", 720 | "entity": "time" 721 | } 722 | ] 723 | }, 724 | { 725 | "text": "喂你好你帮我查看一下这个一月我的流量", 726 | "intent": "request_search", 727 | "entities": [ 728 | { 729 | "start": 16, 730 | "end": 18, 731 | "value": "流量", 732 | "entity": "item" 733 | }, 734 | { 735 | "start": 12, 736 | "end": 14, 737 | "value": "一月", 738 | "entity": "time" 739 | } 740 | ] 741 | }, 742 | { 743 | "text": "你帮我查看一下一月我的流量", 744 | "intent": "request_search", 745 | "entities": [ 746 | { 747 | "start": 11, 748 | "end": 13, 749 | "value": "流量", 750 | "entity": "item" 751 | }, 752 | { 753 | "start": 7, 754 | "end": 9, 755 | "value": "一月", 756 | "entity": "time" 757 | } 758 | ] 759 | }, 760 | { 761 | "text": "恩你好啊给我查查我当月的流量", 762 | "intent": "request_search", 763 | "entities": [ 764 | { 765 | "start": 12, 766 | "end": 14, 767 | "value": "流量", 768 | "entity": "item" 769 | }, 770 | { 771 | "start": 9, 772 | "end": 11, 773 | "value": "当月", 774 | "entity": "time" 775 | } 776 | ] 777 | }, 778 | { 779 | "text": "嗯你好啊给我查查我这个月的流量", 780 | "intent": "request_search", 781 | "entities": [ 782 | { 783 | "start": 13, 784 | "end": 15, 785 | "value": "流量", 786 | "entity": "item" 787 | }, 788 | { 789 | "start": 9, 790 | "end": 12, 791 | "value": "这个月", 792 | "entity": "time" 793 | } 794 | ] 795 | }, 796 | { 797 | "text": "恩你好啊给我查查我话费的使用情况这个月的", 798 | "intent": "request_search", 799 | "entities": [ 800 | { 801 | "start": 9, 802 | "end": 11, 803 | "value": "话费", 804 | "entity": "item" 805 | }, 806 | { 807 | "start": 16, 808 | "end": 19, 809 | "value": "这个月", 810 | "entity": "time" 811 | } 812 | ] 813 | }, 814 | { 815 | "text": "我想看一下这个月份的话费", 816 | "intent": "request_search", 817 | "entities": [ 818 | { 819 | "start": 10, 820 | "end": 12, 821 | "value": "话费", 822 | "entity": "item" 823 | }, 824 | { 825 | "start": 5, 826 | "end": 9, 827 | "value": "这个月份", 828 | "entity": "time" 829 | } 830 | ] 831 | }, 832 | { 833 | "text": "能不能看下我这个月的还剩多少钱", 834 | "intent": "request_search", 835 | "entities": [ 836 | { 837 | "start": 14, 838 | "end": 15, 839 | "value": "钱", 840 | "entity": "item" 841 | }, 842 | { 843 | "start": 6, 844 | "end": 9, 845 | "value": "这个月", 846 | "entity": "time" 847 | } 848 | ] 849 | }, 850 | { 851 | "text": "那个我的话费还有多少这个月", 852 | "intent": "request_search", 853 | "entities": [ 854 | { 855 | "start": 4, 856 | "end": 6, 857 | "value": "话费", 858 | "entity": "item" 859 | }, 860 | { 861 | "start": 10, 862 | "end": 13, 863 | "value": "这个月", 864 | "entity": "time" 865 | } 866 | ] 867 | }, 868 | { 869 | "text": "你能给我看下我三月份消费多少了吗", 870 | "intent": "request_search", 871 | "entities": [ 872 | { 873 | "start": 7, 874 | "end": 10, 875 | "value": "三月份", 876 | "entity": "time" 877 | } 878 | ] 879 | }, 880 | { 881 | "text": "我想知道我的这个月的话费嗯嗯", 882 | "intent": "request_search", 883 | "entities": [ 884 | { 885 | "start": 10, 886 | "end": 12, 887 | "value": "话费", 888 | "entity": "item" 889 | }, 890 | { 891 | "start": 6, 892 | "end": 9, 893 | "value": "这个月", 894 | "entity": "time" 895 | } 896 | ] 897 | }, 898 | { 899 | "text": "你能给我看下我三月份的消费多少了吗", 900 | "intent": "request_search", 901 | "entities": [ 902 | { 903 | "start": 7, 904 | "end": 10, 905 | "value": "三月份", 906 | "entity": "time" 907 | } 908 | ] 909 | }, 910 | { 911 | "text": "我想问一下我一月份是用了多少话费", 912 | "intent": "request_search", 913 | "entities": [ 914 | { 915 | "start": 14, 916 | "end": 16, 917 | "value": "话费", 918 | "entity": "item" 919 | }, 920 | { 921 | "start": 6, 922 | "end": 9, 923 | "value": "一月份", 924 | "entity": "time" 925 | } 926 | ] 927 | }, 928 | { 929 | "text": "帮我查一下我的三月的消费多少", 930 | "intent": "request_search", 931 | "entities": [ 932 | { 933 | "start": 10, 934 | "end": 12, 935 | "value": "话费", 936 | "entity": "item" 937 | }, 938 | { 939 | "start": 7, 940 | "end": 9, 941 | "value": "三月", 942 | "entity": "time" 943 | } 944 | ] 945 | }, 946 | { 947 | "text": "帮我查一下我的三月份的消费多少", 948 | "intent": "request_search", 949 | "entities": [ 950 | { 951 | "start": 11, 952 | "end": 13, 953 | "value": "话费", 954 | "entity": "item" 955 | }, 956 | { 957 | "start": 7, 958 | "end": 10, 959 | "value": "三月份", 960 | "entity": "time" 961 | } 962 | ] 963 | }, 964 | { 965 | "text": "查下我三月份的用了多少钱", 966 | "intent": "request_search", 967 | "entities": [ 968 | { 969 | "start": 11, 970 | "end": 12, 971 | "value": "钱", 972 | "entity": "item" 973 | }, 974 | { 975 | "start": 3, 976 | "end": 6, 977 | "value": "三月份", 978 | "entity": "time" 979 | } 980 | ] 981 | }, 982 | { 983 | "text": "那个请问我三月份的一共消费多少", 984 | "intent": "request_search", 985 | "entities": [ 986 | { 987 | "start": 11, 988 | "end": 13, 989 | "value": "话费", 990 | "entity": "item" 991 | }, 992 | { 993 | "start": 5, 994 | "end": 8, 995 | "value": "三月份", 996 | "entity": "time" 997 | } 998 | ] 999 | }, 1000 | { 1001 | "text": "请帮我查一下18810397783的话费", 1002 | "intent": "request_search", 1003 | "entities": [ 1004 | { 1005 | "start": 18, 1006 | "end": 20, 1007 | "value": "话费", 1008 | "entity": "item" 1009 | }, 1010 | { 1011 | "start": 6, 1012 | "end": 17, 1013 | "value": "18810397783", 1014 | "entity": "phone_number" 1015 | } 1016 | ] 1017 | }, 1018 | { 1019 | "text": "请帮我查一下110的话费", 1020 | "intent": "request_search", 1021 | "entities": [ 1022 | { 1023 | "start": 10, 1024 | "end": 12, 1025 | "value": "话费", 1026 | "entity": "item" 1027 | }, 1028 | { 1029 | "start": 6, 1030 | "end": 9, 1031 | "value": "110", 1032 | "entity": "phone_number" 1033 | } 1034 | ] 1035 | }, 1036 | { 1037 | "text": "一月", 1038 | "intent": "inform_time", 1039 | "entities": [ 1040 | { 1041 | "start": 0, 1042 | "end": 2, 1043 | "value": "一月", 1044 | "entity": "time" 1045 | } 1046 | ] 1047 | }, 1048 | { 1049 | "text": "一月的", 1050 | "intent": "inform_time", 1051 | "entities": [ 1052 | { 1053 | "start": 0, 1054 | "end": 2, 1055 | "value": "一月", 1056 | "entity": "time" 1057 | } 1058 | ] 1059 | }, 1060 | { 1061 | "text": "是一月的", 1062 | "intent": "inform_time", 1063 | "entities": [ 1064 | { 1065 | "start": 1, 1066 | "end": 3, 1067 | "value": "一月", 1068 | "entity": "time" 1069 | } 1070 | ] 1071 | }, 1072 | { 1073 | "text": "一月", 1074 | "intent": "inform_time", 1075 | "entities": [ 1076 | { 1077 | "start": 0, 1078 | "end": 2, 1079 | "value": "一月", 1080 | "entity": "time" 1081 | } 1082 | ] 1083 | }, 1084 | { 1085 | "text": "上月的", 1086 | "intent": "inform_time", 1087 | "entities": [ 1088 | { 1089 | "start": 0, 1090 | "end": 2, 1091 | "value": "上月", 1092 | "entity": "time" 1093 | } 1094 | ] 1095 | }, 1096 | { 1097 | "text": "上个月的", 1098 | "intent": "inform_time", 1099 | "entities": [ 1100 | { 1101 | "start": 0, 1102 | "end": 3, 1103 | "value": "上个月", 1104 | "entity": "time" 1105 | } 1106 | ] 1107 | }, 1108 | { 1109 | "text": "二月", 1110 | "intent": "inform_time", 1111 | "entities": [ 1112 | { 1113 | "start": 0, 1114 | "end": 2, 1115 | "value": "二月", 1116 | "entity": "time" 1117 | } 1118 | ] 1119 | }, 1120 | { 1121 | "text": "二月的", 1122 | "intent": "inform_time", 1123 | "entities": [ 1124 | { 1125 | "start": 0, 1126 | "end": 2, 1127 | "value": "二月", 1128 | "entity": "time" 1129 | } 1130 | ] 1131 | }, 1132 | { 1133 | "text": "是二月的", 1134 | "intent": "inform_time", 1135 | "entities": [ 1136 | { 1137 | "start": 1, 1138 | "end": 3, 1139 | "value": "二月", 1140 | "entity": "time" 1141 | } 1142 | ] 1143 | }, 1144 | { 1145 | "text": "二月", 1146 | "intent": "inform_time", 1147 | "entities": [ 1148 | { 1149 | "start": 0, 1150 | "end": 2, 1151 | "value": "二月", 1152 | "entity": "time" 1153 | } 1154 | ] 1155 | }, 1156 | { 1157 | "text": "三月份", 1158 | "intent": "inform_time", 1159 | "entities": [] 1160 | }, 1161 | { 1162 | "text": "三月的", 1163 | "intent": "inform_time", 1164 | "entities": [] 1165 | }, 1166 | { 1167 | "text": "十一月", 1168 | "intent": "inform_time", 1169 | "entities": [ 1170 | { 1171 | "start": 0, 1172 | "end": 3, 1173 | "value": "十一月", 1174 | "entity": "time" 1175 | } 1176 | ] 1177 | }, 1178 | { 1179 | "text": "十一月的", 1180 | "intent": "inform_time", 1181 | "entities": [ 1182 | { 1183 | "start": 0, 1184 | "end": 3, 1185 | "value": "十一月", 1186 | "entity": "time" 1187 | } 1188 | ] 1189 | }, 1190 | { 1191 | "text": "是十一月的", 1192 | "intent": "inform_time", 1193 | "entities": [ 1194 | { 1195 | "start": 1, 1196 | "end": 4, 1197 | "value": "十一月", 1198 | "entity": "time" 1199 | } 1200 | ] 1201 | }, 1202 | { 1203 | "text": "十一月", 1204 | "intent": "inform_time", 1205 | "entities": [ 1206 | { 1207 | "start": 0, 1208 | "end": 3, 1209 | "value": "十一月", 1210 | "entity": "time" 1211 | } 1212 | ] 1213 | }, 1214 | { 1215 | "text": "上月的", 1216 | "intent": "inform_time", 1217 | "entities": [ 1218 | { 1219 | "start": 0, 1220 | "end": 2, 1221 | "value": "上月", 1222 | "entity": "time" 1223 | } 1224 | ] 1225 | }, 1226 | { 1227 | "text": "一月份", 1228 | "intent": "inform_time", 1229 | "entities": [ 1230 | { 1231 | "start": 0, 1232 | "end": 3, 1233 | "value": "一月份", 1234 | "entity": "time" 1235 | } 1236 | ] 1237 | }, 1238 | { 1239 | "text": "本月的", 1240 | "intent": "inform_time", 1241 | "entities": [ 1242 | { 1243 | "start": 0, 1244 | "end": 2, 1245 | "value": "本月", 1246 | "entity": "time" 1247 | } 1248 | ] 1249 | }, 1250 | { 1251 | "text": "十一份月的吧", 1252 | "intent": "inform_time", 1253 | "entities": [] 1254 | }, 1255 | { 1256 | "text": "话费", 1257 | "intent": "inform_item", 1258 | "entities": [ 1259 | { 1260 | "start": 0, 1261 | "end": 2, 1262 | "value": "话费", 1263 | "entity": "item" 1264 | } 1265 | ] 1266 | }, 1267 | { 1268 | "text": "消费", 1269 | "intent": "inform_item", 1270 | "entities": [ 1271 | { 1272 | "start": 0, 1273 | "end": 2, 1274 | "value": "话费", 1275 | "entity": "item" 1276 | } 1277 | ] 1278 | }, 1279 | { 1280 | "text": "流量", 1281 | "intent": "inform_item", 1282 | "entities": [ 1283 | { 1284 | "start": 0, 1285 | "end": 2, 1286 | "value": "流量", 1287 | "entity": "item" 1288 | } 1289 | ] 1290 | }, 1291 | { 1292 | "text": "话费吧", 1293 | "intent": "inform_item", 1294 | "entities": [ 1295 | { 1296 | "start": 0, 1297 | "end": 2, 1298 | "value": "话费", 1299 | "entity": "item" 1300 | } 1301 | ] 1302 | }, 1303 | { 1304 | "text": "是消费", 1305 | "intent": "inform_item", 1306 | "entities": [ 1307 | { 1308 | "start": 1, 1309 | "end": 3, 1310 | "value": "话费", 1311 | "entity": "item" 1312 | } 1313 | ] 1314 | }, 1315 | { 1316 | "text": "流量就行", 1317 | "intent": "inform_item", 1318 | "entities": [ 1319 | { 1320 | "start": 0, 1321 | "end": 2, 1322 | "value": "流量", 1323 | "entity": "item" 1324 | } 1325 | ] 1326 | }, 1327 | { 1328 | "text": "套餐一吧", 1329 | "intent": "inform_package", 1330 | "entities": [ 1331 | { 1332 | "start": 0, 1333 | "end": 3, 1334 | "value": "套餐一", 1335 | "entity": "item" 1336 | } 1337 | ] 1338 | }, 1339 | { 1340 | "text": "套餐一", 1341 | "intent": "inform_package", 1342 | "entities": [ 1343 | { 1344 | "start": 0, 1345 | "end": 3, 1346 | "value": "套餐一", 1347 | "entity": "item" 1348 | } 1349 | ] 1350 | }, 1351 | { 1352 | "text": "套餐二", 1353 | "intent": "inform_package", 1354 | "entities": [ 1355 | { 1356 | "start": 0, 1357 | "end": 3, 1358 | "value": "套餐二", 1359 | "entity": "item" 1360 | } 1361 | ] 1362 | }, 1363 | { 1364 | "text": "套餐三就好", 1365 | "intent": "inform_package", 1366 | "entities": [ 1367 | { 1368 | "start": 0, 1369 | "end": 3, 1370 | "value": "套餐三", 1371 | "entity": "item" 1372 | } 1373 | ] 1374 | }, 1375 | { 1376 | "text": "给我办一下流量套餐", 1377 | "intent": "request_management", 1378 | "entities": [ 1379 | { 1380 | "start": 5, 1381 | "end": 7, 1382 | "value": "流量", 1383 | "entity": "item" 1384 | } 1385 | ] 1386 | }, 1387 | { 1388 | "text": "我想办流量套餐", 1389 | "intent": "request_management", 1390 | "entities": [ 1391 | { 1392 | "start": 3, 1393 | "end": 5, 1394 | "value": "流量", 1395 | "entity": "item" 1396 | } 1397 | ] 1398 | }, 1399 | { 1400 | "text": "我想开一个新流量套餐", 1401 | "intent": "request_management", 1402 | "entities": [ 1403 | { 1404 | "start": 6, 1405 | "end": 8, 1406 | "value": "流量", 1407 | "entity": "item" 1408 | } 1409 | ] 1410 | }, 1411 | { 1412 | "text": "给我办一个新流量业务", 1413 | "intent": "request_management", 1414 | "entities": [ 1415 | { 1416 | "start": 6, 1417 | "end": 8, 1418 | "value": "流量", 1419 | "entity": "item" 1420 | } 1421 | ] 1422 | }, 1423 | { 1424 | "text": "给我办一下便宜点的流量套餐", 1425 | "intent": "request_management", 1426 | "entities": [ 1427 | { 1428 | "start": 9, 1429 | "end": 11, 1430 | "value": "流量", 1431 | "entity": "item" 1432 | }, 1433 | { 1434 | "start": 5, 1435 | "end": 7, 1436 | "value": "便宜", 1437 | "entity": "price" 1438 | } 1439 | ] 1440 | }, 1441 | { 1442 | "text": "我想办二十八的流量套餐", 1443 | "intent": "request_management", 1444 | "entities": [ 1445 | { 1446 | "start": 7, 1447 | "end": 9, 1448 | "value": "流量", 1449 | "entity": "item" 1450 | }, 1451 | { 1452 | "start": 3, 1453 | "end": 6, 1454 | "value": "二十八", 1455 | "entity": "price" 1456 | } 1457 | ] 1458 | }, 1459 | { 1460 | "text": "我想开一个合适的新流量套餐", 1461 | "intent": "request_management", 1462 | "entities": [ 1463 | { 1464 | "start": 9, 1465 | "end": 11, 1466 | "value": "流量", 1467 | "entity": "item" 1468 | }, 1469 | { 1470 | "start": 5, 1471 | "end": 7, 1472 | "value": "合适", 1473 | "entity": "price" 1474 | } 1475 | ] 1476 | }, 1477 | { 1478 | "intent": "request_management", 1479 | "text": "给我办理流量业务", 1480 | "entities": [ 1481 | { 1482 | "start": 4, 1483 | "value": "流量", 1484 | "end": 6, 1485 | "entity": "item" 1486 | } 1487 | ] 1488 | }, 1489 | { 1490 | "intent": "request_management", 1491 | "text": "给我办理流量", 1492 | "entities": [ 1493 | { 1494 | "start": 4, 1495 | "value": "流量", 1496 | "end": 6, 1497 | "entity": "item" 1498 | } 1499 | ] 1500 | }, 1501 | { 1502 | "text": "给我办一个三十的新流量业务", 1503 | "intent": "request_management", 1504 | "entities": [ 1505 | { 1506 | "start": 9, 1507 | "end": 11, 1508 | "value": "流量", 1509 | "entity": "item" 1510 | }, 1511 | { 1512 | "start": 5, 1513 | "end": 7, 1514 | "value": "三十", 1515 | "entity": "price" 1516 | } 1517 | ] 1518 | }, 1519 | { 1520 | "text": "本机的", 1521 | "intent": "inform_current_phone", 1522 | "entities": [] 1523 | }, 1524 | { 1525 | "text": "自己的号码", 1526 | "intent": "inform_current_phone", 1527 | "entities": [] 1528 | }, 1529 | { 1530 | "text": "我自己的", 1531 | "intent": "inform_current_phone", 1532 | "entities": [] 1533 | }, 1534 | { 1535 | "text": "本机", 1536 | "intent": "inform_current_phone", 1537 | "entities": [] 1538 | }, 1539 | { 1540 | "text": "我查本机的", 1541 | "intent": "inform_current_phone", 1542 | "entities": [] 1543 | }, 1544 | { 1545 | "text": "查本机", 1546 | "intent": "inform_current_phone", 1547 | "entities": [] 1548 | }, 1549 | { 1550 | "text": "这个手机的", 1551 | "intent": "inform_current_phone", 1552 | "entities": [] 1553 | }, 1554 | { 1555 | "text": "其他的", 1556 | "intent": "inform_other_phone", 1557 | "entities": [] 1558 | }, 1559 | { 1560 | "text": "其他号码的", 1561 | "intent": "inform_other_phone", 1562 | "entities": [] 1563 | }, 1564 | { 1565 | "text": "不是本机的", 1566 | "intent": "inform_other_phone", 1567 | "entities": [] 1568 | }, 1569 | { 1570 | "text": "别的号码的", 1571 | "intent": "inform_other_phone", 1572 | "entities": [] 1573 | }, 1574 | { 1575 | "text": "别的", 1576 | "intent": "inform_other_phone", 1577 | "entities": [] 1578 | }, 1579 | { 1580 | "text": "其他号码", 1581 | "intent": "inform_other_phone", 1582 | "entities": [] 1583 | }, 1584 | { 1585 | "text": "非本机号码", 1586 | "intent": "inform_other_phone", 1587 | "entities": [] 1588 | }, 1589 | { 1590 | "text": "你好", 1591 | "intent": "greet", 1592 | "entities": [] 1593 | }, 1594 | { 1595 | "text": "您好", 1596 | "intent": "greet", 1597 | "entities": [] 1598 | }, 1599 | { 1600 | "text": "您好吗", 1601 | "intent": "greet", 1602 | "entities": [] 1603 | }, 1604 | { 1605 | "text": "嗨", 1606 | "intent": "greet", 1607 | "entities": [] 1608 | }, 1609 | { 1610 | "text": "你是谁", 1611 | "intent": "greet", 1612 | "entities": [] 1613 | }, 1614 | { 1615 | "text": "您是", 1616 | "intent": "greet", 1617 | "entities": [] 1618 | }, 1619 | { 1620 | "text": "你是哪个", 1621 | "intent": "greet", 1622 | "entities": [] 1623 | }, 1624 | { 1625 | "text": "喂", 1626 | "intent": "greet", 1627 | "entities": [] 1628 | }, 1629 | { 1630 | "text": "再见", 1631 | "intent": "goodbye", 1632 | "entities": [] 1633 | }, 1634 | { 1635 | "text": "拜拜", 1636 | "intent": "goodbye", 1637 | "entities": [] 1638 | }, 1639 | { 1640 | "text": "很高兴和你说话", 1641 | "intent": "goodbye", 1642 | "entities": [] 1643 | }, 1644 | { 1645 | "text": "嗯", 1646 | "intent": "confirm", 1647 | "entities": [] 1648 | }, 1649 | { 1650 | "text": "好的", 1651 | "intent": "confirm", 1652 | "entities": [] 1653 | }, 1654 | { 1655 | "text": "行", 1656 | "intent": "confirm", 1657 | "entities": [] 1658 | }, 1659 | { 1660 | "text": "可以的", 1661 | "intent": "confirm", 1662 | "entities": [] 1663 | }, 1664 | { 1665 | "text": "恩", 1666 | "intent": "confirm", 1667 | "entities": [] 1668 | }, 1669 | { 1670 | "text": "中中", 1671 | "intent": "confirm", 1672 | "entities": [] 1673 | }, 1674 | { 1675 | "text": "中", 1676 | "intent": "confirm", 1677 | "entities": [] 1678 | }, 1679 | { 1680 | "text": "办吧", 1681 | "intent": "confirm", 1682 | "entities": [] 1683 | }, 1684 | { 1685 | "text": "办理吧", 1686 | "intent": "confirm", 1687 | "entities": [] 1688 | }, 1689 | { 1690 | "text": "行的", 1691 | "intent": "confirm", 1692 | "entities": [] 1693 | }, 1694 | { 1695 | "text": "没问题", 1696 | "intent": "confirm", 1697 | "entities": [] 1698 | }, 1699 | { 1700 | "text": "谢谢", 1701 | "intent": "thanks", 1702 | "entities": [] 1703 | }, 1704 | { 1705 | "text": "谢谢您", 1706 | "intent": "thanks", 1707 | "entities": [] 1708 | }, 1709 | { 1710 | "text": "谢谢你", 1711 | "intent": "thanks", 1712 | "entities": [] 1713 | }, 1714 | { 1715 | "text": "非常感谢", 1716 | "intent": "thanks", 1717 | "entities": [] 1718 | }, 1719 | { 1720 | "text": "谢谢啊", 1721 | "intent": "thanks", 1722 | "entities": [] 1723 | }, 1724 | { 1725 | "text": "谢了", 1726 | "intent": "thanks", 1727 | "entities": [] 1728 | }, 1729 | { 1730 | "text": "不要", 1731 | "intent": "deny", 1732 | "entities": [] 1733 | }, 1734 | { 1735 | "text": "不需要", 1736 | "intent": "deny", 1737 | "entities": [] 1738 | }, 1739 | { 1740 | "text": "不要办", 1741 | "intent": "deny", 1742 | "entities": [] 1743 | }, 1744 | { 1745 | "text": "不办", 1746 | "intent": "deny", 1747 | "entities": [] 1748 | }, 1749 | { 1750 | "text": "暂时不要了", 1751 | "intent": "deny", 1752 | "entities": [] 1753 | }, 1754 | { 1755 | "text": "不是", 1756 | "intent": "deny", 1757 | "entities": [] 1758 | }, 1759 | { 1760 | "text": "有问题", 1761 | "intent": "deny", 1762 | "entities": [] 1763 | }, 1764 | { 1765 | "text": "我再考虑考虑", 1766 | "intent": "deny", 1767 | "entities": [] 1768 | }, 1769 | { 1770 | "text": "不好啦", 1771 | "intent": "deny", 1772 | "entities": [] 1773 | }, 1774 | { 1775 | "text": "不行", 1776 | "intent": "deny", 1777 | "entities": [] 1778 | }, 1779 | { 1780 | "text": "不可以的", 1781 | "intent": "deny", 1782 | "entities": [] 1783 | }, 1784 | { 1785 | "text": "不中", 1786 | "intent": "deny", 1787 | "entities": [] 1788 | }, 1789 | { 1790 | "text": "不可以", 1791 | "intent": "deny", 1792 | "entities": [] 1793 | }, 1794 | { 1795 | "text": "没了", 1796 | "intent": "deny", 1797 | "entities": [] 1798 | }, 1799 | { 1800 | "text": "没有了", 1801 | "intent": "deny", 1802 | "entities": [] 1803 | }, 1804 | { 1805 | "text": "不用了", 1806 | "intent": "deny", 1807 | "entities": [] 1808 | }, 1809 | { 1810 | "text": "暂时不用了", 1811 | "intent": "deny", 1812 | "entities": [] 1813 | }, 1814 | { 1815 | "text": "好的没了", 1816 | "intent": "deny", 1817 | "entities": [] 1818 | }, 1819 | { 1820 | "text": "好不用了", 1821 | "intent": "deny", 1822 | "entities": [] 1823 | }, 1824 | { 1825 | "text": "=", 1826 | "intent": "unknown_intent", 1827 | "entities": [] 1828 | }, 1829 | { 1830 | "text": "&", 1831 | "intent": "unknown_intent", 1832 | "entities": [] 1833 | }, 1834 | { 1835 | "text": "吃饭", 1836 | "intent": "unknown_intent", 1837 | "entities": [] 1838 | } 1839 | ], 1840 | "regex_features": [], 1841 | "entity_synonyms": [{ 1842 | "value": "话费", 1843 | "synonyms": ["话费", "钱"] 1844 | }] 1845 | } 1846 | } --------------------------------------------------------------------------------