Skip to content

Commit

Permalink
Correct off-by-one error in printing threshold for printing confusion…
Browse files Browse the repository at this point in the history
…s, and changed that default to 1. (#16)
  • Loading branch information
belambert authored Oct 8, 2017
1 parent b46b142 commit f153ef1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions asr_evaluation/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ def get_parser():
parser.add_argument('-c', '--confusions', action='store_true', help='Print tables of which words were confused.')
parser.add_argument('-p', '--print-wer-vs-length', action='store_true',
help='Print table of average WER grouped by reference sentence length.')
parser.add_argument('-m', '--min-word-count', type=int, default=10, metavar='count',
help='Minimum word count to show a word in confusions.')
parser.add_argument('-m', '--min-word-count', type=int, default=1, metavar='count',
help='Minimum word count to show a word in confusions (default 1).')
parser.add_argument('-a', '--case-insensitive', action='store_true',
help='Down-case the text before running the evaluation.')
parser.add_argument('-e', '--remove-empty-refs', action='store_true',
Expand Down
6 changes: 3 additions & 3 deletions asr_evaluation/asr_evaluation.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,17 +239,17 @@ def print_confusions():
if len(insertion_table) > 0:
print('INSERTIONS:')
for item in sorted(list(insertion_table.items()), key=lambda x: x[1], reverse=True):
if item[1] > min_count:
if item[1] >= min_count:
print('{0:20s} {1:10d}'.format(*item))
if len(deletion_table) > 0:
print('DELETIONS:')
for item in sorted(list(deletion_table.items()), key=lambda x: x[1], reverse=True):
if item[1] > min_count:
if item[1] >= min_count:
print('{0:20s} {1:10d}'.format(*item))
if len(substitution_table) > 0:
print('SUBSTITUTIONS:')
for [w1, w2], count in sorted(list(substitution_table.items()), key=lambda x: x[1], reverse=True):
if count > min_count:
if count >= min_count:
print('{0:20s} -> {1:20s} {2:10d}'.format(w1, w2, count))

# TODO - For some reason I was getting two different counts depending on how I count the matches,
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from setuptools import setup

version='2.0.1'
version='2.0.2'

setup(
name='asr_evaluation',
Expand Down

0 comments on commit f153ef1

Please sign in to comment.