forked from SeanNaren/deepspeech.pytorch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added instructions to tune LMs, added script to select params
- Loading branch information
sean.narenthiran
committed
Aug 1, 2019
1 parent
b8e34cc
commit 62bd824
Showing
3 changed files
with
53 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import argparse | ||
import json | ||
|
||
parser = argparse.ArgumentParser(description='Select the best parameters based on the WER') | ||
parser.add_argument('--input-path', type=str, help='Output json file from search_lm_params') | ||
args = parser.parse_args() | ||
|
||
with open(args.input_path) as f: | ||
results = json.load(f) | ||
|
||
min_results = min(results, key=lambda x: x[2]) # Find the minimum WER (alpha, beta, WER, CER) | ||
print("Alpha: %f \nBeta: %f \nWER: %f\nCER: %f" % tuple(min_results)) |