Repository navigation
fix: 1.x - nltk upgrade, use nltk.download('punkt_tab') - #8256
Conversation
|
I've managed to get the CI to pass. Note the changes in dependencies. It couldn't be done without these and we need to pin a few more dependencies which is ok. The nltk tests that were failing are related to inability to load old models in pickle files, which I think is forbidden now in nltk 3.9.x I'll upgrade this PR draft into a PR |
nltk.download('punkt_tab')
|
I would make this limitation a bit more evident.
|
I opted for always None-ing |
anakin87
left a comment
There was a problem hiding this comment.
I opted for always None-ing
tokenizer_model_folderand logging the warning with resolution path.
I agree with your approach.
I left some comments to better understand...
Co-authored-by: Stefano Fiorucci <[email protected]>
anakin87
left a comment
There was a problem hiding this comment.
OK for me.
I would prefer that @julian-risch also take a look.
Makes sense 🙏 |
julian-risch
left a comment
There was a problem hiding this comment.
We should change
https://github.com/deepset-ai/haystack/blob/nltk_update_exp1/haystack/nodes/preprocessor/preprocessor.py#L932 and https://github.com/deepset-ai/haystack/blob/nltk_update_exp1/haystack/nodes/preprocessor/preprocessor.py#L939
to use the following instead.
from nltk.tokenize.punkt import PunktTokenizer
tokenizer = PunktTokenizer(language_name)Just like it is done here nltk/nltk@496515e
This is also how I understand the first part of the comment by @sagarneeldubey #8238 (comment)
You could reach out to them directly to understand what changes they made in their custom preprocessor component. And whether this PR can replace their custom preprocessor.
Uh oh!
There was an error while loading. Please reload this page.