Spaces:
Runtime error
Runtime error
import streamlit as st | |
from transformers import pipeline | |
st.write(""" | |
# Question Answering System - Squad_V2 | |
A simple QA system that answers questions from the given context. | |
Ask me a question and I'll try to answer it. | |
There are lots of room for imporvements. This is just an initial version. | |
""") | |
que = st.text_input("Ask me a question", '') | |
content = st.text_area("Enter Context", '') | |
if que != "": | |
model_name = "Vasanth/bert-base-uncased-qa-squad2" | |
question_answerer = pipeline("question-answering", model=model_name, tokenizer=model_name) | |
answer = question_answerer( | |
question= que, | |
context= content | |
) | |
st.write(answer["answer"]) | |