Improve example

This commit is contained in:
Andras Schmelczer 2022-05-26 21:49:58 +02:00
parent 3e1564b9d0
commit b8a373fa80
No known key found for this signature in database
GPG key ID: 39260B5B0614A13E
2 changed files with 20 additions and 23 deletions

View file

@ -12,5 +12,5 @@ def preprocess(text: str) -> str:
def lemmatize(text: str) -> str:
lemmatized = lemmatize_text(text)
clean_lemmas = [re.sub(r"\d[\d.,]*", "NUM", lemma) for lemma in lemmatized]
clean_lemmas = [re.sub(r"\d[\d.,]*", "NUM", lemma.lower()) for lemma in lemmatized]
return " ".join(clean_lemmas)