esg / app.py
PKaushik's picture
Update app.py
a542854
raw
history blame contribute delete
441 Bytes
import streamlit as st
from transformers import BertTokenizer, BertForSequenceClassification, pipeline
finbert = BertForSequenceClassification.from_pretrained('yiyanghkust/finbert-esg',num_labels=4)
tokenizer = BertTokenizer.from_pretrained('yiyanghkust/finbert-esg')
nlp = pipeline("text-classification", model=finbert, tokenizer=tokenizer)
text = []
text = st.text_area('enter some text:')
if text:
results = nlp(text)
st.json(results)