Sequitur G2P github (and bunch of fixes)

468 views
Skip to first unread message

Jan Trmal

unread,
Aug 6, 2015, 3:22:49 PM8/6/15
to kaldi-de...@googlegroups.com, tue6...@temple.edu, Ke Li
All, as you might know, in kaldi, we provide scripts for building and using Sequitur G2P.
The problem of Sequitur G2P is not that it doesn't produce good results, but rather not keeping up with the C++ standard development.

At this time, I think it's safe to say that it's completely abandoned and it's harder and harder getting it compiled. As a solution, some people moved to Phonetisaurus, which IMO has problems on its own -- and we don't have the infrastructure for it (which can take some time to be developed)

So I have created a github organization and repository -- the licence allows that and pushed first batch of fixes that deals with most of the problems with the original package which can be broadly named as
a) using deprecated Numpy interface
b) issues compiling using a modern C++ compiler

While working on it, I've noticed that it's using GCC std library extensions so that it won't probably compile using clang. I don't have an access to the clang compiler ATM
And that's what I'd like to ask someone from you -- checkout the github repo (sequitur-g2p/sequitur-g2p) and try compile using clang. It would be probably better if you'd be more experienced in C++ but I welcome any attempt.

thanks,
y.

Jan Trmal

unread,
Aug 6, 2015, 3:44:04 PM8/6/15
to Danijel Korzinek, kaldi-de...@googlegroups.com
Thanks Danijel, I really appreciate it.
We had some reports from users trying run this thing on Mac that it even does not compile -- and they seem to be bound to use clang for building the sequitur, because that's what had been used for building python there and python's setuptools just use the compiler and flags that had been used for building python.
So I compiled using gcc-4.7, resolved all issues (even warnings) and resolved another batch of issues when compiling with -std=gnu++0x. 
Now it compiles without even a single warning (gcc, Linux) -- I just wasn;t sure if it's true for clang as well. Apparently, yes, at least on Linux.

y.

On Thu, Aug 6, 2015 at 3:37 PM, Danijel Korzinek <dan...@pjwstk.edu.pl> wrote:
Just cloned the github and ran make inside the directory and it works fine. Can you elaborate a bit more what the problem is?

I'm running Debian "testing" if that makes any difference.

Danijel

--
You received this message because you are subscribed to the Google Groups "kaldi-developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kaldi-develope...@googlegroups.com.
To post to this group, send email to kaldi-de...@googlegroups.com.
Visit this group at http://groups.google.com/group/kaldi-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/kaldi-developers/CAFReZQYZSSBZd%3DnQB1T48Wb96ZDVNTvGTccEbY7pwC%3DiO0UKrQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Matthew Aylett

unread,
Aug 6, 2015, 5:30:35 PM8/6/15
to kaldi-de...@googlegroups.com, tue6...@temple.edu, Ke Li
Hi

I don't know if this is useful or not but Idlak has a full G2P system for US GA. The letter to sound is based on CART (so you can build cart trees in speech tools and use them in Idlak with a little massaging).

v best

Matthew


Josef Novak

unread,
Aug 7, 2015, 10:37:57 AM8/7/15
to kaldi-developers, tue6...@temple.edu, keli...@gmail.com
Hi,

On Thursday, August 6, 2015 at 9:22:49 PM UTC+2, Yenda wrote:
All, as you might know, in kaldi, we provide scripts for building and using Sequitur G2P.
The problem of Sequitur G2P is not that it doesn't produce good results, but rather not keeping up with the C++ standard development.

At this time, I think it's safe to say that it's completely abandoned and it's harder and harder getting it compiled. As a solution, some people moved to Phonetisaurus, which IMO has problems on its own -- and we don't have the infrastructure for it (which can take some time to be developed)
I'd definitely be open to and interested to hear more detail on this [fine to address here, or independently if you feel it pollutes this list].
 
Best,
 Joe

Josef Novak

unread,
Aug 7, 2015, 11:33:47 AM8/7/15
to kaldi-developers, tue6...@temple.edu, keli...@gmail.com


On Friday, August 7, 2015 at 4:37:57 PM UTC+2, Josef Novak wrote:
Hi,

On Thursday, August 6, 2015 at 9:22:49 PM UTC+2, Yenda wrote:
All, as you might know, in kaldi, we provide scripts for building and using Sequitur G2P.
The problem of Sequitur G2P is not that it doesn't produce good results, but rather not keeping up with the C++ standard development.

At this time, I think it's safe to say that it's completely abandoned and it's harder and harder getting it compiled. As a solution, some people moved to Phonetisaurus, which IMO has problems on its own -- and we don't have the infrastructure for it (which can take some time to be developed)
I'd definitely be open to and interested to hear more detail on this [fine to address here, or independently if you feel it pollutes this list].
 
