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
632ff31c
Commit
632ff31c
authored
Apr 18, 2023
by
lishen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[add] exercise QA
parent
15ebaf46
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
13 deletions
+13
-13
chatbot_graph.py
chatbot_graph.py
+13
-13
No files found.
chatbot_graph.py
View file @
632ff31c
...
...
@@ -16,7 +16,7 @@ from answer_search import *
class
ChatBotGraph
:
def
__init__
(
self
):
self
.
g
=
Graph
(
'http://127.0.0.1:747
4
'
,
'http://127.0.0.1:747
6
'
,
user
=
"neo4j"
,
password
=
"neo4j"
)
self
.
classifier
=
QuestionClassifier
(
self
.
g
)
...
...
@@ -36,18 +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"
)
# if __name__ == '__main__':
# handler = ChatBotGraph()
# # 接口创建函数
# # fn设置处理函数,inputs设置输入接口组件,outputs设置输出接口组件
# # fn,inputs,outputs都是必填函数
# demo = gr.Interface(fn=handler.chat_main, inputs="text", outputs="text")
#
# demo.launch(share=True, server_name="0.0.0.0")
demo
.
launch
(
share
=
True
,
server_name
=
"0.0.0.0"
)
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