datatab's picture
Common Voice Serbian: word and letter times
26cf558 verified
|
Raw History Blame Contribute Delete
5.43 kB
metadata
license: cc0-1.0
language:
  - sr
task_categories:
  - automatic-speech-recognition
tags:
  - forced-alignment
  - word-timestamps
  - common-voice
  - serbian
pretty_name: Common Voice Serbian, aligned (word and letter times)
size_categories:
  - 1K<n<10K
configs:
  - config_name: default
    data_files:
      - split: train
        path: data/train-*.parquet

Common Voice Serbian, aligned

Common Voice · Serbian · Aligned

The start and the end of every word and every letter of the validated Serbian sentences of Mozilla Common Voice 17.0.

Common Voice gives a recording and the sentence that was read. It does not say when each word is said. This set adds exactly that. Every row holds the recording itself (the clip of Common Voice, unchanged), its sentence, and the times of its words and letters - ready to use, nothing to join.

sentences 7,645
speakers 150
speech covered (first word to last word) 2.93 hours
words with times 31,373
letters with times 126,847
source Common Voice 17.0, Serbian (sr), validated clips

How it was made

  1. Every validated clip was taken once (a clip listed in more than one split is not repeated).
  2. The sentence was turned into plain Latin words: Cyrillic is transliterated, punctuation is dropped, everything is lower case (text). The sentence as Common Voice has it is kept in sentence.
  3. The words were laid over the sound with the Montreal Forced Aligner on the CPU: acoustic model serbocroatian_mfa, pronunciations from the G2P model serbocroatian_serbian_mfa.
  4. The time of a letter comes from the sound (phone) MFA placed for it. lj, nj and dž are one sound and two letters: each letter gets half of that sound. Where MFA gives a word a different number of sounds than it has letters, the letters share the stretch of the word evenly, in order.

No speech recogniser was used and no text was changed: the sentences of Common Voice are read from a screen and checked by its volunteers, so the text is taken as it is.

What is not in it

Of 7,922 sentences given to the aligner, 7,645 are here. Left out:

  • 266 — MFA could not lay it
  • 8 — times that cannot be (a word of 2.5 s, or 9 words a second)
  • 3 — a word MFA has no sounds for

Never given to the aligner at all: sentences with fewer than 3 words, and sentences with a number written in digits (a digit is heard as a word that the text does not spell).

Columns

column what it is
audio the recording: the clip of Common Voice as it is (mp3), not cut and not re-encoded
path the file name of the clip in Common Voice
client_id the speaker id of Common Voice
sentence the sentence as Common Voice has it
text the words that were aligned, lower case Latin
speech_start, speech_end where the first word begins and the last word ends, seconds from the start of the clip
n_words number of words
words list of {word, start, end}, seconds from the start of the clip
letters list of {letter, start, end}, one per Latin letter of text, in order
held_out_speaker true for 1 speaker in 5 (38 speakers, 1,358 sentences), chosen by a hash of client_id. A suggestion for a test split with speakers that are in no training data; the models of the author never learn from these rows
up_votes, down_votes, age, gender, accent, locale, segment, variant as in Common Voice

All times are in seconds from the start of the recording.

An example

common_voice_sr_26552820.mp3 — To si ti uradio?

word start end
to 0.84 0.96
si 1.04 1.23
ti 1.28 1.44
uradio 1.47 1.78

The letters of the first word: t 0.84–0.93, o 0.93–0.96

Use

from datasets import load_dataset
al = load_dataset("datatab/common-voice-sr-aligned", split="train")
row = al[0]
print(row["path"], row["text"])
for w in row["words"]:
    print(f'{w["start"]:6.2f} {w["end"]:6.2f}  {w["word"]}')

To cut a word out of its recording:

import io, soundfile as sf
from datasets import Audio
row = al.cast_column("audio", Audio(decode=False))[0]        # the bytes of the clip, as they are
x, sr = sf.read(io.BytesIO(row["audio"]["bytes"]))
w = row["words"][0]
piece = x[int(w["start"] * sr):int(w["end"] * sr)]

How exact are the times

MFA works in steps of 10 ms. The same procedure (same tool, same acoustic model) was checked on 600 sentences of ParlaSpeech-RS 4.0 against the alignment of its authors: half of the word borders were within 10 ms of theirs, 90.7% within 50 ms and 95.6% within 100 ms. That check was made on parliament speech, not on Common Voice; here the recordings come from home microphones and no second alignment exists to compare with. Treat a border as good to a few tens of milliseconds, not to the millisecond.

Licence and credit

The sentences and recordings are from Mozilla Common Voice 17.0, released under CC0-1.0; they are passed on here unchanged. The times added in this set are released under CC0-1.0 as well. As Common Voice asks: do not try to find out who the speakers are.

Made by datatab while building a small Serbian speech-to-text model (CAWN / hCAWN).