Nikhitha2310's picture
Create app.py
1671cbc verified
raw
history blame contribute delete
432 Bytes
import streamlit as st
import transformers
from transformers import pipeline
text=st.text_input("Enter your text")
question=st.text_input("Enter your question")
btn=st.button("Ask")
pipe = pipeline("question-answering", model="csarron/bert-base-uncased-squad-v1",tokenizer= "csarron/bert-base-uncased-squad-v1")
if(text and question and btn):
output=pipe({'context': text, 'question': question})
st.write(output['answer'])