Skip to content

Commit

Permalink
output path to write result to
Browse files Browse the repository at this point in the history
  • Loading branch information
highly0 committed Apr 26, 2024
1 parent 8d65b96 commit 60e43c0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mintaka_evaluate.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
parser.add_argument(
"--predictions_path",
help="Path to JSONL file with predictions" + EXAMPLE_OF_DATA_FORMAT,
default="/workspace/storage/misc/subgraphs_reranking_runs/reranking_model_results/t5_xl_ssm/mpnet_text_only_reranking_seq2seq_xl_results.jsonl",
default="/workspace/storage/misc/subgraphs_reranking_runs/reranking_model_results/t5_large_ssm/mpnet_highlighted_t5_sequence_reranking_seq2seq_large_2_results.jsonl",
)

parser.add_argument(
Expand Down Expand Up @@ -218,7 +218,8 @@ def _calculate_hits(self, is_correct_df: pd.DataFrame, top_n: int = 10) -> dict:

# save reranking results
OUTPUT_DIR = "/".join(args.predictions_path.split("/")[:-1])
output_path = f"{OUTPUT_DIR}/reranking_result.txt"
run_name = args.predictions_path.split("/")[-1]
output_path = f"{OUTPUT_DIR}/reranking_result_{run_name}.txt"
with open(output_path, "w+", encoding="utf-8") as file_output:
file_output.write("Hit scores: \n")
for key, val in reranking_results.items():
Expand Down

0 comments on commit 60e43c0

Please sign in to comment.