Question Answering when context is provided #5761
Answered
by
julian-risch
NeuroinformaticaFBF
asked this question in
Questions
-
Hello I just trained a QA model on my dataset by using Haystack libraries. I saw a lot of tutorial for complex QA pipelines, but I wasn't able to find how to perform this simple task (at least, I assume it's simple). Can someone help, or point some kind of tutorial/guide? Many thanks |
Beta Was this translation helpful? Give feedback.
Answered by
julian-risch
Sep 12, 2023
Replies: 1 comment 3 replies
-
For question answering on a provided context, without retrieval, all you need is a Reader component. from haystack.nodes import FARMReader
reader = FARMReader(
model_name_or_path="deepset/bert-medium-squad2-distilled",
return_no_answer=True,
)
prediction = reader.predict(query="Who lives in Berlin?", documents=docs, top_k=5) |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
NeuroinformaticaFBF
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For question answering on a provided context, without retrieval, all you need is a Reader component.