rhasspy / piper-phonemize

C++ library for converting text to phonemes for Piper
MIT License
77 stars 61 forks source link

Why does BOS have padding? #35

Open antoninononooono opened 2 months ago

antoninononooono commented 2 months ago

src/phoneme_ids.cpp

I have been reviewing the phonemes_to_ids function in src/phoneme_ids.cpp and noticed that padding (PAD) is inserted after the Beginning of Sentence (BOS) symbol (^). I'm curious about the reasoning behind this implementation choice.

If this decision was intentional, could you kindly clarify why padding is included after BOS? I'm interested to understand the rationale behind this practice.

Additionally, I noticed that padding is not inserted after the End of Sentence (EOS) symbol ($). I'm wondering if there's a specific reason why EOS does not have padding, whereas BOS does.

Thank you in advance for taking the time to provide clarification on this matter. I appreciate your insights into the design decisions behind the code.

synesthesiam commented 2 months ago

I don't have a strong reason for it. I haven't experimented much with different ways of padding (except removing the padding, which seemed to make things worse). Basically, I went with the first thing that worked well enough 😄