kwx icon indicating copy to clipboard operation
kwx copied to clipboard

Fixed the Issue in `utis.py`

Open cicada0007 opened this issue 1 year ago • 10 comments

1 st changes

  • In this modified code, the spacy_version variable is used to store the version of the SpaCy library. Inside the loop, the code checks whether the SpaCy version is 3.0.0 or higher. If it is, the lemmatization is performed using nlp(combined_texts). Otherwise, for older versions, the lemmatization is done using nlp.tokenizer(combined_texts). This change accounts for potential differences in SpaCy versions and ensures the code can handle them correctly.
  • #47 Edit spaCy

2 nd changes

  • Replaced the string slicing with data.endswith() to check the file extension.
  • Changed the error message to be raised as an exception using raise ValueError() instead of just calling ValueError().
  • Fixed the indentation of the function and the if-elif-else blocks.

cicada0007 avatar Jul 03 '23 17:07 cicada0007