# Reuse context for more questions in question answering

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Freuse-context-for-more-questions-in-question-answering%2F9614%3E%5C
**Category:** Beginners\
**Created:** [August 30, 2021, 8:49pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Freuse-context-for-more-questions-in-question-answering%2F9614 "2021-08-30T20:49:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ugosweb](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/ugosweb/32/2608_2.png) [@ugosweb](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fugosweb)%5C
**Post date:** [August 30, 2021, 8:49pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Freuse-context-for-more-questions-in-question-answering%2F9614%2F1 "2021-08-30T20:49:30Z")

</div>

I want to reuse the context in my QA system. I want to answer more questions on the same context and I want to avoid to load the context for any answer.  
I’m tying to use the code below. There is a way to reuse the context, i.e. to load the context only once?

```auto
from transformers import pipeline

nlp_qa = pipeline(
    'question-answering',
    model='mrm8488/bert-italian-finedtuned-squadv1-it-alfa',
    tokenizer='mrm8488/bert-italian-finedtuned-squadv1-it-alfa'
)

nlp_qa(
    {
        'question': 'Per quale lingua stai lavorando?',
        'context': 'Manuel Romero è colaborando attivamente con HF / trasformatori per il trader del poder de las últimas ' +
       'técnicas di procesamiento de lenguaje natural al idioma español'
    }
)

```

---

<div class="post-metadata">

**Author:** ![erickrf](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/erickrf/32/239_2.png) [@erickrf](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Ferickrf)%5C
**Post date:** [November 19, 2021, 5:27pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Freuse-context-for-more-questions-in-question-answering%2F9614%2F2 "2021-11-19T17:27:33Z")

</div>

With most implementations, this is not possible. The models combine question and context such that both can attend to each other since the first layer.

There may be some implementation that only performs question/context attention as a last operation but I am not aware of it.
