rickxzo commited on
Commit
170350e
·
verified ·
1 Parent(s): 30ad80d

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -0
app.py ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ from transformers import pipeline
3
+
4
+ # Load the custom model and tokenizer
5
+ pipe = pipeline("sentiment-analysis", model="rickxzo/review-sentiment-analysis", tokenizer="rickxzo/review-sentiment-analysis")
6
+
7
+ # Streamlit UI
8
+ st.title("Sentiment Analysis with Transformer Model")
9
+ text = st.text_area("Enter some text:")
10
+
11
+ # Perform sentiment analysis when text is provided
12
+ if text:
13
+ out = pipe(text)
14
+ st.json(out)