Skip to content

Commit bf2c4a4

Browse files
authored
Modified train.py of tedlium3 models (#597)
1 parent f3ad327 commit bf2c4a4

File tree

2 files changed

+0
-20
lines changed

2 files changed

+0
-20
lines changed

egs/tedlium3/ASR/pruned_transducer_stateless/train.py

-10
Original file line numberDiff line numberDiff line change
@@ -658,18 +658,8 @@ def remove_short_and_long_utt(c: Cut):
658658
# Keep only utterances with duration between 1 second and 17 seconds
659659
return 1.0 <= c.duration <= 17.0
660660

661-
num_in_total = len(train_cuts)
662-
663661
train_cuts = train_cuts.filter(remove_short_and_long_utt)
664662

665-
num_left = len(train_cuts)
666-
num_removed = num_in_total - num_left
667-
removed_percent = num_removed / num_in_total * 100
668-
669-
logging.info(f"Before removing short and long utterances: {num_in_total}")
670-
logging.info(f"After removing short and long utterances: {num_left}")
671-
logging.info(f"Removed {num_removed} utterances ({removed_percent:.5f}%)")
672-
673663
train_dl = tedlium.train_dataloaders(train_cuts)
674664
valid_cuts = tedlium.dev_cuts()
675665
valid_dl = tedlium.valid_dataloaders(valid_cuts)

egs/tedlium3/ASR/transducer_stateless/train.py

-10
Original file line numberDiff line numberDiff line change
@@ -627,18 +627,8 @@ def remove_short_and_long_utt(c: Cut):
627627
# Keep only utterances with duration between 1 second and 17 seconds
628628
return 1.0 <= c.duration <= 17.0
629629

630-
num_in_total = len(train_cuts)
631-
632630
train_cuts = train_cuts.filter(remove_short_and_long_utt)
633631

634-
num_left = len(train_cuts)
635-
num_removed = num_in_total - num_left
636-
removed_percent = num_removed / num_in_total * 100
637-
638-
logging.info(f"Before removing short and long utterances: {num_in_total}")
639-
logging.info(f"After removing short and long utterances: {num_left}")
640-
logging.info(f"Removed {num_removed} utterances ({removed_percent:.5f}%)")
641-
642632
train_dl = tedlium.train_dataloaders(train_cuts)
643633
valid_cuts = tedlium.dev_cuts()
644634
valid_dl = tedlium.valid_dataloaders(valid_cuts)

0 commit comments

Comments
 (0)