flair icon indicating copy to clipboard operation
flair copied to clipboard

[Question]: tarsclassifier prediction is very slow for more then 100 classes

Open sainiudit opened this issue 1 year ago • 2 comments

Question

I am using tarsclassifier and fine tuned it for 100+ classes, prediction is taking forever to run any work around for this

sainiudit avatar Jun 30 '24 17:06 sainiudit

Hello @sainiudit, unfortunately TARS is slow in scenarios with many classes. The reason is that TARS makes an independent forward pass through the model for each class. So if you have 100 classes, each sentence requires 100 forward passes through the model in order to predict.

We worked together with a team at Bayer to scale TARS up to 80,000 classes. This is not integrated into Flair, but there is code and a paper available:

  • Paper: https://arxiv.org/abs/2206.02662
  • Code: https://github.com/Bayer-Group/xtars-naacl2022

alanakbik avatar Jun 30 '24 19:06 alanakbik

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Apr 26 '25 04:04 stale[bot]