Created
October 10, 2018 14:15
-
-
Save Zhdanovich/87fd4410c95a7b932209c9033be4a719 to your computer and use it in GitHub Desktop.
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
def evaluate(): | |
valid_model_path = "../../../data_deepspeech/models" | |
empty_model_path = "../../../data_deepspeech/models__" | |
dirName = os.path.expanduser(valid_model_path) | |
empty_model_dirName = os.path.expanduser(empty_model_path) | |
output_graph, alphabet, lm, trie = wavTranscriber.resolve_models(dirName) | |
_, _, empty_lm, empty_trie = wavTranscriber.resolve_models(empty_model_dirName) | |
# Load output_graph, alpahbet, lm and trie | |
model_no_lm = wavTranscriber.load_model(output_graph, alphabet, lm, trie, 0) | |
model_empty_lm = wavTranscriber.load_model(output_graph, alphabet, empty_lm, empty_trie, 0) | |
wav_file = '/Users/kirill/Developer/data_deepspeech/test.wav' | |
no_lm = transcribe_file(wav_file, model_no_lm) | |
empty_lm = transcribe_file(wav_file, model_empty_lm) | |
print(no_lm) | |
print(empty_lm) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment