Skip to content

Commit e554de5

Browse files
committed
Changes in the @k and the LuT in order to avoid ad-hoc paths
1 parent 8953336 commit e554de5

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

anyscript.eval/compute.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,14 @@ def load_json(path):
4848
book_id_pages[book.strip()] = list_pages
4949

5050
# A queries map és on va lo de les LUT de pagines o de books en cas de que la response sigui amb les queries originals
51-
map_at_k, recall_at_k = compute_map_recall_at_k(df_books, k=10, queries_map=None, evaluate_page=False, book_to_author_map=book_id_to_author, book_to_pages_map=book_id_pages)
51+
map_at_k, recall_at_k = compute_map_recall_at_k(df_books, k=50, queries_map=None, evaluate_page=False, book_to_author_map=book_id_to_author, book_to_pages_map=book_id_pages)
5252

5353
print(' THe mean recall at k book level is: ', recall_at_k)
5454
print(' THe mean map at k book level is: ', map_at_k)
5555

5656

5757
# A queries map és on va lo de les LUT de pagines o de books en cas de que la response sigui amb les queries originals
58-
map_at_k, recall_at_k = compute_map_recall_at_k(df_pages, k=10, queries_map=None, evaluate_page=True, book_to_author_map=book_id_to_author, book_to_pages_map=book_id_pages)
58+
map_at_k, recall_at_k = compute_map_recall_at_k(df_pages, k=50, queries_map=None, evaluate_page=True, book_to_author_map=book_id_to_author, book_to_pages_map=book_id_pages)
5959

6060
print(' THe mean recall at k page level is: ', recall_at_k)
6161
print(' THe mean map at k page level is: ', map_at_k)
@@ -68,10 +68,10 @@ def load_json(path):
6868
ideal_rankings = load_json(IDEAL_RANKNGS)
6969
ideal_rankings_books = load_json(IDEAL_RANKNGS_BOOKS)
7070

71-
ndcg_at_k = compute_nDCG(df_pages, ideal_rankings, k=10, book_to_author=book_id_to_author, lut_full_catalog=lut_full_catalog, queries_map=lut_pages)
71+
ndcg_at_k = compute_nDCG(df_pages, ideal_rankings, k=50, book_to_author=book_id_to_author, lut_full_catalog=lut_full_catalog, queries_map=lut_pages)
7272

7373
print(' THe mean nDCG at k page level is: ', ndcg_at_k)
7474

75-
ndcg_at_k = compute_nDCG(df_books, ideal_rankings_books, k=10, book_to_author=book_id_to_author, lut_full_catalog=lut_full_catalog, queries_map=lut_books)
75+
ndcg_at_k = compute_nDCG(df_books, ideal_rankings_books, k=50, book_to_author=book_id_to_author, lut_full_catalog=lut_full_catalog, queries_map=lut_books)
7676

7777
print(' THe mean nDCG at k book level is: ', ndcg_at_k)

0 commit comments

Comments
 (0)