Spaces:
Sleeping
Sleeping
Commit
·
51eb727
1
Parent(s):
5bbf0ac
Update app.py
Browse files
app.py
CHANGED
@@ -571,6 +571,7 @@ async def resources_endpoint(profile: MedicalProfile):
|
|
571 |
embeddings_data = load_embeddings ()
|
572 |
folder_path = 'downloaded_articles/downloaded_articles'
|
573 |
initial_results = query_embeddings(query_embedding, embeddings_data, n_results=6)
|
|
|
574 |
file_path = 'finalcleaned_excel_file.xlsx'
|
575 |
df = pd.read_excel(file_path)
|
576 |
file_name_to_url = {f"article_{index}.html": url for index, url in enumerate(df['Unnamed: 0'])}
|
@@ -587,7 +588,6 @@ async def resources_endpoint(profile: MedicalProfile):
|
|
587 |
print(f"Name: {file_name}")
|
588 |
else:
|
589 |
print(f"Name: {file_name}")
|
590 |
-
document_ids = [doc_id for doc_id, _ in initial_results]
|
591 |
document_texts = retrieve_document_texts(document_ids, folder_path)
|
592 |
cross_encoder = models['cross_encoder']
|
593 |
scores = cross_encoder.predict([(query_text, doc) for doc in document_texts])
|
|
|
571 |
embeddings_data = load_embeddings ()
|
572 |
folder_path = 'downloaded_articles/downloaded_articles'
|
573 |
initial_results = query_embeddings(query_embedding, embeddings_data, n_results=6)
|
574 |
+
document_ids = [doc_id for doc_id, _ in initial_results]
|
575 |
file_path = 'finalcleaned_excel_file.xlsx'
|
576 |
df = pd.read_excel(file_path)
|
577 |
file_name_to_url = {f"article_{index}.html": url for index, url in enumerate(df['Unnamed: 0'])}
|
|
|
588 |
print(f"Name: {file_name}")
|
589 |
else:
|
590 |
print(f"Name: {file_name}")
|
|
|
591 |
document_texts = retrieve_document_texts(document_ids, folder_path)
|
592 |
cross_encoder = models['cross_encoder']
|
593 |
scores = cross_encoder.predict([(query_text, doc) for doc in document_texts])
|