Spaces:
Running
Running
Deepak Sahu
commited on
Commit
·
16929de
1
Parent(s):
acffe44
Update app.py
Browse files
app.py
CHANGED
@@ -19,9 +19,10 @@ from z_utils import get_dataframe
|
|
19 |
books_df = get_dataframe(CLEAN_DF_UNIQUE_TITLES)
|
20 |
|
21 |
|
22 |
-
def get_recommendation(book_title: str) ->
|
23 |
fake_summaries = generate_summaries(book_title=book_title, n_samples=5) # other parameters are set to default in the function
|
24 |
|
|
|
25 |
# Compute Simialrity
|
26 |
similarity, ranks = computes_similarity_w_hypothetical(hypothetical_summaries=fake_summaries)
|
27 |
|
@@ -56,7 +57,8 @@ def get_recommendation(book_title: str) -> dict:
|
|
56 |
|
57 |
# We instantiate the Textbox class
|
58 |
textbox = gr.Textbox(label="Write random title", placeholder="The Man who knew", lines=2)
|
59 |
-
output = [gr.Label(label="Similarity"), gr.HTML(label="Books Descriptions")]
|
|
|
60 |
demo = gr.Interface(fn=get_recommendation, inputs=textbox, outputs=output)
|
61 |
|
62 |
-
demo.launch()
|
|
|
19 |
books_df = get_dataframe(CLEAN_DF_UNIQUE_TITLES)
|
20 |
|
21 |
|
22 |
+
def get_recommendation(book_title: str) -> str:
|
23 |
fake_summaries = generate_summaries(book_title=book_title, n_samples=5) # other parameters are set to default in the function
|
24 |
|
25 |
+
return fake_summaries[0]
|
26 |
# Compute Simialrity
|
27 |
similarity, ranks = computes_similarity_w_hypothetical(hypothetical_summaries=fake_summaries)
|
28 |
|
|
|
57 |
|
58 |
# We instantiate the Textbox class
|
59 |
textbox = gr.Textbox(label="Write random title", placeholder="The Man who knew", lines=2)
|
60 |
+
# output = [gr.Label(label="Similarity"), gr.HTML(label="Books Descriptions")]
|
61 |
+
output = gr.Textbox(label="something")
|
62 |
demo = gr.Interface(fn=get_recommendation, inputs=textbox, outputs=output)
|
63 |
|
64 |
+
demo.launch(debug=True)
|