From 6529dc3d986da2f08c2d3ef4cacdf0fe8e92580c Mon Sep 17 00:00:00 2001 From: liuyebo <1515783401@qq.com> Date: Fri, 18 Oct 2024 11:02:58 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E9=AB=98=E6=96=87=E6=9C=AC=E5=88=86?= =?UTF-8?q?=E7=B1=BB=E7=B2=BE=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- services/paddle_services/clas_text.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/paddle_services/clas_text.py b/services/paddle_services/clas_text.py index 9eb77fd..6c12158 100644 --- a/services/paddle_services/clas_text.py +++ b/services/paddle_services/clas_text.py @@ -9,7 +9,7 @@ from utils import process_request app = Flask(__name__) schema = ['基本医保结算单', '出院记录', '费用清单'] CLAS = Taskflow('zero_shot_text_classification', model='utc-xbase', schema=schema, - task_path='model/text_classification', precision='fp16') + task_path='model/text_classification', precision='fp32') @app.route('/', methods=['POST']) @@ -20,7 +20,7 @@ def main(): cls_result = cls_result[0].get('predictions') if cls_result: cls_result = cls_result[0] - if cls_result['score'] < 0.8: + if cls_result['score'] and float(cls_result['score']) < 0.8: logging.info(f"识别结果置信度{cls_result['score']}过低!text: {text}") return None return cls_result['label']