# Question Answering Prediction without answear

**URL:** <https://discuss.huggingface.co/t/question-answering-prediction-without-answear/28661>\
**Category:** Intermediate\
**Created:** [December 31, 2022, 12:37am UTC](https://discuss.huggingface.co/t/question-answering-prediction-without-answear/28661 "2022-12-31T00:37:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lfcc](https://avatars.discourse-cdn.com/v4/letter/l/b5e925/32.png) [@lfcc](https://discuss.huggingface.co/u/lfcc)\
**Post date:** [December 31, 2022, 12:37am UTC](https://discuss.huggingface.co/t/question-answering-prediction-without-answear/28661/1 "2022-12-31T00:37:14Z")

</div>

Hello,  
I have fine tuned BERT on QA with SQuAd\_v2 and was able to achieve the following results:

```auto
{'exact': 75.76715597879051,
 'f1': 86.10779795627346,
 'total': 130319,
 'HasAns_exact': 66.280047453957,
 'HasAns_f1': 81.80143193308851,
 'HasAns_total': 86821,
 'NoAns_exact': 94.70320474504575,
 'NoAns_f1': 94.70320474504575,
 'NoAns_total': 43498,
 'best_exact': 75.77176006568497,
 'best_exact_thresh': 0.0,
 'best_f1': 86.11240204317286,
 'best_f1_thresh': 0.0}

```

As we can see, the model was able to obtain 94.7% F1-score on NoAns questions, however, when I use this model for inference with the pipeline API, it never predicts a NoAnswer question correctly, (always outpus some random answer even if there is no possible correct answer in the given context).

I think the pipeline api is not prepared to handle noAnswer questions (could be wrong).  
How can I use my model for inference in a way it is able to predict that the question has not answer given a certain context? Thank you in advance
