Spaces:
Sleeping
Sleeping
Nikhitha2310
commited on
Commit
•
1671cbc
1
Parent(s):
8ebee5d
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
import transformers
|
3 |
+
from transformers import pipeline
|
4 |
+
text=st.text_input("Enter your text")
|
5 |
+
question=st.text_input("Enter your question")
|
6 |
+
btn=st.button("Ask")
|
7 |
+
|
8 |
+
pipe = pipeline("question-answering", model="csarron/bert-base-uncased-squad-v1",tokenizer= "csarron/bert-base-uncased-squad-v1")
|
9 |
+
|
10 |
+
if(text and question and btn):
|
11 |
+
output=pipe({'context': text, 'question': question})
|
12 |
+
st.write(output['answer'])
|