chartbeat-labs / textacy

NLP, before and after spaCy
https://textacy.readthedocs.io
Other
2.21k stars 249 forks source link

textacy.Vectorizer: TypeError: __init__() got an unexpected keyword argument 'weighting' #194

Closed o-P-o closed 6 years ago

o-P-o commented 6 years ago

I am trying to use the textacy vectorizer, textacy.Vectorizer. In Jupyter Notebook, I do the following:

import textacy
tfidf = textacy.Vectorizer(weighting='tfidf')

This is equivalent to what is done on the usage example on the textacy documentation, so I expect it to work, but instead I get the following error:

TypeError                                 Traceback (most recent call last)
<ipython-input-9-f008b3992bf6> in <module>()
      3 #                                               ngram_range=(1, 2))
      4 import textacy
----> 5 tfidf = textacy.Vectorizer(weighting='tfidf')
      6 tfidf.fit(X)
      7 X = tfidf.transform(X)

TypeError: __init__() got an unexpected keyword argument 'weighting'

I have attempted to reinstall with

pip install textacy

and

pip3 install textacy

but the error continues to occur.

This is my envronment:

- **platform:** darwin
- **python:** 3.6.4 (v3.6.4:d48ecebad5, Dec 18 2017, 21:07:28)  [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)]
- **spacy:** 2.0.10
- **spacy_models:** ['en_core_web_lg', 'en_vectors_web_lg']
- **textacy:** 0.6.0
bdewilde commented 6 years ago

Hi @o-P-o , you're using this class with out-of-date arguments. Please see this quickstart guide and the relevant release for guidance.