Skip to content Skip to sidebar Skip to footer

No Module Named 'gensim.sklearn_api'

I try to use from gensim.sklearn_api import W2VTransformer and get ImportError: No module named 'gensim.sklearn_api' I used import gensim import sklearn from sklearn.base import

Solution 1:

@tursunWali

Class names seem to have changed from v1.0.5. Try calling TFIDF and other methods by prefixing them with do_, e.g. hero.do_tfidf.

Here's a minimal example:

df['pca']=(df['text'].pipe(hero.clean).pipe(hero.do_tfidf).pipe(hero.do_pca))

You can see all the class names in the package source code.

Solution 2:

If you're using vanilla Python, pip install -U gensim.

Solution 3:

After importing the "texthero" library. Its shown error message:

ModuleNotFoundError: No module named 'gensim.sklearn_api'

I have tried to install 'gensim.sklearn_api', but no such module available yet.

Also created the new anaconda environment for an older version of python-like 3.6 and 3.7 but it's has shown the same error message.

Finally, I have installed the older version of texthero and its work

pip install texthero==1.0.5

The older version of texthero==1.0.5 is very much compatible with python version like 3.6, 3.7 and 3.8 enter image description here

Solution 4:

For me it was the version, try: pip install "gensim==3.8.3".

Post a Comment for "No Module Named 'gensim.sklearn_api'"