Update app.py
Browse files
app.py
CHANGED
@@ -15,7 +15,7 @@ if(input_text == "PDF"):
|
|
15 |
st.subheader("PDF")
|
16 |
with st.form("PDF_form"):
|
17 |
uploaded_file = st.file_uploader('Choose your .pdf file', type="pdf")
|
18 |
-
KG_name = st.text_input("
|
19 |
sub = st.form_submit_button("Submit")
|
20 |
if sub:
|
21 |
save_uploadedfile(uploaded_file)
|
@@ -25,7 +25,7 @@ elif(input_text == "Links"):
|
|
25 |
st.subheader("LINKS")
|
26 |
with st.form("links_form"):
|
27 |
text = st.text_input("Input Links Seperated by ','")
|
28 |
-
KG_name = st.text_input("
|
29 |
submitted = st.form_submit_button("Submit")
|
30 |
if submitted:
|
31 |
links = text.split(",")
|
@@ -33,7 +33,7 @@ elif(input_text == "Links"):
|
|
33 |
|
34 |
elif(input_text == "No_Input(Already Created)"):
|
35 |
st.subheader("NO INPUT")
|
36 |
-
KG_name = st.text_input("
|
37 |
if(os.path.exists(KG_name)):
|
38 |
index = load_index(token, KG_name, base_url)
|
39 |
else:
|
@@ -44,7 +44,14 @@ if (index != None):
|
|
44 |
get_network_graph(index)
|
45 |
emb = get_embeddings(index)
|
46 |
fig = get_visualize_embeddings(emb)
|
47 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
# Plotly Chart
|
49 |
st.plotly_chart(fig, use_container_width=True)
|
50 |
|
|
|
15 |
st.subheader("PDF")
|
16 |
with st.form("PDF_form"):
|
17 |
uploaded_file = st.file_uploader('Choose your .pdf file', type="pdf")
|
18 |
+
KG_name = st.text_input("KG name")
|
19 |
sub = st.form_submit_button("Submit")
|
20 |
if sub:
|
21 |
save_uploadedfile(uploaded_file)
|
|
|
25 |
st.subheader("LINKS")
|
26 |
with st.form("links_form"):
|
27 |
text = st.text_input("Input Links Seperated by ','")
|
28 |
+
KG_name = st.text_input("KG name")
|
29 |
submitted = st.form_submit_button("Submit")
|
30 |
if submitted:
|
31 |
links = text.split(",")
|
|
|
33 |
|
34 |
elif(input_text == "No_Input(Already Created)"):
|
35 |
st.subheader("NO INPUT")
|
36 |
+
KG_name = st.text_input(" KG name")
|
37 |
if(os.path.exists(KG_name)):
|
38 |
index = load_index(token, KG_name, base_url)
|
39 |
else:
|
|
|
44 |
get_network_graph(index)
|
45 |
emb = get_embeddings(index)
|
46 |
fig = get_visualize_embeddings(emb)
|
47 |
+
|
48 |
+
rdf_graph = generate_rdf(index)
|
49 |
+
|
50 |
+
# Visualize RDF structure
|
51 |
+
rdf_visualization = visualize_rdf(rdf_graph)
|
52 |
+
st.subheader("RDF Visualization")
|
53 |
+
st.text(rdf_visualization)
|
54 |
+
|
55 |
# Plotly Chart
|
56 |
st.plotly_chart(fig, use_container_width=True)
|
57 |
|