Skip to content

Commit

Permalink
tiny fix
Browse files Browse the repository at this point in the history
  • Loading branch information
markus583 committed Feb 15, 2024
1 parent 8a8bc17 commit f35ca5c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
11 changes: 7 additions & 4 deletions wtpsplit/evaluation/intrinsic.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,14 +267,17 @@ def main(args):
"t": score_t,
"punct": score_punct,
}

if score_u is not None:
u_scores.append((score_u, lang_code))
if score_t is not None:
t_scores.append((score_t, lang_code))
if score_punct is not None:
punct_scores.append((score_punct, lang_code))

# just for printing
score_t = score_t or 0.0
score_punct = score_punct or 0.0

u_scores.append((score_u, lang_code))
t_scores.append((score_t, lang_code))
punct_scores.append((score_punct, lang_code))
print(f"{lang_code} {dataset_name} {score_u:.3f} {score_t:.3f} {score_punct:.3f}")

# Compute statistics for each metric across all languages
Expand Down
3 changes: 2 additions & 1 deletion wtpsplit/evaluation/time_intrinsic.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ def benchmark_strides(low_stride, high_stride, args):
"max_n_train_sentences": args.max_n_train_sentences,
}
)
print(results_data)

return pd.DataFrame(results_data)

Expand Down Expand Up @@ -73,5 +74,5 @@ def benchmark_strides(low_stride, high_stride, args):
# Optionally save df_results to a file
# to csv
df_results.to_csv(
f"timing_results_{args.model_path.replace('/','__')}_batch{args.batch_size}_b{args.block_size}+s{args.stride}_u{args.threshold}_AVG.csv"
f"timing_results_{args.model_path.replace('/','__')}_batch{args.batch_size}_b{args.block_size}+s{args.stride}_n{args.max_n_train_sentences}_u{args.threshold}_AVG.csv"
)

0 comments on commit f35ca5c

Please sign in to comment.