File size: 1,350 Bytes
a15e210 6b79bf9 a15e210 6b79bf9 |
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 28 29 30 31 32 33 34 35 |
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)}') |