|
import streamlit as st |
|
import pandas as pd |
|
import pickle |
|
|
|
|
|
|
|
import sys |
|
import os |
|
sys.path.append(os.path.abspath("src")) |
|
|
|
from recommendationSystem.chatbot.client_module.utils import chatbot |
|
|
|
|
|
os.environ["HF_HOME"] = "/tmp/huggingface" |
|
os.environ["TRANSFORMERS_CACHE"] = "/tmp/transformers" |
|
os.environ["SENTENCE_TRANSFORMERS_HOME"] = "/tmp/sentence-transformers" |
|
|
|
chatbot() |
|
|
|
|
|
|
|
|
|
from utils import fetch_transformed_data, anime_info |
|
|
|
st.title("Anime Recommender System") |
|
|
|
data_path, matrix_path = fetch_transformed_data() |
|
|
|
anime_data = pd.read_csv(data_path) |
|
similarity_matrix = pickle.load(open(file=matrix_path,mode='rb')) |
|
|
|
select_anime_name = st.selectbox( |
|
"Choose Anime Name : ", |
|
anime_data['title'].values, |
|
index=None, |
|
placeholder="Select the anime for recommendation..." |
|
) |
|
|
|
anime_info(anime_name=select_anime_name,anime_data=anime_data,similarity_matrix=similarity_matrix) |
|
|