Update text.py
"characters" was a bad variable name now that I think about it
This commit is contained in:
parent
8ec6ac8079
commit
a3e0e9f9bc
@ -52,10 +52,10 @@ def text_to_char_array(original, alphabet):
|
|||||||
Given a Python string ``original``, remove unsupported characters, map characters
|
Given a Python string ``original``, remove unsupported characters, map characters
|
||||||
to integers and return a numpy array representing the processed string.
|
to integers and return a numpy array representing the processed string.
|
||||||
"""
|
"""
|
||||||
characters = np.asarray([alphabet.label_from_string(c) for c in original])
|
integers = np.asarray([alphabet.label_from_string(c) for c in original])
|
||||||
if characters.shape[0] == 0:
|
if integers.shape[0] == 0:
|
||||||
raise Exception("Found an empty transcript! You must include a transcript for all training data.")
|
raise Exception("Found an empty transcript! You must include a transcript for all training data.")
|
||||||
return characters
|
return integers
|
||||||
|
|
||||||
|
|
||||||
# The following code is from: http://hetland.org/coding/python/levenshtein.py
|
# The following code is from: http://hetland.org/coding/python/levenshtein.py
|
||||||
|
Loading…
Reference in New Issue
Block a user