Hey everyone!
I have two task: first training a binary classifier and second is a QA task.
My classification model looks like this
class XLMRobertaBaseClassifier(nn.Module):
def __init__(self):
super(XLMRobertaBaseClassifier, self).__init__()
self.base_model = AutoModel.from_pretrained('sismetanin/xlm_roberta_base-ru-sentiment-rusentiment')
self.Linear = nn.Linear(768, 2)
def forward(self, input_ids, token_type_ids, attention_mask):
outputs = self.base_model(input_ids, token_type_ids=token_type_ids, attention_mask=attention_mask).pooler_output
outputs = self.Linear(outputs)
return outputs
and it outputs class probabilities. My question is: how I turn it to a QA model?