Update app.py
Browse files
app.py
CHANGED
@@ -3,7 +3,8 @@ from transformers import BertTokenizer, BertForSequenceClassification, pipeline
|
|
3 |
finbert = BertForSequenceClassification.from_pretrained('yiyanghkust/finbert-esg',num_labels=4)
|
4 |
tokenizer = BertTokenizer.from_pretrained('yiyanghkust/finbert-esg')
|
5 |
nlp = pipeline("text-classification", model=finbert, tokenizer=tokenizer)
|
|
|
6 |
text = st.text_area('enter some text:')
|
7 |
if text:
|
8 |
-
results = nlp(
|
9 |
-
st.json(
|
|
|
3 |
finbert = BertForSequenceClassification.from_pretrained('yiyanghkust/finbert-esg',num_labels=4)
|
4 |
tokenizer = BertTokenizer.from_pretrained('yiyanghkust/finbert-esg')
|
5 |
nlp = pipeline("text-classification", model=finbert, tokenizer=tokenizer)
|
6 |
+
text = []
|
7 |
text = st.text_area('enter some text:')
|
8 |
if text:
|
9 |
+
results = nlp(text)
|
10 |
+
st.json(results)
|