优化医院名繁简转换
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
x-env:
|
||||
&template
|
||||
image: fcb_photo_review:1.12.2
|
||||
image: fcb_photo_review:1.12.3
|
||||
restart: always
|
||||
|
||||
services:
|
||||
|
||||
@@ -69,6 +69,7 @@ HOSPITAL_ALIAS = {
|
||||
"江阴徐霞客医院": ["江阴市徐霞客医院"],
|
||||
"江阴北国医院": ["江阴市北国医院"],
|
||||
"溧阳茶亭医院": ["溧阳市茶亭医院"],
|
||||
"南京市六合中医院": ["南京市六合区中医院"]
|
||||
}
|
||||
|
||||
"""
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
numpy==1.26.4
|
||||
onnxconverter-common==1.14.0
|
||||
OpenCC==1.1.9
|
||||
opencv-python==4.6.0.66
|
||||
paddle2onnx==1.2.3
|
||||
paddleclas==2.5.2
|
||||
|
||||
@@ -181,8 +181,8 @@ def parse_hospital(string):
|
||||
if not string:
|
||||
return result
|
||||
|
||||
string = util.traditional_to_simple_chinese(string)
|
||||
string_without_brackets = string.replace(")", "").replace(")", "").replace("(", " ").replace("(", " ")
|
||||
string_without_company = string_without_brackets.replace("有限公司", "")
|
||||
simple_chinese_string = string_without_company.replace("醫", "医")
|
||||
result += simple_chinese_string.split(" ")
|
||||
result += string_without_company.split(" ")
|
||||
return result
|
||||
|
||||
@@ -2,6 +2,8 @@ import logging
|
||||
import os
|
||||
from datetime import datetime
|
||||
|
||||
from opencc import OpenCC
|
||||
|
||||
from util import string_util
|
||||
|
||||
|
||||
@@ -209,3 +211,9 @@ def chinese_money_to_number(chinese_money_amount):
|
||||
amount += j / 10
|
||||
amount += f / 100
|
||||
return round(amount, 2)
|
||||
|
||||
|
||||
# 将繁体字转换为简体字
|
||||
def traditional_to_simple_chinese(traditional_chinese):
|
||||
converter = OpenCC('t2s')
|
||||
return converter.convert(traditional_chinese)
|
||||
|
||||
Reference in New Issue
Block a user