PKaushik commited on
Commit
a542854
·
1 Parent(s): 8762464

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
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([text])
9
- st.json(out)
 
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)