Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
from transformers import pipeline
|
| 3 |
+
|
| 4 |
+
st.title('Question Answering')
|
| 5 |
+
model_checkpoint = 'Diezu/dieumrc'
|
| 6 |
+
question_answerer = pipeline("question-answering", model=model_checkpoint)
|
| 7 |
+
|
| 8 |
+
context = st.text_area('CONTEXT')
|
| 9 |
+
question = st.text_input('QUESTION')
|
| 10 |
+
|
| 11 |
+
if st.button('ANSWER'):
|
| 12 |
+
i=question_answerer(question,context)
|
| 13 |
+
#st.write(i['answer'])
|
| 14 |
+
st.markdown(i['answer'])
|
| 15 |
+
#st.write('<h1 style="font-size: 50px;">i['answer']</h1>')
|