Spaces:
Sleeping
Sleeping
Commit
·
0144081
1
Parent(s):
a040e14
require
Browse files- app.py +12 -0
- requirements.txt +6 -0
app.py
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
from transformers import pipeline
|
3 |
+
|
4 |
+
# Load trained model
|
5 |
+
classifier = pipeline("text-classification", model="./models")
|
6 |
+
|
7 |
+
st.title("Sentiment Analysis with DistilBERT")
|
8 |
+
text = st.text_area("Enter a text")
|
9 |
+
|
10 |
+
if st.button("Predict"):
|
11 |
+
result = classifier(text)
|
12 |
+
st.write(result)
|
requirements.txt
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
transformers
|
2 |
+
datasets
|
3 |
+
torch
|
4 |
+
scikit-learn
|
5 |
+
streamlit
|
6 |
+
huggingface_hub
|