whisper_refs: normalize transcripts (sentence-case, strip quote artifacts)
normalize_text() handles three Whisper quirks that produced messy F5
ref_texts:
1. Lowercase output with no terminal period — capitalize first letter,
append "." if missing.
2. Hallucinated "' clusters Whisper inserts when it interprets a
fragment as quoted dialogue (cora, ivan, atlas, hope had these).
Strip everywhere; never legitimate English punctuation.
3. Trailing apostrophe-then-period (.'.) from earlier rounds where a
closing-quoted line got an extra "." appended — collapse to single
terminal. Function is now idempotent.
Adds --from-cache flag: skip ASR, re-apply normalize from cached
whisper_refs.json. No GPU needed, useful after tuning the normalizer.
Lazy-imports torch so --from-cache works on any host.
Affects 9 of 40 voices: clara, grace, hazel, iris, felix, hugo
(lowercase fix); cora, ivan, atlas, hope (quote-cluster fix).
This commit is contained in:
parent
72a9553047
commit
c5247cd993
4 changed files with 116 additions and 67 deletions
|
|
@ -8,7 +8,7 @@
|
|||
},
|
||||
"clara": {
|
||||
"ref_audio": "cloned-voices/clara.wav",
|
||||
"ref_text": "but it is not with a view to distinction that you should cultivate this talent if you consult your own happiness.",
|
||||
"ref_text": "But it is not with a view to distinction that you should cultivate this talent if you consult your own happiness.",
|
||||
"speaker_id": "3575",
|
||||
"gender": "female",
|
||||
"duration": 7.0
|
||||
|
|
@ -22,21 +22,21 @@
|
|||
},
|
||||
"grace": {
|
||||
"ref_audio": "cloned-voices/grace.wav",
|
||||
"ref_text": "as to his age and also the name of his master jacob's statement varied somewhat from the advertisement",
|
||||
"ref_text": "As to his age and also the name of his master jacob's statement varied somewhat from the advertisement.",
|
||||
"speaker_id": "8463",
|
||||
"gender": "female",
|
||||
"duration": 6.7
|
||||
},
|
||||
"hazel": {
|
||||
"ref_audio": "cloned-voices/hazel.wav",
|
||||
"ref_text": "i believe in the training of people to their highest capacity the englishman here heartily seconded him",
|
||||
"ref_text": "I believe in the training of people to their highest capacity the englishman here heartily seconded him.",
|
||||
"speaker_id": "1995",
|
||||
"gender": "female",
|
||||
"duration": 7.0
|
||||
},
|
||||
"iris": {
|
||||
"ref_audio": "cloned-voices/iris.wav",
|
||||
"ref_text": "gold is the most common metal in the land of oz and is used for many purposes because it is soft and pliable",
|
||||
"ref_text": "Gold is the most common metal in the land of oz and is used for many purposes because it is soft and pliable.",
|
||||
"speaker_id": "1284",
|
||||
"gender": "female",
|
||||
"duration": 7.2
|
||||
|
|
@ -92,7 +92,7 @@
|
|||
},
|
||||
"cora": {
|
||||
"ref_audio": "cloned-voices/cora.wav",
|
||||
"ref_text": "\"'The alternative was that someone passing \"'had observed the key in the door, \"'had known that I was out, \"'and had entered to look at the papers.'",
|
||||
"ref_text": "The alternative was that someone passing had observed the key in the door, had known that I was out, and had entered to look at the papers.",
|
||||
"speaker_id": "1580",
|
||||
"gender": "female",
|
||||
"duration": 7.0
|
||||
|
|
@ -127,7 +127,7 @@
|
|||
},
|
||||
"hope": {
|
||||
"ref_audio": "cloned-voices/hope.wav",
|
||||
"ref_text": "\"'Mr. Graff,' said Kenneth, noticing the boy's face critically, as he stood where the light from the passage fell upon it.",
|
||||
"ref_text": "Mr. Graff,' said Kenneth, noticing the boy's face critically, as he stood where the light from the passage fell upon it.",
|
||||
"speaker_id": "6829",
|
||||
"gender": "female",
|
||||
"duration": 7.1
|
||||
|
|
@ -141,7 +141,7 @@
|
|||
},
|
||||
"atlas": {
|
||||
"ref_audio": "cloned-voices/atlas.wav",
|
||||
"ref_text": "\"'It is you who are mistaken, Raoul. I have read his distress in his eyes, in his every gesture and action the whole day.'",
|
||||
"ref_text": "It is you who are mistaken, Raoul. I have read his distress in his eyes, in his every gesture and action the whole day.",
|
||||
"speaker_id": "6930",
|
||||
"gender": "male",
|
||||
"duration": 7.3
|
||||
|
|
@ -155,14 +155,14 @@
|
|||
},
|
||||
"felix": {
|
||||
"ref_audio": "cloned-voices/felix.wav",
|
||||
"ref_text": "she saw that the bed was gilded and so rich that it seemed that of a prince rather than of a private gentleman",
|
||||
"ref_text": "She saw that the bed was gilded and so rich that it seemed that of a prince rather than of a private gentleman.",
|
||||
"speaker_id": "5639",
|
||||
"gender": "male",
|
||||
"duration": 6.9
|
||||
},
|
||||
"hugo": {
|
||||
"ref_audio": "cloned-voices/hugo.wav",
|
||||
"ref_text": "cried Alice again, for this time the mouse was bristling all over, and she felt certain it must be really offended.",
|
||||
"ref_text": "Cried Alice again, for this time the mouse was bristling all over, and she felt certain it must be really offended.",
|
||||
"speaker_id": "260",
|
||||
"gender": "male",
|
||||
"duration": 6.6
|
||||
|
|
@ -176,7 +176,7 @@
|
|||
},
|
||||
"kai": {
|
||||
"ref_audio": "cloned-voices/kai.wav",
|
||||
"ref_text": "Upon this, Madame deigned to turn her eyes languishingly towards the comte, observing a",
|
||||
"ref_text": "Upon this, Madame deigned to turn her eyes languishingly towards the comte, observing a.",
|
||||
"speaker_id": "7127",
|
||||
"gender": "male",
|
||||
"duration": 6.6
|
||||
|
|
@ -211,7 +211,7 @@
|
|||
},
|
||||
"archer": {
|
||||
"ref_audio": "cloned-voices/archer.wav",
|
||||
"ref_text": "\"'What is the tumult and rioting?' cried out the squire authoritatively, and he blew twice on the silver whistle which hung at his belt.",
|
||||
"ref_text": "What is the tumult and rioting?' cried out the squire authoritatively, and he blew twice on the silver whistle which hung at his belt.",
|
||||
"speaker_id": "61",
|
||||
"gender": "male",
|
||||
"duration": 7.5
|
||||
|
|
@ -225,7 +225,7 @@
|
|||
},
|
||||
"cole": {
|
||||
"ref_audio": "cloned-voices/cole.wav",
|
||||
"ref_text": "like the dove's voice, like transient day, like music in the air. Ah!",
|
||||
"ref_text": "Like the dove's voice, like transient day, like music in the air. Ah!",
|
||||
"speaker_id": "908",
|
||||
"gender": "male",
|
||||
"duration": 7.0
|
||||
|
|
@ -246,7 +246,7 @@
|
|||
},
|
||||
"finn": {
|
||||
"ref_audio": "cloned-voices/finn.wav",
|
||||
"ref_text": "\"'Why, if we erect a station at the Falls, it is a great economy to get it up to the city.'",
|
||||
"ref_text": "Why, if we erect a station at the Falls, it is a great economy to get it up to the city.",
|
||||
"speaker_id": "2300",
|
||||
"gender": "male",
|
||||
"duration": 6.9
|
||||
|
|
@ -267,14 +267,14 @@
|
|||
},
|
||||
"ivan": {
|
||||
"ref_audio": "cloned-voices/ivan.wav",
|
||||
"ref_text": "Then, turning to Jane, she asked, in a somewhat altered tone, \"'Has she been a good girl, Jane?'",
|
||||
"ref_text": "Then, turning to Jane, she asked, in a somewhat altered tone, Has she been a good girl, Jane?",
|
||||
"speaker_id": "7021",
|
||||
"gender": "male",
|
||||
"duration": 7.0
|
||||
},
|
||||
"jude": {
|
||||
"ref_audio": "cloned-voices/jude.wav",
|
||||
"ref_text": "The king stood up and called for that psalm which begins with these words,",
|
||||
"ref_text": "The king stood up and called for that psalm which begins with these words,.",
|
||||
"speaker_id": "8224",
|
||||
"gender": "male",
|
||||
"duration": 6.8
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
{
|
||||
"amber": "Hay fever. A heart trouble caused by falling in love with a grass widow.",
|
||||
"archer": "\"'What is the tumult and rioting?' cried out the squire authoritatively, and he blew twice on the silver whistle which hung at his belt.",
|
||||
"archer": "What is the tumult and rioting?' cried out the squire authoritatively, and he blew twice on the silver whistle which hung at his belt.",
|
||||
"aria": "But the windows are patched with wooden panes, and the door, I think, is like the gate. It is never opened.",
|
||||
"atlas": "\"'It is you who are mistaken, Raoul. I have read his distress in his eyes, in his every gesture and action the whole day.'",
|
||||
"atlas": "It is you who are mistaken, Raoul. I have read his distress in his eyes, in his every gesture and action the whole day.",
|
||||
"blake": "In autumn, the woodcutters always came and felled some of the largest trees.",
|
||||
"brooke": "Frank read English slowly, and the more he read about this divorce case, the angrier he grew.",
|
||||
"caleb": "Four or five of the latter only lingered about the door of the prison of Uncas, wary but close observers of the manner of their captive.",
|
||||
"clara": "but it is not with a view to distinction that you should cultivate this talent if you consult your own happiness.",
|
||||
"cole": "like the dove's voice, like transient day, like music in the air. Ah!",
|
||||
"cora": "\"'The alternative was that someone passing \"'had observed the key in the door, \"'had known that I was out, \"'and had entered to look at the papers.'",
|
||||
"clara": "But it is not with a view to distinction that you should cultivate this talent if you consult your own happiness.",
|
||||
"cole": "Like the dove's voice, like transient day, like music in the air. Ah!",
|
||||
"cora": "The alternative was that someone passing had observed the key in the door, had known that I was out, and had entered to look at the papers.",
|
||||
"dane": "The pride of that dim image brought back to his mind the dignity of the office he had refused.",
|
||||
"diana": "The wearers of uniforms and liveries may be roughly divided into two classes, the free and the servile, or the noble and the ignoble.",
|
||||
"eden": "Ruth sat quite still for a time, with face intent and flushed. It was out now.",
|
||||
|
|
@ -16,21 +16,21 @@
|
|||
"ezra": "But in this vignette, copied from Turner, you have the two principles brought out perfectly.",
|
||||
"f5_native": "Some call me nature. Others call me Mother Nature.",
|
||||
"faye": "He gave up his position and shut the family up in that tomb of a house so he could study his books.",
|
||||
"felix": "she saw that the bed was gilded and so rich that it seemed that of a prince rather than of a private gentleman",
|
||||
"finn": "\"'Why, if we erect a station at the Falls, it is a great economy to get it up to the city.'",
|
||||
"felix": "She saw that the bed was gilded and so rich that it seemed that of a prince rather than of a private gentleman.",
|
||||
"finn": "Why, if we erect a station at the Falls, it is a great economy to get it up to the city.",
|
||||
"gemma": "Do you know? Lake? Oh, I really can't tell, but he'll soon tire of country life.",
|
||||
"grace": "as to his age and also the name of his master jacob's statement varied somewhat from the advertisement",
|
||||
"grace": "As to his age and also the name of his master jacob's statement varied somewhat from the advertisement.",
|
||||
"grant": "At the inception of plural marriage among the Latter-day Saints, there was no law, national or state, against its practice.",
|
||||
"hazel": "i believe in the training of people to their highest capacity the englishman here heartily seconded him",
|
||||
"hazel": "I believe in the training of people to their highest capacity the englishman here heartily seconded him.",
|
||||
"heath": "And what demonstration do you offer, asked Cervidac eagerly, that it will not happen?",
|
||||
"hope": "\"'Mr. Graff,' said Kenneth, noticing the boy's face critically, as he stood where the light from the passage fell upon it.",
|
||||
"hugo": "cried Alice again, for this time the mouse was bristling all over, and she felt certain it must be really offended.",
|
||||
"iris": "gold is the most common metal in the land of oz and is used for many purposes because it is soft and pliable",
|
||||
"ivan": "Then, turning to Jane, she asked, in a somewhat altered tone, \"'Has she been a good girl, Jane?'",
|
||||
"hope": "Mr. Graff,' said Kenneth, noticing the boy's face critically, as he stood where the light from the passage fell upon it.",
|
||||
"hugo": "Cried Alice again, for this time the mouse was bristling all over, and she felt certain it must be really offended.",
|
||||
"iris": "Gold is the most common metal in the land of oz and is used for many purposes because it is soft and pliable.",
|
||||
"ivan": "Then, turning to Jane, she asked, in a somewhat altered tone, Has she been a good girl, Jane?",
|
||||
"ivy": "Over the track-lined city street the young men, the grinning men, pass.",
|
||||
"jasper": "That summer's immigration, however, being mainly from the free states, greatly changed the relative strengths of the two parties.",
|
||||
"jude": "The king stood up and called for that psalm which begins with these words,",
|
||||
"kai": "Upon this, Madame deigned to turn her eyes languishingly towards the comte, observing a",
|
||||
"jude": "The king stood up and called for that psalm which begins with these words,.",
|
||||
"kai": "Upon this, Madame deigned to turn her eyes languishingly towards the comte, observing a.",
|
||||
"leo": "The behaviorist who attempts to make psychology a record of behavior has to trust his memory in making the record.",
|
||||
"luna": "The door opened again while I was still studying the two brothers, without, I honestly confess, being very favorably impressed by either of them.",
|
||||
"marcus": "In the old badly made play, it was frequently necessary for one of the characters to take the audience into his confidence.",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue