Skip to content
/ sosap Public

πŸ—£οΈ sosap(αžŸαžΌαžšαžŸαž–αŸ’αž‘) Python binding for Phonetisaurus

License

Notifications You must be signed in to change notification settings

seanghay/sosap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

29 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Python binding for Phonetisaurus using Cython.

Install

# pypi
pip install sosap

# GitHub
pip install git+https://github.com/seanghay/sosap.git

Phoneticize

from sosap import Model

model = Model("g2p.fst")
model.phoneticize("hello")

Enable Sampling

from sosap import Model

model = Model("g2p.fst")
results = model.phoneticize_sampling("hello", nbest=4)
# => [['h', 'Ι›Ι›', 'l', 'oo'], ['h', 'ee', '.', 'l', 'oo'], ['h', 'Ι›Ι›', 'l', '.', 'l', 'Ι”Ι”'], ['h', 'Ι›Ι›', '.', 'l', 'oo']]

results = model.phoneticize_sampling("hello", nbest=4, beam=1000, threshold=99.0, pmass=99.0)
# => [['h', 'Ι›Ι›', 'l', 'oo'], ['h', 'ee', '.', 'l', 'oo'], ['h', 'Ι›Ι›', 'l', '.', 'l', 'Ι”Ι”'], ['h', 'Ι›Ι›', '.', 'l', 'oo']]

License

MIT

About

πŸ—£οΈ sosap(αžŸαžΌαžšαžŸαž–αŸ’αž‘) Python binding for Phonetisaurus

Topics

Resources

License

Stars

Watchers

Forks

Languages