File size: 554 Bytes
170350e
 
 
 
 
 
 
 
 
 
11014e0
170350e
 
 
11014e0
44df7ce
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import streamlit as st
from transformers import pipeline

# Load the custom model and tokenizer
pipe = pipeline("sentiment-analysis", model="rickxzo/review-sentiment-analysis", tokenizer="rickxzo/review-sentiment-analysis")

# Streamlit UI
st.title("Sentiment Analysis with Transformer Model")
text = st.text_area("Enter some text:")


# Perform sentiment analysis when text is provided
if text:
    out = pipe(text)
    st.json(out)
    st.write("### Label Definitions:")
    st.write("- **LABEL_2** : Positive")
    st.write("- **LABEL_1** : Negative")