from transformers import pipeline | |
qa_model = pipeline("question-answering") | |
question = "Where is the ball?" | |
context = "The chair is near the table, and the ball is behind the chair." | |
qa_model(question = question, context = context) | |
## {'answer': 'behind the chair', 'end': 61, 'score': 0.8110504746437073, | |
# 'start': 45} |