Spaces:
Sleeping
Sleeping
Commit
·
87cc4d3
1
Parent(s):
d2ec6cb
Change method threadhold
Browse files
Model_API/Destinations/get_destinations.py
CHANGED
@@ -29,7 +29,8 @@ def get_destinations_list(question_vector, top_k):
|
|
29 |
accumulation = get_des_accumulation(question_vector[0], weights_bias_vector[index])
|
30 |
accumulation_dict[str(index)] = accumulation
|
31 |
|
32 |
-
top_keys = sorted(accumulation_dict, key=accumulation_dict.get, reverse=True)
|
|
|
33 |
scores = [accumulation_dict[key] for key in top_keys]
|
34 |
q1_score = np.percentile(scores, 25)
|
35 |
destinations_list = []
|
@@ -38,7 +39,7 @@ def get_destinations_list(question_vector, top_k):
|
|
38 |
destinations_list.append(des["name"][int(key)])
|
39 |
print(f"{des['name'][int(key)]}: {accumulation_dict[key]}")
|
40 |
|
41 |
-
return destinations_list
|
42 |
|
43 |
def get_question_vector(question_tags):
|
44 |
"""
|
|
|
29 |
accumulation = get_des_accumulation(question_vector[0], weights_bias_vector[index])
|
30 |
accumulation_dict[str(index)] = accumulation
|
31 |
|
32 |
+
top_keys = sorted(accumulation_dict, key=accumulation_dict.get, reverse=True)
|
33 |
+
print(f"Top keys: {top_keys}")
|
34 |
scores = [accumulation_dict[key] for key in top_keys]
|
35 |
q1_score = np.percentile(scores, 25)
|
36 |
destinations_list = []
|
|
|
39 |
destinations_list.append(des["name"][int(key)])
|
40 |
print(f"{des['name'][int(key)]}: {accumulation_dict[key]}")
|
41 |
|
42 |
+
return destinations_list[:top_k]
|
43 |
|
44 |
def get_question_vector(question_tags):
|
45 |
"""
|