Skip to main content

Build Status Sequitur G2P

A trainable Grapheme-to-Phoneme converter.

Introduction

Sequitur G2P is a data-driven grapheme-to-phoneme converter written at RWTH Aachen University by Maximilian Bisani.

The method used in this software is described in

   M. Bisani and H. Ney: "Joint-Sequence Models for Grapheme-to-Phoneme
   Conversion". Speech Communication, Volume 50, Issue 5, May 2008,
   Pages 434-451

   (available online at http://dx.doi.org/10.1016/j.specom.2008.01.002)

This software is made available to you under terms of the GNU Public License. It can be used for experimentation and as part of other free software projects. For details see the licensing terms below.

If you publish about work that involves the use of this software, please cite the above paper. (You should feel obliged to do so by rules of good scientific conduct.)

The original README contains also these lines: You may contact the author with any questions or comments via e-mail: maximilian.bisani@rwth-aachen.de. For questions regarding current releases of Sequitur G2P contact Pavel Golik (golik@cs.rwth-aachen.de). but we are not sure how active they are. If needed, feel free to create an issue on https://github.com/sequitur-g2p/sequitur-g2p. We will try to help.

License

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License Version 2 (June 1991) as published by the Free Software Foundation.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, you will find it at http://www.gnu.org/licenses/gpl.html, or write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA.

Should a provision of no. 9 and 10 of the GNU General Public License be invalid or become invalid, a valid provision is deemed to have been agreed upon which comes closest to what the parties intended commercially. In any case guarantee/warranty shall be limited to gross negligent actions or intended actions or fraudulent concealment.

Installing

To build and use this software you need to have the following part installed:

To install change to the source directory and type: python setup.py install --prefix /usr/local You may substitute /usr/local with some other directory. If you do so make sure that some-other-directory/lib/python2.5/site-packages/ is in your PYTHONPATH, e.g. by typing export PYTHONPATH=some-other-directory/lib/python2.7/site-packages

You can also install via pip by pointing it at this repository. You still need SWIG and a C++ compiler.

pip install numpy
pip install git+https://github.com/sequitur-g2p/sequitur-g2p@master

Note, when installing on MacOS, you might run into issues due to the default libc being clang's one. If that is the case, try installing it with:

CPPFLAGS="-stdlib=libstdc++" pip install git+https://github.com/sequitur-g2p/sequitur-g2p@master

Using

Sequitur G2P is a data-driven grapheme-to-phoneme converter. Actually, it can be applied to any monotonous sequence translation problem, provided the source and target alphabets are small (less than 255 symbols). Data-driven means that you need to train it with example pronunciations. It has no built-in linguistic knowledge whatsoever, which means that it should work for any alphabetic language. Training takes a pronunciation dictionary and creates a model file. The model file can then be used to transcribe words that where not in the dictionary.

Here is step-by-step guide to get you started:

  1. Obtain a pronunciation dictionary for training. The format is one word per line. Each line contains the orthographic form of the word followed by the corresponding phonemic transcription. The word and all phonemes need to be separated by white space. The word and phoneme symbols may thus not contain blanks. We'll assume your training lexicon is called train.lex, and that you set aside some portion for testing purposes as test.lex, which is disjoint from train.lex.

  2. Train a model. To create a first model type:

    g2p.py --train train.lex --devel 5% --write-model model-1

    This first model will be rather poor because it is only a unigram. To create higher order models you need to run g2p.py again:

    g2p.py --model model-1 --ramp-up --train train.lex --devel 5% --write-model model-2

    Repeat this a couple of times

    g2p.py --model model-2 --ramp-up --train train.lex --devel 5% --write-model model-3
    g2p.py --model model-3 --ramp-up --train train.lex --devel 5% --write-model model-4
    ...
    
  3. Evaluate the model. To find out how accurately your model can transcribe unseen words type:

    g2p.py --model model-6 --test test.lex

  4. Transcribe new words. Prepare a list of words you want to transcribe as a simple text file words.txt with one word per line (and no phonemic transcription), then type:

    g2p.py --model model-3 --apply words.txt

Random comments:

  • You cannot open models created in a python3 environment inside a python2 environment. The opposite works.
  • Whenever a file name is required, you can specify "-" to mean standard in, or standard out.
  • If a file name ends in ".gz", it is assumed that the file is (or should be) compressed using gzip.
  • For the time being you need to type g2p.py --help and/or read the source to find out the other things g2p.py can do. Sorry about that.

Release files for sequitur-g2p 1.0.1668.30

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sequitur-g2p 1.0.1668.30
File Size Uploaded
sequitur_g2p-1.0.1668.30.tar.gz 82.2 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for sequitur-g2p 1.0.1668.30
File
sequitur_g2p-1.0.1668.30-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details
sequitur_g2p-1.0.1668.30-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ x86-64 Details
sequitur_g2p-1.0.1668.30-cp312-cp312-macosx_10_9_universal2.whl CPython 3.12 CPython 3.12 macOS 10.9+ universal2 (ARM64, x86-64) Details
sequitur_g2p-1.0.1668.30-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details
sequitur_g2p-1.0.1668.30-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ x86-64 Details
sequitur_g2p-1.0.1668.30-cp311-cp311-macosx_10_9_universal2.whl CPython 3.11 CPython 3.11 macOS 10.9+ universal2 (ARM64, x86-64) Details
sequitur_g2p-1.0.1668.30-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details
sequitur_g2p-1.0.1668.30-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ x86-64 Details
sequitur_g2p-1.0.1668.30-cp310-cp310-macosx_11_0_x86_64.whl CPython 3.10 CPython 3.10 macOS 11.0+ x86-64 Details
sequitur_g2p-1.0.1668.30-cp39-cp39-win_amd64.whl CPython 3.9 CPython 3.9 Windows x86-64 Details
sequitur_g2p-1.0.1668.30-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.17+ x86-64 Details
sequitur_g2p-1.0.1668.30-cp39-cp39-macosx_11_0_x86_64.whl CPython 3.9 CPython 3.9 macOS 11.0+ x86-64 Details

Total release size: 6.3 MB

Release files / sequitur_g2p-1.0.1668.30.tar.gz

Download URL sequitur_g2p-1.0.1668.30.tar.gz
Size 82.2 kB
Tags Source
SHA-256 checksum
How to use checksums
76dbd71b100acd1d3395514b0bd5a7fbdcf2051d0f6ef59b193dcaa93f8763cb
BLAKE2b-256 checksum
How to use checksums
9e68bdcf68d981bb5242f000eea96a1566eefedf4dc274932e163f2b5470e8c5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.12.4

Release files / sequitur_g2p-1.0.1668.30-cp312-cp312-win_amd64.whl

Download URL sequitur_g2p-1.0.1668.30-cp312-cp312-win_amd64.whl
Size 134.3 kB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
6438ede4fab0dfd6477a693072e5ef8db63e8c305d442e058845e2f0b16c7a54
BLAKE2b-256 checksum
How to use checksums
3ff7b6773e3c12842754a6318cb70e7cf25d4e4cd074dd6e13bc5abad2b2c1f1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.12.4

Release files / sequitur_g2p-1.0.1668.30-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL sequitur_g2p-1.0.1668.30-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.2 MB
Tags CPython 3.12 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
0f40ea55e88713d9ec88116c68baebe582c200c2c278cfc7ddc24f96ecbf34ab
BLAKE2b-256 checksum
How to use checksums
6832013a7b5a0471ea677d525e2d3db8a021e049103c964c21bdcc5487207bd7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.12.4

Release files / sequitur_g2p-1.0.1668.30-cp312-cp312-macosx_10_9_universal2.whl

Download URL sequitur_g2p-1.0.1668.30-cp312-cp312-macosx_10_9_universal2.whl
Size 246.4 kB
Tags CPython 3.12 macOS 10.9+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
963b2fa4649c1243384e3f35ee432e80c93e7d9b8440d3abc7e1d77d466a5298
BLAKE2b-256 checksum
How to use checksums
a7e82b927bd7908533f1336abe760a74425ce631edaac8bb603bebab3e48a8a4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.12.4

Release files / sequitur_g2p-1.0.1668.30-cp311-cp311-win_amd64.whl

Download URL sequitur_g2p-1.0.1668.30-cp311-cp311-win_amd64.whl
Size 133.9 kB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
d9fe1ba79200375ded43a5df01e5e24bd6cfc3a805c45f32c95045e989c1db89
BLAKE2b-256 checksum
How to use checksums
80ba4093ae0d49204f0792dd571ea832b6a7ac62205b2ece0af1a68c68f10322
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.12.4

Release files / sequitur_g2p-1.0.1668.30-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL sequitur_g2p-1.0.1668.30-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.2 MB
Tags CPython 3.11 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
76ebfc3cc5938ce6fe9c29c51bfec9d9630144243cc975740826e9b0d8d7e5a3
BLAKE2b-256 checksum
How to use checksums
49b52b709027b0e83a94c4b6ba4c9c84370afd3fa824cdccc5c78b2011c5d134
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.12.4

Release files / sequitur_g2p-1.0.1668.30-cp311-cp311-macosx_10_9_universal2.whl

Download URL sequitur_g2p-1.0.1668.30-cp311-cp311-macosx_10_9_universal2.whl
Size 245.7 kB
Tags CPython 3.11 macOS 10.9+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
32ee6128daa1c21a2af408c97098293cb9fe32f4f463de131f391c64b41fea7d
BLAKE2b-256 checksum
How to use checksums
8f219a709fbe10f61dd1d2b3eac2b337fcfedd59f25b7431bb17d0d0d80be52d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.12.4

Release files / sequitur_g2p-1.0.1668.30-cp310-cp310-win_amd64.whl

Download URL sequitur_g2p-1.0.1668.30-cp310-cp310-win_amd64.whl
Size 133.9 kB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
3c000856bf21922e25877baade879e34f2dd12900c3dfe480789b429171d6979
BLAKE2b-256 checksum
How to use checksums
75351a2ebbec8f1bb4c3bd6ca4f94189857344902c99227a53cb74d57cd667e7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.12.4

Release files / sequitur_g2p-1.0.1668.30-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL sequitur_g2p-1.0.1668.30-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.2 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
7fce133bc15a023c6c355d6fd4d6953dc376a0a574cd73e176fa23198985fbfd
BLAKE2b-256 checksum
How to use checksums
ca375ac08edc789fc125cea1d6451f4ff062c13e74e3a8e49bc4c1b7a4eb0b47
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.12.4

Release files / sequitur_g2p-1.0.1668.30-cp310-cp310-macosx_11_0_x86_64.whl

Download URL sequitur_g2p-1.0.1668.30-cp310-cp310-macosx_11_0_x86_64.whl
Size 150.4 kB
Tags CPython 3.10 macOS 11.0+ x86-64
SHA-256 checksum
How to use checksums
28023bf80316813c032341fd1704408983f69f2a3bca63b2029326ebfacd7c32
BLAKE2b-256 checksum
How to use checksums
4cc0031e96e1f21a789c6cff953dfa95ac391c210fdf7b2ec7d4ff70be9e8f4b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.12.4

Release files / sequitur_g2p-1.0.1668.30-cp39-cp39-win_amd64.whl

Download URL sequitur_g2p-1.0.1668.30-cp39-cp39-win_amd64.whl
Size 134.0 kB
Tags CPython 3.9 Windows x86-64
SHA-256 checksum
How to use checksums
d34fd8ec713111f5ac598106379d0d81d934ccc4246715638d41158aed40dbbc
BLAKE2b-256 checksum
How to use checksums
65aad100ce887313ef7308c3e7e04315649b54761e883309fd68401ba807623c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.12.4

Release files / sequitur_g2p-1.0.1668.30-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL sequitur_g2p-1.0.1668.30-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.2 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
c471b381e7f8ab90267cd53c38eb21243538137396b5bec5a4606922d6a14465
BLAKE2b-256 checksum
How to use checksums
d1841f2ba1c7e1079c30f568292f65f0129b0d24719c17c3bb4256b8e9e39096
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.12.4

Release files / sequitur_g2p-1.0.1668.30-cp39-cp39-macosx_11_0_x86_64.whl

Download URL sequitur_g2p-1.0.1668.30-cp39-cp39-macosx_11_0_x86_64.whl
Size 150.4 kB
Tags CPython 3.9 macOS 11.0+ x86-64
SHA-256 checksum
How to use checksums
c007e65acfb501d22eeedb0775d24bcd907132ddfbc82871195ac23aaf9da66a
BLAKE2b-256 checksum
How to use checksums
101a8b4286f0a61b3ad168e7f3f96e868d7ad151e89154f46f8de0755768d9ed
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.12.4
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page