Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incompatibility with sklearn >= 1.5 #731

Open
BLKSerene opened this issue May 23, 2024 · 0 comments
Open

Incompatibility with sklearn >= 1.5 #731

BLKSerene opened this issue May 23, 2024 · 0 comments

Comments

@BLKSerene
Copy link
Contributor

Hi, underthesea 6.8.0 is incompatible with the latest scikit-learn 1.5.0:

import underthesea
underthesea.sentiment('test')
Traceback (most recent call last):
  File "<pyshell#1>", line 1, in <module>
    underthesea.sentiment('test')
  File "D:\Python\lib\site-packages\underthesea\pipeline\sentiment\__init__.py", line 33, in sentiment
    return sentiment(X)
  File "D:\Python\lib\site-packages\underthesea\pipeline\sentiment\general\__init__.py", line 23, in sentiment
    classifier.predict(sentence)
  File "D:\Python\lib\site-packages\underthesea\models\text_classifier.py", line 97, in predict
    y = self.pipeline.predict([text])
  File "D:\Python\lib\site-packages\sklearn\pipeline.py", line 603, in predict
    Xt = transform.transform(Xt)
  File "D:\Python\lib\site-packages\sklearn\feature_extraction\text.py", line 2118, in transform
    return self._tfidf.transform(X, copy=False)
  File "D:\Python\lib\site-packages\sklearn\feature_extraction\text.py", line 1689, in transform
    check_is_fitted(self)
  File "D:\Python\lib\site-packages\sklearn\utils\validation.py", line 1632, in check_is_fitted
    raise NotFittedError(msg % {"name": type(estimator).__name__})
sklearn.exceptions.NotFittedError: This TfidfTransformer instance is not fitted yet. Call 'fit' with appropriate arguments before using this estimator.

Downgrading to scikit-learn 1.4.2 works.

OS: Windows 11 x64
Python: 3.10.13 x64
Underthesea: 6.8.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant