I try to use lemmatize()
function from gensim
. They said I have to install pattern
also to use this function. I have already install both gensim
and pattern but every time I try to import lemmatize from gensim
, it keeps showing this error
I use pip install gensim
and pip install pattern
to install the libraries. My gensim version is 4.0.1 and pattern is 3.6
Traceback (most recent call last):
File "c:\Users\huynh\Desktop\machine_learning\test.py", line 1, in <module>
from gensim.utils import lemmatize
ImportError: cannot import name 'lemmatize' from 'gensim.utils' (C:\Users\huynh\AppData\Local\Programs\Python\Python39\lib\site-packages\gensim\utils.py)
I tried to look up documentation about this but all I could find is that I have to install pattern
to be able to use it. Does anyone have an idea why I still don't have lemmatize()
? Thank you
Gensim only ever previously wrapped the lemmatization routines of another library (Pattern
) – which was not a particularly modern or well-maintained option, so it was removed from Gensim-4.0.
Users can choose & apply their own lemmatization operations, if they think that's necessary, as a preprocessing step before applying Gensim's algorithms.
Some Python libraries offering lemmatization include:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With