|
import streamlit as st |
|
from transformers import pipeline |
|
|
|
pipe1 = pipeline("text-classification", model="Emma0123/fine_tuned_model") |
|
pipe2 = pipeline("text-classification", model="jonas/roberta-base-finetuned-sdg") |
|
|
|
st.title("ESG with HuggingFace Spaces") |
|
st.write("Enter a sentence to analyze its ESG") |
|
input_text =st.text_input("") |
|
|
|
|
|
result1 = pipe1(input_text) |
|
|
|
|
|
if result1[0]['label'] == 'environmental': |
|
result2 = pipe2(input_text) |
|
st.write(result2) |
|
else: |
|
|
|
st.write("This content is unrelated to Environment.") |
|
|