Skip to content

Commit

Permalink
fa-ir experiment, minor change #80
Browse files Browse the repository at this point in the history
  • Loading branch information
Hamedloghmani committed Aug 16, 2023
1 parent 2367619 commit 273a30d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/fa-ir experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
output = '../output/imdb/bnn'
fteamsvecs = '../output/imdb/teamsvecs.pkl'
fsplits = '../output/imdb/splits.json'
fpred = '../output/imdb/bnn/t32059.s23.m2011.l[100].lr0.1.b4096.e20.nns3.nsuniform/f0.test.pred'
fpred = '../output/imdb/bnn/t32059.s23.m2011.l[100].lr0.1.b4096.e20.nns3.nsunigram_b/f1.test.pred'

print('#' * 100)
if not os.path.isdir(output): os.makedirs(output)
Expand Down Expand Up @@ -53,11 +53,14 @@
fair_teams = list()

# Check to see if a team needs reranking to become fair or not.
print('Analyzing fairness and reranking if necessary...')
for i, team in enumerate(fair_docs):
print(fair.is_fair(team[:k]))

if fair.is_fair(team[:k]):
fair_teams.append(team[:k])
else:
print(fair.is_fair(team[:k]))
reranked = fair.re_rank(team)
fair_teams.append(reranked)
print(dic_before['ndkl'][i])
print(dic_before['ndkl'][i])
print('Done !')

0 comments on commit 273a30d

Please sign in to comment.