排除单字的搜索,单字搜索的错误率较高
This commit is contained in:
@@ -78,7 +78,8 @@ HOSPITAL_ALIAS = {
|
|||||||
"""
|
"""
|
||||||
搜索过滤配置
|
搜索过滤配置
|
||||||
"""
|
"""
|
||||||
HOSPITAL_FILTER = ["医院", "省", "市", "县", "区", "州", "人民", "第一", "第二", "第三", "大学", "附属"]
|
# 默认会过滤单字
|
||||||
|
HOSPITAL_FILTER = ["医院", "人民", "第一", "第二", "第三", "大学", "附属"]
|
||||||
|
|
||||||
"""
|
"""
|
||||||
分词配置
|
分词配置
|
||||||
|
|||||||
@@ -193,7 +193,7 @@ def save_or_update_ie(table, pk_phhd, data):
|
|||||||
|
|
||||||
def search_hospital(hospital):
|
def search_hospital(hospital):
|
||||||
def _filter_search_keywords(keywords):
|
def _filter_search_keywords(keywords):
|
||||||
keywords = [x for x in keywords if x not in HOSPITAL_FILTER]
|
keywords = [x for x in keywords if x not in HOSPITAL_FILTER and len(x) > 1]
|
||||||
result1 = ""
|
result1 = ""
|
||||||
result2 = ""
|
result2 = ""
|
||||||
for keyword in keywords:
|
for keyword in keywords:
|
||||||
|
|||||||
Reference in New Issue
Block a user