|
import streamlit as st |
|
from transformers import pipeline |
|
|
|
|
|
qa_pipeline = pipeline("question-answering", model="Suhaib-27/my_awesome_qa_model") |
|
|
|
|
|
st.title("Question Answering for Comprehension Passages") |
|
st.write("Enter the passage and the question, and the model will provide the answer.") |
|
|
|
|
|
context = st.text_area("Context", height=200) |
|
question = st.text_input("Question") |
|
|
|
|
|
if context and question: |
|
|
|
result = qa_pipeline(question=question, context=context) |
|
answer = result['answer'] |
|
|
|
st.write("### Answer") |
|
st.write(answer) |
|
|