File size: 589 Bytes
efa5069
853c4f8
 
efa5069
 
 
 
 
 
8999c02
efa5069
 
 
 
8c3a579
efa5069
853c4f8
efa5069
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import streamlit as st
from transformers import pipeline

qa = pipeline("question-answering" , model="JBDef/finetuned_yelp")
def main():
    st.title("Question Answering")

    with st.form("text_field"):
        question = st.text_input("Enter some question :")
        context = st.text_area("Enter some context :")
        
        # clicked==True only when the button is clicked
        clicked = st.form_submit_button("Submit")
        if clicked:        
          results = qa(question = question, context = context)
          st.json(results)

if __name__ == "__main__":
    main()