Skip to content

Commit

Permalink
TIRA Evaluator: Extract top-docs for DiffIR and render them by default.
Browse files Browse the repository at this point in the history
  • Loading branch information
mam10eks committed Jul 19, 2023
1 parent a997cc2 commit d7aca48
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ir-measures/ir_measures_evaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -876,13 +876,13 @@ def render_results(run_file, irds_id, output_path, top_k=10):
excerpt_for_rendering['queries'] = {k: json.loads(irds_loader.map_query_as_jsonl(v)) for k,v in excerpt_for_rendering['queries'].items()}
excerpt_for_rendering['documents'] = {k: json.loads(irds_loader.map_doc(v)) for k,v in excerpt_for_rendering['documents'].items()}

with open(output_path / '.data-top-10-for-rendering.jsonl', 'w') as output_file:
with open(Path(output_path) / '.data-top-10-for-rendering.jsonl', 'w') as output_file:
output_file.write(json.dumps(excerpt_for_rendering))

from diffir.run import diff_from_local_data
_, rendered_serp = diff_from_local_data([str(run_file.resolve())], [str((output_path / '.data-top-10-for-rendering.jsonl').resolve())], cli=False, web=True, print_html=False)

with open(output_path / 'serp.html', 'w') as output_file:
with open(Path(output_path) / 'serp.html', 'w') as output_file:
output_file.write(rendered_serp)


Expand Down

0 comments on commit d7aca48

Please sign in to comment.