import streamlit as st | |
from app_models.rubert_MODEL import classify_text | |
from app_models.bag_of_words_MODEL import predict | |
from app_models.lstm_MODEL import predict_review | |
class_prefix = 'This review is likely...' | |
def run(): | |
st.title("Movie Review Classification") | |
st.write("This page will compare three models: Bag of Words/TF-IDF, LSTM, and BERT.") | |
# Example placeholder for user input | |
user_input = st.text_area("") | |
if st.button('Classify with All Models'): | |
# Bag of Words/TF-IDF prediction | |
bow_tfidf_result = predict(user_input) | |
st.write(f'{class_prefix} {bow_tfidf_result} according to Bag of Words/TF-IDF.') | |
# LSTM prediction | |
lstm_result = predict_review(user_input) | |
st.write(f'{class_prefix} {lstm_result} according to LSTM.') | |
# ruBERT prediction | |
rubert_result = classify_text(user_input) | |
st.write(f'{class_prefix} {rubert_result} according to ruBERT.') | |
# Placeholder buttons for model selection | |
# if st.button('Classify with BoW/TF-IDF'): | |
# st.write(f'{class_prefix}{predict(user_input)}') | |
# if st.button('Classify with LSTM'): | |
# st.write(f'{class_prefix}{predict_review(user_input)}') | |
# if st.button('Classify with ruBERT'): | |
# st.write(f'{class_prefix}{classify_text(user_input)}') |