捕捉ie中抛出的错误

This commit is contained in:
2024-06-20 08:38:40 +08:00
parent 3b6f965eae
commit 6eaf6a2a53

View File

@@ -40,7 +40,12 @@ def information_extraction(ie, phrecs):
doc_phrecs.append(phrec)
if not docs:
return result
ie_results = ie(docs)
try:
ie_results = ie(docs)
except Exception as e:
logging.error(e)
return result
now = get_default_datetime()
for i in range(len(ie_results)):