Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Fix trec file for eval
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
You can’t perform that action at this time.