charlesLoder / hebrew-transliteration

A tool for transliterating Hebrew
https://www.npmjs.com/package/hebrew-transliteration
MIT License
37 stars 14 forks source link

Using for tts #87

Open thewh1teagle opened 1 month ago

thewh1teagle commented 1 month ago

First of all, thanks for your great work. it's very interesting!

I would like to use this package to prepare data which I'll use to train text to speech Hebrew model, Can you tell what's the best schema I can use and how can I get list of all the possible characters from it?

When I'll use the library I'll need two things:

  1. Convert diacritic Hebrew into (Latin?) representation
  2. Get list of all possible characters that the convertor can convert into

By the way, since I'll train it in Python, is there a Python package for this?

charlesLoder commented 1 month ago

Thanks for the interest!

I've been meaning to do something like TTS with this package, but I've never trained a model, so I'm not fully sure what's needed. I'll lay out a little bit about the package and try to anticipate some hurdles and what can be done.



This tool really works best for liturgical Hebrew, i.e. Bible and Rabbinic; it's not very good at handling modern Hebrew, especially loan words. The reason is two fold:

First, it assumes pointed text, so יִשְׂרָאֵ֖ל will produce yiśrāʾēl, but ישראל will produce ysrʾl. If you are using mostly unpointed text, a tool like nakdan will be useful.

Second, it assumes a native Hebrew syllable structure. Under the hood, it uses this package for syllabification, and modern Hebrew words have a slightly different syllable structure than ancient Hebrew words. And loan words, have their own completely different structure.

If you are working with pointed Hebrew and it's native Hebrew, then this package will work the best.

The best way currently to know what's available for transliteration is to use autocomplete in your IDE. I'm currently developing the docs (issue #50), but the README lays out some of what's available in the schema.

Looking at the example schemas can show what's available. This schema for reconstructed tiberian pronunciation has a lot and uses IPA characters which are useful for SpeechML.

The ADDITIONAL_FEATURES has quite a few rules for the Tiberian schema. You may not need to use that many, but it demonstrates all the different custom rules you can create.

There is no Python implementation, unfortunately.

Phew! Ok, that was a lot! Your best bet is to just start playing around with the output until you get it customized to what you want. Feel free to open any issues or discussions. Hopefully once I get the documentation site updated (maybe a week or two), it'll be a little easier to understand.

charlesLoder commented 1 month ago

@thewh1teagle fyi, the new docs are available — https://charlesloder.github.io/hebrew-transliteration/getting-started/quick-start/

thewh1teagle commented 3 days ago

fyi, the new docs are available

It looks good. Thanks!

Have you heard about espeak-ng phenomenizer? I'm considering using it for training vits tts model and I'm wondering if it's produce the phonemes correctly in Hebrew.

charlesLoder commented 3 days ago

I'm not familiar with it. It seems to have Hebrew support and support for SpeechML, so you should be able to adjust a schema to get what you need