Update utils.py
Browse files
utils.py
CHANGED
@@ -44,7 +44,7 @@ def transform_user_question(question, model):
|
|
44 |
|
45 |
|
46 |
def search_document(user_question_embed: list, top_k: int = 1):
|
47 |
-
csv_filename = '
|
48 |
if not os.path.exists(csv_filename):
|
49 |
print("This won't happen!")
|
50 |
return
|
@@ -77,7 +77,7 @@ def search_document(user_question_embed: list, top_k: int = 1):
|
|
77 |
|
78 |
|
79 |
def search_document_annoy(user_question_embed: list, top_k: int, metric):
|
80 |
-
csv_filename = '
|
81 |
if not os.path.exists(csv_filename):
|
82 |
print("This won't happen!")
|
83 |
return
|
@@ -219,7 +219,7 @@ def main():
|
|
219 |
filename_to_embedding_df = get_document_embeddings(path, fn_list)
|
220 |
final_df = pd.concat([final_df, filename_to_embedding_df], axis=0, ignore_index=True)
|
221 |
|
222 |
-
final_df.to_csv('
|
223 |
|
224 |
|
225 |
def parse_downloads_to_title_to_info():
|
|
|
44 |
|
45 |
|
46 |
def search_document(user_question_embed: list, top_k: int = 1):
|
47 |
+
csv_filename = 'document_name_to_embedding.csv'
|
48 |
if not os.path.exists(csv_filename):
|
49 |
print("This won't happen!")
|
50 |
return
|
|
|
77 |
|
78 |
|
79 |
def search_document_annoy(user_question_embed: list, top_k: int, metric):
|
80 |
+
csv_filename = 'document_name_to_embedding.csv'
|
81 |
if not os.path.exists(csv_filename):
|
82 |
print("This won't happen!")
|
83 |
return
|
|
|
219 |
filename_to_embedding_df = get_document_embeddings(path, fn_list)
|
220 |
final_df = pd.concat([final_df, filename_to_embedding_df], axis=0, ignore_index=True)
|
221 |
|
222 |
+
final_df.to_csv('document_name_to_embedding.csv')
|
223 |
|
224 |
|
225 |
def parse_downloads_to_title_to_info():
|