Spaces:
Runtime error
Runtime error
Commit
·
5deec6f
1
Parent(s):
24e4b2c
Update app.py
Browse files
app.py
CHANGED
@@ -73,15 +73,16 @@ def aggregate(list_of_hits):
|
|
73 |
preferences.append([doc["rank"] - 1 for doc in result])
|
74 |
|
75 |
preferences = np.array(preferences)
|
76 |
-
|
77 |
-
y_optimal = BordaRankAggregator().aggregate(preferences)
|
78 |
|
79 |
rank2doc = {}
|
80 |
for doc in list_of_hits[0]:
|
81 |
rank2doc[doc["rank"] - 1] = doc
|
82 |
|
83 |
-
print("
|
84 |
-
print(
|
|
|
85 |
print("y_optimal: ", y_optimal)
|
86 |
return [rank2doc[rank] for rank in y_optimal]
|
87 |
|
|
|
73 |
preferences.append([doc["rank"] - 1 for doc in result])
|
74 |
|
75 |
preferences = np.array(preferences)
|
76 |
+
y_optimal = KemenyOptimalAggregator().aggregate(preferences)
|
77 |
+
# y_optimal = BordaRankAggregator().aggregate(preferences)
|
78 |
|
79 |
rank2doc = {}
|
80 |
for doc in list_of_hits[0]:
|
81 |
rank2doc[doc["rank"] - 1] = doc
|
82 |
|
83 |
+
print("preference:")
|
84 |
+
print(preferences)
|
85 |
+
print("preferences shape: ", preferences.shape)
|
86 |
print("y_optimal: ", y_optimal)
|
87 |
return [rank2doc[rank] for rank in y_optimal]
|
88 |
|