Skip to content

Commit

Permalink
Fix NLTK warnings
Browse files Browse the repository at this point in the history
Added punkt and stopwords modules to README.
  • Loading branch information
louislefevre committed Apr 7, 2021
1 parent d3aee8a commit 878f289
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,6 @@ The program can be initialised by running *start.py*, which accepts parameters i
- [matplotlib](https://pypi.org/project/matplotlib/)
- [nltk](https://pypi.org/project/nltk/)
- [num2words](https://pypi.org/project/num2words/)
- [punkt (nltk module)](http://www.nltk.org/api/nltk.tokenize.html?highlight=punkt)
- [stopwords (nltk module)](https://www.nltk.org/api/nltk.corpus.html)
*NLTK modules are downloaded automatically at runtime*
4 changes: 2 additions & 2 deletions retrieval/util/TextProcessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
from nltk.corpus import stopwords
from nltk.stem import PorterStemmer
from num2words import num2words
nltk.download('punkt')
nltk.download('stopwords')
nltk.download('punkt', quiet=True)
nltk.download('stopwords', quiet=True)


def clean_collection(collection: dict[int, str]) -> dict[int, list[str]]:
Expand Down

0 comments on commit 878f289

Please sign in to comment.