Skip to content

Speech Marks not correctly generated

0

When I generate speech marks (words) for the following :

<speak>Alexander the Great was born in 356 B.C. to King Philip II of Macedonia.</speak>

The phrase 'King Philip II' is categorized as a word separately:

{"time":187,"type":"word","start":7,"end":16,"value":"Alexander"} {"time":812,"type":"word","start":17,"end":20,"value":"the"} {"time":937,"type":"word","start":21,"end":26,"value":"Great"} {"time":1250,"type":"word","start":27,"end":30,"value":"was"} {"time":1437,"type":"word","start":31,"end":35,"value":"born"} {"time":1750,"type":"word","start":36,"end":38,"value":"in"} {"time":1875,"type":"word","start":39,"end":42,"value":"356"} {"time":2825,"type":"word","start":43,"end":46,"value":"B.C"} {"time":3212,"type":"word","start":48,"end":50,"value":"to"} {"time":3312,"type":"word","start":51,"end":55,"value":"King"} {"time":3587,"type":"word","start":56,"end":62,"value":"Philip"} {"time":3950,"type":"word","start":51,"end":65,"value":"King Philip II"} {"time":4125,"type":"word","start":63,"end":65,"value":"II"} {"time":4437,"type":"word","start":66,"end":68,"value":"of"} {"time":4562,"type":"word","start":69,"end":78,"value":"Macedonia"}

Is there any way to prevent this?

asked a year ago163 views
2 Answers
0

I have never used Polly, but does any of this information help? https://docs.aws.amazon.com/polly/latest/dg/speechmarks.html

EXPERT
answered a year ago
  • Thanks! My issue is specific to the phrase I'm using, so I have gone over the documentation with examples and special characters as well, but have not found an answer yet.

0

To prevent the issue where multi-word entities like "King Philip II" are categorized both as separate words and as a whole phrase in speech marks, you can use a few strategies. One approach is to filter out duplicates in the generated speech marks by identifying overlapping entries and keeping only the complete phrase.

Alternatively, applying Named Entity Recognition (NER) before generating the speech marks can help recognize multi-word entities and treat them as a single unit. Another option is to check the configuration of your speech mark generator to adjust how multi-word entities are handled directly.

EXPERT
answered a year ago
  • Thanks! I could implement your suggestion of filtering out duplicates in the generated speech marks that overlap. I was curious if you could elaborate on this though - "check the configuration of your speech mark generator to adjust how multi-word entities are handled directly" - from what I see, AWS Polly does not have any specific configuration options for word tokens, is there something I'm missing?

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.