What is meant by Batch predictions for MNLI tasks
See original GitHub issueHi!
I am making use of the roberta.large.mnli
model for obtaining entailment scores for sentences.
I wanted to ask how exactly does the batch predictions example given in the README works. Specifically, I want to know that if I write the following code:
from fairseq.data.data_utils import collate_tokens
sentences = ['Hello world.', 'Another unrelated sentence.', 'Just another sentence.', 'DFTBA.']
batch = collate_tokens([roberta.encode(sent) for sent in sentences], pad_idx=1)
logprobs = roberta.predict('mnli', batch)
assert logprobs.size() == torch.Size([4, 3])
Then what does each row of the 4 x 3 tensor that is obtained represent? Even if someone could point me to the section of the codebase that could help me understand this, it would be a great help.
Thanks!
Issue Analytics
- State:
- Created 4 years ago
- Comments:11 (11 by maintainers)
Top Results From Across the Web
What is meant by Batch predictions for MNLI tasks · Issue #1167
Hi! I am making use of the roberta.large.mnli model for obtaining entailment scores for sentences. I wanted to ask how exactly does the...
Read more >Online versus batch prediction - AI Platform - Google Cloud
AI Platform Prediction provides two ways to get predictions from trained models: online prediction (sometimes called HTTP prediction), and batch prediction.
Read more >Batch Prediction — Ray 2.2.0
The batch prediction is the process of using a trained model to generate predictions for a collection of observations. It has the following...
Read more >roberta-large-mnli - Hugging Face
Given a premise sentence and a hypothesis sentence, the task is to predict whether the premise entails the hypothesis (entailment), contradicts the hypothesis...
Read more >GLUE: A MULTI-TASK BENCHMARK AND ANALYSIS ...
Each pair is human-annotated with a similarity score from 1 to 5; the task is to predict these scores. Follow common practice, we...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ouput
0 -> contradiction, 1 -> neutral 2 -> entailment
Thank you so much! This clears things up 😄