A friendly, lightweight, graph-based transcriber and scorer for deep Lening (but not only) applications. Based on cmudict and English heuristics.
- Lightweight. Depending only on
numpy
andscipy
. - Fast. Because of graph-nature of algorithm - it can produce transcription variants much faster than through straight combinatory
- Smart. Includes viterbi algorithm to find best way through your predictions.
import phns
graph = phns.from_text("Hello world!")
for pronounciation in graph.to_list():
print("-".join([str(phn) for phn in pronounciation]))
# =>
# hh-eh-l-ow-w-er-l-d
# hh-ah-l-ow-w-er-l-d
# hh-l-ow-w-er-l-d