Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
Q
QASystemOnMedicalKG
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lishen
QASystemOnMedicalKG
Commits
507a36d6
Commit
507a36d6
authored
Apr 17, 2023
by
lishen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[add] gradio
parent
61314e57
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
4 deletions
+52
-4
chatbot_graph.py
chatbot_graph.py
+14
-4
deny.txt
dict/deny.txt
+38
-0
No files found.
chatbot_graph.py
View file @
507a36d6
...
...
@@ -4,6 +4,7 @@
# Author: lhy<lhy_in_blcu@126.com,https://huangyong.github.io>
# Date: 18-10-4
import
gradio
as
gr
from
py2neo
import
Graph
from
question_classifier
import
*
from
question_parser
import
*
...
...
@@ -35,9 +36,18 @@ class ChatBotGraph:
return
'
\n
'
.
join
(
final_answers
)
# if __name__ == '__main__':
# handler = ChatBotGraph()
# while 1:
# question = input('用户:')
# answer = handler.chat_main(question)
# print('小益:', answer)
if
__name__
==
'__main__'
:
handler
=
ChatBotGraph
()
while
1
:
question
=
input
(
'用户:'
)
answer
=
handler
.
chat_main
(
question
)
print
(
'小益:'
,
answer
)
# 接口创建函数
# fn设置处理函数,inputs设置输入接口组件,outputs设置输出接口组件
# fn,inputs,outputs都是必填函数
demo
=
gr
.
Interface
(
fn
=
handler
.
chat_main
,
inputs
=
"text"
,
outputs
=
"text"
)
demo
.
launch
(
share
=
True
)
dict/deny.txt
0 → 100644
View file @
507a36d6
否
非
不
无
弗
勿
毋
未
没
莫
没有
防止
不再
不会
不能
忌
禁止
防止
难以
忘记
忽视
放弃
拒绝
杜绝
不是
并未
并无
仍未
难以出现
切勿
不要
不可
别
管住
注意
小心
少
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment