Update app.py
Browse files
app.py
CHANGED
|
@@ -1,21 +1,31 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
from logic2 import *
|
|
|
|
| 3 |
|
| 4 |
st.title('PyG - Movie Recommendation')
|
| 5 |
st.image('Image_graph.png', caption='Bi-Partite Graph')
|
| 6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
|
| 8 |
# load Hgraph
|
|
|
|
| 9 |
data = load_hetero_data()
|
| 10 |
|
| 11 |
# Load Model
|
|
|
|
| 12 |
model = load_model(data)
|
| 13 |
|
|
|
|
|
|
|
| 14 |
|
|
|
|
|
|
|
| 15 |
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
|
| 20 |
|
| 21 |
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
from logic2 import *
|
| 3 |
+
import streamlit.components.v1 as components
|
| 4 |
|
| 5 |
st.title('PyG - Movie Recommendation')
|
| 6 |
st.image('Image_graph.png', caption='Bi-Partite Graph')
|
| 7 |
+
|
| 8 |
+
st.write('Scatter Plot of embeddings')
|
| 9 |
+
|
| 10 |
+
HtmlFile = open("plot.html", 'r', encoding='utf-8')
|
| 11 |
+
source_code = HtmlFile.read()
|
| 12 |
+
components.html(source_code)
|
| 13 |
|
| 14 |
# load Hgraph
|
| 15 |
+
st.write('Loading Data')
|
| 16 |
data = load_hetero_data()
|
| 17 |
|
| 18 |
# Load Model
|
| 19 |
+
st.write('Loading Model')
|
| 20 |
model = load_model(data)
|
| 21 |
|
| 22 |
+
#get user_id
|
| 23 |
+
user_id = st.number_input('Give User-Id')
|
| 24 |
|
| 25 |
+
# get recommendation
|
| 26 |
+
ans = get_recommendation(model,data,user_id)
|
| 27 |
|
| 28 |
+
st.write(ans)
|
|
|
|
|
|
|
| 29 |
|
| 30 |
|
| 31 |
|