优化案子处理逻辑
This commit is contained in:
@@ -19,7 +19,8 @@ def main():
|
||||
cls_result = CLAS(text)
|
||||
cls_result = cls_result[0].get('predictions')[0]
|
||||
if cls_result['score'] < 0.8:
|
||||
raise Exception(f'识别结果置信度过低!text: {text}')
|
||||
logging.info(f"识别结果置信度{cls_result['score']}过低!text: {text}")
|
||||
return None
|
||||
return cls_result['label']
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user