Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -91,16 +91,18 @@ def gradio_interface(pdf_file, query, metric):
|
|
| 91 |
iface = gr.Interface(
|
| 92 |
fn=gradio_interface,
|
| 93 |
inputs=[
|
| 94 |
-
gr.File(label="Upload PDF"),
|
| 95 |
gr.Textbox(label="Query"),
|
| 96 |
-
gr.Radio(choices=["cosine", "euclidean", "manhattan", "dot"], label="Distance Metric")
|
| 97 |
],
|
| 98 |
outputs=gr.Plot(),
|
| 99 |
title="Semantic Search Visualizer",
|
| 100 |
description="""This tool allows you to upload a PDF document, input a query, and visualize the context of the document
|
| 101 |
as it relates to your query. It uses UMAP for dimensionality reduction and highlights the query and its closest contexts
|
| 102 |
within the document based on the selected distance metric. Choose from cosine, Euclidean, Manhattan, or dot product metrics
|
| 103 |
-
to explore different aspects of textual similarity.
|
|
|
|
|
|
|
| 104 |
)
|
| 105 |
|
| 106 |
if __name__ == "__main__":
|
|
|
|
| 91 |
iface = gr.Interface(
|
| 92 |
fn=gradio_interface,
|
| 93 |
inputs=[
|
| 94 |
+
gr.File(label="Upload a PDF"),
|
| 95 |
gr.Textbox(label="Query"),
|
| 96 |
+
gr.Radio(choices=["cosine", "euclidean", "manhattan", "dot"], label="Choose Distance Metric")
|
| 97 |
],
|
| 98 |
outputs=gr.Plot(),
|
| 99 |
title="Semantic Search Visualizer",
|
| 100 |
description="""This tool allows you to upload a PDF document, input a query, and visualize the context of the document
|
| 101 |
as it relates to your query. It uses UMAP for dimensionality reduction and highlights the query and its closest contexts
|
| 102 |
within the document based on the selected distance metric. Choose from cosine, Euclidean, Manhattan, or dot product metrics
|
| 103 |
+
to explore different aspects of textual similarity.
|
| 104 |
+
umap args: n_neighbors=15, min_dist=0.0,
|
| 105 |
+
"""
|
| 106 |
)
|
| 107 |
|
| 108 |
if __name__ == "__main__":
|