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'])