Update app.py
Browse files
app.py
CHANGED
@@ -1,8 +1,12 @@
|
|
1 |
import streamlit as st
|
2 |
-
from transformers import
|
3 |
|
4 |
-
|
5 |
-
|
|
|
|
|
|
|
|
|
6 |
|
7 |
if text:
|
8 |
out = pipe(text)
|
|
|
1 |
import streamlit as st
|
2 |
+
from transformers import AutoTokenizer, AutoModelForSequenceClassification, Trainer
|
3 |
|
4 |
+
model_name = "mrm8488/distilroberta-finetuned-financial-news-sentiment-analysis"
|
5 |
+
model = AutoModelForSequenceClassification.from_pretrained(model_name)
|
6 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
7 |
+
|
8 |
+
pipe = TextClassificationPipeline(model=model, tokenizer=tokenizer, return_all_scores=True)
|
9 |
+
text = st.text_area(f'Ciao! This app uses {model_name}. Enter your text to test it ❤️')
|
10 |
|
11 |
if text:
|
12 |
out = pipe(text)
|