BTW, if there is an interest, I would be very happy to address said issues [and feedback] and do required integration work.  We currently use it in combination with Kaldi, so it would be an opportunity to improve in a [hopefully] informed manner, and would not be wasted time from my end either.




 

Jan Trmal

unread,
Aug 7, 2015, 12:11:43 PM8/7/15
to kaldi-de...@googlegroups.com, Daniel J Douglas, Ke Li
Yes, please, there is definitely an interest in getting Phonetisaurus scripts included!

What I said about Phonetisaurs might come out too harsh -- I had an experience  one or two years ago and I remember having some problems some combination of parameters -- I even reported some of the issues to you at that time. 

y.

--
You received this message because you are subscribed to the Google Groups "kaldi-developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kaldi-develope...@googlegroups.com.
To post to this group, send email to kaldi-de...@googlegroups.com.
Visit this group at http://groups.google.com/group/kaldi-developers.

Josef Novak

unread,
Aug 7, 2015, 1:43:53 PM8/7/15
to kaldi-developers, tue6...@temple.edu, keli...@gmail.com
Not at all. Open criticism is welcome in all forms.

Internally we use Kaldi in a slightly different form to the open project.
The G2P interface follows the same basic layout as in my github - but has actually been updated.
I am interested in trying to do this the 'right way', so I will lay out a simple blueprint of the current model:
  •  Python bindings based on pybindgen [this is pure python and is included in the project; we also use this for Kaldi]
    • python commandline tool to train a model
    • python commandline tool to produce new pronunciations
      • Optionally takes a reference dictionary
    • simple webserver which loads one or more G2P models and associated reference dictionaries
I have been working some on refactoring the c++ API in response to other requests [as well as more robust response to your original criticism].

In the simplest case, during the network building phase we call the G2P [either via the server or the script] with a word list, e.g.:
  • $ get-pronunciations --wordlist words.wl --model input.en-US.fst --reference input.en-US.lex --output app.en-US.lex
  • Server accepts a curl request.
Reference words are looked-up, OOVs call the model.  Optional parameters can be provided to a.) generate additional pronunciations for reference words, or b.) n-best for OOVs.

There is nothing particularly 'interesting' about any of this, but it keeps things fairly sane and self-contained.

If you have some thoughts about this and/or specific requests about ideal interaction with public Kaldi patterns, I would very much like to leverage them this time around.

I have carte blanche at work with regards to this project so I see this as a good excuse to potentially provide something back where we are benefiting.

Best, Joe

Daniel Povey

unread,
Aug 7, 2015, 3:03:54 PM8/7/15
to kaldi-de...@googlegroups.com, tue6...@temple.edu
I also think including example scripts for Phonetisaurus is a good idea.
One of my concerns is that it should be easy to install and no weird dependencies.  For example, the web-server idea does not fill me with joy because it could interact with firewalls.

Mirko: regarding your python translation, it does sound nice, but I would only really be interested in it if you were to support it as a software project-- meaning, make a project on github or similar, hopefully get others involved, produce documentation, and so on.  Otherwise it would just be an unsupported script.  But if someone tries it out and finds it's very easy to use and as good as sequitur, I wouldn't object- assuming the numpy/scipy dependency didn't turn out to be a hassle.

Anyway I've never really got into the details of the g2p-related scripts; Yenda has mostly done this.  So in the end it will be up to him.

Dan


Josef Novak

unread,
Aug 7, 2015, 4:08:34 PM8/7/15
to kaldi-developers, tue6...@temple.edu, dpo...@gmail.com
Thanks for the response.
I agree completely regarding dependencies.

In practice these are two independent modalities [standalone program, server], which in my opinion solve different practical problems.
The former is probably most appropriate for Kaldi, and most recipes.  The latter is more appropriate for frequent compilation of on-demand dynamic grammars.  I think the latter can be completely ignored in the context of any example recipes.

Best,
Joe

Jan Trmal

unread,
Aug 7, 2015, 4:41:44 PM8/7/15
to Josef Novak
OK, I'm taking the discussion off the list. Please contact me, if you wish to be kept in the loop.

I will work with Joe to get the phonetisaurus scripts included. I'm thinking about first trying to make drop-in  replacement at the script-level of the old sequitur scripts and we can improve on the top of it.
Joe:
basically, is to write an alternative to apply_g2p.sh and train_g2p.sh. You can find them in babel egs. It would be good not include any extra dependency -- if it's possible to make it work without the python binding, the better.  Don't worry about making it completely compatible (some of the command line switches possible do not make much sense in global). Also, I guess we should find most accessible corpus, the babel data are that easy to get to.
y.


Reply all
Reply to author
Forward
0 new messages