Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/seanghay/sosap
🗣️ sosap(សូរសព្ទ) Python binding for Phonetisaurus
https://github.com/seanghay/sosap
g2p phonetisaurus python
Last synced: 2 days ago
JSON representation
🗣️ sosap(សូរសព្ទ) Python binding for Phonetisaurus
- Host: GitHub
- URL: https://github.com/seanghay/sosap
- Owner: seanghay
- License: mit
- Created: 2023-12-17T11:59:44.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-05-23T02:32:48.000Z (6 months ago)
- Last Synced: 2024-05-23T03:33:16.892Z (6 months ago)
- Topics: g2p, phonetisaurus, python
- Language: C++
- Homepage: https://pypi.org/project/sosap/
- Size: 2.34 MB
- Stars: 2
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-khmer-language - sosap(សូរសព្ទ)
README
Python binding for [Phonetisaurus](https://github.com/AdolfVonKleist/Phonetisaurus) using Cython.
### Install
```shell
# pypi
pip install sosap# GitHub
pip install git+https://github.com/seanghay/sosap.git
```### Phoneticize
```python
from sosap import Modelmodel = Model("g2p.fst")
model.phoneticize("hello")
```### Enable Sampling
```python
from sosap import Modelmodel = 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`