Spacy as tokenizer and for stop words? #168
Replies: 1 comment 5 replies
|
Hi Maximilian! A goal of the project for bm25s is to keep things as simple as possible, thus have as few dependencies as possible. For instance, we removed scipy from the dependencies and move to optional (although I would ideally remove it completley but want to keep it for backward compatibility, at least for v0.3.0). One issue with having spacy as a dependency, even optional, is that it will give the user the impression that it's the "official" way to do tokenize text, similar to how PyStemmer is the current "official" way to stem text. However, it may lead to a substantial slowdown (at least that was the case when i tried to use other tokenizer, haven't tested each and every tokenizer so can't tell the exact number). I want to avoid having slowdowns out-of-the-box, and i consider optional dependencies to be part of the "out-of-the-box" experience. That said, I think it'd be great to have examples showing how to use bm25s with different tokenizers, such as spacy. For example, here's an example with nltk: https://github.com/xhluca/bm25s/blob/main/examples/nltk_stemmer.py Since Spacy is already high level, it'd probably make it straightforward to create an example for that, which i'm happy to merge if it matches the format of other examples. I also think it'd be good to share the examples more prominently, maybe by refactoring the huggingface integration section into a broader integration section that also mentions spacy, nltk, etc. Feel free to start a PR if that sounds interesting to you! |
Uh oh!
There was an error while loading. Please reload this page.
spaCy provides solid tokenization across many languages, along with built-in stop-word lists and lemmatisation. Would it make sense to integrate it as an optional tokenizer for users who prefer higher accuracy, even if it comes with a performance cost?
I would be happy to work on it
All reactions