Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,20 +1,9 @@
|
|
1 |
import streamlit as st
|
2 |
from transformers import pipeline
|
3 |
|
4 |
-
|
5 |
-
|
6 |
-
model = pipeline("question-answering")
|
7 |
-
return model
|
8 |
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
question = st.text_input("Questions from this article?")
|
13 |
-
button = st.button("Get me Answers")
|
14 |
-
max = st.sidebar.slider('Select max', 50, 500, step=10, value=150)
|
15 |
-
min = st.sidebar.slider('Select min', 10, 450, step=10, value=50)
|
16 |
-
do_sample = st.sidebar.checkbox("Do sample", value=False)
|
17 |
-
with st.spinner("Discovering Answers.."):
|
18 |
-
if button and sentence:
|
19 |
-
answers = qa(question=question, context=sentence)
|
20 |
-
st.write(answers['answer'])
|
|
|
1 |
import streamlit as st
|
2 |
from transformers import pipeline
|
3 |
|
4 |
+
pipe = pipeline("sentiment-analysis")
|
5 |
+
text = st.text_area('enter some text')
|
|
|
|
|
6 |
|
7 |
+
if text:
|
8 |
+
out = pipe(text)
|
9 |
+
st.json(out)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|