|
|
|
|
|
import streamlit as st |
|
|
|
import sys |
|
import os |
|
root_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) |
|
sys.path.append(root_dir) |
|
from src.models.plot_similarity_finder import plot_simil |
|
|
|
|
|
|
|
st.title('Film Recommender') |
|
st.subheader("Write a plot and I'll look for films with similar ideas.") |
|
|
|
|
|
user_plot = st.text_area("Write your plot here...") |
|
|
|
|
|
|
|
|
|
if st.button('Search'): |
|
with st.spinner('Reading the plot...'): |
|
|
|
result = plot_simil(user_plot) |
|
|
|
|
|
st.markdown(f'{str.capitalize(result[0][1])}, {result[0][0]}') |
|
st.markdown(f'{str.capitalize(result[1][1])}, {result[1][0]}') |
|
st.markdown(f'{str.capitalize(result[2][1])}, {result[2][0]}') |
|
st.markdown(f'{str.capitalize(result[3][1])}, {result[3][0]}') |
|
st.markdown(f'{str.capitalize(result[4][1])}, {result[4][0]}') |
|
|