|
import streamlit as st |
|
import joblib |
|
|
|
|
|
model = joblib.load('path_to_your_model.pkl') |
|
|
|
|
|
st.title("Sentiment Analysis App using GenAI Models") |
|
|
|
|
|
user_input = st.text_area("Enter text to analyze sentiment:", "") |
|
|
|
|
|
if st.button("Analyze"): |
|
if user_input: |
|
|
|
prediction = model.predict([user_input]) |
|
sentiment = "Positive" if prediction[0] == 1 else "Negative" |
|
st.write(f"**Predicted Sentiment:** {sentiment}") |
|
else: |
|
st.warning("Please enter some text to analyze.") |
|
|
|
|
|
st.write("---") |
|
st.caption("Built with Streamlit and GenAI models.") |
|
|