Update app.py
Browse files
app.py
CHANGED
@@ -1,18 +1,16 @@
|
|
1 |
import streamlit as st
|
2 |
from transformers import pipeline
|
3 |
-
from PIL import Image
|
4 |
|
5 |
-
classifier = pipeline("
|
6 |
def main():
|
7 |
st.title("text-classification")
|
8 |
|
9 |
with st.form("text_field"):
|
10 |
-
text = st.
|
11 |
# clicked==True only when the button is clicked
|
12 |
clicked = st.form_submit_button("Submit")
|
13 |
if clicked:
|
14 |
-
|
15 |
-
results = classifier([img])
|
16 |
st.json(results)
|
17 |
|
18 |
if __name__ == "__main__":
|
|
|
1 |
import streamlit as st
|
2 |
from transformers import pipeline
|
|
|
3 |
|
4 |
+
classifier = pipeline("text-classification", model="distilbert-base-uncased-finetuned-sst-2-english")
|
5 |
def main():
|
6 |
st.title("text-classification")
|
7 |
|
8 |
with st.form("text_field"):
|
9 |
+
text = st.text_area('enter some text:')
|
10 |
# clicked==True only when the button is clicked
|
11 |
clicked = st.form_submit_button("Submit")
|
12 |
if clicked:
|
13 |
+
results = classifier([text])
|
|
|
14 |
st.json(results)
|
15 |
|
16 |
if __name__ == "__main__":
|