File size: 1,129 Bytes
ac5da21 895197b ac5da21 895197b f632a6f 9c57485 895197b 43337aa 895197b 9c57485 e3ed455 f632a6f e3ed455 f632a6f |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
import streamlit as st
from transformers import AutoTokenizer, AutoModelForSequenceClassification
from home import render_home
from scipy.special import softmax
# Load the TinyBERT model and tokenizer
model_path = "petermutwiri/Tiny_Bert_Cupstone"
model = AutoModelForSequenceClassification.from_pretrained(model_path)
tokenizer = AutoTokenizer.from_pretrained(model_path)
# Create a sidebar for navigation and review examples
st.sidebar.title("Navigation and review examples")
# Use the selected page function to display the content
page = st.sidebar.radio("Go to", ["Home"])
if page == "Home":
render_home(model, tokenizer)
# An example for a positive movie review
st.sidebar.markdown("π **Positive Review Example:**")
st.sidebar.markdown("> I absolutely loved this movie! It was so thrilling and captivating. The acting was superb, and the plot was fantastic.")
# An example for a negative movie review
st.sidebar.markdown("π **Negative Review Example:**")
st.sidebar.markdown("> This movie was a complete disappointment. The story was boring, and the acting was terrible. I wouldn't recommend it to anyone.")
|