Skip to content

Commit

Permalink
show paragraph number in source
Browse files Browse the repository at this point in the history
  • Loading branch information
Quantisan committed Sep 26, 2023
1 parent d639ce3 commit 91d9764
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mind_palace/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ def load_index(model):
st.markdown("### Sources")
for i, source_node in enumerate(response.source_nodes):
with st.expander(f"[{i + 1}] {source_node.node.metadata['citation']}"):
st.write(f"relevancy score: {source_node.score}")
if source_node.metadata["paragraph_number"]:
st.write(
f"paragraph number: {source_node.metadata['paragraph_number']}"
)
st.write("original text:")
st.write(source_node.node.get_text().split(":", 1)[1])

0 comments on commit 91d9764

Please sign in to comment.