MaartenGr / KeyBERT

Minimal keyword extraction with BERT
https://MaartenGr.github.io/KeyBERT/
MIT License
3.47k stars 344 forks source link

AttributeError: 'CountVectorizer' object has no attribute 'get_feature_names'. Did you mean: 'get_feature_names_out'? #155

Closed PankajKarki closed 1 year ago

PankajKarki commented 1 year ago

kw_model.extract_keywords(doc, keyphrase_ngram_range=(1, 1), stop_words=None) Traceback (most recent call last): File "", line 1, in File "/home/env/lib/python3.10/site-packages/keybert/_model.py", line 110, in extract_keywords keywords = self._extract_keywords_single_doc(doc=docs, File "/home//env/lib/python3.10/site-packages/keybert/_model.py", line 172, in _extract_keywords_single_doc candidates = count.get_feature_names() AttributeError: 'CountVectorizer' object has no attribute 'get_feature_names'. Did you mean: 'get_feature_names_out'?

MaartenGr commented 1 year ago

Are you using the most recent version of KeyBERT? I believe this was fixed in one of its newest versions. It should work in v0.7.