Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pinecone_text/sparse/bm25_tokenizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ def __init__(
@staticmethod
def nltk_setup() -> None:
try:
nltk.data.find("tokenizers/punkt")
nltk.data.find("tokenizers/punkt_tab")
except LookupError:
nltk.download("punkt")
nltk.download("punkt_tab")

try:
nltk.data.find("corpora/stopwords")
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_bm25_tokenizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def test_nltk_download(self):
language="english",
)

nltk.find("tokenizers/punkt")
nltk.find("tokenizers/punkt_tab")
nltk.find("corpora/stopwords")

assert tokenizer("The quick brown fox jumps over the lazy dog") == [
Expand Down