Improve example
This commit is contained in:
parent
e4b4c262c3
commit
8033e63b51
2 changed files with 20 additions and 23 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue