Skip to content
This repository has been archived by the owner on Nov 23, 2023. It is now read-only.

Mamutele_Phosa #75

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .streamlit/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[theme]

# Primary accent for interactive elements
primaryColor = '#7792E3'

# Background color for the main content area
backgroundColor = '#273346'

# Background color for sidebar and most interactive widgets
secondaryBackgroundColor = '#B9F1C0'

# Color used for almost all text
textColor = '#FFFFFF'

# Font family for all text in the app, except code blocks
Accepted values (serif | sans serif | monospace)
Default: "Alata"
font = "Alata"
77 changes: 71 additions & 6 deletions edsa_recommender.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,26 +31,72 @@
# Data handling dependencies
import pandas as pd
import numpy as np
import requests
import json
import base64
import joblib,os
import base64


# Custom Libraries
from utils.data_loader import load_movie_titles
from streamlit_lottie import st_lottie
from streamlit_option_menu import option_menu
from recommenders.collaborative_based import collab_model
from recommenders.content_based import content_model

# background-size: cover

# Data Loading
title_list = load_movie_titles('resources/data/movies.csv')

st.set_page_config(page_title="Explo Insight", layout="wide", page_icon=":sparkles:")


def add_bg_from_local(image_file):
with open(image_file, "rb") as image_file:
encoded_string = base64.b64encode(image_file.read())
st.markdown(
f"""
<style>
.stApp {{
background-image: url(data:image/{"png"};base64,{encoded_string.decode()});
background-attachment: fixed;
background-size: cover

}}
</style>
""",
unsafe_allow_html=True
)
def load_lottieurl(url: str):
r = requests.get(url)

if r.status_code != 200:
return None
return r.json()
add_bg_from_local('resources/imgs/the_one_bck.jpg')


load_lottie_home =load_lottieurl ("https://assets3.lottiefiles.com/packages/lf20_khzniaya.json")
# App declaration
def main():

def main():
page_selection = option_menu(
menu_title= "Explo Insight",
options = ["Recommender System","Home","Solution Overview", "fun facts","Contact us"],
icons=["house", "skip-backward", "file-person","book-half", "bar-chart-line-fill"],
menu_icon =":gem:",
orientation = "horizontal"
)
# DO NOT REMOVE the 'Recommender System' option below, however,
# you are welcome to add more options to enrich your app.
page_options = ["Recommender System","Solution Overview"]

#page_options = ["Recommender System","Solution Overview","Home", "fun facts","Contact us "]

# -------------------------------------------------------------------
# ----------- !! THIS CODE MUST NOT BE ALTERED !! -------------------
# -------------------------------------------------------------------
page_selection = st.sidebar.selectbox("Choose Option", page_options)
#page_selection = st.sidebar.selectbox("Choose Option", page_options)
if page_selection == "Recommender System":
# Header contents
st.write('# Movie Recommender Engine')
Expand Down Expand Up @@ -103,9 +149,28 @@ def main():
if page_selection == "Solution Overview":
st.title("Solution Overview")
st.write("Describe your winning approach on this page")


if page_selection == "Home":
st_lottie(load_lottie_home, speed=1, loop=True, quality="high", width=750, reverse=True)

if page_selection == "Contact us":
st.header("Contact us:")
cont = st.radio("Select how you wan to contact us", ("Leave us a message", "Get in touch with us", "Visit our offices"))
if cont == "Leave us a message":
st.info("Name")
st.text_area("Please enter your Nme")
st.info("Contact information")
st.text_area("Please let us know how we can contact you (Email or Cellphone number)")
st.info("Message ")
st.text_area("Please leave your message")
send = st.button("Submit")

if cont == "Get in touch with us":
st.info("Comming to attend to you")
if cont == "Come to our offices":
st.info("Comming to attend to you as well")
# You may want to add more sections here for aspects such as an EDA,
# or to provide your business pitch.
# or to provide your business pitc.


if __name__ == '__main__':
Expand Down
11 changes: 11 additions & 0 deletions funtions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

# Data dependencies
import pandas as pd



# Load your raw data
df = pd.read_csv('resources/data/movies.csv')

#df= df[df.title.duplicated(keep=false)]
print (df.descibe())
Binary file added resources/imgs/img_bck1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/imgs/movie-background-collage_23.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/imgs/movie-background-collage_3.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/imgs/new_background.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/imgs/the_one_bck.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.