AdolfVonKleist / RnnLMG2P

Grapheme-to-Phoneme conversion with Joint-Sequence RnnLMs
29 stars 3 forks source link

Forward-Backward maxent-features #2

Closed AdolfVonKleist closed 9 years ago

AdolfVonKleist commented 10 years ago

Add support for for phoneme class features and forward grapheme features for direct connections / maxent extension.

ypwang1981 commented 9 years ago

Hi, can you give me some example of how would be train corpus looks like? Are the following right? Thanks a lot. a ey hi h eh be b ih ...

USGZVReB9cJ6Crcp8CXHcR commented 9 years ago

I'll add my end-to-end training scripts later this afternoon. the input file in this case needs to be already aligned, e.g.:

r}R a|i}EY n}N
b}B l}L a}AE s}S t}T

You can use the Phonetisaurus aligner, or any other sequence alignment implementation for this step.

AdolfVonKleist commented 9 years ago

Hi, I have updated the script/train-g2p-rnnlm.py, and the README.md file. You should be able to use the scripts to train a proper RnnLM G2P model. There is also an early Docker image that you might be interested in. This has almost all Phonetisaurus software pre-installed on an phusion/baseimage from Ubuntu 14.04:

$ docker pull bkbroiler/phonetisaurus:0.3
$ curl -o insecure_key -fSL https://github.com/phusion/baseimage-docker/raw/master/image/insecure_key
$ chmod 600 insecure_key 
#Launch the Docker container
$ docker run -d --name g2p -i bkbroiler/phonetisaurus:0.1 /sbin/my_init --enable-insecure-key
#Find the IP
$ docker inspect -f "{{ .NetworkSettings.IPAddress }}" g2p
#Login
$ ssh -i insecure_key root@IP-FOUND
AdolfVonKleist commented 9 years ago

also note that, while the default values in the training script should be fine for English and probably some other indo-european languages, you may need to experiment a bit if you are using this for an asian language. specifically, the ideal --classes will depend on the number of graph-phones in your alphabet, --hidden and --direct will depend on the size of your training corpus, and --direct_order, --bptt, and --bptt_block will depend on the preceding values, as well as the structure of your dictionary [complexity of g-p relationships, etc.]