IBM / fastfit

FastFit ⚡ When LLMs are Unfit Use FastFit ⚡ Fast and Effective Text Classification with Many Classes
Apache License 2.0
183 stars 13 forks source link

Returning all class probabilities #14

Open nishkalavallabhi opened 6 months ago

nishkalavallabhi commented 6 months ago

Is there a way to return all class probabilities instead of just the most probable class? I tried changing the classifier call by adding return_all_scores=True (e.g., results = classifier("I love this package!", return_all_scores=True)) or using top_k=5 instead (to see top 5 probabilties) in the pipeline object. In both cases, I see an error "ValueError: can only convert an array of size 1 to a Python scalar" .

elronbandel commented 6 months ago

It should work with the top_k argument