├── Crawler ├── build_dict.py ├── build_graph.py ├── dict │ ├── check.txt │ ├── disease.txt │ ├── drug.txt │ ├── recipe.txt │ └── symptom.txt ├── entities │ ├── check.json │ ├── disease.json │ ├── disease_id.txt │ ├── drug.json │ ├── recipe.json │ └── symptom.json ├── note.txt ├── request_disease.py └── request_others.py ├── MedicalAssistant ├── __init__.py ├── __pycache__ │ ├── __init__.cpython-36.pyc │ ├── settings.cpython-36.pyc │ ├── urls.cpython-36.pyc │ └── wsgi.cpython-36.pyc ├── settings.py ├── urls.py └── wsgi.py ├── assets ├── image-20230319192131382.png ├── image-20230319192207463.png ├── image-20230319192224207.png ├── image-20230319192224213.png └── image-20230319200606840.png ├── classifier ├── dict │ ├── affirm.txt │ ├── deny.txt │ ├── disease.txt │ ├── drug.txt │ ├── goodbye.txt │ ├── greet.txt │ └── thankyou.txt ├── fasttext_data.txt ├── intent.txt ├── intent │ ├── affirm.txt │ ├── deny.txt │ ├── disease_cause.txt │ ├── disease_department.txt │ ├── disease_desc.txt │ ├── disease_diet.txt │ ├── disease_drug.txt │ ├── disease_easy_get.txt │ ├── disease_neopathy.txt │ ├── disease_prevent.txt │ ├── disease_symptom.txt │ ├── disease_treat_cost.txt │ ├── disease_treat_rate.txt │ ├── disease_treat_time.txt │ ├── disease_treat_way.txt │ ├── drug_func.txt │ ├── drug_price.txt │ ├── drug_use.txt │ ├── goodbye.txt │ ├── greet.txt │ └── thankyou.txt ├── models │ ├── -fasttext.model │ ├── fasttext.model │ ├── test.bin │ ├── test.model │ └── w2v_model.pkl ├── stopwords.txt ├── train_intents_fasttext.py ├── vocabs.txt └── word2vec-test.py ├── contextual ├── IntentDetector.py ├── IntentProcessor.py ├── KGQuery.py └── __pycache__ │ ├── IntentDetector.cpython-36.pyc │ ├── IntentProcessor.cpython-36.pyc │ └── KGQuery.cpython-36.pyc ├── db.sqlite3 ├── main.py ├── manage.py ├── readme.md ├── robot ├── __init__.py ├── __pycache__ │ ├── __init__.cpython-36.pyc │ ├── admin.cpython-36.pyc │ ├── models.cpython-36.pyc │ ├── urls.cpython-36.pyc │ └── views.cpython-36.pyc ├── admin.py ├── apps.py ├── migrations │ ├── __init__.py │ └── __pycache__ │ │ └── __init__.cpython-36.pyc ├── models.py ├── tests.py ├── urls.py └── views.py ├── static └── robot │ ├── bootstrap │ ├── css │ │ ├── bootstrap-theme.css │ │ ├── bootstrap-theme.css.map │ │ ├── bootstrap-theme.min.css │ │ ├── bootstrap-theme.min.css.map │ │ ├── bootstrap.css │ │ ├── bootstrap.css.map │ │ ├── bootstrap.min.css │ │ └── bootstrap.min.css.map │ ├── fonts │ │ ├── glyphicons-halflings-regular.eot │ │ ├── glyphicons-halflings-regular.svg │ │ ├── glyphicons-halflings-regular.ttf │ │ ├── glyphicons-halflings-regular.woff │ │ └── glyphicons-halflings-regular.woff2 │ └── js │ │ ├── bootstrap.js │ │ ├── bootstrap.min.js │ │ └── npm.js │ ├── css │ └── bot.css │ ├── img │ ├── profile.png │ ├── testimg.jpg │ └── user.jpg │ └── js │ ├── bot.js │ └── jquery.js ├── telegramBot.py └── templates ├── index.html └── test.html /Crawler/build_dict.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | 3 | ''' 4 | 根据爬虫结果抽取字典 5 | ''' 6 | import json 7 | import re 8 | 9 | 10 | class build_dict: 11 | def __init__(self, fileName): 12 | self.readFile = open('entities/{fn}.json'.format(fn=fileName), 'r', encoding = 'utf-8') 13 | self.saveFile = open('dict/{fn}.txt'.format(fn = fileName), 'w', encoding = 'utf-8') 14 | 15 | def execute(self): 16 | name_set = set() 17 | # 去重 18 | for item in self.readFile: 19 | data = json.loads(item.strip()) 20 | line = data['name'].strip() 21 | word_list = line.split() 22 | if len(word_list)>1: 23 | name_set.add(word_list[-1]) 24 | else: 25 | name_set.add(word_list[0]) 26 | 27 | 28 | # 保存词典 29 | for name in list(name_set): 30 | self.saveFile.write(name + '\n') 31 | 32 | def __del__(self): 33 | self.readFile.close() 34 | self.saveFile.close() 35 | 36 | if __name__ == '__main__': 37 | # bd = build_dict('disease') 38 | # bd = build_dict('check') 39 | # bd = build_dict('symptom') 40 | # bd = build_dict('recipe') 41 | bd = build_dict('drug') 42 | bd.execute() -------------------------------------------------------------------------------- /Crawler/build_graph.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | 3 | ''' 4 | 这里的工作是从保存的json文件中取出内容进行处理 5 | 构建图先构建实体,再建立联系。 6 | 7 | 实体存入neo4j只需要存自己的属性,涉及的其他实体都是关系 8 | 关系从disease的json文件中找到关系 9 | ''' 10 | 11 | import json 12 | from py2neo import * 13 | from collections import defaultdict 14 | import re 15 | import time 16 | 17 | class Build_Graph: 18 | 19 | # 静态成员变量 20 | disease = 'disease' 21 | symptom = 'symptom' 22 | drug = 'drug' 23 | recipe = 'recipe' 24 | check = 'check' 25 | 26 | # 联系类型 27 | disease_rel_recipe = 'recommend_diet' 28 | disease_rel_neopathy = 'accompany_with' 29 | disease_rel_check = 'need_check' 30 | disease_rel_symptom = 'has_symptom' 31 | disease_rel_drug = 'recommend_drug' 32 | 33 | def __init__(self): 34 | self.graph = Graph("http://localhost:7474", username="neo4j",password='root') 35 | # self._delete_origin_database() 36 | self.start_time = time.clock() 37 | 38 | def _extract_id(self, text: str): 39 | '''将id从字符串中抽出,用于a标签的href属性''' 40 | return re.search("[0-9]+", text).group() 41 | 42 | def _delete_origin_database(self): 43 | print('正在清空当前数据库...') 44 | self.graph.delete_all() 45 | print('清除原数据库成功') 46 | 47 | def _extract_data(self, fileName): 48 | '''从json中取出每一行信息''' 49 | for line in open('entities/{fn}.json'.format(fn=fileName), 'r', encoding = 'utf-8'): 50 | data = json.loads(line.strip()) 51 | # 转化成defaultDict 避免错误, 如果取不到key的话可以获得到一个空的字符串 52 | dd = defaultdict(str) 53 | dd.update(data) 54 | yield dd 55 | 56 | def _build_entities(self): 57 | '''创建Disease实体''' 58 | 59 | for data in self._extract_data(Build_Graph.disease): 60 | print("Disease: ", data['name']) 61 | disease = Node('Disease', 62 | d_id = data['id'], 63 | name = data['name'], 64 | easy_get = data['easy_get'], 65 | ill_rate = data['ill_rate'], 66 | pic_url = data['pic_url'], 67 | desc = data['desc'], 68 | cause = data['cause'], 69 | prevent = data['prevent'], 70 | department = data['department'], 71 | treat_way = data['treat_way'], 72 | treat_time = data['treat_time'], 73 | treat_rate = data['treat_rate'], 74 | treat_cost = data['treat_cost'], 75 | diet_good = data['diet_good'], 76 | diet_bad = data['diet_bad'] ) 77 | self.graph.create(disease) 78 | 79 | '''创建Drug实体''' 80 | for data in self._extract_data(Build_Graph.drug): 81 | print("Drug: ", data['name']) 82 | drug = Node('Drug', 83 | dg_id = data['id'], 84 | name = data['name'], 85 | pic_url = data['pic_url'], 86 | price = data['price'], 87 | func = data['func'], 88 | use = data['use'],) 89 | self.graph.create(drug) 90 | 91 | '''创建symptom实体''' 92 | for data in self._extract_data(Build_Graph.symptom): 93 | print("Symptom: ", data['name']) 94 | symptom = Node('Symptom', 95 | sm_id = data['id'], 96 | name = data['name']) 97 | self.graph.create(symptom) 98 | 99 | '''创建check实体''' 100 | for data in self._extract_data(Build_Graph.check): 101 | print("Check: ", data['name']) 102 | check = Node('Check', 103 | ck_id = data['id'], 104 | desc = data['desc'], 105 | name = data['name']) 106 | self.graph.create(check) 107 | 108 | '''创建recipe实体''' 109 | for data in self._extract_data(Build_Graph.recipe): 110 | print("Recipe: ", data['name']) 111 | recipe = Node('Recipe', 112 | rp_id = data['id'], 113 | name = data['name'], 114 | pic_url = data['pic_url'], 115 | produce_way = data['produce_way'],) 116 | self.graph.create(recipe) 117 | 118 | def _test_build_relationship(self): 119 | # 大致看看会不会有匹配不上的关系,或者看看有什么其他问题 120 | for data in self._extract_data(Build_Graph.disease): 121 | # disease = self.graph.nodes.match('Disease', d_id = data['id']).first() 122 | # 测试并发症是不是都能在数据库找到对应实体 123 | # if data['neopathy']: 124 | # for neo in data['neopathy']: 125 | # neo_id = neo['neo_id'] 126 | # neo_name = neo['neo_name'] 127 | # neopathy = self.graph.nodes.match("Disease", d_id=neo_id, name=neo_name).first() 128 | # if neopathy: 129 | # print(neo_id, neo_name) 130 | # print(neopathy['d_id'], neopathy['name']) 131 | 132 | # 测试检查项目是不是都能在数据库找到对应实体 133 | # if data['checkes']: 134 | # for ck in data['checkes']: 135 | # ck_id = self._extract_id(ck['ck_url']) 136 | # ck_name = ck['ck_name'] 137 | # check = self.graph.nodes.match("Check", ck_id=ck_id, name=ck_name).first() 138 | # if check: 139 | # print(check['ck_id'], check['name']) 140 | 141 | # 测试症状是不是都能在数据库找到对应实体 142 | # if data['symptoms']: 143 | # for sm in data['symptoms']: 144 | # sm_id = sm['sm_id'] 145 | # sm_name = sm['sm_name'] 146 | # symptom = self.graph.nodes.match("Symptom", sm_id=sm_id, name=sm_name).first() 147 | # if symptom: 148 | # print(symptom['sm_id'], symptom['name']) 149 | 150 | # 测试菜谱是不是都能在数据库找到对应实体 151 | # if data['recipes']: 152 | # for rp in data['recipes']: 153 | # rp_id = self._extract_id(rp['rp_url']) 154 | # rp_name = rp['rp_name'] 155 | # recipe = self.graph.nodes.match("Recipe", rp_id = rp_id, name = rp_name).first() 156 | # if recipe: 157 | # print(recipe['rp_id'], recipe['name']) 158 | 159 | # 测试药品是不是都能在数据库找到对应实体 160 | if data['drug']: 161 | for dg_url in data['drug']: 162 | dg_id = self._extract_id(dg_url) 163 | drug = self.graph.nodes.match("Drug", dg_id = dg_id).first() 164 | if drug: 165 | print(drug['dg_id'], drug['name']) 166 | 167 | def _build_relationship(self): 168 | # 建立节点之间的联系 169 | for data in self._extract_data(Build_Graph.disease): 170 | rel_list = [] 171 | disease = self.graph.nodes.match('Disease', d_id = data['id']).first() 172 | # 建立并发症关系 173 | if data['neopathy']: 174 | for neo in data['neopathy']: 175 | neo_id = neo['neo_id'] 176 | neo_name = neo['neo_name'] 177 | neopathy = self.graph.nodes.match("Disease", d_id=neo_id, name=neo_name).first() 178 | if neopathy: 179 | print(neopathy['d_id'], neopathy['name']) 180 | rel_list.append(Relationship(disease, Build_Graph.disease_rel_neopathy, neopathy)) 181 | 182 | # 建立检查项目关系 183 | if data['checkes']: 184 | for ck in data['checkes']: 185 | ck_id = self._extract_id(ck['ck_url']) 186 | ck_name = ck['ck_name'] 187 | check = self.graph.nodes.match("Check", ck_id=ck_id, name=ck_name).first() 188 | if check: 189 | print(check['ck_id'], check['name']) 190 | rel_list.append(Relationship(disease, Build_Graph.disease_rel_check, check)) 191 | 192 | # 建立检查项目关系 193 | if data['symptoms']: 194 | for sm in data['symptoms']: 195 | sm_id = sm['sm_id'] 196 | sm_name = sm['sm_name'] 197 | symptom = self.graph.nodes.match("Symptom", sm_id=sm_id, name=sm_name).first() 198 | if symptom: 199 | print(symptom['sm_id'], symptom['name']) 200 | rel_list.append(Relationship(disease, Build_Graph.disease_rel_symptom, symptom)) 201 | 202 | # 建立食谱项目关系 203 | if data['recipes']: 204 | for rp in data['recipes']: 205 | rp_id = self._extract_id(rp['rp_url']) 206 | rp_name = rp['rp_name'] 207 | recipe = self.graph.nodes.match("Recipe", rp_id = rp_id, name = rp_name).first() 208 | if recipe: 209 | print(recipe['rp_id'], recipe['name']) 210 | rel_list.append(Relationship(disease, Build_Graph.disease_rel_recipe, recipe)) 211 | 212 | # 建立药物项目关系 213 | if data['drug']: 214 | for dg_url in data['drug']: 215 | dg_id = self._extract_id(dg_url) 216 | drug = self.graph.nodes.match("Drug", dg_id = dg_id).first() 217 | if drug: 218 | print(drug['dg_id'], drug['name']) 219 | rel_list.append(Relationship(disease, Build_Graph.disease_rel_drug, drug)) 220 | 221 | Rels = Subgraph(relationships = rel_list) 222 | self.graph.create(Rels) 223 | 224 | def extra_data(self): 225 | '''添加一些额外的数据, ''' 226 | 227 | 228 | def run(self): 229 | # self._build_entities() 230 | # self._build_relationship() 231 | self.extra_data() 232 | 233 | def __del__(self): 234 | print("执行花费时间: %f"%(time.clock() - self.start_time)) 235 | 236 | if __name__ == '__main__': 237 | graph = Build_Graph() 238 | graph.run() 239 | 240 | 241 | -------------------------------------------------------------------------------- /Crawler/note.txt: -------------------------------------------------------------------------------- 1 | 实体包括{ 2 | 疾病/并发症:disease 3 | 症状:symptom 4 | 检查:check 5 | 药品:drug 6 | 食谱:recipe 7 | } 8 | 9 | 疾病disease属性{ 10 | id 11 | name 12 | desc 13 | cause 14 | prevent 15 | department 16 | treat_way 17 | treat_time 18 | treat_rate 19 | treat_cost 20 | easy_get 21 | ill_rate 22 | pic_url 23 | diet_good 24 | diet_bad 25 | *recipies* 26 | *neopathy* 27 | *checkes* 28 | *symptoms* 29 | *drug* 30 | } 31 | 32 | 症状symptoms{ 33 | id 34 | name 35 | desc 36 | diagnose 37 | } 38 | 39 | 检查checks{ 40 | id 41 | name 42 | desc 43 | } 44 | 45 | 药物drug{ 46 | id 47 | name 48 | pic_url 49 | price 50 | func 51 | use 52 | } 53 | 54 | 菜谱recipes{ 55 | id 56 | name 57 | pic_url 58 | produce_way 59 | } -------------------------------------------------------------------------------- /Crawler/request_disease.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | ''' 3 | 实体包括{ 4 | 疾病/并发症:disease 5 | 症状:symptom 6 | 检查:check 7 | 药品:drug 8 | 食谱:recipe 9 | } 10 | 11 | 12 | 思路: 13 | 网站:http://jib.xywy.com 14 | 通过先爬取疾病,获取主要信息,同时记录其他实体的ID信息,以便后续继续爬取相关实体的信息 15 | 16 | 疾病关系以及属性{ 17 | id :前置页面爬虫获取 18 | 19 | 疾病名字:主页 20 | 易感人群:主页 页面获取 21 | 患病比例:主页 页面获取 22 | 疾病图片:主页 页面获取 23 | 症状(实体): 主页 侧边栏获取 记录ID 24 | 检查(实体): 主页 侧边栏获取 记录ID 25 | 并发症(实体):主页 侧边栏获取 不用记录ID 26 | 27 | 简介:简介 页面获取 28 | 病因:病因 页面获取 29 | 预防:预防 页面获取 30 | 31 | 治疗: 治疗 页面获取 32 | 治疗费用:治疗 页面获取 33 | 治疗周期:治疗 页面获取 34 | 治愈率: 治疗 页面获取 35 | 科室:治疗 页面获取 36 | 37 | 食物: 食物 页面获取 38 | 宜吃食物:不记录ID 39 | 忌吃食物:不记录ID 40 | 41 | 推荐食谱(实体): 食物页面获取 记录ID 42 | 推荐药品(实体): 药品页面获取 记录ID 43 | } 44 | ''' 45 | import requests 46 | from lxml import etree 47 | import re 48 | import random 49 | from retrying import retry 50 | import json 51 | import vthread 52 | 53 | class UrlOption: 54 | def __init__(self): 55 | self.main = '主页' 56 | self.info = '简介' 57 | self.cause = '病因' 58 | self.prevent = '预防' 59 | self.neopathy = '并发症' 60 | self.symptom = '症状' 61 | self.inspect = '检查' 62 | self.treat = '治疗' 63 | self.food = '食物' 64 | self.drug = '药品' 65 | options = UrlOption() 66 | 67 | headers = { 68 | 'User-Agent': "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36", 69 | 'Accept-Encoding': 'gzip, deflate, br', 70 | 'Accept-Language': 'zh-CN,zh;q=0.9', 71 | } 72 | 73 | '''工具函数''' 74 | 75 | def gen_website_url(option, diseaseID): 76 | '''返回URL''' 77 | main_url = "http://jib.xywy.com" 78 | url_dict = { 79 | '主页':'/il_sii_', 80 | '简介':'/il_sii/gaishu/', 81 | '病因':'/il_sii/cause/', 82 | '预防':'/il_sii/prevent/', 83 | '并发症':'/il_sii/neopathy/', 84 | '症状':'/il_sii/symptom/', 85 | '检查':'/il_sii/inspect/', 86 | '治疗':'/il_sii/treat/', 87 | '食物':'/il_sii/food/', 88 | '药品':'/il_sii/drug/', 89 | } 90 | return main_url+url_dict[option]+str(diseaseID)+'.htm' 91 | 92 | def extract_id(text:str): 93 | '''将id从字符串中抽出,用于a标签的href属性''' 94 | return re.search("[0-9]+",text).group() 95 | 96 | def unify(s): 97 | '''去除非法字符''' 98 | return s.replace('\r', '').replace(' ', '').replace('\t', '').replace('\n', '')\ 99 | .replace('\xa0', '').replace('\u3000', '') 100 | 101 | 102 | '''信息获取函数''' 103 | def get_disease_id(): 104 | ''' 105 | 函数作用:将每一个id爬取,然后保存至文件disease_id, 作为中间文件以进行后续工作 106 | out_url是由字母排序的所有疾病的网站,从a遍历到z即可获得疾病网站 107 | 然后再根据网站对每一个疾病进行爬取 108 | ''' 109 | out_url = 'http://jib.xywy.com/html/{letter}.html' 110 | f = open("entities/disease_id.txt","w",encoding = "utf-8") 111 | for let in [chr(97+i) for i in range(0,26)]: 112 | cur_url = out_url.format(letter=let) 113 | print("正在爬取", cur_url) 114 | rep = requests.get(cur_url, headers=headers) 115 | html = etree.HTML(rep.text) 116 | res = html.xpath('//div[@class="fl jblist-con-ear"]//ul//a') 117 | for item in res: 118 | d_id = extract_id(item.xpath('@href')[0]) 119 | # d_name = item.xpath('text()')[0].encode('iso-8859-1').decode('gbk') 120 | print(d_id) 121 | f.write(d_id + '\n') 122 | f.close() 123 | 124 | @retry(stop_max_attempt_number=3) 125 | def get_info_main(d_id): 126 | '''根据疾病ID,到其主页获取相应信息''' 127 | main_url = gen_website_url(options.main, d_id) 128 | rep = requests.get(main_url, headers=headers) 129 | html = etree.HTML(rep.text) 130 | data = {} 131 | 132 | name = html.xpath('//div[@class="wrap mt5"]//div/text()')[0].strip() 133 | data['name'] = name 134 | 135 | easy_get = html.xpath('//div[@class="fl jib-common-sense"]/p[1]/span[@class="fl sense-right"]/text()')[0].strip() 136 | data['easy_get'] = easy_get 137 | 138 | '''注释是原来版本, 出错是因为有显示治愈率,但是治愈率是空的''' 139 | # ill_rate = html.xpath('//div[@class="fl jib-common-sense"]/p[2]/span[@class="fl sense-right"]/text()')[0].strip() 140 | # data['ill_rate'] = ill_rate 141 | '''修改版本分界线''' 142 | ill_rate = html.xpath('//div[@class="fl jib-common-sense"]/p[2]/span[@class="fl sense-right"]/text()') 143 | if ill_rate: 144 | data['ill_rate'] = ill_rate[0].strip() 145 | else: 146 | data['ill_rate'] = '' 147 | '''修改版本分界线''' 148 | 149 | pic_url = html.xpath('//div[@class="jib-art-box"]//img/@src')[0] 150 | data['pic_url'] = pic_url 151 | 152 | neopathies = html.xpath('//div[@class="jib-navbar fl bor pr"]/div[1]//div[@class="jib-navbar-bd "]/div[3]/p[not(@class="mt5")]/a') 153 | data['neopathy'] = [] 154 | for neo in neopathies: 155 | neo_id = extract_id(neo.xpath('@href')[0]) 156 | neo_name = neo.xpath('text()')[0].strip() 157 | data['neopathy'].append({"neo_id":neo_id,"neo_name":neo_name}) 158 | 159 | checkes = html.xpath( 160 | '//div[@class="jib-navbar fl bor pr"]/div[2]//div[@class="jib-navbar-bd "]/div[2]/p[not(@class="mt5")]/a') 161 | data['checkes'] = [] 162 | for ck in checkes: 163 | ck_url = ck.xpath('@href')[0] 164 | ck_name = ck.xpath('text()')[0].strip() 165 | data['checkes'].append({"ck_url": ck_url, "ck_name": ck_name}) 166 | 167 | symptoms = html.xpath( 168 | '//div[@class="jib-navbar fl bor pr"]/div[2]//div[@class="jib-navbar-bd "]/div[1]/p[not(@class="mt5")]/a') 169 | data['symptoms'] = [] 170 | for sm in symptoms: 171 | sm_id = extract_id(sm.xpath('@href')[0]) 172 | sm_name = sm.xpath('text()')[0].strip() 173 | data['symptoms'].append({"sm_id": sm_id, "sm_name": sm_name}) 174 | 175 | return data 176 | 177 | @retry(stop_max_attempt_number=3) 178 | def get_info_other(d_id): 179 | '''根据疾病ID,到其简介页, 病因页, 预防页 各获取相应信息''' 180 | data = {} 181 | info_url = gen_website_url(options.info, d_id) 182 | rep = requests.get(info_url, headers = headers) 183 | html = etree.HTML(rep.text) 184 | desc = html.xpath('//div[@class="jib-articl-con jib-lh-articl"]//p/text()')[0].strip() 185 | data['desc'] = unify(desc) 186 | 187 | cause_url = gen_website_url(options.cause, d_id) 188 | rep = requests.get(cause_url, headers = headers) 189 | html = etree.HTML(rep.text) 190 | cause_tag = html.xpath('(//div[@class=" jib-articl fr f14 jib-lh-articl"]/p)|(//div[@class=" jib-articl fr f14 jib-lh-articl"]/p/b)|(//div[@class=" jib-articl fr f14 jib-lh-articl"]/p/strong)') 191 | cause_list = [] 192 | for tag in cause_tag: 193 | s_list = tag.xpath('text()') 194 | if s_list: 195 | s = unify(s_list[0]) 196 | if s: 197 | cause_list.append(s) 198 | data['cause'] = '\n'.join(cause_list) 199 | 200 | prevent_url = gen_website_url(options.prevent, d_id) 201 | rep = requests.get(prevent_url, headers=headers) 202 | html = etree.HTML(rep.text) 203 | prevent_tag = html.xpath( 204 | '(//div[@class="jib-articl fr f14 jib-lh-articl"]/p)|(//div[@class="jib-articl fr f14 jib-lh-articl"]/p/b)|(//div[@class=" jib-articl fr f14 jib-lh-articl"]/p/strong)') 205 | prevent_list = [] 206 | for tag in prevent_tag: 207 | s_list = tag.xpath('text()') 208 | if s_list: 209 | s = unify(s_list[0]) 210 | if s: 211 | prevent_list.append(s) 212 | data['prevent'] = '\n'.join(prevent_list) 213 | 214 | return data 215 | 216 | @retry(stop_max_attempt_number=3) 217 | def get_info_treat(d_id): 218 | '''根据疾病ID,到其治疗页获取相应信息''' 219 | treat_url = gen_website_url(options.treat, d_id) 220 | rep = requests.get(treat_url, headers = headers) 221 | html = etree.HTML(rep.text) 222 | data = {} 223 | 224 | panel = html.xpath('//div[@class="mt20 articl-know "]//p') 225 | for pTag in panel: 226 | left_title = pTag.xpath('span[1]/text()')[0].strip() 227 | '''注释的是原版,下方的是修改版本,出错原因是网页有left_title,但是没有right_content''' 228 | # right_content = pTag.xpath('span[2]/text()')[0].strip() 229 | '''修改版本分割线''' 230 | right_content = pTag.xpath('span[2]/text()') 231 | if right_content: 232 | right_content = right_content[0].strip() 233 | else: 234 | right_content = '' 235 | '''修改版本分割线''' 236 | if left_title == '就诊科室:': 237 | data['department'] = right_content 238 | elif left_title == '治疗方式:': 239 | data['treat_way'] = right_content 240 | elif left_title == '治疗周期:': 241 | data['treat_time'] = right_content 242 | elif left_title == '治愈率:': 243 | data['treat_rate'] = right_content 244 | elif left_title == '治疗费用:': 245 | data['treat_cost'] = right_content 246 | 247 | if len(list(data.keys())) != 5: 248 | print("id=%s get_info_treat 数据获取不完整"%d_id) 249 | print(data) 250 | 251 | return data 252 | 253 | @retry(stop_max_attempt_number=3) 254 | def get_info_food(d_id): 255 | '''根据疾病ID,到其食物页获取相应信息''' 256 | food_url = gen_website_url(options.food, d_id) 257 | rep = requests.get(food_url, headers = headers) 258 | html = etree.HTML(rep.text) 259 | data = {} 260 | 261 | diet_good_text = html.xpath('//div[@class="panels mt10"]/div[2]//div[@class="fl diet-good-txt"]/text()')[0].strip() 262 | diet_good_food_list = html.xpath('//div[@class="panels mt10"]/div[2]//div[@class="diet-img clearfix mt20"]//p') 263 | data['diet_good'] = diet_good_text + " 宜吃:" + ','.join([food.xpath('text()')[0].strip() for food in diet_good_food_list]) 264 | 265 | diet_bad_text = html.xpath('///div[@class="panels mt10"]/div[3]//div[@class="fl diet-good-txt"]/text()')[ 266 | 0].strip() 267 | diet_bad_food_list = html.xpath('//div[@class="panels mt10"]/div[3]//div[@class="diet-img clearfix mt20"]//p') 268 | data['diet_bad'] = diet_bad_text + " 不宜吃:" + ','.join( 269 | [food.xpath('text()')[0].strip() for food in diet_bad_food_list]) 270 | 271 | recipes_list = html.xpath('//div[@class="panels mt10"]/div[4]//div[@class="diet-img clearfix mt20"]/div') 272 | data['recipes'] = [] 273 | for rp in recipes_list: 274 | rp_url = rp.xpath('a/@href')[0] 275 | rp_name = rp.xpath('p/text()')[0].strip() 276 | data['recipes'].append({"rp_url":rp_url, "rp_name":rp_name}) 277 | 278 | return data 279 | 280 | @retry(stop_max_attempt_number=3) 281 | def get_info_drug(d_id): 282 | '''根据疾病ID,到其药品页获取相应信息''' 283 | drug_url = gen_website_url(options.drug, d_id) 284 | rep = requests.get(drug_url, headers = headers) 285 | html = etree.HTML(rep.text) 286 | data = {} 287 | drugs = html.xpath('//div[@class="city-item"]//div[@class="fl drug-pic bor mr10"]') 288 | data['drug'] = [] 289 | for d in drugs: 290 | d_url = d.xpath('a/@href')[0] 291 | data['drug'].append(d_url) 292 | return data 293 | 294 | '''随机测试函数''' 295 | def random_test_func(funcName): 296 | '''随机从id中取出数据,测试上述函数是否发生错误''' 297 | disease_ids = [line.strip() for line in open('entities/disease_id.txt', 'r', encoding = 'utf-8')] 298 | samples = random.sample(disease_ids, 10) 299 | for id in samples: 300 | print(id) 301 | print(funcName(id)) 302 | 303 | def save_test_all(): 304 | '''测试汇总并存储''' 305 | disease_ids = [line.strip() for line in open('entities/disease_id.txt', 'r', encoding = 'utf-8')] 306 | f = open('entities/disease.json','w') 307 | samples = random.sample(disease_ids, 10) 308 | for id in samples: 309 | print(id) 310 | data = { 311 | 'id':id, 312 | **get_info_main(id), 313 | **get_info_other(id), 314 | **get_info_treat(id), 315 | **get_info_food(id), 316 | **get_info_drug(id) 317 | } 318 | print(data) 319 | # 不加ensure_ascii的话,保存到文件是Unicode,看不了中文 320 | f.write(json.dumps(data,ensure_ascii = False) + '\n') 321 | f.close() 322 | 323 | '''多线程进行爬虫下载''' 324 | 325 | class Crawler: 326 | def __init__(self): 327 | self.file = open('entities/disease.json', 'w', encoding = 'utf-8') 328 | self.disease_ids = [line.strip() for line in open('entities/disease_id.txt', 'r', encoding = 'utf-8')] 329 | 330 | @vthread.atom 331 | def save_one_line(self, data:str): 332 | self.file.write(data) 333 | 334 | @vthread.pool(10) 335 | def get_one_line(self, d_id): 336 | '''多线程下载''' 337 | print(d_id) 338 | data = { 339 | 'id': d_id, 340 | **get_info_main(d_id), 341 | **get_info_other(d_id), 342 | **get_info_treat(d_id), 343 | **get_info_food(d_id), 344 | **get_info_drug(d_id) 345 | } 346 | self.save_one_line(json.dumps(data, ensure_ascii = False) + '\n') 347 | 348 | def __del__(self): 349 | self.file.close() 350 | 351 | def run(self): 352 | for d_id in self.disease_ids: 353 | self.get_one_line(d_id) 354 | 355 | def single_process(): 356 | '''单独处理''' 357 | ids = [4839,4467,9765] 358 | for id in ids: 359 | data = { 360 | 'id': id, 361 | **get_info_main(id), 362 | **get_info_other(id), 363 | **get_info_treat(id), 364 | **get_info_food(id), 365 | **get_info_drug(id) 366 | } 367 | print(json.dumps(data, ensure_ascii = False)) 368 | 369 | 370 | if __name__ == '__main__': 371 | # c = Crawler() 372 | # c.run() 373 | '''爬虫总结: 374 | 线程应该开到30甚至50,只有10太慢了 375 | 小部分数据缺少treat_rate或treat_time,后续存入数据库的时候需要注意判断 376 | 忘记在Crawler类中加记录时间的代码了 377 | 3个数据中间出错,需要单独处理。[4839,4467,9765] 378 | ''' 379 | single_process() 380 | ''' 381 | 修改后的版本可以直接用Crawler,应该就没问题了 382 | ''' 383 | # random_test_func(save_info_all) -------------------------------------------------------------------------------- /Crawler/request_others.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | ''' 3 | 通过disease的json文件爬取并保存其他实体的内容 4 | 实体包括{ 5 | 疾病/并发症:disease 6 | 症状:symptom 7 | 检查:check 8 | 药品:drug 9 | 食谱:recipe 10 | } 11 | 12 | 编码问题。由于医疗页面涉及大量不常用词汇,因此用gbk解码是不够的,应该用GB18030 13 | 14 | requests库对中文解码识别有问题,需要用cchardet来进行检测 15 | ''' 16 | 17 | import requests 18 | import json 19 | from lxml import etree 20 | import re 21 | import random 22 | from retrying import retry 23 | import cchardet 24 | import vthread 25 | import time 26 | 27 | headers = { 28 | 'User-Agent': "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36", 29 | 'Accept-Encoding': 'gzip, deflate', 30 | 'Accept-Language': 'zh-CN,zh;q=0.9', 31 | } 32 | 33 | def extract_id(text:str): 34 | '''将id从字符串中抽出''' 35 | return re.search("[0-9]+",text).group() 36 | 37 | def unify(s): 38 | '''去除非法字符''' 39 | return s.replace('\r', '').replace(' ', '').replace('\t', '').replace('\n', '')\ 40 | .replace('\xa0', '').replace('\u3000', '') 41 | 42 | def read_disease_data(): 43 | '''读取disease.json的数据, 只保留其他实体的值''' 44 | lines = [line.strip() for line in open('entities/disease.json', 'r', encoding = 'utf-8')] 45 | for line in lines: 46 | d_data = json.loads(line) 47 | data = { 48 | 'd_id':d_data['id'], 49 | 'recipes':d_data['recipes'], 50 | 'symptoms':d_data['symptoms'], 51 | 'neopathy':d_data['neopathy'], 52 | 'checks':d_data['checkes'], 53 | 'drug':d_data['drug'] 54 | } 55 | yield data 56 | 57 | '''菜谱页面''' 58 | @retry(stop_max_attempt_number=3,wait_fixed=2000) 59 | def get_recipes_info_url(rp_url): 60 | rep = requests.get(rp_url, headers = headers) 61 | encoding = cchardet.detect(rep.content) 62 | rep.encoding = encoding['encoding'] 63 | if not rep.text: 64 | return '', '暂无制作方式' 65 | html = etree.HTML(rep.text) 66 | print(rp_url) 67 | pic_url = html.xpath('//div[@class="w687 fl"]//a/img/@src')[0].strip().replace('error/', '') 68 | produce_way = html.xpath('//div[@class="text-intro f14 graydeep"]/dl[1]//li/text()')[0].strip() 69 | return pic_url, unify(produce_way) 70 | 71 | def get_info_recipies(data:dict, idKey=list()): 72 | '''从data中获取recipes数据,进行爬虫获取其他信息 73 | 菜谱recipes{ 74 | id 75 | name 76 | pic_url 77 | produce_way 78 | } 79 | data['recipes']:[{rp_url, rp_name}...] 80 | ''' 81 | 82 | rps = {} 83 | # print(data['d_id']) 84 | for rp in data['recipes']: 85 | rp_url = rp['rp_url'] 86 | rp_id = extract_id(rp_url) 87 | if idKey and rp_id in idKey: 88 | continue 89 | 90 | rp_name = rp['rp_name'] 91 | pic_url, produce_way = get_recipes_info_url(rp_url) 92 | 93 | rps[str(rp_id)] = { 94 | 'id':rp_id, 95 | 'name':rp_name, 96 | 'pic_url':pic_url, 97 | 'produce_way':produce_way 98 | } 99 | return rps 100 | 101 | 102 | '''检查页面''' 103 | @retry(stop_max_attempt_number=3,wait_fixed=2000) 104 | def get_checks_desc_url(ck_url): 105 | rep = requests.get(ck_url, headers = headers) 106 | encoding = cchardet.detect(rep.content) 107 | if not rep.text: 108 | return '暂无简介' 109 | rep.encoding = encoding['encoding'] 110 | html = etree.HTML(rep.text) 111 | print(ck_url) 112 | desc_tag = html.xpath('//div[@class="baby-weeks"]/p/text()') 113 | if desc_tag: 114 | desc = unify(desc_tag[0].strip()) 115 | else: 116 | desc = '暂无简介' 117 | 118 | return desc 119 | 120 | def get_info_checks(data:dict, idKey=list()): 121 | '''从data中获取checks数据,进行爬虫获取其他信息 122 | 检查checkes{ 123 | id 124 | name 125 | desc 126 | } 127 | data['check']:[{ck_url, ck_name}...] 128 | ''' 129 | cks = {} 130 | # print(data['d_id']) 131 | for ck in data['checks']: 132 | ck_url = ck['ck_url'] 133 | ck_id = extract_id(ck_url) 134 | 135 | if idKey and ck_id in idKey: 136 | continue 137 | ck_name = ck['ck_name'] 138 | 139 | desc = get_checks_desc_url(ck_url) 140 | 141 | cks[str(ck_id)] = { 142 | 'id': ck_id, 143 | 'name': ck_name, 144 | 'desc': desc 145 | } 146 | return cks 147 | 148 | 149 | '''症状页面''' 150 | @retry(stop_max_attempt_number=3,wait_fixed=2000) 151 | def get_symptoms_desc_url(sm_url): 152 | rep = requests.get(sm_url, headers = headers) 153 | encoding = cchardet.detect(rep.content) 154 | rep.encoding = encoding['encoding'] 155 | html = etree.HTML(rep.text) 156 | desc_tags = html.xpath('//div[@class="zz-articl fr f14"]//*') 157 | desc_list = [] 158 | for tag in desc_tags: 159 | s_list = tag.xpath('text()') 160 | if s_list and unify(s_list[0]): 161 | desc_list.append(unify(s_list[0])) 162 | if not desc_list: 163 | desc_list.append('暂无简介') 164 | return ','.join(desc_list) 165 | 166 | def get_symptoms_diagnose_url(sm_url): 167 | rep = requests.get(sm_url, headers = headers) 168 | encoding = cchardet.detect(rep.content) 169 | rep.encoding = encoding['encoding'] 170 | html = etree.HTML(rep.text) 171 | desc_tags = html.xpath('//div[@class="zz-articl fr f14"]//*') 172 | desc_list = [] 173 | for tag in desc_tags: 174 | s_list = tag.xpath('text()') 175 | if s_list and unify(s_list[0]): 176 | desc_list.append(unify(s_list[0])) 177 | if not desc_list: 178 | desc_list.append('暂无简介') 179 | return ','.join(desc_list) 180 | 181 | def get_info_symptoms(data:dict, idKey=list()): 182 | '''从data中获取checks数据,进行爬虫获取其他信息 183 | 症状symptoms{ 184 | id 185 | name 186 | desc 187 | diagnose 188 | } 189 | data['symptoms']:[{sm_id, sm_name}...] 190 | ''' 191 | sms = {} 192 | # print(data['d_id']) 193 | for sm in data['symptoms']: 194 | sm_name = sm['sm_name'] 195 | sm_id = sm['sm_id'] 196 | if idKey and sm_id in idKey: 197 | continue 198 | # desc = get_symptoms_desc_url('http://zzk.xywy.com/{sm_id}_jieshao.html'.format(sm_id=sm_id)) 199 | # diagnose = get_symptoms_diagnose_url('http://zzk.xywy.com/{sm_id}_zhenduan.html'.format(sm_id=sm_id)) 200 | 201 | sms[str(sm_id)] = { 202 | 'id': sm_id, 203 | 'name': sm_name, 204 | # 'desc': desc, 205 | # 'diagnose':diagnose 206 | } 207 | return sms 208 | 209 | 210 | '''药品页面''' 211 | @retry(stop_max_attempt_number=3,wait_fixed=2000) 212 | def get_drugs_info_url(dg_url): 213 | rep = requests.get(dg_url, headers = headers) 214 | encoding = cchardet.detect(rep.content) 215 | rep.encoding = encoding['encoding'] 216 | html = etree.HTML(rep.text) 217 | print(dg_url) 218 | # 这个网站有个坑,长同个格式的网页可以访问到不同页面 219 | if rep.url != dg_url: 220 | return None, None, None, None, None 221 | 222 | pic_url = html.xpath('//div[@class="p-jqzoom fl mt20 ml20"]//img[1]/@src')[0] 223 | price = html.xpath('//div[@class="d-info-dl mt5"]//dl[2]/dd/span/text()')[0].strip() 224 | 225 | dl_tags = html.xpath('//div[@class="d-tab-inf"]/dl') 226 | name=func=use=None 227 | for dl in dl_tags: 228 | left = dl.xpath('dt/text()')[0].strip() 229 | if left == '批准文号': 230 | continue 231 | right = dl.xpath('dd/text()') 232 | if right: 233 | right = right[0].strip() 234 | else: 235 | right = None 236 | 237 | if left == '商品名称': 238 | name = right 239 | 240 | if left == '功能主治': 241 | func = right 242 | 243 | if left == '用法用量': 244 | use = right 245 | 246 | if not name: 247 | raise Exception('药品没有名字: '+dg_url) 248 | if not func: 249 | func = '暂无功能主治信息' 250 | if not use: 251 | use = '暂无用法用量信息' 252 | 253 | return name,pic_url, price, func, use 254 | 255 | def get_info_drugs(data:dict, idKey=list()): 256 | '''从data中获取checks数据,进行爬虫获取其他信息 257 | 药物drug{ 258 | id 259 | name 260 | pic_url 261 | price 262 | func 263 | use 264 | } 265 | data['drug']:[url1,url2...] 266 | ''' 267 | dgs = {} 268 | for dg_url in data['drug']: 269 | dg_id = extract_id(dg_url) 270 | if idKey and dg_id in idKey: 271 | continue 272 | name, pic_url, price, func, use = get_drugs_info_url(dg_url) 273 | # 如果遇到坑的网站,直接跳过一个药品 274 | if name==None or pic_url==None or price==None or func==None or use==None: 275 | continue 276 | dgs[str(dg_id)] = { 277 | 'id':dg_id, 278 | 'name':name, 279 | 'pic_url':pic_url, 280 | 'price':price, 281 | 'func':func, 282 | 'use':use 283 | } 284 | return dgs 285 | 286 | 287 | '''随机测试一些数据''' 288 | def random_test_func(funcName): 289 | lines = [line.strip() for line in open('entities/disease.json', 'r', encoding = 'utf-8')] 290 | tests = random.sample(lines,10) 291 | for t in tests: 292 | d_data = json.loads(t) 293 | data = { 294 | 'd_id': d_data['id'], 295 | 'recipes': d_data['recipes'], 296 | 'symptoms': d_data['symptoms'], 297 | 'neopathy': d_data['neopathy'], 298 | 'checks': d_data['checkes'], 299 | 'drug': d_data['drug'] 300 | } 301 | res = funcName(data) 302 | print(res) 303 | 304 | '''多线程爬虫''' 305 | class Crawler: 306 | def __init__(self,fileName, funcName): 307 | # 根据传递的参数不同爬取不同的实体 308 | self.file = open('entities/{fn}.json'.format(fn=fileName), 'w', encoding = 'utf-8') 309 | self.funcName = funcName 310 | self.t = time.clock() 311 | self.idKey = set() 312 | 313 | @vthread.atom 314 | def update_Data(self, batch_data:dict): 315 | for key in batch_data.keys(): 316 | if key not in self.idKey: 317 | self.idKey.add(key) 318 | self.file.write(json.dumps(batch_data[key], ensure_ascii = False) + '\n') 319 | 320 | @vthread.pool(1) 321 | def get_data(self, data:dict, cur_cnt): 322 | print('当前进度: {0} / {1}'.format(cur_cnt, 6544)) 323 | batch_data = self.funcName(data) 324 | self.update_Data(batch_data) 325 | 326 | def run(self): 327 | cnt = 0 328 | for data in read_disease_data(): 329 | cnt += 1 330 | self.get_data(data, cnt) 331 | # if cnt==10: 332 | # break 333 | 334 | def __del__(self): 335 | self.file.close() 336 | print('总共花费时间: %f'%(time.clock()-self.t)) 337 | 338 | 339 | if __name__ == '__main__': 340 | # data = read_disease_data() 341 | # print(data) 342 | # random_test_func(get_info_drugs) 343 | # print(get_drugs_info_url('http://yao.xywy.com/goods/9743.htm')) 344 | '''drug''' 345 | # c = Crawler('drug', get_info_drugs) 346 | # c.run() 347 | '''check''' 348 | # c = Crawler('check', get_info_checks) 349 | # c.run() 350 | '''recipe''' 351 | # c = Crawler('recipe', get_info_recipies) 352 | # c.run() 353 | '''symptom''' 354 | c = Crawler('symptom', get_info_symptoms) 355 | c.run() 356 | 357 | -------------------------------------------------------------------------------- /MedicalAssistant/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jezemy/MASystem/7f1b86da04250ca9f5ebdafb956e330bb0449bea/MedicalAssistant/__init__.py -------------------------------------------------------------------------------- /MedicalAssistant/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jezemy/MASystem/7f1b86da04250ca9f5ebdafb956e330bb0449bea/MedicalAssistant/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /MedicalAssistant/__pycache__/settings.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jezemy/MASystem/7f1b86da04250ca9f5ebdafb956e330bb0449bea/MedicalAssistant/__pycache__/settings.cpython-36.pyc -------------------------------------------------------------------------------- /MedicalAssistant/__pycache__/urls.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jezemy/MASystem/7f1b86da04250ca9f5ebdafb956e330bb0449bea/MedicalAssistant/__pycache__/urls.cpython-36.pyc -------------------------------------------------------------------------------- /MedicalAssistant/__pycache__/wsgi.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jezemy/MASystem/7f1b86da04250ca9f5ebdafb956e330bb0449bea/MedicalAssistant/__pycache__/wsgi.cpython-36.pyc -------------------------------------------------------------------------------- /MedicalAssistant/settings.py: -------------------------------------------------------------------------------- 1 | """ 2 | Django settings for MedicalAssistant project. 3 | 4 | Generated by 'django-admin startproject' using Django 2.1.7. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/2.1/topics/settings/ 8 | 9 | For the full list of settings and their values, see 10 | https://docs.djangoproject.com/en/2.1/ref/settings/ 11 | """ 12 | 13 | import os 14 | 15 | # Build paths inside the project like this: os.path.join(BASE_DIR, ...) 16 | BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 17 | 18 | PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__)) 19 | 20 | # Quick-start development settings - unsuitable for production 21 | # See https://docs.djangoproject.com/en/2.1/howto/deployment/checklist/ 22 | 23 | # SECURITY WARNING: keep the secret key used in production secret! 24 | SECRET_KEY = '*&5!-dlo+-8!^+e+q*i6l&6-948e9njg4lzgv)z31a0karul67' 25 | 26 | # SECURITY WARNING: don't run with debug turned on in production! 27 | DEBUG = True 28 | 29 | ALLOWED_HOSTS = ["*"] 30 | 31 | 32 | # Application definition 33 | 34 | INSTALLED_APPS = [ 35 | 'django.contrib.admin', 36 | 'django.contrib.auth', 37 | 'django.contrib.contenttypes', 38 | 'django.contrib.sessions', 39 | 'django.contrib.messages', 40 | 'django.contrib.staticfiles', 41 | 'robot' 42 | ] 43 | 44 | MIDDLEWARE = [ 45 | 'django.middleware.security.SecurityMiddleware', 46 | 'django.contrib.sessions.middleware.SessionMiddleware', 47 | 'django.middleware.common.CommonMiddleware', 48 | 'django.middleware.csrf.CsrfViewMiddleware', 49 | 'django.contrib.auth.middleware.AuthenticationMiddleware', 50 | 'django.contrib.messages.middleware.MessageMiddleware', 51 | 'django.middleware.clickjacking.XFrameOptionsMiddleware', 52 | ] 53 | 54 | ROOT_URLCONF = 'MedicalAssistant.urls' 55 | 56 | TEMPLATES = [ 57 | { 58 | 'BACKEND': 'django.template.backends.django.DjangoTemplates', 59 | 'DIRS': [os.path.join(BASE_DIR, 'templates')], 60 | 'APP_DIRS': True, 61 | 'OPTIONS': { 62 | 'context_processors': [ 63 | 'django.template.context_processors.debug', 64 | 'django.template.context_processors.request', 65 | 'django.contrib.auth.context_processors.auth', 66 | 'django.contrib.messages.context_processors.messages', 67 | ], 68 | }, 69 | }, 70 | ] 71 | 72 | WSGI_APPLICATION = 'MedicalAssistant.wsgi.application' 73 | 74 | 75 | # Database 76 | # https://docs.djangoproject.com/en/2.1/ref/settings/#databases 77 | 78 | DATABASES = { 79 | 'default': { 80 | 'ENGINE': 'django.db.backends.sqlite3', 81 | 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), 82 | } 83 | } 84 | 85 | 86 | # Password validation 87 | # https://docs.djangoproject.com/en/2.1/ref/settings/#auth-password-validators 88 | 89 | AUTH_PASSWORD_VALIDATORS = [ 90 | { 91 | 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', 92 | }, 93 | { 94 | 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', 95 | }, 96 | { 97 | 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', 98 | }, 99 | { 100 | 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', 101 | }, 102 | ] 103 | 104 | 105 | LANGUAGE_CODE = 'zh-Hans' 106 | 107 | TIME_ZONE = 'Asia/Shanghai' 108 | 109 | USE_I18N = True 110 | 111 | USE_L10N = True 112 | 113 | USE_TZ = True 114 | 115 | 116 | # Static files (CSS, JavaScript, Images) 117 | # https://docs.djangoproject.com/en/2.1/howto/static-files/ 118 | 119 | STATIC_URL = '/static/' 120 | STATIC_ROOT=os.path.join(BASE_DIR,'/static/') 121 | 122 | STATICFILES_DIRS = [ 123 | os.path.join(BASE_DIR,'static') 124 | ] 125 | 126 | -------------------------------------------------------------------------------- /MedicalAssistant/urls.py: -------------------------------------------------------------------------------- 1 | """MedicalAssistant URL Configuration 2 | 3 | The `urlpatterns` list routes URLs to views. For more information please see: 4 | https://docs.djangoproject.com/en/2.1/topics/http/urls/ 5 | Examples: 6 | Function views 7 | 1. Add an import: from my_app import views 8 | 2. Add a URL to urlpatterns: path('', views.home, name='home') 9 | Class-based views 10 | 1. Add an import: from other_app.views import Home 11 | 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') 12 | Including another URLconf 13 | 1. Import the include() function: from django.urls import include, path 14 | 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) 15 | """ 16 | from django.contrib import admin 17 | from django.urls import path,include 18 | 19 | urlpatterns = [ 20 | path('admin/', admin.site.urls), 21 | path('',include('robot.urls',namespace = 'robot')), 22 | ] 23 | -------------------------------------------------------------------------------- /MedicalAssistant/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for MedicalAssistant project. 3 | 4 | It exposes the WSGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/2.1/howto/deployment/wsgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.wsgi import get_wsgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'MedicalAssistant.settings') 15 | 16 | application = get_wsgi_application() 17 | -------------------------------------------------------------------------------- /assets/image-20230319192131382.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jezemy/MASystem/7f1b86da04250ca9f5ebdafb956e330bb0449bea/assets/image-20230319192131382.png -------------------------------------------------------------------------------- /assets/image-20230319192207463.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jezemy/MASystem/7f1b86da04250ca9f5ebdafb956e330bb0449bea/assets/image-20230319192207463.png -------------------------------------------------------------------------------- /assets/image-20230319192224207.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jezemy/MASystem/7f1b86da04250ca9f5ebdafb956e330bb0449bea/assets/image-20230319192224207.png -------------------------------------------------------------------------------- /assets/image-20230319192224213.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jezemy/MASystem/7f1b86da04250ca9f5ebdafb956e330bb0449bea/assets/image-20230319192224213.png -------------------------------------------------------------------------------- /assets/image-20230319200606840.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jezemy/MASystem/7f1b86da04250ca9f5ebdafb956e330bb0449bea/assets/image-20230319200606840.png -------------------------------------------------------------------------------- /classifier/dict/affirm.txt: -------------------------------------------------------------------------------- 1 | 是 2 | 对 3 | 没错 4 | 正确 5 | 好的 6 | 好 7 | 行的 8 | 可以 9 | 不错 10 | 那行 11 | ok 12 | ojbk 13 | 正是 14 | 没毛病 15 | 行吧 16 | 嗯嗯 17 | 嗯 18 | 哦 19 | 哦哦 20 | o 21 | 嗯嘛 22 | 嗯啊 23 | 嗯呀 24 | en -------------------------------------------------------------------------------- /classifier/dict/deny.txt: -------------------------------------------------------------------------------- 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 | 别 -------------------------------------------------------------------------------- /classifier/dict/goodbye.txt: -------------------------------------------------------------------------------- 1 | 再见 2 | 拜拜 3 | 拜 4 | 886 5 | 走了,下次再聊 6 | 我先走了哦 7 | 临时有事,下次再聊 8 | 好的,再见 -------------------------------------------------------------------------------- /classifier/dict/greet.txt: -------------------------------------------------------------------------------- 1 | 你好 2 | 早上好 3 | 哈喽 4 | hello 5 | hi 6 | 在吗 7 | 中午好 8 | 晚上好 9 | 你好呀 10 | 在吗在吗 11 | 有人吗 -------------------------------------------------------------------------------- /classifier/dict/thankyou.txt: -------------------------------------------------------------------------------- 1 | 谢谢 2 | 感谢 3 | 谢了 4 | 蟹蟹 5 | 万分感谢 6 | 十分感谢 7 | 谢谢谢谢 8 | 感激不尽 9 | 无以回报 10 | 感谢万分 -------------------------------------------------------------------------------- /classifier/fasttext_data.txt: -------------------------------------------------------------------------------- 1 | _affirm 没错 2 | _affirm 嗯啊 3 | _affirm 可以 4 | _affirm 没毛病 5 | _affirm 好的 6 | _affirm 行的 7 | _affirm 行吧 8 | _affirm ojbk 9 | _affirm 哦哦 10 | _affirm 嗯 11 | _affirm 正是 12 | _affirm 不错 13 | _affirm en 14 | _affirm ok 15 | _affirm 16 | _affirm 哦 17 | _affirm 是 18 | _affirm 正确 19 | _affirm 那行 20 | _affirm o 21 | _affirm 对 22 | _deny 别 23 | _deny 并未 24 | _deny 切勿 25 | _deny 毋 26 | _deny 拒绝 27 | _deny 没 28 | _deny 不要 29 | _deny 否 30 | _deny 没有 31 | _deny 不可 32 | _deny 不能 33 | _deny 不 34 | _deny 无 35 | _deny 勿 36 | _deny 弗 37 | _deny 未 38 | _deny 不是 39 | _deny 并无 40 | _deny 莫 41 | _deny 仍未 42 | _deny 不再 43 | _deny 非 44 | _disease_cause 怎样 导致 疾病 45 | _disease_cause 怎么样 才 会 46 | _disease_cause 由 什么 引起 47 | _disease_cause 想 知道 疾病 一般 是 怎么 引起 48 | _disease_cause 如何 会 49 | _disease_cause 麻烦 跟 说 为什么 会 50 | _disease_cause 疾病 病因 是 什么 51 | _disease_cause 想 知道 一般 是 怎么 引起 52 | _disease_cause 为什么 会 疾病 53 | _disease_cause 为什么 会 54 | _disease_cause 疾病 由 什么 引起 55 | _disease_cause 如何 会 疾病 56 | _disease_cause 为何 会 疾病 57 | _disease_cause 为啥 会 58 | _disease_cause 疾病 是因为 什么 导致 59 | _disease_cause 麻烦 告诉 疾病 是 为什么 60 | _disease_cause 成因 61 | _disease_cause 疾病 通常 是 什么 引起 62 | _disease_cause 这是 怎么 导致 63 | _disease_cause 通常 是 什么 引起 64 | _disease_cause 什么 情况 会 发生 65 | _disease_cause 一般 由 什么 情况 引发 66 | _disease_cause 麻烦 告诉 是 为什么 67 | _disease_cause 为什么 我会 68 | _disease_cause 想 知道 是 怎么 会 疾病 69 | _disease_cause 为什么 我会 疾病 70 | _disease_cause 什么 情况 会 发生 疾病 71 | _disease_cause 疾病 怎么 会 72 | _disease_cause 疾病 是 什么 导致 73 | _disease_cause 怎么 会 呢 74 | _disease_cause 疾病 是 怎么 引起 75 | _disease_cause 怎么 会 76 | _disease_cause 是因为 什么 导致 77 | _disease_cause 咋样 才 会 疾病 78 | _disease_cause 疾病 是 由 什么 引起 79 | _disease_cause 咋样 才 会 80 | _disease_cause 疾病 一般 由 什么 情况 引发 81 | _disease_cause 怎样 导致 82 | _disease_cause 是 什么 原因 83 | _disease_cause 为什么 会 导致 84 | _disease_cause 为什么 会 呢 85 | _disease_cause 怎么样 才 会 疾病 86 | _disease_cause 是 由 什么 引起 87 | _disease_cause 是 怎么 引起 88 | _disease_cause 怎么 会 89 | _disease_cause 为什么 会 导致 疾病 90 | _disease_cause 为何 会 91 | _disease_cause 疾病 会 是 什么 导致 呢 92 | _disease_cause 会 是 什么 导致 呢 93 | _disease_cause 想 知道 是 怎么 会 94 | _disease_cause 怎么 会 呢 95 | _disease_cause 是 怎么 会 96 | _disease_cause 这是 怎么 导致 97 | _disease_cause 怎么 会 疾病 98 | _disease_cause 为什么 会 疾病 呢 99 | _disease_department 去 哪个 科室 100 | _disease_department 去 哪个 科 治疗 疾病 101 | _disease_department 属于 什么 科室 102 | _disease_department 疾病 挂 什么 科室 103 | _disease_department 去 哪 看病 104 | _disease_department 属于 什么 地方 管 105 | _disease_department 挂 什么 科室 106 | _disease_department 疾病 去 哪 找 医生 107 | _disease_department 疾病 去 哪 看病 108 | _disease_department 去 哪 找 医生 109 | _disease_department 找 什么 医生 挂号 110 | _disease_department 疾病 去 什么 科室 看病 111 | _disease_department 去 什么 科室 看病 112 | _disease_department 去 哪个 科室 治疗 疾病 113 | _disease_department 疾病 去 挂 什么 号 114 | _disease_department 疾病 属于 什么 科 115 | _disease_department 什么 科室 管 疾病 116 | _disease_department 挂 什么 科 117 | _disease_department 疾病 找 什么 医生 挂号 118 | _disease_department 去 哪个 科室 治疗 119 | _disease_department 疾病 属于 什么 地方 管 120 | _disease_department 疾病 去 哪个 科室 121 | _disease_department 疾病 属于 什么 科室 122 | _disease_department 属于 什么 科 123 | _disease_department 去 哪个 科 治疗 124 | _disease_department 去 什么 地方 治疗 疾病 125 | _disease_department 疾病 挂 什么 科 126 | _disease_department 去 哪里 才能 治疗 疾病 127 | _disease_desc 麻烦 说 下 疾病 是 个 啥 128 | _disease_desc 啥 是 疾病 129 | _disease_desc 疾病 是 啥病 130 | _disease_desc 疾病 131 | _disease_desc 疾病 是 个 啥子 132 | _disease_desc 这是 什么 疾病 133 | _disease_desc 疾病 是 什么 病 134 | _disease_desc 疾病 是 个 什么 东西 135 | _disease_desc 啥病 是 疾病 136 | _disease_desc 请问 啥 玩意 是 疾病 137 | _disease_desc 什么 东西 是 疾病 138 | _disease_desc 疾病 简介 是 什么 139 | _disease_desc 疾病 是 什么 玩意 140 | _disease_desc 到底 什么 才 是 疾病 141 | _disease_desc 啥 玩意 叫 疾病 142 | _disease_desc 麻烦 解释一下 什么 是 疾病 143 | _disease_desc 疾病 是 什么 144 | _disease_desc 能 说 什么 是 疾病 145 | _disease_desc 请问 疾病 是 什么 146 | _disease_desc 我想 问下 疾病 147 | _disease_desc 疾病 到底 是 啥子 148 | _disease_desc 我想 问下 疾病 是 啥 149 | _disease_desc 什么 病是 疾病 150 | _disease_desc 这是 什么 151 | _disease_desc 疾病 究竟 是 什么 152 | _disease_desc 疾病 是 啥 153 | _disease_desc 什么 是 疾病 154 | _disease_diet 疾病 的话 吃 什么 东西 155 | _disease_diet 吃 什么 菜 可以 帮助 疾病 156 | _disease_diet 疾病 不能 吃 什么 157 | _disease_diet 疾病 吃 东西 有 什么 注意 158 | _disease_diet 吃 东西 注意 什么 159 | _disease_diet 吃 东西 有 什么 注意 160 | _disease_diet 吃点 什么 东西 疾病 161 | _disease_diet 疾病 吃些 什么 162 | _disease_diet 疾病 食品 163 | _disease_diet 疾病 可以 吃 什么 164 | _disease_diet 吃 什么 东西 有 帮助 165 | _disease_diet 吃 什么 有助于 疾病 166 | _disease_diet 疾病 食用 什么 167 | _disease_diet 可以 吃 168 | _disease_diet 疾病 可以 喝些 什么 东西 169 | _disease_diet 疾病 有 什么 推荐 吃 170 | _disease_diet 可以 吃些 什么 东西 171 | _disease_diet 忌口 有 什么 172 | _disease_diet 有 什么 菜谱 推荐 173 | _disease_diet 吃 什么 东西 好得快 174 | _disease_diet 有 什么 菜谱 有助于 疾病 快点 恢复 175 | _disease_diet 疾病 吃 啥 176 | _disease_diet 吃 方面 有 什么 禁忌 177 | _disease_diet 疾病 吃 方面 有 什么 禁忌 178 | _disease_diet 喝 什么 179 | _disease_diet 伙食 180 | _disease_diet 不能 吃 什么 181 | _disease_diet 吃点 什么 东西 182 | _disease_diet 疾病 吃 什么 183 | _disease_diet 疾病 吃 什么 东西 好得快 184 | _disease_diet 有 什么 补品 适合 吃 185 | _disease_diet 食用 什么 186 | _disease_diet 可以 吃些 什么 东西 疾病 187 | _disease_diet 有 什么 菜谱 有助于 快点 恢复 188 | _disease_diet 疾病 饮用 什么 189 | _disease_diet 疾病 有 相关 菜谱 190 | _disease_diet 疾病 有 什么 不能 吃 191 | _disease_diet 的话 吃 什么 东西 192 | _disease_diet 有 什么 可以 吃 193 | _disease_diet 有 什么 补品 适合 疾病 吃 194 | _disease_diet 可以 喝 195 | _disease_diet 吃 什么 菜 可以 196 | _disease_diet 疾病 吃 什么 197 | _disease_diet 吃 什么 有助于 198 | _disease_diet 疾病 补品 有 什么 199 | _disease_diet 疾病 有 什么 推荐 吃 200 | _disease_diet 疾病 有 什么 可以 吃 201 | _disease_diet 有 相关 菜谱 202 | _disease_diet 吃 什么 203 | _disease_diet 疾病 伙食 204 | _disease_diet 疾病 可以 吃 什么 东西 205 | _disease_diet 有 什么 推荐 吃 206 | _disease_diet 疾病 喝 什么 207 | _disease_diet 饮用 什么 208 | _disease_diet 食品 209 | _disease_diet 可以 吃 什么 210 | _disease_diet 吃 什么 食物 211 | _disease_diet 疾病 吃 什么 212 | _disease_diet 饮食 注意 什么 213 | _disease_diet 吃 什么 214 | _disease_diet 有 什么 不能 吃 215 | _disease_diet 疾病 忌口 有 什么 216 | _disease_diet 疾病 吃 东西 注意 什么 217 | _disease_diet 食用 什么 食品 有助于 疾病 218 | _disease_diet 吃些 什么 219 | _disease_diet 吃 什么 220 | _disease_diet 疾病 饮食 注意 什么 221 | _disease_drug 通常 吃 什么 药品 222 | _disease_drug 疾病 喝 口服液 可以 223 | _disease_drug 疾病 吃 什么 胶囊 224 | _disease_drug 吃 什么 药品 225 | _disease_drug 什么 药对 治疗 疾病 有 影响 226 | _disease_drug 喝 口服液 可以 227 | _disease_drug 疾病 吃 什么 药 好得快 228 | _disease_drug 疾病 吃 什么 药 比较 229 | _disease_drug 对于 吃 什么 药好 230 | _disease_drug 疾病 吃 什么 药品 231 | _disease_drug 吃 什么 胶囊 232 | _disease_drug 有 什么 药品 可以 治疗 疾病 233 | _disease_drug 疾病 吃 什么 药好 234 | _disease_drug 吃 什么 药好 235 | _disease_drug 疾病 一般 会 吃 什么 药 236 | _disease_drug 什么 药品 对 疾病 237 | _disease_drug 想 吃 点药 238 | _disease_drug 什么 药物 推荐 在 疾病 服用 239 | _disease_drug 什么 药物 可以 治疗 疾病 240 | _disease_drug 疾病 吃 什么 药品 可以 恢复 得 快 241 | _disease_drug 疾病 有 什么 药片 可以 吃 242 | _disease_drug 有 什么 药片 可以 吃 243 | _disease_drug 疾病 吃 什么 药 244 | _disease_drug 中药 可以 治疗 245 | _disease_drug 什么 药物 推荐 在 服用 246 | _disease_drug 有 推荐 药片 247 | _disease_drug 疾病 可以 喝 什么 口服液 248 | _disease_drug 用药 249 | _disease_drug 有 什么 用药 推荐 疾病 250 | _disease_drug 对于 疾病 吃 什么 药好 251 | _disease_drug 有 什么 药品 可以 治疗 252 | _disease_drug 吃 什么 药 253 | _disease_drug 吃 什么 药 好得快 254 | _disease_drug 有 什么 中药 或者 西药 推荐 255 | _disease_drug 吃点 什么 药好 呢 256 | _disease_drug 疾病 推荐 吃 什么 药 257 | _disease_drug 疾病 吃些 什么 药物 258 | _disease_drug 有 什么 用药 推荐 259 | _disease_drug 疾病 用药 260 | _disease_drug 吃 什么 药品 可以 对付 261 | _disease_drug 中药 可以 治疗 疾病 262 | _disease_drug 什么 药品 对 263 | _disease_drug 疾病 可以 吃 什么 药 264 | _disease_drug 疾病 吃 什么 药好 265 | _disease_drug 什么 西药 可以 治疗 疾病 266 | _disease_drug 推荐 吃 什么 药 267 | _disease_drug 疾病 吃 什么 药物 268 | _disease_drug 吃 什么 药好 269 | _disease_drug 吃 什么 药 对于 有 帮助 270 | _disease_drug 得 吃 什么 药 271 | _disease_drug 什么 药对 治疗 有 影响 272 | _disease_drug 疾病 可以 服用 什么 药物 273 | _disease_drug 吃 什么 药物 274 | _disease_drug 吃 什么 药 对于 疾病 有 帮助 275 | _disease_drug 可以 喝 什么 口服液 276 | _disease_drug 疾病 吃 什么 药品 277 | _disease_drug 什么 西药 可以 治疗 278 | _disease_drug 吃 什么 药品 可以 恢复 得 快 279 | _disease_drug 疾病 通常 吃 什么 药品 280 | _disease_drug 吃 什么 药品 可以 对付 疾病 281 | _disease_drug 得 疾病 吃 什么 药 282 | _disease_drug 一般 会 吃 什么 药 283 | _disease_drug 吃些 什么 药物 284 | _disease_drug 疾病 有 什么 中药 或者 西药 推荐 285 | _disease_easy_get 疾病 一般 会 在 什么 人群 发生 286 | _disease_easy_get 谁 会 染上 疾病 287 | _disease_easy_get 谁 容易 得 288 | _disease_easy_get 哪些 人 容易 疾病 289 | _disease_easy_get 小孩 会得 上 疾病 290 | _disease_easy_get 一般 谁 比较 容易 得 291 | _disease_easy_get 疾病 常见 在 什么 人群 292 | _disease_easy_get 谁 容易 感染 疾病 293 | _disease_easy_get 谁 容易 患上 疾病 294 | _disease_easy_get 易感 人群 295 | _disease_easy_get 谁 比较 容易 得 疾病 296 | _disease_easy_get 小孩 会得 上 297 | _disease_easy_get 一般 会 在 什么 人群 发生 298 | _disease_easy_get 谁 容易 患上 299 | _disease_easy_get 疾病 易发 人群 300 | _disease_easy_get 谁 会 染上 301 | _disease_easy_get 成年人 容易 得 上 疾病 302 | _disease_easy_get 易感 人群 有 哪些 303 | _disease_easy_get 谁 容易 得 疾病 304 | _disease_easy_get 谁 比较 容易 感染 305 | _disease_easy_get 疾病 易感 人群 有 哪些 306 | _disease_easy_get 什么样 人会 307 | _disease_easy_get 成年人 容易 得 上 308 | _disease_easy_get 什么样 人会 疾病 309 | _disease_easy_get 疾病 易感 人群 310 | _disease_easy_get 疾病 一般 谁 比较 容易 得 311 | _disease_easy_get 什么 人会 患上 312 | _disease_easy_get 什么 人 容易 313 | _disease_easy_get 哪些 人会 314 | _disease_easy_get 谁 比较 容易 得 315 | _disease_easy_get 那些 人会 疾病 316 | _disease_easy_get 常见 在 什么 人群 317 | _disease_easy_get 易发 人群 318 | _disease_easy_get 什么 人会 患上 疾病 319 | _disease_easy_get 那些 人会 320 | _disease_neopathy 一同 发生 什么 321 | _disease_neopathy 什么 病会 和 一起 发生 322 | _disease_neopathy 疾病 通常 还会 伴随 什么 现象 323 | _disease_neopathy 疾病 会 一起 出现 什么 324 | _disease_neopathy 并发症 有 什么 325 | _disease_neopathy 会 伴随 发生 什么 326 | _disease_neopathy 通常 还会 伴随 什么 现象 327 | _disease_neopathy 疾病 并发症 328 | _disease_neopathy 什么 会 和 疾病 一 起来 329 | _disease_neopathy 疾病 并发症 有 什么 330 | _disease_neopathy 什么 会 随着 它 一起 发生 331 | _disease_neopathy 什么 会 和 一 起来 332 | _disease_neopathy 会 一并 发生 什么 333 | _disease_neopathy 会 引发 什么 334 | _disease_neopathy 还会 出现 什么 并发症 335 | _disease_neopathy 疾病 会 引发 什么 336 | _disease_neopathy 并发症 337 | _disease_neopathy 有 什么 并发症 338 | _disease_neopathy 什么 症状 会 跟着 一 起来 339 | _disease_neopathy 疾病 会 伴随 发生 什么 340 | _disease_neopathy 疾病 有 什么 并发症 341 | _disease_neopathy 什么 会 和 疾病 一起 发生 342 | _disease_neopathy 疾病 还会 出现 什么 并发症 343 | _disease_neopathy 什么 疾病 会 随着 疾病 一起 发生 344 | _disease_neopathy 疾病 还会 出现 什么 情况 345 | _disease_neopathy 会 一起 出现 什么 346 | _disease_neopathy 什么 会 一起 发生 347 | _disease_neopathy 疾病 一同 发生 什么 348 | _disease_neopathy 还会 出现 什么 情况 349 | _disease_prevent 怎样 避开 疾病 350 | _disease_prevent 怎么样 才 能够 不 疾病 351 | _disease_prevent 咋样 才能 不 352 | _disease_prevent 怎样才能 不 疾病 353 | _disease_prevent 怎样 防止 疾病 354 | _disease_prevent 咋 才能 不得 355 | _disease_prevent 咋 才能 不得 疾病 356 | _disease_prevent 如何 防范 疾病 357 | _disease_prevent 怎样才能 预防 疾病 358 | _disease_prevent 咋样 不 359 | _disease_prevent 如何 抵制 疾病 360 | _disease_prevent 咋样 才 可以 不 疾病 361 | _disease_prevent 如何 提前 抵制 疾病 362 | _disease_prevent 怎样才能 提前 预防 疾病 363 | _disease_prevent 如何 躲避 364 | _disease_prevent 怎样才能 不 染上 365 | _disease_prevent 咋样 才 可以 不 366 | _disease_prevent 怎样 避开 367 | _disease_prevent 怎样才能 不 被 疾病 染上 368 | _disease_prevent 怎样才能 提前 预防 369 | _disease_prevent 怎样才能 不 370 | _disease_prevent 如何 预防 疾病 371 | _disease_prevent 如何 提前 抵制 372 | _disease_prevent 不想 疾病 怎么 做 373 | _disease_prevent 如何 不 374 | _disease_prevent 怎么样 才 能够 不 375 | _disease_prevent 如何 预防 376 | _disease_prevent 怎样才能 有效 预防 疾病 377 | _disease_prevent 如何 才 可以 不 疾病 378 | _disease_prevent 不想 得 疾病 怎么办 379 | _disease_prevent 不想 得 怎么办 380 | _disease_prevent 咋样 才能 不 疾病 381 | _disease_prevent 有 什么 预防措施 可以 不 382 | _disease_prevent 如何 去 预防 383 | _disease_prevent 麻烦 告诉 怎么 避免 384 | _disease_prevent 有 什么 预防措施 可以 不 疾病 385 | _disease_prevent 麻烦 告诉 怎么 避免 疾病 386 | _disease_prevent 如何 抵制 387 | _disease_prevent 怎样才能 不 388 | _disease_prevent 疾病 如何 躲避 389 | _disease_prevent 想 请问 下 如何 避免 疾病 390 | _disease_prevent 想 请问 下 如何 避免 391 | _disease_prevent 怎样才能 不 染上 疾病 392 | _disease_prevent 怎样才能 预防 393 | _disease_prevent 如何 才 可以 不 394 | _disease_prevent 如何 预防 395 | _disease_prevent 怎么 才 不 疾病 396 | _disease_prevent 怎样才能 有效 预防 397 | _disease_prevent 不想 怎么 做 398 | _disease_prevent 怎么 才 不 399 | _disease_prevent 怎样才能 不 被 染上 400 | _disease_symptom 如何 判断 疾病 401 | _disease_symptom 好像 疾病 402 | _disease_symptom 会 有 什么 现象 403 | _disease_symptom 一般 会 如何 404 | _disease_symptom 到底 如何 才能 判断 已经 405 | _disease_symptom 一般 会 出现 什么 症状 406 | _disease_symptom 疾病 有 什么 症状 407 | _disease_symptom 想 知道 怎么 断定 疾病 408 | _disease_symptom 怎么 判断 有没有 409 | _disease_symptom 朋友 好像 怎么 判断 410 | _disease_symptom 疾病症状 411 | _disease_symptom 到底 怎么 判断 有没有 412 | _disease_symptom 家人 疾病 怎么 推断 413 | _disease_symptom 想 知道 怎么 断定 414 | _disease_symptom 到底 怎么 判断 有没有 疾病 415 | _disease_symptom 怎么 判断 疾病 416 | _disease_symptom 好像 得 417 | _disease_symptom 症状 418 | _disease_symptom 怎么样 就是 疾病 419 | _disease_symptom 是不是 疾病 420 | _disease_symptom 表征 有 哪些 421 | _disease_symptom 能 不能 跟 说 怎么 判断 疾病 422 | _disease_symptom 想 确定 是否 423 | _disease_symptom 疾病 到底 会 发生 什么 424 | _disease_symptom 家人 怎么 推断 425 | _disease_symptom 什么 情况 意味着 疾病 426 | _disease_symptom 觉得 疾病 怎么 判断 427 | _disease_symptom 疾病 会 有 什么 现象 428 | _disease_symptom 会 引发 别的 429 | _disease_symptom 告诉 疾病 怎么 判断 430 | _disease_symptom 到底 如何 才能 判断 已经 疾病 431 | _disease_symptom 有 什么 症状 432 | _disease_symptom 告诉 我要 怎么 判断 433 | _disease_symptom 疾病 一般 会 如何 434 | _disease_symptom 疾病 一般 会 出现 什么 症状 435 | _disease_symptom 怎么样 就是 436 | _disease_symptom 我会 不会 是 437 | _disease_symptom 我能 自己 判断 是否 疾病 438 | _disease_symptom 怎么 判断 439 | _disease_symptom 疾病 会 有 什么 表现 440 | _disease_symptom 能 不能 跟 说 怎么 判断 441 | _disease_symptom 到底 会 发生 什么 442 | _disease_symptom 请问 怎么 判断 是否 疾病 443 | _disease_symptom 朋友 好像 疾病 怎么 判断 444 | _disease_symptom 想 确定 是否 疾病 445 | _disease_symptom 如何 判断 446 | _disease_symptom 请问 怎么 判断 是否 447 | _disease_symptom 人 疾病 怎么 判断 448 | _disease_symptom 觉得 是 怎么 判断 449 | _disease_symptom 我能 自己 判断 是否 有 450 | _disease_symptom 是不是 451 | _disease_treat_cost 要花 多少 钱 可以 治疗 疾病 452 | _disease_treat_cost 疾病 要花 多少 钱 453 | _disease_treat_cost 治疗 疾病 是不是 很贵 454 | _disease_treat_cost 看病 要花 多少 钱 455 | _disease_treat_cost 要花 多少 钱 才能 看病 456 | _disease_treat_cost 要花 多少 钱 457 | _disease_treat_cost 治 这个 病要 多少 钱 458 | _disease_treat_cost 看 这个 病要 花 多少 钱 459 | _disease_treat_cost 治疗 要花 多少 钱 460 | _disease_treat_cost 治疗 这病 用 不用 一万 461 | _disease_treat_cost 看病 要花 多少 钱 462 | _disease_treat_cost 治疗 费用 是 多少 463 | _disease_treat_cost 治疗 是不是 很贵 464 | _disease_treat_cost 疾病 治疗 贵不贵 465 | _disease_treat_cost 疾病 治疗 费用 是 怎么样 466 | _disease_treat_cost 多少 钱 可以 治疗 这个 病 467 | _disease_treat_cost 治疗 疾病 要花 多少 钱 468 | _disease_treat_cost 治疗 贵不贵 469 | _disease_treat_cost 医疗费 是 多少 470 | _disease_treat_cost 治疗 疾病 贵不贵 471 | _disease_treat_cost 这个 病 治疗 费用 是 多少 472 | _disease_treat_cost 这 病 一千块 治得 473 | _disease_treat_cost 看病 要花 多少 钱 474 | _disease_treat_cost 这 病 多少 钱 可以 治 475 | _disease_treat_cost 治疗 费用 是 怎么样 476 | _disease_treat_cost 治疗 贵不贵 477 | _disease_treat_cost 治疗 这病 用 不用 一千 478 | _disease_treat_rate 有 多少 成功 痊愈 479 | _disease_treat_rate 疾病 能 治疗 480 | _disease_treat_rate 疾病 治疗 比例 481 | _disease_treat_rate 疾病 治疗 几率 多大 482 | _disease_treat_rate 有 多 大 把握 治疗 疾病 483 | _disease_treat_rate 疾病 痊愈 几率 大不大 484 | _disease_treat_rate 有 多 大 几率 治 485 | _disease_treat_rate 有 多 大 能力 治 486 | _disease_treat_rate 治愈 几率 487 | _disease_treat_rate 能治 488 | _disease_treat_rate 可治 489 | _disease_treat_rate 有 多 大 能力 可以 治 490 | _disease_treat_rate 治愈 百分比 491 | _disease_treat_rate 治 疾病 几率 大 492 | _disease_treat_rate 治 好的 可能性 大 493 | _disease_treat_rate 多大 概率 可以 治 494 | _disease_treat_rate 有 多 大 希望 治 495 | _disease_treat_rate 疾病 治愈 可能性 有 多少 496 | _disease_treat_rate 疾病 痊愈 有 多 大 把握 497 | _disease_treat_rate 治疗 几率 多大 498 | _disease_treat_rate 有 多 大 把握 治疗 499 | _disease_treat_rate 有 几成 把握 治疗 500 | _disease_treat_rate 疾病 治愈 几率 501 | _disease_treat_rate 痊愈 几率 大不大 502 | _disease_treat_rate 有 多少 成功 治疗 503 | _disease_treat_rate 痊愈 有 多 大 把握 504 | _disease_treat_rate 有 多 大 几率 治 疾病 505 | _disease_treat_rate 能 不能 痊愈 506 | _disease_treat_rate 疾病 有 多少 成功 治疗 507 | _disease_treat_rate 治愈 可能性 有 多少 508 | _disease_treat_rate 疾病 可治 509 | _disease_treat_rate 疾病 治愈 百分比 510 | _disease_treat_rate 能 治疗 511 | _disease_treat_rate 治 好的 有 多少 512 | _disease_treat_rate 能 不能 治 好的 513 | _disease_treat_rate 疾病 治 好的 可能性 大 514 | _disease_treat_rate 疾病 有 多少 成功 痊愈 515 | _disease_treat_rate 疾病 能 不能 痊愈 516 | _disease_treat_rate 有 多 大 能力 治 疾病 517 | _disease_treat_rate 疾病 能 不能 治 好的 518 | _disease_treat_rate 治 好的 几率 大 519 | _disease_treat_rate 治疗 比例 520 | _disease_treat_rate 疾病 治 把握 有 多 大 521 | _disease_treat_rate 疾病 治疗 几率 大 522 | _disease_treat_rate 治 把握 有 多 大 523 | _disease_treat_rate 疾病 可以 治 524 | _disease_treat_rate 有 多 大 希望 治 疾病 525 | _disease_treat_rate 治 希望 大 526 | _disease_treat_rate 疾病 能治好 527 | _disease_treat_rate 疾病 治愈 有 多 大 把握 528 | _disease_treat_rate 能治好 529 | _disease_treat_rate 有 几成 把握 治疗 疾病 530 | _disease_treat_rate 可以 治 531 | _disease_treat_rate 疾病 治 好的 有 多少 532 | _disease_treat_rate 疾病 多大 概率 可以 治 533 | _disease_treat_time 治疗 多久 534 | _disease_treat_time 要治 多久 535 | _disease_treat_time 疾病 多少 年 可以 536 | _disease_treat_time 疾病 治疗 多少 年 537 | _disease_treat_time 用 多长时间 治疗 538 | _disease_treat_time 治疗 多长时间 539 | _disease_treat_time 疾病 治疗 几天 540 | _disease_treat_time 痊愈 多久 541 | _disease_treat_time 疾病 多久 可以 恢复 542 | _disease_treat_time 治疗 一个 星期 543 | _disease_treat_time 治 多久 544 | _disease_treat_time 疾病 要治 多久 545 | _disease_treat_time 疾病 治疗 周期 是 多久 546 | _disease_treat_time 我要 多久 才能 治疗 547 | _disease_treat_time 疾病 一 星期 可以 548 | _disease_treat_time 多久 可以 549 | _disease_treat_time 多久 可以 恢复 550 | _disease_treat_time 得 多久 菜能 551 | _disease_treat_time 疾病 多久 才能 治疗 552 | _disease_treat_time 三天 可以 553 | _disease_treat_time 疾病 几时 治 554 | _disease_treat_time 疾病 多少 小时 可以 555 | _disease_treat_time 多久 才能 治疗 556 | _disease_treat_time 治疗 疾病 多长时间 557 | _disease_treat_time 治疗 多少 年 558 | _disease_treat_time 治疗 用 多久 559 | _disease_treat_time 疾病 多久 可以 560 | _disease_treat_time 几时 恢复 561 | _disease_treat_time 一 星期 可以 562 | _disease_treat_time 疾病 几天 能 563 | _disease_treat_time 治疗 疾病 用 多久 564 | _disease_treat_time 什么 可以 治疗 565 | _disease_treat_time 疾病 三天 可以 566 | _disease_treat_time 疾病 几时 恢复 567 | _disease_treat_time 几天 能 568 | _disease_treat_time 得 疾病 多久 菜能 569 | _disease_treat_time 疾病 痊愈 多久 570 | _disease_treat_time 我要 多久 才能 治疗 疾病 571 | _disease_treat_time 疾病 治 多久 572 | _disease_treat_time 疾病 多少 天 可以 573 | _disease_treat_time 多少 天 可以 574 | _disease_treat_time 治疗 周期 是 多久 575 | _disease_treat_time 多少 年 可以 576 | _disease_treat_time 疾病 治疗 多久 577 | _disease_treat_time 几时 治 578 | _disease_treat_way 怎么 医治 疾病 579 | _disease_treat_way 怎么 医 580 | _disease_treat_way 疾病 怎么 破 581 | _disease_treat_way 怎么办 582 | _disease_treat_way 疾病 咋治 583 | _disease_treat_way 怎么 医治 584 | _disease_treat_way 咋治 585 | _disease_treat_way 如何治 586 | _disease_treat_way 我想 问下 疾病 怎么办 587 | _disease_treat_way 麻烦 跟 说 怎么 治疗 疾病 588 | _disease_treat_way 得 疾病 怎么办 589 | _disease_treat_way 想 快点 治 疾病 怎么 做 590 | _disease_treat_way 疾病 如何 医治 591 | _disease_treat_way 如何 医 592 | _disease_treat_way 怎样治 才 593 | _disease_treat_way 怎么办 594 | _disease_treat_way 告诉 疾病 怎么 治 595 | _disease_treat_way 得 怎么办 596 | _disease_treat_way 怎么 才能 恢复 597 | _disease_treat_way 疾病 怎样治 才 598 | _disease_treat_way 怎么 治 599 | _disease_treat_way 告诉 怎么 治 600 | _disease_treat_way 疾病 如何治 601 | _disease_treat_way 怎样才能 治好 602 | _disease_treat_way 咋办 603 | _disease_treat_way 疗法 604 | _disease_treat_way 怎样才能 治 疾病 605 | _disease_treat_way 如何 医治 606 | _disease_treat_way 怎么 才能 治疗 607 | _disease_treat_way 疾病 怎么 治疗 608 | _disease_treat_way 怎么 破 609 | _disease_treat_way 疾病 怎么 才能 恢复 610 | _disease_treat_way 疾病 咋办 611 | _disease_treat_way 咋整 疾病 612 | _disease_treat_way 怎么 治疗 613 | _disease_treat_way 我要 怎么 治 614 | _disease_treat_way 我想 问下 怎么办 615 | _disease_treat_way 疾病 怎么 医 616 | _disease_treat_way 是 怎么 个 治疗法 617 | _disease_treat_way 疾病 怎么办 618 | _disease_treat_way 疾病 疗法 619 | _disease_treat_way 怎么 才能 起来 620 | _disease_treat_way 怎么 医治 621 | _disease_treat_way 咋整 622 | _disease_treat_way 疾病 怎么 治 623 | _disease_treat_way 医治 方式 624 | _disease_treat_way 疾病 怎么 才能 起来 625 | _disease_treat_way 怎么 才能 治疗 疾病 626 | _disease_treat_way 如何 医治 627 | _disease_treat_way 如何 医治 疾病 628 | _disease_treat_way 如何 治疗 629 | _disease_treat_way 疾病 怎么 治 630 | _disease_treat_way 麻烦 跟 说 怎么 治疗 631 | _disease_treat_way 如何治 632 | _drug_func 药品 用来 作 甚 633 | _drug_func 药品 干嘛 634 | _drug_func 药品 治疗 啥 635 | _drug_func 药品 用途 636 | _drug_func 药品 是 治疗 什么 病 637 | _drug_func 药品 主治 啥 638 | _drug_func 什么 会 要求 服用 药品 639 | _drug_func 药品 治 啥 640 | _drug_func 药品 做 什么 641 | _drug_func 药品 可以 治疗 什么 病 642 | _drug_func 药品 一般 用于 什么 病 治疗 643 | _drug_func 药品 有 什么 用 644 | _drug_func 药品 可以 用来 做 什么 645 | _drug_func 药品 用处 646 | _drug_func 什么 吃 药品 647 | _drug_func 药品 治愈 啥 648 | _drug_func 药品 这个 药物 有 什么 用 649 | _drug_func 药品 医治 啥 650 | _drug_func 药品 用来 做 啥 651 | _drug_func 什么 病 可以 吃 药品 652 | _drug_func 药品 有 何用 653 | _drug_func 药品 有 什么 好处 654 | _drug_func 药品 有个 什么 用处 655 | _drug_func 得 什么 病得 吃 药品 656 | _drug_func 药品 能够 治疗 些 啥子 病 657 | _drug_price 药品 多少 钱 一盒 658 | _drug_price 这个 药贵 不贵 659 | _drug_price 药品 贵不贵 660 | _drug_price 这个 药 费用 是 多少 钱 661 | _drug_price 这个 药 几个 钱 662 | _drug_price 药物 费用 是 多少 663 | _drug_price 多贵 这个 药 664 | _drug_price 药 多少 钱 可以 买 665 | _drug_price 这个 药品 费用 是 多少 666 | _drug_price 多少 钱 可以 买 这个 药 667 | _drug_price 药物 费用 是 怎么样 668 | _drug_price 这个 药品 多少 钱 669 | _drug_price 药 一盒 多少 钱 670 | _drug_price 这药 花 多少 钱 671 | _drug_price 多少 钱 可以 买 这个 药 672 | _drug_price 这个 药 多少 钱 673 | _drug_price 花 多少 钱 买 这个 药 674 | _drug_price 药品 有多贵 675 | _drug_use 这个 药有 什么 用 676 | _drug_use 药品 怎么 用 才 677 | _drug_use 怎么 吃 药品 678 | _drug_use 这个 药要 怎么 用 679 | _drug_use 药品 怎么 服用 680 | _drug_use 怎么 用 681 | _drug_use 这个 怎么 吃 682 | _drug_use 如何 有效 使用 药品 683 | _drug_use 怎么 吃 这个 药品 684 | _drug_use 药品 使用 方式 685 | _drug_use 药品 用法 用量 686 | _drug_use 这个 药 一天 吃 几次 687 | _drug_use 这个 药 怎么 吃 688 | _drug_use 这个 药物 怎么 用 689 | _drug_use 这个 药 什么 用法 690 | _drug_use 怎么 使用 691 | _drug_use 如何 吃 这个 药品 692 | _drug_use 药品 如何 使用 693 | _goodbye 886 694 | _goodbye 拜 695 | _goodbye 再见 696 | _goodbye 走 下次 再聊 697 | _goodbye 好的 再见 698 | _goodbye 我先走了哦 699 | _goodbye 临时 有事 下次 再聊 700 | _greet 你好呀 701 | _greet 在吗在吗 702 | _greet 在吗 703 | _greet 哈喽 704 | _greet 你好 705 | _greet 晚上好 706 | _greet 中午好 707 | _greet 有人吗 708 | _greet hello 709 | _thankyou 谢谢谢谢 710 | _thankyou 谢谢谢谢 711 | _thankyou 感谢 712 | _thankyou 谢谢 713 | _thankyou 谢了 714 | _thankyou 十分感谢 715 | _thankyou 万分感谢 716 | _thankyou 感激不尽 717 | _thankyou 蟹蟹 718 | -------------------------------------------------------------------------------- /classifier/intent.txt: -------------------------------------------------------------------------------- 1 | 意图分类: 2 | 3 | 意图代码 意图名称 4 | 意图举例 5 | ----------------- 6 | greet 问好 7 | 你好 8 | 9 | goodbye 再见 10 | 拜拜 11 | 12 | thankyou 感谢 13 | 谢谢你 14 | 15 | affirm 确定 16 | 对的,没错 17 | 18 | deny 否认 19 | 没有了 20 | 21 | disease_desc 询问疾病 22 | 感冒是什么 23 | 24 | disease_cause 询问病因 25 | 感冒是怎么引起的 26 | 27 | disease_prevent 询问疾病预防措施 28 | 感冒要如何预防 29 | 30 | disease_department 询问疾病所属分科 31 | 感冒要挂什么科啊 32 | 33 | disease_treat_way 询问疾病如何治疗 34 | 感冒要怎么办 35 | 36 | disease_treat_time 询问疾病治疗时间 37 | 感冒要治疗多久啊 38 | 39 | disease_treat_rate 询问疾病治愈率 40 | 感冒有几成把握治好 41 | 42 | disease_treat_cost 询问疾病治疗费用 43 | 治疗感冒要多少钱 44 | 45 | disease_easy_get 询问疾病易患人群 46 | 谁容易得感冒啊 47 | 48 | disease_diet 询问疾病禁忌 49 | 感冒在饮食方面有什么讲究 50 | 51 | disease_neopathy 询问疾病并发症 52 | 感冒有什么并发症 53 | 54 | disease_symptom 询问疾病症状 55 | 感冒有什么症状 56 | 57 | disease_drug 询问疾病用药 58 | 感冒要吃什么药 59 | 60 | drug_price 询问药物价格 61 | 牛黄解毒丸多少钱 62 | 63 | drug_func 询问药物功能 64 | 牛黄解毒丸有什么用 65 | 66 | drug_use 询问药物怎么用 67 | 牛黄解毒丸怎么用 68 | 69 | recipe_produce_way 询问菜谱怎么做 70 | 酱黄瓜要怎么做 -------------------------------------------------------------------------------- /classifier/intent/affirm.txt: -------------------------------------------------------------------------------- 1 | 是 2 | 对 3 | 没错 4 | 正确 5 | 好的 6 | 好 7 | 行的 8 | 可以 9 | 不错 10 | 那行 11 | ok 12 | ojbk 13 | 正是 14 | 没毛病 15 | 行吧 16 | 嗯嗯 17 | 嗯 18 | 哦 19 | 哦哦 20 | o 21 | 嗯嘛 22 | 嗯啊 23 | 嗯呀 24 | en -------------------------------------------------------------------------------- /classifier/intent/deny.txt: -------------------------------------------------------------------------------- 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 | 别 -------------------------------------------------------------------------------- /classifier/intent/disease_cause.txt: -------------------------------------------------------------------------------- 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 | 什么情况会发生疾病 26 | 疾病会是什么导致的呢 27 | 为什么会疾病呢 28 | 我疾病的病因是什么 29 | 疾病通常是什么引起的 30 | 怎么会的呢 31 | 这是怎么导致的 32 | 是由什么引起的 33 | 是怎么引起的 34 | 由什么引起 35 | 是怎么会的 36 | 怎么会 37 | 为什么会 38 | 怎样导致 39 | 怎么样才会 40 | 咋样才会 41 | 如何会 42 | 为啥会 43 | 为何会 44 | 怎么会 45 | 为什么我会 46 | 成因 47 | 是什么原因 48 | 是什么导致的 49 | 为什么会导致 50 | 我想知道一般是怎么引起的 51 | 我想知道我是怎么会的 52 | 麻烦告诉我是为什么 53 | 麻烦跟我说为什么会 54 | 我是因为什么导致的 55 | 一般由什么情况引发 56 | 什么情况会发生 57 | 会是什么导致的呢 58 | 为什么会呢 59 | 我的病因是什么 60 | 通常是什么引起的 61 | 怎么会的呢 62 | 这是怎么导致的 -------------------------------------------------------------------------------- /classifier/intent/disease_department.txt: -------------------------------------------------------------------------------- 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 | 要去挂什么号 26 | 属于什么地方管 27 | 要挂什么科室 28 | 要找什么医生挂号 29 | 要去哪看病 30 | 去哪里才能治疗 31 | 去什么地方治疗 32 | 要去哪找医生 -------------------------------------------------------------------------------- /classifier/intent/disease_desc.txt: -------------------------------------------------------------------------------- 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 | 疾病是啥病 26 | 啥病是疾病 27 | 什么病是疾病 28 | 疾病 29 | 这是什么 30 | 这是什么疾病 31 | -------------------------------------------------------------------------------- /classifier/intent/disease_diet.txt: -------------------------------------------------------------------------------- 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 | 疾病吃啥 26 | 疾病伙食 27 | 疾病要吃什么 28 | 疾病忌口有什么 29 | 疾病补品有什么 30 | 疾病的时候,吃东西要注意什么 31 | 疾病有什么菜谱推荐 32 | 疾病食用什么好 33 | 疾病喝什么好 34 | 疾病饮食要注意什么 35 | 疾病饮用什么好 36 | 吃什么有助于疾病 37 | 我疾病,吃什么好 38 | 要吃些什么好 39 | 要吃什么东西有帮助 40 | 吃点什么东西好啊 41 | 不能吃什么 42 | 我可以吃些什么东西 43 | 有什么推荐的吃的吗 44 | 我食用什么食品有帮助 45 | 我吃什么菜可以 46 | 吃什么东西好得快 47 | 吃什么食物 48 | 吃东西有什么要注意的吗 49 | 有什么不能吃的吗 50 | 有什么推荐吃的吗 51 | 有什么可以吃的吗 52 | 我的话要吃什么东西好 53 | 可以吃吗 54 | 有相关菜谱吗 55 | 有什么菜谱有助于快点恢复吗 56 | 可以喝些什么东西 57 | 可以吃什么 58 | 有什么补品适合的时候吃吗 59 | 可以喝吗 60 | 的时候,吃的方面有什么禁忌吗 61 | 食品 62 | 吃什么 63 | 吃啥 64 | 伙食 65 | 要吃什么 66 | 忌口有什么 67 | 补品有什么 68 | 吃东西要注意什么 69 | 有什么菜谱推荐 70 | 食用什么好 71 | 喝什么好 72 | 饮食要注意什么 73 | 饮用什么好 74 | 吃什么有助于 75 | 吃什么好 -------------------------------------------------------------------------------- /classifier/intent/disease_drug.txt: -------------------------------------------------------------------------------- 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 | 什么药品对疾病好 26 | 什么药对治疗疾病有影响 27 | 疾病吃什么药好得快 28 | 疾病吃什么药品可以恢复得快 29 | 有什么用药推荐,疾病了 30 | 什么西药可以治疗疾病 31 | 中药可以治疗疾病吗 32 | 我疾病了,想吃点药 33 | 疾病吃点什么药好呢 34 | 疾病吃什么药比较好 35 | 疾病可以服用什么药物 36 | 什么药物推荐在疾病的时候服用 37 | 要吃什么药 38 | 可以吃什么药 39 | 有什么药品可以治疗 40 | 用药 41 | 吃什么药品好 42 | 吃什么药好 43 | 吃什么胶囊 44 | 得了吃什么药 45 | 喝口服液可以吗 46 | 有什么药片可以吃 47 | 我吃什么药好 48 | 推荐吃什么药 49 | 吃什么药物好 50 | 吃什么药对于有帮助 51 | 吃什么药品可以对付 52 | 对于要吃什么药好 53 | 要吃些什么药物 54 | 的时候吃什么药品好 55 | 我了,有推荐的药片吗 56 | 可以喝什么口服液 57 | 有什么中药或者西药推荐吗 58 | 通常吃什么药品啊 59 | 一般会吃什么药 60 | 什么药物可以治疗 61 | 什么药品对好 62 | 什么药对治疗有影响 63 | 吃什么药好得快 64 | 吃什么药品可以恢复得快 65 | 有什么用药推荐,了 66 | 什么西药可以治疗 67 | 中药可以治疗吗 68 | 想吃点药 69 | 吃点什么药好呢 70 | 吃什么药比较好 71 | 可以服用什么药物 72 | 什么药物推荐在的时候服用 -------------------------------------------------------------------------------- /classifier/intent/disease_easy_get.txt: -------------------------------------------------------------------------------- 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 | 哪些人会 26 | 那些人会 27 | 谁会染上 28 | 谁比较容易得 29 | 什么人容易 30 | 成年人容易得上吗 31 | 小孩会得上吗 32 | 易感人群有哪些 33 | 谁容易得 34 | 一般谁比较容易得 35 | 一般会在什么人群发生 36 | 常见在什么人群 37 | 什么样的人会 38 | 谁容易患上 39 | 什么人会患上 -------------------------------------------------------------------------------- /classifier/intent/disease_neopathy.txt: -------------------------------------------------------------------------------- 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 | 会引发什么 26 | 会一并发生什么 27 | 通常还会伴随什么现象 28 | 还会出现什么情况 29 | 什么会随着它一起发生 30 | 什么症状会跟着一起来 31 | 我的时候还会出现什么并发症 32 | 什么会和一起来 33 | 什么病会和一起发生 -------------------------------------------------------------------------------- /classifier/intent/disease_prevent.txt: -------------------------------------------------------------------------------- 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 | 如何提前抵制疾病 26 | 疾病要如何去预防 27 | 怎样才能不被疾病染上 28 | 我想请问下如何避免疾病 29 | 麻烦告诉我怎么避免疾病 30 | 如何预防 31 | 如何防范 32 | 如何抵制 33 | 怎样防止 34 | 如何躲避 35 | 怎样避开 36 | 怎样才能不 37 | 怎样才能不 38 | 咋样才能不 39 | 咋才能不得 40 | 咋样才可以不 41 | 怎么样才能够不 42 | 如何才可以不 43 | 怎么才不 44 | 如何不 45 | 咋样不 46 | 怎样才能预防啊 47 | 我不想,要怎么做 48 | 我不想得,要怎么办 49 | 有什么预防措施可以不 50 | 怎样才能有效预防 51 | 怎样才能不染上 52 | 怎样才能提前预防 53 | 如何提前抵制 54 | 要如何去预防 55 | 怎样才能不被染上 56 | 我想请问下如何避免 57 | 麻烦告诉我怎么避免 -------------------------------------------------------------------------------- /classifier/intent/disease_symptom.txt: -------------------------------------------------------------------------------- 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 | 我想知道怎么断定我疾病了 26 | 我想确定我是否疾病了 27 | 朋友好像疾病了,怎么判断 28 | 家人疾病了要怎么推断 29 | 症状 30 | 有什么症状 31 | 会有什么表现 32 | 表征有哪些 33 | 会有什么现象 34 | 什么情况意味着 35 | 一般会如何 36 | 如何判断 37 | 怎么判断我了 38 | 我觉得我是了,要怎么判断 39 | 我能自己判断是否有 40 | 我到底要怎么判断有没有 41 | 一般会出现什么症状 42 | 到底会发生什么 43 | 人要怎么判断 44 | 会引发别的吗 45 | 怎么样我就是了 46 | 我是不是了啊 47 | 我会不会是了 48 | 我好像得了 49 | 怎么判断我有没有啊 50 | 请问怎么判断是否 51 | 告诉我要怎么判断 52 | 能不能跟我说怎么判断 53 | 到底要如何才能判断我已经了 54 | 我想知道怎么断定我了 55 | 我想确定我是否了 56 | 朋友好像了,怎么判断 57 | 家人了要怎么推断 -------------------------------------------------------------------------------- /classifier/intent/disease_treat_cost.txt: -------------------------------------------------------------------------------- 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 | 看病要花多少钱啊 26 | 看这个病要花多少钱 27 | 治疗要花多少钱 28 | 治疗费用是怎么样的 29 | 治疗贵不贵啊 30 | 治疗是不是很贵啊 31 | 治疗贵不贵 32 | -------------------------------------------------------------------------------- /classifier/intent/disease_treat_rate.txt: -------------------------------------------------------------------------------- 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 | 疾病有多少成功痊愈的 26 | 疾病治好的有多少 27 | 有多大能力治好疾病 28 | 疾病有多大能力可以治好 29 | 疾病治好的可能性大吗 30 | 疾病能不能痊愈 31 | 多大概率可以治好 32 | 多大几率能治好 33 | 治好希望大吗 34 | 治愈几率 35 | 有几成把握治疗 36 | 治疗比例 37 | 治愈可能性有多少 38 | 能治 39 | 可治吗 40 | 可以治吗 41 | 有多大把握治疗 42 | 治愈有多大把握 43 | 治愈百分比 44 | 治疗几率大吗 45 | 治疗几率多大吗 46 | 能治好吗 47 | 能不能治好的 48 | 治好把握有多大 49 | 痊愈有多大把握 50 | 有多大几率治好 51 | 有多大希望治好 52 | 治好的几率大吗 53 | 痊愈的几率大不大 54 | 有多少成功治疗的 55 | 有多少成功痊愈的 56 | 治好的有多少 57 | 有多大能力治好 58 | 有多大能力可以治好 59 | 治好的可能性大吗 60 | 能不能痊愈 61 | 能治疗好吗 62 | 疾病能治疗好吗 -------------------------------------------------------------------------------- /classifier/intent/disease_treat_time.txt: -------------------------------------------------------------------------------- 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 | 疾病几时治好 26 | 要多久才能治疗好 27 | 治疗周期是多久 28 | 治疗要多长时间 29 | 要治疗几天 30 | 几天能好 31 | 治多久 32 | 要治多久 33 | 多久可以好 34 | 多少天可以好 35 | 多少小时可以好 36 | 治疗多少年 37 | 多少年可以好 38 | 多久可以恢复 39 | 痊愈要多久 40 | 我要多久才能治疗好 41 | 得了要多久菜能好 42 | 三天可以好吗 43 | 一星期可以好吗 44 | 要治疗一个星期吗 45 | 要治疗多久 46 | 治疗要用多久 47 | 要用多长时间治疗 48 | 什么时候可以治疗好 49 | 几时恢复 50 | 几时治好 -------------------------------------------------------------------------------- /classifier/intent/disease_treat_way.txt: -------------------------------------------------------------------------------- 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 | 疾病医治方式 26 | 疾病疗法 27 | 疾病咋治 28 | 疾病咋办 29 | 得了怎么办 30 | 我想问下我了怎么办 31 | 我要怎么治啊 32 | 是怎么个治疗法 33 | 麻烦跟我说怎么治疗 34 | 告诉我怎么治 35 | 要怎么办 36 | 怎么办 37 | 怎么才能治疗啊 38 | 怎么才能恢复 39 | 怎么才能好起来 40 | 我想快点治好要怎么做 41 | 怎样才能治好啊 42 | 咋整啊,我了 43 | 怎样治才好 44 | 怎么治疗 45 | 怎么破 46 | 我要怎么办 47 | 如何医治 48 | 如何医治 49 | 如何治疗 50 | 怎么医治 51 | 怎么治 52 | 怎么医治 53 | 如何治 54 | 如何医 55 | 怎么医 56 | 如何治 57 | 医治方式 58 | 疗法 59 | 咋治 60 | 咋办 -------------------------------------------------------------------------------- /classifier/intent/drug_func.txt: -------------------------------------------------------------------------------- 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 | 药品用来做啥 26 | 药品用来作甚 27 | 药品干嘛的 28 | 药品做什么的 -------------------------------------------------------------------------------- /classifier/intent/drug_price.txt: -------------------------------------------------------------------------------- 1 | 这个药品多少钱 2 | 这个药多少钱 3 | 药品多少钱一盒 4 | 这个药品费用是多少 5 | 药物费用是多少 6 | 药物费用是怎么样的 7 | 这个药贵不贵啊 8 | 这个药要多少钱可以买到 9 | 药品有多贵 10 | 药品贵不贵 11 | 药要花费多少钱 12 | 药一盒多少钱 13 | 药多少钱可以买到 14 | 这个药的费用是多少钱 15 | 多少钱可以买这个药 16 | 多贵啊这个药 17 | 这个药几个钱啊 18 | 多少钱可以买到这个药 19 | 这药要花多少钱 20 | 花多少钱买啊这个药 21 | -------------------------------------------------------------------------------- /classifier/intent/drug_use.txt: -------------------------------------------------------------------------------- 1 | 这个药要怎么用啊 2 | 药品的使用方式 3 | 药品的用法用量 4 | 这个药一天吃几次 5 | 这个药怎么吃啊 6 | 如何吃这个药品 7 | 怎么吃药品 8 | 药品要怎么服用 9 | 服用药品有什么注意的 10 | 这个药有什么用 11 | 这个药物怎么用 12 | 这个药什么用法 13 | 药品要如何使用 14 | 药品要怎么用才好 15 | 怎么才能有效使用药品 16 | 如何有效使用药品 17 | 这个药品什么样的吃法 18 | 怎么吃这个药品 19 | 怎么使用 20 | 怎么用啊 21 | 这个怎么吃啊 -------------------------------------------------------------------------------- /classifier/intent/goodbye.txt: -------------------------------------------------------------------------------- 1 | 再见 2 | 拜拜 3 | 拜 4 | 886 5 | 走了,下次再聊 6 | 我先走了哦 7 | 临时有事,下次再聊 8 | 好的,再见 -------------------------------------------------------------------------------- /classifier/intent/greet.txt: -------------------------------------------------------------------------------- 1 | 你好 2 | 早上好 3 | 哈喽 4 | hello 5 | hi 6 | 在吗 7 | 中午好 8 | 晚上好 9 | 你好呀 10 | 在吗在吗 11 | 有人吗 -------------------------------------------------------------------------------- /classifier/intent/thankyou.txt: -------------------------------------------------------------------------------- 1 | 谢谢 2 | 感谢 3 | 谢了 4 | 蟹蟹 5 | 万分感谢 6 | 十分感谢 7 | 谢谢谢谢 8 | 感激不尽 9 | 无以回报 10 | 感谢万分 11 | 谢谢谢谢 -------------------------------------------------------------------------------- /classifier/models/-fasttext.model: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jezemy/MASystem/7f1b86da04250ca9f5ebdafb956e330bb0449bea/classifier/models/-fasttext.model -------------------------------------------------------------------------------- /classifier/models/fasttext.model: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jezemy/MASystem/7f1b86da04250ca9f5ebdafb956e330bb0449bea/classifier/models/fasttext.model -------------------------------------------------------------------------------- /classifier/models/test.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jezemy/MASystem/7f1b86da04250ca9f5ebdafb956e330bb0449bea/classifier/models/test.bin -------------------------------------------------------------------------------- /classifier/models/test.model: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jezemy/MASystem/7f1b86da04250ca9f5ebdafb956e330bb0449bea/classifier/models/test.model -------------------------------------------------------------------------------- /classifier/models/w2v_model.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jezemy/MASystem/7f1b86da04250ca9f5ebdafb956e330bb0449bea/classifier/models/w2v_model.pkl -------------------------------------------------------------------------------- /classifier/stopwords.txt: -------------------------------------------------------------------------------- 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 | ) 26 | 。 27 | . 28 | - 29 | ⑴ 30 | ? 31 | ⑵ 32 | ⑶ 33 | ⑷ 34 | ⑸ 35 | ⑹ 36 | ⑺ 37 | ⑻ 38 | ⑼ 39 | ⑽ 40 | ⑾ 41 | ⑿ 42 | ⒀ 43 | ⒁ 44 | ⒂ 45 | ⒃ 46 | @ 47 | % 48 | # 49 | ¥ 50 | $ 51 | ^ 52 | > 53 | < 54 | 、 55 | 【 56 | 】 57 | [ 58 | ] 59 | 60 | \t 61 | \ t 62 | \ 63 | / 64 | : 65 | : -------------------------------------------------------------------------------- /classifier/train_intents_fasttext.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | 3 | import os 4 | import jieba 5 | import fasttext.FastText as fasttext 6 | import random 7 | 8 | stopwords = set([line.strip() for line in open('stopwords.txt', 'r', encoding = 'utf-8')]) 9 | 10 | def read_data_file(): 11 | 12 | # 读取intents 13 | _, _, files = list(os.walk('intent'))[0] 14 | 15 | # 从文件写入data 16 | data = {} 17 | for file in files: 18 | file_intent_list = [line.strip() for line in open('intent/'+file, 'r', encoding = 'utf-8')] 19 | data[file.replace('.txt','')] = random.sample(file_intent_list, int(0.9*len(file_intent_list))) 20 | 21 | return data 22 | 23 | def read_dict_jieba(): 24 | _, _, files = list(os.walk('dict'))[0] 25 | for file in files: 26 | jieba.load_userdict('dict/'+file) 27 | 28 | def split_sentence_jieba(s:str): 29 | '''将句子进行分词, 返回列表''' 30 | res_list = [] 31 | for word in jieba.cut(s): 32 | if word not in stopwords: 33 | res_list.append(word) 34 | return res_list 35 | 36 | 37 | def build_fasttext_train_data(): 38 | data = read_data_file() 39 | word_set = set() 40 | file = open('fasttext_data.txt', 'w', encoding = 'utf-8') 41 | for key in data.keys(): 42 | for s in data[key]: 43 | split_list = split_sentence_jieba(s) 44 | for word in split_list: 45 | word_set.add(word) 46 | file.write('_%s '%key + ' '.join(split_list) + '\n') 47 | file.close() 48 | 49 | # 保存词典 50 | 51 | with open('vocabs.txt', 'w', encoding = 'utf-8') as f: 52 | for word in list(word_set): 53 | f.write(word + '\n') 54 | 55 | 56 | def train_model_fasttext(): 57 | classifier = fasttext.train_supervised('fasttext_data.txt', label='_', dim=100, epoch=500, lr=0.01, loss='softmax') 58 | classifier.save_model('models/fasttext.model') 59 | return classifier 60 | 61 | def test_model_fasttext(s_list): 62 | model = fasttext.load_model('models/fasttext.model') 63 | for s in s_list: 64 | split_list = split_sentence_jieba(s) 65 | label_prob = model.predict(' '.join(split_list), k=5) 66 | print(s) 67 | print(split_list) 68 | print(label_prob) 69 | 70 | 71 | if __name__ == '__main__': 72 | read_dict_jieba() 73 | build_fasttext_train_data() 74 | train_model_fasttext() 75 | test_model_fasttext([ 76 | '药品有什么用', 77 | '要如何治疗', 78 | '这是什么疾病', 79 | '要去哪里看疾病', 80 | '吃什么好啊', 81 | '有什么症状', 82 | '要治疗多久', 83 | '疾病要花多少钱', 84 | '这药品要花多少钱', 85 | '怎么使用', 86 | '好的', 87 | '没有', 88 | '谢谢', 89 | '你好', 90 | ]) 91 | -------------------------------------------------------------------------------- /classifier/vocabs.txt: -------------------------------------------------------------------------------- 1 | 服用 2 | 菜 3 | 这是 4 | 食品 5 | 伙食 6 | 快点 7 | hello 8 | 确定 9 | 不用 10 | 适合 11 | 预防 12 | 我要 13 | en 14 | 避开 15 | 周期 16 | 为何 17 | 解释一下 18 | 觉得 19 | 万分感谢 20 | 吃些 21 | 已经 22 | 几个 23 | 否 24 | 一万 25 | 这病 26 | 什么 27 | 出现 28 | 成年人 29 | ok 30 | 莫 31 | 防范 32 | 好像 33 | 上 34 | 正是 35 | 破 36 | 哪里 37 | 不能 38 | 躲避 39 | 仍未 40 | 能力 41 | 何用 42 | 用 43 | 疾病症状 44 | 病会 45 | 药片 46 | 几率 47 | 你好 48 | 判断 49 | 有效 50 | 病要 51 | 由 52 | 食用 53 | 嗯 54 | 它 55 | 为什么 56 | 医 57 | 病是 58 | 推荐 59 | 如何治 60 | 属于 61 | 挂 62 | 注意 63 | 怎么样 64 | 好得快 65 | 正确 66 | 几时 67 | 东西 68 | 的话 69 | 才能 70 | 有人吗 71 | 几次 72 | 能够 73 | 哦 74 | 年 75 | 走 76 | 别 77 | 西药 78 | 成因 79 | 甚 80 | 切勿 81 | 科室 82 | 是不是 83 | 对于 84 | 没有 85 | 点药 86 | 请问 87 | 勿 88 | 呢 89 | 情况 90 | 症状 91 | 不 92 | o 93 | 对付 94 | 看 95 | 用处 96 | 找 97 | 在 98 | 一盒 99 | 概率 100 | 用法 101 | 跟着 102 | 影响 103 | 治疗法 104 | 中午好 105 | 菜谱 106 | 引发 107 | 会得 108 | 地方 109 | 号 110 | 拜 111 | 就是 112 | 科 113 | 告诉 114 | 提前 115 | 易感 116 | 啥 117 | 恢复 118 | 饮食 119 | 知道 120 | 干嘛 121 | 补品 122 | 再见 123 | 弗 124 | 在吗 125 | 喝 126 | 多久 127 | 人群 128 | 哪些 129 | 疾病 130 | 小孩 131 | 哪 132 | 禁忌 133 | 治好 134 | 饮用 135 | 简介 136 | 主治 137 | 多 138 | 一天 139 | 治疗 140 | 用于 141 | 还会 142 | 不再 143 | 中药 144 | 多长时间 145 | 几天 146 | 谢谢 147 | 推断 148 | 用途 149 | 引起 150 | 不可 151 | 想 152 | 抵制 153 | 到底 154 | 可能性 155 | 比较 156 | 很贵 157 | 怎么办 158 | 小时 159 | 花 160 | 食物 161 | 喝些 162 | 几成 163 | 一起 164 | 我想 165 | 那行 166 | 常见 167 | 天 168 | 被 169 | 毋 170 | 嗯啊 171 | 叫 172 | 易发 173 | 一 174 | 有 175 | 有个 176 | 药贵 177 | 或者 178 | 钱 179 | 在吗在吗 180 | 没毛病 181 | 药 182 | 究竟 183 | 治 184 | 下 185 | 一千块 186 | 随着 187 | 药要 188 | 伴随 189 | 并未 190 | 行吧 191 | 快 192 | 多贵 193 | 能治 194 | 不得 195 | 百分比 196 | 胶囊 197 | 别的 198 | 看病 199 | 并发症 200 | 要求 201 | 帮助 202 | 不错 203 | 用来 204 | 蟹蟹 205 | 表现 206 | 未 207 | 这药 208 | 意味着 209 | 病得 210 | 无 211 | 对 212 | 通常 213 | 管 214 | 比例 215 | 药有 216 | 可治 217 | 并无 218 | 成功 219 | 挂号 220 | 治愈 221 | 方式 222 | 相关 223 | 这 224 | 个 225 | 人 226 | 一千 227 | 有事 228 | 防止 229 | 问下 230 | 断定 231 | 要治 232 | 要花 233 | 886 234 | 十分感谢 235 | 行的 236 | 自己 237 | 为啥 238 | 没 239 | 是 240 | 药物 241 | 玩意 242 | 多大 243 | 感激不尽 244 | 原因 245 | 能治好 246 | 再聊 247 | 是否 248 | 不是 249 | 和 250 | 用药 251 | 做 252 | 啥子 253 | 药好 254 | 医治 255 | 去 256 | 咋治 257 | 染上 258 | 拒绝 259 | 那些 260 | 我能 261 | 发生 262 | 有没有 263 | 医疗费 264 | 感谢 265 | 没错 266 | 感染 267 | 怎么 268 | 谢谢谢谢 269 | 大不大 270 | 不要 271 | 一般 272 | 买 273 | 一并 274 | 临时 275 | 患上 276 | 我先走了哦 277 | 麻烦 278 | 多少 279 | 咋样 280 | 些 281 | 哪个 282 | 好处 283 | 菜能 284 | 希望 285 | 我会 286 | 一同 287 | 治得 288 | 啥病 289 | 朋友 290 | 忌口 291 | 这个 292 | 有助于 293 | 咋整 294 | 下次 295 | 能 296 | 病 297 | 家人 298 | 病因 299 | 药品 300 | 咋办 301 | 痊愈 302 | 把握 303 | 如何 304 | 晚上好 305 | 谢了 306 | 谁 307 | 是因为 308 | 现象 309 | 咋 310 | 避免 311 | 作 312 | 使用 313 | 好的 314 | 哦哦 315 | 起来 316 | 说 317 | 得 318 | 有多贵 319 | 才 320 | 用量 321 | 药对 322 | 三天 323 | 非 324 | 医生 325 | 会 326 | 星期 327 | 费用 328 | 导致 329 | 容易 330 | 不贵 331 | 哈喽 332 | 预防措施 333 | 吃 334 | 不想 335 | 不会 336 | 表征 337 | 人会 338 | 吃点 339 | 什么样 340 | 怎样 341 | 跟 342 | 怎样才能 343 | 一个 344 | 方面 345 | 贵不贵 346 | 疗法 347 | 口服液 348 | 你好呀 349 | 大 350 | 怎样治 351 | ojbk 352 | 可以 353 | -------------------------------------------------------------------------------- /classifier/word2vec-test.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | from gensim.models.word2vec import Word2Vec 3 | import jieba 4 | import numpy as np 5 | 6 | def split_sentence_jieba(s:str): 7 | '''将句子进行分词, 返回列表''' 8 | res_list = jieba.cut(s) 9 | return list(res_list) 10 | 11 | def build_corpus(): 12 | corpus = [] 13 | corpus.append(split_sentence_jieba("我想问下疾病")) 14 | corpus.append(split_sentence_jieba("请问疾病是什么")) 15 | corpus.append(split_sentence_jieba("告诉我什么是疾病")) 16 | corpus.append(split_sentence_jieba("疾病到底是什么")) 17 | return corpus 18 | 19 | def train_word2vec(corpus): 20 | '''传入的corpus为二维数组, 行代表一句话的分词,列代表每句话 21 | eg: 22 | [ 23 | ["我", "今天", "上班"], 24 | ["你", "找", "我", "干嘛"], 25 | ... 26 | ] 27 | ''' 28 | model = Word2Vec(corpus, min_count = 1) 29 | model.save('models/test.model') 30 | model.wv.save_word2vec_format('models/test.bin', binary = True) 31 | print('训练完成') 32 | 33 | def get_sentence_vector(s_list): 34 | model = Word2Vec.load('models/test.model') 35 | v = np.zeros((1,100)) 36 | for s in s_list: 37 | v += np.array(model[s]) 38 | return v/len(s_list) 39 | 40 | if __name__ == '__main__': 41 | # corpus = build_corpus() 42 | # print(corpus) 43 | # train_word2vec(corpus) 44 | 45 | 46 | s_list = split_sentence_jieba('我想问下疾病') 47 | s_v = get_sentence_vector(s_list) 48 | print(s_v) 49 | 50 | 51 | -------------------------------------------------------------------------------- /contextual/IntentDetector.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | 3 | ''' 4 | 意图检测分类,上下文槽 5 | ''' 6 | import fasttext.FastText as fasttext 7 | import jieba 8 | import os 9 | 10 | 11 | class Detector: 12 | 13 | def __init__(self): 14 | self.slots = {} 15 | '''django用第二个,普通用第一个''' 16 | # self.classifier_path = '../classifier' 17 | self.classifier_path = 'classifier' 18 | 19 | self.model = fasttext.load_model( 20 | '{classifier_path}/models/fasttext.model'.format(classifier_path = self.classifier_path)) 21 | 22 | self.stopwords = set([line.strip() for line in open('{classifier_path}/stopwords.txt'.format(classifier_path = self.classifier_path),'r',encoding = 'utf-8')]) 23 | 24 | self.vocabs = set([line.strip() for line in open('{classifier_path}/vocabs.txt'.format(classifier_path = self.classifier_path), 'r',encoding = 'utf-8')]) 25 | 26 | # 读取专业词汇 27 | self.disease = set([line.strip() for line in open('{classifier_path}/dict/disease.txt'.format(classifier_path = self.classifier_path),'r',encoding = 'utf-8')]) 28 | 29 | self.drug = set([line.strip() for line in open('{classifier_path}/dict/drug.txt'.format(classifier_path = self.classifier_path), 'r',encoding = 'utf-8')]) 30 | 31 | # 初始化方法 32 | self._read_dict() 33 | 34 | def _read_dict(self): 35 | # jieba读取字典 36 | _, _, files = list(os.walk('{classifier_path}/dict'.format(classifier_path = self.classifier_path)))[0] 37 | for file in files: 38 | # print('jieba分词器读取文件: ' + file) 39 | jieba.load_userdict('{classifier_path}/dict/'.format(classifier_path = self.classifier_path) + file) 40 | 41 | def _init_slot(self, username): 42 | self.slots[username] = { 43 | "disease": None, 44 | "drug": None, 45 | "symptom": None, 46 | "recipe": None, 47 | "check": None 48 | } 49 | 50 | def detect(self, username: str, sentence: str): 51 | # 针对用户名初始化slot 52 | if username not in self.slots: 53 | self._init_slot(username) 54 | 55 | # 先用jieba初步分词 56 | split_list = list(jieba.cut(sentence)) 57 | 58 | # 检测是否有更新slot 59 | isUpdateSlot = False 60 | 61 | # 过滤掉不在fasttext训练中的词汇,即未登录词 62 | # 修正专业词汇 63 | filter_list = [] 64 | for word in split_list: 65 | if word in self.disease: 66 | self.update_slots(username, disease = word) 67 | isUpdateSlot = True 68 | filter_list.append('疾病') 69 | continue 70 | 71 | if word in self.drug: 72 | self.update_slots(username, drug = word) 73 | isUpdateSlot = True 74 | filter_list.append('药品') 75 | continue 76 | 77 | if word in self.vocabs: 78 | filter_list.append(word) 79 | 80 | print(filter_list) 81 | label_prob = self.model.predict(' '.join(filter_list)) 82 | print(label_prob) 83 | return label_prob[0][0][1:], not isUpdateSlot 84 | 85 | def update_slots(self, username, disease=None, drug=None, symptom=None, check=None, recipe=None): 86 | if username not in self.slots: 87 | self._init_slot(username) 88 | 89 | if disease: 90 | self.slots[username]['disease'] = disease 91 | 92 | if drug: 93 | self.slots[username]['drug'] = drug 94 | 95 | if symptom: 96 | self.slots[username]['symptom'] = symptom 97 | 98 | if check: 99 | self.slots[username]['check'] = check 100 | 101 | if recipe: 102 | self.slots[username]['recipe'] = recipe 103 | 104 | def set_single_slot(self, username, entity_name, content): 105 | self.slots[username][entity_name] = content 106 | 107 | def gain_slot(self, username): 108 | if username not in self.slots: 109 | self._init_slot(username) 110 | 111 | return self.slots[username] 112 | 113 | IntentDetector = Detector() 114 | 115 | if __name__ == '__main__': 116 | username = 'jezemy' 117 | IntentDetector.detect(username, '请问感冒怎么办') 118 | print(IntentDetector.gain_slot(username)) 119 | IntentDetector.detect(username, '骨折治疗费用是多少') 120 | print(IntentDetector.gain_slot(username)) 121 | IntentDetector.detect(username, '上清丸怎么使用') 122 | print(IntentDetector.gain_slot(username)) 123 | -------------------------------------------------------------------------------- /contextual/IntentProcessor.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | ''' 3 | 上下文机制 4 | 5 | 输入一句问句,判断意图,查询数据库 6 | 7 | 返回数据data = {text:"回复内容", buttons:[], pic_url:""} 8 | 9 | ''' 10 | from contextual.IntentDetector import IntentDetector 11 | from contextual.KGQuery import * 12 | 13 | import random 14 | 15 | class IntentProcess: 16 | def __init__(self): 17 | pass 18 | 19 | '''固定模板的intent''' 20 | def _action_greet(self): 21 | '''greet的回答方式''' 22 | # 将从下面的模板中随机选择一条回复 23 | response_pattern = [ 24 | '你好', 25 | '你好啊', 26 | ] 27 | text = random.choice(response_pattern) 28 | return {'text':text, 'button':[], 'pic_url':""} 29 | 30 | def _action_deny(self): 31 | response_pattern = [ 32 | '希望我能帮到你', 33 | '很高兴为您服务' 34 | ] 35 | text = random.choice(response_pattern) 36 | return {'text':text, 'button':[], 'pic_url':""} 37 | 38 | def _action_goodbye(self): 39 | response_pattern = [ 40 | '再见,希望您身体健康', 41 | '拜拜,希望我有帮助到您', 42 | '再见,很高兴能够为您服务' 43 | ] 44 | text = random.choice(response_pattern) 45 | return {'text':text, 'button':[], 'pic_url':""} 46 | 47 | def _action_affirm(self): 48 | response_pattern = [ 49 | '嗯嗯,请问还有其他问题吗', 50 | '好的,如果你有问题还可以继续询问我', 51 | '很高兴能够帮到你,请问还有其他什么要问的吗' 52 | ] 53 | text = random.choice(response_pattern) 54 | return {'text':text, 'button':[], 'pic_url':""} 55 | 56 | def _action_thankyou(self): 57 | response_pattern = [ 58 | '不用客气', 59 | '能帮到您是我的荣幸', 60 | '很高兴为您服务', 61 | '很高兴能够帮助到您' 62 | ] 63 | text = random.choice(response_pattern) 64 | return {'text':text, 'button':[], 'pic_url':""} 65 | 66 | '''查询数据库的Intent''' 67 | def _button_data_process(self, data, intent): 68 | # 要保证data有数据 69 | if data: 70 | return {'text': '请点击选择想要查询的内容', 'button': data, 'pic_url': "", "intent":intent} 71 | else: 72 | return {'text': '知识库暂无相关内容', 'button': [], 'pic_url': ""} 73 | 74 | def _action_disease_cause(self, slot:dict, sure=False): 75 | data = query_disease_property(slot['disease'], Disease.cause, sure) 76 | 77 | # 如果sure是False,那么返回的将会是数据库中与disease名字相似的名字列表,直接放进button 78 | if not sure: 79 | return self._button_data_process(data, "disease_cause") 80 | 81 | # 如果sure是True,那么查询到的结果是确定的disease的cause了。 82 | else: 83 | text = data['property'] 84 | if text: 85 | return {'text': text, 'button': [], 'pic_url': ""} 86 | else: 87 | return {'text': "知识库中暂无相关信息", 'button': [], 'pic_url': ""} 88 | 89 | def _action_disease_department(self, slot:dict, sure=False): 90 | data = query_disease_property(slot['disease'], Disease.department, sure) 91 | 92 | if not sure: 93 | return self._button_data_process(data, "disease_department") 94 | else: 95 | text = data['property'] 96 | if text: 97 | return {'text': text, 'button': [], 'pic_url': ""} 98 | else: 99 | return {'text': "知识库中暂无相关信息", 'button': [], 'pic_url': ""} 100 | 101 | def _action_disease_desc(self, slot: dict, sure = False): 102 | desc = query_disease_property(slot['disease'], Disease.desc, sure) 103 | 104 | if not sure: 105 | return self._button_data_process(desc, "disease_desc") 106 | else: 107 | 108 | data = {'text':'知识库暂无相关信息', 'button':[], 'pic_url':""} 109 | 110 | text = desc['property'] 111 | if text: 112 | data['text'] = text 113 | 114 | # 获取图片数据 115 | pic_url = query_disease_property(slot['disease'], Disease.pic_url, sure) 116 | if pic_url: 117 | data['pic_url'] = pic_url['property'] 118 | 119 | return data 120 | 121 | def _action_disease_diet(self, slot: dict, sure = False): 122 | diet_good = query_disease_property(slot['disease'], Disease.diet_good, sure) 123 | 124 | # 这里的diet_good有可能是按钮列表 125 | if not sure: 126 | return self._button_data_process(diet_good, "disease_diet") 127 | else: 128 | data = {'text': '', 'button': [], 'pic_url': "", "intent":"recipe_produce_way"} 129 | # 获取另外的属性 130 | good = diet_good['property'] 131 | if good: 132 | data['text'] = good + "\n" 133 | 134 | diet_bad = query_disease_property(slot['disease'], Disease.diet_bad, sure) 135 | bad = diet_bad['property'] 136 | if bad: 137 | data['text'] += bad 138 | 139 | recipe_list = query_disease_rels_recipe(slot['disease'], sure) 140 | if recipe_list: 141 | data['button'] = recipe_list 142 | 143 | if data['button'] and not data['text']: 144 | data['text'] = '{0}可以尝试以下食疗方式'.format(slot['disease']) 145 | 146 | if not (data['text'] and data['button']): 147 | data['text'] = '知识库暂无相关信息' 148 | 149 | return data 150 | 151 | def _action_disease_drug(self, slot: dict, sure = False): 152 | if not sure: 153 | data = query_disease(slot['disease']) 154 | return self._button_data_process(data, "disease_drug") 155 | else: 156 | drug_list = query_disease_rels_drug(slot['disease'], sure) 157 | return {'text': '{0}可以尝试以下药物'.format(slot['disease']), 'button': drug_list, 'pic_url': "", "intent":"drug_func"} 158 | 159 | def _action_disease_easy_get(self, slot:dict, sure=False): 160 | data = query_disease_property(slot['disease'], Disease.easy_get, sure) 161 | 162 | if not sure: 163 | return self._button_data_process(data, "disease_easy_get") 164 | else: 165 | text = data['property'] 166 | if text: 167 | return {'text': text, 'button': [], 'pic_url': ""} 168 | else: 169 | return {'text': "知识库中暂无相关信息", 'button': [], 'pic_url': ""} 170 | 171 | def _action_disease_neopathy(self, slot:dict, sure=False): 172 | if not sure: 173 | data = query_disease(slot['disease']) 174 | return self._button_data_process(data, "disease_neopathy") 175 | else: 176 | neopathy_list = query_disease_rels_neopathy(slot['disease'], sure) 177 | return {'text': '{0}常常会伴随有如下并发症'.format(slot['disease']), 'button': neopathy_list, 'pic_url': "", "intent":"disease_desc"} 178 | 179 | def _action_disease_prevent(self, slot:dict, sure=False): 180 | data = query_disease_property(slot['disease'], Disease.prevent, sure) 181 | 182 | if not sure: 183 | return self._button_data_process(data, "disease_prevent") 184 | else: 185 | text = data['property'] 186 | if text: 187 | return {'text': text, 'button': [], 'pic_url': ""} 188 | else: 189 | return {'text': "知识库中暂无相关信息", 'button': [], 'pic_url': ""} 190 | 191 | def _action_disease_symptom(self, slot:dict, sure=False): 192 | if not sure: 193 | data = query_disease(slot['disease']) 194 | return self._button_data_process(data, "disease_symptom") 195 | else: 196 | symptom_list = query_disease_rels_symptom(slot['disease'], sure) 197 | return {'text': '{0}常常会有{1}的症状'.format(slot['disease'], ",".join(symptom_list)), 'button': [], 'pic_url': ""} 198 | 199 | def _action_disease_treat_cost(self, slot:dict, sure=False): 200 | data = query_disease_property(slot['disease'], Disease.treat_cost, sure) 201 | 202 | if not sure: 203 | return self._button_data_process(data, "disease_treat_cost") 204 | else: 205 | text = data['property'] 206 | if text: 207 | return {'text': text, 'button': [], 'pic_url': ""} 208 | else: 209 | return {'text': "知识库中暂无相关信息", 'button': [], 'pic_url': ""} 210 | 211 | def _action_disease_treat_rate(self, slot:dict, sure=False): 212 | data = query_disease_property(slot['disease'], Disease.treat_rate, sure) 213 | 214 | if not sure: 215 | return self._button_data_process(data, "disease_treat_rate") 216 | else: 217 | text = data['property'] 218 | if text: 219 | return {'text': text, 'button': [], 'pic_url': ""} 220 | else: 221 | return {'text': "知识库中暂无相关信息", 'button': [], 'pic_url': ""} 222 | 223 | def _action_disease_treat_time(self, slot:dict, sure=False): 224 | data = query_disease_property(slot['disease'], Disease.treat_time, sure) 225 | 226 | if not sure: 227 | return self._button_data_process(data, "disease_treat_time") 228 | else: 229 | text = data['property'] 230 | if text: 231 | return {'text': text, 'button': [], 'pic_url': ""} 232 | else: 233 | return {'text': "知识库中暂无相关信息", 'button': [], 'pic_url': ""} 234 | 235 | def _action_disease_treat_way(self, slot:dict, sure=False): 236 | data = query_disease_property(slot['disease'], Disease.treat_way, sure) 237 | 238 | if not sure: 239 | return self._button_data_process(data, "disease_treat_way") 240 | else: 241 | text = data['property'] 242 | if text: 243 | return {'text': text, 'button': [], 'pic_url': ""} 244 | else: 245 | return {'text': "知识库中暂无相关信息", 'button': [], 'pic_url': ""} 246 | 247 | def _action_drug_func(self, slot:dict, sure=False): 248 | func = query_drug_property(slot['drug'], Drug.func, sure) 249 | 250 | if not sure: 251 | return self._button_data_process(func, "drug_func") 252 | else: 253 | data = {'text': "知识库中暂无相关信息", 'button': [], 'pic_url': ""} 254 | text = func['property'] 255 | if text: 256 | data['text'] = text 257 | 258 | pic_url = query_drug_property(slot['drug'], Drug.pic_url, sure) 259 | if pic_url['property']: 260 | data['pic_url'] = pic_url['property'] 261 | 262 | return data 263 | 264 | def _action_drug_price(self, slot:dict, sure=False): 265 | data = query_drug_property(slot['drug'], Drug.price, sure) 266 | 267 | if not sure: 268 | return self._button_data_process(data, "drug_price") 269 | else: 270 | text = data['property'] 271 | if text: 272 | return {'text': text, 'button': [], 'pic_url': ""} 273 | else: 274 | return {'text': "知识库中暂无相关信息", 'button': [], 'pic_url': ""} 275 | 276 | def _action_drug_use(self, slot:dict, sure=False): 277 | data = query_drug_property(slot['drug'], Drug.use, sure) 278 | 279 | if not sure: 280 | return self._button_data_process(data, "drug_use") 281 | else: 282 | text = data['property'] 283 | if text: 284 | return {'text': text, 'button': [], 'pic_url': ""} 285 | else: 286 | return {'text': "知识库中暂无相关信息", 'button': [], 'pic_url': ""} 287 | 288 | def _action_recipe_produce_way(self, slot:dict, sure=False): 289 | produce_way = query_recipe_property(slot['recipe'], Recipe.produce_way) 290 | pic_url = query_recipe_property(slot['recipe'], Recipe.pic_url) 291 | 292 | data = {'text': '知识库中暂无相关信息', 'button': [], 'pic_url': ""} 293 | if produce_way['property']: 294 | data['text'] = produce_way['property'] 295 | 296 | if pic_url['property']: 297 | data['pic_url'] = pic_url['property'] 298 | 299 | return data 300 | 301 | '''对外开放的接口''' 302 | def intent_not_sure(self, username, sentence): 303 | '''处理文本,提取出意图类型,调用对应函数, 用getattr简化代码,不然要写很长的if判断''' 304 | intent, sure = IntentDetector.detect(username, sentence) 305 | 306 | if "_" not in intent: 307 | # 固定模板的intent 308 | response_data = getattr(self, '_action_{intent}'.format(intent = intent))() 309 | else: 310 | # 查询数据库的intent 311 | slot = IntentDetector.gain_slot(username) 312 | response_data = getattr(self, '_action_{intent}'.format(intent = intent))(slot, sure) 313 | 314 | 315 | print(response_data) 316 | print(IntentDetector.gain_slot(username)) 317 | print("-"*50) 318 | return response_data 319 | 320 | def intent_button_sure(self, username, intent): 321 | '''进入这个方法的,都是按钮点进来的''' 322 | slot = IntentDetector.gain_slot(username) 323 | response_data = getattr(self, '_action_{intent}'.format(intent = intent))(slot, True) 324 | print(response_data) 325 | return response_data 326 | 327 | def set_slot(self, username, disease=None, drug=None, symptom=None, check=None, recipe=None): 328 | IntentDetector.update_slots(username, disease, drug, symptom, check, recipe) 329 | 330 | def set_single_slot(self, username, entity_name, content): 331 | IntentDetector.set_single_slot(username, entity_name, content) 332 | 333 | IntentProcessor = IntentProcess() 334 | if __name__ == '__main__': 335 | # 测试 336 | username = 'jezemy' 337 | 338 | IntentProcessor.set_slot(username, disease = "感冒") 339 | IntentProcessor.intent_not_sure(username, '是怎么引起的') 340 | IntentProcessor.intent_not_sure(username, '要去哪看病') 341 | IntentProcessor.intent_not_sure(username, '是什么') 342 | IntentProcessor.intent_not_sure(username, '饮食要注意什么') 343 | IntentProcessor.intent_not_sure(username, '吃什么药好') 344 | IntentProcessor.intent_not_sure(username, '谁比较容易得') 345 | IntentProcessor.intent_not_sure(username, '有什么并发症') 346 | IntentProcessor.intent_not_sure(username, '怎么预防') 347 | IntentProcessor.intent_not_sure(username, '一般有什么症状') 348 | IntentProcessor.intent_not_sure(username, '治疗要多少钱') 349 | IntentProcessor.intent_not_sure(username, '要治疗多久') 350 | IntentProcessor.intent_not_sure(username, '怎么治疗') 351 | 352 | IntentDetector.update_slots(username, drug = '广州白云山陈李济 上清丸') 353 | IntentProcessor.intent_button_sure(username, 'drug_func') 354 | IntentProcessor.intent_button_sure(username, 'drug_price') 355 | IntentProcessor.intent_button_sure(username, 'drug_use') 356 | IntentDetector.update_slots(username, recipe = "荔枝荷花蒸鸭") 357 | IntentProcessor.intent_button_sure(username, 'recipe_produce_way') -------------------------------------------------------------------------------- /contextual/KGQuery.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | 3 | ''' 4 | 查询数据库 5 | ''' 6 | 7 | from py2neo import * 8 | import re 9 | 10 | # 在这里修改Neo4j用户名和密码 11 | graph = Graph("http://localhost:7474", username="neo4j",password='root') 12 | 13 | # 读取专业词汇 14 | '''django用第二个,普通用第一个''' 15 | # classifier_path = '../classifier' 16 | classifier_path = 'classifier' 17 | disease_names = list(set([line.strip() for line in open('{classifier_path}/dict/disease.txt'.format(classifier_path=classifier_path), 'r', encoding = 'utf-8')])) 18 | drug_names = list(set([line.strip() for line in open('{classifier_path}/dict/drug.txt'.format(classifier_path=classifier_path), 'r', encoding = 'utf-8')])) 19 | 20 | class Disease: 21 | name = 'name' 22 | easy_get = 'easy_get' 23 | ill_rate = 'ill_rate' 24 | pic_url = 'pic_url' 25 | desc = 'desc' 26 | cause = 'cause' 27 | prevent = 'prevent' 28 | department = 'department' 29 | treat_way = 'treat_way' 30 | treat_time = 'treat_time' 31 | treat_rate = 'treat_rate' 32 | treat_cost = 'treat_cost' 33 | diet_good = 'diet_good' 34 | diet_bad = 'diet_bad' 35 | 36 | class Drug: 37 | name = 'name' 38 | pic_url = 'pic_url' 39 | price = 'price' 40 | func = 'func' 41 | use = 'use' 42 | 43 | class Recipe: 44 | name = 'name' 45 | pic_url = 'pic_url' 46 | produce_way = 'produce_way' 47 | 48 | def query_disease(disease): 49 | '''查询所有相似名字的疾病''' 50 | name_list = [] 51 | pattern = '.*{disease}.*'.format(disease=disease) 52 | for name in disease_names: 53 | ret = re.findall(pattern, name) 54 | if ret: 55 | name_list.append(ret[0]) 56 | return name_list 57 | 58 | def query_disease_property(disease:str, property_name:str, sure:bool=False): 59 | '''查找disease实体的属性''' 60 | if not sure: 61 | return query_disease(disease) 62 | 63 | cql = 'match (n:Disease) where n.name="{disease}" return n.{property}'.format(disease = disease, property=property_name) 64 | ret = graph.run(cql).data() 65 | 66 | # 进行属性空判断, 理论上都是匹配字典的,应该不会空,但是以防万一还是判断下 67 | if ret: 68 | ret_content = ret[0]['n.{0}'.format(property_name)] 69 | if ret_content: 70 | return {"property": ret_content} 71 | 72 | return {"property": ""} 73 | 74 | 75 | def query_drug(drug:str): 76 | '''查找drug实体的属性''' 77 | cql = 'match (n:Drug) where n.name=~".*{drug}.*" return n.name'.format(drug=drug) 78 | ret = graph.run(cql).data() 79 | 80 | name_list = [] 81 | for drug_data in ret: 82 | if drug_data['n.name']: 83 | name_list.append(drug_data['n.name']) 84 | 85 | return name_list 86 | 87 | def query_drug_property(drug:str, property_name:str, sure:bool=False): 88 | '''查找drug实体的属性''' 89 | if not sure: 90 | return query_drug(drug) 91 | 92 | cql = 'match (n:Drug) where n.name="{drug}" return n.{property}'.format(drug=drug, property=property_name) 93 | ret = graph.run(cql).data() 94 | 95 | if ret: 96 | ret_content = ret[0]['n.{0}'.format(property_name)] 97 | if ret_content: 98 | return {"property": ret_content} 99 | 100 | return {"property": ""} 101 | 102 | def query_recipe_property(recipe:str, property_name:str): 103 | cql = 'match (n:Recipe) where n.name="{recipe}" return n.{property}'.format(recipe = recipe, property = property_name) 104 | ret = graph.run(cql).data() 105 | 106 | if ret: 107 | ret_content = ret[0]['n.{0}'.format(property_name)] 108 | if ret_content: 109 | return {"property": ret_content} 110 | 111 | return {"property": ""} 112 | 113 | 114 | def query_disease_rels_neopathy(disease:str, sure:bool=False): 115 | '''查找疾病的并发症''' 116 | if not sure: 117 | return query_disease(disease) 118 | cql = 'match(n:Disease)-[r:accompany_with]-(m:Disease) where n.name="{0}" return m.name'.format(disease) 119 | ret = graph.run(cql).data() 120 | 121 | name_list = [] 122 | for neo in ret: 123 | if neo['m.name']: 124 | name_list.append(neo['m.name']) 125 | return name_list 126 | 127 | def query_disease_rels_symptom(disease:str, sure:bool=False): 128 | '''查找疾病的症状''' 129 | if not sure: 130 | return query_disease(disease) 131 | cql = 'match(n:Disease)-[r:has_symptom]-(m:Symptom) where n.name="{0}" return m.name'.format(disease) 132 | ret = graph.run(cql).data() 133 | 134 | name_list = [] 135 | for neo in ret: 136 | if neo['m.name']: 137 | name_list.append(neo['m.name']) 138 | return name_list 139 | 140 | def query_disease_rels_drug(disease:str, sure:bool=False): 141 | '''查找疾病的推荐药品''' 142 | if not sure: 143 | return query_disease(disease) 144 | cql = 'match(n:Disease)-[r:recommend_drug]-(m:Drug) where n.name="{0}" return m.name'.format(disease) 145 | ret = graph.run(cql).data() 146 | 147 | name_list = [] 148 | for neo in ret: 149 | if neo['m.name']: 150 | name_list.append(neo['m.name']) 151 | return name_list 152 | 153 | def query_disease_rels_check(disease:str, sure:bool=False): 154 | '''查找疾病的检查项目''' 155 | if not sure: 156 | return query_disease(disease) 157 | cql = 'match(n:Disease)-[r:need_check]-(m:Check) where n.name="{0}" return m.name'.format(disease) 158 | ret = graph.run(cql).data() 159 | 160 | name_list = [] 161 | for neo in ret: 162 | if neo['m.name']: 163 | name_list.append(neo['m.name']) 164 | return name_list 165 | 166 | def query_disease_rels_recipe(disease:str, sure:bool=False): 167 | '''查找疾病的菜谱''' 168 | if not sure: 169 | return query_disease(disease) 170 | cql = 'match(n:Disease)-[r:recommend_diet]-(m:Recipe) where n.name="{0}" return m.name'.format(disease) 171 | ret = graph.run(cql).data() 172 | 173 | name_list = [] 174 | for neo in ret: 175 | if neo['m.name']: 176 | name_list.append(neo['m.name']) 177 | return name_list 178 | 179 | if __name__ == '__main__': 180 | data = query_recipe_property("西芹百合", Recipe.produce_way) 181 | print(data) 182 | -------------------------------------------------------------------------------- /contextual/__pycache__/IntentDetector.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jezemy/MASystem/7f1b86da04250ca9f5ebdafb956e330bb0449bea/contextual/__pycache__/IntentDetector.cpython-36.pyc -------------------------------------------------------------------------------- /contextual/__pycache__/IntentProcessor.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jezemy/MASystem/7f1b86da04250ca9f5ebdafb956e330bb0449bea/contextual/__pycache__/IntentProcessor.cpython-36.pyc -------------------------------------------------------------------------------- /contextual/__pycache__/KGQuery.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jezemy/MASystem/7f1b86da04250ca9f5ebdafb956e330bb0449bea/contextual/__pycache__/KGQuery.cpython-36.pyc -------------------------------------------------------------------------------- /db.sqlite3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jezemy/MASystem/7f1b86da04250ca9f5ebdafb956e330bb0449bea/db.sqlite3 -------------------------------------------------------------------------------- /main.py: -------------------------------------------------------------------------------- 1 | n = int(input()) 2 | res = 1 3 | k = 1 4 | while res < n: 5 | k += 1 6 | res += 1 / k 7 | 8 | print(k) -------------------------------------------------------------------------------- /manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import os 3 | import sys 4 | 5 | if __name__ == '__main__': 6 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'MedicalAssistant.settings') 7 | try: 8 | from django.core.management import execute_from_command_line 9 | except ImportError as exc: 10 | raise ImportError( 11 | "Couldn't import Django. Are you sure it's installed and " 12 | "available on your PYTHONPATH environment variable? Did you " 13 | "forget to activate a virtual environment?" 14 | ) from exc 15 | execute_from_command_line(sys.argv) 16 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # 中文医疗问答系统 2 | 3 | ## 预览 4 | ![image-20230319192224207](https://github.com/Jezemy/MASystem/blob/main/assets/image-20230319192224213.png) 5 | 6 | ![image-20230319192207463](https://github.com/Jezemy/MASystem/blob/main/assets/image-20230319192207463.png) 7 | 8 | ## 介绍 9 | 10 | 本项目为本人的本科毕业设计,基于知识图谱的中文医疗问答系统,通过爬虫工具从公开的医疗网站获取医疗知识并利用Neo4j图数据库构建知识图谱。问句意图利用Fasttext文本分类算法识别,并简单编写了一个槽位记忆功能辅助记住上下文信息,最后利用Django框架搭建了一个简单的前端对话界面。 11 | 12 | ## 使用步骤 13 | 14 | ### 1. 下载本项目并安装必备环境依赖 15 | 16 | ### 必备 17 | 18 | - JDK 15以上 19 | - Neo4j 4.2.1 20 | - Python3.6以上 21 | - Django 2.1.7 22 | - jieba 0.42.1 23 | - fasttext 0.9.2 24 | - py2neo 2020.1.1 25 | 26 | ### 爬虫相关 27 | 28 | - requests 2.25.1 29 | - lxml 4.3.0 30 | - retrying 1.3.3 31 | - vthread 0.1.1 32 | - cchardet 2.1.7 33 | 34 | ### 其他 35 | 36 | - pyTelegramBotAPI 3.7.4 (用于连接TelegramBot) 37 | 38 | ### 2. 安装Neo4j数据库 39 | 40 | [Neo4j安装教程](https://blog.csdn.net/qq_38335648/article/details/115027676) 41 | 42 | ### 3. 还原Neo4j数据 43 | 44 | 点击[医疗知识图谱数据](https://pan.baidu.com/s/1UculLeRm7-9g7K7t7VtPtQ)下载数据,提取码:a04c 45 | 46 | 下载后执行下面的命令进行数据还原 47 | 48 | ```shell 49 | # 如果没有把neo4j的命令加进环境变量,请到neo4j的安装目录下的bin文件中执行 50 | # 假设neo4j.dum的路径是:G:/dump/neo4j.dump 51 | # neo4j数据库的名称是graph 52 | 53 | neo4j-admin load --from=G:/dump/neo4j.dump --database=graph.db --force 54 | ``` 55 | 56 | 57 | 58 | ### 4. 修改用户名密码 59 | 60 | 打开项目中的contextual/KGQuery.py文件,修改连接的用户名和密码 61 | 62 | ![image-20230319200606840](https://github.com/Jezemy/MASystem/blob/main/assets/image-20230319200606840.png) 63 | 64 | ### 5. 启动Neo4j服务 65 | 66 | ```shell 67 | # 在命令行中启动Neo4j 68 | neo4j.bat console 69 | ``` 70 | 71 | ### 6. 启动Django服务访问默认地址 72 | 73 | ```Shell 74 | # 定位到MASystem目录下,执行manage.py 75 | python manage.py runserver 76 | ``` 77 | 78 | ### Telegram Bot说明 79 | 80 | TelegramBot需要到官网申请创建机器人,并将生成的Token复制到telegramBot.py的Token变量即可运行。 81 | 82 | ## 项目模块 83 | 84 | ![image-20230319192131382](https://github.com/Jezemy/MASystem/blob/main/assets/image-20230319192131382.png) 85 | 86 | ## 代码文件结构 87 | 88 | 主要代码存放在MASystem文件夹中 89 | 90 | - Crawler 爬虫代码以及爬取到的医疗信息 91 | - dict 实体字典列表 92 | - entities 爬取的所有数据,整理成json格式 93 | - build_dict.py 从爬取后的数据中提取实体字典 94 | - buIld_graph.py 依靠爬取的数据连接neo4j构建知识图谱 95 | - request_disease.py 爬取疾病分类数据 96 | - request_others.py 爬取其他分类数据 97 | - classifier 意图分类器相关代码 98 | - dict 部分意图语料和实体字典 99 | - intent 意图语料 100 | - models 存储训练好的模型 101 | - fasttext_data.txt Fasttext库能够识别的语料 102 | - intent.txt 所有意图的举例解释文件 103 | - stopwords.txt 停用词语料 104 | - train_intents_fasttext.py 训练Fasttext分类器的代码 105 | - vocabs.txt 训练Fasttext过程中留下的字典,不重要 106 | - word2vec-test.py 采用word2vec的尝试,不重要 107 | - contextual 处理上下文信息的代码 108 | - IntentDetector.py 调用模型识别意图代码 109 | - IntentProcessor.py 记忆上下文实体,处理对应意图的回复 110 | - KGQuery.py 提供从图数据库查询的各类方法 111 | - telegramBot.py 支持机器人在telegram上运行的相关代码 112 | - static中存放网页相关的静态文件 113 | - 其他文件均为 Django框架生成或依赖的文件 114 | 115 | ### 116 | -------------------------------------------------------------------------------- /robot/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jezemy/MASystem/7f1b86da04250ca9f5ebdafb956e330bb0449bea/robot/__init__.py -------------------------------------------------------------------------------- /robot/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jezemy/MASystem/7f1b86da04250ca9f5ebdafb956e330bb0449bea/robot/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /robot/__pycache__/admin.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jezemy/MASystem/7f1b86da04250ca9f5ebdafb956e330bb0449bea/robot/__pycache__/admin.cpython-36.pyc -------------------------------------------------------------------------------- /robot/__pycache__/models.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jezemy/MASystem/7f1b86da04250ca9f5ebdafb956e330bb0449bea/robot/__pycache__/models.cpython-36.pyc -------------------------------------------------------------------------------- /robot/__pycache__/urls.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jezemy/MASystem/7f1b86da04250ca9f5ebdafb956e330bb0449bea/robot/__pycache__/urls.cpython-36.pyc -------------------------------------------------------------------------------- /robot/__pycache__/views.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jezemy/MASystem/7f1b86da04250ca9f5ebdafb956e330bb0449bea/robot/__pycache__/views.cpython-36.pyc -------------------------------------------------------------------------------- /robot/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /robot/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class RobotConfig(AppConfig): 5 | name = 'robot' 6 | -------------------------------------------------------------------------------- /robot/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jezemy/MASystem/7f1b86da04250ca9f5ebdafb956e330bb0449bea/robot/migrations/__init__.py -------------------------------------------------------------------------------- /robot/migrations/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jezemy/MASystem/7f1b86da04250ca9f5ebdafb956e330bb0449bea/robot/migrations/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /robot/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | # Create your models here. 4 | -------------------------------------------------------------------------------- /robot/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /robot/urls.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | from django.urls import path 3 | from . import views 4 | 5 | app_name = 'robot' 6 | urlpatterns=[ 7 | path('',views.indexPage), 8 | path('receiveMsg/',views.receiveMsg), 9 | path('receiveBtn/', views.receiveBtn), 10 | path('test/',views.getTest), 11 | ] -------------------------------------------------------------------------------- /robot/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render 2 | from django.http import JsonResponse 3 | from contextual.IntentProcessor import IntentProcessor 4 | 5 | ''' 6 | 前端数据: 7 | sentence = request.POST.get('msg') 8 | username = request.POST.get('username') 9 | 10 | 返回数据: 11 | {"code":"200", "response":text, "buttons":[]} 12 | 13 | {"code":"200", "response":text} 14 | ''' 15 | 16 | # Create your views here. 17 | def indexPage(request): 18 | return render(request,'index.html') 19 | 20 | def receiveMsg(request): 21 | sentence = request.POST.get('msg') 22 | username = request.POST.get('username') 23 | 24 | data_back = {"code": "200", "response": '', "buttons": [], 'pic_url':""} 25 | data = IntentProcessor.intent_not_sure(username, sentence) 26 | if data['text']: 27 | data_back['response'] = data['text'] 28 | 29 | if data['button']: 30 | data_back['buttons'] = data['button'] 31 | data_back['intent'] = data['intent'] 32 | 33 | if data['pic_url']: 34 | data_back["pic_url"] = data['pic_url'] 35 | 36 | 37 | 38 | return JsonResponse(data_back, safe = False) 39 | 40 | def receiveBtn(request): 41 | entity = request.POST.get("msg") 42 | username = request.POST.get('username') 43 | intent = request.POST.get('intent') 44 | 45 | entity_name = intent.split("_")[0] 46 | IntentProcessor.set_single_slot(username, entity_name, entity) 47 | data = IntentProcessor.intent_button_sure(username, intent) 48 | data_back = {"code":"200", "response":data['text'], "pic_url":""} 49 | if data['pic_url']: 50 | data_back['pic_url'] = data['pic_url'] 51 | return JsonResponse(data_back, safe = False) 52 | 53 | def getTest(request): 54 | return JsonResponse({"code":"200","content":"connect successfully"}, safe = False) -------------------------------------------------------------------------------- /static/robot/bootstrap/css/bootstrap-theme.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap v3.3.7 (http://getbootstrap.com) 3 | * Copyright 2011-2016 Twitter, Inc. 4 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 5 | */ 6 | .btn-default, 7 | .btn-primary, 8 | .btn-success, 9 | .btn-info, 10 | .btn-warning, 11 | .btn-danger { 12 | text-shadow: 0 -1px 0 rgba(0, 0, 0, .2); 13 | -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), 0 1px 1px rgba(0, 0, 0, .075); 14 | box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), 0 1px 1px rgba(0, 0, 0, .075); 15 | } 16 | .btn-default:active, 17 | .btn-primary:active, 18 | .btn-success:active, 19 | .btn-info:active, 20 | .btn-warning:active, 21 | .btn-danger:active, 22 | .btn-default.active, 23 | .btn-primary.active, 24 | .btn-success.active, 25 | .btn-info.active, 26 | .btn-warning.active, 27 | .btn-danger.active { 28 | -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125); 29 | box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125); 30 | } 31 | .btn-default.disabled, 32 | .btn-primary.disabled, 33 | .btn-success.disabled, 34 | .btn-info.disabled, 35 | .btn-warning.disabled, 36 | .btn-danger.disabled, 37 | .btn-default[disabled], 38 | .btn-primary[disabled], 39 | .btn-success[disabled], 40 | .btn-info[disabled], 41 | .btn-warning[disabled], 42 | .btn-danger[disabled], 43 | fieldset[disabled] .btn-default, 44 | fieldset[disabled] .btn-primary, 45 | fieldset[disabled] .btn-success, 46 | fieldset[disabled] .btn-info, 47 | fieldset[disabled] .btn-warning, 48 | fieldset[disabled] .btn-danger { 49 | -webkit-box-shadow: none; 50 | box-shadow: none; 51 | } 52 | .btn-default .badge, 53 | .btn-primary .badge, 54 | .btn-success .badge, 55 | .btn-info .badge, 56 | .btn-warning .badge, 57 | .btn-danger .badge { 58 | text-shadow: none; 59 | } 60 | .btn:active, 61 | .btn.active { 62 | background-image: none; 63 | } 64 | .btn-default { 65 | text-shadow: 0 1px 0 #fff; 66 | background-image: -webkit-linear-gradient(top, #fff 0%, #e0e0e0 100%); 67 | background-image: -o-linear-gradient(top, #fff 0%, #e0e0e0 100%); 68 | background-image: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#e0e0e0)); 69 | background-image: linear-gradient(to bottom, #fff 0%, #e0e0e0 100%); 70 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe0e0e0', GradientType=0); 71 | filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); 72 | background-repeat: repeat-x; 73 | border-color: #dbdbdb; 74 | border-color: #ccc; 75 | } 76 | .btn-default:hover, 77 | .btn-default:focus { 78 | background-color: #e0e0e0; 79 | background-position: 0 -15px; 80 | } 81 | .btn-default:active, 82 | .btn-default.active { 83 | background-color: #e0e0e0; 84 | border-color: #dbdbdb; 85 | } 86 | .btn-default.disabled, 87 | .btn-default[disabled], 88 | fieldset[disabled] .btn-default, 89 | .btn-default.disabled:hover, 90 | .btn-default[disabled]:hover, 91 | fieldset[disabled] .btn-default:hover, 92 | .btn-default.disabled:focus, 93 | .btn-default[disabled]:focus, 94 | fieldset[disabled] .btn-default:focus, 95 | .btn-default.disabled.focus, 96 | .btn-default[disabled].focus, 97 | fieldset[disabled] .btn-default.focus, 98 | .btn-default.disabled:active, 99 | .btn-default[disabled]:active, 100 | fieldset[disabled] .btn-default:active, 101 | .btn-default.disabled.active, 102 | .btn-default[disabled].active, 103 | fieldset[disabled] .btn-default.active { 104 | background-color: #e0e0e0; 105 | background-image: none; 106 | } 107 | .btn-primary { 108 | background-image: -webkit-linear-gradient(top, #337ab7 0%, #265a88 100%); 109 | background-image: -o-linear-gradient(top, #337ab7 0%, #265a88 100%); 110 | background-image: -webkit-gradient(linear, left top, left bottom, from(#337ab7), to(#265a88)); 111 | background-image: linear-gradient(to bottom, #337ab7 0%, #265a88 100%); 112 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff265a88', GradientType=0); 113 | filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); 114 | background-repeat: repeat-x; 115 | border-color: #245580; 116 | } 117 | .btn-primary:hover, 118 | .btn-primary:focus { 119 | background-color: #265a88; 120 | background-position: 0 -15px; 121 | } 122 | .btn-primary:active, 123 | .btn-primary.active { 124 | background-color: #265a88; 125 | border-color: #245580; 126 | } 127 | .btn-primary.disabled, 128 | .btn-primary[disabled], 129 | fieldset[disabled] .btn-primary, 130 | .btn-primary.disabled:hover, 131 | .btn-primary[disabled]:hover, 132 | fieldset[disabled] .btn-primary:hover, 133 | .btn-primary.disabled:focus, 134 | .btn-primary[disabled]:focus, 135 | fieldset[disabled] .btn-primary:focus, 136 | .btn-primary.disabled.focus, 137 | .btn-primary[disabled].focus, 138 | fieldset[disabled] .btn-primary.focus, 139 | .btn-primary.disabled:active, 140 | .btn-primary[disabled]:active, 141 | fieldset[disabled] .btn-primary:active, 142 | .btn-primary.disabled.active, 143 | .btn-primary[disabled].active, 144 | fieldset[disabled] .btn-primary.active { 145 | background-color: #265a88; 146 | background-image: none; 147 | } 148 | .btn-success { 149 | background-image: -webkit-linear-gradient(top, #5cb85c 0%, #419641 100%); 150 | background-image: -o-linear-gradient(top, #5cb85c 0%, #419641 100%); 151 | background-image: -webkit-gradient(linear, left top, left bottom, from(#5cb85c), to(#419641)); 152 | background-image: linear-gradient(to bottom, #5cb85c 0%, #419641 100%); 153 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff419641', GradientType=0); 154 | filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); 155 | background-repeat: repeat-x; 156 | border-color: #3e8f3e; 157 | } 158 | .btn-success:hover, 159 | .btn-success:focus { 160 | background-color: #419641; 161 | background-position: 0 -15px; 162 | } 163 | .btn-success:active, 164 | .btn-success.active { 165 | background-color: #419641; 166 | border-color: #3e8f3e; 167 | } 168 | .btn-success.disabled, 169 | .btn-success[disabled], 170 | fieldset[disabled] .btn-success, 171 | .btn-success.disabled:hover, 172 | .btn-success[disabled]:hover, 173 | fieldset[disabled] .btn-success:hover, 174 | .btn-success.disabled:focus, 175 | .btn-success[disabled]:focus, 176 | fieldset[disabled] .btn-success:focus, 177 | .btn-success.disabled.focus, 178 | .btn-success[disabled].focus, 179 | fieldset[disabled] .btn-success.focus, 180 | .btn-success.disabled:active, 181 | .btn-success[disabled]:active, 182 | fieldset[disabled] .btn-success:active, 183 | .btn-success.disabled.active, 184 | .btn-success[disabled].active, 185 | fieldset[disabled] .btn-success.active { 186 | background-color: #419641; 187 | background-image: none; 188 | } 189 | .btn-info { 190 | background-image: -webkit-linear-gradient(top, #5bc0de 0%, #2aabd2 100%); 191 | background-image: -o-linear-gradient(top, #5bc0de 0%, #2aabd2 100%); 192 | background-image: -webkit-gradient(linear, left top, left bottom, from(#5bc0de), to(#2aabd2)); 193 | background-image: linear-gradient(to bottom, #5bc0de 0%, #2aabd2 100%); 194 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff2aabd2', GradientType=0); 195 | filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); 196 | background-repeat: repeat-x; 197 | border-color: #28a4c9; 198 | } 199 | .btn-info:hover, 200 | .btn-info:focus { 201 | background-color: #2aabd2; 202 | background-position: 0 -15px; 203 | } 204 | .btn-info:active, 205 | .btn-info.active { 206 | background-color: #2aabd2; 207 | border-color: #28a4c9; 208 | } 209 | .btn-info.disabled, 210 | .btn-info[disabled], 211 | fieldset[disabled] .btn-info, 212 | .btn-info.disabled:hover, 213 | .btn-info[disabled]:hover, 214 | fieldset[disabled] .btn-info:hover, 215 | .btn-info.disabled:focus, 216 | .btn-info[disabled]:focus, 217 | fieldset[disabled] .btn-info:focus, 218 | .btn-info.disabled.focus, 219 | .btn-info[disabled].focus, 220 | fieldset[disabled] .btn-info.focus, 221 | .btn-info.disabled:active, 222 | .btn-info[disabled]:active, 223 | fieldset[disabled] .btn-info:active, 224 | .btn-info.disabled.active, 225 | .btn-info[disabled].active, 226 | fieldset[disabled] .btn-info.active { 227 | background-color: #2aabd2; 228 | background-image: none; 229 | } 230 | .btn-warning { 231 | background-image: -webkit-linear-gradient(top, #f0ad4e 0%, #eb9316 100%); 232 | background-image: -o-linear-gradient(top, #f0ad4e 0%, #eb9316 100%); 233 | background-image: -webkit-gradient(linear, left top, left bottom, from(#f0ad4e), to(#eb9316)); 234 | background-image: linear-gradient(to bottom, #f0ad4e 0%, #eb9316 100%); 235 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffeb9316', GradientType=0); 236 | filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); 237 | background-repeat: repeat-x; 238 | border-color: #e38d13; 239 | } 240 | .btn-warning:hover, 241 | .btn-warning:focus { 242 | background-color: #eb9316; 243 | background-position: 0 -15px; 244 | } 245 | .btn-warning:active, 246 | .btn-warning.active { 247 | background-color: #eb9316; 248 | border-color: #e38d13; 249 | } 250 | .btn-warning.disabled, 251 | .btn-warning[disabled], 252 | fieldset[disabled] .btn-warning, 253 | .btn-warning.disabled:hover, 254 | .btn-warning[disabled]:hover, 255 | fieldset[disabled] .btn-warning:hover, 256 | .btn-warning.disabled:focus, 257 | .btn-warning[disabled]:focus, 258 | fieldset[disabled] .btn-warning:focus, 259 | .btn-warning.disabled.focus, 260 | .btn-warning[disabled].focus, 261 | fieldset[disabled] .btn-warning.focus, 262 | .btn-warning.disabled:active, 263 | .btn-warning[disabled]:active, 264 | fieldset[disabled] .btn-warning:active, 265 | .btn-warning.disabled.active, 266 | .btn-warning[disabled].active, 267 | fieldset[disabled] .btn-warning.active { 268 | background-color: #eb9316; 269 | background-image: none; 270 | } 271 | .btn-danger { 272 | background-image: -webkit-linear-gradient(top, #d9534f 0%, #c12e2a 100%); 273 | background-image: -o-linear-gradient(top, #d9534f 0%, #c12e2a 100%); 274 | background-image: -webkit-gradient(linear, left top, left bottom, from(#d9534f), to(#c12e2a)); 275 | background-image: linear-gradient(to bottom, #d9534f 0%, #c12e2a 100%); 276 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc12e2a', GradientType=0); 277 | filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); 278 | background-repeat: repeat-x; 279 | border-color: #b92c28; 280 | } 281 | .btn-danger:hover, 282 | .btn-danger:focus { 283 | background-color: #c12e2a; 284 | background-position: 0 -15px; 285 | } 286 | .btn-danger:active, 287 | .btn-danger.active { 288 | background-color: #c12e2a; 289 | border-color: #b92c28; 290 | } 291 | .btn-danger.disabled, 292 | .btn-danger[disabled], 293 | fieldset[disabled] .btn-danger, 294 | .btn-danger.disabled:hover, 295 | .btn-danger[disabled]:hover, 296 | fieldset[disabled] .btn-danger:hover, 297 | .btn-danger.disabled:focus, 298 | .btn-danger[disabled]:focus, 299 | fieldset[disabled] .btn-danger:focus, 300 | .btn-danger.disabled.focus, 301 | .btn-danger[disabled].focus, 302 | fieldset[disabled] .btn-danger.focus, 303 | .btn-danger.disabled:active, 304 | .btn-danger[disabled]:active, 305 | fieldset[disabled] .btn-danger:active, 306 | .btn-danger.disabled.active, 307 | .btn-danger[disabled].active, 308 | fieldset[disabled] .btn-danger.active { 309 | background-color: #c12e2a; 310 | background-image: none; 311 | } 312 | .thumbnail, 313 | .img-thumbnail { 314 | -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, .075); 315 | box-shadow: 0 1px 2px rgba(0, 0, 0, .075); 316 | } 317 | .dropdown-menu > li > a:hover, 318 | .dropdown-menu > li > a:focus { 319 | background-color: #e8e8e8; 320 | background-image: -webkit-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%); 321 | background-image: -o-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%); 322 | background-image: -webkit-gradient(linear, left top, left bottom, from(#f5f5f5), to(#e8e8e8)); 323 | background-image: linear-gradient(to bottom, #f5f5f5 0%, #e8e8e8 100%); 324 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0); 325 | background-repeat: repeat-x; 326 | } 327 | .dropdown-menu > .active > a, 328 | .dropdown-menu > .active > a:hover, 329 | .dropdown-menu > .active > a:focus { 330 | background-color: #2e6da4; 331 | background-image: -webkit-linear-gradient(top, #337ab7 0%, #2e6da4 100%); 332 | background-image: -o-linear-gradient(top, #337ab7 0%, #2e6da4 100%); 333 | background-image: -webkit-gradient(linear, left top, left bottom, from(#337ab7), to(#2e6da4)); 334 | background-image: linear-gradient(to bottom, #337ab7 0%, #2e6da4 100%); 335 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2e6da4', GradientType=0); 336 | background-repeat: repeat-x; 337 | } 338 | .navbar-default { 339 | background-image: -webkit-linear-gradient(top, #fff 0%, #f8f8f8 100%); 340 | background-image: -o-linear-gradient(top, #fff 0%, #f8f8f8 100%); 341 | background-image: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#f8f8f8)); 342 | background-image: linear-gradient(to bottom, #fff 0%, #f8f8f8 100%); 343 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#fff8f8f8', GradientType=0); 344 | filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); 345 | background-repeat: repeat-x; 346 | border-radius: 4px; 347 | -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), 0 1px 5px rgba(0, 0, 0, .075); 348 | box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), 0 1px 5px rgba(0, 0, 0, .075); 349 | } 350 | .navbar-default .navbar-nav > .open > a, 351 | .navbar-default .navbar-nav > .active > a { 352 | background-image: -webkit-linear-gradient(top, #dbdbdb 0%, #e2e2e2 100%); 353 | background-image: -o-linear-gradient(top, #dbdbdb 0%, #e2e2e2 100%); 354 | background-image: -webkit-gradient(linear, left top, left bottom, from(#dbdbdb), to(#e2e2e2)); 355 | background-image: linear-gradient(to bottom, #dbdbdb 0%, #e2e2e2 100%); 356 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdbdbdb', endColorstr='#ffe2e2e2', GradientType=0); 357 | background-repeat: repeat-x; 358 | -webkit-box-shadow: inset 0 3px 9px rgba(0, 0, 0, .075); 359 | box-shadow: inset 0 3px 9px rgba(0, 0, 0, .075); 360 | } 361 | .navbar-brand, 362 | .navbar-nav > li > a { 363 | text-shadow: 0 1px 0 rgba(255, 255, 255, .25); 364 | } 365 | .navbar-inverse { 366 | background-image: -webkit-linear-gradient(top, #3c3c3c 0%, #222 100%); 367 | background-image: -o-linear-gradient(top, #3c3c3c 0%, #222 100%); 368 | background-image: -webkit-gradient(linear, left top, left bottom, from(#3c3c3c), to(#222)); 369 | background-image: linear-gradient(to bottom, #3c3c3c 0%, #222 100%); 370 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff3c3c3c', endColorstr='#ff222222', GradientType=0); 371 | filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); 372 | background-repeat: repeat-x; 373 | border-radius: 4px; 374 | } 375 | .navbar-inverse .navbar-nav > .open > a, 376 | .navbar-inverse .navbar-nav > .active > a { 377 | background-image: -webkit-linear-gradient(top, #080808 0%, #0f0f0f 100%); 378 | background-image: -o-linear-gradient(top, #080808 0%, #0f0f0f 100%); 379 | background-image: -webkit-gradient(linear, left top, left bottom, from(#080808), to(#0f0f0f)); 380 | background-image: linear-gradient(to bottom, #080808 0%, #0f0f0f 100%); 381 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff080808', endColorstr='#ff0f0f0f', GradientType=0); 382 | background-repeat: repeat-x; 383 | -webkit-box-shadow: inset 0 3px 9px rgba(0, 0, 0, .25); 384 | box-shadow: inset 0 3px 9px rgba(0, 0, 0, .25); 385 | } 386 | .navbar-inverse .navbar-brand, 387 | .navbar-inverse .navbar-nav > li > a { 388 | text-shadow: 0 -1px 0 rgba(0, 0, 0, .25); 389 | } 390 | .navbar-static-top, 391 | .navbar-fixed-top, 392 | .navbar-fixed-bottom { 393 | border-radius: 0; 394 | } 395 | @media (max-width: 767px) { 396 | .navbar .navbar-nav .open .dropdown-menu > .active > a, 397 | .navbar .navbar-nav .open .dropdown-menu > .active > a:hover, 398 | .navbar .navbar-nav .open .dropdown-menu > .active > a:focus { 399 | color: #fff; 400 | background-image: -webkit-linear-gradient(top, #337ab7 0%, #2e6da4 100%); 401 | background-image: -o-linear-gradient(top, #337ab7 0%, #2e6da4 100%); 402 | background-image: -webkit-gradient(linear, left top, left bottom, from(#337ab7), to(#2e6da4)); 403 | background-image: linear-gradient(to bottom, #337ab7 0%, #2e6da4 100%); 404 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2e6da4', GradientType=0); 405 | background-repeat: repeat-x; 406 | } 407 | } 408 | .alert { 409 | text-shadow: 0 1px 0 rgba(255, 255, 255, .2); 410 | -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 1px 2px rgba(0, 0, 0, .05); 411 | box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 1px 2px rgba(0, 0, 0, .05); 412 | } 413 | .alert-success { 414 | background-image: -webkit-linear-gradient(top, #dff0d8 0%, #c8e5bc 100%); 415 | background-image: -o-linear-gradient(top, #dff0d8 0%, #c8e5bc 100%); 416 | background-image: -webkit-gradient(linear, left top, left bottom, from(#dff0d8), to(#c8e5bc)); 417 | background-image: linear-gradient(to bottom, #dff0d8 0%, #c8e5bc 100%); 418 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffc8e5bc', GradientType=0); 419 | background-repeat: repeat-x; 420 | border-color: #b2dba1; 421 | } 422 | .alert-info { 423 | background-image: -webkit-linear-gradient(top, #d9edf7 0%, #b9def0 100%); 424 | background-image: -o-linear-gradient(top, #d9edf7 0%, #b9def0 100%); 425 | background-image: -webkit-gradient(linear, left top, left bottom, from(#d9edf7), to(#b9def0)); 426 | background-image: linear-gradient(to bottom, #d9edf7 0%, #b9def0 100%); 427 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffb9def0', GradientType=0); 428 | background-repeat: repeat-x; 429 | border-color: #9acfea; 430 | } 431 | .alert-warning { 432 | background-image: -webkit-linear-gradient(top, #fcf8e3 0%, #f8efc0 100%); 433 | background-image: -o-linear-gradient(top, #fcf8e3 0%, #f8efc0 100%); 434 | background-image: -webkit-gradient(linear, left top, left bottom, from(#fcf8e3), to(#f8efc0)); 435 | background-image: linear-gradient(to bottom, #fcf8e3 0%, #f8efc0 100%); 436 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fff8efc0', GradientType=0); 437 | background-repeat: repeat-x; 438 | border-color: #f5e79e; 439 | } 440 | .alert-danger { 441 | background-image: -webkit-linear-gradient(top, #f2dede 0%, #e7c3c3 100%); 442 | background-image: -o-linear-gradient(top, #f2dede 0%, #e7c3c3 100%); 443 | background-image: -webkit-gradient(linear, left top, left bottom, from(#f2dede), to(#e7c3c3)); 444 | background-image: linear-gradient(to bottom, #f2dede 0%, #e7c3c3 100%); 445 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffe7c3c3', GradientType=0); 446 | background-repeat: repeat-x; 447 | border-color: #dca7a7; 448 | } 449 | .progress { 450 | background-image: -webkit-linear-gradient(top, #ebebeb 0%, #f5f5f5 100%); 451 | background-image: -o-linear-gradient(top, #ebebeb 0%, #f5f5f5 100%); 452 | background-image: -webkit-gradient(linear, left top, left bottom, from(#ebebeb), to(#f5f5f5)); 453 | background-image: linear-gradient(to bottom, #ebebeb 0%, #f5f5f5 100%); 454 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffebebeb', endColorstr='#fff5f5f5', GradientType=0); 455 | background-repeat: repeat-x; 456 | } 457 | .progress-bar { 458 | background-image: -webkit-linear-gradient(top, #337ab7 0%, #286090 100%); 459 | background-image: -o-linear-gradient(top, #337ab7 0%, #286090 100%); 460 | background-image: -webkit-gradient(linear, left top, left bottom, from(#337ab7), to(#286090)); 461 | background-image: linear-gradient(to bottom, #337ab7 0%, #286090 100%); 462 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff286090', GradientType=0); 463 | background-repeat: repeat-x; 464 | } 465 | .progress-bar-success { 466 | background-image: -webkit-linear-gradient(top, #5cb85c 0%, #449d44 100%); 467 | background-image: -o-linear-gradient(top, #5cb85c 0%, #449d44 100%); 468 | background-image: -webkit-gradient(linear, left top, left bottom, from(#5cb85c), to(#449d44)); 469 | background-image: linear-gradient(to bottom, #5cb85c 0%, #449d44 100%); 470 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff449d44', GradientType=0); 471 | background-repeat: repeat-x; 472 | } 473 | .progress-bar-info { 474 | background-image: -webkit-linear-gradient(top, #5bc0de 0%, #31b0d5 100%); 475 | background-image: -o-linear-gradient(top, #5bc0de 0%, #31b0d5 100%); 476 | background-image: -webkit-gradient(linear, left top, left bottom, from(#5bc0de), to(#31b0d5)); 477 | background-image: linear-gradient(to bottom, #5bc0de 0%, #31b0d5 100%); 478 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff31b0d5', GradientType=0); 479 | background-repeat: repeat-x; 480 | } 481 | .progress-bar-warning { 482 | background-image: -webkit-linear-gradient(top, #f0ad4e 0%, #ec971f 100%); 483 | background-image: -o-linear-gradient(top, #f0ad4e 0%, #ec971f 100%); 484 | background-image: -webkit-gradient(linear, left top, left bottom, from(#f0ad4e), to(#ec971f)); 485 | background-image: linear-gradient(to bottom, #f0ad4e 0%, #ec971f 100%); 486 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffec971f', GradientType=0); 487 | background-repeat: repeat-x; 488 | } 489 | .progress-bar-danger { 490 | background-image: -webkit-linear-gradient(top, #d9534f 0%, #c9302c 100%); 491 | background-image: -o-linear-gradient(top, #d9534f 0%, #c9302c 100%); 492 | background-image: -webkit-gradient(linear, left top, left bottom, from(#d9534f), to(#c9302c)); 493 | background-image: linear-gradient(to bottom, #d9534f 0%, #c9302c 100%); 494 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc9302c', GradientType=0); 495 | background-repeat: repeat-x; 496 | } 497 | .progress-bar-striped { 498 | background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); 499 | background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); 500 | background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); 501 | } 502 | .list-group { 503 | border-radius: 4px; 504 | -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, .075); 505 | box-shadow: 0 1px 2px rgba(0, 0, 0, .075); 506 | } 507 | .list-group-item.active, 508 | .list-group-item.active:hover, 509 | .list-group-item.active:focus { 510 | text-shadow: 0 -1px 0 #286090; 511 | background-image: -webkit-linear-gradient(top, #337ab7 0%, #2b669a 100%); 512 | background-image: -o-linear-gradient(top, #337ab7 0%, #2b669a 100%); 513 | background-image: -webkit-gradient(linear, left top, left bottom, from(#337ab7), to(#2b669a)); 514 | background-image: linear-gradient(to bottom, #337ab7 0%, #2b669a 100%); 515 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2b669a', GradientType=0); 516 | background-repeat: repeat-x; 517 | border-color: #2b669a; 518 | } 519 | .list-group-item.active .badge, 520 | .list-group-item.active:hover .badge, 521 | .list-group-item.active:focus .badge { 522 | text-shadow: none; 523 | } 524 | .panel { 525 | -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, .05); 526 | box-shadow: 0 1px 2px rgba(0, 0, 0, .05); 527 | } 528 | .panel-default > .panel-heading { 529 | background-image: -webkit-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%); 530 | background-image: -o-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%); 531 | background-image: -webkit-gradient(linear, left top, left bottom, from(#f5f5f5), to(#e8e8e8)); 532 | background-image: linear-gradient(to bottom, #f5f5f5 0%, #e8e8e8 100%); 533 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0); 534 | background-repeat: repeat-x; 535 | } 536 | .panel-primary > .panel-heading { 537 | background-image: -webkit-linear-gradient(top, #337ab7 0%, #2e6da4 100%); 538 | background-image: -o-linear-gradient(top, #337ab7 0%, #2e6da4 100%); 539 | background-image: -webkit-gradient(linear, left top, left bottom, from(#337ab7), to(#2e6da4)); 540 | background-image: linear-gradient(to bottom, #337ab7 0%, #2e6da4 100%); 541 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2e6da4', GradientType=0); 542 | background-repeat: repeat-x; 543 | } 544 | .panel-success > .panel-heading { 545 | background-image: -webkit-linear-gradient(top, #dff0d8 0%, #d0e9c6 100%); 546 | background-image: -o-linear-gradient(top, #dff0d8 0%, #d0e9c6 100%); 547 | background-image: -webkit-gradient(linear, left top, left bottom, from(#dff0d8), to(#d0e9c6)); 548 | background-image: linear-gradient(to bottom, #dff0d8 0%, #d0e9c6 100%); 549 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffd0e9c6', GradientType=0); 550 | background-repeat: repeat-x; 551 | } 552 | .panel-info > .panel-heading { 553 | background-image: -webkit-linear-gradient(top, #d9edf7 0%, #c4e3f3 100%); 554 | background-image: -o-linear-gradient(top, #d9edf7 0%, #c4e3f3 100%); 555 | background-image: -webkit-gradient(linear, left top, left bottom, from(#d9edf7), to(#c4e3f3)); 556 | background-image: linear-gradient(to bottom, #d9edf7 0%, #c4e3f3 100%); 557 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffc4e3f3', GradientType=0); 558 | background-repeat: repeat-x; 559 | } 560 | .panel-warning > .panel-heading { 561 | background-image: -webkit-linear-gradient(top, #fcf8e3 0%, #faf2cc 100%); 562 | background-image: -o-linear-gradient(top, #fcf8e3 0%, #faf2cc 100%); 563 | background-image: -webkit-gradient(linear, left top, left bottom, from(#fcf8e3), to(#faf2cc)); 564 | background-image: linear-gradient(to bottom, #fcf8e3 0%, #faf2cc 100%); 565 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fffaf2cc', GradientType=0); 566 | background-repeat: repeat-x; 567 | } 568 | .panel-danger > .panel-heading { 569 | background-image: -webkit-linear-gradient(top, #f2dede 0%, #ebcccc 100%); 570 | background-image: -o-linear-gradient(top, #f2dede 0%, #ebcccc 100%); 571 | background-image: -webkit-gradient(linear, left top, left bottom, from(#f2dede), to(#ebcccc)); 572 | background-image: linear-gradient(to bottom, #f2dede 0%, #ebcccc 100%); 573 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffebcccc', GradientType=0); 574 | background-repeat: repeat-x; 575 | } 576 | .well { 577 | background-image: -webkit-linear-gradient(top, #e8e8e8 0%, #f5f5f5 100%); 578 | background-image: -o-linear-gradient(top, #e8e8e8 0%, #f5f5f5 100%); 579 | background-image: -webkit-gradient(linear, left top, left bottom, from(#e8e8e8), to(#f5f5f5)); 580 | background-image: linear-gradient(to bottom, #e8e8e8 0%, #f5f5f5 100%); 581 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe8e8e8', endColorstr='#fff5f5f5', GradientType=0); 582 | background-repeat: repeat-x; 583 | border-color: #dcdcdc; 584 | -webkit-box-shadow: inset 0 1px 3px rgba(0, 0, 0, .05), 0 1px 0 rgba(255, 255, 255, .1); 585 | box-shadow: inset 0 1px 3px rgba(0, 0, 0, .05), 0 1px 0 rgba(255, 255, 255, .1); 586 | } 587 | /*# sourceMappingURL=bootstrap-theme.css.map */ 588 | -------------------------------------------------------------------------------- /static/robot/bootstrap/css/bootstrap-theme.min.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap v3.3.7 (http://getbootstrap.com) 3 | * Copyright 2011-2016 Twitter, Inc. 4 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 5 | */.btn-danger,.btn-default,.btn-info,.btn-primary,.btn-success,.btn-warning{text-shadow:0 -1px 0 rgba(0,0,0,.2);-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.15),0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 0 rgba(255,255,255,.15),0 1px 1px rgba(0,0,0,.075)}.btn-danger.active,.btn-danger:active,.btn-default.active,.btn-default:active,.btn-info.active,.btn-info:active,.btn-primary.active,.btn-primary:active,.btn-success.active,.btn-success:active,.btn-warning.active,.btn-warning:active{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn-danger.disabled,.btn-danger[disabled],.btn-default.disabled,.btn-default[disabled],.btn-info.disabled,.btn-info[disabled],.btn-primary.disabled,.btn-primary[disabled],.btn-success.disabled,.btn-success[disabled],.btn-warning.disabled,.btn-warning[disabled],fieldset[disabled] .btn-danger,fieldset[disabled] .btn-default,fieldset[disabled] .btn-info,fieldset[disabled] .btn-primary,fieldset[disabled] .btn-success,fieldset[disabled] .btn-warning{-webkit-box-shadow:none;box-shadow:none}.btn-danger .badge,.btn-default .badge,.btn-info .badge,.btn-primary .badge,.btn-success .badge,.btn-warning .badge{text-shadow:none}.btn.active,.btn:active{background-image:none}.btn-default{text-shadow:0 1px 0 #fff;background-image:-webkit-linear-gradient(top,#fff 0,#e0e0e0 100%);background-image:-o-linear-gradient(top,#fff 0,#e0e0e0 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#fff),to(#e0e0e0));background-image:linear-gradient(to bottom,#fff 0,#e0e0e0 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe0e0e0', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-color:#dbdbdb;border-color:#ccc}.btn-default:focus,.btn-default:hover{background-color:#e0e0e0;background-position:0 -15px}.btn-default.active,.btn-default:active{background-color:#e0e0e0;border-color:#dbdbdb}.btn-default.disabled,.btn-default.disabled.active,.btn-default.disabled.focus,.btn-default.disabled:active,.btn-default.disabled:focus,.btn-default.disabled:hover,.btn-default[disabled],.btn-default[disabled].active,.btn-default[disabled].focus,.btn-default[disabled]:active,.btn-default[disabled]:focus,.btn-default[disabled]:hover,fieldset[disabled] .btn-default,fieldset[disabled] .btn-default.active,fieldset[disabled] .btn-default.focus,fieldset[disabled] .btn-default:active,fieldset[disabled] .btn-default:focus,fieldset[disabled] .btn-default:hover{background-color:#e0e0e0;background-image:none}.btn-primary{background-image:-webkit-linear-gradient(top,#337ab7 0,#265a88 100%);background-image:-o-linear-gradient(top,#337ab7 0,#265a88 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#337ab7),to(#265a88));background-image:linear-gradient(to bottom,#337ab7 0,#265a88 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff265a88', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-color:#245580}.btn-primary:focus,.btn-primary:hover{background-color:#265a88;background-position:0 -15px}.btn-primary.active,.btn-primary:active{background-color:#265a88;border-color:#245580}.btn-primary.disabled,.btn-primary.disabled.active,.btn-primary.disabled.focus,.btn-primary.disabled:active,.btn-primary.disabled:focus,.btn-primary.disabled:hover,.btn-primary[disabled],.btn-primary[disabled].active,.btn-primary[disabled].focus,.btn-primary[disabled]:active,.btn-primary[disabled]:focus,.btn-primary[disabled]:hover,fieldset[disabled] .btn-primary,fieldset[disabled] .btn-primary.active,fieldset[disabled] .btn-primary.focus,fieldset[disabled] .btn-primary:active,fieldset[disabled] .btn-primary:focus,fieldset[disabled] .btn-primary:hover{background-color:#265a88;background-image:none}.btn-success{background-image:-webkit-linear-gradient(top,#5cb85c 0,#419641 100%);background-image:-o-linear-gradient(top,#5cb85c 0,#419641 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#5cb85c),to(#419641));background-image:linear-gradient(to bottom,#5cb85c 0,#419641 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff419641', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-color:#3e8f3e}.btn-success:focus,.btn-success:hover{background-color:#419641;background-position:0 -15px}.btn-success.active,.btn-success:active{background-color:#419641;border-color:#3e8f3e}.btn-success.disabled,.btn-success.disabled.active,.btn-success.disabled.focus,.btn-success.disabled:active,.btn-success.disabled:focus,.btn-success.disabled:hover,.btn-success[disabled],.btn-success[disabled].active,.btn-success[disabled].focus,.btn-success[disabled]:active,.btn-success[disabled]:focus,.btn-success[disabled]:hover,fieldset[disabled] .btn-success,fieldset[disabled] .btn-success.active,fieldset[disabled] .btn-success.focus,fieldset[disabled] .btn-success:active,fieldset[disabled] .btn-success:focus,fieldset[disabled] .btn-success:hover{background-color:#419641;background-image:none}.btn-info{background-image:-webkit-linear-gradient(top,#5bc0de 0,#2aabd2 100%);background-image:-o-linear-gradient(top,#5bc0de 0,#2aabd2 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#5bc0de),to(#2aabd2));background-image:linear-gradient(to bottom,#5bc0de 0,#2aabd2 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff2aabd2', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-color:#28a4c9}.btn-info:focus,.btn-info:hover{background-color:#2aabd2;background-position:0 -15px}.btn-info.active,.btn-info:active{background-color:#2aabd2;border-color:#28a4c9}.btn-info.disabled,.btn-info.disabled.active,.btn-info.disabled.focus,.btn-info.disabled:active,.btn-info.disabled:focus,.btn-info.disabled:hover,.btn-info[disabled],.btn-info[disabled].active,.btn-info[disabled].focus,.btn-info[disabled]:active,.btn-info[disabled]:focus,.btn-info[disabled]:hover,fieldset[disabled] .btn-info,fieldset[disabled] .btn-info.active,fieldset[disabled] .btn-info.focus,fieldset[disabled] .btn-info:active,fieldset[disabled] .btn-info:focus,fieldset[disabled] .btn-info:hover{background-color:#2aabd2;background-image:none}.btn-warning{background-image:-webkit-linear-gradient(top,#f0ad4e 0,#eb9316 100%);background-image:-o-linear-gradient(top,#f0ad4e 0,#eb9316 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#f0ad4e),to(#eb9316));background-image:linear-gradient(to bottom,#f0ad4e 0,#eb9316 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffeb9316', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-color:#e38d13}.btn-warning:focus,.btn-warning:hover{background-color:#eb9316;background-position:0 -15px}.btn-warning.active,.btn-warning:active{background-color:#eb9316;border-color:#e38d13}.btn-warning.disabled,.btn-warning.disabled.active,.btn-warning.disabled.focus,.btn-warning.disabled:active,.btn-warning.disabled:focus,.btn-warning.disabled:hover,.btn-warning[disabled],.btn-warning[disabled].active,.btn-warning[disabled].focus,.btn-warning[disabled]:active,.btn-warning[disabled]:focus,.btn-warning[disabled]:hover,fieldset[disabled] .btn-warning,fieldset[disabled] .btn-warning.active,fieldset[disabled] .btn-warning.focus,fieldset[disabled] .btn-warning:active,fieldset[disabled] .btn-warning:focus,fieldset[disabled] .btn-warning:hover{background-color:#eb9316;background-image:none}.btn-danger{background-image:-webkit-linear-gradient(top,#d9534f 0,#c12e2a 100%);background-image:-o-linear-gradient(top,#d9534f 0,#c12e2a 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#d9534f),to(#c12e2a));background-image:linear-gradient(to bottom,#d9534f 0,#c12e2a 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc12e2a', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-color:#b92c28}.btn-danger:focus,.btn-danger:hover{background-color:#c12e2a;background-position:0 -15px}.btn-danger.active,.btn-danger:active{background-color:#c12e2a;border-color:#b92c28}.btn-danger.disabled,.btn-danger.disabled.active,.btn-danger.disabled.focus,.btn-danger.disabled:active,.btn-danger.disabled:focus,.btn-danger.disabled:hover,.btn-danger[disabled],.btn-danger[disabled].active,.btn-danger[disabled].focus,.btn-danger[disabled]:active,.btn-danger[disabled]:focus,.btn-danger[disabled]:hover,fieldset[disabled] .btn-danger,fieldset[disabled] .btn-danger.active,fieldset[disabled] .btn-danger.focus,fieldset[disabled] .btn-danger:active,fieldset[disabled] .btn-danger:focus,fieldset[disabled] .btn-danger:hover{background-color:#c12e2a;background-image:none}.img-thumbnail,.thumbnail{-webkit-box-shadow:0 1px 2px rgba(0,0,0,.075);box-shadow:0 1px 2px rgba(0,0,0,.075)}.dropdown-menu>li>a:focus,.dropdown-menu>li>a:hover{background-color:#e8e8e8;background-image:-webkit-linear-gradient(top,#f5f5f5 0,#e8e8e8 100%);background-image:-o-linear-gradient(top,#f5f5f5 0,#e8e8e8 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#f5f5f5),to(#e8e8e8));background-image:linear-gradient(to bottom,#f5f5f5 0,#e8e8e8 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0);background-repeat:repeat-x}.dropdown-menu>.active>a,.dropdown-menu>.active>a:focus,.dropdown-menu>.active>a:hover{background-color:#2e6da4;background-image:-webkit-linear-gradient(top,#337ab7 0,#2e6da4 100%);background-image:-o-linear-gradient(top,#337ab7 0,#2e6da4 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#337ab7),to(#2e6da4));background-image:linear-gradient(to bottom,#337ab7 0,#2e6da4 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2e6da4', GradientType=0);background-repeat:repeat-x}.navbar-default{background-image:-webkit-linear-gradient(top,#fff 0,#f8f8f8 100%);background-image:-o-linear-gradient(top,#fff 0,#f8f8f8 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#fff),to(#f8f8f8));background-image:linear-gradient(to bottom,#fff 0,#f8f8f8 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#fff8f8f8', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-radius:4px;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.15),0 1px 5px rgba(0,0,0,.075);box-shadow:inset 0 1px 0 rgba(255,255,255,.15),0 1px 5px rgba(0,0,0,.075)}.navbar-default .navbar-nav>.active>a,.navbar-default .navbar-nav>.open>a{background-image:-webkit-linear-gradient(top,#dbdbdb 0,#e2e2e2 100%);background-image:-o-linear-gradient(top,#dbdbdb 0,#e2e2e2 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#dbdbdb),to(#e2e2e2));background-image:linear-gradient(to bottom,#dbdbdb 0,#e2e2e2 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdbdbdb', endColorstr='#ffe2e2e2', GradientType=0);background-repeat:repeat-x;-webkit-box-shadow:inset 0 3px 9px rgba(0,0,0,.075);box-shadow:inset 0 3px 9px rgba(0,0,0,.075)}.navbar-brand,.navbar-nav>li>a{text-shadow:0 1px 0 rgba(255,255,255,.25)}.navbar-inverse{background-image:-webkit-linear-gradient(top,#3c3c3c 0,#222 100%);background-image:-o-linear-gradient(top,#3c3c3c 0,#222 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#3c3c3c),to(#222));background-image:linear-gradient(to bottom,#3c3c3c 0,#222 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff3c3c3c', endColorstr='#ff222222', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-radius:4px}.navbar-inverse .navbar-nav>.active>a,.navbar-inverse .navbar-nav>.open>a{background-image:-webkit-linear-gradient(top,#080808 0,#0f0f0f 100%);background-image:-o-linear-gradient(top,#080808 0,#0f0f0f 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#080808),to(#0f0f0f));background-image:linear-gradient(to bottom,#080808 0,#0f0f0f 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff080808', endColorstr='#ff0f0f0f', GradientType=0);background-repeat:repeat-x;-webkit-box-shadow:inset 0 3px 9px rgba(0,0,0,.25);box-shadow:inset 0 3px 9px rgba(0,0,0,.25)}.navbar-inverse .navbar-brand,.navbar-inverse .navbar-nav>li>a{text-shadow:0 -1px 0 rgba(0,0,0,.25)}.navbar-fixed-bottom,.navbar-fixed-top,.navbar-static-top{border-radius:0}@media (max-width:767px){.navbar .navbar-nav .open .dropdown-menu>.active>a,.navbar .navbar-nav .open .dropdown-menu>.active>a:focus,.navbar .navbar-nav .open .dropdown-menu>.active>a:hover{color:#fff;background-image:-webkit-linear-gradient(top,#337ab7 0,#2e6da4 100%);background-image:-o-linear-gradient(top,#337ab7 0,#2e6da4 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#337ab7),to(#2e6da4));background-image:linear-gradient(to bottom,#337ab7 0,#2e6da4 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2e6da4', GradientType=0);background-repeat:repeat-x}}.alert{text-shadow:0 1px 0 rgba(255,255,255,.2);-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 2px rgba(0,0,0,.05)}.alert-success{background-image:-webkit-linear-gradient(top,#dff0d8 0,#c8e5bc 100%);background-image:-o-linear-gradient(top,#dff0d8 0,#c8e5bc 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#dff0d8),to(#c8e5bc));background-image:linear-gradient(to bottom,#dff0d8 0,#c8e5bc 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffc8e5bc', GradientType=0);background-repeat:repeat-x;border-color:#b2dba1}.alert-info{background-image:-webkit-linear-gradient(top,#d9edf7 0,#b9def0 100%);background-image:-o-linear-gradient(top,#d9edf7 0,#b9def0 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#d9edf7),to(#b9def0));background-image:linear-gradient(to bottom,#d9edf7 0,#b9def0 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffb9def0', GradientType=0);background-repeat:repeat-x;border-color:#9acfea}.alert-warning{background-image:-webkit-linear-gradient(top,#fcf8e3 0,#f8efc0 100%);background-image:-o-linear-gradient(top,#fcf8e3 0,#f8efc0 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#fcf8e3),to(#f8efc0));background-image:linear-gradient(to bottom,#fcf8e3 0,#f8efc0 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fff8efc0', GradientType=0);background-repeat:repeat-x;border-color:#f5e79e}.alert-danger{background-image:-webkit-linear-gradient(top,#f2dede 0,#e7c3c3 100%);background-image:-o-linear-gradient(top,#f2dede 0,#e7c3c3 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#f2dede),to(#e7c3c3));background-image:linear-gradient(to bottom,#f2dede 0,#e7c3c3 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffe7c3c3', GradientType=0);background-repeat:repeat-x;border-color:#dca7a7}.progress{background-image:-webkit-linear-gradient(top,#ebebeb 0,#f5f5f5 100%);background-image:-o-linear-gradient(top,#ebebeb 0,#f5f5f5 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#ebebeb),to(#f5f5f5));background-image:linear-gradient(to bottom,#ebebeb 0,#f5f5f5 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffebebeb', endColorstr='#fff5f5f5', GradientType=0);background-repeat:repeat-x}.progress-bar{background-image:-webkit-linear-gradient(top,#337ab7 0,#286090 100%);background-image:-o-linear-gradient(top,#337ab7 0,#286090 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#337ab7),to(#286090));background-image:linear-gradient(to bottom,#337ab7 0,#286090 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff286090', GradientType=0);background-repeat:repeat-x}.progress-bar-success{background-image:-webkit-linear-gradient(top,#5cb85c 0,#449d44 100%);background-image:-o-linear-gradient(top,#5cb85c 0,#449d44 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#5cb85c),to(#449d44));background-image:linear-gradient(to bottom,#5cb85c 0,#449d44 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff449d44', GradientType=0);background-repeat:repeat-x}.progress-bar-info{background-image:-webkit-linear-gradient(top,#5bc0de 0,#31b0d5 100%);background-image:-o-linear-gradient(top,#5bc0de 0,#31b0d5 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#5bc0de),to(#31b0d5));background-image:linear-gradient(to bottom,#5bc0de 0,#31b0d5 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff31b0d5', GradientType=0);background-repeat:repeat-x}.progress-bar-warning{background-image:-webkit-linear-gradient(top,#f0ad4e 0,#ec971f 100%);background-image:-o-linear-gradient(top,#f0ad4e 0,#ec971f 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#f0ad4e),to(#ec971f));background-image:linear-gradient(to bottom,#f0ad4e 0,#ec971f 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffec971f', GradientType=0);background-repeat:repeat-x}.progress-bar-danger{background-image:-webkit-linear-gradient(top,#d9534f 0,#c9302c 100%);background-image:-o-linear-gradient(top,#d9534f 0,#c9302c 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#d9534f),to(#c9302c));background-image:linear-gradient(to bottom,#d9534f 0,#c9302c 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc9302c', GradientType=0);background-repeat:repeat-x}.progress-bar-striped{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.list-group{border-radius:4px;-webkit-box-shadow:0 1px 2px rgba(0,0,0,.075);box-shadow:0 1px 2px rgba(0,0,0,.075)}.list-group-item.active,.list-group-item.active:focus,.list-group-item.active:hover{text-shadow:0 -1px 0 #286090;background-image:-webkit-linear-gradient(top,#337ab7 0,#2b669a 100%);background-image:-o-linear-gradient(top,#337ab7 0,#2b669a 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#337ab7),to(#2b669a));background-image:linear-gradient(to bottom,#337ab7 0,#2b669a 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2b669a', GradientType=0);background-repeat:repeat-x;border-color:#2b669a}.list-group-item.active .badge,.list-group-item.active:focus .badge,.list-group-item.active:hover .badge{text-shadow:none}.panel{-webkit-box-shadow:0 1px 2px rgba(0,0,0,.05);box-shadow:0 1px 2px rgba(0,0,0,.05)}.panel-default>.panel-heading{background-image:-webkit-linear-gradient(top,#f5f5f5 0,#e8e8e8 100%);background-image:-o-linear-gradient(top,#f5f5f5 0,#e8e8e8 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#f5f5f5),to(#e8e8e8));background-image:linear-gradient(to bottom,#f5f5f5 0,#e8e8e8 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0);background-repeat:repeat-x}.panel-primary>.panel-heading{background-image:-webkit-linear-gradient(top,#337ab7 0,#2e6da4 100%);background-image:-o-linear-gradient(top,#337ab7 0,#2e6da4 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#337ab7),to(#2e6da4));background-image:linear-gradient(to bottom,#337ab7 0,#2e6da4 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2e6da4', GradientType=0);background-repeat:repeat-x}.panel-success>.panel-heading{background-image:-webkit-linear-gradient(top,#dff0d8 0,#d0e9c6 100%);background-image:-o-linear-gradient(top,#dff0d8 0,#d0e9c6 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#dff0d8),to(#d0e9c6));background-image:linear-gradient(to bottom,#dff0d8 0,#d0e9c6 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffd0e9c6', GradientType=0);background-repeat:repeat-x}.panel-info>.panel-heading{background-image:-webkit-linear-gradient(top,#d9edf7 0,#c4e3f3 100%);background-image:-o-linear-gradient(top,#d9edf7 0,#c4e3f3 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#d9edf7),to(#c4e3f3));background-image:linear-gradient(to bottom,#d9edf7 0,#c4e3f3 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffc4e3f3', GradientType=0);background-repeat:repeat-x}.panel-warning>.panel-heading{background-image:-webkit-linear-gradient(top,#fcf8e3 0,#faf2cc 100%);background-image:-o-linear-gradient(top,#fcf8e3 0,#faf2cc 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#fcf8e3),to(#faf2cc));background-image:linear-gradient(to bottom,#fcf8e3 0,#faf2cc 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fffaf2cc', GradientType=0);background-repeat:repeat-x}.panel-danger>.panel-heading{background-image:-webkit-linear-gradient(top,#f2dede 0,#ebcccc 100%);background-image:-o-linear-gradient(top,#f2dede 0,#ebcccc 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#f2dede),to(#ebcccc));background-image:linear-gradient(to bottom,#f2dede 0,#ebcccc 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffebcccc', GradientType=0);background-repeat:repeat-x}.well{background-image:-webkit-linear-gradient(top,#e8e8e8 0,#f5f5f5 100%);background-image:-o-linear-gradient(top,#e8e8e8 0,#f5f5f5 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#e8e8e8),to(#f5f5f5));background-image:linear-gradient(to bottom,#e8e8e8 0,#f5f5f5 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe8e8e8', endColorstr='#fff5f5f5', GradientType=0);background-repeat:repeat-x;border-color:#dcdcdc;-webkit-box-shadow:inset 0 1px 3px rgba(0,0,0,.05),0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 3px rgba(0,0,0,.05),0 1px 0 rgba(255,255,255,.1)} 6 | /*# sourceMappingURL=bootstrap-theme.min.css.map */ -------------------------------------------------------------------------------- /static/robot/bootstrap/css/bootstrap-theme.min.css.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["less/theme.less","less/mixins/vendor-prefixes.less","less/mixins/gradients.less","less/mixins/reset-filter.less"],"names":[],"mappings":";;;;AAmBA,YAAA,aAAA,UAAA,aAAA,aAAA,aAME,YAAA,EAAA,KAAA,EAAA,eC2CA,mBAAA,MAAA,EAAA,IAAA,EAAA,sBAAA,EAAA,IAAA,IAAA,iBACQ,WAAA,MAAA,EAAA,IAAA,EAAA,sBAAA,EAAA,IAAA,IAAA,iBDvCR,mBAAA,mBAAA,oBAAA,oBAAA,iBAAA,iBAAA,oBAAA,oBAAA,oBAAA,oBAAA,oBAAA,oBCsCA,mBAAA,MAAA,EAAA,IAAA,IAAA,iBACQ,WAAA,MAAA,EAAA,IAAA,IAAA,iBDlCR,qBAAA,sBAAA,sBAAA,uBAAA,mBAAA,oBAAA,sBAAA,uBAAA,sBAAA,uBAAA,sBAAA,uBAAA,+BAAA,gCAAA,6BAAA,gCAAA,gCAAA,gCCiCA,mBAAA,KACQ,WAAA,KDlDV,mBAAA,oBAAA,iBAAA,oBAAA,oBAAA,oBAuBI,YAAA,KAyCF,YAAA,YAEE,iBAAA,KAKJ,aErEI,YAAA,EAAA,IAAA,EAAA,KACA,iBAAA,iDACA,iBAAA,4CAAA,iBAAA,qEAEA,iBAAA,+CCnBF,OAAA,+GH4CA,OAAA,0DACA,kBAAA,SAuC2C,aAAA,QAA2B,aAAA,KArCtE,mBAAA,mBAEE,iBAAA,QACA,oBAAA,EAAA,MAGF,oBAAA,oBAEE,iBAAA,QACA,aAAA,QAMA,sBAAA,6BAAA,4BAAA,6BAAA,4BAAA,4BAAA,uBAAA,8BAAA,6BAAA,8BAAA,6BAAA,6BAAA,gCAAA,uCAAA,sCAAA,uCAAA,sCAAA,sCAME,iBAAA,QACA,iBAAA,KAgBN,aEtEI,iBAAA,oDACA,iBAAA,+CACA,iBAAA,wEAAA,iBAAA,kDAEA,OAAA,+GCnBF,OAAA,0DH4CA,kBAAA,SACA,aAAA,QAEA,mBAAA,mBAEE,iBAAA,QACA,oBAAA,EAAA,MAGF,oBAAA,oBAEE,iBAAA,QACA,aAAA,QAMA,sBAAA,6BAAA,4BAAA,6BAAA,4BAAA,4BAAA,uBAAA,8BAAA,6BAAA,8BAAA,6BAAA,6BAAA,gCAAA,uCAAA,sCAAA,uCAAA,sCAAA,sCAME,iBAAA,QACA,iBAAA,KAiBN,aEvEI,iBAAA,oDACA,iBAAA,+CACA,iBAAA,wEAAA,iBAAA,kDAEA,OAAA,+GCnBF,OAAA,0DH4CA,kBAAA,SACA,aAAA,QAEA,mBAAA,mBAEE,iBAAA,QACA,oBAAA,EAAA,MAGF,oBAAA,oBAEE,iBAAA,QACA,aAAA,QAMA,sBAAA,6BAAA,4BAAA,6BAAA,4BAAA,4BAAA,uBAAA,8BAAA,6BAAA,8BAAA,6BAAA,6BAAA,gCAAA,uCAAA,sCAAA,uCAAA,sCAAA,sCAME,iBAAA,QACA,iBAAA,KAkBN,UExEI,iBAAA,oDACA,iBAAA,+CACA,iBAAA,wEAAA,iBAAA,kDAEA,OAAA,+GCnBF,OAAA,0DH4CA,kBAAA,SACA,aAAA,QAEA,gBAAA,gBAEE,iBAAA,QACA,oBAAA,EAAA,MAGF,iBAAA,iBAEE,iBAAA,QACA,aAAA,QAMA,mBAAA,0BAAA,yBAAA,0BAAA,yBAAA,yBAAA,oBAAA,2BAAA,0BAAA,2BAAA,0BAAA,0BAAA,6BAAA,oCAAA,mCAAA,oCAAA,mCAAA,mCAME,iBAAA,QACA,iBAAA,KAmBN,aEzEI,iBAAA,oDACA,iBAAA,+CACA,iBAAA,wEAAA,iBAAA,kDAEA,OAAA,+GCnBF,OAAA,0DH4CA,kBAAA,SACA,aAAA,QAEA,mBAAA,mBAEE,iBAAA,QACA,oBAAA,EAAA,MAGF,oBAAA,oBAEE,iBAAA,QACA,aAAA,QAMA,sBAAA,6BAAA,4BAAA,6BAAA,4BAAA,4BAAA,uBAAA,8BAAA,6BAAA,8BAAA,6BAAA,6BAAA,gCAAA,uCAAA,sCAAA,uCAAA,sCAAA,sCAME,iBAAA,QACA,iBAAA,KAoBN,YE1EI,iBAAA,oDACA,iBAAA,+CACA,iBAAA,wEAAA,iBAAA,kDAEA,OAAA,+GCnBF,OAAA,0DH4CA,kBAAA,SACA,aAAA,QAEA,kBAAA,kBAEE,iBAAA,QACA,oBAAA,EAAA,MAGF,mBAAA,mBAEE,iBAAA,QACA,aAAA,QAMA,qBAAA,4BAAA,2BAAA,4BAAA,2BAAA,2BAAA,sBAAA,6BAAA,4BAAA,6BAAA,4BAAA,4BAAA,+BAAA,sCAAA,qCAAA,sCAAA,qCAAA,qCAME,iBAAA,QACA,iBAAA,KA2BN,eAAA,WClCE,mBAAA,EAAA,IAAA,IAAA,iBACQ,WAAA,EAAA,IAAA,IAAA,iBD2CV,0BAAA,0BE3FI,iBAAA,QACA,iBAAA,oDACA,iBAAA,+CAAA,iBAAA,wEACA,iBAAA,kDACA,OAAA,+GF0FF,kBAAA,SAEF,yBAAA,+BAAA,+BEhGI,iBAAA,QACA,iBAAA,oDACA,iBAAA,+CAAA,iBAAA,wEACA,iBAAA,kDACA,OAAA,+GFgGF,kBAAA,SASF,gBE7GI,iBAAA,iDACA,iBAAA,4CACA,iBAAA,qEAAA,iBAAA,+CACA,OAAA,+GACA,OAAA,0DCnBF,kBAAA,SH+HA,cAAA,ICjEA,mBAAA,MAAA,EAAA,IAAA,EAAA,sBAAA,EAAA,IAAA,IAAA,iBACQ,WAAA,MAAA,EAAA,IAAA,EAAA,sBAAA,EAAA,IAAA,IAAA,iBD6DV,sCAAA,oCE7GI,iBAAA,oDACA,iBAAA,+CACA,iBAAA,wEAAA,iBAAA,kDACA,OAAA,+GACA,kBAAA,SD2CF,mBAAA,MAAA,EAAA,IAAA,IAAA,iBACQ,WAAA,MAAA,EAAA,IAAA,IAAA,iBD0EV,cAAA,iBAEE,YAAA,EAAA,IAAA,EAAA,sBAIF,gBEhII,iBAAA,iDACA,iBAAA,4CACA,iBAAA,qEAAA,iBAAA,+CACA,OAAA,+GACA,OAAA,0DCnBF,kBAAA,SHkJA,cAAA,IAHF,sCAAA,oCEhII,iBAAA,oDACA,iBAAA,+CACA,iBAAA,wEAAA,iBAAA,kDACA,OAAA,+GACA,kBAAA,SD2CF,mBAAA,MAAA,EAAA,IAAA,IAAA,gBACQ,WAAA,MAAA,EAAA,IAAA,IAAA,gBDgFV,8BAAA,iCAYI,YAAA,EAAA,KAAA,EAAA,gBAKJ,qBAAA,kBAAA,mBAGE,cAAA,EAqBF,yBAfI,mDAAA,yDAAA,yDAGE,MAAA,KE7JF,iBAAA,oDACA,iBAAA,+CACA,iBAAA,wEAAA,iBAAA,kDACA,OAAA,+GACA,kBAAA,UFqKJ,OACE,YAAA,EAAA,IAAA,EAAA,qBC3HA,mBAAA,MAAA,EAAA,IAAA,EAAA,sBAAA,EAAA,IAAA,IAAA,gBACQ,WAAA,MAAA,EAAA,IAAA,EAAA,sBAAA,EAAA,IAAA,IAAA,gBDsIV,eEtLI,iBAAA,oDACA,iBAAA,+CACA,iBAAA,wEAAA,iBAAA,kDACA,OAAA,+GACA,kBAAA,SF8KF,aAAA,QAKF,YEvLI,iBAAA,oDACA,iBAAA,+CACA,iBAAA,wEAAA,iBAAA,kDACA,OAAA,+GACA,kBAAA,SF8KF,aAAA,QAMF,eExLI,iBAAA,oDACA,iBAAA,+CACA,iBAAA,wEAAA,iBAAA,kDACA,OAAA,+GACA,kBAAA,SF8KF,aAAA,QAOF,cEzLI,iBAAA,oDACA,iBAAA,+CACA,iBAAA,wEAAA,iBAAA,kDACA,OAAA,+GACA,kBAAA,SF8KF,aAAA,QAeF,UEjMI,iBAAA,oDACA,iBAAA,+CACA,iBAAA,wEAAA,iBAAA,kDACA,OAAA,+GACA,kBAAA,SFuMJ,cE3MI,iBAAA,oDACA,iBAAA,+CACA,iBAAA,wEAAA,iBAAA,kDACA,OAAA,+GACA,kBAAA,SFwMJ,sBE5MI,iBAAA,oDACA,iBAAA,+CACA,iBAAA,wEAAA,iBAAA,kDACA,OAAA,+GACA,kBAAA,SFyMJ,mBE7MI,iBAAA,oDACA,iBAAA,+CACA,iBAAA,wEAAA,iBAAA,kDACA,OAAA,+GACA,kBAAA,SF0MJ,sBE9MI,iBAAA,oDACA,iBAAA,+CACA,iBAAA,wEAAA,iBAAA,kDACA,OAAA,+GACA,kBAAA,SF2MJ,qBE/MI,iBAAA,oDACA,iBAAA,+CACA,iBAAA,wEAAA,iBAAA,kDACA,OAAA,+GACA,kBAAA,SF+MJ,sBElLI,iBAAA,yKACA,iBAAA,oKACA,iBAAA,iKFyLJ,YACE,cAAA,IC9KA,mBAAA,EAAA,IAAA,IAAA,iBACQ,WAAA,EAAA,IAAA,IAAA,iBDgLV,wBAAA,8BAAA,8BAGE,YAAA,EAAA,KAAA,EAAA,QEnOE,iBAAA,oDACA,iBAAA,+CACA,iBAAA,wEAAA,iBAAA,kDACA,OAAA,+GACA,kBAAA,SFiOF,aAAA,QALF,+BAAA,qCAAA,qCAQI,YAAA,KAUJ,OCnME,mBAAA,EAAA,IAAA,IAAA,gBACQ,WAAA,EAAA,IAAA,IAAA,gBD4MV,8BE5PI,iBAAA,oDACA,iBAAA,+CACA,iBAAA,wEAAA,iBAAA,kDACA,OAAA,+GACA,kBAAA,SFyPJ,8BE7PI,iBAAA,oDACA,iBAAA,+CACA,iBAAA,wEAAA,iBAAA,kDACA,OAAA,+GACA,kBAAA,SF0PJ,8BE9PI,iBAAA,oDACA,iBAAA,+CACA,iBAAA,wEAAA,iBAAA,kDACA,OAAA,+GACA,kBAAA,SF2PJ,2BE/PI,iBAAA,oDACA,iBAAA,+CACA,iBAAA,wEAAA,iBAAA,kDACA,OAAA,+GACA,kBAAA,SF4PJ,8BEhQI,iBAAA,oDACA,iBAAA,+CACA,iBAAA,wEAAA,iBAAA,kDACA,OAAA,+GACA,kBAAA,SF6PJ,6BEjQI,iBAAA,oDACA,iBAAA,+CACA,iBAAA,wEAAA,iBAAA,kDACA,OAAA,+GACA,kBAAA,SFoQJ,MExQI,iBAAA,oDACA,iBAAA,+CACA,iBAAA,wEAAA,iBAAA,kDACA,OAAA,+GACA,kBAAA,SFsQF,aAAA,QC3NA,mBAAA,MAAA,EAAA,IAAA,IAAA,gBAAA,EAAA,IAAA,EAAA,qBACQ,WAAA,MAAA,EAAA,IAAA,IAAA,gBAAA,EAAA,IAAA,EAAA","sourcesContent":["/*!\n * Bootstrap v3.3.7 (http://getbootstrap.com)\n * Copyright 2011-2016 Twitter, Inc.\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n */\n\n//\n// Load core variables and mixins\n// --------------------------------------------------\n\n@import \"variables.less\";\n@import \"mixins.less\";\n\n\n//\n// Buttons\n// --------------------------------------------------\n\n// Common styles\n.btn-default,\n.btn-primary,\n.btn-success,\n.btn-info,\n.btn-warning,\n.btn-danger {\n text-shadow: 0 -1px 0 rgba(0,0,0,.2);\n @shadow: inset 0 1px 0 rgba(255,255,255,.15), 0 1px 1px rgba(0,0,0,.075);\n .box-shadow(@shadow);\n\n // Reset the shadow\n &:active,\n &.active {\n .box-shadow(inset 0 3px 5px rgba(0,0,0,.125));\n }\n\n &.disabled,\n &[disabled],\n fieldset[disabled] & {\n .box-shadow(none);\n }\n\n .badge {\n text-shadow: none;\n }\n}\n\n// Mixin for generating new styles\n.btn-styles(@btn-color: #555) {\n #gradient > .vertical(@start-color: @btn-color; @end-color: darken(@btn-color, 12%));\n .reset-filter(); // Disable gradients for IE9 because filter bleeds through rounded corners; see https://github.com/twbs/bootstrap/issues/10620\n background-repeat: repeat-x;\n border-color: darken(@btn-color, 14%);\n\n &:hover,\n &:focus {\n background-color: darken(@btn-color, 12%);\n background-position: 0 -15px;\n }\n\n &:active,\n &.active {\n background-color: darken(@btn-color, 12%);\n border-color: darken(@btn-color, 14%);\n }\n\n &.disabled,\n &[disabled],\n fieldset[disabled] & {\n &,\n &:hover,\n &:focus,\n &.focus,\n &:active,\n &.active {\n background-color: darken(@btn-color, 12%);\n background-image: none;\n }\n }\n}\n\n// Common styles\n.btn {\n // Remove the gradient for the pressed/active state\n &:active,\n &.active {\n background-image: none;\n }\n}\n\n// Apply the mixin to the buttons\n.btn-default { .btn-styles(@btn-default-bg); text-shadow: 0 1px 0 #fff; border-color: #ccc; }\n.btn-primary { .btn-styles(@btn-primary-bg); }\n.btn-success { .btn-styles(@btn-success-bg); }\n.btn-info { .btn-styles(@btn-info-bg); }\n.btn-warning { .btn-styles(@btn-warning-bg); }\n.btn-danger { .btn-styles(@btn-danger-bg); }\n\n\n//\n// Images\n// --------------------------------------------------\n\n.thumbnail,\n.img-thumbnail {\n .box-shadow(0 1px 2px rgba(0,0,0,.075));\n}\n\n\n//\n// Dropdowns\n// --------------------------------------------------\n\n.dropdown-menu > li > a:hover,\n.dropdown-menu > li > a:focus {\n #gradient > .vertical(@start-color: @dropdown-link-hover-bg; @end-color: darken(@dropdown-link-hover-bg, 5%));\n background-color: darken(@dropdown-link-hover-bg, 5%);\n}\n.dropdown-menu > .active > a,\n.dropdown-menu > .active > a:hover,\n.dropdown-menu > .active > a:focus {\n #gradient > .vertical(@start-color: @dropdown-link-active-bg; @end-color: darken(@dropdown-link-active-bg, 5%));\n background-color: darken(@dropdown-link-active-bg, 5%);\n}\n\n\n//\n// Navbar\n// --------------------------------------------------\n\n// Default navbar\n.navbar-default {\n #gradient > .vertical(@start-color: lighten(@navbar-default-bg, 10%); @end-color: @navbar-default-bg);\n .reset-filter(); // Remove gradient in IE<10 to fix bug where dropdowns don't get triggered\n border-radius: @navbar-border-radius;\n @shadow: inset 0 1px 0 rgba(255,255,255,.15), 0 1px 5px rgba(0,0,0,.075);\n .box-shadow(@shadow);\n\n .navbar-nav > .open > a,\n .navbar-nav > .active > a {\n #gradient > .vertical(@start-color: darken(@navbar-default-link-active-bg, 5%); @end-color: darken(@navbar-default-link-active-bg, 2%));\n .box-shadow(inset 0 3px 9px rgba(0,0,0,.075));\n }\n}\n.navbar-brand,\n.navbar-nav > li > a {\n text-shadow: 0 1px 0 rgba(255,255,255,.25);\n}\n\n// Inverted navbar\n.navbar-inverse {\n #gradient > .vertical(@start-color: lighten(@navbar-inverse-bg, 10%); @end-color: @navbar-inverse-bg);\n .reset-filter(); // Remove gradient in IE<10 to fix bug where dropdowns don't get triggered; see https://github.com/twbs/bootstrap/issues/10257\n border-radius: @navbar-border-radius;\n .navbar-nav > .open > a,\n .navbar-nav > .active > a {\n #gradient > .vertical(@start-color: @navbar-inverse-link-active-bg; @end-color: lighten(@navbar-inverse-link-active-bg, 2.5%));\n .box-shadow(inset 0 3px 9px rgba(0,0,0,.25));\n }\n\n .navbar-brand,\n .navbar-nav > li > a {\n text-shadow: 0 -1px 0 rgba(0,0,0,.25);\n }\n}\n\n// Undo rounded corners in static and fixed navbars\n.navbar-static-top,\n.navbar-fixed-top,\n.navbar-fixed-bottom {\n border-radius: 0;\n}\n\n// Fix active state of dropdown items in collapsed mode\n@media (max-width: @grid-float-breakpoint-max) {\n .navbar .navbar-nav .open .dropdown-menu > .active > a {\n &,\n &:hover,\n &:focus {\n color: #fff;\n #gradient > .vertical(@start-color: @dropdown-link-active-bg; @end-color: darken(@dropdown-link-active-bg, 5%));\n }\n }\n}\n\n\n//\n// Alerts\n// --------------------------------------------------\n\n// Common styles\n.alert {\n text-shadow: 0 1px 0 rgba(255,255,255,.2);\n @shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 1px 2px rgba(0,0,0,.05);\n .box-shadow(@shadow);\n}\n\n// Mixin for generating new styles\n.alert-styles(@color) {\n #gradient > .vertical(@start-color: @color; @end-color: darken(@color, 7.5%));\n border-color: darken(@color, 15%);\n}\n\n// Apply the mixin to the alerts\n.alert-success { .alert-styles(@alert-success-bg); }\n.alert-info { .alert-styles(@alert-info-bg); }\n.alert-warning { .alert-styles(@alert-warning-bg); }\n.alert-danger { .alert-styles(@alert-danger-bg); }\n\n\n//\n// Progress bars\n// --------------------------------------------------\n\n// Give the progress background some depth\n.progress {\n #gradient > .vertical(@start-color: darken(@progress-bg, 4%); @end-color: @progress-bg)\n}\n\n// Mixin for generating new styles\n.progress-bar-styles(@color) {\n #gradient > .vertical(@start-color: @color; @end-color: darken(@color, 10%));\n}\n\n// Apply the mixin to the progress bars\n.progress-bar { .progress-bar-styles(@progress-bar-bg); }\n.progress-bar-success { .progress-bar-styles(@progress-bar-success-bg); }\n.progress-bar-info { .progress-bar-styles(@progress-bar-info-bg); }\n.progress-bar-warning { .progress-bar-styles(@progress-bar-warning-bg); }\n.progress-bar-danger { .progress-bar-styles(@progress-bar-danger-bg); }\n\n// Reset the striped class because our mixins don't do multiple gradients and\n// the above custom styles override the new `.progress-bar-striped` in v3.2.0.\n.progress-bar-striped {\n #gradient > .striped();\n}\n\n\n//\n// List groups\n// --------------------------------------------------\n\n.list-group {\n border-radius: @border-radius-base;\n .box-shadow(0 1px 2px rgba(0,0,0,.075));\n}\n.list-group-item.active,\n.list-group-item.active:hover,\n.list-group-item.active:focus {\n text-shadow: 0 -1px 0 darken(@list-group-active-bg, 10%);\n #gradient > .vertical(@start-color: @list-group-active-bg; @end-color: darken(@list-group-active-bg, 7.5%));\n border-color: darken(@list-group-active-border, 7.5%);\n\n .badge {\n text-shadow: none;\n }\n}\n\n\n//\n// Panels\n// --------------------------------------------------\n\n// Common styles\n.panel {\n .box-shadow(0 1px 2px rgba(0,0,0,.05));\n}\n\n// Mixin for generating new styles\n.panel-heading-styles(@color) {\n #gradient > .vertical(@start-color: @color; @end-color: darken(@color, 5%));\n}\n\n// Apply the mixin to the panel headings only\n.panel-default > .panel-heading { .panel-heading-styles(@panel-default-heading-bg); }\n.panel-primary > .panel-heading { .panel-heading-styles(@panel-primary-heading-bg); }\n.panel-success > .panel-heading { .panel-heading-styles(@panel-success-heading-bg); }\n.panel-info > .panel-heading { .panel-heading-styles(@panel-info-heading-bg); }\n.panel-warning > .panel-heading { .panel-heading-styles(@panel-warning-heading-bg); }\n.panel-danger > .panel-heading { .panel-heading-styles(@panel-danger-heading-bg); }\n\n\n//\n// Wells\n// --------------------------------------------------\n\n.well {\n #gradient > .vertical(@start-color: darken(@well-bg, 5%); @end-color: @well-bg);\n border-color: darken(@well-bg, 10%);\n @shadow: inset 0 1px 3px rgba(0,0,0,.05), 0 1px 0 rgba(255,255,255,.1);\n .box-shadow(@shadow);\n}\n","// Vendor Prefixes\n//\n// All vendor mixins are deprecated as of v3.2.0 due to the introduction of\n// Autoprefixer in our Gruntfile. They have been removed in v4.\n\n// - Animations\n// - Backface visibility\n// - Box shadow\n// - Box sizing\n// - Content columns\n// - Hyphens\n// - Placeholder text\n// - Transformations\n// - Transitions\n// - User Select\n\n\n// Animations\n.animation(@animation) {\n -webkit-animation: @animation;\n -o-animation: @animation;\n animation: @animation;\n}\n.animation-name(@name) {\n -webkit-animation-name: @name;\n animation-name: @name;\n}\n.animation-duration(@duration) {\n -webkit-animation-duration: @duration;\n animation-duration: @duration;\n}\n.animation-timing-function(@timing-function) {\n -webkit-animation-timing-function: @timing-function;\n animation-timing-function: @timing-function;\n}\n.animation-delay(@delay) {\n -webkit-animation-delay: @delay;\n animation-delay: @delay;\n}\n.animation-iteration-count(@iteration-count) {\n -webkit-animation-iteration-count: @iteration-count;\n animation-iteration-count: @iteration-count;\n}\n.animation-direction(@direction) {\n -webkit-animation-direction: @direction;\n animation-direction: @direction;\n}\n.animation-fill-mode(@fill-mode) {\n -webkit-animation-fill-mode: @fill-mode;\n animation-fill-mode: @fill-mode;\n}\n\n// Backface visibility\n// Prevent browsers from flickering when using CSS 3D transforms.\n// Default value is `visible`, but can be changed to `hidden`\n\n.backface-visibility(@visibility) {\n -webkit-backface-visibility: @visibility;\n -moz-backface-visibility: @visibility;\n backface-visibility: @visibility;\n}\n\n// Drop shadows\n//\n// Note: Deprecated `.box-shadow()` as of v3.1.0 since all of Bootstrap's\n// supported browsers that have box shadow capabilities now support it.\n\n.box-shadow(@shadow) {\n -webkit-box-shadow: @shadow; // iOS <4.3 & Android <4.1\n box-shadow: @shadow;\n}\n\n// Box sizing\n.box-sizing(@boxmodel) {\n -webkit-box-sizing: @boxmodel;\n -moz-box-sizing: @boxmodel;\n box-sizing: @boxmodel;\n}\n\n// CSS3 Content Columns\n.content-columns(@column-count; @column-gap: @grid-gutter-width) {\n -webkit-column-count: @column-count;\n -moz-column-count: @column-count;\n column-count: @column-count;\n -webkit-column-gap: @column-gap;\n -moz-column-gap: @column-gap;\n column-gap: @column-gap;\n}\n\n// Optional hyphenation\n.hyphens(@mode: auto) {\n word-wrap: break-word;\n -webkit-hyphens: @mode;\n -moz-hyphens: @mode;\n -ms-hyphens: @mode; // IE10+\n -o-hyphens: @mode;\n hyphens: @mode;\n}\n\n// Placeholder text\n.placeholder(@color: @input-color-placeholder) {\n // Firefox\n &::-moz-placeholder {\n color: @color;\n opacity: 1; // Override Firefox's unusual default opacity; see https://github.com/twbs/bootstrap/pull/11526\n }\n &:-ms-input-placeholder { color: @color; } // Internet Explorer 10+\n &::-webkit-input-placeholder { color: @color; } // Safari and Chrome\n}\n\n// Transformations\n.scale(@ratio) {\n -webkit-transform: scale(@ratio);\n -ms-transform: scale(@ratio); // IE9 only\n -o-transform: scale(@ratio);\n transform: scale(@ratio);\n}\n.scale(@ratioX; @ratioY) {\n -webkit-transform: scale(@ratioX, @ratioY);\n -ms-transform: scale(@ratioX, @ratioY); // IE9 only\n -o-transform: scale(@ratioX, @ratioY);\n transform: scale(@ratioX, @ratioY);\n}\n.scaleX(@ratio) {\n -webkit-transform: scaleX(@ratio);\n -ms-transform: scaleX(@ratio); // IE9 only\n -o-transform: scaleX(@ratio);\n transform: scaleX(@ratio);\n}\n.scaleY(@ratio) {\n -webkit-transform: scaleY(@ratio);\n -ms-transform: scaleY(@ratio); // IE9 only\n -o-transform: scaleY(@ratio);\n transform: scaleY(@ratio);\n}\n.skew(@x; @y) {\n -webkit-transform: skewX(@x) skewY(@y);\n -ms-transform: skewX(@x) skewY(@y); // See https://github.com/twbs/bootstrap/issues/4885; IE9+\n -o-transform: skewX(@x) skewY(@y);\n transform: skewX(@x) skewY(@y);\n}\n.translate(@x; @y) {\n -webkit-transform: translate(@x, @y);\n -ms-transform: translate(@x, @y); // IE9 only\n -o-transform: translate(@x, @y);\n transform: translate(@x, @y);\n}\n.translate3d(@x; @y; @z) {\n -webkit-transform: translate3d(@x, @y, @z);\n transform: translate3d(@x, @y, @z);\n}\n.rotate(@degrees) {\n -webkit-transform: rotate(@degrees);\n -ms-transform: rotate(@degrees); // IE9 only\n -o-transform: rotate(@degrees);\n transform: rotate(@degrees);\n}\n.rotateX(@degrees) {\n -webkit-transform: rotateX(@degrees);\n -ms-transform: rotateX(@degrees); // IE9 only\n -o-transform: rotateX(@degrees);\n transform: rotateX(@degrees);\n}\n.rotateY(@degrees) {\n -webkit-transform: rotateY(@degrees);\n -ms-transform: rotateY(@degrees); // IE9 only\n -o-transform: rotateY(@degrees);\n transform: rotateY(@degrees);\n}\n.perspective(@perspective) {\n -webkit-perspective: @perspective;\n -moz-perspective: @perspective;\n perspective: @perspective;\n}\n.perspective-origin(@perspective) {\n -webkit-perspective-origin: @perspective;\n -moz-perspective-origin: @perspective;\n perspective-origin: @perspective;\n}\n.transform-origin(@origin) {\n -webkit-transform-origin: @origin;\n -moz-transform-origin: @origin;\n -ms-transform-origin: @origin; // IE9 only\n transform-origin: @origin;\n}\n\n\n// Transitions\n\n.transition(@transition) {\n -webkit-transition: @transition;\n -o-transition: @transition;\n transition: @transition;\n}\n.transition-property(@transition-property) {\n -webkit-transition-property: @transition-property;\n transition-property: @transition-property;\n}\n.transition-delay(@transition-delay) {\n -webkit-transition-delay: @transition-delay;\n transition-delay: @transition-delay;\n}\n.transition-duration(@transition-duration) {\n -webkit-transition-duration: @transition-duration;\n transition-duration: @transition-duration;\n}\n.transition-timing-function(@timing-function) {\n -webkit-transition-timing-function: @timing-function;\n transition-timing-function: @timing-function;\n}\n.transition-transform(@transition) {\n -webkit-transition: -webkit-transform @transition;\n -moz-transition: -moz-transform @transition;\n -o-transition: -o-transform @transition;\n transition: transform @transition;\n}\n\n\n// User select\n// For selecting text on the page\n\n.user-select(@select) {\n -webkit-user-select: @select;\n -moz-user-select: @select;\n -ms-user-select: @select; // IE10+\n user-select: @select;\n}\n","// Gradients\n\n#gradient {\n\n // Horizontal gradient, from left to right\n //\n // Creates two color stops, start and end, by specifying a color and position for each color stop.\n // Color stops are not available in IE9 and below.\n .horizontal(@start-color: #555; @end-color: #333; @start-percent: 0%; @end-percent: 100%) {\n background-image: -webkit-linear-gradient(left, @start-color @start-percent, @end-color @end-percent); // Safari 5.1-6, Chrome 10+\n background-image: -o-linear-gradient(left, @start-color @start-percent, @end-color @end-percent); // Opera 12\n background-image: linear-gradient(to right, @start-color @start-percent, @end-color @end-percent); // Standard, IE10, Firefox 16+, Opera 12.10+, Safari 7+, Chrome 26+\n background-repeat: repeat-x;\n filter: e(%(\"progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=1)\",argb(@start-color),argb(@end-color))); // IE9 and down\n }\n\n // Vertical gradient, from top to bottom\n //\n // Creates two color stops, start and end, by specifying a color and position for each color stop.\n // Color stops are not available in IE9 and below.\n .vertical(@start-color: #555; @end-color: #333; @start-percent: 0%; @end-percent: 100%) {\n background-image: -webkit-linear-gradient(top, @start-color @start-percent, @end-color @end-percent); // Safari 5.1-6, Chrome 10+\n background-image: -o-linear-gradient(top, @start-color @start-percent, @end-color @end-percent); // Opera 12\n background-image: linear-gradient(to bottom, @start-color @start-percent, @end-color @end-percent); // Standard, IE10, Firefox 16+, Opera 12.10+, Safari 7+, Chrome 26+\n background-repeat: repeat-x;\n filter: e(%(\"progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)\",argb(@start-color),argb(@end-color))); // IE9 and down\n }\n\n .directional(@start-color: #555; @end-color: #333; @deg: 45deg) {\n background-repeat: repeat-x;\n background-image: -webkit-linear-gradient(@deg, @start-color, @end-color); // Safari 5.1-6, Chrome 10+\n background-image: -o-linear-gradient(@deg, @start-color, @end-color); // Opera 12\n background-image: linear-gradient(@deg, @start-color, @end-color); // Standard, IE10, Firefox 16+, Opera 12.10+, Safari 7+, Chrome 26+\n }\n .horizontal-three-colors(@start-color: #00b3ee; @mid-color: #7a43b6; @color-stop: 50%; @end-color: #c3325f) {\n background-image: -webkit-linear-gradient(left, @start-color, @mid-color @color-stop, @end-color);\n background-image: -o-linear-gradient(left, @start-color, @mid-color @color-stop, @end-color);\n background-image: linear-gradient(to right, @start-color, @mid-color @color-stop, @end-color);\n background-repeat: no-repeat;\n filter: e(%(\"progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=1)\",argb(@start-color),argb(@end-color))); // IE9 and down, gets no color-stop at all for proper fallback\n }\n .vertical-three-colors(@start-color: #00b3ee; @mid-color: #7a43b6; @color-stop: 50%; @end-color: #c3325f) {\n background-image: -webkit-linear-gradient(@start-color, @mid-color @color-stop, @end-color);\n background-image: -o-linear-gradient(@start-color, @mid-color @color-stop, @end-color);\n background-image: linear-gradient(@start-color, @mid-color @color-stop, @end-color);\n background-repeat: no-repeat;\n filter: e(%(\"progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)\",argb(@start-color),argb(@end-color))); // IE9 and down, gets no color-stop at all for proper fallback\n }\n .radial(@inner-color: #555; @outer-color: #333) {\n background-image: -webkit-radial-gradient(circle, @inner-color, @outer-color);\n background-image: radial-gradient(circle, @inner-color, @outer-color);\n background-repeat: no-repeat;\n }\n .striped(@color: rgba(255,255,255,.15); @angle: 45deg) {\n background-image: -webkit-linear-gradient(@angle, @color 25%, transparent 25%, transparent 50%, @color 50%, @color 75%, transparent 75%, transparent);\n background-image: -o-linear-gradient(@angle, @color 25%, transparent 25%, transparent 50%, @color 50%, @color 75%, transparent 75%, transparent);\n background-image: linear-gradient(@angle, @color 25%, transparent 25%, transparent 50%, @color 50%, @color 75%, transparent 75%, transparent);\n }\n}\n","// Reset filters for IE\n//\n// When you need to remove a gradient background, do not forget to use this to reset\n// the IE filter for IE9 and below.\n\n.reset-filter() {\n filter: e(%(\"progid:DXImageTransform.Microsoft.gradient(enabled = false)\"));\n}\n"]} -------------------------------------------------------------------------------- /static/robot/bootstrap/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jezemy/MASystem/7f1b86da04250ca9f5ebdafb956e330bb0449bea/static/robot/bootstrap/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /static/robot/bootstrap/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jezemy/MASystem/7f1b86da04250ca9f5ebdafb956e330bb0449bea/static/robot/bootstrap/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /static/robot/bootstrap/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jezemy/MASystem/7f1b86da04250ca9f5ebdafb956e330bb0449bea/static/robot/bootstrap/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /static/robot/bootstrap/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jezemy/MASystem/7f1b86da04250ca9f5ebdafb956e330bb0449bea/static/robot/bootstrap/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /static/robot/bootstrap/js/npm.js: -------------------------------------------------------------------------------- 1 | // This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment. 2 | require('../../js/transition.js') 3 | require('../../js/alert.js') 4 | require('../../js/button.js') 5 | require('../../js/carousel.js') 6 | require('../../js/collapse.js') 7 | require('../../js/dropdown.js') 8 | require('../../js/modal.js') 9 | require('../../js/tooltip.js') 10 | require('../../js/popover.js') 11 | require('../../js/scrollspy.js') 12 | require('../../js/tab.js') 13 | require('../../js/affix.js') -------------------------------------------------------------------------------- /static/robot/css/bot.css: -------------------------------------------------------------------------------- 1 | #main { 2 | padding: 20px 0px; 3 | } 4 | 5 | #mainChat { 6 | background-color: ghostwhite; 7 | border: rgb(200, 200, 200, 0.5) solid 1px; 8 | box-shadow: 0px 0px 1px 1px rgb(200, 200, 200, 0.5); 9 | border-radius: 20px; 10 | } 11 | 12 | #mainQuestion { 13 | background-color: ghostwhite; 14 | border: rgb(200, 200, 200, 0.5) solid 1px; 15 | box-shadow: 0px 0px 1px 1px rgb(200, 200, 200, 0.5); 16 | border-radius: 20px; 17 | } 18 | 19 | .message, 20 | .reply { 21 | margin: 10px 0px; 22 | } 23 | 24 | 25 | #content { 26 | height: 600px; 27 | padding: 10px 0; 28 | overflow-y: scroll; 29 | overflow-x: hidden; 30 | } 31 | 32 | #content::-webkit-scrollbar { 33 | display: none; 34 | } 35 | 36 | #questions { 37 | height: 670px; 38 | } 39 | 40 | .image img { 41 | width: 40px; 42 | height: 40px; 43 | border-radius: 50%; 44 | } 45 | 46 | .message .chattext .text { 47 | max-width: 400px; 48 | margin: 0 10px; 49 | background-color: #EEE; 50 | border-radius: 10px; 51 | padding: 10px 10px; 52 | width:auto; 53 | display:inline-block !important; 54 | display:inline; 55 | } 56 | 57 | .reply .chattext .text { 58 | max-width: 400px; 59 | background-color: lightblue; 60 | border-radius: 10px; 61 | padding: 10px 10px; 62 | width:auto; 63 | display:inline-block !important; 64 | display:inline; 65 | 66 | float: right; 67 | } 68 | .reply .image{ 69 | padding: 0; 70 | } 71 | 72 | 73 | .chattext img { 74 | max-width: 300px; 75 | max-height: 200px; 76 | } 77 | 78 | 79 | .btn-options { 80 | margin: 10px 0; 81 | padding: 0px 5px; 82 | } 83 | .btn-options span{ 84 | margin: 5px 2px; 85 | } 86 | 87 | .a-opt { 88 | color: cornflowerblue; 89 | } 90 | 91 | .a-opt:hover { 92 | text-decoration: none; 93 | cursor: pointer; 94 | } 95 | 96 | .btn-opt { 97 | background-color: #FFFFFF; 98 | border: royalblue solid 1px; 99 | border-radius: 20px; 100 | margin: 2px; 101 | color: royalblue; 102 | } 103 | 104 | .btn-opt:hover { 105 | background-color: royalblue; 106 | color: #fff; 107 | transition: all .3s 108 | } 109 | 110 | #footer { 111 | margin: 10px 0; 112 | } 113 | 114 | #footer input { 115 | height: 40px; 116 | width: 600px; 117 | border-radius: 10px; 118 | resize: none; 119 | } 120 | 121 | .sendBtn { 122 | margin: 2px 15px 0; 123 | } 124 | 125 | .btn-send { 126 | width: 60px; 127 | } 128 | 129 | .btn-send:hover { 130 | color: #FFF; 131 | background-color: royalblue; 132 | } 133 | 134 | #questions p { 135 | margin: 15px 3px; 136 | color: #64a0ed; 137 | } 138 | 139 | #questions p a { 140 | margin: 15px 3px; 141 | color: #64a0ed; 142 | text-decoration: none; 143 | cursor: pointer; 144 | } 145 | 146 | #questions p:hover { 147 | color: #204D74; 148 | cursor: pointer; 149 | } 150 | 151 | #questions p a:hover { 152 | color: #204D74; 153 | cursor: pointer; 154 | } 155 | 156 | /* CSS Spinner */ 157 | .spinner { 158 | margin: 0 30px; 159 | width: 20px; 160 | text-align: center; 161 | } 162 | 163 | .spinner>div { 164 | width: 4px; 165 | height: 4px; 166 | background-color: #888; 167 | 168 | border-radius: 100%; 169 | display: inline-block; 170 | -webkit-animation: sk-bouncedelay 1.4s infinite ease-in-out both; 171 | animation: sk-bouncedelay 1.4s infinite ease-in-out both; 172 | } 173 | 174 | .spinner .bounce1 { 175 | -webkit-animation-delay: -0.32s; 176 | animation-delay: -0.32s; 177 | } 178 | 179 | .spinner .bounce2 { 180 | -webkit-animation-delay: -0.16s; 181 | animation-delay: -0.16s; 182 | } 183 | 184 | @-webkit-keyframes sk-bouncedelay { 185 | 186 | 0%, 187 | 80%, 188 | 100% { 189 | -webkit-transform: scale(0) 190 | } 191 | 192 | 40% { 193 | -webkit-transform: scale(1.0) 194 | } 195 | } 196 | 197 | @keyframes sk-bouncedelay { 198 | 199 | 0%, 200 | 80%, 201 | 100% { 202 | -webkit-transform: scale(0); 203 | transform: scale(0); 204 | } 205 | 206 | 40% { 207 | -webkit-transform: scale(1.0); 208 | transform: scale(1.0); 209 | } 210 | 211 | } 212 | -------------------------------------------------------------------------------- /static/robot/img/profile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jezemy/MASystem/7f1b86da04250ca9f5ebdafb956e330bb0449bea/static/robot/img/profile.png -------------------------------------------------------------------------------- /static/robot/img/testimg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jezemy/MASystem/7f1b86da04250ca9f5ebdafb956e330bb0449bea/static/robot/img/testimg.jpg -------------------------------------------------------------------------------- /static/robot/img/user.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jezemy/MASystem/7f1b86da04250ca9f5ebdafb956e330bb0449bea/static/robot/img/user.jpg -------------------------------------------------------------------------------- /static/robot/js/bot.js: -------------------------------------------------------------------------------- 1 | function scrollDown() { 2 | $('#content').animate({ 3 | scrollTop: $('#content').get(0).scrollHeight 4 | }, 100); 5 | } 6 | 7 | function controller(isOpen) { 8 | // 控制加载点是否显示 9 | if (isOpen === true) { 10 | $('#waiting').css("display", "block"); 11 | } else { 12 | $('#waiting').css("display", "none"); 13 | } 14 | } 15 | 16 | function init() { 17 | controller(true); 18 | setTimeout(function () { 19 | sendMsgText("你好,我是您的私人医疗问答助理"); 20 | }, 1000); 21 | setTimeout(function () { 22 | $('#waiting').before('
'); 23 | }, 1000); 24 | controller(false); 25 | 26 | } 27 | 28 | function button(item) { 29 | controller(true); 30 | intent = $(item).attr("intent"); 31 | text = $(item).text(); 32 | ReplyMsg(text); 33 | $.ajax({ 34 | type: "POST", 35 | url: "/receiveBtn/", 36 | dataType: "json", 37 | data: {msg: text, intent: intent, username: "django"}, 38 | success: function (data) { 39 | console.log(data); 40 | if (data['code'] === "200") { 41 | sendMsgText(data['response']); 42 | if (data['pic_url'] != "") { 43 | sendPhoto(data['pic_url']); 44 | } 45 | } 46 | } 47 | 48 | }); 49 | scrollDown(); 50 | controller(false); 51 | } 52 | 53 | function aTag(item) { 54 | let text = $(item).text(); 55 | console.log(text); 56 | if (text === "") return; 57 | 58 | controller(true); 59 | ReplyMsg(text); 60 | 61 | $.ajax({ 62 | type: "POST", 63 | url: "/receiveMsg/", 64 | dataType: "json", 65 | data: {msg: text, username: "django"}, 66 | success: function (data) { 67 | console.log(data); 68 | if (data['code'] === "200") { 69 | console.log(data["response"]); 70 | if (data['buttons'].length != 0) { 71 | sendMsgBtn(data['response'], data['buttons'], data['intent']); 72 | } else { 73 | sendMsgText(data['response']); 74 | } 75 | 76 | } 77 | } 78 | }); 79 | controller(false); 80 | } 81 | 82 | function ReplyMsg(text) { 83 | // 把输入框内的文字输出到消息面板 84 | str = '
' + text + '
'; 85 | $("#waiting").before(str); 86 | $('#msgText').val(""); 87 | scrollDown(); 88 | } 89 | 90 | function sendMsgText(response) { 91 | // 机器人回复,只有文字 92 | str = '
' + response + '
'; 93 | $("#waiting").before(str); 94 | scrollDown(); 95 | } 96 | 97 | function sendMsgBtn(response, buttons, intent) { 98 | // 机器人回复,有文字,有按钮 99 | str = '
' + response + '
'; 100 | $(buttons).each(function (index, element) { 101 | str += '' + element + ''; 102 | }); 103 | str += '
'; 104 | 105 | $("#waiting").before(str); 106 | scrollDown(); 107 | } 108 | 109 | function sendPhoto(pic_url) { 110 | str = '
'; 111 | $("#waiting").before(str); 112 | scrollDown(); 113 | } 114 | 115 | 116 | $(document).ready(function () { 117 | // 对textarea绑定回车键 118 | $('#msgText').keydown(function (e) { 119 | if (e.keyCode === 13) { 120 | $('#sendBtn').click(); 121 | } 122 | }); 123 | 124 | init(); 125 | 126 | // 发送消息 127 | $("#sendBtn").click(function () { 128 | let text = $('#msgText').val(); 129 | if (text === "") return; 130 | 131 | controller(true); 132 | ReplyMsg(text); 133 | 134 | $.ajax({ 135 | type: "POST", 136 | url: "/receiveMsg/", 137 | dataType: "json", 138 | data: {msg: text, username: "django"}, 139 | success: function (data) { 140 | console.log(data); 141 | if (data['code'] === "200") { 142 | console.log(data["response"]); 143 | if (data['buttons'].length != 0) { 144 | sendMsgBtn(data['response'], data['buttons'], data['intent']); 145 | } else { 146 | sendMsgText(data['response']); 147 | if (data['pic_url'] != ""){ 148 | sendPhoto(data['pic_url']); 149 | } 150 | 151 | } 152 | 153 | } 154 | } 155 | }); 156 | controller(false); 157 | }); 158 | 159 | 160 | }); 161 | -------------------------------------------------------------------------------- /telegramBot.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | ''' 3 | 移植到telegram上 4 | ''' 5 | 6 | import telebot 7 | from telebot.types import * 8 | from contextual.IntentProcessor import IntentProcessor 9 | import json 10 | import requests 11 | import re 12 | 13 | TOKEN = '改成自己的TelegramBotID' 14 | 15 | bot = telebot.TeleBot(TOKEN, parse_mode = None) # You can set parse_mode by default. HTML or MARKDOWN 16 | 17 | 18 | @bot.message_handler(commands = ['start', 'help']) 19 | def send_welcome(message): 20 | bot.send_message(message.chat.id, "你好,我是你的私人医疗助理") 21 | inform = '''您可以这样向我提问:\n感冒怎么办\n什么人容易感冒\n感冒吃什么药\n感冒属于什么科\n如何防止感冒\n感冒要治多久\n感冒有什么并发症状\n感冒有什么症状\n感冒治疗几率大吗\n上清丸可以治什么病''' 22 | bot.send_message(message.chat.id, inform) 23 | 24 | def generateMarkupButton(names:list, intent): 25 | markup = InlineKeyboardMarkup() 26 | buttons = [] 27 | 28 | for name in names: 29 | buttons.append(InlineKeyboardButton(name, callback_data = name+"#"+intent)) 30 | markup.add(*buttons, row_width = 3) 31 | return markup 32 | 33 | def sendPhoto(chat_id, pic_url): 34 | pattern = '\.[a-z]{3,4}' 35 | file_type = re.findall(pattern, pic_url)[-1] 36 | file_name = 'telegramPhotoTemp' + file_type 37 | rp = requests.get(pic_url) 38 | with open(file_name, 'wb') as f: 39 | f.write(rp.content) 40 | photo = open(file_name, 'rb') 41 | bot.send_photo(chat_id, photo) 42 | photo.close() 43 | 44 | @bot.message_handler(func = lambda m: m.text is not None) 45 | def receiveMsg(message): 46 | sentence = message.text 47 | username = message.chat.first_name 48 | print("receiveMsg: ", sentence, username) 49 | data = IntentProcessor.intent_not_sure(username,sentence) 50 | 51 | 52 | if data["button"]: 53 | button_names = [name for name in data['button']] 54 | intent = data['intent'] 55 | markup = generateMarkupButton(button_names, intent) 56 | bot.send_message(message.chat.id, data['text'], reply_markup = markup) 57 | else: 58 | bot.send_message(message.chat.id, data['text']) 59 | 60 | if data['pic_url']: 61 | sendPhoto(message.chat.id, data['pic_url']) 62 | 63 | @bot.callback_query_handler(func=lambda call: True) 64 | def receiveBtn(call): 65 | username=call.message.json['chat']['first_name'] 66 | data_str = call.data 67 | 68 | entity,intent = data_str.split("#") 69 | entity_name = intent.split("_")[0] 70 | 71 | print("receiveMsg: ",entity, intent) 72 | IntentProcessor.set_single_slot(username, entity_name, entity) 73 | 74 | data = IntentProcessor.intent_button_sure(username, intent) 75 | chat_id = call.message.json['chat']['id'] 76 | bot.send_message(chat_id, data['text']) 77 | if data['button']: 78 | button_names = [name for name in data['button']] 79 | intent = data['intent'] 80 | markup = generateMarkupButton(button_names, intent) 81 | bot.send_message(chat_id, "可以试试如下食疗", reply_markup = markup) 82 | 83 | if data['pic_url']: 84 | sendPhoto(chat_id, data['pic_url']) 85 | 86 | bot.polling() -------------------------------------------------------------------------------- /templates/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 17 | 18 |
19 |
20 |
21 |
22 |

医疗问答助手

23 |
24 | 25 |
26 | 27 |
28 |
29 | 30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 | 42 | 43 |
44 | 45 | 46 | 57 | 58 |
59 | 60 |
61 |
62 |

常见问题

63 |
64 | 70 |
71 |
72 |
73 | 74 | 75 | -------------------------------------------------------------------------------- /templates/test.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Medical Assistant 5 | 6 | 15 | 80 | 81 | 82 | 83 | 84 | 85 |
86 |
聊天内容
87 |
88 | 89 |
90 | 91 | 92 |
93 | 94 | 95 | --------------------------------------------------------------------------------