kwx
kwx copied to clipboard
Fixed the Issue in `utis.py`
1 st changes
- In this modified code, the
spacy_version
variable is used to store the version of theSpaCy
library. Inside the loop, the code checks whether theSpaCy
version is 3.0.0 or higher. If it is, the lemmatization is performed usingnlp(combined_texts)
. Otherwise, for older versions, the lemmatization is done usingnlp.tokenizer(combined_texts)
. This change accounts for potential differences inSpaCy
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.