webis-de / small-text

Active Learning for Text Classification in Python
https://small-text.readthedocs.io/
MIT License
547 stars 60 forks source link

Active Learning with SetFit #64

Closed savasy closed 2 months ago

savasy commented 2 months ago

When I run the following line in 03-Active Learning with SetFit Python Notebook code, active_learner.initialize_data(x_indices_initial, y_initial)

I got the following error

'TrainingArguments' object has no attribute 'eval_strategy'

chschroeder commented 2 months ago

Hi @savasy!

Thank you for reporting this. This is likely caused by your sefit version being newer than what the library supports. Unfortunately, I haven't had the time to update the code to be compatible with recent SetFit versions. To resolve this, please use an older version of SetFit for now:

pip install setfit==0.7.0

Since this is an optional dependency, I can't really control the versions people install, but all restrictions on optional dependencies are documented here. For the example notebooks, I will pin the versions to ensure that those who are just trying out the library will not encounter any unexpected issues.

savasy commented 2 months ago

Hi @chschroeder Thank you very much for the solution. The following setting also works out!

transformers ==4.39.0 setfit==1.0.3

chschroeder commented 2 months ago

Oh, that's interesting. Thank you for the feedback! Maybe, the upgrade to setfit>=1.0.0 is easier than expected. (Link to #55 so that I will not miss this.)