Bonjour je me demandais comment faire pour aller chercher les phonèmes à partir d'un ou de plusieurs mots à l'aide d'un algorithme python. Est-ce que vous connaissez des librairies en python ou avez vous des pistes pour m’aligner sur la bonne voie.

Pour l'instant, j'ai seulement trouver des librairies en anglais dont "g2p_en" et ce n'est pas ce que je recherche. Puisque si je met le mot "elephant" j'obtiens ['EH1', 'L', 'AH0', 'F', 'AH0', 'N', 'T'] et non ['EH1', 'L', 'EH1', 'F', 'AH0', 'N', 'T'] par exemple.


Hello I was wondering how to get the phonemes from one or more words using a python algorithm. Do you know any python libraries or do you have any leads to get me on the right track.

For now, I only find English librairies including "g2p_en" and that's not what I'm looking for. Cause if I write "elephant" I get ['EH1', 'L', 'AH0', 'F', 'AH0', 'N', 'T'] instead of ['EH1', 'L', 'EH1', 'F', 'AH0', 'N', 'T'].

Thank you

  • Hi Alex and welcome on French SE! I think this question might be considered off-topic, because it does not relate to French language directly. However, I understand it must be difficult to ask anywhere else since you're looking for a specifically French tool. Here is what I found, maybe that can help you: linuxfr.org/news/… – Reyedy May 28 '20 at 6:48
  • 4
    I’m voting to close this question because it belongs to stackoverflow – Toto May 28 '20 at 10:32

I'd comment but you need 50 rep. Those are the correct phonemes for "elephant", so if you can find a French library from the same source it should be fine.

  • Hi Rhubarb and welcome to French SE. I'm not sure this answers the question, as the author is looking for a library that generates French phonems, and their example clearly shows that the library they're using does not give the phonems in French. I'm sure if that library had a French version, the author would have found it. – Reyedy May 28 '20 at 6:50
  • I don't think the complaint can be that the English library doesn't give the correct French phonemes. It's not totally clear but I understood OP to be saying that since the English library doesn't give the correct English phonemes, a French library from the same place probably wouldn't give the correct French phonemes. Otherwise I don't understand why English is referred to at all (perhaps OP could clarify). With that in mind, I thought it might be helpful to point out in a comment that the En library does actually give the correct En phonemes, but found I couldn't comment for lack of rep. – Rhubarb May 28 '20 at 9:28
  • I didn't understand OP's point the same way as you did. I think OP mentioned English only to point out that they found a correct library for English words, which unfortunately does not work for French words (given the example). But you are right indeed, the library does give the right phonemes in English, and indeed, your message would have been more relevant as a comment. It's a shame that there is a rep minimum for those! Anyway, thanks for the clarification. :) – Reyedy May 28 '20 at 10:19
  • Exactly the English library is accurate for english phonemes but not for french phonemes ['EH1', 'L', 'EH1', 'F', 'AH0', 'N', 'T'] was just an example of what I would like to have in french I'm not even sure a this is the right phoneme for this word, but it's just for example. Sorry for the lack of clarification. – Tom May 28 '20 at 13:39
  • @Alex: the French phonemes for éléphant bear no relation to ['EH1', 'L', 'EH1', 'F', 'AH0', 'N', 'T'], which is probably why people were so puzzled by your question. They would be something more like ['E', 'L', 'E', 'F', 'AN'], The 't' is not pronounced, and the 'n' is not pronounced but nasalizes the vowel. – Peter Shor May 28 '20 at 15:43

Not the answer you're looking for? Browse other questions tagged or ask your own question.