Phonemizer¶
The phonemizer allows simple phonemisation of words and texts in many languages. It is based on four backends: espeak, espeak-mbrola, festival and segments.
Phonemizer is available as an Apptainer container on Apocrita.
Usage¶
To run the default installed version of Phonemizer, simply load the
phonemizer module:
$ module load phonemizer
$ phonemizer --version
phonemizer-VERSION
available backends: espeak-ng, espeak-mbrola, festival, segments
For full usage documentation, run phonemizer --help.
The phonemizer Pip package has been installed inside the Phonemizer
container, which can be used by launching the python program after
loading the phonemizer module, as shown below:
$ module load phonemizer
$ python
>>> import phonemizer
>>> phonemizer.__version__
'X.Y.Z'
Example jobs¶
Serial jobs¶
Here is an example job running running on 1 core and 1GB memory:
#!/bin/bash
#SBATCH -n 1 # (or --ntasks=1) Request 1 core
#SBATCH --mem-per-cpu=1G # Request 1GB RAM per core
#SBATCH -t 1:0:0 # Request 1 hour runtime
module load phonemizer
# Phonemize phrase using English (GB) dialect within the espeak backend engine
echo 'The quick brown fox jumps over the lazy dog' \
| phonemizer -l en-gb -b espeak
Here is an output this job will produce:
ðə kwɪk bɹaʊn fɒks dʒʌmps əʊvə ðə leɪzi dɒɡ
Here is an example job running running using the phonemizer Python package
inside the container, on 1 core and 1GB memory:
#!/bin/bash
#SBATCH -n 1 # (or --ntasks=1) Request 1 core
#SBATCH --mem-per-cpu=1G # Request 1GB RAM per core
#SBATCH -t 1:0:0 # Request 1 hour runtime
module load phonemizer
python -c "from phonemizer import phonemize; \
print(phonemize(['line1', 'line2']))"
Here is an output this job will produce:
['laɪn wʌn ', 'laɪn tuː ']