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
424a8483
Commit
424a8483
authored
Apr 19, 2023
by
lishen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[fix]
parent
8d09a61d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
3 deletions
+8
-3
answer_search.py
answer_search.py
+5
-0
question_classifier.py
question_classifier.py
+3
-3
No files found.
answer_search.py
View file @
424a8483
...
...
@@ -267,6 +267,11 @@ class AnswerSearcher:
subject
=
answers
[
0
][
'n.name'
]
final_answer
=
'含低量{0}的食物有:{1}'
.
format
(
subject
,
';'
.
join
(
list
(
set
(
desc
))[:
self
.
num_limit
]))
elif
question_type
==
question_type_enum
.
FOODPROCESS_ALIAS
:
desc
=
[
i
[
'n.name'
]
for
i
in
answers
]
subject
=
answers
[
0
][
'm.name'
]
final_answer
=
'{0}还有其他称呼:{1}'
.
format
(
subject
,
';'
.
join
(
list
(
set
(
desc
))[:
self
.
num_limit
]))
elif
question_type
==
question_type_enum
.
FOODPROCESS_NATURE
:
desc
=
[
i
[
'n.name'
]
for
i
in
answers
]
subject
=
answers
[
0
][
'm.name'
]
...
...
question_classifier.py
View file @
424a8483
...
...
@@ -66,9 +66,9 @@ class QuestionClassifier:
'怎样才可不'
,
'怎么才可不'
,
'咋样才可不'
,
'咋才可不'
,
'如何可不'
]
self
.
lasttime_qwds
=
[
'周期'
,
'多久'
,
'多长时间'
,
'多少时间'
,
'几天'
,
'几年'
,
'多少天'
,
'多少小时'
,
'几个小时'
,
'多少年'
]
self
.
cureway_qwds
=
[
'怎么治疗'
,
'如何医治'
,
'怎么医治'
,
'怎么治'
,
'怎么医'
,
'如何治'
,
'医治方式'
,
'疗法'
,
'咋治'
,
'怎么办'
,
'咋办'
,
'咋治'
]
self
.
cureprob_qwds
=
[
'多大概率能治好'
,
'多大几率能治好'
,
'治好希望大么'
,
'几率'
,
'几成'
,
'比例'
,
'可能性'
,
'能治'
,
'可治'
,
'可以治'
,
'可以医'
]
self
.
cureprob_qwds
=
[
'多大概率能治好'
,
'多大几率能治好'
,
'治好希望大么'
,
'几率'
,
'
概率'
,
'
几成'
,
'比例'
,
'可能性'
,
'能治'
,
'可治'
,
'可以治'
,
'可以医'
]
self
.
easyget_qwds
=
[
'易感人群'
,
'容易感染'
,
'易发人群'
,
'什么人'
,
'哪些人'
,
'感染'
,
'染上'
,
'得上'
]
self
.
check_qwds
=
[
'检查'
,
'检查项目'
,
'查出'
,
'
检查'
,
'
测出'
,
'试出'
]
self
.
check_qwds
=
[
'检查'
,
'检查项目'
,
'查出'
,
'测出'
,
'试出'
]
self
.
belong_qwds
=
[
'属于什么科'
,
'属于'
,
'什么科'
,
'科室'
]
self
.
cure_qwds
=
[
'治疗什么'
,
'治啥'
,
'治疗啥'
,
'医治啥'
,
'治愈啥'
,
'主治啥'
,
'主治什么'
,
'有什么用'
,
'有何用'
,
'用处'
,
'用途'
,
'有什么好处'
,
'有什么益处'
,
'有何益处'
,
'用来'
,
'用来做啥'
,
'用来作甚'
,
'需要'
,
'要'
]
...
...
@@ -165,7 +165,7 @@ class QuestionClassifier:
question_types
.
append
(
question_type
)
# 已知食物找疾病:
if
self
.
check_words
(
self
.
food_qwds
+
self
.
cure_qwds
,
question
)
and
word_type_enum
.
FOOD
in
types
and
word_type_enum
.
DISEASE
in
types
:
if
self
.
check_words
(
self
.
food_qwds
+
self
.
cure_qwds
,
question
)
and
word_type_enum
.
FOOD
in
types
:
deny_status
=
self
.
check_words
(
self
.
deny_words
,
question
)
if
deny_status
:
question_type
=
question_type_enum
.
FOOD_NOT_DISEASE
...
...
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