Commit 0def44e5 authored by Wael Ramadan's avatar Wael Ramadan
Browse files

log get_stanza_tokens exception and return empty sentences, entities

parent 24e0001d
Pipeline #5695 passed with stage
in 17 minutes and 33 seconds
......@@ -230,13 +230,15 @@ class MLP:
def _get_stanza_tokens(self, lang: str, raw_text: str):
sentences = []
entities = []
try:
pipeline = self.stanza_pipelines[lang](raw_text)
except Exception as e:
print(e)
self.logger.exception(e)
return sentences, entities
sentences = []
entities = []
pip_pat = re.compile(r"(?<=\d)_(?=\d)")
for sentence in pipeline.sentences:
words = []
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment