pieces of context to answer the question at the end. If you don't know the answer, just say that you don't know, don't try to make up an answer.In addition to giving an answer, also return a score of how fully it answered the user's question. This should be in the following format:Question: [question here]Helpful Answer In Italian: [answer here]Score: [score between 0 and 100]Begin!Context:---------{context}---------Question: {question}Helpful Answer In Italian:"""PROMPT = PromptTemplate(    template=prompt_template,    input_variables=["context", "question"],    output_parser=output_parser,)chain = load_qa_chain(OpenAI(temperature=0), chain_type="map_rerank", return_intermediate_steps=True, prompt=PROMPT)query = "What did the president say about Justice Breyer"chain({"input_documents": docs, "question": query}, return_only_outputs=True)    {'intermediate_steps': [{'answer': ' Il presidente ha detto che Justice Breyer ha dedicato la sua vita a servire questo paese.',       'score': '100'},      {'answer': ' Il presidente non ha detto nulla sulla Giustizia Breyer.',       'score': '100'},      {'answer': ' Non so.', 'score': '0'},      {'answer': ' Non so.', 'score': '0'}],     'output_text': ' Il presidente ha detto che Justice Breyer ha dedicato la sua vita a servire questo paese.'}Document QA with sources‚ÄãWe can also perform document QA and return the sources that were used to answer the question. To do this we'll just need to make sure each document has a "source" key in the metadata, and we'll use the load_qa_with_sources helper to construct our chain:docsearch = Chroma.from_texts(texts, embeddings, metadatas=[{"source": str(i)} for i in range(len(texts))])query = "What did the president say about Justice Breyer"docs = docsearch.similarity_search(query)from langchain.chains.qa_with_sources import load_qa_with_sources_chainchain = load_qa_with_sources_chain(OpenAI(temperature=0), chain_type="stuff")query = "What did the president say about Justice
Here we walk through how to use LangChain for question answering over a list of documents. Under the hood we'll be using our Document chains.
Here we walk through how to use LangChain for question answering over a list of documents. Under the hood we'll be using our Document chains. ->: pieces of context to answer the question at the end. If you don't know the answer, just say that you don't know, don't try to make up an answer.In addition to giving an answer, also return a score of how fully it answered the user's question. This should be in the following format:Question: [question here]Helpful Answer In Italian: [answer here]Score: [score between 0 and 100]Begin!Context:---------{context}---------Question: {question}Helpful Answer In Italian:"""PROMPT = PromptTemplate(    template=prompt_template,    input_variables=["context", "question"],    output_parser=output_parser,)chain = load_qa_chain(OpenAI(temperature=0), chain_type="map_rerank", return_intermediate_steps=True, prompt=PROMPT)query = "What did the president say about Justice Breyer"chain({"input_documents": docs, "question": query}, return_only_outputs=True)    {'intermediate_steps': [{'answer': ' Il presidente ha detto che Justice Breyer ha dedicato la sua vita a servire questo paese.',       'score': '100'},      {'answer': ' Il presidente non ha detto nulla sulla Giustizia Breyer.',       'score': '100'},      {'answer': ' Non so.', 'score': '0'},      {'answer': ' Non so.', 'score': '0'}],     'output_text': ' Il presidente ha detto che Justice Breyer ha dedicato la sua vita a servire questo paese.'}Document QA with sources‚ÄãWe can also perform document QA and return the sources that were used to answer the question. To do this we'll just need to make sure each document has a "source" key in the metadata, and we'll use the load_qa_with_sources helper to construct our chain:docsearch = Chroma.from_texts(texts, embeddings, metadatas=[{"source": str(i)} for i in range(len(texts))])query = "What did the president say about Justice Breyer"docs = docsearch.similarity_search(query)from langchain.chains.qa_with_sources import load_qa_with_sources_chainchain = load_qa_with_sources_chain(OpenAI(temperature=0), chain_type="stuff")query = "What did the president say about Justice