Create Tut
Browse files
Tut
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from transformers import pipeline
|
2 |
+
|
3 |
+
qa_model = pipeline("question-answering")
|
4 |
+
|
5 |
+
question = "Where is the ball?"
|
6 |
+
context = "The chair is near the table, and the ball is behind the chair."
|
7 |
+
qa_model(question = question, context = context)
|
8 |
+
## {'answer': 'behind the chair', 'end': 61, 'score': 0.8110504746437073,
|
9 |
+
# 'start': 45}
|