# How do I transform a sequence classification model into a question answering model?

**URL:** <https://discuss.huggingface.co/t/how-do-i-transform-a-sequence-classification-model-into-a-question-answering-model/9392>\
**Category:** 🤗Transformers\
**Created:** [August 21, 2021, 12:25pm UTC](https://discuss.huggingface.co/t/how-do-i-transform-a-sequence-classification-model-into-a-question-answering-model/9392 "2021-08-21T12:25:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![leffff](https://avatars.discourse-cdn.com/v4/letter/l/e79b87/32.png) [@leffff](https://discuss.huggingface.co/u/leffff)\
**Post date:** [August 21, 2021, 12:25pm UTC](https://discuss.huggingface.co/t/how-do-i-transform-a-sequence-classification-model-into-a-question-answering-model/9392/1 "2021-08-21T12:25:18Z")

</div>

Hey everyone!  
I have two task: first training a binary classifier and second is a QA task.  
My classification model looks like this

```auto
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?
