Created
October 1, 2016 19:41
-
-
Save BernardoGO/646509ef6041ad654f42cabddd4851b2 to your computer and use it in GitHub Desktop.
Fix trec file for eval
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fixed = "" | |
with open('trec10.res') as f: | |
previous = "" | |
for line in f: | |
print(line) | |
if line.split()[2] == previous: | |
continue | |
previous = line.split("\t")[2] | |
fixed += line | |
text_file = open("output.txt", "w") | |
text_file.write(fixed) | |
text_file.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment