Skip to content

Commit

Permalink
Output a vertical line of correct & incorrect transitions instead of …
Browse files Browse the repository at this point in the history
…printing out the Counter as-is
  • Loading branch information
AngledLuffa committed Jan 16, 2025
1 parent 5a3a234 commit 98a3c80
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions stanza/models/constituency/parser_training.py
Original file line number Diff line number Diff line change
Expand Up @@ -570,9 +570,11 @@ def train_model_one_epoch(epoch, trainer, transition_tensors, process_outputs, m

# TODO: refactor the logging?
total_correct = sum(v for _, v in epoch_stats.transitions_correct.items())
correct_transitions_str = "\n ".join(["%s: %d" % (x, epoch_stats.transitions_correct[x]) for x in epoch_stats.transitions_correct])
tlogger.info("Transitions correct: %d\n %s", total_correct, correct_transitions_str)
total_incorrect = sum(v for _, v in epoch_stats.transitions_incorrect.items())
tlogger.info("Transitions correct: %d\n %s", total_correct, str(epoch_stats.transitions_correct))
tlogger.info("Transitions incorrect: %d\n %s", total_incorrect, str(epoch_stats.transitions_incorrect))
incorrect_transitions_str = "\n ".join(["%s: %d" % (x, epoch_stats.transitions_incorrect[x]) for x in epoch_stats.transitions_incorrect])
tlogger.info("Transitions incorrect: %d\n %s", total_incorrect, incorrect_transitions_str)
if len(epoch_stats.repairs_used) > 0:
tlogger.info("Oracle repairs:\n %s", "\n ".join("%s (%s): %d" % (x.name, x.value, y) for x, y in epoch_stats.repairs_used.most_common()))
if epoch_stats.fake_transitions_used > 0:
Expand Down

0 comments on commit 98a3c80

Please sign in to comment.