-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Give option to disable converting from transcription text to ids. #396
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -68,7 +68,8 @@ def infer(): | |
mean_std_filepath=args.mean_std_path, | ||
augmentation_config='{}', | ||
specgram_type=args.specgram_type, | ||
num_threads=1) | ||
num_threads=1, | ||
keep_transcription_text=True) | ||
batch_reader = data_generator.batch_reader_creator( | ||
manifest_path=args.infer_manifest, | ||
batch_size=args.num_samples, | ||
|
@@ -103,8 +104,7 @@ def infer(): | |
|
||
error_rate_func = cer if args.error_rate_type == 'cer' else wer | ||
target_transcripts = [ | ||
''.join([data_generator.vocab_list[token] for token in transcript]) | ||
for _, transcript in infer_data | ||
transcript for _, transcript in infer_data | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Line 106 - 108 could be put into one line ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. |
||
] | ||
for target, result in zip(target_transcripts, result_transcripts): | ||
print("\nTarget Transcription: %s\nOutput Transcription: %s" % | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -69,7 +69,8 @@ def evaluate(): | |
mean_std_filepath=args.mean_std_path, | ||
augmentation_config='{}', | ||
specgram_type=args.specgram_type, | ||
num_threads=args.num_proc_data) | ||
num_threads=args.num_proc_data, | ||
keep_transcription_text=True) | ||
batch_reader = data_generator.batch_reader_creator( | ||
manifest_path=args.test_manifest, | ||
batch_size=args.batch_size, | ||
|
@@ -104,8 +105,7 @@ def evaluate(): | |
language_model_path=args.lang_model_path, | ||
num_processes=args.num_proc_bsearch) | ||
target_transcripts = [ | ||
''.join([data_generator.vocab_list[token] for token in transcript]) | ||
for _, transcript in infer_data | ||
transcript for _, transcript in infer_data | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Line 107 - 109 could be put into single line? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. |
||
] | ||
for target, result in zip(target_transcripts, result_transcripts): | ||
error_sum += error_rate_func(target, result) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -87,7 +87,8 @@ def tune(): | |
mean_std_filepath=args.mean_std_path, | ||
augmentation_config='{}', | ||
specgram_type=args.specgram_type, | ||
num_threads=args.num_proc_data) | ||
num_threads=args.num_proc_data, | ||
keep_transcription_text=True) | ||
|
||
audio_data = paddle.layer.data( | ||
name="audio_spectrogram", | ||
|
@@ -164,8 +165,7 @@ def tune(): | |
] | ||
|
||
target_transcripts = [ | ||
''.join([data_generator.vocab_list[token] for token in transcript]) | ||
for _, transcript in infer_data | ||
transcript for _, transcript in infer_data | ||
] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Line 167 - 169 --> single line? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. |
||
|
||
num_ins += len(target_transcripts) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please modify the function doc in Line 106.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.