Create QA_Pipeline
Browse files- QA_Pipeline +6 -0
QA_Pipeline
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from transformers import pipeline
|
2 |
+
|
3 |
+
qa = pipeline("question-answering")
|
4 |
+
|
5 |
+
def question_answering_pipeline(question, context):
|
6 |
+
return qa(question, context)["answer"]
|