EricFillion / happy-transformer

Happy Transformer makes it easy to fine-tune and perform inference with NLP Transformer models.
http://happytransformer.com
Apache License 2.0
517 stars 66 forks source link

top_k no longer automatically set to number of targets #251

Closed EricFillion closed 3 years ago

EricFillion commented 3 years ago

In the past, the number of outputs from calling FillMaskPipeline was equal to the number of targets -- even if top_k was set to 1. Now, with one of the latest versions of Hugging Face's Transformers library, the number of outputs is 1, even if there are multiple targets.

We can replicate the old behaviour by setting top_k to None by default, and then if top_k is None only return the top answer. But this is a little messy. So, I think we should just update the documentation to reflect this change.