File size: 858 Bytes
5507d79
fa01a43
0dc3ba4
fa01a43
 
 
0dc3ba4
 
 
 
 
d5a051d
fa01a43
 
d5a051d
0dc3ba4
fa01a43
 
 
0dc3ba4
fa01a43
 
0dc3ba4
266f4a1
 
fa01a43
a3eccab
 
21f0f11
 
 
 
fa01a43
a3eccab
0dc3ba4
fa01a43
 
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
36
37
38
import streamlit as st
from logic2 import *
import streamlit.components.v1 as components

st.title('PyG - Movie Recommendation')
st.image('Image_graph.png', caption='Bi-Partite Graph')

st.write('Scatter Plot of embeddings')

HtmlFile = open("plot.html", 'r', encoding='utf-8')
source_code = HtmlFile.read() 
components.html(source_code, width=500, height=500)

# load Hgraph
global data
st.write('Loading Data')
data = load_hetero_data()

# Load Model
st.write('Loading Model')
model = load_model(data)

#get user_id
user_id = st.number_input('Give User-Id')
user_id = int(round(user_id))

# get recommendation and graph

make_1_hop_graph(data,user_id)
HtmlFile1 = open('index.html', 'r', encoding='utf-8')
source_code1 = HtmlFile1.read() 
components.html(source_code1, height=1200, width=1000)

ans = get_recommendation(model,data,user_id)
st.write(ans)