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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Extract Predictions from Trainer #5547

Closed
geblanco opened this issue Jul 6, 2020 · 6 comments
Closed

[Feature Request] Extract Predictions from Trainer #5547

geblanco opened this issue Jul 6, 2020 · 6 comments
Labels

Comments

@geblanco
Copy link

geblanco commented Jul 6, 2020

馃殌 Feature request

Add the possibility to return predictions along with its example id in the new Trainer class.

Motivation

When working with extractive QA (i.e.: SQuAD), you get back the best predictions, but, the current example for running squad uses the old, plain training/eval script, without the new Trainer class.

Additionally, there are other tasks where predictions can be extremely useful (i.e.: Multiple Choice).

Adding such functionality in the Trainer class could solve this and unify both question answering and multiple choice examples.

Your contribution

I am familiarized with the code (both the Trainer class and the old train/eval script), so I could submit a PR with the new functionality.

@geblanco geblanco changed the title Predictions from Trainer [Feature Request] Extract Predictions from Trainer Jul 7, 2020
@julien-c
Copy link
Member

julien-c commented Jul 7, 2020

Unless I'm mistaken, Question-answering does support Trainer. Is a specific feature missing for your use case?

@geblanco
Copy link
Author

geblanco commented Jul 8, 2020

Hi @julien-c!

At the time of writing the PR was not merged yet (and I was not aware of it, my bad). It is great!

In any case, the previous example (the one without trainer) outputted both predictions and nbest_predictions, which are crucial for error analysis.

The new example with trainer looses this ability (because the new dataset/trainer API does not support it). Adding this feature could benefit not only SQuAD, but other datasets too (i.e.: RACE).

What do you think on this regard?

@stale
Copy link

stale bot commented Sep 6, 2020

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 stale bot added the wontfix label Sep 6, 2020
@dianags
Copy link

dianags commented Sep 12, 2020

Any updates on this matter? I recently started using transformers and running the multiple-choice example I realized there's an output of the overall accuracy but I can't find the predictions. Currently going through the code to obtain them...

@stale stale bot removed the wontfix label Sep 12, 2020
@geblanco
Copy link
Author

Hi @dianags,

Might be a little late, but tired of waiting, I programmed my own solution that output predictions and some more data, the code can be found here

Best,

@stale
Copy link

stale bot commented Nov 29, 2020

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 stale bot added the wontfix label Nov 29, 2020
@stale stale bot closed this as completed Dec 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants