diff --git a/.gitattributes b/.gitattributes index a6344aac8c09253b3b630fb776ae94478aa0275b..3b8dec6aa65abb11bcf9465878fe288f84bcd05a 100644 --- a/.gitattributes +++ b/.gitattributes @@ -33,3 +33,7 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text *.zip filter=lfs diff=lfs merge=lfs -text *.zst filter=lfs diff=lfs merge=lfs -text *tfevents* filter=lfs diff=lfs merge=lfs -text +default_voices/AmericanFemale.mp3 filter=lfs diff=lfs merge=lfs -text +default_voices/AmericanMale.mp3 filter=lfs diff=lfs merge=lfs -text +default_voices/BritishFemale.mp3 filter=lfs diff=lfs merge=lfs -text +zonos3/vendor/nemo_text_processing/text_normalization/en/data/number/cardinal_number_name.far filter=lfs diff=lfs merge=lfs -text diff --git a/README.md b/README.md index 3785087597d28fbd33b9ff9c45e46725397f3655..b33182b56f5096b0cb26c5d1bfbff2743d8eb15d 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,22 @@ --- title: ZONOS3 Mini -emoji: 👁 -colorFrom: yellow -colorTo: purple sdk: gradio -sdk_version: 6.31.0 -python_version: '3.13' +sdk_version: 6.17.3 +python_version: "3.12.12" app_file: app.py pinned: false +short_description: Multilingual TTS with voice cloning and steering controls +startup_duration_timeout: 1h +models: + - Zyphra/ZONOS3_Mini_release_ckpts --- -Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference +# ZONOS3 Mini + +Runs the plain-PyTorch reference implementation of ZONOS3 Mini on ZeroGPU: multilingual +text-to-speech with preset or uploaded voices and the studio's steering controls. + +The first start downloads about 10.5 GB of weights and builds the text-normalization grammars, +so it takes several minutes. + +Source: `space/` in Zyphra/ZONOS3, deployed with `space/deploy.py`. diff --git a/app.py b/app.py new file mode 100644 index 0000000000000000000000000000000000000000..16615051d7be8d6cc265a85d2b30867c378c2635 --- /dev/null +++ b/app.py @@ -0,0 +1,290 @@ +"""ZONOS3 Mini on a ZeroGPU Space: the plain-PyTorch reference (zonos3.reference) behind a Gradio UI.""" + +import spaces # noqa: I001 (ZeroGPU: must be imported before torch) + +import base64 +import re +import secrets +from pathlib import Path + +import gradio as gr +import numpy as np +import torch + +from zonos3 import languages +from zonos3.generation import SAMPLE_RATE, SAMPLING +from zonos3.reference.lm import Zonos3LM +from zonos3.reference.synth import ReferenceAssets, synthesize +from zonos3.tokenizer import matched_codec +from zonos3.tts.steering import controls_document +from zonos3.utils.release import RELEASE_LM, resolve_dir_or_local + +ROOT = Path(__file__).resolve().parent +# One device object everywhere: synthesize() moves the LM when lm.device != device, and ReferenceAssets +# caches the decoder / speaker encoder by str(device). +DEVICE = torch.device("cuda:0") + +LM = Zonos3LM.load(RELEASE_LM, device="cpu", dtype=torch.float32).to(DEVICE) +ASSETS = ReferenceAssets.load(steer_bundle=str(ROOT / "steering" / "studio_bundle_mect60k.json")) +ASSETS.decoder(LM.config.audio_codec, DEVICE) +ASSETS.speaker_encoder(LM.config.speaker_embedding_codec, LM.config.speaker_embedding_dim, DEVICE) +# The dual-codec encoder needs real CUDA (it loads inside the GPU worker); fetch its teacher folder now. +_DUAL = next(e for e in matched_codec.registry().values() if e.get("family") == "dual") +resolve_dir_or_local(_DUAL["teacher"]) + +# All nine NeMo grammars, synchronously: GPU workers are forked from this process. +NORMALIZER = ASSETS.normalizer() +NORMALIZER.warmup() + +CONTROLS = controls_document( + ASSETS.steer_bundle, speaker_embedding_dim=LM.config.speaker_embedding_dim +) +UI = CONTROLS["ui"] +N_CONTROLS = len(UI["controls"]) + +PRESETS = { + re.sub(r"(? bool: + """A control or accent is usable in a speaker mode when every direction it maps to is.""" + maps = [spec["map"].get("+"), spec["map"].get("-")] if "type" in spec else [spec["map"]] + for m in maps: + for did in m or {}: + direction = CONTROLS["directions"].get(did) + if direction is None: + return False + if mode not in CONTROLS["sets"].get(direction["set"], {}).get("modes", []): + return False + return True + + +def control_doses( + values: list[float], accents: list[float], mode: str +) -> tuple[dict[str, float], list[str]]: + """UI slider values → primitive `controls` doses for `mode`, plus labels of the dropped ones.""" + out: dict[str, float] = {} + dropped: list[str] = [] + + def add(m: dict | None, scale: float) -> None: + for did, w in (m or {}).items(): + out[did] = out.get(did, 0.0) + w * scale + + for spec, v in zip(UI["controls"], values, strict=True): + if not v: + continue + if not usable(spec, mode): + dropped.append(spec["label"]) + elif v > 0: + add(spec["map"].get("+"), v) + else: + add(spec["map"].get("-"), -v) + for spec, s in zip(UI["accents"], accents, strict=True): + if not s: + continue + if usable(spec, mode): + add(spec["map"], s) + else: + dropped.append(f"{spec['label']} accent") + doses = {did: round(x, 4) for did, x in out.items()} + return {did: x for did, x in doses.items() if x}, dropped + + +def preset_values(name: str | None) -> list[float]: + """Control values then accent strengths for a named preset (all zeros for None).""" + preset = UI["presets"].get(name, {}) if name else {} + + def value(spec: dict, key: str) -> float: + lo, hi = spec["range"] + return float(min(max(preset.get(key, 0.0), lo), hi)) + + return [value(c, c["id"]) for c in UI["controls"]] + [ + value(a, f"accent:{a['id']}") for a in UI["accents"] + ] + + +# ------------------------------------------------------------------------------------------- GPU + + +def gpu_seconds(request: dict) -> int: + base = 30 + clip = 60 if request["speaker_mode"] == "reference" and "speaker_audio_base64" in request else 0 + cfg = 2 if request["speaker_cfg_scale"] != 1.0 else 1 + return min(300, int(base + clip + 0.15 * len(request["text"]) * cfg)) + + +@spaces.GPU(duration=gpu_seconds) +def generate_audio(request: dict) -> tuple[int, np.ndarray]: + try: + result = synthesize(LM, request, assets=ASSETS, device=DEVICE) + except ValueError as exc: + raise gr.Error(str(exc)) from exc + return SAMPLE_RATE, (np.clip(result.pcm, -1.0, 1.0) * 32767.0).astype(np.int16) + + +# ----------------------------------------------------------------------------------------- request + + +def run( + text, language, voice, clip, speaker_mode, seed, randomize_seed, normalize, + speaker_cfg_scale, temperature, topk, top_p, min_p, repetition_penalty, *sliders, +): + if not text.strip(): + raise gr.Error("Enter some text.") + if voice == CUSTOM_VOICE and clip is None: + raise gr.Error("Upload or record a clip, or pick a preset voice.") + seed = secrets.randbelow(2**31) if randomize_seed else int(seed) + if normalize: + text = NORMALIZER.normalize(text, language) + request = { + "text": text, + "language": language, + "text_normalization": False, + "seed": seed, + "speaker_mode": speaker_mode, + "speaker_cfg_scale": float(speaker_cfg_scale), + "temperature": float(temperature), + "topk": int(topk), + "top_p": float(top_p), + "min_p": float(min_p), + "repetition_penalty": float(repetition_penalty), + } + if voice == CUSTOM_VOICE: + path = Path(clip) + request["speaker_audio_base64"] = base64.b64encode(path.read_bytes()).decode("ascii") + request["speaker_audio_name"] = path.name + elif speaker_mode == "reference": + request["speaker_reference_codes"] = PRESETS[voice]["codes"] + else: + request["speaker_audio_base64"] = PRESETS[voice]["audio_b64"] + doses, dropped = control_doses( + list(sliders[:N_CONTROLS]), list(sliders[N_CONTROLS:]), speaker_mode + ) + if doses: + request["controls"] = doses + rate, pcm = generate_audio(request) + status = f"Seed {seed} · {len(pcm) / rate:.1f} s" + if dropped: + status += f" · ignored in reference mode: {', '.join(dropped)}" + return (rate, pcm), seed, status + + +# ---------------------------------------------------------------------------------------------- UI + + +def slider_info(spec: dict) -> str: + safe = f"tested-safe {spec['safe'][0]}…{spec['safe'][1]}" + bipolar = spec.get("type") == "bipolar" + info = f"{spec['poles'][0]} ↔ {spec['poles'][1]} · {safe}" if bipolar else safe + return f"{info} · {spec['effect']}" if spec.get("effect") else info + + +DEFAULT_MODE = UI["request_defaults"]["speaker_mode"] + +with gr.Blocks(title="ZONOS3 Mini") as demo: + gr.Markdown( + "# ZONOS3 Mini\nMultilingual text-to-speech with preset or cloned voices and steering " + "controls (plain-PyTorch reference on ZeroGPU)." + ) + with gr.Row(): + with gr.Column(): + text = gr.Textbox( + label="Text", lines=4, max_length=MAX_TEXT_CHARS, value=UI["preview_text"] + ) + language = gr.Dropdown( + label="Language", choices=[(lang.label, lang.code) for lang in languages.SERVER], + value="en_us", + ) + voice = gr.Radio( + label="Voice", choices=[*PRESETS, CUSTOM_VOICE], value=next(iter(PRESETS)) + ) + clip = gr.Audio( + label="Custom clip (used when Voice is 'Custom clip'; up to 60 s)", + sources=["upload", "microphone"], type="filepath", + ) + speaker_mode = gr.Radio( + label="Speaker mode", + choices=[ + ("Embedding (all controls)", "embedding"), + ("Reference (closest clone; Who/Texture/Room/Accent off)", "reference"), + ], + value=DEFAULT_MODE, + ) + with gr.Row(): + seed = gr.Number(label="Seed", precision=0, value=0) + randomize_seed = gr.Checkbox(label="Randomize seed", value=True) + normalize = gr.Checkbox(label="Normalize text", value=True) + generate = gr.Button("Generate", variant="primary") + + with gr.Row(): + preset = gr.Dropdown(label="Preset", choices=list(UI["presets"]), value=None) + reset = gr.Button("Reset controls") + sliders: dict[str, gr.Slider] = {} + for group in UI["groups"]: + with gr.Accordion(group["label"], open=False): + if group["id"] == "accent": + for a in UI["accents"]: + sliders[f"accent:{a['id']}"] = gr.Slider( + minimum=0, maximum=a["range"][1], value=0, step=0.1, + label=f"{a['label']} ({a['tab']})", info=slider_info(a), + interactive=usable(a, DEFAULT_MODE), + ) + else: + for c in UI["controls"]: + if c["group"] == group["id"]: + sliders[c["id"]] = gr.Slider( + minimum=c["range"][0], maximum=c["range"][1], value=0, + step=0.1, label=c["label"], info=slider_info(c), + interactive=usable(c, DEFAULT_MODE), + ) + control_sliders = [sliders[c["id"]] for c in UI["controls"]] + accent_sliders = [sliders[f"accent:{a['id']}"] for a in UI["accents"]] + + with gr.Accordion("Advanced", open=False): + speaker_cfg = gr.Slider( + 1.0, 3.0, value=UI["request_defaults"]["speaker_cfg_scale"], step=0.1, + label="Speaker CFG", + ) + temperature = gr.Slider( + 0.1, 1.5, value=SAMPLING["temperature"], step=0.05, label="Temperature" + ) + topk = gr.Slider(1, 200, value=UI["request_defaults"]["topk"], step=1, label="Top-k") + top_p = gr.Slider(0.05, 1.0, value=SAMPLING["top_p"], step=0.01, label="Top-p") + min_p = gr.Slider(0.0, 0.5, value=SAMPLING["min_p"], step=0.01, label="Min-p") + repetition_penalty = gr.Slider( + 1.0, 4.0, value=SAMPLING["repetition_penalty"], step=0.1, + label="Repetition penalty", + ) + with gr.Column(): + output_audio = gr.Audio(label="Output", type="numpy", interactive=False) + status = gr.Markdown() + + all_sliders = [*control_sliders, *accent_sliders] + generate.click( + run, + inputs=[ + text, language, voice, clip, speaker_mode, seed, randomize_seed, normalize, + speaker_cfg, temperature, topk, top_p, min_p, repetition_penalty, *all_sliders, + ], + outputs=[output_audio, seed, status], + api_name="generate", + ) + preset.change(preset_values, inputs=preset, outputs=all_sliders) + reset.click(lambda: [None, *preset_values(None)], outputs=[preset, *all_sliders]) + speaker_mode.change( + lambda m: [gr.Slider(interactive=usable(s, m)) for s in UI["controls"] + UI["accents"]], + inputs=speaker_mode, + outputs=all_sliders, + ) + +demo.launch() diff --git a/default_voices/AmericanFemale.codes.npy b/default_voices/AmericanFemale.codes.npy new file mode 100644 index 0000000000000000000000000000000000000000..96ca923b578bbda374d5309dbc74121c0ec4d6cb --- /dev/null +++ b/default_voices/AmericanFemale.codes.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:34d14eaeae9f18e5780147680043e89147c86f3496c0d7cba1dfa6920bb2f900 +size 9448 diff --git a/default_voices/AmericanFemale.mp3 b/default_voices/AmericanFemale.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..94282ecd66d562b28171a2a959ed8d7870d1fcfc --- /dev/null +++ b/default_voices/AmericanFemale.mp3 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e917cb7893fc7c49318143aca79cecf7536f74d1527002c31cc8632e86b9bec3 +size 241034 diff --git a/default_voices/AmericanMale.codes.npy b/default_voices/AmericanMale.codes.npy new file mode 100644 index 0000000000000000000000000000000000000000..47a27d961517cdac171e98c63b97d3cf7e4a3ffa --- /dev/null +++ b/default_voices/AmericanMale.codes.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bae54f7db93186c7b6b44d801e35971c1a4055cfdc5298acb231f1d8fe449dde +size 14488 diff --git a/default_voices/AmericanMale.mp3 b/default_voices/AmericanMale.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..2eb335d653fe7f6d4e79fbcef4a26a503ee39e85 --- /dev/null +++ b/default_voices/AmericanMale.mp3 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d7d40fbf1256119e4c9981221c5237432eb579c9487a9246167bad8af424d773 +size 480227 diff --git a/default_voices/BritishFemale.codes.npy b/default_voices/BritishFemale.codes.npy new file mode 100644 index 0000000000000000000000000000000000000000..08b114d82e74c294e5cb6d9809043cbf98c234b1 --- /dev/null +++ b/default_voices/BritishFemale.codes.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:850434818c2592bc88d1a1cb8f88ec8ed5f946dfd3d8aa273ba6d26f0a76dbbb +size 14208 diff --git a/default_voices/BritishFemale.mp3 b/default_voices/BritishFemale.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..07df4b6bc47642c1418d1b82472a76a2281fba14 --- /dev/null +++ b/default_voices/BritishFemale.mp3 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:706d55ea899e2bea280b9eee7280f60ad2052ca0a99e47788fbcd6ca69a1e089 +size 414605 diff --git a/packages.txt b/packages.txt new file mode 100644 index 0000000000000000000000000000000000000000..20645e641240cb419f5fc66c14c1447e91daf669 --- /dev/null +++ b/packages.txt @@ -0,0 +1 @@ +ffmpeg diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..124dc2c5325a9e9d4bb1644630c9f8bbb3e4a065 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,14 @@ +torch==2.9.1 +torchaudio==2.9.1 +transformers==4.57.3 +huggingface_hub==0.36.0 +descript-audio-codec==1.0.0 +numpy==2.4.1 +soundfile==0.13.1 +tokenizers==0.22.2 +pynini==2.1.6 +regex==2025.11.3 +joblib==1.5.3 +sacremoses==0.1.1 +tqdm==4.67.1 +pyyaml==6.0.3 diff --git a/steering/accent_directions_mect60k/hin.npy b/steering/accent_directions_mect60k/hin.npy new file mode 100644 index 0000000000000000000000000000000000000000..99deb633b25116a4387197d46da25ca81db76e2a --- /dev/null +++ b/steering/accent_directions_mect60k/hin.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cc1f506bc3c77a39b87dde1eda21348c9845e790f5e9fb111aee7cf4a123665f +size 4224 diff --git a/steering/accent_directions_mect60k/manifest.json b/steering/accent_directions_mect60k/manifest.json new file mode 100644 index 0000000000000000000000000000000000000000..27f4dd82f55fe00a8d14f0ebdd766bd903e55b9a --- /dev/null +++ b/steering/accent_directions_mect60k/manifest.json @@ -0,0 +1,22 @@ +{ + "dim": 1024, + "space": "attnres_source", + "source_index": 15, + "source_name": "L7.attn", + "neutral": "eng", + "checkpoint": "/data/groups/audio/gabriel/hf_release_zonos3mini_20261020/lm/mect_60k", + "row_norm": 0.4042471716391197, + "clips": 9713, + "prompt_conditioning": "speaker_row=own,condition_rows=3:unknown,pools=/data/groups/audio/sofian/runs/accent_steering/clips_l2eng", + "directions": { + "hin": { + "file": "hin.npy", + "kind": "named", + "norm": 0.13439911603927612, + "snr": 0.48619717359542847, + "clips": 800, + "data": "pool" + } + }, + "note": "Accented English minus English at L7.attn: English-labelled zv3subsample segments with the largest MMS-LID Hindi posterior (lingua apps.zonos.accented_english_keys; 39% top-pods-intl/pods/in) vs native English, 800 clips each. accent_strength 1 = the measured shift; validated with the ZTTS2-Eval accent harness (results/_accent_steering_mect60k/hin_l2eng_s15)." +} diff --git a/steering/channel_mect60k/clean.npy b/steering/channel_mect60k/clean.npy new file mode 100644 index 0000000000000000000000000000000000000000..13198e45cb2abfa84729a89cbd8bf1722da2148e --- /dev/null +++ b/steering/channel_mect60k/clean.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cf7bade0544633eb8317d02e626b8d1824887f2b9984e9c2fb7f489c65a995de +size 896 diff --git a/steering/channel_mect60k/eval_summary.json b/steering/channel_mect60k/eval_summary.json new file mode 100644 index 0000000000000000000000000000000000000000..cde333d05ee7af07f030920e150a0a25a3d1eacc --- /dev/null +++ b/steering/channel_mect60k/eval_summary.json @@ -0,0 +1,702 @@ +{ + "all": { + "neutral": { + "wer": 0.004866946778711485, + "collapse": 0.0, + "identity": 0.9463956918186919, + "durx": 1.0, + "female": 0.4983073752615989, + "age": 41.317688735822834, + "f0": 136.19757792145845, + "f0_st": 2.903048200564409, + "voiced": 0.6307535235563585, + "rms_db": -38.16175572077433, + "snr_db": 39.82410788536072, + "bandwidth": 8300.152587890625 + }, + "clean -8": { + "wer": 0.11618095750886166, + "collapse": 0.125, + "identity": 0.5366230731534662, + "durx": 0.8969610636277303, + "female": 0.5480646657912681, + "age": 37.84326041738192, + "f0": 183.89776978725556, + "f0_st": 3.751899738308408, + "voiced": 0.5721863148402521, + "rms_db": -32.35019977887472, + "snr_db": 17.558393319447834, + "bandwidth": 9266.903686523438 + }, + "clean -4": { + "wer": 0.038541286079649247, + "collapse": 0.041666666666666664, + "identity": 0.8241410272035181, + "durx": 0.8680626489615253, + "female": 0.5018800143540526, + "age": 41.22090544551611, + "f0": 148.2991139757817, + "f0_st": 2.9132039878371674, + "voiced": 0.5869771659506015, + "rms_db": -37.25071303049723, + "snr_db": 23.43547574679057, + "bandwidth": 8881.997680664062 + }, + "clean -2": { + "wer": 0.004901960784313725, + "collapse": 0.0, + "identity": 0.8953117237762593, + "durx": 0.9264461090303786, + "female": 0.5150010973981504, + "age": 40.441353557010494, + "f0": 141.0334789383672, + "f0_st": 2.4760033446845395, + "voiced": 0.5986334640490037, + "rms_db": -37.42417971293131, + "snr_db": 27.511621554692585, + "bandwidth": 8504.718017578125 + }, + "clean +2": { + "wer": 0.0012254901960784314, + "collapse": 0.0, + "identity": 0.9128066314581291, + "durx": 1.0491668825002158, + "female": 0.49768549199507106, + "age": 42.7596158037583, + "f0": 137.72053615050731, + "f0_st": 2.9618686730575114, + "voiced": 0.6750870962301742, + "rms_db": -35.11836369832357, + "snr_db": 49.10927645365397, + "bandwidth": 8865.847778320312 + }, + "clean +4": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.896551037511525, + "durx": 1.0997498436522828, + "female": 0.49801832646577776, + "age": 43.47227203349272, + "f0": 141.48602057421155, + "f0_st": 3.331662092467601, + "voiced": 0.6778310198192353, + "rms_db": -33.46127541859945, + "snr_db": 58.40580987930298, + "bandwidth": 9890.469360351562 + }, + "clean +8": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.8334763114785337, + "durx": 1.1165501165501164, + "female": 0.49218456182764686, + "age": 42.09242003659407, + "f0": 144.45158549647326, + "f0_st": 3.757560061983033, + "voiced": 0.7127722228306697, + "rms_db": -32.224674463272095, + "snr_db": 68.11199617385864, + "bandwidth": 11221.490478515625 + } + }, + "American Female": { + "neutral": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.950361505518176, + "durx": 1.0, + "female": 0.9827781617641449, + "age": 29.750093817710876, + "f0": 155.81481265779422, + "f0_st": 1.8082626788764102, + "voiced": 0.678813494199399, + "rms_db": -29.80318832397461, + "snr_db": 38.62734889984131, + "bandwidth": 6026.605224609375 + }, + "clean -8": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.6900374927046984, + "durx": 0.7560119047619047, + "female": 0.9813219010829926, + "age": 31.662610918283463, + "f0": 171.0525232773398, + "f0_st": 2.1939322345537424, + "voiced": 0.6768792269821102, + "rms_db": -31.033190727233887, + "snr_db": 17.520348072052002, + "bandwidth": 5738.5986328125 + }, + "clean -4": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.862402399716651, + "durx": 0.8284313725490196, + "female": 0.9800302088260651, + "age": 30.036436766386032, + "f0": 156.12694350169158, + "f0_st": 1.8532027404678244, + "voiced": 0.6903132298685903, + "rms_db": -31.39401340484619, + "snr_db": 25.18285083770752, + "bandwidth": 5609.3994140625 + }, + "clean -2": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9195898058919028, + "durx": 0.9378273809523809, + "female": 0.9820193648338318, + "age": 28.213229030370712, + "f0": 156.53596418387784, + "f0_st": 1.9061339746887036, + "voiced": 0.6590308739217086, + "rms_db": -30.336423873901367, + "snr_db": 32.997093200683594, + "bandwidth": 5639.007568359375 + }, + "clean +2": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9249865309237348, + "durx": 1.1858823529411766, + "female": 0.9810979217290878, + "age": 30.05310446023941, + "f0": 159.687369758905, + "f0_st": 2.2021038383987923, + "voiced": 0.6836592792031362, + "rms_db": -29.743972778320312, + "snr_db": 58.52098846435547, + "bandwidth": 7603.912353515625 + }, + "clean +4": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9106967735489755, + "durx": 1.2993277310924372, + "female": 0.9839924871921539, + "age": 30.224989354610443, + "f0": 165.84235157721167, + "f0_st": 2.5084269421341725, + "voiced": 0.6507227339589454, + "rms_db": -29.64600706100464, + "snr_db": 69.19759941101074, + "bandwidth": 8936.279296875 + }, + "clean +8": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.8160981583667275, + "durx": 1.2236974789915966, + "female": 0.9576015323400497, + "age": 27.760913223028183, + "f0": 168.67594186811093, + "f0_st": 3.1400693774948705, + "voiced": 0.6831252155880936, + "rms_db": -29.608139514923096, + "snr_db": 74.3608341217041, + "bandwidth": 9498.834228515625 + } + }, + "American Male": { + "neutral": { + "wer": 0.007352941176470588, + "collapse": 0.0, + "identity": 0.944281897024579, + "durx": 1.0, + "female": 0.0021247467666398734, + "age": 48.121464252471924, + "f0": 116.91828356269122, + "f0_st": 4.913690931254914, + "voiced": 0.4680676167050811, + "rms_db": -43.39509105682373, + "snr_db": 39.194278717041016, + "bandwidth": 8204.150390625 + }, + "clean -8": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.7088325216786636, + "durx": 0.8594426406926408, + "female": 0.0023521866532973945, + "age": 47.22038209438324, + "f0": 122.78843719010503, + "f0_st": 3.164763598990955, + "voiced": 0.27870537993081157, + "rms_db": -32.18381929397583, + "snr_db": 14.442923545837402, + "bandwidth": 9733.0078125 + }, + "clean -4": { + "wer": 0.21323529411764705, + "collapse": 0.25, + "identity": 0.7796460077810933, + "durx": 0.9036796536796539, + "female": 0.0022517999750562012, + "age": 51.280879974365234, + "f0": 125.46454643880497, + "f0_st": 2.3709051131415135, + "voiced": 0.4030454498243759, + "rms_db": -41.120361328125, + "snr_db": 27.586724281311035, + "bandwidth": 10309.02099609375 + }, + "clean -2": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.8979662290337235, + "durx": 0.9655782848151062, + "female": 0.002236635860754177, + "age": 47.296685725450516, + "f0": 117.97505459173895, + "f0_st": 2.295273631990515, + "voiced": 0.3003544197051146, + "rms_db": -44.275421142578125, + "snr_db": 26.776583194732666, + "bandwidth": 9003.570556640625 + }, + "clean +2": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9071636646950366, + "durx": 1.0539554531490016, + "female": 0.0018901773728430271, + "age": 51.50161609053612, + "f0": 115.0157971386016, + "f0_st": 4.250575513015256, + "voiced": 0.6375733618541805, + "rms_db": -39.1222038269043, + "snr_db": 49.11924934387207, + "bandwidth": 8021.1181640625 + }, + "clean +4": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.895698269039231, + "durx": 1.0925124573826381, + "female": 0.002163118391763419, + "age": 50.385020673274994, + "f0": 113.9119226155694, + "f0_st": 4.619627254192967, + "voiced": 0.6872094589120622, + "rms_db": -36.78094673156738, + "snr_db": 60.44081783294678, + "bandwidth": 8696.722412109375 + }, + "clean +8": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.8264737619464793, + "durx": 1.1258851298190402, + "female": 0.0019298568658996373, + "age": 52.08096131682396, + "f0": 118.12652103041253, + "f0_st": 4.640815677245043, + "voiced": 0.7080579460603592, + "rms_db": -31.804635047912598, + "snr_db": 66.92804145812988, + "bandwidth": 11089.599609375 + } + }, + "British Female": { + "neutral": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9646508989039382, + "durx": 1.0, + "female": 0.9985478520393372, + "age": 48.11074435710907, + "f0": 145.18670227011933, + "f0_st": 3.120616918031748, + "voiced": 0.684659116272671, + "rms_db": -34.987064361572266, + "snr_db": 43.8385124206543, + "bandwidth": 9003.570556640625 + }, + "clean -8": { + "wer": 0.007352941176470588, + "collapse": 0.0, + "identity": 0.655511713740059, + "durx": 0.7871110630942091, + "female": 0.9963381886482239, + "age": 43.87347176671028, + "f0": 176.74183510346694, + "f0_st": 5.75344525770255, + "voiced": 0.5238985248781196, + "rms_db": -32.64195251464844, + "snr_db": 15.13669204711914, + "bandwidth": 9366.943359375 + }, + "clean -4": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.885893059062751, + "durx": 0.8680626489615253, + "female": 0.9982717782258987, + "age": 47.289013117551804, + "f0": 154.5216449934045, + "f0_st": 3.7647001066577874, + "voiced": 0.6249740476323785, + "rms_db": -37.73430252075195, + "snr_db": 24.186354637145996, + "bandwidth": 9738.39111328125 + }, + "clean -2": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9249021547058239, + "durx": 0.9281296107138803, + "female": 0.9986347705125809, + "age": 44.832245260477066, + "f0": 143.34452747941558, + "f0_st": 2.764725147968736, + "voiced": 0.6425417324415641, + "rms_db": -35.05423355102539, + "snr_db": 30.397499084472656, + "bandwidth": 9132.769775390625 + }, + "clean +2": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9267276233678016, + "durx": 0.987090001134945, + "female": 0.9984954744577408, + "age": 50.49605220556259, + "f0": 146.21390325187988, + "f0_st": 3.5485677154910795, + "voiced": 0.7143795717593154, + "rms_db": -34.04744052886963, + "snr_db": 51.56220054626465, + "bandwidth": 10314.404296875 + }, + "clean +4": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.8911166655158799, + "durx": 1.0473206568712188, + "female": 0.9985356330871582, + "age": 51.649708300828934, + "f0": 147.49852382806765, + "f0_st": 3.903104171413233, + "voiced": 0.7039437780391382, + "rms_db": -35.938748359680176, + "snr_db": 60.34027862548828, + "bandwidth": 11234.94873046875 + }, + "clean +8": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.8528572376579199, + "durx": 1.0937742812742812, + "female": 0.9969689100980759, + "age": 49.79445934295654, + "f0": 156.1632782627205, + "f0_st": 4.862966017105031, + "voiced": 0.7389793196339607, + "rms_db": -32.849087715148926, + "snr_db": 64.95539951324463, + "bandwidth": 12704.58984375 + } + }, + "British Male": { + "neutral": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9536403536976914, + "durx": 1.0, + "female": 0.005018519994337112, + "age": 19.837047532200813, + "f0": 88.88241321026631, + "f0_st": 2.4990147456627976, + "voiced": 0.5315726962367779, + "rms_db": -39.36486530303955, + "snr_db": 35.08437442779541, + "bandwidth": 11011.541748046875 + }, + "clean -8": { + "wer": 0.402304674730304, + "collapse": 0.5, + "identity": 0.27495905427609524, + "durx": 0.8663717235145807, + "female": 0.33500999899115413, + "age": 34.44104418158531, + "f0": 142.1742270877477, + "f0_st": 3.262500630800626, + "voiced": 0.5050725026307712, + "rms_db": -32.15365934371948, + "snr_db": 15.218880653381348, + "bandwidth": 10462.445068359375 + }, + "clean -4": { + "wer": 0.018012422360248446, + "collapse": 0.0, + "identity": 0.7754781639425774, + "durx": 0.9103277674706246, + "female": 0.02570499706780538, + "age": 23.387479409575462, + "f0": 93.60245907332413, + "f0_st": 2.5103791053439406, + "voiced": 0.4296737454111198, + "rms_db": -37.96236038208008, + "snr_db": 11.871181964874268, + "bandwidth": 12012.835693359375 + }, + "clean -2": { + "wer": 0.007352941176470588, + "collapse": 0.0, + "identity": 0.8883108311341454, + "durx": 0.9208172779601351, + "female": 0.10495347034884617, + "age": 24.89609383046627, + "f0": 89.24743084494577, + "f0_st": 1.3043228206026394, + "voiced": 0.5205873431196194, + "rms_db": -37.669440269470215, + "snr_db": 14.738545417785645, + "bandwidth": 11487.9638671875 + }, + "clean +2": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9251529556864786, + "durx": 1.066142191142191, + "female": 0.0027940083236899227, + "age": 21.460576355457306, + "f0": 88.71261952067539, + "f0_st": 1.998338182300166, + "voiced": 0.5698625375548285, + "rms_db": -39.91881275177002, + "snr_db": 44.28951454162598, + "bandwidth": 12128.57666015625 + }, + "clean +4": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9007459974356522, + "durx": 1.096938775510204, + "female": 0.0034163901291321963, + "age": 21.012474596500397, + "f0": 92.00006717670513, + "f0_st": 1.9662337041311113, + "voiced": 0.5697216534042785, + "rms_db": -33.94219255447388, + "snr_db": 50.43320560455322, + "bandwidth": 13722.03369140625 + }, + "clean +8": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.8222366811057029, + "durx": 1.0976107226107226, + "female": 0.002987402433063835, + "age": 25.191812217235565, + "f0": 100.69010944264933, + "f0_st": 2.851710470913174, + "voiced": 0.6392778911978219, + "rms_db": -32.1496901512146, + "snr_db": 65.2023572921753, + "bandwidth": 13250.994873046875 + } + }, + "Obama": { + "neutral": { + "wer": 0.014705882352941176, + "collapse": 0.0, + "identity": 0.9387460296541414, + "durx": 1.0, + "female": 0.0035154334036633372, + "age": 53.74961122870445, + "f0": 123.7537390161196, + "f0_st": 2.7043656138649546, + "voiced": 0.6549097443442305, + "rms_db": -41.428171157836914, + "snr_db": 50.819594383239746, + "bandwidth": 7555.462646484375 + }, + "clean -8": { + "wer": 0.08007518796992481, + "collapse": 0.0, + "identity": 0.4274222220980304, + "durx": 0.9856140350877192, + "female": 0.010810161882545799, + "age": 43.02389249205589, + "f0": 187.8758126223097, + "f0_st": 3.740453190985332, + "voiced": 0.7521961914033082, + "rms_db": -34.97163486480713, + "snr_db": 23.602232933044434, + "bandwidth": 12080.126953125 + }, + "clean -4": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.8420850555280859, + "durx": 0.9831578947368421, + "female": 0.007778359577059746, + "age": 50.47902837395668, + "f0": 162.2444500001409, + "f0_st": 3.7419858286922265, + "voiced": 0.6208964211194098, + "rms_db": -40.40924835205078, + "snr_db": 30.41631555557251, + "bandwidth": 8621.356201171875 + }, + "clean -2": { + "wer": 0.022058823529411766, + "collapse": 0.0, + "identity": 0.8795861921709379, + "durx": 0.8950617283950617, + "female": 0.004012292192783207, + "age": 47.16091305017471, + "f0": 151.25235091093077, + "f0_st": 3.3500718206083095, + "voiced": 0.6896573282903443, + "rms_db": -37.91316032409668, + "snr_db": 35.235591888427734, + "bandwidth": 8615.972900390625 + }, + "clean +2": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9156271000951572, + "durx": 1.0404808317089018, + "female": 0.0036100834840908647, + "age": 51.683562994003296, + "f0": 126.02872050792607, + "f0_st": 2.97233966395116, + "voiced": 0.7010590759364941, + "rms_db": -35.56367874145508, + "snr_db": 55.947184562683105, + "bandwidth": 7286.297607421875 + }, + "clean +4": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9016863751438564, + "durx": 1.0771604938271604, + "female": 0.0028833652031607926, + "age": 55.69439381361008, + "f0": 123.30093688507259, + "f0_st": 3.496128481878045, + "voiced": 0.717192345294262, + "rms_db": -35.472137451171875, + "snr_db": 61.74311447143555, + "bandwidth": 7531.23779296875 + }, + "clean +8": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.8708129236301401, + "durx": 1.0809616634178036, + "female": 0.0033416785299777985, + "age": 51.870497316122055, + "f0": 122.46041713119862, + "f0_st": 3.7167250717452305, + "voiced": 0.7254945312238769, + "rms_db": -38.44478225708008, + "snr_db": 64.13578128814697, + "bandwidth": 9291.5771484375 + } + }, + "Scottish Female": { + "neutral": { + "wer": 0.007142857142857143, + "collapse": 0.0, + "identity": 0.9266934661136247, + "durx": 1.0, + "female": 0.997859537601471, + "age": 48.33717122673988, + "f0": 186.62951681175997, + "f0_st": 2.372338315695629, + "voiced": 0.7664984735799911, + "rms_db": -39.992154121398926, + "snr_db": 31.38053846359253, + "bandwidth": 7999.5849609375 + }, + "clean -8": { + "wer": 0.2073529411764706, + "collapse": 0.25, + "identity": 0.46297543442325095, + "durx": 0.9405514576747454, + "female": 0.9625555574893951, + "age": 26.838161051273346, + "f0": 287.47645029327674, + "f0_st": 4.249519481987878, + "voiced": 0.6963660632163916, + "rms_db": -31.116941928863525, + "snr_db": 19.429282665252686, + "bandwidth": 8220.30029296875 + }, + "clean -4": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.7993414771899504, + "durx": 0.879193964661505, + "female": 0.9972429424524307, + "age": 44.852595031261444, + "f0": 197.83463984732398, + "f0_st": 3.238051032719712, + "voiced": 0.7529601018477343, + "rms_db": -34.883992195129395, + "snr_db": 21.36942720413208, + "bandwidth": 7000.982666015625 + }, + "clean -2": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.8615151297210226, + "durx": 0.8770903010033444, + "female": 0.9981500506401062, + "age": 50.24895444512367, + "f0": 187.84554561929426, + "f0_st": 3.2354926722483346, + "voiced": 0.7796290868156714, + "rms_db": -39.29639911651611, + "snr_db": 24.924416542053223, + "bandwidth": 7149.0234375 + }, + "clean +2": { + "wer": 0.007352941176470588, + "collapse": 0.0, + "identity": 0.8771819139805663, + "durx": 1.035827186512118, + "female": 0.9982252866029739, + "age": 51.3627827167511, + "f0": 190.66480672505594, + "f0_st": 2.7992871251886147, + "voiced": 0.7439887510730907, + "rms_db": -32.31407356262207, + "snr_db": 35.21652126312256, + "bandwidth": 7840.777587890625 + }, + "clean +4": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.8793621443855547, + "durx": 1.1133649455567265, + "female": 0.9971189647912979, + "age": 51.8670454621315, + "f0": 206.36232136264292, + "f0_st": 3.4964520010560736, + "voiced": 0.7381961493067252, + "rms_db": -28.98762035369873, + "snr_db": 48.2798433303833, + "bandwidth": 9221.59423828125 + }, + "clean +8": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.8123791061642327, + "durx": 1.359253065774805, + "female": 0.9902779906988144, + "age": 45.85587680339813, + "f0": 200.5932452437476, + "f0_st": 3.3330737573948492, + "voiced": 0.7816984332799064, + "rms_db": -28.49171209335327, + "snr_db": 73.08956336975098, + "bandwidth": 11493.34716796875 + } + } +} diff --git a/steering/channel_mect60k/manifest.json b/steering/channel_mect60k/manifest.json new file mode 100644 index 0000000000000000000000000000000000000000..1b963d6d5e9e28f147f5419b47ecff5c4ab67664 --- /dev/null +++ b/steering/channel_mect60k/manifest.json @@ -0,0 +1,42 @@ +{ + "dim": 192, + "space": "raw", + "checkpoint": "/data/groups/audio/gabriel/hf_release_zonos3mini_20261020/lm/mect_60k", + "corpus": "/data/groups/audio/sofian/runs/steer_corpora/paraspeechcaps/clips.json", + "spec": { + "space": "raw", + "group_by": "clip", + "center": "speaker", + "orthogonal_to": [ + "/data/groups/audio/sofian/bingua2-gdn-emotion/minisgl/speaker_attributes_mect60k" + ], + "directions": { + "clean": { + "regress": "clean", + "within": "corpus", + "filter": { + "corpus": "voxceleb" + }, + "kind": "axis", + "poles": { + "+": "clean studio", + "-": "noisy / far-field" + } + } + } + }, + "directions": { + "clean": { + "file": "clean.npy", + "kind": "axis", + "norm": 0.26050034319127313, + "poles": { + "+": "clean studio", + "-": "noisy / far-field" + } + } + }, + "input_dim": 192, + "speaker_codec": "ownmect_s2", + "ref_base_norm": 2.3988178768739483 +} diff --git a/steering/channel_mect60k/report.json b/steering/channel_mect60k/report.json new file mode 100644 index 0000000000000000000000000000000000000000..832017c3346aff78fd64b24bdd183a26eae5b68e --- /dev/null +++ b/steering/channel_mect60k/report.json @@ -0,0 +1,26 @@ +{ + "clean": { + "norm": 0.26050034319127313, + "removed_share": 0.0008912888058341117, + "pairs": [ + { + "pair": [ + { + "corpus": "voxceleb" + }, + "clean P10-P90 3" + ], + "train_speakers": [ + 3501, + 0 + ], + "held_out_speakers": [ + 970, + 0 + ], + "cos_with_direction": 0.9995542562533389, + "held_out_auc": 0.3874766163262394 + } + ] + } +} diff --git a/steering/channel_mect60k/spec.json b/steering/channel_mect60k/spec.json new file mode 100644 index 0000000000000000000000000000000000000000..f9ab1e9d8d8634606941d403d60b44af4be112c5 --- /dev/null +++ b/steering/channel_mect60k/spec.json @@ -0,0 +1,22 @@ +{ + "space": "raw", + "group_by": "clip", + "center": "speaker", + "orthogonal_to": [ + "/data/groups/audio/sofian/bingua2-gdn-emotion/minisgl/speaker_attributes_mect60k" + ], + "directions": { + "clean": { + "regress": "clean", + "within": "corpus", + "filter": { + "corpus": "voxceleb" + }, + "kind": "axis", + "poles": { + "+": "clean studio", + "-": "noisy / far-field" + } + } + } +} \ No newline at end of file diff --git a/steering/disfluency_mect60k/disfluent.npy b/steering/disfluency_mect60k/disfluent.npy new file mode 100644 index 0000000000000000000000000000000000000000..34eb4982d295f91ce4ff77784a264c90869d7d0b --- /dev/null +++ b/steering/disfluency_mect60k/disfluent.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cccd835a00e0cf26b0284f3ba0e108691902af8dfe8a64ba3ef8fae2aea35f0d +size 4224 diff --git a/steering/disfluency_mect60k/eval_summary.json b/steering/disfluency_mect60k/eval_summary.json new file mode 100644 index 0000000000000000000000000000000000000000..09fc542b6d4452514bf120447667a30653e12289 --- /dev/null +++ b/steering/disfluency_mect60k/eval_summary.json @@ -0,0 +1,1045 @@ +{ + "all": { + "neutral": { + "wer": 0.004866946778711485, + "collapse": 0.0, + "identity": 0.9463956918186919, + "durx": 1.0, + "female": 0.4983073752615989, + "age": 41.317688735822834, + "f0": 136.19757792145845, + "f0_st": 2.903048200564409, + "voiced": 0.6307535235563585, + "rms_db": -38.16175572077433, + "snr_db": 39.82410788536072, + "bandwidth": 8300.152587890625, + "flow:disfluent": 0.09457541666666668, + "flow:interjection": 0.06453458333333334, + "flow:word repetition": 0.06725041666666666, + "flow:block": 0.1695075, + "quality:hesitant": 0.12327458333333334, + "quality:stammering": 0.042923333333333334, + "quality:flowing": 0.59947875 + }, + "disfluent -8": { + "wer": 0.0012254901960784314, + "collapse": 0.0, + "identity": 0.9082085284827737, + "durx": 0.9028644749618531, + "female": 0.499057737547749, + "age": 41.74826710174481, + "f0": 127.40357106536517, + "f0_st": 2.909659674063103, + "voiced": 0.611046445814115, + "rms_db": -42.8821595509847, + "snr_db": 35.89958564440409, + "bandwidth": 8467.483520507812, + "flow:disfluent": 0.07608625000000001, + "flow:interjection": 0.04131083333333333, + "flow:word repetition": 0.0748275, + "flow:block": 0.15681375, + "quality:hesitant": 0.1435316666666667, + "quality:stammering": 0.05429124999999999, + "quality:flowing": 0.5658758333333332 + }, + "disfluent -4": { + "wer": 0.003002070393374741, + "collapse": 0.0, + "identity": 0.9145563036495178, + "durx": 0.9380085981882389, + "female": 0.4981338299791484, + "age": 41.433788587649666, + "f0": 132.22605518464965, + "f0_st": 2.865654153888364, + "voiced": 0.6251432434394905, + "rms_db": -41.970491886138916, + "snr_db": 38.8972974618276, + "bandwidth": 8507.858276367188, + "flow:disfluent": 0.08402625000000001, + "flow:interjection": 0.05126708333333333, + "flow:word repetition": 0.07950208333333335, + "flow:block": 0.16384583333333333, + "quality:hesitant": 0.11591208333333335, + "quality:stammering": 0.042813333333333335, + "quality:flowing": 0.5966429166666667 + }, + "disfluent +4": { + "wer": 0.0011904761904761904, + "collapse": 0.0, + "identity": 0.9215754816787795, + "durx": 1.1221956087824352, + "female": 0.5000835929434592, + "age": 42.06312155971924, + "f0": 143.20093643617062, + "f0_st": 2.9336831445383686, + "voiced": 0.6264457906983735, + "rms_db": -37.86835559209188, + "snr_db": 40.08300971984863, + "bandwidth": 8217.160034179688, + "flow:disfluent": 0.16282041666666666, + "flow:interjection": 0.12712625000000002, + "flow:word repetition": 0.070815, + "flow:block": 0.22256333333333334, + "quality:hesitant": 0.15767375, + "quality:stammering": 0.04274166666666667, + "quality:flowing": 0.5532387500000001 + }, + "disfluent +8": { + "wer": 0.0012254901960784314, + "collapse": 0.0, + "identity": 0.914761129094415, + "durx": 1.3226924916307987, + "female": 0.4997665746583759, + "age": 41.79824081559976, + "f0": 148.20181120696716, + "f0_st": 3.0285338683075964, + "voiced": 0.6581230556736145, + "rms_db": -36.537171045939125, + "snr_db": 46.180215994517006, + "bandwidth": 8262.020874023438, + "flow:disfluent": 0.2071158333333333, + "flow:interjection": 0.12451958333333334, + "flow:word repetition": 0.08699541666666666, + "flow:block": 0.26692375, + "quality:hesitant": 0.16340333333333332, + "quality:stammering": 0.06505625, + "quality:flowing": 0.5127454166666666 + }, + "disfluent +16": { + "wer": 0.08610689126909345, + "collapse": 0.08333333333333333, + "identity": 0.8802417033935387, + "durx": 1.9080487033523088, + "female": 0.5043790474107178, + "age": 42.786613230903946, + "f0": 157.08786386197175, + "f0_st": 3.074247722316232, + "voiced": 0.6629290135002545, + "rms_db": -33.16324019432068, + "snr_db": 52.376529375712074, + "bandwidth": 8456.716918945312, + "flow:disfluent": 0.4310491666666667, + "flow:interjection": 0.24867000000000003, + "flow:word repetition": 0.18129166666666666, + "flow:block": 0.40862875000000004, + "quality:hesitant": 0.09985875, + "quality:stammering": 0.011937083333333333, + "quality:flowing": 0.4759075 + }, + "disfluent +32": { + "wer": 0.456056541609779, + "collapse": 0.5, + "identity": 0.7852037755218504, + "durx": 2.754032258064516, + "female": 0.5008027582225623, + "age": 46.08823855717977, + "f0": 172.6871741088834, + "f0_st": 4.468154184427994, + "voiced": 0.682220998824473, + "rms_db": -31.013883272806805, + "snr_db": 52.635767221450806, + "bandwidth": 8700.311279296875, + "flow:disfluent": 0.70596375, + "flow:interjection": 0.44627666666666665, + "flow:word repetition": 0.3486741666666667, + "flow:block": 0.5361570833333333, + "quality:hesitant": 0.08876125, + "quality:stammering": 0.03725708333333333, + "quality:flowing": 0.5470891666666667 + } + }, + "American Female": { + "neutral": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.950361505518176, + "durx": 1.0, + "female": 0.9827781617641449, + "age": 29.750093817710876, + "f0": 155.81481265779422, + "f0_st": 1.8082626788764102, + "voiced": 0.678813494199399, + "rms_db": -29.80318832397461, + "snr_db": 38.62734889984131, + "bandwidth": 6026.605224609375, + "flow:disfluent": 0.08399, + "flow:interjection": 0.039615000000000004, + "flow:word repetition": 0.048455, + "flow:block": 0.1596075, + "quality:hesitant": 0.0, + "quality:stammering": 0.0, + "quality:flowing": 0.0149075 + }, + "disfluent -8": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9208512172707153, + "durx": 0.9406845238095238, + "female": 0.9853821694850922, + "age": 30.964726954698563, + "f0": 147.37136991799406, + "f0_st": 1.9506385907306694, + "voiced": 0.6390253561755711, + "rms_db": -36.720611572265625, + "snr_db": 36.8337664604187, + "bandwidth": 6131.57958984375, + "flow:disfluent": 0.0776525, + "flow:interjection": 0.037945000000000007, + "flow:word repetition": 0.053412499999999995, + "flow:block": 0.15841750000000002, + "quality:hesitant": 0.0, + "quality:stammering": 0.0, + "quality:flowing": 0.037635 + }, + "disfluent -4": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9286318089679401, + "durx": 0.9667261904761905, + "female": 0.9827602505683899, + "age": 28.91303077340126, + "f0": 148.78813538366407, + "f0_st": 2.234330721299075, + "voiced": 0.6453389378645797, + "rms_db": -34.41473960876465, + "snr_db": 41.63545227050781, + "bandwidth": 5851.64794921875, + "flow:disfluent": 0.088245, + "flow:interjection": 0.0411, + "flow:word repetition": 0.0533175, + "flow:block": 0.1753375, + "quality:hesitant": 0.0, + "quality:stammering": 0.0, + "quality:flowing": 0.033784999999999996 + }, + "disfluent +4": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9287973688604698, + "durx": 1.126875, + "female": 0.9851289987564087, + "age": 30.75612634420395, + "f0": 161.52398500175389, + "f0_st": 2.0413044592327036, + "voiced": 0.6756001350686002, + "rms_db": -30.88649320602417, + "snr_db": 40.50976085662842, + "bandwidth": 6212.3291015625, + "flow:disfluent": 0.1332525, + "flow:interjection": 0.056607500000000005, + "flow:word repetition": 0.045162499999999994, + "flow:block": 0.220455, + "quality:hesitant": 0.0, + "quality:stammering": 0.0, + "quality:flowing": 0.00976 + }, + "disfluent +8": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.931439643211718, + "durx": 1.5152083333333333, + "female": 0.9735300689935684, + "age": 27.123092859983444, + "f0": 165.06206715790208, + "f0_st": 1.6918640201055486, + "voiced": 0.666098401733658, + "rms_db": -26.71970224380493, + "snr_db": 59.08294486999512, + "bandwidth": 6745.27587890625, + "flow:disfluent": 0.22219999999999998, + "flow:interjection": 0.11206250000000001, + "flow:word repetition": 0.052969999999999996, + "flow:block": 0.2813675, + "quality:hesitant": 0.0, + "quality:stammering": 0.0, + "quality:flowing": 0.0015800000000000002 + }, + "disfluent +16": { + "wer": 0.02786377708978328, + "collapse": 0.0, + "identity": 0.9064537339116003, + "durx": 2.20936974789916, + "female": 0.9492974430322647, + "age": 27.13971771299839, + "f0": 171.12728593179756, + "f0_st": 1.8511604974619873, + "voiced": 0.6902080714224027, + "rms_db": -23.84486722946167, + "snr_db": 69.9621810913086, + "bandwidth": 6858.3251953125, + "flow:disfluent": 0.3856675, + "flow:interjection": 0.2065775, + "flow:word repetition": 0.09384999999999999, + "flow:block": 0.4086325, + "quality:hesitant": 0.0, + "quality:stammering": 0.0, + "quality:flowing": 0.01108 + }, + "disfluent +32": { + "wer": 0.4928595465646213, + "collapse": 0.5, + "identity": 0.7988309522055261, + "durx": 2.974285714285714, + "female": 0.933273047208786, + "age": 28.367979824543, + "f0": 187.28419835334753, + "f0_st": 4.105742735544138, + "voiced": 0.6613861547533306, + "rms_db": -24.04301691055298, + "snr_db": 71.37398529052734, + "bandwidth": 8115.325927734375, + "flow:disfluent": 0.6991275, + "flow:interjection": 0.41908999999999996, + "flow:word repetition": 0.36624500000000004, + "flow:block": 0.5695475, + "quality:hesitant": 0.0, + "quality:stammering": 0.0, + "quality:flowing": 0.06122 + } + }, + "American Male": { + "neutral": { + "wer": 0.007352941176470588, + "collapse": 0.0, + "identity": 0.944281897024579, + "durx": 1.0, + "female": 0.0021247467666398734, + "age": 48.121464252471924, + "f0": 116.91828356269122, + "f0_st": 4.913690931254914, + "voiced": 0.4680676167050811, + "rms_db": -43.39509105682373, + "snr_db": 39.194278717041016, + "bandwidth": 8204.150390625, + "flow:disfluent": 0.06804500000000001, + "flow:interjection": 0.03238, + "flow:word repetition": 0.052872499999999996, + "flow:block": 0.144785, + "quality:hesitant": 0.0056725000000000005, + "quality:stammering": 2.4999999999999998e-05, + "quality:flowing": 0.9711599999999999 + }, + "disfluent -8": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9029210338612171, + "durx": 0.9408602150537635, + "female": 0.0018169116519857198, + "age": 48.16804379224777, + "f0": 100.16472382563595, + "f0_st": 3.678750473115576, + "voiced": 0.31049927707192515, + "rms_db": -49.127241134643555, + "snr_db": 31.545073986053467, + "bandwidth": 8317.19970703125, + "flow:disfluent": 0.0971625, + "flow:interjection": 0.047992499999999993, + "flow:word repetition": 0.0797775, + "flow:block": 0.18736750000000002, + "quality:hesitant": 0.0646125, + "quality:stammering": 0.002255, + "quality:flowing": 0.76182 + }, + "disfluent -4": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.8934090157002439, + "durx": 0.9573863636363636, + "female": 0.0016261747805401683, + "age": 49.15132150053978, + "f0": 110.19954674116367, + "f0_st": 4.092463795279015, + "voiced": 0.4969241817353903, + "rms_db": -49.722662925720215, + "snr_db": 40.24984645843506, + "bandwidth": 8338.73291015625, + "flow:disfluent": 0.065455, + "flow:interjection": 0.03172, + "flow:word repetition": 0.0497075, + "flow:block": 0.13886500000000002, + "quality:hesitant": 0.0435175, + "quality:stammering": 0.00119, + "quality:flowing": 0.841975 + }, + "disfluent +4": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9106396726363064, + "durx": 1.1394009216589862, + "female": 0.002443018602207303, + "age": 49.082790315151215, + "f0": 124.65887976852392, + "f0_st": 3.570160865428652, + "voiced": 0.44358785228812325, + "rms_db": -44.23974132537842, + "snr_db": 34.858888149261475, + "bandwidth": 7940.36865234375, + "flow:disfluent": 0.0899025, + "flow:interjection": 0.0413525, + "flow:word repetition": 0.05322999999999999, + "flow:block": 0.1718025, + "quality:hesitant": 0.00747, + "quality:stammering": 1.5e-05, + "quality:flowing": 0.9731924999999999 + }, + "disfluent +8": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.8989331353126354, + "durx": 1.3866407982261642, + "female": 0.0020045319106429815, + "age": 48.143160343170166, + "f0": 129.09511226796258, + "f0_st": 3.851903681066942, + "voiced": 0.5779291007410734, + "rms_db": -42.311641693115234, + "snr_db": 41.691805839538574, + "bandwidth": 8513.690185546875, + "flow:disfluent": 0.1582, + "flow:interjection": 0.057905, + "flow:word repetition": 0.0537925, + "flow:block": 0.22506750000000003, + "quality:hesitant": 0.0022675, + "quality:stammering": 5e-06, + "quality:flowing": 0.9879500000000001 + }, + "disfluent +16": { + "wer": 0.0537593984962406, + "collapse": 0.0, + "identity": 0.8481949097524969, + "durx": 2.177218614718615, + "female": 0.004144768696278334, + "age": 52.59004309773445, + "f0": 132.156597178289, + "f0_st": 4.888524000722896, + "voiced": 0.5888468182598795, + "rms_db": -39.83034324645996, + "snr_db": 40.46463203430176, + "bandwidth": 7805.7861328125, + "flow:disfluent": 0.5922700000000001, + "flow:interjection": 0.2793875, + "flow:word repetition": 0.19388, + "flow:block": 0.441465, + "quality:hesitant": 0.0, + "quality:stammering": 0.0, + "quality:flowing": 0.9955825000000001 + }, + "disfluent +32": { + "wer": 0.4260850335557564, + "collapse": 0.5, + "identity": 0.7469822144330047, + "durx": 2.670698924731183, + "female": 0.004396991949761286, + "age": 52.07766517996788, + "f0": 133.80659739962204, + "f0_st": 6.875493334067607, + "voiced": 0.7466527284764399, + "rms_db": -34.86379432678223, + "snr_db": 39.962039947509766, + "bandwidth": 7391.27197265625, + "flow:disfluent": 0.7829475, + "flow:interjection": 0.47424749999999993, + "flow:word repetition": 0.32048750000000004, + "flow:block": 0.50109, + "quality:hesitant": 0.0, + "quality:stammering": 0.0, + "quality:flowing": 0.99053 + } + }, + "British Female": { + "neutral": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9646508989039382, + "durx": 1.0, + "female": 0.9985478520393372, + "age": 48.11074435710907, + "f0": 145.18670227011933, + "f0_st": 3.120616918031748, + "voiced": 0.684659116272671, + "rms_db": -34.987064361572266, + "snr_db": 43.8385124206543, + "bandwidth": 9003.570556640625, + "flow:disfluent": 0.095805, + "flow:interjection": 0.0436975, + "flow:word repetition": 0.05054, + "flow:block": 0.1844475, + "quality:hesitant": 0.0, + "quality:stammering": 0.0, + "quality:flowing": 0.6609849999999999 + }, + "disfluent -8": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9365327184296819, + "durx": 0.8764896152536601, + "female": 0.9976339042186737, + "age": 44.03698593378067, + "f0": 133.42871621467378, + "f0_st": 3.2565052282204006, + "voiced": 0.6848605321276345, + "rms_db": -40.3601188659668, + "snr_db": 40.7980842590332, + "bandwidth": 9498.834228515625, + "flow:disfluent": 0.0778175, + "flow:interjection": 0.039502499999999996, + "flow:word repetition": 0.04483, + "flow:block": 0.15880499999999997, + "quality:hesitant": 2e-05, + "quality:stammering": 0.0, + "quality:flowing": 0.6949675 + }, + "disfluent -4": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.939003092774732, + "durx": 0.9447789813631164, + "female": 0.9980297982692719, + "age": 44.9407696723938, + "f0": 139.72187875611434, + "f0_st": 3.1090896801141508, + "voiced": 0.6565646057422374, + "rms_db": -37.20823860168457, + "snr_db": 39.92825222015381, + "bandwidth": 9657.6416015625, + "flow:disfluent": 0.07005, + "flow:interjection": 0.034117499999999995, + "flow:word repetition": 0.0445575, + "flow:block": 0.14905249999999998, + "quality:hesitant": 7.5e-06, + "quality:stammering": 0.0, + "quality:flowing": 0.70056 + }, + "disfluent +4": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9441633847552731, + "durx": 1.04491544660084, + "female": 0.9985781461000443, + "age": 46.657540649175644, + "f0": 149.54761631167636, + "f0_st": 2.8078354810382207, + "voiced": 0.6705757402013638, + "rms_db": -34.32681083679199, + "snr_db": 49.02004814147949, + "bandwidth": 9864.898681640625, + "flow:disfluent": 0.11333499999999999, + "flow:interjection": 0.0508975, + "flow:word repetition": 0.041965, + "flow:block": 0.19572, + "quality:hesitant": 2.5e-06, + "quality:stammering": 0.0, + "quality:flowing": 0.51217 + }, + "disfluent +8": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9383201242383824, + "durx": 1.1673465423465423, + "female": 0.9984142482280731, + "age": 44.44165155291557, + "f0": 157.90366658205951, + "f0_st": 2.752145509892418, + "voiced": 0.6856841773859637, + "rms_db": -32.77216291427612, + "snr_db": 50.54715442657471, + "bandwidth": 9673.79150390625, + "flow:disfluent": 0.12281, + "flow:interjection": 0.0480725, + "flow:word repetition": 0.04238, + "flow:block": 0.2026075, + "quality:hesitant": 0.0, + "quality:stammering": 0.0, + "quality:flowing": 0.2874575 + }, + "disfluent +16": { + "wer": 0.12116368286445012, + "collapse": 0.0, + "identity": 0.9240143749808232, + "durx": 1.4968128781331027, + "female": 0.9987891614437103, + "age": 48.607246577739716, + "f0": 167.08182963687042, + "f0_st": 2.9968213726318957, + "voiced": 0.666661355827195, + "rms_db": -32.31175184249878, + "snr_db": 56.249807357788086, + "bandwidth": 9846.05712890625, + "flow:disfluent": 0.253245, + "flow:interjection": 0.1065875, + "flow:word repetition": 0.092615, + "flow:block": 0.3171175, + "quality:hesitant": 0.0, + "quality:stammering": 0.0, + "quality:flowing": 0.05691999999999999 + }, + "disfluent +32": { + "wer": 0.11152289291002442, + "collapse": 0.0, + "identity": 0.8790800087779094, + "durx": 2.683988764044944, + "female": 0.9978882819414139, + "age": 51.37040391564369, + "f0": 176.92538573574845, + "f0_st": 2.2783933559750644, + "voiced": 0.6524992264986035, + "rms_db": -27.614826202392578, + "snr_db": 61.11164855957031, + "bandwidth": 9423.468017578125, + "flow:disfluent": 0.6345675, + "flow:interjection": 0.3417225, + "flow:word repetition": 0.2901275, + "flow:block": 0.5287325, + "quality:hesitant": 0.0, + "quality:stammering": 0.0, + "quality:flowing": 0.0525075 + } + }, + "British Male": { + "neutral": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9536403536976914, + "durx": 1.0, + "female": 0.005018519994337112, + "age": 19.837047532200813, + "f0": 88.88241321026631, + "f0_st": 2.4990147456627976, + "voiced": 0.5315726962367779, + "rms_db": -39.36486530303955, + "snr_db": 35.08437442779541, + "bandwidth": 11011.541748046875, + "flow:disfluent": 0.0874325, + "flow:interjection": 0.0431575, + "flow:word repetition": 0.0833275, + "flow:block": 0.17647000000000002, + "quality:hesitant": 0.6122075, + "quality:stammering": 0.13353500000000001, + "quality:flowing": 0.6694425 + }, + "disfluent -8": { + "wer": 0.007352941176470588, + "collapse": 0.0, + "identity": 0.9084945794313544, + "durx": 0.8010204081632653, + "female": 0.008223566022934392, + "age": 23.100117966532707, + "f0": 84.71429504411469, + "f0_st": 2.3926102766243718, + "voiced": 0.5695542115116597, + "rms_db": -44.09991931915283, + "snr_db": 29.915813446044922, + "bandwidth": 10543.194580078125, + "flow:disfluent": 0.0668375, + "flow:interjection": 0.0412575, + "flow:word repetition": 0.11549999999999999, + "flow:block": 0.14227499999999998, + "quality:hesitant": 0.654595, + "quality:stammering": 0.15964, + "quality:flowing": 0.655825 + }, + "disfluent -4": { + "wer": 0.010869565217391304, + "collapse": 0.0, + "identity": 0.9265259991430863, + "durx": 0.9035250463821892, + "female": 0.004336770216468722, + "age": 24.434225261211395, + "f0": 86.8221834103802, + "f0_st": 2.6241060646238594, + "voiced": 0.5206333642316489, + "rms_db": -44.40935039520264, + "snr_db": 32.97440814971924, + "bandwidth": 11738.287353515625, + "flow:disfluent": 0.0720325, + "flow:interjection": 0.037445, + "flow:word repetition": 0.10314999999999999, + "flow:block": 0.151365, + "quality:hesitant": 0.52818, + "quality:stammering": 0.0415475, + "quality:flowing": 0.7382099999999999 + }, + "disfluent +4": { + "wer": 0.007142857142857143, + "collapse": 0.0, + "identity": 0.9277437984964578, + "durx": 1.3300865800865802, + "female": 0.013490943529177457, + "age": 21.826259419322014, + "f0": 89.76289654523863, + "f0_st": 2.996969817207568, + "voiced": 0.5335241021242141, + "rms_db": -46.13826560974121, + "snr_db": 34.40209674835205, + "bandwidth": 11644.07958984375, + "flow:disfluent": 0.22591, + "flow:interjection": 0.1106125, + "flow:word repetition": 0.08477749999999999, + "flow:block": 0.287095, + "quality:hesitant": 0.692345, + "quality:stammering": 0.1245975, + "quality:flowing": 0.6242749999999999 + }, + "disfluent +8": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9248752181738501, + "durx": 1.6525974025974026, + "female": 0.02222571859601885, + "age": 22.757107764482498, + "f0": 94.53699067386188, + "f0_st": 3.757060205902384, + "voiced": 0.5986189143418812, + "rms_db": -42.50966453552246, + "snr_db": 34.40255546569824, + "bandwidth": 10632.01904296875, + "flow:disfluent": 0.32590250000000004, + "flow:interjection": 0.22016999999999998, + "flow:word repetition": 0.1256, + "flow:block": 0.3376775, + "quality:hesitant": 0.75122, + "quality:stammering": 0.24115499999999998, + "quality:flowing": 0.5980624999999999 + }, + "disfluent +16": { + "wer": 0.14473684210526316, + "collapse": 0.25, + "identity": 0.8759576564885598, + "durx": 2.381737310308739, + "female": 0.07093269168399274, + "age": 24.019931629300117, + "f0": 91.87390389690016, + "f0_st": 4.019145742577846, + "voiced": 0.6208160094786367, + "rms_db": -42.22202777862549, + "snr_db": 41.66515064239502, + "bandwidth": 10470.52001953125, + "flow:disfluent": 0.553525, + "flow:interjection": 0.49579750000000006, + "flow:word repetition": 0.251535, + "flow:block": 0.44304750000000004, + "quality:hesitant": 0.055222499999999994, + "quality:stammering": 0.00101, + "quality:flowing": 0.9195274999999999 + }, + "disfluent +32": { + "wer": 0.6945738707382266, + "collapse": 0.75, + "identity": 0.7251534877929705, + "durx": 2.7122758194186765, + "female": 0.07110889069736004, + "age": 34.32245850563049, + "f0": 101.14462940281946, + "f0_st": 6.728051208842855, + "voiced": 0.6812090728183102, + "rms_db": -39.00286865234375, + "snr_db": 41.89784049987793, + "bandwidth": 10610.48583984375, + "flow:disfluent": 0.8266749999999999, + "flow:interjection": 0.6136025, + "flow:word repetition": 0.30561750000000004, + "flow:block": 0.5308375000000001, + "quality:hesitant": 0.00042500000000000003, + "quality:stammering": 3.5e-05, + "quality:flowing": 0.9819074999999999 + } + }, + "Obama": { + "neutral": { + "wer": 0.014705882352941176, + "collapse": 0.0, + "identity": 0.9387460296541414, + "durx": 1.0, + "female": 0.0035154334036633372, + "age": 53.74961122870445, + "f0": 123.7537390161196, + "f0_st": 2.7043656138649546, + "voiced": 0.6549097443442305, + "rms_db": -41.428171157836914, + "snr_db": 50.819594383239746, + "bandwidth": 7555.462646484375, + "flow:disfluent": 0.070495, + "flow:interjection": 0.0366575, + "flow:word repetition": 0.04646, + "flow:block": 0.1543625, + "quality:hesitant": 0.02416, + "quality:stammering": 0.12398, + "quality:flowing": 0.40512000000000004 + }, + "disfluent -8": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9055291283888858, + "durx": 0.9104938271604938, + "female": 0.002824782917741686, + "age": 51.352352648973465, + "f0": 117.37056108276947, + "f0_st": 3.2564944191089595, + "voiced": 0.6770142735599725, + "rms_db": -42.79365634918213, + "snr_db": 46.649946212768555, + "bandwidth": 7676.5869140625, + "flow:disfluent": 0.058902499999999997, + "flow:interjection": 0.0318675, + "flow:word repetition": 0.0443075, + "flow:block": 0.133145, + "quality:hesitant": 0.034645, + "quality:stammering": 0.163835, + "quality:flowing": 0.3897775 + }, + "disfluent -4": { + "wer": 0.007142857142857143, + "collapse": 0.0, + "identity": 0.9199751457489501, + "durx": 0.9259259259259258, + "female": 0.0034693514462560415, + "age": 50.569942593574524, + "f0": 120.88989769109094, + "f0_st": 2.76627608697449, + "voiced": 0.6755832705283227, + "rms_db": -41.51624584197998, + "snr_db": 49.29328155517578, + "bandwidth": 7310.5224609375, + "flow:disfluent": 0.06772500000000001, + "flow:interjection": 0.0345525, + "flow:word repetition": 0.062445, + "flow:block": 0.151645, + "quality:hesitant": 0.022602499999999998, + "quality:stammering": 0.214135, + "quality:flowing": 0.3960575 + }, + "disfluent +4": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9240898238244128, + "durx": 1.092755035737492, + "female": 0.0034608374116942286, + "age": 55.25016933679581, + "f0": 137.43160606560434, + "f0_st": 3.2088599075693987, + "voiced": 0.6614178895017717, + "rms_db": -37.59330415725708, + "snr_db": 49.29704284667969, + "bandwidth": 7318.597412109375, + "flow:disfluent": 0.087005, + "flow:interjection": 0.04612, + "flow:word repetition": 0.05662249999999999, + "flow:block": 0.182415, + "quality:hesitant": 0.1100975, + "quality:stammering": 0.13181500000000002, + "quality:flowing": 0.37035250000000003 + }, + "disfluent +8": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9141750924596621, + "durx": 1.2735542560103963, + "female": 0.004581823304761201, + "age": 57.13093429803848, + "f0": 139.57953772529683, + "f0_st": 3.448492593510801, + "voiced": 0.6833824582141117, + "rms_db": -39.51111888885498, + "snr_db": 54.68964385986328, + "bandwidth": 7827.3193359375, + "flow:disfluent": 0.12172000000000001, + "flow:interjection": 0.0627375, + "flow:word repetition": 0.05910499999999999, + "flow:block": 0.23016250000000002, + "quality:hesitant": 0.13369499999999998, + "quality:stammering": 0.149175, + "quality:flowing": 0.37027750000000004 + }, + "disfluent +16": { + "wer": 0.014705882352941176, + "collapse": 0.0, + "identity": 0.8910758294313577, + "durx": 1.7962962962962963, + "female": 0.007049088249914348, + "age": 54.68612462282181, + "f0": 153.0492002348408, + "f0_st": 2.675690161400146, + "voiced": 0.7008132396653638, + "rms_db": -32.65997505187988, + "snr_db": 57.555015563964844, + "bandwidth": 7803.094482421875, + "flow:disfluent": 0.21252, + "flow:interjection": 0.079665, + "flow:word repetition": 0.07712250000000001, + "flow:block": 0.326965, + "quality:hesitant": 0.29188000000000003, + "quality:stammering": 0.070475, + "quality:flowing": 0.42132499999999995 + }, + "disfluent +32": { + "wer": 0.21063688633348077, + "collapse": 0.25, + "identity": 0.834598858727747, + "durx": 2.4783950617283947, + "female": 0.006160365708637983, + "age": 57.674892991781235, + "f0": 163.7420370614546, + "f0_st": 3.3355586965469888, + "voiced": 0.6626737570879383, + "rms_db": -35.4351806640625, + "snr_db": 59.245744705200195, + "bandwidth": 7924.21875, + "flow:disfluent": 0.5441750000000001, + "flow:interjection": 0.41557750000000004, + "flow:word repetition": 0.3324125, + "flow:block": 0.5213000000000001, + "quality:hesitant": 0.1707525, + "quality:stammering": 0.02679, + "quality:flowing": 0.7219949999999999 + } + }, + "Scottish Female": { + "neutral": { + "wer": 0.007142857142857143, + "collapse": 0.0, + "identity": 0.9266934661136247, + "durx": 1.0, + "female": 0.997859537601471, + "age": 48.33717122673988, + "f0": 186.62951681175997, + "f0_st": 2.372338315695629, + "voiced": 0.7664984735799911, + "rms_db": -39.992154121398926, + "snr_db": 31.38053846359253, + "bandwidth": 7999.5849609375, + "flow:disfluent": 0.161685, + "flow:interjection": 0.19169999999999998, + "flow:word repetition": 0.1218475, + "flow:block": 0.1973725, + "quality:hesitant": 0.0976075, + "quality:stammering": 0.0, + "quality:flowing": 0.8752574999999999 + }, + "disfluent -8": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.8749224935147878, + "durx": 0.8809921962095875, + "female": 0.9984650909900665, + "age": 52.86737531423569, + "f0": 181.3717603070032, + "f0_st": 2.9229590565786427, + "voiced": 0.7853250244379277, + "rms_db": -44.191410064697266, + "snr_db": 29.654829502105713, + "bandwidth": 8637.506103515625, + "flow:disfluent": 0.078145, + "flow:interjection": 0.049300000000000004, + "flow:word repetition": 0.11113750000000001, + "flow:block": 0.1608725, + "quality:hesitant": 0.1073175, + "quality:stammering": 1.75e-05, + "quality:flowing": 0.85523 + }, + "disfluent -4": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.8797927595621542, + "durx": 0.9337021426062522, + "female": 0.9985806345939636, + "age": 50.59344172477722, + "f0": 186.93468912548462, + "f0_st": 2.3676585750395938, + "voiced": 0.7558151005347638, + "rms_db": -44.551713943481445, + "snr_db": 29.302544116973877, + "bandwidth": 8150.3173828125, + "flow:disfluent": 0.14065, + "flow:interjection": 0.1286675, + "flow:word repetition": 0.163835, + "flow:block": 0.21681, + "quality:hesitant": 0.101165, + "quality:stammering": 7.500000000000001e-06, + "quality:flowing": 0.86927 + }, + "disfluent +4": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.894018841499757, + "durx": 1.2132107023411374, + "female": 0.9973996132612228, + "age": 48.80584329366684, + "f0": 196.2806349242267, + "f0_st": 2.9769683367536657, + "voiced": 0.7739690250061683, + "rms_db": -34.0255184173584, + "snr_db": 32.410221576690674, + "bandwidth": 6322.686767578125, + "flow:disfluent": 0.3275175, + "flow:interjection": 0.45716750000000006, + "flow:word repetition": 0.1431325, + "flow:block": 0.2778925, + "quality:hesitant": 0.1361275, + "quality:stammering": 2.25e-05, + "quality:flowing": 0.8296825 + }, + "disfluent +8": { + "wer": 0.007352941176470588, + "collapse": 0.0, + "identity": 0.8808235611702417, + "durx": 1.289549902152642, + "female": 0.9978430569171906, + "age": 51.19349807500839, + "f0": 203.03349283472008, + "f0_st": 2.669737199367487, + "voiced": 0.7370252816249989, + "rms_db": -35.398736000061035, + "snr_db": 36.66719150543213, + "bandwidth": 6180.029296875, + "flow:disfluent": 0.2918625, + "flow:interjection": 0.24617, + "flow:word repetition": 0.18812500000000001, + "flow:block": 0.32466, + "quality:hesitant": 0.0932375, + "quality:stammering": 2.5e-06, + "quality:flowing": 0.831145 + }, + "disfluent +16": { + "wer": 0.15441176470588236, + "collapse": 0.25, + "identity": 0.8357537157963946, + "durx": 1.5775091575091573, + "female": 0.9960611313581467, + "age": 49.67661574482918, + "f0": 227.23836629313257, + "f0_st": 2.014144559102621, + "voiced": 0.7102285863480488, + "rms_db": -28.11047601699829, + "snr_db": 48.36238956451416, + "bandwidth": 7956.5185546875, + "flow:disfluent": 0.5890675, + "flow:interjection": 0.32400500000000004, + "flow:word repetition": 0.3787475, + "flow:block": 0.514545, + "quality:hesitant": 0.25205, + "quality:stammering": 0.0001375, + "quality:flowing": 0.45101 + }, + "disfluent +32": { + "wer": 0.8006610195565641, + "collapse": 1.0, + "identity": 0.7265771311939444, + "durx": 2.967158412363892, + "female": 0.9919889718294144, + "age": 52.716030925512314, + "f0": 273.22019670030846, + "f0_st": 3.485685775591312, + "voiced": 0.6889050533122144, + "rms_db": -25.123612880706787, + "snr_db": 42.22334432601929, + "bandwidth": 8737.09716796875, + "flow:disfluent": 0.74829, + "flow:interjection": 0.41342, + "flow:word repetition": 0.477155, + "flow:block": 0.5654349999999999, + "quality:hesitant": 0.36139, + "quality:stammering": 0.1967175, + "quality:flowing": 0.474375 + } + } +} diff --git a/steering/disfluency_mect60k/manifest.json b/steering/disfluency_mect60k/manifest.json new file mode 100644 index 0000000000000000000000000000000000000000..5a352114daaa19d5f1e0755915708d650f848d14 --- /dev/null +++ b/steering/disfluency_mect60k/manifest.json @@ -0,0 +1,37 @@ +{ + "dim": 1024, + "space": "attnres_source", + "checkpoint": "/data/groups/audio/gabriel/hf_release_zonos3mini_20261020/lm/mect_60k", + "corpus": "/data/groups/audio/sofian/runs/steer_corpora/disfluency/clips.json", + "spec": { + "space": "attnres_source", + "source_index": 19, + "group_by": "clip", + "directions": { + "disfluent": { + "regress": "disfl", + "within": "corpus", + "kind": "axis", + "poles": { + "+": "hesitant, fillers", + "-": "fluent" + } + } + }, + "holdout": "clip" + }, + "directions": { + "disfluent": { + "file": "disfluent.npy", + "kind": "axis", + "norm": 0.007459484146172073, + "poles": { + "+": "hesitant, fillers", + "-": "fluent" + } + } + }, + "source_index": 19, + "source_name": "L9.attn", + "prompt_conditioning": "speaker_row=no,condition_rows=3:unknown" +} diff --git a/steering/disfluency_mect60k/report.json b/steering/disfluency_mect60k/report.json new file mode 100644 index 0000000000000000000000000000000000000000..7cff89c6e2c9a49ba9e4c3c15edbad02c09d5919 --- /dev/null +++ b/steering/disfluency_mect60k/report.json @@ -0,0 +1,26 @@ +{ + "disfluent": { + "norm": 0.007459484146172073, + "removed_share": 0.0, + "pairs": [ + { + "pair": [ + { + "corpus": "disfluencyspeech" + }, + "disfl P10-P90 0.333" + ], + "train_speakers": [ + 2403, + 0 + ], + "held_out_speakers": [ + 597, + 0 + ], + "cos_with_direction": 1.0000000000000002, + "held_out_auc": 0.7329297606977223 + } + ] + } +} diff --git a/steering/disfluency_mect60k/spec.json b/steering/disfluency_mect60k/spec.json new file mode 100644 index 0000000000000000000000000000000000000000..da946dbe7eb468d40d6bdeb6afa6461d5e9890fb --- /dev/null +++ b/steering/disfluency_mect60k/spec.json @@ -0,0 +1,17 @@ +{ + "space": "attnres_source", + "source_index": 19, + "group_by": "clip", + "directions": { + "disfluent": { + "regress": "disfl", + "within": "corpus", + "kind": "axis", + "poles": { + "+": "hesitant, fillers", + "-": "fluent" + } + } + }, + "holdout": "clip" +} \ No newline at end of file diff --git a/steering/ears_emotions_mect60k/angry.npy b/steering/ears_emotions_mect60k/angry.npy new file mode 100644 index 0000000000000000000000000000000000000000..85ceedc800c4ad761d1b49154b68d956a48478a2 --- /dev/null +++ b/steering/ears_emotions_mect60k/angry.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:58db87626d768e4f7238e668eae487c715f709a234d03dc526913776187c7feb +size 4224 diff --git a/steering/ears_emotions_mect60k/disgusted.npy b/steering/ears_emotions_mect60k/disgusted.npy new file mode 100644 index 0000000000000000000000000000000000000000..4207012ef2f1774ab33f174c675a8dd115b8ad4c --- /dev/null +++ b/steering/ears_emotions_mect60k/disgusted.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:55a485f36d43d69ff0bf9fe0b57c19b064413df60d3a7c81c4a3f89cc794f796 +size 4224 diff --git a/steering/ears_emotions_mect60k/eval_comparison.json b/steering/ears_emotions_mect60k/eval_comparison.json new file mode 100644 index 0000000000000000000000000000000000000000..d7061a043032d90c5e40fb86da341e73e9508028 --- /dev/null +++ b/steering/ears_emotions_mect60k/eval_comparison.json @@ -0,0 +1,1114 @@ +{ + "all": { + "neutral": { + "wer": 0.004866946778711485, + "collapse": 0.0, + "identity": 0.9463956918186919, + "durx": 1.0, + "female": 0.4983073752615989, + "age": 41.317688735822834, + "f0": 136.19757792145845, + "f0_st": 2.903048200564409, + "voiced": 0.6307535235563585, + "rms_db": -38.16175572077433, + "snr_db": 39.82410788536072, + "bandwidth": 8300.152587890625, + "emotion:Anger": 0.022680000000000002, + "emotion:Anger@1": 0.0, + "emotion:Sadness": 0.13764958333333333, + "emotion:Sadness@1": 0.0, + "emotion:Happiness": 0.17693250000000002, + "emotion:Happiness@1": 0.041666666666666664, + "emotion:Fear": 0.05800625, + "emotion:Fear@1": 0.0, + "emotion:Disgust": 0.054101666666666666, + "emotion:Disgust@1": 0.0, + "emotion:Surprise": 0.05627791666666667, + "emotion:Surprise@1": 0.0, + "emotion:Neutral": 0.35085249999999996, + "emotion:Neutral@1": 0.9583333333333334, + "emodim:arousal": 0.3977925, + "emodim:valence": 0.5074708333333333 + }, + "angry emb x2": { + "wer": 0.003641456582633053, + "collapse": 0.0, + "identity": 0.7658224766527907, + "durx": 0.950956937799043, + "female": 0.4959143141362195, + "age": 45.330387353897095, + "f0": 176.79571785358917, + "f0_st": 4.31278786006989, + "voiced": 0.6109014353132045, + "rms_db": -36.99547139803568, + "snr_db": 37.99728020032247, + "bandwidth": 10472.763061523438, + "emotion:Anger": 0.13373374999999998, + "emotion:Anger@1": 0.3333333333333333, + "emotion:Sadness": 0.03948125, + "emotion:Sadness@1": 0.0, + "emotion:Happiness": 0.21099083333333332, + "emotion:Happiness@1": 0.375, + "emotion:Fear": 0.06399375, + "emotion:Fear@1": 0.0, + "emotion:Disgust": 0.06919416666666667, + "emotion:Disgust@1": 0.0, + "emotion:Surprise": 0.07190833333333334, + "emotion:Surprise@1": 0.0, + "emotion:Neutral": 0.19019958333333334, + "emotion:Neutral@1": 0.2916666666666667, + "emodim:arousal": 0.6460154166666666, + "emodim:valence": 0.4849820833333333 + }, + "angry hid-ears x2": { + "wer": 0.006127450980392157, + "collapse": 0.0, + "identity": 0.8591210004499535, + "durx": 0.9780451127819549, + "female": 0.4970989828677072, + "age": 41.86214332779249, + "f0": 184.41606431538136, + "f0_st": 3.4313699712873587, + "voiced": 0.6337839597942438, + "rms_db": -27.025393803914387, + "snr_db": 33.14532423019409, + "bandwidth": 8651.412963867188, + "emotion:Anger": 0.07929874999999999, + "emotion:Anger@1": 0.16666666666666666, + "emotion:Sadness": 0.06224, + "emotion:Sadness@1": 0.0, + "emotion:Happiness": 0.21413375, + "emotion:Happiness@1": 0.3333333333333333, + "emotion:Fear": 0.06794583333333333, + "emotion:Fear@1": 0.0, + "emotion:Disgust": 0.07159791666666666, + "emotion:Disgust@1": 0.0, + "emotion:Surprise": 0.0786225, + "emotion:Surprise@1": 0.0, + "emotion:Neutral": 0.24124333333333334, + "emotion:Neutral@1": 0.4166666666666667, + "emodim:arousal": 0.5757304166666667, + "emodim:valence": 0.5248595833333333 + }, + "angry hid-expresso x2": { + "wer": 0.0024509803921568627, + "collapse": 0.0, + "identity": 0.879555920739037, + "durx": 0.8752969502407704, + "female": 0.4958840254015134, + "age": 41.979995742440224, + "f0": 175.30433915123322, + "f0_st": 2.9704082425600262, + "voiced": 0.7001157950010032, + "rms_db": -40.168246825536094, + "snr_db": 36.7164843082428, + "bandwidth": 8366.995239257812, + "emotion:Anger": 0.03314416666666666, + "emotion:Anger@1": 0.0, + "emotion:Sadness": 0.09464874999999999, + "emotion:Sadness@1": 0.0, + "emotion:Happiness": 0.21436791666666666, + "emotion:Happiness@1": 0.375, + "emotion:Fear": 0.05976208333333333, + "emotion:Fear@1": 0.0, + "emotion:Disgust": 0.05472583333333333, + "emotion:Disgust@1": 0.0, + "emotion:Surprise": 0.06759708333333332, + "emotion:Surprise@1": 0.0, + "emotion:Neutral": 0.3116383333333333, + "emotion:Neutral@1": 0.625, + "emodim:arousal": 0.4903741666666666, + "emodim:valence": 0.5209570833333333 + }, + "angry emb x4": { + "wer": 0.12146358543417367, + "collapse": 0.125, + "identity": 0.5283778861322709, + "durx": 0.9046854942233633, + "female": 0.4799862256331835, + "age": 44.909776126345, + "f0": 207.63950494662586, + "f0_st": 4.571300105448404, + "voiced": 0.5794581349737763, + "rms_db": -36.09399445851644, + "snr_db": 44.870326360066734, + "bandwidth": 10819.985961914062, + "emotion:Anger": 0.2712104166666667, + "emotion:Anger@1": 0.625, + "emotion:Sadness": 0.03299125, + "emotion:Sadness@1": 0.0, + "emotion:Happiness": 0.16174833333333336, + "emotion:Happiness@1": 0.20833333333333334, + "emotion:Fear": 0.04867291666666667, + "emotion:Fear@1": 0.0, + "emotion:Disgust": 0.054780416666666665, + "emotion:Disgust@1": 0.0, + "emotion:Surprise": 0.055204583333333335, + "emotion:Surprise@1": 0.0, + "emotion:Neutral": 0.16362666666666667, + "emotion:Neutral@1": 0.16666666666666666, + "emodim:arousal": 0.7049595833333333, + "emodim:valence": 0.44824291666666666 + }, + "angry hid-ears x4": { + "wer": 0.05958109788537841, + "collapse": 0.0, + "identity": 0.6430750895568139, + "durx": 0.9839380196523053, + "female": 0.5809703200648073, + "age": 40.141917392611504, + "f0": 321.5380130078588, + "f0_st": 4.051488273594744, + "voiced": 0.706852416831723, + "rms_db": -18.223669171333313, + "snr_db": 27.110424399375916, + "bandwidth": 11050.570678710938, + "emotion:Anger": 0.25484958333333335, + "emotion:Anger@1": 0.5, + "emotion:Sadness": 0.025115833333333334, + "emotion:Sadness@1": 0.0, + "emotion:Happiness": 0.18413291666666667, + "emotion:Happiness@1": 0.3333333333333333, + "emotion:Fear": 0.06877666666666667, + "emotion:Fear@1": 0.0, + "emotion:Disgust": 0.08899625, + "emotion:Disgust@1": 0.0, + "emotion:Surprise": 0.12961458333333334, + "emotion:Surprise@1": 0.08333333333333333, + "emotion:Neutral": 0.06779, + "emotion:Neutral@1": 0.08333333333333333, + "emodim:arousal": 0.8199179166666667, + "emodim:valence": 0.46605541666666667 + }, + "angry hid-expresso x4": { + "wer": 0.005869453044375645, + "collapse": 0.0, + "identity": 0.7813739738468772, + "durx": 0.799084030266826, + "female": 0.4952503484673798, + "age": 39.01102393865585, + "f0": 224.1403372650675, + "f0_st": 2.5288614604697432, + "voiced": 0.7512526945914284, + "rms_db": -43.70218952496847, + "snr_db": 37.66593647003174, + "bandwidth": 9022.412109375, + "emotion:Anger": 0.048402083333333325, + "emotion:Anger@1": 0.041666666666666664, + "emotion:Sadness": 0.07269125, + "emotion:Sadness@1": 0.0, + "emotion:Happiness": 0.2570625, + "emotion:Happiness@1": 0.5, + "emotion:Fear": 0.05812291666666667, + "emotion:Fear@1": 0.0, + "emotion:Disgust": 0.051436249999999996, + "emotion:Disgust@1": 0.0, + "emotion:Surprise": 0.07845374999999999, + "emotion:Surprise@1": 0.0, + "emotion:Neutral": 0.266095, + "emotion:Neutral@1": 0.4583333333333333, + "emodim:arousal": 0.5797095833333333, + "emodim:valence": 0.5465645833333334 + }, + "sad emb x2": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.8668773971103237, + "durx": 1.0727513227513228, + "female": 0.49930095005159575, + "age": 39.82725820193688, + "f0": 133.69797889264464, + "f0_st": 2.3899880624051755, + "voiced": 0.6626369175918446, + "rms_db": -40.83355474472046, + "snr_db": 42.99938050905863, + "bandwidth": 8396.603393554688, + "emotion:Anger": 0.015279166666666665, + "emotion:Anger@1": 0.0, + "emotion:Sadness": 0.21901625, + "emotion:Sadness@1": 0.16666666666666666, + "emotion:Happiness": 0.14795041666666667, + "emotion:Happiness@1": 0.08333333333333333, + "emotion:Fear": 0.055115000000000004, + "emotion:Fear@1": 0.0, + "emotion:Disgust": 0.04765208333333334, + "emotion:Disgust@1": 0.0, + "emotion:Surprise": 0.04883291666666667, + "emotion:Surprise@1": 0.0, + "emotion:Neutral": 0.34769958333333334, + "emotion:Neutral@1": 0.75, + "emodim:arousal": 0.3105108333333333, + "emodim:valence": 0.46461041666666664 + }, + "sad hid-ears x2": { + "wer": 0.0043859649122807015, + "collapse": 0.0, + "identity": 0.904370769971422, + "durx": 1.0507262164124909, + "female": 0.4994283479027217, + "age": 40.86250985662142, + "f0": 135.11885913196156, + "f0_st": 2.7062096010878527, + "voiced": 0.623067014842865, + "rms_db": -44.63076305389404, + "snr_db": 40.483768463134766, + "bandwidth": 8451.333618164062, + "emotion:Anger": 0.017401249999999997, + "emotion:Anger@1": 0.0, + "emotion:Sadness": 0.17058625000000002, + "emotion:Sadness@1": 0.08333333333333333, + "emotion:Happiness": 0.16528833333333334, + "emotion:Happiness@1": 0.08333333333333333, + "emotion:Fear": 0.054275, + "emotion:Fear@1": 0.0, + "emotion:Disgust": 0.04838499999999999, + "emotion:Disgust@1": 0.0, + "emotion:Surprise": 0.051016666666666675, + "emotion:Surprise@1": 0.0, + "emotion:Neutral": 0.36337041666666664, + "emotion:Neutral@1": 0.8333333333333334, + "emodim:arousal": 0.32608750000000003, + "emodim:valence": 0.48367458333333335 + }, + "sad hid-expresso x2": { + "wer": 0.005799425033171163, + "collapse": 0.0, + "identity": 0.9165032126683835, + "durx": 1.1734930139720559, + "female": 0.4992088942769139, + "age": 41.2890978778402, + "f0": 129.52117251983057, + "f0_st": 2.889583173785816, + "voiced": 0.6637449493023229, + "rms_db": -39.54338828722636, + "snr_db": 40.63011900583903, + "bandwidth": 7838.983154296875, + "emotion:Anger": 0.018371666666666665, + "emotion:Anger@1": 0.0, + "emotion:Sadness": 0.18281375, + "emotion:Sadness@1": 0.08333333333333333, + "emotion:Happiness": 0.14888791666666668, + "emotion:Happiness@1": 0.08333333333333333, + "emotion:Fear": 0.05866833333333333, + "emotion:Fear@1": 0.0, + "emotion:Disgust": 0.05207666666666666, + "emotion:Disgust@1": 0.0, + "emotion:Surprise": 0.05099958333333333, + "emotion:Surprise@1": 0.0, + "emotion:Neutral": 0.3552087500000001, + "emotion:Neutral@1": 0.8333333333333334, + "emodim:arousal": 0.33533708333333334, + "emodim:valence": 0.48326166666666664 + }, + "sad emb x4": { + "wer": 0.004608948842694973, + "collapse": 0.0, + "identity": 0.7482837640986996, + "durx": 1.1401627953146716, + "female": 0.5017882938457964, + "age": 33.9931263277928, + "f0": 126.8808851553437, + "f0_st": 2.0085441018588748, + "voiced": 0.65413442142749, + "rms_db": -39.49734115600586, + "snr_db": 43.573280016581215, + "bandwidth": 9042.599487304688, + "emotion:Anger": 0.011435833333333334, + "emotion:Anger@1": 0.0, + "emotion:Sadness": 0.29838625, + "emotion:Sadness@1": 0.3333333333333333, + "emotion:Happiness": 0.1150125, + "emotion:Happiness@1": 0.0, + "emotion:Fear": 0.05404083333333334, + "emotion:Fear@1": 0.0, + "emotion:Disgust": 0.04084416666666666, + "emotion:Disgust@1": 0.0, + "emotion:Surprise": 0.039411666666666664, + "emotion:Surprise@1": 0.0, + "emotion:Neutral": 0.3414908333333333, + "emotion:Neutral@1": 0.6666666666666666, + "emodim:arousal": 0.272125, + "emodim:valence": 0.44484708333333334 + }, + "sad hid-ears x4": { + "wer": 0.016928510534648642, + "collapse": 0.0, + "identity": 0.8690518834648419, + "durx": 1.097018150388937, + "female": 0.49791908666763146, + "age": 36.92436286558708, + "f0": 134.56195041383862, + "f0_st": 2.8937719004767035, + "voiced": 0.5904230085504835, + "rms_db": -47.51613744099935, + "snr_db": 43.465171019236244, + "bandwidth": 8659.9365234375, + "emotion:Anger": 0.014486666666666667, + "emotion:Anger@1": 0.0, + "emotion:Sadness": 0.22601166666666664, + "emotion:Sadness@1": 0.125, + "emotion:Happiness": 0.12610333333333332, + "emotion:Happiness@1": 0.0, + "emotion:Fear": 0.05110041666666667, + "emotion:Fear@1": 0.0, + "emotion:Disgust": 0.0453, + "emotion:Disgust@1": 0.0, + "emotion:Surprise": 0.044999583333333336, + "emotion:Surprise@1": 0.0, + "emotion:Neutral": 0.37177958333333333, + "emotion:Neutral@1": 0.875, + "emodim:arousal": 0.2724433333333333, + "emodim:valence": 0.4608475 + }, + "sad hid-expresso x4": { + "wer": 0.0036231884057971015, + "collapse": 0.0, + "identity": 0.9066392390291117, + "durx": 1.3304761904761904, + "female": 0.5044554660271388, + "age": 43.50215227653583, + "f0": 129.1708427745377, + "f0_st": 3.031934703378594, + "voiced": 0.6617983439607648, + "rms_db": -38.99009339014689, + "snr_db": 40.9358381430308, + "bandwidth": 7690.045166015625, + "emotion:Anger": 0.018873749999999998, + "emotion:Anger@1": 0.0, + "emotion:Sadness": 0.19882791666666666, + "emotion:Sadness@1": 0.125, + "emotion:Happiness": 0.14281708333333332, + "emotion:Happiness@1": 0.0, + "emotion:Fear": 0.057562499999999996, + "emotion:Fear@1": 0.0, + "emotion:Disgust": 0.05267083333333333, + "emotion:Disgust@1": 0.0, + "emotion:Surprise": 0.05045249999999999, + "emotion:Surprise@1": 0.0, + "emotion:Neutral": 0.34666708333333335, + "emotion:Neutral@1": 0.875, + "emodim:arousal": 0.3184070833333333, + "emodim:valence": 0.47514249999999997 + }, + "happy emb x2": { + "wer": 0.034523809523809526, + "collapse": 0.041666666666666664, + "identity": 0.8312557110197014, + "durx": 0.9144203859183975, + "female": 0.49739038326758117, + "age": 41.455200935403504, + "f0": 161.00558025472776, + "f0_st": 3.48784206589216, + "voiced": 0.6408904164746428, + "rms_db": -34.525163412094116, + "snr_db": 37.31307109196981, + "bandwidth": 9781.008911132812, + "emotion:Anger": 0.04011375, + "emotion:Anger@1": 0.0, + "emotion:Sadness": 0.06424083333333333, + "emotion:Sadness@1": 0.0, + "emotion:Happiness": 0.23733541666666666, + "emotion:Happiness@1": 0.4583333333333333, + "emotion:Fear": 0.06469291666666667, + "emotion:Fear@1": 0.0, + "emotion:Disgust": 0.06522916666666667, + "emotion:Disgust@1": 0.0, + "emotion:Surprise": 0.08543291666666668, + "emotion:Surprise@1": 0.0, + "emotion:Neutral": 0.26936458333333335, + "emotion:Neutral@1": 0.5416666666666666, + "emodim:arousal": 0.5378691666666667, + "emodim:valence": 0.5558729166666666 + }, + "happy hid-ears x2": { + "wer": 0.004901960784313725, + "collapse": 0.0, + "identity": 0.8980164823006245, + "durx": 0.9881249999999999, + "female": 0.49814371718578815, + "age": 41.379802053173385, + "f0": 179.57132913920046, + "f0_st": 3.963024627442964, + "voiced": 0.6580756427199872, + "rms_db": -33.93821088473002, + "snr_db": 37.34904877344767, + "bandwidth": 7864.105224609375, + "emotion:Anger": 0.04783958333333333, + "emotion:Anger@1": 0.041666666666666664, + "emotion:Sadness": 0.07454625, + "emotion:Sadness@1": 0.0, + "emotion:Happiness": 0.2153445833333333, + "emotion:Happiness@1": 0.4166666666666667, + "emotion:Fear": 0.06245124999999999, + "emotion:Fear@1": 0.0, + "emotion:Disgust": 0.06857416666666666, + "emotion:Disgust@1": 0.0, + "emotion:Surprise": 0.07862583333333334, + "emotion:Surprise@1": 0.0, + "emotion:Neutral": 0.27470041666666667, + "emotion:Neutral@1": 0.5416666666666666, + "emodim:arousal": 0.5074029166666666, + "emodim:valence": 0.5370033333333333 + }, + "happy hid-expresso x2": { + "wer": 0.0011904761904761904, + "collapse": 0.0, + "identity": 0.9109893955215368, + "durx": 1.0788944375086698, + "female": 0.49955502479375963, + "age": 42.62122865766287, + "f0": 154.37996545478947, + "f0_st": 3.2224391841369084, + "voiced": 0.6645174821382841, + "rms_db": -35.88378779093424, + "snr_db": 38.91659474372864, + "bandwidth": 8180.3741455078125, + "emotion:Anger": 0.028814999999999997, + "emotion:Anger@1": 0.0, + "emotion:Sadness": 0.11575916666666668, + "emotion:Sadness@1": 0.0, + "emotion:Happiness": 0.19465666666666667, + "emotion:Happiness@1": 0.16666666666666666, + "emotion:Fear": 0.061493333333333344, + "emotion:Fear@1": 0.0, + "emotion:Disgust": 0.059596666666666666, + "emotion:Disgust@1": 0.0, + "emotion:Surprise": 0.06515375, + "emotion:Surprise@1": 0.0, + "emotion:Neutral": 0.31688083333333333, + "emotion:Neutral@1": 0.8333333333333334, + "emodim:arousal": 0.42125250000000003, + "emodim:valence": 0.5071283333333333 + }, + "happy emb x4": { + "wer": 0.0021929824561403508, + "collapse": 0.0, + "identity": 0.7358736573867852, + "durx": 0.954004817825956, + "female": 0.5058714660796492, + "age": 44.98111754655838, + "f0": 182.1270006000146, + "f0_st": 5.232154712615707, + "voiced": 0.6275081276760927, + "rms_db": -34.25869679450989, + "snr_db": 34.676495949427284, + "bandwidth": 9207.23876953125, + "emotion:Anger": 0.05384708333333333, + "emotion:Anger@1": 0.041666666666666664, + "emotion:Sadness": 0.025609583333333335, + "emotion:Sadness@1": 0.0, + "emotion:Happiness": 0.31605583333333337, + "emotion:Happiness@1": 0.75, + "emotion:Fear": 0.05497749999999999, + "emotion:Fear@1": 0.0, + "emotion:Disgust": 0.06189208333333333, + "emotion:Disgust@1": 0.0, + "emotion:Surprise": 0.08656666666666667, + "emotion:Surprise@1": 0.0, + "emotion:Neutral": 0.21331666666666668, + "emotion:Neutral@1": 0.20833333333333334, + "emodim:arousal": 0.66282625, + "emodim:valence": 0.6045275 + }, + "happy hid-ears x4": { + "wer": 0.07848561621444916, + "collapse": 0.041666666666666664, + "identity": 0.7516159805728889, + "durx": 1.0510033444816054, + "female": 0.6044553986090856, + "age": 39.8035983244578, + "f0": 289.871781810304, + "f0_st": 4.344237060691278, + "voiced": 0.7004697331894573, + "rms_db": -27.083906650543213, + "snr_db": 36.0888200600942, + "bandwidth": 7921.9757080078125, + "emotion:Anger": 0.11159916666666668, + "emotion:Anger@1": 0.125, + "emotion:Sadness": 0.0345525, + "emotion:Sadness@1": 0.0, + "emotion:Happiness": 0.26576041666666667, + "emotion:Happiness@1": 0.5833333333333334, + "emotion:Fear": 0.06401833333333333, + "emotion:Fear@1": 0.0, + "emotion:Disgust": 0.0758525, + "emotion:Disgust@1": 0.041666666666666664, + "emotion:Surprise": 0.12442958333333333, + "emotion:Surprise@1": 0.0, + "emotion:Neutral": 0.1386008333333333, + "emotion:Neutral@1": 0.20833333333333334, + "emodim:arousal": 0.69158375, + "emodim:valence": 0.56078 + }, + "happy hid-expresso x4": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.8840536292221627, + "durx": 1.1655251141552512, + "female": 0.5029744293375794, + "age": 44.06601836284002, + "f0": 187.85934013292717, + "f0_st": 3.597743802991934, + "voiced": 0.6575126657777076, + "rms_db": -35.53488032023112, + "snr_db": 36.951061725616455, + "bandwidth": 8114.4287109375, + "emotion:Anger": 0.03861875, + "emotion:Anger@1": 0.0, + "emotion:Sadness": 0.10436374999999999, + "emotion:Sadness@1": 0.041666666666666664, + "emotion:Happiness": 0.19671416666666666, + "emotion:Happiness@1": 0.2916666666666667, + "emotion:Fear": 0.06568416666666667, + "emotion:Fear@1": 0.0, + "emotion:Disgust": 0.0668875, + "emotion:Disgust@1": 0.0, + "emotion:Surprise": 0.0796375, + "emotion:Surprise@1": 0.0, + "emotion:Neutral": 0.27583375000000004, + "emotion:Neutral@1": 0.625, + "emodim:arousal": 0.4567491666666667, + "emodim:valence": 0.504595 + }, + "fearful emb x2": { + "wer": 0.003606442577030812, + "collapse": 0.0, + "identity": 0.8131313468725679, + "durx": 0.9704982517482518, + "female": 0.5002272353691902, + "age": 43.993217373887695, + "f0": 161.67419252994634, + "f0_st": 3.2900516958193022, + "voiced": 0.5775736138526976, + "rms_db": -36.288239320119224, + "snr_db": 38.86055040359497, + "bandwidth": 9405.972290039062, + "emotion:Anger": 0.07774541666666666, + "emotion:Anger@1": 0.08333333333333333, + "emotion:Sadness": 0.09338458333333333, + "emotion:Sadness@1": 0.041666666666666664, + "emotion:Happiness": 0.1780375, + "emotion:Happiness@1": 0.3333333333333333, + "emotion:Fear": 0.07871916666666666, + "emotion:Fear@1": 0.0, + "emotion:Disgust": 0.07546666666666667, + "emotion:Disgust@1": 0.0, + "emotion:Surprise": 0.07737875, + "emotion:Surprise@1": 0.0, + "emotion:Neutral": 0.22852666666666668, + "emotion:Neutral@1": 0.5416666666666666, + "emodim:arousal": 0.5304954166666667, + "emodim:valence": 0.4579179166666667 + }, + "fearful hid-ears x2": { + "wer": 0.0030370843989769823, + "collapse": 0.0, + "identity": 0.8701553895118282, + "durx": 1.0765853658536586, + "female": 0.5018243514350615, + "age": 42.02400998522838, + "f0": 193.57825899485647, + "f0_st": 3.8109478636980363, + "voiced": 0.6514274145017233, + "rms_db": -37.2564152876536, + "snr_db": 43.55648104349772, + "bandwidth": 8768.051147460938, + "emotion:Anger": 0.047191666666666666, + "emotion:Anger@1": 0.041666666666666664, + "emotion:Sadness": 0.09494375000000001, + "emotion:Sadness@1": 0.0, + "emotion:Happiness": 0.18791291666666665, + "emotion:Happiness@1": 0.20833333333333334, + "emotion:Fear": 0.06558791666666668, + "emotion:Fear@1": 0.0, + "emotion:Disgust": 0.06815291666666666, + "emotion:Disgust@1": 0.0, + "emotion:Surprise": 0.07476666666666666, + "emotion:Surprise@1": 0.0, + "emotion:Neutral": 0.2800154166666667, + "emotion:Neutral@1": 0.6666666666666666, + "emodim:arousal": 0.47479791666666665, + "emodim:valence": 0.5013016666666666 + }, + "fearful hid-expresso x2": { + "wer": 0.0023809523809523807, + "collapse": 0.0, + "identity": 0.8932490180637931, + "durx": 0.8516483516483517, + "female": 0.49750313537272933, + "age": 40.40007796138525, + "f0": 155.4362244974608, + "f0_st": 2.6614985048388013, + "voiced": 0.6953845461520277, + "rms_db": -37.471466859181724, + "snr_db": 38.031686782836914, + "bandwidth": 7976.7059326171875, + "emotion:Anger": 0.03153333333333334, + "emotion:Anger@1": 0.0, + "emotion:Sadness": 0.10316874999999999, + "emotion:Sadness@1": 0.0, + "emotion:Happiness": 0.2040904166666667, + "emotion:Happiness@1": 0.20833333333333334, + "emotion:Fear": 0.05730333333333334, + "emotion:Fear@1": 0.0, + "emotion:Disgust": 0.05271083333333334, + "emotion:Disgust@1": 0.0, + "emotion:Surprise": 0.05722666666666667, + "emotion:Surprise@1": 0.0, + "emotion:Neutral": 0.33915958333333335, + "emotion:Neutral@1": 0.7916666666666666, + "emodim:arousal": 0.475195, + "emodim:valence": 0.517555 + }, + "fearful emb x4": { + "wer": 0.009387599433366024, + "collapse": 0.0, + "identity": 0.6689732120553255, + "durx": 0.9055782312925169, + "female": 0.50279633430182, + "age": 44.64969982703527, + "f0": 196.7467425023314, + "f0_st": 3.901871474465015, + "voiced": 0.6005963607996624, + "rms_db": -35.808566649754844, + "snr_db": 35.16858124732971, + "bandwidth": 9185.70556640625, + "emotion:Anger": 0.16115500000000002, + "emotion:Anger@1": 0.375, + "emotion:Sadness": 0.046643333333333335, + "emotion:Sadness@1": 0.0, + "emotion:Happiness": 0.17200875000000002, + "emotion:Happiness@1": 0.375, + "emotion:Fear": 0.08807916666666667, + "emotion:Fear@1": 0.041666666666666664, + "emotion:Disgust": 0.08104291666666667, + "emotion:Disgust@1": 0.0, + "emotion:Surprise": 0.08618083333333333, + "emotion:Surprise@1": 0.0, + "emotion:Neutral": 0.14501958333333334, + "emotion:Neutral@1": 0.20833333333333334, + "emodim:arousal": 0.6846616666666666, + "emodim:valence": 0.45265874999999994 + }, + "fearful hid-ears x4": { + "wer": 0.048000676243037256, + "collapse": 0.0, + "identity": 0.7498345583588618, + "durx": 1.1897966594045024, + "female": 0.6190170796374636, + "age": 41.619935259222984, + "f0": 298.5426784240669, + "f0_st": 4.573477477778327, + "voiced": 0.6842839250507554, + "rms_db": -27.226947744687397, + "snr_db": 47.66378672917684, + "bandwidth": 8182.6171875, + "emotion:Anger": 0.11799583333333334, + "emotion:Anger@1": 0.16666666666666666, + "emotion:Sadness": 0.05431166666666667, + "emotion:Sadness@1": 0.0, + "emotion:Happiness": 0.18767875, + "emotion:Happiness@1": 0.4583333333333333, + "emotion:Fear": 0.09674583333333335, + "emotion:Fear@1": 0.041666666666666664, + "emotion:Disgust": 0.09239000000000001, + "emotion:Disgust@1": 0.0, + "emotion:Surprise": 0.14207958333333334, + "emotion:Surprise@1": 0.125, + "emotion:Neutral": 0.11106125, + "emotion:Neutral@1": 0.20833333333333334, + "emodim:arousal": 0.658755, + "emodim:valence": 0.5052424999999999 + }, + "fearful hid-expresso x4": { + "wer": 0.01577304834977469, + "collapse": 0.0, + "identity": 0.8358283523991451, + "durx": 0.7158385093167702, + "female": 0.498119546721379, + "age": 39.69697734961907, + "f0": 177.17102540808764, + "f0_st": 2.0872713231987006, + "voiced": 0.7619043091938332, + "rms_db": -34.606011072794594, + "snr_db": 32.48696764310201, + "bandwidth": 7960.5560302734375, + "emotion:Anger": 0.05009625, + "emotion:Anger@1": 0.08333333333333333, + "emotion:Sadness": 0.07114458333333334, + "emotion:Sadness@1": 0.0, + "emotion:Happiness": 0.23681666666666668, + "emotion:Happiness@1": 0.2916666666666667, + "emotion:Fear": 0.062191250000000003, + "emotion:Fear@1": 0.041666666666666664, + "emotion:Disgust": 0.053486250000000006, + "emotion:Disgust@1": 0.0, + "emotion:Surprise": 0.06662666666666667, + "emotion:Surprise@1": 0.0, + "emotion:Neutral": 0.2970729166666667, + "emotion:Neutral@1": 0.5833333333333334, + "emodim:arousal": 0.5857054166666665, + "emodim:valence": 0.5468079166666667 + }, + "disgusted emb x2": { + "wer": 0.0012254901960784314, + "collapse": 0.0, + "identity": 0.8167013300106514, + "durx": 1.0136566332218506, + "female": 0.4960197875479935, + "age": 43.199433758854866, + "f0": 158.22098885858395, + "f0_st": 4.063589573685003, + "voiced": 0.5664061238439941, + "rms_db": -35.49829204877218, + "snr_db": 36.064648151397705, + "bandwidth": 10394.256591796875, + "emotion:Anger": 0.06466083333333332, + "emotion:Anger@1": 0.08333333333333333, + "emotion:Sadness": 0.07171375, + "emotion:Sadness@1": 0.041666666666666664, + "emotion:Happiness": 0.22343208333333334, + "emotion:Happiness@1": 0.375, + "emotion:Fear": 0.06436083333333333, + "emotion:Fear@1": 0.0, + "emotion:Disgust": 0.06702666666666666, + "emotion:Disgust@1": 0.0, + "emotion:Surprise": 0.07257958333333332, + "emotion:Surprise@1": 0.0, + "emotion:Neutral": 0.2473145833333333, + "emotion:Neutral@1": 0.4583333333333333, + "emodim:arousal": 0.54550375, + "emodim:valence": 0.51818375 + }, + "disgusted hid-ears x2": { + "wer": 0.003641456582633053, + "collapse": 0.0, + "identity": 0.9051040803259309, + "durx": 1.005952380952381, + "female": 0.5000955122814048, + "age": 40.289884308973946, + "f0": 154.22657679751305, + "f0_st": 3.255612653032614, + "voiced": 0.5947403737172366, + "rms_db": -32.81152478853861, + "snr_db": 35.55649979909261, + "bandwidth": 8720.498657226562, + "emotion:Anger": 0.04456833333333333, + "emotion:Anger@1": 0.041666666666666664, + "emotion:Sadness": 0.0922525, + "emotion:Sadness@1": 0.0, + "emotion:Happiness": 0.19657541666666667, + "emotion:Happiness@1": 0.20833333333333334, + "emotion:Fear": 0.06152, + "emotion:Fear@1": 0.0, + "emotion:Disgust": 0.06553041666666667, + "emotion:Disgust@1": 0.0, + "emotion:Surprise": 0.06647416666666667, + "emotion:Surprise@1": 0.0, + "emotion:Neutral": 0.29761166666666666, + "emotion:Neutral@1": 0.7083333333333334, + "emodim:arousal": 0.4889895833333333, + "emodim:valence": 0.50393875 + }, + "disgusted hid-expresso x2": { + "wer": 0.0012254901960784314, + "collapse": 0.0, + "identity": 0.8929933340131117, + "durx": 1.080047789725209, + "female": 0.5001998505855832, + "age": 43.899486400187016, + "f0": 167.76657466209153, + "f0_st": 3.085972594334475, + "voiced": 0.6799672500910571, + "rms_db": -43.903902212778725, + "snr_db": 41.24531046549479, + "bandwidth": 9004.916381835938, + "emotion:Anger": 0.02968, + "emotion:Anger@1": 0.0, + "emotion:Sadness": 0.1234425, + "emotion:Sadness@1": 0.041666666666666664, + "emotion:Happiness": 0.18554875, + "emotion:Happiness@1": 0.125, + "emotion:Fear": 0.058633750000000005, + "emotion:Fear@1": 0.0, + "emotion:Disgust": 0.05759375, + "emotion:Disgust@1": 0.0, + "emotion:Surprise": 0.06389125, + "emotion:Surprise@1": 0.0, + "emotion:Neutral": 0.3218079166666667, + "emotion:Neutral@1": 0.8333333333333334, + "emodim:arousal": 0.400495, + "emodim:valence": 0.4914320833333334 + }, + "disgusted emb x4": { + "wer": 0.04285714285714285, + "collapse": 0.041666666666666664, + "identity": 0.6412165353213961, + "durx": 0.9808448540706605, + "female": 0.4921189176723904, + "age": 42.4794631699721, + "f0": 167.82456596909492, + "f0_st": 4.6517477572029415, + "voiced": 0.5294598313043383, + "rms_db": -35.79592076937357, + "snr_db": 37.9282763004303, + "bandwidth": 10830.303955078125, + "emotion:Anger": 0.12554583333333333, + "emotion:Anger@1": 0.16666666666666666, + "emotion:Sadness": 0.045879583333333335, + "emotion:Sadness@1": 0.0, + "emotion:Happiness": 0.22526083333333333, + "emotion:Happiness@1": 0.5416666666666666, + "emotion:Fear": 0.05023625, + "emotion:Fear@1": 0.0, + "emotion:Disgust": 0.05782291666666667, + "emotion:Disgust@1": 0.0, + "emotion:Surprise": 0.06719125, + "emotion:Surprise@1": 0.0, + "emotion:Neutral": 0.21391333333333332, + "emotion:Neutral@1": 0.2916666666666667, + "emodim:arousal": 0.6192566666666667, + "emodim:valence": 0.50425875 + }, + "disgusted hid-ears x4": { + "wer": 0.01684173669467787, + "collapse": 0.0, + "identity": 0.7683651534983081, + "durx": 1.0796380090497737, + "female": 0.4952140359285598, + "age": 38.01967427134514, + "f0": 211.6896231934488, + "f0_st": 3.6208509546008933, + "voiced": 0.5648916915918503, + "rms_db": -24.213120738665264, + "snr_db": 28.021793325742085, + "bandwidth": 10310.8154296875, + "emotion:Anger": 0.12812749999999998, + "emotion:Anger@1": 0.20833333333333334, + "emotion:Sadness": 0.05443375, + "emotion:Sadness@1": 0.041666666666666664, + "emotion:Happiness": 0.24316749999999998, + "emotion:Happiness@1": 0.5, + "emotion:Fear": 0.06476041666666667, + "emotion:Fear@1": 0.0, + "emotion:Disgust": 0.0729925, + "emotion:Disgust@1": 0.041666666666666664, + "emotion:Surprise": 0.09110208333333332, + "emotion:Surprise@1": 0.0, + "emotion:Neutral": 0.16169458333333334, + "emotion:Neutral@1": 0.16666666666666666, + "emodim:arousal": 0.6693370833333333, + "emodim:valence": 0.51375875 + }, + "disgusted hid-expresso x4": { + "wer": 0.02015893313847278, + "collapse": 0.0, + "identity": 0.7956951747105606, + "durx": 1.2468831768508544, + "female": 0.5027808864445736, + "age": 44.14414775868257, + "f0": 219.9030086139776, + "f0_st": 3.6782187274323275, + "voiced": 0.703178703267485, + "rms_db": -43.566847244898476, + "snr_db": 43.7267738978068, + "bandwidth": 8897.250366210938, + "emotion:Anger": 0.0531, + "emotion:Anger@1": 0.0, + "emotion:Sadness": 0.10735499999999999, + "emotion:Sadness@1": 0.0, + "emotion:Happiness": 0.2039895833333333, + "emotion:Happiness@1": 0.4166666666666667, + "emotion:Fear": 0.06560875000000001, + "emotion:Fear@1": 0.0, + "emotion:Disgust": 0.06530916666666667, + "emotion:Disgust@1": 0.041666666666666664, + "emotion:Surprise": 0.09009541666666669, + "emotion:Surprise@1": 0.0, + "emotion:Neutral": 0.2282291666666667, + "emotion:Neutral@1": 0.5416666666666666, + "emodim:arousal": 0.4570383333333334, + "emodim:valence": 0.4884033333333333 + }, + "surprised emb x2": { + "wer": 0.011838579825522886, + "collapse": 0.0, + "identity": 0.8456442228257165, + "durx": 0.9814814814814814, + "female": 0.498661633420852, + "age": 43.282718708117805, + "f0": 155.4680133256139, + "f0_st": 4.070474301723205, + "voiced": 0.6897569703331587, + "rms_db": -35.70777599016825, + "snr_db": 39.15029835700989, + "bandwidth": 9137.704467773438, + "emotion:Anger": 0.04965708333333333, + "emotion:Anger@1": 0.0, + "emotion:Sadness": 0.07089083333333333, + "emotion:Sadness@1": 0.0, + "emotion:Happiness": 0.21612666666666666, + "emotion:Happiness@1": 0.2916666666666667, + "emotion:Fear": 0.06233666666666667, + "emotion:Fear@1": 0.0, + "emotion:Disgust": 0.06531166666666666, + "emotion:Disgust@1": 0.0, + "emotion:Surprise": 0.07342833333333333, + "emotion:Surprise@1": 0.0, + "emotion:Neutral": 0.2763525, + "emotion:Neutral@1": 0.7083333333333334, + "emodim:arousal": 0.5124425, + "emodim:valence": 0.5260616666666666 + }, + "surprised hid-ears x2": { + "wer": 0.0036764705882352945, + "collapse": 0.0, + "identity": 0.9060078131220809, + "durx": 1.0662716699583057, + "female": 0.5144121301467143, + "age": 42.015814470748104, + "f0": 163.25217369079493, + "f0_st": 3.6056825572484033, + "voiced": 0.6109535891509896, + "rms_db": -34.815828243891396, + "snr_db": 35.31335926055908, + "bandwidth": 8350.396728515625, + "emotion:Anger": 0.03973291666666667, + "emotion:Anger@1": 0.0, + "emotion:Sadness": 0.08857249999999998, + "emotion:Sadness@1": 0.0, + "emotion:Happiness": 0.19264083333333334, + "emotion:Happiness@1": 0.25, + "emotion:Fear": 0.06509333333333334, + "emotion:Fear@1": 0.0, + "emotion:Disgust": 0.06733333333333333, + "emotion:Disgust@1": 0.0, + "emotion:Surprise": 0.07003333333333335, + "emotion:Surprise@1": 0.0, + "emotion:Neutral": 0.29992250000000004, + "emotion:Neutral@1": 0.7083333333333334, + "emodim:arousal": 0.4674804166666666, + "emodim:valence": 0.516165 + }, + "surprised hid-expresso x2": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.905665980385527, + "durx": 1.0705128205128205, + "female": 0.5033317759468142, + "age": 41.431533358991146, + "f0": 131.2739261866117, + "f0_st": 2.887352793686754, + "voiced": 0.6330326769539826, + "rms_db": -41.602630058924355, + "snr_db": 37.98695572217306, + "bandwidth": 8296.563720703125, + "emotion:Anger": 0.017055, + "emotion:Anger@1": 0.0, + "emotion:Sadness": 0.17481708333333335, + "emotion:Sadness@1": 0.125, + "emotion:Happiness": 0.15510291666666667, + "emotion:Happiness@1": 0.0, + "emotion:Fear": 0.05686, + "emotion:Fear@1": 0.0, + "emotion:Disgust": 0.0482125, + "emotion:Disgust@1": 0.0, + "emotion:Surprise": 0.050023333333333336, + "emotion:Surprise@1": 0.0, + "emotion:Neutral": 0.3680445833333333, + "emotion:Neutral@1": 0.875, + "emodim:arousal": 0.3333095833333333, + "emodim:valence": 0.48960833333333326 + }, + "surprised emb x4": { + "wer": 0.0588235294117647, + "collapse": 0.041666666666666664, + "identity": 0.7208325799960568, + "durx": 0.9519789397240377, + "female": 0.4997436727474754, + "age": 43.65594138701757, + "f0": 178.75512557175585, + "f0_st": 4.975396049233896, + "voiced": 0.6769161387865757, + "rms_db": -35.01146308581034, + "snr_db": 41.1749161084493, + "bandwidth": 8682.815551757812, + "emotion:Anger": 0.09766625, + "emotion:Anger@1": 0.125, + "emotion:Sadness": 0.04389416666666666, + "emotion:Sadness@1": 0.0, + "emotion:Happiness": 0.24445625, + "emotion:Happiness@1": 0.5, + "emotion:Fear": 0.05793333333333334, + "emotion:Fear@1": 0.0, + "emotion:Disgust": 0.06098875, + "emotion:Disgust@1": 0.0, + "emotion:Surprise": 0.07530958333333333, + "emotion:Surprise@1": 0.0, + "emotion:Neutral": 0.23260791666666666, + "emotion:Neutral@1": 0.375, + "emodim:arousal": 0.6055083333333333, + "emodim:valence": 0.5456641666666666 + }, + "surprised hid-ears x4": { + "wer": 0.060763161099680135, + "collapse": 0.041666666666666664, + "identity": 0.7880011453536717, + "durx": 1.3001278772378517, + "female": 0.46762684869463556, + "age": 40.108565613627434, + "f0": 253.22422375010805, + "f0_st": 4.147513210348705, + "voiced": 0.6813554569837712, + "rms_db": -25.468263665835064, + "snr_db": 32.77194778124491, + "bandwidth": 8512.344360351562, + "emotion:Anger": 0.10324166666666666, + "emotion:Anger@1": 0.20833333333333334, + "emotion:Sadness": 0.055066666666666673, + "emotion:Sadness@1": 0.0, + "emotion:Happiness": 0.22012708333333333, + "emotion:Happiness@1": 0.4166666666666667, + "emotion:Fear": 0.06854666666666666, + "emotion:Fear@1": 0.0, + "emotion:Disgust": 0.08372541666666666, + "emotion:Disgust@1": 0.041666666666666664, + "emotion:Surprise": 0.11213958333333333, + "emotion:Surprise@1": 0.0, + "emotion:Neutral": 0.1695458333333333, + "emotion:Neutral@1": 0.2916666666666667, + "emodim:arousal": 0.62805875, + "emodim:valence": 0.5238625 + }, + "surprised hid-expresso x4": { + "wer": 0.0012254901960784314, + "collapse": 0.0, + "identity": 0.8753900805585163, + "durx": 1.174013252664938, + "female": 0.5010339454020141, + "age": 41.06996643046538, + "f0": 128.69268145054696, + "f0_st": 2.875982949835606, + "voiced": 0.6212177826101426, + "rms_db": -43.87037340799967, + "snr_db": 37.59151140848795, + "bandwidth": 8654.55322265625, + "emotion:Anger": 0.01560208333333333, + "emotion:Anger@1": 0.0, + "emotion:Sadness": 0.2225495833333333, + "emotion:Sadness@1": 0.08333333333333333, + "emotion:Happiness": 0.13417291666666667, + "emotion:Happiness@1": 0.0, + "emotion:Fear": 0.05974666666666667, + "emotion:Fear@1": 0.0, + "emotion:Disgust": 0.04842958333333333, + "emotion:Disgust@1": 0.0, + "emotion:Surprise": 0.048349583333333335, + "emotion:Surprise@1": 0.0, + "emotion:Neutral": 0.34783625, + "emotion:Neutral@1": 0.9166666666666666, + "emodim:arousal": 0.2777266666666667, + "emodim:valence": 0.4763 + } + } +} diff --git a/steering/ears_emotions_mect60k/fearful.npy b/steering/ears_emotions_mect60k/fearful.npy new file mode 100644 index 0000000000000000000000000000000000000000..6b34567b9cbec9f62f6326474cf0ec0d31764bf4 --- /dev/null +++ b/steering/ears_emotions_mect60k/fearful.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8ebc224df22867238bfe537f940740236659efdbb2742ee89caa4f5b4d37111b +size 4224 diff --git a/steering/ears_emotions_mect60k/happy.npy b/steering/ears_emotions_mect60k/happy.npy new file mode 100644 index 0000000000000000000000000000000000000000..4e0e39c0d0f3842f915f704be1745a74e47e2502 --- /dev/null +++ b/steering/ears_emotions_mect60k/happy.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c7fb009a9a56dd8670d071d7ee99f1e1739418ab6c7e9754e8023cf752812d5b +size 4224 diff --git a/steering/ears_emotions_mect60k/manifest.json b/steering/ears_emotions_mect60k/manifest.json new file mode 100644 index 0000000000000000000000000000000000000000..42ab01d53c4d745db80c5bfeb82a8da2e0360906 --- /dev/null +++ b/steering/ears_emotions_mect60k/manifest.json @@ -0,0 +1,127 @@ +{ + "dim": 1024, + "space": "attnres_source", + "checkpoint": "/data/groups/audio/gabriel/hf_release_zonos3mini_20261020/lm/mect_60k", + "corpus": "/data/groups/audio/sofian/runs/steer_corpora/ears_emotions/clips.json", + "spec": { + "space": "attnres_source", + "group_by": "clip", + "center": "speaker", + "directions": { + "angry": { + "pairs": [ + [ + { + "style": "anger" + }, + { + "style": "neutral" + } + ] + ], + "kind": "named" + }, + "sad": { + "pairs": [ + [ + { + "style": "sadness" + }, + { + "style": "neutral" + } + ] + ], + "kind": "named" + }, + "happy": { + "pairs": [ + [ + { + "style": "amusement" + }, + { + "style": "neutral" + } + ] + ], + "kind": "named" + }, + "fearful": { + "pairs": [ + [ + { + "style": "fear" + }, + { + "style": "neutral" + } + ] + ], + "kind": "named" + }, + "disgusted": { + "pairs": [ + [ + { + "style": "disgust" + }, + { + "style": "neutral" + } + ] + ], + "kind": "named" + }, + "surprised": { + "pairs": [ + [ + { + "style": "amazement" + }, + { + "style": "neutral" + } + ] + ], + "kind": "named" + } + }, + "source_index": 19 + }, + "directions": { + "angry": { + "file": "angry.npy", + "kind": "named", + "norm": 0.024435275369628806 + }, + "sad": { + "file": "sad.npy", + "kind": "named", + "norm": 0.01633910478720501 + }, + "happy": { + "file": "happy.npy", + "kind": "named", + "norm": 0.01910547416830079 + }, + "fearful": { + "file": "fearful.npy", + "kind": "named", + "norm": 0.02055408798565512 + }, + "disgusted": { + "file": "disgusted.npy", + "kind": "named", + "norm": 0.020196482824966278 + }, + "surprised": { + "file": "surprised.npy", + "kind": "named", + "norm": 0.019633100615820298 + } + }, + "source_index": 19, + "source_name": "L9.attn", + "prompt_conditioning": "speaker_row=no,condition_rows=3:unknown" +} diff --git a/steering/ears_emotions_mect60k/report.json b/steering/ears_emotions_mect60k/report.json new file mode 100644 index 0000000000000000000000000000000000000000..6e792f12e97a1b65c55b5bad5315bd925b9c857e --- /dev/null +++ b/steering/ears_emotions_mect60k/report.json @@ -0,0 +1,158 @@ +{ + "angry": { + "norm": 0.024435275369628806, + "removed_share": 0.0, + "pairs": [ + { + "pair": [ + { + "style": "anger" + }, + { + "style": "neutral" + } + ], + "train_speakers": [ + 79, + 79 + ], + "held_out_speakers": [ + 28, + 28 + ], + "held_out_auc": 1.0, + "cos_with_direction": 1.0 + } + ] + }, + "sad": { + "norm": 0.01633910478720501, + "removed_share": 0.0, + "pairs": [ + { + "pair": [ + { + "style": "sadness" + }, + { + "style": "neutral" + } + ], + "train_speakers": [ + 79, + 79 + ], + "held_out_speakers": [ + 28, + 28 + ], + "held_out_auc": 1.0, + "cos_with_direction": 1.0 + } + ] + }, + "happy": { + "norm": 0.01910547416830079, + "removed_share": 0.0, + "pairs": [ + { + "pair": [ + { + "style": "amusement" + }, + { + "style": "neutral" + } + ], + "train_speakers": [ + 79, + 79 + ], + "held_out_speakers": [ + 28, + 28 + ], + "held_out_auc": 1.0, + "cos_with_direction": 0.9999999999999998 + } + ] + }, + "fearful": { + "norm": 0.02055408798565512, + "removed_share": 0.0, + "pairs": [ + { + "pair": [ + { + "style": "fear" + }, + { + "style": "neutral" + } + ], + "train_speakers": [ + 79, + 79 + ], + "held_out_speakers": [ + 28, + 28 + ], + "held_out_auc": 1.0, + "cos_with_direction": 1.0 + } + ] + }, + "disgusted": { + "norm": 0.020196482824966278, + "removed_share": 0.0, + "pairs": [ + { + "pair": [ + { + "style": "disgust" + }, + { + "style": "neutral" + } + ], + "train_speakers": [ + 79, + 79 + ], + "held_out_speakers": [ + 28, + 28 + ], + "held_out_auc": 1.0, + "cos_with_direction": 1.0 + } + ] + }, + "surprised": { + "norm": 0.019633100615820298, + "removed_share": 0.0, + "pairs": [ + { + "pair": [ + { + "style": "amazement" + }, + { + "style": "neutral" + } + ], + "train_speakers": [ + 79, + 79 + ], + "held_out_speakers": [ + 28, + 28 + ], + "held_out_auc": 1.0, + "cos_with_direction": 1.0000000000000002 + } + ] + } +} diff --git a/steering/ears_emotions_mect60k/sad.npy b/steering/ears_emotions_mect60k/sad.npy new file mode 100644 index 0000000000000000000000000000000000000000..0fee5cb81e37c718b241300353f29e9e0aead668 --- /dev/null +++ b/steering/ears_emotions_mect60k/sad.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1b32eb391e593283b44d1b0d357fc05ed07e53abdbad428133ff88e8129cbd10 +size 4224 diff --git a/steering/ears_emotions_mect60k/spec.json b/steering/ears_emotions_mect60k/spec.json new file mode 100644 index 0000000000000000000000000000000000000000..78393c40080b987c1b19f886f6f0a28af708b7cc --- /dev/null +++ b/steering/ears_emotions_mect60k/spec.json @@ -0,0 +1,86 @@ +{ + "space": "attnres_source", + "group_by": "clip", + "center": "speaker", + "directions": { + "angry": { + "pairs": [ + [ + { + "style": "anger" + }, + { + "style": "neutral" + } + ] + ], + "kind": "named" + }, + "sad": { + "pairs": [ + [ + { + "style": "sadness" + }, + { + "style": "neutral" + } + ] + ], + "kind": "named" + }, + "happy": { + "pairs": [ + [ + { + "style": "amusement" + }, + { + "style": "neutral" + } + ] + ], + "kind": "named" + }, + "fearful": { + "pairs": [ + [ + { + "style": "fear" + }, + { + "style": "neutral" + } + ] + ], + "kind": "named" + }, + "disgusted": { + "pairs": [ + [ + { + "style": "disgust" + }, + { + "style": "neutral" + } + ] + ], + "kind": "named" + }, + "surprised": { + "pairs": [ + [ + { + "style": "amazement" + }, + { + "style": "neutral" + } + ] + ], + "kind": "named" + } + }, + "source_index": 19 +} \ No newline at end of file diff --git a/steering/ears_emotions_mect60k/surprised.npy b/steering/ears_emotions_mect60k/surprised.npy new file mode 100644 index 0000000000000000000000000000000000000000..b8fc6a371e322e6d0f906c92be24a6ae0f3f0112 --- /dev/null +++ b/steering/ears_emotions_mect60k/surprised.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:54f42a78ceeb5885321c1ff9b8ca0ec18cde67daccd6584e681fd23de0b3587b +size 4224 diff --git a/steering/ears_moods_mect60k/adoring.npy b/steering/ears_moods_mect60k/adoring.npy new file mode 100644 index 0000000000000000000000000000000000000000..9a5523e14d938c5590d6e6360564501ee9d5cc94 --- /dev/null +++ b/steering/ears_moods_mect60k/adoring.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0fce2a88a890222ead5ffe86f7c20caa6e43a86c875ddcd3f7a1323bb54712e9 +size 4224 diff --git a/steering/ears_moods_mect60k/angry.npy b/steering/ears_moods_mect60k/angry.npy new file mode 100644 index 0000000000000000000000000000000000000000..85ceedc800c4ad761d1b49154b68d956a48478a2 --- /dev/null +++ b/steering/ears_moods_mect60k/angry.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:58db87626d768e4f7238e668eae487c715f709a234d03dc526913776187c7feb +size 4224 diff --git a/steering/ears_moods_mect60k/confused.npy b/steering/ears_moods_mect60k/confused.npy new file mode 100644 index 0000000000000000000000000000000000000000..fd1a30fa839ac389529eb2faaf18027ec958b039 --- /dev/null +++ b/steering/ears_moods_mect60k/confused.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:351f40dfd777a6254f985eb61aa47e8da9da0ba1f0c238c0f250a7f69de8b65f +size 4224 diff --git a/steering/ears_moods_mect60k/content.npy b/steering/ears_moods_mect60k/content.npy new file mode 100644 index 0000000000000000000000000000000000000000..5603ee6862971d5453e8ad1328097e3db6dfefd3 --- /dev/null +++ b/steering/ears_moods_mect60k/content.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5cc81de195696b2441d49932c24feaed80bbd15aa7e4190281339fecf68070da +size 4224 diff --git a/steering/ears_moods_mect60k/cute.npy b/steering/ears_moods_mect60k/cute.npy new file mode 100644 index 0000000000000000000000000000000000000000..c2c4c81a4489cea870c5646441038d5587f723cb --- /dev/null +++ b/steering/ears_moods_mect60k/cute.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a364eccf1f7c67a1191d82ff411f45f334f1e2d23b514669adac3be3b8546c19 +size 4224 diff --git a/steering/ears_moods_mect60k/desirous.npy b/steering/ears_moods_mect60k/desirous.npy new file mode 100644 index 0000000000000000000000000000000000000000..8b7722c46f09246f7f6fd0c03a6dc231e37759d4 --- /dev/null +++ b/steering/ears_moods_mect60k/desirous.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d60aa9c1e5592df02fbce59c1f69f726b2b676c84ee31ec1bb6f78b7a63ea3a1 +size 4224 diff --git a/steering/ears_moods_mect60k/disappointed.npy b/steering/ears_moods_mect60k/disappointed.npy new file mode 100644 index 0000000000000000000000000000000000000000..ff913ecb8d17408b79056d8f0a07e1f05ba3721f --- /dev/null +++ b/steering/ears_moods_mect60k/disappointed.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:991de36c80e3ca1cf982b29ee5849bb47857992ec5eccb5c8aa8319c9e0f2dcb +size 4224 diff --git a/steering/ears_moods_mect60k/disgusted.npy b/steering/ears_moods_mect60k/disgusted.npy new file mode 100644 index 0000000000000000000000000000000000000000..4207012ef2f1774ab33f174c675a8dd115b8ad4c --- /dev/null +++ b/steering/ears_moods_mect60k/disgusted.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:55a485f36d43d69ff0bf9fe0b57c19b064413df60d3a7c81c4a3f89cc794f796 +size 4224 diff --git a/steering/ears_moods_mect60k/distressed.npy b/steering/ears_moods_mect60k/distressed.npy new file mode 100644 index 0000000000000000000000000000000000000000..10a71fec098a5ba6c378bfdae068372068256c57 --- /dev/null +++ b/steering/ears_moods_mect60k/distressed.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f096dae9f8cf1ee47ae2bc109217b06d29c36c969bfd9def2584282a1392d436 +size 4224 diff --git a/steering/ears_moods_mect60k/ecstatic.npy b/steering/ears_moods_mect60k/ecstatic.npy new file mode 100644 index 0000000000000000000000000000000000000000..768fc2a9c2fd6c63bbc87fff522831578c721353 --- /dev/null +++ b/steering/ears_moods_mect60k/ecstatic.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1988044692f17e6eb57ac41b4b7a9ac609c46302a9983a73954ea3a658142e43 +size 4224 diff --git a/steering/ears_moods_mect60k/embarrassed.npy b/steering/ears_moods_mect60k/embarrassed.npy new file mode 100644 index 0000000000000000000000000000000000000000..8a4e36dde2e25e024f949b4be3ac434b3a1c9570 --- /dev/null +++ b/steering/ears_moods_mect60k/embarrassed.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:915062d6ffaa3ffdb43cbeacc25a5374052d8b1f9e3a32de4c82e4344108e981 +size 4224 diff --git a/steering/ears_moods_mect60k/eval/effects.json b/steering/ears_moods_mect60k/eval/effects.json new file mode 100644 index 0000000000000000000000000000000000000000..ec0043b93b18c4649ba1a78a8d5b4b0bb54757e8 --- /dev/null +++ b/steering/ears_moods_mect60k/eval/effects.json @@ -0,0 +1,14695 @@ +{ + "moods": { + "angry": { + "style": "anger", + "e2v": "angry", + "clap": [ + "angry" + ], + "msp": "Anger" + }, + "happy": { + "style": "amusement", + "e2v": "happy", + "clap": [ + "happy", + "enthusiastic" + ], + "msp": "Happiness" + }, + "sad": { + "style": "sadness", + "e2v": "sad", + "clap": [ + "saddened" + ], + "msp": "Sadness" + }, + "fearful": { + "style": "fear", + "e2v": "fearful", + "clap": [ + "scared" + ], + "msp": "Fear" + }, + "scared": { + "style": "fear vs the other 21 EARS emotions", + "e2v": "fearful", + "clap": [ + "scared" + ], + "msp": "Fear" + }, + "disgusted": { + "style": "disgust", + "e2v": "disgusted", + "clap": [ + "disgusted" + ], + "msp": "Disgust" + }, + "surprised": { + "style": "amazement", + "e2v": "surprised", + "clap": [ + "awed" + ], + "msp": "Surprise" + }, + "ecstatic": { + "style": "extasy", + "e2v": "happy", + "clap": [ + "happy", + "enthusiastic" + ], + "msp": "Happiness" + }, + "adoring": { + "style": "adoration", + "e2v": null, + "clap": [ + "admiring" + ], + "msp": null + }, + "confused": { + "style": "confusion", + "e2v": null, + "clap": [ + "confused" + ], + "msp": null + }, + "desirous": { + "style": "desire", + "e2v": null, + "clap": [ + "desirous" + ], + "msp": null + }, + "distressed": { + "style": "distress", + "e2v": null, + "clap": [ + "anxious" + ], + "msp": null + }, + "guilty": { + "style": "guilt", + "e2v": null, + "clap": [ + "guilt" + ], + "msp": null + }, + "pained": { + "style": "pain", + "e2v": null, + "clap": [ + "pained" + ], + "msp": null + }, + "content": { + "style": "contentment", + "e2v": null, + "clap": [ + "calm" + ], + "msp": null + }, + "relieved": { + "style": "relief", + "e2v": null, + "clap": [ + "calm" + ], + "msp": null + }, + "serene": { + "style": "serenity", + "e2v": null, + "clap": [ + "calm" + ], + "msp": null + }, + "disappointed": { + "style": "disappointment", + "e2v": "sad", + "clap": [ + "saddened" + ], + "msp": "Sadness" + }, + "cute": { + "style": "cuteness", + "e2v": null, + "clap": [], + "msp": null + }, + "embarrassed": { + "style": "embarassment", + "e2v": null, + "clap": [], + "msp": null + }, + "interested": { + "style": "interest", + "e2v": null, + "clap": [], + "msp": null + }, + "proud": { + "style": "pride", + "e2v": null, + "clap": [], + "msp": null + }, + "realizing": { + "style": "realization", + "e2v": null, + "clap": [], + "msp": null + } + }, + "evals": { + "served": { + "dirs": [ + "tmp/steer/moods/served", + "tmp/steer/moods/served_ovr", + "tmp/steer/moods/served_scared" + ], + "neutral": { + "wer": 0.0017, + "identity": 0.9448, + "arousal": 0.3686, + "valence": 0.5301, + "dominance": 0.4365, + "collapse": 0.0 + }, + "conditions": { + "angry x4": { + "mood": "angry", + "variant": null, + "dose": 4.0, + "n": 48, + "wer": 0.036, + "collapse": 0.0208, + "identity": 0.7846, + "durx": 0.989, + "clap_top": { + "happy": 0.271, + "desirous": 0.25, + "calm": 0.208 + }, + "e2v_top": { + "happy": 0.604, + "neutral": 0.312, + "unknown": 0.042 + }, + "msp_top": { + "Happiness": 0.479, + "Neutral": 0.25, + "Anger": 0.167 + }, + "targets": { + "e2v": { + "base": 0.0035, + "value": 0.0162, + "delta": 0.0127, + "ci": [ + 0.0006, + 0.0335 + ], + "voices": 5, + "specific": 0.0093 + }, + "e2v@1": { + "base": 0.0, + "value": 0.0208, + "delta": 0.0208, + "ci": [ + 0.0, + 0.0625 + ], + "voices": 1, + "specific": 0.0142 + }, + "clap": { + "base": 0.0014, + "value": 0.0072, + "delta": 0.0058, + "ci": [ + -0.0001, + 0.0167 + ], + "voices": 5, + "specific": 0.0058 + }, + "clap@1": { + "base": 0.0, + "value": 0.0, + "delta": 0.0, + "ci": [ + 0.0, + 0.0 + ], + "voices": 0, + "specific": 0.0 + }, + "clap_rank": { + "base": 14.0833, + "value": 17.5208, + "delta": 3.4375, + "ci": [ + 2.2703, + 4.5417 + ], + "voices": 5, + "specific": 1.0724 + }, + "msp@1": { + "base": 0.0, + "value": 0.1667, + "delta": 0.1667, + "ci": [ + 0.0625, + 0.2917 + ], + "voices": 3, + "specific": 0.1656 + }, + "arousal": { + "base": 0.3686, + "value": 0.7152, + "delta": 0.3466, + "ci": [ + 0.3234, + 0.3684 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.5731, + "delta": 0.043, + "ci": [ + 0.0161, + 0.0724 + ], + "voices": 5 + }, + "dominance": { + "base": 0.4365, + "value": 0.7256, + "delta": 0.2891, + "ci": [ + 0.2711, + 0.3069 + ], + "voices": 6 + } + }, + "clap_rise": { + "happy": 0.226, + "desirous": 0.165, + "sleepy": 0.064 + } + }, + "angry x6": { + "mood": "angry", + "variant": null, + "dose": 6.0, + "n": 48, + "wer": 0.1731, + "collapse": 0.125, + "identity": 0.6055, + "durx": 0.984, + "clap_top": { + "sleepy": 0.354, + "scared": 0.125, + "calm": 0.104 + }, + "e2v_top": { + "happy": 0.583, + "neutral": 0.125, + "angry": 0.104 + }, + "msp_top": { + "Happiness": 0.479, + "Anger": 0.333, + "Surprise": 0.083 + }, + "targets": { + "e2v": { + "base": 0.0035, + "value": 0.1208, + "delta": 0.1173, + "ci": [ + 0.046, + 0.2048 + ], + "voices": 6, + "specific": 0.1112 + }, + "e2v@1": { + "base": 0.0, + "value": 0.1042, + "delta": 0.1042, + "ci": [ + 0.0208, + 0.1875 + ], + "voices": 3, + "specific": 0.0965 + }, + "clap": { + "base": 0.0014, + "value": 0.0133, + "delta": 0.0119, + "ci": [ + 0.0025, + 0.028 + ], + "voices": 6, + "specific": 0.0118 + }, + "clap@1": { + "base": 0.0, + "value": 0.0208, + "delta": 0.0208, + "ci": [ + 0.0, + 0.0625 + ], + "voices": 1, + "specific": 0.0208 + }, + "clap_rank": { + "base": 14.0833, + "value": 15.2917, + "delta": 1.2083, + "ci": [ + -0.2292, + 2.7083 + ], + "voices": 3, + "specific": -2.1437 + }, + "msp@1": { + "base": 0.0, + "value": 0.3333, + "delta": 0.3333, + "ci": [ + 0.2083, + 0.4583 + ], + "voices": 4, + "specific": 0.3212 + }, + "arousal": { + "base": 0.3686, + "value": 0.821, + "delta": 0.4525, + "ci": [ + 0.4293, + 0.477 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.5464, + "delta": 0.0163, + "ci": [ + -0.0228, + 0.0528 + ], + "voices": 4 + }, + "dominance": { + "base": 0.4365, + "value": 0.81, + "delta": 0.3735, + "ci": [ + 0.3542, + 0.3939 + ], + "voices": 6 + } + }, + "clap_rise": { + "sleepy": 0.238, + "scared": 0.123, + "happy": 0.11 + } + }, + "angry x8": { + "mood": "angry", + "variant": null, + "dose": 8.0, + "n": 48, + "wer": 0.2986, + "collapse": 0.2083, + "identity": 0.5147, + "durx": 0.919, + "clap_top": { + "sleepy": 0.5, + "scared": 0.188, + "happy": 0.083 + }, + "e2v_top": { + "happy": 0.562, + "angry": 0.25, + "neutral": 0.083 + }, + "msp_top": { + "Happiness": 0.458, + "Anger": 0.396, + "Surprise": 0.104 + }, + "targets": { + "e2v": { + "base": 0.0035, + "value": 0.2212, + "delta": 0.2177, + "ci": [ + 0.124, + 0.3185 + ], + "voices": 6, + "specific": 0.2094 + }, + "e2v@1": { + "base": 0.0, + "value": 0.25, + "delta": 0.25, + "ci": [ + 0.1458, + 0.375 + ], + "voices": 4, + "specific": 0.239 + }, + "clap": { + "base": 0.0014, + "value": 0.021, + "delta": 0.0196, + "ci": [ + 0.0073, + 0.0361 + ], + "voices": 6, + "specific": 0.0195 + }, + "clap@1": { + "base": 0.0, + "value": 0.0208, + "delta": 0.0208, + "ci": [ + 0.0, + 0.0625 + ], + "voices": 1, + "specific": 0.0197 + }, + "clap_rank": { + "base": 14.0833, + "value": 14.0833, + "delta": 0.0, + "ci": [ + -1.7917, + 1.9167 + ], + "voices": 3, + "specific": -3.8366 + }, + "msp@1": { + "base": 0.0, + "value": 0.3958, + "delta": 0.3958, + "ci": [ + 0.25, + 0.5208 + ], + "voices": 5, + "specific": 0.3706 + }, + "arousal": { + "base": 0.3686, + "value": 0.8422, + "delta": 0.4736, + "ci": [ + 0.4444, + 0.5014 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.5079, + "delta": -0.0222, + "ci": [ + -0.0621, + 0.0174 + ], + "voices": 3 + }, + "dominance": { + "base": 0.4365, + "value": 0.8268, + "delta": 0.3903, + "ci": [ + 0.3655, + 0.4136 + ], + "voices": 6 + } + }, + "clap_rise": { + "sleepy": 0.322, + "scared": 0.149, + "happy": 0.071 + } + }, + "happy x4": { + "mood": "happy", + "variant": null, + "dose": 4.0, + "n": 48, + "wer": 0.0248, + "collapse": 0.0, + "identity": 0.867, + "durx": 1.022, + "clap_top": { + "calm": 0.312, + "happy": 0.208, + "desirous": 0.188 + }, + "e2v_top": { + "happy": 0.625, + "neutral": 0.375 + }, + "msp_top": { + "Happiness": 0.583, + "Neutral": 0.375, + "Contempt": 0.042 + }, + "targets": { + "e2v": { + "base": 0.1835, + "value": 0.5903, + "delta": 0.4068, + "ci": [ + 0.281, + 0.5336 + ], + "voices": 6, + "specific": 0.2558 + }, + "e2v@1": { + "base": 0.2083, + "value": 0.625, + "delta": 0.4167, + "ci": [ + 0.2708, + 0.5625 + ], + "voices": 6, + "specific": 0.2862 + }, + "clap": { + "base": 0.0107, + "value": 0.1662, + "delta": 0.1555, + "ci": [ + 0.0954, + 0.2224 + ], + "voices": 6, + "specific": 0.104 + }, + "clap@1": { + "base": 0.0, + "value": 0.2083, + "delta": 0.2083, + "ci": [ + 0.1042, + 0.3333 + ], + "voices": 5, + "specific": 0.1699 + }, + "clap_rank": { + "base": 10.2708, + "value": 6.2083, + "delta": -4.0625, + "ci": [ + -5.1047, + -2.9583 + ], + "voices": 5, + "specific": -2.1217 + }, + "msp@1": { + "base": 0.1458, + "value": 0.5833, + "delta": 0.4375, + "ci": [ + 0.2917, + 0.5833 + ], + "voices": 6, + "specific": 0.2862 + }, + "arousal": { + "base": 0.3686, + "value": 0.5424, + "delta": 0.1738, + "ci": [ + 0.1456, + 0.1989 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.5864, + "delta": 0.0563, + "ci": [ + 0.0397, + 0.0732 + ], + "voices": 5 + }, + "dominance": { + "base": 0.4365, + "value": 0.5768, + "delta": 0.1403, + "ci": [ + 0.1172, + 0.1608 + ], + "voices": 6 + } + }, + "clap_rise": { + "happy": 0.142, + "desirous": 0.138, + "sympathetic": 0.089 + } + }, + "happy x6": { + "mood": "happy", + "variant": null, + "dose": 6.0, + "n": 48, + "wer": 0.1138, + "collapse": 0.0208, + "identity": 0.7404, + "durx": 1.065, + "clap_top": { + "sleepy": 0.312, + "happy": 0.312, + "desirous": 0.167 + }, + "e2v_top": { + "happy": 0.812, + "neutral": 0.104, + "unknown": 0.042 + }, + "msp_top": { + "Happiness": 0.729, + "Neutral": 0.167, + "Surprise": 0.062 + }, + "targets": { + "e2v": { + "base": 0.1835, + "value": 0.8056, + "delta": 0.622, + "ci": [ + 0.5009, + 0.7419 + ], + "voices": 6, + "specific": 0.4297 + }, + "e2v@1": { + "base": 0.2083, + "value": 0.8125, + "delta": 0.6042, + "ci": [ + 0.4583, + 0.75 + ], + "voices": 6, + "specific": 0.4266 + }, + "clap": { + "base": 0.0107, + "value": 0.2758, + "delta": 0.2651, + "ci": [ + 0.1929, + 0.3401 + ], + "voices": 6, + "specific": 0.1929 + }, + "clap@1": { + "base": 0.0, + "value": 0.3125, + "delta": 0.3125, + "ci": [ + 0.1875, + 0.4375 + ], + "voices": 6, + "specific": 0.2336 + }, + "clap_rank": { + "base": 10.2708, + "value": 3.8333, + "delta": -6.4375, + "ci": [ + -7.3125, + -5.4375 + ], + "voices": 6, + "specific": -4.2796 + }, + "msp@1": { + "base": 0.1458, + "value": 0.7292, + "delta": 0.5833, + "ci": [ + 0.4375, + 0.7292 + ], + "voices": 6, + "specific": 0.3903 + }, + "arousal": { + "base": 0.3686, + "value": 0.6701, + "delta": 0.3016, + "ci": [ + 0.2783, + 0.3244 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.6498, + "delta": 0.1197, + "ci": [ + 0.0972, + 0.1417 + ], + "voices": 5 + }, + "dominance": { + "base": 0.4365, + "value": 0.6743, + "delta": 0.2378, + "ci": [ + 0.2201, + 0.256 + ], + "voices": 6 + } + }, + "clap_rise": { + "happy": 0.262, + "sleepy": 0.238, + "desirous": 0.138 + } + }, + "happy x8": { + "mood": "happy", + "variant": null, + "dose": 8.0, + "n": 48, + "wer": 0.3549, + "collapse": 0.2708, + "identity": 0.5941, + "durx": 0.995, + "clap_top": { + "sleepy": 0.479, + "happy": 0.229, + "desirous": 0.125 + }, + "e2v_top": { + "happy": 0.917, + "surprised": 0.062, + "unknown": 0.021 + }, + "msp_top": { + "Happiness": 0.917, + "Surprise": 0.042, + "Neutral": 0.021 + }, + "targets": { + "e2v": { + "base": 0.1835, + "value": 0.914, + "delta": 0.7305, + "ci": [ + 0.6209, + 0.8342 + ], + "voices": 6, + "specific": 0.4965 + }, + "e2v@1": { + "base": 0.2083, + "value": 0.9167, + "delta": 0.7083, + "ci": [ + 0.5833, + 0.8333 + ], + "voices": 6, + "specific": 0.4868 + }, + "clap": { + "base": 0.0107, + "value": 0.2029, + "delta": 0.1922, + "ci": [ + 0.136, + 0.2525 + ], + "voices": 6, + "specific": 0.1095 + }, + "clap@1": { + "base": 0.0, + "value": 0.2292, + "delta": 0.2292, + "ci": [ + 0.1042, + 0.3542 + ], + "voices": 5, + "specific": 0.1437 + }, + "clap_rank": { + "base": 10.2708, + "value": 3.9167, + "delta": -6.3542, + "ci": [ + -7.4792, + -5.2286 + ], + "voices": 6, + "specific": -4.3027 + }, + "msp@1": { + "base": 0.1458, + "value": 0.9167, + "delta": 0.7708, + "ci": [ + 0.6458, + 0.875 + ], + "voices": 6, + "specific": 0.5581 + }, + "arousal": { + "base": 0.3686, + "value": 0.7367, + "delta": 0.3681, + "ci": [ + 0.3415, + 0.3938 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.6898, + "delta": 0.1597, + "ci": [ + 0.1301, + 0.1915 + ], + "voices": 6 + }, + "dominance": { + "base": 0.4365, + "value": 0.7155, + "delta": 0.279, + "ci": [ + 0.2552, + 0.3012 + ], + "voices": 6 + } + }, + "clap_rise": { + "sleepy": 0.372, + "happy": 0.191, + "desirous": 0.09 + } + }, + "sad x4": { + "mood": "sad", + "variant": null, + "dose": 4.0, + "n": 48, + "wer": 0.0017, + "collapse": 0.0, + "identity": 0.8989, + "durx": 1.089, + "clap_top": { + "calm": 0.938, + "whispered": 0.062 + }, + "e2v_top": { + "neutral": 0.854, + "sad": 0.083, + "happy": 0.042 + }, + "msp_top": { + "Neutral": 0.875, + "Sadness": 0.125 + }, + "targets": { + "e2v": { + "base": 0.0075, + "value": 0.0699, + "delta": 0.0624, + "ci": [ + 0.0127, + 0.1242 + ], + "voices": 4, + "specific": 0.0347 + }, + "e2v@1": { + "base": 0.0, + "value": 0.0833, + "delta": 0.0833, + "ci": [ + 0.0208, + 0.1667 + ], + "voices": 1, + "specific": 0.0548 + }, + "clap": { + "base": 0.0035, + "value": 0.0027, + "delta": -0.0008, + "ci": [ + -0.0022, + 0.0004 + ], + "voices": 3, + "specific": -0.0072 + }, + "clap@1": { + "base": 0.0, + "value": 0.0, + "delta": 0.0, + "ci": [ + 0.0, + 0.0 + ], + "voices": 0, + "specific": -0.0022 + }, + "clap_rank": { + "base": 11.1458, + "value": 8.5417, + "delta": -2.6042, + "ci": [ + -3.4797, + -1.75 + ], + "voices": 6, + "specific": -2.5614 + }, + "msp@1": { + "base": 0.0208, + "value": 0.125, + "delta": 0.1042, + "ci": [ + 0.0, + 0.2083 + ], + "voices": 3, + "specific": 0.0845 + }, + "arousal": { + "base": 0.3686, + "value": 0.2685, + "delta": -0.1, + "ci": [ + -0.1178, + -0.0814 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.4924, + "delta": -0.0377, + "ci": [ + -0.0495, + -0.0263 + ], + "voices": 6 + }, + "dominance": { + "base": 0.4365, + "value": 0.3508, + "delta": -0.0857, + "ci": [ + -0.1016, + -0.0697 + ], + "voices": 6 + } + }, + "clap_rise": { + "calm": 0.237, + "confused": -0.0, + "anxious": -0.0 + } + }, + "sad x6": { + "mood": "sad", + "variant": null, + "dose": 6.0, + "n": 48, + "wer": 0.0213, + "collapse": 0.0, + "identity": 0.866, + "durx": 1.18, + "clap_top": { + "calm": 0.917, + "whispered": 0.083 + }, + "e2v_top": { + "neutral": 0.792, + "sad": 0.125, + "happy": 0.062 + }, + "msp_top": { + "Neutral": 0.708, + "Sadness": 0.292 + }, + "targets": { + "e2v": { + "base": 0.0075, + "value": 0.1571, + "delta": 0.1496, + "ci": [ + 0.0705, + 0.238 + ], + "voices": 6, + "specific": 0.0857 + }, + "e2v@1": { + "base": 0.0, + "value": 0.125, + "delta": 0.125, + "ci": [ + 0.0417, + 0.2292 + ], + "voices": 3, + "specific": 0.0603 + }, + "clap": { + "base": 0.0035, + "value": 0.0048, + "delta": 0.0013, + "ci": [ + -0.0013, + 0.0037 + ], + "voices": 4, + "specific": -0.0113 + }, + "clap@1": { + "base": 0.0, + "value": 0.0, + "delta": 0.0, + "ci": [ + 0.0, + 0.0 + ], + "voices": 0, + "specific": -0.0022 + }, + "clap_rank": { + "base": 11.1458, + "value": 7.2292, + "delta": -3.9167, + "ci": [ + -4.8542, + -2.9578 + ], + "voices": 6, + "specific": -2.7138 + }, + "msp@1": { + "base": 0.0208, + "value": 0.2917, + "delta": 0.2708, + "ci": [ + 0.1458, + 0.3958 + ], + "voices": 5, + "specific": 0.2401 + }, + "arousal": { + "base": 0.3686, + "value": 0.2191, + "delta": -0.1495, + "ci": [ + -0.1705, + -0.129 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.4654, + "delta": -0.0647, + "ci": [ + -0.0769, + -0.0531 + ], + "voices": 6 + }, + "dominance": { + "base": 0.4365, + "value": 0.3028, + "delta": -0.1337, + "ci": [ + -0.1527, + -0.1169 + ], + "voices": 6 + } + }, + "clap_rise": { + "calm": 0.231, + "whispered": 0.01, + "saddened": 0.001 + } + }, + "sad x8": { + "mood": "sad", + "variant": null, + "dose": 8.0, + "n": 48, + "wer": 0.0624, + "collapse": 0.0208, + "identity": 0.8229, + "durx": 1.268, + "clap_top": { + "calm": 0.833, + "sleepy": 0.083, + "whispered": 0.083 + }, + "e2v_top": { + "neutral": 0.646, + "sad": 0.208, + "happy": 0.062 + }, + "msp_top": { + "Neutral": 0.667, + "Sadness": 0.333 + }, + "targets": { + "e2v": { + "base": 0.0075, + "value": 0.2015, + "delta": 0.194, + "ci": [ + 0.1055, + 0.2995 + ], + "voices": 6, + "specific": 0.1148 + }, + "e2v@1": { + "base": 0.0, + "value": 0.2083, + "delta": 0.2083, + "ci": [ + 0.1042, + 0.3333 + ], + "voices": 4, + "specific": 0.125 + }, + "clap": { + "base": 0.0035, + "value": 0.0108, + "delta": 0.0073, + "ci": [ + 0.002, + 0.0149 + ], + "voices": 5, + "specific": -0.0135 + }, + "clap@1": { + "base": 0.0, + "value": 0.0, + "delta": 0.0, + "ci": [ + 0.0, + 0.0 + ], + "voices": 0, + "specific": -0.0022 + }, + "clap_rank": { + "base": 11.1458, + "value": 5.6667, + "delta": -5.4792, + "ci": [ + -6.6875, + -4.3542 + ], + "voices": 6, + "specific": -3.4233 + }, + "msp@1": { + "base": 0.0208, + "value": 0.3333, + "delta": 0.3125, + "ci": [ + 0.1875, + 0.4375 + ], + "voices": 5, + "specific": 0.2621 + }, + "arousal": { + "base": 0.3686, + "value": 0.1891, + "delta": -0.1795, + "ci": [ + -0.2019, + -0.1558 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.4436, + "delta": -0.0865, + "ci": [ + -0.1024, + -0.0707 + ], + "voices": 6 + }, + "dominance": { + "base": 0.4365, + "value": 0.2715, + "delta": -0.165, + "ci": [ + -0.1849, + -0.1464 + ], + "voices": 6 + } + }, + "clap_rise": { + "calm": 0.191, + "sleepy": 0.058, + "saddened": 0.007 + } + }, + "fearful x4": { + "mood": "fearful", + "variant": null, + "dose": 4.0, + "n": 48, + "wer": 0.0137, + "collapse": 0.0, + "identity": 0.8615, + "durx": 1.197, + "clap_top": { + "calm": 0.479, + "desirous": 0.271, + "sympathetic": 0.146 + }, + "e2v_top": { + "happy": 0.521, + "neutral": 0.417, + "unknown": 0.021 + }, + "msp_top": { + "Happiness": 0.583, + "Neutral": 0.312, + "Sadness": 0.042 + }, + "targets": { + "e2v": { + "base": 0.0001, + "value": 0.0013, + "delta": 0.0012, + "ci": [ + 0.0003, + 0.0024 + ], + "voices": 5, + "specific": -0.0018 + }, + "e2v@1": { + "base": 0.0, + "value": 0.0, + "delta": 0.0, + "ci": [ + 0.0, + 0.0 + ], + "voices": 0, + "specific": -0.0022 + }, + "clap": { + "base": 0.0001, + "value": 0.0013, + "delta": 0.0012, + "ci": [ + 0.0003, + 0.0026 + ], + "voices": 5, + "specific": -0.0018 + }, + "clap@1": { + "base": 0.0, + "value": 0.0, + "delta": 0.0, + "ci": [ + 0.0, + 0.0 + ], + "voices": 0, + "specific": -0.0022 + }, + "clap_rank": { + "base": 18.625, + "value": 18.2292, + "delta": -0.3958, + "ci": [ + -1.4167, + 0.563 + ], + "voices": 4, + "specific": 0.7676 + }, + "msp@1": { + "base": 0.0, + "value": 0.0, + "delta": 0.0, + "ci": [ + 0.0, + 0.0 + ], + "voices": 0, + "specific": -0.0033 + }, + "arousal": { + "base": 0.3686, + "value": 0.5205, + "delta": 0.152, + "ci": [ + 0.1274, + 0.1776 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.5583, + "delta": 0.0281, + "ci": [ + 0.0145, + 0.0428 + ], + "voices": 5 + }, + "dominance": { + "base": 0.4365, + "value": 0.5678, + "delta": 0.1313, + "ci": [ + 0.1102, + 0.1531 + ], + "voices": 6 + } + }, + "clap_rise": { + "desirous": 0.139, + "sympathetic": 0.08, + "happy": 0.06 + } + }, + "fearful x6": { + "mood": "fearful", + "variant": null, + "dose": 6.0, + "n": 48, + "wer": 0.0882, + "collapse": 0.0208, + "identity": 0.7362, + "durx": 1.32, + "clap_top": { + "desirous": 0.271, + "calm": 0.167, + "sleepy": 0.146 + }, + "e2v_top": { + "happy": 0.646, + "neutral": 0.125, + "surprised": 0.104 + }, + "msp_top": { + "Happiness": 0.625, + "Neutral": 0.104, + "Sadness": 0.083 + }, + "targets": { + "e2v": { + "base": 0.0001, + "value": 0.0104, + "delta": 0.0102, + "ci": [ + 0.0009, + 0.0222 + ], + "voices": 4, + "specific": 0.0008 + }, + "e2v@1": { + "base": 0.0, + "value": 0.0, + "delta": 0.0, + "ci": [ + 0.0, + 0.0 + ], + "voices": 0, + "specific": -0.0077 + }, + "clap": { + "base": 0.0001, + "value": 0.011, + "delta": 0.0109, + "ci": [ + 0.0028, + 0.0211 + ], + "voices": 6, + "specific": -0.0002 + }, + "clap@1": { + "base": 0.0, + "value": 0.0, + "delta": 0.0, + "ci": [ + 0.0, + 0.0 + ], + "voices": 0, + "specific": -0.0077 + }, + "clap_rank": { + "base": 18.625, + "value": 14.5625, + "delta": -4.0625, + "ci": [ + -5.5417, + -2.562 + ], + "voices": 5, + "specific": -0.9463 + }, + "msp@1": { + "base": 0.0, + "value": 0.0625, + "delta": 0.0625, + "ci": [ + 0.0, + 0.1458 + ], + "voices": 3, + "specific": 0.0548 + }, + "arousal": { + "base": 0.3686, + "value": 0.5977, + "delta": 0.2291, + "ci": [ + 0.203, + 0.2537 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.5707, + "delta": 0.0406, + "ci": [ + 0.0145, + 0.0668 + ], + "voices": 5 + }, + "dominance": { + "base": 0.4365, + "value": 0.6142, + "delta": 0.1776, + "ci": [ + 0.156, + 0.1991 + ], + "voices": 6 + } + }, + "clap_rise": { + "desirous": 0.162, + "sleepy": 0.14, + "happy": 0.134 + } + }, + "fearful x8": { + "mood": "fearful", + "variant": null, + "dose": 8.0, + "n": 48, + "wer": 0.3405, + "collapse": 0.2292, + "identity": 0.5735, + "durx": 1.38, + "clap_top": { + "desirous": 0.292, + "sleepy": 0.271, + "awed": 0.146 + }, + "e2v_top": { + "happy": 0.583, + "surprised": 0.25, + "sad": 0.083 + }, + "msp_top": { + "Happiness": 0.542, + "Surprise": 0.167, + "Fear": 0.167 + }, + "targets": { + "e2v": { + "base": 0.0001, + "value": 0.047, + "delta": 0.0469, + "ci": [ + 0.0053, + 0.1043 + ], + "voices": 6, + "specific": 0.0285 + }, + "e2v@1": { + "base": 0.0, + "value": 0.0417, + "delta": 0.0417, + "ci": [ + 0.0, + 0.1042 + ], + "voices": 1, + "specific": 0.0253 + }, + "clap": { + "base": 0.0001, + "value": 0.044, + "delta": 0.0439, + "ci": [ + 0.0176, + 0.083 + ], + "voices": 6, + "specific": 0.0283 + }, + "clap@1": { + "base": 0.0, + "value": 0.0417, + "delta": 0.0417, + "ci": [ + 0.0, + 0.1042 + ], + "voices": 2, + "specific": 0.0296 + }, + "clap_rank": { + "base": 18.625, + "value": 9.9167, + "delta": -8.7083, + "ci": [ + -9.938, + -7.3958 + ], + "voices": 6, + "specific": -3.8333 + }, + "msp@1": { + "base": 0.0, + "value": 0.1667, + "delta": 0.1667, + "ci": [ + 0.0833, + 0.2708 + ], + "voices": 5, + "specific": 0.1448 + }, + "arousal": { + "base": 0.3686, + "value": 0.6674, + "delta": 0.2988, + "ci": [ + 0.2691, + 0.3285 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.5674, + "delta": 0.0372, + "ci": [ + 0.0063, + 0.0686 + ], + "voices": 4 + }, + "dominance": { + "base": 0.4365, + "value": 0.6505, + "delta": 0.214, + "ci": [ + 0.187, + 0.24 + ], + "voices": 6 + } + }, + "clap_rise": { + "sleepy": 0.198, + "happy": 0.169, + "desirous": 0.148 + } + }, + "disgusted x4": { + "mood": "disgusted", + "variant": null, + "dose": 4.0, + "n": 48, + "wer": 0.0086, + "collapse": 0.0, + "identity": 0.8886, + "durx": 1.05, + "clap_top": { + "calm": 0.375, + "desirous": 0.312, + "happy": 0.083 + }, + "e2v_top": { + "neutral": 0.604, + "happy": 0.333, + "angry": 0.062 + }, + "msp_top": { + "Neutral": 0.542, + "Happiness": 0.396, + "Contempt": 0.062 + }, + "targets": { + "e2v": { + "base": 0.002, + "value": 0.0039, + "delta": 0.002, + "ci": [ + -0.0023, + 0.006 + ], + "voices": 4, + "specific": -0.0107 + }, + "e2v@1": { + "base": 0.0, + "value": 0.0, + "delta": 0.0, + "ci": [ + 0.0, + 0.0 + ], + "voices": 0, + "specific": -0.0143 + }, + "clap": { + "base": 0.0004, + "value": 0.0018, + "delta": 0.0014, + "ci": [ + 0.0004, + 0.003 + ], + "voices": 4, + "specific": -0.0002 + }, + "clap@1": { + "base": 0.0, + "value": 0.0, + "delta": 0.0, + "ci": [ + 0.0, + 0.0 + ], + "voices": 0, + "specific": 0.0 + }, + "clap_rank": { + "base": 17.0625, + "value": 16.1458, + "delta": -0.9167, + "ci": [ + -1.7708, + -0.0833 + ], + "voices": 4, + "specific": -0.2128 + }, + "msp@1": { + "base": 0.0, + "value": 0.0, + "delta": 0.0, + "ci": [ + 0.0, + 0.0 + ], + "voices": 0, + "specific": -0.0033 + }, + "arousal": { + "base": 0.3686, + "value": 0.5259, + "delta": 0.1573, + "ci": [ + 0.1347, + 0.1835 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.5459, + "delta": 0.0158, + "ci": [ + 0.0002, + 0.0316 + ], + "voices": 4 + }, + "dominance": { + "base": 0.4365, + "value": 0.5767, + "delta": 0.1402, + "ci": [ + 0.1199, + 0.1614 + ], + "voices": 6 + } + }, + "clap_rise": { + "desirous": 0.178, + "happy": 0.089, + "loud": 0.051 + } + }, + "disgusted x6": { + "mood": "disgusted", + "variant": null, + "dose": 6.0, + "n": 48, + "wer": 0.0204, + "collapse": 0.0, + "identity": 0.8129, + "durx": 1.111, + "clap_top": { + "desirous": 0.312, + "calm": 0.208, + "happy": 0.188 + }, + "e2v_top": { + "neutral": 0.479, + "happy": 0.458, + "angry": 0.042 + }, + "msp_top": { + "Happiness": 0.562, + "Neutral": 0.333, + "Anger": 0.062 + }, + "targets": { + "e2v": { + "base": 0.002, + "value": 0.0334, + "delta": 0.0314, + "ci": [ + 0.0041, + 0.0718 + ], + "voices": 5, + "specific": -0.0003 + }, + "e2v@1": { + "base": 0.0, + "value": 0.0208, + "delta": 0.0208, + "ci": [ + 0.0, + 0.0625 + ], + "voices": 1, + "specific": -0.0121 + }, + "clap": { + "base": 0.0004, + "value": 0.0036, + "delta": 0.0032, + "ci": [ + 0.0011, + 0.0057 + ], + "voices": 5, + "specific": -0.001 + }, + "clap@1": { + "base": 0.0, + "value": 0.0, + "delta": 0.0, + "ci": [ + 0.0, + 0.0 + ], + "voices": 0, + "specific": -0.0011 + }, + "clap_rank": { + "base": 17.0625, + "value": 15.0417, + "delta": -2.0208, + "ci": [ + -3.0625, + -0.875 + ], + "voices": 6, + "specific": 0.056 + }, + "msp@1": { + "base": 0.0, + "value": 0.0208, + "delta": 0.0208, + "ci": [ + 0.0, + 0.0625 + ], + "voices": 1, + "specific": 0.0164 + }, + "arousal": { + "base": 0.3686, + "value": 0.6306, + "delta": 0.262, + "ci": [ + 0.2334, + 0.2908 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.5397, + "delta": 0.0095, + "ci": [ + -0.0192, + 0.0354 + ], + "voices": 4 + }, + "dominance": { + "base": 0.4365, + "value": 0.6657, + "delta": 0.2292, + "ci": [ + 0.2046, + 0.2548 + ], + "voices": 6 + } + }, + "clap_rise": { + "desirous": 0.215, + "happy": 0.137, + "sleepy": 0.044 + } + }, + "disgusted x8": { + "mood": "disgusted", + "variant": null, + "dose": 8.0, + "n": 48, + "wer": 0.1008, + "collapse": 0.0625, + "identity": 0.7211, + "durx": 1.185, + "clap_top": { + "sleepy": 0.271, + "desirous": 0.25, + "calm": 0.125 + }, + "e2v_top": { + "happy": 0.521, + "neutral": 0.271, + "angry": 0.104 + }, + "msp_top": { + "Happiness": 0.583, + "Anger": 0.188, + "Neutral": 0.146 + }, + "targets": { + "e2v": { + "base": 0.002, + "value": 0.0382, + "delta": 0.0362, + "ci": [ + 0.0029, + 0.0798 + ], + "voices": 5, + "specific": 0.0038 + }, + "e2v@1": { + "base": 0.0, + "value": 0.0417, + "delta": 0.0417, + "ci": [ + 0.0, + 0.1042 + ], + "voices": 2, + "specific": 0.0077 + }, + "clap": { + "base": 0.0004, + "value": 0.0069, + "delta": 0.0064, + "ci": [ + 0.0037, + 0.0095 + ], + "voices": 6, + "specific": -0.0022 + }, + "clap@1": { + "base": 0.0, + "value": 0.0, + "delta": 0.0, + "ci": [ + 0.0, + 0.0 + ], + "voices": 0, + "specific": -0.0033 + }, + "clap_rank": { + "base": 17.0625, + "value": 13.3958, + "delta": -3.6667, + "ci": [ + -4.9167, + -2.4995 + ], + "voices": 6, + "specific": -0.0954 + }, + "msp@1": { + "base": 0.0, + "value": 0.0208, + "delta": 0.0208, + "ci": [ + 0.0, + 0.0625 + ], + "voices": 1, + "specific": 0.0164 + }, + "arousal": { + "base": 0.3686, + "value": 0.7221, + "delta": 0.3536, + "ci": [ + 0.3222, + 0.3856 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.5347, + "delta": 0.0045, + "ci": [ + -0.028, + 0.0343 + ], + "voices": 4 + }, + "dominance": { + "base": 0.4365, + "value": 0.7383, + "delta": 0.3018, + "ci": [ + 0.2777, + 0.3248 + ], + "voices": 6 + } + }, + "clap_rise": { + "sleepy": 0.158, + "desirous": 0.157, + "happy": 0.125 + } + }, + "surprised x4": { + "mood": "surprised", + "variant": null, + "dose": 4.0, + "n": 48, + "wer": 0.0121, + "collapse": 0.0, + "identity": 0.8766, + "durx": 1.152, + "clap_top": { + "calm": 0.479, + "desirous": 0.271, + "sympathetic": 0.146 + }, + "e2v_top": { + "neutral": 0.562, + "happy": 0.396, + "surprised": 0.021 + }, + "msp_top": { + "Happiness": 0.479, + "Neutral": 0.438, + "Sadness": 0.042 + }, + "targets": { + "e2v": { + "base": 0.0, + "value": 0.01, + "delta": 0.01, + "ci": [ + 0.0, + 0.0299 + ], + "voices": 4, + "specific": -0.0085 + }, + "e2v@1": { + "base": 0.0, + "value": 0.0208, + "delta": 0.0208, + "ci": [ + 0.0, + 0.0625 + ], + "voices": 1, + "specific": 0.0011 + }, + "clap": { + "base": 0.0205, + "value": 0.0478, + "delta": 0.0273, + "ci": [ + 0.01, + 0.0461 + ], + "voices": 5, + "specific": 0.0087 + }, + "clap@1": { + "base": 0.0, + "value": 0.0, + "delta": 0.0, + "ci": [ + 0.0, + 0.0 + ], + "voices": 0, + "specific": -0.0066 + }, + "clap_rank": { + "base": 8.375, + "value": 7.1458, + "delta": -1.2292, + "ci": [ + -2.3542, + -0.1042 + ], + "voices": 5, + "specific": 0.0142 + }, + "msp@1": { + "base": 0.0, + "value": 0.0, + "delta": 0.0, + "ci": [ + 0.0, + 0.0 + ], + "voices": 0, + "specific": -0.0121 + }, + "arousal": { + "base": 0.3686, + "value": 0.4893, + "delta": 0.1207, + "ci": [ + 0.1001, + 0.1422 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.5536, + "delta": 0.0235, + "ci": [ + 0.0074, + 0.0377 + ], + "voices": 5 + }, + "dominance": { + "base": 0.4365, + "value": 0.5466, + "delta": 0.11, + "ci": [ + 0.093, + 0.1281 + ], + "voices": 6 + } + }, + "clap_rise": { + "desirous": 0.148, + "sympathetic": 0.053, + "sleepy": 0.045 + } + }, + "surprised x6": { + "mood": "surprised", + "variant": null, + "dose": 6.0, + "n": 48, + "wer": 0.0512, + "collapse": 0.0208, + "identity": 0.8121, + "durx": 1.276, + "clap_top": { + "desirous": 0.271, + "calm": 0.25, + "happy": 0.25 + }, + "e2v_top": { + "happy": 0.562, + "neutral": 0.354, + "unknown": 0.042 + }, + "msp_top": { + "Happiness": 0.562, + "Neutral": 0.292, + "Surprise": 0.062 + }, + "targets": { + "e2v": { + "base": 0.0, + "value": 0.0003, + "delta": 0.0003, + "ci": [ + 0.0, + 0.0006 + ], + "voices": 5, + "specific": -0.0425 + }, + "e2v@1": { + "base": 0.0, + "value": 0.0, + "delta": 0.0, + "ci": [ + 0.0, + 0.0 + ], + "voices": 0, + "specific": -0.0417 + }, + "clap": { + "base": 0.0205, + "value": 0.05, + "delta": 0.0295, + "ci": [ + 0.0086, + 0.0507 + ], + "voices": 5, + "specific": 0.0088 + }, + "clap@1": { + "base": 0.0, + "value": 0.0208, + "delta": 0.0208, + "ci": [ + 0.0, + 0.0625 + ], + "voices": 1, + "specific": -0.0022 + }, + "clap_rank": { + "base": 8.375, + "value": 6.2708, + "delta": -2.1042, + "ci": [ + -3.5208, + -0.7292 + ], + "voices": 4, + "specific": -0.9463 + }, + "msp@1": { + "base": 0.0, + "value": 0.0625, + "delta": 0.0625, + "ci": [ + 0.0, + 0.1458 + ], + "voices": 2, + "specific": 0.0186 + }, + "arousal": { + "base": 0.3686, + "value": 0.6018, + "delta": 0.2332, + "ci": [ + 0.2062, + 0.2591 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.5791, + "delta": 0.0489, + "ci": [ + 0.0255, + 0.0709 + ], + "voices": 5 + }, + "dominance": { + "base": 0.4365, + "value": 0.6398, + "delta": 0.2033, + "ci": [ + 0.1821, + 0.2235 + ], + "voices": 6 + } + }, + "clap_rise": { + "happy": 0.198, + "desirous": 0.168, + "sleepy": 0.082 + } + }, + "surprised x8": { + "mood": "surprised", + "variant": null, + "dose": 8.0, + "n": 48, + "wer": 0.2449, + "collapse": 0.1875, + "identity": 0.699, + "durx": 1.272, + "clap_top": { + "sleepy": 0.354, + "desirous": 0.208, + "happy": 0.188 + }, + "e2v_top": { + "happy": 0.667, + "neutral": 0.146, + "surprised": 0.083 + }, + "msp_top": { + "Happiness": 0.625, + "Neutral": 0.146, + "Surprise": 0.062 + }, + "targets": { + "e2v": { + "base": 0.0, + "value": 0.0814, + "delta": 0.0814, + "ci": [ + 0.0209, + 0.1587 + ], + "voices": 6, + "specific": 0.02 + }, + "e2v@1": { + "base": 0.0, + "value": 0.0833, + "delta": 0.0833, + "ci": [ + 0.0208, + 0.1667 + ], + "voices": 3, + "specific": 0.0263 + }, + "clap": { + "base": 0.0205, + "value": 0.0684, + "delta": 0.0479, + "ci": [ + 0.0208, + 0.0776 + ], + "voices": 6, + "specific": 0.0237 + }, + "clap@1": { + "base": 0.0, + "value": 0.0417, + "delta": 0.0417, + "ci": [ + 0.0, + 0.1042 + ], + "voices": 2, + "specific": 0.0066 + }, + "clap_rank": { + "base": 8.375, + "value": 5.3125, + "delta": -3.0625, + "ci": [ + -4.25, + -1.8542 + ], + "voices": 5, + "specific": -2.0384 + }, + "msp@1": { + "base": 0.0, + "value": 0.0625, + "delta": 0.0625, + "ci": [ + 0.0, + 0.1458 + ], + "voices": 3, + "specific": 0.0033 + }, + "arousal": { + "base": 0.3686, + "value": 0.6703, + "delta": 0.3017, + "ci": [ + 0.2752, + 0.3292 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.6243, + "delta": 0.0941, + "ci": [ + 0.0678, + 0.1208 + ], + "voices": 6 + }, + "dominance": { + "base": 0.4365, + "value": 0.6804, + "delta": 0.2438, + "ci": [ + 0.2212, + 0.266 + ], + "voices": 6 + } + }, + "clap_rise": { + "sleepy": 0.26, + "happy": 0.162, + "desirous": 0.119 + } + }, + "adoring x4": { + "mood": "adoring", + "variant": null, + "dose": 4.0, + "n": 48, + "wer": 0.0024, + "collapse": 0.0, + "identity": 0.9094, + "durx": 1.114, + "clap_top": { + "calm": 0.625, + "desirous": 0.229, + "enunciated": 0.062 + }, + "e2v_top": { + "neutral": 0.604, + "happy": 0.312, + "unknown": 0.042 + }, + "msp_top": { + "Neutral": 0.625, + "Happiness": 0.292, + "Sadness": 0.062 + }, + "targets": { + "clap": { + "base": 0.0214, + "value": 0.024, + "delta": 0.0026, + "ci": [ + -0.0045, + 0.0105 + ], + "voices": 3, + "specific": 0.004 + }, + "clap@1": { + "base": 0.0, + "value": 0.0, + "delta": 0.0, + "ci": [ + 0.0, + 0.0 + ], + "voices": 0, + "specific": 0.0 + }, + "clap_rank": { + "base": 7.0833, + "value": 7.9792, + "delta": 0.8958, + "ci": [ + 0.0, + 1.8339 + ], + "voices": 3, + "specific": -0.7248 + }, + "arousal": { + "base": 0.3686, + "value": 0.4152, + "delta": 0.0466, + "ci": [ + 0.0314, + 0.0627 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.5385, + "delta": 0.0083, + "ci": [ + -0.0047, + 0.0202 + ], + "voices": 5 + }, + "dominance": { + "base": 0.4365, + "value": 0.4838, + "delta": 0.0473, + "ci": [ + 0.0341, + 0.0624 + ], + "voices": 6 + } + }, + "clap_rise": { + "desirous": 0.096, + "sympathetic": 0.037, + "awed": 0.022 + } + }, + "adoring x6": { + "mood": "adoring", + "variant": null, + "dose": 6.0, + "n": 48, + "wer": 0.0072, + "collapse": 0.0, + "identity": 0.8717, + "durx": 1.227, + "clap_top": { + "calm": 0.604, + "desirous": 0.125, + "happy": 0.062 + }, + "e2v_top": { + "neutral": 0.479, + "happy": 0.417, + "unknown": 0.083 + }, + "msp_top": { + "Neutral": 0.521, + "Happiness": 0.458, + "Contempt": 0.021 + }, + "targets": { + "clap": { + "base": 0.0214, + "value": 0.0148, + "delta": -0.0066, + "ci": [ + -0.013, + -0.0008 + ], + "voices": 5, + "specific": -0.0004 + }, + "clap@1": { + "base": 0.0, + "value": 0.0, + "delta": 0.0, + "ci": [ + 0.0, + 0.0 + ], + "voices": 0, + "specific": -0.0011 + }, + "clap_rank": { + "base": 7.0833, + "value": 8.6875, + "delta": 1.6042, + "ci": [ + 0.6667, + 2.6667 + ], + "voices": 4, + "specific": -1.5723 + }, + "arousal": { + "base": 0.3686, + "value": 0.4342, + "delta": 0.0656, + "ci": [ + 0.0482, + 0.0829 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.552, + "delta": 0.0219, + "ci": [ + 0.0081, + 0.0354 + ], + "voices": 5 + }, + "dominance": { + "base": 0.4365, + "value": 0.4969, + "delta": 0.0604, + "ci": [ + 0.0445, + 0.0761 + ], + "voices": 6 + } + }, + "clap_rise": { + "desirous": 0.091, + "happy": 0.054, + "sympathetic": 0.039 + } + }, + "adoring x8": { + "mood": "adoring", + "variant": null, + "dose": 8.0, + "n": 48, + "wer": 0.0661, + "collapse": 0.0208, + "identity": 0.8391, + "durx": 1.271, + "clap_top": { + "calm": 0.438, + "desirous": 0.167, + "sleepy": 0.125 + }, + "e2v_top": { + "happy": 0.458, + "neutral": 0.458, + "unknown": 0.042 + }, + "msp_top": { + "Happiness": 0.479, + "Neutral": 0.458, + "Disgust": 0.042 + }, + "targets": { + "clap": { + "base": 0.0214, + "value": 0.01, + "delta": -0.0113, + "ci": [ + -0.0192, + -0.0043 + ], + "voices": 5, + "specific": -0.004 + }, + "clap@1": { + "base": 0.0, + "value": 0.0, + "delta": 0.0, + "ci": [ + 0.0, + 0.0 + ], + "voices": 0, + "specific": -0.0055 + }, + "clap_rank": { + "base": 7.0833, + "value": 10.3958, + "delta": 3.3125, + "ci": [ + 2.1458, + 4.5625 + ], + "voices": 5, + "specific": -0.8673 + }, + "arousal": { + "base": 0.3686, + "value": 0.4908, + "delta": 0.1222, + "ci": [ + 0.0979, + 0.1466 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.5701, + "delta": 0.04, + "ci": [ + 0.0215, + 0.0572 + ], + "voices": 5 + }, + "dominance": { + "base": 0.4365, + "value": 0.5416, + "delta": 0.1051, + "ci": [ + 0.0846, + 0.1247 + ], + "voices": 6 + } + }, + "clap_rise": { + "sleepy": 0.089, + "desirous": 0.073, + "awed": 0.071 + } + }, + "confused x4": { + "mood": "confused", + "variant": null, + "dose": 4.0, + "n": 48, + "wer": 0.1998, + "collapse": 0.1042, + "identity": 0.7956, + "durx": 2.29, + "clap_top": { + "sleepy": 0.375, + "calm": 0.333, + "desirous": 0.208 + }, + "e2v_top": { + "happy": 0.521, + "surprised": 0.167, + "neutral": 0.125 + }, + "msp_top": { + "Neutral": 0.667, + "Happiness": 0.146, + "Sadness": 0.083 + }, + "targets": { + "clap": { + "base": 0.0002, + "value": 0.0348, + "delta": 0.0346, + "ci": [ + 0.0233, + 0.0476 + ], + "voices": 6, + "specific": 0.0267 + }, + "clap@1": { + "base": 0.0, + "value": 0.0, + "delta": 0.0, + "ci": [ + 0.0, + 0.0 + ], + "voices": 0, + "specific": -0.0055 + }, + "clap_rank": { + "base": 18.875, + "value": 8.2083, + "delta": -10.6667, + "ci": [ + -11.8958, + -9.2708 + ], + "voices": 6, + "specific": -6.727 + }, + "arousal": { + "base": 0.3686, + "value": 0.3471, + "delta": -0.0215, + "ci": [ + -0.0517, + 0.008 + ], + "voices": 3 + }, + "valence": { + "base": 0.5301, + "value": 0.5055, + "delta": -0.0247, + "ci": [ + -0.0485, + -0.002 + ], + "voices": 3 + }, + "dominance": { + "base": 0.4365, + "value": 0.3998, + "delta": -0.0368, + "ci": [ + -0.0644, + -0.0086 + ], + "voices": 3 + } + }, + "clap_rise": { + "sleepy": 0.249, + "desirous": 0.055, + "happy": 0.054 + } + }, + "confused x6": { + "mood": "confused", + "variant": null, + "dose": 6.0, + "n": 48, + "wer": 0.7665, + "collapse": 0.9167, + "identity": 0.5315, + "durx": 2.251, + "clap_top": { + "sleepy": 0.854, + "calm": 0.042, + "saddened": 0.042 + }, + "e2v_top": { + "happy": 0.354, + "surprised": 0.271, + "sad": 0.188 + }, + "msp_top": { + "Neutral": 0.771, + "Surprise": 0.146, + "Happiness": 0.062 + }, + "targets": { + "clap": { + "base": 0.0002, + "value": 0.0469, + "delta": 0.0467, + "ci": [ + 0.0283, + 0.0718 + ], + "voices": 6, + "specific": 0.0297 + }, + "clap@1": { + "base": 0.0, + "value": 0.0208, + "delta": 0.0208, + "ci": [ + 0.0, + 0.0625 + ], + "voices": 1, + "specific": 0.0098 + }, + "clap_rank": { + "base": 18.875, + "value": 5.6042, + "delta": -13.2708, + "ci": [ + -14.25, + -12.2083 + ], + "voices": 6, + "specific": -7.1008 + }, + "arousal": { + "base": 0.3686, + "value": 0.3395, + "delta": -0.0291, + "ci": [ + -0.0686, + 0.0104 + ], + "voices": 3 + }, + "valence": { + "base": 0.5301, + "value": 0.527, + "delta": -0.0032, + "ci": [ + -0.0337, + 0.0257 + ], + "voices": 3 + }, + "dominance": { + "base": 0.4365, + "value": 0.3475, + "delta": -0.089, + "ci": [ + -0.1187, + -0.0589 + ], + "voices": 6 + } + }, + "clap_rise": { + "sleepy": 0.583, + "saddened": 0.08, + "confused": 0.047 + } + }, + "confused x8": { + "mood": "confused", + "variant": null, + "dose": 8.0, + "n": 48, + "wer": 0.9029, + "collapse": 1.0, + "identity": 0.3746, + "durx": 1.875, + "clap_top": { + "sleepy": 0.896, + "awed": 0.062, + "pained": 0.021 + }, + "e2v_top": { + "sad": 0.312, + "surprised": 0.25, + "happy": 0.229 + }, + "msp_top": { + "Neutral": 0.688, + "Surprise": 0.125, + "Sadness": 0.125 + }, + "targets": { + "clap": { + "base": 0.0002, + "value": 0.043, + "delta": 0.0429, + "ci": [ + 0.0308, + 0.0568 + ], + "voices": 6, + "specific": 0.0199 + }, + "clap@1": { + "base": 0.0, + "value": 0.0, + "delta": 0.0, + "ci": [ + 0.0, + 0.0 + ], + "voices": 0, + "specific": -0.0066 + }, + "clap_rank": { + "base": 18.875, + "value": 5.5625, + "delta": -13.3125, + "ci": [ + -14.2917, + -12.2292 + ], + "voices": 6, + "specific": -5.2357 + }, + "arousal": { + "base": 0.3686, + "value": 0.3332, + "delta": -0.0354, + "ci": [ + -0.075, + 0.0053 + ], + "voices": 4 + }, + "valence": { + "base": 0.5301, + "value": 0.5362, + "delta": 0.0061, + "ci": [ + -0.0263, + 0.0395 + ], + "voices": 2 + }, + "dominance": { + "base": 0.4365, + "value": 0.3335, + "delta": -0.1031, + "ci": [ + -0.1352, + -0.0696 + ], + "voices": 5 + } + }, + "clap_rise": { + "sleepy": 0.58, + "saddened": 0.104, + "confused": 0.043 + } + }, + "content x4": { + "mood": "content", + "variant": null, + "dose": 4.0, + "n": 48, + "wer": 0.0012, + "collapse": 0.0, + "identity": 0.9114, + "durx": 0.961, + "clap_top": { + "calm": 0.688, + "desirous": 0.104, + "enunciated": 0.083 + }, + "e2v_top": { + "neutral": 0.646, + "happy": 0.292, + "sad": 0.042 + }, + "msp_top": { + "Neutral": 0.75, + "Happiness": 0.229, + "Surprise": 0.021 + }, + "targets": { + "clap": { + "base": 0.5825, + "value": 0.5539, + "delta": -0.0286, + "ci": [ + -0.083, + 0.0277 + ], + "voices": 3, + "specific": 0.1297 + }, + "clap@1": { + "base": 0.7708, + "value": 0.6875, + "delta": -0.0833, + "ci": [ + -0.2083, + 0.0417 + ], + "voices": 3, + "specific": 0.1645 + }, + "clap_rank": { + "base": 1.4167, + "value": 1.7083, + "delta": 0.2917, + "ci": [ + 0.0, + 0.6458 + ], + "voices": 4, + "specific": -2.1107 + }, + "arousal": { + "base": 0.3686, + "value": 0.4147, + "delta": 0.0461, + "ci": [ + 0.0301, + 0.0616 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.5712, + "delta": 0.0411, + "ci": [ + 0.03, + 0.0524 + ], + "voices": 6 + }, + "dominance": { + "base": 0.4365, + "value": 0.4695, + "delta": 0.033, + "ci": [ + 0.02, + 0.0462 + ], + "voices": 6 + } + }, + "clap_rise": { + "sympathetic": 0.038, + "loud": 0.022, + "fast": 0.018 + } + }, + "content x6": { + "mood": "content", + "variant": null, + "dose": 6.0, + "n": 48, + "wer": 0.0163, + "collapse": 0.0, + "identity": 0.881, + "durx": 0.955, + "clap_top": { + "calm": 0.562, + "desirous": 0.125, + "sympathetic": 0.062 + }, + "e2v_top": { + "neutral": 0.562, + "happy": 0.375, + "unknown": 0.062 + }, + "msp_top": { + "Neutral": 0.542, + "Happiness": 0.438, + "Sadness": 0.021 + }, + "targets": { + "clap": { + "base": 0.5825, + "value": 0.4456, + "delta": -0.1369, + "ci": [ + -0.1998, + -0.0722 + ], + "voices": 6, + "specific": 0.1305 + }, + "clap@1": { + "base": 0.7708, + "value": 0.5625, + "delta": -0.2083, + "ci": [ + -0.3542, + -0.0625 + ], + "voices": 4, + "specific": 0.1744 + }, + "clap_rank": { + "base": 1.4167, + "value": 2.2917, + "delta": 0.875, + "ci": [ + 0.375, + 1.5005 + ], + "voices": 5, + "specific": -3.6404 + }, + "arousal": { + "base": 0.3686, + "value": 0.4533, + "delta": 0.0847, + "ci": [ + 0.0672, + 0.102 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.6007, + "delta": 0.0705, + "ci": [ + 0.0596, + 0.081 + ], + "voices": 6 + }, + "dominance": { + "base": 0.4365, + "value": 0.4955, + "delta": 0.0589, + "ci": [ + 0.0437, + 0.0737 + ], + "voices": 6 + } + }, + "clap_rise": { + "desirous": 0.051, + "sympathetic": 0.045, + "happy": 0.041 + } + }, + "content x8": { + "mood": "content", + "variant": null, + "dose": 8.0, + "n": 48, + "wer": 0.04, + "collapse": 0.0, + "identity": 0.8483, + "durx": 0.956, + "clap_top": { + "calm": 0.479, + "desirous": 0.125, + "sympathetic": 0.125 + }, + "e2v_top": { + "happy": 0.667, + "neutral": 0.292, + "unknown": 0.042 + }, + "msp_top": { + "Happiness": 0.583, + "Neutral": 0.354, + "Contempt": 0.042 + }, + "targets": { + "clap": { + "base": 0.5825, + "value": 0.3778, + "delta": -0.2047, + "ci": [ + -0.2784, + -0.1386 + ], + "voices": 6, + "specific": 0.1479 + }, + "clap@1": { + "base": 0.7708, + "value": 0.4792, + "delta": -0.2917, + "ci": [ + -0.4375, + -0.1458 + ], + "voices": 5, + "specific": 0.2138 + }, + "clap_rank": { + "base": 1.4167, + "value": 3.0, + "delta": 1.5833, + "ci": [ + 0.8333, + 2.4583 + ], + "voices": 6, + "specific": -5.0022 + }, + "arousal": { + "base": 0.3686, + "value": 0.4993, + "delta": 0.1307, + "ci": [ + 0.1105, + 0.1487 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.6139, + "delta": 0.0837, + "ci": [ + 0.0673, + 0.0995 + ], + "voices": 6 + }, + "dominance": { + "base": 0.4365, + "value": 0.5279, + "delta": 0.0913, + "ci": [ + 0.074, + 0.1081 + ], + "voices": 6 + } + }, + "clap_rise": { + "sleepy": 0.08, + "happy": 0.064, + "sympathetic": 0.056 + } + }, + "cute x4": { + "mood": "cute", + "variant": null, + "dose": 4.0, + "n": 48, + "wer": 0.6549, + "collapse": 0.6875, + "identity": 0.4826, + "durx": 1.159, + "clap_top": { + "sleepy": 0.875, + "desirous": 0.062, + "awed": 0.042 + }, + "e2v_top": { + "happy": 0.792, + "surprised": 0.104, + "fearful": 0.042 + }, + "msp_top": { + "Happiness": 0.667, + "Neutral": 0.271, + "Contempt": 0.021 + }, + "targets": { + "arousal": { + "base": 0.3686, + "value": 0.6059, + "delta": 0.2373, + "ci": [ + 0.1942, + 0.2759 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.6584, + "delta": 0.1283, + "ci": [ + 0.0931, + 0.1639 + ], + "voices": 6 + }, + "dominance": { + "base": 0.4365, + "value": 0.5789, + "delta": 0.1423, + "ci": [ + 0.1048, + 0.1804 + ], + "voices": 6 + } + }, + "clap_rise": { + "sleepy": 0.609, + "happy": 0.046, + "confused": 0.044 + } + }, + "cute x6": { + "mood": "cute", + "variant": null, + "dose": 6.0, + "n": 48, + "wer": 0.8896, + "collapse": 0.9792, + "identity": 0.2647, + "durx": 0.811, + "clap_top": { + "sleepy": 0.979, + "desirous": 0.021 + }, + "e2v_top": { + "happy": 0.708, + "fearful": 0.104, + "sad": 0.104 + }, + "msp_top": { + "Neutral": 0.438, + "Happiness": 0.271, + "Surprise": 0.208 + }, + "targets": { + "arousal": { + "base": 0.3686, + "value": 0.6219, + "delta": 0.2533, + "ci": [ + 0.2088, + 0.2972 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.6304, + "delta": 0.1002, + "ci": [ + 0.0677, + 0.1308 + ], + "voices": 6 + }, + "dominance": { + "base": 0.4365, + "value": 0.5747, + "delta": 0.1382, + "ci": [ + 0.0984, + 0.1751 + ], + "voices": 6 + } + }, + "clap_rise": { + "sleepy": 0.762, + "confused": 0.046, + "anxious": 0.034 + } + }, + "cute x8": { + "mood": "cute", + "variant": null, + "dose": 8.0, + "n": 48, + "wer": 0.9603, + "collapse": 1.0, + "identity": 0.1799, + "durx": 0.653, + "clap_top": { + "sleepy": 1.0 + }, + "e2v_top": { + "happy": 0.708, + "fearful": 0.188, + "sad": 0.083 + }, + "msp_top": { + "Neutral": 0.333, + "Surprise": 0.271, + "Happiness": 0.25 + }, + "targets": { + "arousal": { + "base": 0.3686, + "value": 0.6436, + "delta": 0.275, + "ci": [ + 0.2439, + 0.3057 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.647, + "delta": 0.1169, + "ci": [ + 0.0896, + 0.1434 + ], + "voices": 6 + }, + "dominance": { + "base": 0.4365, + "value": 0.5908, + "delta": 0.1542, + "ci": [ + 0.1278, + 0.181 + ], + "voices": 6 + } + }, + "clap_rise": { + "sleepy": 0.727, + "confused": 0.051, + "anxious": 0.047 + } + }, + "desirous x4": { + "mood": "desirous", + "variant": null, + "dose": 4.0, + "n": 48, + "wer": 0.0219, + "collapse": 0.0, + "identity": 0.9063, + "durx": 1.707, + "clap_top": { + "calm": 0.708, + "desirous": 0.167, + "sleepy": 0.104 + }, + "e2v_top": { + "neutral": 0.583, + "happy": 0.146, + "disgusted": 0.146 + }, + "msp_top": { + "Neutral": 0.833, + "Sadness": 0.125, + "Happiness": 0.042 + }, + "targets": { + "clap": { + "base": 0.0498, + "value": 0.0876, + "delta": 0.0378, + "ci": [ + 0.0083, + 0.0694 + ], + "voices": 5, + "specific": -0.041 + }, + "clap@1": { + "base": 0.0625, + "value": 0.1667, + "delta": 0.1042, + "ci": [ + 0.0, + 0.2083 + ], + "voices": 1, + "specific": -0.012 + }, + "clap_rank": { + "base": 7.5, + "value": 5.8125, + "delta": -1.6875, + "ci": [ + -2.6042, + -0.7911 + ], + "voices": 5, + "specific": -0.4737 + }, + "arousal": { + "base": 0.3686, + "value": 0.3114, + "delta": -0.0572, + "ci": [ + -0.0776, + -0.036 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.4807, + "delta": -0.0494, + "ci": [ + -0.0628, + -0.0363 + ], + "voices": 6 + }, + "dominance": { + "base": 0.4365, + "value": 0.4032, + "delta": -0.0334, + "ci": [ + -0.0523, + -0.015 + ], + "voices": 5 + } + }, + "clap_rise": { + "sleepy": 0.073, + "desirous": 0.038, + "awed": 0.036 + } + }, + "desirous x6": { + "mood": "desirous", + "variant": null, + "dose": 6.0, + "n": 48, + "wer": 0.2323, + "collapse": 0.1667, + "identity": 0.8234, + "durx": 2.528, + "clap_top": { + "sleepy": 0.458, + "calm": 0.396, + "desirous": 0.104 + }, + "e2v_top": { + "disgusted": 0.354, + "neutral": 0.25, + "sad": 0.167 + }, + "msp_top": { + "Neutral": 0.833, + "Sadness": 0.146, + "Happiness": 0.021 + }, + "targets": { + "clap": { + "base": 0.0498, + "value": 0.0695, + "delta": 0.0197, + "ci": [ + -0.0184, + 0.0558 + ], + "voices": 4, + "specific": -0.0543 + }, + "clap@1": { + "base": 0.0625, + "value": 0.1042, + "delta": 0.0417, + "ci": [ + -0.0625, + 0.1458 + ], + "voices": 2, + "specific": -0.0318 + }, + "clap_rank": { + "base": 7.5, + "value": 7.0417, + "delta": -0.4583, + "ci": [ + -1.7922, + 0.8958 + ], + "voices": 3, + "specific": 0.5198 + }, + "arousal": { + "base": 0.3686, + "value": 0.2839, + "delta": -0.0847, + "ci": [ + -0.1148, + -0.0552 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.4621, + "delta": -0.068, + "ci": [ + -0.0927, + -0.0454 + ], + "voices": 6 + }, + "dominance": { + "base": 0.4365, + "value": 0.3605, + "delta": -0.076, + "ci": [ + -0.1045, + -0.0486 + ], + "voices": 6 + } + }, + "clap_rise": { + "sleepy": 0.36, + "awed": 0.043, + "saddened": 0.035 + } + }, + "desirous x8": { + "mood": "desirous", + "variant": null, + "dose": 8.0, + "n": 48, + "wer": 0.614, + "collapse": 0.75, + "identity": 0.7097, + "durx": 2.293, + "clap_top": { + "sleepy": 0.875, + "calm": 0.062, + "awed": 0.062 + }, + "e2v_top": { + "happy": 0.271, + "sad": 0.188, + "disgusted": 0.188 + }, + "msp_top": { + "Neutral": 0.75, + "Sadness": 0.146, + "Happiness": 0.042 + }, + "targets": { + "clap": { + "base": 0.0498, + "value": 0.0237, + "delta": -0.0261, + "ci": [ + -0.0531, + -0.0046 + ], + "voices": 4, + "specific": -0.0844 + }, + "clap@1": { + "base": 0.0625, + "value": 0.0, + "delta": -0.0625, + "ci": [ + -0.1458, + 0.0 + ], + "voices": 3, + "specific": -0.1272 + }, + "clap_rank": { + "base": 7.5, + "value": 9.0625, + "delta": 1.5625, + "ci": [ + 0.2703, + 2.9583 + ], + "voices": 3, + "specific": 2.2445 + }, + "arousal": { + "base": 0.3686, + "value": 0.2954, + "delta": -0.0732, + "ci": [ + -0.1032, + -0.0433 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.4778, + "delta": -0.0524, + "ci": [ + -0.0855, + -0.0195 + ], + "voices": 5 + }, + "dominance": { + "base": 0.4365, + "value": 0.3338, + "delta": -0.1027, + "ci": [ + -0.1272, + -0.0778 + ], + "voices": 6 + } + }, + "clap_rise": { + "sleepy": 0.641, + "saddened": 0.052, + "anxious": 0.036 + } + }, + "distressed x4": { + "mood": "distressed", + "variant": null, + "dose": 4.0, + "n": 48, + "wer": 0.0055, + "collapse": 0.0, + "identity": 0.8869, + "durx": 0.931, + "clap_top": { + "calm": 0.375, + "desirous": 0.25, + "fast": 0.125 + }, + "e2v_top": { + "neutral": 0.625, + "happy": 0.354, + "unknown": 0.021 + }, + "msp_top": { + "Neutral": 0.625, + "Happiness": 0.354, + "Fear": 0.021 + }, + "targets": { + "clap": { + "base": 0.0001, + "value": 0.0012, + "delta": 0.0011, + "ci": [ + 0.0003, + 0.0021 + ], + "voices": 6, + "specific": -0.0038 + }, + "clap@1": { + "base": 0.0, + "value": 0.0, + "delta": 0.0, + "ci": [ + 0.0, + 0.0 + ], + "voices": 0, + "specific": 0.0 + }, + "clap_rank": { + "base": 18.3958, + "value": 17.0208, + "delta": -1.375, + "ci": [ + -2.0833, + -0.7292 + ], + "voices": 5, + "specific": 1.2818 + }, + "arousal": { + "base": 0.3686, + "value": 0.536, + "delta": 0.1675, + "ci": [ + 0.1471, + 0.1902 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.5618, + "delta": 0.0317, + "ci": [ + 0.0196, + 0.0442 + ], + "voices": 6 + }, + "dominance": { + "base": 0.4365, + "value": 0.5726, + "delta": 0.1361, + "ci": [ + 0.1187, + 0.1558 + ], + "voices": 6 + } + }, + "clap_rise": { + "desirous": 0.123, + "fast": 0.1, + "happy": 0.066 + } + }, + "distressed x6": { + "mood": "distressed", + "variant": null, + "dose": 6.0, + "n": 48, + "wer": 0.0226, + "collapse": 0.0, + "identity": 0.8267, + "durx": 0.9, + "clap_top": { + "calm": 0.25, + "happy": 0.208, + "fast": 0.208 + }, + "e2v_top": { + "neutral": 0.542, + "happy": 0.417, + "unknown": 0.042 + }, + "msp_top": { + "Happiness": 0.604, + "Neutral": 0.292, + "Surprise": 0.021 + }, + "targets": { + "clap": { + "base": 0.0001, + "value": 0.0035, + "delta": 0.0033, + "ci": [ + 0.0015, + 0.0057 + ], + "voices": 6, + "specific": -0.0101 + }, + "clap@1": { + "base": 0.0, + "value": 0.0, + "delta": 0.0, + "ci": [ + 0.0, + 0.0 + ], + "voices": 0, + "specific": -0.0066 + }, + "clap_rank": { + "base": 18.3958, + "value": 14.4792, + "delta": -3.9167, + "ci": [ + -5.0833, + -2.8333 + ], + "voices": 6, + "specific": 1.3201 + }, + "arousal": { + "base": 0.3686, + "value": 0.6412, + "delta": 0.2726, + "ci": [ + 0.2437, + 0.3006 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.5713, + "delta": 0.0411, + "ci": [ + 0.0214, + 0.0607 + ], + "voices": 5 + }, + "dominance": { + "base": 0.4365, + "value": 0.6547, + "delta": 0.2182, + "ci": [ + 0.1935, + 0.2412 + ], + "voices": 6 + } + }, + "clap_rise": { + "fast": 0.147, + "happy": 0.137, + "desirous": 0.1 + } + }, + "distressed x8": { + "mood": "distressed", + "variant": null, + "dose": 8.0, + "n": 48, + "wer": 0.0872, + "collapse": 0.0417, + "identity": 0.7428, + "durx": 0.884, + "clap_top": { + "happy": 0.292, + "calm": 0.188, + "fast": 0.167 + }, + "e2v_top": { + "happy": 0.458, + "neutral": 0.375, + "unknown": 0.125 + }, + "msp_top": { + "Happiness": 0.729, + "Neutral": 0.167, + "Fear": 0.062 + }, + "targets": { + "clap": { + "base": 0.0001, + "value": 0.0118, + "delta": 0.0116, + "ci": [ + 0.005, + 0.0198 + ], + "voices": 6, + "specific": -0.0102 + }, + "clap@1": { + "base": 0.0, + "value": 0.0, + "delta": 0.0, + "ci": [ + 0.0, + 0.0 + ], + "voices": 0, + "specific": -0.0088 + }, + "clap_rank": { + "base": 18.3958, + "value": 11.3958, + "delta": -7.0, + "ci": [ + -8.4167, + -5.5833 + ], + "voices": 6, + "specific": 0.193 + }, + "arousal": { + "base": 0.3686, + "value": 0.7119, + "delta": 0.3433, + "ci": [ + 0.3169, + 0.3691 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.595, + "delta": 0.0648, + "ci": [ + 0.035, + 0.0942 + ], + "voices": 4 + }, + "dominance": { + "base": 0.4365, + "value": 0.7104, + "delta": 0.2739, + "ci": [ + 0.2507, + 0.2953 + ], + "voices": 6 + } + }, + "clap_rise": { + "happy": 0.216, + "fast": 0.132, + "desirous": 0.099 + } + }, + "embarrassed x4": { + "mood": "embarrassed", + "variant": null, + "dose": 4.0, + "n": 48, + "wer": 0.0035, + "collapse": 0.0, + "identity": 0.8869, + "durx": 0.996, + "clap_top": { + "calm": 0.521, + "desirous": 0.208, + "sympathetic": 0.188 + }, + "e2v_top": { + "neutral": 0.625, + "happy": 0.333, + "unknown": 0.021 + }, + "msp_top": { + "Neutral": 0.479, + "Happiness": 0.438, + "Contempt": 0.062 + }, + "targets": { + "arousal": { + "base": 0.3686, + "value": 0.5092, + "delta": 0.1406, + "ci": [ + 0.1182, + 0.162 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.5665, + "delta": 0.0364, + "ci": [ + 0.0199, + 0.0526 + ], + "voices": 5 + }, + "dominance": { + "base": 0.4365, + "value": 0.5538, + "delta": 0.1172, + "ci": [ + 0.1009, + 0.1339 + ], + "voices": 6 + } + }, + "clap_rise": { + "sympathetic": 0.122, + "desirous": 0.097, + "loud": 0.043 + } + }, + "embarrassed x6": { + "mood": "embarrassed", + "variant": null, + "dose": 6.0, + "n": 48, + "wer": 0.0222, + "collapse": 0.0208, + "identity": 0.799, + "durx": 0.971, + "clap_top": { + "calm": 0.375, + "desirous": 0.208, + "happy": 0.146 + }, + "e2v_top": { + "happy": 0.521, + "neutral": 0.333, + "surprised": 0.062 + }, + "msp_top": { + "Happiness": 0.604, + "Neutral": 0.292, + "Disgust": 0.042 + }, + "targets": { + "arousal": { + "base": 0.3686, + "value": 0.601, + "delta": 0.2324, + "ci": [ + 0.2139, + 0.252 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.6012, + "delta": 0.0711, + "ci": [ + 0.0505, + 0.0912 + ], + "voices": 5 + }, + "dominance": { + "base": 0.4365, + "value": 0.6202, + "delta": 0.1836, + "ci": [ + 0.17, + 0.1981 + ], + "voices": 6 + } + }, + "clap_rise": { + "desirous": 0.132, + "happy": 0.107, + "sympathetic": 0.095 + } + }, + "embarrassed x8": { + "mood": "embarrassed", + "variant": null, + "dose": 8.0, + "n": 48, + "wer": 0.0847, + "collapse": 0.0208, + "identity": 0.7017, + "durx": 1.025, + "clap_top": { + "happy": 0.312, + "sleepy": 0.208, + "calm": 0.208 + }, + "e2v_top": { + "happy": 0.688, + "neutral": 0.167, + "unknown": 0.062 + }, + "msp_top": { + "Happiness": 0.75, + "Neutral": 0.104, + "Fear": 0.104 + }, + "targets": { + "arousal": { + "base": 0.3686, + "value": 0.6751, + "delta": 0.3065, + "ci": [ + 0.2874, + 0.3266 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.6196, + "delta": 0.0895, + "ci": [ + 0.0622, + 0.1144 + ], + "voices": 5 + }, + "dominance": { + "base": 0.4365, + "value": 0.6749, + "delta": 0.2384, + "ci": [ + 0.2211, + 0.2552 + ], + "voices": 6 + } + }, + "clap_rise": { + "happy": 0.198, + "sleepy": 0.176, + "desirous": 0.116 + } + }, + "guilty x4": { + "mood": "guilty", + "variant": null, + "dose": 4.0, + "n": 48, + "wer": 0.004, + "collapse": 0.0, + "identity": 0.9141, + "durx": 1.084, + "clap_top": { + "calm": 0.917, + "whispered": 0.021, + "enunciated": 0.021 + }, + "e2v_top": { + "neutral": 0.771, + "happy": 0.167, + "sad": 0.042 + }, + "msp_top": { + "Neutral": 0.896, + "Sadness": 0.062, + "Happiness": 0.042 + }, + "targets": { + "clap": { + "base": 0.0006, + "value": 0.0007, + "delta": 0.0001, + "ci": [ + -0.0004, + 0.0008 + ], + "voices": 3, + "specific": -0.0023 + }, + "clap@1": { + "base": 0.0, + "value": 0.0, + "delta": 0.0, + "ci": [ + 0.0, + 0.0 + ], + "voices": 0, + "specific": 0.0 + }, + "clap_rank": { + "base": 14.8333, + "value": 13.6458, + "delta": -1.1875, + "ci": [ + -1.8958, + -0.5208 + ], + "voices": 4, + "specific": -1.3421 + }, + "arousal": { + "base": 0.3686, + "value": 0.3338, + "delta": -0.0348, + "ci": [ + -0.0508, + -0.0194 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.5228, + "delta": -0.0074, + "ci": [ + -0.0189, + 0.0045 + ], + "voices": 3 + }, + "dominance": { + "base": 0.4365, + "value": 0.4106, + "delta": -0.026, + "ci": [ + -0.0404, + -0.0121 + ], + "voices": 5 + } + }, + "clap_rise": { + "calm": 0.183, + "saddened": 0.0, + "guilt": 0.0 + } + }, + "guilty x6": { + "mood": "guilty", + "variant": null, + "dose": 6.0, + "n": 48, + "wer": 0.0024, + "collapse": 0.0, + "identity": 0.9007, + "durx": 1.124, + "clap_top": { + "calm": 0.979, + "loud": 0.021 + }, + "e2v_top": { + "neutral": 0.729, + "happy": 0.167, + "sad": 0.083 + }, + "msp_top": { + "Neutral": 0.854, + "Sadness": 0.104, + "Happiness": 0.042 + }, + "targets": { + "clap": { + "base": 0.0006, + "value": 0.0005, + "delta": -0.0001, + "ci": [ + -0.0006, + 0.0003 + ], + "voices": 4, + "specific": -0.0043 + }, + "clap@1": { + "base": 0.0, + "value": 0.0, + "delta": 0.0, + "ci": [ + 0.0, + 0.0 + ], + "voices": 0, + "specific": 0.0 + }, + "clap_rank": { + "base": 14.8333, + "value": 13.75, + "delta": -1.0833, + "ci": [ + -1.7708, + -0.4375 + ], + "voices": 5, + "specific": -0.5054 + }, + "arousal": { + "base": 0.3686, + "value": 0.3178, + "delta": -0.0508, + "ci": [ + -0.0669, + -0.0358 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.509, + "delta": -0.0212, + "ci": [ + -0.0315, + -0.0099 + ], + "voices": 6 + }, + "dominance": { + "base": 0.4365, + "value": 0.3957, + "delta": -0.0408, + "ci": [ + -0.0561, + -0.0269 + ], + "voices": 6 + } + }, + "clap_rise": { + "calm": 0.201, + "sleepy": 0.008, + "saddened": 0.001 + } + }, + "guilty x8": { + "mood": "guilty", + "variant": null, + "dose": 8.0, + "n": 48, + "wer": 0.038, + "collapse": 0.0208, + "identity": 0.8796, + "durx": 1.176, + "clap_top": { + "calm": 0.958, + "sleepy": 0.021, + "enunciated": 0.021 + }, + "e2v_top": { + "neutral": 0.771, + "happy": 0.146, + "sad": 0.083 + }, + "msp_top": { + "Neutral": 0.854, + "Sadness": 0.083, + "Happiness": 0.062 + }, + "targets": { + "clap": { + "base": 0.0006, + "value": 0.0006, + "delta": -0.0, + "ci": [ + -0.0005, + 0.0004 + ], + "voices": 4, + "specific": -0.0058 + }, + "clap@1": { + "base": 0.0, + "value": 0.0, + "delta": 0.0, + "ci": [ + 0.0, + 0.0 + ], + "voices": 0, + "specific": 0.0 + }, + "clap_rank": { + "base": 14.8333, + "value": 13.8333, + "delta": -1.0, + "ci": [ + -1.75, + -0.2708 + ], + "voices": 3, + "specific": 0.0581 + }, + "arousal": { + "base": 0.3686, + "value": 0.2971, + "delta": -0.0715, + "ci": [ + -0.0872, + -0.0544 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.5019, + "delta": -0.0282, + "ci": [ + -0.0401, + -0.0164 + ], + "voices": 6 + }, + "dominance": { + "base": 0.4365, + "value": 0.3788, + "delta": -0.0577, + "ci": [ + -0.0722, + -0.0434 + ], + "voices": 6 + } + }, + "clap_rise": { + "calm": 0.224, + "sleepy": 0.021, + "saddened": 0.009 + } + }, + "interested x4": { + "mood": "interested", + "variant": null, + "dose": 4.0, + "n": 48, + "wer": 0.0763, + "collapse": 0.0417, + "identity": 0.8526, + "durx": 1.896, + "clap_top": { + "calm": 0.417, + "desirous": 0.208, + "sleepy": 0.125 + }, + "e2v_top": { + "happy": 0.562, + "neutral": 0.229, + "unknown": 0.083 + }, + "msp_top": { + "Neutral": 0.479, + "Happiness": 0.396, + "Surprise": 0.062 + }, + "targets": { + "arousal": { + "base": 0.3686, + "value": 0.4154, + "delta": 0.0468, + "ci": [ + 0.0196, + 0.0751 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.5425, + "delta": 0.0123, + "ci": [ + -0.0077, + 0.0318 + ], + "voices": 4 + }, + "dominance": { + "base": 0.4365, + "value": 0.4801, + "delta": 0.0435, + "ci": [ + 0.0197, + 0.0684 + ], + "voices": 6 + } + }, + "clap_rise": { + "sleepy": 0.129, + "desirous": 0.072, + "happy": 0.069 + } + }, + "interested x6": { + "mood": "interested", + "variant": null, + "dose": 6.0, + "n": 48, + "wer": 0.488, + "collapse": 0.4792, + "identity": 0.64, + "durx": 2.113, + "clap_top": { + "sleepy": 0.625, + "awed": 0.167, + "desirous": 0.083 + }, + "e2v_top": { + "happy": 0.604, + "surprised": 0.146, + "sad": 0.125 + }, + "msp_top": { + "Neutral": 0.5, + "Happiness": 0.333, + "Surprise": 0.146 + }, + "targets": { + "arousal": { + "base": 0.3686, + "value": 0.4411, + "delta": 0.0725, + "ci": [ + 0.0351, + 0.1103 + ], + "voices": 5 + }, + "valence": { + "base": 0.5301, + "value": 0.5675, + "delta": 0.0373, + "ci": [ + 0.0105, + 0.0654 + ], + "voices": 4 + }, + "dominance": { + "base": 0.4365, + "value": 0.4563, + "delta": 0.0197, + "ci": [ + -0.0134, + 0.0526 + ], + "voices": 3 + } + }, + "clap_rise": { + "sleepy": 0.429, + "awed": 0.093, + "confused": 0.059 + } + }, + "interested x8": { + "mood": "interested", + "variant": null, + "dose": 8.0, + "n": 48, + "wer": 0.7794, + "collapse": 0.875, + "identity": 0.4855, + "durx": 1.772, + "clap_top": { + "sleepy": 0.812, + "awed": 0.083, + "desirous": 0.042 + }, + "e2v_top": { + "happy": 0.396, + "sad": 0.292, + "surprised": 0.208 + }, + "msp_top": { + "Neutral": 0.542, + "Happiness": 0.208, + "Surprise": 0.125 + }, + "targets": { + "arousal": { + "base": 0.3686, + "value": 0.4376, + "delta": 0.069, + "ci": [ + 0.0289, + 0.109 + ], + "voices": 5 + }, + "valence": { + "base": 0.5301, + "value": 0.5704, + "delta": 0.0402, + "ci": [ + 0.0083, + 0.073 + ], + "voices": 5 + }, + "dominance": { + "base": 0.4365, + "value": 0.4277, + "delta": -0.0088, + "ci": [ + -0.0418, + 0.0227 + ], + "voices": 4 + } + }, + "clap_rise": { + "sleepy": 0.533, + "saddened": 0.08, + "awed": 0.067 + } + }, + "pained x4": { + "mood": "pained", + "variant": null, + "dose": 4.0, + "n": 48, + "wer": 0.0055, + "collapse": 0.0, + "identity": 0.8888, + "durx": 1.337, + "clap_top": { + "calm": 0.583, + "desirous": 0.292, + "sleepy": 0.062 + }, + "e2v_top": { + "neutral": 0.708, + "happy": 0.208, + "unknown": 0.021 + }, + "msp_top": { + "Neutral": 0.667, + "Happiness": 0.25, + "Sadness": 0.062 + }, + "targets": { + "clap": { + "base": 0.0003, + "value": 0.0017, + "delta": 0.0013, + "ci": [ + 0.0006, + 0.0024 + ], + "voices": 5, + "specific": -0.0005 + }, + "clap@1": { + "base": 0.0, + "value": 0.0, + "delta": 0.0, + "ci": [ + 0.0, + 0.0 + ], + "voices": 0, + "specific": 0.0 + }, + "clap_rank": { + "base": 16.7083, + "value": 16.2292, + "delta": -0.4792, + "ci": [ + -1.1875, + 0.1875 + ], + "voices": 3, + "specific": 0.4375 + }, + "arousal": { + "base": 0.3686, + "value": 0.3949, + "delta": 0.0263, + "ci": [ + 0.0067, + 0.0481 + ], + "voices": 5 + }, + "valence": { + "base": 0.5301, + "value": 0.5065, + "delta": -0.0236, + "ci": [ + -0.037, + -0.0108 + ], + "voices": 5 + }, + "dominance": { + "base": 0.4365, + "value": 0.4736, + "delta": 0.037, + "ci": [ + 0.0189, + 0.0548 + ], + "voices": 5 + } + }, + "clap_rise": { + "desirous": 0.106, + "awed": 0.056, + "sleepy": 0.029 + } + }, + "pained x6": { + "mood": "pained", + "variant": null, + "dose": 6.0, + "n": 48, + "wer": 0.0891, + "collapse": 0.0625, + "identity": 0.8231, + "durx": 1.467, + "clap_top": { + "calm": 0.354, + "desirous": 0.229, + "sleepy": 0.146 + }, + "e2v_top": { + "neutral": 0.458, + "happy": 0.354, + "unknown": 0.104 + }, + "msp_top": { + "Neutral": 0.542, + "Happiness": 0.292, + "Sadness": 0.083 + }, + "targets": { + "clap": { + "base": 0.0003, + "value": 0.0045, + "delta": 0.0042, + "ci": [ + 0.0025, + 0.0065 + ], + "voices": 6, + "specific": -0.0001 + }, + "clap@1": { + "base": 0.0, + "value": 0.0, + "delta": 0.0, + "ci": [ + 0.0, + 0.0 + ], + "voices": 0, + "specific": -0.0022 + }, + "clap_rank": { + "base": 16.7083, + "value": 14.1042, + "delta": -2.6042, + "ci": [ + -3.6047, + -1.6458 + ], + "voices": 6, + "specific": -0.522 + }, + "arousal": { + "base": 0.3686, + "value": 0.4192, + "delta": 0.0506, + "ci": [ + 0.0209, + 0.0789 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.5031, + "delta": -0.0271, + "ci": [ + -0.0449, + -0.0082 + ], + "voices": 4 + }, + "dominance": { + "base": 0.4365, + "value": 0.496, + "delta": 0.0595, + "ci": [ + 0.0331, + 0.0857 + ], + "voices": 6 + } + }, + "clap_rise": { + "sleepy": 0.125, + "desirous": 0.12, + "awed": 0.079 + } + }, + "pained x8": { + "mood": "pained", + "variant": null, + "dose": 8.0, + "n": 48, + "wer": 0.2503, + "collapse": 0.1458, + "identity": 0.7407, + "durx": 1.65, + "clap_top": { + "sleepy": 0.396, + "awed": 0.188, + "desirous": 0.167 + }, + "e2v_top": { + "happy": 0.521, + "neutral": 0.271, + "unknown": 0.062 + }, + "msp_top": { + "Happiness": 0.396, + "Neutral": 0.333, + "Sadness": 0.125 + }, + "targets": { + "clap": { + "base": 0.0003, + "value": 0.0144, + "delta": 0.0141, + "ci": [ + 0.0068, + 0.0256 + ], + "voices": 6, + "specific": 0.0069 + }, + "clap@1": { + "base": 0.0, + "value": 0.0, + "delta": 0.0, + "ci": [ + 0.0, + 0.0 + ], + "voices": 0, + "specific": -0.0011 + }, + "clap_rank": { + "base": 16.7083, + "value": 11.4375, + "delta": -5.2708, + "ci": [ + -6.5005, + -4.0 + ], + "voices": 6, + "specific": -2.0658 + }, + "arousal": { + "base": 0.3686, + "value": 0.4957, + "delta": 0.1271, + "ci": [ + 0.0944, + 0.1607 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.5251, + "delta": -0.005, + "ci": [ + -0.0313, + 0.0218 + ], + "voices": 3 + }, + "dominance": { + "base": 0.4365, + "value": 0.5368, + "delta": 0.1003, + "ci": [ + 0.0729, + 0.1282 + ], + "voices": 6 + } + }, + "clap_rise": { + "sleepy": 0.28, + "awed": 0.128, + "happy": 0.078 + } + }, + "proud x4": { + "mood": "proud", + "variant": null, + "dose": 4.0, + "n": 48, + "wer": 0.0025, + "collapse": 0.0, + "identity": 0.9128, + "durx": 1.007, + "clap_top": { + "calm": 0.583, + "desirous": 0.229, + "sympathetic": 0.062 + }, + "e2v_top": { + "neutral": 0.646, + "happy": 0.312, + "unknown": 0.021 + }, + "msp_top": { + "Neutral": 0.688, + "Happiness": 0.292, + "Contempt": 0.021 + }, + "targets": { + "arousal": { + "base": 0.3686, + "value": 0.4519, + "delta": 0.0833, + "ci": [ + 0.0671, + 0.0997 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.537, + "delta": 0.0069, + "ci": [ + -0.0037, + 0.0183 + ], + "voices": 3 + }, + "dominance": { + "base": 0.4365, + "value": 0.5109, + "delta": 0.0743, + "ci": [ + 0.0608, + 0.0876 + ], + "voices": 6 + } + }, + "clap_rise": { + "desirous": 0.119, + "sympathetic": 0.037, + "loud": 0.03 + } + }, + "proud x6": { + "mood": "proud", + "variant": null, + "dose": 6.0, + "n": 48, + "wer": 0.0094, + "collapse": 0.0, + "identity": 0.8784, + "durx": 1.016, + "clap_top": { + "calm": 0.417, + "desirous": 0.25, + "sympathetic": 0.125 + }, + "e2v_top": { + "neutral": 0.625, + "happy": 0.375 + }, + "msp_top": { + "Neutral": 0.521, + "Happiness": 0.438, + "Contempt": 0.021 + }, + "targets": { + "arousal": { + "base": 0.3686, + "value": 0.5238, + "delta": 0.1552, + "ci": [ + 0.1351, + 0.176 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.562, + "delta": 0.0318, + "ci": [ + 0.0144, + 0.0477 + ], + "voices": 5 + }, + "dominance": { + "base": 0.4365, + "value": 0.567, + "delta": 0.1305, + "ci": [ + 0.1135, + 0.1484 + ], + "voices": 6 + } + }, + "clap_rise": { + "desirous": 0.136, + "happy": 0.085, + "loud": 0.036 + } + }, + "proud x8": { + "mood": "proud", + "variant": null, + "dose": 8.0, + "n": 48, + "wer": 0.0521, + "collapse": 0.0, + "identity": 0.8351, + "durx": 1.049, + "clap_top": { + "calm": 0.271, + "desirous": 0.271, + "happy": 0.167 + }, + "e2v_top": { + "neutral": 0.5, + "happy": 0.438, + "unknown": 0.042 + }, + "msp_top": { + "Happiness": 0.5, + "Neutral": 0.396, + "Contempt": 0.062 + }, + "targets": { + "arousal": { + "base": 0.3686, + "value": 0.5868, + "delta": 0.2182, + "ci": [ + 0.1979, + 0.2382 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.5563, + "delta": 0.0262, + "ci": [ + 0.0076, + 0.0447 + ], + "voices": 5 + }, + "dominance": { + "base": 0.4365, + "value": 0.6147, + "delta": 0.1781, + "ci": [ + 0.1624, + 0.1941 + ], + "voices": 6 + } + }, + "clap_rise": { + "desirous": 0.163, + "happy": 0.141, + "sleepy": 0.045 + } + }, + "realizing x4": { + "mood": "realizing", + "variant": null, + "dose": 4.0, + "n": 48, + "wer": 0.0052, + "collapse": 0.0, + "identity": 0.8927, + "durx": 0.94, + "clap_top": { + "calm": 0.312, + "desirous": 0.25, + "sympathetic": 0.188 + }, + "e2v_top": { + "neutral": 0.604, + "happy": 0.375, + "surprised": 0.021 + }, + "msp_top": { + "Neutral": 0.5, + "Happiness": 0.479, + "Surprise": 0.021 + }, + "targets": { + "arousal": { + "base": 0.3686, + "value": 0.5172, + "delta": 0.1486, + "ci": [ + 0.1295, + 0.1677 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.576, + "delta": 0.0459, + "ci": [ + 0.0304, + 0.0611 + ], + "voices": 5 + }, + "dominance": { + "base": 0.4365, + "value": 0.5558, + "delta": 0.1192, + "ci": [ + 0.1029, + 0.1367 + ], + "voices": 6 + } + }, + "clap_rise": { + "desirous": 0.121, + "sympathetic": 0.074, + "loud": 0.063 + } + }, + "realizing x6": { + "mood": "realizing", + "variant": null, + "dose": 6.0, + "n": 48, + "wer": 0.0249, + "collapse": 0.0, + "identity": 0.83, + "durx": 0.914, + "clap_top": { + "calm": 0.271, + "desirous": 0.271, + "fast": 0.167 + }, + "e2v_top": { + "happy": 0.458, + "neutral": 0.458, + "surprised": 0.042 + }, + "msp_top": { + "Happiness": 0.583, + "Neutral": 0.292, + "Anger": 0.062 + }, + "targets": { + "arousal": { + "base": 0.3686, + "value": 0.6284, + "delta": 0.2598, + "ci": [ + 0.2366, + 0.2841 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.5709, + "delta": 0.0408, + "ci": [ + 0.0158, + 0.0635 + ], + "voices": 5 + }, + "dominance": { + "base": 0.4365, + "value": 0.6465, + "delta": 0.21, + "ci": [ + 0.1913, + 0.2298 + ], + "voices": 6 + } + }, + "clap_rise": { + "desirous": 0.166, + "fast": 0.13, + "happy": 0.085 + } + }, + "realizing x8": { + "mood": "realizing", + "variant": null, + "dose": 8.0, + "n": 48, + "wer": 0.0273, + "collapse": 0.0, + "identity": 0.7705, + "durx": 0.883, + "clap_top": { + "desirous": 0.312, + "calm": 0.167, + "fast": 0.167 + }, + "e2v_top": { + "happy": 0.625, + "neutral": 0.208, + "surprised": 0.083 + }, + "msp_top": { + "Happiness": 0.562, + "Neutral": 0.146, + "Surprise": 0.125 + }, + "targets": { + "arousal": { + "base": 0.3686, + "value": 0.6993, + "delta": 0.3308, + "ci": [ + 0.3057, + 0.3542 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.5863, + "delta": 0.0562, + "ci": [ + 0.0314, + 0.0825 + ], + "voices": 5 + }, + "dominance": { + "base": 0.4365, + "value": 0.698, + "delta": 0.2614, + "ci": [ + 0.2424, + 0.2822 + ], + "voices": 6 + } + }, + "clap_rise": { + "desirous": 0.181, + "happy": 0.159, + "fast": 0.128 + } + }, + "relieved x4": { + "mood": "relieved", + "variant": null, + "dose": 4.0, + "n": 48, + "wer": 0.003, + "collapse": 0.0, + "identity": 0.9145, + "durx": 1.118, + "clap_top": { + "calm": 0.833, + "desirous": 0.062, + "whispered": 0.062 + }, + "e2v_top": { + "neutral": 0.854, + "happy": 0.083, + "sad": 0.042 + }, + "msp_top": { + "Neutral": 0.812, + "Sadness": 0.125, + "Happiness": 0.062 + }, + "targets": { + "clap": { + "base": 0.5825, + "value": 0.6974, + "delta": 0.1149, + "ci": [ + 0.0462, + 0.1819 + ], + "voices": 4, + "specific": 0.2808 + }, + "clap@1": { + "base": 0.7708, + "value": 0.8333, + "delta": 0.0625, + "ci": [ + -0.0625, + 0.1875 + ], + "voices": 3, + "specific": 0.318 + }, + "clap_rank": { + "base": 1.4167, + "value": 1.1875, + "delta": -0.2292, + "ci": [ + -0.5208, + 0.0005 + ], + "voices": 3, + "specific": -2.659 + }, + "arousal": { + "base": 0.3686, + "value": 0.3322, + "delta": -0.0364, + "ci": [ + -0.0508, + -0.0219 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.5051, + "delta": -0.025, + "ci": [ + -0.0357, + -0.0148 + ], + "voices": 6 + }, + "dominance": { + "base": 0.4365, + "value": 0.4123, + "delta": -0.0242, + "ci": [ + -0.0365, + -0.0123 + ], + "voices": 6 + } + }, + "clap_rise": { + "calm": 0.115, + "saddened": 0.004, + "guilt": 0.0 + } + }, + "relieved x6": { + "mood": "relieved", + "variant": null, + "dose": 6.0, + "n": 48, + "wer": 0.0199, + "collapse": 0.0, + "identity": 0.8925, + "durx": 1.157, + "clap_top": { + "calm": 0.958, + "whispered": 0.021, + "desirous": 0.021 + }, + "e2v_top": { + "neutral": 0.833, + "happy": 0.083, + "sad": 0.083 + }, + "msp_top": { + "Neutral": 0.792, + "Sadness": 0.146, + "Happiness": 0.062 + }, + "targets": { + "clap": { + "base": 0.5825, + "value": 0.7188, + "delta": 0.1363, + "ci": [ + 0.0608, + 0.2097 + ], + "voices": 4, + "specific": 0.4181 + }, + "clap@1": { + "base": 0.7708, + "value": 0.9583, + "delta": 0.1875, + "ci": [ + 0.0417, + 0.3125 + ], + "voices": 4, + "specific": 0.591 + }, + "clap_rank": { + "base": 1.4167, + "value": 1.1042, + "delta": -0.3125, + "ci": [ + -0.6255, + -0.0208 + ], + "voices": 3, + "specific": -4.8904 + }, + "arousal": { + "base": 0.3686, + "value": 0.3296, + "delta": -0.039, + "ci": [ + -0.0531, + -0.0259 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.4973, + "delta": -0.0328, + "ci": [ + -0.0428, + -0.0217 + ], + "voices": 6 + }, + "dominance": { + "base": 0.4365, + "value": 0.4102, + "delta": -0.0263, + "ci": [ + -0.0381, + -0.0145 + ], + "voices": 6 + } + }, + "clap_rise": { + "calm": 0.136, + "awed": 0.008, + "sleepy": 0.005 + } + }, + "relieved x8": { + "mood": "relieved", + "variant": null, + "dose": 8.0, + "n": 48, + "wer": 0.0291, + "collapse": 0.0, + "identity": 0.8684, + "durx": 1.256, + "clap_top": { + "calm": 0.812, + "desirous": 0.104, + "sympathetic": 0.042 + }, + "e2v_top": { + "neutral": 0.792, + "happy": 0.104, + "sad": 0.062 + }, + "msp_top": { + "Neutral": 0.833, + "Sadness": 0.167 + }, + "targets": { + "clap": { + "base": 0.5825, + "value": 0.6838, + "delta": 0.1013, + "ci": [ + 0.0217, + 0.1809 + ], + "voices": 5, + "specific": 0.47 + }, + "clap@1": { + "base": 0.7708, + "value": 0.8125, + "delta": 0.0417, + "ci": [ + -0.1042, + 0.1667 + ], + "voices": 2, + "specific": 0.5647 + }, + "clap_rank": { + "base": 1.4167, + "value": 1.4167, + "delta": 0.0, + "ci": [ + -0.3542, + 0.375 + ], + "voices": 2, + "specific": -6.6689 + }, + "arousal": { + "base": 0.3686, + "value": 0.3065, + "delta": -0.0621, + "ci": [ + -0.0805, + -0.0446 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.4718, + "delta": -0.0583, + "ci": [ + -0.0708, + -0.0458 + ], + "voices": 6 + }, + "dominance": { + "base": 0.4365, + "value": 0.388, + "delta": -0.0485, + "ci": [ + -0.0654, + -0.0329 + ], + "voices": 6 + } + }, + "clap_rise": { + "calm": 0.101, + "sleepy": 0.035, + "awed": 0.019 + } + }, + "serene x4": { + "mood": "serene", + "variant": null, + "dose": 4.0, + "n": 48, + "wer": 0.0095, + "collapse": 0.0, + "identity": 0.8991, + "durx": 1.381, + "clap_top": { + "calm": 0.938, + "whispered": 0.062 + }, + "e2v_top": { + "neutral": 0.792, + "happy": 0.083, + "sad": 0.083 + }, + "msp_top": { + "Neutral": 0.833, + "Sadness": 0.146, + "Happiness": 0.021 + }, + "targets": { + "clap": { + "base": 0.5825, + "value": 0.8025, + "delta": 0.22, + "ci": [ + 0.141, + 0.2986 + ], + "voices": 5, + "specific": 0.3914 + }, + "clap@1": { + "base": 0.7708, + "value": 0.9375, + "delta": 0.1667, + "ci": [ + 0.0417, + 0.2917 + ], + "voices": 4, + "specific": 0.4277 + }, + "clap_rank": { + "base": 1.4167, + "value": 1.0625, + "delta": -0.3542, + "ci": [ + -0.6458, + -0.1042 + ], + "voices": 4, + "specific": -2.7906 + }, + "arousal": { + "base": 0.3686, + "value": 0.2296, + "delta": -0.139, + "ci": [ + -0.1576, + -0.12 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.4738, + "delta": -0.0563, + "ci": [ + -0.0679, + -0.0446 + ], + "voices": 6 + }, + "dominance": { + "base": 0.4365, + "value": 0.3213, + "delta": -0.1152, + "ci": [ + -0.1316, + -0.1 + ], + "voices": 6 + } + }, + "clap_rise": { + "calm": 0.22, + "saddened": 0.003, + "sleepy": 0.002 + } + }, + "serene x6": { + "mood": "serene", + "variant": null, + "dose": 6.0, + "n": 48, + "wer": 0.0171, + "collapse": 0.0, + "identity": 0.8631, + "durx": 1.595, + "clap_top": { + "calm": 0.917, + "whispered": 0.062, + "sleepy": 0.021 + }, + "e2v_top": { + "neutral": 0.562, + "sad": 0.292, + "disgusted": 0.083 + }, + "msp_top": { + "Neutral": 0.688, + "Sadness": 0.312 + }, + "targets": { + "clap": { + "base": 0.5825, + "value": 0.7589, + "delta": 0.1764, + "ci": [ + 0.1082, + 0.2522 + ], + "voices": 5, + "specific": 0.4603 + }, + "clap@1": { + "base": 0.7708, + "value": 0.9167, + "delta": 0.1458, + "ci": [ + 0.0208, + 0.2708 + ], + "voices": 4, + "specific": 0.5471 + }, + "clap_rank": { + "base": 1.4167, + "value": 1.1042, + "delta": -0.3125, + "ci": [ + -0.5417, + -0.1042 + ], + "voices": 4, + "specific": -4.8904 + }, + "arousal": { + "base": 0.3686, + "value": 0.1832, + "delta": -0.1854, + "ci": [ + -0.2088, + -0.1641 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.4507, + "delta": -0.0795, + "ci": [ + -0.0918, + -0.0676 + ], + "voices": 6 + }, + "dominance": { + "base": 0.4365, + "value": 0.2751, + "delta": -0.1614, + "ci": [ + -0.1815, + -0.1431 + ], + "voices": 6 + } + }, + "clap_rise": { + "calm": 0.176, + "sleepy": 0.038, + "saddened": 0.006 + } + }, + "serene x8": { + "mood": "serene", + "variant": null, + "dose": 8.0, + "n": 48, + "wer": 0.1302, + "collapse": 0.0625, + "identity": 0.7862, + "durx": 2.204, + "clap_top": { + "calm": 0.646, + "sleepy": 0.25, + "whispered": 0.083 + }, + "e2v_top": { + "neutral": 0.438, + "sad": 0.375, + "disgusted": 0.083 + }, + "msp_top": { + "Sadness": 0.521, + "Neutral": 0.479 + }, + "targets": { + "clap": { + "base": 0.5825, + "value": 0.5451, + "delta": -0.0374, + "ci": [ + -0.1213, + 0.05 + ], + "voices": 3, + "specific": 0.324 + }, + "clap@1": { + "base": 0.7708, + "value": 0.6458, + "delta": -0.125, + "ci": [ + -0.2708, + 0.0208 + ], + "voices": 3, + "specific": 0.3893 + }, + "clap_rank": { + "base": 1.4167, + "value": 1.75, + "delta": 0.3333, + "ci": [ + 0.0, + 0.7917 + ], + "voices": 5, + "specific": -6.318 + }, + "arousal": { + "base": 0.3686, + "value": 0.15, + "delta": -0.2186, + "ci": [ + -0.2462, + -0.1908 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.4059, + "delta": -0.1243, + "ci": [ + -0.1482, + -0.1018 + ], + "voices": 6 + }, + "dominance": { + "base": 0.4365, + "value": 0.23, + "delta": -0.2065, + "ci": [ + -0.2296, + -0.1833 + ], + "voices": 6 + } + }, + "clap_rise": { + "sleepy": 0.222, + "saddened": 0.036, + "anxious": 0.003 + } + }, + "valence -6": { + "mood": null, + "variant": null, + "dose": null, + "n": 48, + "wer": 0.0168, + "collapse": 0.0, + "identity": 0.8402, + "durx": 0.747, + "clap_top": { + "fast": 0.5, + "calm": 0.354, + "whispered": 0.104 + }, + "e2v_top": { + "neutral": 0.792, + "happy": 0.167, + "sad": 0.042 + }, + "msp_top": { + "Neutral": 0.938, + "Happiness": 0.042, + "Sadness": 0.021 + }, + "targets": { + "arousal": { + "base": 0.3686, + "value": 0.3597, + "delta": -0.0089, + "ci": [ + -0.0292, + 0.0107 + ], + "voices": 3 + }, + "valence": { + "base": 0.5301, + "value": 0.5102, + "delta": -0.02, + "ci": [ + -0.0338, + -0.0054 + ], + "voices": 3 + }, + "dominance": { + "base": 0.4365, + "value": 0.4052, + "delta": -0.0314, + "ci": [ + -0.0481, + -0.0152 + ], + "voices": 5 + } + }, + "clap_rise": { + "fast": 0.41, + "enthusiastic": 0.001, + "sleepy": 0.001 + } + }, + "valence +6": { + "mood": null, + "variant": null, + "dose": null, + "n": 48, + "wer": 0.0792, + "collapse": 0.0417, + "identity": 0.738, + "durx": 1.903, + "clap_top": { + "sleepy": 0.292, + "desirous": 0.25, + "calm": 0.208 + }, + "e2v_top": { + "happy": 0.625, + "neutral": 0.188, + "surprised": 0.083 + }, + "msp_top": { + "Happiness": 0.479, + "Neutral": 0.292, + "Surprise": 0.083 + }, + "targets": { + "arousal": { + "base": 0.3686, + "value": 0.5509, + "delta": 0.1824, + "ci": [ + 0.1538, + 0.2112 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.556, + "delta": 0.0258, + "ci": [ + 0.0011, + 0.0492 + ], + "voices": 4 + }, + "dominance": { + "base": 0.4365, + "value": 0.6007, + "delta": 0.1641, + "ci": [ + 0.1412, + 0.1868 + ], + "voices": 6 + } + }, + "clap_rise": { + "sleepy": 0.161, + "desirous": 0.141, + "happy": 0.13 + } + }, + "arousal -6": { + "mood": null, + "variant": null, + "dose": null, + "n": 48, + "wer": 0.0351, + "collapse": 0.0208, + "identity": 0.8284, + "durx": 1.869, + "clap_top": { + "calm": 0.688, + "whispered": 0.25, + "sleepy": 0.021 + }, + "e2v_top": { + "neutral": 0.5, + "sad": 0.333, + "disgusted": 0.146 + }, + "msp_top": { + "Sadness": 0.646, + "Neutral": 0.354 + }, + "targets": { + "arousal": { + "base": 0.3686, + "value": 0.2109, + "delta": -0.1576, + "ci": [ + -0.1803, + -0.1353 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.4462, + "delta": -0.084, + "ci": [ + -0.1005, + -0.0684 + ], + "voices": 6 + }, + "dominance": { + "base": 0.4365, + "value": 0.3081, + "delta": -0.1284, + "ci": [ + -0.1482, + -0.1101 + ], + "voices": 6 + } + }, + "clap_rise": { + "whispered": 0.144, + "sleepy": 0.043, + "saddened": 0.012 + } + }, + "arousal +6": { + "mood": null, + "variant": null, + "dose": null, + "n": 48, + "wer": 0.0115, + "collapse": 0.0, + "identity": 0.7696, + "durx": 0.721, + "clap_top": { + "fast": 0.583, + "loud": 0.125, + "happy": 0.104 + }, + "e2v_top": { + "happy": 0.479, + "neutral": 0.458, + "angry": 0.042 + }, + "msp_top": { + "Happiness": 0.542, + "Neutral": 0.438, + "Anger": 0.021 + }, + "targets": { + "arousal": { + "base": 0.3686, + "value": 0.6143, + "delta": 0.2457, + "ci": [ + 0.2278, + 0.2658 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.5974, + "delta": 0.0672, + "ci": [ + 0.0481, + 0.0839 + ], + "voices": 5 + }, + "dominance": { + "base": 0.4365, + "value": 0.5982, + "delta": 0.1617, + "ci": [ + 0.1451, + 0.1781 + ], + "voices": 6 + } + }, + "clap_rise": { + "fast": 0.46, + "happy": 0.105, + "loud": 0.056 + } + }, + "ovr/fearful x8": { + "mood": "fearful", + "variant": "ovr", + "dose": 8.0, + "n": 48, + "wer": 0.0102, + "collapse": 0.0, + "identity": 0.8573, + "durx": 1.15, + "clap_top": { + "calm": 0.542, + "desirous": 0.208, + "sleepy": 0.062 + }, + "e2v_top": { + "neutral": 0.542, + "happy": 0.354, + "sad": 0.083 + }, + "msp_top": { + "Neutral": 0.625, + "Happiness": 0.292, + "Surprise": 0.042 + }, + "targets": { + "e2v": { + "base": 0.0001, + "value": 0.0039, + "delta": 0.0038, + "ci": [ + 0.0001, + 0.0111 + ], + "voices": 6, + "specific": 0.0038 + }, + "e2v@1": { + "base": 0.0, + "value": 0.0, + "delta": 0.0, + "ci": [ + 0.0, + 0.0 + ], + "voices": 0, + "specific": 0.0 + }, + "clap": { + "base": 0.0001, + "value": 0.0005, + "delta": 0.0003, + "ci": [ + 0.0001, + 0.0006 + ], + "voices": 5, + "specific": 0.0001 + }, + "clap@1": { + "base": 0.0, + "value": 0.0, + "delta": 0.0, + "ci": [ + 0.0, + 0.0 + ], + "voices": 0, + "specific": 0.0 + }, + "clap_rank": { + "base": 18.625, + "value": 18.8542, + "delta": 0.2292, + "ci": [ + -0.4589, + 0.9797 + ], + "voices": 1, + "specific": 0.3485 + }, + "msp@1": { + "base": 0.0, + "value": 0.0, + "delta": 0.0, + "ci": [ + 0.0, + 0.0 + ], + "voices": 0, + "specific": 0.0 + }, + "arousal": { + "base": 0.3686, + "value": 0.4432, + "delta": 0.0747, + "ci": [ + 0.0544, + 0.0941 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.5358, + "delta": 0.0056, + "ci": [ + -0.0107, + 0.0209 + ], + "voices": 3 + }, + "dominance": { + "base": 0.4365, + "value": 0.4965, + "delta": 0.06, + "ci": [ + 0.0422, + 0.0763 + ], + "voices": 6 + } + }, + "clap_rise": { + "desirous": 0.081, + "awed": 0.044, + "sympathetic": 0.025 + } + }, + "ovr/fearful x12": { + "mood": "fearful", + "variant": "ovr", + "dose": 12.0, + "n": 48, + "wer": 0.0148, + "collapse": 0.0, + "identity": 0.7782, + "durx": 1.305, + "clap_top": { + "calm": 0.458, + "desirous": 0.375, + "sleepy": 0.062 + }, + "e2v_top": { + "happy": 0.5, + "neutral": 0.188, + "fearful": 0.083 + }, + "msp_top": { + "Neutral": 0.354, + "Happiness": 0.312, + "Sadness": 0.125 + }, + "targets": { + "e2v": { + "base": 0.0001, + "value": 0.0864, + "delta": 0.0863, + "ci": [ + 0.0262, + 0.1562 + ], + "voices": 6, + "specific": 0.0856 + }, + "e2v@1": { + "base": 0.0, + "value": 0.0833, + "delta": 0.0833, + "ci": [ + 0.0208, + 0.1667 + ], + "voices": 2, + "specific": 0.0833 + }, + "clap": { + "base": 0.0001, + "value": 0.002, + "delta": 0.0019, + "ci": [ + 0.0005, + 0.0042 + ], + "voices": 5, + "specific": 0.0013 + }, + "clap@1": { + "base": 0.0, + "value": 0.0, + "delta": 0.0, + "ci": [ + 0.0, + 0.0 + ], + "voices": 0, + "specific": 0.0 + }, + "clap_rank": { + "base": 18.625, + "value": 18.0833, + "delta": -0.5417, + "ci": [ + -1.5833, + 0.5005 + ], + "voices": 4, + "specific": 0.178 + }, + "msp@1": { + "base": 0.0, + "value": 0.0208, + "delta": 0.0208, + "ci": [ + 0.0, + 0.0625 + ], + "voices": 1, + "specific": 0.017 + }, + "arousal": { + "base": 0.3686, + "value": 0.4756, + "delta": 0.107, + "ci": [ + 0.0854, + 0.129 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.5125, + "delta": -0.0176, + "ci": [ + -0.0356, + -0.0005 + ], + "voices": 4 + }, + "dominance": { + "base": 0.4365, + "value": 0.5197, + "delta": 0.0832, + "ci": [ + 0.0628, + 0.1035 + ], + "voices": 6 + } + }, + "clap_rise": { + "desirous": 0.154, + "awed": 0.073, + "sleepy": 0.065 + } + }, + "ovr/disgusted x8": { + "mood": "disgusted", + "variant": "ovr", + "dose": 8.0, + "n": 48, + "wer": 0.0296, + "collapse": 0.0208, + "identity": 0.8721, + "durx": 0.987, + "clap_top": { + "calm": 0.333, + "desirous": 0.312, + "enunciated": 0.104 + }, + "e2v_top": { + "neutral": 0.75, + "happy": 0.146, + "angry": 0.062 + }, + "msp_top": { + "Neutral": 0.625, + "Happiness": 0.312, + "Contempt": 0.042 + }, + "targets": { + "e2v": { + "base": 0.002, + "value": 0.0203, + "delta": 0.0183, + "ci": [ + 0.0009, + 0.0395 + ], + "voices": 5, + "specific": -0.008 + }, + "e2v@1": { + "base": 0.0, + "value": 0.0208, + "delta": 0.0208, + "ci": [ + 0.0, + 0.0625 + ], + "voices": 1, + "specific": -0.0076 + }, + "clap": { + "base": 0.0004, + "value": 0.0025, + "delta": 0.002, + "ci": [ + 0.0012, + 0.0029 + ], + "voices": 6, + "specific": 0.0014 + }, + "clap@1": { + "base": 0.0, + "value": 0.0, + "delta": 0.0, + "ci": [ + 0.0, + 0.0 + ], + "voices": 0, + "specific": 0.0 + }, + "clap_rank": { + "base": 17.0625, + "value": 15.2292, + "delta": -1.8333, + "ci": [ + -2.3755, + -1.2708 + ], + "voices": 6, + "specific": -1.7746 + }, + "msp@1": { + "base": 0.0, + "value": 0.0, + "delta": 0.0, + "ci": [ + 0.0, + 0.0 + ], + "voices": 0, + "specific": 0.0 + }, + "arousal": { + "base": 0.3686, + "value": 0.493, + "delta": 0.1244, + "ci": [ + 0.1042, + 0.1455 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.5284, + "delta": -0.0018, + "ci": [ + -0.0151, + 0.0108 + ], + "voices": 3 + }, + "dominance": { + "base": 0.4365, + "value": 0.5441, + "delta": 0.1076, + "ci": [ + 0.0905, + 0.1248 + ], + "voices": 6 + } + }, + "clap_rise": { + "desirous": 0.146, + "admiring": 0.052, + "loud": 0.05 + } + }, + "ovr/disgusted x12": { + "mood": "disgusted", + "variant": "ovr", + "dose": 12.0, + "n": 48, + "wer": 0.0162, + "collapse": 0.0, + "identity": 0.813, + "durx": 0.994, + "clap_top": { + "desirous": 0.312, + "calm": 0.229, + "loud": 0.146 + }, + "e2v_top": { + "neutral": 0.604, + "happy": 0.292, + "angry": 0.083 + }, + "msp_top": { + "Neutral": 0.625, + "Happiness": 0.354, + "Contempt": 0.021 + }, + "targets": { + "e2v": { + "base": 0.002, + "value": 0.0225, + "delta": 0.0205, + "ci": [ + 0.0045, + 0.0411 + ], + "voices": 6, + "specific": -0.0268 + }, + "e2v@1": { + "base": 0.0, + "value": 0.0, + "delta": 0.0, + "ci": [ + 0.0, + 0.0 + ], + "voices": 0, + "specific": -0.0511 + }, + "clap": { + "base": 0.0004, + "value": 0.0034, + "delta": 0.003, + "ci": [ + 0.0012, + 0.0051 + ], + "voices": 6, + "specific": 0.0024 + }, + "clap@1": { + "base": 0.0, + "value": 0.0, + "delta": 0.0, + "ci": [ + 0.0, + 0.0 + ], + "voices": 0, + "specific": 0.0 + }, + "clap_rank": { + "base": 17.0625, + "value": 15.2292, + "delta": -1.8333, + "ci": [ + -2.7083, + -0.9792 + ], + "voices": 5, + "specific": -1.7178 + }, + "msp@1": { + "base": 0.0, + "value": 0.0, + "delta": 0.0, + "ci": [ + 0.0, + 0.0 + ], + "voices": 0, + "specific": -0.0019 + }, + "arousal": { + "base": 0.3686, + "value": 0.527, + "delta": 0.1585, + "ci": [ + 0.1361, + 0.1804 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.5314, + "delta": 0.0013, + "ci": [ + -0.015, + 0.0163 + ], + "voices": 4 + }, + "dominance": { + "base": 0.4365, + "value": 0.573, + "delta": 0.1364, + "ci": [ + 0.1178, + 0.1553 + ], + "voices": 6 + } + }, + "clap_rise": { + "desirous": 0.184, + "loud": 0.08, + "happy": 0.055 + } + }, + "ovr/surprised x8": { + "mood": "surprised", + "variant": "ovr", + "dose": 8.0, + "n": 48, + "wer": 0.0006, + "collapse": 0.0, + "identity": 0.9114, + "durx": 1.013, + "clap_top": { + "calm": 0.562, + "desirous": 0.208, + "enunciated": 0.104 + }, + "e2v_top": { + "neutral": 0.771, + "happy": 0.229 + }, + "msp_top": { + "Neutral": 0.667, + "Happiness": 0.312, + "Sadness": 0.021 + }, + "targets": { + "e2v": { + "base": 0.0, + "value": 0.0001, + "delta": 0.0, + "ci": [ + -0.0, + 0.0001 + ], + "voices": 4, + "specific": -0.0022 + }, + "e2v@1": { + "base": 0.0, + "value": 0.0, + "delta": 0.0, + "ci": [ + 0.0, + 0.0 + ], + "voices": 0, + "specific": -0.0019 + }, + "clap": { + "base": 0.0205, + "value": 0.0362, + "delta": 0.0156, + "ci": [ + 0.0061, + 0.0266 + ], + "voices": 5, + "specific": 0.016 + }, + "clap@1": { + "base": 0.0, + "value": 0.0, + "delta": 0.0, + "ci": [ + 0.0, + 0.0 + ], + "voices": 0, + "specific": -0.0057 + }, + "clap_rank": { + "base": 8.375, + "value": 7.75, + "delta": -0.625, + "ci": [ + -1.3964, + 0.0833 + ], + "voices": 5, + "specific": -0.9962 + }, + "msp@1": { + "base": 0.0, + "value": 0.0, + "delta": 0.0, + "ci": [ + 0.0, + 0.0 + ], + "voices": 0, + "specific": -0.0038 + }, + "arousal": { + "base": 0.3686, + "value": 0.4547, + "delta": 0.0862, + "ci": [ + 0.0708, + 0.1013 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.548, + "delta": 0.0179, + "ci": [ + 0.0089, + 0.0276 + ], + "voices": 5 + }, + "dominance": { + "base": 0.4365, + "value": 0.5148, + "delta": 0.0782, + "ci": [ + 0.0651, + 0.0915 + ], + "voices": 6 + } + }, + "clap_rise": { + "desirous": 0.055, + "loud": 0.034, + "sympathetic": 0.026 + } + }, + "ovr/surprised x12": { + "mood": "surprised", + "variant": "ovr", + "dose": 12.0, + "n": 48, + "wer": 0.0098, + "collapse": 0.0, + "identity": 0.8754, + "durx": 1.05, + "clap_top": { + "calm": 0.521, + "desirous": 0.208, + "sleepy": 0.062 + }, + "e2v_top": { + "neutral": 0.708, + "happy": 0.292 + }, + "msp_top": { + "Neutral": 0.667, + "Happiness": 0.25, + "Contempt": 0.062 + }, + "targets": { + "e2v": { + "base": 0.0, + "value": 0.0004, + "delta": 0.0003, + "ci": [ + -0.0, + 0.001 + ], + "voices": 3, + "specific": -0.0068 + }, + "e2v@1": { + "base": 0.0, + "value": 0.0, + "delta": 0.0, + "ci": [ + 0.0, + 0.0 + ], + "voices": 0, + "specific": -0.0076 + }, + "clap": { + "base": 0.0205, + "value": 0.0249, + "delta": 0.0044, + "ci": [ + -0.0031, + 0.0116 + ], + "voices": 4, + "specific": 0.0042 + }, + "clap@1": { + "base": 0.0, + "value": 0.0, + "delta": 0.0, + "ci": [ + 0.0, + 0.0 + ], + "voices": 0, + "specific": -0.0038 + }, + "clap_rank": { + "base": 8.375, + "value": 8.2292, + "delta": -0.1458, + "ci": [ + -1.1042, + 0.9583 + ], + "voices": 4, + "specific": -1.0833 + }, + "msp@1": { + "base": 0.0, + "value": 0.0, + "delta": 0.0, + "ci": [ + 0.0, + 0.0 + ], + "voices": 0, + "specific": -0.0095 + }, + "arousal": { + "base": 0.3686, + "value": 0.4937, + "delta": 0.1251, + "ci": [ + 0.1067, + 0.1449 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.56, + "delta": 0.0299, + "ci": [ + 0.0152, + 0.0442 + ], + "voices": 5 + }, + "dominance": { + "base": 0.4365, + "value": 0.549, + "delta": 0.1124, + "ci": [ + 0.0959, + 0.1299 + ], + "voices": 6 + } + }, + "clap_rise": { + "desirous": 0.078, + "happy": 0.049, + "loud": 0.045 + } + }, + "ovr/adoring x8": { + "mood": "adoring", + "variant": "ovr", + "dose": 8.0, + "n": 48, + "wer": 0.003, + "collapse": 0.0, + "identity": 0.9273, + "durx": 1.033, + "clap_top": { + "calm": 0.833, + "enunciated": 0.104, + "whispered": 0.042 + }, + "e2v_top": { + "neutral": 0.75, + "happy": 0.188, + "sad": 0.062 + }, + "msp_top": { + "Neutral": 0.875, + "Happiness": 0.062, + "Sadness": 0.062 + }, + "targets": { + "clap": { + "base": 0.0214, + "value": 0.0127, + "delta": -0.0086, + "ci": [ + -0.015, + -0.0026 + ], + "voices": 5, + "specific": -0.0168 + }, + "clap@1": { + "base": 0.0, + "value": 0.0, + "delta": 0.0, + "ci": [ + 0.0, + 0.0 + ], + "voices": 0, + "specific": -0.0076 + }, + "clap_rank": { + "base": 7.0833, + "value": 7.3542, + "delta": 0.2708, + "ci": [ + -0.4583, + 1.0417 + ], + "voices": 3, + "specific": -0.1288 + }, + "arousal": { + "base": 0.3686, + "value": 0.3231, + "delta": -0.0455, + "ci": [ + -0.0597, + -0.0318 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.5201, + "delta": -0.0101, + "ci": [ + -0.0202, + 0.0002 + ], + "voices": 5 + }, + "dominance": { + "base": 0.4365, + "value": 0.3985, + "delta": -0.0381, + "ci": [ + -0.0517, + -0.0263 + ], + "voices": 6 + } + }, + "clap_rise": { + "calm": 0.111, + "saddened": 0.002, + "sleepy": 0.001 + } + }, + "ovr/adoring x12": { + "mood": "adoring", + "variant": "ovr", + "dose": 12.0, + "n": 48, + "wer": 0.0024, + "collapse": 0.0, + "identity": 0.9154, + "durx": 1.041, + "clap_top": { + "calm": 0.896, + "enunciated": 0.062, + "whispered": 0.021 + }, + "e2v_top": { + "neutral": 0.792, + "happy": 0.104, + "sad": 0.062 + }, + "msp_top": { + "Neutral": 0.875, + "Sadness": 0.104, + "Happiness": 0.021 + }, + "targets": { + "clap": { + "base": 0.0214, + "value": 0.0104, + "delta": -0.011, + "ci": [ + -0.0173, + -0.0049 + ], + "voices": 6, + "specific": -0.0151 + }, + "clap@1": { + "base": 0.0, + "value": 0.0, + "delta": 0.0, + "ci": [ + 0.0, + 0.0 + ], + "voices": 0, + "specific": -0.0019 + }, + "clap_rank": { + "base": 7.0833, + "value": 7.5625, + "delta": 0.4792, + "ci": [ + -0.2708, + 1.3333 + ], + "voices": 4, + "specific": -0.7613 + }, + "arousal": { + "base": 0.3686, + "value": 0.3046, + "delta": -0.064, + "ci": [ + -0.0785, + -0.0504 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.5197, + "delta": -0.0104, + "ci": [ + -0.0218, + 0.0002 + ], + "voices": 4 + }, + "dominance": { + "base": 0.4365, + "value": 0.3801, + "delta": -0.0564, + "ci": [ + -0.0676, + -0.0448 + ], + "voices": 6 + } + }, + "clap_rise": { + "calm": 0.192, + "saddened": 0.0, + "anxious": -0.0 + } + }, + "ovr/desirous x8": { + "mood": "desirous", + "variant": "ovr", + "dose": 8.0, + "n": 48, + "wer": 0.0495, + "collapse": 0.0417, + "identity": 0.8618, + "durx": 2.287, + "clap_top": { + "calm": 0.562, + "whispered": 0.25, + "sleepy": 0.146 + }, + "e2v_top": { + "neutral": 0.521, + "disgusted": 0.271, + "sad": 0.146 + }, + "msp_top": { + "Neutral": 0.729, + "Sadness": 0.271 + }, + "targets": { + "clap": { + "base": 0.0498, + "value": 0.0375, + "delta": -0.0123, + "ci": [ + -0.0429, + 0.0146 + ], + "voices": 3, + "specific": -0.0334 + }, + "clap@1": { + "base": 0.0625, + "value": 0.0208, + "delta": -0.0417, + "ci": [ + -0.125, + 0.0417 + ], + "voices": 2, + "specific": -0.0966 + }, + "clap_rank": { + "base": 7.5, + "value": 7.4167, + "delta": -0.0833, + "ci": [ + -1.1042, + 0.8755 + ], + "voices": 4, + "specific": -0.3503 + }, + "arousal": { + "base": 0.3686, + "value": 0.1941, + "delta": -0.1745, + "ci": [ + -0.1999, + -0.1504 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.4228, + "delta": -0.1073, + "ci": [ + -0.1247, + -0.0899 + ], + "voices": 6 + }, + "dominance": { + "base": 0.4365, + "value": 0.2893, + "delta": -0.1472, + "ci": [ + -0.1687, + -0.1265 + ], + "voices": 6 + } + }, + "clap_rise": { + "sleepy": 0.14, + "whispered": 0.086, + "saddened": 0.022 + } + }, + "ovr/desirous x12": { + "mood": "desirous", + "variant": "ovr", + "dose": 12.0, + "n": 48, + "wer": 0.3294, + "collapse": 0.2917, + "identity": 0.7567, + "durx": 3.223, + "clap_top": { + "sleepy": 0.771, + "calm": 0.208, + "whispered": 0.021 + }, + "e2v_top": { + "disgusted": 0.375, + "sad": 0.333, + "neutral": 0.229 + }, + "msp_top": { + "Sadness": 0.542, + "Neutral": 0.458 + }, + "targets": { + "clap": { + "base": 0.0498, + "value": 0.0107, + "delta": -0.0391, + "ci": [ + -0.0689, + -0.0145 + ], + "voices": 5, + "specific": -0.072 + }, + "clap@1": { + "base": 0.0625, + "value": 0.0, + "delta": -0.0625, + "ci": [ + -0.1458, + 0.0 + ], + "voices": 3, + "specific": -0.1212 + }, + "clap_rank": { + "base": 7.5, + "value": 9.3125, + "delta": 1.8125, + "ci": [ + 0.6458, + 2.9167 + ], + "voices": 4, + "specific": 1.6572 + }, + "arousal": { + "base": 0.3686, + "value": 0.1659, + "delta": -0.2026, + "ci": [ + -0.2296, + -0.1759 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.391, + "delta": -0.1391, + "ci": [ + -0.1588, + -0.1209 + ], + "voices": 6 + }, + "dominance": { + "base": 0.4365, + "value": 0.232, + "delta": -0.2045, + "ci": [ + -0.2304, + -0.1789 + ], + "voices": 6 + } + }, + "clap_rise": { + "sleepy": 0.625, + "saddened": 0.051, + "anxious": 0.009 + } + }, + "ovr/distressed x8": { + "mood": "distressed", + "variant": "ovr", + "dose": 8.0, + "n": 48, + "wer": 0.0079, + "collapse": 0.0, + "identity": 0.8833, + "durx": 0.785, + "clap_top": { + "fast": 0.375, + "calm": 0.208, + "desirous": 0.167 + }, + "e2v_top": { + "neutral": 0.792, + "happy": 0.146, + "unknown": 0.021 + }, + "msp_top": { + "Neutral": 0.708, + "Happiness": 0.25, + "Contempt": 0.021 + }, + "targets": { + "clap": { + "base": 0.0001, + "value": 0.0012, + "delta": 0.001, + "ci": [ + 0.0001, + 0.0028 + ], + "voices": 5, + "specific": 0.0003 + }, + "clap@1": { + "base": 0.0, + "value": 0.0, + "delta": 0.0, + "ci": [ + 0.0, + 0.0 + ], + "voices": 0, + "specific": 0.0 + }, + "clap_rank": { + "base": 18.3958, + "value": 18.1042, + "delta": -0.2917, + "ci": [ + -1.0417, + 0.375 + ], + "voices": 4, + "specific": 0.195 + }, + "arousal": { + "base": 0.3686, + "value": 0.5374, + "delta": 0.1688, + "ci": [ + 0.1496, + 0.1902 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.5201, + "delta": -0.01, + "ci": [ + -0.0238, + 0.0043 + ], + "voices": 3 + }, + "dominance": { + "base": 0.4365, + "value": 0.5594, + "delta": 0.1229, + "ci": [ + 0.1069, + 0.1403 + ], + "voices": 6 + } + }, + "clap_rise": { + "fast": 0.32, + "desirous": 0.05, + "loud": 0.039 + } + }, + "ovr/distressed x12": { + "mood": "distressed", + "variant": "ovr", + "dose": 12.0, + "n": 48, + "wer": 0.0067, + "collapse": 0.0, + "identity": 0.8437, + "durx": 0.752, + "clap_top": { + "fast": 0.604, + "calm": 0.125, + "desirous": 0.125 + }, + "e2v_top": { + "neutral": 0.667, + "happy": 0.333 + }, + "msp_top": { + "Neutral": 0.625, + "Happiness": 0.375 + }, + "targets": { + "clap": { + "base": 0.0001, + "value": 0.0004, + "delta": 0.0003, + "ci": [ + 0.0, + 0.0006 + ], + "voices": 5, + "specific": -0.0016 + }, + "clap@1": { + "base": 0.0, + "value": 0.0, + "delta": 0.0, + "ci": [ + 0.0, + 0.0 + ], + "voices": 0, + "specific": 0.0 + }, + "clap_rank": { + "base": 18.3958, + "value": 17.0625, + "delta": -1.3333, + "ci": [ + -2.1875, + -0.4792 + ], + "voices": 5, + "specific": 0.3182 + }, + "arousal": { + "base": 0.3686, + "value": 0.612, + "delta": 0.2435, + "ci": [ + 0.2222, + 0.2636 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.5458, + "delta": 0.0157, + "ci": [ + -0.0038, + 0.0354 + ], + "voices": 3 + }, + "dominance": { + "base": 0.4365, + "value": 0.6191, + "delta": 0.1825, + "ci": [ + 0.1646, + 0.1991 + ], + "voices": 6 + } + }, + "clap_rise": { + "fast": 0.513, + "desirous": 0.054, + "happy": 0.03 + } + }, + "ovr/pained x8": { + "mood": "pained", + "variant": "ovr", + "dose": 8.0, + "n": 48, + "wer": 0.0025, + "collapse": 0.0, + "identity": 0.9086, + "durx": 1.254, + "clap_top": { + "calm": 0.792, + "desirous": 0.167, + "loud": 0.021 + }, + "e2v_top": { + "neutral": 0.729, + "sad": 0.104, + "happy": 0.083 + }, + "msp_top": { + "Neutral": 0.792, + "Sadness": 0.167, + "Happiness": 0.042 + }, + "targets": { + "clap": { + "base": 0.0003, + "value": 0.0011, + "delta": 0.0008, + "ci": [ + 0.0003, + 0.0015 + ], + "voices": 5, + "specific": -0.0 + }, + "clap@1": { + "base": 0.0, + "value": 0.0, + "delta": 0.0, + "ci": [ + 0.0, + 0.0 + ], + "voices": 0, + "specific": 0.0 + }, + "clap_rank": { + "base": 16.7083, + "value": 15.4583, + "delta": -1.25, + "ci": [ + -1.9792, + -0.5625 + ], + "voices": 4, + "specific": -1.0152 + }, + "arousal": { + "base": 0.3686, + "value": 0.3265, + "delta": -0.042, + "ci": [ + -0.0541, + -0.0295 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.4753, + "delta": -0.0549, + "ci": [ + -0.0659, + -0.0432 + ], + "voices": 6 + }, + "dominance": { + "base": 0.4365, + "value": 0.417, + "delta": -0.0195, + "ci": [ + -0.0304, + -0.0092 + ], + "voices": 6 + } + }, + "clap_rise": { + "calm": 0.094, + "desirous": 0.036, + "saddened": 0.015 + } + }, + "ovr/pained x12": { + "mood": "pained", + "variant": "ovr", + "dose": 12.0, + "n": 48, + "wer": 0.0152, + "collapse": 0.0, + "identity": 0.8795, + "durx": 1.404, + "clap_top": { + "calm": 0.854, + "desirous": 0.104, + "sleepy": 0.021 + }, + "e2v_top": { + "neutral": 0.562, + "disgusted": 0.188, + "sad": 0.146 + }, + "msp_top": { + "Neutral": 0.812, + "Sadness": 0.188 + }, + "targets": { + "clap": { + "base": 0.0003, + "value": 0.0014, + "delta": 0.0011, + "ci": [ + 0.0005, + 0.002 + ], + "voices": 6, + "specific": -0.0001 + }, + "clap@1": { + "base": 0.0, + "value": 0.0, + "delta": 0.0, + "ci": [ + 0.0, + 0.0 + ], + "voices": 0, + "specific": 0.0 + }, + "clap_rank": { + "base": 16.7083, + "value": 16.1458, + "delta": -0.5625, + "ci": [ + -1.3125, + 0.1875 + ], + "voices": 3, + "specific": -0.2045 + }, + "arousal": { + "base": 0.3686, + "value": 0.3111, + "delta": -0.0575, + "ci": [ + -0.0703, + -0.0458 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.4608, + "delta": -0.0693, + "ci": [ + -0.0817, + -0.0568 + ], + "voices": 6 + }, + "dominance": { + "base": 0.4365, + "value": 0.4049, + "delta": -0.0316, + "ci": [ + -0.0431, + -0.0205 + ], + "voices": 5 + } + }, + "clap_rise": { + "calm": 0.115, + "sleepy": 0.029, + "awed": 0.023 + } + }, + "ovr/guilty x8": { + "mood": "guilty", + "variant": "ovr", + "dose": 8.0, + "n": 48, + "wer": 0.0066, + "collapse": 0.0, + "identity": 0.8903, + "durx": 0.986, + "clap_top": { + "calm": 0.896, + "whispered": 0.104 + }, + "e2v_top": { + "neutral": 0.771, + "sad": 0.146, + "happy": 0.083 + }, + "msp_top": { + "Neutral": 0.854, + "Sadness": 0.146 + }, + "targets": { + "clap": { + "base": 0.0006, + "value": 0.0003, + "delta": -0.0003, + "ci": [ + -0.0007, + -0.0 + ], + "voices": 6, + "specific": -0.0022 + }, + "clap@1": { + "base": 0.0, + "value": 0.0, + "delta": 0.0, + "ci": [ + 0.0, + 0.0 + ], + "voices": 0, + "specific": -0.0019 + }, + "clap_rank": { + "base": 14.8333, + "value": 13.8542, + "delta": -0.9792, + "ci": [ + -1.5, + -0.5 + ], + "voices": 6, + "specific": -0.5341 + }, + "arousal": { + "base": 0.3686, + "value": 0.237, + "delta": -0.1316, + "ci": [ + -0.1491, + -0.1146 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.4746, + "delta": -0.0555, + "ci": [ + -0.0684, + -0.0425 + ], + "voices": 6 + }, + "dominance": { + "base": 0.4365, + "value": 0.3188, + "delta": -0.1177, + "ci": [ + -0.1314, + -0.1028 + ], + "voices": 6 + } + }, + "clap_rise": { + "calm": 0.211, + "whispered": 0.031, + "saddened": 0.001 + } + }, + "ovr/guilty x12": { + "mood": "guilty", + "variant": "ovr", + "dose": 12.0, + "n": 48, + "wer": 0.0139, + "collapse": 0.0, + "identity": 0.8605, + "durx": 1.04, + "clap_top": { + "calm": 0.875, + "whispered": 0.125 + }, + "e2v_top": { + "neutral": 0.792, + "sad": 0.167, + "happy": 0.042 + }, + "msp_top": { + "Neutral": 0.792, + "Sadness": 0.208 + }, + "targets": { + "clap": { + "base": 0.0006, + "value": 0.0002, + "delta": -0.0004, + "ci": [ + -0.0008, + -0.0001 + ], + "voices": 5, + "specific": -0.0026 + }, + "clap@1": { + "base": 0.0, + "value": 0.0, + "delta": 0.0, + "ci": [ + 0.0, + 0.0 + ], + "voices": 0, + "specific": 0.0 + }, + "clap_rank": { + "base": 14.8333, + "value": 13.2708, + "delta": -1.5625, + "ci": [ + -2.1875, + -0.9583 + ], + "voices": 5, + "specific": -0.839 + }, + "arousal": { + "base": 0.3686, + "value": 0.2072, + "delta": -0.1614, + "ci": [ + -0.1821, + -0.1403 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.4548, + "delta": -0.0753, + "ci": [ + -0.0903, + -0.0606 + ], + "voices": 6 + }, + "dominance": { + "base": 0.4365, + "value": 0.2888, + "delta": -0.1478, + "ci": [ + -0.1642, + -0.1314 + ], + "voices": 6 + } + }, + "clap_rise": { + "calm": 0.22, + "whispered": 0.049, + "saddened": 0.0 + } + }, + "ovr/proud x8": { + "mood": "proud", + "variant": "ovr", + "dose": 8.0, + "n": 48, + "wer": 0.004, + "collapse": 0.0, + "identity": 0.9031, + "durx": 0.874, + "clap_top": { + "calm": 0.458, + "fast": 0.167, + "desirous": 0.146 + }, + "e2v_top": { + "neutral": 0.792, + "happy": 0.188, + "sad": 0.021 + }, + "msp_top": { + "Neutral": 0.812, + "Happiness": 0.188 + }, + "targets": { + "arousal": { + "base": 0.3686, + "value": 0.4317, + "delta": 0.0631, + "ci": [ + 0.0503, + 0.0763 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.5356, + "delta": 0.0055, + "ci": [ + -0.0065, + 0.0166 + ], + "voices": 3 + }, + "dominance": { + "base": 0.4365, + "value": 0.4796, + "delta": 0.0431, + "ci": [ + 0.0316, + 0.0543 + ], + "voices": 6 + } + }, + "clap_rise": { + "fast": 0.144, + "loud": 0.025, + "admiring": 0.023 + } + }, + "ovr/proud x12": { + "mood": "proud", + "variant": "ovr", + "dose": 12.0, + "n": 48, + "wer": 0.0075, + "collapse": 0.0, + "identity": 0.8838, + "durx": 0.859, + "clap_top": { + "calm": 0.438, + "fast": 0.188, + "desirous": 0.146 + }, + "e2v_top": { + "neutral": 0.833, + "happy": 0.146, + "angry": 0.021 + }, + "msp_top": { + "Neutral": 0.792, + "Happiness": 0.188, + "Sadness": 0.021 + }, + "targets": { + "arousal": { + "base": 0.3686, + "value": 0.4347, + "delta": 0.0662, + "ci": [ + 0.0516, + 0.0802 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.5305, + "delta": 0.0003, + "ci": [ + -0.012, + 0.0121 + ], + "voices": 4 + }, + "dominance": { + "base": 0.4365, + "value": 0.4805, + "delta": 0.0439, + "ci": [ + 0.0311, + 0.0565 + ], + "voices": 6 + } + }, + "clap_rise": { + "fast": 0.132, + "loud": 0.038, + "desirous": 0.036 + } + }, + "ovr/embarrassed x8": { + "mood": "embarrassed", + "variant": "ovr", + "dose": 8.0, + "n": 48, + "wer": 0.0055, + "collapse": 0.0, + "identity": 0.8883, + "durx": 0.846, + "clap_top": { + "calm": 0.521, + "fast": 0.229, + "loud": 0.083 + }, + "e2v_top": { + "neutral": 0.771, + "happy": 0.229 + }, + "msp_top": { + "Neutral": 0.708, + "Happiness": 0.271, + "Sadness": 0.021 + }, + "targets": { + "arousal": { + "base": 0.3686, + "value": 0.4725, + "delta": 0.1039, + "ci": [ + 0.0863, + 0.1205 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.5628, + "delta": 0.0326, + "ci": [ + 0.0213, + 0.0444 + ], + "voices": 5 + }, + "dominance": { + "base": 0.4365, + "value": 0.5065, + "delta": 0.07, + "ci": [ + 0.055, + 0.0843 + ], + "voices": 6 + } + }, + "clap_rise": { + "fast": 0.19, + "loud": 0.043, + "sympathetic": 0.026 + } + }, + "ovr/embarrassed x12": { + "mood": "embarrassed", + "variant": "ovr", + "dose": 12.0, + "n": 48, + "wer": 0.007, + "collapse": 0.0, + "identity": 0.8439, + "durx": 0.792, + "clap_top": { + "fast": 0.417, + "calm": 0.354, + "loud": 0.104 + }, + "e2v_top": { + "neutral": 0.646, + "happy": 0.333, + "unknown": 0.021 + }, + "msp_top": { + "Neutral": 0.5, + "Happiness": 0.458, + "Fear": 0.042 + }, + "targets": { + "arousal": { + "base": 0.3686, + "value": 0.53, + "delta": 0.1614, + "ci": [ + 0.1445, + 0.179 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.5768, + "delta": 0.0467, + "ci": [ + 0.0315, + 0.063 + ], + "voices": 5 + }, + "dominance": { + "base": 0.4365, + "value": 0.5445, + "delta": 0.108, + "ci": [ + 0.093, + 0.1229 + ], + "voices": 6 + } + }, + "clap_rise": { + "fast": 0.331, + "loud": 0.056, + "sympathetic": 0.028 + } + }, + "ovr/content x8": { + "mood": "content", + "variant": "ovr", + "dose": 8.0, + "n": 48, + "wer": 0.0073, + "collapse": 0.0, + "identity": 0.9064, + "durx": 0.88, + "clap_top": { + "calm": 0.729, + "enunciated": 0.125, + "fast": 0.104 + }, + "e2v_top": { + "neutral": 0.771, + "happy": 0.229 + }, + "msp_top": { + "Neutral": 0.917, + "Happiness": 0.062, + "Sadness": 0.021 + }, + "targets": { + "clap": { + "base": 0.5825, + "value": 0.613, + "delta": 0.0305, + "ci": [ + -0.042, + 0.1046 + ], + "voices": 3, + "specific": 0.1075 + }, + "clap@1": { + "base": 0.7708, + "value": 0.7292, + "delta": -0.0417, + "ci": [ + -0.1667, + 0.0833 + ], + "voices": 2, + "specific": 0.1344 + }, + "clap_rank": { + "base": 1.4167, + "value": 1.4375, + "delta": 0.0208, + "ci": [ + -0.2297, + 0.2708 + ], + "voices": 2, + "specific": -0.8902 + }, + "arousal": { + "base": 0.3686, + "value": 0.334, + "delta": -0.0346, + "ci": [ + -0.0512, + -0.0182 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.5389, + "delta": 0.0088, + "ci": [ + -0.003, + 0.0199 + ], + "voices": 5 + }, + "dominance": { + "base": 0.4365, + "value": 0.3949, + "delta": -0.0416, + "ci": [ + -0.0571, + -0.0265 + ], + "voices": 6 + } + }, + "clap_rise": { + "fast": 0.1, + "calm": 0.03, + "sleepy": 0.002 + } + }, + "ovr/content x12": { + "mood": "content", + "variant": "ovr", + "dose": 12.0, + "n": 48, + "wer": 0.013, + "collapse": 0.0, + "identity": 0.882, + "durx": 0.866, + "clap_top": { + "calm": 0.75, + "fast": 0.125, + "whispered": 0.104 + }, + "e2v_top": { + "neutral": 0.688, + "happy": 0.271, + "other": 0.021 + }, + "msp_top": { + "Neutral": 0.917, + "Happiness": 0.042, + "Sadness": 0.042 + }, + "targets": { + "clap": { + "base": 0.5825, + "value": 0.6372, + "delta": 0.0548, + "ci": [ + -0.0194, + 0.1382 + ], + "voices": 4, + "specific": 0.1947 + }, + "clap@1": { + "base": 0.7708, + "value": 0.75, + "delta": -0.0208, + "ci": [ + -0.1464, + 0.125 + ], + "voices": 1, + "specific": 0.2311 + }, + "clap_rank": { + "base": 1.4167, + "value": 1.2917, + "delta": -0.125, + "ci": [ + -0.3125, + 0.0625 + ], + "voices": 4, + "specific": -1.6591 + }, + "arousal": { + "base": 0.3686, + "value": 0.309, + "delta": -0.0596, + "ci": [ + -0.0799, + -0.0404 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.5331, + "delta": 0.003, + "ci": [ + -0.0085, + 0.0133 + ], + "voices": 4 + }, + "dominance": { + "base": 0.4365, + "value": 0.3715, + "delta": -0.065, + "ci": [ + -0.0819, + -0.049 + ], + "voices": 6 + } + }, + "clap_rise": { + "fast": 0.093, + "calm": 0.055, + "sleepy": 0.005 + } + }, + "ovr/relieved x8": { + "mood": "relieved", + "variant": "ovr", + "dose": 8.0, + "n": 48, + "wer": 0.006, + "collapse": 0.0, + "identity": 0.8597, + "durx": 0.984, + "clap_top": { + "calm": 0.833, + "whispered": 0.104, + "fast": 0.042 + }, + "e2v_top": { + "neutral": 0.854, + "happy": 0.083, + "sad": 0.062 + }, + "msp_top": { + "Neutral": 0.833, + "Sadness": 0.146, + "Happiness": 0.021 + }, + "targets": { + "clap": { + "base": 0.5825, + "value": 0.7286, + "delta": 0.1461, + "ci": [ + 0.0693, + 0.2172 + ], + "voices": 4, + "specific": 0.2336 + }, + "clap@1": { + "base": 0.7708, + "value": 0.8333, + "delta": 0.0625, + "ci": [ + -0.0625, + 0.1875 + ], + "voices": 4, + "specific": 0.2481 + }, + "clap_rank": { + "base": 1.4167, + "value": 1.2292, + "delta": -0.1875, + "ci": [ + -0.4792, + 0.0833 + ], + "voices": 4, + "specific": -1.1174 + }, + "arousal": { + "base": 0.3686, + "value": 0.2632, + "delta": -0.1054, + "ci": [ + -0.122, + -0.0905 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.4801, + "delta": -0.05, + "ci": [ + -0.0626, + -0.0383 + ], + "voices": 6 + }, + "dominance": { + "base": 0.4365, + "value": 0.3424, + "delta": -0.0941, + "ci": [ + -0.1084, + -0.0814 + ], + "voices": 6 + } + }, + "clap_rise": { + "calm": 0.146, + "whispered": 0.037, + "fast": 0.014 + } + }, + "ovr/relieved x12": { + "mood": "relieved", + "variant": "ovr", + "dose": 12.0, + "n": 48, + "wer": 0.0347, + "collapse": 0.0, + "identity": 0.8167, + "durx": 1.016, + "clap_top": { + "calm": 0.75, + "whispered": 0.167, + "fast": 0.083 + }, + "e2v_top": { + "neutral": 0.688, + "sad": 0.25, + "happy": 0.042 + }, + "msp_top": { + "Neutral": 0.812, + "Sadness": 0.188 + }, + "targets": { + "clap": { + "base": 0.5825, + "value": 0.6971, + "delta": 0.1146, + "ci": [ + 0.0304, + 0.1964 + ], + "voices": 4, + "specific": 0.2599 + }, + "clap@1": { + "base": 0.7708, + "value": 0.75, + "delta": -0.0208, + "ci": [ + -0.1667, + 0.125 + ], + "voices": 1, + "specific": 0.2311 + }, + "clap_rank": { + "base": 1.4167, + "value": 1.3125, + "delta": -0.1042, + "ci": [ + -0.375, + 0.1667 + ], + "voices": 4, + "specific": -1.6364 + }, + "arousal": { + "base": 0.3686, + "value": 0.2335, + "delta": -0.1351, + "ci": [ + -0.1556, + -0.1157 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.4654, + "delta": -0.0647, + "ci": [ + -0.0774, + -0.0524 + ], + "voices": 6 + }, + "dominance": { + "base": 0.4365, + "value": 0.3169, + "delta": -0.1196, + "ci": [ + -0.1381, + -0.1017 + ], + "voices": 6 + } + }, + "clap_rise": { + "calm": 0.115, + "whispered": 0.058, + "fast": 0.037 + } + }, + "confused x2": { + "mood": "confused", + "variant": null, + "dose": 2.0, + "n": 48, + "wer": 0.0048, + "collapse": 0.0, + "identity": 0.9129, + "durx": 1.352, + "clap_top": { + "calm": 0.75, + "desirous": 0.167, + "sleepy": 0.021 + }, + "e2v_top": { + "neutral": 0.583, + "happy": 0.396, + "sad": 0.021 + }, + "msp_top": { + "Neutral": 0.792, + "Happiness": 0.146, + "Sadness": 0.062 + }, + "targets": { + "clap": { + "base": 0.0002, + "value": 0.0035, + "delta": 0.0034, + "ci": [ + 0.0015, + 0.006 + ], + "voices": 6, + "specific": 0.0007 + }, + "clap@1": { + "base": 0.0, + "value": 0.0, + "delta": 0.0, + "ci": [ + 0.0, + 0.0 + ], + "voices": 0, + "specific": 0.0 + }, + "clap_rank": { + "base": 18.875, + "value": 14.5417, + "delta": -4.3333, + "ci": [ + -5.25, + -3.4583 + ], + "voices": 6, + "specific": 0.125 + }, + "arousal": { + "base": 0.3686, + "value": 0.3402, + "delta": -0.0284, + "ci": [ + -0.0467, + -0.0103 + ], + "voices": 4 + }, + "valence": { + "base": 0.5301, + "value": 0.5102, + "delta": -0.0199, + "ci": [ + -0.0329, + -0.0065 + ], + "voices": 4 + }, + "dominance": { + "base": 0.4365, + "value": 0.4246, + "delta": -0.012, + "ci": [ + -0.0294, + 0.0046 + ], + "voices": 3 + } + }, + "clap_rise": { + "desirous": 0.059, + "enthusiastic": 0.02, + "happy": 0.018 + } + }, + "confused x3": { + "mood": "confused", + "variant": null, + "dose": 3.0, + "n": 48, + "wer": 0.0335, + "collapse": 0.0, + "identity": 0.8773, + "durx": 1.806, + "clap_top": { + "calm": 0.542, + "desirous": 0.188, + "sleepy": 0.104 + }, + "e2v_top": { + "happy": 0.521, + "neutral": 0.396, + "unknown": 0.062 + }, + "msp_top": { + "Neutral": 0.75, + "Happiness": 0.167, + "Sadness": 0.042 + }, + "targets": { + "clap": { + "base": 0.0002, + "value": 0.0278, + "delta": 0.0276, + "ci": [ + 0.0147, + 0.0424 + ], + "voices": 6 + }, + "clap@1": { + "base": 0.0, + "value": 0.0208, + "delta": 0.0208, + "ci": [ + 0.0, + 0.0625 + ], + "voices": 1 + }, + "clap_rank": { + "base": 18.875, + "value": 10.3958, + "delta": -8.4792, + "ci": [ + -9.938, + -7.0 + ], + "voices": 6 + }, + "arousal": { + "base": 0.3686, + "value": 0.3386, + "delta": -0.0299, + "ci": [ + -0.0537, + -0.0082 + ], + "voices": 3 + }, + "valence": { + "base": 0.5301, + "value": 0.5058, + "delta": -0.0244, + "ci": [ + -0.0399, + -0.0101 + ], + "voices": 4 + }, + "dominance": { + "base": 0.4365, + "value": 0.421, + "delta": -0.0155, + "ci": [ + -0.0382, + 0.0067 + ], + "voices": 3 + } + }, + "clap_rise": { + "sleepy": 0.094, + "desirous": 0.081, + "awed": 0.057 + } + }, + "interested x2": { + "mood": "interested", + "variant": null, + "dose": 2.0, + "n": 48, + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9262, + "durx": 1.236, + "clap_top": { + "calm": 0.708, + "desirous": 0.146, + "whispered": 0.083 + }, + "e2v_top": { + "neutral": 0.667, + "happy": 0.292, + "unknown": 0.021 + }, + "msp_top": { + "Neutral": 0.792, + "Happiness": 0.208 + }, + "targets": { + "arousal": { + "base": 0.3686, + "value": 0.3732, + "delta": 0.0046, + "ci": [ + -0.0102, + 0.0194 + ], + "voices": 4 + }, + "valence": { + "base": 0.5301, + "value": 0.5309, + "delta": 0.0008, + "ci": [ + -0.0087, + 0.0109 + ], + "voices": 4 + }, + "dominance": { + "base": 0.4365, + "value": 0.4498, + "delta": 0.0132, + "ci": [ + -0.0011, + 0.0273 + ], + "voices": 4 + } + }, + "clap_rise": { + "desirous": 0.04, + "awed": 0.018, + "enthusiastic": 0.01 + } + }, + "cute x2": { + "mood": "cute", + "variant": null, + "dose": 2.0, + "n": 48, + "wer": 0.0081, + "collapse": 0.0, + "identity": 0.8891, + "durx": 1.273, + "clap_top": { + "calm": 0.542, + "desirous": 0.229, + "sympathetic": 0.104 + }, + "e2v_top": { + "happy": 0.479, + "neutral": 0.458, + "unknown": 0.042 + }, + "msp_top": { + "Happiness": 0.458, + "Neutral": 0.458, + "Contempt": 0.062 + }, + "targets": { + "arousal": { + "base": 0.3686, + "value": 0.4737, + "delta": 0.1052, + "ci": [ + 0.0863, + 0.1251 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.5568, + "delta": 0.0267, + "ci": [ + 0.0098, + 0.0437 + ], + "voices": 5 + }, + "dominance": { + "base": 0.4365, + "value": 0.5354, + "delta": 0.0988, + "ci": [ + 0.0824, + 0.114 + ], + "voices": 6 + } + }, + "clap_rise": { + "desirous": 0.127, + "happy": 0.069, + "sympathetic": 0.05 + } + }, + "scared x10": { + "mood": "scared", + "variant": null, + "dose": 10.0, + "n": 48, + "wer": 0.0383, + "collapse": 0.0417, + "identity": 0.8176, + "durx": 1.268, + "clap_top": { + "calm": 0.583, + "desirous": 0.25, + "awed": 0.083 + }, + "e2v_top": { + "happy": 0.458, + "neutral": 0.354, + "fearful": 0.062 + }, + "msp_top": { + "Happiness": 0.417, + "Neutral": 0.375, + "Sadness": 0.083 + }, + "targets": { + "e2v": { + "base": 0.0001, + "value": 0.0474, + "delta": 0.0473, + "ci": [ + 0.0098, + 0.096 + ], + "voices": 6 + }, + "e2v@1": { + "base": 0.0, + "value": 0.0625, + "delta": 0.0625, + "ci": [ + 0.0, + 0.125 + ], + "voices": 2 + }, + "clap": { + "base": 0.0001, + "value": 0.0006, + "delta": 0.0005, + "ci": [ + 0.0001, + 0.001 + ], + "voices": 5 + }, + "clap@1": { + "base": 0.0, + "value": 0.0, + "delta": 0.0, + "ci": [ + 0.0, + 0.0 + ], + "voices": 0 + }, + "clap_rank": { + "base": 18.625, + "value": 18.8333, + "delta": 0.2083, + "ci": [ + -0.5417, + 1.0625 + ], + "voices": 1 + }, + "msp@1": { + "base": 0.0, + "value": 0.0208, + "delta": 0.0208, + "ci": [ + 0.0, + 0.0625 + ], + "voices": 1 + }, + "arousal": { + "base": 0.3686, + "value": 0.4671, + "delta": 0.0986, + "ci": [ + 0.0766, + 0.1202 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.5268, + "delta": -0.0034, + "ci": [ + -0.0218, + 0.0139 + ], + "voices": 2 + }, + "dominance": { + "base": 0.4365, + "value": 0.5135, + "delta": 0.077, + "ci": [ + 0.059, + 0.0947 + ], + "voices": 6 + } + }, + "clap_rise": { + "desirous": 0.121, + "awed": 0.065, + "sleepy": 0.033 + } + }, + "scared x12": { + "mood": "scared", + "variant": null, + "dose": 12.0, + "n": 48, + "wer": 0.0148, + "collapse": 0.0, + "identity": 0.7782, + "durx": 1.305, + "clap_top": { + "calm": 0.458, + "desirous": 0.375, + "sleepy": 0.062 + }, + "e2v_top": { + "happy": 0.5, + "neutral": 0.188, + "fearful": 0.083 + }, + "msp_top": { + "Neutral": 0.354, + "Happiness": 0.312, + "Sadness": 0.125 + }, + "targets": { + "e2v": { + "base": 0.0001, + "value": 0.0864, + "delta": 0.0863, + "ci": [ + 0.027, + 0.1624 + ], + "voices": 6 + }, + "e2v@1": { + "base": 0.0, + "value": 0.0833, + "delta": 0.0833, + "ci": [ + 0.0208, + 0.1667 + ], + "voices": 2 + }, + "clap": { + "base": 0.0001, + "value": 0.002, + "delta": 0.0019, + "ci": [ + 0.0005, + 0.0041 + ], + "voices": 5 + }, + "clap@1": { + "base": 0.0, + "value": 0.0, + "delta": 0.0, + "ci": [ + 0.0, + 0.0 + ], + "voices": 0 + }, + "clap_rank": { + "base": 18.625, + "value": 18.0833, + "delta": -0.5417, + "ci": [ + -1.6458, + 0.5417 + ], + "voices": 4 + }, + "msp@1": { + "base": 0.0, + "value": 0.0208, + "delta": 0.0208, + "ci": [ + 0.0, + 0.0625 + ], + "voices": 1 + }, + "arousal": { + "base": 0.3686, + "value": 0.4756, + "delta": 0.107, + "ci": [ + 0.0845, + 0.1293 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.5125, + "delta": -0.0176, + "ci": [ + -0.0351, + -0.0012 + ], + "voices": 4 + }, + "dominance": { + "base": 0.4365, + "value": 0.5197, + "delta": 0.0832, + "ci": [ + 0.0638, + 0.1033 + ], + "voices": 6 + } + }, + "clap_rise": { + "desirous": 0.154, + "awed": 0.073, + "sleepy": 0.065 + } + }, + "scared x14": { + "mood": "scared", + "variant": null, + "dose": 14.0, + "n": 48, + "wer": 0.0224, + "collapse": 0.0, + "identity": 0.7344, + "durx": 1.39, + "clap_top": { + "calm": 0.458, + "desirous": 0.292, + "awed": 0.125 + }, + "e2v_top": { + "happy": 0.396, + "neutral": 0.188, + "fearful": 0.167 + }, + "msp_top": { + "Happiness": 0.354, + "Neutral": 0.208, + "Surprise": 0.146 + }, + "targets": { + "e2v": { + "base": 0.0001, + "value": 0.1576, + "delta": 0.1575, + "ci": [ + 0.073, + 0.2539 + ], + "voices": 5 + }, + "e2v@1": { + "base": 0.0, + "value": 0.1667, + "delta": 0.1667, + "ci": [ + 0.0625, + 0.2708 + ], + "voices": 5 + }, + "clap": { + "base": 0.0001, + "value": 0.0039, + "delta": 0.0038, + "ci": [ + 0.0011, + 0.0073 + ], + "voices": 5 + }, + "clap@1": { + "base": 0.0, + "value": 0.0, + "delta": 0.0, + "ci": [ + 0.0, + 0.0 + ], + "voices": 0 + }, + "clap_rank": { + "base": 18.625, + "value": 17.875, + "delta": -0.75, + "ci": [ + -1.875, + 0.375 + ], + "voices": 5 + }, + "msp@1": { + "base": 0.0, + "value": 0.0625, + "delta": 0.0625, + "ci": [ + 0.0, + 0.1458 + ], + "voices": 2 + }, + "arousal": { + "base": 0.3686, + "value": 0.4828, + "delta": 0.1143, + "ci": [ + 0.0893, + 0.1406 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.5057, + "delta": -0.0245, + "ci": [ + -0.0462, + -0.0034 + ], + "voices": 4 + }, + "dominance": { + "base": 0.4365, + "value": 0.5165, + "delta": 0.0799, + "ci": [ + 0.0571, + 0.1027 + ], + "voices": 6 + } + }, + "clap_rise": { + "desirous": 0.144, + "awed": 0.094, + "sleepy": 0.083 + } + }, + "scared x16": { + "mood": "scared", + "variant": null, + "dose": 16.0, + "n": 48, + "wer": 0.0614, + "collapse": 0.0208, + "identity": 0.7105, + "durx": 1.448, + "clap_top": { + "calm": 0.271, + "desirous": 0.25, + "awed": 0.167 + }, + "e2v_top": { + "happy": 0.354, + "fearful": 0.167, + "sad": 0.146 + }, + "msp_top": { + "Happiness": 0.25, + "Surprise": 0.188, + "Sadness": 0.188 + }, + "targets": { + "e2v": { + "base": 0.0001, + "value": 0.166, + "delta": 0.1659, + "ci": [ + 0.0774, + 0.2678 + ], + "voices": 6 + }, + "e2v@1": { + "base": 0.0, + "value": 0.1667, + "delta": 0.1667, + "ci": [ + 0.0625, + 0.2917 + ], + "voices": 4 + }, + "clap": { + "base": 0.0001, + "value": 0.0082, + "delta": 0.0081, + "ci": [ + 0.0015, + 0.0166 + ], + "voices": 6 + }, + "clap@1": { + "base": 0.0, + "value": 0.0, + "delta": 0.0, + "ci": [ + 0.0, + 0.0 + ], + "voices": 0 + }, + "clap_rank": { + "base": 18.625, + "value": 17.0208, + "delta": -1.6042, + "ci": [ + -2.9583, + -0.437 + ], + "voices": 5 + }, + "msp@1": { + "base": 0.0, + "value": 0.1042, + "delta": 0.1042, + "ci": [ + 0.0208, + 0.1875 + ], + "voices": 3 + }, + "arousal": { + "base": 0.3686, + "value": 0.4873, + "delta": 0.1187, + "ci": [ + 0.0933, + 0.1458 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.4874, + "delta": -0.0428, + "ci": [ + -0.0604, + -0.0249 + ], + "voices": 4 + }, + "dominance": { + "base": 0.4365, + "value": 0.5186, + "delta": 0.082, + "ci": [ + 0.0591, + 0.1051 + ], + "voices": 6 + } + }, + "clap_rise": { + "desirous": 0.169, + "awed": 0.113, + "sleepy": 0.06 + } + } + } + }, + "base": { + "dirs": [ + "tmp/steer/moods/base", + "tmp/steer/moods/base_extra" + ], + "neutral": { + "wer": 0.0006, + "identity": 0.9426, + "arousal": 0.3669, + "valence": 0.5144, + "dominance": 0.4393, + "collapse": 0.0 + }, + "conditions": { + "angry x4": { + "mood": "angry", + "variant": null, + "dose": 4.0, + "n": 48, + "wer": 0.0685, + "collapse": 0.0, + "identity": 0.6569, + "durx": 1.018, + "clap_top": { + "desirous": 0.229, + "happy": 0.208, + "sleepy": 0.125 + }, + "e2v_top": { + "happy": 0.625, + "neutral": 0.167, + "angry": 0.146 + }, + "msp_top": { + "Happiness": 0.521, + "Anger": 0.333, + "Neutral": 0.062 + }, + "targets": { + "e2v": { + "base": 0.0002, + "value": 0.1297, + "delta": 0.1296, + "ci": [ + 0.0505, + 0.2194 + ], + "voices": 6, + "specific": 0.1213 + }, + "e2v@1": { + "base": 0.0, + "value": 0.1458, + "delta": 0.1458, + "ci": [ + 0.0625, + 0.25 + ], + "voices": 3, + "specific": 0.1359 + }, + "clap": { + "base": 0.0011, + "value": 0.0099, + "delta": 0.0088, + "ci": [ + 0.0012, + 0.0209 + ], + "voices": 6, + "specific": 0.0085 + }, + "clap@1": { + "base": 0.0, + "value": 0.0208, + "delta": 0.0208, + "ci": [ + 0.0, + 0.0625 + ], + "voices": 1, + "specific": 0.0208 + }, + "clap_rank": { + "base": 14.25, + "value": 16.3958, + "delta": 2.1458, + "ci": [ + 0.9161, + 3.2708 + ], + "voices": 6, + "specific": -0.5329 + }, + "msp@1": { + "base": 0.0, + "value": 0.3333, + "delta": 0.3333, + "ci": [ + 0.2083, + 0.4792 + ], + "voices": 4, + "specific": 0.3103 + }, + "arousal": { + "base": 0.3669, + "value": 0.8115, + "delta": 0.4446, + "ci": [ + 0.4149, + 0.475 + ], + "voices": 6 + }, + "valence": { + "base": 0.5144, + "value": 0.5362, + "delta": 0.0217, + "ci": [ + -0.0125, + 0.0554 + ], + "voices": 5 + }, + "dominance": { + "base": 0.4393, + "value": 0.8048, + "delta": 0.3655, + "ci": [ + 0.3421, + 0.3884 + ], + "voices": 6 + } + }, + "clap_rise": { + "happy": 0.194, + "desirous": 0.183, + "sleepy": 0.097 + } + }, + "angry x6": { + "mood": "angry", + "variant": null, + "dose": 6.0, + "n": 48, + "wer": 0.1949, + "collapse": 0.125, + "identity": 0.4878, + "durx": 1.02, + "clap_top": { + "sleepy": 0.625, + "scared": 0.167, + "desirous": 0.062 + }, + "e2v_top": { + "happy": 0.458, + "angry": 0.292, + "unknown": 0.062 + }, + "msp_top": { + "Happiness": 0.438, + "Anger": 0.438, + "Surprise": 0.083 + }, + "targets": { + "e2v": { + "base": 0.0002, + "value": 0.2616, + "delta": 0.2614, + "ci": [ + 0.164, + 0.3705 + ], + "voices": 6, + "specific": 0.2477 + }, + "e2v@1": { + "base": 0.0, + "value": 0.2917, + "delta": 0.2917, + "ci": [ + 0.1667, + 0.4167 + ], + "voices": 4, + "specific": 0.2785 + }, + "clap": { + "base": 0.0011, + "value": 0.0068, + "delta": 0.0057, + "ci": [ + 0.0023, + 0.0104 + ], + "voices": 6, + "specific": 0.005 + }, + "clap@1": { + "base": 0.0, + "value": 0.0, + "delta": 0.0, + "ci": [ + 0.0, + 0.0 + ], + "voices": 0, + "specific": 0.0 + }, + "clap_rank": { + "base": 14.25, + "value": 15.4792, + "delta": 1.2292, + "ci": [ + -0.4172, + 2.8125 + ], + "voices": 3, + "specific": -2.3388 + }, + "msp@1": { + "base": 0.0, + "value": 0.4375, + "delta": 0.4375, + "ci": [ + 0.3125, + 0.5833 + ], + "voices": 5, + "specific": 0.3893 + }, + "arousal": { + "base": 0.3669, + "value": 0.8595, + "delta": 0.4926, + "ci": [ + 0.4664, + 0.521 + ], + "voices": 6 + }, + "valence": { + "base": 0.5144, + "value": 0.5234, + "delta": 0.0089, + "ci": [ + -0.0265, + 0.0477 + ], + "voices": 4 + }, + "dominance": { + "base": 0.4393, + "value": 0.8421, + "delta": 0.4029, + "ci": [ + 0.3804, + 0.4251 + ], + "voices": 6 + } + }, + "clap_rise": { + "sleepy": 0.359, + "scared": 0.137, + "happy": 0.069 + } + }, + "happy x4": { + "mood": "happy", + "variant": null, + "dose": 4.0, + "n": 48, + "wer": 0.0618, + "collapse": 0.0417, + "identity": 0.7681, + "durx": 1.019, + "clap_top": { + "desirous": 0.271, + "happy": 0.229, + "calm": 0.146 + }, + "e2v_top": { + "happy": 0.708, + "neutral": 0.188, + "unknown": 0.042 + }, + "msp_top": { + "Happiness": 0.604, + "Neutral": 0.292, + "Disgust": 0.042 + }, + "targets": { + "e2v": { + "base": 0.1441, + "value": 0.6868, + "delta": 0.5427, + "ci": [ + 0.3919, + 0.6798 + ], + "voices": 6, + "specific": 0.3303 + }, + "e2v@1": { + "base": 0.1667, + "value": 0.7083, + "delta": 0.5417, + "ci": [ + 0.375, + 0.6875 + ], + "voices": 6, + "specific": 0.3465 + }, + "clap": { + "base": 0.0096, + "value": 0.2192, + "delta": 0.2096, + "ci": [ + 0.1457, + 0.2796 + ], + "voices": 6, + "specific": 0.1225 + }, + "clap@1": { + "base": 0.0, + "value": 0.2292, + "delta": 0.2292, + "ci": [ + 0.125, + 0.3542 + ], + "voices": 6, + "specific": 0.1371 + }, + "clap_rank": { + "base": 10.5833, + "value": 4.3333, + "delta": -6.25, + "ci": [ + -7.4167, + -4.9583 + ], + "voices": 6, + "specific": -3.0866 + }, + "msp@1": { + "base": 0.1042, + "value": 0.6042, + "delta": 0.5, + "ci": [ + 0.3542, + 0.6458 + ], + "voices": 6, + "specific": 0.2467 + }, + "arousal": { + "base": 0.3669, + "value": 0.6452, + "delta": 0.2783, + "ci": [ + 0.2545, + 0.3017 + ], + "voices": 6 + }, + "valence": { + "base": 0.5144, + "value": 0.6008, + "delta": 0.0863, + "ci": [ + 0.0647, + 0.1063 + ], + "voices": 6 + }, + "dominance": { + "base": 0.4393, + "value": 0.6659, + "delta": 0.2266, + "ci": [ + 0.2071, + 0.2446 + ], + "voices": 6 + } + }, + "clap_rise": { + "happy": 0.198, + "desirous": 0.197, + "sleepy": 0.101 + } + }, + "happy x6": { + "mood": "happy", + "variant": null, + "dose": 6.0, + "n": 48, + "wer": 0.2194, + "collapse": 0.1458, + "identity": 0.6026, + "durx": 1.113, + "clap_top": { + "sleepy": 0.458, + "happy": 0.229, + "desirous": 0.146 + }, + "e2v_top": { + "happy": 0.854, + "sad": 0.062, + "unknown": 0.021 + }, + "msp_top": { + "Happiness": 0.792, + "Surprise": 0.146, + "Fear": 0.042 + }, + "targets": { + "e2v": { + "base": 0.1441, + "value": 0.8291, + "delta": 0.685, + "ci": [ + 0.5352, + 0.8135 + ], + "voices": 6, + "specific": 0.4495 + }, + "e2v@1": { + "base": 0.1667, + "value": 0.8542, + "delta": 0.6875, + "ci": [ + 0.5208, + 0.8333 + ], + "voices": 6, + "specific": 0.4715 + }, + "clap": { + "base": 0.0096, + "value": 0.2239, + "delta": 0.2143, + "ci": [ + 0.1481, + 0.2867 + ], + "voices": 6, + "specific": 0.1167 + }, + "clap@1": { + "base": 0.0, + "value": 0.2292, + "delta": 0.2292, + "ci": [ + 0.125, + 0.3542 + ], + "voices": 5, + "specific": 0.1294 + }, + "clap_rank": { + "base": 10.5833, + "value": 3.8958, + "delta": -6.6875, + "ci": [ + -7.8547, + -5.5625 + ], + "voices": 6, + "specific": -3.4112 + }, + "msp@1": { + "base": 0.1042, + "value": 0.7917, + "delta": 0.6875, + "ci": [ + 0.5417, + 0.813 + ], + "voices": 6, + "specific": 0.4134 + }, + "arousal": { + "base": 0.3669, + "value": 0.7812, + "delta": 0.4143, + "ci": [ + 0.3854, + 0.442 + ], + "voices": 6 + }, + "valence": { + "base": 0.5144, + "value": 0.6787, + "delta": 0.1643, + "ci": [ + 0.1388, + 0.188 + ], + "voices": 6 + }, + "dominance": { + "base": 0.4393, + "value": 0.7647, + "delta": 0.3254, + "ci": [ + 0.3022, + 0.3489 + ], + "voices": 6 + } + }, + "clap_rise": { + "sleepy": 0.36, + "happy": 0.212, + "desirous": 0.112 + } + }, + "sad x4": { + "mood": "sad", + "variant": null, + "dose": 4.0, + "n": 48, + "wer": 0.0048, + "collapse": 0.0, + "identity": 0.8934, + "durx": 1.112, + "clap_top": { + "calm": 0.917, + "whispered": 0.042, + "fast": 0.042 + }, + "e2v_top": { + "neutral": 0.75, + "sad": 0.146, + "happy": 0.062 + }, + "msp_top": { + "Neutral": 0.833, + "Sadness": 0.146, + "Happiness": 0.021 + }, + "targets": { + "e2v": { + "base": 0.0086, + "value": 0.1405, + "delta": 0.132, + "ci": [ + 0.0525, + 0.2198 + ], + "voices": 5, + "specific": 0.0757 + }, + "e2v@1": { + "base": 0.0, + "value": 0.1458, + "delta": 0.1458, + "ci": [ + 0.0625, + 0.25 + ], + "voices": 4, + "specific": 0.0855 + }, + "clap": { + "base": 0.0124, + "value": 0.0033, + "delta": -0.009, + "ci": [ + -0.0187, + -0.0015 + ], + "voices": 2, + "specific": -0.0096 + }, + "clap@1": { + "base": 0.0, + "value": 0.0, + "delta": 0.0, + "ci": [ + 0.0, + 0.0 + ], + "voices": 0, + "specific": -0.0044 + }, + "clap_rank": { + "base": 10.125, + "value": 7.625, + "delta": -2.5, + "ci": [ + -3.4167, + -1.6453 + ], + "voices": 5, + "specific": -2.9956 + }, + "msp@1": { + "base": 0.0208, + "value": 0.1458, + "delta": 0.125, + "ci": [ + 0.0417, + 0.2292 + ], + "voices": 4, + "specific": 0.1075 + }, + "arousal": { + "base": 0.3669, + "value": 0.2832, + "delta": -0.0837, + "ci": [ + -0.0993, + -0.0695 + ], + "voices": 6 + }, + "valence": { + "base": 0.5144, + "value": 0.4926, + "delta": -0.0219, + "ci": [ + -0.0336, + -0.0108 + ], + "voices": 4 + }, + "dominance": { + "base": 0.4393, + "value": 0.3671, + "delta": -0.0721, + "ci": [ + -0.0849, + -0.0596 + ], + "voices": 6 + } + }, + "clap_rise": { + "calm": 0.241, + "scared": -0.0, + "confused": -0.0 + } + }, + "sad x6": { + "mood": "sad", + "variant": null, + "dose": 6.0, + "n": 48, + "wer": 0.0233, + "collapse": 0.0, + "identity": 0.8451, + "durx": 1.227, + "clap_top": { + "calm": 0.958, + "whispered": 0.042 + }, + "e2v_top": { + "neutral": 0.521, + "sad": 0.312, + "happy": 0.125 + }, + "msp_top": { + "Neutral": 0.667, + "Sadness": 0.333 + }, + "targets": { + "e2v": { + "base": 0.0086, + "value": 0.2885, + "delta": 0.28, + "ci": [ + 0.1708, + 0.3989 + ], + "voices": 6, + "specific": 0.185 + }, + "e2v@1": { + "base": 0.0, + "value": 0.3125, + "delta": 0.3125, + "ci": [ + 0.1875, + 0.4375 + ], + "voices": 5, + "specific": 0.2061 + }, + "clap": { + "base": 0.0124, + "value": 0.0063, + "delta": -0.0061, + "ci": [ + -0.0165, + 0.0024 + ], + "voices": 2, + "specific": -0.0144 + }, + "clap@1": { + "base": 0.0, + "value": 0.0, + "delta": 0.0, + "ci": [ + 0.0, + 0.0 + ], + "voices": 0, + "specific": -0.0033 + }, + "clap_rank": { + "base": 10.125, + "value": 6.3542, + "delta": -3.7708, + "ci": [ + -4.8333, + -2.6875 + ], + "voices": 6, + "specific": -2.9879 + }, + "msp@1": { + "base": 0.0208, + "value": 0.3333, + "delta": 0.3125, + "ci": [ + 0.1875, + 0.4375 + ], + "voices": 4, + "specific": 0.2895 + }, + "arousal": { + "base": 0.3669, + "value": 0.2191, + "delta": -0.1478, + "ci": [ + -0.1682, + -0.1268 + ], + "voices": 6 + }, + "valence": { + "base": 0.5144, + "value": 0.4553, + "delta": -0.0592, + "ci": [ + -0.0734, + -0.0456 + ], + "voices": 6 + }, + "dominance": { + "base": 0.4393, + "value": 0.3036, + "delta": -0.1356, + "ci": [ + -0.1523, + -0.1184 + ], + "voices": 6 + } + }, + "clap_rise": { + "calm": 0.272, + "sleepy": 0.005, + "scared": -0.0 + } + }, + "fearful x4": { + "mood": "fearful", + "variant": null, + "dose": 4.0, + "n": 48, + "wer": 0.0595, + "collapse": 0.0208, + "identity": 0.7669, + "durx": 1.161, + "clap_top": { + "desirous": 0.375, + "calm": 0.25, + "happy": 0.146 + }, + "e2v_top": { + "happy": 0.438, + "neutral": 0.25, + "unknown": 0.125 + }, + "msp_top": { + "Happiness": 0.5, + "Neutral": 0.188, + "Surprise": 0.125 + }, + "targets": { + "e2v": { + "base": 0.0001, + "value": 0.0132, + "delta": 0.0131, + "ci": [ + 0.001, + 0.0357 + ], + "voices": 6, + "specific": 0.0039 + }, + "e2v@1": { + "base": 0.0, + "value": 0.0208, + "delta": 0.0208, + "ci": [ + 0.0, + 0.0625 + ], + "voices": 1, + "specific": 0.012 + }, + "clap": { + "base": 0.0001, + "value": 0.008, + "delta": 0.0079, + "ci": [ + 0.0025, + 0.015 + ], + "voices": 6, + "specific": -0.0005 + }, + "clap@1": { + "base": 0.0, + "value": 0.0, + "delta": 0.0, + "ci": [ + 0.0, + 0.0 + ], + "voices": 0, + "specific": -0.0077 + }, + "clap_rank": { + "base": 19.2708, + "value": 15.0, + "delta": -4.2708, + "ci": [ + -5.6875, + -2.9161 + ], + "voices": 5, + "specific": -1.0427 + }, + "msp@1": { + "base": 0.0, + "value": 0.0417, + "delta": 0.0417, + "ci": [ + 0.0, + 0.1042 + ], + "voices": 2, + "specific": 0.0373 + }, + "arousal": { + "base": 0.3669, + "value": 0.6235, + "delta": 0.2566, + "ci": [ + 0.2307, + 0.2832 + ], + "voices": 6 + }, + "valence": { + "base": 0.5144, + "value": 0.545, + "delta": 0.0305, + "ci": [ + 0.0085, + 0.0518 + ], + "voices": 5 + }, + "dominance": { + "base": 0.4393, + "value": 0.6484, + "delta": 0.2091, + "ci": [ + 0.1878, + 0.2303 + ], + "voices": 6 + } + }, + "clap_rise": { + "desirous": 0.235, + "happy": 0.14, + "sleepy": 0.074 + } + }, + "fearful x6": { + "mood": "fearful", + "variant": null, + "dose": 6.0, + "n": 48, + "wer": 0.2409, + "collapse": 0.2083, + "identity": 0.5413, + "durx": 1.299, + "clap_top": { + "sleepy": 0.333, + "desirous": 0.271, + "scared": 0.104 + }, + "e2v_top": { + "surprised": 0.417, + "happy": 0.396, + "unknown": 0.062 + }, + "msp_top": { + "Happiness": 0.562, + "Surprise": 0.229, + "Anger": 0.083 + }, + "targets": { + "e2v": { + "base": 0.0001, + "value": 0.0265, + "delta": 0.0264, + "ci": [ + 0.0034, + 0.07 + ], + "voices": 6, + "specific": 0.0078 + }, + "e2v@1": { + "base": 0.0, + "value": 0.0208, + "delta": 0.0208, + "ci": [ + 0.0, + 0.0625 + ], + "voices": 1, + "specific": 0.0033 + }, + "clap": { + "base": 0.0001, + "value": 0.0708, + "delta": 0.0707, + "ci": [ + 0.0302, + 0.1214 + ], + "voices": 6, + "specific": 0.0528 + }, + "clap@1": { + "base": 0.0, + "value": 0.1042, + "delta": 0.1042, + "ci": [ + 0.0208, + 0.1875 + ], + "voices": 3, + "specific": 0.091 + }, + "clap_rank": { + "base": 19.2708, + "value": 8.8333, + "delta": -10.4375, + "ci": [ + -11.7292, + -9.0833 + ], + "voices": 6, + "specific": -4.4989 + }, + "msp@1": { + "base": 0.0, + "value": 0.0417, + "delta": 0.0417, + "ci": [ + 0.0, + 0.1042 + ], + "voices": 2, + "specific": 0.0296 + }, + "arousal": { + "base": 0.3669, + "value": 0.712, + "delta": 0.3451, + "ci": [ + 0.3153, + 0.3733 + ], + "voices": 6 + }, + "valence": { + "base": 0.5144, + "value": 0.5693, + "delta": 0.0548, + "ci": [ + 0.0207, + 0.0912 + ], + "voices": 5 + }, + "dominance": { + "base": 0.4393, + "value": 0.708, + "delta": 0.2687, + "ci": [ + 0.2432, + 0.2951 + ], + "voices": 6 + } + }, + "clap_rise": { + "sleepy": 0.199, + "desirous": 0.165, + "happy": 0.133 + } + }, + "disgusted x4": { + "mood": "disgusted", + "variant": null, + "dose": 4.0, + "n": 48, + "wer": 0.025, + "collapse": 0.0, + "identity": 0.8185, + "durx": 1.114, + "clap_top": { + "desirous": 0.333, + "calm": 0.271, + "happy": 0.167 + }, + "e2v_top": { + "neutral": 0.583, + "happy": 0.354, + "angry": 0.042 + }, + "msp_top": { + "Happiness": 0.5, + "Neutral": 0.375, + "Anger": 0.125 + }, + "targets": { + "e2v": { + "base": 0.008, + "value": 0.0153, + "delta": 0.0074, + "ci": [ + -0.0156, + 0.0299 + ], + "voices": 4, + "specific": -0.0081 + }, + "e2v@1": { + "base": 0.0, + "value": 0.0, + "delta": 0.0, + "ci": [ + 0.0, + 0.0 + ], + "voices": 0, + "specific": -0.0219 + }, + "clap": { + "base": 0.0007, + "value": 0.0028, + "delta": 0.0021, + "ci": [ + 0.0008, + 0.0037 + ], + "voices": 5, + "specific": -0.0017 + }, + "clap@1": { + "base": 0.0, + "value": 0.0, + "delta": 0.0, + "ci": [ + 0.0, + 0.0 + ], + "voices": 0, + "specific": 0.0 + }, + "clap_rank": { + "base": 17.4375, + "value": 15.0625, + "delta": -2.375, + "ci": [ + -3.3333, + -1.5208 + ], + "voices": 5, + "specific": -0.6009 + }, + "msp@1": { + "base": 0.0, + "value": 0.0, + "delta": 0.0, + "ci": [ + 0.0, + 0.0 + ], + "voices": 0, + "specific": -0.0088 + }, + "arousal": { + "base": 0.3669, + "value": 0.6032, + "delta": 0.2363, + "ci": [ + 0.2051, + 0.2672 + ], + "voices": 6 + }, + "valence": { + "base": 0.5144, + "value": 0.5286, + "delta": 0.0142, + "ci": [ + -0.0143, + 0.0437 + ], + "voices": 4 + }, + "dominance": { + "base": 0.4393, + "value": 0.6463, + "delta": 0.207, + "ci": [ + 0.1815, + 0.2332 + ], + "voices": 6 + } + }, + "clap_rise": { + "desirous": 0.232, + "happy": 0.126, + "loud": 0.039 + } + }, + "disgusted x6": { + "mood": "disgusted", + "variant": null, + "dose": 6.0, + "n": 48, + "wer": 0.0732, + "collapse": 0.0625, + "identity": 0.6836, + "durx": 1.142, + "clap_top": { + "sleepy": 0.25, + "desirous": 0.208, + "happy": 0.167 + }, + "e2v_top": { + "happy": 0.479, + "neutral": 0.25, + "unknown": 0.104 + }, + "msp_top": { + "Happiness": 0.562, + "Anger": 0.271, + "Neutral": 0.104 + }, + "targets": { + "e2v": { + "base": 0.008, + "value": 0.0147, + "delta": 0.0067, + "ci": [ + -0.0105, + 0.0208 + ], + "voices": 5, + "specific": -0.0245 + }, + "e2v@1": { + "base": 0.0, + "value": 0.0, + "delta": 0.0, + "ci": [ + 0.0, + 0.0 + ], + "voices": 0, + "specific": -0.0406 + }, + "clap": { + "base": 0.0007, + "value": 0.0081, + "delta": 0.0074, + "ci": [ + 0.0039, + 0.0122 + ], + "voices": 6, + "specific": -0.0006 + }, + "clap@1": { + "base": 0.0, + "value": 0.0, + "delta": 0.0, + "ci": [ + 0.0, + 0.0 + ], + "voices": 0, + "specific": -0.0022 + }, + "clap_rank": { + "base": 17.4375, + "value": 14.0417, + "delta": -3.3958, + "ci": [ + -4.5833, + -2.2292 + ], + "voices": 6, + "specific": 0.0888 + }, + "msp@1": { + "base": 0.0, + "value": 0.0, + "delta": 0.0, + "ci": [ + 0.0, + 0.0 + ], + "voices": 0, + "specific": -0.0044 + }, + "arousal": { + "base": 0.3669, + "value": 0.7607, + "delta": 0.3938, + "ci": [ + 0.3702, + 0.4173 + ], + "voices": 6 + }, + "valence": { + "base": 0.5144, + "value": 0.5365, + "delta": 0.0221, + "ci": [ + -0.0044, + 0.0488 + ], + "voices": 4 + }, + "dominance": { + "base": 0.4393, + "value": 0.7709, + "delta": 0.3317, + "ci": [ + 0.3119, + 0.3506 + ], + "voices": 6 + } + }, + "clap_rise": { + "sleepy": 0.157, + "happy": 0.138, + "desirous": 0.122 + } + }, + "surprised x4": { + "mood": "surprised", + "variant": null, + "dose": 4.0, + "n": 48, + "wer": 0.043, + "collapse": 0.0, + "identity": 0.7896, + "durx": 1.216, + "clap_top": { + "calm": 0.271, + "desirous": 0.271, + "happy": 0.208 + }, + "e2v_top": { + "happy": 0.521, + "neutral": 0.417, + "sad": 0.042 + }, + "msp_top": { + "Happiness": 0.542, + "Neutral": 0.354, + "Contempt": 0.042 + }, + "targets": { + "e2v": { + "base": 0.0001, + "value": 0.0004, + "delta": 0.0003, + "ci": [ + -0.0001, + 0.0008 + ], + "voices": 5, + "specific": -0.0277 + }, + "e2v@1": { + "base": 0.0, + "value": 0.0, + "delta": 0.0, + "ci": [ + 0.0, + 0.0 + ], + "voices": 0, + "specific": -0.0263 + }, + "clap": { + "base": 0.0188, + "value": 0.0396, + "delta": 0.0208, + "ci": [ + 0.0044, + 0.0389 + ], + "voices": 6, + "specific": 0.004 + }, + "clap@1": { + "base": 0.0, + "value": 0.0208, + "delta": 0.0208, + "ci": [ + 0.0, + 0.0625 + ], + "voices": 1, + "specific": 0.0087 + }, + "clap_rank": { + "base": 8.8125, + "value": 7.0833, + "delta": -1.7292, + "ci": [ + -2.7917, + -0.6245 + ], + "voices": 4, + "specific": -0.9167 + }, + "msp@1": { + "base": 0.0, + "value": 0.0, + "delta": 0.0, + "ci": [ + 0.0, + 0.0 + ], + "voices": 0, + "specific": -0.0318 + }, + "arousal": { + "base": 0.3669, + "value": 0.5843, + "delta": 0.2174, + "ci": [ + 0.1856, + 0.2484 + ], + "voices": 6 + }, + "valence": { + "base": 0.5144, + "value": 0.5541, + "delta": 0.0397, + "ci": [ + 0.0176, + 0.0616 + ], + "voices": 5 + }, + "dominance": { + "base": 0.4393, + "value": 0.6281, + "delta": 0.1888, + "ci": [ + 0.165, + 0.2132 + ], + "voices": 6 + } + }, + "clap_rise": { + "desirous": 0.204, + "happy": 0.15, + "sleepy": 0.11 + } + }, + "surprised x6": { + "mood": "surprised", + "variant": null, + "dose": 6.0, + "n": 48, + "wer": 0.2744, + "collapse": 0.2083, + "identity": 0.6023, + "durx": 1.43, + "clap_top": { + "sleepy": 0.521, + "desirous": 0.25, + "happy": 0.167 + }, + "e2v_top": { + "happy": 0.708, + "unknown": 0.062, + "fearful": 0.062 + }, + "msp_top": { + "Happiness": 0.625, + "Neutral": 0.188, + "Surprise": 0.104 + }, + "targets": { + "e2v": { + "base": 0.0001, + "value": 0.0565, + "delta": 0.0564, + "ci": [ + 0.0115, + 0.1159 + ], + "voices": 5, + "specific": -0.0099 + }, + "e2v@1": { + "base": 0.0, + "value": 0.0417, + "delta": 0.0417, + "ci": [ + 0.0, + 0.1042 + ], + "voices": 2, + "specific": -0.0263 + }, + "clap": { + "base": 0.0188, + "value": 0.0515, + "delta": 0.0327, + "ci": [ + 0.0078, + 0.0654 + ], + "voices": 4, + "specific": 0.0119 + }, + "clap@1": { + "base": 0.0, + "value": 0.0417, + "delta": 0.0417, + "ci": [ + 0.0, + 0.1042 + ], + "voices": 2, + "specific": 0.0077 + }, + "clap_rank": { + "base": 8.8125, + "value": 5.8958, + "delta": -2.9167, + "ci": [ + -4.1875, + -1.6245 + ], + "voices": 4, + "specific": -2.0702 + }, + "msp@1": { + "base": 0.0, + "value": 0.1042, + "delta": 0.1042, + "ci": [ + 0.0208, + 0.1875 + ], + "voices": 3, + "specific": 0.0263 + }, + "arousal": { + "base": 0.3669, + "value": 0.7269, + "delta": 0.36, + "ci": [ + 0.3214, + 0.3967 + ], + "voices": 6 + }, + "valence": { + "base": 0.5144, + "value": 0.6341, + "delta": 0.1197, + "ci": [ + 0.0981, + 0.1428 + ], + "voices": 6 + }, + "dominance": { + "base": 0.4393, + "value": 0.7234, + "delta": 0.2841, + "ci": [ + 0.2473, + 0.3151 + ], + "voices": 6 + } + }, + "clap_rise": { + "sleepy": 0.345, + "happy": 0.182, + "desirous": 0.15 + } + }, + "adoring x4": { + "mood": "adoring", + "variant": null, + "dose": 4.0, + "n": 48, + "wer": 0.0028, + "collapse": 0.0, + "identity": 0.8899, + "durx": 1.096, + "clap_top": { + "calm": 0.562, + "desirous": 0.208, + "loud": 0.062 + }, + "e2v_top": { + "neutral": 0.583, + "happy": 0.375, + "angry": 0.021 + }, + "msp_top": { + "Neutral": 0.667, + "Happiness": 0.312, + "Sadness": 0.021 + }, + "targets": { + "clap": { + "base": 0.0223, + "value": 0.025, + "delta": 0.0027, + "ci": [ + -0.006, + 0.0113 + ], + "voices": 3, + "specific": 0.0057 + }, + "clap@1": { + "base": 0.0, + "value": 0.0, + "delta": 0.0, + "ci": [ + 0.0, + 0.0 + ], + "voices": 0, + "specific": 0.0 + }, + "clap_rank": { + "base": 7.8333, + "value": 8.3333, + "delta": 0.5, + "ci": [ + -0.2292, + 1.2708 + ], + "voices": 4, + "specific": -0.7906 + }, + "arousal": { + "base": 0.3669, + "value": 0.4403, + "delta": 0.0734, + "ci": [ + 0.0549, + 0.0937 + ], + "voices": 6 + }, + "valence": { + "base": 0.5144, + "value": 0.5365, + "delta": 0.022, + "ci": [ + 0.0085, + 0.0379 + ], + "voices": 4 + }, + "dominance": { + "base": 0.4393, + "value": 0.5048, + "delta": 0.0656, + "ci": [ + 0.0508, + 0.0831 + ], + "voices": 6 + } + }, + "clap_rise": { + "desirous": 0.097, + "happy": 0.052, + "loud": 0.024 + } + }, + "adoring x6": { + "mood": "adoring", + "variant": null, + "dose": 6.0, + "n": 48, + "wer": 0.0196, + "collapse": 0.0, + "identity": 0.8085, + "durx": 1.198, + "clap_top": { + "calm": 0.438, + "desirous": 0.208, + "happy": 0.146 + }, + "e2v_top": { + "neutral": 0.479, + "happy": 0.438, + "sad": 0.042 + }, + "msp_top": { + "Happiness": 0.542, + "Neutral": 0.354, + "Contempt": 0.062 + }, + "targets": { + "clap": { + "base": 0.0223, + "value": 0.0116, + "delta": -0.0108, + "ci": [ + -0.0217, + -0.0016 + ], + "voices": 5, + "specific": -0.0019 + }, + "clap@1": { + "base": 0.0, + "value": 0.0, + "delta": 0.0, + "ci": [ + 0.0, + 0.0 + ], + "voices": 0, + "specific": -0.0011 + }, + "clap_rank": { + "base": 7.8333, + "value": 9.9375, + "delta": 2.1042, + "ci": [ + 1.0, + 3.2297 + ], + "voices": 5, + "specific": -0.909 + }, + "arousal": { + "base": 0.3669, + "value": 0.5057, + "delta": 0.1388, + "ci": [ + 0.115, + 0.1631 + ], + "voices": 6 + }, + "valence": { + "base": 0.5144, + "value": 0.5579, + "delta": 0.0435, + "ci": [ + 0.0247, + 0.0628 + ], + "voices": 4 + }, + "dominance": { + "base": 0.4393, + "value": 0.5612, + "delta": 0.1219, + "ci": [ + 0.1032, + 0.1416 + ], + "voices": 6 + } + }, + "clap_rise": { + "desirous": 0.132, + "happy": 0.124, + "sleepy": 0.103 + } + }, + "confused x4": { + "mood": "confused", + "variant": null, + "dose": 4.0, + "n": 48, + "wer": 0.3564, + "collapse": 0.375, + "identity": 0.6918, + "durx": 2.006, + "clap_top": { + "sleepy": 0.438, + "desirous": 0.271, + "calm": 0.104 + }, + "e2v_top": { + "happy": 0.438, + "surprised": 0.292, + "sad": 0.104 + }, + "msp_top": { + "Neutral": 0.458, + "Happiness": 0.312, + "Surprise": 0.167 + }, + "targets": { + "clap": { + "base": 0.0002, + "value": 0.0503, + "delta": 0.0501, + "ci": [ + 0.0346, + 0.0658 + ], + "voices": 6, + "specific": 0.0366 + }, + "clap@1": { + "base": 0.0, + "value": 0.0417, + "delta": 0.0417, + "ci": [ + 0.0, + 0.1042 + ], + "voices": 1, + "specific": 0.0351 + }, + "clap_rank": { + "base": 19.125, + "value": 6.625, + "delta": -12.5, + "ci": [ + -13.6667, + -11.2083 + ], + "voices": 6, + "specific": -7.3662 + }, + "arousal": { + "base": 0.3669, + "value": 0.4256, + "delta": 0.0587, + "ci": [ + 0.0179, + 0.0954 + ], + "voices": 4 + }, + "valence": { + "base": 0.5144, + "value": 0.536, + "delta": 0.0215, + "ci": [ + -0.001, + 0.0456 + ], + "voices": 5 + }, + "dominance": { + "base": 0.4393, + "value": 0.4559, + "delta": 0.0166, + "ci": [ + -0.0217, + 0.0495 + ], + "voices": 3 + } + }, + "clap_rise": { + "sleepy": 0.291, + "happy": 0.091, + "desirous": 0.087 + } + }, + "confused x6": { + "mood": "confused", + "variant": null, + "dose": 6.0, + "n": 48, + "wer": 0.8023, + "collapse": 0.8958, + "identity": 0.4265, + "durx": 1.796, + "clap_top": { + "sleepy": 0.625, + "awed": 0.167, + "happy": 0.083 + }, + "e2v_top": { + "sad": 0.333, + "surprised": 0.333, + "happy": 0.25 + }, + "msp_top": { + "Neutral": 0.5, + "Surprise": 0.292, + "Happiness": 0.104 + }, + "targets": { + "clap": { + "base": 0.0002, + "value": 0.046, + "delta": 0.0458, + "ci": [ + 0.0336, + 0.0583 + ], + "voices": 6, + "specific": 0.021 + }, + "clap@1": { + "base": 0.0, + "value": 0.0, + "delta": 0.0, + "ci": [ + 0.0, + 0.0 + ], + "voices": 0, + "specific": -0.0088 + }, + "clap_rank": { + "base": 19.125, + "value": 6.3333, + "delta": -12.7917, + "ci": [ + -14.0417, + -11.5411 + ], + "voices": 6, + "specific": -4.8904 + }, + "arousal": { + "base": 0.3669, + "value": 0.4637, + "delta": 0.0968, + "ci": [ + 0.0526, + 0.1413 + ], + "voices": 5 + }, + "valence": { + "base": 0.5144, + "value": 0.5682, + "delta": 0.0537, + "ci": [ + 0.0273, + 0.0793 + ], + "voices": 5 + }, + "dominance": { + "base": 0.4393, + "value": 0.4526, + "delta": 0.0133, + "ci": [ + -0.0254, + 0.0488 + ], + "voices": 3 + } + }, + "clap_rise": { + "sleepy": 0.386, + "awed": 0.082, + "saddened": 0.08 + } + }, + "content x4": { + "mood": "content", + "variant": null, + "dose": 4.0, + "n": 48, + "wer": 0.0049, + "collapse": 0.0, + "identity": 0.877, + "durx": 0.971, + "clap_top": { + "calm": 0.458, + "desirous": 0.146, + "fast": 0.125 + }, + "e2v_top": { + "neutral": 0.521, + "happy": 0.458, + "sad": 0.021 + }, + "msp_top": { + "Neutral": 0.625, + "Happiness": 0.375 + }, + "targets": { + "clap": { + "base": 0.581, + "value": 0.43, + "delta": -0.151, + "ci": [ + -0.2064, + -0.0956 + ], + "voices": 6, + "specific": 0.0864 + }, + "clap@1": { + "base": 0.7708, + "value": 0.4583, + "delta": -0.3125, + "ci": [ + -0.4375, + -0.1875 + ], + "voices": 5, + "specific": 0.0351 + }, + "clap_rank": { + "base": 1.6042, + "value": 2.9792, + "delta": 1.375, + "ci": [ + 0.625, + 2.2083 + ], + "voices": 5, + "specific": -2.8279 + }, + "arousal": { + "base": 0.3669, + "value": 0.4564, + "delta": 0.0895, + "ci": [ + 0.0721, + 0.1086 + ], + "voices": 6 + }, + "valence": { + "base": 0.5144, + "value": 0.5668, + "delta": 0.0524, + "ci": [ + 0.04, + 0.0657 + ], + "voices": 6 + }, + "dominance": { + "base": 0.4393, + "value": 0.5049, + "delta": 0.0657, + "ci": [ + 0.0501, + 0.0818 + ], + "voices": 6 + } + }, + "clap_rise": { + "fast": 0.055, + "loud": 0.051, + "happy": 0.05 + } + }, + "content x6": { + "mood": "content", + "variant": null, + "dose": 6.0, + "n": 48, + "wer": 0.0397, + "collapse": 0.0208, + "identity": 0.8324, + "durx": 0.988, + "clap_top": { + "calm": 0.438, + "desirous": 0.146, + "happy": 0.125 + }, + "e2v_top": { + "happy": 0.521, + "neutral": 0.458, + "surprised": 0.021 + }, + "msp_top": { + "Happiness": 0.583, + "Neutral": 0.396, + "Surprise": 0.021 + }, + "targets": { + "clap": { + "base": 0.581, + "value": 0.3633, + "delta": -0.2177, + "ci": [ + -0.2928, + -0.1453 + ], + "voices": 6, + "specific": 0.1213 + }, + "clap@1": { + "base": 0.7708, + "value": 0.4375, + "delta": -0.3333, + "ci": [ + -0.4792, + -0.1875 + ], + "voices": 6, + "specific": 0.1503 + }, + "clap_rank": { + "base": 1.6042, + "value": 3.6667, + "delta": 2.0625, + "ci": [ + 1.2292, + 3.125 + ], + "voices": 6, + "specific": -4.9221 + }, + "arousal": { + "base": 0.3669, + "value": 0.5221, + "delta": 0.1552, + "ci": [ + 0.1343, + 0.1762 + ], + "voices": 6 + }, + "valence": { + "base": 0.5144, + "value": 0.613, + "delta": 0.0985, + "ci": [ + 0.0854, + 0.1133 + ], + "voices": 6 + }, + "dominance": { + "base": 0.4393, + "value": 0.5559, + "delta": 0.1167, + "ci": [ + 0.1003, + 0.1323 + ], + "voices": 6 + } + }, + "clap_rise": { + "happy": 0.099, + "sleepy": 0.095, + "desirous": 0.07 + } + }, + "cute x4": { + "mood": "cute", + "variant": null, + "dose": 4.0, + "n": 48, + "wer": 0.6426, + "collapse": 0.7292, + "identity": 0.3699, + "durx": 1.415, + "clap_top": { + "sleepy": 0.854, + "desirous": 0.083, + "scared": 0.021 + }, + "e2v_top": { + "happy": 0.708, + "fearful": 0.125, + "sad": 0.125 + }, + "msp_top": { + "Happiness": 0.667, + "Neutral": 0.167, + "Surprise": 0.042 + }, + "targets": { + "arousal": { + "base": 0.3669, + "value": 0.6915, + "delta": 0.3246, + "ci": [ + 0.2895, + 0.3595 + ], + "voices": 6 + }, + "valence": { + "base": 0.5144, + "value": 0.6742, + "delta": 0.1598, + "ci": [ + 0.133, + 0.1859 + ], + "voices": 6 + }, + "dominance": { + "base": 0.4393, + "value": 0.6566, + "delta": 0.2174, + "ci": [ + 0.1844, + 0.25 + ], + "voices": 6 + } + }, + "clap_rise": { + "sleepy": 0.536, + "confused": 0.062, + "desirous": 0.053 + } + }, + "cute x6": { + "mood": "cute", + "variant": null, + "dose": 6.0, + "n": 48, + "wer": 0.9113, + "collapse": 1.0, + "identity": 0.1964, + "durx": 1.51, + "clap_top": { + "sleepy": 0.979, + "scared": 0.021 + }, + "e2v_top": { + "happy": 0.5, + "sad": 0.229, + "fearful": 0.188 + }, + "msp_top": { + "Neutral": 0.354, + "Happiness": 0.292, + "Surprise": 0.188 + }, + "targets": { + "arousal": { + "base": 0.3669, + "value": 0.6281, + "delta": 0.2612, + "ci": [ + 0.2093, + 0.3094 + ], + "voices": 6 + }, + "valence": { + "base": 0.5144, + "value": 0.6559, + "delta": 0.1415, + "ci": [ + 0.1132, + 0.1699 + ], + "voices": 6 + }, + "dominance": { + "base": 0.4393, + "value": 0.5838, + "delta": 0.1445, + "ci": [ + 0.1019, + 0.1861 + ], + "voices": 6 + } + }, + "clap_rise": { + "sleepy": 0.711, + "confused": 0.053, + "anxious": 0.045 + } + }, + "desirous x4": { + "mood": "desirous", + "variant": null, + "dose": 4.0, + "n": 48, + "wer": 0.0296, + "collapse": 0.0208, + "identity": 0.8757, + "durx": 1.779, + "clap_top": { + "calm": 0.583, + "desirous": 0.229, + "sleepy": 0.104 + }, + "e2v_top": { + "neutral": 0.583, + "happy": 0.208, + "disgusted": 0.167 + }, + "msp_top": { + "Neutral": 0.771, + "Happiness": 0.125, + "Sadness": 0.104 + }, + "targets": { + "clap": { + "base": 0.0433, + "value": 0.1302, + "delta": 0.0869, + "ci": [ + 0.052, + 0.1287 + ], + "voices": 6, + "specific": -0.0236 + }, + "clap@1": { + "base": 0.0625, + "value": 0.2292, + "delta": 0.1667, + "ci": [ + 0.0625, + 0.2917 + ], + "voices": 2, + "specific": 0.034 + }, + "clap_rank": { + "base": 7.8542, + "value": 4.625, + "delta": -3.2292, + "ci": [ + -4.2083, + -2.375 + ], + "voices": 6, + "specific": -1.0285 + }, + "arousal": { + "base": 0.3669, + "value": 0.3485, + "delta": -0.0184, + "ci": [ + -0.0454, + 0.0084 + ], + "voices": 5 + }, + "valence": { + "base": 0.5144, + "value": 0.4694, + "delta": -0.0451, + "ci": [ + -0.0625, + -0.0262 + ], + "voices": 5 + }, + "dominance": { + "base": 0.4393, + "value": 0.4408, + "delta": 0.0016, + "ci": [ + -0.0213, + 0.0256 + ], + "voices": 2 + } + }, + "clap_rise": { + "desirous": 0.087, + "sleepy": 0.086, + "happy": 0.041 + } + }, + "desirous x6": { + "mood": "desirous", + "variant": null, + "dose": 6.0, + "n": 48, + "wer": 0.2838, + "collapse": 0.2292, + "identity": 0.7665, + "durx": 1.962, + "clap_top": { + "sleepy": 0.479, + "awed": 0.229, + "calm": 0.208 + }, + "e2v_top": { + "disgusted": 0.375, + "neutral": 0.333, + "happy": 0.104 + }, + "msp_top": { + "Neutral": 0.792, + "Surprise": 0.083, + "Sadness": 0.083 + }, + "targets": { + "clap": { + "base": 0.0433, + "value": 0.1021, + "delta": 0.0588, + "ci": [ + 0.0299, + 0.0899 + ], + "voices": 6, + "specific": -0.0201 + }, + "clap@1": { + "base": 0.0625, + "value": 0.0833, + "delta": 0.0208, + "ci": [ + -0.0417, + 0.1042 + ], + "voices": 1, + "specific": -0.0516 + }, + "clap_rank": { + "base": 7.8542, + "value": 6.1667, + "delta": -1.6875, + "ci": [ + -2.9375, + -0.5 + ], + "voices": 5, + "specific": -0.1305 + }, + "arousal": { + "base": 0.3669, + "value": 0.3655, + "delta": -0.0014, + "ci": [ + -0.0347, + 0.0363 + ], + "voices": 3 + }, + "valence": { + "base": 0.5144, + "value": 0.4642, + "delta": -0.0502, + "ci": [ + -0.0768, + -0.0217 + ], + "voices": 6 + }, + "dominance": { + "base": 0.4393, + "value": 0.4366, + "delta": -0.0027, + "ci": [ + -0.0335, + 0.0295 + ], + "voices": 2 + } + }, + "clap_rise": { + "sleepy": 0.327, + "awed": 0.11, + "desirous": 0.059 + } + }, + "distressed x4": { + "mood": "distressed", + "variant": null, + "dose": 4.0, + "n": 48, + "wer": 0.0236, + "collapse": 0.0208, + "identity": 0.832, + "durx": 0.946, + "clap_top": { + "calm": 0.292, + "desirous": 0.271, + "happy": 0.104 + }, + "e2v_top": { + "neutral": 0.604, + "happy": 0.333, + "unknown": 0.021 + }, + "msp_top": { + "Happiness": 0.458, + "Neutral": 0.396, + "Contempt": 0.062 + }, + "targets": { + "clap": { + "base": 0.0004, + "value": 0.0054, + "delta": 0.005, + "ci": [ + 0.0021, + 0.0087 + ], + "voices": 6, + "specific": -0.0054 + }, + "clap@1": { + "base": 0.0, + "value": 0.0, + "delta": 0.0, + "ci": [ + 0.0, + 0.0 + ], + "voices": 0, + "specific": -0.0033 + }, + "clap_rank": { + "base": 18.3958, + "value": 15.6042, + "delta": -2.7917, + "ci": [ + -4.0005, + -1.6661 + ], + "voices": 5, + "specific": 0.9155 + }, + "arousal": { + "base": 0.3669, + "value": 0.6078, + "delta": 0.2409, + "ci": [ + 0.2117, + 0.2701 + ], + "voices": 6 + }, + "valence": { + "base": 0.5144, + "value": 0.5398, + "delta": 0.0253, + "ci": [ + -0.0005, + 0.0515 + ], + "voices": 4 + }, + "dominance": { + "base": 0.4393, + "value": 0.6372, + "delta": 0.1979, + "ci": [ + 0.1745, + 0.2218 + ], + "voices": 6 + } + }, + "clap_rise": { + "desirous": 0.16, + "happy": 0.114, + "fast": 0.052 + } + }, + "distressed x6": { + "mood": "distressed", + "variant": null, + "dose": 6.0, + "n": 48, + "wer": 0.038, + "collapse": 0.0208, + "identity": 0.7212, + "durx": 0.938, + "clap_top": { + "happy": 0.292, + "calm": 0.208, + "desirous": 0.146 + }, + "e2v_top": { + "happy": 0.5, + "neutral": 0.396, + "unknown": 0.042 + }, + "msp_top": { + "Happiness": 0.604, + "Neutral": 0.188, + "Anger": 0.188 + }, + "targets": { + "clap": { + "base": 0.0004, + "value": 0.0121, + "delta": 0.0116, + "ci": [ + 0.0071, + 0.0165 + ], + "voices": 6, + "specific": -0.0096 + }, + "clap@1": { + "base": 0.0, + "value": 0.0, + "delta": 0.0, + "ci": [ + 0.0, + 0.0 + ], + "voices": 0, + "specific": -0.0055 + }, + "clap_rank": { + "base": 18.3958, + "value": 11.2292, + "delta": -7.1667, + "ci": [ + -8.5625, + -5.7286 + ], + "voices": 6, + "specific": -0.3049 + }, + "arousal": { + "base": 0.3669, + "value": 0.7473, + "delta": 0.3804, + "ci": [ + 0.3557, + 0.4066 + ], + "voices": 6 + }, + "valence": { + "base": 0.5144, + "value": 0.5591, + "delta": 0.0447, + "ci": [ + 0.0079, + 0.0813 + ], + "voices": 5 + }, + "dominance": { + "base": 0.4393, + "value": 0.7455, + "delta": 0.3062, + "ci": [ + 0.2856, + 0.3253 + ], + "voices": 6 + } + }, + "clap_rise": { + "happy": 0.216, + "sleepy": 0.111, + "desirous": 0.108 + } + }, + "embarrassed x4": { + "mood": "embarrassed", + "variant": null, + "dose": 4.0, + "n": 48, + "wer": 0.014, + "collapse": 0.0, + "identity": 0.8169, + "durx": 0.99, + "clap_top": { + "calm": 0.417, + "desirous": 0.25, + "happy": 0.125 + }, + "e2v_top": { + "neutral": 0.521, + "happy": 0.438, + "angry": 0.021 + }, + "msp_top": { + "Happiness": 0.646, + "Neutral": 0.271, + "Disgust": 0.042 + }, + "targets": { + "arousal": { + "base": 0.3669, + "value": 0.5789, + "delta": 0.212, + "ci": [ + 0.1884, + 0.2372 + ], + "voices": 6 + }, + "valence": { + "base": 0.5144, + "value": 0.5603, + "delta": 0.0458, + "ci": [ + 0.0296, + 0.0625 + ], + "voices": 5 + }, + "dominance": { + "base": 0.4393, + "value": 0.6117, + "delta": 0.1724, + "ci": [ + 0.1547, + 0.1908 + ], + "voices": 6 + } + }, + "clap_rise": { + "desirous": 0.154, + "happy": 0.113, + "sleepy": 0.059 + } + }, + "embarrassed x6": { + "mood": "embarrassed", + "variant": null, + "dose": 6.0, + "n": 48, + "wer": 0.0809, + "collapse": 0.0208, + "identity": 0.6954, + "durx": 1.029, + "clap_top": { + "sleepy": 0.229, + "desirous": 0.229, + "happy": 0.208 + }, + "e2v_top": { + "happy": 0.646, + "neutral": 0.188, + "unknown": 0.062 + }, + "msp_top": { + "Happiness": 0.667, + "Neutral": 0.188, + "Fear": 0.083 + }, + "targets": { + "arousal": { + "base": 0.3669, + "value": 0.6948, + "delta": 0.3279, + "ci": [ + 0.3011, + 0.3539 + ], + "voices": 6 + }, + "valence": { + "base": 0.5144, + "value": 0.5992, + "delta": 0.0848, + "ci": [ + 0.0593, + 0.11 + ], + "voices": 5 + }, + "dominance": { + "base": 0.4393, + "value": 0.6973, + "delta": 0.258, + "ci": [ + 0.2384, + 0.2789 + ], + "voices": 6 + } + }, + "clap_rise": { + "happy": 0.209, + "sleepy": 0.179, + "desirous": 0.16 + } + }, + "guilty x4": { + "mood": "guilty", + "variant": null, + "dose": 4.0, + "n": 48, + "wer": 0.0034, + "collapse": 0.0, + "identity": 0.9102, + "durx": 1.121, + "clap_top": { + "calm": 0.958, + "desirous": 0.042 + }, + "e2v_top": { + "neutral": 0.75, + "happy": 0.146, + "sad": 0.083 + }, + "msp_top": { + "Neutral": 0.833, + "Happiness": 0.104, + "Sadness": 0.062 + }, + "targets": { + "clap": { + "base": 0.0014, + "value": 0.0007, + "delta": -0.0007, + "ci": [ + -0.0018, + 0.0001 + ], + "voices": 5, + "specific": -0.0032 + }, + "clap@1": { + "base": 0.0, + "value": 0.0, + "delta": 0.0, + "ci": [ + 0.0, + 0.0 + ], + "voices": 0, + "specific": 0.0 + }, + "clap_rank": { + "base": 14.0417, + "value": 14.2083, + "delta": 0.1667, + "ci": [ + -0.4167, + 0.75 + ], + "voices": 3, + "specific": -1.2971 + }, + "arousal": { + "base": 0.3669, + "value": 0.3384, + "delta": -0.0285, + "ci": [ + -0.0419, + -0.0157 + ], + "voices": 5 + }, + "valence": { + "base": 0.5144, + "value": 0.4966, + "delta": -0.0178, + "ci": [ + -0.029, + -0.0067 + ], + "voices": 6 + }, + "dominance": { + "base": 0.4393, + "value": 0.4182, + "delta": -0.0211, + "ci": [ + -0.0337, + -0.0089 + ], + "voices": 4 + } + }, + "clap_rise": { + "calm": 0.172, + "happy": 0.002, + "scared": -0.0 + } + }, + "guilty x6": { + "mood": "guilty", + "variant": null, + "dose": 6.0, + "n": 48, + "wer": 0.0063, + "collapse": 0.0, + "identity": 0.8845, + "durx": 1.178, + "clap_top": { + "calm": 0.958, + "sleepy": 0.021, + "desirous": 0.021 + }, + "e2v_top": { + "neutral": 0.646, + "happy": 0.167, + "sad": 0.167 + }, + "msp_top": { + "Neutral": 0.833, + "Happiness": 0.083, + "Sadness": 0.083 + }, + "targets": { + "clap": { + "base": 0.0014, + "value": 0.0009, + "delta": -0.0006, + "ci": [ + -0.0018, + 0.0007 + ], + "voices": 3, + "specific": -0.0047 + }, + "clap@1": { + "base": 0.0, + "value": 0.0, + "delta": 0.0, + "ci": [ + 0.0, + 0.0 + ], + "voices": 0, + "specific": 0.0 + }, + "clap_rank": { + "base": 14.0417, + "value": 14.0208, + "delta": -0.0208, + "ci": [ + -0.6667, + 0.6458 + ], + "voices": 4, + "specific": -0.7927 + }, + "arousal": { + "base": 0.3669, + "value": 0.3179, + "delta": -0.049, + "ci": [ + -0.0628, + -0.0344 + ], + "voices": 6 + }, + "valence": { + "base": 0.5144, + "value": 0.4957, + "delta": -0.0187, + "ci": [ + -0.0311, + -0.0061 + ], + "voices": 3 + }, + "dominance": { + "base": 0.4393, + "value": 0.401, + "delta": -0.0382, + "ci": [ + -0.0524, + -0.024 + ], + "voices": 5 + } + }, + "clap_rise": { + "calm": 0.218, + "sleepy": 0.013, + "awed": 0.002 + } + }, + "interested x4": { + "mood": "interested", + "variant": null, + "dose": 4.0, + "n": 48, + "wer": 0.1474, + "collapse": 0.0833, + "identity": 0.7548, + "durx": 1.794, + "clap_top": { + "sleepy": 0.292, + "calm": 0.292, + "desirous": 0.167 + }, + "e2v_top": { + "happy": 0.604, + "sad": 0.188, + "neutral": 0.104 + }, + "msp_top": { + "Happiness": 0.479, + "Neutral": 0.292, + "Surprise": 0.167 + }, + "targets": { + "arousal": { + "base": 0.3669, + "value": 0.5029, + "delta": 0.136, + "ci": [ + 0.1048, + 0.1676 + ], + "voices": 6 + }, + "valence": { + "base": 0.5144, + "value": 0.5586, + "delta": 0.0442, + "ci": [ + 0.0248, + 0.0642 + ], + "voices": 6 + }, + "dominance": { + "base": 0.4393, + "value": 0.5484, + "delta": 0.1091, + "ci": [ + 0.0823, + 0.1349 + ], + "voices": 6 + } + }, + "clap_rise": { + "sleepy": 0.204, + "happy": 0.104, + "desirous": 0.088 + } + }, + "interested x6": { + "mood": "interested", + "variant": null, + "dose": 6.0, + "n": 48, + "wer": 0.6011, + "collapse": 0.6458, + "identity": 0.5122, + "durx": 1.535, + "clap_top": { + "sleepy": 0.625, + "happy": 0.146, + "awed": 0.104 + }, + "e2v_top": { + "happy": 0.542, + "surprised": 0.229, + "sad": 0.188 + }, + "msp_top": { + "Happiness": 0.417, + "Neutral": 0.229, + "Surprise": 0.208 + }, + "targets": { + "arousal": { + "base": 0.3669, + "value": 0.5358, + "delta": 0.1689, + "ci": [ + 0.129, + 0.2087 + ], + "voices": 6 + }, + "valence": { + "base": 0.5144, + "value": 0.5919, + "delta": 0.0775, + "ci": [ + 0.0512, + 0.1064 + ], + "voices": 6 + }, + "dominance": { + "base": 0.4393, + "value": 0.5339, + "delta": 0.0946, + "ci": [ + 0.0603, + 0.1316 + ], + "voices": 6 + } + }, + "clap_rise": { + "sleepy": 0.373, + "happy": 0.086, + "awed": 0.068 + } + }, + "pained x4": { + "mood": "pained", + "variant": null, + "dose": 4.0, + "n": 48, + "wer": 0.0084, + "collapse": 0.0, + "identity": 0.8561, + "durx": 1.309, + "clap_top": { + "calm": 0.458, + "desirous": 0.208, + "happy": 0.146 + }, + "e2v_top": { + "neutral": 0.479, + "happy": 0.333, + "sad": 0.083 + }, + "msp_top": { + "Neutral": 0.562, + "Happiness": 0.333, + "Sadness": 0.083 + }, + "targets": { + "clap": { + "base": 0.0007, + "value": 0.0046, + "delta": 0.0039, + "ci": [ + 0.001, + 0.0082 + ], + "voices": 6, + "specific": 0.0001 + }, + "clap@1": { + "base": 0.0, + "value": 0.0, + "delta": 0.0, + "ci": [ + 0.0, + 0.0 + ], + "voices": 0, + "specific": 0.0 + }, + "clap_rank": { + "base": 16.5208, + "value": 14.875, + "delta": -1.6458, + "ci": [ + -2.5625, + -0.8333 + ], + "voices": 5, + "specific": -0.3794 + }, + "arousal": { + "base": 0.3669, + "value": 0.462, + "delta": 0.0951, + "ci": [ + 0.0675, + 0.1251 + ], + "voices": 6 + }, + "valence": { + "base": 0.5144, + "value": 0.5058, + "delta": -0.0086, + "ci": [ + -0.0283, + 0.0122 + ], + "voices": 5 + }, + "dominance": { + "base": 0.4393, + "value": 0.5351, + "delta": 0.0958, + "ci": [ + 0.0729, + 0.1206 + ], + "voices": 6 + } + }, + "clap_rise": { + "desirous": 0.149, + "happy": 0.087, + "awed": 0.047 + } + }, + "pained x6": { + "mood": "pained", + "variant": null, + "dose": 6.0, + "n": 48, + "wer": 0.1759, + "collapse": 0.125, + "identity": 0.726, + "durx": 1.462, + "clap_top": { + "sleepy": 0.458, + "desirous": 0.229, + "calm": 0.167 + }, + "e2v_top": { + "happy": 0.354, + "neutral": 0.333, + "sad": 0.167 + }, + "msp_top": { + "Happiness": 0.521, + "Neutral": 0.312, + "Surprise": 0.042 + }, + "targets": { + "clap": { + "base": 0.0007, + "value": 0.0129, + "delta": 0.0122, + "ci": [ + 0.0065, + 0.0202 + ], + "voices": 6, + "specific": 0.0048 + }, + "clap@1": { + "base": 0.0, + "value": 0.0, + "delta": 0.0, + "ci": [ + 0.0, + 0.0 + ], + "voices": 0, + "specific": -0.0011 + }, + "clap_rank": { + "base": 16.5208, + "value": 11.6458, + "delta": -4.875, + "ci": [ + -6.1667, + -3.5833 + ], + "voices": 6, + "specific": -2.1382 + }, + "arousal": { + "base": 0.3669, + "value": 0.5571, + "delta": 0.1902, + "ci": [ + 0.1599, + 0.2233 + ], + "voices": 6 + }, + "valence": { + "base": 0.5144, + "value": 0.52, + "delta": 0.0056, + "ci": [ + -0.0209, + 0.0298 + ], + "voices": 4 + }, + "dominance": { + "base": 0.4393, + "value": 0.5979, + "delta": 0.1586, + "ci": [ + 0.1282, + 0.1863 + ], + "voices": 6 + } + }, + "clap_rise": { + "sleepy": 0.282, + "desirous": 0.126, + "happy": 0.074 + } + }, + "proud x4": { + "mood": "proud", + "variant": null, + "dose": 4.0, + "n": 48, + "wer": 0.0018, + "collapse": 0.0, + "identity": 0.8862, + "durx": 1.023, + "clap_top": { + "calm": 0.396, + "desirous": 0.25, + "loud": 0.083 + }, + "e2v_top": { + "neutral": 0.708, + "happy": 0.271, + "angry": 0.021 + }, + "msp_top": { + "Neutral": 0.667, + "Happiness": 0.292, + "Anger": 0.042 + }, + "targets": { + "arousal": { + "base": 0.3669, + "value": 0.4931, + "delta": 0.1262, + "ci": [ + 0.1066, + 0.145 + ], + "voices": 6 + }, + "valence": { + "base": 0.5144, + "value": 0.5241, + "delta": 0.0096, + "ci": [ + -0.0045, + 0.0233 + ], + "voices": 4 + }, + "dominance": { + "base": 0.4393, + "value": 0.5487, + "delta": 0.1094, + "ci": [ + 0.0929, + 0.1264 + ], + "voices": 6 + } + }, + "clap_rise": { + "desirous": 0.129, + "happy": 0.068, + "loud": 0.048 + } + }, + "proud x6": { + "mood": "proud", + "variant": null, + "dose": 6.0, + "n": 48, + "wer": 0.0161, + "collapse": 0.0, + "identity": 0.8262, + "durx": 1.004, + "clap_top": { + "calm": 0.312, + "desirous": 0.208, + "sympathetic": 0.104 + }, + "e2v_top": { + "neutral": 0.562, + "happy": 0.354, + "unknown": 0.042 + }, + "msp_top": { + "Happiness": 0.542, + "Neutral": 0.417, + "Anger": 0.021 + }, + "targets": { + "arousal": { + "base": 0.3669, + "value": 0.579, + "delta": 0.2121, + "ci": [ + 0.186, + 0.2386 + ], + "voices": 6 + }, + "valence": { + "base": 0.5144, + "value": 0.541, + "delta": 0.0266, + "ci": [ + 0.0062, + 0.046 + ], + "voices": 4 + }, + "dominance": { + "base": 0.4393, + "value": 0.6179, + "delta": 0.1786, + "ci": [ + 0.1572, + 0.2004 + ], + "voices": 6 + } + }, + "clap_rise": { + "desirous": 0.141, + "happy": 0.094, + "sleepy": 0.041 + } + }, + "realizing x4": { + "mood": "realizing", + "variant": null, + "dose": 4.0, + "n": 48, + "wer": 0.0037, + "collapse": 0.0, + "identity": 0.8495, + "durx": 0.917, + "clap_top": { + "calm": 0.292, + "desirous": 0.271, + "loud": 0.104 + }, + "e2v_top": { + "neutral": 0.583, + "happy": 0.375, + "angry": 0.021 + }, + "msp_top": { + "Happiness": 0.5, + "Neutral": 0.354, + "Anger": 0.083 + }, + "targets": { + "arousal": { + "base": 0.3669, + "value": 0.5779, + "delta": 0.211, + "ci": [ + 0.1858, + 0.236 + ], + "voices": 6 + }, + "valence": { + "base": 0.5144, + "value": 0.5377, + "delta": 0.0233, + "ci": [ + 0.0052, + 0.0405 + ], + "voices": 5 + }, + "dominance": { + "base": 0.4393, + "value": 0.61, + "delta": 0.1707, + "ci": [ + 0.1488, + 0.1928 + ], + "voices": 6 + } + }, + "clap_rise": { + "desirous": 0.158, + "happy": 0.091, + "fast": 0.048 + } + }, + "realizing x6": { + "mood": "realizing", + "variant": null, + "dose": 6.0, + "n": 48, + "wer": 0.0307, + "collapse": 0.0, + "identity": 0.7445, + "durx": 0.923, + "clap_top": { + "desirous": 0.333, + "happy": 0.229, + "calm": 0.146 + }, + "e2v_top": { + "happy": 0.542, + "neutral": 0.271, + "surprised": 0.125 + }, + "msp_top": { + "Happiness": 0.542, + "Neutral": 0.188, + "Anger": 0.167 + }, + "targets": { + "arousal": { + "base": 0.3669, + "value": 0.7055, + "delta": 0.3386, + "ci": [ + 0.3129, + 0.365 + ], + "voices": 6 + }, + "valence": { + "base": 0.5144, + "value": 0.5595, + "delta": 0.0451, + "ci": [ + 0.023, + 0.068 + ], + "voices": 5 + }, + "dominance": { + "base": 0.4393, + "value": 0.7097, + "delta": 0.2704, + "ci": [ + 0.2499, + 0.2933 + ], + "voices": 6 + } + }, + "clap_rise": { + "desirous": 0.227, + "happy": 0.213, + "sleepy": 0.037 + } + }, + "relieved x4": { + "mood": "relieved", + "variant": null, + "dose": 4.0, + "n": 48, + "wer": 0.0048, + "collapse": 0.0, + "identity": 0.9085, + "durx": 1.135, + "clap_top": { + "calm": 0.833, + "desirous": 0.042, + "whispered": 0.042 + }, + "e2v_top": { + "neutral": 0.729, + "sad": 0.104, + "happy": 0.104 + }, + "msp_top": { + "Neutral": 0.75, + "Sadness": 0.146, + "Happiness": 0.104 + }, + "targets": { + "clap": { + "base": 0.581, + "value": 0.6843, + "delta": 0.1033, + "ci": [ + 0.0415, + 0.1684 + ], + "voices": 5, + "specific": 0.3541 + }, + "clap@1": { + "base": 0.7708, + "value": 0.8333, + "delta": 0.0625, + "ci": [ + -0.0417, + 0.1667 + ], + "voices": 3, + "specific": 0.4298 + }, + "clap_rank": { + "base": 1.6042, + "value": 1.3125, + "delta": -0.2917, + "ci": [ + -0.5625, + -0.0417 + ], + "voices": 3, + "specific": -4.5823 + }, + "arousal": { + "base": 0.3669, + "value": 0.3339, + "delta": -0.033, + "ci": [ + -0.0464, + -0.0185 + ], + "voices": 6 + }, + "valence": { + "base": 0.5144, + "value": 0.4914, + "delta": -0.0231, + "ci": [ + -0.033, + -0.0128 + ], + "voices": 6 + }, + "dominance": { + "base": 0.4393, + "value": 0.4155, + "delta": -0.0238, + "ci": [ + -0.0364, + -0.0113 + ], + "voices": 5 + } + }, + "clap_rise": { + "calm": 0.103, + "awed": 0.009, + "saddened": 0.003 + } + }, + "relieved x6": { + "mood": "relieved", + "variant": null, + "dose": 6.0, + "n": 48, + "wer": 0.0137, + "collapse": 0.0, + "identity": 0.8705, + "durx": 1.158, + "clap_top": { + "calm": 0.875, + "desirous": 0.042, + "sympathetic": 0.042 + }, + "e2v_top": { + "neutral": 0.667, + "sad": 0.146, + "happy": 0.083 + }, + "msp_top": { + "Neutral": 0.854, + "Sadness": 0.083, + "Happiness": 0.062 + }, + "targets": { + "clap": { + "base": 0.581, + "value": 0.7221, + "delta": 0.1411, + "ci": [ + 0.0823, + 0.2018 + ], + "voices": 5, + "specific": 0.499 + }, + "clap@1": { + "base": 0.7708, + "value": 0.875, + "delta": 0.1042, + "ci": [ + 0.0, + 0.2292 + ], + "voices": 3, + "specific": 0.6108 + }, + "clap_rank": { + "base": 1.6042, + "value": 1.1875, + "delta": -0.4167, + "ci": [ + -0.7917, + -0.0828 + ], + "voices": 4, + "specific": -7.5318 + }, + "arousal": { + "base": 0.3669, + "value": 0.3277, + "delta": -0.0392, + "ci": [ + -0.0523, + -0.0266 + ], + "voices": 6 + }, + "valence": { + "base": 0.5144, + "value": 0.483, + "delta": -0.0314, + "ci": [ + -0.0421, + -0.0215 + ], + "voices": 6 + }, + "dominance": { + "base": 0.4393, + "value": 0.4131, + "delta": -0.0261, + "ci": [ + -0.0387, + -0.0141 + ], + "voices": 4 + } + }, + "clap_rise": { + "calm": 0.141, + "awed": 0.009, + "sleepy": 0.005 + } + }, + "serene x4": { + "mood": "serene", + "variant": null, + "dose": 4.0, + "n": 48, + "wer": 0.0079, + "collapse": 0.0, + "identity": 0.8811, + "durx": 1.425, + "clap_top": { + "calm": 0.896, + "whispered": 0.083, + "desirous": 0.021 + }, + "e2v_top": { + "neutral": 0.604, + "sad": 0.25, + "happy": 0.083 + }, + "msp_top": { + "Neutral": 0.812, + "Sadness": 0.188 + }, + "targets": { + "clap": { + "base": 0.581, + "value": 0.7994, + "delta": 0.2183, + "ci": [ + 0.1347, + 0.2974 + ], + "voices": 4, + "specific": 0.4751 + }, + "clap@1": { + "base": 0.7708, + "value": 0.8958, + "delta": 0.125, + "ci": [ + 0.0, + 0.2708 + ], + "voices": 3, + "specific": 0.4956 + }, + "clap_rank": { + "base": 1.6042, + "value": 1.125, + "delta": -0.4792, + "ci": [ + -0.875, + -0.1042 + ], + "voices": 4, + "specific": -4.7796 + }, + "arousal": { + "base": 0.3669, + "value": 0.2242, + "delta": -0.1427, + "ci": [ + -0.1623, + -0.1236 + ], + "voices": 6 + }, + "valence": { + "base": 0.5144, + "value": 0.469, + "delta": -0.0454, + "ci": [ + -0.0589, + -0.0305 + ], + "voices": 6 + }, + "dominance": { + "base": 0.4393, + "value": 0.3202, + "delta": -0.1191, + "ci": [ + -0.1342, + -0.104 + ], + "voices": 6 + } + }, + "clap_rise": { + "calm": 0.218, + "whispered": 0.005, + "scared": 0.0 + } + }, + "serene x6": { + "mood": "serene", + "variant": null, + "dose": 6.0, + "n": 48, + "wer": 0.0263, + "collapse": 0.0, + "identity": 0.8201, + "durx": 1.672, + "clap_top": { + "calm": 0.833, + "whispered": 0.104, + "sleepy": 0.062 + }, + "e2v_top": { + "neutral": 0.458, + "sad": 0.333, + "happy": 0.104 + }, + "msp_top": { + "Neutral": 0.688, + "Sadness": 0.312 + }, + "targets": { + "clap": { + "base": 0.581, + "value": 0.7049, + "delta": 0.1239, + "ci": [ + 0.0419, + 0.2128 + ], + "voices": 4, + "specific": 0.4808 + }, + "clap@1": { + "base": 0.7708, + "value": 0.8333, + "delta": 0.0625, + "ci": [ + -0.0833, + 0.1875 + ], + "voices": 3, + "specific": 0.5669 + }, + "clap_rank": { + "base": 1.6042, + "value": 1.25, + "delta": -0.3542, + "ci": [ + -0.7297, + 0.0208 + ], + "voices": 4, + "specific": -7.466 + }, + "arousal": { + "base": 0.3669, + "value": 0.1723, + "delta": -0.1946, + "ci": [ + -0.2205, + -0.1705 + ], + "voices": 6 + }, + "valence": { + "base": 0.5144, + "value": 0.4326, + "delta": -0.0819, + "ci": [ + -0.1019, + -0.0631 + ], + "voices": 6 + }, + "dominance": { + "base": 0.4393, + "value": 0.2633, + "delta": -0.176, + "ci": [ + -0.1969, + -0.1566 + ], + "voices": 6 + } + }, + "clap_rise": { + "calm": 0.124, + "sleepy": 0.062, + "whispered": 0.012 + } + }, + "scared x8": { + "mood": "scared", + "variant": null, + "dose": 8.0, + "n": 48, + "wer": 0.0229, + "collapse": 0.0, + "identity": 0.7823, + "durx": 1.14, + "clap_top": { + "calm": 0.396, + "desirous": 0.354, + "sleepy": 0.104 + }, + "e2v_top": { + "happy": 0.458, + "neutral": 0.333, + "surprised": 0.083 + }, + "msp_top": { + "Happiness": 0.375, + "Neutral": 0.292, + "Surprise": 0.188 + }, + "targets": { + "e2v": { + "base": 0.0001, + "value": 0.0635, + "delta": 0.0633, + "ci": [ + 0.0158, + 0.1232 + ], + "voices": 6 + }, + "e2v@1": { + "base": 0.0, + "value": 0.0625, + "delta": 0.0625, + "ci": [ + 0.0, + 0.1458 + ], + "voices": 3 + }, + "clap": { + "base": 0.0001, + "value": 0.002, + "delta": 0.0019, + "ci": [ + 0.0008, + 0.0033 + ], + "voices": 5 + }, + "clap@1": { + "base": 0.0, + "value": 0.0, + "delta": 0.0, + "ci": [ + 0.0, + 0.0 + ], + "voices": 0 + }, + "clap_rank": { + "base": 19.2708, + "value": 17.5208, + "delta": -1.75, + "ci": [ + -2.7089, + -0.8125 + ], + "voices": 5 + }, + "msp@1": { + "base": 0.0, + "value": 0.0417, + "delta": 0.0417, + "ci": [ + 0.0, + 0.1042 + ], + "voices": 2 + }, + "arousal": { + "base": 0.3669, + "value": 0.5224, + "delta": 0.1555, + "ci": [ + 0.1346, + 0.1769 + ], + "voices": 6 + }, + "valence": { + "base": 0.5144, + "value": 0.5129, + "delta": -0.0016, + "ci": [ + -0.0185, + 0.0154 + ], + "voices": 5 + }, + "dominance": { + "base": 0.4393, + "value": 0.5598, + "delta": 0.1206, + "ci": [ + 0.1035, + 0.1366 + ], + "voices": 6 + } + }, + "clap_rise": { + "desirous": 0.149, + "sleepy": 0.072, + "happy": 0.045 + } + }, + "scared x12": { + "mood": "scared", + "variant": null, + "dose": 12.0, + "n": 48, + "wer": 0.0847, + "collapse": 0.0833, + "identity": 0.6614, + "durx": 1.286, + "clap_top": { + "desirous": 0.375, + "calm": 0.167, + "sleepy": 0.125 + }, + "e2v_top": { + "surprised": 0.292, + "happy": 0.271, + "fearful": 0.188 + }, + "msp_top": { + "Surprise": 0.333, + "Happiness": 0.229, + "Fear": 0.167 + }, + "targets": { + "e2v": { + "base": 0.0001, + "value": 0.206, + "delta": 0.2059, + "ci": [ + 0.1089, + 0.3111 + ], + "voices": 6 + }, + "e2v@1": { + "base": 0.0, + "value": 0.1875, + "delta": 0.1875, + "ci": [ + 0.0833, + 0.3125 + ], + "voices": 3 + }, + "clap": { + "base": 0.0001, + "value": 0.0216, + "delta": 0.0215, + "ci": [ + 0.0048, + 0.0505 + ], + "voices": 6 + }, + "clap@1": { + "base": 0.0, + "value": 0.0208, + "delta": 0.0208, + "ci": [ + 0.0, + 0.0625 + ], + "voices": 1 + }, + "clap_rank": { + "base": 19.2708, + "value": 14.7917, + "delta": -4.4792, + "ci": [ + -6.0422, + -3.1036 + ], + "voices": 6 + }, + "msp@1": { + "base": 0.0, + "value": 0.1667, + "delta": 0.1667, + "ci": [ + 0.0625, + 0.2708 + ], + "voices": 4 + }, + "arousal": { + "base": 0.3669, + "value": 0.5549, + "delta": 0.188, + "ci": [ + 0.1579, + 0.2169 + ], + "voices": 6 + }, + "valence": { + "base": 0.5144, + "value": 0.464, + "delta": -0.0505, + "ci": [ + -0.069, + -0.0328 + ], + "voices": 6 + }, + "dominance": { + "base": 0.4393, + "value": 0.573, + "delta": 0.1337, + "ci": [ + 0.1097, + 0.1583 + ], + "voices": 6 + } + }, + "clap_rise": { + "desirous": 0.208, + "sleepy": 0.09, + "happy": 0.085 + } + }, + "confused x2": { + "mood": "confused", + "variant": null, + "dose": 2.0, + "n": 48, + "wer": 0.0148, + "collapse": 0.0, + "identity": 0.894, + "durx": 1.384, + "clap_top": { + "calm": 0.625, + "desirous": 0.208, + "sleepy": 0.062 + }, + "e2v_top": { + "neutral": 0.604, + "happy": 0.375, + "sad": 0.021 + }, + "msp_top": { + "Neutral": 0.708, + "Happiness": 0.188, + "Contempt": 0.062 + }, + "targets": { + "clap": { + "base": 0.0002, + "value": 0.0078, + "delta": 0.0075, + "ci": [ + 0.0028, + 0.0137 + ], + "voices": 6 + }, + "clap@1": { + "base": 0.0, + "value": 0.0, + "delta": 0.0, + "ci": [ + 0.0, + 0.0 + ], + "voices": 0 + }, + "clap_rank": { + "base": 19.125, + "value": 13.4792, + "delta": -5.6458, + "ci": [ + -6.875, + -4.5625 + ], + "voices": 6 + }, + "arousal": { + "base": 0.3669, + "value": 0.3823, + "delta": 0.0154, + "ci": [ + -0.0048, + 0.0347 + ], + "voices": 5 + }, + "valence": { + "base": 0.5144, + "value": 0.5001, + "delta": -0.0143, + "ci": [ + -0.0304, + 0.0027 + ], + "voices": 4 + }, + "dominance": { + "base": 0.4393, + "value": 0.4625, + "delta": 0.0232, + "ci": [ + 0.0064, + 0.0415 + ], + "voices": 5 + } + }, + "clap_rise": { + "desirous": 0.06, + "sleepy": 0.045, + "enthusiastic": 0.03 + } + }, + "confused x3": { + "mood": "confused", + "variant": null, + "dose": 3.0, + "n": 48, + "wer": 0.0817, + "collapse": 0.0, + "identity": 0.8228, + "durx": 1.813, + "clap_top": { + "calm": 0.292, + "desirous": 0.208, + "sleepy": 0.188 + }, + "e2v_top": { + "happy": 0.521, + "neutral": 0.292, + "sad": 0.083 + }, + "msp_top": { + "Neutral": 0.646, + "Happiness": 0.312, + "Surprise": 0.021 + }, + "targets": { + "clap": { + "base": 0.0002, + "value": 0.0392, + "delta": 0.039, + "ci": [ + 0.0216, + 0.0615 + ], + "voices": 6 + }, + "clap@1": { + "base": 0.0, + "value": 0.0833, + "delta": 0.0833, + "ci": [ + 0.0208, + 0.1667 + ], + "voices": 1 + }, + "clap_rank": { + "base": 19.125, + "value": 9.1042, + "delta": -10.0208, + "ci": [ + -11.3542, + -8.6458 + ], + "voices": 6 + }, + "arousal": { + "base": 0.3669, + "value": 0.4182, + "delta": 0.0513, + "ci": [ + 0.0228, + 0.0797 + ], + "voices": 5 + }, + "valence": { + "base": 0.5144, + "value": 0.5138, + "delta": -0.0006, + "ci": [ + -0.0218, + 0.0204 + ], + "voices": 4 + }, + "dominance": { + "base": 0.4393, + "value": 0.482, + "delta": 0.0427, + "ci": [ + 0.0203, + 0.0645 + ], + "voices": 5 + } + }, + "clap_rise": { + "sleepy": 0.159, + "desirous": 0.086, + "happy": 0.068 + } + } + } + }, + "served_editfit": { + "dirs": [ + "tmp/steer/moods/served_editfit" + ], + "neutral": { + "wer": 0.0017, + "identity": 0.9448, + "arousal": 0.3686, + "valence": 0.5301, + "dominance": 0.4365, + "collapse": 0.0 + }, + "conditions": { + "angry x6": { + "mood": "angry", + "variant": null, + "dose": 6.0, + "n": 48, + "wer": 0.2304, + "collapse": 0.125, + "identity": 0.5289, + "durx": 0.944, + "clap_top": { + "sleepy": 0.583, + "scared": 0.229, + "happy": 0.062 + }, + "e2v_top": { + "happy": 0.688, + "angry": 0.146, + "unknown": 0.062 + }, + "msp_top": { + "Happiness": 0.604, + "Anger": 0.271, + "Surprise": 0.062 + }, + "targets": { + "e2v": { + "base": 0.0035, + "value": 0.1344, + "delta": 0.1309, + "ci": [ + 0.0681, + 0.2078 + ], + "voices": 6, + "specific": 0.1321 + }, + "e2v@1": { + "base": 0.0, + "value": 0.1458, + "delta": 0.1458, + "ci": [ + 0.0625, + 0.25 + ], + "voices": 3, + "specific": 0.1458 + }, + "clap": { + "base": 0.0014, + "value": 0.0125, + "delta": 0.0111, + "ci": [ + 0.0045, + 0.02 + ], + "voices": 6, + "specific": 0.0109 + }, + "clap@1": { + "base": 0.0, + "value": 0.0, + "delta": 0.0, + "ci": [ + 0.0, + 0.0 + ], + "voices": 0, + "specific": -0.0026 + }, + "clap_rank": { + "base": 14.0833, + "value": 16.125, + "delta": 2.0417, + "ci": [ + 0.4583, + 3.5625 + ], + "voices": 4, + "specific": -1.4166 + }, + "msp@1": { + "base": 0.0, + "value": 0.2708, + "delta": 0.2708, + "ci": [ + 0.1458, + 0.3964 + ], + "voices": 3, + "specific": 0.263 + }, + "arousal": { + "base": 0.3686, + "value": 0.846, + "delta": 0.4774, + "ci": [ + 0.452, + 0.5006 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.5739, + "delta": 0.0437, + "ci": [ + 0.0115, + 0.075 + ], + "voices": 5 + }, + "dominance": { + "base": 0.4365, + "value": 0.8274, + "delta": 0.3908, + "ci": [ + 0.3705, + 0.411 + ], + "voices": 6 + } + }, + "clap_rise": { + "sleepy": 0.424, + "scared": 0.131, + "happy": 0.069 + } + }, + "happy x6": { + "mood": "happy", + "variant": null, + "dose": 6.0, + "n": 48, + "wer": 0.2209, + "collapse": 0.1042, + "identity": 0.6468, + "durx": 1.097, + "clap_top": { + "happy": 0.417, + "sleepy": 0.292, + "desirous": 0.125 + }, + "e2v_top": { + "happy": 0.875, + "unknown": 0.083, + "neutral": 0.021 + }, + "msp_top": { + "Happiness": 0.896, + "Surprise": 0.042, + "Fear": 0.021 + }, + "targets": { + "e2v": { + "base": 0.1835, + "value": 0.8638, + "delta": 0.6803, + "ci": [ + 0.5483, + 0.8004 + ], + "voices": 6, + "specific": 0.5268 + }, + "e2v@1": { + "base": 0.2083, + "value": 0.875, + "delta": 0.6667, + "ci": [ + 0.5208, + 0.8125 + ], + "voices": 6, + "specific": 0.5287 + }, + "clap": { + "base": 0.0107, + "value": 0.2787, + "delta": 0.268, + "ci": [ + 0.1985, + 0.3401 + ], + "voices": 6, + "specific": 0.1848 + }, + "clap@1": { + "base": 0.0, + "value": 0.4167, + "delta": 0.4167, + "ci": [ + 0.2917, + 0.5625 + ], + "voices": 5, + "specific": 0.3282 + }, + "clap_rank": { + "base": 10.2708, + "value": 3.1458, + "delta": -7.125, + "ci": [ + -8.25, + -6.0417 + ], + "voices": 6, + "specific": -4.9219 + }, + "msp@1": { + "base": 0.1458, + "value": 0.8958, + "delta": 0.75, + "ci": [ + 0.625, + 0.875 + ], + "voices": 6, + "specific": 0.5807 + }, + "arousal": { + "base": 0.3686, + "value": 0.7471, + "delta": 0.3786, + "ci": [ + 0.352, + 0.4043 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.6772, + "delta": 0.1471, + "ci": [ + 0.1194, + 0.1716 + ], + "voices": 6 + }, + "dominance": { + "base": 0.4365, + "value": 0.7358, + "delta": 0.2992, + "ci": [ + 0.2755, + 0.3203 + ], + "voices": 6 + } + }, + "clap_rise": { + "sleepy": 0.298, + "happy": 0.265, + "desirous": 0.126 + } + }, + "sad x6": { + "mood": "sad", + "variant": null, + "dose": 6.0, + "n": 48, + "wer": 0.0132, + "collapse": 0.0, + "identity": 0.8852, + "durx": 1.117, + "clap_top": { + "calm": 0.917, + "whispered": 0.083 + }, + "e2v_top": { + "neutral": 0.875, + "happy": 0.042, + "disgusted": 0.042 + }, + "msp_top": { + "Neutral": 0.833, + "Sadness": 0.167 + }, + "targets": { + "e2v": { + "base": 0.0075, + "value": 0.0508, + "delta": 0.0433, + "ci": [ + 0.0015, + 0.095 + ], + "voices": 6, + "specific": -0.0135 + }, + "e2v@1": { + "base": 0.0, + "value": 0.0417, + "delta": 0.0417, + "ci": [ + 0.0, + 0.1042 + ], + "voices": 1, + "specific": -0.0208 + }, + "clap": { + "base": 0.0035, + "value": 0.0042, + "delta": 0.0007, + "ci": [ + -0.0012, + 0.0026 + ], + "voices": 4, + "specific": -0.0089 + }, + "clap@1": { + "base": 0.0, + "value": 0.0, + "delta": 0.0, + "ci": [ + 0.0, + 0.0 + ], + "voices": 0, + "specific": 0.0 + }, + "clap_rank": { + "base": 11.1458, + "value": 7.5, + "delta": -3.6458, + "ci": [ + -4.5625, + -2.7917 + ], + "voices": 6, + "specific": -2.5937 + }, + "msp@1": { + "base": 0.0208, + "value": 0.1667, + "delta": 0.1458, + "ci": [ + 0.0625, + 0.25 + ], + "voices": 4, + "specific": 0.0885 + }, + "arousal": { + "base": 0.3686, + "value": 0.2594, + "delta": -0.1092, + "ci": [ + -0.1258, + -0.0933 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.4808, + "delta": -0.0494, + "ci": [ + -0.0623, + -0.0365 + ], + "voices": 6 + }, + "dominance": { + "base": 0.4365, + "value": 0.3399, + "delta": -0.0966, + "ci": [ + -0.1112, + -0.0821 + ], + "voices": 6 + } + }, + "clap_rise": { + "calm": 0.234, + "saddened": 0.001, + "scared": 0.0 + } + }, + "fearful x6": { + "mood": "fearful", + "variant": null, + "dose": 6.0, + "n": 48, + "wer": 0.1484, + "collapse": 0.0625, + "identity": 0.6584, + "durx": 1.144, + "clap_top": { + "happy": 0.271, + "sleepy": 0.25, + "desirous": 0.25 + }, + "e2v_top": { + "happy": 0.688, + "surprised": 0.167, + "unknown": 0.062 + }, + "msp_top": { + "Happiness": 0.688, + "Surprise": 0.167, + "Anger": 0.062 + }, + "targets": { + "e2v": { + "base": 0.0001, + "value": 0.0309, + "delta": 0.0307, + "ci": [ + 0.0035, + 0.07 + ], + "voices": 6, + "specific": 0.0278 + }, + "e2v@1": { + "base": 0.0, + "value": 0.0208, + "delta": 0.0208, + "ci": [ + 0.0, + 0.0625 + ], + "voices": 1, + "specific": 0.0182 + }, + "clap": { + "base": 0.0001, + "value": 0.0319, + "delta": 0.0318, + "ci": [ + 0.0135, + 0.0574 + ], + "voices": 6, + "specific": 0.0115 + }, + "clap@1": { + "base": 0.0, + "value": 0.0208, + "delta": 0.0208, + "ci": [ + 0.0, + 0.0625 + ], + "voices": 1, + "specific": -0.0105 + }, + "clap_rank": { + "base": 18.625, + "value": 9.3333, + "delta": -9.2917, + "ci": [ + -10.5833, + -7.8333 + ], + "voices": 6, + "specific": -5.3698 + }, + "msp@1": { + "base": 0.0, + "value": 0.0208, + "delta": 0.0208, + "ci": [ + 0.0, + 0.0625 + ], + "voices": 1, + "specific": 0.0104 + }, + "arousal": { + "base": 0.3686, + "value": 0.7191, + "delta": 0.3505, + "ci": [ + 0.3266, + 0.3766 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.6113, + "delta": 0.0812, + "ci": [ + 0.0548, + 0.1084 + ], + "voices": 5 + }, + "dominance": { + "base": 0.4365, + "value": 0.7108, + "delta": 0.2743, + "ci": [ + 0.2547, + 0.2951 + ], + "voices": 6 + } + }, + "clap_rise": { + "happy": 0.245, + "desirous": 0.179, + "sleepy": 0.175 + } + }, + "surprised x6": { + "mood": "surprised", + "variant": null, + "dose": 6.0, + "n": 48, + "wer": 0.0952, + "collapse": 0.0625, + "identity": 0.7607, + "durx": 1.179, + "clap_top": { + "happy": 0.292, + "desirous": 0.188, + "sleepy": 0.167 + }, + "e2v_top": { + "happy": 0.646, + "neutral": 0.312, + "unknown": 0.042 + }, + "msp_top": { + "Happiness": 0.667, + "Neutral": 0.188, + "Surprise": 0.083 + }, + "targets": { + "e2v": { + "base": 0.0, + "value": 0.0046, + "delta": 0.0046, + "ci": [ + 0.0, + 0.0112 + ], + "voices": 6, + "specific": -0.0244 + }, + "e2v@1": { + "base": 0.0, + "value": 0.0, + "delta": 0.0, + "ci": [ + 0.0, + 0.0 + ], + "voices": 0, + "specific": -0.0234 + }, + "clap": { + "base": 0.0205, + "value": 0.0448, + "delta": 0.0243, + "ci": [ + 0.0038, + 0.0472 + ], + "voices": 5, + "specific": 0.0019 + }, + "clap@1": { + "base": 0.0, + "value": 0.0, + "delta": 0.0, + "ci": [ + 0.0, + 0.0 + ], + "voices": 0, + "specific": -0.0286 + }, + "clap_rank": { + "base": 8.375, + "value": 6.2292, + "delta": -2.1458, + "ci": [ + -3.4792, + -0.7917 + ], + "voices": 4, + "specific": -0.9817 + }, + "msp@1": { + "base": 0.0, + "value": 0.0833, + "delta": 0.0833, + "ci": [ + 0.0208, + 0.1667 + ], + "voices": 4, + "specific": 0.0468 + }, + "arousal": { + "base": 0.3686, + "value": 0.677, + "delta": 0.3084, + "ci": [ + 0.2806, + 0.3352 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.6068, + "delta": 0.0767, + "ci": [ + 0.0514, + 0.1027 + ], + "voices": 5 + }, + "dominance": { + "base": 0.4365, + "value": 0.696, + "delta": 0.2595, + "ci": [ + 0.2369, + 0.282 + ], + "voices": 6 + } + }, + "clap_rise": { + "happy": 0.224, + "desirous": 0.153, + "sleepy": 0.137 + } + }, + "serene x6": { + "mood": "serene", + "variant": null, + "dose": 6.0, + "n": 48, + "wer": 0.0654, + "collapse": 0.0417, + "identity": 0.8585, + "durx": 1.847, + "clap_top": { + "calm": 0.812, + "sleepy": 0.104, + "whispered": 0.062 + }, + "e2v_top": { + "neutral": 0.521, + "sad": 0.208, + "happy": 0.125 + }, + "msp_top": { + "Neutral": 0.646, + "Sadness": 0.333, + "Happiness": 0.021 + }, + "targets": { + "clap": { + "base": 0.5825, + "value": 0.657, + "delta": 0.0745, + "ci": [ + 0.0009, + 0.1481 + ], + "voices": 4, + "specific": 0.3607 + }, + "clap@1": { + "base": 0.7708, + "value": 0.8125, + "delta": 0.0417, + "ci": [ + -0.1042, + 0.1875 + ], + "voices": 3, + "specific": 0.461 + }, + "clap_rank": { + "base": 1.4167, + "value": 1.2708, + "delta": -0.1458, + "ci": [ + -0.4375, + 0.1458 + ], + "voices": 3, + "specific": -6.0859 + }, + "arousal": { + "base": 0.3686, + "value": 0.1764, + "delta": -0.1922, + "ci": [ + -0.2181, + -0.1667 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.433, + "delta": -0.0972, + "ci": [ + -0.1129, + -0.0811 + ], + "voices": 6 + }, + "dominance": { + "base": 0.4365, + "value": 0.2641, + "delta": -0.1724, + "ci": [ + -0.1942, + -0.1505 + ], + "voices": 6 + } + }, + "clap_rise": { + "sleepy": 0.094, + "calm": 0.075, + "saddened": 0.019 + } + }, + "relieved x6": { + "mood": "relieved", + "variant": null, + "dose": 6.0, + "n": 48, + "wer": 0.0152, + "collapse": 0.0208, + "identity": 0.8991, + "durx": 1.121, + "clap_top": { + "calm": 0.854, + "desirous": 0.083, + "sympathetic": 0.042 + }, + "e2v_top": { + "neutral": 0.854, + "happy": 0.083, + "sad": 0.042 + }, + "msp_top": { + "Neutral": 0.771, + "Sadness": 0.146, + "Happiness": 0.062 + }, + "targets": { + "clap": { + "base": 0.5825, + "value": 0.7027, + "delta": 0.1202, + "ci": [ + 0.0394, + 0.1978 + ], + "voices": 5, + "specific": 0.4121 + }, + "clap@1": { + "base": 0.7708, + "value": 0.8542, + "delta": 0.0833, + "ci": [ + -0.0833, + 0.2292 + ], + "voices": 1, + "specific": 0.5078 + }, + "clap_rank": { + "base": 1.4167, + "value": 1.1875, + "delta": -0.2292, + "ci": [ + -0.5417, + 0.0422 + ], + "voices": 1, + "specific": -6.1797 + }, + "arousal": { + "base": 0.3686, + "value": 0.3526, + "delta": -0.0159, + "ci": [ + -0.0324, + -0.0008 + ], + "voices": 5 + }, + "valence": { + "base": 0.5301, + "value": 0.4904, + "delta": -0.0397, + "ci": [ + -0.0511, + -0.0285 + ], + "voices": 6 + }, + "dominance": { + "base": 0.4365, + "value": 0.4301, + "delta": -0.0064, + "ci": [ + -0.0198, + 0.008 + ], + "voices": 5 + } + }, + "clap_rise": { + "calm": 0.12, + "sympathetic": 0.034, + "awed": 0.015 + } + }, + "desirous x6": { + "mood": "desirous", + "variant": null, + "dose": 6.0, + "n": 48, + "wer": 0.1196, + "collapse": 0.0833, + "identity": 0.8674, + "durx": 2.453, + "clap_top": { + "calm": 0.458, + "sleepy": 0.312, + "desirous": 0.125 + }, + "e2v_top": { + "neutral": 0.354, + "disgusted": 0.292, + "happy": 0.188 + }, + "msp_top": { + "Neutral": 0.938, + "Happiness": 0.021, + "Contempt": 0.021 + }, + "targets": { + "clap": { + "base": 0.0498, + "value": 0.0869, + "delta": 0.0371, + "ci": [ + 0.0104, + 0.0672 + ], + "voices": 5, + "specific": -0.0288 + }, + "clap@1": { + "base": 0.0625, + "value": 0.125, + "delta": 0.0625, + "ci": [ + -0.0417, + 0.1667 + ], + "voices": 1, + "specific": 0.0104 + }, + "clap_rank": { + "base": 7.5, + "value": 6.5, + "delta": -1.0, + "ci": [ + -2.1458, + 0.1672 + ], + "voices": 4, + "specific": 0.2266 + }, + "arousal": { + "base": 0.3686, + "value": 0.3344, + "delta": -0.0342, + "ci": [ + -0.0636, + -0.0064 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.4798, + "delta": -0.0503, + "ci": [ + -0.0699, + -0.0308 + ], + "voices": 6 + }, + "dominance": { + "base": 0.4365, + "value": 0.4116, + "delta": -0.0249, + "ci": [ + -0.0525, + 0.001 + ], + "voices": 6 + } + }, + "clap_rise": { + "sleepy": 0.203, + "awed": 0.089, + "desirous": 0.037 + } + }, + "pained x6": { + "mood": "pained", + "variant": null, + "dose": 6.0, + "n": 48, + "wer": 0.0761, + "collapse": 0.0208, + "identity": 0.8276, + "durx": 1.537, + "clap_top": { + "calm": 0.354, + "sleepy": 0.271, + "desirous": 0.208 + }, + "e2v_top": { + "neutral": 0.438, + "happy": 0.312, + "unknown": 0.104 + }, + "msp_top": { + "Happiness": 0.458, + "Neutral": 0.312, + "Sadness": 0.083 + }, + "targets": { + "clap": { + "base": 0.0003, + "value": 0.0056, + "delta": 0.0052, + "ci": [ + 0.0031, + 0.0078 + ], + "voices": 6, + "specific": 0.001 + }, + "clap@1": { + "base": 0.0, + "value": 0.0, + "delta": 0.0, + "ci": [ + 0.0, + 0.0 + ], + "voices": 0, + "specific": 0.0 + }, + "clap_rank": { + "base": 16.7083, + "value": 13.9583, + "delta": -2.75, + "ci": [ + -3.8755, + -1.7292 + ], + "voices": 4, + "specific": -0.7474 + }, + "arousal": { + "base": 0.3686, + "value": 0.491, + "delta": 0.1224, + "ci": [ + 0.0984, + 0.1485 + ], + "voices": 6 + }, + "valence": { + "base": 0.5301, + "value": 0.5164, + "delta": -0.0137, + "ci": [ + -0.031, + 0.0035 + ], + "voices": 3 + }, + "dominance": { + "base": 0.4365, + "value": 0.5535, + "delta": 0.1169, + "ci": [ + 0.0955, + 0.1389 + ], + "voices": 6 + } + }, + "clap_rise": { + "sleepy": 0.149, + "desirous": 0.1, + "happy": 0.085 + } + } + } + } + } +} diff --git a/steering/ears_moods_mect60k/fearful.npy b/steering/ears_moods_mect60k/fearful.npy new file mode 100644 index 0000000000000000000000000000000000000000..6b34567b9cbec9f62f6326474cf0ec0d31764bf4 --- /dev/null +++ b/steering/ears_moods_mect60k/fearful.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8ebc224df22867238bfe537f940740236659efdbb2742ee89caa4f5b4d37111b +size 4224 diff --git a/steering/ears_moods_mect60k/guilty.npy b/steering/ears_moods_mect60k/guilty.npy new file mode 100644 index 0000000000000000000000000000000000000000..8d6c71aff5d22075f0ebf155f5a8bdcd7d177f7c --- /dev/null +++ b/steering/ears_moods_mect60k/guilty.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0af8d48646da0925329f8a81d0adca1d50bac67b5bed5cbd2c3d4ddc9100a3f1 +size 4224 diff --git a/steering/ears_moods_mect60k/happy.npy b/steering/ears_moods_mect60k/happy.npy new file mode 100644 index 0000000000000000000000000000000000000000..4e0e39c0d0f3842f915f704be1745a74e47e2502 --- /dev/null +++ b/steering/ears_moods_mect60k/happy.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c7fb009a9a56dd8670d071d7ee99f1e1739418ab6c7e9754e8023cf752812d5b +size 4224 diff --git a/steering/ears_moods_mect60k/interested.npy b/steering/ears_moods_mect60k/interested.npy new file mode 100644 index 0000000000000000000000000000000000000000..28689b0085831bd30ad5489169b8f26132b2be4b --- /dev/null +++ b/steering/ears_moods_mect60k/interested.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d6c7af89bdeec2d50c07c686c0d72214ec4c3d9d8106572c7cf34031440181c1 +size 4224 diff --git a/steering/ears_moods_mect60k/manifest.json b/steering/ears_moods_mect60k/manifest.json new file mode 100644 index 0000000000000000000000000000000000000000..f9ed357a4c88711bd43df113c40d0dbb618d3b94 --- /dev/null +++ b/steering/ears_moods_mect60k/manifest.json @@ -0,0 +1,455 @@ +{ + "dim": 1024, + "space": "attnres_source", + "checkpoint": "/data/groups/audio/gabriel/hf_release_zonos3mini_20261020/lm/mect_60k", + "corpus": "/data/groups/audio/sofian/runs/steer_corpora/ears_emotions/clips.json", + "spec": { + "space": "attnres_source", + "group_by": "clip", + "center": "speaker", + "directions": { + "angry": { + "pairs": [ + [ + { + "style": "anger" + }, + { + "style": "neutral" + } + ] + ], + "kind": "named" + }, + "sad": { + "pairs": [ + [ + { + "style": "sadness" + }, + { + "style": "neutral" + } + ] + ], + "kind": "named" + }, + "happy": { + "pairs": [ + [ + { + "style": "amusement" + }, + { + "style": "neutral" + } + ] + ], + "kind": "named" + }, + "fearful": { + "pairs": [ + [ + { + "style": "fear" + }, + { + "style": "neutral" + } + ] + ], + "kind": "named" + }, + "disgusted": { + "pairs": [ + [ + { + "style": "disgust" + }, + { + "style": "neutral" + } + ] + ], + "kind": "named" + }, + "surprised": { + "pairs": [ + [ + { + "style": "amazement" + }, + { + "style": "neutral" + } + ] + ], + "kind": "named" + }, + "adoring": { + "pairs": [ + [ + { + "style": "adoration" + }, + { + "style": "neutral" + } + ] + ], + "kind": "named" + }, + "confused": { + "pairs": [ + [ + { + "style": "confusion" + }, + { + "style": "neutral" + } + ] + ], + "kind": "named" + }, + "content": { + "pairs": [ + [ + { + "style": "contentment" + }, + { + "style": "neutral" + } + ] + ], + "kind": "named" + }, + "cute": { + "pairs": [ + [ + { + "style": "cuteness" + }, + { + "style": "neutral" + } + ] + ], + "kind": "named" + }, + "desirous": { + "pairs": [ + [ + { + "style": "desire" + }, + { + "style": "neutral" + } + ] + ], + "kind": "named" + }, + "disappointed": { + "pairs": [ + [ + { + "style": "disappointment" + }, + { + "style": "neutral" + } + ] + ], + "kind": "named" + }, + "distressed": { + "pairs": [ + [ + { + "style": "distress" + }, + { + "style": "neutral" + } + ] + ], + "kind": "named" + }, + "embarrassed": { + "pairs": [ + [ + { + "style": "embarassment" + }, + { + "style": "neutral" + } + ] + ], + "kind": "named" + }, + "ecstatic": { + "pairs": [ + [ + { + "style": "extasy" + }, + { + "style": "neutral" + } + ] + ], + "kind": "named" + }, + "guilty": { + "pairs": [ + [ + { + "style": "guilt" + }, + { + "style": "neutral" + } + ] + ], + "kind": "named" + }, + "interested": { + "pairs": [ + [ + { + "style": "interest" + }, + { + "style": "neutral" + } + ] + ], + "kind": "named" + }, + "pained": { + "pairs": [ + [ + { + "style": "pain" + }, + { + "style": "neutral" + } + ] + ], + "kind": "named" + }, + "proud": { + "pairs": [ + [ + { + "style": "pride" + }, + { + "style": "neutral" + } + ] + ], + "kind": "named" + }, + "realizing": { + "pairs": [ + [ + { + "style": "realization" + }, + { + "style": "neutral" + } + ] + ], + "kind": "named" + }, + "relieved": { + "pairs": [ + [ + { + "style": "relief" + }, + { + "style": "neutral" + } + ] + ], + "kind": "named" + }, + "serene": { + "pairs": [ + [ + { + "style": "serenity" + }, + { + "style": "neutral" + } + ] + ], + "kind": "named" + }, + "scared": { + "pairs": [ + [ + { + "style": "fear" + }, + { + "style": [ + "anger", + "sadness", + "amusement", + "disgust", + "amazement", + "adoration", + "confusion", + "contentment", + "cuteness", + "desire", + "disappointment", + "distress", + "embarassment", + "extasy", + "guilt", + "interest", + "pain", + "pride", + "realization", + "relief", + "serenity" + ] + } + ] + ], + "kind": "named" + } + }, + "source_index": 19 + }, + "directions": { + "angry": { + "file": "angry.npy", + "kind": "named", + "norm": 0.024435275369628806 + }, + "sad": { + "file": "sad.npy", + "kind": "named", + "norm": 0.01633910478720501 + }, + "happy": { + "file": "happy.npy", + "kind": "named", + "norm": 0.01910547416830079 + }, + "fearful": { + "file": "fearful.npy", + "kind": "named", + "norm": 0.02055408798565512 + }, + "disgusted": { + "file": "disgusted.npy", + "kind": "named", + "norm": 0.020196482824966278 + }, + "surprised": { + "file": "surprised.npy", + "kind": "named", + "norm": 0.019633100615820298 + }, + "adoring": { + "file": "adoring.npy", + "kind": "named", + "norm": 0.016284889328201296 + }, + "confused": { + "file": "confused.npy", + "kind": "named", + "norm": 0.026082286900063353 + }, + "content": { + "file": "content.npy", + "kind": "named", + "norm": 0.013912039359480644 + }, + "cute": { + "file": "cute.npy", + "kind": "named", + "norm": 0.027364304670973127 + }, + "desirous": { + "file": "desirous.npy", + "kind": "named", + "norm": 0.017848278287119154 + }, + "disappointed": { + "file": "disappointed.npy", + "kind": "named", + "norm": 0.016322801521609327 + }, + "distressed": { + "file": "distressed.npy", + "kind": "named", + "norm": 0.018937708805635837 + }, + "embarrassed": { + "file": "embarrassed.npy", + "kind": "named", + "norm": 0.018894311337840627 + }, + "ecstatic": { + "file": "ecstatic.npy", + "kind": "named", + "norm": 0.025073490177977806 + }, + "guilty": { + "file": "guilty.npy", + "kind": "named", + "norm": 0.015239547474610779 + }, + "interested": { + "file": "interested.npy", + "kind": "named", + "norm": 0.019086483178770566 + }, + "pained": { + "file": "pained.npy", + "kind": "named", + "norm": 0.02070991877178616 + }, + "proud": { + "file": "proud.npy", + "kind": "named", + "norm": 0.01662208879133351 + }, + "realizing": { + "file": "realizing.npy", + "kind": "named", + "norm": 0.016936622637553696 + }, + "relieved": { + "file": "relieved.npy", + "kind": "named", + "norm": 0.01731547693539987 + }, + "serene": { + "file": "serene.npy", + "kind": "named", + "norm": 0.015665733708158797 + }, + "scared": { + "file": "scared.npy", + "kind": "named", + "norm": 0.012197559309144927 + } + }, + "source_index": 19, + "source_name": "L9.attn", + "prompt_conditioning": "speaker_row=no,condition_rows=3:unknown" +} diff --git a/steering/ears_moods_mect60k/pained.npy b/steering/ears_moods_mect60k/pained.npy new file mode 100644 index 0000000000000000000000000000000000000000..e973f7ae325babdc2a2b1fb07c36152b953b2ddd --- /dev/null +++ b/steering/ears_moods_mect60k/pained.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:df54d5eed33f31d4ca303771d32c73728673ebefeb081f4830860c2e215b3a6e +size 4224 diff --git a/steering/ears_moods_mect60k/proud.npy b/steering/ears_moods_mect60k/proud.npy new file mode 100644 index 0000000000000000000000000000000000000000..03bf7a73317e0b86c3dd35665699594c2a15867c --- /dev/null +++ b/steering/ears_moods_mect60k/proud.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d358cf1d71a8e33d71bea8b88cc2d828384df2e5b99c72d7b061629e24d2783a +size 4224 diff --git a/steering/ears_moods_mect60k/realizing.npy b/steering/ears_moods_mect60k/realizing.npy new file mode 100644 index 0000000000000000000000000000000000000000..2cf89026ab007dda3ab64ca785bc5ac46acb9ee9 --- /dev/null +++ b/steering/ears_moods_mect60k/realizing.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1c98d1fffbf0e12be80461732dd0020d487325224a29a1bcd2faf4eaebf11c86 +size 4224 diff --git a/steering/ears_moods_mect60k/relieved.npy b/steering/ears_moods_mect60k/relieved.npy new file mode 100644 index 0000000000000000000000000000000000000000..b1f2d36fb41adf802f1687f67bc667acfc0e0a11 --- /dev/null +++ b/steering/ears_moods_mect60k/relieved.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5c92566cf0dcc4a4d5095ce403b1ece5737cdecc088e888d44507a22e092a140 +size 4224 diff --git a/steering/ears_moods_mect60k/report.json b/steering/ears_moods_mect60k/report.json new file mode 100644 index 0000000000000000000000000000000000000000..6a544d5b1e9f3d1925ca75298b57eb805a7ca927 --- /dev/null +++ b/steering/ears_moods_mect60k/report.json @@ -0,0 +1,622 @@ +{ + "angry": { + "norm": 0.024435275369628806, + "removed_share": 0.0, + "pairs": [ + { + "pair": [ + { + "style": "anger" + }, + { + "style": "neutral" + } + ], + "train_speakers": [ + 79, + 79 + ], + "held_out_speakers": [ + 28, + 28 + ], + "held_out_auc": 1.0, + "cos_with_direction": 1.0 + } + ] + }, + "sad": { + "norm": 0.01633910478720501, + "removed_share": 0.0, + "pairs": [ + { + "pair": [ + { + "style": "sadness" + }, + { + "style": "neutral" + } + ], + "train_speakers": [ + 79, + 79 + ], + "held_out_speakers": [ + 28, + 28 + ], + "held_out_auc": 1.0, + "cos_with_direction": 1.0 + } + ] + }, + "happy": { + "norm": 0.01910547416830079, + "removed_share": 0.0, + "pairs": [ + { + "pair": [ + { + "style": "amusement" + }, + { + "style": "neutral" + } + ], + "train_speakers": [ + 79, + 79 + ], + "held_out_speakers": [ + 28, + 28 + ], + "held_out_auc": 1.0, + "cos_with_direction": 0.9999999999999998 + } + ] + }, + "fearful": { + "norm": 0.02055408798565512, + "removed_share": 0.0, + "pairs": [ + { + "pair": [ + { + "style": "fear" + }, + { + "style": "neutral" + } + ], + "train_speakers": [ + 79, + 79 + ], + "held_out_speakers": [ + 28, + 28 + ], + "held_out_auc": 1.0, + "cos_with_direction": 1.0 + } + ] + }, + "disgusted": { + "norm": 0.020196482824966278, + "removed_share": 0.0, + "pairs": [ + { + "pair": [ + { + "style": "disgust" + }, + { + "style": "neutral" + } + ], + "train_speakers": [ + 79, + 79 + ], + "held_out_speakers": [ + 28, + 28 + ], + "held_out_auc": 1.0, + "cos_with_direction": 1.0 + } + ] + }, + "surprised": { + "norm": 0.019633100615820298, + "removed_share": 0.0, + "pairs": [ + { + "pair": [ + { + "style": "amazement" + }, + { + "style": "neutral" + } + ], + "train_speakers": [ + 79, + 79 + ], + "held_out_speakers": [ + 28, + 28 + ], + "held_out_auc": 1.0, + "cos_with_direction": 1.0000000000000002 + } + ] + }, + "adoring": { + "norm": 0.016284889328201296, + "removed_share": 0.0, + "pairs": [ + { + "pair": [ + { + "style": "adoration" + }, + { + "style": "neutral" + } + ], + "train_speakers": [ + 79, + 79 + ], + "held_out_speakers": [ + 28, + 28 + ], + "held_out_auc": 1.0, + "cos_with_direction": 1.0 + } + ] + }, + "confused": { + "norm": 0.026082286900063353, + "removed_share": 0.0, + "pairs": [ + { + "pair": [ + { + "style": "confusion" + }, + { + "style": "neutral" + } + ], + "train_speakers": [ + 79, + 79 + ], + "held_out_speakers": [ + 28, + 28 + ], + "held_out_auc": 1.0, + "cos_with_direction": 1.0000000000000002 + } + ] + }, + "content": { + "norm": 0.013912039359480644, + "removed_share": 0.0, + "pairs": [ + { + "pair": [ + { + "style": "contentment" + }, + { + "style": "neutral" + } + ], + "train_speakers": [ + 79, + 79 + ], + "held_out_speakers": [ + 28, + 28 + ], + "held_out_auc": 1.0, + "cos_with_direction": 1.0 + } + ] + }, + "cute": { + "norm": 0.027364304670973127, + "removed_share": 0.0, + "pairs": [ + { + "pair": [ + { + "style": "cuteness" + }, + { + "style": "neutral" + } + ], + "train_speakers": [ + 79, + 79 + ], + "held_out_speakers": [ + 28, + 28 + ], + "held_out_auc": 1.0, + "cos_with_direction": 0.9999999999999999 + } + ] + }, + "desirous": { + "norm": 0.017848278287119154, + "removed_share": 0.0, + "pairs": [ + { + "pair": [ + { + "style": "desire" + }, + { + "style": "neutral" + } + ], + "train_speakers": [ + 79, + 79 + ], + "held_out_speakers": [ + 28, + 28 + ], + "held_out_auc": 1.0, + "cos_with_direction": 0.9999999999999998 + } + ] + }, + "disappointed": { + "norm": 0.016322801521609327, + "removed_share": 0.0, + "pairs": [ + { + "pair": [ + { + "style": "disappointment" + }, + { + "style": "neutral" + } + ], + "train_speakers": [ + 79, + 79 + ], + "held_out_speakers": [ + 28, + 28 + ], + "held_out_auc": 1.0, + "cos_with_direction": 1.0000000000000002 + } + ] + }, + "distressed": { + "norm": 0.018937708805635837, + "removed_share": 0.0, + "pairs": [ + { + "pair": [ + { + "style": "distress" + }, + { + "style": "neutral" + } + ], + "train_speakers": [ + 79, + 79 + ], + "held_out_speakers": [ + 28, + 28 + ], + "held_out_auc": 1.0, + "cos_with_direction": 0.9999999999999998 + } + ] + }, + "embarrassed": { + "norm": 0.018894311337840627, + "removed_share": 0.0, + "pairs": [ + { + "pair": [ + { + "style": "embarassment" + }, + { + "style": "neutral" + } + ], + "train_speakers": [ + 79, + 79 + ], + "held_out_speakers": [ + 28, + 28 + ], + "held_out_auc": 1.0, + "cos_with_direction": 1.0000000000000002 + } + ] + }, + "ecstatic": { + "norm": 0.025073490177977806, + "removed_share": 0.0, + "pairs": [ + { + "pair": [ + { + "style": "extasy" + }, + { + "style": "neutral" + } + ], + "train_speakers": [ + 79, + 79 + ], + "held_out_speakers": [ + 28, + 28 + ], + "held_out_auc": 1.0, + "cos_with_direction": 1.0000000000000002 + } + ] + }, + "guilty": { + "norm": 0.015239547474610779, + "removed_share": 0.0, + "pairs": [ + { + "pair": [ + { + "style": "guilt" + }, + { + "style": "neutral" + } + ], + "train_speakers": [ + 79, + 79 + ], + "held_out_speakers": [ + 28, + 28 + ], + "held_out_auc": 1.0, + "cos_with_direction": 1.0000000000000002 + } + ] + }, + "interested": { + "norm": 0.019086483178770566, + "removed_share": 0.0, + "pairs": [ + { + "pair": [ + { + "style": "interest" + }, + { + "style": "neutral" + } + ], + "train_speakers": [ + 79, + 79 + ], + "held_out_speakers": [ + 28, + 28 + ], + "held_out_auc": 1.0, + "cos_with_direction": 1.0 + } + ] + }, + "pained": { + "norm": 0.02070991877178616, + "removed_share": 0.0, + "pairs": [ + { + "pair": [ + { + "style": "pain" + }, + { + "style": "neutral" + } + ], + "train_speakers": [ + 79, + 79 + ], + "held_out_speakers": [ + 28, + 28 + ], + "held_out_auc": 1.0, + "cos_with_direction": 1.0 + } + ] + }, + "proud": { + "norm": 0.01662208879133351, + "removed_share": 0.0, + "pairs": [ + { + "pair": [ + { + "style": "pride" + }, + { + "style": "neutral" + } + ], + "train_speakers": [ + 79, + 79 + ], + "held_out_speakers": [ + 28, + 28 + ], + "held_out_auc": 1.0, + "cos_with_direction": 1.0 + } + ] + }, + "realizing": { + "norm": 0.016936622637553696, + "removed_share": 0.0, + "pairs": [ + { + "pair": [ + { + "style": "realization" + }, + { + "style": "neutral" + } + ], + "train_speakers": [ + 79, + 79 + ], + "held_out_speakers": [ + 28, + 28 + ], + "held_out_auc": 1.0, + "cos_with_direction": 1.0 + } + ] + }, + "relieved": { + "norm": 0.01731547693539987, + "removed_share": 0.0, + "pairs": [ + { + "pair": [ + { + "style": "relief" + }, + { + "style": "neutral" + } + ], + "train_speakers": [ + 79, + 79 + ], + "held_out_speakers": [ + 28, + 28 + ], + "held_out_auc": 1.0, + "cos_with_direction": 0.9999999999999998 + } + ] + }, + "serene": { + "norm": 0.015665733708158797, + "removed_share": 0.0, + "pairs": [ + { + "pair": [ + { + "style": "serenity" + }, + { + "style": "neutral" + } + ], + "train_speakers": [ + 79, + 79 + ], + "held_out_speakers": [ + 28, + 28 + ], + "held_out_auc": 1.0, + "cos_with_direction": 1.0 + } + ] + }, + "scared": { + "norm": 0.012197559309144927, + "removed_share": 0.0, + "pairs": [ + { + "pair": [ + { + "style": "fear" + }, + { + "style": [ + "anger", + "sadness", + "amusement", + "disgust", + "amazement", + "adoration", + "confusion", + "contentment", + "cuteness", + "desire", + "disappointment", + "distress", + "embarassment", + "extasy", + "guilt", + "interest", + "pain", + "pride", + "realization", + "relief", + "serenity" + ] + } + ], + "train_speakers": [ + 79, + 1659 + ], + "held_out_speakers": [ + 28, + 588 + ], + "held_out_auc": 0.9774659863945578, + "cos_with_direction": 0.9999999999999999 + } + ] + } +} diff --git a/steering/ears_moods_mect60k/sad.npy b/steering/ears_moods_mect60k/sad.npy new file mode 100644 index 0000000000000000000000000000000000000000..0fee5cb81e37c718b241300353f29e9e0aead668 --- /dev/null +++ b/steering/ears_moods_mect60k/sad.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1b32eb391e593283b44d1b0d357fc05ed07e53abdbad428133ff88e8129cbd10 +size 4224 diff --git a/steering/ears_moods_mect60k/scared.npy b/steering/ears_moods_mect60k/scared.npy new file mode 100644 index 0000000000000000000000000000000000000000..bea95105cfa020652c64e2306ccf70abadb7c0d1 --- /dev/null +++ b/steering/ears_moods_mect60k/scared.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a5e4526074eb1841bf3fe46308c191ef68e0000c92f6890cfbbd54f8858cf5f1 +size 4224 diff --git a/steering/ears_moods_mect60k/serene.npy b/steering/ears_moods_mect60k/serene.npy new file mode 100644 index 0000000000000000000000000000000000000000..8406932f7cd9031388a1b1a4a0d43afd41f4190f --- /dev/null +++ b/steering/ears_moods_mect60k/serene.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0bc7b3dd4f8305dc278f5873bf767b358b31e43ec2760ad364bd61a8e22fe85c +size 4224 diff --git a/steering/ears_moods_mect60k/spec.json b/steering/ears_moods_mect60k/spec.json new file mode 100644 index 0000000000000000000000000000000000000000..d2456a8a9d1d5f5ed24e7e7292ba88650496937d --- /dev/null +++ b/steering/ears_moods_mect60k/spec.json @@ -0,0 +1,329 @@ +{ + "space": "attnres_source", + "group_by": "clip", + "center": "speaker", + "directions": { + "angry": { + "pairs": [ + [ + { + "style": "anger" + }, + { + "style": "neutral" + } + ] + ], + "kind": "named" + }, + "sad": { + "pairs": [ + [ + { + "style": "sadness" + }, + { + "style": "neutral" + } + ] + ], + "kind": "named" + }, + "happy": { + "pairs": [ + [ + { + "style": "amusement" + }, + { + "style": "neutral" + } + ] + ], + "kind": "named" + }, + "fearful": { + "pairs": [ + [ + { + "style": "fear" + }, + { + "style": "neutral" + } + ] + ], + "kind": "named" + }, + "disgusted": { + "pairs": [ + [ + { + "style": "disgust" + }, + { + "style": "neutral" + } + ] + ], + "kind": "named" + }, + "surprised": { + "pairs": [ + [ + { + "style": "amazement" + }, + { + "style": "neutral" + } + ] + ], + "kind": "named" + }, + "adoring": { + "pairs": [ + [ + { + "style": "adoration" + }, + { + "style": "neutral" + } + ] + ], + "kind": "named" + }, + "confused": { + "pairs": [ + [ + { + "style": "confusion" + }, + { + "style": "neutral" + } + ] + ], + "kind": "named" + }, + "content": { + "pairs": [ + [ + { + "style": "contentment" + }, + { + "style": "neutral" + } + ] + ], + "kind": "named" + }, + "cute": { + "pairs": [ + [ + { + "style": "cuteness" + }, + { + "style": "neutral" + } + ] + ], + "kind": "named" + }, + "desirous": { + "pairs": [ + [ + { + "style": "desire" + }, + { + "style": "neutral" + } + ] + ], + "kind": "named" + }, + "disappointed": { + "pairs": [ + [ + { + "style": "disappointment" + }, + { + "style": "neutral" + } + ] + ], + "kind": "named" + }, + "distressed": { + "pairs": [ + [ + { + "style": "distress" + }, + { + "style": "neutral" + } + ] + ], + "kind": "named" + }, + "embarrassed": { + "pairs": [ + [ + { + "style": "embarassment" + }, + { + "style": "neutral" + } + ] + ], + "kind": "named" + }, + "ecstatic": { + "pairs": [ + [ + { + "style": "extasy" + }, + { + "style": "neutral" + } + ] + ], + "kind": "named" + }, + "guilty": { + "pairs": [ + [ + { + "style": "guilt" + }, + { + "style": "neutral" + } + ] + ], + "kind": "named" + }, + "interested": { + "pairs": [ + [ + { + "style": "interest" + }, + { + "style": "neutral" + } + ] + ], + "kind": "named" + }, + "pained": { + "pairs": [ + [ + { + "style": "pain" + }, + { + "style": "neutral" + } + ] + ], + "kind": "named" + }, + "proud": { + "pairs": [ + [ + { + "style": "pride" + }, + { + "style": "neutral" + } + ] + ], + "kind": "named" + }, + "realizing": { + "pairs": [ + [ + { + "style": "realization" + }, + { + "style": "neutral" + } + ] + ], + "kind": "named" + }, + "relieved": { + "pairs": [ + [ + { + "style": "relief" + }, + { + "style": "neutral" + } + ] + ], + "kind": "named" + }, + "serene": { + "pairs": [ + [ + { + "style": "serenity" + }, + { + "style": "neutral" + } + ] + ], + "kind": "named" + }, + "scared": { + "pairs": [ + [ + { + "style": "fear" + }, + { + "style": [ + "anger", + "sadness", + "amusement", + "disgust", + "amazement", + "adoration", + "confusion", + "contentment", + "cuteness", + "desire", + "disappointment", + "distress", + "embarassment", + "extasy", + "guilt", + "interest", + "pain", + "pride", + "realization", + "relief", + "serenity" + ] + } + ] + ], + "kind": "named" + } + }, + "source_index": 19 +} \ No newline at end of file diff --git a/steering/ears_moods_mect60k/surprised.npy b/steering/ears_moods_mect60k/surprised.npy new file mode 100644 index 0000000000000000000000000000000000000000..b8fc6a371e322e6d0f906c92be24a6ae0f3f0112 --- /dev/null +++ b/steering/ears_moods_mect60k/surprised.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:54f42a78ceeb5885321c1ff9b8ca0ec18cde67daccd6584e681fd23de0b3587b +size 4224 diff --git a/steering/ears_styles_mect60k/conversational.npy b/steering/ears_styles_mect60k/conversational.npy new file mode 100644 index 0000000000000000000000000000000000000000..fa40aed7df4126707d4b4e7b0487608ef2032348 --- /dev/null +++ b/steering/ears_styles_mect60k/conversational.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4cd4510955160dd0b78656d131e1d69f351169b6ac0ecb1306fd79de400b72a9 +size 4224 diff --git a/steering/ears_styles_mect60k/eval/conversational.json b/steering/ears_styles_mect60k/eval/conversational.json new file mode 100644 index 0000000000000000000000000000000000000000..ea94d6f2ac2515b54f9f9a9a4e257cdcf0465b61 --- /dev/null +++ b/steering/ears_styles_mect60k/eval/conversational.json @@ -0,0 +1,1045 @@ +{ + "all": { + "neutral": { + "wer": 0.004866946778711485, + "collapse": 0.0, + "identity": 0.9463956918186919, + "durx": 1.0, + "female": 0.4983073752615989, + "age": 41.317688735822834, + "f0": 136.19757792145845, + "f0_st": 2.903048200564409, + "voiced": 0.6307535235563585, + "rms_db": -38.16175572077433, + "snr_db": 39.82410788536072, + "bandwidth": 8300.152587890625, + "flow:disfluent": 0.09457541666666668, + "flow:interjection": 0.06453458333333334, + "quality:flowing": 0.59947875, + "quality:hesitant": 0.12327458333333334, + "quality:enunciated": 0.4923699999999999, + "quality:monotone": 0.0, + "quality:singsong": 0.34092208333333335 + }, + "conversational -4": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.8959861374994244, + "durx": 0.9583950617283951, + "female": 0.49973479300873197, + "age": 44.90501172840595, + "f0": 137.7180925835291, + "f0_st": 3.3906382038004756, + "voiced": 0.5402600523754434, + "rms_db": -46.4925651550293, + "snr_db": 42.882087548573814, + "bandwidth": 9387.579345703125, + "flow:disfluent": 0.07938541666666667, + "flow:interjection": 0.04074875, + "quality:flowing": 0.6157254166666666, + "quality:hesitant": 0.1293716666666667, + "quality:enunciated": 0.5457045833333333, + "quality:monotone": 0.0, + "quality:singsong": 0.17494041666666668 + }, + "conversational -2": { + "wer": 0.0024509803921568627, + "collapse": 0.0, + "identity": 0.9147045780474118, + "durx": 0.981214042503229, + "female": 0.4993715442881997, + "age": 43.79457135995229, + "f0": 135.81689995345945, + "f0_st": 3.2745799683826218, + "voiced": 0.5873564565461971, + "rms_db": -41.87494762738546, + "snr_db": 40.09773929913839, + "bandwidth": 8431.594848632812, + "flow:disfluent": 0.07771416666666665, + "flow:interjection": 0.04052, + "quality:flowing": 0.5832970833333333, + "quality:hesitant": 0.12894208333333332, + "quality:enunciated": 0.5893979166666666, + "quality:monotone": 0.0, + "quality:singsong": 0.27532791666666667 + }, + "conversational -1": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9191836783447754, + "durx": 0.9903416961674619, + "female": 0.49870648158927605, + "age": 43.39262383679549, + "f0": 136.7697534183079, + "f0_st": 3.1900745787955995, + "voiced": 0.5839991822199844, + "rms_db": -41.00093825658163, + "snr_db": 39.4890505472819, + "bandwidth": 8496.64306640625, + "flow:disfluent": 0.09154291666666665, + "flow:interjection": 0.05997958333333333, + "quality:flowing": 0.61294625, + "quality:hesitant": 0.14308208333333333, + "quality:enunciated": 0.5479041666666667, + "quality:monotone": 0.0, + "quality:singsong": 0.2583954166666667 + }, + "conversational +1": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9177813683308941, + "durx": 1.0080492424242424, + "female": 0.4973367481046201, + "age": 39.86445205907027, + "f0": 138.65410519288267, + "f0_st": 2.5320762333682194, + "voiced": 0.6495113110325912, + "rms_db": -37.06918978691101, + "snr_db": 37.39020291964213, + "bandwidth": 8295.66650390625, + "flow:disfluent": 0.10264499999999999, + "flow:interjection": 0.07421833333333333, + "quality:flowing": 0.5835020833333333, + "quality:hesitant": 0.12679666666666667, + "quality:enunciated": 0.5104420833333333, + "quality:monotone": 0.0, + "quality:singsong": 0.2773995833333333 + }, + "conversational +2": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.923129849067165, + "durx": 1.0649038461538463, + "female": 0.49716106642154045, + "age": 39.11628431330124, + "f0": 137.47175912790885, + "f0_st": 2.7395649943347653, + "voiced": 0.6518915395756223, + "rms_db": -35.73284912109375, + "snr_db": 36.14733783404032, + "bandwidth": 8307.330322265625, + "flow:disfluent": 0.14392875000000002, + "flow:interjection": 0.10107083333333333, + "quality:flowing": 0.5889208333333333, + "quality:hesitant": 0.15411458333333336, + "quality:enunciated": 0.4978233333333333, + "quality:monotone": 0.0, + "quality:singsong": 0.34296958333333344 + }, + "conversational +4": { + "wer": 0.025031488567967233, + "collapse": 0.0, + "identity": 0.9013732947799715, + "durx": 1.1721428571428572, + "female": 0.4959534329827875, + "age": 37.2971241051952, + "f0": 139.0615823457537, + "f0_st": 2.495002733125183, + "voiced": 0.6973337211438855, + "rms_db": -32.80763165156046, + "snr_db": 36.35856564839681, + "bandwidth": 8191.1407470703125, + "flow:disfluent": 0.26406416666666666, + "flow:interjection": 0.22325124999999998, + "quality:flowing": 0.5458916666666666, + "quality:hesitant": 0.14926541666666668, + "quality:enunciated": 0.36228583333333325, + "quality:monotone": 0.0, + "quality:singsong": 0.44115291666666673 + } + }, + "American Female": { + "neutral": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.950361505518176, + "durx": 1.0, + "female": 0.9827781617641449, + "age": 29.750093817710876, + "f0": 155.81481265779422, + "f0_st": 1.8082626788764102, + "voiced": 0.678813494199399, + "rms_db": -29.80318832397461, + "snr_db": 38.62734889984131, + "bandwidth": 6026.605224609375, + "flow:disfluent": 0.08399, + "flow:interjection": 0.039615000000000004, + "quality:flowing": 0.0149075, + "quality:hesitant": 0.0, + "quality:enunciated": 0.9318975, + "quality:monotone": 0.0, + "quality:singsong": 0.1593025 + }, + "conversational -4": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9183321271303443, + "durx": 0.98, + "female": 0.9923010319471359, + "age": 33.95789414644241, + "f0": 149.2024069728438, + "f0_st": 2.1916614701575097, + "voiced": 0.6180135976850409, + "rms_db": -37.72012996673584, + "snr_db": 51.2559118270874, + "bandwidth": 6236.553955078125, + "flow:disfluent": 0.0754275, + "flow:interjection": 0.03685, + "quality:flowing": 0.09215499999999999, + "quality:hesitant": 0.0, + "quality:enunciated": 0.9408750000000001, + "quality:monotone": 0.0, + "quality:singsong": 0.0051725 + }, + "conversational -2": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9424595795561164, + "durx": 1.0497478991596638, + "female": 0.9888882488012314, + "age": 32.40271285176277, + "f0": 156.7662220262431, + "f0_st": 2.14688809846143, + "voiced": 0.6558417424653575, + "rms_db": -34.62852382659912, + "snr_db": 45.994510650634766, + "bandwidth": 5827.423095703125, + "flow:disfluent": 0.07831500000000001, + "flow:interjection": 0.036185, + "quality:flowing": 0.0351875, + "quality:hesitant": 0.0, + "quality:enunciated": 0.9056975, + "quality:monotone": 0.0, + "quality:singsong": 0.1793225 + }, + "conversational -1": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.933093780546332, + "durx": 1.0260416666666665, + "female": 0.9840401709079742, + "age": 30.23340404033661, + "f0": 158.5211435526411, + "f0_st": 2.1288639273058787, + "voiced": 0.6782431044896041, + "rms_db": -32.2032527923584, + "snr_db": 43.84947490692139, + "bandwidth": 6328.070068359375, + "flow:disfluent": 0.0896375, + "flow:interjection": 0.0412825, + "quality:flowing": 0.005742499999999999, + "quality:hesitant": 0.0, + "quality:enunciated": 0.9671424999999999, + "quality:monotone": 0.0, + "quality:singsong": 0.19721 + }, + "conversational +1": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9411249955138827, + "durx": 1.0027573529411764, + "female": 0.9778578132390976, + "age": 28.121712803840637, + "f0": 159.02378370068146, + "f0_st": 1.7625758655213106, + "voiced": 0.6962143180604328, + "rms_db": -30.105541229248047, + "snr_db": 38.62705707550049, + "bandwidth": 6726.434326171875, + "flow:disfluent": 0.09134250000000001, + "flow:interjection": 0.0408675, + "quality:flowing": 0.08054, + "quality:hesitant": 5e-06, + "quality:enunciated": 0.9306899999999999, + "quality:monotone": 0.0, + "quality:singsong": 0.07986499999999999 + }, + "conversational +2": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9323013380126016, + "durx": 1.0793154761904762, + "female": 0.9682715684175491, + "age": 26.519732177257538, + "f0": 159.5739328189877, + "f0_st": 1.8155452516317279, + "voiced": 0.6967207724793496, + "rms_db": -29.639363288879395, + "snr_db": 35.2680606842041, + "bandwidth": 6430.352783203125, + "flow:disfluent": 0.09386749999999999, + "flow:interjection": 0.048085, + "quality:flowing": 0.021622500000000003, + "quality:hesitant": 0.0, + "quality:enunciated": 0.9322900000000001, + "quality:monotone": 0.0, + "quality:singsong": 0.172955 + }, + "conversational +4": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9224934687993986, + "durx": 1.2433210784313724, + "female": 0.9626924693584442, + "age": 26.143911480903625, + "f0": 158.09714237652014, + "f0_st": 1.6445181781953258, + "voiced": 0.7031849130171499, + "rms_db": -25.912368297576904, + "snr_db": 43.42747688293457, + "bandwidth": 6653.759765625, + "flow:disfluent": 0.23742999999999997, + "flow:interjection": 0.1182025, + "quality:flowing": 0.023485, + "quality:hesitant": 0.0, + "quality:enunciated": 0.7266825, + "quality:monotone": 0.0, + "quality:singsong": 0.3745275 + } + }, + "American Male": { + "neutral": { + "wer": 0.007352941176470588, + "collapse": 0.0, + "identity": 0.944281897024579, + "durx": 1.0, + "female": 0.0021247467666398734, + "age": 48.121464252471924, + "f0": 116.91828356269122, + "f0_st": 4.913690931254914, + "voiced": 0.4680676167050811, + "rms_db": -43.39509105682373, + "snr_db": 39.194278717041016, + "bandwidth": 8204.150390625, + "flow:disfluent": 0.06804500000000001, + "flow:interjection": 0.03238, + "quality:flowing": 0.9711599999999999, + "quality:hesitant": 0.0056725000000000005, + "quality:enunciated": 0.09842499999999998, + "quality:monotone": 0.0, + "quality:singsong": 0.9347175 + }, + "conversational -4": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.8801926620633823, + "durx": 0.9350748337028825, + "female": 0.0022953270527068526, + "age": 51.45084261894226, + "f0": 121.75642260915527, + "f0_st": 4.395308797027787, + "voiced": 0.25536125226640316, + "rms_db": -53.382431983947754, + "snr_db": 40.780147552490234, + "bandwidth": 9805.682373046875, + "flow:disfluent": 0.09166, + "flow:interjection": 0.044612500000000006, + "quality:flowing": 0.9413375, + "quality:hesitant": 0.01525, + "quality:enunciated": 0.1960825, + "quality:monotone": 0.0, + "quality:singsong": 0.83075 + }, + "conversational -2": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9144418883439474, + "durx": 0.978519955654102, + "female": 0.0022264264116529375, + "age": 48.54527488350868, + "f0": 109.22163719514286, + "f0_st": 4.278498434732142, + "voiced": 0.35463725155378856, + "rms_db": -48.289045333862305, + "snr_db": 35.60054683685303, + "bandwidth": 8478.69873046875, + "flow:disfluent": 0.0739, + "flow:interjection": 0.035675, + "quality:flowing": 0.8390000000000001, + "quality:hesitant": 0.048197500000000004, + "quality:enunciated": 0.220115, + "quality:monotone": 0.0, + "quality:singsong": 0.95499 + }, + "conversational -1": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9203084886235047, + "durx": 0.9799370574350905, + "female": 0.0023320525942835957, + "age": 49.464914202690125, + "f0": 118.09942626875161, + "f0_st": 4.725943629309181, + "voiced": 0.34996204541123066, + "rms_db": -49.62601089477539, + "snr_db": 34.8459358215332, + "bandwidth": 8774.7802734375, + "flow:disfluent": 0.08348250000000002, + "flow:interjection": 0.041182500000000004, + "quality:flowing": 0.9466100000000001, + "quality:hesitant": 0.0078175, + "quality:enunciated": 0.1308925, + "quality:monotone": 0.0, + "quality:singsong": 0.9515600000000001 + }, + "conversational +1": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9118573980125668, + "durx": 1.0405145929339477, + "female": 0.0017614871030673385, + "age": 48.82894903421402, + "f0": 112.42827068408931, + "f0_st": 3.2285453375135225, + "voiced": 0.5236498739607156, + "rms_db": -42.489728927612305, + "snr_db": 38.74171447753906, + "bandwidth": 7848.8525390625, + "flow:disfluent": 0.083585, + "flow:interjection": 0.041875, + "quality:flowing": 0.9475525, + "quality:hesitant": 0.008832499999999998, + "quality:enunciated": 0.08352500000000002, + "quality:monotone": 0.0, + "quality:singsong": 0.8799375 + }, + "conversational +2": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9228456787579996, + "durx": 1.0360046457607432, + "female": 0.002141892327927053, + "age": 48.11476171016693, + "f0": 111.88789574284675, + "f0_st": 3.42391073437504, + "voiced": 0.5971662677820461, + "rms_db": -39.060447216033936, + "snr_db": 35.947776794433594, + "bandwidth": 7913.4521484375, + "flow:disfluent": 0.12439, + "flow:interjection": 0.0544875, + "quality:flowing": 0.9713125, + "quality:hesitant": 0.006025, + "quality:enunciated": 0.1248325, + "quality:monotone": 0.0, + "quality:singsong": 0.974445 + }, + "conversational +4": { + "wer": 0.007352941176470588, + "collapse": 0.0, + "identity": 0.8858316653194067, + "durx": 1.223694316436252, + "female": 0.0027334598125889897, + "age": 42.349665611982346, + "f0": 110.54781205866684, + "f0_st": 2.9647920948932773, + "voiced": 0.6661358158914867, + "rms_db": -37.62112522125244, + "snr_db": 28.53142213821411, + "bandwidth": 8179.925537109375, + "flow:disfluent": 0.3006375, + "flow:interjection": 0.287875, + "quality:flowing": 0.985765, + "quality:hesitant": 0.0053225, + "quality:enunciated": 0.029095, + "quality:monotone": 0.0, + "quality:singsong": 0.9928725 + } + }, + "British Female": { + "neutral": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9646508989039382, + "durx": 1.0, + "female": 0.9985478520393372, + "age": 48.11074435710907, + "f0": 145.18670227011933, + "f0_st": 3.120616918031748, + "voiced": 0.684659116272671, + "rms_db": -34.987064361572266, + "snr_db": 43.8385124206543, + "bandwidth": 9003.570556640625, + "flow:disfluent": 0.095805, + "flow:interjection": 0.0436975, + "quality:flowing": 0.6609849999999999, + "quality:hesitant": 0.0, + "quality:enunciated": 0.3200325, + "quality:monotone": 0.0, + "quality:singsong": 0.5825724999999999 + }, + "conversational -4": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9312569486241965, + "durx": 0.9198357821953328, + "female": 0.9986636787652969, + "age": 51.06038078665733, + "f0": 143.45473370484623, + "f0_st": 4.011772454855346, + "voiced": 0.67745964764879, + "rms_db": -41.895721435546875, + "snr_db": 41.53719425201416, + "bandwidth": 9383.09326171875, + "flow:disfluent": 0.07544000000000001, + "flow:interjection": 0.03448, + "quality:flowing": 0.710155, + "quality:hesitant": 2.5e-06, + "quality:enunciated": 0.4432375, + "quality:monotone": 0.0, + "quality:singsong": 0.06294 + }, + "conversational -2": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9316201241536103, + "durx": 0.9546780466724287, + "female": 0.9984892010688782, + "age": 49.23754408955574, + "f0": 144.27391819509552, + "f0_st": 3.3642246369528035, + "voiced": 0.6679249373732115, + "rms_db": -38.19259166717529, + "snr_db": 45.209561347961426, + "bandwidth": 9598.42529296875, + "flow:disfluent": 0.07148499999999999, + "flow:interjection": 0.034440000000000005, + "quality:flowing": 0.64977, + "quality:hesitant": 1.75e-05, + "quality:enunciated": 0.40561499999999995, + "quality:monotone": 0.0, + "quality:singsong": 0.36462000000000006 + }, + "conversational -1": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9423606071960848, + "durx": 0.9543701059419623, + "female": 0.9983704388141632, + "age": 48.13019931316376, + "f0": 143.13628474186103, + "f0_st": 3.437016229152924, + "voiced": 0.6477263348778417, + "rms_db": -37.661322593688965, + "snr_db": 43.80871391296387, + "bandwidth": 8844.76318359375, + "flow:disfluent": 0.0788675, + "flow:interjection": 0.0381325, + "quality:flowing": 0.8018974999999999, + "quality:hesitant": 1e-05, + "quality:enunciated": 0.43409999999999993, + "quality:monotone": 0.0, + "quality:singsong": 0.137585 + }, + "conversational +1": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9446175542815948, + "durx": 1.0, + "female": 0.9980179518461227, + "age": 43.126430362463, + "f0": 147.60245065134228, + "f0_st": 2.6448374772656025, + "voiced": 0.6569224889714816, + "rms_db": -34.842724323272705, + "snr_db": 40.32228755950928, + "bandwidth": 9431.54296875, + "flow:disfluent": 0.0794575, + "flow:interjection": 0.035977499999999996, + "quality:flowing": 0.6242775, + "quality:hesitant": 2.5e-06, + "quality:enunciated": 0.4115725, + "quality:monotone": 0.0, + "quality:singsong": 0.3710375 + }, + "conversational +2": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9366362072845191, + "durx": 1.0845520497466605, + "female": 0.9985898733139038, + "age": 44.659632444381714, + "f0": 148.78458964257067, + "f0_st": 2.453567818705796, + "voiced": 0.6533428279352193, + "rms_db": -33.49081230163574, + "snr_db": 38.4014310836792, + "bandwidth": 9811.065673828125, + "flow:disfluent": 0.09946250000000001, + "flow:interjection": 0.04039, + "quality:flowing": 0.667345, + "quality:hesitant": 2.75e-05, + "quality:enunciated": 0.3855775, + "quality:monotone": 0.0, + "quality:singsong": 0.43771250000000006 + }, + "conversational +4": { + "wer": 0.007142857142857143, + "collapse": 0.0, + "identity": 0.9292257589682761, + "durx": 1.11227442969016, + "female": 0.9979524314403534, + "age": 42.404673993587494, + "f0": 149.2769861384606, + "f0_st": 2.5833202267809874, + "voiced": 0.6699396332020338, + "rms_db": -28.899874210357666, + "snr_db": 44.59167957305908, + "bandwidth": 9442.3095703125, + "flow:disfluent": 0.116875, + "flow:interjection": 0.0481625, + "quality:flowing": 0.49666, + "quality:hesitant": 2e-05, + "quality:enunciated": 0.389465, + "quality:monotone": 0.0, + "quality:singsong": 0.49067 + } + }, + "British Male": { + "neutral": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9536403536976914, + "durx": 1.0, + "female": 0.005018519994337112, + "age": 19.837047532200813, + "f0": 88.88241321026631, + "f0_st": 2.4990147456627976, + "voiced": 0.5315726962367779, + "rms_db": -39.36486530303955, + "snr_db": 35.08437442779541, + "bandwidth": 11011.541748046875, + "flow:disfluent": 0.0874325, + "flow:interjection": 0.0431575, + "quality:flowing": 0.6694425, + "quality:hesitant": 0.6122075, + "quality:enunciated": 0.693615, + "quality:monotone": 0.0, + "quality:singsong": 0.299145 + }, + "conversational -4": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.8972407189411236, + "durx": 0.8506077256077256, + "female": 0.003344703698530793, + "age": 24.75227415561676, + "f0": 85.4585153625978, + "f0_st": 2.185493479040174, + "voiced": 0.35732602510336725, + "rms_db": -51.81794738769531, + "snr_db": 34.14910697937012, + "bandwidth": 11934.77783203125, + "flow:disfluent": 0.07417750000000001, + "flow:interjection": 0.0406375, + "quality:flowing": 0.6922975, + "quality:hesitant": 0.574975, + "quality:enunciated": 0.7729199999999999, + "quality:monotone": 0.0, + "quality:singsong": 0.0771475 + }, + "conversational -2": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9151163709791345, + "durx": 1.0016233766233766, + "female": 0.005226492648944259, + "age": 26.060589402914047, + "f0": 85.82506947149636, + "f0_st": 2.8974322425676453, + "voiced": 0.4385232902772507, + "rms_db": -47.30109691619873, + "snr_db": 33.967116355895996, + "bandwidth": 10804.28466796875, + "flow:disfluent": 0.0954525, + "flow:interjection": 0.049914999999999994, + "quality:flowing": 0.68692, + "quality:hesitant": 0.6203299999999999, + "quality:enunciated": 0.80367, + "quality:monotone": 0.0, + "quality:singsong": 0.1024425 + }, + "conversational -1": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9140017960311119, + "durx": 1.025890775890776, + "female": 0.005065562727395445, + "age": 24.770311266183853, + "f0": 87.32145679269333, + "f0_st": 2.787583343271963, + "voiced": 0.46201794515954575, + "rms_db": -42.86910820007324, + "snr_db": 33.075279712677, + "bandwidth": 10874.267578125, + "flow:disfluent": 0.09242249999999999, + "flow:interjection": 0.04948, + "quality:flowing": 0.6649425, + "quality:hesitant": 0.6230775, + "quality:enunciated": 0.7829025000000001, + "quality:monotone": 0.0, + "quality:singsong": 0.1401825 + }, + "conversational +1": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9263146262553265, + "durx": 1.0412920412920412, + "female": 0.005418954882770777, + "age": 19.87120285630226, + "f0": 88.96625984018098, + "f0_st": 2.6612916346607256, + "voiced": 0.5782247224199258, + "rms_db": -39.38865947723389, + "snr_db": 31.633864402770996, + "bandwidth": 11245.71533203125, + "flow:disfluent": 0.121005, + "flow:interjection": 0.0815125, + "quality:flowing": 0.6299275000000001, + "quality:hesitant": 0.6566749999999999, + "quality:enunciated": 0.7065675, + "quality:monotone": 0.0, + "quality:singsong": 0.23788 + }, + "conversational +2": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.930368118604237, + "durx": 1.127164502164502, + "female": 0.012452471302822232, + "age": 19.71818543970585, + "f0": 89.35299348728131, + "f0_st": 2.373231266400493, + "voiced": 0.5943643134995072, + "rms_db": -38.189104080200195, + "snr_db": 28.615516185760498, + "bandwidth": 10567.41943359375, + "flow:disfluent": 0.1708175, + "flow:interjection": 0.1411925, + "quality:flowing": 0.605575, + "quality:hesitant": 0.7364175000000001, + "quality:enunciated": 0.626165, + "quality:monotone": 0.0, + "quality:singsong": 0.34916 + }, + "conversational +4": { + "wer": 0.04805491990846682, + "collapse": 0.0, + "identity": 0.9100745960350834, + "durx": 1.1887755102040816, + "female": 0.014431554882321507, + "age": 22.38166071474552, + "f0": 93.19770777783302, + "f0_st": 3.5913221650282625, + "voiced": 0.6633321542644438, + "rms_db": -33.67692708969116, + "snr_db": 25.575753688812256, + "bandwidth": 9924.114990234375, + "flow:disfluent": 0.371085, + "flow:interjection": 0.1885725, + "quality:flowing": 0.6282625000000001, + "quality:hesitant": 0.6891075, + "quality:enunciated": 0.41193749999999996, + "quality:monotone": 0.0, + "quality:singsong": 0.5882325 + } + }, + "Obama": { + "neutral": { + "wer": 0.014705882352941176, + "collapse": 0.0, + "identity": 0.9387460296541414, + "durx": 1.0, + "female": 0.0035154334036633372, + "age": 53.74961122870445, + "f0": 123.7537390161196, + "f0_st": 2.7043656138649546, + "voiced": 0.6549097443442305, + "rms_db": -41.428171157836914, + "snr_db": 50.819594383239746, + "bandwidth": 7555.462646484375, + "flow:disfluent": 0.070495, + "flow:interjection": 0.0366575, + "quality:flowing": 0.40512000000000004, + "quality:hesitant": 0.02416, + "quality:enunciated": 0.47367, + "quality:monotone": 0.0, + "quality:singsong": 0.00885 + }, + "conversational -4": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9102055089150854, + "durx": 0.9678687459389215, + "female": 0.003437630890402943, + "age": 54.499781131744385, + "f0": 128.32311205768724, + "f0_st": 3.9169689114596027, + "voiced": 0.6301889732042008, + "rms_db": -41.6522216796875, + "snr_db": 52.59519863128662, + "bandwidth": 7428.955078125, + "flow:disfluent": 0.071635, + "flow:interjection": 0.038055, + "quality:flowing": 0.46943, + "quality:hesitant": 0.060792500000000006, + "quality:enunciated": 0.55798, + "quality:monotone": 0.0, + "quality:singsong": 0.0299775 + }, + "conversational -2": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.914548249042713, + "durx": 0.9660493827160493, + "female": 0.002900024875998497, + "age": 54.153868556022644, + "f0": 130.33606935859345, + "f0_st": 3.459507222811681, + "voiced": 0.6456043011054031, + "rms_db": -39.393795013427734, + "snr_db": 49.103333473205566, + "bandwidth": 7337.43896484375, + "flow:disfluent": 0.0683125, + "flow:interjection": 0.0427475, + "quality:flowing": 0.38599249999999996, + "quality:hesitant": 0.0654825, + "quality:enunciated": 0.6189725, + "quality:monotone": 0.0, + "quality:singsong": 0.008830000000000001 + }, + "conversational -1": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9297903835125865, + "durx": 0.9722222222222221, + "female": 0.003976570558734238, + "age": 53.275568783283234, + "f0": 120.69563373790916, + "f0_st": 3.480729992675551, + "voiced": 0.5870281959092251, + "rms_db": -39.94861888885498, + "snr_db": 47.66773700714111, + "bandwidth": 7628.13720703125, + "flow:disfluent": 0.07358999999999999, + "flow:interjection": 0.041165, + "quality:flowing": 0.42854, + "quality:hesitant": 0.0897925, + "quality:enunciated": 0.5982625, + "quality:monotone": 0.0, + "quality:singsong": 0.043495 + }, + "conversational +1": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9100742018772068, + "durx": 1.0066666666666666, + "female": 0.003243131039198488, + "age": 52.594390511512756, + "f0": 130.0661563911505, + "f0_st": 2.589213117536712, + "voiced": 0.6709066957679282, + "rms_db": -36.907217025756836, + "snr_db": 50.14494800567627, + "bandwidth": 7466.63818359375, + "flow:disfluent": 0.07058, + "flow:interjection": 0.0384825, + "quality:flowing": 0.365535, + "quality:hesitant": 0.049535, + "quality:enunciated": 0.5138024999999999, + "quality:monotone": 0.0, + "quality:singsong": 0.0191175 + }, + "conversational +2": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9179015124808323, + "durx": 1.126543209876543, + "female": 0.0037641553790308535, + "age": 50.28890073299408, + "f0": 127.93062796286173, + "f0_st": 4.104278938880058, + "voiced": 0.6012635942331728, + "rms_db": -37.745644092559814, + "snr_db": 47.8860559463501, + "bandwidth": 7253.997802734375, + "flow:disfluent": 0.08572, + "flow:interjection": 0.043077500000000005, + "quality:flowing": 0.3966775, + "quality:hesitant": 0.07469999999999999, + "quality:enunciated": 0.49832250000000006, + "quality:monotone": 0.0, + "quality:singsong": 0.020225 + }, + "conversational +4": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.897576667345674, + "durx": 1.1419753086419753, + "female": 0.004675973497796804, + "age": 52.93121784925461, + "f0": 131.9930370821308, + "f0_st": 2.401938613495031, + "voiced": 0.7222244027674162, + "rms_db": -37.2748646736145, + "snr_db": 49.97593021392822, + "bandwidth": 7899.993896484375, + "flow:disfluent": 0.111895, + "flow:interjection": 0.058992499999999996, + "quality:flowing": 0.35736999999999997, + "quality:hesitant": 0.09753749999999999, + "quality:enunciated": 0.40509249999999997, + "quality:monotone": 0.0, + "quality:singsong": 0.02322 + } + }, + "Scottish Female": { + "neutral": { + "wer": 0.007142857142857143, + "collapse": 0.0, + "identity": 0.9266934661136247, + "durx": 1.0, + "female": 0.997859537601471, + "age": 48.33717122673988, + "f0": 186.62951681175997, + "f0_st": 2.372338315695629, + "voiced": 0.7664984735799911, + "rms_db": -39.992154121398926, + "snr_db": 31.38053846359253, + "bandwidth": 7999.5849609375, + "flow:disfluent": 0.161685, + "flow:interjection": 0.19169999999999998, + "quality:flowing": 0.8752574999999999, + "quality:hesitant": 0.0976075, + "quality:enunciated": 0.43658, + "quality:monotone": 0.0, + "quality:singsong": 0.060945 + }, + "conversational -4": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.8386888593224143, + "durx": 0.9670706006322445, + "female": 0.9983663856983185, + "age": 53.70889753103256, + "f0": 198.1133647940444, + "f0_st": 3.6426241102624326, + "voiced": 0.7032108183448582, + "rms_db": -52.4869384765625, + "snr_db": 36.974966049194336, + "bandwidth": 11536.41357421875, + "flow:disfluent": 0.08797250000000001, + "flow:interjection": 0.0498575, + "quality:flowing": 0.7889774999999999, + "quality:hesitant": 0.12521, + "quality:enunciated": 0.36313249999999997, + "quality:monotone": 0.0, + "quality:singsong": 0.043655 + }, + "conversational -2": { + "wer": 0.014705882352941176, + "collapse": 0.0, + "identity": 0.8700412562089501, + "durx": 0.9400780379041249, + "female": 0.998498871922493, + "age": 52.36743837594986, + "f0": 188.47848347418545, + "f0_st": 3.500929174770029, + "voiced": 0.7616072165021707, + "rms_db": -43.44463300704956, + "snr_db": 30.71136713027954, + "bandwidth": 8543.29833984375, + "flow:disfluent": 0.07882, + "flow:interjection": 0.0441575, + "quality:flowing": 0.9029125, + "quality:hesitant": 0.039625, + "quality:enunciated": 0.5823175, + "quality:monotone": 0.0, + "quality:singsong": 0.0417625 + }, + "conversational -1": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.8755470141590331, + "durx": 0.9406354515050168, + "female": 0.9984540939331055, + "age": 54.481345415115356, + "f0": 192.84457541599096, + "f0_st": 2.5803103510581025, + "voiced": 0.7790174674724589, + "rms_db": -43.69731616973877, + "snr_db": 33.687161922454834, + "bandwidth": 8529.840087890625, + "flow:disfluent": 0.1312575, + "flow:interjection": 0.148635, + "quality:flowing": 0.829945, + "quality:hesitant": 0.137795, + "quality:enunciated": 0.37412500000000004, + "quality:monotone": 0.0, + "quality:singsong": 0.08034 + }, + "conversational +1": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.8726994340447867, + "durx": 0.9503326810176126, + "female": 0.9977211505174637, + "age": 46.64402678608894, + "f0": 193.83770988985142, + "f0_st": 2.3059939677114447, + "voiced": 0.7711497670150633, + "rms_db": -38.681267738342285, + "snr_db": 24.87134599685669, + "bandwidth": 7054.815673828125, + "flow:disfluent": 0.1699, + "flow:interjection": 0.206595, + "quality:flowing": 0.85318, + "quality:hesitant": 0.04573, + "quality:enunciated": 0.41649499999999995, + "quality:monotone": 0.0, + "quality:singsong": 0.07655999999999999 + }, + "conversational +2": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.8987262392628003, + "durx": 0.9871794871794871, + "female": 0.9977464377880096, + "age": 45.39649337530136, + "f0": 187.30051511290492, + "f0_st": 2.266855956015477, + "voiced": 0.7684914615244387, + "rms_db": -36.27172374725342, + "snr_db": 30.765186309814453, + "bandwidth": 7867.694091796875, + "flow:disfluent": 0.289315, + "flow:interjection": 0.2791925, + "quality:flowing": 0.8709925000000001, + "quality:hesitant": 0.10751749999999999, + "quality:enunciated": 0.4197525, + "quality:monotone": 0.0, + "quality:singsong": 0.10332 + }, + "conversational +4": { + "wer": 0.08763821318000883, + "collapse": 0.0, + "identity": 0.8630376122119907, + "durx": 1.1445009784735811, + "female": 0.99323470890522, + "age": 37.57161498069763, + "f0": 191.25680864091095, + "f0_st": 1.784125120358215, + "voiced": 0.759185407720782, + "rms_db": -33.46063041687012, + "snr_db": 26.049131393432617, + "bandwidth": 7046.74072265625, + "flow:disfluent": 0.4464625, + "flow:interjection": 0.6377025000000001, + "quality:flowing": 0.7838075, + "quality:hesitant": 0.103605, + "quality:enunciated": 0.21144249999999998, + "quality:monotone": 0.0, + "quality:singsong": 0.177395 + } + } +} diff --git a/steering/ears_styles_mect60k/eval/rate_extension.json b/steering/ears_styles_mect60k/eval/rate_extension.json new file mode 100644 index 0000000000000000000000000000000000000000..6f414b54f068213f2aec68f0362d2c895a125df0 --- /dev/null +++ b/steering/ears_styles_mect60k/eval/rate_extension.json @@ -0,0 +1,1526 @@ +{ + "row_edges": [ + 10.117, + 12.123, + 13.286, + 14.25, + 15.14, + 16.079, + 17.094, + 18.489, + 21.208 + ], + "nominal_step": 1.0969352571650484, + "below": [ + 9.222969116834363, + 8.407942999909105, + 7.664940063681461, + 6.9875956795216485, + 6.370107655743144, + 5.807186535517363, + 5.2940102869203285, + 4.8261829969822685 + ], + "above": [ + 23.263802933956345, + 25.51888565399641, + 27.992565397432017, + 30.706031922941524 + ], + "direction": "delivery.tempo", + "thresholds": { + "identity": 0.8, + "wer_slack": [ + 0.02, + 0.5 + ], + "collapse_slack": 0.035, + "ratio": "within one achieved-ladder step of the target" + }, + "languages": { + "en": { + "tts_language": "en_us", + "dose_curve": "en", + "achieved_step": 1.074724216062034, + "unsteered": { + "n": 32, + "rate": 17.4905007766228, + "log_ratio": 0.0, + "sd": 0.0, + "wer": 0.001838235294117647, + "collapse": 0.0, + "identity": 0.9295600568052615 + }, + "row": { + "0": { + "n": 32, + "rate": 12.256778607504412, + "log_ratio": -0.35557878112830993, + "sd": 0.18017613041743952, + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9118098998099293 + }, + "9": { + "n": 32, + "rate": 23.44496849784591, + "log_ratio": 0.2929979880898362, + "sd": 0.10598526850105817, + "wer": 0.0017857142857142857, + "collapse": 0.0, + "identity": 0.8945271957263521 + } + }, + "buckets": { + "-1": { + "dose": -0.851, + "target": 0.6520442399997715, + "achieved": 0.6800631891112464, + "sd": 0.11389603366360451, + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9033986421821634, + "failed": [], + "kept": true + }, + "-2": { + "dose": -0.986, + "target": 0.6067084283156553, + "achieved": 0.6307242439294143, + "sd": 0.1655479464651764, + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9050146747009501, + "failed": [], + "kept": true + }, + "-3": { + "dose": -1.111, + "target": 0.5645247583037949, + "achieved": 0.5732210375883222, + "sd": 0.14414788253336167, + "wer": 0.0, + "collapse": 0.0, + "identity": 0.8989113025944735, + "failed": [], + "kept": true + }, + "-4": { + "dose": -1.235, + "target": 0.5252740655386983, + "achieved": 0.5535769099252288, + "sd": 0.19228845386688428, + "wer": 0.0036502100840336135, + "collapse": 0.0, + "identity": 0.89282925616883, + "failed": [], + "kept": true + }, + "-5": { + "dose": -1.358, + "target": 0.48875242382030676, + "achieved": 0.4870665804482327, + "sd": 0.21398889196257187, + "wer": 0.0008928571428571428, + "collapse": 0.0, + "identity": 0.8905011066248373, + "failed": [], + "kept": true + }, + "-6": { + "dose": -1.482, + "target": 0.45477008567944605, + "achieved": 0.45068583358304404, + "sd": 0.2067123027373433, + "wer": 0.002537593984962406, + "collapse": 0.0, + "identity": 0.8862385991223473, + "failed": [], + "kept": true + }, + "-7": { + "dose": -1.587, + "target": 0.42315049654859205, + "achieved": 0.44092867705468713, + "sd": 0.24576619551659823, + "wer": 0.0008928571428571428, + "collapse": 0.0, + "identity": 0.877659902864377, + "failed": [], + "kept": true + }, + "-8": { + "dose": -1.689, + "target": 0.39372937747609793, + "achieved": 0.42998504140517463, + "sd": 0.20811972414529695, + "wer": 0.00319693094629156, + "collapse": 0.0, + "identity": 0.8768059874989219, + "failed": [ + "ratio" + ], + "kept": false + }, + "10": { + "dose": 1.398, + "target": 1.4406034287550984, + "achieved": 1.4515009414716507, + "sd": 0.08819996166922493, + "wer": 0.0, + "collapse": 0.0, + "identity": 0.8706447195991145, + "failed": [], + "kept": true + }, + "11": { + "dose": 1.795, + "target": 1.5482513906251014, + "achieved": 1.5401043163068295, + "sd": 0.08695213694004077, + "wer": 0.001838235294117647, + "collapse": 0.0, + "identity": 0.8533202188136138, + "failed": [], + "kept": true + }, + "12": { + "dose": 2.243, + "target": 1.6639432620565164, + "achieved": 1.6474660095354956, + "sd": 0.1152995795442214, + "wer": 0.011817226890756302, + "collapse": 0.0, + "identity": 0.8254270063531985, + "failed": [], + "kept": true + } + }, + "kept": { + "-7": -1.587, + "-6": -1.482, + "-5": -1.358, + "-4": -1.235, + "-3": -1.111, + "-2": -0.986, + "-1": -0.851, + "10": 1.398, + "11": 1.795, + "12": 2.243 + } + }, + "fr": { + "tts_language": "fr_fr", + "dose_curve": "fr", + "achieved_step": 1.0826926555050682, + "unsteered": { + "n": 32, + "rate": 19.06663916749805, + "log_ratio": 0.0, + "sd": 0.0, + "wer": 0.09359988512949038, + "collapse": 0.0, + "identity": 0.9163481009515589 + }, + "row": { + "0": { + "n": 32, + "rate": 12.46633439340036, + "log_ratio": -0.4249084049911328, + "sd": 0.26827810089538573, + "wer": 0.06210186925647452, + "collapse": 0.0, + "identity": 0.9066120617779196 + }, + "9": { + "n": 32, + "rate": 25.48504992463002, + "log_ratio": 0.29015183531854305, + "sd": 0.1405155219204883, + "wer": 0.08358787593984962, + "collapse": 0.0, + "identity": 0.8825201321385792 + } + }, + "buckets": { + "-1": { + "dose": -0.987, + "target": 0.6038922187170824, + "achieved": 0.6099952877224253, + "sd": 0.16331358048345518, + "wer": 0.06036575814536341, + "collapse": 0.0, + "identity": 0.8859374770463199, + "failed": [], + "kept": true + }, + "-2": { + "dose": -1.124, + "target": 0.557768832776806, + "achieved": 0.5636058688397262, + "sd": 0.2753262310496915, + "wer": 0.07810541979949875, + "collapse": 0.0, + "identity": 0.8893049247181175, + "failed": [], + "kept": true + }, + "-3": { + "dose": -1.26, + "target": 0.5151682058068555, + "achieved": 0.535916257559619, + "sd": 0.19151377118352708, + "wer": 0.07804015246449456, + "collapse": 0.0, + "identity": 0.8922100169705602, + "failed": [], + "kept": true + }, + "-4": { + "dose": -1.397, + "target": 0.4758212805706466, + "achieved": 0.4840904575968762, + "sd": 0.2543198326117081, + "wer": 0.09620405179615706, + "collapse": 0.03125, + "identity": 0.8771004051182867, + "failed": [], + "kept": true + }, + "-5": { + "dose": -1.526, + "target": 0.43947954957603313, + "achieved": 0.4403173907815133, + "sd": 0.30268616664565723, + "wer": 0.12259163533834587, + "collapse": 0.0625, + "identity": 0.8663126754973003, + "failed": [ + "collapse" + ], + "kept": false + }, + "-6": { + "dose": -1.633, + "target": 0.4059134855505407, + "achieved": 0.40850866294756377, + "sd": 0.34075750607569755, + "wer": 0.16558975563909772, + "collapse": 0.125, + "identity": 0.8576547217753461, + "failed": [ + "wer", + "collapse" + ], + "kept": false + }, + "-7": { + "dose": -1.739, + "target": 0.3749110917919592, + "achieved": 0.38155968712628224, + "sd": 0.28733634083795395, + "wer": 0.10080539891395154, + "collapse": 0.03125, + "identity": 0.862779760855785, + "failed": [], + "kept": false + }, + "-8": { + "dose": -1.846, + "target": 0.3462765632385913, + "achieved": 0.3628887946806404, + "sd": 0.26936198463462596, + "wer": 0.15954600041771091, + "collapse": 0.09375, + "identity": 0.854976623657462, + "failed": [ + "wer", + "collapse" + ], + "kept": false + }, + "10": { + "dose": 1.443, + "target": 1.4471599392100767, + "achieved": 1.4270817617385405, + "sd": 0.10660531489673213, + "wer": 0.09841008771929824, + "collapse": 0.0, + "identity": 0.8555135345791729, + "failed": [], + "kept": true + }, + "11": { + "dose": 1.927, + "target": 1.5668294375239111, + "achieved": 1.5221600467221927, + "sd": 0.1062231125903001, + "wer": 0.11623459690893902, + "collapse": 0.0, + "identity": 0.8385740544022252, + "failed": [], + "kept": true + }, + "12": { + "dose": 2.63, + "target": 1.6963947244362758, + "achieved": 1.6437600357207045, + "sd": 0.11717328655940977, + "wer": 0.14454756683375103, + "collapse": 0.03125, + "identity": 0.8012998957200909, + "failed": [ + "wer" + ], + "kept": false + } + }, + "kept": { + "-4": -1.397, + "-3": -1.26, + "-2": -1.124, + "-1": -0.987, + "10": 1.443, + "11": 1.927 + } + }, + "de": { + "tts_language": "de", + "dose_curve": "own", + "achieved_step": 1.0687966194052407, + "unsteered": { + "n": 32, + "rate": 17.482155140713044, + "log_ratio": 0.0, + "sd": 0.0, + "wer": 0.04359546703296703, + "collapse": 0.0, + "identity": 0.923862476549429 + }, + "row": { + "0": { + "n": 32, + "rate": 12.74608299930831, + "log_ratio": -0.3159566457668981, + "sd": 0.16118740900257394, + "wer": 0.02581845238095238, + "collapse": 0.0, + "identity": 0.9079688561881312 + }, + "9": { + "n": 32, + "rate": 23.197030063793576, + "log_ratio": 0.282843601555668, + "sd": 0.13457171917265337, + "wer": 0.05778388278388279, + "collapse": 0.0, + "identity": 0.8893241378718995 + } + }, + "buckets": { + "-1": { + "dose": -0.815, + "target": 0.6821607080604999, + "achieved": 0.7011529511078799, + "sd": 0.15317322723572682, + "wer": 0.04387019230769231, + "collapse": 0.0, + "identity": 0.9158792465938439, + "failed": [], + "kept": true + }, + "-2": { + "dose": -0.949, + "target": 0.6382511842525341, + "achieved": 0.6576714337884391, + "sd": 0.10945681252782449, + "wer": 0.03630952380952381, + "collapse": 0.0, + "identity": 0.9040194462439162, + "failed": [], + "kept": true + }, + "-3": { + "dose": -1.062, + "target": 0.5971680417624312, + "achieved": 0.5954100782549119, + "sd": 0.16624919286238313, + "wer": 0.0415922619047619, + "collapse": 0.0, + "identity": 0.898769256337186, + "failed": [], + "kept": true + }, + "-4": { + "dose": -1.188, + "target": 0.5587293512349811, + "achieved": 0.552961120417334, + "sd": 0.16050431238256677, + "wer": 0.047367216117216115, + "collapse": 0.0, + "identity": 0.900497496944628, + "failed": [], + "kept": true + }, + "-5": { + "dose": -1.327, + "target": 0.522764893797943, + "achieved": 0.5053921418178121, + "sd": 0.19768150604396859, + "wer": 0.036057692307692304, + "collapse": 0.0, + "identity": 0.8946682457964537, + "failed": [], + "kept": true + }, + "-6": { + "dose": -1.409, + "target": 0.48911540727818625, + "achieved": 0.5056663034192984, + "sd": 0.19887380234916788, + "wer": 0.05817880036630037, + "collapse": 0.0, + "identity": 0.8928334368299071, + "failed": [ + "monotone" + ], + "kept": false + }, + "-7": { + "dose": -1.497, + "target": 0.45763188093761653, + "achieved": 0.4594782040636973, + "sd": 0.19684843342217367, + "wer": 0.06266597985347985, + "collapse": 0.0, + "identity": 0.8926868109744773, + "failed": [], + "kept": false + }, + "-8": { + "dose": -1.678, + "target": 0.4281748956057492, + "achieved": 0.38844341036814173, + "sd": 0.2488744375237413, + "wer": 0.09232486263736264, + "collapse": 0.03125, + "identity": 0.8845323154181978, + "failed": [ + "ratio", + "wer" + ], + "kept": false + }, + "10": { + "dose": 1.38, + "target": 1.4181836914766721, + "achieved": 1.428405088248348, + "sd": 0.1221531404483494, + "wer": 0.07452495421245423, + "collapse": 0.0, + "identity": 0.8619626891676204, + "failed": [ + "wer" + ], + "kept": false + }, + "11": { + "dose": 1.753, + "target": 1.515749935145912, + "achieved": 1.4784278445378614, + "sd": 0.12895576717816745, + "wer": 0.0798992673992674, + "collapse": 0.0, + "identity": 0.8435941829037031, + "failed": [ + "wer" + ], + "kept": false + }, + "12": { + "dose": 2.353, + "target": 1.6200284065476638, + "achieved": 1.6265117558172288, + "sd": 0.12851135885708856, + "wer": 0.11991758241758241, + "collapse": 0.03125, + "identity": 0.8244141866958162, + "failed": [ + "wer" + ], + "kept": false + } + }, + "kept": { + "-5": -1.327, + "-4": -1.188, + "-3": -1.062, + "-2": -0.949, + "-1": -0.815 + } + }, + "es": { + "tts_language": "es", + "dose_curve": "own", + "achieved_step": 1.0708141790477665, + "unsteered": { + "n": 32, + "rate": 16.454505183767676, + "log_ratio": 0.0, + "sd": 0.0, + "wer": 0.0400390625, + "collapse": 0.0, + "identity": 0.9315974596393326 + }, + "row": { + "0": { + "n": 32, + "rate": 12.074521950885373, + "log_ratio": -0.3095017023029819, + "sd": 0.16783819962671123, + "wer": 0.036675347222222224, + "collapse": 0.0, + "identity": 0.9169435067031242 + }, + "9": { + "n": 32, + "rate": 22.35100029240285, + "log_ratio": 0.30627176480114904, + "sd": 0.07227249408086887, + "wer": 0.043979577850877194, + "collapse": 0.0, + "identity": 0.8945498401456344 + } + }, + "buckets": { + "-1": { + "dose": -0.749, + "target": 0.685284652168872, + "achieved": 0.7075126810908515, + "sd": 0.16142087062340696, + "wer": 0.03515625, + "collapse": 0.0, + "identity": 0.9185203027911932, + "failed": [], + "kept": true + }, + "-2": { + "dose": -0.885, + "target": 0.6399659862351366, + "achieved": 0.6500664006694017, + "sd": 0.19922188675778923, + "wer": 0.04497327302631579, + "collapse": 0.0, + "identity": 0.9133536678159131, + "failed": [], + "kept": true + }, + "-3": { + "dose": -0.988, + "target": 0.5976442960479226, + "achieved": 0.584352124650961, + "sd": 0.21447807930921906, + "wer": 0.03325452302631579, + "collapse": 0.0, + "identity": 0.9106506658731306, + "failed": [], + "kept": true + }, + "-4": { + "dose": -1.085, + "target": 0.5581213881379348, + "achieved": 0.578296783855252, + "sd": 0.17030937994069403, + "wer": 0.0390625, + "collapse": 0.0, + "identity": 0.9056826976077272, + "failed": [], + "kept": true + }, + "-5": { + "dose": -1.196, + "target": 0.5212121757990266, + "achieved": 0.5017593220562905, + "sd": 0.2705462384721378, + "wer": 0.07096354166666667, + "collapse": 0.0, + "identity": 0.9040673383670828, + "failed": [ + "wer" + ], + "kept": false + }, + "-6": { + "dose": -1.34, + "target": 0.4867438123228068, + "achieved": 0.4868498697887758, + "sd": 0.21707940446562363, + "wer": 0.051432291666666664, + "collapse": 0.0, + "identity": 0.895853525694511, + "failed": [], + "kept": false + }, + "-7": { + "dose": -1.437, + "target": 0.45455488155344476, + "achieved": 0.42980405831458685, + "sd": 0.27781333238051453, + "wer": 0.0754123263888889, + "collapse": 0.0, + "identity": 0.8923616829029668, + "failed": [ + "wer" + ], + "kept": false + }, + "-8": { + "dose": -1.505, + "target": 0.4244946419720205, + "achieved": 0.4188207176552169, + "sd": 0.29167348003321664, + "wer": 0.07823350694444445, + "collapse": 0.0, + "identity": 0.8891599640776171, + "failed": [ + "wer" + ], + "kept": false + }, + "10": { + "dose": 1.457, + "target": 1.4545419483422908, + "achieved": 1.4570098096200033, + "sd": 0.09116879054572377, + "wer": 0.05622372989766082, + "collapse": 0.0, + "identity": 0.8786989081310798, + "failed": [], + "kept": true + }, + "11": { + "dose": 1.996, + "target": 1.557544142304689, + "achieved": 1.5855384315364216, + "sd": 0.10210945821103667, + "wer": 0.06794247989766082, + "collapse": 0.0, + "identity": 0.8465707319567328, + "failed": [ + "wer" + ], + "kept": false + } + }, + "kept": { + "-4": -1.085, + "-3": -0.988, + "-2": -0.885, + "-1": -0.749, + "10": 1.457 + } + }, + "it": { + "tts_language": "it", + "dose_curve": "own", + "achieved_step": 1.069085184559761, + "unsteered": { + "n": 32, + "rate": 14.461970983850122, + "log_ratio": 0.0, + "sd": 0.0, + "wer": 0.07942414630325814, + "collapse": 0.0, + "identity": 0.9291893711601537 + }, + "row": { + "0": { + "n": 32, + "rate": 11.63851629838166, + "log_ratio": -0.21720254497481753, + "sd": 0.14281664353184043, + "wer": 0.06194196428571429, + "collapse": 0.0, + "identity": 0.9112384034378866 + }, + "9": { + "n": 32, + "rate": 21.232856230108748, + "log_ratio": 0.3840272907390596, + "sd": 0.13074014647551072, + "wer": 0.1449297070802005, + "collapse": 0.0625, + "identity": 0.8795942623046954 + } + }, + "buckets": { + "-1": { + "dose": -0.544, + "target": 0.7527622334658306, + "achieved": 0.7887593264819759, + "sd": 0.15487995354159892, + "wer": 0.08733258928571429, + "collapse": 0.0, + "identity": 0.9133250400442443, + "failed": [], + "kept": true + }, + "-2": { + "dose": -0.673, + "target": 0.7041181042797922, + "achieved": 0.7128231818853639, + "sd": 0.16485625851711308, + "wer": 0.07500000000000001, + "collapse": 0.0, + "identity": 0.9044437046722544, + "failed": [], + "kept": true + }, + "-3": { + "dose": -0.801, + "target": 0.6586173996693642, + "achieved": 0.6961423622415123, + "sd": 0.17825613344533464, + "wer": 0.08508967731829574, + "collapse": 0.0, + "identity": 0.9037046192280046, + "failed": [], + "kept": true + }, + "-4": { + "dose": -0.949, + "target": 0.616056988892402, + "achieved": 0.6303278851401793, + "sd": 0.19409584447540656, + "wer": 0.08003015350877193, + "collapse": 0.0, + "identity": 0.9040077353755926, + "failed": [], + "kept": true + }, + "-5": { + "dose": -1.105, + "target": 0.5762468676863091, + "achieved": 0.6307310101874364, + "sd": 0.3276139935948215, + "wer": 0.10634006892230576, + "collapse": 0.03125, + "identity": 0.8915961235576244, + "failed": [ + "ratio", + "monotone" + ], + "kept": false + }, + "-6": { + "dose": -1.173, + "target": 0.53900931002388, + "achieved": 0.5473611669856757, + "sd": 0.1481178983674585, + "wer": 0.1035234570802005, + "collapse": 0.03125, + "identity": 0.8918611137526284, + "failed": [], + "kept": false + }, + "-7": { + "dose": -1.244, + "target": 0.5041780746833928, + "achieved": 0.5175057835601216, + "sd": 0.1945465334348485, + "wer": 0.09926084743107769, + "collapse": 0.0, + "identity": 0.8936760374369321, + "failed": [], + "kept": false + }, + "-8": { + "dose": -1.316, + "target": 0.4715976630908121, + "achieved": 0.471427623411909, + "sd": 0.277841054038213, + "wer": 0.1015967653508772, + "collapse": 0.0, + "identity": 0.8835936021486623, + "failed": [], + "kept": false + }, + "10": { + "dose": 1.764, + "target": 1.5696153758603009, + "achieved": 1.556317616990085, + "sd": 0.11711451365411563, + "wer": 0.15693530701754385, + "collapse": 0.09375, + "identity": 0.849725137169262, + "failed": [ + "wer", + "collapse" + ], + "kept": false + }, + "11": { + "dose": 2.24, + "target": 1.6780525437894485, + "achieved": 1.6510245732036366, + "sd": 0.12954284072448774, + "wer": 0.16839070332080203, + "collapse": 0.0625, + "identity": 0.8213425762791075, + "failed": [ + "wer", + "collapse" + ], + "kept": false + } + }, + "kept": { + "-4": -0.949, + "-3": -0.801, + "-2": -0.673, + "-1": -0.544 + } + }, + "pt": { + "tts_language": "pt_br", + "dose_curve": "own", + "achieved_step": 1.0770924929708898, + "unsteered": { + "n": 32, + "rate": 15.932957195515904, + "log_ratio": 0.0, + "sd": 0.0, + "wer": 0.06171875, + "collapse": 0.0, + "identity": 0.9324853560037409 + }, + "row": { + "0": { + "n": 32, + "rate": 11.322070301478393, + "log_ratio": -0.3416357986985683, + "sd": 0.2148292024629257, + "wer": 0.08014632936507937, + "collapse": 0.03125, + "identity": 0.916957003889644 + }, + "9": { + "n": 32, + "rate": 22.090362269851934, + "log_ratio": 0.32675167344457007, + "sd": 0.10276038006749429, + "wer": 0.10018601190476191, + "collapse": 0.0, + "identity": 0.8954070585627636 + } + }, + "buckets": { + "-1": { + "dose": -0.841, + "target": 0.6597455336511562, + "achieved": 0.6737357575650169, + "sd": 0.18567712745435233, + "wer": 0.053298611111111116, + "collapse": 0.0, + "identity": 0.915467670588626, + "failed": [], + "kept": true + }, + "-2": { + "dose": -0.977, + "target": 0.612524493445696, + "achieved": 0.5931623996072042, + "sd": 0.2329580987495836, + "wer": 0.055933779761904764, + "collapse": 0.0, + "identity": 0.9089339930586908, + "failed": [], + "kept": true + }, + "-3": { + "dose": -1.081, + "target": 0.5686832815594143, + "achieved": 0.5663571650632385, + "sd": 0.19508255307364336, + "wer": 0.059728422619047615, + "collapse": 0.0, + "identity": 0.9114367053752502, + "failed": [], + "kept": true + }, + "-4": { + "dose": -1.152, + "target": 0.5279799880424789, + "achieved": 0.5520323465884326, + "sd": 0.19449299442212667, + "wer": 0.09339037698412699, + "collapse": 0.03125, + "identity": 0.9062549189379383, + "failed": [ + "wer" + ], + "kept": false + }, + "-5": { + "dose": -1.232, + "target": 0.4901900175593819, + "achieved": 0.5013739434161152, + "sd": 0.3473933921971316, + "wer": 0.10218253968253968, + "collapse": 0.03125, + "identity": 0.895690663080388, + "failed": [ + "wer" + ], + "kept": false + }, + "-6": { + "dose": -1.327, + "target": 0.4551048501018845, + "achieved": 0.44017375905918316, + "sd": 0.3051639101613576, + "wer": 0.0880766369047619, + "collapse": 0.03125, + "identity": 0.904192936380371, + "failed": [], + "kept": false + }, + "-7": { + "dose": -1.522, + "target": 0.4225308904034711, + "achieved": 0.40040573124849665, + "sd": 0.2659885857965901, + "wer": 0.14049479166666667, + "collapse": 0.03125, + "identity": 0.8910980544880471, + "failed": [ + "wer" + ], + "kept": false + }, + "-8": { + "dose": -1.618, + "target": 0.3922883997065335, + "achieved": 0.39142407335930735, + "sd": 0.2550186232605914, + "wer": 0.13232886904761904, + "collapse": 0.03125, + "identity": 0.8957681340046966, + "failed": [ + "wer" + ], + "kept": false + }, + "10": { + "dose": 1.552, + "target": 1.493342577645359, + "achieved": 1.4990606557373998, + "sd": 0.08257738470048503, + "wer": 0.08630952380952381, + "collapse": 0.0, + "identity": 0.8767878695486857, + "failed": [], + "kept": true + }, + "11": { + "dose": 2.043, + "target": 1.6084680798156146, + "achieved": 1.5912845011557464, + "sd": 0.09381954369493119, + "wer": 0.10187872023809524, + "collapse": 0.0, + "identity": 0.8694030420227515, + "failed": [ + "wer" + ], + "kept": false + } + }, + "kept": { + "-3": -1.081, + "-2": -0.977, + "-1": -0.841, + "10": 1.552 + } + }, + "ja": { + "tts_language": "ja", + "dose_curve": "own", + "achieved_step": 1.0471681782832594, + "unsteered": { + "n": 32, + "rate": 20.170177607703444, + "log_ratio": 0.0, + "sd": 0.0, + "wer": 0.03146472953216375, + "collapse": 0.0, + "identity": 0.948758282601562 + }, + "row": { + "0": { + "n": 32, + "rate": 15.717625334778196, + "log_ratio": -0.24942244200373373, + "sd": 0.136711918027436, + "wer": 0.03532757675438596, + "collapse": 0.0, + "identity": 0.9328792947501502 + }, + "9": { + "n": 32, + "rate": 23.797693041691428, + "log_ratio": 0.16538348749249476, + "sd": 0.07061674993815975, + "wer": 0.033813048245614034, + "collapse": 0.0, + "identity": 0.9241490932179344 + } + }, + "buckets": { + "-1": { + "dose": -1.027, + "target": 0.7441504925094651, + "achieved": 0.7721804938471104, + "sd": 0.10821452067889491, + "wer": 0.03047560307017544, + "collapse": 0.0, + "identity": 0.9299117055751499, + "failed": [], + "kept": true + }, + "-2": { + "dose": -1.143, + "target": 0.7106313082674406, + "achieved": 0.721059809268753, + "sd": 0.10875615042139479, + "wer": 0.035631396198830406, + "collapse": 0.0, + "identity": 0.9283643320481383, + "failed": [], + "kept": true + }, + "-3": { + "dose": -1.252, + "target": 0.6786219472716011, + "achieved": 0.6932324140359712, + "sd": 0.12500689984440141, + "wer": 0.0283077485380117, + "collapse": 0.0, + "identity": 0.9242805853822391, + "failed": [], + "kept": true + }, + "-4": { + "dose": -1.42, + "target": 0.6480544017142905, + "achieved": 0.6350654282248055, + "sd": 0.15995067564264223, + "wer": 0.03698145102339181, + "collapse": 0.0, + "identity": 0.9165022958392277, + "failed": [], + "kept": true + }, + "-5": { + "dose": -1.519, + "target": 0.6188637271013324, + "achieved": 0.6037038772820937, + "sd": 0.19373774944859798, + "wer": 0.04161412646198831, + "collapse": 0.0, + "identity": 0.9179855744281071, + "failed": [], + "kept": true + }, + "-6": { + "dose": -1.609, + "target": 0.5909879042694989, + "achieved": 0.5931743665146412, + "sd": 0.18189916897773759, + "wer": 0.06750502558479532, + "collapse": 0.03125, + "identity": 0.9108913703272593, + "failed": [ + "wer" + ], + "kept": false + }, + "-7": { + "dose": -1.691, + "target": 0.564367707619202, + "achieved": 0.5562912098606059, + "sd": 0.21149910100097416, + "wer": 0.04349186769005848, + "collapse": 0.0, + "identity": 0.9086797117313333, + "failed": [], + "kept": false + }, + "-8": { + "dose": -1.754, + "target": 0.5389465792824544, + "achieved": 0.5501986903871481, + "sd": 0.1811198893863976, + "wer": 0.07249862938596491, + "collapse": 0.03125, + "identity": 0.9029714428813158, + "failed": [ + "wer" + ], + "kept": false + }, + "10": { + "dose": 0.92, + "target": 1.235496650277121, + "achieved": 1.1785184266977684, + "sd": 0.07092473298572198, + "wer": 0.041173245614035084, + "collapse": 0.0, + "identity": 0.9200430467980598, + "failed": [ + "ratio", + "monotone" + ], + "kept": false + }, + "11": { + "dose": 1.12, + "target": 1.293772776545762, + "achieved": 1.2251137279564557, + "sd": 0.08300275048775288, + "wer": 0.047633406432748535, + "collapse": 0.0, + "identity": 0.9186595545533045, + "failed": [ + "ratio" + ], + "kept": false + }, + "12": { + "dose": 1.32, + "target": 1.3547976815279, + "achieved": 1.2523762395961329, + "sd": 0.07831942584369588, + "wer": 0.05005482456140351, + "collapse": 0.0, + "identity": 0.9127387159809026, + "failed": [ + "ratio" + ], + "kept": false + }, + "13": { + "dose": 1.962, + "target": 1.4187010201079544, + "achieved": 1.3629115074110427, + "sd": 0.08703027803229853, + "wer": 0.06404650950292398, + "collapse": 0.0, + "identity": 0.8959396083010862, + "failed": [ + "wer" + ], + "kept": false + } + }, + "kept": { + "-5": -1.519, + "-4": -1.42, + "-3": -1.252, + "-2": -1.143, + "-1": -1.027 + } + }, + "zh": { + "tts_language": "cmn", + "dose_curve": "own", + "achieved_step": 1.0867207457937427, + "unsteered": { + "n": 32, + "rate": 16.48188828162185, + "log_ratio": 0.0, + "sd": 0.0, + "wer": 0.013194933145672062, + "collapse": 0.0, + "identity": 0.9297157749400713 + }, + "row": { + "0": { + "n": 32, + "rate": 12.713859499518643, + "log_ratio": -0.25956940050785193, + "sd": 0.13482981408241984, + "wer": 0.010841836734693876, + "collapse": 0.0, + "identity": 0.9200946180963309 + }, + "9": { + "n": 32, + "rate": 26.87441560996368, + "log_ratio": 0.4889126433528518, + "sd": 0.6685270939111458, + "wer": 0.11165112596762843, + "collapse": 0.09375, + "identity": 0.8324312469349091 + } + }, + "buckets": { + "-1": { + "dose": -0.977, + "target": 0.7098269492907262, + "achieved": 0.715790448766341, + "sd": 0.12518931780963494, + "wer": 0.011479591836734693, + "collapse": 0.0, + "identity": 0.9186884353460282, + "failed": [], + "kept": true + }, + "-2": { + "dose": -1.176, + "target": 0.6531824776863604, + "achieved": 0.6434627866640004, + "sd": 0.10719805032048595, + "wer": 0.01211734693877551, + "collapse": 0.0, + "identity": 0.9127677587166899, + "failed": [], + "kept": true + }, + "-3": { + "dose": -1.306, + "target": 0.6010582573440013, + "achieved": 0.5959350314811606, + "sd": 0.14314274172927777, + "wer": 0.010841836734693876, + "collapse": 0.0, + "identity": 0.912925422036895, + "failed": [], + "kept": true + }, + "-4": { + "dose": -1.438, + "target": 0.5530935704231794, + "achieved": 0.5881336894398675, + "sd": 0.16130797940930347, + "wer": 0.01618684758386113, + "collapse": 0.0, + "identity": 0.9167326002367948, + "failed": [], + "kept": true + }, + "-5": { + "dose": -1.647, + "target": 0.5089564845099179, + "achieved": 0.50628636784767, + "sd": 0.16286759655739208, + "wer": 0.012755102040816327, + "collapse": 0.0, + "identity": 0.9097509886841186, + "failed": [], + "kept": true + }, + "-6": { + "dose": -1.743, + "target": 0.46834155552830203, + "achieved": 0.4747314678041427, + "sd": 0.24266763277517356, + "wer": 0.020643033075299085, + "collapse": 0.0, + "identity": 0.9049469053124382, + "failed": [], + "kept": true + } + }, + "kept": { + "-6": -1.743, + "-5": -1.647, + "-4": -1.438, + "-3": -1.306, + "-2": -1.176, + "-1": -0.977 + } + }, + "ko": { + "tts_language": "ko", + "dose_curve": "own", + "achieved_step": 1.0704041979950287, + "unsteered": { + "n": 32, + "rate": 19.643416373827375, + "log_ratio": 0.0, + "sd": 0.0, + "wer": 0.02487180075047191, + "collapse": 0.0, + "identity": 0.9362988867431299 + }, + "row": { + "0": { + "n": 32, + "rate": 13.843358655826135, + "log_ratio": -0.3499366393941538, + "sd": 0.1613519559739027, + "wer": 0.03478013637648929, + "collapse": 0.0, + "identity": 0.9188953260319681 + }, + "9": { + "n": 32, + "rate": 25.537107454589393, + "log_ratio": 0.2623903511064763, + "sd": 0.5298112659553568, + "wer": 0.05230543710021321, + "collapse": 0.03125, + "identity": 0.8859137050455916 + } + }, + "buckets": { + "-1": { + "dose": -1.066, + "target": 0.6583800230955578, + "achieved": 0.6481290672519394, + "sd": 0.13085461100229834, + "wer": 0.03511633699780667, + "collapse": 0.0, + "identity": 0.9137146025352063, + "failed": [], + "kept": true + }, + "-2": { + "dose": -1.139, + "target": 0.6150760846498619, + "achieved": 0.619712611749329, + "sd": 0.16421315188010865, + "wer": 0.03572449532292454, + "collapse": 0.0, + "identity": 0.9079778391450066, + "failed": [], + "kept": true + }, + "-3": { + "dose": -1.247, + "target": 0.5746203964838322, + "achieved": 0.5863177695355126, + "sd": 0.1696168555689674, + "wer": 0.05817494707720996, + "collapse": 0.0, + "identity": 0.9035272399940131, + "failed": [ + "wer" + ], + "kept": false + }, + "-4": { + "dose": -1.442, + "target": 0.5368256192942369, + "achieved": 0.5367634978026409, + "sd": 0.2220793976906988, + "wer": 0.06352155791702012, + "collapse": 0.0, + "identity": 0.9011152956637767, + "failed": [ + "wer" + ], + "kept": false + }, + "-5": { + "dose": -1.557, + "target": 0.501516735733813, + "achieved": 0.5014349200842227, + "sd": 0.2257380997788172, + "wer": 0.06466724318117553, + "collapse": 0.0, + "identity": 0.8954075478593553, + "failed": [ + "wer" + ], + "kept": false + }, + "-6": { + "dose": -1.615, + "target": 0.46853023995347054, + "achieved": 0.4365385165711044, + "sd": 0.32052924745060585, + "wer": 0.08304698664893657, + "collapse": 0.0, + "identity": 0.8805467572117338, + "failed": [ + "ratio", + "wer" + ], + "kept": false + }, + "-7": { + "dose": -1.673, + "target": 0.43771338045111674, + "achieved": 0.43200737156336905, + "sd": 0.27327439399372694, + "wer": 0.07698606143629014, + "collapse": 0.0, + "identity": 0.8869438286122328, + "failed": [ + "wer" + ], + "kept": false + }, + "-8": { + "dose": -1.73, + "target": 0.4089234527209409, + "achieved": 0.4057472200626012, + "sd": 0.3050350914278698, + "wer": 0.13258078367761805, + "collapse": 0.03125, + "identity": 0.8643823945972791, + "failed": [ + "wer" + ], + "kept": false + }, + "10": { + "dose": 1.268, + "target": 1.3915617580892627, + "achieved": 1.4228319765722257, + "sd": 0.5102595821856852, + "wer": 0.07284358736272555, + "collapse": 0.03125, + "identity": 0.8693599805518077, + "failed": [ + "wer" + ], + "kept": false + }, + "11": { + "dose": 1.689, + "target": 1.4895335476280893, + "achieved": 1.486078447005942, + "sd": 0.505669246767693, + "wer": 0.07721574777800704, + "collapse": 0.03125, + "identity": 0.861718742480636, + "failed": [ + "wer" + ], + "kept": false + }, + "12": { + "dose": 2.371, + "target": 1.594402962435535, + "achieved": 1.6336722953194789, + "sd": 0.5144827093065352, + "wer": 0.09143379206119938, + "collapse": 0.0625, + "identity": 0.8322575005122229, + "failed": [ + "wer", + "collapse" + ], + "kept": false + } + }, + "kept": { + "-2": -1.139, + "-1": -1.066 + } + } + } +} diff --git a/steering/ears_styles_mect60k/eval/tempo.json b/steering/ears_styles_mect60k/eval/tempo.json new file mode 100644 index 0000000000000000000000000000000000000000..2d48e66e093eb194ac5d2ace244b45dc2ab9c83d --- /dev/null +++ b/steering/ears_styles_mect60k/eval/tempo.json @@ -0,0 +1,751 @@ +{ + "all": { + "neutral": { + "wer": 0.004866946778711485, + "collapse": 0.0, + "identity": 0.9463956918186919, + "durx": 1.0, + "female": 0.4983073752615989, + "age": 41.317688735822834, + "f0": 136.19757792145845, + "f0_st": 2.903048200564409, + "voiced": 0.6307535235563585, + "rms_db": -38.16175572077433, + "snr_db": 39.82410788536072, + "bandwidth": 8300.152587890625, + "flow:disfluent": 0.09457541666666668 + }, + "tempo -4": { + "wer": 0.5856922517290669, + "collapse": 0.6666666666666666, + "identity": 0.7230682771546011, + "durx": 2.880553578158369, + "female": 0.5093518091889564, + "age": 48.70579664905866, + "f0": 113.61445699801243, + "f0_st": 4.519904128193783, + "voiced": 0.6621293587300757, + "rms_db": -53.275464375813804, + "snr_db": 42.84227053324381, + "bandwidth": 10422.518920898438, + "flow:disfluent": 0.6726170833333334 + }, + "tempo -2": { + "wer": 0.03349934939650917, + "collapse": 0.0, + "identity": 0.8751764475914111, + "durx": 2.2116620417701185, + "female": 0.5050622309645405, + "age": 47.28456226487955, + "f0": 121.88906864923571, + "f0_st": 3.165366430509932, + "voiced": 0.6385324269821689, + "rms_db": -47.14699093500773, + "snr_db": 46.38646284739176, + "bandwidth": 8879.306030273438, + "flow:disfluent": 0.42075291666666664 + }, + "tempo -1": { + "wer": 0.0021929824561403508, + "collapse": 0.0, + "identity": 0.9153413980688866, + "durx": 1.4514864232209739, + "female": 0.5047970898158383, + "age": 42.98752217243115, + "f0": 129.26937730798906, + "f0_st": 3.0694009812707272, + "voiced": 0.6306512716980012, + "rms_db": -43.365065256754555, + "snr_db": 42.43683942159017, + "bandwidth": 8633.468627929688, + "flow:disfluent": 0.22507333333333332 + }, + "tempo +1": { + "wer": 0.0060224089635854345, + "collapse": 0.0, + "identity": 0.8995279389180544, + "durx": 0.7786952410967539, + "female": 0.4958526120947984, + "age": 38.80464180062214, + "f0": 147.0889402652358, + "f0_st": 2.726193238314806, + "voiced": 0.6733667459157732, + "rms_db": -35.14257828394572, + "snr_db": 33.55640689531962, + "bandwidth": 8628.533935546875, + "flow:disfluent": 0.076485 + }, + "tempo +2": { + "wer": 0.013445378151260505, + "collapse": 0.0, + "identity": 0.8570998892241922, + "durx": 0.6300829320492242, + "female": 0.49232131460060674, + "age": 36.45866475999355, + "f0": 158.71022313966407, + "f0_st": 2.5503545584480407, + "voiced": 0.7242372237826631, + "rms_db": -30.107327938079834, + "snr_db": 28.22616171836853, + "bandwidth": 9037.664794921875, + "flow:disfluent": 0.07022708333333333 + }, + "tempo +4": { + "wer": 0.0648462588696806, + "collapse": 0.0, + "identity": 0.7826433569795518, + "durx": 0.5492586256059311, + "female": 0.47865020268121344, + "age": 35.64165458083153, + "f0": 182.4435781202288, + "f0_st": 2.4160175237643178, + "voiced": 0.7823267126598944, + "rms_db": -26.141826629638672, + "snr_db": 22.327888250350952, + "bandwidth": 8957.363891601562, + "flow:disfluent": 0.08656958333333335 + } + }, + "American Female": { + "neutral": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.950361505518176, + "durx": 1.0, + "female": 0.9827781617641449, + "age": 29.750093817710876, + "f0": 155.81481265779422, + "f0_st": 1.8082626788764102, + "voiced": 0.678813494199399, + "rms_db": -29.80318832397461, + "snr_db": 38.62734889984131, + "bandwidth": 6026.605224609375, + "flow:disfluent": 0.08399 + }, + "tempo -4": { + "wer": 0.5049876930177105, + "collapse": 0.5, + "identity": 0.7564268755821835, + "durx": 2.5826785714285716, + "female": 0.9871469438076019, + "age": 33.0791637301445, + "f0": 153.7190995171655, + "f0_st": 2.8587991761488762, + "voiced": 0.6063681006112898, + "rms_db": -42.3856315612793, + "snr_db": 58.78636169433594, + "bandwidth": 6131.57958984375, + "flow:disfluent": 0.700325 + }, + "tempo -2": { + "wer": 0.007352941176470588, + "collapse": 0.0, + "identity": 0.8987316927885013, + "durx": 2.5210784313725494, + "female": 0.9836304783821106, + "age": 32.91188441216946, + "f0": 144.3470634375804, + "f0_st": 2.4163218687410692, + "voiced": 0.6949158265841731, + "rms_db": -37.52029228210449, + "snr_db": 62.174896240234375, + "bandwidth": 5636.31591796875, + "flow:disfluent": 0.4422125 + }, + "tempo -1": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9338355269643634, + "durx": 1.5193697478991597, + "female": 0.9852810651063919, + "age": 29.87491339445114, + "f0": 150.27952728991937, + "f0_st": 1.924135490947568, + "voiced": 0.6564805478819512, + "rms_db": -33.061819076538086, + "snr_db": 56.19734191894531, + "bandwidth": 5679.38232421875, + "flow:disfluent": 0.20769 + }, + "tempo +1": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9169926720113554, + "durx": 0.7638988095238095, + "female": 0.9695343971252441, + "age": 28.4675233066082, + "f0": 164.7702127527268, + "f0_st": 1.8004949327132147, + "voiced": 0.7371334275116648, + "rms_db": -27.58448076248169, + "snr_db": 35.52736854553223, + "bandwidth": 7157.098388671875, + "flow:disfluent": 0.064505 + }, + "tempo +2": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.864773039627267, + "durx": 0.6333333333333333, + "female": 0.9655077904462814, + "age": 28.696220368146896, + "f0": 169.54516572421255, + "f0_st": 1.8341168357101116, + "voiced": 0.766313282593923, + "rms_db": -23.410785675048828, + "snr_db": 24.266345977783203, + "bandwidth": 7092.498779296875, + "flow:disfluent": 0.062315 + }, + "tempo +4": { + "wer": 0.04390756302521009, + "collapse": 0.0, + "identity": 0.7794077379078412, + "durx": 0.5298214285714286, + "female": 0.8945897370576859, + "age": 29.563122987747192, + "f0": 193.8704604830478, + "f0_st": 1.9044661580902615, + "voiced": 0.8697297828390177, + "rms_db": -22.53319025039673, + "snr_db": 20.7595477104187, + "bandwidth": 8128.7841796875, + "flow:disfluent": 0.071205 + } + }, + "American Male": { + "neutral": { + "wer": 0.007352941176470588, + "collapse": 0.0, + "identity": 0.944281897024579, + "durx": 1.0, + "female": 0.0021247467666398734, + "age": 48.121464252471924, + "f0": 116.91828356269122, + "f0_st": 4.913690931254914, + "voiced": 0.4680676167050811, + "rms_db": -43.39509105682373, + "snr_db": 39.194278717041016, + "bandwidth": 8204.150390625, + "flow:disfluent": 0.06804500000000001 + }, + "tempo -4": { + "wer": 0.656143876314828, + "collapse": 0.75, + "identity": 0.7099759222192794, + "durx": 1.8054681353265145, + "female": 0.00585286773275584, + "age": 54.09335121512413, + "f0": 81.33662316404349, + "f0_st": 4.810162729799232, + "voiced": 0.6573349310781218, + "rms_db": -56.28432273864746, + "snr_db": 32.56315326690674, + "bandwidth": 9178.52783203125, + "flow:disfluent": 0.7391700000000001 + }, + "tempo -2": { + "wer": 0.021739130434782608, + "collapse": 0.0, + "identity": 0.866343505297078, + "durx": 2.1925582039911307, + "female": 0.004051450552651659, + "age": 53.57763469219208, + "f0": 89.28714254758057, + "f0_st": 4.1671183207909746, + "voiced": 0.5646890532445406, + "rms_db": -52.7276725769043, + "snr_db": 34.2125825881958, + "bandwidth": 8252.60009765625, + "flow:disfluent": 0.413535 + }, + "tempo -1": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.8958924452360238, + "durx": 1.3732718894009217, + "female": 0.0036066057509742677, + "age": 50.19082427024841, + "f0": 92.49704654208202, + "f0_st": 4.734060063226946, + "voiced": 0.5374490885706804, + "rms_db": -48.86362361907959, + "snr_db": 31.755341053009033, + "bandwidth": 8048.03466796875, + "flow:disfluent": 0.16670500000000002 + }, + "tempo +1": { + "wer": 0.007352941176470588, + "collapse": 0.0, + "identity": 0.9014297252206558, + "durx": 0.7673092053501179, + "female": 0.001826488645747304, + "age": 44.04633566737175, + "f0": 125.02605758058235, + "f0_st": 3.6880436354007795, + "voiced": 0.5853238892116579, + "rms_db": -40.21114635467529, + "snr_db": 34.38389015197754, + "bandwidth": 8387.1826171875, + "flow:disfluent": 0.08416749999999999 + }, + "tempo +2": { + "wer": 0.014705882352941176, + "collapse": 0.0, + "identity": 0.8789000750231588, + "durx": 0.6358225108225108, + "female": 0.0015327122819144279, + "age": 41.25424697995186, + "f0": 133.34429922774433, + "f0_st": 2.9042930662719875, + "voiced": 0.5819793150006147, + "rms_db": -36.83397722244263, + "snr_db": 26.75862169265747, + "bandwidth": 8742.48046875, + "flow:disfluent": 0.051684999999999995 + }, + "tempo +4": { + "wer": 0.029411764705882353, + "collapse": 0.0, + "identity": 0.793919467092653, + "durx": 0.5716991341991342, + "female": 0.0018463989545125514, + "age": 40.27725011110306, + "f0": 173.9664914387596, + "f0_st": 2.617942039422489, + "voiced": 0.6640425492625447, + "rms_db": -33.3346586227417, + "snr_db": 22.654193878173828, + "bandwidth": 8330.657958984375, + "flow:disfluent": 0.09412 + } + }, + "British Female": { + "neutral": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9646508989039382, + "durx": 1.0, + "female": 0.9985478520393372, + "age": 48.11074435710907, + "f0": 145.18670227011933, + "f0_st": 3.120616918031748, + "voiced": 0.684659116272671, + "rms_db": -34.987064361572266, + "snr_db": 43.8385124206543, + "bandwidth": 9003.570556640625, + "flow:disfluent": 0.095805 + }, + "tempo -4": { + "wer": 0.38331730861681057, + "collapse": 0.5, + "identity": 0.8185344020676775, + "durx": 3.1971813947861856, + "female": 0.9987433701753616, + "age": 51.96615383028984, + "f0": 124.76938054915107, + "f0_st": 3.185398861304927, + "voiced": 0.6850340381064675, + "rms_db": -52.27995204925537, + "snr_db": 44.10794925689697, + "bandwidth": 12028.985595703125, + "flow:disfluent": 0.6749299999999999 + }, + "tempo -2": { + "wer": 0.013157894736842105, + "collapse": 0.0, + "identity": 0.9254047521049925, + "durx": 1.8539893315174214, + "female": 0.9993804395198822, + "age": 50.073571503162384, + "f0": 129.69350458592595, + "f0_st": 2.912681916222332, + "voiced": 0.6545666946301044, + "rms_db": -43.7330379486084, + "snr_db": 49.235212326049805, + "bandwidth": 9706.09130859375, + "flow:disfluent": 0.3776575 + }, + "tempo -1": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9462566287372762, + "durx": 1.3717588591184096, + "female": 0.99891696870327, + "age": 48.037318140268326, + "f0": 142.3139608650949, + "f0_st": 3.004964500484321, + "voiced": 0.6622388994286013, + "rms_db": -38.60324192047119, + "snr_db": 50.00192832946777, + "bandwidth": 9245.819091796875, + "flow:disfluent": 0.17658 + }, + "tempo +1": { + "wer": 0.007142857142857143, + "collapse": 0.0, + "identity": 0.9081917545356689, + "durx": 0.7594138645785353, + "female": 0.9973055869340897, + "age": 43.691057711839676, + "f0": 151.236233279334, + "f0_st": 2.94674069960694, + "voiced": 0.6889838897094652, + "rms_db": -34.06732368469238, + "snr_db": 31.343669891357422, + "bandwidth": 9479.99267578125, + "flow:disfluent": 0.06296 + }, + "tempo +2": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.8804173385702689, + "durx": 0.6222990492653413, + "female": 0.9974644184112549, + "age": 42.46465191245079, + "f0": 172.66280259609243, + "f0_st": 3.0575053410003026, + "voiced": 0.7250097500136259, + "rms_db": -27.41505765914917, + "snr_db": 25.10690975189209, + "bandwidth": 10066.7724609375, + "flow:disfluent": 0.0556525 + }, + "tempo +4": { + "wer": 0.014285714285714285, + "collapse": 0.0, + "identity": 0.8170885526820785, + "durx": 0.5330248593721647, + "female": 0.9958458840847015, + "age": 41.458660364151, + "f0": 198.33772926084316, + "f0_st": 2.9305449913118706, + "voiced": 0.8321389933373043, + "rms_db": -24.57657289505005, + "snr_db": 18.873897075653076, + "bandwidth": 10179.82177734375, + "flow:disfluent": 0.05677000000000001 + } + }, + "British Male": { + "neutral": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9536403536976914, + "durx": 1.0, + "female": 0.005018519994337112, + "age": 19.837047532200813, + "f0": 88.88241321026631, + "f0_st": 2.4990147456627976, + "voiced": 0.5315726962367779, + "rms_db": -39.36486530303955, + "snr_db": 35.08437442779541, + "bandwidth": 11011.541748046875, + "flow:disfluent": 0.0874325 + }, + "tempo -4": { + "wer": 0.6808857181316462, + "collapse": 0.75, + "identity": 0.7458341777221815, + "durx": 2.1650254507397366, + "female": 0.06340937921777368, + "age": 31.277945637702942, + "f0": 92.1916885219668, + "f0_st": 3.502326111835196, + "voiced": 0.6714422984954709, + "rms_db": -57.35443305969238, + "snr_db": 31.577112197875977, + "bandwidth": 13687.042236328125, + "flow:disfluent": 0.7807825 + }, + "tempo -2": { + "wer": 0.05, + "collapse": 0.0, + "identity": 0.8469169551919995, + "durx": 2.578231292517007, + "female": 0.040879939682781696, + "age": 29.55884374678135, + "f0": 85.32505981880767, + "f0_st": 1.9221827256974096, + "voiced": 0.5739867596811208, + "rms_db": -57.065348625183105, + "snr_db": 35.24776268005371, + "bandwidth": 12233.551025390625, + "flow:disfluent": 0.44866249999999996 + }, + "tempo -1": { + "wer": 0.013157894736842105, + "collapse": 0.0, + "identity": 0.9182321824422943, + "durx": 1.5246598639455784, + "female": 0.0368626497220248, + "age": 23.49739260971546, + "f0": 86.18716825369852, + "f0_st": 2.3180902146618316, + "voiced": 0.5688812727312884, + "rms_db": -48.929715156555176, + "snr_db": 32.171568393707275, + "bandwidth": 11950.927734375, + "flow:disfluent": 0.29320999999999997 + }, + "tempo +1": { + "wer": 0.021638655462184873, + "collapse": 0.0, + "identity": 0.9087583476563157, + "durx": 0.7646103896103895, + "female": 0.006552364502567798, + "age": 23.00235815346241, + "f0": 91.78956875383575, + "f0_st": 1.9950143253721775, + "voiced": 0.55820265627171, + "rms_db": -37.00075435638428, + "snr_db": 30.197203636169434, + "bandwidth": 11891.71142578125, + "flow:disfluent": 0.0678775 + }, + "tempo +2": { + "wer": 0.022058823529411766, + "collapse": 0.0, + "identity": 0.8786180004754303, + "durx": 0.6215986394557822, + "female": 0.0023912038013804704, + "age": 20.852559059858322, + "f0": 96.04114318427068, + "f0_st": 2.30734348997241, + "voiced": 0.6711962041821102, + "rms_db": -31.303239345550537, + "snr_db": 29.428645133972168, + "bandwidth": 11746.3623046875, + "flow:disfluent": 0.07229250000000001 + }, + "tempo +4": { + "wer": 0.0708540853412303, + "collapse": 0.0, + "identity": 0.8252017123141424, + "durx": 0.5430402930402931, + "female": 0.0017562328866915777, + "age": 23.441094160079956, + "f0": 113.97936037152358, + "f0_st": 1.9173167222481542, + "voiced": 0.6763448831253847, + "rms_db": -29.792292594909668, + "snr_db": 20.498971939086914, + "bandwidth": 10815.05126953125, + "flow:disfluent": 0.10276 + } + }, + "Obama": { + "neutral": { + "wer": 0.014705882352941176, + "collapse": 0.0, + "identity": 0.9387460296541414, + "durx": 1.0, + "female": 0.0035154334036633372, + "age": 53.74961122870445, + "f0": 123.7537390161196, + "f0_st": 2.7043656138649546, + "voiced": 0.6549097443442305, + "rms_db": -41.428171157836914, + "snr_db": 50.819594383239746, + "bandwidth": 7555.462646484375, + "flow:disfluent": 0.070495 + }, + "tempo -4": { + "wer": 0.470313251158587, + "collapse": 0.5, + "identity": 0.7366758433661341, + "durx": 2.691358024691358, + "female": 0.005529508518520743, + "age": 64.65144157409668, + "f0": 113.9577687295683, + "f0_st": 3.6561699930314724, + "voiced": 0.6269362866835047, + "rms_db": -54.37965202331543, + "snr_db": 47.29763889312744, + "bandwidth": 9181.219482421875, + "flow:disfluent": 0.565295 + }, + "tempo -2": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.8779669501011598, + "durx": 1.9783950617283947, + "female": 0.003884760430082679, + "age": 62.92061507701874, + "f0": 115.82587023314967, + "f0_st": 3.7920239717058144, + "voiced": 0.6676808449563756, + "rms_db": -43.024752616882324, + "snr_db": 54.135457038879395, + "bandwidth": 7288.9892578125, + "flow:disfluent": 0.19562999999999997 + }, + "tempo -1": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9193708587705091, + "durx": 1.3364197530864197, + "female": 0.0051446069264784455, + "age": 50.80139935016632, + "f0": 118.68715325962181, + "f0_st": 3.515858013788541, + "voiced": 0.6502054925304708, + "rms_db": -42.30255317687988, + "snr_db": 50.76035499572754, + "bandwidth": 7321.2890625, + "flow:disfluent": 0.10379749999999999 + }, + "tempo +1": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.8936717800922283, + "durx": 0.7907082521117609, + "female": 0.0031351110083051026, + "age": 48.35432469844818, + "f0": 134.1045280021808, + "f0_st": 2.598861598091596, + "voiced": 0.6635923187400476, + "rms_db": -39.81044292449951, + "snr_db": 43.22697734832764, + "bandwidth": 8158.392333984375, + "flow:disfluent": 0.06205000000000001 + }, + "tempo +2": { + "wer": 0.022058823529411766, + "collapse": 0.0, + "identity": 0.8630439387223777, + "durx": 0.6560103963612736, + "female": 0.0027159798773936927, + "age": 46.40969783067703, + "f0": 143.08413328254983, + "f0_st": 2.99726093837286, + "voiced": 0.7359468409090667, + "rms_db": -31.122117042541504, + "snr_db": 41.3206353187561, + "bandwidth": 8605.206298828125, + "flow:disfluent": 0.0788375 + }, + "tempo +4": { + "wer": 0.028991596638655463, + "collapse": 0.0, + "identity": 0.7520023420786851, + "durx": 0.567251461988304, + "female": 0.002952539944089949, + "age": 40.196043998003006, + "f0": 165.51048051949704, + "f0_st": 2.448262634981497, + "voiced": 0.7130911661351547, + "rms_db": -24.984222888946533, + "snr_db": 30.510751724243164, + "bandwidth": 9654.949951171875, + "flow:disfluent": 0.0697875 + } + }, + "Scottish Female": { + "neutral": { + "wer": 0.007142857142857143, + "collapse": 0.0, + "identity": 0.9266934661136247, + "durx": 1.0, + "female": 0.997859537601471, + "age": 48.33717122673988, + "f0": 186.62951681175997, + "f0_st": 2.372338315695629, + "voiced": 0.7664984735799911, + "rms_db": -39.992154121398926, + "snr_db": 31.38053846359253, + "bandwidth": 7999.5849609375, + "flow:disfluent": 0.161685 + }, + "tempo -4": { + "wer": 0.8185056631348191, + "collapse": 1.0, + "identity": 0.5709624419701498, + "durx": 3.3922360248447205, + "female": 0.9954287856817245, + "age": 57.166723906993866, + "f0": 115.71218150617939, + "f0_st": 9.106567897042995, + "voiced": 0.7256604974056, + "rms_db": -56.96879482269287, + "snr_db": 42.721407890319824, + "bandwidth": 12327.7587890625, + "flow:disfluent": 0.5751999999999999 + }, + "tempo -2": { + "wer": 0.10874613003095975, + "collapse": 0.0, + "identity": 0.8356948300647355, + "durx": 2.6176677204074466, + "female": 0.9985463172197342, + "age": 54.66482415795326, + "f0": 166.85577127237002, + "f0_st": 3.781869779901992, + "voiced": 0.6753553827966996, + "rms_db": -48.81084156036377, + "snr_db": 43.3128662109375, + "bandwidth": 10158.28857421875, + "flow:disfluent": 0.64682 + }, + "tempo -1": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.8784607462628525, + "durx": 1.46992673992674, + "female": 0.9989706426858902, + "age": 55.523285269737244, + "f0": 185.65140763751765, + "f0_st": 2.919297604515154, + "voiced": 0.7086523290450143, + "rms_db": -48.42943859100342, + "snr_db": 33.73450183868408, + "bandwidth": 9555.35888671875, + "flow:disfluent": 0.4024575 + }, + "tempo +1": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.8681233539921024, + "durx": 0.7814938684503903, + "female": 0.9967617243528366, + "age": 45.266251266002655, + "f0": 215.60704122275513, + "f0_st": 3.3280042387041275, + "voiced": 0.8069642940500928, + "rms_db": -32.18132162094116, + "snr_db": 26.659331798553467, + "bandwidth": 6696.826171875, + "flow:disfluent": 0.11735000000000001 + }, + "tempo +2": { + "wer": 0.021848739495798318, + "collapse": 0.0, + "identity": 0.7768469429266507, + "durx": 0.6689497716894978, + "female": 0.9843157827854156, + "age": 39.07461240887642, + "f0": 237.5837948231146, + "f0_st": 2.2016076793605728, + "voiced": 0.8649779499966377, + "rms_db": -30.558790683746338, + "snr_db": 22.475812435150146, + "bandwidth": 7972.66845703125, + "flow:disfluent": 0.10058 + }, + "tempo +4": { + "wer": 0.20162682922139108, + "collapse": 0.0, + "identity": 0.72824032980191, + "durx": 0.5621516164994426, + "female": 0.9749104231595993, + "age": 38.91375586390495, + "f0": 248.9969466477016, + "f0_st": 2.6775725965316353, + "voiced": 0.93861290125996, + "rms_db": -21.630022525787354, + "snr_db": 20.66996717453003, + "bandwidth": 6634.918212890625, + "flow:disfluent": 0.12477500000000001 + } + } +} diff --git a/steering/ears_styles_mect60k/eval/whisper_loud.json b/steering/ears_styles_mect60k/eval/whisper_loud.json new file mode 100644 index 0000000000000000000000000000000000000000..4a6edcd65e3c16a5eb1e975edca4bf089a93bc20 --- /dev/null +++ b/steering/ears_styles_mect60k/eval/whisper_loud.json @@ -0,0 +1,898 @@ +{ + "all": { + "neutral": { + "wer": 0.004866946778711485, + "collapse": 0.0, + "identity": 0.9463956918186919, + "durx": 1.0, + "female": 0.4983073752615989, + "age": 41.317688735822834, + "f0": 136.19757792145845, + "f0_st": 2.903048200564409, + "voiced": 0.6307535235563585, + "rms_db": -38.16175572077433, + "snr_db": 39.82410788536072, + "bandwidth": 8300.152587890625, + "quality:hushed": 0.0, + "quality:soft": 0.25702625, + "quality:loud": 0.33855458333333327, + "quality:booming": 0.49958083333333336 + }, + "whisper +1": { + "wer": 0.005434782608695652, + "collapse": 0.0, + "identity": 0.8861146227462351, + "durx": 1.0756043956043957, + "female": 0.5025241449863339, + "age": 40.36238435655832, + "f0": 123.55324347844957, + "f0_st": 3.414587782172051, + "voiced": 0.4973688028439591, + "rms_db": -47.63636636734009, + "snr_db": 40.59239411354065, + "bandwidth": 9799.850463867188, + "quality:hushed": 0.0, + "quality:soft": 0.2508608333333333, + "quality:loud": 0.29682458333333334, + "quality:booming": 0.49954291666666667 + }, + "whisper +2": { + "wer": 0.07219535411418572, + "collapse": 0.0, + "identity": 0.7439658130560964, + "durx": 1.1212664277180406, + "female": 0.4974489743860128, + "age": 38.597000390291214, + "f0": 113.29166732393708, + "f0_st": 3.1525181100640634, + "voiced": 0.3165725465614341, + "rms_db": -55.655746618906655, + "snr_db": 37.920177141825356, + "bandwidth": 10312.60986328125, + "quality:hushed": 0.0, + "quality:soft": 0.22246958333333333, + "quality:loud": 0.30402625, + "quality:booming": 0.40252375 + }, + "whisper +4": { + "wer": 0.2936410719894365, + "collapse": 0.20833333333333334, + "identity": 0.5641189366170011, + "durx": 1.1040816326530611, + "female": 0.5402080647375745, + "age": 35.576739348471165, + "f0": 148.60508976979727, + "f0_st": 2.0110153119675513, + "voiced": 0.20055696409105436, + "rms_db": -57.442459424336754, + "snr_db": 34.975877126057945, + "bandwidth": 12162.6708984375, + "quality:hushed": 3.75e-06, + "quality:soft": 0.15461041666666667, + "quality:loud": 0.41772000000000004, + "quality:booming": 0.3381266666666667 + }, + "loud +1": { + "wer": 0.0012254901960784314, + "collapse": 0.0, + "identity": 0.9149835956527662, + "durx": 0.9878754578754579, + "female": 0.4988482942038293, + "age": 41.47004044304291, + "f0": 151.18742336643004, + "f0_st": 3.047263605204215, + "voiced": 0.6743314357920553, + "rms_db": -35.83672332763672, + "snr_db": 35.89528624216715, + "bandwidth": 8154.3548583984375, + "quality:hushed": 0.0, + "quality:soft": 0.24523083333333331, + "quality:loud": 0.3698241666666666, + "quality:booming": 0.47622416666666667 + }, + "loud +2": { + "wer": 0.0011904761904761904, + "collapse": 0.0, + "identity": 0.8882212043675208, + "durx": 0.954942250872952, + "female": 0.4997102289441197, + "age": 41.58113493273655, + "f0": 167.68324954496867, + "f0_st": 2.936251352722671, + "voiced": 0.6969647412025873, + "rms_db": -31.10213581720988, + "snr_db": 32.55089330673218, + "bandwidth": 8704.348754882812, + "quality:hushed": 0.0, + "quality:soft": 0.22007375000000004, + "quality:loud": 0.3789420833333333, + "quality:booming": 0.47438583333333334 + }, + "loud +4": { + "wer": 0.012079831932773108, + "collapse": 0.0, + "identity": 0.7686392598844572, + "durx": 0.9452614379084967, + "female": 0.4937654337166653, + "age": 39.43979529043039, + "f0": 244.6074702236484, + "f0_st": 3.4555646150878077, + "voiced": 0.7734885219714135, + "rms_db": -21.654570420583088, + "snr_db": 28.501208941141766, + "bandwidth": 9846.05712890625, + "quality:hushed": 0.0, + "quality:soft": 0.07995666666666668, + "quality:loud": 0.5428583333333333, + "quality:booming": 0.3658270833333333 + } + }, + "American Female": { + "neutral": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.950361505518176, + "durx": 1.0, + "female": 0.9827781617641449, + "age": 29.750093817710876, + "f0": 155.81481265779422, + "f0_st": 1.8082626788764102, + "voiced": 0.678813494199399, + "rms_db": -29.80318832397461, + "snr_db": 38.62734889984131, + "bandwidth": 6026.605224609375, + "quality:hushed": 0.0, + "quality:soft": 3.9999999999999996e-05, + "quality:loud": 0.9971475, + "quality:booming": 0.921205 + }, + "whisper +1": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9090615740379994, + "durx": 1.130892857142857, + "female": 0.9844885766506195, + "age": 28.808192908763885, + "f0": 151.81169440541714, + "f0_st": 2.3894429096989436, + "voiced": 0.5815177740392845, + "rms_db": -40.428396224975586, + "snr_db": 51.44086933135986, + "bandwidth": 7248.614501953125, + "quality:hushed": 0.0, + "quality:soft": 0.0006125, + "quality:loud": 0.986025, + "quality:booming": 0.93318 + }, + "whisper +2": { + "wer": 0.007142857142857143, + "collapse": 0.0, + "identity": 0.838194223648516, + "durx": 1.2425210084033615, + "female": 0.9748350083827972, + "age": 26.760058850049973, + "f0": 149.95963912840455, + "f0_st": 3.014874811004467, + "voiced": 0.3028234601081932, + "rms_db": -46.59469795227051, + "snr_db": 54.72954750061035, + "bandwidth": 7517.779541015625, + "quality:hushed": 0.0, + "quality:soft": 0.0166025, + "quality:loud": 0.96721, + "quality:booming": 0.950275 + }, + "whisper +4": { + "wer": 0.22649462531007825, + "collapse": 0.0, + "identity": 0.6636243779327886, + "durx": 1.3480059523809522, + "female": 0.7124146670103073, + "age": 19.08618025481701, + "f0": 351.4413495518971, + "f0_st": 1.0614313567795008, + "voiced": 0.05256324165731359, + "rms_db": -58.43415069580078, + "snr_db": 47.98525524139404, + "bandwidth": 10155.596923828125, + "quality:hushed": 0.0, + "quality:soft": 0.0, + "quality:loud": 0.9997699999999999, + "quality:booming": 0.8816975 + }, + "loud +1": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9262212220055734, + "durx": 1.0354621848739496, + "female": 0.9820628315210342, + "age": 29.78406250476837, + "f0": 166.1331469254593, + "f0_st": 2.3185429932086983, + "voiced": 0.7207728368412365, + "rms_db": -29.309933185577393, + "snr_db": 33.872751235961914, + "bandwidth": 6134.271240234375, + "quality:hushed": 0.0, + "quality:soft": 3.25e-05, + "quality:loud": 0.9982549999999999, + "quality:booming": 0.923695 + }, + "loud +2": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.8879103189000591, + "durx": 0.9696078431372549, + "female": 0.9775870740413666, + "age": 29.632458835840225, + "f0": 180.29940055192972, + "f0_st": 1.7666096935277882, + "voiced": 0.7693408184033413, + "rms_db": -25.68948221206665, + "snr_db": 30.311343669891357, + "bandwidth": 7638.90380859375, + "quality:hushed": 0.0, + "quality:soft": 1.25e-05, + "quality:loud": 0.9981225, + "quality:booming": 0.94965 + }, + "loud +4": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.7471487320927778, + "durx": 0.9469975490196079, + "female": 0.9215887039899826, + "age": 27.455071732401848, + "f0": 250.7025167049144, + "f0_st": 2.6714618327680473, + "voiced": 0.7926383318984298, + "rms_db": -17.52474331855774, + "snr_db": 26.419846057891846, + "bandwidth": 9380.401611328125, + "quality:hushed": 0.0, + "quality:soft": 0.0026149999999999997, + "quality:loud": 0.9754375000000001, + "quality:booming": 0.74946 + } + }, + "American Male": { + "neutral": { + "wer": 0.007352941176470588, + "collapse": 0.0, + "identity": 0.944281897024579, + "durx": 1.0, + "female": 0.0021247467666398734, + "age": 48.121464252471924, + "f0": 116.91828356269122, + "f0_st": 4.913690931254914, + "voiced": 0.4680676167050811, + "rms_db": -43.39509105682373, + "snr_db": 39.194278717041016, + "bandwidth": 8204.150390625, + "quality:hushed": 0.0, + "quality:soft": 8.75e-05, + "quality:loud": 0.07103999999999999, + "quality:booming": 0.127695 + }, + "whisper +1": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.8592400306807044, + "durx": 1.1011904761904763, + "female": 0.0021651191636919975, + "age": 50.51499009132385, + "f0": 79.3531273606036, + "f0_st": 6.102436394225379, + "voiced": 0.3202840422664237, + "rms_db": -54.70952796936035, + "snr_db": 32.79377841949463, + "bandwidth": 9022.412109375, + "quality:hushed": 0.0, + "quality:soft": 0.010409999999999999, + "quality:loud": 0.071045, + "quality:booming": 0.1584275 + }, + "whisper +2": { + "wer": 0.10273109243697479, + "collapse": 0.0, + "identity": 0.6862572750512513, + "durx": 1.1845003933910307, + "female": 0.006649241782724857, + "age": 48.10115918517113, + "f0": 67.37834637795403, + "f0_st": 0.7340006883020149, + "voiced": 0.20982804691583987, + "rms_db": -58.64642810821533, + "snr_db": 27.71666717529297, + "bandwidth": 9628.033447265625, + "quality:hushed": 0.0, + "quality:soft": 0.0608325, + "quality:loud": 0.15693, + "quality:booming": 0.030709999999999998 + }, + "whisper +4": { + "wer": 0.2942729265619291, + "collapse": 0.25, + "identity": 0.471365672517689, + "durx": 1.0457251082251082, + "female": 0.2007419723086059, + "age": 44.616518914699554, + "f0": 59.319680694091716, + "f0_st": 0.5680749354081737, + "voiced": 0.30450550083760386, + "rms_db": -60.51035976409912, + "snr_db": 21.945948600769043, + "bandwidth": 13918.524169921875, + "quality:hushed": 0.0, + "quality:soft": 0.01021, + "quality:loud": 0.2921425, + "quality:booming": 0.0315275 + }, + "loud +1": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9036528994566032, + "durx": 0.9880015735641228, + "female": 0.002444354206090793, + "age": 47.27412387728691, + "f0": 130.3773131189181, + "f0_st": 3.792700545964333, + "voiced": 0.517919488405245, + "rms_db": -41.73675060272217, + "snr_db": 33.74873065948486, + "bandwidth": 7988.818359375, + "quality:hushed": 0.0, + "quality:soft": 0.0031199999999999995, + "quality:loud": 0.0709175, + "quality:booming": 0.06749250000000001 + }, + "loud +2": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.8890774196285172, + "durx": 1.0157450076804915, + "female": 0.00275650667026639, + "age": 50.867876410484314, + "f0": 149.4760023306722, + "f0_st": 3.8839250214918826, + "voiced": 0.5069077177472904, + "rms_db": -37.131043434143066, + "snr_db": 33.1930193901062, + "bandwidth": 8354.8828125, + "quality:hushed": 0.0, + "quality:soft": 0.0, + "quality:loud": 0.006072500000000001, + "quality:booming": 0.0034925 + }, + "loud +4": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.756016631108932, + "durx": 0.984577922077922, + "female": 0.028995009139180183, + "age": 52.41689309477806, + "f0": 236.9689599266784, + "f0_st": 3.6043929046918244, + "voiced": 0.6925151757007548, + "rms_db": -26.829474925994873, + "snr_db": 32.49537134170532, + "bandwidth": 8715.56396484375, + "quality:hushed": 0.0, + "quality:soft": 0.0, + "quality:loud": 0.0223825, + "quality:booming": 0.004945 + } + }, + "British Female": { + "neutral": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9646508989039382, + "durx": 1.0, + "female": 0.9985478520393372, + "age": 48.11074435710907, + "f0": 145.18670227011933, + "f0_st": 3.120616918031748, + "voiced": 0.684659116272671, + "rms_db": -34.987064361572266, + "snr_db": 43.8385124206543, + "bandwidth": 9003.570556640625, + "quality:hushed": 0.0, + "quality:soft": 0.005847499999999999, + "quality:loud": 0.54104, + "quality:booming": 0.8693 + }, + "whisper +1": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9267725065165348, + "durx": 1.0890233362143475, + "female": 0.9987607449293137, + "age": 44.21921297907829, + "f0": 131.3942449050702, + "f0_st": 3.247504008320272, + "voiced": 0.5903274467066091, + "rms_db": -43.06676769256592, + "snr_db": 45.88443565368652, + "bandwidth": 10696.61865234375, + "quality:hushed": 0.0, + "quality:soft": 0.112255, + "quality:loud": 0.538545, + "quality:booming": 0.9363275 + }, + "whisper +2": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.8465789589868151, + "durx": 1.0671349608475358, + "female": 0.99725541472435, + "age": 38.86089473962784, + "f0": 128.99475225836443, + "f0_st": 2.6168172250787602, + "voiced": 0.43803443465401665, + "rms_db": -52.055179595947266, + "snr_db": 48.34209442138672, + "bandwidth": 10626.6357421875, + "quality:hushed": 0.0, + "quality:soft": 0.11669750000000001, + "quality:loud": 0.542165, + "quality:booming": 0.8812249999999999 + }, + "whisper +4": { + "wer": 0.10086389246774224, + "collapse": 0.0, + "identity": 0.7277955817839916, + "durx": 1.1673760072636477, + "female": 0.9965981841087341, + "age": 36.48032620549202, + "f0": 126.38738597886743, + "f0_st": 2.6225348080699513, + "voiced": 0.22048366246609885, + "rms_db": -56.48030185699463, + "snr_db": 43.26663780212402, + "bandwidth": 10615.869140625, + "quality:hushed": 0.0, + "quality:soft": 0.035410000000000004, + "quality:loud": 0.6434675, + "quality:booming": 0.7114275 + }, + "loud +1": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9406981834079045, + "durx": 0.9865225286573601, + "female": 0.9987944066524506, + "age": 48.31204116344452, + "f0": 158.6443980102773, + "f0_st": 3.3375671237803903, + "voiced": 0.6804097764295007, + "rms_db": -35.194817543029785, + "snr_db": 41.74097442626953, + "bandwidth": 9921.42333984375, + "quality:hushed": 0.0, + "quality:soft": 0.0056075, + "quality:loud": 0.6637725000000001, + "quality:booming": 0.8657649999999999 + }, + "loud +2": { + "wer": 0.007142857142857143, + "collapse": 0.0, + "identity": 0.9210096371710917, + "durx": 0.9146521393712406, + "female": 0.9987134486436844, + "age": 47.40138128399849, + "f0": 179.21739584974387, + "f0_st": 3.592647847212589, + "voiced": 0.7049792520608094, + "rms_db": -27.905063152313232, + "snr_db": 35.67916297912598, + "bandwidth": 9571.5087890625, + "quality:hushed": 0.0, + "quality:soft": 0.0023899999999999998, + "quality:loud": 0.6655725, + "quality:booming": 0.8490175 + }, + "loud +4": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.8635111041479078, + "durx": 0.9438742437337944, + "female": 0.9984386116266251, + "age": 45.888689160346985, + "f0": 221.5316654612211, + "f0_st": 3.8567953009492832, + "voiced": 0.725816737495184, + "rms_db": -24.946794033050537, + "snr_db": 28.320966243743896, + "bandwidth": 11310.31494140625, + "quality:hushed": 0.0, + "quality:soft": 0.0001875, + "quality:loud": 0.860205, + "quality:booming": 0.7584775 + } + }, + "British Male": { + "neutral": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9536403536976914, + "durx": 1.0, + "female": 0.005018519994337112, + "age": 19.837047532200813, + "f0": 88.88241321026631, + "f0_st": 2.4990147456627976, + "voiced": 0.5315726962367779, + "rms_db": -39.36486530303955, + "snr_db": 35.08437442779541, + "bandwidth": 11011.541748046875, + "quality:hushed": 0.0, + "quality:soft": 0.6038975000000001, + "quality:loud": 0.166065, + "quality:booming": 0.08789250000000001 + }, + "whisper +1": { + "wer": 0.021739130434782608, + "collapse": 0.0, + "identity": 0.9010645202631796, + "durx": 1.18510656010656, + "female": 0.028561758052092046, + "age": 23.27575795352459, + "f0": 86.07286659425637, + "f0_st": 2.4732839210068778, + "voiced": 0.3578811802557277, + "rms_db": -48.668710708618164, + "snr_db": 28.35758686065674, + "bandwidth": 11186.4990234375, + "quality:hushed": 0.0, + "quality:soft": 0.47331999999999996, + "quality:loud": 0.048135, + "quality:booming": 0.130405 + }, + "whisper +2": { + "wer": 0.11174259177355152, + "collapse": 0.0, + "identity": 0.7073229971134422, + "durx": 1.0824056895485468, + "female": 0.008549616672098637, + "age": 29.570895433425903, + "f0": 75.06253516174665, + "f0_st": 1.8176689248416331, + "voiced": 0.25147689950653174, + "rms_db": -54.71645164489746, + "snr_db": 24.511205673217773, + "bandwidth": 11851.336669921875, + "quality:hushed": 0.0, + "quality:soft": 0.2195125, + "quality:loud": 0.0651475, + "quality:booming": 0.1216475 + }, + "whisper +4": { + "wer": 0.4006773647674172, + "collapse": 0.25, + "identity": 0.4898824612140237, + "durx": 1.1941808191808192, + "female": 0.33527871558908373, + "age": 30.42064756155014, + "f0": 64.40810793536384, + "f0_st": 0.4864180844900887, + "voiced": 0.33689063302229166, + "rms_db": -44.8943452835083, + "snr_db": 32.65315914154053, + "bandwidth": 13434.027099609375, + "quality:hushed": 2.25e-05, + "quality:soft": 0.2139375, + "quality:loud": 0.2182375, + "quality:booming": 0.1487825 + }, + "loud +1": { + "wer": 0.007352941176470588, + "collapse": 0.0, + "identity": 0.9205635033867492, + "durx": 1.0142773892773893, + "female": 0.009227817645296454, + "age": 20.84229104220867, + "f0": 92.23376795370265, + "f0_st": 2.647744911771243, + "voiced": 0.6346592781330469, + "rms_db": -38.72709655761719, + "snr_db": 33.9145565032959, + "bandwidth": 10319.78759765625, + "quality:hushed": 0.0, + "quality:soft": 0.565115, + "quality:loud": 0.17093750000000002, + "quality:booming": 0.039695 + }, + "loud +2": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9225606296725608, + "durx": 1.0003746253746253, + "female": 0.01796976785408333, + "age": 20.542562380433083, + "f0": 97.06778353982159, + "f0_st": 1.8324893311147008, + "voiced": 0.6334877046190813, + "rms_db": -34.308204650878906, + "snr_db": 27.302303314208984, + "bandwidth": 10567.41943359375, + "quality:hushed": 0.0, + "quality:soft": 0.46572499999999994, + "quality:loud": 0.18616749999999999, + "quality:booming": 0.045782500000000004 + }, + "loud +4": { + "wer": 0.007142857142857143, + "collapse": 0.0, + "identity": 0.8639603600668316, + "durx": 0.9104229104229105, + "female": 0.03034583735279739, + "age": 25.418423488736153, + "f0": 134.1868951922864, + "f0_st": 3.0834228510971866, + "voiced": 0.7377564285331417, + "rms_db": -26.090219974517822, + "snr_db": 23.95761775970459, + "bandwidth": 10214.813232421875, + "quality:hushed": 0.0, + "quality:soft": 0.10545, + "quality:loud": 0.37230749999999996, + "quality:booming": 0.0466825 + } + }, + "Obama": { + "neutral": { + "wer": 0.014705882352941176, + "collapse": 0.0, + "identity": 0.9387460296541414, + "durx": 1.0, + "female": 0.0035154334036633372, + "age": 53.74961122870445, + "f0": 123.7537390161196, + "f0_st": 2.7043656138649546, + "voiced": 0.6549097443442305, + "rms_db": -41.428171157836914, + "snr_db": 50.819594383239746, + "bandwidth": 7555.462646484375, + "quality:hushed": 0.0, + "quality:soft": 0.00744, + "quality:loud": 0.1787125, + "quality:booming": 0.5851900000000001 + }, + "whisper +1": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9106156565602516, + "durx": 1.0219623131903834, + "female": 0.004257905355188996, + "age": 51.30046606063843, + "f0": 117.45097534359519, + "f0_st": 3.750915055022232, + "voiced": 0.49734909298552865, + "rms_db": -47.681541442871094, + "snr_db": 52.39809513092041, + "bandwidth": 8543.29833984375, + "quality:hushed": 0.0, + "quality:soft": 0.01184, + "quality:loud": 0.09731999999999999, + "quality:booming": 0.4644325 + }, + "whisper +2": { + "wer": 0.07549852893102321, + "collapse": 0.0, + "identity": 0.7419790678519925, + "durx": 1.1314814814814813, + "female": 0.005280931130982935, + "age": 51.954011619091034, + "f0": 111.84347750291901, + "f0_st": 3.2742870073873314, + "voiced": 0.2708297925996328, + "rms_db": -62.924981117248535, + "snr_db": 41.19688701629639, + "bandwidth": 10303.6376953125, + "quality:hushed": 0.0, + "quality:soft": 0.0166925, + "quality:loud": 0.041895, + "quality:booming": 0.2317325 + }, + "whisper +4": { + "wer": 0.36254158413937654, + "collapse": 0.25, + "identity": 0.5469895929676998, + "durx": 1.0456140350877192, + "female": 0.008094829972833395, + "age": 51.335643976926804, + "f0": 130.62378741060056, + "f0_st": 2.376003860966758, + "voiced": 0.10692503767889616, + "rms_db": -64.87841701507568, + "snr_db": 35.6916389465332, + "bandwidth": 11967.07763671875, + "quality:hushed": 0.0, + "quality:soft": 0.0891675, + "quality:loud": 0.16932, + "quality:booming": 0.08582250000000001 + }, + "loud +1": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9097988825100354, + "durx": 1.0153086419753086, + "female": 0.003304046404082328, + "age": 55.21530359983444, + "f0": 150.6857081473695, + "f0_st": 3.7072206059660187, + "voiced": 0.6901428157804497, + "rms_db": -32.63158941268921, + "snr_db": 46.87190055847168, + "bandwidth": 7515.087890625, + "quality:hushed": 0.0, + "quality:soft": 0.012380000000000002, + "quality:loud": 0.195935, + "quality:booming": 0.551275 + }, + "loud +2": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.8862392373586131, + "durx": 0.9320987654320987, + "female": 0.00464856659527868, + "age": 49.08883273601532, + "f0": 164.69478122681275, + "f0_st": 3.7144759678077204, + "voiced": 0.7297567296674446, + "rms_db": -30.962168216705322, + "snr_db": 42.86879634857178, + "bandwidth": 8691.339111328125, + "quality:hushed": 0.0, + "quality:soft": 0.012135, + "quality:loud": 0.27527999999999997, + "quality:booming": 0.5873075 + }, + "loud +4": { + "wer": 0.007352941176470588, + "collapse": 0.0, + "identity": 0.7688924418074617, + "durx": 0.9248538011695906, + "female": 0.010766316030640155, + "age": 51.80997774004936, + "f0": 241.88605599007187, + "f0_st": 4.045365726311235, + "voiced": 0.7719634881640544, + "rms_db": -21.288774490356445, + "snr_db": 42.464542388916016, + "bandwidth": 10532.427978515625, + "quality:hushed": 0.0, + "quality:soft": 0.007155000000000001, + "quality:loud": 0.6459425, + "quality:booming": 0.43863250000000004 + } + }, + "Scottish Female": { + "neutral": { + "wer": 0.007142857142857143, + "collapse": 0.0, + "identity": 0.9266934661136247, + "durx": 1.0, + "female": 0.997859537601471, + "age": 48.33717122673988, + "f0": 186.62951681175997, + "f0_st": 2.372338315695629, + "voiced": 0.7664984735799911, + "rms_db": -39.992154121398926, + "snr_db": 31.38053846359253, + "bandwidth": 7999.5849609375, + "quality:hushed": 0.0, + "quality:soft": 0.924845, + "quality:loud": 0.07732249999999999, + "quality:booming": 0.4062025 + }, + "whisper +1": { + "wer": 0.010869565217391304, + "collapse": 0.0, + "identity": 0.8099334484187408, + "durx": 0.9396733403582719, + "female": 0.9969107657670975, + "age": 44.05568614602089, + "f0": 175.23655226175507, + "f0_st": 2.5239444047586055, + "voiced": 0.6368532808101808, + "rms_db": -51.263254165649414, + "snr_db": 32.67959928512573, + "bandwidth": 12101.66015625, + "quality:hushed": 0.0, + "quality:soft": 0.8967275, + "quality:loud": 0.0398775, + "quality:booming": 0.374485 + }, + "whisper +2": { + "wer": 0.13605705440070764, + "collapse": 0.0, + "identity": 0.6434623556845616, + "durx": 1.0314175104228709, + "female": 0.9921236336231232, + "age": 36.33498251438141, + "f0": 146.51125351423386, + "f0_st": 7.457460003770173, + "voiced": 0.42644264558439016, + "rms_db": -58.99674129486084, + "snr_db": 31.02466106414795, + "bandwidth": 11948.236083984375, + "quality:hushed": 0.0, + "quality:soft": 0.90448, + "quality:loud": 0.050809999999999994, + "quality:booming": 0.19955250000000002 + }, + "whisper +4": { + "wer": 0.37699603869007553, + "collapse": 0.5, + "identity": 0.4850559332858136, + "durx": 0.8200207039337475, + "female": 0.9881200194358826, + "age": 31.52111917734146, + "f0": 163.0652728073515, + "f0_st": 5.931833330798597, + "voiced": 0.1819737088841219, + "rms_db": -59.45718193054199, + "snr_db": 28.312623023986816, + "bandwidth": 12884.930419921875, + "quality:hushed": 0.0, + "quality:soft": 0.5789375, + "quality:loud": 0.1833825, + "quality:booming": 0.1695025 + }, + "loud +1": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.8889668831497317, + "durx": 0.9456445381102916, + "female": 0.9972563087940216, + "age": 47.39242047071457, + "f0": 209.05020604285338, + "f0_st": 2.4798054505346037, + "voiced": 0.8020844191628536, + "rms_db": -37.42015266418457, + "snr_db": 25.222804069519043, + "bandwidth": 7046.74072265625, + "quality:hushed": 0.0, + "quality:soft": 0.88513, + "quality:loud": 0.1191275, + "quality:booming": 0.4094225 + }, + "loud +2": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.822529983474283, + "durx": 0.9281700035124694, + "female": 0.9965860098600388, + "age": 51.9536979496479, + "f0": 235.34413377083183, + "f0_st": 2.827360255181344, + "voiced": 0.8373162247175568, + "rms_db": -30.6168532371521, + "snr_db": 25.95073413848877, + "bandwidth": 7402.03857421875, + "quality:hushed": 0.0, + "quality:soft": 0.84018, + "quality:loud": 0.1424375, + "quality:booming": 0.411065 + }, + "loud +4": { + "wer": 0.05798319327731093, + "collapse": 0.0, + "identity": 0.6123062900828323, + "durx": 0.9590301003344481, + "female": 0.9724581241607666, + "age": 33.64971652626991, + "f0": 382.3687280667182, + "f0_st": 3.4719490747092725, + "voiced": 0.9202409700369154, + "rms_db": -13.247415781021118, + "snr_db": 17.348909854888916, + "bandwidth": 8922.821044921875, + "quality:hushed": 0.0, + "quality:soft": 0.3643325, + "quality:loud": 0.38087499999999996, + "quality:booming": 0.196765 + } + } +} diff --git a/steering/ears_styles_mect60k/loud.npy b/steering/ears_styles_mect60k/loud.npy new file mode 100644 index 0000000000000000000000000000000000000000..8af48694aa05b266a4937cea350e6549aaf86832 --- /dev/null +++ b/steering/ears_styles_mect60k/loud.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:682920e83b6835c36de205b19491c479ec42192772ae060e3325d2c8d95fa3cb +size 4224 diff --git a/steering/ears_styles_mect60k/manifest.json b/steering/ears_styles_mect60k/manifest.json new file mode 100644 index 0000000000000000000000000000000000000000..a92b800cad3339ca4a35d851431bda14843ada13 --- /dev/null +++ b/steering/ears_styles_mect60k/manifest.json @@ -0,0 +1,133 @@ +{ + "dim": 1024, + "space": "attnres_source", + "checkpoint": "/data/groups/audio/gabriel/hf_release_zonos3mini_20261020/lm/mect_60k", + "corpus": "/data/groups/audio/sofian/runs/steer_corpora/ears_styles/clips.json", + "spec": { + "space": "attnres_source", + "source_index": 19, + "group_by": "clip", + "center": "speaker", + "directions": { + "whisper": { + "pairs": [ + [ + { + "style": "whisper" + }, + { + "style": "regular" + } + ] + ], + "kind": "named" + }, + "loud": { + "pairs": [ + [ + { + "style": "loud" + }, + { + "style": "regular" + } + ] + ], + "kind": "named" + }, + "tempo": { + "pairs": [ + [ + { + "style": "fast" + }, + { + "style": "slow" + } + ] + ], + "kind": "axis", + "poles": { + "+": "fast", + "-": "slow" + } + }, + "pitch": { + "pairs": [ + [ + { + "style": "highpitch" + }, + { + "style": "lowpitch" + } + ] + ], + "kind": "axis", + "poles": { + "+": "high", + "-": "low" + } + }, + "conversational": { + "pairs": [ + [ + { + "mode": "freeform" + }, + { + "style": "regular" + } + ] + ], + "kind": "axis", + "poles": { + "+": "spontaneous", + "-": "read" + } + } + } + }, + "directions": { + "whisper": { + "file": "whisper.npy", + "kind": "named", + "norm": 0.0405090517963514 + }, + "loud": { + "file": "loud.npy", + "kind": "named", + "norm": 0.017280372790038676 + }, + "tempo": { + "file": "tempo.npy", + "kind": "axis", + "norm": 0.02787669988911365, + "poles": { + "+": "fast", + "-": "slow" + } + }, + "pitch": { + "file": "pitch.npy", + "kind": "axis", + "norm": 0.03443120879329161, + "poles": { + "+": "high", + "-": "low" + } + }, + "conversational": { + "file": "conversational.npy", + "kind": "axis", + "norm": 0.01566362728160354, + "poles": { + "+": "spontaneous", + "-": "read" + } + } + }, + "source_index": 19, + "source_name": "L9.attn", + "prompt_conditioning": "speaker_row=no,condition_rows=3:unknown" +} diff --git a/steering/ears_styles_mect60k/pitch.npy b/steering/ears_styles_mect60k/pitch.npy new file mode 100644 index 0000000000000000000000000000000000000000..805d1e78a5c1d8d8ab4fd005cf57b95644812ea1 --- /dev/null +++ b/steering/ears_styles_mect60k/pitch.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ad6466b72187f77db8d3e973bf20055b0c5d5b5ad8814d830f0b42ccdfa9ea50 +size 4224 diff --git a/steering/ears_styles_mect60k/report.json b/steering/ears_styles_mect60k/report.json new file mode 100644 index 0000000000000000000000000000000000000000..819e92b3b064a33bffde074a23e27992105922bd --- /dev/null +++ b/steering/ears_styles_mect60k/report.json @@ -0,0 +1,132 @@ +{ + "whisper": { + "norm": 0.0405090517963514, + "removed_share": 0.0, + "pairs": [ + { + "pair": [ + { + "style": "whisper" + }, + { + "style": "regular" + } + ], + "train_speakers": [ + 316, + 316 + ], + "held_out_speakers": [ + 112, + 112 + ], + "held_out_auc": 0.9998405612244898, + "cos_with_direction": 1.0000000000000002 + } + ] + }, + "loud": { + "norm": 0.017280372790038676, + "removed_share": 0.0, + "pairs": [ + { + "pair": [ + { + "style": "loud" + }, + { + "style": "regular" + } + ], + "train_speakers": [ + 316, + 316 + ], + "held_out_speakers": [ + 112, + 112 + ], + "held_out_auc": 0.9980867346938775, + "cos_with_direction": 0.9999999999999998 + } + ] + }, + "tempo": { + "norm": 0.02787669988911365, + "removed_share": 0.0, + "pairs": [ + { + "pair": [ + { + "style": "fast" + }, + { + "style": "slow" + } + ], + "train_speakers": [ + 316, + 316 + ], + "held_out_speakers": [ + 112, + 112 + ], + "held_out_auc": 1.0, + "cos_with_direction": 1.0 + } + ] + }, + "pitch": { + "norm": 0.03443120879329161, + "removed_share": 0.0, + "pairs": [ + { + "pair": [ + { + "style": "highpitch" + }, + { + "style": "lowpitch" + } + ], + "train_speakers": [ + 316, + 316 + ], + "held_out_speakers": [ + 112, + 112 + ], + "held_out_auc": 0.9996811224489796, + "cos_with_direction": 1.0000000000000002 + } + ] + }, + "conversational": { + "norm": 0.01566362728160354, + "removed_share": 0.0, + "pairs": [ + { + "pair": [ + { + "mode": "freeform" + }, + { + "style": "regular" + } + ], + "train_speakers": [ + 474, + 316 + ], + "held_out_speakers": [ + 168, + 112 + ], + "held_out_auc": 0.9998937074829932, + "cos_with_direction": 1.0 + } + ] + } +} diff --git a/steering/ears_styles_mect60k/spec.json b/steering/ears_styles_mect60k/spec.json new file mode 100644 index 0000000000000000000000000000000000000000..df6362591f855eec3dd5ba942f9e31f3aec1d322 --- /dev/null +++ b/steering/ears_styles_mect60k/spec.json @@ -0,0 +1,85 @@ +{ + "space": "attnres_source", + "source_index": 19, + "group_by": "clip", + "center": "speaker", + "directions": { + "whisper": { + "pairs": [ + [ + { + "style": "whisper" + }, + { + "style": "regular" + } + ] + ], + "kind": "named" + }, + "loud": { + "pairs": [ + [ + { + "style": "loud" + }, + { + "style": "regular" + } + ] + ], + "kind": "named" + }, + "tempo": { + "pairs": [ + [ + { + "style": "fast" + }, + { + "style": "slow" + } + ] + ], + "kind": "axis", + "poles": { + "+": "fast", + "-": "slow" + } + }, + "pitch": { + "pairs": [ + [ + { + "style": "highpitch" + }, + { + "style": "lowpitch" + } + ] + ], + "kind": "axis", + "poles": { + "+": "high", + "-": "low" + } + }, + "conversational": { + "pairs": [ + [ + { + "mode": "freeform" + }, + { + "style": "regular" + } + ] + ], + "kind": "axis", + "poles": { + "+": "spontaneous", + "-": "read" + } + } + } +} \ No newline at end of file diff --git a/steering/ears_styles_mect60k/tempo.npy b/steering/ears_styles_mect60k/tempo.npy new file mode 100644 index 0000000000000000000000000000000000000000..9789d09871dd2afb0ee82b677468e3f05704877c --- /dev/null +++ b/steering/ears_styles_mect60k/tempo.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:85fb2a25761aaf3be38b4ad3624eca9805e99cc3e4a3ede84c81fc40294371ec +size 4224 diff --git a/steering/ears_styles_mect60k/whisper.npy b/steering/ears_styles_mect60k/whisper.npy new file mode 100644 index 0000000000000000000000000000000000000000..80e1f812053825fe4acbe5bd96ae970ce7bf9069 --- /dev/null +++ b/steering/ears_styles_mect60k/whisper.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d5e9b11cbe9c1973fe0e15df5fae6ffe24a14bfd5908afd48c399d9e96b01e2c +size 4224 diff --git a/steering/emotion_directions_mect60k_axes/arousal.npy b/steering/emotion_directions_mect60k_axes/arousal.npy new file mode 100644 index 0000000000000000000000000000000000000000..3fb75a06f3dcc676e50eb971082f483b1a415dfb --- /dev/null +++ b/steering/emotion_directions_mect60k_axes/arousal.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b1888ab51f5399be08aafc5f3583f3b33f0704947491a79d52377e6894696283 +size 4224 diff --git a/steering/emotion_directions_mect60k_axes/articulation.npy b/steering/emotion_directions_mect60k_axes/articulation.npy new file mode 100644 index 0000000000000000000000000000000000000000..c01297f133d63a82aa27e3a7f04cb9a7a8421fab --- /dev/null +++ b/steering/emotion_directions_mect60k_axes/articulation.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6276622cda7b4c1d39d2579922ef22ce2c33c1a95da31cf96c1f367a0dac54fc +size 4224 diff --git a/steering/emotion_directions_mect60k_axes/calibration.json b/steering/emotion_directions_mect60k_axes/calibration.json new file mode 100644 index 0000000000000000000000000000000000000000..e6487c0031294190dfd70be8ec692044c92c26da --- /dev/null +++ b/steering/emotion_directions_mect60k_axes/calibration.json @@ -0,0 +1,16 @@ +{ + "objective": "seed doses for the ZONOS3 Mini release LM (mect_60k) hidden-space (L9.attn) conceptual axes; replaced by calibrate_emotion_oneshot.py", + "grid": [], + "global_default": 4.0, + "default": { + "valence": 4, + "arousal": 4, + "dominance": 4, + "loudness": 2, + "tempo": 4, + "clarity": 2, + "articulation": 4 + }, + "by_speaker": {}, + "labels": {} +} \ No newline at end of file diff --git a/steering/emotion_directions_mect60k_axes/clarity.npy b/steering/emotion_directions_mect60k_axes/clarity.npy new file mode 100644 index 0000000000000000000000000000000000000000..401b4597c4d3caaa40ff1988cf7116e49332764c --- /dev/null +++ b/steering/emotion_directions_mect60k_axes/clarity.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:26ddf368a49732b5a1d49b782ac9a0d755081355fb49c00cbf782a66012809ee +size 4224 diff --git a/steering/emotion_directions_mect60k_axes/dominance.npy b/steering/emotion_directions_mect60k_axes/dominance.npy new file mode 100644 index 0000000000000000000000000000000000000000..426047b5ab28626a5894982be0fa752352f7ab62 --- /dev/null +++ b/steering/emotion_directions_mect60k_axes/dominance.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4f40a100e10fe7fea75d47bcb03666077eb6ea89ee57348bd278cfdfa683f6c3 +size 4224 diff --git a/steering/emotion_directions_mect60k_axes/loudness.npy b/steering/emotion_directions_mect60k_axes/loudness.npy new file mode 100644 index 0000000000000000000000000000000000000000..4ca4ef46f2958751c13a64bb60dc81aa4097210c --- /dev/null +++ b/steering/emotion_directions_mect60k_axes/loudness.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ceacf8712a042207eb974987a59fc3650f3bf298c564c9cc60c9497e950de8d9 +size 4224 diff --git a/steering/emotion_directions_mect60k_axes/manifest.json b/steering/emotion_directions_mect60k_axes/manifest.json new file mode 100644 index 0000000000000000000000000000000000000000..82c30ad41676cf5c60d1b186ab1ae49d3eaec712 --- /dev/null +++ b/steering/emotion_directions_mect60k_axes/manifest.json @@ -0,0 +1,478 @@ +{ + "dim": 1024, + "ref_base_norm": null, + "neutral": "default", + "space": "attnres_source", + "source_index": 19, + "source_name": "L9.attn", + "checkpoint": "/data/groups/audio/gabriel/hf_release_zonos3mini_20261020/lm/mect_60k", + "speaker_codec": null, + "folded_from": "emotion_directions_mect60k_full", + "axis_norm": 0.019202508467236323, + "common_mode_weight": { + "disgusted": 0.5, + "whisper": 1.0 + }, + "common_mode_energy": 0.209, + "axis_cosines": { + "valence": { + "valence": 1.0, + "arousal": -0.0, + "dominance": -0.0, + "loudness": 0.0, + "tempo": -0.0, + "clarity": 0.0, + "articulation": 0.0 + }, + "arousal": { + "valence": -0.0, + "arousal": 1.0, + "dominance": -0.0, + "loudness": -0.0, + "tempo": -0.0, + "clarity": 0.0, + "articulation": 0.0 + }, + "dominance": { + "valence": -0.0, + "arousal": -0.0, + "dominance": 1.0, + "loudness": -0.0, + "tempo": 0.0, + "clarity": -0.0, + "articulation": 0.0 + }, + "loudness": { + "valence": 0.0, + "arousal": -0.0, + "dominance": -0.0, + "loudness": 1.0, + "tempo": -0.0, + "clarity": -0.0, + "articulation": 0.0 + }, + "tempo": { + "valence": -0.0, + "arousal": -0.0, + "dominance": 0.0, + "loudness": -0.0, + "tempo": 1.0, + "clarity": -0.0, + "articulation": 0.0 + }, + "clarity": { + "valence": 0.0, + "arousal": 0.0, + "dominance": -0.0, + "loudness": -0.0, + "tempo": -0.0, + "clarity": 1.0, + "articulation": 0.0 + }, + "articulation": { + "valence": 0.0, + "arousal": 0.0, + "dominance": 0.0, + "loudness": 0.0, + "tempo": 0.0, + "clarity": 0.0, + "articulation": 1.0 + } + }, + "directions": { + "valence": { + "file": "valence.npy", + "kind": "axis", + "norm": 0.019202508467236323, + "group": "affect", + "recipe": { + "happy": 2.0, + "laughing": 0.5, + "calm": 0.5, + "sympathetic": 0.5, + "awe": 0.25, + "sad": -1.0, + "disgusted": -0.5, + "fearful": -0.5, + "sarcastic": -0.5 + }, + "judge": { + "+": [ + "happy", + "calm" + ], + "-": [ + "sad", + "angry" + ] + }, + "orthogonal_to": [], + "norm_kept_after_orthogonalisation": 1.0 + }, + "arousal": { + "file": "arousal.npy", + "kind": "axis", + "norm": 0.019202508467236326, + "group": "affect", + "recipe": { + "angry": 0.75, + "fearful": 0.5, + "fast": 1.0, + "projected": 0.75, + "happy": 0.5, + "laughing": 0.25, + "sleepy": -1.0, + "calm": -0.75, + "sad": -0.5, + "bored": -0.5, + "whisper": -0.5 + }, + "judge": { + "+": [ + "fast", + "angry" + ], + "-": [ + "sleepy", + "calm" + ] + }, + "orthogonal_to": [ + "valence" + ], + "norm_kept_after_orthogonalisation": 0.9826325241511435 + }, + "dominance": { + "file": "dominance.npy", + "kind": "axis", + "norm": 0.019202508467236326, + "group": "affect", + "recipe": { + "angry": 0.75, + "projected": 1.0, + "enunciated": 0.5, + "disgusted": 0.25, + "sarcastic": 0.5, + "fearful": -0.75, + "sympathetic": -0.5, + "confused": -0.75, + "whisper": -0.5, + "sad": -0.5 + }, + "judge": { + "+": [ + "projected", + "angry" + ], + "-": [ + "fearful", + "confused" + ] + }, + "orthogonal_to": [ + "valence", + "arousal" + ], + "norm_kept_after_orthogonalisation": 0.43153395904891756 + }, + "loudness": { + "file": "loudness.npy", + "kind": "axis", + "norm": 0.019202508467236323, + "group": "delivery", + "recipe": { + "projected": 1.0, + "whisper": -1.0 + }, + "judge": { + "+": [ + "projected" + ], + "-": [ + "whisper" + ] + }, + "orthogonal_to": [ + "valence", + "arousal", + "dominance" + ], + "norm_kept_after_orthogonalisation": 0.5074554432633701 + }, + "tempo": { + "file": "tempo.npy", + "kind": "axis", + "norm": 0.019202508467236323, + "group": "delivery", + "recipe": { + "fast": 1.0, + "sleepy": -1.0 + }, + "judge": { + "+": [ + "fast" + ], + "-": [ + "sleepy" + ] + }, + "orthogonal_to": [ + "valence", + "arousal", + "dominance", + "loudness" + ], + "norm_kept_after_orthogonalisation": 0.31900488621249623 + }, + "clarity": { + "file": "clarity.npy", + "kind": "axis", + "norm": 0.019202508467236323, + "group": "delivery", + "recipe": { + "enunciated": 1.0, + "confused": -0.75, + "sleepy": -0.5 + }, + "judge": { + "+": [ + "enunciated" + ], + "-": [ + "confused" + ] + }, + "orthogonal_to": [ + "valence", + "arousal", + "dominance", + "loudness", + "tempo" + ], + "norm_kept_after_orthogonalisation": 0.6487347803904722 + }, + "articulation": { + "file": "articulation.npy", + "kind": "axis", + "norm": 0.019202508467236323, + "group": "delivery", + "recipe": { + "enunciated": 1.0, + "confused": 1.0 + }, + "judge": { + "+": [ + "enunciated", + "confused" + ], + "-": null + }, + "orthogonal_to": [ + "valence", + "arousal", + "dominance", + "loudness", + "tempo", + "clarity" + ], + "norm_kept_after_orthogonalisation": 0.6930749370638022 + } + }, + "presets": { + "happy": { + "sliders": { + "valence": 1.0, + "arousal": 0.75, + "dominance": 0.08, + "loudness": 0.09, + "tempo": -0.24, + "clarity": 0.15, + "articulation": 0.11 + }, + "captured": 0.955 + }, + "sad": { + "sliders": { + "valence": -0.59, + "arousal": -1.0, + "dominance": -0.19, + "loudness": 0.31, + "tempo": -0.12, + "clarity": 0.34, + "articulation": 0.1 + }, + "captured": 0.938 + }, + "angry": { + "sliders": { + "valence": 0.06, + "arousal": 1.0, + "dominance": 0.14 + }, + "captured": 0.969 + }, + "calm": { + "sliders": { + "valence": -0.05, + "arousal": -1.0, + "loudness": 0.15, + "tempo": 0.34, + "articulation": -0.16 + }, + "captured": 0.933 + }, + "fearful": { + "sliders": { + "valence": -0.74, + "arousal": 1.0, + "dominance": -0.78, + "loudness": 0.21, + "tempo": -0.12, + "clarity": 0.07, + "articulation": -0.41 + }, + "captured": 0.962 + }, + "disgusted": { + "sliders": { + "valence": 0.33, + "arousal": 1.0, + "dominance": 0.26, + "loudness": -0.44, + "tempo": -0.53, + "clarity": -0.33 + }, + "captured": 0.713 + }, + "sympathetic": { + "sliders": { + "valence": -0.29, + "arousal": -1.0, + "dominance": -0.4, + "loudness": 0.28, + "tempo": 0.12, + "clarity": -0.25, + "articulation": -0.35 + }, + "captured": 0.909 + }, + "sarcastic": { + "sliders": { + "valence": -0.3, + "arousal": 1.0, + "dominance": 0.55, + "loudness": 0.28, + "tempo": -0.14, + "clarity": 0.07 + }, + "captured": 0.899 + }, + "confused": { + "sliders": { + "valence": -0.42, + "arousal": -0.44, + "loudness": 0.55, + "tempo": 0.14, + "clarity": 0.37, + "articulation": 1.0 + }, + "captured": 0.995 + }, + "awe": { + "sliders": { + "arousal": -1.0, + "dominance": -0.09, + "loudness": -0.24, + "tempo": 0.53, + "clarity": 0.34, + "articulation": -0.35 + }, + "captured": 0.797 + }, + "bored": { + "sliders": { + "valence": -1.0, + "arousal": -0.49, + "dominance": -0.24, + "loudness": 0.41, + "tempo": 0.3, + "clarity": -0.13 + }, + "captured": 0.771 + }, + "sleepy": { + "sliders": { + "valence": 0.08, + "arousal": -1.0, + "dominance": 0.35, + "loudness": 0.27, + "tempo": -0.83, + "clarity": -0.5 + }, + "captured": 0.939 + }, + "whisper": { + "sliders": { + "valence": 0.12, + "arousal": -0.9, + "dominance": -0.24, + "loudness": -1.0, + "clarity": -0.14 + }, + "captured": 0.963 + }, + "projected": { + "sliders": { + "valence": 0.46, + "arousal": 1.0, + "dominance": 0.39, + "loudness": 0.26, + "clarity": -0.12 + }, + "captured": 0.963 + }, + "fast": { + "sliders": { + "arousal": 1.0, + "dominance": -0.11, + "loudness": -0.08, + "clarity": -0.36 + }, + "captured": 0.939 + }, + "enunciated": { + "sliders": { + "valence": -0.06, + "arousal": -0.21, + "dominance": 0.42, + "loudness": 0.14, + "tempo": 0.46, + "clarity": 1.0, + "articulation": 0.8 + }, + "captured": 0.995 + }, + "laughing": { + "sliders": { + "valence": 0.44, + "arousal": 0.27, + "dominance": -0.24, + "tempo": -1.0, + "clarity": 0.17, + "articulation": 0.14 + }, + "captured": 0.541 + }, + "desire": { + "sliders": { + "valence": -0.74, + "arousal": -1.0, + "loudness": -0.15, + "tempo": 0.89, + "clarity": -0.32, + "articulation": -0.79 + }, + "captured": 0.672 + } + } +} diff --git a/steering/emotion_directions_mect60k_axes/tempo.npy b/steering/emotion_directions_mect60k_axes/tempo.npy new file mode 100644 index 0000000000000000000000000000000000000000..66a81b3270855d2f08a93712ed58b09ae6c82e85 --- /dev/null +++ b/steering/emotion_directions_mect60k_axes/tempo.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:36b5d8dc223b39be1fdac28b4013d5a64311f561bd630e3d0b09361245b73fa0 +size 4224 diff --git a/steering/emotion_directions_mect60k_axes/valence.npy b/steering/emotion_directions_mect60k_axes/valence.npy new file mode 100644 index 0000000000000000000000000000000000000000..cac071b542ccc1fceadbea51f686fa070665e08b --- /dev/null +++ b/steering/emotion_directions_mect60k_axes/valence.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0db6a006d29a55e2b92a46252ec190f65de5602c3296a13797a82f2776423a1b +size 4224 diff --git a/steering/english_accents_mect60k/american.npy b/steering/english_accents_mect60k/american.npy new file mode 100644 index 0000000000000000000000000000000000000000..06584fb348aaab05d09068621d7fb2aa8549ebaf --- /dev/null +++ b/steering/english_accents_mect60k/american.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a3330130880cc42734a6976fe196de30fcc42c9a84dd4674313ca92b3acd6b67 +size 896 diff --git a/steering/english_accents_mect60k/australian.npy b/steering/english_accents_mect60k/australian.npy new file mode 100644 index 0000000000000000000000000000000000000000..3e70d7d91bf179166095db8243e9d512be75d55f --- /dev/null +++ b/steering/english_accents_mect60k/australian.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5b923db90a566fee437462db2fe2e21cbd84471b697a5f8af8ff8f8a7759d97b +size 896 diff --git a/steering/english_accents_mect60k/british.npy b/steering/english_accents_mect60k/british.npy new file mode 100644 index 0000000000000000000000000000000000000000..9eea5fd5dbe433fd2f2138b18f4526ce34d681b2 --- /dev/null +++ b/steering/english_accents_mect60k/british.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5b5d5ed002ca179e49c2fdd2cae32fbcad1c6658b384a130a21bde2f4cf77ef7 +size 896 diff --git a/steering/english_accents_mect60k/eval_summary.json b/steering/english_accents_mect60k/eval_summary.json new file mode 100644 index 0000000000000000000000000000000000000000..dc0ff7358033edeeebebbe7cabbe65d58e5cb7ee --- /dev/null +++ b/steering/english_accents_mect60k/eval_summary.json @@ -0,0 +1,4020 @@ +{ + "all": { + "neutral": { + "wer": 0.001803221288515406, + "collapse": 0.0, + "identity": 0.9434228585850603, + "durx": 1.0, + "female": 0.6642780192366141, + "age": 37.844411159555115, + "f0": 143.67580687734284, + "f0_st": 2.8378235477189038, + "voiced": 0.6345504700360763, + "rms_db": -38.005955616633095, + "accent:North America": 0.172443125, + "accent:North America@1": 0.1875, + "accent:English": 0.39368541666666673, + "accent:English@1": 0.3958333333333333, + "accent:Scottish": 0.007066666666666666, + "accent:Scottish@1": 0.0, + "accent:Irish": 0.0006714583333333333, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.07923833333333333, + "accent:Oceania@1": 0.08333333333333333, + "accent:South Asia": 0.0005631249999999999, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.18440458333333332, + "accent:Welsh@1": 0.1875 + }, + "british x1": { + "wer": 0.0017092363261093913, + "collapse": 0.0, + "identity": 0.8712620045867459, + "durx": 0.9502719502719503, + "female": 0.6645642596583153, + "age": 37.262242349485554, + "f0": 144.47079101145766, + "f0_st": 3.4988927600353414, + "voiced": 0.6295099541548704, + "rms_db": -37.46363174915314, + "accent:North America": 0.003611875, + "accent:North America@1": 0.0, + "accent:English": 0.5528795833333333, + "accent:English@1": 0.5625, + "accent:Scottish": 0.05653520833333334, + "accent:Scottish@1": 0.041666666666666664, + "accent:Irish": 7.583333333333334e-05, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.042416666666666665, + "accent:Oceania@1": 0.041666666666666664, + "accent:South Asia": 4.520833333333333e-05, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.333661875, + "accent:Welsh@1": 0.3541666666666667 + }, + "british x1.5": { + "wer": 0.003614815491413957, + "collapse": 0.0, + "identity": 0.8396138207959297, + "durx": 0.9650756220523662, + "female": 0.6639842079409087, + "age": 35.85673145328959, + "f0": 145.1263427711759, + "f0_st": 3.535165255472675, + "voiced": 0.626195200892463, + "rms_db": -37.49537646770477, + "accent:North America": 0.0009812500000000001, + "accent:North America@1": 0.0, + "accent:English": 0.6665464583333334, + "accent:English@1": 0.6875, + "accent:Scottish": 0.009009999999999999, + "accent:Scottish@1": 0.0, + "accent:Irish": 3.791666666666667e-05, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.02107125, + "accent:Oceania@1": 0.020833333333333332, + "accent:South Asia": 1.3125e-05, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.29637020833333333, + "accent:Welsh@1": 0.2916666666666667 + }, + "british x2": { + "wer": 0.005124984776519304, + "collapse": 0.0, + "identity": 0.8037470900025475, + "durx": 0.938378311155329, + "female": 0.6649001425733635, + "age": 36.06163142248988, + "f0": 145.5364008701154, + "f0_st": 3.6058552463660747, + "voiced": 0.6440889605124422, + "rms_db": -38.720093727111816, + "accent:North America": 0.0010406249999999999, + "accent:North America@1": 0.0, + "accent:English": 0.7382637500000001, + "accent:English@1": 0.75, + "accent:Scottish": 0.015127916666666666, + "accent:Scottish@1": 0.0, + "accent:Irish": 4.0833333333333334e-05, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.010829375, + "accent:Oceania@1": 0.0, + "accent:South Asia": 1.1250000000000002e-05, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.21609729166666666, + "accent:Welsh@1": 0.22916666666666666 + }, + "american x1": { + "wer": 0.0024509803921568627, + "collapse": 0.0, + "identity": 0.8544435544681033, + "durx": 0.9746842050318405, + "female": 0.6679231186887288, + "age": 38.00438937420646, + "f0": 145.0445781627907, + "f0_st": 3.52073724573545, + "voiced": 0.6761690720973323, + "rms_db": -38.72478985786438, + "accent:North America": 0.4148570833333333, + "accent:North America@1": 0.4375, + "accent:English": 0.006029375, + "accent:English@1": 0.0, + "accent:Scottish": 0.005376875, + "accent:Scottish@1": 0.0, + "accent:Irish": 0.013195625, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.009300625, + "accent:Oceania@1": 0.0, + "accent:South Asia": 0.004557083333333333, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.008921666666666666, + "accent:Welsh@1": 0.0 + }, + "american x1.5": { + "wer": 0.002415966386554622, + "collapse": 0.0, + "identity": 0.8079673462629796, + "durx": 0.9765856950067477, + "female": 0.6660294077397945, + "age": 39.236620565255485, + "f0": 147.94225966182148, + "f0_st": 3.529447232924395, + "voiced": 0.7012243718151581, + "rms_db": -41.0225221713384, + "accent:North America": 0.3519591666666666, + "accent:North America@1": 0.3541666666666667, + "accent:English": 0.00030208333333333335, + "accent:English@1": 0.0, + "accent:Scottish": 0.0002985416666666667, + "accent:Scottish@1": 0.0, + "accent:Irish": 0.013834375000000001, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.004512916666666666, + "accent:Oceania@1": 0.0, + "accent:South Asia": 0.0021293749999999998, + "accent:South Asia@1": 0.0, + "accent:Welsh": 8.125e-06, + "accent:Welsh@1": 0.0 + }, + "american x2": { + "wer": 0.006705182072829132, + "collapse": 0.0, + "identity": 0.7583765916613295, + "durx": 1.0065789473684212, + "female": 0.6660788247196857, + "age": 40.58804797629515, + "f0": 149.87967910540445, + "f0_st": 3.763175619229937, + "voiced": 0.6806146299663434, + "rms_db": -41.8449133237203, + "accent:North America": 0.3306716666666667, + "accent:North America@1": 0.3333333333333333, + "accent:English": 0.00014041666666666667, + "accent:English@1": 0.0, + "accent:Scottish": 0.00010645833333333334, + "accent:Scottish@1": 0.0, + "accent:Irish": 0.005651666666666667, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.0040102083333333335, + "accent:Oceania@1": 0.0, + "accent:South Asia": 0.00094, + "accent:South Asia@1": 0.0, + "accent:Welsh": 2.916666666666667e-06, + "accent:Welsh@1": 0.0 + }, + "scottish x1": { + "wer": 0.0035124576146247973, + "collapse": 0.0, + "identity": 0.8730403389326743, + "durx": 0.9644994644994644, + "female": 0.6658133035283148, + "age": 36.840416522075735, + "f0": 140.11902093239402, + "f0_st": 2.8035306512253606, + "voiced": 0.6253322867084289, + "rms_db": -36.82698210080465, + "accent:North America": 0.013612916666666667, + "accent:North America@1": 0.0, + "accent:English": 0.426138125, + "accent:English@1": 0.4166666666666667, + "accent:Scottish": 0.23847229166666664, + "accent:Scottish@1": 0.22916666666666666, + "accent:Irish": 0.038793749999999995, + "accent:Irish@1": 0.041666666666666664, + "accent:Oceania": 0.06736458333333332, + "accent:Oceania@1": 0.08333333333333333, + "accent:South Asia": 0.0004027083333333333, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.18692645833333335, + "accent:Welsh@1": 0.22916666666666666 + }, + "scottish x1.5": { + "wer": 0.0029347265221878224, + "collapse": 0.0, + "identity": 0.8223643751416313, + "durx": 0.9256628787878787, + "female": 0.6647618355297406, + "age": 35.72898513327042, + "f0": 137.27053052514736, + "f0_st": 2.3817234771089617, + "voiced": 0.6390705323373248, + "rms_db": -38.55785667896271, + "accent:North America": 0.004772291666666667, + "accent:North America@1": 0.0, + "accent:English": 0.4473620833333333, + "accent:English@1": 0.4583333333333333, + "accent:Scottish": 0.218565625, + "accent:Scottish@1": 0.1875, + "accent:Irish": 0.04844124999999999, + "accent:Irish@1": 0.0625, + "accent:Oceania": 0.06076499999999999, + "accent:Oceania@1": 0.0625, + "accent:South Asia": 4.5416666666666675e-05, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.2107077083333333, + "accent:Welsh@1": 0.22916666666666666 + }, + "scottish x2": { + "wer": 0.007007408226448473, + "collapse": 0.0, + "identity": 0.7492171489533366, + "durx": 0.8969938107869142, + "female": 0.6647478332197352, + "age": 34.21585373580456, + "f0": 135.253261276297, + "f0_st": 2.1605111476036587, + "voiced": 0.6411633236244975, + "rms_db": -39.5404460032781, + "accent:North America": 0.0032460416666666666, + "accent:North America@1": 0.0, + "accent:English": 0.5993195833333332, + "accent:English@1": 0.625, + "accent:Scottish": 0.257031875, + "accent:Scottish@1": 0.25, + "accent:Irish": 0.024076249999999997, + "accent:Irish@1": 0.020833333333333332, + "accent:Oceania": 0.012416458333333333, + "accent:Oceania@1": 0.020833333333333332, + "accent:South Asia": 6.208333333333334e-05, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.09323416666666666, + "accent:Welsh@1": 0.08333333333333333 + }, + "irish x1": { + "wer": 0.003356777493606138, + "collapse": 0.0, + "identity": 0.8949225945127927, + "durx": 0.9515346069527091, + "female": 0.6645710835643209, + "age": 37.0641004294157, + "f0": 141.87371311512314, + "f0_st": 2.6374557274928994, + "voiced": 0.668923643230019, + "rms_db": -37.54180522759756, + "accent:North America": 0.06211958333333334, + "accent:North America@1": 0.08333333333333333, + "accent:English": 0.37114249999999993, + "accent:English@1": 0.375, + "accent:Scottish": 0.16348395833333332, + "accent:Scottish@1": 0.16666666666666666, + "accent:Irish": 0.09539729166666666, + "accent:Irish@1": 0.10416666666666667, + "accent:Oceania": 0.041151875000000004, + "accent:Oceania@1": 0.020833333333333332, + "accent:South Asia": 0.00098, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.20635395833333334, + "accent:Welsh@1": 0.20833333333333334 + }, + "irish x1.5": { + "wer": 0.0021137802947265865, + "collapse": 0.0, + "identity": 0.8512133483887862, + "durx": 0.931276274303731, + "female": 0.6648171493579866, + "age": 36.327024859686695, + "f0": 140.26658641543284, + "f0_st": 2.55184628242131, + "voiced": 0.6757936519939598, + "rms_db": -37.340344309806824, + "accent:North America": 0.019366666666666667, + "accent:North America@1": 0.0, + "accent:English": 0.46582791666666673, + "accent:English@1": 0.5, + "accent:Scottish": 0.10150208333333333, + "accent:Scottish@1": 0.08333333333333333, + "accent:Irish": 0.14826833333333334, + "accent:Irish@1": 0.16666666666666666, + "accent:Oceania": 0.07962375000000001, + "accent:Oceania@1": 0.10416666666666667, + "accent:South Asia": 0.0003441666666666667, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.15010500000000002, + "accent:Welsh@1": 0.125 + }, + "irish x2": { + "wer": 0.0021137802947265865, + "collapse": 0.0, + "identity": 0.8214288722691562, + "durx": 0.8885514629049113, + "female": 0.6657188418103033, + "age": 34.84520946318904, + "f0": 137.12425619317355, + "f0_st": 2.4021970669129273, + "voiced": 0.6929494489461954, + "rms_db": -36.429515957832336, + "accent:North America": 0.010731041666666668, + "accent:North America@1": 0.0, + "accent:English": 0.540256875, + "accent:English@1": 0.5416666666666666, + "accent:Scottish": 0.07507229166666667, + "accent:Scottish@1": 0.0625, + "accent:Irish": 0.153088125, + "accent:Irish@1": 0.16666666666666666, + "accent:Oceania": 0.051141875, + "accent:Oceania@1": 0.0625, + "accent:South Asia": 0.000645625, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.11195187499999999, + "accent:Welsh@1": 0.125 + }, + "australian x1": { + "wer": 0.001803221288515406, + "collapse": 0.0, + "identity": 0.8691114522063934, + "durx": 0.9736842105263159, + "female": 0.6639675542586095, + "age": 36.21323900297284, + "f0": 141.91985600342755, + "f0_st": 3.3233504993009615, + "voiced": 0.6650850407090861, + "rms_db": -35.66466768582662, + "accent:North America": 0.02335875, + "accent:North America@1": 0.041666666666666664, + "accent:English": 0.5129697916666666, + "accent:English@1": 0.5208333333333334, + "accent:Scottish": 0.0038760416666666665, + "accent:Scottish@1": 0.0, + "accent:Irish": 0.00037125, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.285081875, + "accent:Oceania@1": 0.2916666666666667, + "accent:South Asia": 0.00047312499999999997, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.16505666666666666, + "accent:Welsh@1": 0.14583333333333334 + }, + "australian x1.5": { + "wer": 0.0018207282913165264, + "collapse": 0.0, + "identity": 0.8161755022336271, + "durx": 0.9571577847439916, + "female": 0.6632371758047763, + "age": 35.03869309400519, + "f0": 138.9492854593001, + "f0_st": 2.9212179844316926, + "voiced": 0.660328868433254, + "rms_db": -35.083228488763176, + "accent:North America": 0.005488541666666667, + "accent:North America@1": 0.0, + "accent:English": 0.49339145833333337, + "accent:English@1": 0.4791666666666667, + "accent:Scottish": 0.003099375, + "accent:Scottish@1": 0.0, + "accent:Irish": 7.333333333333334e-05, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.409153125, + "accent:Oceania@1": 0.4375, + "accent:South Asia": 8.041666666666667e-05, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.07662916666666666, + "accent:Welsh@1": 0.0625 + }, + "australian x2": { + "wer": 0.0018207282913165264, + "collapse": 0.0, + "identity": 0.7750143111864554, + "durx": 0.9392651078044336, + "female": 0.6567153508610014, + "age": 31.56099859625101, + "f0": 135.91583369674078, + "f0_st": 2.723582938066684, + "voiced": 0.6571185426862711, + "rms_db": -34.20913394292196, + "accent:North America": 0.0031516666666666668, + "accent:North America@1": 0.0, + "accent:English": 0.5432816666666666, + "accent:English@1": 0.5625, + "accent:Scottish": 0.0028979166666666667, + "accent:Scottish@1": 0.0, + "accent:Irish": 0.00017687500000000003, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.43607375000000004, + "accent:Oceania@1": 0.4375, + "accent:South Asia": 3.6874999999999995e-05, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.013267291666666667, + "accent:Welsh@1": 0.0 + }, + "indian x1": { + "wer": 0.004142709715465134, + "collapse": 0.0, + "identity": 0.8063261649195566, + "durx": 0.9000316731332648, + "female": 0.6647237727496152, + "age": 38.38965610290567, + "f0": 150.06633927364996, + "f0_st": 3.0394501415972583, + "voiced": 0.7281876058379702, + "rms_db": -37.809679667154946, + "accent:North America": 0.005473958333333334, + "accent:North America@1": 0.0, + "accent:English": 0.28664729166666664, + "accent:English@1": 0.3125, + "accent:Scottish": 0.024950833333333335, + "accent:Scottish@1": 0.0, + "accent:Irish": 0.0007233333333333333, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.035152916666666666, + "accent:Oceania@1": 0.041666666666666664, + "accent:South Asia": 0.2992297916666667, + "accent:South Asia@1": 0.3125, + "accent:Welsh": 0.25205500000000003, + "accent:Welsh@1": 0.2708333333333333 + }, + "indian x1.5": { + "wer": 0.013409602971623432, + "collapse": 0.0, + "identity": 0.7018202624210154, + "durx": 0.8376569729015202, + "female": 0.6653589812776772, + "age": 36.42307575792074, + "f0": 154.4962683494397, + "f0_st": 2.7743958625711187, + "voiced": 0.7533826153184453, + "rms_db": -36.447019259134926, + "accent:North America": 0.005948958333333334, + "accent:North America@1": 0.0, + "accent:English": 0.03169708333333333, + "accent:English@1": 0.0, + "accent:Scottish": 0.05510479166666667, + "accent:Scottish@1": 0.0625, + "accent:Irish": 0.001185625, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.007528333333333334, + "accent:Oceania@1": 0.0, + "accent:South Asia": 0.7124747916666666, + "accent:South Asia@1": 0.7916666666666666, + "accent:Welsh": 0.1353916666666667, + "accent:Welsh@1": 0.125 + }, + "indian x2": { + "wer": 0.019789443237249134, + "collapse": 0.020833333333333332, + "identity": 0.6160281272726609, + "durx": 0.808957219251337, + "female": 0.6660135738081104, + "age": 35.39166130746404, + "f0": 160.46423622318915, + "f0_st": 2.7783812366841345, + "voiced": 0.7576915956338311, + "rms_db": -36.87368373076121, + "accent:North America": 0.0015714583333333333, + "accent:North America@1": 0.0, + "accent:English": 0.013692291666666669, + "accent:English@1": 0.0, + "accent:Scottish": 0.009128333333333334, + "accent:Scottish@1": 0.0, + "accent:Irish": 9e-05, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.0018752083333333338, + "accent:Oceania@1": 0.0, + "accent:South Asia": 0.9066677083333333, + "accent:South Asia@1": 0.9583333333333334, + "accent:Welsh": 0.039407083333333336, + "accent:Welsh@1": 0.041666666666666664 + }, + "welsh x1": { + "wer": 0.0005952380952380952, + "collapse": 0.0, + "identity": 0.8655318142007222, + "durx": 1.0795574288724974, + "female": 0.6658745847695778, + "age": 39.38348572701216, + "f0": 142.30202579014193, + "f0_st": 3.1966596690929916, + "voiced": 0.6735566857679137, + "rms_db": -39.2999804019928, + "accent:North America": 0.004288750000000001, + "accent:North America@1": 0.0, + "accent:English": 0.3722229166666666, + "accent:English@1": 0.3541666666666667, + "accent:Scottish": 0.08232437499999999, + "accent:Scottish@1": 0.0625, + "accent:Irish": 0.009868541666666666, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.033235625, + "accent:Oceania@1": 0.020833333333333332, + "accent:South Asia": 0.000261875, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.47162125000000005, + "accent:Welsh@1": 0.5416666666666666 + }, + "welsh x1.5": { + "wer": 0.001207983193277311, + "collapse": 0.0, + "identity": 0.8129951018938967, + "durx": 1.1197845507094062, + "female": 0.6654876071770559, + "age": 40.911259253819786, + "f0": 144.46905606119552, + "f0_st": 3.3509129737118357, + "voiced": 0.6787166130752906, + "rms_db": -41.01684709390005, + "accent:North America": 0.0030264583333333337, + "accent:North America@1": 0.0, + "accent:English": 0.34012812499999995, + "accent:English@1": 0.3541666666666667, + "accent:Scottish": 0.022088333333333335, + "accent:Scottish@1": 0.020833333333333332, + "accent:Irish": 0.00013166666666666668, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.020722291666666667, + "accent:Oceania@1": 0.0, + "accent:South Asia": 0.00015583333333333332, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.5806125, + "accent:Welsh@1": 0.6041666666666666 + }, + "welsh x2": { + "wer": 0.0032102715227967614, + "collapse": 0.0, + "identity": 0.7622917475916875, + "durx": 1.1976959133821878, + "female": 0.6650126815851157, + "age": 40.64601010953387, + "f0": 141.0345075057502, + "f0_st": 3.68162762542669, + "voiced": 0.7132011705395783, + "rms_db": -42.817385951677956, + "accent:North America": 0.0014379166666666666, + "accent:North America@1": 0.0, + "accent:English": 0.25078375, + "accent:English@1": 0.2708333333333333, + "accent:Scottish": 0.0031435416666666664, + "accent:Scottish@1": 0.0, + "accent:Irish": 0.00010916666666666666, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.009653125, + "accent:Oceania@1": 0.0, + "accent:South Asia": 4.1458333333333336e-05, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.6778989583333334, + "accent:Welsh@1": 0.6458333333333334 + } + }, + "American Female": { + "neutral": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9491112383517852, + "durx": 1.0, + "female": 0.9853595942258835, + "age": 30.74580542743206, + "f0": 154.97109496812877, + "f0_st": 1.7581294845149986, + "voiced": 0.6955018220052585, + "rms_db": -31.640471935272217, + "accent:North America": 0.48815375, + "accent:North America@1": 0.625, + "accent:English": 0.0019975, + "accent:English@1": 0.0, + "accent:Scottish": 0.0011524999999999999, + "accent:Scottish@1": 0.0, + "accent:Irish": 0.0027825, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.0024912500000000004, + "accent:Oceania@1": 0.0, + "accent:South Asia": 0.0019625, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.00072125, + "accent:Welsh@1": 0.0 + }, + "british x1": { + "wer": 0.006578947368421052, + "collapse": 0.0, + "identity": 0.8312975958805346, + "durx": 1.0, + "female": 0.9895196259021759, + "age": 30.64110279083252, + "f0": 155.4657085365064, + "f0_st": 1.8913104376818204, + "voiced": 0.6539244158942935, + "rms_db": -31.35777974128723, + "accent:North America": 0.00035375, + "accent:North America@1": 0.0, + "accent:English": 0.38095, + "accent:English@1": 0.375, + "accent:Scottish": 0.0031675, + "accent:Scottish@1": 0.0, + "accent:Irish": 1.8750000000000002e-05, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.00063125, + "accent:Oceania@1": 0.0, + "accent:South Asia": 1.25e-05, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.6124725, + "accent:Welsh@1": 0.625 + }, + "british x1.5": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.7886607798364464, + "durx": 1.0519209858644436, + "female": 0.9898502975702286, + "age": 29.688173532485962, + "f0": 155.81085957755113, + "f0_st": 1.8056056538180267, + "voiced": 0.6523968151499601, + "rms_db": -28.563501119613647, + "accent:North America": 0.00027125, + "accent:North America@1": 0.0, + "accent:English": 0.45690875000000003, + "accent:English@1": 0.5, + "accent:Scottish": 0.0008425, + "accent:Scottish@1": 0.0, + "accent:Irish": 5e-06, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.00274125, + "accent:Oceania@1": 0.0, + "accent:South Asia": 6.25e-06, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.53789625, + "accent:Welsh@1": 0.5 + }, + "british x2": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.7268116048836403, + "durx": 0.9569747899159664, + "female": 0.9940019249916077, + "age": 34.602805972099304, + "f0": 154.04155695985162, + "f0_st": 1.9935305552346128, + "voiced": 0.6581439524742476, + "rms_db": -28.876713514328003, + "accent:North America": 4.5e-05, + "accent:North America@1": 0.0, + "accent:English": 0.54816875, + "accent:English@1": 0.5, + "accent:Scottish": 0.0016975, + "accent:Scottish@1": 0.0, + "accent:Irish": 0.0, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.0005762499999999999, + "accent:Oceania@1": 0.0, + "accent:South Asia": 1.25e-06, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.44783, + "accent:Welsh@1": 0.5 + }, + "american x1": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.8962935943562313, + "durx": 0.997191011235955, + "female": 0.9902839511632919, + "age": 32.528018951416016, + "f0": 162.45597207260863, + "f0_st": 2.1304677081515617, + "voiced": 0.742175200195127, + "rms_db": -31.374963521957397, + "accent:North America": 0.462545, + "accent:North America@1": 0.5, + "accent:English": 0.00021375, + "accent:English@1": 0.0, + "accent:Scottish": 0.00023875000000000003, + "accent:Scottish@1": 0.0, + "accent:Irish": 0.0015075, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.00106, + "accent:Oceania@1": 0.0, + "accent:South Asia": 0.00083875, + "accent:South Asia@1": 0.0, + "accent:Welsh": 1.25e-06, + "accent:Welsh@1": 0.0 + }, + "american x1.5": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.8442376823485773, + "durx": 0.9563095238095238, + "female": 0.9940891042351723, + "age": 37.53054514527321, + "f0": 163.21275648236127, + "f0_st": 2.413960916956812, + "voiced": 0.7439259497296434, + "rms_db": -31.96074867248535, + "accent:North America": 0.4373275, + "accent:North America@1": 0.5, + "accent:English": 0.00011875000000000001, + "accent:English@1": 0.0, + "accent:Scottish": 2.125e-05, + "accent:Scottish@1": 0.0, + "accent:Irish": 0.00160125, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.00128125, + "accent:Oceania@1": 0.0, + "accent:South Asia": 0.0009199999999999999, + "accent:South Asia@1": 0.0, + "accent:Welsh": 1.25e-06, + "accent:Welsh@1": 0.0 + }, + "american x2": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.7636091013846742, + "durx": 0.8977526162291989, + "female": 0.9952746704220772, + "age": 39.28799293935299, + "f0": 168.9911903003813, + "f0_st": 2.2757449130048313, + "voiced": 0.7593620148187912, + "rms_db": -30.907915115356445, + "accent:North America": 0.23656249999999998, + "accent:North America@1": 0.125, + "accent:English": 3.375e-05, + "accent:English@1": 0.0, + "accent:Scottish": 1.25e-06, + "accent:Scottish@1": 0.0, + "accent:Irish": 0.0003575, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.0009437499999999999, + "accent:Oceania@1": 0.0, + "accent:South Asia": 0.00049875, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.0, + "accent:Welsh@1": 0.0 + }, + "scottish x1": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.8725754276468749, + "durx": 1.0949404761904762, + "female": 0.9894047379493713, + "age": 29.93931546807289, + "f0": 151.21087390857807, + "f0_st": 1.6361192315257387, + "voiced": 0.631192030011117, + "rms_db": -31.667858600616455, + "accent:North America": 0.03518875, + "accent:North America@1": 0.0, + "accent:English": 0.09809625000000001, + "accent:English@1": 0.0, + "accent:Scottish": 0.36111875, + "accent:Scottish@1": 0.375, + "accent:Irish": 0.230885, + "accent:Irish@1": 0.25, + "accent:Oceania": 0.0008025, + "accent:Oceania@1": 0.0, + "accent:South Asia": 0.00038625, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.22085000000000002, + "accent:Welsh@1": 0.375 + }, + "scottish x1.5": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.7711519539666535, + "durx": 0.9915730337078652, + "female": 0.9924964755773544, + "age": 31.82433173060417, + "f0": 149.43109578786198, + "f0_st": 1.7648144598935818, + "voiced": 0.660678666557329, + "rms_db": -30.410443782806396, + "accent:North America": 0.003905, + "accent:North America@1": 0.0, + "accent:English": 0.15245375, + "accent:English@1": 0.125, + "accent:Scottish": 0.2247325, + "accent:Scottish@1": 0.125, + "accent:Irish": 0.28921125000000003, + "accent:Irish@1": 0.375, + "accent:Oceania": 0.0002025, + "accent:Oceania@1": 0.0, + "accent:South Asia": 0.00019125000000000001, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.299355, + "accent:Welsh@1": 0.375 + }, + "scottish x2": { + "wer": 0.003676470588235294, + "collapse": 0.0, + "identity": 0.6502796120022167, + "durx": 0.9469086021505376, + "female": 0.9952444434165955, + "age": 34.52310673892498, + "f0": 145.58691675549068, + "f0_st": 1.5602330926011825, + "voiced": 0.6940954817954492, + "rms_db": -28.864548206329346, + "accent:North America": 0.0014712500000000001, + "accent:North America@1": 0.0, + "accent:English": 0.31788, + "accent:English@1": 0.25, + "accent:Scottish": 0.29647249999999997, + "accent:Scottish@1": 0.375, + "accent:Irish": 0.14266625, + "accent:Irish@1": 0.125, + "accent:Oceania": 0.00042750000000000004, + "accent:Oceania@1": 0.0, + "accent:South Asia": 0.00027625, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.2343975, + "accent:Welsh@1": 0.25 + }, + "irish x1": { + "wer": 0.01278772378516624, + "collapse": 0.0, + "identity": 0.881903650138447, + "durx": 0.9519442608504076, + "female": 0.985502079129219, + "age": 28.621164336800575, + "f0": 155.4865909807171, + "f0_st": 1.6190251683919252, + "voiced": 0.6800423460163267, + "rms_db": -30.71289873123169, + "accent:North America": 0.0156675, + "accent:North America@1": 0.0, + "accent:English": 0.04782125, + "accent:English@1": 0.0, + "accent:Scottish": 0.17838874999999998, + "accent:Scottish@1": 0.125, + "accent:Irish": 0.5552625, + "accent:Irish@1": 0.625, + "accent:Oceania": 0.0008775, + "accent:Oceania@1": 0.0, + "accent:South Asia": 0.00039999999999999996, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.18737, + "accent:Welsh@1": 0.25 + }, + "irish x1.5": { + "wer": 0.005434782608695652, + "collapse": 0.0, + "identity": 0.8289276367038355, + "durx": 0.9351349606095829, + "female": 0.9886890351772308, + "age": 30.208462849259377, + "f0": 152.35398754832707, + "f0_st": 1.6247891624647153, + "voiced": 0.6990497030347692, + "rms_db": -28.613250494003296, + "accent:North America": 0.00309625, + "accent:North America@1": 0.0, + "accent:English": 0.007670000000000001, + "accent:English@1": 0.0, + "accent:Scottish": 0.09573375, + "accent:Scottish@1": 0.0, + "accent:Irish": 0.8854175, + "accent:Irish@1": 1.0, + "accent:Oceania": 2.125e-05, + "accent:Oceania@1": 0.0, + "accent:South Asia": 5.125e-05, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.005353750000000001, + "accent:Welsh@1": 0.0 + }, + "irish x2": { + "wer": 0.005434782608695652, + "collapse": 0.0, + "identity": 0.7926814126141483, + "durx": 0.941689708141321, + "female": 0.9897153154015541, + "age": 31.1893492937088, + "f0": 152.614521593282, + "f0_st": 1.435784133032148, + "voiced": 0.7026177716045199, + "rms_db": -28.103437900543213, + "accent:North America": 0.0071575, + "accent:North America@1": 0.0, + "accent:English": 0.00872, + "accent:English@1": 0.0, + "accent:Scottish": 0.045698749999999996, + "accent:Scottish@1": 0.0, + "accent:Irish": 0.91033125, + "accent:Irish@1": 1.0, + "accent:Oceania": 0.00015000000000000001, + "accent:Oceania@1": 0.0, + "accent:South Asia": 0.0002075, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.00025, + "accent:Welsh@1": 0.0 + }, + "australian x1": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.8366427733526729, + "durx": 1.0344686329588013, + "female": 0.9861967712640762, + "age": 28.2894354313612, + "f0": 155.58964457418506, + "f0_st": 1.7195141430623864, + "voiced": 0.6614702275076619, + "rms_db": -28.73928689956665, + "accent:North America": 0.11276874999999999, + "accent:North America@1": 0.25, + "accent:English": 0.53088125, + "accent:English@1": 0.625, + "accent:Scottish": 0.005170000000000001, + "accent:Scottish@1": 0.0, + "accent:Irish": 0.0017, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.13057375, + "accent:Oceania@1": 0.0, + "accent:South Asia": 0.0008175, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.18563625, + "accent:Welsh@1": 0.125 + }, + "australian x1.5": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.747698251039572, + "durx": 0.9585900688655309, + "female": 0.9846498742699623, + "age": 28.64417266100645, + "f0": 158.61992886048324, + "f0_st": 1.0947808035879352, + "voiced": 0.674186827925713, + "rms_db": -26.532439470291138, + "accent:North America": 0.0026175, + "accent:North America@1": 0.0, + "accent:English": 0.4996125, + "accent:English@1": 0.5, + "accent:Scottish": 0.0009875, + "accent:Scottish@1": 0.0, + "accent:Irish": 0.00015125, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.47704499999999994, + "accent:Oceania@1": 0.5, + "accent:South Asia": 2.3749999999999998e-05, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.0156325, + "accent:Welsh@1": 0.0 + }, + "australian x2": { + "wer": 0.007247899159663866, + "collapse": 0.0, + "identity": 0.6994130260065702, + "durx": 0.920577849117175, + "female": 0.9895146638154984, + "age": 30.027569085359573, + "f0": 154.34444717145877, + "f0_st": 1.407451275686121, + "voiced": 0.6677894539519472, + "rms_db": -24.13688635826111, + "accent:North America": 0.0007462500000000001, + "accent:North America@1": 0.0, + "accent:English": 0.51070375, + "accent:English@1": 0.5, + "accent:Scottish": 0.00038250000000000003, + "accent:Scottish@1": 0.0, + "accent:Irish": 1.6250000000000002e-05, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.4863350000000001, + "accent:Oceania@1": 0.5, + "accent:South Asia": 2.5e-06, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.00057375, + "accent:Welsh@1": 0.0 + }, + "indian x1": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.791372353789263, + "durx": 0.9323364177131527, + "female": 0.9874512925744057, + "age": 29.079538583755493, + "f0": 161.0911661581343, + "f0_st": 2.04734700741721, + "voiced": 0.7456683452938069, + "rms_db": -31.01770043373108, + "accent:North America": 0.00655875, + "accent:North America@1": 0.0, + "accent:English": 0.02583625, + "accent:English@1": 0.0, + "accent:Scottish": 0.0032125, + "accent:Scottish@1": 0.0, + "accent:Irish": 0.0009475, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.0008575, + "accent:Oceania@1": 0.0, + "accent:South Asia": 0.66199125, + "accent:South Asia@1": 0.75, + "accent:Welsh": 0.10920375, + "accent:Welsh@1": 0.125 + }, + "indian x1.5": { + "wer": 0.014705882352941176, + "collapse": 0.0, + "identity": 0.6675922724688717, + "durx": 0.8438488298545224, + "female": 0.9909328669309616, + "age": 30.312056094408035, + "f0": 163.07387959192891, + "f0_st": 2.011824140042159, + "voiced": 0.7680275417270472, + "rms_db": -29.796685457229614, + "accent:North America": 5.7499999999999995e-05, + "accent:North America@1": 0.0, + "accent:English": 0.0006424999999999998, + "accent:English@1": 0.0, + "accent:Scottish": 0.0, + "accent:Scottish@1": 0.0, + "accent:Irish": 0.0, + "accent:Irish@1": 0.0, + "accent:Oceania": 1.25e-06, + "accent:Oceania@1": 0.0, + "accent:South Asia": 0.999155, + "accent:South Asia@1": 1.0, + "accent:Welsh": 0.0, + "accent:Welsh@1": 0.0 + }, + "indian x2": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.5710272433209032, + "durx": 0.796551724137931, + "female": 0.9960191175341606, + "age": 38.63353356719017, + "f0": 166.13428503259655, + "f0_st": 2.235037247768248, + "voiced": 0.7594508660711254, + "rms_db": -33.43618059158325, + "accent:North America": 7.25e-05, + "accent:North America@1": 0.0, + "accent:English": 0.00026, + "accent:English@1": 0.0, + "accent:Scottish": 0.0, + "accent:Scottish@1": 0.0, + "accent:Irish": 0.0, + "accent:Irish@1": 0.0, + "accent:Oceania": 5e-06, + "accent:Oceania@1": 0.0, + "accent:South Asia": 0.998705, + "accent:South Asia@1": 1.0, + "accent:Welsh": 0.0, + "accent:Welsh@1": 0.0 + }, + "welsh x1": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.8621443283661262, + "durx": 1.188235294117647, + "female": 0.9886542484164238, + "age": 31.705227866768837, + "f0": 154.1306732685141, + "f0_st": 1.8168304521842629, + "voiced": 0.6759638557832478, + "rms_db": -30.984384298324585, + "accent:North America": 0.00957125, + "accent:North America@1": 0.0, + "accent:English": 0.088525, + "accent:English@1": 0.0, + "accent:Scottish": 0.2560875, + "accent:Scottish@1": 0.25, + "accent:Irish": 0.0585575, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.00036125, + "accent:Oceania@1": 0.0, + "accent:South Asia": 0.00044625000000000003, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.55190875, + "accent:Welsh@1": 0.75 + }, + "welsh x1.5": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.7781474075255, + "durx": 1.239307720188474, + "female": 0.9933583959937096, + "age": 34.00287181138992, + "f0": 153.56936954425322, + "f0_st": 1.8402063929203651, + "voiced": 0.6932193170400083, + "rms_db": -33.00029468536377, + "accent:North America": 1.8750000000000002e-05, + "accent:North America@1": 0.0, + "accent:English": 0.06742625000000001, + "accent:English@1": 0.0, + "accent:Scottish": 0.00020250000000000002, + "accent:Scottish@1": 0.0, + "accent:Irish": 7.5e-06, + "accent:Irish@1": 0.0, + "accent:Oceania": 1.3750000000000002e-05, + "accent:Oceania@1": 0.0, + "accent:South Asia": 5e-06, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.93210375, + "accent:Welsh@1": 1.0 + }, + "welsh x2": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.7249944758945384, + "durx": 1.3637144745538663, + "female": 0.9948465451598167, + "age": 37.82985843718052, + "f0": 152.6216371173792, + "f0_st": 1.9015240814855503, + "voiced": 0.6935251053537387, + "rms_db": -33.08171558380127, + "accent:North America": 9e-05, + "accent:North America@1": 0.0, + "accent:English": 0.008624999999999999, + "accent:English@1": 0.0, + "accent:Scottish": 0.00016125, + "accent:Scottish@1": 0.0, + "accent:Irish": 1.375e-05, + "accent:Irish@1": 0.0, + "accent:Oceania": 5.875e-05, + "accent:Oceania@1": 0.0, + "accent:South Asia": 1.875e-05, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.9905925, + "accent:Welsh@1": 1.0 + } + }, + "American Male": { + "neutral": { + "wer": 0.003676470588235294, + "collapse": 0.0, + "identity": 0.9350361538207567, + "durx": 1.0, + "female": 0.0020230181835358962, + "age": 48.180196806788445, + "f0": 115.77960832879836, + "f0_st": 4.021952994749228, + "voiced": 0.4818184305366697, + "rms_db": -44.970130920410156, + "accent:North America": 0.53772, + "accent:North America@1": 0.5, + "accent:English": 2.625e-05, + "accent:English@1": 0.0, + "accent:Scottish": 6.25e-05, + "accent:Scottish@1": 0.0, + "accent:Irish": 0.00054375, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.012976249999999998, + "accent:Oceania@1": 0.0, + "accent:South Asia": 0.0003375, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.0, + "accent:Welsh@1": 0.0 + }, + "british x1": { + "wer": 0.003676470588235294, + "collapse": 0.0, + "identity": 0.8106478705552036, + "durx": 0.9416944753429737, + "female": 0.0018056441185763106, + "age": 49.448008835315704, + "f0": 111.10595834825124, + "f0_st": 3.262679926830225, + "voiced": 0.4399752573059026, + "rms_db": -40.02676725387573, + "accent:North America": 0.018003750000000002, + "accent:North America@1": 0.0, + "accent:English": 0.32348875, + "accent:English@1": 0.375, + "accent:Scottish": 0.04806374999999999, + "accent:Scottish@1": 0.0, + "accent:Irish": 0.00011375, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.2395675, + "accent:Oceania@1": 0.25, + "accent:South Asia": 7.75e-05, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.329115, + "accent:Welsh@1": 0.375 + }, + "british x1.5": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.7647591784112564, + "durx": 0.9460445468509986, + "female": 0.0019463977369014174, + "age": 43.39222572743893, + "f0": 106.59400718435316, + "f0_st": 3.607589621888253, + "voiced": 0.450698805671791, + "rms_db": -40.21406412124634, + "accent:North America": 0.00470375, + "accent:North America@1": 0.0, + "accent:English": 0.6520762499999999, + "accent:English@1": 0.625, + "accent:Scottish": 0.01599375, + "accent:Scottish@1": 0.0, + "accent:Irish": 7.75e-05, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.11507125, + "accent:Oceania@1": 0.125, + "accent:South Asia": 3.2500000000000004e-05, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.20612375, + "accent:Welsh@1": 0.25 + }, + "british x2": { + "wer": 0.011029411764705881, + "collapse": 0.0, + "identity": 0.7434415972163938, + "durx": 0.9168208245243129, + "female": 0.0019995463808299974, + "age": 40.19385986030102, + "f0": 109.5357734442053, + "f0_st": 3.2556150503699515, + "voiced": 0.49457889243375497, + "rms_db": -44.05427551269531, + "accent:North America": 0.0034087500000000003, + "accent:North America@1": 0.0, + "accent:English": 0.62163875, + "accent:English@1": 0.625, + "accent:Scottish": 0.06924125, + "accent:Scottish@1": 0.0, + "accent:Irish": 8.999999999999999e-05, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.049967500000000005, + "accent:Oceania@1": 0.0, + "accent:South Asia": 1.5000000000000002e-05, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.16526625, + "accent:Welsh@1": 0.25 + }, + "american x1": { + "wer": 0.003676470588235294, + "collapse": 0.0, + "identity": 0.8915344056392833, + "durx": 1.0259957230686982, + "female": 0.002470333070959896, + "age": 41.82285778224468, + "f0": 111.72641304844646, + "f0_st": 5.959646935397333, + "voiced": 0.47916796375836773, + "rms_db": -45.37539529800415, + "accent:North America": 0.3661675, + "accent:North America@1": 0.25, + "accent:English": 5e-06, + "accent:English@1": 0.0, + "accent:Scottish": 2.5e-06, + "accent:Scottish@1": 0.0, + "accent:Irish": 0.00033875, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.00348375, + "accent:Oceania@1": 0.0, + "accent:South Asia": 0.00016875, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.0, + "accent:Welsh@1": 0.0 + }, + "american x1.5": { + "wer": 0.007352941176470588, + "collapse": 0.0, + "identity": 0.8400682034315342, + "durx": 1.0593185550082103, + "female": 0.003367139695910737, + "age": 40.44817462563515, + "f0": 112.53829544493588, + "f0_st": 5.415502505533465, + "voiced": 0.5394304286712546, + "rms_db": -47.67458438873291, + "accent:North America": 0.3919975, + "accent:North America@1": 0.375, + "accent:English": 1.25e-06, + "accent:English@1": 0.0, + "accent:Scottish": 0.0, + "accent:Scottish@1": 0.0, + "accent:Irish": 0.00030125000000000003, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.0040212500000000005, + "accent:Oceania@1": 0.0, + "accent:South Asia": 0.00012625, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.0, + "accent:Welsh@1": 0.0 + }, + "american x2": { + "wer": 0.01838235294117647, + "collapse": 0.0, + "identity": 0.7918646117205101, + "durx": 1.0691067653276956, + "female": 0.003116614811006002, + "age": 41.36682152748108, + "f0": 112.07197239417363, + "f0_st": 5.863380413624741, + "voiced": 0.4701416048517225, + "rms_db": -43.89907121658325, + "accent:North America": 0.27078, + "accent:North America@1": 0.25, + "accent:English": 6.25e-06, + "accent:English@1": 0.0, + "accent:Scottish": 1.1249999999999999e-05, + "accent:Scottish@1": 0.0, + "accent:Irish": 0.00117625, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.004443750000000001, + "accent:Oceania@1": 0.0, + "accent:South Asia": 0.00013, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.0, + "accent:Welsh@1": 0.0 + }, + "scottish x1": { + "wer": 0.003676470588235294, + "collapse": 0.0, + "identity": 0.811912248278055, + "durx": 0.9138477801268499, + "female": 0.0018782034458126873, + "age": 45.12190520763397, + "f0": 104.85105442688865, + "f0_st": 2.7109560354211055, + "voiced": 0.4992769864871276, + "rms_db": -40.615371227264404, + "accent:North America": 0.04209875, + "accent:North America@1": 0.0, + "accent:English": 0.27761125, + "accent:English@1": 0.25, + "accent:Scottish": 0.03951125, + "accent:Scottish@1": 0.0, + "accent:Irish": 0.00087375, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.38891624999999996, + "accent:Oceania@1": 0.5, + "accent:South Asia": 0.0006249999999999999, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.1612675, + "accent:Welsh@1": 0.25 + }, + "scottish x1.5": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.7585245221243995, + "durx": 0.8828369905956113, + "female": 0.0021609953400911763, + "age": 41.476983577013016, + "f0": 100.74153332584582, + "f0_st": 2.6002771259265414, + "voiced": 0.5137094354044627, + "rms_db": -40.143672466278076, + "accent:North America": 0.01953875, + "accent:North America@1": 0.0, + "accent:English": 0.47780125000000007, + "accent:English@1": 0.5, + "accent:Scottish": 0.049288750000000006, + "accent:Scottish@1": 0.0, + "accent:Irish": 0.0003075, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.3422525, + "accent:Oceania@1": 0.375, + "accent:South Asia": 4.25e-05, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.0935275, + "accent:Welsh@1": 0.125 + }, + "scottish x2": { + "wer": 0.003676470588235294, + "collapse": 0.0, + "identity": 0.6683305280619339, + "durx": 0.8007168458781362, + "female": 0.0019617916113929823, + "age": 31.19499348104, + "f0": 98.0382180364794, + "f0_st": 2.6793500834385355, + "voiced": 0.5070710130113435, + "rms_db": -42.64324378967285, + "accent:North America": 0.014570000000000001, + "accent:North America@1": 0.0, + "accent:English": 0.78241125, + "accent:English@1": 0.875, + "accent:Scottish": 0.07715125, + "accent:Scottish@1": 0.0, + "accent:Irish": 0.0005412500000000001, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.06748375000000001, + "accent:Oceania@1": 0.125, + "accent:South Asia": 6.374999999999999e-05, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.011090000000000001, + "accent:Welsh@1": 0.0 + }, + "irish x1": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.8799489261101467, + "durx": 0.9519969278033795, + "female": 0.0019552638768800534, + "age": 48.32703098654747, + "f0": 103.76115402719762, + "f0_st": 2.936202749828489, + "voiced": 0.6102392853637155, + "rms_db": -41.13544845581055, + "accent:North America": 0.335225, + "accent:North America@1": 0.5, + "accent:English": 0.018285000000000003, + "accent:English@1": 0.0, + "accent:Scottish": 0.17193625, + "accent:Scottish@1": 0.125, + "accent:Irish": 0.014764999999999999, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.1773225, + "accent:Oceania@1": 0.125, + "accent:South Asia": 0.0044025, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.00073875, + "accent:Welsh@1": 0.0 + }, + "irish x1.5": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.7917043386239434, + "durx": 0.9339984143763214, + "female": 0.0016821500903461128, + "age": 45.276058465242386, + "f0": 98.69953266587666, + "f0_st": 1.9346657481855662, + "voiced": 0.5859079250553132, + "rms_db": -41.83007192611694, + "accent:North America": 0.066595, + "accent:North America@1": 0.0, + "accent:English": 0.12503, + "accent:English@1": 0.125, + "accent:Scottish": 0.11601, + "accent:Scottish@1": 0.125, + "accent:Irish": 0.00094125, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.38197749999999997, + "accent:Oceania@1": 0.5, + "accent:South Asia": 0.00091, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.1527475, + "accent:Welsh@1": 0.125 + }, + "irish x2": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.7172200178292323, + "durx": 0.8885514629049113, + "female": 0.002183279793825932, + "age": 39.615586027503014, + "f0": 92.43178829545103, + "f0_st": 1.8211100100499453, + "voiced": 0.6571286923654264, + "rms_db": -41.06988286972046, + "accent:North America": 0.021271250000000002, + "accent:North America@1": 0.0, + "accent:English": 0.30190375, + "accent:English@1": 0.25, + "accent:Scottish": 0.24156624999999998, + "accent:Scottish@1": 0.25, + "accent:Irish": 0.00234125, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.1463675, + "accent:Oceania@1": 0.25, + "accent:South Asia": 0.0033175, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.11328375, + "accent:Welsh@1": 0.125 + }, + "australian x1": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.8003031736101303, + "durx": 0.8807493540051679, + "female": 0.001655443964409642, + "age": 45.54273448884487, + "f0": 116.56341564986346, + "f0_st": 2.637350031186958, + "voiced": 0.5828850360287525, + "rms_db": -41.34757328033447, + "accent:North America": 0.0147375, + "accent:North America@1": 0.0, + "accent:English": 0.1131075, + "accent:English@1": 0.0, + "accent:Scottish": 0.00190625, + "accent:Scottish@1": 0.0, + "accent:Irish": 2.7500000000000004e-05, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.8646575000000001, + "accent:Oceania@1": 1.0, + "accent:South Asia": 4.000000000000001e-05, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.00469, + "accent:Welsh@1": 0.0 + }, + "australian x1.5": { + "wer": 0.003676470588235294, + "collapse": 0.0, + "identity": 0.7590585674710972, + "durx": 0.956629243517776, + "female": 0.0018670189165277407, + "age": 41.807788237929344, + "f0": 106.43753352223771, + "f0_st": 2.8042112990429486, + "voiced": 0.6251673203634815, + "rms_db": -39.20566749572754, + "accent:North America": 0.0138675, + "accent:North America@1": 0.0, + "accent:English": 0.17427875, + "accent:English@1": 0.0, + "accent:Scottish": 0.00190625, + "accent:Scottish@1": 0.0, + "accent:Irish": 1.8750000000000002e-05, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.80815625, + "accent:Oceania@1": 1.0, + "accent:South Asia": 1.5000000000000002e-05, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.00047625, + "accent:Welsh@1": 0.0 + }, + "australian x2": { + "wer": 0.003676470588235294, + "collapse": 0.0, + "identity": 0.7198176050375915, + "durx": 0.8793652993348116, + "female": 0.001975850434973836, + "age": 35.58748476207256, + "f0": 102.71911474070644, + "f0_st": 2.6284200714714974, + "voiced": 0.6126358504163494, + "rms_db": -40.43619728088379, + "accent:North America": 0.01016, + "accent:North America@1": 0.0, + "accent:English": 0.04295875, + "accent:English@1": 0.0, + "accent:Scottish": 0.00060125, + "accent:Scottish@1": 0.0, + "accent:Irish": 1.9999999999999998e-05, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.94585375, + "accent:Oceania@1": 1.0, + "accent:South Asia": 1e-05, + "accent:South Asia@1": 0.0, + "accent:Welsh": 4.6250000000000006e-05, + "accent:Welsh@1": 0.0 + }, + "indian x1": { + "wer": 0.007352941176470588, + "collapse": 0.0, + "identity": 0.7111650098814193, + "durx": 0.859809183064997, + "female": 0.0016569252184126526, + "age": 53.12516242265701, + "f0": 132.85759400505856, + "f0_st": 3.4961248351104546, + "voiced": 0.713489590723897, + "rms_db": -39.755263328552246, + "accent:North America": 0.00028625, + "accent:North America@1": 0.0, + "accent:English": 8.625000000000001e-05, + "accent:English@1": 0.0, + "accent:Scottish": 1.25e-06, + "accent:Scottish@1": 0.0, + "accent:Irish": 0.0, + "accent:Irish@1": 0.0, + "accent:Oceania": 6.125000000000001e-05, + "accent:Oceania@1": 0.0, + "accent:South Asia": 0.9983900000000001, + "accent:South Asia@1": 1.0, + "accent:Welsh": 0.0, + "accent:Welsh@1": 0.0 + }, + "indian x1.5": { + "wer": 0.03292838874680307, + "collapse": 0.0, + "identity": 0.6223929000095716, + "durx": 0.7815803382663848, + "female": 0.002430146065307781, + "age": 42.54280440509319, + "f0": 132.9952708668703, + "f0_st": 3.7035557113100945, + "voiced": 0.7547829549867203, + "rms_db": -41.047412395477295, + "accent:North America": 0.0, + "accent:North America@1": 0.0, + "accent:English": 1.25e-06, + "accent:English@1": 0.0, + "accent:Scottish": 0.0, + "accent:Scottish@1": 0.0, + "accent:Irish": 0.0, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.0, + "accent:Oceania@1": 0.0, + "accent:South Asia": 0.99998625, + "accent:South Asia@1": 1.0, + "accent:Welsh": 0.0, + "accent:Welsh@1": 0.0 + }, + "indian x2": { + "wer": 0.07352941176470588, + "collapse": 0.125, + "identity": 0.5493651458598061, + "durx": 0.8036018150879183, + "female": 0.0065064409136539325, + "age": 36.851343885064125, + "f0": 149.97437849417082, + "f0_st": 3.712663810470166, + "voiced": 0.7689408402672357, + "rms_db": -37.59369397163391, + "accent:North America": 1.9999999999999998e-05, + "accent:North America@1": 0.0, + "accent:English": 1.5000000000000002e-05, + "accent:English@1": 0.0, + "accent:Scottish": 0.0, + "accent:Scottish@1": 0.0, + "accent:Irish": 0.0, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.00022875, + "accent:Oceania@1": 0.0, + "accent:South Asia": 0.98775, + "accent:South Asia@1": 1.0, + "accent:Welsh": 0.0, + "accent:Welsh@1": 0.0 + }, + "welsh x1": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.7768416280515555, + "durx": 0.9913793103448276, + "female": 0.0026524719287408516, + "age": 52.1491676568985, + "f0": 112.16658259226256, + "f0_st": 2.9553312173016755, + "voiced": 0.5697317038936174, + "rms_db": -41.23020362854004, + "accent:North America": 0.009770000000000001, + "accent:North America@1": 0.0, + "accent:English": 0.18338125, + "accent:English@1": 0.25, + "accent:Scottish": 0.046717499999999995, + "accent:Scottish@1": 0.0, + "accent:Irish": 0.00011375000000000001, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.16105999999999998, + "accent:Oceania@1": 0.125, + "accent:South Asia": 8.75e-05, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.48901124999999995, + "accent:Welsh@1": 0.5 + }, + "welsh x1.5": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.7102759115255921, + "durx": 0.974235893416928, + "female": 0.0018463475425960496, + "age": 50.78819654881954, + "f0": 115.38602902921642, + "f0_st": 2.9182071573795563, + "voiced": 0.5862439341249925, + "rms_db": -45.74503231048584, + "accent:North America": 0.00779125, + "accent:North America@1": 0.0, + "accent:English": 0.16994125, + "accent:English@1": 0.25, + "accent:Scottish": 0.009421249999999999, + "accent:Scottish@1": 0.0, + "accent:Irish": 0.000345, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.06607124999999998, + "accent:Oceania@1": 0.0, + "accent:South Asia": 0.00013000000000000002, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.60326625, + "accent:Welsh@1": 0.625 + }, + "welsh x2": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.6616643536202705, + "durx": 0.971969696969697, + "female": 0.002185372664825991, + "age": 47.826676443219185, + "f0": 111.43013168113835, + "f0_st": 3.0405904894319455, + "voiced": 0.6341608631868529, + "rms_db": -49.784581899642944, + "accent:North America": 0.0058475, + "accent:North America@1": 0.0, + "accent:English": 0.1463575, + "accent:English@1": 0.125, + "accent:Scottish": 0.0030675000000000003, + "accent:Scottish@1": 0.0, + "accent:Irish": 0.000125, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.05096125, + "accent:Oceania@1": 0.0, + "accent:South Asia": 6.625000000000001e-05, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.46620874999999995, + "accent:Welsh@1": 0.375 + } + }, + "British Female": { + "neutral": { + "wer": 0.0035714285714285713, + "collapse": 0.0, + "identity": 0.9614104772708219, + "durx": 1.0, + "female": 0.9985204413533211, + "age": 48.2656117528677, + "f0": 144.67021140614364, + "f0_st": 3.205871204508802, + "voiced": 0.6747678310508236, + "rms_db": -35.31939744949341, + "accent:North America": 0.000355, + "accent:North America@1": 0.0, + "accent:English": 0.43743625, + "accent:English@1": 0.5, + "accent:Scottish": 0.0119825, + "accent:Scottish@1": 0.0, + "accent:Irish": 4.875e-05, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.0030937499999999997, + "accent:Oceania@1": 0.0, + "accent:South Asia": 1e-05, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.54604375, + "accent:Welsh@1": 0.5 + }, + "british x1": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9244510409751494, + "durx": 0.969533275713051, + "female": 0.996827058494091, + "age": 42.912404611706734, + "f0": 149.026729943592, + "f0_st": 3.493880691863744, + "voiced": 0.6997302357329397, + "rms_db": -34.65124988555908, + "accent:North America": 5.25e-05, + "accent:North America@1": 0.0, + "accent:English": 0.48332875000000003, + "accent:English@1": 0.5, + "accent:Scottish": 0.00142, + "accent:Scottish@1": 0.0, + "accent:Irish": 1.375e-05, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.00043375, + "accent:Oceania@1": 0.0, + "accent:South Asia": 1.25e-06, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.51466125, + "accent:Welsh@1": 0.5 + }, + "british x1.5": { + "wer": 0.0035714285714285713, + "collapse": 0.0, + "identity": 0.9011139379786581, + "durx": 0.9372823444378737, + "female": 0.9937157332897186, + "age": 43.04533712565899, + "f0": 157.61116155952777, + "f0_st": 3.32934155983734, + "voiced": 0.6665881189886064, + "rms_db": -33.71537256240845, + "accent:North America": 6.625000000000001e-05, + "accent:North America@1": 0.0, + "accent:English": 0.5863262499999999, + "accent:English@1": 0.5, + "accent:Scottish": 0.00129875, + "accent:Scottish@1": 0.0, + "accent:Irish": 2.5e-05, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.00079125, + "accent:Oceania@1": 0.0, + "accent:South Asia": 1.25e-06, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.41134249999999994, + "accent:Welsh@1": 0.5 + }, + "british x2": { + "wer": 0.005434782608695652, + "collapse": 0.0, + "identity": 0.8609713565345563, + "durx": 0.9185393258426966, + "female": 0.9941294640302658, + "age": 41.789498925209045, + "f0": 161.0334854007123, + "f0_st": 3.5071026051499556, + "voiced": 0.70613281321365, + "rms_db": -32.212300300598145, + "accent:North America": 4.75e-05, + "accent:North America@1": 0.0, + "accent:English": 0.72235375, + "accent:English@1": 0.75, + "accent:Scottish": 0.0011575000000000001, + "accent:Scottish@1": 0.0, + "accent:Irish": 6.25e-06, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.0012725, + "accent:Oceania@1": 0.0, + "accent:South Asia": 0.0, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.27509375, + "accent:Welsh@1": 0.25 + }, + "american x1": { + "wer": 0.003676470588235294, + "collapse": 0.0, + "identity": 0.8534856041768238, + "durx": 0.9649690569465736, + "female": 0.998551107943058, + "age": 47.033409401774406, + "f0": 142.9099643388996, + "f0_st": 3.454677953222892, + "voiced": 0.729780831661285, + "rms_db": -39.90286445617676, + "accent:North America": 0.42496500000000004, + "accent:North America@1": 0.625, + "accent:English": 0.005554999999999999, + "accent:English@1": 0.0, + "accent:Scottish": 0.007917500000000001, + "accent:Scottish@1": 0.0, + "accent:Irish": 0.007435000000000001, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.004805, + "accent:Oceania@1": 0.0, + "accent:South Asia": 0.0044887500000000006, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.028235, + "accent:Welsh@1": 0.0 + }, + "american x1.5": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.7916392468920388, + "durx": 1.0314738156252052, + "female": 0.9985738471150398, + "age": 50.71077458560467, + "f0": 147.05532188774168, + "f0_st": 4.085023567568587, + "voiced": 0.776284820855204, + "rms_db": -47.69293212890625, + "accent:North America": 0.34037249999999997, + "accent:North America@1": 0.25, + "accent:English": 0.00042125, + "accent:English@1": 0.0, + "accent:Scottish": 6.875e-05, + "accent:Scottish@1": 0.0, + "accent:Irish": 0.00126125, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.0024525, + "accent:Oceania@1": 0.0, + "accent:South Asia": 0.0027912500000000003, + "accent:South Asia@1": 0.0, + "accent:Welsh": 2.9999999999999997e-05, + "accent:Welsh@1": 0.0 + }, + "american x2": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.7377377597172914, + "durx": 1.011526890443836, + "female": 0.9982316419482231, + "age": 50.41841194033623, + "f0": 150.31564187817537, + "f0_st": 3.8826534934593804, + "voiced": 0.7856118636364593, + "rms_db": -46.56336832046509, + "accent:North America": 0.46030125, + "accent:North America@1": 0.375, + "accent:English": 0.000255, + "accent:English@1": 0.0, + "accent:Scottish": 4e-05, + "accent:Scottish@1": 0.0, + "accent:Irish": 0.001935, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.00272, + "accent:Oceania@1": 0.0, + "accent:South Asia": 0.00199375, + "accent:South Asia@1": 0.0, + "accent:Welsh": 1.7500000000000002e-05, + "accent:Welsh@1": 0.0 + }, + "scottish x1": { + "wer": 0.0035714285714285713, + "collapse": 0.0, + "identity": 0.9097885765856266, + "durx": 0.9634831460674157, + "female": 0.9978045970201492, + "age": 44.37314569950104, + "f0": 145.16268353711143, + "f0_st": 3.209459062256621, + "voiced": 0.6960079142758422, + "rms_db": -33.45918250083923, + "accent:North America": 7.000000000000001e-05, + "accent:North America@1": 0.0, + "accent:English": 0.66468125, + "accent:English@1": 0.625, + "accent:Scottish": 0.0014624999999999998, + "accent:Scottish@1": 0.0, + "accent:Irish": 7.500000000000001e-06, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.00052, + "accent:Oceania@1": 0.0, + "accent:South Asia": 0.0, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.333095, + "accent:Welsh@1": 0.375 + }, + "scottish x1.5": { + "wer": 0.010255417956656347, + "collapse": 0.0, + "identity": 0.8675593931961917, + "durx": 1.0141261284665843, + "female": 0.9948735237121582, + "age": 39.00681585073471, + "f0": 142.30423233170114, + "f0_st": 2.8709392331853607, + "voiced": 0.6800777840018091, + "rms_db": -36.70598840713501, + "accent:North America": 9.625000000000001e-05, + "accent:North America@1": 0.0, + "accent:English": 0.54752375, + "accent:English@1": 0.625, + "accent:Scottish": 0.00415625, + "accent:Scottish@1": 0.0, + "accent:Irish": 5.8750000000000005e-05, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.00082625, + "accent:Oceania@1": 0.0, + "accent:South Asia": 3.7500000000000005e-06, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.44715625000000003, + "accent:Welsh@1": 0.375 + }, + "scottish x2": { + "wer": 0.013721804511278194, + "collapse": 0.0, + "identity": 0.819909752533019, + "durx": 0.9070128972823583, + "female": 0.9878250434994698, + "age": 37.67067976295948, + "f0": 137.64407373707428, + "f0_st": 2.3489485928824285, + "voiced": 0.670252074333195, + "rms_db": -37.351155519485474, + "accent:North America": 0.0001175, + "accent:North America@1": 0.0, + "accent:English": 0.81205625, + "accent:English@1": 0.875, + "accent:Scottish": 0.016995, + "accent:Scottish@1": 0.0, + "accent:Irish": 4.75e-05, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.000495, + "accent:Oceania@1": 0.0, + "accent:South Asia": 1.25e-06, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.17007250000000002, + "accent:Welsh@1": 0.125 + }, + "irish x1": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.918480262244177, + "durx": 0.9410460744149503, + "female": 0.9985244423151016, + "age": 45.772531628608704, + "f0": 152.44017018926723, + "f0_st": 3.0254702263616124, + "voiced": 0.7163399514674749, + "rms_db": -33.62139558792114, + "accent:North America": 0.00017874999999999998, + "accent:North America@1": 0.0, + "accent:English": 0.49162125, + "accent:English@1": 0.5, + "accent:Scottish": 0.004753749999999999, + "accent:Scottish@1": 0.0, + "accent:Irish": 1.2499999999999999e-05, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.0009174999999999999, + "accent:Oceania@1": 0.0, + "accent:South Asia": 2.5e-06, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.502055, + "accent:Welsh@1": 0.5 + }, + "irish x1.5": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.8935108707432908, + "durx": 0.8843827496522108, + "female": 0.9977857023477554, + "age": 42.952996119856834, + "f0": 148.48362343339488, + "f0_st": 3.1375289745331636, + "voiced": 0.7248536341073524, + "rms_db": -34.59185338020325, + "accent:North America": 0.00021250000000000002, + "accent:North America@1": 0.0, + "accent:English": 0.70418, + "accent:English@1": 0.875, + "accent:Scottish": 0.009808750000000001, + "accent:Scottish@1": 0.0, + "accent:Irish": 2.3749999999999998e-05, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.0011675, + "accent:Oceania@1": 0.0, + "accent:South Asia": 2.5e-06, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.2843225, + "accent:Welsh@1": 0.125 + }, + "irish x2": { + "wer": 0.0035714285714285713, + "collapse": 0.0, + "identity": 0.8845489419345312, + "durx": 0.8653328076746173, + "female": 0.9974832534790039, + "age": 42.54131242632866, + "f0": 143.52741808739626, + "f0_st": 2.7234543090919443, + "voiced": 0.7131364893926302, + "rms_db": -32.25427865982056, + "accent:North America": 0.00014000000000000001, + "accent:North America@1": 0.0, + "accent:English": 0.8400049999999999, + "accent:English@1": 0.875, + "accent:Scottish": 0.013352500000000002, + "accent:Scottish@1": 0.0, + "accent:Irish": 4.3750000000000006e-05, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.0010887499999999999, + "accent:Oceania@1": 0.0, + "accent:South Asia": 3.7500000000000005e-06, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.14527125000000002, + "accent:Welsh@1": 0.125 + }, + "australian x1": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9194935632376634, + "durx": 0.974313177891797, + "female": 0.9977079704403877, + "age": 43.10890696942806, + "f0": 146.69803898431832, + "f0_st": 3.40471911395883, + "voiced": 0.7005084043220315, + "rms_db": -34.5035879611969, + "accent:North America": 0.00021375000000000002, + "accent:North America@1": 0.0, + "accent:English": 0.40510874999999996, + "accent:English@1": 0.375, + "accent:Scottish": 0.00239875, + "accent:Scottish@1": 0.0, + "accent:Irish": 3.125e-05, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.00231125, + "accent:Oceania@1": 0.0, + "accent:South Asia": 5e-06, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.58972375, + "accent:Welsh@1": 0.625 + }, + "australian x1.5": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.8949068159625759, + "durx": 0.9728867623604466, + "female": 0.9947261586785316, + "age": 40.83438701927662, + "f0": 141.88107603503374, + "f0_st": 3.27382624230599, + "voiced": 0.701720742190369, + "rms_db": -33.660900831222534, + "accent:North America": 0.0003175, + "accent:North America@1": 0.0, + "accent:English": 0.63961625, + "accent:English@1": 0.625, + "accent:Scottish": 0.00578625, + "accent:Scottish@1": 0.0, + "accent:Irish": 0.0001225, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.0053774999999999995, + "accent:Oceania@1": 0.0, + "accent:South Asia": 5e-06, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.34857125, + "accent:Welsh@1": 0.375 + }, + "australian x2": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.8256730905583848, + "durx": 0.9480352659543412, + "female": 0.9489652439951897, + "age": 32.88780823349953, + "f0": 137.7170895857595, + "f0_st": 2.854021533099083, + "voiced": 0.705792684387085, + "rms_db": -29.72960066795349, + "accent:North America": 0.0016500000000000002, + "accent:North America@1": 0.0, + "accent:English": 0.87292875, + "accent:English@1": 1.0, + "accent:Scottish": 0.006398749999999999, + "accent:Scottish@1": 0.0, + "accent:Irish": 0.0007725, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.048944999999999995, + "accent:Oceania@1": 0.0, + "accent:South Asia": 8.750000000000001e-06, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.06877749999999999, + "accent:Welsh@1": 0.0 + }, + "indian x1": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.8596328797553572, + "durx": 0.8571358170707668, + "female": 0.9980596452951431, + "age": 41.61669351160526, + "f0": 154.0176081046565, + "f0_st": 3.3712782720223977, + "voiced": 0.7422869104830347, + "rms_db": -37.8821496963501, + "accent:North America": 0.0012850000000000001, + "accent:North America@1": 0.0, + "accent:English": 0.466, + "accent:English@1": 0.375, + "accent:Scottish": 0.033805, + "accent:Scottish@1": 0.0, + "accent:Irish": 0.00012000000000000002, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.00545125, + "accent:Oceania@1": 0.0, + "accent:South Asia": 0.0001625, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.48495375, + "accent:Welsh@1": 0.625 + }, + "indian x1.5": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.7532384641454086, + "durx": 0.8177079950639734, + "female": 0.997191771864891, + "age": 39.84554260969162, + "f0": 162.2444344624167, + "f0_st": 3.62772549516048, + "voiced": 0.7685468498810446, + "rms_db": -40.69186305999756, + "accent:North America": 0.0025524999999999996, + "accent:North America@1": 0.0, + "accent:English": 0.013018749999999999, + "accent:English@1": 0.0, + "accent:Scottish": 0.00546375, + "accent:Scottish@1": 0.0, + "accent:Irish": 0.00020875, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.003185, + "accent:Oceania@1": 0.0, + "accent:South Asia": 0.6714312499999999, + "accent:South Asia@1": 0.75, + "accent:Welsh": 0.29438875000000003, + "accent:Welsh@1": 0.25 + }, + "indian x2": { + "wer": 0.017608359133126937, + "collapse": 0.0, + "identity": 0.6480536112842571, + "durx": 0.8080377706126209, + "female": 0.9960911050438881, + "age": 40.46931900084019, + "f0": 170.86466480449573, + "f0_st": 3.436990554991733, + "voiced": 0.7553806812129331, + "rms_db": -37.86137056350708, + "accent:North America": 0.00030375, + "accent:North America@1": 0.0, + "accent:English": 0.003535, + "accent:English@1": 0.0, + "accent:Scottish": 0.0007074999999999999, + "accent:Scottish@1": 0.0, + "accent:Irish": 1.125e-05, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.00034500000000000004, + "accent:Oceania@1": 0.0, + "accent:South Asia": 0.9926062499999999, + "accent:South Asia@1": 1.0, + "accent:Welsh": 0.00102125, + "accent:Welsh@1": 0.0 + }, + "welsh x1": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9089585748730502, + "durx": 1.057444641566463, + "female": 0.9978848695755005, + "age": 47.09772914648056, + "f0": 139.32502646863747, + "f0_st": 3.3533378820815782, + "voiced": 0.6879133023282422, + "rms_db": -36.21231436729431, + "accent:North America": 3.0000000000000004e-05, + "accent:North America@1": 0.0, + "accent:English": 0.1969025, + "accent:English@1": 0.125, + "accent:Scottish": 0.00436, + "accent:Scottish@1": 0.0, + "accent:Irish": 1e-05, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.0001625, + "accent:Oceania@1": 0.0, + "accent:South Asia": 2.5e-06, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.7983925000000001, + "accent:Welsh@1": 0.875 + }, + "welsh x1.5": { + "wer": 0.0035714285714285713, + "collapse": 0.0, + "identity": 0.8708494516820229, + "durx": 1.1577810202592738, + "female": 0.9962093904614449, + "age": 49.08781610429287, + "f0": 153.38631077179923, + "f0_st": 3.4124812937825295, + "voiced": 0.6986489046756266, + "rms_db": -35.41437125205994, + "accent:North America": 1.375e-05, + "accent:North America@1": 0.0, + "accent:English": 0.108245, + "accent:English@1": 0.125, + "accent:Scottish": 0.00088125, + "accent:Scottish@1": 0.0, + "accent:Irish": 7.5e-06, + "accent:Irish@1": 0.0, + "accent:Oceania": 3.9999999999999996e-05, + "accent:Oceania@1": 0.0, + "accent:South Asia": 0.0, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.890755, + "accent:Welsh@1": 0.875 + }, + "welsh x2": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.8149772216896869, + "durx": 1.314505819821032, + "female": 0.9869837537407875, + "age": 47.36190624535084, + "f0": 143.51820115767282, + "f0_st": 3.7552456016765, + "voiced": 0.7354353046689599, + "rms_db": -33.89900183677673, + "accent:North America": 1.1249999999999999e-05, + "accent:North America@1": 0.0, + "accent:English": 0.010029999999999999, + "accent:English@1": 0.0, + "accent:Scottish": 3.5000000000000004e-05, + "accent:Scottish@1": 0.0, + "accent:Irish": 1.2499999999999999e-05, + "accent:Irish@1": 0.0, + "accent:Oceania": 7.5e-05, + "accent:Oceania@1": 0.0, + "accent:South Asia": 5e-06, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.9897262499999999, + "accent:Welsh@1": 1.0 + } + }, + "British Male": { + "neutral": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9425920818213915, + "durx": 1.0, + "female": 0.005120516638271511, + "age": 19.872745126485825, + "f0": 88.86001730755206, + "f0_st": 2.3053593439369218, + "voiced": 0.5461017048528698, + "rms_db": -41.61740207672119, + "accent:North America": 0.0017275000000000003, + "accent:North America@1": 0.0, + "accent:English": 0.97594625, + "accent:English@1": 1.0, + "accent:Scottish": 0.009225, + "accent:Scottish@1": 0.0, + "accent:Irish": 4.5e-05, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.012983749999999999, + "accent:Oceania@1": 0.0, + "accent:South Asia": 1.25e-06, + "accent:South Asia@1": 0.0, + "accent:Welsh": 2.5e-06, + "accent:Welsh@1": 0.0 + }, + "british x1": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.8988448411588933, + "durx": 1.050333969465649, + "female": 0.004258593893609941, + "age": 21.939533203840256, + "f0": 90.29443525084415, + "f0_st": 2.5965482676685503, + "voiced": 0.5751082332461905, + "rms_db": -46.16713762283325, + "accent:North America": 0.0012399999999999998, + "accent:North America@1": 0.0, + "accent:English": 0.99225875, + "accent:English@1": 1.0, + "accent:Scottish": 0.000835, + "accent:Scottish@1": 0.0, + "accent:Irish": 3.7500000000000003e-05, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.0046925, + "accent:Oceania@1": 0.0, + "accent:South Asia": 0.0, + "accent:South Asia@1": 0.0, + "accent:Welsh": 3.375e-05, + "accent:Welsh@1": 0.0 + }, + "british x1.5": { + "wer": 0.014440993788819875, + "collapse": 0.0, + "identity": 0.8824283558046145, + "durx": 0.9825174825174825, + "female": 0.003878726245602593, + "age": 23.01823478192091, + "f0": 92.77975651055567, + "f0_st": 2.632531600614329, + "voiced": 0.6078019067264654, + "rms_db": -45.34103298187256, + "accent:North America": 0.00010125, + "accent:North America@1": 0.0, + "accent:English": 0.99774875, + "accent:English@1": 1.0, + "accent:Scottish": 0.0006825000000000001, + "accent:Scottish@1": 0.0, + "accent:Irish": 8.750000000000001e-06, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.0013475, + "accent:Oceania@1": 0.0, + "accent:South Asia": 0.0, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.0, + "accent:Welsh@1": 0.0 + }, + "british x2": { + "wer": 0.010714285714285714, + "collapse": 0.0, + "identity": 0.8625429605325744, + "durx": 1.0761623872310895, + "female": 0.003922040210454725, + "age": 23.484649322926998, + "f0": 92.58059915174842, + "f0_st": 3.394186364329461, + "voiced": 0.5959806445489657, + "rms_db": -48.41231870651245, + "accent:North America": 0.00019750000000000003, + "accent:North America@1": 0.0, + "accent:English": 0.99149, + "accent:English@1": 1.0, + "accent:Scottish": 0.00533125, + "accent:Scottish@1": 0.0, + "accent:Irish": 1e-05, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.002415, + "accent:Oceania@1": 0.0, + "accent:South Asia": 0.0, + "accent:South Asia@1": 0.0, + "accent:Welsh": 6.25e-06, + "accent:Welsh@1": 0.0 + }, + "american x1": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.8448499584566658, + "durx": 0.9848484848484849, + "female": 0.02153715731401462, + "age": 22.61321973055601, + "f0": 90.09698041176941, + "f0_st": 1.8430158502020322, + "voiced": 0.5820716754188435, + "rms_db": -37.087281703948975, + "accent:North America": 0.63646125, + "accent:North America@1": 0.75, + "accent:English": 0.00061625, + "accent:English@1": 0.0, + "accent:Scottish": 0.003715, + "accent:Scottish@1": 0.0, + "accent:Irish": 0.0636975, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.009076250000000001, + "accent:Oceania@1": 0.0, + "accent:South Asia": 2.875e-05, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.0, + "accent:Welsh@1": 0.0 + }, + "american x1.5": { + "wer": 0.007142857142857143, + "collapse": 0.0, + "identity": 0.8046767506358761, + "durx": 1.0091346153846155, + "female": 0.005687463941285387, + "age": 24.605074897408485, + "f0": 93.05472258157563, + "f0_st": 2.1235348312175266, + "voiced": 0.6234342338472708, + "rms_db": -35.64302039146423, + "accent:North America": 0.5852824999999999, + "accent:North America@1": 0.75, + "accent:English": 0.00046, + "accent:English@1": 0.0, + "accent:Scottish": 0.00110875, + "accent:Scottish@1": 0.0, + "accent:Irish": 0.0783175, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.0086325, + "accent:Oceania@1": 0.0, + "accent:South Asia": 0.00012875, + "accent:South Asia@1": 0.0, + "accent:Welsh": 1.25e-06, + "accent:Welsh@1": 0.0 + }, + "american x2": { + "wer": 0.010819327731092437, + "collapse": 0.0, + "identity": 0.771621099872604, + "durx": 1.0238095238095237, + "female": 0.004892439974355511, + "age": 28.906157612800598, + "f0": 97.90353437652814, + "f0_st": 2.6770191242978534, + "voiced": 0.6157786053560879, + "rms_db": -40.89446020126343, + "accent:North America": 0.62369125, + "accent:North America@1": 0.875, + "accent:English": 0.00039, + "accent:English@1": 0.0, + "accent:Scottish": 0.0005275, + "accent:Scottish@1": 0.0, + "accent:Irish": 0.029759999999999998, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.00898, + "accent:Oceania@1": 0.0, + "accent:South Asia": 0.00010750000000000001, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.0, + "accent:Welsh@1": 0.0 + }, + "scottish x1": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.8940201497243995, + "durx": 1.025, + "female": 0.010720551246777177, + "age": 20.580408535897732, + "f0": 91.32015493778275, + "f0_st": 2.16805285532485, + "voiced": 0.5241503774076507, + "rms_db": -46.080392837524414, + "accent:North America": 0.00036750000000000004, + "accent:North America@1": 0.0, + "accent:English": 0.98863875, + "accent:English@1": 1.0, + "accent:Scottish": 0.00285, + "accent:Scottish@1": 0.0, + "accent:Irish": 0.0001375, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.004979999999999999, + "accent:Oceania@1": 0.0, + "accent:South Asia": 0.0, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.0, + "accent:Welsh@1": 0.0 + }, + "scottish x1.5": { + "wer": 0.003676470588235294, + "collapse": 0.0, + "identity": 0.8532437116321943, + "durx": 0.992436135293278, + "female": 0.003794837524765171, + "age": 20.49836441874504, + "f0": 94.27212547721086, + "f0_st": 1.94224701439276, + "voiced": 0.5832684950716021, + "rms_db": -48.5961275100708, + "accent:North America": 0.00346, + "accent:North America@1": 0.0, + "accent:English": 0.9752475, + "accent:English@1": 1.0, + "accent:Scottish": 0.00492375, + "accent:Scottish@1": 0.0, + "accent:Irish": 0.00034, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.01433875, + "accent:Oceania@1": 0.0, + "accent:South Asia": 1.25e-06, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.0, + "accent:Welsh@1": 0.0 + }, + "scottish x2": { + "wer": 0.007247899159663866, + "collapse": 0.0, + "identity": 0.7753998541617462, + "durx": 1.0115384615384615, + "female": 0.007988780685991514, + "age": 20.11362947523594, + "f0": 97.7728800555161, + "f0_st": 1.5015185011281036, + "voiced": 0.5985104202040008, + "rms_db": -51.89628458023071, + "accent:North America": 0.00197625, + "accent:North America@1": 0.0, + "accent:English": 0.80777875, + "accent:English@1": 0.875, + "accent:Scottish": 0.18584625, + "accent:Scottish@1": 0.125, + "accent:Irish": 0.00112375, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.0019825, + "accent:Oceania@1": 0.0, + "accent:South Asia": 5e-06, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.0, + "accent:Welsh@1": 0.0 + }, + "irish x1": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9073114525472565, + "durx": 1.0242543171114598, + "female": 0.0063232891843654215, + "age": 20.712262392044067, + "f0": 88.28075798290685, + "f0_st": 2.1435151416724203, + "voiced": 0.5637789387625997, + "rms_db": -45.955750942230225, + "accent:North America": 0.0043925, + "accent:North America@1": 0.0, + "accent:English": 0.9510099999999999, + "accent:English@1": 1.0, + "accent:Scottish": 0.00874875, + "accent:Scottish@1": 0.0, + "accent:Irish": 0.0001575, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.034371250000000006, + "accent:Oceania@1": 0.0, + "accent:South Asia": 2.5e-06, + "accent:South Asia@1": 0.0, + "accent:Welsh": 5e-06, + "accent:Welsh@1": 0.0 + }, + "irish x1.5": { + "wer": 0.003676470588235294, + "collapse": 0.0, + "identity": 0.8831689670231774, + "durx": 1.0803030303030303, + "female": 0.005173761921469122, + "age": 20.89749686419964, + "f0": 88.64535331801436, + "f0_st": 1.6814027278632695, + "voiced": 0.5772990810427603, + "rms_db": -45.66321563720703, + "accent:North America": 0.00044625000000000003, + "accent:North America@1": 0.0, + "accent:English": 0.97159375, + "accent:English@1": 1.0, + "accent:Scottish": 0.011012500000000001, + "accent:Scottish@1": 0.0, + "accent:Irish": 0.00024125, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.01577, + "accent:Oceania@1": 0.0, + "accent:South Asia": 1.25e-06, + "accent:South Asia@1": 0.0, + "accent:Welsh": 1.25e-06, + "accent:Welsh@1": 0.0 + }, + "irish x2": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.8467991600116234, + "durx": 1.1049783549783552, + "female": 0.009598841919796541, + "age": 19.12314761430025, + "f0": 88.5673388041254, + "f0_st": 2.341775853668703, + "voiced": 0.6065977586855891, + "rms_db": -44.1479926109314, + "accent:North America": 0.0008024999999999999, + "accent:North America@1": 0.0, + "accent:English": 0.9806549999999999, + "accent:English@1": 1.0, + "accent:Scottish": 0.010457500000000002, + "accent:Scottish@1": 0.0, + "accent:Irish": 0.001015, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.0030487500000000002, + "accent:Oceania@1": 0.0, + "accent:South Asia": 6.25e-06, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.00027499999999999996, + "accent:Welsh@1": 0.0 + }, + "australian x1": { + "wer": 0.007247899159663866, + "collapse": 0.0, + "identity": 0.8953823801208097, + "durx": 1.0918560606060606, + "female": 0.00428862617991399, + "age": 22.562317736446857, + "f0": 83.15493332329923, + "f0_st": 3.557735212142951, + "voiced": 0.6346961069073123, + "rms_db": -45.64985227584839, + "accent:North America": 0.00146, + "accent:North America@1": 0.0, + "accent:English": 0.89171875, + "accent:English@1": 0.875, + "accent:Scottish": 0.00149875, + "accent:Scottish@1": 0.0, + "accent:Irish": 2.75e-05, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.10499875, + "accent:Oceania@1": 0.125, + "accent:South Asia": 0.0, + "accent:South Asia@1": 0.0, + "accent:Welsh": 7.5e-06, + "accent:Welsh@1": 0.0 + }, + "australian x1.5": { + "wer": 0.003676470588235294, + "collapse": 0.0, + "identity": 0.8309605839183792, + "durx": 1.0084644544840837, + "female": 0.0058241645456291735, + "age": 22.666672617197037, + "f0": 88.1131671491477, + "f0_st": 2.368043082176289, + "voiced": 0.5911245784737286, + "rms_db": -47.380759716033936, + "accent:North America": 0.0088075, + "accent:North America@1": 0.0, + "accent:English": 0.70925625, + "accent:English@1": 0.75, + "accent:Scottish": 0.0049825, + "accent:Scottish@1": 0.0, + "accent:Irish": 4.625e-05, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.27672250000000004, + "accent:Oceania@1": 0.25, + "accent:South Asia": 1.25e-06, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.0, + "accent:Welsh@1": 0.0 + }, + "australian x2": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.8293100025889573, + "durx": 1.0765707574867882, + "female": 0.009273870702600107, + "age": 21.2432861328125, + "f0": 89.51913996664312, + "f0_st": 2.8553185897849556, + "voiced": 0.5985470707018754, + "rms_db": -44.83509111404419, + "accent:North America": 0.00139, + "accent:North America@1": 0.0, + "accent:English": 0.57418875, + "accent:English@1": 0.5, + "accent:Scottish": 0.005783749999999999, + "accent:Scottish@1": 0.0, + "accent:Irish": 3.375e-05, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.41857125, + "accent:Oceania@1": 0.5, + "accent:South Asia": 0.0, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.0, + "accent:Welsh@1": 0.0 + }, + "indian x1": { + "wer": 0.003676470588235294, + "collapse": 0.0, + "identity": 0.8349503235456596, + "durx": 0.9784382284382285, + "female": 0.005548420682316646, + "age": 24.225747399032116, + "f0": 86.98826414838682, + "f0_st": 2.5034480863089974, + "voiced": 0.6751440757159901, + "rms_db": -43.7421760559082, + "accent:North America": 0.01685625, + "accent:North America@1": 0.0, + "accent:English": 0.702005, + "accent:English@1": 0.75, + "accent:Scottish": 0.06667875000000001, + "accent:Scottish@1": 0.0, + "accent:Irish": 0.00282125, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.12676125000000002, + "accent:Oceania@1": 0.125, + "accent:South Asia": 0.001865, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.0004075, + "accent:Welsh@1": 0.0 + }, + "indian x1.5": { + "wer": 0.025470405553525755, + "collapse": 0.0, + "identity": 0.7368981471547101, + "durx": 0.9173664122137405, + "female": 0.006929397175554186, + "age": 24.44097511470318, + "f0": 93.73935639696742, + "f0_st": 2.3808821171017023, + "voiced": 0.6539406734841223, + "rms_db": -39.06763458251953, + "accent:North America": 0.02973125, + "accent:North America@1": 0.0, + "accent:English": 0.11025874999999999, + "accent:English@1": 0.0, + "accent:Scottish": 0.316395, + "accent:Scottish@1": 0.375, + "accent:Irish": 0.00665625, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.031792499999999994, + "accent:Oceania@1": 0.0, + "accent:South Asia": 0.35604, + "accent:South Asia@1": 0.5, + "accent:Welsh": 0.0044825, + "accent:Welsh@1": 0.0 + }, + "indian x2": { + "wer": 0.006578947368421052, + "collapse": 0.0, + "identity": 0.6722579725104072, + "durx": 0.891287284144427, + "female": 0.005562509933952242, + "age": 21.08218688517809, + "f0": 106.33484772360798, + "f0_st": 2.534760560861204, + "voiced": 0.6861967788877188, + "rms_db": -38.05672287940979, + "accent:North America": 0.00773625, + "accent:North America@1": 0.0, + "accent:English": 0.037741250000000004, + "accent:English@1": 0.0, + "accent:Scottish": 0.03976875, + "accent:Scottish@1": 0.0, + "accent:Irish": 0.0005, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.0075112500000000006, + "accent:Oceania@1": 0.0, + "accent:South Asia": 0.7543425, + "accent:South Asia@1": 0.875, + "accent:Welsh": 0.1259375, + "accent:Welsh@1": 0.125 + }, + "welsh x1": { + "wer": 0.0035714285714285713, + "collapse": 0.0, + "identity": 0.8942782940720139, + "durx": 1.1664329854079036, + "female": 0.010881488386075944, + "age": 23.48964661359787, + "f0": 88.9201069484767, + "f0_st": 2.1282733818927597, + "voiced": 0.679356362624068, + "rms_db": -51.01775026321411, + "accent:North America": 0.004745, + "accent:North America@1": 0.0, + "accent:English": 0.9537599999999999, + "accent:English@1": 1.0, + "accent:Scottish": 0.00280125, + "accent:Scottish@1": 0.0, + "accent:Irish": 9.75e-05, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.03528124999999999, + "accent:Oceania@1": 0.0, + "accent:South Asia": 2.5e-06, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.0018725, + "accent:Welsh@1": 0.0 + }, + "welsh x1.5": { + "wer": 0.003676470588235294, + "collapse": 0.0, + "identity": 0.8355175259197816, + "durx": 1.3545983278807707, + "female": 0.006212341133505106, + "age": 26.391347870230675, + "f0": 92.86496912500196, + "f0_st": 2.212033773971016, + "voiced": 0.6376564524603823, + "rms_db": -54.247560024261475, + "accent:North America": 0.0085425, + "accent:North America@1": 0.0, + "accent:English": 0.87716375, + "accent:English@1": 1.0, + "accent:Scottish": 0.0025450000000000004, + "accent:Scottish@1": 0.0, + "accent:Irish": 0.0002175, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.054417499999999994, + "accent:Oceania@1": 0.0, + "accent:South Asia": 0.0006475, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.036621249999999994, + "accent:Welsh@1": 0.0 + }, + "welsh x2": { + "wer": 0.015690200565352, + "collapse": 0.0, + "identity": 0.8250931937702859, + "durx": 1.4187796935888541, + "female": 0.011590514535782859, + "age": 26.82982850819826, + "f0": 94.16151756637075, + "f0_st": 2.642206994106254, + "voiced": 0.7390605507565787, + "rms_db": -49.03059482574463, + "accent:North America": 0.00079375, + "accent:North America@1": 0.0, + "accent:English": 0.6937025, + "accent:English@1": 0.625, + "accent:Scottish": 0.0039837499999999994, + "accent:Scottish@1": 0.0, + "accent:Irish": 0.00021999999999999998, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.00299125, + "accent:Oceania@1": 0.0, + "accent:South Asia": 6.25e-06, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.29754, + "accent:Welsh@1": 0.375 + } + }, + "Australian Female": { + "neutral": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9577942174372572, + "durx": 1.0, + "female": 0.9963618963956833, + "age": 30.72400987148285, + "f0": 169.75764743272322, + "f0_st": 3.403637465701284, + "voiced": 0.6474153976776713, + "rms_db": -35.6559100151062, + "accent:North America": 0.0018650000000000001, + "accent:North America@1": 0.0, + "accent:English": 0.40268625, + "accent:English@1": 0.375, + "accent:Scottish": 0.019033750000000002, + "accent:Scottish@1": 0.0, + "accent:Irish": 0.0005312499999999999, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.0065425, + "accent:Oceania@1": 0.0, + "accent:South Asia": 0.0010487500000000002, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.55875875, + "accent:Welsh@1": 0.625 + }, + "british x1": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.92365620896469, + "durx": 0.9205802968960863, + "female": 0.9971953481435776, + "age": 31.158143281936646, + "f0": 172.9203865539778, + "f0_st": 7.089981468444673, + "voiced": 0.6457936586386128, + "rms_db": -37.7350697517395, + "accent:North America": 0.0009012499999999999, + "accent:North America@1": 0.0, + "accent:English": 0.44068625000000006, + "accent:English@1": 0.375, + "accent:Scottish": 0.0059900000000000005, + "accent:Scottish@1": 0.0, + "accent:Irish": 0.0002325, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.00266125, + "accent:Oceania@1": 0.0, + "accent:South Asia": 0.000165, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.5438125, + "accent:Welsh@1": 0.625 + }, + "british x1.5": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.90406580233382, + "durx": 0.9675990675990677, + "female": 0.9964090585708618, + "age": 30.137672275304794, + "f0": 172.33857834274002, + "f0_st": 7.030636484542395, + "voiced": 0.6486548476751739, + "rms_db": -40.65476131439209, + "accent:North America": 0.000555, + "accent:North America@1": 0.0, + "accent:English": 0.47767, + "accent:English@1": 0.5, + "accent:Scottish": 0.01091, + "accent:Scottish@1": 0.0, + "accent:Irish": 0.00010625000000000001, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.0048312500000000005, + "accent:Oceania@1": 0.0, + "accent:South Asia": 3.375e-05, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.4951175, + "accent:Welsh@1": 0.5 + }, + "british x2": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.8691370336132374, + "durx": 0.9026995027231827, + "female": 0.9973528534173965, + "age": 31.797298789024353, + "f0": 170.4847566260456, + "f0_st": 6.843343344754742, + "voiced": 0.659282498796664, + "rms_db": -42.83674240112305, + "accent:North America": 0.00214125, + "accent:North America@1": 0.0, + "accent:English": 0.5722524999999999, + "accent:English@1": 0.625, + "accent:Scottish": 0.007025000000000001, + "accent:Scottish@1": 0.0, + "accent:Irish": 0.00010625, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.009449999999999998, + "accent:Oceania@1": 0.0, + "accent:South Asia": 4.75e-05, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.4059125, + "accent:Welsh@1": 0.375 + }, + "american x1": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.8534434059623817, + "durx": 0.9004504504504505, + "female": 0.9969166070222855, + "age": 32.416751980781555, + "f0": 169.059183540542, + "f0_st": 5.1660001259296475, + "voiced": 0.7008943950599212, + "rms_db": -35.1468608379364, + "accent:North America": 0.08802375000000001, + "accent:North America@1": 0.0, + "accent:English": 0.02976625, + "accent:English@1": 0.0, + "accent:Scottish": 0.020386249999999998, + "accent:Scottish@1": 0.0, + "accent:Irish": 0.005855, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.017748749999999997, + "accent:Oceania@1": 0.0, + "accent:South Asia": 0.02134875, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.025293749999999997, + "accent:Welsh@1": 0.0 + }, + "american x1.5": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.819717903710104, + "durx": 0.8731777231777231, + "female": 0.9965232834219933, + "age": 31.670600920915604, + "f0": 175.94001282994148, + "f0_st": 4.258491830838212, + "voiced": 0.7121687896273662, + "rms_db": -34.5775465965271, + "accent:North America": 0.094645, + "accent:North America@1": 0.0, + "accent:English": 0.0008099999999999998, + "accent:English@1": 0.0, + "accent:Scottish": 0.0005925, + "accent:Scottish@1": 0.0, + "accent:Irish": 0.0013062500000000001, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.003715, + "accent:Oceania@1": 0.0, + "accent:South Asia": 0.0087525, + "accent:South Asia@1": 0.0, + "accent:Welsh": 1.6250000000000002e-05, + "accent:Welsh@1": 0.0 + }, + "american x2": { + "wer": 0.003676470588235294, + "collapse": 0.0, + "identity": 0.7837324845007398, + "durx": 0.8565118516574828, + "female": 0.9968866407871246, + "age": 33.67482349276543, + "f0": 176.66643755945347, + "f0_st": 4.761277418312877, + "voiced": 0.6879014718390344, + "rms_db": -37.99065637588501, + "accent:North America": 0.20692375, + "accent:North America@1": 0.25, + "accent:English": 0.0001575, + "accent:English@1": 0.0, + "accent:Scottish": 5.8750000000000005e-05, + "accent:Scottish@1": 0.0, + "accent:Irish": 0.0006075, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.002585, + "accent:Oceania@1": 0.0, + "accent:South Asia": 0.0028474999999999998, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.0, + "accent:Welsh@1": 0.0 + }, + "scottish x1": { + "wer": 0.0035714285714285713, + "collapse": 0.0, + "identity": 0.9270180041106918, + "durx": 0.9304632941577244, + "female": 0.9968485161662102, + "age": 31.007440015673637, + "f0": 167.12588668183605, + "f0_st": 4.567222808092897, + "voiced": 0.6434249043400873, + "rms_db": -37.96992540359497, + "accent:North America": 0.003835, + "accent:North America@1": 0.0, + "accent:English": 0.5256275, + "accent:English@1": 0.625, + "accent:Scottish": 0.02825875, + "accent:Scottish@1": 0.0, + "accent:Irish": 0.000845, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.00893625, + "accent:Oceania@1": 0.0, + "accent:South Asia": 0.0014012500000000002, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.4063425, + "accent:Welsh@1": 0.375 + }, + "scottish x1.5": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9124631953050427, + "durx": 0.8707250940260649, + "female": 0.9969192743301392, + "age": 31.189925223588943, + "f0": 167.2930898891778, + "f0_st": 3.131843460506765, + "voiced": 0.6377534790370344, + "rms_db": -38.68415117263794, + "accent:North America": 0.0015925, + "accent:North America@1": 0.0, + "accent:English": 0.52747625, + "accent:English@1": 0.5, + "accent:Scottish": 0.032055, + "accent:Scottish@1": 0.0, + "accent:Irish": 0.0007237499999999999, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.0069412499999999995, + "accent:Oceania@1": 0.0, + "accent:South Asia": 3.125e-05, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.42420749999999996, + "accent:Welsh@1": 0.5 + }, + "scottish x2": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.8662757755505754, + "durx": 0.840298916769505, + "female": 0.997416116297245, + "age": 33.30325819551945, + "f0": 167.15358626883665, + "f0_st": 2.605441177972262, + "voiced": 0.6348960636176756, + "rms_db": -39.165616035461426, + "accent:North America": 0.0011887500000000001, + "accent:North America@1": 0.0, + "accent:English": 0.8241725, + "accent:English@1": 0.875, + "accent:Scottish": 0.01863125, + "accent:Scottish@1": 0.0, + "accent:Irish": 5.000000000000001e-05, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.00376125, + "accent:Oceania@1": 0.0, + "accent:South Asia": 2.125e-05, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.14382250000000002, + "accent:Welsh@1": 0.125 + }, + "irish x1": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9351467156399926, + "durx": 0.8908685404364245, + "female": 0.9969351142644882, + "age": 30.12162335216999, + "f0": 172.16952705438086, + "f0_st": 3.7022891622494427, + "voiced": 0.6502104551566682, + "rms_db": -38.24481534957886, + "accent:North America": 0.0052699999999999995, + "accent:North America@1": 0.0, + "accent:English": 0.3878, + "accent:English@1": 0.5, + "accent:Scottish": 0.017362500000000003, + "accent:Scottish@1": 0.0, + "accent:Irish": 0.00114625, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.02194, + "accent:Oceania@1": 0.0, + "accent:South Asia": 0.00085125, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.5478125, + "accent:Welsh@1": 0.5 + }, + "irish x1.5": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9005603443616544, + "durx": 0.803713469567128, + "female": 0.9972607642412186, + "age": 31.062816083431244, + "f0": 172.7616047305296, + "f0_st": 4.972115117547873, + "voiced": 0.6835688473859565, + "rms_db": -38.82320690155029, + "accent:North America": 0.005205, + "accent:North America@1": 0.0, + "accent:English": 0.4835475, + "accent:English@1": 0.5, + "accent:Scottish": 0.0181, + "accent:Scottish@1": 0.0, + "accent:Irish": 0.0011325, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.02147375, + "accent:Oceania@1": 0.0, + "accent:South Asia": 0.000785, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.45815750000000005, + "accent:Welsh@1": 0.5 + }, + "irish x2": { + "wer": 0.003676470588235294, + "collapse": 0.0, + "identity": 0.8927398877621799, + "durx": 0.7924872831616018, + "female": 0.9971562996506691, + "age": 30.008262395858765, + "f0": 172.52139255557603, + "f0_st": 4.090602681546665, + "voiced": 0.6897433433605906, + "rms_db": -38.753825187683105, + "accent:North America": 0.00993, + "accent:North America@1": 0.0, + "accent:English": 0.46635624999999997, + "accent:English@1": 0.5, + "accent:Scottish": 0.0256575, + "accent:Scottish@1": 0.0, + "accent:Irish": 0.00342875, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.0199025, + "accent:Oceania@1": 0.0, + "accent:South Asia": 0.00021375000000000002, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.41231124999999996, + "accent:Welsh@1": 0.5 + }, + "australian x1": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9164643906459609, + "durx": 0.9641148325358853, + "female": 0.9964710101485252, + "age": 29.77244295179844, + "f0": 168.07511988645177, + "f0_st": 4.569136454554234, + "voiced": 0.6434837470343826, + "rms_db": -38.29828119277954, + "accent:North America": 0.0090125, + "accent:North America@1": 0.0, + "accent:English": 0.53797375, + "accent:English@1": 0.625, + "accent:Scottish": 0.011538749999999999, + "accent:Scottish@1": 0.0, + "accent:Irish": 0.0004175, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.21037250000000002, + "accent:Oceania@1": 0.25, + "accent:South Asia": 0.00195875, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.21026124999999998, + "accent:Welsh@1": 0.125 + }, + "australian x1.5": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.8816842477573572, + "durx": 0.9185296497514739, + "female": 0.9954095035791397, + "age": 29.405907168984413, + "f0": 166.54088183623128, + "f0_st": 4.076478894777297, + "voiced": 0.6313708591224464, + "rms_db": -35.62793159484863, + "accent:North America": 0.00268625, + "accent:North America@1": 0.0, + "accent:English": 0.46338250000000003, + "accent:English@1": 0.5, + "accent:Scottish": 0.00358, + "accent:Scottish@1": 0.0, + "accent:Irish": 7.374999999999999e-05, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.370645, + "accent:Oceania@1": 0.375, + "accent:South Asia": 0.0002375, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.09495750000000001, + "accent:Welsh@1": 0.0 + }, + "australian x2": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.8615223341138016, + "durx": 0.910955710955711, + "female": 0.9970865398645401, + "age": 29.371029883623123, + "f0": 168.32576830367825, + "f0_st": 3.6453039343439837, + "voiced": 0.6214657770526785, + "rms_db": -37.0352668762207, + "accent:North America": 0.0031225, + "accent:North America@1": 0.0, + "accent:English": 0.66724, + "accent:English@1": 0.75, + "accent:Scottish": 0.0036962500000000003, + "accent:Scottish@1": 0.0, + "accent:Irish": 0.00021500000000000002, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.31099374999999996, + "accent:Oceania@1": 0.25, + "accent:South Asia": 0.00019875, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.01020375, + "accent:Welsh@1": 0.0 + }, + "indian x1": { + "wer": 0.007247899159663866, + "collapse": 0.0, + "identity": 0.8926963373257657, + "durx": 0.8675438596491228, + "female": 0.9977825358510017, + "age": 33.89906771481037, + "f0": 172.40088382527483, + "f0_st": 4.181208185497184, + "voiced": 0.6762078105228313, + "rms_db": -38.794856548309326, + "accent:North America": 0.0002675, + "accent:North America@1": 0.0, + "accent:English": 0.20395, + "accent:English@1": 0.25, + "accent:Scottish": 0.0238425, + "accent:Scottish@1": 0.0, + "accent:Irish": 0.00011375, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.0012912499999999999, + "accent:Oceania@1": 0.0, + "accent:South Asia": 8.874999999999999e-05, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.76913375, + "accent:Welsh@1": 0.75 + }, + "indian x1.5": { + "wer": 0.007352941176470588, + "collapse": 0.0, + "identity": 0.7700697799403032, + "durx": 0.7955008287946957, + "female": 0.9967977032065392, + "age": 33.185943216085434, + "f0": 172.91857542459206, + "f0_st": 2.6436363187340453, + "voiced": 0.7178679852908735, + "rms_db": -36.283594608306885, + "accent:North America": 0.0017112499999999999, + "accent:North America@1": 0.0, + "accent:English": 0.051567499999999995, + "accent:English@1": 0.0, + "accent:Scottish": 0.00539375, + "accent:Scottish@1": 0.0, + "accent:Irish": 0.00020125, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.00757875, + "accent:Oceania@1": 0.0, + "accent:South Asia": 0.45972124999999997, + "accent:South Asia@1": 0.5, + "accent:Welsh": 0.45107125000000003, + "accent:Welsh@1": 0.5 + }, + "indian x2": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.698105558946809, + "durx": 0.7908013787160708, + "female": 0.9968989044427872, + "age": 35.37910021841526, + "f0": 179.73925841653366, + "f0_st": 2.7939115923847364, + "voiced": 0.7307051465700913, + "rms_db": -38.07326340675354, + "accent:North America": 0.0001275, + "accent:North America@1": 0.0, + "accent:English": 0.00234875, + "accent:English@1": 0.0, + "accent:Scottish": 0.00035375, + "accent:Scottish@1": 0.0, + "accent:Irish": 3.7500000000000005e-06, + "accent:Irish@1": 0.0, + "accent:Oceania": 4.5e-05, + "accent:Oceania@1": 0.0, + "accent:South Asia": 0.88959875, + "accent:South Asia@1": 0.875, + "accent:Welsh": 0.10633375, + "accent:Welsh@1": 0.125 + }, + "welsh x1": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9249778978528826, + "durx": 1.042918271287976, + "female": 0.997116930782795, + "age": 31.84932880103588, + "f0": 169.17650668820914, + "f0_st": 6.537882117227737, + "voiced": 0.6472372122283789, + "rms_db": -40.83584117889404, + "accent:North America": 0.00081625, + "accent:North America@1": 0.0, + "accent:English": 0.23474874999999998, + "accent:English@1": 0.125, + "accent:Scottish": 0.004625, + "accent:Scottish@1": 0.0, + "accent:Irish": 0.0002875, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.0014899999999999998, + "accent:Oceania@1": 0.0, + "accent:South Asia": 0.00102, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.7524150000000001, + "accent:Welsh@1": 0.875 + }, + "welsh x1.5": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9010746371731332, + "durx": 1.0747228381374723, + "female": 0.9970859736204147, + "age": 34.103063866496086, + "f0": 170.29427372204796, + "f0_st": 7.487662977963358, + "voiced": 0.6430251393290005, + "rms_db": -41.759706020355225, + "accent:North America": 0.0005974999999999999, + "accent:North America@1": 0.0, + "accent:English": 0.1442125, + "accent:English@1": 0.0, + "accent:Scottish": 0.00261, + "accent:Scottish@1": 0.0, + "accent:Irish": 4.25e-05, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.0005824999999999999, + "accent:Oceania@1": 0.0, + "accent:South Asia": 0.00010375000000000001, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.84918875, + "accent:Welsh@1": 1.0 + }, + "welsh x2": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.8393694370027869, + "durx": 1.0471989306112528, + "female": 0.9974460601806641, + "age": 35.886504128575325, + "f0": 165.37600069526655, + "f0_st": 8.406106953541869, + "voiced": 0.6712149058923982, + "rms_db": -49.28371524810791, + "accent:North America": 0.00152625, + "accent:North America@1": 0.0, + "accent:English": 0.2136, + "accent:English@1": 0.25, + "accent:Scottish": 0.00330125, + "accent:Scottish@1": 0.0, + "accent:Irish": 0.00024, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.00218625, + "accent:Oceania@1": 0.0, + "accent:South Asia": 0.0001225, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.77621125, + "accent:Welsh@1": 0.75 + } + }, + "Scottish Female": { + "neutral": { + "wer": 0.0035714285714285713, + "collapse": 0.0, + "identity": 0.9145929828083488, + "durx": 1.0, + "female": 0.9982826486229897, + "age": 49.27809797227383, + "f0": 188.01626182071107, + "f0_st": 2.3319907929021895, + "voiced": 0.7616976340931645, + "rms_db": -38.83242130279541, + "accent:North America": 0.004837500000000001, + "accent:North America@1": 0.0, + "accent:English": 0.54402, + "accent:English@1": 0.5, + "accent:Scottish": 0.0009437499999999999, + "accent:Scottish@1": 0.0, + "accent:Irish": 7.750000000000001e-05, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.4373425, + "accent:Oceania@1": 0.5, + "accent:South Asia": 1.8750000000000002e-05, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.0009012499999999999, + "accent:Welsh@1": 0.0 + }, + "british x1": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.8386744699860043, + "durx": 0.9637389202256246, + "female": 0.9977792873978615, + "age": 47.47426137328148, + "f0": 188.01152743557446, + "f0_st": 2.6589557677230378, + "voiced": 0.7625279241112832, + "rms_db": -34.84378623962402, + "accent:North America": 0.00112, + "accent:North America@1": 0.0, + "accent:English": 0.696565, + "accent:English@1": 0.75, + "accent:Scottish": 0.279735, + "accent:Scottish@1": 0.25, + "accent:Irish": 3.875000000000001e-05, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.00651375, + "accent:Oceania@1": 0.0, + "accent:South Asia": 1.5e-05, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.00187625, + "accent:Welsh@1": 0.0 + }, + "british x1.5": { + "wer": 0.003676470588235294, + "collapse": 0.0, + "identity": 0.796654870410782, + "durx": 1.0049580472921436, + "female": 0.9981050342321396, + "age": 45.85874527692795, + "f0": 185.62369345232747, + "f0_st": 2.805286612135707, + "voiced": 0.7310307111427813, + "rms_db": -36.48352670669556, + "accent:North America": 0.00019, + "accent:North America@1": 0.0, + "accent:English": 0.8285487500000001, + "accent:English@1": 1.0, + "accent:Scottish": 0.024332500000000003, + "accent:Scottish@1": 0.0, + "accent:Irish": 5e-06, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.001645, + "accent:Oceania@1": 0.0, + "accent:South Asia": 5e-06, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.12774125, + "accent:Welsh@1": 0.0 + }, + "british x2": { + "wer": 0.0035714285714285713, + "collapse": 0.0, + "identity": 0.7595779872348831, + "durx": 0.9855072463768116, + "female": 0.997995026409626, + "age": 44.50167566537857, + "f0": 185.54223363812918, + "f0_st": 2.6413535583577246, + "voiced": 0.7504149616073714, + "rms_db": -35.92821192741394, + "accent:North America": 0.00040375000000000003, + "accent:North America@1": 0.0, + "accent:English": 0.9736787499999999, + "accent:English@1": 1.0, + "accent:Scottish": 0.006314999999999999, + "accent:Scottish@1": 0.0, + "accent:Irish": 3.25e-05, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.0012950000000000001, + "accent:Oceania@1": 0.0, + "accent:South Asia": 3.75e-06, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.0024749999999999998, + "accent:Welsh@1": 0.0 + }, + "american x1": { + "wer": 0.007352941176470588, + "collapse": 0.0, + "identity": 0.7870543582172336, + "durx": 0.9147864625302177, + "female": 0.997779555618763, + "age": 51.61207839846611, + "f0": 194.01895556447826, + "f0_st": 2.5706149015092365, + "voiced": 0.8229243664904495, + "rms_db": -43.4613733291626, + "accent:North America": 0.51098, + "accent:North America@1": 0.5, + "accent:English": 2e-05, + "accent:English@1": 0.0, + "accent:Scottish": 1.25e-06, + "accent:Scottish@1": 0.0, + "accent:Irish": 0.00034, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.01963, + "accent:Oceania@1": 0.0, + "accent:South Asia": 0.0004687500000000001, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.0, + "accent:Welsh@1": 0.0 + }, + "american x1.5": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.7474642905597468, + "durx": 0.9684597523219814, + "female": 0.9979356080293655, + "age": 50.454553216695786, + "f0": 195.85244874437285, + "f0_st": 2.8801697454317687, + "voiced": 0.81210200816021, + "rms_db": -48.58630084991455, + "accent:North America": 0.26213000000000003, + "accent:North America@1": 0.25, + "accent:English": 1.25e-06, + "accent:English@1": 0.0, + "accent:Scottish": 0.0, + "accent:Scottish@1": 0.0, + "accent:Irish": 0.00021875, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.006975, + "accent:Oceania@1": 0.0, + "accent:South Asia": 5.75e-05, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.0, + "accent:Welsh@1": 0.0 + }, + "american x2": { + "wer": 0.007352941176470588, + "collapse": 0.0, + "identity": 0.7016944927721576, + "durx": 1.0134282624369142, + "female": 0.9980709403753281, + "age": 49.8740803450346, + "f0": 193.32929812371484, + "f0_st": 3.118978352679939, + "voiced": 0.7648922192959653, + "rms_db": -50.814008712768555, + "accent:North America": 0.18577125, + "accent:North America@1": 0.125, + "accent:English": 0.0, + "accent:English@1": 0.0, + "accent:Scottish": 0.0, + "accent:Scottish@1": 0.0, + "accent:Irish": 7.375e-05, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.00438875, + "accent:Oceania@1": 0.0, + "accent:South Asia": 6.25e-05, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.0, + "accent:Welsh@1": 0.0 + }, + "scottish x1": { + "wer": 0.010255417956656347, + "collapse": 0.0, + "identity": 0.8229276272503976, + "durx": 0.944947209653092, + "female": 0.998223215341568, + "age": 50.020284205675125, + "f0": 181.0434721021672, + "f0_st": 2.529373914730951, + "voiced": 0.7579415077287481, + "rms_db": -31.169162034988403, + "accent:North America": 0.0001175, + "accent:North America@1": 0.0, + "accent:English": 0.00217375, + "accent:English@1": 0.0, + "accent:Scottish": 0.9976324999999999, + "accent:Scottish@1": 1.0, + "accent:Irish": 1.375e-05, + "accent:Irish@1": 0.0, + "accent:Oceania": 3.2500000000000004e-05, + "accent:Oceania@1": 0.0, + "accent:South Asia": 3.75e-06, + "accent:South Asia@1": 0.0, + "accent:Welsh": 3.7500000000000005e-06, + "accent:Welsh@1": 0.0 + }, + "scottish x1.5": { + "wer": 0.003676470588235294, + "collapse": 0.0, + "identity": 0.771243474625306, + "durx": 0.9173164392462638, + "female": 0.9983259066939354, + "age": 50.37748999893665, + "f0": 169.58110633908657, + "f0_st": 1.9802195687487605, + "voiced": 0.758935333951712, + "rms_db": -36.80675673484802, + "accent:North America": 4.125e-05, + "accent:North America@1": 0.0, + "accent:English": 0.00367, + "accent:English@1": 0.0, + "accent:Scottish": 0.9962375, + "accent:Scottish@1": 1.0, + "accent:Irish": 6.25e-06, + "accent:Irish@1": 0.0, + "accent:Oceania": 2.875e-05, + "accent:Oceania@1": 0.0, + "accent:South Asia": 2.5e-06, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.0, + "accent:Welsh@1": 0.0 + }, + "scottish x2": { + "wer": 0.013721804511278194, + "collapse": 0.0, + "identity": 0.7151073714105273, + "durx": 0.9016164994425865, + "female": 0.9980508238077164, + "age": 48.4894547611475, + "f0": 165.32389280438485, + "f0_st": 2.267575437599441, + "voiced": 0.74215488878532, + "rms_db": -37.32182788848877, + "accent:North America": 0.0001525, + "accent:North America@1": 0.0, + "accent:English": 0.05161875, + "accent:English@1": 0.0, + "accent:Scottish": 0.947095, + "accent:Scottish@1": 1.0, + "accent:Irish": 2.875e-05, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.00034875, + "accent:Oceania@1": 0.0, + "accent:South Asia": 5e-06, + "accent:South Asia@1": 0.0, + "accent:Welsh": 2.25e-05, + "accent:Welsh@1": 0.0 + }, + "irish x1": { + "wer": 0.007352941176470588, + "collapse": 0.0, + "identity": 0.8467445603967366, + "durx": 0.9745311167945441, + "female": 0.9981863126158714, + "age": 48.82998988032341, + "f0": 179.10407845626924, + "f0_st": 2.398231916453509, + "voiced": 0.792930882613329, + "rms_db": -35.580522298812866, + "accent:North America": 0.011983750000000001, + "accent:North America@1": 0.0, + "accent:English": 0.3303175, + "accent:English@1": 0.25, + "accent:Scottish": 0.59971375, + "accent:Scottish@1": 0.75, + "accent:Irish": 0.00104, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.0114825, + "accent:Oceania@1": 0.0, + "accent:South Asia": 0.00022124999999999998, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.0001425, + "accent:Welsh@1": 0.0 + }, + "irish x1.5": { + "wer": 0.0035714285714285713, + "collapse": 0.0, + "identity": 0.8094079328768149, + "durx": 0.9807692307692307, + "female": 0.9983114823698997, + "age": 47.564318776130676, + "f0": 180.6554167964544, + "f0_st": 1.9605759639332723, + "voiced": 0.7840827213376076, + "rms_db": -34.52046751976013, + "accent:North America": 0.040645, + "accent:North America@1": 0.0, + "accent:English": 0.50294625, + "accent:English@1": 0.5, + "accent:Scottish": 0.35834750000000004, + "accent:Scottish@1": 0.375, + "accent:Irish": 0.0018537500000000001, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.057332499999999995, + "accent:Oceania@1": 0.125, + "accent:South Asia": 0.000315, + "accent:South Asia@1": 0.0, + "accent:Welsh": 4.75e-05, + "accent:Welsh@1": 0.0 + }, + "irish x2": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.7945838134632226, + "durx": 0.9526321398124467, + "female": 0.9981760606169701, + "age": 46.593599021434784, + "f0": 173.08307782321071, + "f0_st": 2.000455414088158, + "voiced": 0.7884726382684155, + "rms_db": -34.24767851829529, + "accent:North America": 0.025085, + "accent:North America@1": 0.0, + "accent:English": 0.6439012500000001, + "accent:English@1": 0.625, + "accent:Scottish": 0.11370125, + "accent:Scottish@1": 0.125, + "accent:Irish": 0.00136875, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.13629375, + "accent:Oceania@1": 0.125, + "accent:South Asia": 0.000125, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.00031999999999999997, + "accent:Welsh@1": 0.0 + }, + "australian x1": { + "wer": 0.0035714285714285713, + "collapse": 0.0, + "identity": 0.8463824322711236, + "durx": 0.9676113360323887, + "female": 0.9974855035543442, + "age": 48.00359643995762, + "f0": 181.43798360244767, + "f0_st": 4.051648040900412, + "voiced": 0.7674667224543761, + "rms_db": -25.449424505233765, + "accent:North America": 0.00196, + "accent:North America@1": 0.0, + "accent:English": 0.59902875, + "accent:English@1": 0.625, + "accent:Scottish": 0.00074375, + "accent:Scottish@1": 0.0, + "accent:Irish": 2.375e-05, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.39757750000000003, + "accent:Oceania@1": 0.375, + "accent:South Asia": 1.75e-05, + "accent:South Asia@1": 0.0, + "accent:Welsh": 2.125e-05, + "accent:Welsh@1": 0.0 + }, + "australian x1.5": { + "wer": 0.0035714285714285713, + "collapse": 0.0, + "identity": 0.7827445472527813, + "durx": 1.01461161387632, + "female": 0.9969463348388672, + "age": 46.87323085963726, + "f0": 172.10312535266712, + "f0_st": 3.909967584699698, + "voiced": 0.7384028825237852, + "rms_db": -28.09167182445526, + "accent:North America": 0.004635, + "accent:North America@1": 0.0, + "accent:English": 0.47420249999999997, + "accent:English@1": 0.5, + "accent:Scottish": 0.00135375, + "accent:Scottish@1": 0.0, + "accent:Irish": 2.75e-05, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.5169725, + "accent:Oceania@1": 0.5, + "accent:South Asia": 0.0002, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.00013749999999999998, + "accent:Welsh@1": 0.0 + }, + "australian x2": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.714349808813427, + "durx": 0.9387871853546912, + "female": 0.9934759363532066, + "age": 40.24881348013878, + "f0": 162.86944241219857, + "f0_st": 2.95098222401446, + "voiced": 0.7364804196076917, + "rms_db": -29.081761360168457, + "accent:North America": 0.00184125, + "accent:North America@1": 0.0, + "accent:English": 0.59167, + "accent:English@1": 0.625, + "accent:Scottish": 0.000525, + "accent:Scottish@1": 0.0, + "accent:Irish": 3.7500000000000005e-06, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.40574374999999996, + "accent:Oceania@1": 0.375, + "accent:South Asia": 1.25e-06, + "accent:South Asia@1": 0.0, + "accent:Welsh": 2.5e-06, + "accent:Welsh@1": 0.0 + }, + "indian x1": { + "wer": 0.006578947368421052, + "collapse": 0.0, + "identity": 0.7481400852198745, + "durx": 0.9135932560590095, + "female": 0.9978438168764114, + "age": 48.39172698557377, + "f0": 193.04251940038858, + "f0_st": 2.6372944632273074, + "voiced": 0.816328902288261, + "rms_db": -35.665931940078735, + "accent:North America": 0.00759, + "accent:North America@1": 0.0, + "accent:English": 0.32200625000000005, + "accent:English@1": 0.5, + "accent:Scottish": 0.022164999999999997, + "accent:Scottish@1": 0.0, + "accent:Irish": 0.0003375, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.076495, + "accent:Oceania@1": 0.125, + "accent:South Asia": 0.13288125, + "accent:South Asia@1": 0.125, + "accent:Welsh": 0.14863125000000002, + "accent:Welsh@1": 0.125 + }, + "indian x1.5": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.6607300108072273, + "durx": 0.861653908138598, + "female": 0.9978720024228096, + "age": 48.21113310754299, + "f0": 202.00609335386275, + "f0_st": 2.278751393078231, + "voiced": 0.8571296865408646, + "rms_db": -31.794925451278687, + "accent:North America": 0.0016412500000000001, + "accent:North America@1": 0.0, + "accent:English": 0.01469375, + "accent:English@1": 0.0, + "accent:Scottish": 0.00337625, + "accent:Scottish@1": 0.0, + "accent:Irish": 4.750000000000001e-05, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.0026125000000000002, + "accent:Oceania@1": 0.0, + "accent:South Asia": 0.7885150000000001, + "accent:South Asia@1": 1.0, + "accent:Welsh": 0.062407500000000005, + "accent:Welsh@1": 0.0 + }, + "indian x2": { + "wer": 0.02101994115724093, + "collapse": 0.0, + "identity": 0.5573592317137823, + "durx": 0.8188854489164087, + "female": 0.9950033649802208, + "age": 39.93448428809643, + "f0": 189.73798286773032, + "f0_st": 1.956923653628717, + "voiced": 0.8454752607938829, + "rms_db": -36.22087097167969, + "accent:North America": 0.00116875, + "accent:North America@1": 0.0, + "accent:English": 0.03825375, + "accent:English@1": 0.0, + "accent:Scottish": 0.013940000000000001, + "accent:Scottish@1": 0.0, + "accent:Irish": 2.5e-05, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.00311625, + "accent:Oceania@1": 0.0, + "accent:South Asia": 0.81700375, + "accent:South Asia@1": 1.0, + "accent:Welsh": 0.00315, + "accent:Welsh@1": 0.0 + }, + "welsh x1": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.8259901619887049, + "durx": 1.0859676852827538, + "female": 0.9980574995279312, + "age": 50.0098142772913, + "f0": 190.09325877475166, + "f0_st": 2.388302963869937, + "voiced": 0.7811376777499281, + "rms_db": -35.5193886756897, + "accent:North America": 0.0008, + "accent:North America@1": 0.0, + "accent:English": 0.57602, + "accent:English@1": 0.625, + "accent:Scottish": 0.179355, + "accent:Scottish@1": 0.125, + "accent:Irish": 0.000145, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.00105875, + "accent:Oceania@1": 0.0, + "accent:South Asia": 1.2499999999999999e-05, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.2361275, + "accent:Welsh@1": 0.25 + }, + "welsh x1.5": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.7821056775373502, + "durx": 1.1120401337792643, + "female": 0.9982131943106651, + "age": 51.094259321689606, + "f0": 181.31338417485435, + "f0_st": 2.2348862462541907, + "voiced": 0.8135059308217334, + "rms_db": -35.93411827087402, + "accent:North America": 0.001195, + "accent:North America@1": 0.0, + "accent:English": 0.67378, + "accent:English@1": 0.75, + "accent:Scottish": 0.11687, + "accent:Scottish@1": 0.125, + "accent:Irish": 0.00017, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.00320875, + "accent:Oceania@1": 0.0, + "accent:South Asia": 4.875e-05, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.17174, + "accent:Welsh@1": 0.125 + }, + "welsh x2": { + "wer": 0.0035714285714285713, + "collapse": 0.0, + "identity": 0.7076518035725563, + "durx": 1.1205045625335481, + "female": 0.997023843228817, + "age": 48.14128689467907, + "f0": 179.0995568166736, + "f0_st": 2.3440916323180163, + "voiced": 0.8058102933789423, + "rms_db": -41.82470631599426, + "accent:North America": 0.00035875, + "accent:North America@1": 0.0, + "accent:English": 0.43238750000000004, + "accent:English@1": 0.625, + "accent:Scottish": 0.0083125, + "accent:Scottish@1": 0.0, + "accent:Irish": 4.375e-05, + "accent:Irish@1": 0.0, + "accent:Oceania": 0.0016462500000000001, + "accent:Oceania@1": 0.0, + "accent:South Asia": 2.9999999999999997e-05, + "accent:South Asia@1": 0.0, + "accent:Welsh": 0.547115, + "accent:Welsh@1": 0.375 + } + } +} diff --git a/steering/english_accents_mect60k/indian.npy b/steering/english_accents_mect60k/indian.npy new file mode 100644 index 0000000000000000000000000000000000000000..932431b574eea2846a2b2924e0962c88130adf86 --- /dev/null +++ b/steering/english_accents_mect60k/indian.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:03be0e6b8eb0f10cd1867616e33623fbb667b1de65889336e9d8c7c8a8a05c68 +size 896 diff --git a/steering/english_accents_mect60k/irish.npy b/steering/english_accents_mect60k/irish.npy new file mode 100644 index 0000000000000000000000000000000000000000..cc85a9bf772f0ae9bc5cc83f30171488c6a3261f --- /dev/null +++ b/steering/english_accents_mect60k/irish.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2da7d0647ea897e488a111eb3e829f6f277c5109828331304de37ca7fb9f8a26 +size 896 diff --git a/steering/english_accents_mect60k/manifest.json b/steering/english_accents_mect60k/manifest.json new file mode 100644 index 0000000000000000000000000000000000000000..f08b3a3dd95d085ab68de648ef3fd41b05132134 --- /dev/null +++ b/steering/english_accents_mect60k/manifest.json @@ -0,0 +1,225 @@ +{ + "dim": 192, + "space": "raw", + "checkpoint": "/data/groups/audio/gabriel/hf_release_zonos3mini_20261020/lm/mect_60k", + "corpus": "/data/groups/audio/sofian/runs/steer_corpora/english_accents/clips.json", + "spec": { + "space": "raw", + "orthogonal_to": [ + "/data/groups/audio/sofian/bingua2-gdn-emotion/minisgl/speaker_attributes_mect60k" + ], + "directions": { + "british": { + "pairs": [ + [ + { + "corpus": "vctk", + "accent": "English" + }, + { + "corpus": "vctk", + "accent": "American" + } + ], + [ + { + "corpus": "voxceleb", + "accent": "UK" + }, + { + "corpus": "voxceleb", + "accent": "USA" + } + ] + ] + }, + "american": { + "pairs": [ + [ + { + "corpus": "vctk", + "accent": "American" + }, + { + "corpus": "vctk", + "accent": "English" + } + ], + [ + { + "corpus": "voxceleb", + "accent": "USA" + }, + { + "corpus": "voxceleb", + "accent": "UK" + } + ] + ] + }, + "scottish": { + "pairs": [ + [ + { + "corpus": "vctk", + "accent": "Scottish" + }, + { + "corpus": "vctk", + "accent": "American" + } + ], + [ + { + "corpus": "english_dialects", + "accent": "scottish" + }, + { + "corpus": "english_dialects", + "accent": "southern" + }, + "+british" + ] + ] + }, + "irish": { + "pairs": [ + [ + { + "corpus": "vctk", + "accent": "Irish" + }, + { + "corpus": "vctk", + "accent": "American" + } + ], + [ + { + "corpus": "voxceleb", + "accent": "Ireland" + }, + { + "corpus": "voxceleb", + "accent": "USA" + } + ], + [ + { + "corpus": "english_dialects", + "accent": "irish" + }, + { + "corpus": "english_dialects", + "accent": "southern" + }, + "+british" + ] + ] + }, + "australian": { + "pairs": [ + [ + { + "corpus": "vctk", + "accent": "Australian" + }, + { + "corpus": "vctk", + "accent": "American" + } + ], + [ + { + "corpus": "voxceleb", + "accent": "Australia" + }, + { + "corpus": "voxceleb", + "accent": "USA" + } + ] + ] + }, + "indian": { + "pairs": [ + [ + { + "corpus": "vctk", + "accent": "Indian" + }, + { + "corpus": "vctk", + "accent": "American" + } + ], + [ + { + "corpus": "voxceleb", + "accent": "India" + }, + { + "corpus": "voxceleb", + "accent": "USA" + } + ] + ] + }, + "welsh": { + "pairs": [ + [ + { + "corpus": "english_dialects", + "accent": "welsh" + }, + { + "corpus": "english_dialects", + "accent": "southern" + }, + "+british" + ] + ] + } + } + }, + "directions": { + "british": { + "file": "british.npy", + "kind": "named", + "norm": 1.6460160023035668 + }, + "american": { + "file": "american.npy", + "kind": "named", + "norm": 1.6460160023035668 + }, + "scottish": { + "file": "scottish.npy", + "kind": "named", + "norm": 1.5993952256562336 + }, + "irish": { + "file": "irish.npy", + "kind": "named", + "norm": 1.4670428877353188 + }, + "australian": { + "file": "australian.npy", + "kind": "named", + "norm": 1.6846640382867135 + }, + "indian": { + "file": "indian.npy", + "kind": "named", + "norm": 1.9338742609604493 + }, + "welsh": { + "file": "welsh.npy", + "kind": "named", + "norm": 1.694260713795206 + } + }, + "input_dim": 192, + "speaker_codec": "ownmect_s2", + "ref_base_norm": 3.8260087439079817 +} diff --git a/steering/english_accents_mect60k/report.json b/steering/english_accents_mect60k/report.json new file mode 100644 index 0000000000000000000000000000000000000000..7844513c26c1cd73dbf519390ec751684031d237 --- /dev/null +++ b/steering/english_accents_mect60k/report.json @@ -0,0 +1,355 @@ +{ + "british": { + "norm": 1.6460160023035668, + "removed_share": 0.007576180840087932, + "pairs": [ + { + "pair": [ + { + "corpus": "vctk", + "accent": "English" + }, + { + "corpus": "vctk", + "accent": "American" + } + ], + "train_speakers": [ + 26, + 18 + ], + "held_out_speakers": [ + 7, + 3 + ], + "held_out_auc": 1.0, + "cos_with_direction": 0.7703393669925056 + }, + { + "pair": [ + { + "corpus": "voxceleb", + "accent": "UK" + }, + { + "corpus": "voxceleb", + "accent": "USA" + } + ], + "train_speakers": [ + 119, + 122 + ], + "held_out_speakers": [ + 31, + 28 + ], + "held_out_auc": 1.0, + "cos_with_direction": 0.9871124902132461 + } + ] + }, + "american": { + "norm": 1.6460160023035668, + "removed_share": 0.007576180840087932, + "pairs": [ + { + "pair": [ + { + "corpus": "vctk", + "accent": "American" + }, + { + "corpus": "vctk", + "accent": "English" + } + ], + "train_speakers": [ + 18, + 26 + ], + "held_out_speakers": [ + 3, + 7 + ], + "held_out_auc": 1.0, + "cos_with_direction": 0.7703393669925056 + }, + { + "pair": [ + { + "corpus": "voxceleb", + "accent": "USA" + }, + { + "corpus": "voxceleb", + "accent": "UK" + } + ], + "train_speakers": [ + 122, + 119 + ], + "held_out_speakers": [ + 28, + 31 + ], + "held_out_auc": 1.0, + "cos_with_direction": 0.9871124902132461 + } + ] + }, + "scottish": { + "norm": 1.5993952256562336, + "removed_share": 0.03577474487574517, + "pairs": [ + { + "pair": [ + { + "corpus": "vctk", + "accent": "Scottish" + }, + { + "corpus": "vctk", + "accent": "American" + } + ], + "train_speakers": [ + 13, + 18 + ], + "held_out_speakers": [ + 6, + 3 + ], + "held_out_auc": 1.0, + "cos_with_direction": 0.8626585135708608 + }, + { + "pair": [ + { + "corpus": "english_dialects", + "accent": "scottish" + }, + { + "corpus": "english_dialects", + "accent": "southern" + }, + "+british" + ], + "train_speakers": [ + 11, + 29 + ], + "held_out_speakers": [ + 0, + 2 + ], + "held_out_auc": NaN, + "cos_with_direction": 0.8712762474012816 + } + ] + }, + "irish": { + "norm": 1.4670428877353188, + "removed_share": 0.030458260083314648, + "pairs": [ + { + "pair": [ + { + "corpus": "vctk", + "accent": "Irish" + }, + { + "corpus": "vctk", + "accent": "American" + } + ], + "train_speakers": [ + 7, + 18 + ], + "held_out_speakers": [ + 2, + 3 + ], + "held_out_auc": 0.8333333333333334, + "cos_with_direction": 0.6602647548397248 + }, + { + "pair": [ + { + "corpus": "voxceleb", + "accent": "Ireland" + }, + { + "corpus": "voxceleb", + "accent": "USA" + } + ], + "train_speakers": [ + 12, + 122 + ], + "held_out_speakers": [ + 3, + 28 + ], + "held_out_auc": 0.9523809523809523, + "cos_with_direction": 0.8712574614439489 + }, + { + "pair": [ + { + "corpus": "english_dialects", + "accent": "irish" + }, + { + "corpus": "english_dialects", + "accent": "southern" + }, + "+british" + ], + "train_speakers": [ + 2, + 29 + ], + "held_out_speakers": [ + 1, + 2 + ], + "held_out_auc": 0.0, + "cos_with_direction": 0.521591606405971 + } + ] + }, + "australian": { + "norm": 1.6846640382867135, + "removed_share": 0.0028896926186066096, + "pairs": [ + { + "pair": [ + { + "corpus": "vctk", + "accent": "Australian" + }, + { + "corpus": "vctk", + "accent": "American" + } + ], + "train_speakers": [ + 2, + 18 + ], + "held_out_speakers": [ + 0, + 3 + ], + "held_out_auc": NaN, + "cos_with_direction": 0.605634548678038 + }, + { + "pair": [ + { + "corpus": "voxceleb", + "accent": "Australia" + }, + { + "corpus": "voxceleb", + "accent": "USA" + } + ], + "train_speakers": [ + 28, + 122 + ], + "held_out_speakers": [ + 9, + 28 + ], + "held_out_auc": 0.996031746031746, + "cos_with_direction": 0.992472713119429 + } + ] + }, + "indian": { + "norm": 1.9338742609604493, + "removed_share": 0.005098340575824034, + "pairs": [ + { + "pair": [ + { + "corpus": "vctk", + "accent": "Indian" + }, + { + "corpus": "vctk", + "accent": "American" + } + ], + "train_speakers": [ + 1, + 18 + ], + "held_out_speakers": [ + 2, + 3 + ], + "held_out_auc": 0.5, + "cos_with_direction": 0.4830369027020469 + }, + { + "pair": [ + { + "corpus": "voxceleb", + "accent": "India" + }, + { + "corpus": "voxceleb", + "accent": "USA" + } + ], + "train_speakers": [ + 17, + 122 + ], + "held_out_speakers": [ + 8, + 28 + ], + "held_out_auc": 1.0, + "cos_with_direction": 0.9885687008346927 + } + ] + }, + "welsh": { + "norm": 1.694260713795206, + "removed_share": 0.0015759263052679273, + "pairs": [ + { + "pair": [ + { + "corpus": "english_dialects", + "accent": "welsh" + }, + { + "corpus": "english_dialects", + "accent": "southern" + }, + "+british" + ], + "train_speakers": [ + 10, + 29 + ], + "held_out_speakers": [ + 1, + 2 + ], + "held_out_auc": 0.5, + "cos_with_direction": 0.9992117261595422 + } + ] + } +} diff --git a/steering/english_accents_mect60k/scottish.npy b/steering/english_accents_mect60k/scottish.npy new file mode 100644 index 0000000000000000000000000000000000000000..60cb8409421335730ccbce55478d1d6c5bc85948 --- /dev/null +++ b/steering/english_accents_mect60k/scottish.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5420d2d7fcff83751b2564c239aa60b06c1ac8f79c7848e4048778d734cab6e7 +size 896 diff --git a/steering/english_accents_mect60k/spec.json b/steering/english_accents_mect60k/spec.json new file mode 100644 index 0000000000000000000000000000000000000000..4d8cbb3e515350d89a5d5dc8784e9cc3ad3f948b --- /dev/null +++ b/steering/english_accents_mect60k/spec.json @@ -0,0 +1,179 @@ +{ + "space": "raw", + "orthogonal_to": [ + "/data/groups/audio/sofian/bingua2-gdn-emotion/minisgl/speaker_attributes_mect60k" + ], + "directions": { + "british": { + "pairs": [ + [ + { + "corpus": "vctk", + "accent": "English" + }, + { + "corpus": "vctk", + "accent": "American" + } + ], + [ + { + "corpus": "voxceleb", + "accent": "UK" + }, + { + "corpus": "voxceleb", + "accent": "USA" + } + ] + ] + }, + "american": { + "pairs": [ + [ + { + "corpus": "vctk", + "accent": "American" + }, + { + "corpus": "vctk", + "accent": "English" + } + ], + [ + { + "corpus": "voxceleb", + "accent": "USA" + }, + { + "corpus": "voxceleb", + "accent": "UK" + } + ] + ] + }, + "scottish": { + "pairs": [ + [ + { + "corpus": "vctk", + "accent": "Scottish" + }, + { + "corpus": "vctk", + "accent": "American" + } + ], + [ + { + "corpus": "english_dialects", + "accent": "scottish" + }, + { + "corpus": "english_dialects", + "accent": "southern" + }, + "+british" + ] + ] + }, + "irish": { + "pairs": [ + [ + { + "corpus": "vctk", + "accent": "Irish" + }, + { + "corpus": "vctk", + "accent": "American" + } + ], + [ + { + "corpus": "voxceleb", + "accent": "Ireland" + }, + { + "corpus": "voxceleb", + "accent": "USA" + } + ], + [ + { + "corpus": "english_dialects", + "accent": "irish" + }, + { + "corpus": "english_dialects", + "accent": "southern" + }, + "+british" + ] + ] + }, + "australian": { + "pairs": [ + [ + { + "corpus": "vctk", + "accent": "Australian" + }, + { + "corpus": "vctk", + "accent": "American" + } + ], + [ + { + "corpus": "voxceleb", + "accent": "Australia" + }, + { + "corpus": "voxceleb", + "accent": "USA" + } + ] + ] + }, + "indian": { + "pairs": [ + [ + { + "corpus": "vctk", + "accent": "Indian" + }, + { + "corpus": "vctk", + "accent": "American" + } + ], + [ + { + "corpus": "voxceleb", + "accent": "India" + }, + { + "corpus": "voxceleb", + "accent": "USA" + } + ] + ] + }, + "welsh": { + "pairs": [ + [ + { + "corpus": "english_dialects", + "accent": "welsh" + }, + { + "corpus": "english_dialects", + "accent": "southern" + }, + "+british" + ] + ] + } + } +} \ No newline at end of file diff --git a/steering/english_accents_mect60k/welsh.npy b/steering/english_accents_mect60k/welsh.npy new file mode 100644 index 0000000000000000000000000000000000000000..7fa74424963483decb1d7b24165a37a53f434727 --- /dev/null +++ b/steering/english_accents_mect60k/welsh.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3d5d5587ee6520330aea04054e559c615bc76476d4a76269a914704ad5783391 +size 896 diff --git a/steering/expressive_mect60k/eval_summary.json b/steering/expressive_mect60k/eval_summary.json new file mode 100644 index 0000000000000000000000000000000000000000..cfb85d18980d9a2fcd94b3030bac0db722e3572c --- /dev/null +++ b/steering/expressive_mect60k/eval_summary.json @@ -0,0 +1,898 @@ +{ + "all": { + "neutral": { + "wer": 0.004866946778711485, + "collapse": 0.0, + "identity": 0.9463956918186919, + "durx": 1.0, + "female": 0.4983073752615989, + "age": 41.317688735822834, + "f0": 136.19757792145845, + "f0_st": 2.903048200564409, + "voiced": 0.6307535235563585, + "rms_db": -38.16175572077433, + "snr_db": 39.82410788536072, + "bandwidth": 8300.152587890625, + "quality:monotone": 0.0, + "quality:singsong": 0.34092208333333335, + "quality:flowing": 0.59947875, + "quality:pitchy": 0.005500833333333334 + }, + "expressive -16": { + "wer": 0.0024509803921568627, + "collapse": 0.0, + "identity": 0.8982913643109094, + "durx": 0.8352059925093632, + "female": 0.49819045811212465, + "age": 39.2216932028532, + "f0": 117.82521312026306, + "f0_st": 2.1895790907698185, + "voiced": 0.710384564304945, + "rms_db": -35.36005965868632, + "snr_db": 29.311468521753948, + "bandwidth": 8268.75, + "quality:monotone": 0.0, + "quality:singsong": 0.36776958333333337, + "quality:flowing": 0.6215745833333334, + "quality:pitchy": 0.010459999999999999 + }, + "expressive -8": { + "wer": 0.0024509803921568627, + "collapse": 0.0, + "identity": 0.9095589841925845, + "durx": 0.8905228758169934, + "female": 0.4999748350237496, + "age": 40.90329216172298, + "f0": 124.69934204446815, + "f0_st": 2.322041034097598, + "voiced": 0.6770598323344658, + "rms_db": -36.41672468185425, + "snr_db": 35.17166566848755, + "bandwidth": 8284.451293945312, + "quality:monotone": 0.0, + "quality:singsong": 0.36038375, + "quality:flowing": 0.5684866666666667, + "quality:pitchy": 0.009339166666666667 + }, + "expressive -4": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9198316548622505, + "durx": 0.9574160407493741, + "female": 0.5021451410284499, + "age": 41.61893812318643, + "f0": 131.6227278699083, + "f0_st": 2.6536665349166566, + "voiced": 0.6566260546724729, + "rms_db": -37.782925526301064, + "snr_db": 36.15418688456217, + "bandwidth": 8347.705078125, + "quality:monotone": 0.0, + "quality:singsong": 0.3541154166666667, + "quality:flowing": 0.5897554166666666, + "quality:pitchy": 0.00089375 + }, + "expressive +4": { + "wer": 0.007006647052413643, + "collapse": 0.0, + "identity": 0.9146935292574007, + "durx": 1.0624778237729153, + "female": 0.49976004928854917, + "age": 42.94119750459989, + "f0": 144.07725586986967, + "f0_st": 3.211393757680168, + "voiced": 0.6142483647808773, + "rms_db": -39.845219453175865, + "snr_db": 41.24538040161133, + "bandwidth": 8412.3046875, + "quality:monotone": 0.0, + "quality:singsong": 0.3426775, + "quality:flowing": 0.5586354166666666, + "quality:pitchy": 0.006111250000000001 + }, + "expressive +8": { + "wer": 0.0036231884057971015, + "collapse": 0.0, + "identity": 0.9068218411241743, + "durx": 1.208006279434851, + "female": 0.5024713736978205, + "age": 44.090866670012474, + "f0": 158.20728042224002, + "f0_st": 4.289244395868862, + "voiced": 0.5822052673391863, + "rms_db": -41.421388467152916, + "snr_db": 44.720975716908775, + "bandwidth": 8191.1407470703125, + "quality:monotone": 0.0, + "quality:singsong": 0.35355541666666673, + "quality:flowing": 0.4824170833333334, + "quality:pitchy": 0.002140833333333333 + }, + "expressive +16": { + "wer": 0.02696078431372549, + "collapse": 0.0, + "identity": 0.8311071968710754, + "durx": 1.4966179653679657, + "female": 0.5272833803901449, + "age": 44.315907483299576, + "f0": 255.03751779988124, + "f0_st": 6.140062976123114, + "voiced": 0.5312244382125172, + "rms_db": -41.527235666910805, + "snr_db": 50.200567404429115, + "bandwidth": 8424.86572265625, + "quality:monotone": 0.0, + "quality:singsong": 0.41780833333333334, + "quality:flowing": 0.36237500000000006, + "quality:pitchy": 0.019572083333333334 + } + }, + "American Female": { + "neutral": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.950361505518176, + "durx": 1.0, + "female": 0.9827781617641449, + "age": 29.750093817710876, + "f0": 155.81481265779422, + "f0_st": 1.8082626788764102, + "voiced": 0.678813494199399, + "rms_db": -29.80318832397461, + "snr_db": 38.62734889984131, + "bandwidth": 6026.605224609375, + "quality:monotone": 0.0, + "quality:singsong": 0.1593025, + "quality:flowing": 0.0149075, + "quality:pitchy": 0.0 + }, + "expressive -16": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9005941623634117, + "durx": 0.8252380952380952, + "female": 0.9845078736543655, + "age": 31.33902996778488, + "f0": 136.24125541508215, + "f0_st": 2.8342736835828255, + "voiced": 0.7093316674200013, + "rms_db": -30.39233112335205, + "snr_db": 34.14218997955322, + "bandwidth": 6180.029296875, + "quality:monotone": 0.0, + "quality:singsong": 0.19834999999999997, + "quality:flowing": 0.0600175, + "quality:pitchy": 3.75e-05 + }, + "expressive -8": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9269051631694818, + "durx": 0.899203431372549, + "female": 0.9851872473955154, + "age": 31.616268306970596, + "f0": 143.08577524213746, + "f0_st": 1.876729323396234, + "voiced": 0.69872984947755, + "rms_db": -30.45998191833496, + "snr_db": 35.70639944076538, + "bandwidth": 5943.1640625, + "quality:monotone": 0.0, + "quality:singsong": 0.1003725, + "quality:flowing": 0.035405, + "quality:pitchy": 0.0 + }, + "expressive -4": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9286696429366527, + "durx": 0.9505952380952382, + "female": 0.9822354018688202, + "age": 29.82613518834114, + "f0": 151.60313542441565, + "f0_st": 1.8241427285782685, + "voiced": 0.6987052326392678, + "rms_db": -30.451812267303467, + "snr_db": 35.19464683532715, + "bandwidth": 6433.04443359375, + "quality:monotone": 0.0, + "quality:singsong": 0.3001625, + "quality:flowing": 0.01032, + "quality:pitchy": 0.0 + }, + "expressive +4": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9379347572936229, + "durx": 1.1480357142857143, + "female": 0.9869286268949509, + "age": 31.36008158326149, + "f0": 164.35145144575813, + "f0_st": 2.1935350829066387, + "voiced": 0.7030342962496541, + "rms_db": -30.76860761642456, + "snr_db": 49.41349792480469, + "bandwidth": 5881.256103515625, + "quality:monotone": 0.0, + "quality:singsong": 0.2100325, + "quality:flowing": 0.013890000000000001, + "quality:pitchy": 0.0 + }, + "expressive +8": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9308989466598804, + "durx": 1.2196078431372548, + "female": 0.9850094765424728, + "age": 30.686672031879425, + "f0": 172.67856042204806, + "f0_st": 2.7688754726771525, + "voiced": 0.6799812054049054, + "rms_db": -29.427157402038574, + "snr_db": 53.02602291107178, + "bandwidth": 6091.204833984375, + "quality:monotone": 0.0, + "quality:singsong": 0.2046725, + "quality:flowing": 0.0052425, + "quality:pitchy": 0.0 + }, + "expressive +16": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.8935686830449875, + "durx": 1.678487394957983, + "female": 0.9823122173547745, + "age": 34.229881316423416, + "f0": 220.51543220734976, + "f0_st": 5.2184215814187125, + "voiced": 0.6168972624980888, + "rms_db": -30.517505645751953, + "snr_db": 65.79354190826416, + "bandwidth": 5945.855712890625, + "quality:monotone": 0.0, + "quality:singsong": 0.115195, + "quality:flowing": 0.00015, + "quality:pitchy": 0.0 + } + }, + "American Male": { + "neutral": { + "wer": 0.007352941176470588, + "collapse": 0.0, + "identity": 0.944281897024579, + "durx": 1.0, + "female": 0.0021247467666398734, + "age": 48.121464252471924, + "f0": 116.91828356269122, + "f0_st": 4.913690931254914, + "voiced": 0.4680676167050811, + "rms_db": -43.39509105682373, + "snr_db": 39.194278717041016, + "bandwidth": 8204.150390625, + "quality:monotone": 0.0, + "quality:singsong": 0.9347175, + "quality:flowing": 0.9711599999999999, + "quality:pitchy": 0.0 + }, + "expressive -16": { + "wer": 0.014705882352941176, + "collapse": 0.0, + "identity": 0.9042486281597988, + "durx": 0.8087463939155521, + "female": 0.0023619926359970123, + "age": 43.91719177365303, + "f0": 92.5321211663024, + "f0_st": 2.1961113614884376, + "voiced": 0.6702153267813374, + "rms_db": -39.85066890716553, + "snr_db": 25.674872875213623, + "bandwidth": 8505.615234375, + "quality:monotone": 0.0, + "quality:singsong": 0.8333200000000001, + "quality:flowing": 0.8618925, + "quality:pitchy": 3.2500000000000004e-05 + }, + "expressive -8": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9204858074207316, + "durx": 0.9327956989247311, + "female": 0.002243917668238282, + "age": 47.40673080086708, + "f0": 101.47836093848143, + "f0_st": 2.873574209026771, + "voiced": 0.6249111372012641, + "rms_db": -39.16932678222656, + "snr_db": 34.92537593841553, + "bandwidth": 8220.30029296875, + "quality:monotone": 0.0, + "quality:singsong": 0.903065, + "quality:flowing": 0.8683025, + "quality:pitchy": 2.5e-05 + }, + "expressive -4": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9156363790913199, + "durx": 0.982538802660754, + "female": 0.002035815588897094, + "age": 46.21187597513199, + "f0": 105.5745193579022, + "f0_st": 3.863894795100029, + "voiced": 0.5614454684840106, + "rms_db": -44.47824764251709, + "snr_db": 36.118178367614746, + "bandwidth": 7913.4521484375, + "quality:monotone": 0.0, + "quality:singsong": 0.8372149999999999, + "quality:flowing": 0.881035, + "quality:pitchy": 1e-05 + }, + "expressive +4": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.8982009878615714, + "durx": 1.0706762749445677, + "female": 0.002676320436876267, + "age": 50.55994316935539, + "f0": 105.9457820998613, + "f0_st": 5.719592142662998, + "voiced": 0.35280163320240865, + "rms_db": -51.064645767211914, + "snr_db": 30.741907119750977, + "bandwidth": 8091.10107421875, + "quality:monotone": 0.0, + "quality:singsong": 0.9800599999999999, + "quality:flowing": 0.9506724999999999, + "quality:pitchy": 0.0 + }, + "expressive +8": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.8903376663631678, + "durx": 1.227303274682307, + "female": 0.0032067373977042735, + "age": 52.176204323768616, + "f0": 123.20422131658259, + "f0_st": 6.839282866314185, + "voiced": 0.3471498366416642, + "rms_db": -51.00687789916992, + "snr_db": 34.41105270385742, + "bandwidth": 8365.6494140625, + "quality:monotone": 0.0, + "quality:singsong": 0.9685375, + "quality:flowing": 0.9082325, + "quality:pitchy": 0.0 + }, + "expressive +16": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.8179048224505078, + "durx": 1.5329129711751666, + "female": 0.011860465572681278, + "age": 50.50068274140358, + "f0": 287.3990819147367, + "f0_st": 10.472254549617022, + "voiced": 0.2554234593413744, + "rms_db": -54.867733001708984, + "snr_db": 34.55759620666504, + "bandwidth": 8613.28125, + "quality:monotone": 0.0, + "quality:singsong": 0.9540225, + "quality:flowing": 0.9104175, + "quality:pitchy": 0.0 + } + }, + "British Female": { + "neutral": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9646508989039382, + "durx": 1.0, + "female": 0.9985478520393372, + "age": 48.11074435710907, + "f0": 145.18670227011933, + "f0_st": 3.120616918031748, + "voiced": 0.684659116272671, + "rms_db": -34.987064361572266, + "snr_db": 43.8385124206543, + "bandwidth": 9003.570556640625, + "quality:monotone": 0.0, + "quality:singsong": 0.5825724999999999, + "quality:flowing": 0.6609849999999999, + "quality:pitchy": 0.0 + }, + "expressive -16": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9189128156894969, + "durx": 0.8223854796888503, + "female": 0.990736186504364, + "age": 40.19014909863472, + "f0": 123.85106034233078, + "f0_st": 1.9311970103076115, + "voiced": 0.6911481239279849, + "rms_db": -36.571858406066895, + "snr_db": 32.012388706207275, + "bandwidth": 9628.033447265625, + "quality:monotone": 0.0, + "quality:singsong": 0.5529125, + "quality:flowing": 0.8803475, + "quality:pitchy": 0.0 + }, + "expressive -8": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9295347244382939, + "durx": 0.8929343128781331, + "female": 0.9975371956825256, + "age": 43.955472111701965, + "f0": 131.01423939696957, + "f0_st": 2.461263882668264, + "voiced": 0.6632073775298506, + "rms_db": -34.98388910293579, + "snr_db": 39.07312488555908, + "bandwidth": 9767.999267578125, + "quality:monotone": 0.0, + "quality:singsong": 0.6683600000000001, + "quality:flowing": 0.665235, + "quality:pitchy": 2.5e-06 + }, + "expressive -4": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9399177836831056, + "durx": 0.9731525496974935, + "female": 0.9983135014772415, + "age": 45.853087306022644, + "f0": 139.1473738029959, + "f0_st": 2.8941920008552158, + "voiced": 0.6612327763753295, + "rms_db": -36.446455001831055, + "snr_db": 38.71109580993652, + "bandwidth": 9278.118896484375, + "quality:monotone": 0.0, + "quality:singsong": 0.512, + "quality:flowing": 0.6925825, + "quality:pitchy": 0.0 + }, + "expressive +4": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9474284492544232, + "durx": 1.0359493814549994, + "female": 0.9988504499197006, + "age": 49.911099672317505, + "f0": 155.8160795712365, + "f0_st": 3.3721199338533743, + "voiced": 0.6671636201409603, + "rms_db": -34.84534406661987, + "snr_db": 50.3970308303833, + "bandwidth": 9342.718505859375, + "quality:monotone": 0.0, + "quality:singsong": 0.3718, + "quality:flowing": 0.495535, + "quality:pitchy": 0.0 + }, + "expressive +8": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9402437804585906, + "durx": 1.0894554883318928, + "female": 0.9991094917058945, + "age": 50.580520927906036, + "f0": 175.9759737845986, + "f0_st": 4.685075090050713, + "voiced": 0.6723720380540903, + "rms_db": -37.52516555786133, + "snr_db": 49.36676216125488, + "bandwidth": 9248.5107421875, + "quality:monotone": 0.0, + "quality:singsong": 0.2885525, + "quality:flowing": 0.3680675, + "quality:pitchy": 2.5e-06 + }, + "expressive +16": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9134054532851713, + "durx": 1.235382672882673, + "female": 0.9991268068552017, + "age": 52.41209492087364, + "f0": 241.73654793822632, + "f0_st": 7.096899942065771, + "voiced": 0.6125412345367802, + "rms_db": -34.09582805633545, + "snr_db": 56.482319831848145, + "bandwidth": 9687.249755859375, + "quality:monotone": 0.0, + "quality:singsong": 0.4670375, + "quality:flowing": 0.12597999999999998, + "quality:pitchy": 0.0 + } + }, + "British Male": { + "neutral": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9536403536976914, + "durx": 1.0, + "female": 0.005018519994337112, + "age": 19.837047532200813, + "f0": 88.88241321026631, + "f0_st": 2.4990147456627976, + "voiced": 0.5315726962367779, + "rms_db": -39.36486530303955, + "snr_db": 35.08437442779541, + "bandwidth": 11011.541748046875, + "quality:monotone": 0.0, + "quality:singsong": 0.299145, + "quality:flowing": 0.6694425, + "quality:pitchy": 1.75e-05 + }, + "expressive -16": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9115664286914515, + "durx": 0.8421994671994673, + "female": 0.01024011883419007, + "age": 21.7531256377697, + "f0": 88.10405598230966, + "f0_st": 1.6242263207470573, + "voiced": 0.6892023936012662, + "rms_db": -35.51410102844238, + "snr_db": 21.711881160736084, + "bandwidth": 10742.376708984375, + "quality:monotone": 0.0, + "quality:singsong": 0.4949175, + "quality:flowing": 0.6254675000000001, + "quality:pitchy": 1.7500000000000002e-05 + }, + "expressive -8": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9150486527964726, + "durx": 0.8785797535797536, + "female": 0.013784028822556138, + "age": 22.128567472100258, + "f0": 90.06395971671905, + "f0_st": 1.9296674203632356, + "voiced": 0.6507997590787006, + "rms_db": -35.49430465698242, + "snr_db": 25.518950939178467, + "bandwidth": 10322.479248046875, + "quality:monotone": 0.0, + "quality:singsong": 0.4058475, + "quality:flowing": 0.6510125, + "quality:pitchy": 2.5e-06 + }, + "expressive -4": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9251217614267202, + "durx": 0.922077922077922, + "female": 0.028482908848673105, + "age": 23.321756720542908, + "f0": 88.45680731098707, + "f0_st": 1.9748903505282254, + "voiced": 0.5869325464598906, + "rms_db": -39.11588382720947, + "snr_db": 31.51536273956299, + "bandwidth": 11493.34716796875, + "quality:monotone": 0.0, + "quality:singsong": 0.40431249999999996, + "quality:flowing": 0.6882375, + "quality:pitchy": 2.5e-06 + }, + "expressive +4": { + "wer": 0.013157894736842105, + "collapse": 0.0, + "identity": 0.9188230044069838, + "durx": 0.9936729936729938, + "female": 0.008484005054924637, + "age": 22.009923309087753, + "f0": 88.8619096882068, + "f0_st": 1.9772136564866383, + "voiced": 0.5581343972963417, + "rms_db": -41.28389930725098, + "snr_db": 28.90705108642578, + "bandwidth": 11679.071044921875, + "quality:monotone": 0.0, + "quality:singsong": 0.39264499999999997, + "quality:flowing": 0.64104, + "quality:pitchy": 1.5e-05 + }, + "expressive +8": { + "wer": 0.021739130434782608, + "collapse": 0.0, + "identity": 0.920990394226868, + "durx": 1.286879786879787, + "female": 0.025220616720616817, + "age": 24.313052743673325, + "f0": 91.3514385497003, + "f0_st": 3.550301916156551, + "voiced": 0.44935055275884067, + "rms_db": -47.848960876464844, + "snr_db": 35.770042419433594, + "bandwidth": 10992.7001953125, + "quality:monotone": 0.0, + "quality:singsong": 0.51024, + "quality:flowing": 0.6736975000000001, + "quality:pitchy": 2.5e-06 + }, + "expressive +16": { + "wer": 0.10294117647058823, + "collapse": 0.0, + "identity": 0.8726639882819258, + "durx": 1.5108225108225108, + "female": 0.2396421194425784, + "age": 33.720140904188156, + "f0": 141.66783645780973, + "f0_st": 5.493322441734618, + "voiced": 0.3966681456472714, + "rms_db": -52.95099353790283, + "snr_db": 39.037692070007324, + "bandwidth": 11636.004638671875, + "quality:monotone": 0.0, + "quality:singsong": 0.29148250000000003, + "quality:flowing": 0.6758475, + "quality:pitchy": 5e-06 + } + }, + "Obama": { + "neutral": { + "wer": 0.014705882352941176, + "collapse": 0.0, + "identity": 0.9387460296541414, + "durx": 1.0, + "female": 0.0035154334036633372, + "age": 53.74961122870445, + "f0": 123.7537390161196, + "f0_st": 2.7043656138649546, + "voiced": 0.6549097443442305, + "rms_db": -41.428171157836914, + "snr_db": 50.819594383239746, + "bandwidth": 7555.462646484375, + "quality:monotone": 0.0, + "quality:singsong": 0.00885, + "quality:flowing": 0.40512000000000004, + "quality:pitchy": 0.0003325 + }, + "expressive -16": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9101157282728963, + "durx": 0.835899935022742, + "female": 0.0032671066001057625, + "age": 48.94718751311302, + "f0": 103.24281804303985, + "f0_st": 2.4281907403302814, + "voiced": 0.7267316542401195, + "rms_db": -36.74622440338135, + "snr_db": 38.016029357910156, + "bandwidth": 7294.37255859375, + "quality:monotone": 0.0, + "quality:singsong": 0.029527499999999998, + "quality:flowing": 0.44283, + "quality:pitchy": 0.0001975 + }, + "expressive -8": { + "wer": 0.014705882352941176, + "collapse": 0.0, + "identity": 0.9121117063433593, + "durx": 0.9228395061728395, + "female": 0.0033041530987247825, + "age": 50.13487860560417, + "f0": 111.84358802788465, + "f0_st": 2.842224880929283, + "voiced": 0.6811050612843264, + "rms_db": -40.54447269439697, + "snr_db": 45.15526008605957, + "bandwidth": 7749.261474609375, + "quality:monotone": 0.0, + "quality:singsong": 0.0055049999999999995, + "quality:flowing": 0.371245, + "quality:pitchy": 0.000125 + }, + "expressive -4": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9225476860684928, + "durx": 1.052982456140351, + "female": 0.0033248504623770714, + "age": 53.66176813840866, + "f0": 122.49477233763525, + "f0_st": 3.056486884700316, + "voiced": 0.6731507138956065, + "rms_db": -38.30360698699951, + "snr_db": 50.713138580322266, + "bandwidth": 7262.07275390625, + "quality:monotone": 0.0, + "quality:singsong": 0.00446, + "quality:flowing": 0.38270499999999996, + "quality:pitchy": 0.0001025 + }, + "expressive +4": { + "wer": 0.021739130434782608, + "collapse": 0.0, + "identity": 0.9141293027322176, + "durx": 1.0717024041585446, + "female": 0.00367445225128904, + "age": 54.893431067466736, + "f0": 139.9652009391605, + "f0_st": 3.1895188008375612, + "voiced": 0.6311058701928431, + "rms_db": -38.82693099975586, + "snr_db": 51.77689266204834, + "bandwidth": 7372.430419921875, + "quality:monotone": 0.0, + "quality:singsong": 0.023045, + "quality:flowing": 0.4102825, + "quality:pitchy": 0.000495 + }, + "expressive +8": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9150339627933526, + "durx": 1.1612085769980505, + "female": 0.004245326621457934, + "age": 55.7056188583374, + "f0": 147.21947818182755, + "f0_st": 3.5916033205058513, + "voiced": 0.6264312999142718, + "rms_db": -40.04600143432617, + "snr_db": 53.77745819091797, + "bandwidth": 7655.0537109375, + "quality:monotone": 0.0, + "quality:singsong": 0.019872500000000005, + "quality:flowing": 0.39243000000000006, + "quality:pitchy": 0.00028 + }, + "expressive +16": { + "wer": 0.007352941176470588, + "collapse": 0.0, + "identity": 0.830000640385334, + "durx": 1.376140350877193, + "female": 0.006264943047426641, + "age": 56.65331333875656, + "f0": 228.9531875404295, + "f0_st": 4.310943728726694, + "voiced": 0.583840078892067, + "rms_db": -38.19476652145386, + "snr_db": 58.281229972839355, + "bandwidth": 7283.60595703125, + "quality:monotone": 0.0, + "quality:singsong": 0.07561, + "quality:flowing": 0.36730999999999997, + "quality:pitchy": 0.0060875 + } + }, + "Scottish Female": { + "neutral": { + "wer": 0.007142857142857143, + "collapse": 0.0, + "identity": 0.9266934661136247, + "durx": 1.0, + "female": 0.997859537601471, + "age": 48.33717122673988, + "f0": 186.62951681175997, + "f0_st": 2.372338315695629, + "voiced": 0.7664984735799911, + "rms_db": -39.992154121398926, + "snr_db": 31.38053846359253, + "bandwidth": 7999.5849609375, + "quality:monotone": 0.0, + "quality:singsong": 0.060945, + "quality:flowing": 0.8752574999999999, + "quality:pitchy": 0.032655 + }, + "expressive -16": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.8443104226884015, + "durx": 0.8224141353980545, + "female": 0.9980294704437256, + "age": 49.183475226163864, + "f0": 162.97996777251353, + "f0_st": 2.1234754281627004, + "voiced": 0.7756782198589613, + "rms_db": -33.08517408370972, + "snr_db": 24.31144905090332, + "bandwidth": 7262.07275390625, + "quality:monotone": 0.0, + "quality:singsong": 0.09759, + "quality:flowing": 0.8588925000000001, + "quality:pitchy": 0.062475 + }, + "expressive -8": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.8532678509871684, + "durx": 0.9021242803255907, + "female": 0.9977924674749374, + "age": 50.177835673093796, + "f0": 170.71012894461683, + "f0_st": 1.9487864882018013, + "voiced": 0.7436058094351032, + "rms_db": -37.84837293624878, + "snr_db": 30.650882720947266, + "bandwidth": 7703.50341796875, + "quality:monotone": 0.0, + "quality:singsong": 0.0791525, + "quality:flowing": 0.81972, + "quality:pitchy": 0.05588 + }, + "expressive -4": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.8870966759672119, + "durx": 0.9007727432384968, + "female": 0.9984783679246902, + "age": 50.839005410671234, + "f0": 182.45975898551364, + "f0_st": 2.308392449737883, + "voiced": 0.7582895901807325, + "rms_db": -37.9015474319458, + "snr_db": 24.672698974609375, + "bandwidth": 7706.195068359375, + "quality:monotone": 0.0, + "quality:singsong": 0.0665425, + "quality:flowing": 0.8836525000000001, + "quality:pitchy": 0.0052475 + }, + "expressive +4": { + "wer": 0.007142857142857143, + "collapse": 0.0, + "identity": 0.8716446739955849, + "durx": 0.9871794871794871, + "female": 0.9979464411735535, + "age": 48.91270622611046, + "f0": 209.52311147499483, + "f0_st": 2.816382929333797, + "voiced": 0.7732503716030554, + "rms_db": -42.28188896179199, + "snr_db": 36.23590278625488, + "bandwidth": 8107.2509765625, + "quality:monotone": 0.0, + "quality:singsong": 0.0784825, + "quality:flowing": 0.8403925000000001, + "quality:pitchy": 0.0361575 + }, + "expressive +8": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.8434262962431868, + "durx": 1.1711355311355311, + "female": 0.9980365931987762, + "age": 51.08313113451004, + "f0": 238.81401027868282, + "f0_st": 4.300327709508723, + "voiced": 0.7179466712613457, + "rms_db": -42.67416763305664, + "snr_db": 41.97451591491699, + "bandwidth": 6793.7255859375, + "quality:monotone": 0.0, + "quality:singsong": 0.1294575, + "quality:flowing": 0.5468325, + "quality:pitchy": 0.01256 + }, + "expressive +16": { + "wer": 0.051470588235294115, + "collapse": 0.0, + "identity": 0.6590995937785263, + "durx": 1.7160168598524763, + "female": 0.9244937300682068, + "age": 38.379331678152084, + "f0": 409.9530207407354, + "f0_st": 4.248535613175871, + "voiced": 0.7219764483595209, + "rms_db": -38.53658723831177, + "snr_db": 47.051024436950684, + "bandwidth": 7383.197021484375, + "quality:monotone": 0.0, + "quality:singsong": 0.6035025, + "quality:flowing": 0.094545, + "quality:pitchy": 0.11134 + } + } +} diff --git a/steering/expressive_mect60k/expressive.npy b/steering/expressive_mect60k/expressive.npy new file mode 100644 index 0000000000000000000000000000000000000000..6ae979fd09bebbb33ecbfe3d76892ea3b9237869 --- /dev/null +++ b/steering/expressive_mect60k/expressive.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:23ab4de3134989ded2f87ac93df53ed76db4b0ee282d98c0e1cd1b6507ab5235 +size 4224 diff --git a/steering/expressive_mect60k/manifest.json b/steering/expressive_mect60k/manifest.json new file mode 100644 index 0000000000000000000000000000000000000000..82adc098fdc9369c050eba2993d626670b1d6a70 --- /dev/null +++ b/steering/expressive_mect60k/manifest.json @@ -0,0 +1,40 @@ +{ + "dim": 1024, + "space": "attnres_source", + "checkpoint": "/data/groups/audio/gabriel/hf_release_zonos3mini_20261020/lm/mect_60k", + "corpus": "/data/groups/audio/sofian/bingua2-gdn-emotion/minisgl/speaker_corpus_libritts_ears/clips.json", + "spec": { + "space": "attnres_source", + "source_index": 19, + "group_by": "clip", + "center": "speaker", + "directions": { + "expressive": { + "regress": "f0_st", + "within": "corpus", + "filter": { + "corpus": "libritts_r" + }, + "kind": "axis", + "poles": { + "+": "lively intonation", + "-": "flat" + } + } + } + }, + "directions": { + "expressive": { + "file": "expressive.npy", + "kind": "axis", + "norm": 0.0040849415994502185, + "poles": { + "+": "lively intonation", + "-": "flat" + } + } + }, + "source_index": 19, + "source_name": "L9.attn", + "prompt_conditioning": "speaker_row=no,condition_rows=3:unknown" +} diff --git a/steering/expressive_mect60k/report.json b/steering/expressive_mect60k/report.json new file mode 100644 index 0000000000000000000000000000000000000000..17c1f5188a0fb8c60c137ebd92706492ebdbbec7 --- /dev/null +++ b/steering/expressive_mect60k/report.json @@ -0,0 +1,26 @@ +{ + "expressive": { + "norm": 0.0040849415994502185, + "removed_share": 0.0, + "pairs": [ + { + "pair": [ + { + "corpus": "libritts_r" + }, + "f0_st P10-P90 2.1" + ], + "train_speakers": [ + 5169, + 0 + ], + "held_out_speakers": [ + 1306, + 0 + ], + "cos_with_direction": 1.0000000000000002, + "held_out_auc": 0.4686700557481454 + } + ] + } +} diff --git a/steering/expressive_mect60k/spec.json b/steering/expressive_mect60k/spec.json new file mode 100644 index 0000000000000000000000000000000000000000..5c116073af4fe8d14b340c952f4ee9fc953795cd --- /dev/null +++ b/steering/expressive_mect60k/spec.json @@ -0,0 +1,20 @@ +{ + "space": "attnres_source", + "source_index": 19, + "group_by": "clip", + "center": "speaker", + "directions": { + "expressive": { + "regress": "f0_st", + "within": "corpus", + "filter": { + "corpus": "libritts_r" + }, + "kind": "axis", + "poles": { + "+": "lively intonation", + "-": "flat" + } + } + } +} \ No newline at end of file diff --git a/steering/hidden_attributes_mect60k/age.npy b/steering/hidden_attributes_mect60k/age.npy new file mode 100644 index 0000000000000000000000000000000000000000..8b29c2276304285d8717d0ee2990c54f6e9d855f --- /dev/null +++ b/steering/hidden_attributes_mect60k/age.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d4d59f9c7c963581e7c0ffc156320916205d994f4453b4cd9f7f455109925364 +size 4224 diff --git a/steering/hidden_attributes_mect60k/bank.npz b/steering/hidden_attributes_mect60k/bank.npz new file mode 100644 index 0000000000000000000000000000000000000000..3cb5cd2f9e26fc6f7d98b87077a1d8799730063a --- /dev/null +++ b/steering/hidden_attributes_mect60k/bank.npz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:578fb90d18c7cd3ec42911db5d7b5edc9db2e37daed29a02f12dd862203e4730 +size 188920 diff --git a/steering/hidden_attributes_mect60k/gender.npy b/steering/hidden_attributes_mect60k/gender.npy new file mode 100644 index 0000000000000000000000000000000000000000..097b21c8ddce753a466900fff17409beb21b53d0 --- /dev/null +++ b/steering/hidden_attributes_mect60k/gender.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9248291bc894642c56d288bab2642b4aaac8157c576d7a8230e373d43937d3d1 +size 4224 diff --git a/steering/hidden_attributes_mect60k/manifest.json b/steering/hidden_attributes_mect60k/manifest.json new file mode 100644 index 0000000000000000000000000000000000000000..29eec465af9c1f8dc156f1abf60efd8c3f622185 --- /dev/null +++ b/steering/hidden_attributes_mect60k/manifest.json @@ -0,0 +1,80 @@ +{ + "dim": 1024, + "space": "attnres_source", + "source_index": 19, + "source_name": "L9.attn", + "prompt_conditioning": "speaker_row=no,condition_rows=3:unknown", + "cosines_with_emotion_axes": { + "valence": { + "gender": 0.3333434885022961, + "age": 0.028904903135182545 + }, + "arousal": { + "gender": 0.2682256299648177, + "age": 0.11110420256606866 + }, + "dominance": { + "gender": -0.07288586985791787, + "age": 0.1374217278819063 + }, + "loudness": { + "gender": -0.0858001003491795, + "age": -0.12050357237243656 + }, + "tempo": { + "gender": 0.3444991753770675, + "age": 0.16759401695238177 + }, + "clarity": { + "gender": 0.036435301497266696, + "age": 0.1808654964303496 + }, + "articulation": { + "gender": -0.03336615820242795, + "age": -0.043437830029046685 + } + }, + "corpus": "/data/groups/audio/sofian/bingua2-gdn-emotion/minisgl/speaker_corpus_libritts_ears/clips.json", + "labeller": "audeering/wav2vec2-large-robust-24-ft-age-gender", + "train_speakers": 850, + "age_gap_years": 27.869893920918308, + "checkpoint": "/data/groups/audio/gabriel/hf_release_zonos3mini_20261020/lm/mect_60k", + "checks": { + "gender_norm": 0.031420507450612485, + "age_norm": 0.009044028784692544, + "cos_age_gender": -0.6187958988497088, + "held_out": { + "n": 218, + "gender_auc": 1.0, + "age_spearman_female": 0.7298529852985298, + "age_spearman_male": 0.6038989259328242 + }, + "ears": { + "n": 99, + "gender_auc": 1.0, + "age_spearman_female": 0.09931647300068354, + "age_spearman_male": 0.5385080036242826 + } + }, + "directions": { + "gender": { + "file": "gender.npy", + "kind": "axis", + "norm": 0.031420507450612485, + "poles": { + "+": "female", + "-": "male" + } + }, + "age": { + "file": "age.npy", + "kind": "axis", + "norm": 0.009044028784692544, + "poles": { + "+": "older", + "-": "younger" + }, + "years_per_dose": 27.869893920918308 + } + } +} diff --git a/steering/hidden_attributes_mect60k/report.json b/steering/hidden_attributes_mect60k/report.json new file mode 100644 index 0000000000000000000000000000000000000000..f88bc51e8692a61f3dae25467d0081a60761a006 --- /dev/null +++ b/steering/hidden_attributes_mect60k/report.json @@ -0,0 +1,410 @@ +{ + "emb": { + "gender_norm": 1.9442397226456662, + "age_norm": 0.6478588309219074, + "cos_age_gender": -0.6172022869398367, + "held_out": { + "n": 218, + "gender_auc": 0.9999152542372881, + "age_spearman_female": 0.7045544554455444, + "age_spearman_male": 0.4656177986187956 + }, + "ears": { + "n": 99, + "gender_auc": 0.9987541528239202, + "age_spearman_female": 0.2688995215311005, + "age_spearman_male": 0.44699486559951673 + } + }, + "L0.attn": { + "gender_norm": 0.05769759457863937, + "age_norm": 0.013753704289664413, + "cos_age_gender": -0.6531037236737948, + "held_out": { + "n": 218, + "gender_auc": 0.9999152542372881, + "age_spearman_female": 0.6743114311431143, + "age_spearman_male": 0.43863647153776764 + }, + "ears": { + "n": 99, + "gender_auc": 0.9995847176079734, + "age_spearman_female": 0.1525632262474368, + "age_spearman_male": 0.48927816369676835 + } + }, + "L0.ffn": { + "gender_norm": 0.04964405537121398, + "age_norm": 0.012859791351890285, + "cos_age_gender": -0.5654928540511042, + "held_out": { + "n": 218, + "gender_auc": 1.0, + "age_spearman_female": 0.6084128412841282, + "age_spearman_male": 0.504168812244585 + }, + "ears": { + "n": 99, + "gender_auc": 1.0, + "age_spearman_female": 0.3209842788790157, + "age_spearman_male": 0.3498942917547569 + } + }, + "L1.attn": { + "gender_norm": 0.056755717714755474, + "age_norm": 0.014415598194727737, + "cos_age_gender": -0.5139677337068287, + "held_out": { + "n": 218, + "gender_auc": 1.0, + "age_spearman_female": 0.5565796579657966, + "age_spearman_male": 0.5238825647599327 + }, + "ears": { + "n": 99, + "gender_auc": 1.0, + "age_spearman_female": 0.3005468215994532, + "age_spearman_male": 0.3921775898520084 + } + }, + "L1.ffn": { + "gender_norm": 0.19358489234776693, + "age_norm": 0.03850617414562324, + "cos_age_gender": -0.4220080300627343, + "held_out": { + "n": 218, + "gender_auc": 0.9984745762711864, + "age_spearman_female": 0.4835163516351635, + "age_spearman_male": 0.2554497679123801 + }, + "ears": { + "n": 99, + "gender_auc": 0.9954318936877077, + "age_spearman_female": 0.31367053998632954, + "age_spearman_male": 0.27469042585321657 + } + }, + "L2.attn": { + "gender_norm": 0.039878253083404966, + "age_norm": 0.00817551378484557, + "cos_age_gender": -0.5581811433166836, + "held_out": { + "n": 218, + "gender_auc": 0.9969491525423729, + "age_spearman_female": 0.6074887488748875, + "age_spearman_male": 0.4816356790434558 + }, + "ears": { + "n": 99, + "gender_auc": 0.9908637873754153, + "age_spearman_female": 0.24969241285030763, + "age_spearman_male": 0.28903654485049834 + } + }, + "L2.ffn": { + "gender_norm": 0.04066410929098142, + "age_norm": 0.012486810394310656, + "cos_age_gender": -0.6371392968382179, + "held_out": { + "n": 218, + "gender_auc": 0.9996610169491525, + "age_spearman_female": 0.6102730273027301, + "age_spearman_male": 0.5421062818869399 + }, + "ears": { + "n": 99, + "gender_auc": 1.0, + "age_spearman_female": 0.012440191387559809, + "age_spearman_male": 0.5450015101177892 + } + }, + "L3.attn": { + "gender_norm": 0.0817004657580971, + "age_norm": 0.026833417250830584, + "cos_age_gender": -0.4942248068905884, + "held_out": { + "n": 218, + "gender_auc": 1.0, + "age_spearman_female": 0.8037323732373236, + "age_spearman_male": 0.6283165156545018 + }, + "ears": { + "n": 99, + "gender_auc": 1.0, + "age_spearman_female": 0.4215994531784006, + "age_spearman_male": 0.626698882512836 + } + }, + "L3.ffn": { + "gender_norm": 0.02188530121647111, + "age_norm": 0.013449045237649103, + "cos_age_gender": -0.1773247017089892, + "held_out": { + "n": 218, + "gender_auc": 0.9997457627118644, + "age_spearman_female": 0.722124212421242, + "age_spearman_male": 0.7353142039084213 + }, + "ears": { + "n": 99, + "gender_auc": 0.9995847176079734, + "age_spearman_female": 0.5336978810663022, + "age_spearman_male": 0.6535789791603744 + } + }, + "L4.attn": { + "gender_norm": 0.0852170270641935, + "age_norm": 0.02448517549812161, + "cos_age_gender": -0.5846551288931808, + "held_out": { + "n": 218, + "gender_auc": 1.0, + "age_spearman_female": 0.7636963696369635, + "age_spearman_male": 0.5457364171222596 + }, + "ears": { + "n": 99, + "gender_auc": 1.0, + "age_spearman_female": 0.348257006151743, + "age_spearman_male": 0.6227725762609484 + } + }, + "L4.ffn": { + "gender_norm": 0.062220928218118025, + "age_norm": 0.01639493496529516, + "cos_age_gender": -0.5785743053857367, + "held_out": { + "n": 218, + "gender_auc": 0.9997457627118644, + "age_spearman_female": 0.3838943894389439, + "age_spearman_male": 0.36317786567038807 + }, + "ears": { + "n": 99, + "gender_auc": 0.9941860465116279, + "age_spearman_female": 0.09706083390293918, + "age_spearman_male": 0.3657505285412262 + } + }, + "L5.attn": { + "gender_norm": 0.039981915877810324, + "age_norm": 0.011120098040139898, + "cos_age_gender": -0.4614205030711731, + "held_out": { + "n": 218, + "gender_auc": 0.9995762711864407, + "age_spearman_female": 0.5956795679567957, + "age_spearman_male": 0.3823657233427921 + }, + "ears": { + "n": 99, + "gender_auc": 0.9975083056478405, + "age_spearman_female": 0.3492139439507861, + "age_spearman_male": 0.4510721836303232 + } + }, + "L5.ffn": { + "gender_norm": 0.0327712228429931, + "age_norm": 0.010371210230402992, + "cos_age_gender": -0.49776828316068156, + "held_out": { + "n": 218, + "gender_auc": 0.9947457627118644, + "age_spearman_female": 0.37528952895289525, + "age_spearman_male": 0.1110112884788857 + }, + "ears": { + "n": 99, + "gender_auc": 0.9821428571428571, + "age_spearman_female": 0.37689678742310323, + "age_spearman_male": 0.2873754152823921 + } + }, + "L6.attn": { + "gender_norm": 0.042983456097556265, + "age_norm": 0.013962699735829738, + "cos_age_gender": -0.5236291215432274, + "held_out": { + "n": 218, + "gender_auc": 0.9999152542372881, + "age_spearman_female": 0.7385898589858985, + "age_spearman_male": 0.4466782801777817 + }, + "ears": { + "n": 99, + "gender_auc": 0.9995847176079734, + "age_spearman_female": 0.04429254955570745, + "age_spearman_male": 0.4163394744790094 + } + }, + "L6.ffn": { + "gender_norm": 0.031129745631914046, + "age_norm": 0.01242433612905748, + "cos_age_gender": -0.5897048177295249, + "held_out": { + "n": 218, + "gender_auc": 0.9978813559322034, + "age_spearman_female": 0.7517431743174318, + "age_spearman_male": 0.4689630741475208 + }, + "ears": { + "n": 99, + "gender_auc": 0.992109634551495, + "age_spearman_female": 0.2581681476418319, + "age_spearman_male": 0.47296889157354277 + } + }, + "L7.attn": { + "gender_norm": 0.11168872375545172, + "age_norm": 0.039985313146240556, + "cos_age_gender": -0.5220159837893595, + "held_out": { + "n": 218, + "gender_auc": 1.0, + "age_spearman_female": 0.8787398739873986, + "age_spearman_male": 0.6519452631117636 + }, + "ears": { + "n": 99, + "gender_auc": 1.0, + "age_spearman_female": 0.5609706083390295, + "age_spearman_male": 0.7219873150105709 + } + }, + "L7.ffn": { + "gender_norm": 0.05514661667393825, + "age_norm": 0.018983366268918427, + "cos_age_gender": -0.6204876389854211, + "held_out": { + "n": 218, + "gender_auc": 0.9986440677966102, + "age_spearman_female": 0.6007200720072006, + "age_spearman_male": 0.49472461735672113 + }, + "ears": { + "n": 99, + "gender_auc": 1.0, + "age_spearman_female": 0.041558441558441565, + "age_spearman_male": 0.5114768951978255 + } + }, + "L8.attn": { + "gender_norm": 0.030120329177232206, + "age_norm": 0.009304546130817373, + "cos_age_gender": -0.3219965144960377, + "held_out": { + "n": 218, + "gender_auc": 1.0, + "age_spearman_female": 0.7892709270927092, + "age_spearman_male": 0.44939540353299084 + }, + "ears": { + "n": 99, + "gender_auc": 1.0, + "age_spearman_female": 0.3443609022556391, + "age_spearman_male": 0.46617336152219874 + } + }, + "L8.ffn": { + "gender_norm": 0.033512205165378214, + "age_norm": 0.01718561514224993, + "cos_age_gender": -0.5498456048540582, + "held_out": { + "n": 218, + "gender_auc": 0.9998305084745762, + "age_spearman_female": 0.6393879387938795, + "age_spearman_male": 0.6136133723372008 + }, + "ears": { + "n": 99, + "gender_auc": 1.0, + "age_spearman_female": 0.26233766233766237, + "age_spearman_male": 0.5655391120507399 + } + }, + "L9.attn": { + "gender_norm": 0.031420507450612485, + "age_norm": 0.009044028784692544, + "cos_age_gender": -0.6187958988497088, + "held_out": { + "n": 218, + "gender_auc": 1.0, + "age_spearman_female": 0.7298529852985298, + "age_spearman_male": 0.6038989259328242 + }, + "ears": { + "n": 99, + "gender_auc": 1.0, + "age_spearman_female": 0.09931647300068354, + "age_spearman_male": 0.5385080036242826 + } + }, + "L9.ffn": { + "gender_norm": 0.1504822756448529, + "age_norm": 0.04945183953428105, + "cos_age_gender": -0.20042000791303352, + "held_out": { + "n": 218, + "gender_auc": 0.9994915254237288, + "age_spearman_female": 0.5640804080408041, + "age_spearman_male": 0.341272884642775 + }, + "ears": { + "n": 99, + "gender_auc": 0.9904485049833887, + "age_spearman_female": 0.3292549555707451, + "age_spearman_male": 0.3346421020839625 + } + }, + "L10.attn": { + "gender_norm": 0.014318056959327126, + "age_norm": 0.00621089693068045, + "cos_age_gender": -0.6307619494164919, + "held_out": { + "n": 218, + "gender_auc": 0.9628813559322034, + "age_spearman_female": 0.7624242424242424, + "age_spearman_male": 0.5230060733550266 + }, + "ears": { + "n": 99, + "gender_auc": 0.7637043189368771, + "age_spearman_female": 0.2419002050580998, + "age_spearman_male": 0.1375717305949864 + } + }, + "L10.ffn": { + "gender_norm": 0.18652416085958584, + "age_norm": 0.056917759144084444, + "cos_age_gender": -0.6377149544753009, + "held_out": { + "n": 218, + "gender_auc": 0.9995762711864407, + "age_spearman_female": 0.452037203720372, + "age_spearman_male": 0.42478060324520944 + }, + "ears": { + "n": 99, + "gender_auc": 1.0, + "age_spearman_female": 0.07676008202323993, + "age_spearman_male": 0.38704318936877075 + } + }, + "speaker_embedding": { + "gender_norm": 1.8763586747638452, + "age_norm": 1.2692715820938114, + "cos_age_gender": -0.16108777352606762, + "held_out": { + "n": 218, + "gender_auc": 1.0, + "age_spearman_female": 0.8699309930993099, + "age_spearman_male": 0.7659840989850961 + }, + "ears": { + "n": 99, + "gender_auc": 0.9327242524916943, + "age_spearman_female": 0.6403964456596036, + "age_spearman_male": 0.5382059800664452 + } + } +} diff --git a/steering/mandarin_hidden_mect60k/cmn.npy b/steering/mandarin_hidden_mect60k/cmn.npy new file mode 100644 index 0000000000000000000000000000000000000000..4a54be6075f1d51beb5d8944ea5f4981826e865b --- /dev/null +++ b/steering/mandarin_hidden_mect60k/cmn.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6609f1bf976e6f2c0f78eb900d330db789f3ef4ca531904afbe1496f5bead5d5 +size 4224 diff --git a/steering/mandarin_hidden_mect60k/manifest.json b/steering/mandarin_hidden_mect60k/manifest.json new file mode 100644 index 0000000000000000000000000000000000000000..a26ab5c33f6aff7f09ea7aaaf7ac847ce3642a1c --- /dev/null +++ b/steering/mandarin_hidden_mect60k/manifest.json @@ -0,0 +1,21 @@ +{ + "dim": 1024, + "space": "attnres_source", + "source_index": 15, + "source_name": "L7.attn", + "neutral": "eng", + "checkpoint": "/data/groups/audio/gabriel/hf_release_zonos3mini_20261020/lm/mect_60k", + "row_norm": 0.4116750960088868, + "prompt_conditioning": "speaker_row=own,condition_rows=3:unknown,pools=/data/groups/audio/sofian/runs/accent_steering/clips", + "directions": { + "cmn": { + "file": "cmn.npy", + "kind": "named", + "norm": 0.1931122988462448, + "snr": 0.6807807683944702, + "clips": 799, + "data": "pool" + } + }, + "note": "Native Mandarin minus native English at L7.attn (accent_steering clips pools, fit_hidden_directions.py --pools, job 78345). Alone it barely moves the accent; with the mandarin_mect60k speaker-embedding direction (x1.5 + this x0.5) Vox-Profile hears East Asia on 58% of renders at 1.8% WER." +} \ No newline at end of file diff --git a/steering/mandarin_mect60k/cmn.npy b/steering/mandarin_mect60k/cmn.npy new file mode 100644 index 0000000000000000000000000000000000000000..6ae5a8cd2f38bc9360381365056b6b8829481ac2 --- /dev/null +++ b/steering/mandarin_mect60k/cmn.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:db43c3f740c2a535939873e7813bf0da1ebcda984df0fbaca847128911c78eea +size 896 diff --git a/steering/mandarin_mect60k/manifest.json b/steering/mandarin_mect60k/manifest.json new file mode 100644 index 0000000000000000000000000000000000000000..ecdec674e727a0f16c2d83760bcd7eac5af8dc72 --- /dev/null +++ b/steering/mandarin_mect60k/manifest.json @@ -0,0 +1,21 @@ +{ + "dim": 192, + "input_dim": 192, + "space": "raw", + "speaker_codec": "ownmect_s2", + "ref_base_norm": 4.306550888923916, + "neutral": "eng", + "checkpoint": "/data/groups/audio/gabriel/hf_release_zonos3mini_20261020/lm/mect_60k", + "pools": "/data/groups/audio/sofian/runs/accent_steering/clips", + "orthogonal_to": "/data/groups/audio/sofian/bingua2-gdn-emotion/minisgl/speaker_attributes_mect60k", + "note": "accent recordings minus English recordings in the ownmect_s2 speaker embedding (per-recording means), gender and age projected out; accent_strength 1 = the full mean shift, speaker_mode embedding only.", + "directions": { + "cmn": { + "file": "cmn.npy", + "kind": "named", + "norm": 2.2392895869313927, + "recordings": 779, + "held_out_auc": 1.0 + } + } +} diff --git a/steering/mandarin_mect60k/report.json b/steering/mandarin_mect60k/report.json new file mode 100644 index 0000000000000000000000000000000000000000..49954d783c44c66a6fcb36c96c6daa52d4093fee --- /dev/null +++ b/steering/mandarin_mect60k/report.json @@ -0,0 +1,12 @@ +{ + "cmn": { + "recordings": 779, + "norm": 2.2392895869313927, + "removed_share": 0.009115443161335612, + "held_out_auc": 1.0, + "cos_gender_before": 0.09490638259018808, + "cos_age_before": -0.010402966274770664, + "max_cos_other": "-", + "common_share": 1.0000000000000004 + } +} diff --git a/steering/pitch_mect60k/eval_summary.json b/steering/pitch_mect60k/eval_summary.json new file mode 100644 index 0000000000000000000000000000000000000000..3964dca23797c28a29f41a18495b89f99f2949d2 --- /dev/null +++ b/steering/pitch_mect60k/eval_summary.json @@ -0,0 +1,251 @@ +{ + "all": { + "neutral": { + "wer": 0.004866946778711485, + "collapse": 0.0, + "identity": 0.9463956918186919, + "durx": 1.0, + "female": 0.4983073752615989, + "age": 41.317688735822834, + "f0": 136.19757792145845, + "f0_st": 2.903048200564409, + "voiced": 0.6307535235563585, + "rms_db": -38.16175572077433, + "snr_db": 39.82410788536072, + "bandwidth": 8300.152587890625, + "quality:deep": 0.2347025, + "quality:shrill": 0.20924874999999998, + "quality:monotone": 0.0, + "quality:singsong": 0.34092208333333335, + "quality:pitchy": 0.005500833333333334 + }, + "pitch -3": { + "wer": 0.015238784300905715, + "collapse": 0.0, + "identity": 0.7651748563681653, + "durx": 0.9424603174603174, + "female": 0.5009427528372422, + "age": 36.51716982324918, + "f0": 114.10975007014417, + "f0_st": 2.997057103379598, + "voiced": 0.6169235433615562, + "rms_db": -33.30506416161855, + "snr_db": 28.244252681732178, + "bandwidth": 10324.273681640625, + "quality:deep": 0.24337833333333336, + "quality:shrill": 0.21115458333333334, + "quality:monotone": 0.0, + "quality:singsong": 0.18759333333333336, + "quality:pitchy": 0.003493333333333333 + }, + "pitch -2": { + "wer": 0.003641456582633053, + "collapse": 0.0, + "identity": 0.8527247498196439, + "durx": 0.9752747252747253, + "female": 0.4990966404147912, + "age": 38.34450580179691, + "f0": 115.00415804377305, + "f0_st": 2.6789276479477597, + "voiced": 0.5930164463201216, + "rms_db": -34.444097797075905, + "snr_db": 35.72257397572199, + "bandwidth": 10421.173095703125, + "quality:deep": 0.29424958333333334, + "quality:shrill": 0.23810416666666667, + "quality:monotone": 0.0, + "quality:singsong": 0.24387083333333334, + "quality:pitchy": 0.011365 + }, + "pitch -1": { + "wer": 0.005576441102756892, + "collapse": 0.0, + "identity": 0.9079579797014575, + "durx": 0.9725141959647214, + "female": 0.4992187816290728, + "age": 39.13750580201546, + "f0": 126.37453427697308, + "f0_st": 2.933854894081643, + "voiced": 0.6297118920624251, + "rms_db": -37.605687936147056, + "snr_db": 36.41699846585592, + "bandwidth": 9249.856567382812, + "quality:deep": 0.25272833333333333, + "quality:shrill": 0.21141708333333334, + "quality:monotone": 0.0, + "quality:singsong": 0.219695, + "quality:pitchy": 0.0034829166666666667 + }, + "pitch +1": { + "wer": 0.004831932773109244, + "collapse": 0.0, + "identity": 0.8979757308426023, + "durx": 0.9680234833659492, + "female": 0.4992239070949533, + "age": 43.89275678743919, + "f0": 152.98055787644185, + "f0_st": 3.3228338657194403, + "voiced": 0.6746165200390729, + "rms_db": -37.842355171839394, + "snr_db": 36.025092681248985, + "bandwidth": 7542.00439453125, + "quality:deep": 0.21350833333333333, + "quality:shrill": 0.21049208333333336, + "quality:monotone": 0.0, + "quality:singsong": 0.28207458333333335, + "quality:pitchy": 0.00339125 + }, + "pitch +2": { + "wer": 0.0011904761904761904, + "collapse": 0.0, + "identity": 0.838263122141147, + "durx": 0.9914285714285714, + "female": 0.5001188309882613, + "age": 46.474106485644974, + "f0": 176.29567960964073, + "f0_st": 3.9189246781167895, + "voiced": 0.7231763328824058, + "rms_db": -34.1405873298645, + "snr_db": 36.572357495625816, + "bandwidth": 7077.6947021484375, + "quality:deep": 0.2149833333333333, + "quality:shrill": 0.199685, + "quality:monotone": 0.0, + "quality:singsong": 0.37871666666666665, + "quality:pitchy": 0.00336375 + }, + "pitch +3": { + "wer": 0.0011904761904761904, + "collapse": 0.0, + "identity": 0.733349593976025, + "durx": 0.9847883597883598, + "female": 0.35353870828597184, + "age": 46.20017974327008, + "f0": 189.18781546410983, + "f0_st": 4.281564429232234, + "voiced": 0.7387637647312202, + "rms_db": -33.50203323364258, + "snr_db": 38.549638430277504, + "bandwidth": 7063.787841796875, + "quality:deep": 0.16851916666666666, + "quality:shrill": 0.19242125, + "quality:monotone": 0.0, + "quality:singsong": 0.4768333333333333, + "quality:pitchy": 0.004587916666666666 + }, + "pitch_range -3": { + "wer": 0.0021929824561403508, + "collapse": 0.0, + "identity": 0.8600128454816595, + "durx": 0.9941176470588236, + "female": 0.4962053057048858, + "age": 37.67219508687655, + "f0": 136.62839936629325, + "f0_st": 1.745787022737984, + "voiced": 0.7060694630327494, + "rms_db": -39.13854384422302, + "snr_db": 38.353715896606445, + "bandwidth": 7880.7037353515625, + "quality:deep": 0.25679708333333334, + "quality:shrill": 0.20467666666666665, + "quality:monotone": 0.0, + "quality:singsong": 0.3613783333333333, + "quality:pitchy": 0.01199625 + }, + "pitch_range -2": { + "wer": 0.0021929824561403508, + "collapse": 0.0, + "identity": 0.8918871270991069, + "durx": 0.9766531713900135, + "female": 0.4973482775433998, + "age": 39.49383174379667, + "f0": 138.6181592801831, + "f0_st": 2.092016531590464, + "voiced": 0.7033696311479168, + "rms_db": -38.02633937199911, + "snr_db": 37.921666622161865, + "bandwidth": 8068.2220458984375, + "quality:deep": 0.26995375, + "quality:shrill": 0.19149958333333336, + "quality:monotone": 0.0, + "quality:singsong": 0.3692783333333334, + "quality:pitchy": 0.013205833333333332 + }, + "pitch_range -1": { + "wer": 0.007094943240454076, + "collapse": 0.0, + "identity": 0.9139932949726427, + "durx": 1.0089687726942629, + "female": 0.497866127397477, + "age": 40.53299513955911, + "f0": 136.46191879148958, + "f0_st": 2.218275881167139, + "voiced": 0.6661423904604561, + "rms_db": -39.722058852513634, + "snr_db": 38.11930775642395, + "bandwidth": 8336.489868164062, + "quality:deep": 0.23993291666666663, + "quality:shrill": 0.20707166666666668, + "quality:monotone": 0.0, + "quality:singsong": 0.35416374999999994, + "quality:pitchy": 0.005002916666666667 + }, + "pitch_range +1": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9134307973973121, + "durx": 0.9716533466533468, + "female": 0.4994794678204926, + "age": 42.62345662961403, + "f0": 136.7282181312811, + "f0_st": 3.5025350736077256, + "voiced": 0.5916284432364043, + "rms_db": -38.05551918347677, + "snr_db": 37.55640045801798, + "bandwidth": 8555.859375, + "quality:deep": 0.19649916666666667, + "quality:shrill": 0.2134979166666667, + "quality:monotone": 0.0, + "quality:singsong": 0.2746591666666667, + "quality:pitchy": 0.00172875 + }, + "pitch_range +2": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.8914904736876815, + "durx": 0.9715923406399596, + "female": 0.4998331018675041, + "age": 42.89155751466751, + "f0": 139.70795845732877, + "f0_st": 4.352541928535282, + "voiced": 0.5560188053269668, + "rms_db": -37.20184556643168, + "snr_db": 37.85539325078329, + "bandwidth": 9013.43994140625, + "quality:deep": 0.19566124999999998, + "quality:shrill": 0.2168154166666667, + "quality:monotone": 0.0, + "quality:singsong": 0.27925041666666667, + "quality:pitchy": 0.0032170833333333335 + }, + "pitch_range +3": { + "wer": 0.005834439038773405, + "collapse": 0.0, + "identity": 0.8597137294632268, + "durx": 0.9738461538461538, + "female": 0.5008024038300695, + "age": 42.3450717702508, + "f0": 139.06259257522467, + "f0_st": 4.982104418745666, + "voiced": 0.4979637369762842, + "rms_db": -37.569387356440224, + "snr_db": 36.59771076838175, + "bandwidth": 9100.469970703125, + "quality:deep": 0.15836125, + "quality:shrill": 0.2442075, + "quality:monotone": 0.0, + "quality:singsong": 0.2985495833333333, + "quality:pitchy": 0.0016979166666666668 + } + } +} diff --git a/steering/pitch_mect60k/manifest.json b/steering/pitch_mect60k/manifest.json new file mode 100644 index 0000000000000000000000000000000000000000..491a845c98018d02b4aff0aefaad4e63aac97a2a --- /dev/null +++ b/steering/pitch_mect60k/manifest.json @@ -0,0 +1,69 @@ +{ + "dim": 192, + "space": "raw", + "checkpoint": "/data/groups/audio/gabriel/hf_release_zonos3mini_20261020/lm/mect_60k", + "corpus": "/data/groups/audio/sofian/bingua2-gdn-emotion/minisgl/speaker_corpus_libritts_ears/clips.json", + "spec": { + "space": "raw", + "orthogonal_to": [ + "/data/groups/audio/sofian/bingua2-gdn-emotion/minisgl/speaker_attributes_mect60k" + ], + "directions": { + "pitch": { + "regress": "f0_log", + "within": "meta_gender", + "filter": { + "corpus": "libritts_r", + "meta_gender": [ + "female", + "male" + ] + }, + "kind": "axis", + "poles": { + "+": "higher", + "-": "lower" + } + }, + "pitch_range": { + "regress": "f0_st", + "within": "meta_gender", + "filter": { + "corpus": "libritts_r", + "meta_gender": [ + "female", + "male" + ] + }, + "kind": "axis", + "poles": { + "+": "varied", + "-": "monotone" + } + } + } + }, + "directions": { + "pitch": { + "file": "pitch.npy", + "kind": "axis", + "norm": 0.7707383909536902, + "poles": { + "+": "higher", + "-": "lower" + } + }, + "pitch_range": { + "file": "pitch_range.npy", + "kind": "axis", + "norm": 0.526365652403613, + "poles": { + "+": "varied", + "-": "monotone" + } + } + }, + "input_dim": 192, + "speaker_codec": "ownmect_s2", + "ref_base_norm": 3.513610409673348 +} diff --git a/steering/pitch_mect60k/pitch.npy b/steering/pitch_mect60k/pitch.npy new file mode 100644 index 0000000000000000000000000000000000000000..432a996a65beaca098fabe0b91b27c84e3d6f296 --- /dev/null +++ b/steering/pitch_mect60k/pitch.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5ffc82e23322ec2d3c09a4e82508758106cdb208456314ce10a80c1880ec1c0c +size 896 diff --git a/steering/pitch_mect60k/pitch_range.npy b/steering/pitch_mect60k/pitch_range.npy new file mode 100644 index 0000000000000000000000000000000000000000..c49d7b478e4c0f50dae1f8b77f990b6d8d07e84e --- /dev/null +++ b/steering/pitch_mect60k/pitch_range.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2f89b77f20ff9e78aa2813dbc17762ff39c937cb36084f19da6889106fbecdf8 +size 896 diff --git a/steering/pitch_mect60k/report.json b/steering/pitch_mect60k/report.json new file mode 100644 index 0000000000000000000000000000000000000000..4acdda67d830fac8e3516b6e1b25deb6134b8fd5 --- /dev/null +++ b/steering/pitch_mect60k/report.json @@ -0,0 +1,90 @@ +{ + "pitch": { + "norm": 0.7707383909536902, + "removed_share": 0.36466429646664533, + "pairs": [ + { + "pair": [ + { + "corpus": "libritts_r", + "meta_gender": "female" + }, + "f0_log P10-P90 0.433" + ], + "train_speakers": [ + 438, + 0 + ], + "held_out_speakers": [ + 101, + 0 + ], + "cos_with_direction": 0.5316875125328713, + "held_out_auc": 0.8132789749563191 + }, + { + "pair": [ + { + "corpus": "libritts_r", + "meta_gender": "male" + }, + "f0_log P10-P90 0.554" + ], + "train_speakers": [ + 455, + 0 + ], + "held_out_speakers": [ + 125, + 0 + ], + "cos_with_direction": 0.6522806194841999, + "held_out_auc": 0.7189308755760367 + } + ] + }, + "pitch_range": { + "norm": 0.526365652403613, + "removed_share": 0.3847031008841182, + "pairs": [ + { + "pair": [ + { + "corpus": "libritts_r", + "meta_gender": "female" + }, + "f0_st P10-P90 2.05" + ], + "train_speakers": [ + 438, + 0 + ], + "held_out_speakers": [ + 101, + 0 + ], + "cos_with_direction": 0.6394842137651136, + "held_out_auc": 0.4650902737332557 + }, + { + "pair": [ + { + "corpus": "libritts_r", + "meta_gender": "male" + }, + "f0_st P10-P90 2.06" + ], + "train_speakers": [ + 455, + 0 + ], + "held_out_speakers": [ + 125, + 0 + ], + "cos_with_direction": 0.6549728040039728, + "held_out_auc": 0.43406451612903224 + } + ] + } +} diff --git a/steering/pitch_mect60k/spec.json b/steering/pitch_mect60k/spec.json new file mode 100644 index 0000000000000000000000000000000000000000..73a01a80fb194e03b852901294332437843606a7 --- /dev/null +++ b/steering/pitch_mect60k/spec.json @@ -0,0 +1,40 @@ +{ + "space": "raw", + "orthogonal_to": [ + "/data/groups/audio/sofian/bingua2-gdn-emotion/minisgl/speaker_attributes_mect60k" + ], + "directions": { + "pitch": { + "regress": "f0_log", + "within": "meta_gender", + "filter": { + "corpus": "libritts_r", + "meta_gender": [ + "female", + "male" + ] + }, + "kind": "axis", + "poles": { + "+": "higher", + "-": "lower" + } + }, + "pitch_range": { + "regress": "f0_st", + "within": "meta_gender", + "filter": { + "corpus": "libritts_r", + "meta_gender": [ + "female", + "male" + ] + }, + "kind": "axis", + "poles": { + "+": "varied", + "-": "monotone" + } + } + } +} \ No newline at end of file diff --git a/steering/speaker_accents_mect60k/deu.npy b/steering/speaker_accents_mect60k/deu.npy new file mode 100644 index 0000000000000000000000000000000000000000..56d3ced0c0439041225af596c3e730c4394dc8fe --- /dev/null +++ b/steering/speaker_accents_mect60k/deu.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a515464558c7f3c782ea131e9cd28a566b05858f5d72569f27fea3bd936ef252 +size 896 diff --git a/steering/speaker_accents_mect60k/fra.npy b/steering/speaker_accents_mect60k/fra.npy new file mode 100644 index 0000000000000000000000000000000000000000..d69c7cf2c6c4f882bb80b5b81d36f788ca063387 --- /dev/null +++ b/steering/speaker_accents_mect60k/fra.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cde5379eaf3bdbb484cb07ec2505d0974222efa5ea10dc3adc280f79f2e1d05a +size 896 diff --git a/steering/speaker_accents_mect60k/hin.npy b/steering/speaker_accents_mect60k/hin.npy new file mode 100644 index 0000000000000000000000000000000000000000..fc8cd5795879e123f66d952e3ec225ba1ba25350 --- /dev/null +++ b/steering/speaker_accents_mect60k/hin.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a75548f0de03973c88aea57d084691da6bdd826bab75c6b628ef98965551c636 +size 896 diff --git a/steering/speaker_accents_mect60k/manifest.json b/steering/speaker_accents_mect60k/manifest.json new file mode 100644 index 0000000000000000000000000000000000000000..71755484c56d5dbc9fabcc0353e1c6616093574e --- /dev/null +++ b/steering/speaker_accents_mect60k/manifest.json @@ -0,0 +1,63 @@ +{ + "dim": 192, + "input_dim": 192, + "space": "raw", + "speaker_codec": "ownmect_s2", + "ref_base_norm": 4.306550888923916, + "neutral": "eng", + "checkpoint": "/data/groups/audio/gabriel/hf_release_zonos3mini_20261020/lm/mect_60k", + "pools": "/data/groups/audio/sofian/runs/accent_steering/clips", + "orthogonal_to": "/data/groups/audio/sofian/bingua2-gdn-emotion/minisgl/speaker_attributes_mect60k", + "note": "accent recordings minus English recordings in the ownmect_s2 speaker embedding (per-recording means), gender and age projected out; accent_strength 1 = the full mean shift, speaker_mode embedding only.", + "directions": { + "hin": { + "file": "hin.npy", + "kind": "named", + "norm": 1.8782425729684693, + "recordings": 531, + "held_out_auc": 0.9999424228466145 + }, + "spa": { + "file": "spa.npy", + "kind": "named", + "norm": 1.7367654139952144, + "recordings": 672, + "held_out_auc": 1.0 + }, + "fra": { + "file": "fra.npy", + "kind": "named", + "norm": 1.6489054185649126, + "recordings": 623, + "held_out_auc": 1.0 + }, + "por": { + "file": "por.npy", + "kind": "named", + "norm": 2.014261370414127, + "recordings": 624, + "held_out_auc": 0.9998976406162035 + }, + "deu": { + "file": "deu.npy", + "kind": "named", + "norm": 1.6574719433691114, + "recordings": 588, + "held_out_auc": 0.9885888600158175 + }, + "vie": { + "file": "vie.npy", + "kind": "named", + "norm": 2.4562732630149373, + "recordings": 536, + "held_out_auc": 0.9923084864753252 + }, + "pol": { + "file": "pol.npy", + "kind": "named", + "norm": 2.0049545519176637, + "recordings": 329, + "held_out_auc": 0.9938188139849333 + } + } +} diff --git a/steering/speaker_accents_mect60k/pol.npy b/steering/speaker_accents_mect60k/pol.npy new file mode 100644 index 0000000000000000000000000000000000000000..039ca6627013d8bdb30c5fa0a3141f8dd4c05534 --- /dev/null +++ b/steering/speaker_accents_mect60k/pol.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d946bce5197ce68c2640c906307702cfe6e02cabfcbb1012a43e44226e6470c0 +size 896 diff --git a/steering/speaker_accents_mect60k/por.npy b/steering/speaker_accents_mect60k/por.npy new file mode 100644 index 0000000000000000000000000000000000000000..9c61598e2a899bf4ebc22960af9fadf31fd51728 --- /dev/null +++ b/steering/speaker_accents_mect60k/por.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:30f411180fa38763c65f4f578b6a673b12fece9378b06e942b4b2c6f48ea86ec +size 896 diff --git a/steering/speaker_accents_mect60k/report.json b/steering/speaker_accents_mect60k/report.json new file mode 100644 index 0000000000000000000000000000000000000000..854895a270f595a8c15de279eef4503b9601f136 --- /dev/null +++ b/steering/speaker_accents_mect60k/report.json @@ -0,0 +1,72 @@ +{ + "hin": { + "recordings": 531, + "norm": 1.8782425729684693, + "removed_share": 0.00023435527718718152, + "held_out_auc": 0.9999424228466145, + "cos_gender_before": 0.01530725658626391, + "cos_age_before": 0.00020778109186879234, + "max_cos_other": "deu 0.35", + "common_share": 0.2836667832424048 + }, + "spa": { + "recordings": 672, + "norm": 1.7367654139952144, + "removed_share": 0.00356131976973606, + "held_out_auc": 1.0, + "cos_gender_before": 0.025454677235210707, + "cos_age_before": -0.053975727691575257, + "max_cos_other": "fra 0.26", + "common_share": 0.2901799616188182 + }, + "fra": { + "recordings": 623, + "norm": 1.6489054185649126, + "removed_share": 0.009886733616853993, + "held_out_auc": 1.0, + "cos_gender_before": 0.0586856295067271, + "cos_age_before": -0.08026662143997261, + "max_cos_other": "vie 0.29", + "common_share": 0.3553618210232504 + }, + "por": { + "recordings": 624, + "norm": 2.014261370414127, + "removed_share": 0.005971001720438296, + "held_out_auc": 0.9998976406162035, + "cos_gender_before": 0.07592441253420945, + "cos_age_before": -0.014369596527148166, + "max_cos_other": "pol 0.31", + "common_share": 0.3356952964624147 + }, + "deu": { + "recordings": 588, + "norm": 1.6574719433691114, + "removed_share": 0.011753505825710886, + "held_out_auc": 0.9885888600158175, + "cos_gender_before": -0.06034181199139575, + "cos_age_before": -0.09006870454524658, + "max_cos_other": "hin 0.35", + "common_share": 0.4291298433684991 + }, + "vie": { + "recordings": 536, + "norm": 2.4562732630149373, + "removed_share": 0.0012422154525163487, + "held_out_auc": 0.9923084864753252, + "cos_gender_before": 0.00558908246052393, + "cos_age_before": 0.034799103570441296, + "max_cos_other": "fra 0.29", + "common_share": 0.2187942738265085 + }, + "pol": { + "recordings": 329, + "norm": 2.0049545519176637, + "removed_share": 0.012447448985959508, + "held_out_auc": 0.9938188139849333, + "cos_gender_before": -0.028580595478086477, + "cos_age_before": -0.1078452527503723, + "max_cos_other": "deu 0.33", + "common_share": 0.24889277800185053 + } +} diff --git a/steering/speaker_accents_mect60k/spa.npy b/steering/speaker_accents_mect60k/spa.npy new file mode 100644 index 0000000000000000000000000000000000000000..20b4b2de84609a7b84fbbecc31b0b55ae390b4e8 --- /dev/null +++ b/steering/speaker_accents_mect60k/spa.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d57686ae15125d1f28e9615f624c0be99c50f72b8396846f5554e3b9986593af +size 896 diff --git a/steering/speaker_accents_mect60k/vie.npy b/steering/speaker_accents_mect60k/vie.npy new file mode 100644 index 0000000000000000000000000000000000000000..35a66af666070587d556f661d88e06ecfb1866e6 --- /dev/null +++ b/steering/speaker_accents_mect60k/vie.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8f32141973546261556f0d9885146d8ac83c60ad1eb6780587781ac79b747b86 +size 896 diff --git a/steering/speaker_attributes_mect60k/age.npy b/steering/speaker_attributes_mect60k/age.npy new file mode 100644 index 0000000000000000000000000000000000000000..4db4c2c85bff5d9f3f113a8334bc28b0cdf886db --- /dev/null +++ b/steering/speaker_attributes_mect60k/age.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cce35e64e6525a9e75e204c1ecf7419efb2651e0bd040a65599648e1b6467028 +size 896 diff --git a/steering/speaker_attributes_mect60k/default_voice_traits.json b/steering/speaker_attributes_mect60k/default_voice_traits.json new file mode 100644 index 0000000000000000000000000000000000000000..b92985f8eb7b8dee6e9e610a4ff2c4cbd3ce0711 --- /dev/null +++ b/steering/speaker_attributes_mect60k/default_voice_traits.json @@ -0,0 +1,55 @@ +{ + "note": "audeering/wav2vec2-large-robust-24-ft-age-gender on the first 20 s of each release default voice (/data/groups/audio/gabriel/zonosv2_realtime_demo/default_voices_gdn): P(female) = female/(female+male), age in years. Dose calibration from eval_sweep.json (six voices, embedding mode): 1.31 logits of P(female) per gender dose, 8.7 years per age dose (median per-voice slopes).", + "logit_per_gender_dose": 1.31, + "years_per_age_dose": 8.7, + "voices": { + "American Female": { + "female": 0.9944, + "age": 29.1 + }, + "American Male": { + "female": 0.0013, + "age": 52.4 + }, + "Australian Female": { + "female": 0.9968, + "age": 36.1 + }, + "British Female": { + "female": 0.9991, + "age": 52.6 + }, + "British Male": { + "female": 0.0099, + "age": 32.1 + }, + "David Attenborough": { + "female": 0.009, + "age": 72.5 + }, + "Dwarkesh": { + "female": 0.0022, + "age": 20.4 + }, + "German Accent Male": { + "female": 0.0121, + "age": 68.4 + }, + "Obama Yelling": { + "female": 0.0151, + "age": 55.7 + }, + "Obama": { + "female": 0.0018, + "age": 59.2 + }, + "Scottish Female": { + "female": 0.9992, + "age": 57.0 + }, + "Skyler": { + "female": 0.9921, + "age": 23.8 + } + } +} \ No newline at end of file diff --git a/steering/speaker_attributes_mect60k/eval_sweep.json b/steering/speaker_attributes_mect60k/eval_sweep.json new file mode 100644 index 0000000000000000000000000000000000000000..12a2c7ccf132dc45b5ac1f56b0b5e214e08c5325 --- /dev/null +++ b/steering/speaker_attributes_mect60k/eval_sweep.json @@ -0,0 +1,656 @@ +{ + "American Female": { + "id": "default_c7f3482b2806b3aa", + "cells": { + "neutral": { + "female": 0.9780601759751638, + "age": 27.82994508743286, + "wer": 0.06060606060606061, + "collapse": 0.0, + "identity": 0.9079747200012207, + "durx": 1.0 + }, + "gender-3": { + "female": 0.0190970985374103, + "age": 26.735739409923553, + "wer": 0.06060606060606061, + "collapse": 0.0, + "identity": 0.4764242172241211, + "durx": 0.8475068493150685 + }, + "gender-2": { + "female": 0.19938337244093418, + "age": 30.663528790076573, + "wer": 0.06060606060606061, + "collapse": 0.0, + "identity": 0.5010582804679871, + "durx": 0.84 + }, + "gender-1": { + "female": 0.9891236126422882, + "age": 39.59423899650574, + "wer": 0.06060606060606061, + "collapse": 0.0, + "identity": 0.6057565808296204, + "durx": 0.8102307692307692 + }, + "gender+1": { + "female": 0.9629183014233907, + "age": 27.834448963403702, + "wer": 0.06060606060606061, + "collapse": 0.0, + "identity": 0.8241246342658997, + "durx": 1.02 + }, + "gender+2": { + "female": 0.9796834886074066, + "age": 29.956718285878498, + "wer": 0.06060606060606061, + "collapse": 0.0, + "identity": 0.6441343426704407, + "durx": 1.024 + }, + "gender+3": { + "female": 0.9776312013467153, + "age": 29.505721479654312, + "wer": 0.06060606060606061, + "collapse": 0.0, + "identity": 0.5326423048973083, + "durx": 0.8943624868282403 + }, + "age-3": { + "female": 0.7757611076037089, + "age": 20.701922724644344, + "wer": 0.06060606060606061, + "collapse": 0.0, + "identity": 0.6807830929756165, + "durx": 1.0096986301369864 + }, + "age-2": { + "female": 0.8820140262444814, + "age": 20.807623863220215, + "wer": 0.06060606060606061, + "collapse": 0.0, + "identity": 0.7501528859138489, + "durx": 0.9783846153846153 + }, + "age-1": { + "female": 0.9313942790031433, + "age": 23.457375913858414, + "wer": 0.06060606060606061, + "collapse": 0.0, + "identity": 0.8347185254096985, + "durx": 0.9863846153846154 + }, + "age+1": { + "female": 0.9946736494700114, + "age": 38.755268355210625, + "wer": 0.06060606060606061, + "collapse": 0.0, + "identity": 0.8256159424781799, + "durx": 0.9726027397260273 + }, + "age+2": { + "female": 0.9985697865486145, + "age": 52.81303624312083, + "wer": 0.06060606060606061, + "collapse": 0.0, + "identity": 0.6494847536087036, + "durx": 1.0108493150684932 + }, + "age+3": { + "female": 0.9991792043050131, + "age": 62.33444809913635, + "wer": 0.06060606060606061, + "collapse": 0.0, + "identity": 0.4737032353878021, + "durx": 1.0472307692307692 + } + } + }, + "American Male": { + "id": "default_f9a5b116c03b471e", + "cells": { + "neutral": { + "female": 0.0017800596542656422, + "age": 48.5908513267835, + "wer": 0.06060606060606061, + "collapse": 0.0, + "identity": 0.886648416519165, + "durx": 1.0 + }, + "gender-3": { + "female": 0.008322355027000109, + "age": 35.08705447117487, + "wer": 0.06060606060606061, + "collapse": 0.0, + "identity": 0.5132225155830383, + "durx": 1.1382113821138213 + }, + "gender-2": { + "female": 0.0037235792454642556, + "age": 32.95531620581945, + "wer": 0.06060606060606061, + "collapse": 0.0, + "identity": 0.5716794729232788, + "durx": 0.950354609929078 + }, + "gender-1": { + "female": 0.0026574612808569023, + "age": 36.463447411855064, + "wer": 0.06060606060606061, + "collapse": 0.0, + "identity": 0.742866039276123, + "durx": 0.9679986161563744 + }, + "gender+1": { + "female": 0.9871208270390829, + "age": 39.44313327471415, + "wer": 0.06060606060606061, + "collapse": 0.0, + "identity": 0.5258494019508362, + "durx": 0.9148936170212766 + }, + "gender+2": { + "female": 0.9941282570362091, + "age": 37.80807008345922, + "wer": 0.06060606060606061, + "collapse": 0.0, + "identity": 0.4244813621044159, + "durx": 0.9162774606469468 + }, + "gender+3": { + "female": 0.9956799646218618, + "age": 40.79034477472305, + "wer": 0.06060606060606061, + "collapse": 0.0, + "identity": 0.3363466262817383, + "durx": 0.9219858156028368 + }, + "age-3": { + "female": 0.7912772231114408, + "age": 23.88958806792895, + "wer": 0.06060606060606061, + "collapse": 0.0, + "identity": 0.3820617198944092, + "durx": 0.8178515827711469 + }, + "age-2": { + "female": 0.001089766602187107, + "age": 22.958156218131382, + "wer": 0.06060606060606061, + "collapse": 0.0, + "identity": 0.6132129430770874, + "durx": 0.78031482442484 + }, + "age-1": { + "female": 0.0016426961519755423, + "age": 32.36528784036636, + "wer": 0.06060606060606061, + "collapse": 0.0, + "identity": 0.7889389991760254, + "durx": 0.8561535252398831 + }, + "age+1": { + "female": 0.0016386076458729804, + "age": 54.48761930068334, + "wer": 0.06060606060606061, + "collapse": 0.0, + "identity": 0.8120710849761963, + "durx": 1.0695381421899326 + }, + "age+2": { + "female": 0.0013988279194260638, + "age": 59.445702036221824, + "wer": 0.06060606060606061, + "collapse": 0.0, + "identity": 0.7760634422302246, + "durx": 1.141498010724788 + }, + "age+3": { + "female": 0.001602033948681007, + "age": 61.460269490877785, + "wer": 0.06060606060606061, + "collapse": 0.0, + "identity": 0.7064376473426819, + "durx": 1.1300813008130082 + } + } + }, + "British Female": { + "id": "default_e2fc300248216589", + "cells": { + "neutral": { + "female": 0.9972693026065826, + "age": 44.349841276804604, + "wer": 0.06060606060606061, + "collapse": 0.0, + "identity": 0.924590528011322, + "durx": 1.0 + }, + "gender-3": { + "female": 0.026916283027579386, + "age": 35.38204630215963, + "wer": 0.06060606060606061, + "collapse": 0.0, + "identity": 0.5155704617500305, + "durx": 0.9377093494740554 + }, + "gender-2": { + "female": 0.02312579386246701, + "age": 30.65081040064494, + "wer": 0.06060606060606061, + "collapse": 0.0, + "identity": 0.5844853520393372, + "durx": 0.9187066130800146 + }, + "gender-1": { + "female": 0.5191127949704727, + "age": 38.45164676507314, + "wer": 0.06060606060606061, + "collapse": 0.0, + "identity": 0.7278294563293457, + "durx": 0.9097373215020274 + }, + "gender+1": { + "female": 0.9971189995606741, + "age": 40.01118838787079, + "wer": 0.06060606060606061, + "collapse": 0.0, + "identity": 0.7994043231010437, + "durx": 1.0595542564852027 + }, + "gender+2": { + "female": 0.9967629909515381, + "age": 39.450281858444214, + "wer": 0.06060606060606061, + "collapse": 0.0, + "identity": 0.6264761686325073, + "durx": 1.0756302521008405 + }, + "gender+3": { + "female": 0.9970106581846873, + "age": 37.8013347585996, + "wer": 0.06060606060606061, + "collapse": 0.0, + "identity": 0.4946042597293854, + "durx": 1.0930833872010344 + }, + "age-3": { + "female": 0.6505730127294859, + "age": 20.35614053408305, + "wer": 0.09393939393939395, + "collapse": 0.0, + "identity": 0.5527672171592712, + "durx": 0.9547862623310194 + }, + "age-2": { + "female": 0.9502145946025848, + "age": 28.6472591261069, + "wer": 0.06060606060606061, + "collapse": 0.0, + "identity": 0.7149264216423035, + "durx": 0.9243697478991596 + }, + "age-1": { + "female": 0.9953771829605103, + "age": 37.13949571053187, + "wer": 0.06060606060606061, + "collapse": 0.0, + "identity": 0.8369969725608826, + "durx": 0.9573367808661926 + }, + "age+1": { + "female": 0.9982012708981832, + "age": 52.63160367806753, + "wer": 0.06060606060606061, + "collapse": 0.0, + "identity": 0.8675475120544434, + "durx": 1.0427475337961272 + }, + "age+2": { + "female": 0.9982435901959738, + "age": 56.564237674077354, + "wer": 0.06060606060606061, + "collapse": 0.0, + "identity": 0.8245849609375, + "durx": 1.1751918158567776 + }, + "age+3": { + "female": 0.9964015483856201, + "age": 58.22386840979258, + "wer": 0.06060606060606061, + "collapse": 0.0, + "identity": 0.7531635165214539, + "durx": 1.1882235411647175 + } + } + }, + "British Male": { + "id": "default_0129b891b5aa71e2", + "cells": { + "neutral": { + "female": 0.005303417177249988, + "age": 21.269172926743824, + "wer": 0.06060606060606061, + "collapse": 0.0, + "identity": 0.9069168567657471, + "durx": 1.0 + }, + "gender-3": { + "female": 0.025489528353015583, + "age": 32.40789771080017, + "wer": 0.06060606060606061, + "collapse": 0.0, + "identity": 0.6844325065612793, + "durx": 1.0278125 + }, + "gender-2": { + "female": 0.00862473746140798, + "age": 24.226810534795124, + "wer": 0.030303030303030304, + "collapse": 0.0, + "identity": 0.7245606780052185, + "durx": 0.9315599173553719 + }, + "gender-1": { + "female": 0.021318455459550023, + "age": 24.585138261318207, + "wer": 0.030303030303030304, + "collapse": 0.0, + "identity": 0.8082708716392517, + "durx": 0.9593388429752066 + }, + "gender+1": { + "female": 0.014536505584449818, + "age": 16.560861468315125, + "wer": 0.06060606060606061, + "collapse": 0.0, + "identity": 0.7704615592956543, + "durx": 0.8515625 + }, + "gender+2": { + "female": 0.9924874405066172, + "age": 29.122834652662277, + "wer": 0.046969696969696974, + "collapse": 0.0, + "identity": 0.4884401559829712, + "durx": 0.8828125 + }, + "gender+3": { + "female": 0.9915535151958466, + "age": 29.26870932181676, + "wer": 0.07575757575757576, + "collapse": 0.0, + "identity": 0.34861159324645996, + "durx": 0.9510416666666668 + }, + "age-3": { + "female": 0.008052530572361624, + "age": 22.311004996299744, + "wer": 0.0909090909090909, + "collapse": 0.0, + "identity": 0.5603686571121216, + "durx": 1.157993285123967 + }, + "age-2": { + "female": 0.0020867750669519105, + "age": 18.251579999923706, + "wer": 0.1106060606060606, + "collapse": 0.0, + "identity": 0.7218759655952454, + "durx": 1.035625 + }, + "age-1": { + "female": 0.005976717317632089, + "age": 17.443738132715225, + "wer": 0.06060606060606061, + "collapse": 0.0, + "identity": 0.8426111340522766, + "durx": 0.9921875 + }, + "age+1": { + "female": 0.006134321020605664, + "age": 28.28422288099925, + "wer": 0.06060606060606061, + "collapse": 0.0, + "identity": 0.842004120349884, + "durx": 1.0666666666666667 + }, + "age+2": { + "female": 0.005536238197237253, + "age": 37.08402266105016, + "wer": 0.030303030303030304, + "collapse": 0.0, + "identity": 0.7648714184761047, + "durx": 1.0811458333333333 + }, + "age+3": { + "female": 0.008985714560064176, + "age": 41.91722422838211, + "wer": 0.06060606060606061, + "collapse": 0.0, + "identity": 0.7313130497932434, + "durx": 1.0367381198347108 + } + } + }, + "Obama": { + "id": "default_ca92a0bb00a5a0ba", + "cells": { + "neutral": { + "female": 0.0026490401942282915, + "age": 52.54816859960556, + "wer": 0.06060606060606061, + "collapse": 0.0, + "identity": 0.8871486783027649, + "durx": 1.0 + }, + "gender-3": { + "female": 0.003662512404844165, + "age": 48.029461006323494, + "wer": 0.06060606060606061, + "collapse": 0.0, + "identity": 0.4875597655773163, + "durx": 0.9999062617172854 + }, + "gender-2": { + "female": 0.006285397801548243, + "age": 45.27208159367243, + "wer": 0.06060606060606061, + "collapse": 0.0, + "identity": 0.6206315159797668, + "durx": 0.9052305961754781 + }, + "gender-1": { + "female": 0.005025295734715958, + "age": 48.50332885980606, + "wer": 0.06060606060606061, + "collapse": 0.0, + "identity": 0.7630252242088318, + "durx": 1.0472440944881891 + }, + "gender+1": { + "female": 0.046981245589752994, + "age": 37.99304167429606, + "wer": 0.06060606060606061, + "collapse": 0.0, + "identity": 0.48579439520835876, + "durx": 0.9773038711887634 + }, + "gender+2": { + "female": 0.9846742550532023, + "age": 32.78773774703344, + "wer": 0.06060606060606061, + "collapse": 0.0, + "identity": 0.3736802041530609, + "durx": 0.9684101987251594 + }, + "gender+3": { + "female": 0.9918442567189535, + "age": 34.79854663213094, + "wer": 0.06060606060606061, + "collapse": 0.0, + "identity": 0.2980023920536041, + "durx": 1.021922619384807 + }, + "age-3": { + "female": 0.9380248685677847, + "age": 25.18228491147359, + "wer": 0.06060606060606061, + "collapse": 0.0, + "identity": 0.31216147541999817, + "durx": 0.8386433710174718 + }, + "age-2": { + "female": 0.004217120741183559, + "age": 24.514783918857574, + "wer": 0.06060606060606061, + "collapse": 0.0, + "identity": 0.3666110038757324, + "durx": 0.7133631677335297 + }, + "age-1": { + "female": 0.0032284948586796722, + "age": 38.730051120122276, + "wer": 0.06060606060606061, + "collapse": 0.0, + "identity": 0.8118444085121155, + "durx": 0.8489208633093527 + }, + "age+1": { + "female": 0.0016524597303941846, + "age": 61.38617197672526, + "wer": 0.07575757575757576, + "collapse": 0.0, + "identity": 0.8226690292358398, + "durx": 1.228403104288223 + }, + "age+2": { + "female": 0.001689548740008225, + "age": 62.73695031801859, + "wer": 0.06060606060606061, + "collapse": 0.0, + "identity": 0.7531586289405823, + "durx": 1.2712401507365536 + }, + "age+3": { + "female": 0.001759509730618447, + "age": 62.90549635887146, + "wer": 0.06060606060606061, + "collapse": 0.0, + "identity": 0.698809802532196, + "durx": 1.3855772524837275 + } + } + }, + "Scottish Female": { + "id": "default_1156053527e1268f", + "cells": { + "neutral": { + "female": 0.9974450965722402, + "age": 50.6011962890625, + "wer": 0.06060606060606061, + "collapse": 0.0, + "identity": 0.8536019325256348, + "durx": 1.0 + }, + "gender-3": { + "female": 0.003028837265446782, + "age": 35.78453212976456, + "wer": 0.09242424242424241, + "collapse": 0.0, + "identity": 0.41647979617118835, + "durx": 1.0592974540767002 + }, + "gender-2": { + "female": 0.0028751713883442185, + "age": 32.23211665948232, + "wer": 0.06060606060606061, + "collapse": 0.0, + "identity": 0.5036709904670715, + "durx": 1.1028037383177571 + }, + "gender-1": { + "female": 0.0021084575564600527, + "age": 29.784781982501347, + "wer": 0.06060606060606061, + "collapse": 0.0, + "identity": 0.6010499596595764, + "durx": 0.9878376648316477 + }, + "gender+1": { + "female": 0.9954146643479665, + "age": 51.0968416929245, + "wer": 0.07727272727272728, + "collapse": 0.0, + "identity": 0.6169344782829285, + "durx": 0.9320818562681277 + }, + "gender+2": { + "female": 0.994259387254715, + "age": 44.92143591245016, + "wer": 0.06060606060606061, + "collapse": 0.0, + "identity": 0.6708540320396423, + "durx": 0.9050057611061324 + }, + "gender+3": { + "female": 0.9952036539713541, + "age": 46.496654053529106, + "wer": 0.06060606060606061, + "collapse": 0.0, + "identity": 0.577427864074707, + "durx": 1.095890410958904 + }, + "age-3": { + "female": 0.9576201538244883, + "age": 24.61785301566124, + "wer": 0.07727272727272728, + "collapse": 0.0, + "identity": 0.570586621761322, + "durx": 0.8682627064396364 + }, + "age-2": { + "female": 0.9667837818463644, + "age": 25.531303137540817, + "wer": 0.06363636363636364, + "collapse": 0.0, + "identity": 0.6278311610221863, + "durx": 0.8693906471421824 + }, + "age-1": { + "female": 0.9872374931971232, + "age": 29.49772501985232, + "wer": 0.046969696969696974, + "collapse": 0.0, + "identity": 0.7643792629241943, + "durx": 0.8402253232620663 + }, + "age+1": { + "female": 0.9972527225812277, + "age": 54.56247081359228, + "wer": 0.06060606060606061, + "collapse": 0.0, + "identity": 0.7608959078788757, + "durx": 1.0154700047236656 + }, + "age+2": { + "female": 0.9973375002543131, + "age": 60.19354462623596, + "wer": 0.06060606060606061, + "collapse": 0.0, + "identity": 0.7102875709533691, + "durx": 1.1184459140292866 + }, + "age+3": { + "female": 0.9971498449643453, + "age": 58.98605932792028, + "wer": 0.06060606060606061, + "collapse": 0.0, + "identity": 0.6492452621459961, + "durx": 1.4652755398001935 + } + } + } +} \ No newline at end of file diff --git a/steering/speaker_attributes_mect60k/gender.npy b/steering/speaker_attributes_mect60k/gender.npy new file mode 100644 index 0000000000000000000000000000000000000000..1b47e26b0b94be330b3cf95fcdf3ed71e8b94c1b --- /dev/null +++ b/steering/speaker_attributes_mect60k/gender.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:385b44272a8107019fac19852605b2a9180a6dbc9de0d7037bae1d7567ec1f01 +size 896 diff --git a/steering/speaker_attributes_mect60k/manifest.json b/steering/speaker_attributes_mect60k/manifest.json new file mode 100644 index 0000000000000000000000000000000000000000..2244680b241a6849b7fe08ac1668bd7f71b1ba0f --- /dev/null +++ b/steering/speaker_attributes_mect60k/manifest.json @@ -0,0 +1,50 @@ +{ + "dim": 192, + "input_dim": 192, + "space": "raw", + "speaker_codec": "ownmect_s2", + "ref_base_norm": 3.5114699447297797, + "corpus": "/data/groups/audio/sofian/bingua2-gdn-emotion/minisgl/speaker_corpus_libritts_ears/clips.json", + "labeller": "audeering/wav2vec2-large-robust-24-ft-age-gender", + "train_speakers": 850, + "age_gap_years": 27.869893920918308, + "checkpoint": "/data/groups/audio/gabriel/hf_release_zonos3mini_20261020/lm/mect_60k", + "checks": { + "gender_norm": 1.8763586747638452, + "age_norm": 1.2692715820938114, + "cos_age_gender": -0.16108777352606762, + "held_out": { + "n": 218, + "gender_auc": 1.0, + "age_spearman_female": 0.8699309930993099, + "age_spearman_male": 0.7659840989850961 + }, + "ears": { + "n": 99, + "gender_auc": 0.9327242524916943, + "age_spearman_female": 0.6403964456596036, + "age_spearman_male": 0.5382059800664452 + } + }, + "directions": { + "gender": { + "file": "gender.npy", + "kind": "axis", + "norm": 1.8763586747638452, + "poles": { + "+": "female", + "-": "male" + } + }, + "age": { + "file": "age.npy", + "kind": "axis", + "norm": 1.2692715820938114, + "poles": { + "+": "older", + "-": "younger" + }, + "years_per_dose": 27.869893920918308 + } + } +} diff --git a/steering/speaker_emotions_mect60k/angry.npy b/steering/speaker_emotions_mect60k/angry.npy new file mode 100644 index 0000000000000000000000000000000000000000..4dea8c99eb7ea0e51342aebb671f35b6301ec892 --- /dev/null +++ b/steering/speaker_emotions_mect60k/angry.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a4c44f120c69e8716567dbf33392f97b89e10ee260d7457e3542807258f56910 +size 896 diff --git a/steering/speaker_emotions_mect60k/disgusted.npy b/steering/speaker_emotions_mect60k/disgusted.npy new file mode 100644 index 0000000000000000000000000000000000000000..2ace53fb46b18cdf7a8cc6b4c3be732a31c97ae8 --- /dev/null +++ b/steering/speaker_emotions_mect60k/disgusted.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4eee633deed7fdb2d7fd4a7b387f588705d79dcb39269c9ef9d94422c1486dc7 +size 896 diff --git a/steering/speaker_emotions_mect60k/fearful.npy b/steering/speaker_emotions_mect60k/fearful.npy new file mode 100644 index 0000000000000000000000000000000000000000..fc8a633585a108629ac70ea2d2540950f48695cf --- /dev/null +++ b/steering/speaker_emotions_mect60k/fearful.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cf2707495479b8939a0681f348d290218a44eff450268c30ae96ea2715632f2b +size 896 diff --git a/steering/speaker_emotions_mect60k/happy.npy b/steering/speaker_emotions_mect60k/happy.npy new file mode 100644 index 0000000000000000000000000000000000000000..d8859715cd63531a32ffc4b05241645f23c004b4 --- /dev/null +++ b/steering/speaker_emotions_mect60k/happy.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d9f0bbccbf8f24b20c5c4e1427b1b7c52d9daa254276a703b8ec8ddb7e636e4d +size 896 diff --git a/steering/speaker_emotions_mect60k/manifest.json b/steering/speaker_emotions_mect60k/manifest.json new file mode 100644 index 0000000000000000000000000000000000000000..6880172e88586ebaa332b91ee8c64b8894dde455 --- /dev/null +++ b/steering/speaker_emotions_mect60k/manifest.json @@ -0,0 +1,129 @@ +{ + "dim": 192, + "space": "raw", + "checkpoint": "/data/groups/audio/gabriel/hf_release_zonos3mini_20261020/lm/mect_60k", + "corpus": "/data/groups/audio/sofian/runs/steer_corpora/ears_emotions/clips.json", + "spec": { + "space": "raw", + "group_by": "clip", + "center": "speaker", + "directions": { + "angry": { + "pairs": [ + [ + { + "style": "anger" + }, + { + "style": "neutral" + } + ] + ], + "kind": "named" + }, + "sad": { + "pairs": [ + [ + { + "style": "sadness" + }, + { + "style": "neutral" + } + ] + ], + "kind": "named" + }, + "happy": { + "pairs": [ + [ + { + "style": "amusement" + }, + { + "style": "neutral" + } + ] + ], + "kind": "named" + }, + "fearful": { + "pairs": [ + [ + { + "style": "fear" + }, + { + "style": "neutral" + } + ] + ], + "kind": "named" + }, + "disgusted": { + "pairs": [ + [ + { + "style": "disgust" + }, + { + "style": "neutral" + } + ] + ], + "kind": "named" + }, + "surprised": { + "pairs": [ + [ + { + "style": "amazement" + }, + { + "style": "neutral" + } + ] + ], + "kind": "named" + } + }, + "orthogonal_to": [ + "/data/groups/audio/sofian/bingua2-gdn-emotion/minisgl/speaker_attributes_mect60k" + ] + }, + "directions": { + "angry": { + "file": "angry.npy", + "kind": "named", + "norm": 1.0596890887233845 + }, + "sad": { + "file": "sad.npy", + "kind": "named", + "norm": 0.6941092554111131 + }, + "happy": { + "file": "happy.npy", + "kind": "named", + "norm": 0.7464997821482542 + }, + "fearful": { + "file": "fearful.npy", + "kind": "named", + "norm": 0.9065878465855942 + }, + "disgusted": { + "file": "disgusted.npy", + "kind": "named", + "norm": 0.9784041116068823 + }, + "surprised": { + "file": "surprised.npy", + "kind": "named", + "norm": 0.7549633561679097 + } + }, + "input_dim": 192, + "speaker_codec": "ownmect_s2", + "ref_base_norm": 1.7932623487910373 +} diff --git a/steering/speaker_emotions_mect60k/report.json b/steering/speaker_emotions_mect60k/report.json new file mode 100644 index 0000000000000000000000000000000000000000..e1252cab4bbdc1e5426b42d9330705f74f7f5c0b --- /dev/null +++ b/steering/speaker_emotions_mect60k/report.json @@ -0,0 +1,158 @@ +{ + "angry": { + "norm": 1.0596890887233845, + "removed_share": 0.0005207913225800942, + "pairs": [ + { + "pair": [ + { + "style": "anger" + }, + { + "style": "neutral" + } + ], + "train_speakers": [ + 79, + 79 + ], + "held_out_speakers": [ + 28, + 28 + ], + "held_out_auc": 1.0, + "cos_with_direction": 0.999739570426929 + } + ] + }, + "sad": { + "norm": 0.6941092554111131, + "removed_share": 0.015428586551108348, + "pairs": [ + { + "pair": [ + { + "style": "sadness" + }, + { + "style": "neutral" + } + ], + "train_speakers": [ + 79, + 79 + ], + "held_out_speakers": [ + 28, + 28 + ], + "held_out_auc": 0.9846938775510204, + "cos_with_direction": 0.9922557197864328 + } + ] + }, + "happy": { + "norm": 0.7464997821482542, + "removed_share": 0.029723891857365015, + "pairs": [ + { + "pair": [ + { + "style": "amusement" + }, + { + "style": "neutral" + } + ], + "train_speakers": [ + 79, + 79 + ], + "held_out_speakers": [ + 28, + 28 + ], + "held_out_auc": 0.9936224489795918, + "cos_with_direction": 0.9850259428779705 + } + ] + }, + "fearful": { + "norm": 0.9065878465855942, + "removed_share": 0.007604743483358711, + "pairs": [ + { + "pair": [ + { + "style": "fear" + }, + { + "style": "neutral" + } + ], + "train_speakers": [ + 79, + 79 + ], + "held_out_speakers": [ + 28, + 28 + ], + "held_out_auc": 1.0, + "cos_with_direction": 0.9961903716241396 + } + ] + }, + "disgusted": { + "norm": 0.9784041116068823, + "removed_share": 0.0014086687968790645, + "pairs": [ + { + "pair": [ + { + "style": "disgust" + }, + { + "style": "neutral" + } + ], + "train_speakers": [ + 79, + 79 + ], + "held_out_speakers": [ + 28, + 28 + ], + "held_out_auc": 0.9987244897959183, + "cos_with_direction": 0.9992954173832285 + } + ] + }, + "surprised": { + "norm": 0.7549633561679097, + "removed_share": 0.007241204422737235, + "pairs": [ + { + "pair": [ + { + "style": "amazement" + }, + { + "style": "neutral" + } + ], + "train_speakers": [ + 79, + 79 + ], + "held_out_speakers": [ + 28, + 28 + ], + "held_out_auc": 0.9923469387755102, + "cos_with_direction": 0.9963728195696944 + } + ] + } +} diff --git a/steering/speaker_emotions_mect60k/sad.npy b/steering/speaker_emotions_mect60k/sad.npy new file mode 100644 index 0000000000000000000000000000000000000000..863cbf9f7a46086b148b2efb7a77a50d1fece65a --- /dev/null +++ b/steering/speaker_emotions_mect60k/sad.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8bd930f2ee9dae78aa777acfc385fdeb75f97c4ec6980343b65752e6e8b63fdd +size 896 diff --git a/steering/speaker_emotions_mect60k/spec.json b/steering/speaker_emotions_mect60k/spec.json new file mode 100644 index 0000000000000000000000000000000000000000..9ee81d1066d736cde138f061fc5bb55abe034314 --- /dev/null +++ b/steering/speaker_emotions_mect60k/spec.json @@ -0,0 +1,88 @@ +{ + "space": "raw", + "group_by": "clip", + "center": "speaker", + "directions": { + "angry": { + "pairs": [ + [ + { + "style": "anger" + }, + { + "style": "neutral" + } + ] + ], + "kind": "named" + }, + "sad": { + "pairs": [ + [ + { + "style": "sadness" + }, + { + "style": "neutral" + } + ] + ], + "kind": "named" + }, + "happy": { + "pairs": [ + [ + { + "style": "amusement" + }, + { + "style": "neutral" + } + ] + ], + "kind": "named" + }, + "fearful": { + "pairs": [ + [ + { + "style": "fear" + }, + { + "style": "neutral" + } + ] + ], + "kind": "named" + }, + "disgusted": { + "pairs": [ + [ + { + "style": "disgust" + }, + { + "style": "neutral" + } + ] + ], + "kind": "named" + }, + "surprised": { + "pairs": [ + [ + { + "style": "amazement" + }, + { + "style": "neutral" + } + ] + ], + "kind": "named" + } + }, + "orthogonal_to": [ + "/data/groups/audio/sofian/bingua2-gdn-emotion/minisgl/speaker_attributes_mect60k" + ] +} \ No newline at end of file diff --git a/steering/speaker_emotions_mect60k/surprised.npy b/steering/speaker_emotions_mect60k/surprised.npy new file mode 100644 index 0000000000000000000000000000000000000000..282e7609036115d49506fc51822466301c4b9f1c --- /dev/null +++ b/steering/speaker_emotions_mect60k/surprised.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4ae2bdb4593246c0d673a951e2ab4112bb058a0302c332c80d72d496a684a757 +size 896 diff --git a/steering/speaker_traits_mect60k/age.npy b/steering/speaker_traits_mect60k/age.npy new file mode 100644 index 0000000000000000000000000000000000000000..4db4c2c85bff5d9f3f113a8334bc28b0cdf886db --- /dev/null +++ b/steering/speaker_traits_mect60k/age.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cce35e64e6525a9e75e204c1ecf7419efb2651e0bd040a65599648e1b6467028 +size 896 diff --git a/steering/speaker_traits_mect60k/american.npy b/steering/speaker_traits_mect60k/american.npy new file mode 100644 index 0000000000000000000000000000000000000000..06584fb348aaab05d09068621d7fb2aa8549ebaf --- /dev/null +++ b/steering/speaker_traits_mect60k/american.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a3330130880cc42734a6976fe196de30fcc42c9a84dd4674313ca92b3acd6b67 +size 896 diff --git a/steering/speaker_traits_mect60k/australian.npy b/steering/speaker_traits_mect60k/australian.npy new file mode 100644 index 0000000000000000000000000000000000000000..3e70d7d91bf179166095db8243e9d512be75d55f --- /dev/null +++ b/steering/speaker_traits_mect60k/australian.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5b923db90a566fee437462db2fe2e21cbd84471b697a5f8af8ff8f8a7759d97b +size 896 diff --git a/steering/speaker_traits_mect60k/authoritative.npy b/steering/speaker_traits_mect60k/authoritative.npy new file mode 100644 index 0000000000000000000000000000000000000000..9b744c7dcbd6cb4a8e71f31b5866032329183c56 --- /dev/null +++ b/steering/speaker_traits_mect60k/authoritative.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:599d8ce697957a19aebdb88f13bc58ff8a006818e4900af79e3af2e0d3e622a3 +size 896 diff --git a/steering/speaker_traits_mect60k/british.npy b/steering/speaker_traits_mect60k/british.npy new file mode 100644 index 0000000000000000000000000000000000000000..9eea5fd5dbe433fd2f2138b18f4526ce34d681b2 --- /dev/null +++ b/steering/speaker_traits_mect60k/british.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5b5d5ed002ca179e49c2fdd2cae32fbcad1c6658b384a130a21bde2f4cf77ef7 +size 896 diff --git a/steering/speaker_traits_mect60k/clean.npy b/steering/speaker_traits_mect60k/clean.npy new file mode 100644 index 0000000000000000000000000000000000000000..13198e45cb2abfa84729a89cbd8bf1722da2148e --- /dev/null +++ b/steering/speaker_traits_mect60k/clean.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cf7bade0544633eb8317d02e626b8d1824887f2b9984e9c2fb7f489c65a995de +size 896 diff --git a/steering/speaker_traits_mect60k/deep.npy b/steering/speaker_traits_mect60k/deep.npy new file mode 100644 index 0000000000000000000000000000000000000000..11c2e62d09dc3e0cbf68ec9c9b0cdf910c751bf3 --- /dev/null +++ b/steering/speaker_traits_mect60k/deep.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b8a9096b4aecb0135eadaea625be5a11f21d02af8de4d94ddfd245842e9eba97 +size 896 diff --git a/steering/speaker_traits_mect60k/eval_summary.json b/steering/speaker_traits_mect60k/eval_summary.json new file mode 100644 index 0000000000000000000000000000000000000000..895617c88adb250745f12a2a5ab4d67af1c08824 --- /dev/null +++ b/steering/speaker_traits_mect60k/eval_summary.json @@ -0,0 +1,1969 @@ +{ + "all": { + "neutral": { + "wer": 0.004866946778711485, + "collapse": 0.0, + "identity": 0.9463956918186919, + "durx": 1.0, + "female": 0.4983073752615989, + "age": 41.317688735822834, + "f0": 136.19757792145845, + "f0_st": 2.903048200564409, + "voiced": 0.6307535235563585, + "rms_db": -38.16175572077433, + "snr_db": 39.82410788536072, + "bandwidth": 8300.152587890625, + "accent:Scottish": 0.0038395833333333324, + "accent:Scottish@1": 0.0, + "accent:Oceania": 0.08413458333333333, + "accent:Oceania@1": 0.08333333333333333, + "accent:English": 0.3197375, + "accent:English@1": 0.3333333333333333, + "accent:Irish": 0.001593333333333333, + "accent:Irish@1": 0.0, + "accent:South Asia": 0.0005195833333333333, + "accent:South Asia@1": 0.0, + "accent:North America": 0.25191125000000003, + "accent:North America@1": 0.25, + "quality:deep": 0.2347025, + "quality:raspy": 0.05948625, + "quality:soft": 0.25702625, + "quality:authoritative": 0.5381658333333333, + "flow:disfluent": 0.09457541666666668 + }, + "elderly Scottish narrator": { + "wer": 0.0012254901960784314, + "collapse": 0.0, + "identity": 0.6985881874327523, + "durx": 1.087187751813054, + "female": 0.5012031382066198, + "age": 45.978937981029354, + "f0": 116.99216657950232, + "f0_st": 2.1137352665304108, + "voiced": 0.6594781872016718, + "rms_db": -35.31897266705831, + "snr_db": 40.419919888178505, + "bandwidth": 8458.511352539062, + "accent:Scottish": 0.03578833333333333, + "accent:Scottish@1": 0.041666666666666664, + "accent:Oceania": 0.23508041666666668, + "accent:Oceania@1": 0.20833333333333334, + "accent:English": 0.517055, + "accent:English@1": 0.5416666666666666, + "accent:Irish": 0.0015445833333333334, + "accent:Irish@1": 0.0, + "accent:South Asia": 0.00053125, + "accent:South Asia@1": 0.0, + "accent:North America": 0.006989583333333334, + "accent:North America@1": 0.0, + "quality:deep": 0.23807083333333331, + "quality:raspy": 0.07277166666666668, + "quality:soft": 0.21794, + "quality:authoritative": 0.5588700000000001, + "flow:disfluent": 0.10399541666666667 + }, + "young Australian": { + "wer": 0.010871087565460966, + "collapse": 0.0, + "identity": 0.6418856619202374, + "durx": 0.8844845630559917, + "female": 0.371365116899445, + "age": 23.638162886102993, + "f0": 134.26485852844644, + "f0_st": 2.620659968790983, + "voiced": 0.5837382090907696, + "rms_db": -40.93819737434387, + "snr_db": 39.19957701365153, + "bandwidth": 8784.201049804688, + "accent:Scottish": 0.00147375, + "accent:Scottish@1": 0.0, + "accent:Oceania": 0.33816666666666667, + "accent:Oceania@1": 0.3333333333333333, + "accent:English": 0.6337733333333333, + "accent:English@1": 0.6666666666666666, + "accent:Irish": 6.708333333333334e-05, + "accent:Irish@1": 0.0, + "accent:South Asia": 2.083333333333334e-06, + "accent:South Asia@1": 0.0, + "accent:North America": 0.011855416666666667, + "accent:North America@1": 0.0, + "quality:deep": 0.12986708333333333, + "quality:raspy": 0.006548333333333333, + "quality:soft": 0.3928766666666667, + "quality:authoritative": 0.3947775, + "flow:disfluent": 0.09456999999999999 + }, + "gravelly old man": { + "wer": 0.007094943240454076, + "collapse": 0.0, + "identity": 0.5860428495793947, + "durx": 1.1488269794721409, + "female": 0.12980453202423328, + "age": 58.89795683324337, + "f0": 81.5798050751314, + "f0_st": 2.6711379831781628, + "voiced": 0.5919696134851119, + "rms_db": -39.17392532030741, + "snr_db": 31.018086751302082, + "bandwidth": 9500.180053710938, + "accent:Scottish": 0.04202, + "accent:Scottish@1": 0.041666666666666664, + "accent:Oceania": 0.10368333333333335, + "accent:Oceania@1": 0.125, + "accent:English": 0.20004625, + "accent:English@1": 0.16666666666666666, + "accent:Irish": 0.036740833333333334, + "accent:Irish@1": 0.041666666666666664, + "accent:South Asia": 0.003841666666666667, + "accent:South Asia@1": 0.0, + "accent:North America": 0.2332875, + "accent:North America@1": 0.25, + "quality:deep": 0.43182208333333333, + "quality:raspy": 0.3561791666666667, + "quality:soft": 0.0749725, + "quality:authoritative": 0.7120908333333333, + "flow:disfluent": 0.18185958333333332 + }, + "BBC newsreader": { + "wer": 0.009287925696594427, + "collapse": 0.0, + "identity": 0.7089272349727693, + "durx": 0.9822811197141157, + "female": 0.48794865731179016, + "age": 47.80736826360226, + "f0": 155.82922236601976, + "f0_st": 4.063129483635406, + "voiced": 0.6295857221994858, + "rms_db": -31.78644887606303, + "snr_db": 53.76423740386963, + "bandwidth": 7217.2119140625, + "accent:Scottish": 0.0090825, + "accent:Scottish@1": 0.0, + "accent:Oceania": 0.023925416666666668, + "accent:Oceania@1": 0.041666666666666664, + "accent:English": 0.7831275, + "accent:English@1": 0.7916666666666666, + "accent:Irish": 2.625e-05, + "accent:Irish@1": 0.0, + "accent:South Asia": 3.3333333333333337e-06, + "accent:South Asia@1": 0.0, + "accent:North America": 0.0012766666666666666, + "accent:North America@1": 0.0, + "quality:deep": 0.1604391666666667, + "quality:raspy": 0.02713125, + "quality:soft": 0.14249833333333337, + "quality:authoritative": 0.7861008333333332, + "flow:disfluent": 0.08158458333333334 + }, + "soft-spoken Irish woman": { + "wer": 0.0036764705882352936, + "collapse": 0.0, + "identity": 0.6239679109792077, + "durx": 0.9391534391534391, + "female": 0.7862598139909096, + "age": 36.89948028574387, + "f0": 176.79571099597663, + "f0_st": 2.348344250046529, + "voiced": 0.7384780857146286, + "rms_db": -41.326592206954956, + "snr_db": 36.895348151524864, + "bandwidth": 8050.726318359375, + "accent:Scottish": 0.18326999999999996, + "accent:Scottish@1": 0.16666666666666666, + "accent:Oceania": 0.058758333333333336, + "accent:Oceania@1": 0.041666666666666664, + "accent:English": 0.38713916666666665, + "accent:English@1": 0.4166666666666667, + "accent:Irish": 0.15584166666666668, + "accent:Irish@1": 0.16666666666666666, + "accent:South Asia": 0.0008083333333333333, + "accent:South Asia@1": 0.0, + "accent:North America": 0.019926666666666665, + "accent:North America@1": 0.0, + "quality:deep": 0.08422083333333334, + "quality:raspy": 0.04628208333333333, + "quality:soft": 0.4007316666666667, + "quality:authoritative": 0.4962120833333333, + "flow:disfluent": 0.076995 + }, + "Indian English caller": { + "wer": 0.025956835823574286, + "collapse": 0.0, + "identity": 0.6542116010673639, + "durx": 0.8309803921568628, + "female": 0.5011505371779398, + "age": 35.16472248981396, + "f0": 162.05162581760206, + "f0_st": 2.6430419703052848, + "voiced": 0.7444670372240214, + "rms_db": -38.35785245895386, + "snr_db": 29.035205284754436, + "bandwidth": 8942.111206054688, + "accent:Scottish": 0.039656250000000004, + "accent:Scottish@1": 0.08333333333333333, + "accent:Oceania": 0.030289583333333328, + "accent:Oceania@1": 0.041666666666666664, + "accent:English": 0.026667499999999997, + "accent:English@1": 0.0, + "accent:Irish": 0.0007287499999999999, + "accent:Irish@1": 0.0, + "accent:South Asia": 0.7492212500000001, + "accent:South Asia@1": 0.7916666666666666, + "accent:North America": 0.00504, + "accent:North America@1": 0.0, + "quality:deep": 0.3165645833333333, + "quality:raspy": 0.05302166666666666, + "quality:soft": 0.17639458333333333, + "quality:authoritative": 0.05561708333333334, + "flow:disfluent": 0.08231875 + }, + "Indian English caller + conversational": { + "wer": 0.03142815478594183, + "collapse": 0.0, + "identity": 0.6448889728377106, + "durx": 0.8614330874604847, + "female": 0.5044833242427558, + "age": 35.18859501928091, + "f0": 160.41860167734882, + "f0_st": 2.5696564872056693, + "voiced": 0.7685426779790462, + "rms_db": -35.28194419542948, + "snr_db": 26.797032356262207, + "bandwidth": 9079.385375976562, + "accent:Scottish": 0.00828875, + "accent:Scottish@1": 0.0, + "accent:Oceania": 0.009973333333333336, + "accent:Oceania@1": 0.0, + "accent:English": 0.03563416666666667, + "accent:English@1": 0.041666666666666664, + "accent:Irish": 0.00043916666666666675, + "accent:Irish@1": 0.0, + "accent:South Asia": 0.6755108333333334, + "accent:South Asia@1": 0.75, + "accent:North America": 0.0075425000000000015, + "accent:North America@1": 0.0, + "quality:deep": 0.2990125, + "quality:raspy": 0.059249166666666665, + "quality:soft": 0.2146479166666667, + "quality:authoritative": 0.030754583333333335, + "flow:disfluent": 0.12238916666666666 + }, + "BBC newsreader + slow": { + "wer": 0.0012254901960784314, + "collapse": 0.0, + "identity": 0.7247901773354672, + "durx": 1.4074025974025974, + "female": 0.4975615980705091, + "age": 53.21816330154737, + "f0": 143.17108320070918, + "f0_st": 4.297872665975206, + "voiced": 0.6093130501521247, + "rms_db": -36.963168938954674, + "snr_db": 56.681283950805664, + "bandwidth": 7253.1005859375, + "accent:Scottish": 0.00959125, + "accent:Scottish@1": 0.0, + "accent:Oceania": 0.0046008333333333335, + "accent:Oceania@1": 0.0, + "accent:English": 0.3100504166666667, + "accent:English@1": 0.2916666666666667, + "accent:Irish": 0.00013, + "accent:Irish@1": 0.0, + "accent:South Asia": 1.3750000000000002e-05, + "accent:South Asia@1": 0.0, + "accent:North America": 0.0011125, + "accent:North America@1": 0.0, + "quality:deep": 0.13496958333333334, + "quality:raspy": 0.00255375, + "quality:soft": 0.12589291666666666, + "quality:authoritative": 0.8259924999999999, + "flow:disfluent": 0.15317 + } + }, + "American Female": { + "neutral": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.950361505518176, + "durx": 1.0, + "female": 0.9827781617641449, + "age": 29.750093817710876, + "f0": 155.81481265779422, + "f0_st": 1.8082626788764102, + "voiced": 0.678813494199399, + "rms_db": -29.80318832397461, + "snr_db": 38.62734889984131, + "bandwidth": 6026.605224609375, + "accent:Scottish": 0.001815, + "accent:Scottish@1": 0.0, + "accent:Oceania": 0.0029500000000000004, + "accent:Oceania@1": 0.0, + "accent:English": 0.00253, + "accent:English@1": 0.0, + "accent:Irish": 0.004382499999999999, + "accent:Irish@1": 0.0, + "accent:South Asia": 0.002165, + "accent:South Asia@1": 0.0, + "accent:North America": 0.6207725, + "accent:North America@1": 0.75, + "quality:deep": 0.0, + "quality:raspy": 0.0, + "quality:soft": 3.9999999999999996e-05, + "quality:authoritative": 0.0217975, + "flow:disfluent": 0.08399 + }, + "elderly Scottish narrator": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.5365288847218599, + "durx": 0.9658928571428571, + "female": 0.9978477358818054, + "age": 45.0870081782341, + "f0": 140.6335626718801, + "f0_st": 1.0453841297921136, + "voiced": 0.7023306232501975, + "rms_db": -27.13599920272827, + "snr_db": 37.461607933044434, + "bandwidth": 6521.868896484375, + "accent:Scottish": 0.13087249999999997, + "accent:Scottish@1": 0.25, + "accent:Oceania": 0.000465, + "accent:Oceania@1": 0.0, + "accent:English": 0.10497000000000001, + "accent:English@1": 0.0, + "accent:Irish": 0.005475, + "accent:Irish@1": 0.0, + "accent:South Asia": 0.0028374999999999997, + "accent:South Asia@1": 0.0, + "accent:North America": 0.0019299999999999999, + "accent:North America@1": 0.0, + "quality:deep": 0.0632375, + "quality:raspy": 0.00249, + "quality:soft": 0.028069999999999998, + "quality:authoritative": 0.1115275, + "flow:disfluent": 0.1486525 + }, + "young Australian": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.6775422965045921, + "durx": 0.878655462184874, + "female": 0.9165904223918915, + "age": 22.7391816675663, + "f0": 173.15584796832866, + "f0_st": 1.927502023403403, + "voiced": 0.6906969536559268, + "rms_db": -27.749372005462646, + "snr_db": 50.256367683410645, + "bandwidth": 5550.18310546875, + "accent:Scottish": 0.00058, + "accent:Scottish@1": 0.0, + "accent:Oceania": 0.47686249999999997, + "accent:Oceania@1": 0.5, + "accent:English": 0.5055425, + "accent:English@1": 0.5, + "accent:Irish": 1e-05, + "accent:Irish@1": 0.0, + "accent:South Asia": 5e-06, + "accent:South Asia@1": 0.0, + "accent:North America": 0.00399, + "accent:North America@1": 0.0, + "quality:deep": 0.0, + "quality:raspy": 2.5e-06, + "quality:soft": 0.0082325, + "quality:authoritative": 0.0140025, + "flow:disfluent": 0.10040500000000002 + }, + "gravelly old man": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.49757462943579905, + "durx": 0.8852328431372549, + "female": 0.28725425340235233, + "age": 64.9148240685463, + "f0": 78.60815054452983, + "f0_st": 2.271955204241912, + "voiced": 0.5676038157599105, + "rms_db": -28.050464153289795, + "snr_db": 24.834474563598633, + "bandwidth": 6820.64208984375, + "accent:Scottish": 0.016697500000000004, + "accent:Scottish@1": 0.0, + "accent:Oceania": 0.0066775, + "accent:Oceania@1": 0.0, + "accent:English": 0.001205, + "accent:English@1": 0.0, + "accent:Irish": 0.037009999999999994, + "accent:Irish@1": 0.0, + "accent:South Asia": 0.007075, + "accent:South Asia@1": 0.0, + "accent:North America": 0.504275, + "accent:North America@1": 0.5, + "quality:deep": 0.023039999999999998, + "quality:raspy": 0.2653775, + "quality:soft": 0.1333025, + "quality:authoritative": 0.6277575, + "flow:disfluent": 0.18610749999999998 + }, + "BBC newsreader": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.6347936074986075, + "durx": 1.0762867647058822, + "female": 0.9951957911252975, + "age": 41.59233644604683, + "f0": 174.71234813432548, + "f0_st": 3.6089091641201314, + "voiced": 0.6321467129791669, + "rms_db": -32.27383804321289, + "snr_db": 59.58210849761963, + "bandwidth": 5730.523681640625, + "accent:Scottish": 0.00093, + "accent:Scottish@1": 0.0, + "accent:Oceania": 0.0014525, + "accent:Oceania@1": 0.0, + "accent:English": 0.45945749999999996, + "accent:English@1": 0.5, + "accent:Irish": 5e-06, + "accent:Irish@1": 0.0, + "accent:South Asia": 2.5e-06, + "accent:South Asia@1": 0.0, + "accent:North America": 0.000255, + "accent:North America@1": 0.0, + "quality:deep": 5e-06, + "quality:raspy": 0.0, + "quality:soft": 0.002045, + "quality:authoritative": 0.5229174999999999, + "flow:disfluent": 0.10025250000000001 + }, + "soft-spoken Irish woman": { + "wer": 0.007352941176470588, + "collapse": 0.0, + "identity": 0.744583287994466, + "durx": 0.8746936274509803, + "female": 0.991122230887413, + "age": 30.04293069243431, + "f0": 180.64700493606364, + "f0_st": 1.9274477477911416, + "voiced": 0.764331859722712, + "rms_db": -34.552833557128906, + "snr_db": 36.165677070617676, + "bandwidth": 6850.250244140625, + "accent:Scottish": 0.135085, + "accent:Scottish@1": 0.0, + "accent:Oceania": 0.0010975, + "accent:Oceania@1": 0.0, + "accent:English": 0.004232499999999999, + "accent:English@1": 0.0, + "accent:Irish": 0.8475474999999999, + "accent:Irish@1": 1.0, + "accent:South Asia": 0.0002375, + "accent:South Asia@1": 0.0, + "accent:North America": 0.00466, + "accent:North America@1": 0.0, + "quality:deep": 0.00035, + "quality:raspy": 1e-05, + "quality:soft": 0.00248, + "quality:authoritative": 0.290775, + "flow:disfluent": 0.07352500000000001 + }, + "Indian English caller": { + "wer": 0.014705882352941176, + "collapse": 0.0, + "identity": 0.6480024649937657, + "durx": 0.846218487394958, + "female": 0.9932140409946442, + "age": 31.354450434446335, + "f0": 165.23938283566048, + "f0_st": 2.3547296677093312, + "voiced": 0.7615566895614369, + "rms_db": -31.26106882095337, + "snr_db": 32.38363027572632, + "bandwidth": 6712.97607421875, + "accent:Scottish": 0.0, + "accent:Scottish@1": 0.0, + "accent:Oceania": 0.0, + "accent:Oceania@1": 0.0, + "accent:English": 0.00023, + "accent:English@1": 0.0, + "accent:Irish": 0.0, + "accent:Irish@1": 0.0, + "accent:South Asia": 0.99968, + "accent:South Asia@1": 1.0, + "accent:North America": 2e-05, + "accent:North America@1": 0.0, + "quality:deep": 0.001755, + "quality:raspy": 0.000475, + "quality:soft": 0.0010674999999999999, + "quality:authoritative": 1e-05, + "flow:disfluent": 0.078295 + }, + "Indian English caller + conversational": { + "wer": 0.02557544757033248, + "collapse": 0.0, + "identity": 0.6201276318312297, + "durx": 0.8314583333333334, + "female": 0.9937090575695038, + "age": 32.14881047606468, + "f0": 167.71285700380562, + "f0_st": 1.8061346521569657, + "voiced": 0.7710109046026571, + "rms_db": -26.728106021881104, + "snr_db": 29.384589195251465, + "bandwidth": 7439.7216796875, + "accent:Scottish": 5e-06, + "accent:Scottish@1": 0.0, + "accent:Oceania": 0.0, + "accent:Oceania@1": 0.0, + "accent:English": 0.00053, + "accent:English@1": 0.0, + "accent:Irish": 0.0, + "accent:Irish@1": 0.0, + "accent:South Asia": 0.9991725, + "accent:South Asia@1": 1.0, + "accent:North America": 5e-06, + "accent:North America@1": 0.0, + "quality:deep": 0.038930000000000006, + "quality:raspy": 8.75e-05, + "quality:soft": 0.00078, + "quality:authoritative": 1.75e-05, + "flow:disfluent": 0.0897675 + }, + "BBC newsreader + slow": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.6163020400766265, + "durx": 1.68890756302521, + "female": 0.9966180175542831, + "age": 46.63320481777191, + "f0": 163.1922102936694, + "f0_st": 4.570817118115658, + "voiced": 0.6471064322633658, + "rms_db": -31.856355667114258, + "snr_db": 68.97173500061035, + "bandwidth": 5423.675537109375, + "accent:Scottish": 0.0001925, + "accent:Scottish@1": 0.0, + "accent:Oceania": 1e-05, + "accent:Oceania@1": 0.0, + "accent:English": 0.0166375, + "accent:English@1": 0.0, + "accent:Irish": 0.0, + "accent:Irish@1": 0.0, + "accent:South Asia": 2.5e-06, + "accent:South Asia@1": 0.0, + "accent:North America": 1.5e-05, + "accent:North America@1": 0.0, + "quality:deep": 0.0, + "quality:raspy": 0.0, + "quality:soft": 0.000165, + "quality:authoritative": 0.34717, + "flow:disfluent": 0.24752 + } + }, + "American Male": { + "neutral": { + "wer": 0.007352941176470588, + "collapse": 0.0, + "identity": 0.944281897024579, + "durx": 1.0, + "female": 0.0021247467666398734, + "age": 48.121464252471924, + "f0": 116.91828356269122, + "f0_st": 4.913690931254914, + "voiced": 0.4680676167050811, + "rms_db": -43.39509105682373, + "snr_db": 39.194278717041016, + "bandwidth": 8204.150390625, + "accent:Scottish": 4.7499999999999996e-05, + "accent:Scottish@1": 0.0, + "accent:Oceania": 0.014735000000000002, + "accent:Oceania@1": 0.0, + "accent:English": 3.2500000000000004e-05, + "accent:English@1": 0.0, + "accent:Irish": 0.0008775, + "accent:Irish@1": 0.0, + "accent:South Asia": 0.0004775, + "accent:South Asia@1": 0.0, + "accent:North America": 0.536065, + "accent:North America@1": 0.5, + "quality:deep": 0.0153025, + "quality:raspy": 0.054255, + "quality:soft": 8.75e-05, + "quality:authoritative": 0.937925, + "flow:disfluent": 0.06804500000000001 + }, + "elderly Scottish narrator": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.6845711807318879, + "durx": 1.1188556067588324, + "female": 0.0023250110680237412, + "age": 50.199856609106064, + "f0": 81.75093126990356, + "f0_st": 1.9558179322595115, + "voiced": 0.6199073117756191, + "rms_db": -38.62241744995117, + "snr_db": 39.042917251586914, + "bandwidth": 6723.74267578125, + "accent:Scottish": 0.0136225, + "accent:Scottish@1": 0.0, + "accent:Oceania": 0.6516649999999999, + "accent:Oceania@1": 0.75, + "accent:English": 0.13644, + "accent:English@1": 0.0, + "accent:Irish": 0.0022825, + "accent:Irish@1": 0.0, + "accent:South Asia": 0.00031999999999999997, + "accent:South Asia@1": 0.0, + "accent:North America": 0.029055, + "accent:North America@1": 0.0, + "quality:deep": 0.18741, + "quality:raspy": 0.049272500000000004, + "quality:soft": 0.000155, + "quality:authoritative": 0.9412874999999999, + "flow:disfluent": 0.11051 + }, + "young Australian": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.6134139710676767, + "durx": 0.8193164362519201, + "female": 0.0011422570678405464, + "age": 24.055025726556778, + "f0": 112.67611894245552, + "f0_st": 2.710673032319517, + "voiced": 0.40820054972049524, + "rms_db": -44.25302982330322, + "snr_db": 29.85602855682373, + "bandwidth": 7579.6875, + "accent:Scottish": 0.0021650000000000003, + "accent:Scottish@1": 0.0, + "accent:Oceania": 0.551815, + "accent:Oceania@1": 0.5, + "accent:English": 0.42277999999999993, + "accent:English@1": 0.5, + "accent:Irish": 1.25e-05, + "accent:Irish@1": 0.0, + "accent:South Asia": 2.5e-06, + "accent:South Asia@1": 0.0, + "accent:North America": 0.0185525, + "accent:North America@1": 0.0, + "quality:deep": 0.2722325, + "quality:raspy": 0.0057675, + "quality:soft": 0.078335, + "quality:authoritative": 0.5942575, + "flow:disfluent": 0.09761249999999999 + }, + "gravelly old man": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.7295827648088394, + "durx": 1.2269866247049568, + "female": 0.005355951958335936, + "age": 64.01287615299225, + "f0": 81.6304613958878, + "f0_st": 3.2240474334384066, + "voiced": 0.584824796543443, + "rms_db": -44.211849212646484, + "snr_db": 25.301388263702393, + "bandwidth": 9140.8447265625, + "accent:Scottish": 5.5e-05, + "accent:Scottish@1": 0.0, + "accent:Oceania": 0.006554999999999999, + "accent:Oceania@1": 0.0, + "accent:English": 0.00016, + "accent:English@1": 0.0, + "accent:Irish": 0.001175, + "accent:Irish@1": 0.0, + "accent:South Asia": 0.0023425, + "accent:South Asia@1": 0.0, + "accent:North America": 0.218175, + "accent:North America@1": 0.25, + "quality:deep": 0.162995, + "quality:raspy": 0.2184225, + "quality:soft": 7.500000000000001e-05, + "quality:authoritative": 0.8043750000000001, + "flow:disfluent": 0.1695775 + }, + "BBC newsreader": { + "wer": 0.02631578947368421, + "collapse": 0.0, + "identity": 0.6678989596755638, + "durx": 0.9196826645685812, + "female": 0.001380276444251649, + "age": 54.83396351337433, + "f0": 131.42173878944527, + "f0_st": 4.060690764749249, + "voiced": 0.424307802990783, + "rms_db": -36.92001152038574, + "snr_db": 46.38183403015137, + "bandwidth": 6922.9248046875, + "accent:Scottish": 0.0183725, + "accent:Scottish@1": 0.0, + "accent:Oceania": 0.12759500000000001, + "accent:Oceania@1": 0.25, + "accent:English": 0.56439, + "accent:English@1": 0.5, + "accent:Irish": 7.75e-05, + "accent:Irish@1": 0.0, + "accent:South Asia": 1.25e-05, + "accent:South Asia@1": 0.0, + "accent:North America": 0.00601, + "accent:North America@1": 0.0, + "quality:deep": 0.07123249999999999, + "quality:raspy": 0.0061975, + "quality:soft": 4.7499999999999996e-05, + "quality:authoritative": 0.9725225, + "flow:disfluent": 0.07703750000000001 + }, + "soft-spoken Irish woman": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.4269012127153616, + "durx": 0.8928571428571429, + "female": 0.9985566139221191, + "age": 44.807516038417816, + "f0": 165.0868385815381, + "f0_st": 2.426979128988463, + "voiced": 0.675373895239742, + "rms_db": -43.248229026794434, + "snr_db": 23.100913047790527, + "bandwidth": 7342.822265625, + "accent:Scottish": 0.145, + "accent:Scottish@1": 0.0, + "accent:Oceania": 0.07145499999999999, + "accent:Oceania@1": 0.0, + "accent:English": 0.163945, + "accent:English@1": 0.25, + "accent:Irish": 0.0013, + "accent:Irish@1": 0.0, + "accent:South Asia": 0.004255, + "accent:South Asia@1": 0.0, + "accent:North America": 0.042115, + "accent:North America@1": 0.0, + "quality:deep": 0.01426, + "quality:raspy": 7.000000000000001e-05, + "quality:soft": 0.0852675, + "quality:authoritative": 0.6563525, + "flow:disfluent": 0.058655 + }, + "Indian English caller": { + "wer": 0.06079216583658635, + "collapse": 0.0, + "identity": 0.6436404631171599, + "durx": 0.7859062980030722, + "female": 0.00178624848194886, + "age": 38.53149265050888, + "f0": 127.37489745095937, + "f0_st": 3.0395791321629426, + "voiced": 0.7101881901105348, + "rms_db": -42.322184562683105, + "snr_db": 24.73225975036621, + "bandwidth": 9261.968994140625, + "accent:Scottish": 0.0, + "accent:Scottish@1": 0.0, + "accent:Oceania": 0.0, + "accent:Oceania@1": 0.0, + "accent:English": 2.5e-06, + "accent:English@1": 0.0, + "accent:Irish": 0.0, + "accent:Irish@1": 0.0, + "accent:South Asia": 0.999995, + "accent:South Asia@1": 1.0, + "accent:North America": 2.5e-06, + "accent:North America@1": 0.0, + "quality:deep": 0.9254725000000001, + "quality:raspy": 0.0026275, + "quality:soft": 0.013545000000000001, + "quality:authoritative": 0.0015099999999999998, + "flow:disfluent": 0.079445 + }, + "Indian English caller + conversational": { + "wer": 0.04256965944272446, + "collapse": 0.0, + "identity": 0.6205450480250609, + "durx": 0.9352918586789555, + "female": 0.0018414869555272162, + "age": 38.29915374517441, + "f0": 130.90395509820843, + "f0_st": 2.3955885085395283, + "voiced": 0.7477665392876343, + "rms_db": -36.54498910903931, + "snr_db": 24.88615322113037, + "bandwidth": 9649.566650390625, + "accent:Scottish": 0.0, + "accent:Scottish@1": 0.0, + "accent:Oceania": 0.0, + "accent:Oceania@1": 0.0, + "accent:English": 7.500000000000001e-06, + "accent:English@1": 0.0, + "accent:Irish": 0.0, + "accent:Irish@1": 0.0, + "accent:South Asia": 0.99998, + "accent:South Asia@1": 1.0, + "accent:North America": 5e-06, + "accent:North America@1": 0.0, + "quality:deep": 0.9300775, + "quality:raspy": 0.0039525, + "quality:soft": 0.025679999999999998, + "quality:authoritative": 0.000535, + "flow:disfluent": 0.13706000000000002 + }, + "BBC newsreader + slow": { + "wer": 0.007352941176470588, + "collapse": 0.0, + "identity": 0.7072263714056073, + "durx": 1.2834382376081825, + "female": 0.001274068490602076, + "age": 59.726786613464355, + "f0": 118.47468985351813, + "f0_st": 4.9277916456127615, + "voiced": 0.42785718142515294, + "rms_db": -40.673964500427246, + "snr_db": 47.438008308410645, + "bandwidth": 6982.14111328125, + "accent:Scottish": 0.025257500000000002, + "accent:Scottish@1": 0.0, + "accent:Oceania": 0.022977499999999998, + "accent:Oceania@1": 0.0, + "accent:English": 0.43100499999999997, + "accent:English@1": 0.5, + "accent:Irish": 0.0003825, + "accent:Irish@1": 0.0, + "accent:South Asia": 5.25e-05, + "accent:South Asia@1": 0.0, + "accent:North America": 0.004625, + "accent:North America@1": 0.0, + "quality:deep": 0.0431025, + "quality:raspy": 0.00026250000000000004, + "quality:soft": 5e-06, + "quality:authoritative": 0.99472, + "flow:disfluent": 0.11132249999999999 + } + }, + "British Female": { + "neutral": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9646508989039382, + "durx": 1.0, + "female": 0.9985478520393372, + "age": 48.11074435710907, + "f0": 145.18670227011933, + "f0_st": 3.120616918031748, + "voiced": 0.684659116272671, + "rms_db": -34.987064361572266, + "snr_db": 43.8385124206543, + "bandwidth": 9003.570556640625, + "accent:Scottish": 0.015465, + "accent:Scottish@1": 0.0, + "accent:Oceania": 0.005022499999999999, + "accent:Oceania@1": 0.0, + "accent:English": 0.4138125, + "accent:English@1": 0.5, + "accent:Irish": 3.9999999999999996e-05, + "accent:Irish@1": 0.0, + "accent:South Asia": 1.25e-05, + "accent:South Asia@1": 0.0, + "accent:North America": 0.0002975, + "accent:North America@1": 0.0, + "quality:deep": 5e-06, + "quality:raspy": 0.0, + "quality:soft": 0.005847499999999999, + "quality:authoritative": 0.9470675000000001, + "flow:disfluent": 0.095805 + }, + "elderly Scottish narrator": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.8060865062096365, + "durx": 0.9606741573033708, + "female": 0.9968502223491669, + "age": 49.734754860401154, + "f0": 147.21156843466974, + "f0_st": 1.8954888823560745, + "voiced": 0.71673102935718, + "rms_db": -33.9288330078125, + "snr_db": 48.44528102874756, + "bandwidth": 8949.737548828125, + "accent:Scottish": 0.0198575, + "accent:Scottish@1": 0.0, + "accent:Oceania": 0.004727499999999999, + "accent:Oceania@1": 0.0, + "accent:English": 0.7094025, + "accent:English@1": 0.75, + "accent:Irish": 7.75e-05, + "accent:Irish@1": 0.0, + "accent:South Asia": 5e-06, + "accent:South Asia@1": 0.0, + "accent:North America": 0.000165, + "accent:North America@1": 0.0, + "quality:deep": 0.005355, + "quality:raspy": 3.7500000000000003e-05, + "quality:soft": 0.0397775, + "quality:authoritative": 0.7440325, + "flow:disfluent": 0.089505 + }, + "young Australian": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.7410609765934408, + "durx": 0.9601634320735445, + "female": 0.357936792075634, + "age": 19.108406454324722, + "f0": 119.39596962556692, + "f0_st": 2.8424798702999468, + "voiced": 0.6099557120491379, + "rms_db": -44.11439037322998, + "snr_db": 47.11812686920166, + "bandwidth": 14626.42822265625, + "accent:Scottish": 0.0028725, + "accent:Scottish@1": 0.0, + "accent:Oceania": 0.021492499999999998, + "accent:Oceania@1": 0.0, + "accent:English": 0.939575, + "accent:English@1": 1.0, + "accent:Irish": 0.00011500000000000002, + "accent:Irish@1": 0.0, + "accent:South Asia": 2.5e-06, + "accent:South Asia@1": 0.0, + "accent:North America": 0.0030175, + "accent:North America@1": 0.0, + "quality:deep": 0.0035700000000000003, + "quality:raspy": 6.5e-05, + "quality:soft": 0.400925, + "quality:authoritative": 0.749405, + "flow:disfluent": 0.118395 + }, + "gravelly old man": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.5525408399545527, + "durx": 0.9022812393598911, + "female": 0.45031432062387466, + "age": 61.67828589677811, + "f0": 104.4383695955269, + "f0_st": 3.506121321206394, + "voiced": 0.6626133797400999, + "rms_db": -34.025957107543945, + "snr_db": 38.37714624404907, + "bandwidth": 7402.03857421875, + "accent:Scottish": 0.16529249999999998, + "accent:Scottish@1": 0.25, + "accent:Oceania": 0.024864999999999998, + "accent:Oceania@1": 0.0, + "accent:English": 0.41930500000000004, + "accent:English@1": 0.5, + "accent:Irish": 0.0107, + "accent:Irish@1": 0.0, + "accent:South Asia": 0.0013425, + "accent:South Asia@1": 0.0, + "accent:North America": 0.0054399999999999995, + "accent:North America@1": 0.0, + "quality:deep": 0.2220175, + "quality:raspy": 0.0665575, + "quality:soft": 0.012975, + "quality:authoritative": 0.7978675000000001, + "flow:disfluent": 0.11865500000000001 + }, + "BBC newsreader": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.7426452021514656, + "durx": 0.9202701168993304, + "female": 0.9302252531051636, + "age": 51.25371739268303, + "f0": 172.2659780206687, + "f0_st": 5.153842084155459, + "voiced": 0.6988529355342896, + "rms_db": -28.996329307556152, + "snr_db": 60.503092765808105, + "bandwidth": 7943.060302734375, + "accent:Scottish": 0.0028525, + "accent:Scottish@1": 0.0, + "accent:Oceania": 0.00082, + "accent:Oceania@1": 0.0, + "accent:English": 0.7500199999999999, + "accent:English@1": 0.75, + "accent:Irish": 2.5e-06, + "accent:Irish@1": 0.0, + "accent:South Asia": 0.0, + "accent:South Asia@1": 0.0, + "accent:North America": 4.75e-05, + "accent:North America@1": 0.0, + "quality:deep": 0.042679999999999996, + "quality:raspy": 0.0008925, + "quality:soft": 0.0410875, + "quality:authoritative": 0.950645, + "flow:disfluent": 0.07335749999999999 + }, + "soft-spoken Irish woman": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.7335660684341407, + "durx": 0.8920454545454546, + "female": 0.9982047080993652, + "age": 37.02904358506203, + "f0": 198.0151130712194, + "f0_st": 3.2969295735117106, + "voiced": 0.7210838577748396, + "rms_db": -37.95617437362671, + "snr_db": 43.37228775024414, + "bandwidth": 9103.16162109375, + "accent:Scottish": 0.0039625, + "accent:Scottish@1": 0.0, + "accent:Oceania": 0.0027300000000000002, + "accent:Oceania@1": 0.0, + "accent:English": 0.7544025, + "accent:English@1": 0.75, + "accent:Irish": 5e-05, + "accent:Irish@1": 0.0, + "accent:South Asia": 7.5e-06, + "accent:South Asia@1": 0.0, + "accent:North America": 0.0005225, + "accent:North America@1": 0.0, + "quality:deep": 0.0001475, + "quality:raspy": 1.5000000000000002e-05, + "quality:soft": 0.4026, + "quality:authoritative": 0.71073, + "flow:disfluent": 0.0702825 + }, + "Indian English caller": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.7288113549694533, + "durx": 0.7881701631701632, + "female": 0.9972665756940842, + "age": 39.43835124373436, + "f0": 168.30434027018228, + "f0_st": 3.369897368764845, + "voiced": 0.720191945621116, + "rms_db": -40.338483810424805, + "snr_db": 33.86128234863281, + "bandwidth": 7574.30419921875, + "accent:Scottish": 0.00026250000000000004, + "accent:Scottish@1": 0.0, + "accent:Oceania": 0.000425, + "accent:Oceania@1": 0.0, + "accent:English": 0.0043475, + "accent:English@1": 0.0, + "accent:Irish": 7.500000000000001e-06, + "accent:Irish@1": 0.0, + "accent:South Asia": 0.7356325, + "accent:South Asia@1": 0.75, + "accent:North America": 0.00029, + "accent:North America@1": 0.0, + "quality:deep": 0.03849, + "quality:raspy": 0.0052825, + "quality:soft": 0.20807, + "quality:authoritative": 0.016642499999999998, + "flow:disfluent": 0.06661249999999999 + }, + "Indian English caller + conversational": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.722865753478994, + "durx": 0.810339239412273, + "female": 0.9976761490106583, + "age": 38.816701620817184, + "f0": 165.6698441661354, + "f0_st": 3.7271047711113434, + "voiced": 0.7269858884619752, + "rms_db": -34.19183301925659, + "snr_db": 29.398534297943115, + "bandwidth": 8004.96826171875, + "accent:Scottish": 0.00033249999999999995, + "accent:Scottish@1": 0.0, + "accent:Oceania": 0.0034675, + "accent:Oceania@1": 0.0, + "accent:English": 0.0162525, + "accent:English@1": 0.0, + "accent:Irish": 0.0001525, + "accent:Irish@1": 0.0, + "accent:South Asia": 0.706955, + "accent:South Asia@1": 0.75, + "accent:North America": 0.0021825, + "accent:North America@1": 0.0, + "quality:deep": 0.01644, + "quality:raspy": 0.0176825, + "quality:soft": 0.13629999999999998, + "quality:authoritative": 0.0142275, + "flow:disfluent": 0.0669475 + }, + "BBC newsreader + slow": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.7655492780432137, + "durx": 1.342048401037165, + "female": 0.9823596924543381, + "age": 53.50593775510788, + "f0": 160.32272972070453, + "f0_st": 4.828545752324096, + "voiced": 0.6585236907656207, + "rms_db": -34.44810724258423, + "snr_db": 63.07024383544922, + "bandwidth": 7326.67236328125, + "accent:Scottish": 0.001055, + "accent:Scottish@1": 0.0, + "accent:Oceania": 0.00012, + "accent:Oceania@1": 0.0, + "accent:English": 0.1678825, + "accent:English@1": 0.0, + "accent:Irish": 5e-06, + "accent:Irish@1": 0.0, + "accent:South Asia": 0.0, + "accent:South Asia@1": 0.0, + "accent:North America": 3e-05, + "accent:North America@1": 0.0, + "quality:deep": 0.00074, + "quality:raspy": 0.0, + "quality:soft": 0.00312, + "quality:authoritative": 0.854875, + "flow:disfluent": 0.1350575 + } + }, + "British Male": { + "neutral": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9536403536976914, + "durx": 1.0, + "female": 0.005018519994337112, + "age": 19.837047532200813, + "f0": 88.88241321026631, + "f0_st": 2.4990147456627976, + "voiced": 0.5315726962367779, + "rms_db": -39.36486530303955, + "snr_db": 35.08437442779541, + "bandwidth": 11011.541748046875, + "accent:Scottish": 0.00236, + "accent:Scottish@1": 0.0, + "accent:Oceania": 0.0034825000000000004, + "accent:Oceania@1": 0.0, + "accent:English": 0.993915, + "accent:English@1": 1.0, + "accent:Irish": 1e-05, + "accent:Irish@1": 0.0, + "accent:South Asia": 0.0, + "accent:South Asia@1": 0.0, + "accent:North America": 0.00020750000000000003, + "accent:North America@1": 0.0, + "quality:deep": 0.5986974999999999, + "quality:raspy": 0.046765, + "quality:soft": 0.6038975000000001, + "quality:authoritative": 0.4112175, + "flow:disfluent": 0.0874325 + }, + "elderly Scottish narrator": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.7871253053670688, + "durx": 1.1173469387755102, + "female": 0.007322377001401037, + "age": 24.76569674909115, + "f0": 79.11037694322704, + "f0_st": 2.4479450911967207, + "voiced": 0.5841223348440531, + "rms_db": -42.531447410583496, + "snr_db": 39.76707458496094, + "bandwidth": 12666.90673828125, + "accent:Scottish": 0.03399, + "accent:Scottish@1": 0.0, + "accent:Oceania": 0.0031249999999999997, + "accent:Oceania@1": 0.0, + "accent:English": 0.9579825000000001, + "accent:English@1": 1.0, + "accent:Irish": 0.00055, + "accent:Irish@1": 0.0, + "accent:South Asia": 5e-06, + "accent:South Asia@1": 0.0, + "accent:North America": 0.00047, + "accent:North America@1": 0.0, + "quality:deep": 0.52747, + "quality:raspy": 0.0746975, + "quality:soft": 0.46993, + "quality:authoritative": 0.3490325, + "flow:disfluent": 0.097855 + }, + "young Australian": { + "wer": 0.014705882352941176, + "collapse": 0.0, + "identity": 0.7546694777572254, + "durx": 1.0086580086580086, + "female": 0.002874044585041702, + "age": 20.168887078762054, + "f0": 88.13086884197605, + "f0_st": 2.5249479162249786, + "voiced": 0.47259012556698543, + "rms_db": -53.68616962432861, + "snr_db": 35.49391174316406, + "bandwidth": 10120.60546875, + "accent:Scottish": 0.0023825, + "accent:Scottish@1": 0.0, + "accent:Oceania": 0.054952499999999994, + "accent:Oceania@1": 0.0, + "accent:English": 0.9292799999999999, + "accent:English@1": 1.0, + "accent:Irish": 0.00026500000000000004, + "accent:Irish@1": 0.0, + "accent:South Asia": 2.5e-06, + "accent:South Asia@1": 0.0, + "accent:North America": 0.009787500000000001, + "accent:North America@1": 0.0, + "quality:deep": 0.173035, + "quality:raspy": 0.003675, + "quality:soft": 0.8544099999999999, + "quality:authoritative": 0.2613875, + "flow:disfluent": 0.116315 + }, + "gravelly old man": { + "wer": 0.035216718266253874, + "collapse": 0.0, + "identity": 0.663933298200883, + "durx": 1.18006993006993, + "female": 0.010091255884617567, + "age": 46.241262555122375, + "f0": 63.5714169398247, + "f0_st": 1.5828258447072494, + "voiced": 0.5857167988792432, + "rms_db": -39.137192726135254, + "snr_db": 22.342763900756836, + "bandwidth": 12742.27294921875, + "accent:Scottish": 0.0332775, + "accent:Scottish@1": 0.0, + "accent:Oceania": 0.13923249999999998, + "accent:Oceania@1": 0.25, + "accent:English": 0.5666074999999999, + "accent:English@1": 0.5, + "accent:Irish": 0.020447499999999997, + "accent:Irish@1": 0.0, + "accent:South Asia": 0.0007875, + "accent:South Asia@1": 0.0, + "accent:North America": 0.05799, + "accent:North America@1": 0.0, + "quality:deep": 0.575275, + "quality:raspy": 0.3618825, + "quality:soft": 0.0266175, + "quality:authoritative": 0.77101, + "flow:disfluent": 0.21039000000000002 + }, + "BBC newsreader": { + "wer": 0.014705882352941176, + "collapse": 0.0, + "identity": 0.825939101602821, + "durx": 1.0643939393939392, + "female": 0.004200131166726351, + "age": 35.959578305482864, + "f0": 115.14607373062933, + "f0_st": 4.1167472089769666, + "voiced": 0.6514987966592862, + "rms_db": -34.42813968658447, + "snr_db": 53.92642688751221, + "bandwidth": 8470.623779296875, + "accent:Scottish": 0.00035999999999999997, + "accent:Scottish@1": 0.0, + "accent:Oceania": 0.000165, + "accent:Oceania@1": 0.0, + "accent:English": 0.9994575, + "accent:English@1": 1.0, + "accent:Irish": 0.0, + "accent:Irish@1": 0.0, + "accent:South Asia": 0.0, + "accent:South Asia@1": 0.0, + "accent:North America": 2.5e-06, + "accent:North America@1": 0.0, + "quality:deep": 0.3327025, + "quality:raspy": 0.0073950000000000005, + "quality:soft": 0.3305675, + "quality:authoritative": 0.64356, + "flow:disfluent": 0.0830625 + }, + "soft-spoken Irish woman": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.6703125970309075, + "durx": 1.1420068027210886, + "female": 0.4825366324512288, + "age": 21.23662941157818, + "f0": 129.11157289764145, + "f0_st": 2.610945883710151, + "voiced": 0.6499364436025145, + "rms_db": -46.960622787475586, + "snr_db": 41.32752799987793, + "bandwidth": 9017.02880859375, + "accent:Scottish": 0.11035, + "accent:Scottish@1": 0.0, + "accent:Oceania": 0.001345, + "accent:Oceania@1": 0.0, + "accent:English": 0.88618, + "accent:English@1": 1.0, + "accent:Irish": 0.0010675, + "accent:Irish@1": 0.0, + "accent:South Asia": 2.5e-06, + "accent:South Asia@1": 0.0, + "accent:North America": 0.0007725000000000001, + "accent:North America@1": 0.0, + "quality:deep": 0.10401000000000002, + "quality:raspy": 0.01047, + "quality:soft": 0.6818075, + "quality:authoritative": 0.46337, + "flow:disfluent": 0.0987875 + }, + "Indian English caller": { + "wer": 0.03644501278772379, + "collapse": 0.0, + "identity": 0.7414482229708601, + "durx": 0.8449288806431663, + "female": 0.010385818779468536, + "age": 24.679632857441902, + "f0": 92.53115670733261, + "f0_st": 2.404998595462186, + "voiced": 0.6773094193817878, + "rms_db": -45.482831954956055, + "snr_db": 23.831955432891846, + "bandwidth": 10357.470703125, + "accent:Scottish": 0.23706, + "accent:Scottish@1": 0.5, + "accent:Oceania": 0.1768575, + "accent:Oceania@1": 0.25, + "accent:English": 0.1523725, + "accent:English@1": 0.0, + "accent:Irish": 0.0043549999999999995, + "accent:Irish@1": 0.0, + "accent:South Asia": 0.14128749999999998, + "accent:South Asia@1": 0.25, + "accent:North America": 0.02855, + "accent:North America@1": 0.0, + "quality:deep": 0.4212775000000001, + "quality:raspy": 0.09271, + "quality:soft": 0.59202, + "quality:authoritative": 0.07082000000000001, + "flow:disfluent": 0.0910275 + }, + "Indian English caller + conversational": { + "wer": 0.04379795396419438, + "collapse": 0.0, + "identity": 0.7547564374603631, + "durx": 1.0093537414965987, + "female": 0.012487326457630843, + "age": 22.576988860964775, + "f0": 97.81610953659703, + "f0_st": 2.8545379938733024, + "voiced": 0.7162615821252691, + "rms_db": -44.234768867492676, + "snr_db": 24.34766674041748, + "bandwidth": 9864.898681640625, + "accent:Scottish": 0.047177500000000004, + "accent:Scottish@1": 0.0, + "accent:Oceania": 0.04844, + "accent:Oceania@1": 0.0, + "accent:English": 0.17068500000000003, + "accent:English@1": 0.25, + "accent:Irish": 0.0024400000000000003, + "accent:Irish@1": 0.0, + "accent:South Asia": 0.1707725, + "accent:South Asia@1": 0.25, + "accent:North America": 0.0415325, + "accent:North America@1": 0.0, + "quality:deep": 0.3114525, + "quality:raspy": 0.058679999999999996, + "quality:soft": 0.8554125, + "quality:authoritative": 0.028745, + "flow:disfluent": 0.259445 + }, + "BBC newsreader + slow": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.8328338286808504, + "durx": 1.707833832833833, + "female": 0.006063619977794588, + "age": 41.1458894610405, + "f0": 101.238293701247, + "f0_st": 3.703139605820122, + "voiced": 0.5989141776444502, + "rms_db": -39.29749011993408, + "snr_db": 48.4683895111084, + "bandwidth": 9073.553466796875, + "accent:Scottish": 0.003735, + "accent:Scottish@1": 0.0, + "accent:Oceania": 0.0007425, + "accent:Oceania@1": 0.0, + "accent:English": 0.51652, + "accent:English@1": 0.5, + "accent:Irish": 0.000125, + "accent:Irish@1": 0.0, + "accent:South Asia": 2.5e-06, + "accent:South Asia@1": 0.0, + "accent:North America": 0.00020999999999999998, + "accent:North America@1": 0.0, + "quality:deep": 0.183665, + "quality:raspy": 0.0009475, + "quality:soft": 0.194795, + "quality:authoritative": 0.8816174999999999, + "flow:disfluent": 0.154715 + } + }, + "Obama": { + "neutral": { + "wer": 0.014705882352941176, + "collapse": 0.0, + "identity": 0.9387460296541414, + "durx": 1.0, + "female": 0.0035154334036633372, + "age": 53.74961122870445, + "f0": 123.7537390161196, + "f0_st": 2.7043656138649546, + "voiced": 0.6549097443442305, + "rms_db": -41.428171157836914, + "snr_db": 50.819594383239746, + "bandwidth": 7555.462646484375, + "accent:Scottish": 0.002345, + "accent:Scottish@1": 0.0, + "accent:Oceania": 0.017825, + "accent:Oceania@1": 0.0, + "accent:English": 0.00022500000000000002, + "accent:English@1": 0.0, + "accent:Irish": 0.00417, + "accent:Irish@1": 0.0, + "accent:South Asia": 0.00044, + "accent:South Asia@1": 0.0, + "accent:North America": 0.34904999999999997, + "accent:North America@1": 0.25, + "quality:deep": 0.7942100000000001, + "quality:raspy": 0.2555425, + "quality:soft": 0.00744, + "quality:authoritative": 0.7360925, + "flow:disfluent": 0.070495 + }, + "elderly Scottish narrator": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.6337079144369269, + "durx": 1.16137102014295, + "female": 0.0038325663772411644, + "age": 46.1759515106678, + "f0": 89.08134436334869, + "f0_st": 2.0807875560820235, + "voiced": 0.5913688996306458, + "rms_db": -40.206732749938965, + "snr_db": 48.59057426452637, + "bandwidth": 8013.043212890625, + "accent:Scottish": 0.0133775, + "accent:Scottish@1": 0.0, + "accent:Oceania": 0.369985, + "accent:Oceania@1": 0.25, + "accent:English": 0.6056925, + "accent:English@1": 0.75, + "accent:Irish": 0.0007624999999999999, + "accent:Irish@1": 0.0, + "accent:South Asia": 1e-05, + "accent:South Asia@1": 0.0, + "accent:North America": 0.009057500000000001, + "accent:North America@1": 0.0, + "quality:deep": 0.643045, + "quality:raspy": 0.309065, + "quality:soft": 0.18109000000000003, + "quality:authoritative": 0.7920625, + "flow:disfluent": 0.08976 + }, + "young Australian": { + "wer": 0.007352941176470588, + "collapse": 0.0, + "identity": 0.42940996303750867, + "durx": 0.8209876543209875, + "female": 0.003633481333963573, + "age": 27.354182302951813, + "f0": 151.77643542750383, + "f0_st": 2.9033527377526394, + "voiced": 0.663454627682795, + "rms_db": -41.089138984680176, + "snr_db": 46.7476749420166, + "bandwidth": 8142.242431640625, + "accent:Scottish": 0.000385, + "accent:Scottish@1": 0.0, + "accent:Oceania": 0.537895, + "accent:Oceania@1": 0.5, + "accent:English": 0.39272750000000006, + "accent:English@1": 0.5, + "accent:Irish": 0.0, + "accent:Irish@1": 0.0, + "accent:South Asia": 0.0, + "accent:South Asia@1": 0.0, + "accent:North America": 0.0351625, + "accent:North America@1": 0.0, + "quality:deep": 0.3303075, + "quality:raspy": 0.029517500000000002, + "quality:soft": 0.22171000000000002, + "quality:authoritative": 0.5577574999999999, + "flow:disfluent": 0.057275 + }, + "gravelly old man": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.6240032219988634, + "durx": 1.4660493827160492, + "female": 0.003844584571197629, + "age": 64.49469476938248, + "f0": 86.44651820684092, + "f0_st": 3.3511896344823553, + "voiced": 0.6313052580289626, + "rms_db": -43.953423500061035, + "snr_db": 47.03892707824707, + "bandwidth": 11531.0302734375, + "accent:Scottish": 0.004235, + "accent:Scottish@1": 0.0, + "accent:Oceania": 0.021384999999999998, + "accent:Oceania@1": 0.0, + "accent:English": 0.0041925, + "accent:English@1": 0.0, + "accent:Irish": 0.0380325, + "accent:Irish@1": 0.0, + "accent:South Asia": 0.0109675, + "accent:South Asia@1": 0.0, + "accent:North America": 0.4275625, + "accent:North America@1": 0.5, + "quality:deep": 0.88042, + "quality:raspy": 0.586015, + "quality:soft": 0.012424999999999999, + "quality:authoritative": 0.7605474999999999, + "flow:disfluent": 0.179525 + }, + "BBC newsreader": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.6864371393727313, + "durx": 0.9228395061728395, + "female": 0.0022644203854724765, + "age": 53.83392423391342, + "f0": 143.29719831750276, + "f0_st": 3.52861326077904, + "voiced": 0.625439211166564, + "rms_db": -27.510056495666504, + "snr_db": 62.83002853393555, + "bandwidth": 7851.544189453125, + "accent:Scottish": 0.026795, + "accent:Scottish@1": 0.0, + "accent:Oceania": 0.005620000000000001, + "accent:Oceania@1": 0.0, + "accent:English": 0.95424, + "accent:English@1": 1.0, + "accent:Irish": 4.25e-05, + "accent:Irish@1": 0.0, + "accent:South Asia": 0.0, + "accent:South Asia@1": 0.0, + "accent:North America": 0.0008125000000000001, + "accent:North America@1": 0.0, + "quality:deep": 0.5036125, + "quality:raspy": 0.1466175, + "quality:soft": 0.091655, + "quality:authoritative": 0.853815, + "flow:disfluent": 0.06756000000000001 + }, + "soft-spoken Irish woman": { + "wer": 0.014705882352941176, + "collapse": 0.0, + "identity": 0.4025506675865315, + "durx": 0.9135802469135801, + "female": 0.24879736173897982, + "age": 39.91338163614273, + "f0": 185.01081892304038, + "f0_st": 1.912686955147991, + "voiced": 0.8200866475375296, + "rms_db": -41.06977844238281, + "snr_db": 44.00387191772461, + "bandwidth": 7149.0234375, + "accent:Scottish": 0.5565599999999999, + "accent:Scottish@1": 0.75, + "accent:Oceania": 0.0407525, + "accent:Oceania@1": 0.0, + "accent:English": 0.031895, + "accent:English@1": 0.0, + "accent:Irish": 0.08314250000000001, + "accent:Irish@1": 0.0, + "accent:South Asia": 0.00022, + "accent:South Asia@1": 0.0, + "accent:North America": 0.0411575, + "accent:North America@1": 0.0, + "quality:deep": 0.386395, + "quality:raspy": 0.2662725, + "quality:soft": 0.35745499999999997, + "quality:authoritative": 0.67384, + "flow:disfluent": 0.07021999999999999 + }, + "Indian English caller": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.5625717439801724, + "durx": 0.8330864197530865, + "female": 0.008481857948936522, + "age": 38.24790641665459, + "f0": 204.0490481669816, + "f0_st": 2.166600528909239, + "voiced": 0.7680200168465657, + "rms_db": -35.6936936378479, + "snr_db": 30.41598653793335, + "bandwidth": 12952.2216796875, + "accent:Scottish": 0.00018, + "accent:Scottish@1": 0.0, + "accent:Oceania": 0.000505, + "accent:Oceania@1": 0.0, + "accent:English": 1.7500000000000002e-05, + "accent:English@1": 0.0, + "accent:Irish": 0.0, + "accent:Irish@1": 0.0, + "accent:South Asia": 0.8619775000000001, + "accent:South Asia@1": 1.0, + "accent:North America": 6.25e-05, + "accent:North America@1": 0.0, + "quality:deep": 0.51127, + "quality:raspy": 0.196535, + "quality:soft": 0.0957575, + "quality:authoritative": 0.2415875, + "flow:disfluent": 0.08398249999999999 + }, + "Indian English caller + conversational": { + "wer": 0.04007124588966021, + "collapse": 0.0, + "identity": 0.546415656904095, + "durx": 0.8117283950617283, + "female": 0.025371661642566323, + "age": 40.07024988532066, + "f0": 190.81932064550205, + "f0_st": 2.4887208097640343, + "voiced": 0.8308099694898904, + "rms_db": -31.646650791168213, + "snr_db": 26.279701709747314, + "bandwidth": 11821.728515625, + "accent:Scottish": 0.0012000000000000001, + "accent:Scottish@1": 0.0, + "accent:Oceania": 0.000675, + "accent:Oceania@1": 0.0, + "accent:English": 4e-05, + "accent:English@1": 0.0, + "accent:Irish": 2.5e-06, + "accent:Irish@1": 0.0, + "accent:South Asia": 0.7052625000000001, + "accent:South Asia@1": 0.75, + "accent:North America": 9.75e-05, + "accent:North America@1": 0.0, + "quality:deep": 0.447815, + "quality:raspy": 0.2611675, + "quality:soft": 0.13580499999999998, + "quality:authoritative": 0.13915, + "flow:disfluent": 0.0932825 + }, + "BBC newsreader + slow": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.7202383250952731, + "durx": 1.2901234567901234, + "female": 0.0025691950577311218, + "age": 59.28619056940079, + "f0": 128.06902902564684, + "f0_st": 4.282775614882867, + "voiced": 0.592202876365525, + "rms_db": -35.952208042144775, + "snr_db": 62.76783084869385, + "bandwidth": 8274.13330078125, + "accent:Scottish": 0.0181425, + "accent:Scottish@1": 0.0, + "accent:Oceania": 0.0031725, + "accent:Oceania@1": 0.0, + "accent:English": 0.477865, + "accent:English@1": 0.5, + "accent:Irish": 0.00015000000000000001, + "accent:Irish@1": 0.0, + "accent:South Asia": 5e-06, + "accent:South Asia@1": 0.0, + "accent:North America": 0.00126, + "accent:North America@1": 0.0, + "quality:deep": 0.57661, + "quality:raspy": 0.01411, + "quality:soft": 0.0859225, + "quality:authoritative": 0.954155, + "flow:disfluent": 0.095575 + } + }, + "Scottish Female": { + "neutral": { + "wer": 0.007142857142857143, + "collapse": 0.0, + "identity": 0.9266934661136247, + "durx": 1.0, + "female": 0.997859537601471, + "age": 48.33717122673988, + "f0": 186.62951681175997, + "f0_st": 2.372338315695629, + "voiced": 0.7664984735799911, + "rms_db": -39.992154121398926, + "snr_db": 31.38053846359253, + "bandwidth": 7999.5849609375, + "accent:Scottish": 0.001005, + "accent:Scottish@1": 0.0, + "accent:Oceania": 0.4607925, + "accent:Oceania@1": 0.5, + "accent:English": 0.50791, + "accent:English@1": 0.5, + "accent:Irish": 8e-05, + "accent:Irish@1": 0.0, + "accent:South Asia": 2.25e-05, + "accent:South Asia@1": 0.0, + "accent:North America": 0.0050750000000000005, + "accent:North America@1": 0.0, + "quality:deep": 0.0, + "quality:raspy": 0.000355, + "quality:soft": 0.924845, + "quality:authoritative": 0.174895, + "flow:disfluent": 0.161685 + }, + "elderly Scottish narrator": { + "wer": 0.007352941176470588, + "collapse": 0.0, + "identity": 0.743509333129134, + "durx": 1.1368106779065683, + "female": 0.9990409165620804, + "age": 59.91035997867584, + "f0": 164.16521579398471, + "f0_st": 3.2569880074960222, + "voiced": 0.7424089243523351, + "rms_db": -29.48840618133545, + "snr_db": 29.212064266204834, + "bandwidth": 7875.76904296875, + "accent:Scottish": 0.0030099999999999997, + "accent:Scottish@1": 0.0, + "accent:Oceania": 0.380515, + "accent:Oceania@1": 0.25, + "accent:English": 0.5878424999999999, + "accent:English@1": 0.75, + "accent:Irish": 0.00011999999999999999, + "accent:Irish@1": 0.0, + "accent:South Asia": 1e-05, + "accent:South Asia@1": 0.0, + "accent:North America": 0.0012599999999999998, + "accent:North America@1": 0.0, + "quality:deep": 0.0019075000000000001, + "quality:raspy": 0.0010674999999999999, + "quality:soft": 0.5886175, + "quality:authoritative": 0.41527749999999997, + "flow:disfluent": 0.08768999999999999 + }, + "young Australian": { + "wer": 0.04316770186335404, + "collapse": 0.0, + "identity": 0.6352172865609813, + "durx": 0.8939234281700035, + "female": 0.9460137039422989, + "age": 28.4032940864563, + "f0": 160.45391036484767, + "f0_st": 2.815004232745412, + "voiced": 0.6575312858692772, + "rms_db": -34.737083435058594, + "snr_db": 25.72535228729248, + "bandwidth": 6686.0595703125, + "accent:Scottish": 0.00045750000000000006, + "accent:Scottish@1": 0.0, + "accent:Oceania": 0.3859825, + "accent:Oceania@1": 0.5, + "accent:English": 0.612735, + "accent:English@1": 0.5, + "accent:Irish": 0.0, + "accent:Irish@1": 0.0, + "accent:South Asia": 0.0, + "accent:South Asia@1": 0.0, + "accent:North America": 0.0006225, + "accent:North America@1": 0.0, + "quality:deep": 5.75e-05, + "quality:raspy": 0.00026250000000000004, + "quality:soft": 0.7936475000000001, + "quality:authoritative": 0.19185500000000003, + "flow:disfluent": 0.0774175 + }, + "gravelly old man": { + "wer": 0.007352941176470588, + "collapse": 0.0, + "identity": 0.44862234307743015, + "durx": 1.1804645622394285, + "female": 0.02196682570502162, + "age": 52.04579755663872, + "f0": 74.78391376817831, + "f0_st": 2.09068846099266, + "voiced": 0.5197536319590121, + "rms_db": -45.66466522216797, + "snr_db": 28.213820457458496, + "bandwidth": 9364.251708984375, + "accent:Scottish": 0.0325625, + "accent:Scottish@1": 0.0, + "accent:Oceania": 0.423385, + "accent:Oceania@1": 0.5, + "accent:English": 0.20880749999999998, + "accent:English@1": 0.0, + "accent:Irish": 0.11308000000000001, + "accent:Irish@1": 0.25, + "accent:South Asia": 0.0005350000000000001, + "accent:South Asia@1": 0.0, + "accent:North America": 0.18628250000000002, + "accent:North America@1": 0.25, + "quality:deep": 0.727185, + "quality:raspy": 0.6388199999999999, + "quality:soft": 0.26444, + "quality:authoritative": 0.5109874999999999, + "flow:disfluent": 0.2269025 + }, + "BBC newsreader": { + "wer": 0.014705882352941176, + "collapse": 0.0, + "identity": 0.6958493995354265, + "durx": 0.9822811197141157, + "female": 0.9944260716438293, + "age": 49.37068969011307, + "f0": 198.13199720354692, + "f0_st": 3.909974419031593, + "voiced": 0.745268873866825, + "rms_db": -30.590318202972412, + "snr_db": 39.36193370819092, + "bandwidth": 6384.5947265625, + "accent:Scottish": 0.005185, + "accent:Scottish@1": 0.0, + "accent:Oceania": 0.0079, + "accent:Oceania@1": 0.0, + "accent:English": 0.9712, + "accent:English@1": 1.0, + "accent:Irish": 3e-05, + "accent:Irish@1": 0.0, + "accent:South Asia": 5e-06, + "accent:South Asia@1": 0.0, + "accent:North America": 0.0005325, + "accent:North America@1": 0.0, + "quality:deep": 0.0124025, + "quality:raspy": 0.001685, + "quality:soft": 0.3895875, + "quality:authoritative": 0.773145, + "flow:disfluent": 0.0882375 + }, + "soft-spoken Irish woman": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.7658936321138387, + "durx": 1.0217391304347827, + "female": 0.9983413368463516, + "age": 48.36738035082817, + "f0": 202.90291756635685, + "f0_st": 1.9150762111297164, + "voiced": 0.8000558104104334, + "rms_db": -44.17191505432129, + "snr_db": 33.40181112289429, + "bandwidth": 8842.071533203125, + "accent:Scottish": 0.1486625, + "accent:Scottish@1": 0.25, + "accent:Oceania": 0.23517, + "accent:Oceania@1": 0.25, + "accent:English": 0.48218, + "accent:English@1": 0.5, + "accent:Irish": 0.0019425, + "accent:Irish@1": 0.0, + "accent:South Asia": 0.0001275, + "accent:South Asia@1": 0.0, + "accent:North America": 0.0303325, + "accent:North America@1": 0.0, + "quality:deep": 0.0001625, + "quality:raspy": 0.000855, + "quality:soft": 0.87478, + "quality:authoritative": 0.18220499999999998, + "flow:disfluent": 0.0905 + }, + "Indian English caller": { + "wer": 0.04379795396419438, + "collapse": 0.0, + "identity": 0.6007953563727715, + "durx": 0.850613154960981, + "female": 0.9957686811685562, + "age": 38.73650133609772, + "f0": 214.81092947449594, + "f0_st": 2.5224465288231657, + "voiced": 0.8295359618226867, + "rms_db": -35.04885196685791, + "snr_db": 28.986117362976074, + "bandwidth": 6793.7255859375, + "accent:Scottish": 0.000435, + "accent:Scottish@1": 0.0, + "accent:Oceania": 0.0039499999999999995, + "accent:Oceania@1": 0.0, + "accent:English": 0.003035, + "accent:English@1": 0.0, + "accent:Irish": 1e-05, + "accent:Irish@1": 0.0, + "accent:South Asia": 0.7567550000000001, + "accent:South Asia@1": 0.75, + "accent:North America": 0.001315, + "accent:North America@1": 0.0, + "quality:deep": 0.0011225, + "quality:raspy": 0.0205, + "quality:soft": 0.1479075, + "quality:authoritative": 0.0031325, + "flow:disfluent": 0.09455 + }, + "Indian English caller + conversational": { + "wer": 0.0365546218487395, + "collapse": 0.0, + "identity": 0.6046233093265213, + "durx": 0.8614330874604847, + "female": 0.9958142638206482, + "age": 39.21966552734375, + "f0": 209.58952361384445, + "f0_st": 2.1458521877888423, + "voiced": 0.8184211839068506, + "rms_db": -38.345317363739014, + "snr_db": 26.485548973083496, + "bandwidth": 7695.428466796875, + "accent:Scottish": 0.0010175, + "accent:Scottish@1": 0.0, + "accent:Oceania": 0.0072575, + "accent:Oceania@1": 0.0, + "accent:English": 0.026289999999999997, + "accent:English@1": 0.0, + "accent:Irish": 3.9999999999999996e-05, + "accent:Irish@1": 0.0, + "accent:South Asia": 0.4709225, + "accent:South Asia@1": 0.75, + "accent:North America": 0.0014325, + "accent:North America@1": 0.0, + "quality:deep": 0.04936, + "quality:raspy": 0.013925, + "quality:soft": 0.13391, + "quality:authoritative": 0.0018525, + "flow:disfluent": 0.08783250000000001 + }, + "BBC newsreader + slow": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.7065912207112325, + "durx": 1.5337197049525817, + "female": 0.9964849948883057, + "age": 59.01097059249878, + "f0": 187.7295466094692, + "f0_st": 3.474166259095732, + "voiced": 0.7312739424486332, + "rms_db": -39.55088806152344, + "snr_db": 49.37149620056152, + "bandwidth": 6438.427734375, + "accent:Scottish": 0.009165, + "accent:Scottish@1": 0.0, + "accent:Oceania": 0.0005825, + "accent:Oceania@1": 0.0, + "accent:English": 0.2503925, + "accent:English@1": 0.25, + "accent:Irish": 0.0001175, + "accent:Irish@1": 0.0, + "accent:South Asia": 2e-05, + "accent:South Asia@1": 0.0, + "accent:North America": 0.000535, + "accent:North America@1": 0.0, + "quality:deep": 0.0057, + "quality:raspy": 2.5e-06, + "quality:soft": 0.47135, + "quality:authoritative": 0.9234175, + "flow:disfluent": 0.17483 + } + } +} diff --git a/steering/speaker_traits_mect60k/gender.npy b/steering/speaker_traits_mect60k/gender.npy new file mode 100644 index 0000000000000000000000000000000000000000..1b47e26b0b94be330b3cf95fcdf3ed71e8b94c1b --- /dev/null +++ b/steering/speaker_traits_mect60k/gender.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:385b44272a8107019fac19852605b2a9180a6dbc9de0d7037bae1d7567ec1f01 +size 896 diff --git a/steering/speaker_traits_mect60k/husky.npy b/steering/speaker_traits_mect60k/husky.npy new file mode 100644 index 0000000000000000000000000000000000000000..48d8c0199f60f319f28fd2e34babc724fc39f957 --- /dev/null +++ b/steering/speaker_traits_mect60k/husky.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:67c0b613dc5e2727729d0ba23e98bac56d97e57aa7e8d72bca62e57997001fcc +size 896 diff --git a/steering/speaker_traits_mect60k/indian.npy b/steering/speaker_traits_mect60k/indian.npy new file mode 100644 index 0000000000000000000000000000000000000000..932431b574eea2846a2b2924e0962c88130adf86 --- /dev/null +++ b/steering/speaker_traits_mect60k/indian.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:03be0e6b8eb0f10cd1867616e33623fbb667b1de65889336e9d8c7c8a8a05c68 +size 896 diff --git a/steering/speaker_traits_mect60k/irish.npy b/steering/speaker_traits_mect60k/irish.npy new file mode 100644 index 0000000000000000000000000000000000000000..cc85a9bf772f0ae9bc5cc83f30171488c6a3261f --- /dev/null +++ b/steering/speaker_traits_mect60k/irish.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2da7d0647ea897e488a111eb3e829f6f277c5109828331304de37ca7fb9f8a26 +size 896 diff --git a/steering/speaker_traits_mect60k/manifest.json b/steering/speaker_traits_mect60k/manifest.json new file mode 100644 index 0000000000000000000000000000000000000000..063b0d36fcd0a03a13fec3fd2f9055daafbcb8b1 --- /dev/null +++ b/steering/speaker_traits_mect60k/manifest.json @@ -0,0 +1,179 @@ +{ + "space": "raw", + "dim": 192, + "input_dim": 192, + "speaker_codec": "ownmect_s2", + "ref_base_norm": 3.5114699447297797, + "checkpoint": "/data/groups/audio/gabriel/hf_release_zonos3mini_20261020/lm/mect_60k", + "sources": [ + "/data/groups/audio/sofian/bingua2-gdn-emotion/minisgl/speaker_attributes_mect60k", + "/data/groups/audio/sofian/bingua2-gdn-emotion/minisgl/english_accents_mect60k", + "/data/groups/audio/sofian/bingua2-gdn-emotion/minisgl/voice_quality_mect60k", + "/data/groups/audio/sofian/bingua2-gdn-emotion/minisgl/pitch_mect60k", + "/data/groups/audio/sofian/bingua2-gdn-emotion/minisgl/channel_mect60k" + ], + "directions": { + "gender": { + "file": "gender.npy", + "kind": "axis", + "norm": 1.8763586747638452, + "poles": { + "+": "female", + "-": "male" + }, + "from": "speaker_attributes_mect60k" + }, + "age": { + "file": "age.npy", + "kind": "axis", + "norm": 1.2692715820938114, + "poles": { + "+": "older", + "-": "younger" + }, + "years_per_dose": 27.869893920918308, + "from": "speaker_attributes_mect60k" + }, + "british": { + "file": "british.npy", + "kind": "named", + "norm": 1.6460160023035668, + "from": "english_accents_mect60k" + }, + "american": { + "file": "american.npy", + "kind": "named", + "norm": 1.6460160023035668, + "from": "english_accents_mect60k" + }, + "scottish": { + "file": "scottish.npy", + "kind": "named", + "norm": 1.5993952256562336, + "from": "english_accents_mect60k" + }, + "irish": { + "file": "irish.npy", + "kind": "named", + "norm": 1.4670428877353188, + "from": "english_accents_mect60k" + }, + "australian": { + "file": "australian.npy", + "kind": "named", + "norm": 1.6846640382867135, + "from": "english_accents_mect60k" + }, + "indian": { + "file": "indian.npy", + "kind": "named", + "norm": 1.9338742609604493, + "from": "english_accents_mect60k" + }, + "welsh": { + "file": "welsh.npy", + "kind": "named", + "norm": 1.694260713795206, + "from": "english_accents_mect60k" + }, + "deep": { + "file": "deep.npy", + "kind": "named", + "norm": 0.5765019744974527, + "from": "voice_quality_mect60k" + }, + "shrill": { + "file": "shrill.npy", + "kind": "named", + "norm": 0.8610223457716267, + "from": "voice_quality_mect60k" + }, + "husky": { + "file": "husky.npy", + "kind": "named", + "norm": 0.5867545131746184, + "from": "voice_quality_mect60k" + }, + "raspy": { + "file": "raspy.npy", + "kind": "named", + "norm": 0.8753706576316298, + "from": "voice_quality_mect60k" + }, + "soft": { + "file": "soft.npy", + "kind": "named", + "norm": 0.722508601574993, + "from": "voice_quality_mect60k" + }, + "authoritative": { + "file": "authoritative.npy", + "kind": "named", + "norm": 0.6506623679403928, + "from": "voice_quality_mect60k" + }, + "pitch": { + "file": "pitch.npy", + "kind": "axis", + "norm": 0.7707383909536902, + "poles": { + "+": "higher", + "-": "lower" + }, + "from": "pitch_mect60k" + }, + "pitch_range": { + "file": "pitch_range.npy", + "kind": "axis", + "norm": 0.526365652403613, + "poles": { + "+": "varied", + "-": "monotone" + }, + "from": "pitch_mect60k" + }, + "clean": { + "file": "clean.npy", + "kind": "axis", + "norm": 0.26050034319127313, + "poles": { + "+": "clean studio", + "-": "noisy / far-field" + }, + "from": "channel_mect60k" + } + }, + "presets": { + "elderly Scottish narrator": { + "age": 1.5, + "scottish": 1.5, + "deep": 2.0, + "pitch_range": -1.0 + }, + "young Australian": { + "age": -1.5, + "australian": 1.5, + "pitch_range": 1.0 + }, + "gravelly old man": { + "gender": -1.0, + "age": 2.0, + "raspy": 3.0, + "deep": 2.0 + }, + "BBC newsreader": { + "british": 1.5, + "authoritative": 3.0, + "clean": 2.0 + }, + "soft-spoken Irish woman": { + "gender": 1.0, + "irish": 1.5, + "soft": 3.0 + }, + "Indian English caller": { + "indian": 1.5, + "clean": -2.0 + } + } +} diff --git a/steering/speaker_traits_mect60k/pitch.npy b/steering/speaker_traits_mect60k/pitch.npy new file mode 100644 index 0000000000000000000000000000000000000000..432a996a65beaca098fabe0b91b27c84e3d6f296 --- /dev/null +++ b/steering/speaker_traits_mect60k/pitch.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5ffc82e23322ec2d3c09a4e82508758106cdb208456314ce10a80c1880ec1c0c +size 896 diff --git a/steering/speaker_traits_mect60k/pitch_range.npy b/steering/speaker_traits_mect60k/pitch_range.npy new file mode 100644 index 0000000000000000000000000000000000000000..c49d7b478e4c0f50dae1f8b77f990b6d8d07e84e --- /dev/null +++ b/steering/speaker_traits_mect60k/pitch_range.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2f89b77f20ff9e78aa2813dbc17762ff39c937cb36084f19da6889106fbecdf8 +size 896 diff --git a/steering/speaker_traits_mect60k/presets.json b/steering/speaker_traits_mect60k/presets.json new file mode 100644 index 0000000000000000000000000000000000000000..23bfae3b97b4c83703ad876921f95c04304610a8 --- /dev/null +++ b/steering/speaker_traits_mect60k/presets.json @@ -0,0 +1,33 @@ +{ + "elderly Scottish narrator": { + "age": 1.5, + "scottish": 1.5, + "deep": 2.0, + "pitch_range": -1.0 + }, + "young Australian": { + "age": -1.5, + "australian": 1.5, + "pitch_range": 1.0 + }, + "gravelly old man": { + "gender": -1.0, + "age": 2.0, + "raspy": 3.0, + "deep": 2.0 + }, + "BBC newsreader": { + "british": 1.5, + "authoritative": 3.0, + "clean": 2.0 + }, + "soft-spoken Irish woman": { + "gender": 1.0, + "irish": 1.5, + "soft": 3.0 + }, + "Indian English caller": { + "indian": 1.5, + "clean": -2.0 + } +} \ No newline at end of file diff --git a/steering/speaker_traits_mect60k/raspy.npy b/steering/speaker_traits_mect60k/raspy.npy new file mode 100644 index 0000000000000000000000000000000000000000..0ba7f7de5c77ac635224bb3e1d712d8b4641d81f --- /dev/null +++ b/steering/speaker_traits_mect60k/raspy.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:54f004215a259783b37adbfe9dc67bf19b2f99b095dd6fdc23284de29743a43c +size 896 diff --git a/steering/speaker_traits_mect60k/scottish.npy b/steering/speaker_traits_mect60k/scottish.npy new file mode 100644 index 0000000000000000000000000000000000000000..60cb8409421335730ccbce55478d1d6c5bc85948 --- /dev/null +++ b/steering/speaker_traits_mect60k/scottish.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5420d2d7fcff83751b2564c239aa60b06c1ac8f79c7848e4048778d734cab6e7 +size 896 diff --git a/steering/speaker_traits_mect60k/shrill.npy b/steering/speaker_traits_mect60k/shrill.npy new file mode 100644 index 0000000000000000000000000000000000000000..62668af33af489451fe78b4e78322b6365a89eef --- /dev/null +++ b/steering/speaker_traits_mect60k/shrill.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:152528b12c2da06b2e508378dd84537d72f1659d19673db7f559c15759a8932b +size 896 diff --git a/steering/speaker_traits_mect60k/soft.npy b/steering/speaker_traits_mect60k/soft.npy new file mode 100644 index 0000000000000000000000000000000000000000..7c9c342619d98008002101fa572bd1e90c85e910 --- /dev/null +++ b/steering/speaker_traits_mect60k/soft.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e266201d0342cb8d12a8e2f617e202b289986c78ebeb1359fbd7f9fd78cfc2c8 +size 896 diff --git a/steering/speaker_traits_mect60k/welsh.npy b/steering/speaker_traits_mect60k/welsh.npy new file mode 100644 index 0000000000000000000000000000000000000000..7fa74424963483decb1d7b24165a37a53f434727 --- /dev/null +++ b/steering/speaker_traits_mect60k/welsh.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3d5d5587ee6520330aea04054e559c615bc76476d4a76269a914704ad5783391 +size 896 diff --git a/steering/studio_bundle_mect60k.json b/steering/studio_bundle_mect60k.json new file mode 100644 index 0000000000000000000000000000000000000000..1df053732bb73406fa4449563781b59c4d615ae0 --- /dev/null +++ b/steering/studio_bundle_mect60k.json @@ -0,0 +1,1933 @@ +{ + "name": "studio_mect60k", + "sets": { + "identity": "speaker_attributes_mect60k", + "pitch": "pitch_mect60k", + "accents_en": "english_accents_mect60k", + "accents_l1": "speaker_accents_mect60k", + "accent_hidden": "accent_directions_mect60k", + "mandarin": "mandarin_mect60k", + "mandarin_hidden": "mandarin_hidden_mect60k", + "texture": "voice_quality_mect60k", + "room": "channel_mect60k", + "delivery": "ears_styles_mect60k", + "expressive": "expressive_mect60k", + "disfluency": "disfluency_mect60k", + "mood": "emotion_directions_mect60k_axes", + "emotions": "ears_moods_mect60k" + }, + "timing": { + "delivery.tempo": [ + [ + -4.0, + 2.881 + ], + [ + -2.0, + 2.212 + ], + [ + -1.0, + 1.451 + ], + [ + 0.0, + 1.0 + ], + [ + 1.0, + 0.779 + ], + [ + 2.0, + 0.63 + ], + [ + 4.0, + 0.549 + ] + ], + "delivery.conversational": [ + [ + -4.0, + 0.958 + ], + [ + -2.0, + 0.981 + ], + [ + -1.0, + 0.99 + ], + [ + 0.0, + 1.0 + ], + [ + 1.0, + 1.008 + ], + [ + 2.0, + 1.065 + ], + [ + 4.0, + 1.172 + ] + ], + "delivery.whisper": [ + [ + 0.0, + 1.0 + ], + [ + 1.0, + 1.076 + ], + [ + 2.0, + 1.121 + ], + [ + 4.0, + 1.104 + ] + ], + "delivery.loud": [ + [ + 0.0, + 1.0 + ], + [ + 1.0, + 0.988 + ], + [ + 2.0, + 0.955 + ], + [ + 4.0, + 0.945 + ] + ], + "disfluency.disfluent": [ + [ + -8.0, + 0.903 + ], + [ + -4.0, + 0.938 + ], + [ + 0.0, + 1.0 + ], + [ + 4.0, + 1.122 + ], + [ + 8.0, + 1.323 + ], + [ + 16.0, + 1.908 + ], + [ + 32.0, + 2.754 + ] + ], + "expressive.expressive": [ + [ + -16.0, + 0.835 + ], + [ + -8.0, + 0.891 + ], + [ + -4.0, + 0.957 + ], + [ + 0.0, + 1.0 + ], + [ + 4.0, + 1.062 + ], + [ + 8.0, + 1.208 + ], + [ + 16.0, + 1.497 + ] + ] + }, + "rate_extension": { + "direction": "delivery.tempo", + "row_edges": [ + 10.117, + 12.123, + 13.286, + 14.25, + 15.14, + 16.079, + 17.094, + 18.489, + 21.208 + ], + "below": [ + 9.223, + 8.408, + 7.665, + 6.988, + 6.37, + 5.807, + 5.294, + 4.826 + ], + "above": [ + 23.264, + 25.519, + 27.993, + 30.706 + ], + "languages": { + "en_us": { + "-7": -1.587, + "-6": -1.482, + "-5": -1.358, + "-4": -1.235, + "-3": -1.111, + "-2": -0.986, + "-1": -0.851, + "10": 1.398, + "11": 1.795, + "12": 2.243 + }, + "fr_fr": { + "-4": -1.397, + "-3": -1.26, + "-2": -1.124, + "-1": -0.987, + "10": 1.443, + "11": 1.927 + }, + "de": { + "-5": -1.327, + "-4": -1.188, + "-3": -1.062, + "-2": -0.949, + "-1": -0.815 + }, + "es": { + "-4": -1.085, + "-3": -0.988, + "-2": -0.885, + "-1": -0.749, + "10": 1.457 + }, + "it": { + "-4": -0.949, + "-3": -0.801, + "-2": -0.673, + "-1": -0.544 + }, + "pt_br": { + "-3": -1.081, + "-2": -0.977, + "-1": -0.841, + "10": 1.552 + }, + "ja": { + "-5": -1.519, + "-4": -1.42, + "-3": -1.252, + "-2": -1.143, + "-1": -1.027 + }, + "cmn": { + "-6": -1.743, + "-5": -1.647, + "-4": -1.438, + "-3": -1.306, + "-2": -1.176, + "-1": -0.977 + }, + "ko": { + "-2": -1.139, + "-1": -1.066 + } + }, + "reference_sides": [ + "faster" + ] + }, + "ui": { + "groups": [ + { + "id": "who", + "label": "Who", + "hue": "c1" + }, + { + "id": "accent", + "label": "Accent", + "hue": "c2" + }, + { + "id": "texture", + "label": "Texture", + "hue": "c3" + }, + { + "id": "room", + "label": "Room", + "hue": "c4" + }, + { + "id": "delivery", + "label": "Delivery", + "hue": "c5" + }, + { + "id": "mood", + "label": "Mood", + "hue": "c6" + } + ], + "controls": [ + { + "id": "gender", + "group": "who", + "label": "Gender", + "type": "bipolar", + "poles": [ + "masculine", + "feminine" + ], + "map": { + "-": { + "identity.gender": -1 + }, + "+": { + "identity.gender": 1 + } + }, + "range": [ + -3, + 3 + ], + "safe": [ + -2, + 2 + ], + "collapse": null, + "spannable": false, + "identity": [ + [ + 0.0, + 0.894 + ], + [ + 1.0, + 0.689 + ], + [ + 2.0, + 0.561 + ], + [ + 3.0, + 0.473 + ] + ], + "effect": "\u00b12 flips the gender of every release voice; identity drops to ~0.5" + }, + { + "id": "age", + "group": "who", + "label": "Age", + "type": "bipolar", + "poles": [ + "younger", + "older" + ], + "map": { + "-": { + "identity.age": -1 + }, + "+": { + "identity.age": 1 + } + }, + "range": [ + -3, + 3 + ], + "safe": [ + -2, + 2 + ], + "collapse": null, + "spannable": false, + "identity": [ + [ + 0.0, + 0.894 + ], + [ + 1.0, + 0.818 + ], + [ + 2.0, + 0.689 + ], + [ + 3.0, + 0.589 + ] + ], + "effect": "\u00b12 moves apparent age by 10-30 years; at \u22123 male voices start to read female" + }, + { + "id": "pitch", + "group": "who", + "label": "Pitch", + "type": "bipolar", + "poles": [ + "lower", + "higher" + ], + "map": { + "-": { + "pitch.pitch": -1 + }, + "+": { + "pitch.pitch": 1 + } + }, + "range": [ + -3, + 3 + ], + "safe": [ + -2, + 2 + ], + "collapse": null, + "spannable": false, + "identity": [ + [ + 0.0, + 0.946 + ], + [ + 1.0, + 0.903 + ], + [ + 2.0, + 0.845 + ], + [ + 3.0, + 0.749 + ] + ], + "effect": "\u00b12: about \u221220 / +40 Hz at the same gender; +3 can flip a female voice" + }, + { + "id": "range", + "group": "who", + "label": "Intonation", + "type": "bipolar", + "poles": [ + "monotone", + "varied" + ], + "map": { + "-": { + "pitch.pitch_range": -1 + }, + "+": { + "pitch.pitch_range": 1 + } + }, + "range": [ + -3, + 3 + ], + "safe": [ + -2, + 2 + ], + "collapse": null, + "spannable": false, + "identity": [ + [ + 0.0, + 0.946 + ], + [ + 1.0, + 0.914 + ], + [ + 2.0, + 0.892 + ], + [ + 3.0, + 0.86 + ] + ], + "effect": "\u00b12: F0 spread 2.9 \u2192 2.1 / 4.4 semitones at the same pitch level" + }, + { + "id": "deep", + "group": "texture", + "label": "Deep", + "type": "unipolar", + "map": { + "+": { + "texture.deep": 1 + } + }, + "range": [ + 0, + 6 + ], + "safe": [ + 0, + 4 + ], + "collapse": null, + "spannable": false, + "identity": [ + [ + 0.0, + 0.946 + ], + [ + 2.0, + 0.901 + ], + [ + 4.0, + 0.808 + ] + ], + "effect": "\u00d74: deeper and huskier, F0 \u221217 Hz" + }, + { + "id": "bright", + "group": "texture", + "label": "Bright", + "type": "unipolar", + "map": { + "+": { + "texture.shrill": 1 + } + }, + "range": [ + 0, + 6 + ], + "safe": [ + 0, + 4 + ], + "collapse": null, + "spannable": false, + "identity": [ + [ + 0.0, + 0.946 + ], + [ + 2.0, + 0.867 + ], + [ + 4.0, + 0.695 + ] + ], + "effect": "\u00d74: shriller, F0 +40 Hz" + }, + { + "id": "husky", + "group": "texture", + "label": "Husky", + "type": "unipolar", + "map": { + "+": { + "texture.husky": 1 + } + }, + "range": [ + 0, + 6 + ], + "safe": [ + 0, + 4 + ], + "collapse": null, + "spannable": false, + "identity": [ + [ + 0.0, + 0.946 + ], + [ + 2.0, + 0.905 + ], + [ + 4.0, + 0.85 + ] + ], + "effect": "\u00d74: husky 0.18 \u2192 0.33" + }, + { + "id": "raspy", + "group": "texture", + "label": "Raspy", + "type": "unipolar", + "map": { + "+": { + "texture.raspy": 1 + } + }, + "range": [ + 0, + 6 + ], + "safe": [ + 0, + 4 + ], + "collapse": null, + "spannable": false, + "identity": [ + [ + 0.0, + 0.946 + ], + [ + 2.0, + 0.852 + ], + [ + 4.0, + 0.643 + ] + ], + "effect": "\u00d74: raspy 0.06 \u2192 0.34; changes the voice the most" + }, + { + "id": "soft", + "group": "texture", + "label": "Soft", + "type": "unipolar", + "map": { + "+": { + "texture.soft": 1 + } + }, + "range": [ + 0, + 6 + ], + "safe": [ + 0, + 4 + ], + "collapse": null, + "spannable": false, + "identity": [ + [ + 0.0, + 0.946 + ], + [ + 2.0, + 0.881 + ], + [ + 4.0, + 0.761 + ] + ], + "effect": "\u00d74: softer and 7.5 dB quieter" + }, + { + "id": "authority", + "group": "texture", + "label": "Authority", + "type": "unipolar", + "map": { + "+": { + "texture.authoritative": 1 + } + }, + "range": [ + 0, + 6 + ], + "safe": [ + 0, + 4 + ], + "collapse": null, + "spannable": false, + "identity": [ + [ + 0.0, + 0.946 + ], + [ + 2.0, + 0.875 + ], + [ + 4.0, + 0.765 + ] + ], + "effect": "\u00d74: authoritative 0.54 \u2192 0.78" + }, + { + "id": "room", + "group": "room", + "label": "Room", + "type": "bipolar", + "poles": [ + "phone", + "studio" + ], + "map": { + "-": { + "room.clean": -1 + }, + "+": { + "room.clean": 1 + } + }, + "range": [ + -4, + 6 + ], + "safe": [ + -2, + 4 + ], + "collapse": [ + -6, + null + ], + "spannable": false, + "identity": [ + [ + 0.0, + 0.946 + ], + [ + 2.0, + 0.904 + ], + [ + 4.0, + 0.86 + ], + [ + 8.0, + 0.685 + ] + ], + "effect": "speech over the noise floor 40 dB \u2192 28 (\u22122) / 58 (+4)" + }, + { + "id": "projection", + "group": "delivery", + "label": "Projection", + "type": "bipolar", + "poles": [ + "whisper", + "loud" + ], + "map": { + "-": { + "delivery.whisper": 1 + }, + "+": { + "delivery.loud": 1 + } + }, + "range": [ + -3, + 4 + ], + "safe": [ + -1.5, + 2 + ], + "collapse": [ + -3, + null + ], + "spannable": true, + "identity": [ + [ + 0.0, + 0.946 + ], + [ + 1.0, + 0.9005000000000001 + ], + [ + 2.0, + 0.8160000000000001 + ], + [ + 4.0, + 0.6665 + ] + ], + "effect": "whisper \u00d72 halves voicing (7% WER); loud \u00d72 +7 dB, \u00d74 +16 dB" + }, + { + "id": "pace", + "group": "delivery", + "label": "Pace", + "type": "bipolar", + "poles": [ + "slower", + "faster" + ], + "map": { + "-": { + "delivery.tempo": -1 + }, + "+": { + "delivery.tempo": 1 + } + }, + "range": [ + -3, + 3 + ], + "safe": [ + -2, + 2 + ], + "collapse": [ + -3, + null + ], + "spannable": true, + "identity": [ + [ + 0.0, + 0.946 + ], + [ + 1.0, + 0.907 + ], + [ + 2.0, + 0.866 + ], + [ + 4.0, + 0.753 + ] + ], + "effect": "\u22121: \u00d71.45 longer, +2: \u00d70.63; fast is also louder and higher" + }, + { + "id": "chatty", + "group": "delivery", + "label": "Read \u2194 chatty", + "type": "bipolar", + "poles": [ + "read", + "chatty" + ], + "map": { + "-": { + "delivery.conversational": -1 + }, + "+": { + "delivery.conversational": 1 + } + }, + "range": [ + -5, + 5 + ], + "safe": [ + -4, + 4 + ], + "collapse": null, + "spannable": true, + "identity": [ + [ + 0.0, + 0.946 + ], + [ + 1.0, + 0.918 + ], + [ + 2.0, + 0.919 + ], + [ + 4.0, + 0.899 + ] + ], + "effect": "+4: spontaneous (hesitation 0.10 \u2192 0.26, less enunciated); \u22124: careful reading" + }, + { + "id": "hesitant", + "group": "delivery", + "label": "Hesitation", + "type": "bipolar", + "poles": [ + "fluent", + "hesitant" + ], + "map": { + "-": { + "disfluency.disfluent": -1 + }, + "+": { + "disfluency.disfluent": 1 + } + }, + "range": [ + -8, + 20 + ], + "safe": [ + -8, + 8 + ], + "collapse": [ + null, + 24 + ], + "spannable": true, + "identity": [ + [ + 0.0, + 0.946 + ], + [ + 4.0, + 0.918 + ], + [ + 8.0, + 0.911 + ], + [ + 16.0, + 0.88 + ], + [ + 32.0, + 0.785 + ] + ], + "effect": "+8: pauses and blocks (0.10 \u2192 0.21), \u00d71.3 longer; +16 drops words" + }, + { + "id": "lively", + "group": "delivery", + "label": "Liveliness", + "type": "bipolar", + "poles": [ + "flat", + "lively" + ], + "map": { + "-": { + "expressive.expressive": -1 + }, + "+": { + "expressive.expressive": 1 + } + }, + "range": [ + -16, + 16 + ], + "safe": [ + -8, + 8 + ], + "collapse": null, + "spannable": true, + "identity": [ + [ + 0.0, + 0.946 + ], + [ + 4.0, + 0.917 + ], + [ + 8.0, + 0.908 + ], + [ + 16.0, + 0.865 + ] + ], + "effect": "+8: F0 spread 2.9 \u2192 4.3 st, higher and slower" + }, + { + "id": "valence", + "group": "mood", + "label": "Valence", + "type": "bipolar", + "poles": [ + "negative", + "positive" + ], + "map": { + "-": { + "mood.valence": -1 + }, + "+": { + "mood.valence": 1 + } + }, + "range": [ + -6, + 6 + ], + "safe": [ + -4, + 4 + ], + "collapse": null, + "spannable": true, + "identity": null, + "effect": "seed dose 4 (emotion axes, L9.attn)" + }, + { + "id": "arousal", + "group": "mood", + "label": "Arousal", + "type": "bipolar", + "poles": [ + "calm", + "excited" + ], + "map": { + "-": { + "mood.arousal": -1 + }, + "+": { + "mood.arousal": 1 + } + }, + "range": [ + -6, + 6 + ], + "safe": [ + -4, + 4 + ], + "collapse": null, + "spannable": true, + "identity": null, + "effect": "seed dose 4 (emotion axes, L9.attn)" + }, + { + "id": "angry", + "group": "mood", + "label": "Angry", + "type": "unipolar", + "map": { + "+": { + "emotions.angry": 1 + } + }, + "range": [ + 0, + 6 + ], + "safe": [ + 0, + 4 + ], + "collapse": null, + "spannable": true, + "identity": [ + [ + 0.0, + 0.945 + ], + [ + 4, + 0.785 + ], + [ + 6, + 0.606 + ], + [ + 8, + 0.515 + ] + ], + "effect": "\u00d74: heard as angry on 17% of renders (from 0%; MSP-Podcast); more aroused (+0.35 MSP), WER 3.6%" + }, + { + "id": "happy", + "group": "mood", + "label": "Happy", + "type": "unipolar", + "map": { + "+": { + "emotions.happy": 1 + } + }, + "range": [ + 0, + 6 + ], + "safe": [ + 0, + 4 + ], + "collapse": null, + "spannable": true, + "identity": [ + [ + 0.0, + 0.945 + ], + [ + 4, + 0.867 + ], + [ + 6, + 0.74 + ], + [ + 8, + 0.594 + ] + ], + "effect": "\u00d74: heard as happy on 62 / 58% of renders (from 21 / 15%; emotion2vec / MSP-Podcast); more aroused (+0.17 MSP), WER 2.5%" + }, + { + "id": "sad", + "group": "mood", + "label": "Sad", + "type": "unipolar", + "map": { + "+": { + "emotions.sad": 1 + } + }, + "range": [ + 0, + 8 + ], + "safe": [ + 0, + 6 + ], + "collapse": null, + "spannable": true, + "identity": [ + [ + 0.0, + 0.945 + ], + [ + 4, + 0.899 + ], + [ + 6, + 0.866 + ], + [ + 8, + 0.823 + ] + ], + "effect": "\u00d76: heard as sad on 29 / 12% of renders (from 2 / 0%; MSP-Podcast / emotion2vec); less aroused (\u22120.15 MSP), WER 2.1%" + }, + { + "id": "calm", + "group": "mood", + "label": "Calm", + "type": "unipolar", + "map": { + "+": { + "emotions.serene": 1 + } + }, + "range": [ + 0, + 8 + ], + "safe": [ + 0, + 6 + ], + "collapse": null, + "spannable": true, + "identity": [ + [ + 0.0, + 0.945 + ], + [ + 4, + 0.899 + ], + [ + 6, + 0.863 + ], + [ + 8, + 0.786 + ] + ], + "effect": "\u00d74: heard as calm on 94% of renders (from 77%; ParaSpeechCLAP); less aroused (\u22120.14 MSP), WER 0.9%" + }, + { + "id": "scared", + "group": "mood", + "label": "Scared", + "type": "unipolar", + "map": { + "+": { + "emotions.scared": 1 + } + }, + "range": [ + 0, + 14 + ], + "safe": [ + 0, + 12 + ], + "collapse": null, + "spannable": true, + "identity": [ + [ + 0.0, + 0.945 + ], + [ + 10, + 0.818 + ], + [ + 12, + 0.778 + ], + [ + 14, + 0.734 + ], + [ + 16, + 0.711 + ] + ], + "effect": "\u00d712: heard as fearful on 8% of renders (from 0%; emotion2vec); more aroused (+0.11 MSP), WER 1.5%" + }, + { + "id": "confused", + "group": "mood", + "label": "Confused", + "type": "unipolar", + "map": { + "+": { + "emotions.confused": 1 + } + }, + "range": [ + 0, + 4 + ], + "safe": [ + 0, + 3 + ], + "collapse": null, + "spannable": true, + "identity": [ + [ + 0.0, + 0.945 + ], + [ + 2, + 0.913 + ], + [ + 3, + 0.877 + ], + [ + 4, + 0.796 + ], + [ + 6, + 0.531 + ], + [ + 8, + 0.375 + ] + ], + "effect": "\u00d73: confused ranks 19 \u2192 10 of 21 styles (ParaSpeechCLAP); less aroused (\u22120.03 MSP), WER 3.4%" + } + ], + "accents": [ + { + "id": "american", + "label": "North America", + "tab": "english", + "region": "north_america", + "strength": "strong", + "map": { + "accents_en.american": 1 + }, + "range": [ + 0, + 2 + ], + "safe": [ + 0, + 1.5 + ], + "identity": [ + [ + 0.0, + 0.943 + ], + [ + 1.0, + 0.854 + ], + [ + 1.5, + 0.808 + ], + [ + 2.0, + 0.758 + ] + ], + "effect": "\u00d71: North America 19 \u2192 44% (British voices 75-88%)" + }, + { + "id": "british", + "label": "England", + "tab": "english", + "region": "england", + "strength": "strong", + "map": { + "accents_en.british": 1 + }, + "range": [ + 0, + 2 + ], + "safe": [ + 0, + 1.5 + ], + "identity": [ + [ + 0.0, + 0.943 + ], + [ + 1.0, + 0.871 + ], + [ + 1.5, + 0.84 + ], + [ + 2.0, + 0.804 + ] + ], + "effect": "\u00d71.5: English 40 \u2192 69%" + }, + { + "id": "scottish", + "label": "Scotland", + "tab": "english", + "region": "scotland", + "strength": "faint", + "map": { + "accents_en.scottish": 1 + }, + "range": [ + 0, + 2 + ], + "safe": [ + 0, + 1.5 + ], + "identity": [ + [ + 0.0, + 0.943 + ], + [ + 1.0, + 0.873 + ], + [ + 1.5, + 0.822 + ], + [ + 2.0, + 0.749 + ] + ], + "effect": "\u00d71.5: Scottish 0 \u2192 19%" + }, + { + "id": "irish", + "label": "Ireland", + "tab": "english", + "region": "ireland", + "strength": "faint", + "map": { + "accents_en.irish": 1 + }, + "range": [ + 0, + 2 + ], + "safe": [ + 0, + 1.5 + ], + "identity": [ + [ + 0.0, + 0.943 + ], + [ + 1.0, + 0.895 + ], + [ + 1.5, + 0.851 + ], + [ + 2.0, + 0.821 + ] + ], + "effect": "\u00d71.5: Irish 0 \u2192 17% (strong on some voices)" + }, + { + "id": "welsh", + "label": "Wales", + "tab": "english", + "region": "wales", + "strength": "strong", + "map": { + "accents_en.welsh": 1 + }, + "range": [ + 0, + 2 + ], + "safe": [ + 0, + 1.5 + ], + "identity": [ + [ + 0.0, + 0.943 + ], + [ + 1.0, + 0.866 + ], + [ + 1.5, + 0.813 + ], + [ + 2.0, + 0.762 + ] + ], + "effect": "\u00d71.5: Welsh 19 \u2192 60%; slows speech" + }, + { + "id": "australian", + "label": "Australia", + "tab": "english", + "region": "australia", + "strength": "strong", + "map": { + "accents_en.australian": 1 + }, + "range": [ + 0, + 2 + ], + "safe": [ + 0, + 1.5 + ], + "identity": [ + [ + 0.0, + 0.943 + ], + [ + 1.0, + 0.869 + ], + [ + 1.5, + 0.816 + ], + [ + 2.0, + 0.775 + ] + ], + "effect": "\u00d71.5: Oceania 8 \u2192 44%" + }, + { + "id": "indian", + "label": "India", + "tab": "english", + "region": "india", + "strength": "strong", + "map": { + "accents_en.indian": 1 + }, + "range": [ + 0, + 2 + ], + "safe": [ + 0, + 1.5 + ], + "identity": [ + [ + 0.0, + 0.943 + ], + [ + 1.0, + 0.806 + ], + [ + 1.5, + 0.702 + ], + [ + 2.0, + 0.616 + ] + ], + "effect": "\u00d71.5: South Asia 0 \u2192 79%" + }, + { + "id": "hin", + "label": "Hindi", + "tab": "world", + "region": "india", + "strength": "strong", + "map": { + "accents_l1.hin": 1 + }, + "range": [ + 0, + 2 + ], + "safe": [ + 0, + 1.5 + ], + "identity": null, + "effect": "\u00d71.5: South Asia 82% (LoRA 58%)" + }, + { + "id": "spa", + "label": "Spanish", + "tab": "world", + "region": "spain", + "strength": "strong", + "map": { + "accents_l1.spa": 1 + }, + "range": [ + 0, + 2 + ], + "safe": [ + 0, + 1.5 + ], + "identity": null, + "effect": "\u00d71: Romance 69% (LoRA 70%)" + }, + { + "id": "fra", + "label": "French", + "tab": "world", + "region": "france", + "strength": "strong", + "map": { + "accents_l1.fra": 1 + }, + "range": [ + 0, + 2 + ], + "safe": [ + 0, + 1.5 + ], + "identity": null, + "effect": "\u00d71.5: Romance 65% (LoRA 64%)" + }, + { + "id": "por", + "label": "Portuguese", + "tab": "world", + "region": "portugal", + "strength": "strong", + "map": { + "accents_l1.por": 1 + }, + "range": [ + 0, + 2 + ], + "safe": [ + 0, + 1.5 + ], + "identity": null, + "effect": "\u00d71: Romance 66% (LoRA 64%)" + }, + { + "id": "deu", + "label": "German", + "tab": "world", + "region": "germany", + "strength": "strong", + "map": { + "accents_l1.deu": 1 + }, + "range": [ + 0, + 2 + ], + "safe": [ + 0, + 1.5 + ], + "identity": null, + "effect": "\u00d71.5: Germanic 42% (LoRA 24%)" + }, + { + "id": "vie", + "label": "Vietnamese", + "tab": "world", + "region": "vietnam", + "strength": "faint", + "map": { + "accents_l1.vie": 1 + }, + "range": [ + 0, + 2 + ], + "safe": [ + 0, + 1.5 + ], + "identity": null, + "effect": "\u00d71.5: Southeast Asia 21% (LoRA 17%)" + }, + { + "id": "pol", + "label": "Polish", + "tab": "world", + "region": "poland", + "strength": "faint", + "map": { + "accents_l1.pol": 1 + }, + "range": [ + 0, + 2 + ], + "safe": [ + 0, + 1.5 + ], + "identity": null, + "effect": "\u00d71.5: Slavic 20% (LoRA 15%)" + }, + { + "id": "mandarin", + "label": "Mandarin", + "tab": "world", + "region": "china", + "strength": "strong", + "map": { + "mandarin.cmn": 1, + "mandarin_hidden.cmn": 0.3333333333333333 + }, + "range": [ + 0, + 1.5 + ], + "safe": [ + 0, + 1.5 + ], + "identity": [ + [ + 0.0, + 0.95 + ], + [ + 1.0, + 0.71 + ], + [ + 1.5, + 0.54 + ] + ], + "effect": "embedding \u00d71.5 + hidden \u00d70.5: East Asia 58% at 1.8% WER" + } + ], + "presets": { + "BBC newsreader": { + "accent:british": 1.5, + "authority": 3, + "room": 2 + }, + "Elderly Scottish narrator": { + "age": 1.5, + "accent:scottish": 1.5, + "deep": 2, + "range": -1 + }, + "Young Australian": { + "age": -1.5, + "accent:australian": 1.5, + "range": 1 + }, + "Gravelly old man": { + "gender": -1, + "age": 2, + "raspy": 3, + "deep": 2 + }, + "Soft-spoken Irish woman": { + "gender": 1, + "accent:irish": 1.5, + "soft": 3 + }, + "Indian English caller": { + "accent:indian": 1.5, + "room": -2 + }, + "Chatty podcaster": { + "chatty": 3, + "room": 1, + "lively": 4 + }, + "Late-night radio": { + "deep": 2, + "room": 3, + "pace": -0.8, + "projection": -0.6 + } + }, + "who": { + "gender": { + "control": "gender", + "logit_per_dose": 1.31, + "clip_logit": 3.0 + }, + "age": { + "control": "age", + "center_years": 42.0, + "years_per_dose": 8.7 + }, + "landmarks": { + "American Female": { + "female": 0.9944, + "age": 29.1 + }, + "American Male": { + "female": 0.0013, + "age": 52.4 + }, + "Australian Female": { + "female": 0.9968, + "age": 36.1 + }, + "British Female": { + "female": 0.9991, + "age": 52.6 + }, + "British Male": { + "female": 0.0099, + "age": 32.1 + }, + "David Attenborough": { + "female": 0.009, + "age": 72.5 + }, + "Dwarkesh": { + "female": 0.0022, + "age": 20.4 + }, + "German Accent Male": { + "female": 0.0121, + "age": 68.4 + }, + "Obama Yelling": { + "female": 0.0151, + "age": 55.7 + }, + "Obama": { + "female": 0.0018, + "age": 59.2 + }, + "Scottish Female": { + "female": 0.9992, + "age": 57.0 + }, + "Skyler": { + "female": 0.9921, + "age": 23.8 + } + }, + "note": "audeering/wav2vec2-large-robust-24-ft-age-gender on the first 20 s of each release default voice (/data/groups/audio/gabriel/zonosv2_realtime_demo/default_voices_gdn): P(female) = female/(female+male), age in years. Dose calibration from eval_sweep.json (six voices, embedding mode): 1.31 logits of P(female) per gender dose, 8.7 years per age dose (median per-voice slopes)." + }, + "moods": [ + { + "id": "angry", + "label": "Angry", + "control": "angry", + "valence": 0.21, + "arousal": 1.0, + "dose": 4, + "effect": "\u00d74: heard as angry on 17% of renders (from 0%; MSP-Podcast); more aroused (+0.35 MSP), WER 3.6%" + }, + { + "id": "happy", + "label": "Happy", + "control": "happy", + "valence": 0.28, + "arousal": 0.86, + "dose": 4, + "effect": "\u00d74: heard as happy on 62 / 58% of renders (from 21 / 15%; emotion2vec / MSP-Podcast); more aroused (+0.17 MSP), WER 2.5%" + }, + { + "id": "sad", + "label": "Sad", + "control": "sad", + "valence": -0.32, + "arousal": -0.74, + "dose": 6, + "effect": "\u00d76: heard as sad on 29 / 12% of renders (from 2 / 0%; MSP-Podcast / emotion2vec); less aroused (\u22120.15 MSP), WER 2.1%" + }, + { + "id": "calm", + "label": "Calm", + "control": "calm", + "valence": -0.28, + "arousal": -0.69, + "dose": 4, + "effect": "\u00d74: heard as calm on 94% of renders (from 77%; ParaSpeechCLAP); less aroused (\u22120.14 MSP), WER 0.9%" + }, + { + "id": "scared", + "label": "Scared", + "control": "scared", + "valence": -0.09, + "arousal": 0.53, + "dose": 12, + "effect": "\u00d712: heard as fearful on 8% of renders (from 0%; emotion2vec); more aroused (+0.11 MSP), WER 1.5%" + }, + { + "id": "confused", + "label": "Confused", + "control": "confused", + "valence": -0.12, + "arousal": -0.15, + "dose": 3, + "effect": "\u00d73: confused ranks 19 \u2192 10 of 21 styles (ParaSpeechCLAP); less aroused (\u22120.03 MSP), WER 3.4%" + } + ], + "preview_text": "Hello there. It's lovely to finally meet you, how have you been?", + "request_defaults": { + "speaker_mode": "embedding", + "speaker_cfg_scale": 1.5, + "topk": 40, + "stream_decode": "prefix" + }, + "identity_threshold": 0.8 + } +} diff --git a/steering/voice_quality_mect60k/authoritative.npy b/steering/voice_quality_mect60k/authoritative.npy new file mode 100644 index 0000000000000000000000000000000000000000..9b744c7dcbd6cb4a8e71f31b5866032329183c56 --- /dev/null +++ b/steering/voice_quality_mect60k/authoritative.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:599d8ce697957a19aebdb88f13bc58ff8a006818e4900af79e3af2e0d3e622a3 +size 896 diff --git a/steering/voice_quality_mect60k/deep.npy b/steering/voice_quality_mect60k/deep.npy new file mode 100644 index 0000000000000000000000000000000000000000..11c2e62d09dc3e0cbf68ec9c9b0cdf910c751bf3 --- /dev/null +++ b/steering/voice_quality_mect60k/deep.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b8a9096b4aecb0135eadaea625be5a11f21d02af8de4d94ddfd245842e9eba97 +size 896 diff --git a/steering/voice_quality_mect60k/eval_summary.json b/steering/voice_quality_mect60k/eval_summary.json new file mode 100644 index 0000000000000000000000000000000000000000..0200aeda3bfd5ee258b282fc2c4ad7d42f504914 --- /dev/null +++ b/steering/voice_quality_mect60k/eval_summary.json @@ -0,0 +1,654 @@ +{ + "all": { + "neutral": { + "wer": 0.004866946778711485, + "collapse": 0.0, + "identity": 0.9463956918186919, + "durx": 1.0, + "female": 0.4983073752615989, + "age": 41.317688735822834, + "f0": 136.19757792145845, + "f0_st": 2.903048200564409, + "voiced": 0.6307535235563585, + "rms_db": -38.16175572077433, + "snr_db": 39.82410788536072, + "bandwidth": 8300.152587890625, + "quality:deep": 0.2347025, + "quality:shrill": 0.20924874999999998, + "quality:nasal": 0.23775, + "quality:husky": 0.1761125, + "quality:raspy": 0.05948625, + "quality:silky": 0.4042279166666667, + "quality:crisp": 0.7082670833333333, + "quality:soft": 0.25702625, + "quality:booming": 0.49958083333333336, + "quality:authoritative": 0.5381658333333333, + "quality:guttural": 0.006755, + "quality:vocal-fry": 0.08060750000000001 + }, + "deep x2": { + "wer": 0.0023809523809523807, + "collapse": 0.0, + "identity": 0.9009691911501433, + "durx": 1.0387035679374388, + "female": 0.4985392355447402, + "age": 40.22182455907265, + "f0": 132.38148258942857, + "f0_st": 2.86071152057971, + "voiced": 0.6335674569668089, + "rms_db": -38.1301543712616, + "snr_db": 39.76051219304403, + "bandwidth": 9181.219482421875, + "quality:deep": 0.2758741666666667, + "quality:shrill": 0.21488333333333334, + "quality:nasal": 0.17627333333333337, + "quality:husky": 0.271685, + "quality:raspy": 0.12580666666666665, + "quality:silky": 0.42248291666666665, + "quality:crisp": 0.7103837500000001, + "quality:soft": 0.2750295833333333, + "quality:booming": 0.4890079166666667, + "quality:authoritative": 0.4756008333333333, + "quality:guttural": 0.06647666666666667, + "quality:vocal-fry": 0.10250708333333332 + }, + "deep x4": { + "wer": 0.0011904761904761904, + "collapse": 0.0, + "identity": 0.8077959893426744, + "durx": 1.0938914027149322, + "female": 0.4521755067592797, + "age": 38.760407331089176, + "f0": 119.40872217107932, + "f0_st": 2.96847636348717, + "voiced": 0.6479836369685223, + "rms_db": -38.71555002530416, + "snr_db": 38.18208305040995, + "bandwidth": 8928.652954101562, + "quality:deep": 0.38647125000000004, + "quality:shrill": 0.1701775, + "quality:nasal": 0.07529666666666666, + "quality:husky": 0.4012633333333333, + "quality:raspy": 0.19677958333333334, + "quality:silky": 0.3911554166666667, + "quality:crisp": 0.6723991666666667, + "quality:soft": 0.27079083333333337, + "quality:booming": 0.44814166666666666, + "quality:authoritative": 0.53373875, + "quality:guttural": 0.13928958333333333, + "quality:vocal-fry": 0.0006875000000000001 + }, + "shrill x2": { + "wer": 0.002415966386554622, + "collapse": 0.0, + "identity": 0.8672911536163138, + "durx": 0.9348220769789397, + "female": 0.5051398922223598, + "age": 43.7093178431193, + "f0": 146.62601940060105, + "f0_st": 2.7704386276235664, + "voiced": 0.6989610537068813, + "rms_db": -39.67708007494608, + "snr_db": 35.917832136154175, + "bandwidth": 8043.548583984375, + "quality:deep": 0.22786583333333335, + "quality:shrill": 0.22332541666666672, + "quality:nasal": 0.2509975, + "quality:husky": 0.2442091666666667, + "quality:raspy": 0.11543208333333332, + "quality:silky": 0.40512041666666665, + "quality:crisp": 0.7293520833333335, + "quality:soft": 0.24560500000000005, + "quality:booming": 0.5125737499999999, + "quality:authoritative": 0.5271579166666667, + "quality:guttural": 0.02778458333333333, + "quality:vocal-fry": 0.09386541666666666 + }, + "shrill x4": { + "wer": 0.015756302521008403, + "collapse": 0.0, + "identity": 0.6946611197207608, + "durx": 0.8961709022684632, + "female": 0.5310388750610097, + "age": 39.7199726353089, + "f0": 175.56328648045977, + "f0_st": 3.282032826141645, + "voiced": 0.7206677254427958, + "rms_db": -41.77561171849569, + "snr_db": 36.22440767288208, + "bandwidth": 7930.9478759765625, + "quality:deep": 0.08650541666666667, + "quality:shrill": 0.33463916666666665, + "quality:nasal": 0.33951166666666666, + "quality:husky": 0.13895791666666665, + "quality:raspy": 0.11673875, + "quality:silky": 0.48963333333333336, + "quality:crisp": 0.7125979166666667, + "quality:soft": 0.27477, + "quality:booming": 0.41944791666666664, + "quality:authoritative": 0.3422320833333334, + "quality:guttural": 0.03015125, + "quality:vocal-fry": 0.1699945833333333 + }, + "nasal x2": { + "wer": 0.0036764705882352936, + "collapse": 0.0, + "identity": 0.8979570092103107, + "durx": 0.9622996051567481, + "female": 0.4986474767841476, + "age": 41.93186052143574, + "f0": 136.99934195071663, + "f0_st": 2.533820529677213, + "voiced": 0.6780768606027193, + "rms_db": -39.08946418762207, + "snr_db": 37.04375648498535, + "bandwidth": 8055.6610107421875, + "quality:deep": 0.24831499999999998, + "quality:shrill": 0.20191875, + "quality:nasal": 0.21344833333333335, + "quality:husky": 0.22446333333333335, + "quality:raspy": 0.09849124999999999, + "quality:silky": 0.38976374999999996, + "quality:crisp": 0.7044754166666666, + "quality:soft": 0.24478166666666668, + "quality:booming": 0.53374875, + "quality:authoritative": 0.55434125, + "quality:guttural": 0.00460875, + "quality:vocal-fry": 0.056512083333333324 + }, + "nasal x4": { + "wer": 0.007247899159663865, + "collapse": 0.0, + "identity": 0.8241291811190451, + "durx": 0.9017948717948718, + "female": 0.497399219898701, + "age": 43.17331208537022, + "f0": 139.79379506777698, + "f0_st": 2.4459938973377024, + "voiced": 0.7084372490642794, + "rms_db": -37.86749291419983, + "snr_db": 33.9894163608551, + "bandwidth": 7934.088134765625, + "quality:deep": 0.17780958333333333, + "quality:shrill": 0.23573791666666666, + "quality:nasal": 0.3023616666666667, + "quality:husky": 0.15475000000000003, + "quality:raspy": 0.0671875, + "quality:silky": 0.38945583333333333, + "quality:crisp": 0.7131137500000001, + "quality:soft": 0.230415, + "quality:booming": 0.5105408333333333, + "quality:authoritative": 0.5470679166666667, + "quality:guttural": 0.004885833333333333, + "quality:vocal-fry": 0.10324208333333333 + }, + "husky x2": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.9053976839855092, + "durx": 1.0598729227761485, + "female": 0.49955648818286136, + "age": 43.24052954713503, + "f0": 128.41863040870976, + "f0_st": 2.667421910097733, + "voiced": 0.6304623541561398, + "rms_db": -38.531264543533325, + "snr_db": 37.20648248990377, + "bandwidth": 8346.359252929688, + "quality:deep": 0.24003, + "quality:shrill": 0.16701458333333333, + "quality:nasal": 0.18943, + "quality:husky": 0.20408, + "quality:raspy": 0.10105791666666665, + "quality:silky": 0.44361791666666667, + "quality:crisp": 0.7270279166666667, + "quality:soft": 0.26557458333333334, + "quality:booming": 0.4641341666666667, + "quality:authoritative": 0.5397266666666667, + "quality:guttural": 0.028484166666666668, + "quality:vocal-fry": 0.022256666666666664 + }, + "husky x4": { + "wer": 0.0011904761904761904, + "collapse": 0.0, + "identity": 0.8495610726856525, + "durx": 1.0468817204301075, + "female": 0.5006266017056381, + "age": 44.72927264869213, + "f0": 124.28648762838499, + "f0_st": 2.4070029371927677, + "voiced": 0.6305416848051185, + "rms_db": -42.04342254002889, + "snr_db": 35.453123569488525, + "bandwidth": 8432.492065429688, + "quality:deep": 0.2929616666666667, + "quality:shrill": 0.18929583333333333, + "quality:nasal": 0.14888833333333334, + "quality:husky": 0.32823291666666665, + "quality:raspy": 0.15095, + "quality:silky": 0.4250254166666667, + "quality:crisp": 0.6828045833333333, + "quality:soft": 0.28207208333333333, + "quality:booming": 0.43016999999999994, + "quality:authoritative": 0.55509625, + "quality:guttural": 0.12731, + "quality:vocal-fry": 0.042655 + }, + "raspy x2": { + "wer": 0.004831932773109244, + "collapse": 0.0, + "identity": 0.8520280916938496, + "durx": 1.0176799007444168, + "female": 0.5026898439852326, + "age": 48.40663385887941, + "f0": 130.2053067161775, + "f0_st": 3.2743065347470934, + "voiced": 0.649884474426133, + "rms_db": -38.37106148401896, + "snr_db": 39.58593980471293, + "bandwidth": 8476.904296875, + "quality:deep": 0.26031541666666663, + "quality:shrill": 0.1818995833333333, + "quality:nasal": 0.21879333333333328, + "quality:husky": 0.22798833333333338, + "quality:raspy": 0.12974208333333334, + "quality:silky": 0.4385745833333334, + "quality:crisp": 0.6867491666666666, + "quality:soft": 0.251305, + "quality:booming": 0.4146141666666667, + "quality:authoritative": 0.52982625, + "quality:guttural": 0.032195416666666664, + "quality:vocal-fry": 0.07937333333333334 + }, + "raspy x4": { + "wer": 0.007247899159663865, + "collapse": 0.0, + "identity": 0.6433174330743988, + "durx": 1.0233431879773343, + "female": 0.49918889880549006, + "age": 54.8148171355327, + "f0": 125.95495854095373, + "f0_st": 3.2474471591099188, + "voiced": 0.5954190472074645, + "rms_db": -40.54382880528768, + "snr_db": 36.05198073387146, + "bandwidth": 9302.792358398438, + "quality:deep": 0.26691708333333336, + "quality:shrill": 0.2713345833333333, + "quality:nasal": 0.2603275, + "quality:husky": 0.38238625, + "quality:raspy": 0.3365616666666667, + "quality:silky": 0.4416225, + "quality:crisp": 0.5387095833333333, + "quality:soft": 0.18306541666666667, + "quality:booming": 0.24383875, + "quality:authoritative": 0.48860499999999996, + "quality:guttural": 0.07428916666666667, + "quality:vocal-fry": 0.020244583333333333 + }, + "silky x2": { + "wer": 0.0021929824561403508, + "collapse": 0.0, + "identity": 0.896346822935777, + "durx": 1.0380479735318446, + "female": 0.5023087409014503, + "age": 41.4833360662063, + "f0": 140.9346190319537, + "f0_st": 3.4755524898734187, + "voiced": 0.6440101290450339, + "rms_db": -39.50288391113281, + "snr_db": 37.049089431762695, + "bandwidth": 8343.218994140625, + "quality:deep": 0.20067500000000002, + "quality:shrill": 0.1956616666666667, + "quality:nasal": 0.20760125, + "quality:husky": 0.21458958333333333, + "quality:raspy": 0.07482958333333332, + "quality:silky": 0.4301945833333334, + "quality:crisp": 0.6977920833333333, + "quality:soft": 0.3198770833333333, + "quality:booming": 0.43906833333333334, + "quality:authoritative": 0.5262558333333333, + "quality:guttural": 0.05271791666666667, + "quality:vocal-fry": 0.06210833333333333 + }, + "silky x4": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.8361626023634227, + "durx": 1.0113636363636362, + "female": 0.5013916667182153, + "age": 41.51422797391812, + "f0": 150.06117884503416, + "f0_st": 3.785749703916199, + "voiced": 0.6425306893811167, + "rms_db": -38.25845686594645, + "snr_db": 36.90584754943848, + "bandwidth": 8207.290649414062, + "quality:deep": 0.17536291666666667, + "quality:shrill": 0.1685325, + "quality:nasal": 0.20171666666666666, + "quality:husky": 0.1869229166666667, + "quality:raspy": 0.06227916666666666, + "quality:silky": 0.47082375000000004, + "quality:crisp": 0.6845024999999999, + "quality:soft": 0.32428625000000005, + "quality:booming": 0.3719104166666667, + "quality:authoritative": 0.5807862500000001, + "quality:guttural": 0.019956666666666668, + "quality:vocal-fry": 0.06110833333333334 + }, + "crisp x2": { + "wer": 0.014320728291316526, + "collapse": 0.0, + "identity": 0.8756742155021945, + "durx": 0.9438832772166106, + "female": 0.506069977505831, + "age": 39.570573841532074, + "f0": 138.60500242496698, + "f0_st": 2.8111890852304655, + "voiced": 0.5807113585175603, + "rms_db": -36.31166386604309, + "snr_db": 34.76304268836975, + "bandwidth": 9232.36083984375, + "quality:deep": 0.16437916666666666, + "quality:shrill": 0.22719583333333335, + "quality:nasal": 0.28348625, + "quality:husky": 0.12950125, + "quality:raspy": 0.022080000000000002, + "quality:silky": 0.34611333333333333, + "quality:crisp": 0.7253587499999999, + "quality:soft": 0.21948958333333335, + "quality:booming": 0.49537000000000003, + "quality:authoritative": 0.5821604166666666, + "quality:guttural": 0.0038658333333333335, + "quality:vocal-fry": 0.08160458333333334 + }, + "crisp x4": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.8209674010767296, + "durx": 0.8827083333333334, + "female": 0.502295659884112, + "age": 39.38930376122395, + "f0": 138.4394416856069, + "f0_st": 2.533773611332919, + "voiced": 0.618838106920955, + "rms_db": -36.34106206893921, + "snr_db": 33.17276096343994, + "bandwidth": 9746.017456054688, + "quality:deep": 0.11259083333333335, + "quality:shrill": 0.24064125, + "quality:nasal": 0.30547875, + "quality:husky": 0.11347375, + "quality:raspy": 0.017375833333333337, + "quality:silky": 0.2849091666666667, + "quality:crisp": 0.7965279166666667, + "quality:soft": 0.21595125, + "quality:booming": 0.5066383333333333, + "quality:authoritative": 0.6707166666666667, + "quality:guttural": 0.0009891666666666666, + "quality:vocal-fry": 0.08296416666666667 + }, + "soft x2": { + "wer": 0.0021929824561403508, + "collapse": 0.0, + "identity": 0.8810640211764892, + "durx": 1.0355113636363635, + "female": 0.5004228032339597, + "age": 42.53181914488474, + "f0": 137.09715850259636, + "f0_st": 3.063717522838582, + "voiced": 0.6748916974641527, + "rms_db": -42.006712675094604, + "snr_db": 38.60217332839966, + "bandwidth": 7634.417724609375, + "quality:deep": 0.20748250000000001, + "quality:shrill": 0.20117791666666665, + "quality:nasal": 0.18464625, + "quality:husky": 0.19068583333333333, + "quality:raspy": 0.08511208333333332, + "quality:silky": 0.47580541666666676, + "quality:crisp": 0.6990704166666667, + "quality:soft": 0.27597125, + "quality:booming": 0.4288616666666667, + "quality:authoritative": 0.5455266666666666, + "quality:guttural": 0.080055, + "quality:vocal-fry": 0.08725291666666667 + }, + "soft x4": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.761272645879027, + "durx": 1.015432098765432, + "female": 0.501666513455954, + "age": 42.16876352826754, + "f0": 145.8568613303745, + "f0_st": 3.260082333270218, + "voiced": 0.7003861108881733, + "rms_db": -45.68876544634501, + "snr_db": 37.16483990351359, + "bandwidth": 8074.951171875, + "quality:deep": 0.19725250000000003, + "quality:shrill": 0.18557208333333333, + "quality:nasal": 0.11238250000000001, + "quality:husky": 0.16673875000000002, + "quality:raspy": 0.08807166666666666, + "quality:silky": 0.59261625, + "quality:crisp": 0.6934999999999999, + "quality:soft": 0.34605083333333336, + "quality:booming": 0.39397250000000006, + "quality:authoritative": 0.58156375, + "quality:guttural": 0.04549666666666666, + "quality:vocal-fry": 0.009880833333333333 + }, + "booming x2": { + "wer": 0.0012254901960784314, + "collapse": 0.0, + "identity": 0.8733816847149264, + "durx": 0.9495238095238095, + "female": 0.4971129569603363, + "age": 38.939893431961536, + "f0": 147.17328062398414, + "f0_st": 3.498182801434647, + "voiced": 0.5844014308683426, + "rms_db": -35.84875520070394, + "snr_db": 38.620232025782265, + "bandwidth": 9490.75927734375, + "quality:deep": 0.20172333333333334, + "quality:shrill": 0.23662708333333335, + "quality:nasal": 0.2917295833333333, + "quality:husky": 0.18857875000000002, + "quality:raspy": 0.06422666666666667, + "quality:silky": 0.34727250000000004, + "quality:crisp": 0.7078241666666667, + "quality:soft": 0.18201166666666665, + "quality:booming": 0.5693783333333333, + "quality:authoritative": 0.5575725, + "quality:guttural": 0.003565, + "quality:vocal-fry": 0.05518666666666667 + }, + "booming x4": { + "wer": 0.006022408963585434, + "collapse": 0.0, + "identity": 0.744077150843817, + "durx": 0.8643904320987654, + "female": 0.48655614129287034, + "age": 36.011979853113495, + "f0": 155.55223029664475, + "f0_st": 3.9774374819026748, + "voiced": 0.5712037686069469, + "rms_db": -36.31201044718424, + "snr_db": 35.848182598749794, + "bandwidth": 9891.366577148438, + "quality:deep": 0.14366791666666667, + "quality:shrill": 0.2874758333333334, + "quality:nasal": 0.37330083333333336, + "quality:husky": 0.13208041666666667, + "quality:raspy": 0.050513333333333334, + "quality:silky": 0.2838366666666667, + "quality:crisp": 0.6726820833333332, + "quality:soft": 0.14430166666666666, + "quality:booming": 0.5847820833333334, + "quality:authoritative": 0.5865287499999999, + "quality:guttural": 0.0005945833333333334, + "quality:vocal-fry": 0.04823583333333333 + }, + "authoritative x2": { + "wer": 0.004831932773109243, + "collapse": 0.0, + "identity": 0.8751557773056263, + "durx": 0.9729464285714287, + "female": 0.49975977443682496, + "age": 45.87260180463394, + "f0": 148.97128861670342, + "f0_st": 3.5544767081510287, + "voiced": 0.5890754081847885, + "rms_db": -36.14015316963196, + "snr_db": 40.15280636151632, + "bandwidth": 7528.0975341796875, + "quality:deep": 0.22253291666666666, + "quality:shrill": 0.23968374999999997, + "quality:nasal": 0.2280475, + "quality:husky": 0.20236666666666667, + "quality:raspy": 0.06150833333333333, + "quality:silky": 0.3082841666666667, + "quality:crisp": 0.7529566666666666, + "quality:soft": 0.23812, + "quality:booming": 0.5974725, + "quality:authoritative": 0.6379020833333333, + "quality:guttural": 0.009578333333333333, + "quality:vocal-fry": 0.07908333333333335 + }, + "authoritative x4": { + "wer": 0.0, + "collapse": 0.0, + "identity": 0.7654500498587195, + "durx": 0.9281219452590421, + "female": 0.49682659140671603, + "age": 50.19060100118319, + "f0": 159.8366837295395, + "f0_st": 4.172176629632188, + "voiced": 0.5839481252030642, + "rms_db": -36.668997844060264, + "snr_db": 41.292596896489464, + "bandwidth": 6707.5927734375, + "quality:deep": 0.19436166666666665, + "quality:shrill": 0.20043083333333334, + "quality:nasal": 0.2515133333333333, + "quality:husky": 0.13581916666666669, + "quality:raspy": 0.03741291666666667, + "quality:silky": 0.2647129166666667, + "quality:crisp": 0.7879825, + "quality:soft": 0.2851466666666667, + "quality:booming": 0.5821079166666666, + "quality:authoritative": 0.77597375, + "quality:guttural": 0.003935833333333334, + "quality:vocal-fry": 0.11561208333333334 + }, + "guttural x2": { + "wer": 0.004866946778711485, + "collapse": 0.0, + "identity": 0.7279959582684112, + "durx": 1.0389266817838245, + "female": 0.2370058711967431, + "age": 40.48638238261143, + "f0": 112.84082978308739, + "f0_st": 3.0417379747490068, + "voiced": 0.6821621903414199, + "rms_db": -40.50285863876343, + "snr_db": 33.99963935216268, + "bandwidth": 8567.523193359375, + "quality:deep": 0.389365, + "quality:shrill": 0.14124, + "quality:nasal": 0.14500500000000002, + "quality:husky": 0.32195583333333333, + "quality:raspy": 0.17355125000000002, + "quality:silky": 0.32524291666666666, + "quality:crisp": 0.5339966666666667, + "quality:soft": 0.18035958333333332, + "quality:booming": 0.33192208333333334, + "quality:authoritative": 0.52676, + "quality:guttural": 0.05966666666666667, + "quality:vocal-fry": 0.0013949999999999998 + }, + "guttural x4": { + "wer": 0.013854889781999757, + "collapse": 0.0, + "identity": 0.3890738803466547, + "durx": 1.0705076551168413, + "female": 0.004611095874376285, + "age": 57.23831790188948, + "f0": 75.96888164865572, + "f0_st": 2.2058295053598465, + "voiced": 0.5937092228106485, + "rms_db": -43.876219272613525, + "snr_db": 31.92168935139974, + "bandwidth": 9040.3564453125, + "quality:deep": 0.8904020833333334, + "quality:shrill": 0.0004233333333333333, + "quality:nasal": 0.051126666666666674, + "quality:husky": 0.68310125, + "quality:raspy": 0.42171875, + "quality:silky": 0.010739583333333332, + "quality:crisp": 0.15145375000000003, + "quality:soft": 0.06595416666666666, + "quality:booming": 0.2893129166666667, + "quality:authoritative": 0.6927820833333334, + "quality:guttural": 0.37237374999999995, + "quality:vocal-fry": 0.0033279166666666665 + }, + "vocal_fry x2": { + "wer": 0.014048308110429527, + "collapse": 0.0, + "identity": 0.6298004155882445, + "durx": 0.8610661268556006, + "female": 0.5080539070089193, + "age": 31.4393050968647, + "f0": 141.8109336304192, + "f0_st": 2.9999554905440426, + "voiced": 0.7031217302781746, + "rms_db": -41.90695826212565, + "snr_db": 34.39292701085409, + "bandwidth": 10583.5693359375, + "quality:deep": 0.10398791666666668, + "quality:shrill": 0.39970083333333334, + "quality:nasal": 0.3790995833333333, + "quality:husky": 0.16140583333333333, + "quality:raspy": 0.15162208333333335, + "quality:silky": 0.39248208333333334, + "quality:crisp": 0.7200083333333334, + "quality:soft": 0.3773391666666666, + "quality:booming": 0.5064170833333334, + "quality:authoritative": 0.3152666666666667, + "quality:guttural": 0.0024020833333333333, + "quality:vocal-fry": 0.2752395833333333 + }, + "vocal_fry x4": { + "wer": 0.021854268022998672, + "collapse": 0.0, + "identity": 0.33099906154087366, + "durx": 0.7947368421052632, + "female": 0.7127863417069117, + "age": 27.18365751206875, + "f0": 163.17050298025703, + "f0_st": 3.134762139732216, + "voiced": 0.7450578944261862, + "rms_db": -45.95399959882101, + "snr_db": 32.968310038248696, + "bandwidth": 11306.72607421875, + "quality:deep": 1.6666666666666669e-06, + "quality:shrill": 0.9318320833333334, + "quality:nasal": 0.5105595833333333, + "quality:husky": 6.333333333333333e-05, + "quality:raspy": 0.03589916666666667, + "quality:silky": 0.1148675, + "quality:crisp": 0.7648075000000002, + "quality:soft": 0.19511750000000003, + "quality:booming": 0.7222083333333332, + "quality:authoritative": 0.10943708333333334, + "quality:guttural": 0.0, + "quality:vocal-fry": 0.91579 + } + } +} diff --git a/steering/voice_quality_mect60k/husky.npy b/steering/voice_quality_mect60k/husky.npy new file mode 100644 index 0000000000000000000000000000000000000000..48d8c0199f60f319f28fd2e34babc724fc39f957 --- /dev/null +++ b/steering/voice_quality_mect60k/husky.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:67c0b613dc5e2727729d0ba23e98bac56d97e57aa7e8d72bca62e57997001fcc +size 896 diff --git a/steering/voice_quality_mect60k/manifest.json b/steering/voice_quality_mect60k/manifest.json new file mode 100644 index 0000000000000000000000000000000000000000..19c12c5a671bd67440ba2ae5ac3302fe6abae393 --- /dev/null +++ b/steering/voice_quality_mect60k/manifest.json @@ -0,0 +1,301 @@ +{ + "dim": 192, + "space": "raw", + "checkpoint": "/data/groups/audio/gabriel/hf_release_zonos3mini_20261020/lm/mect_60k", + "corpus": "/data/groups/audio/sofian/runs/steer_corpora/paraspeechcaps/clips.json", + "spec": { + "space": "raw", + "orthogonal_to": [ + "/data/groups/audio/sofian/bingua2-gdn-emotion/minisgl/speaker_attributes_mect60k" + ], + "directions": { + "deep": { + "pairs": [ + [ + { + "corpus": "voxceleb", + "gender": "female", + "q_deep": true + }, + { + "corpus": "voxceleb", + "gender": "female", + "q_deep": false + } + ], + [ + { + "corpus": "voxceleb", + "gender": "male", + "q_deep": true + }, + { + "corpus": "voxceleb", + "gender": "male", + "q_deep": false + } + ], + [ + { + "corpus": "ears", + "gender": "male", + "q_deep": true + }, + { + "corpus": "ears", + "gender": "male", + "q_deep": false + } + ] + ] + }, + "shrill": { + "pairs": [ + [ + { + "corpus": "voxceleb", + "gender": "female", + "q_shrill": true + }, + { + "corpus": "voxceleb", + "gender": "female", + "q_shrill": false + } + ], + [ + { + "corpus": "voxceleb", + "gender": "male", + "q_shrill": true + }, + { + "corpus": "voxceleb", + "gender": "male", + "q_shrill": false + } + ], + [ + { + "corpus": "ears", + "gender": "female", + "q_shrill": true + }, + { + "corpus": "ears", + "gender": "female", + "q_shrill": false + } + ] + ] + }, + "husky": { + "pairs": [ + [ + { + "corpus": "voxceleb", + "gender": "female", + "q_husky": true + }, + { + "corpus": "voxceleb", + "gender": "female", + "q_husky": false + } + ], + [ + { + "corpus": "voxceleb", + "gender": "male", + "q_husky": true + }, + { + "corpus": "voxceleb", + "gender": "male", + "q_husky": false + } + ], + [ + { + "corpus": "ears", + "gender": "male", + "q_husky": true + }, + { + "corpus": "ears", + "gender": "male", + "q_husky": false + } + ] + ] + }, + "raspy": { + "pairs": [ + [ + { + "corpus": "voxceleb", + "gender": "female", + "q_raspy": true + }, + { + "corpus": "voxceleb", + "gender": "female", + "q_raspy": false + } + ], + [ + { + "corpus": "voxceleb", + "gender": "male", + "q_raspy": true + }, + { + "corpus": "voxceleb", + "gender": "male", + "q_raspy": false + } + ], + [ + { + "corpus": "ears", + "gender": "female", + "q_raspy": true + }, + { + "corpus": "ears", + "gender": "female", + "q_raspy": false + } + ], + [ + { + "corpus": "ears", + "gender": "male", + "q_raspy": true + }, + { + "corpus": "ears", + "gender": "male", + "q_raspy": false + } + ] + ] + }, + "soft": { + "pairs": [ + [ + { + "corpus": "voxceleb", + "gender": "female", + "q_soft": true + }, + { + "corpus": "voxceleb", + "gender": "female", + "q_soft": false + } + ], + [ + { + "corpus": "voxceleb", + "gender": "male", + "q_soft": true + }, + { + "corpus": "voxceleb", + "gender": "male", + "q_soft": false + } + ], + [ + { + "corpus": "ears", + "gender": "female", + "q_soft": true + }, + { + "corpus": "ears", + "gender": "female", + "q_soft": false + } + ] + ] + }, + "authoritative": { + "pairs": [ + [ + { + "corpus": "voxceleb", + "gender": "female", + "q_authoritative": true + }, + { + "corpus": "voxceleb", + "gender": "female", + "q_authoritative": false + } + ], + [ + { + "corpus": "voxceleb", + "gender": "male", + "q_authoritative": true + }, + { + "corpus": "voxceleb", + "gender": "male", + "q_authoritative": false + } + ], + [ + { + "corpus": "ears", + "gender": "male", + "q_authoritative": true + }, + { + "corpus": "ears", + "gender": "male", + "q_authoritative": false + } + ] + ] + } + } + }, + "directions": { + "deep": { + "file": "deep.npy", + "kind": "named", + "norm": 0.5765019744974527 + }, + "shrill": { + "file": "shrill.npy", + "kind": "named", + "norm": 0.8610223457716267 + }, + "husky": { + "file": "husky.npy", + "kind": "named", + "norm": 0.5867545131746184 + }, + "raspy": { + "file": "raspy.npy", + "kind": "named", + "norm": 0.8753706576316298 + }, + "soft": { + "file": "soft.npy", + "kind": "named", + "norm": 0.722508601574993 + }, + "authoritative": { + "file": "authoritative.npy", + "kind": "named", + "norm": 0.6506623679403928 + } + }, + "input_dim": 192, + "speaker_codec": "ownmect_s2", + "ref_base_norm": 3.826565928967399 +} diff --git a/steering/voice_quality_mect60k/raspy.npy b/steering/voice_quality_mect60k/raspy.npy new file mode 100644 index 0000000000000000000000000000000000000000..0ba7f7de5c77ac635224bb3e1d712d8b4641d81f --- /dev/null +++ b/steering/voice_quality_mect60k/raspy.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:54f004215a259783b37adbfe9dc67bf19b2f99b095dd6fdc23284de29743a43c +size 896 diff --git a/steering/voice_quality_mect60k/report.json b/steering/voice_quality_mect60k/report.json new file mode 100644 index 0000000000000000000000000000000000000000..f2c78cec1383785f1bf0cc7f2c23a44e53082ce5 --- /dev/null +++ b/steering/voice_quality_mect60k/report.json @@ -0,0 +1,494 @@ +{ + "deep": { + "norm": 0.5765019744974527, + "removed_share": 0.10945321039375322, + "pairs": [ + { + "pair": [ + { + "corpus": "voxceleb", + "gender": "female", + "q_deep": true + }, + { + "corpus": "voxceleb", + "gender": "female", + "q_deep": false + } + ], + "train_speakers": [ + 3, + 154 + ], + "held_out_speakers": [ + 0, + 41 + ], + "held_out_auc": NaN, + "cos_with_direction": 0.11488527191150882 + }, + { + "pair": [ + { + "corpus": "voxceleb", + "gender": "male", + "q_deep": true + }, + { + "corpus": "voxceleb", + "gender": "male", + "q_deep": false + } + ], + "train_speakers": [ + 130, + 157 + ], + "held_out_speakers": [ + 33, + 50 + ], + "held_out_auc": 0.7606060606060606, + "cos_with_direction": 0.9142597249486913 + }, + { + "pair": [ + { + "corpus": "ears", + "gender": "male", + "q_deep": true + }, + { + "corpus": "ears", + "gender": "male", + "q_deep": false + } + ], + "train_speakers": [ + 23, + 11 + ], + "held_out_speakers": [ + 6, + 3 + ], + "held_out_auc": 0.5555555555555556, + "cos_with_direction": 0.3460187357905659 + } + ] + }, + "shrill": { + "norm": 0.8610223457716267, + "removed_share": 0.02757108513296458, + "pairs": [ + { + "pair": [ + { + "corpus": "voxceleb", + "gender": "female", + "q_shrill": true + }, + { + "corpus": "voxceleb", + "gender": "female", + "q_shrill": false + } + ], + "train_speakers": [ + 31, + 126 + ], + "held_out_speakers": [ + 11, + 30 + ], + "held_out_auc": 0.6303030303030303, + "cos_with_direction": 0.8598823635483033 + }, + { + "pair": [ + { + "corpus": "voxceleb", + "gender": "male", + "q_shrill": true + }, + { + "corpus": "voxceleb", + "gender": "male", + "q_shrill": false + } + ], + "train_speakers": [ + 8, + 279 + ], + "held_out_speakers": [ + 0, + 83 + ], + "held_out_auc": NaN, + "cos_with_direction": 0.5593689746627238 + }, + { + "pair": [ + { + "corpus": "ears", + "gender": "female", + "q_shrill": true + }, + { + "corpus": "ears", + "gender": "female", + "q_shrill": false + } + ], + "train_speakers": [ + 7, + 38 + ], + "held_out_speakers": [ + 2, + 17 + ], + "held_out_auc": 0.29411764705882354, + "cos_with_direction": 0.37461099441188345 + } + ] + }, + "husky": { + "norm": 0.5867545131746184, + "removed_share": 0.048480306527915906, + "pairs": [ + { + "pair": [ + { + "corpus": "voxceleb", + "gender": "female", + "q_husky": true + }, + { + "corpus": "voxceleb", + "gender": "female", + "q_husky": false + } + ], + "train_speakers": [ + 4, + 153 + ], + "held_out_speakers": [ + 1, + 40 + ], + "held_out_auc": 1.0, + "cos_with_direction": 0.4102496595275657 + }, + { + "pair": [ + { + "corpus": "voxceleb", + "gender": "male", + "q_husky": true + }, + { + "corpus": "voxceleb", + "gender": "male", + "q_husky": false + } + ], + "train_speakers": [ + 46, + 241 + ], + "held_out_speakers": [ + 11, + 72 + ], + "held_out_auc": 0.4659090909090909, + "cos_with_direction": 0.8882408911887717 + }, + { + "pair": [ + { + "corpus": "ears", + "gender": "male", + "q_husky": true + }, + { + "corpus": "ears", + "gender": "male", + "q_husky": false + } + ], + "train_speakers": [ + 9, + 25 + ], + "held_out_speakers": [ + 1, + 8 + ], + "held_out_auc": 0.5, + "cos_with_direction": 0.32969608139006235 + } + ] + }, + "raspy": { + "norm": 0.8753706576316298, + "removed_share": 0.006941417346383316, + "pairs": [ + { + "pair": [ + { + "corpus": "voxceleb", + "gender": "female", + "q_raspy": true + }, + { + "corpus": "voxceleb", + "gender": "female", + "q_raspy": false + } + ], + "train_speakers": [ + 14, + 143 + ], + "held_out_speakers": [ + 1, + 40 + ], + "held_out_auc": 0.975, + "cos_with_direction": 0.7169767019735188 + }, + { + "pair": [ + { + "corpus": "voxceleb", + "gender": "male", + "q_raspy": true + }, + { + "corpus": "voxceleb", + "gender": "male", + "q_raspy": false + } + ], + "train_speakers": [ + 34, + 253 + ], + "held_out_speakers": [ + 15, + 68 + ], + "held_out_auc": 0.5666666666666667, + "cos_with_direction": 0.8540833566436784 + }, + { + "pair": [ + { + "corpus": "ears", + "gender": "female", + "q_raspy": true + }, + { + "corpus": "ears", + "gender": "female", + "q_raspy": false + } + ], + "train_speakers": [ + 5, + 40 + ], + "held_out_speakers": [ + 0, + 19 + ], + "held_out_auc": NaN, + "cos_with_direction": 0.40845282298831853 + }, + { + "pair": [ + { + "corpus": "ears", + "gender": "male", + "q_raspy": true + }, + { + "corpus": "ears", + "gender": "male", + "q_raspy": false + } + ], + "train_speakers": [ + 3, + 31 + ], + "held_out_speakers": [ + 2, + 7 + ], + "held_out_auc": 0.7142857142857143, + "cos_with_direction": 0.30758249206693555 + } + ] + }, + "soft": { + "norm": 0.722508601574993, + "removed_share": 0.006702683106764029, + "pairs": [ + { + "pair": [ + { + "corpus": "voxceleb", + "gender": "female", + "q_soft": true + }, + { + "corpus": "voxceleb", + "gender": "female", + "q_soft": false + } + ], + "train_speakers": [ + 13, + 144 + ], + "held_out_speakers": [ + 3, + 38 + ], + "held_out_auc": 0.32456140350877194, + "cos_with_direction": 0.5949769185774906 + }, + { + "pair": [ + { + "corpus": "voxceleb", + "gender": "male", + "q_soft": true + }, + { + "corpus": "voxceleb", + "gender": "male", + "q_soft": false + } + ], + "train_speakers": [ + 14, + 273 + ], + "held_out_speakers": [ + 5, + 78 + ], + "held_out_auc": 0.5871794871794872, + "cos_with_direction": 0.6773755439423391 + }, + { + "pair": [ + { + "corpus": "ears", + "gender": "female", + "q_soft": true + }, + { + "corpus": "ears", + "gender": "female", + "q_soft": false + } + ], + "train_speakers": [ + 6, + 39 + ], + "held_out_speakers": [ + 6, + 13 + ], + "held_out_auc": 0.3076923076923077, + "cos_with_direction": 0.6324648783698372 + } + ] + }, + "authoritative": { + "norm": 0.6506623679403928, + "removed_share": 0.20802959135494703, + "pairs": [ + { + "pair": [ + { + "corpus": "voxceleb", + "gender": "female", + "q_authoritative": true + }, + { + "corpus": "voxceleb", + "gender": "female", + "q_authoritative": false + } + ], + "train_speakers": [ + 13, + 144 + ], + "held_out_speakers": [ + 1, + 40 + ], + "held_out_auc": 0.825, + "cos_with_direction": 0.5232440873318961 + }, + { + "pair": [ + { + "corpus": "voxceleb", + "gender": "male", + "q_authoritative": true + }, + { + "corpus": "voxceleb", + "gender": "male", + "q_authoritative": false + } + ], + "train_speakers": [ + 50, + 237 + ], + "held_out_speakers": [ + 20, + 63 + ], + "held_out_auc": 0.6182539682539683, + "cos_with_direction": 0.7992828966285668 + }, + { + "pair": [ + { + "corpus": "ears", + "gender": "male", + "q_authoritative": true + }, + { + "corpus": "ears", + "gender": "male", + "q_authoritative": false + } + ], + "train_speakers": [ + 10, + 24 + ], + "held_out_speakers": [ + 0, + 9 + ], + "held_out_auc": NaN, + "cos_with_direction": 0.33020482115861616 + } + ] + } +} diff --git a/steering/voice_quality_mect60k/shrill.npy b/steering/voice_quality_mect60k/shrill.npy new file mode 100644 index 0000000000000000000000000000000000000000..62668af33af489451fe78b4e78322b6365a89eef --- /dev/null +++ b/steering/voice_quality_mect60k/shrill.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:152528b12c2da06b2e508378dd84537d72f1659d19673db7f559c15759a8932b +size 896 diff --git a/steering/voice_quality_mect60k/soft.npy b/steering/voice_quality_mect60k/soft.npy new file mode 100644 index 0000000000000000000000000000000000000000..7c9c342619d98008002101fa572bd1e90c85e910 --- /dev/null +++ b/steering/voice_quality_mect60k/soft.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e266201d0342cb8d12a8e2f617e202b289986c78ebeb1359fbd7f9fd78cfc2c8 +size 896 diff --git a/steering/voice_quality_mect60k/spec.json b/steering/voice_quality_mect60k/spec.json new file mode 100644 index 0000000000000000000000000000000000000000..72e7b2773aac1d837e7e29ca23a13c7a1881cc5e --- /dev/null +++ b/steering/voice_quality_mect60k/spec.json @@ -0,0 +1,260 @@ +{ + "space": "raw", + "orthogonal_to": [ + "/data/groups/audio/sofian/bingua2-gdn-emotion/minisgl/speaker_attributes_mect60k" + ], + "directions": { + "deep": { + "pairs": [ + [ + { + "corpus": "voxceleb", + "gender": "female", + "q_deep": true + }, + { + "corpus": "voxceleb", + "gender": "female", + "q_deep": false + } + ], + [ + { + "corpus": "voxceleb", + "gender": "male", + "q_deep": true + }, + { + "corpus": "voxceleb", + "gender": "male", + "q_deep": false + } + ], + [ + { + "corpus": "ears", + "gender": "male", + "q_deep": true + }, + { + "corpus": "ears", + "gender": "male", + "q_deep": false + } + ] + ] + }, + "shrill": { + "pairs": [ + [ + { + "corpus": "voxceleb", + "gender": "female", + "q_shrill": true + }, + { + "corpus": "voxceleb", + "gender": "female", + "q_shrill": false + } + ], + [ + { + "corpus": "voxceleb", + "gender": "male", + "q_shrill": true + }, + { + "corpus": "voxceleb", + "gender": "male", + "q_shrill": false + } + ], + [ + { + "corpus": "ears", + "gender": "female", + "q_shrill": true + }, + { + "corpus": "ears", + "gender": "female", + "q_shrill": false + } + ] + ] + }, + "husky": { + "pairs": [ + [ + { + "corpus": "voxceleb", + "gender": "female", + "q_husky": true + }, + { + "corpus": "voxceleb", + "gender": "female", + "q_husky": false + } + ], + [ + { + "corpus": "voxceleb", + "gender": "male", + "q_husky": true + }, + { + "corpus": "voxceleb", + "gender": "male", + "q_husky": false + } + ], + [ + { + "corpus": "ears", + "gender": "male", + "q_husky": true + }, + { + "corpus": "ears", + "gender": "male", + "q_husky": false + } + ] + ] + }, + "raspy": { + "pairs": [ + [ + { + "corpus": "voxceleb", + "gender": "female", + "q_raspy": true + }, + { + "corpus": "voxceleb", + "gender": "female", + "q_raspy": false + } + ], + [ + { + "corpus": "voxceleb", + "gender": "male", + "q_raspy": true + }, + { + "corpus": "voxceleb", + "gender": "male", + "q_raspy": false + } + ], + [ + { + "corpus": "ears", + "gender": "female", + "q_raspy": true + }, + { + "corpus": "ears", + "gender": "female", + "q_raspy": false + } + ], + [ + { + "corpus": "ears", + "gender": "male", + "q_raspy": true + }, + { + "corpus": "ears", + "gender": "male", + "q_raspy": false + } + ] + ] + }, + "soft": { + "pairs": [ + [ + { + "corpus": "voxceleb", + "gender": "female", + "q_soft": true + }, + { + "corpus": "voxceleb", + "gender": "female", + "q_soft": false + } + ], + [ + { + "corpus": "voxceleb", + "gender": "male", + "q_soft": true + }, + { + "corpus": "voxceleb", + "gender": "male", + "q_soft": false + } + ], + [ + { + "corpus": "ears", + "gender": "female", + "q_soft": true + }, + { + "corpus": "ears", + "gender": "female", + "q_soft": false + } + ] + ] + }, + "authoritative": { + "pairs": [ + [ + { + "corpus": "voxceleb", + "gender": "female", + "q_authoritative": true + }, + { + "corpus": "voxceleb", + "gender": "female", + "q_authoritative": false + } + ], + [ + { + "corpus": "voxceleb", + "gender": "male", + "q_authoritative": true + }, + { + "corpus": "voxceleb", + "gender": "male", + "q_authoritative": false + } + ], + [ + { + "corpus": "ears", + "gender": "male", + "q_authoritative": true + }, + { + "corpus": "ears", + "gender": "male", + "q_authoritative": false + } + ] + ] + } + } +} \ No newline at end of file diff --git a/zonos3/__init__.py b/zonos3/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/zonos3/codec/SOURCE.md b/zonos3/codec/SOURCE.md new file mode 100644 index 0000000000000000000000000000000000000000..6d8bd9ef1bd0de357fcc70172af998cde762b412 --- /dev/null +++ b/zonos3/codec/SOURCE.md @@ -0,0 +1,33 @@ +# Provenance of `zonos3.codec` + +Vendored from the s1_s2_dac codec package of the release codec `opus_dual_3n_600k_sched600k_r4096_step600000`. + +- `P` = `/data/groups/audio/gabriel/s1_s2_dac/downstream/campaigns/opus_dual_finished_50k_20260912/packages/3n_600k_sched600k_r4096/source` +- `R` = `/data/groups/audio/gabriel/s1_s2_dac` + +| File | Source | +| --- | --- | +| `codec_adapter.py` | bingua2 `minisgl/vendor/dual_codec_adapter/codec_adapter.py` (f543d63) | +| `resample_exact.py` | `P/resample_exact.py` | +| `istft_head_a_20261002/{__init__,model}.py` | `R/istft_head_a_20261002/` | +| `hybrid10_dual_encoding/{__init__,base_model,inference,model}.py` | `P/hybrid10_dual_encoding/` | +| `s1dac/{__init__,losses}.py` | `P/s1dac/` | +| `s1dac/vendor/{__init__,modded_dac,rvq}.py` | `P/s1dac/vendor/` | +| `s1dac/same_data/npy_ogg_dataset.py` | `P/s1dac/same_data/npy_ogg_dataset.py` L48-51 (`_cached_resampler`) and L85-118 (`Wav2Vec2BertFeaturePreprocessor`), verbatim | +| `data_processing/{independent_batcher,torch_utils}.py` | `P/data_processing/` | + +## Changes + +- Every import of `data_processing`, `resample_exact`, `hybrid10_dual_encoding` and `s1dac` is rewritten to + `zonos3.codec.*`; the runtime no longer puts codec directories on `sys.path`. +- `s1dac/same_data/npy_ogg_dataset.py` keeps only the W2V-BERT preprocessor; the torchcodec/ctypes dataset code is not + used at inference. `s1dac/same_data/__init__.py` is empty. +- `data_processing/__init__.py` holds a docstring only (no `raw_audio_dataloader` import, no `__getattr__`). +- `codec_adapter.py` (`MossAutoencoder`): + - takes the generator checkpoint, SSL teacher dir, step, codebook sizes, codec name, checkpoint sha256 and device as + keyword arguments (`tokenizer/dual_reference.py` fills them from the codec registry) instead of reading the + package's `checkpoints/hybrid_10cb.json` receipt; the device is no longer hardcoded to `cuda:0`; + - drops `ROOT`, `add_arguments` and `create_autoencoder`; + - drops the real-audio validation on `audio_examples.pt` (not released) and the `checks/` report file; the random + warm-up graph/native agreement checks stay; + - `metadata()` reports `ssl_teacher` (the teacher dir) instead of the package's `teacher.sha256` manifest. diff --git a/zonos3/codec/__init__.py b/zonos3/codec/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..f4587bc52bff6aa6ae0db11bc6a7261e7631ae9c --- /dev/null +++ b/zonos3/codec/__init__.py @@ -0,0 +1 @@ +"""Dual codec (encoder, quantizer, causal MR iSTFT decoder) of ZONOS3, vendored from the s1_s2_dac codec package.""" diff --git a/zonos3/codec/codec_adapter.py b/zonos3/codec/codec_adapter.py new file mode 100644 index 0000000000000000000000000000000000000000..1a263cb797a52c4fa786b592386731f41d1e7f96 --- /dev/null +++ b/zonos3/codec/codec_adapter.py @@ -0,0 +1,133 @@ +"""Frozen dual codec: native SSL teacher -> semantic Q1, acoustic residual RVQ. + +Each independent lane retains both external-rate teacher audio and full-file +resampled codec audio. Packing external hop samples into the second channel is +lossless and only aligns the two sample grids for the existing batch scheduler. +The teacher sees 20-second lanes, including the same 10-second real left context +as the acoustic encoder. It retains native bidirectional attention within a lane. +""" +import json,time +from types import SimpleNamespace +import numpy as np +import torch +from torch.nn import functional as F +from zonos3.codec.data_processing.independent_batcher import IndependentBatcher +from zonos3.codec.data_processing.torch_utils import compile_fixed +from zonos3.codec.resample_exact import resample_exact +from zonos3.codec.hybrid10_dual_encoding.model import MossCodec +from zonos3.codec.hybrid10_dual_encoding.inference import extract_ssl +from zonos3.codec.s1dac.losses import SemanticTeacher + +class MossAutoencoder: + def __init__(self,args,*,generator_path:str,teacher_dir:str,step:int,codebook_sizes:list[int],name:str,checkpoint_sha256:str,device:str): + torch.set_num_threads(1) + torch.backends.cuda.matmul.allow_tf32=False + torch.backends.cudnn.allow_tf32=False + self.device=torch.device(device) + if self.device.type!='cuda':raise RuntimeError('Production encoding requires an allocated GPU') + torch.cuda.set_device(self.device) + self.receipt=dict(step=step,codebook_sizes=list(codebook_sizes),output_name=name,sha256=checkpoint_sha256,checkpoint=generator_path) + self.teacher_dir=teacher_dir + state=torch.load(generator_path,map_location='cpu',weights_only=True,mmap=True) + cfg=state['config']['model']; self.cfg=cfg + assert state['step']==self.receipt['step'] + self.codebook_sizes=self.receipt['codebook_sizes'] + assert self.codebook_sizes==[cfg['semantic_codebook_size']]+[cfg['residual_codebook_size']]*9 + assert cfg['residual_codebooks']==9 and cfg['frame_rate']==15 and cfg['dual_encoding'] + assert (cfg['sample_rate'],cfg['internal_sample_rate'],cfg['internal_hop_length'],cfg['external_samples_per_frame'])==(44100,44160,2944,2940) + model=MossCodec(cfg); model.load_state_dict(state['generator'],strict=True,assign=True) + model.eval().requires_grad_(False) + self.resample=model.to_internal.cpu() + # Both semantic modules are required for token encoding. + del model.decoder,model.to_external,model.to_internal + self.model=model.to(self.device) + self.teacher=SemanticTeacher(teacher_dir,layer=state['config']['teacher']['layer'],dtype=torch.bfloat16).to(self.device).eval().requires_grad_(False) + del state + self.sample_rate=44100;self.feature_dim=10;self.name=self.receipt['output_name'] + self.batch_size=args.hybrid_batch_size;self.chunk_seconds=args.hybrid_chunk_seconds;self.context_seconds=args.hybrid_context_seconds + self.execution='cuda_graph_acoustic_encoder_native_ssl_and_dual_rvq' if args.hybrid_cuda_graph else 'eager_native_ssl_and_dual_rvq' + self.packer=IndependentBatcher(torch=torch,device=self.device,sample_rate=44160,hop_length=2944,feature_dim=10, + prepare=self._prepare,run=self._run,batch_size=self.batch_size,chunk_seconds=self.chunk_seconds, + continuation_context_seconds=self.context_seconds,window=32,output_dtype=np.int16,label=self.name, + input_dtype=torch.float32,input_channels=2) + self.optimized=None + print(json.dumps(dict(event='model_loaded',**self.metadata())),flush=True) + with torch.inference_mode(): + g=torch.Generator(device=self.device).manual_seed(728) + warmup=torch.randn((self.batch_size,1,self.packer.chunk_samples),generator=g,device=self.device)*.05 + expected=self._encoder(warmup).clone() + self.optimized=compile_fixed(torch,self._encoder,warmup,enabled=args.hybrid_cuda_graph,cache_name=self.name,strategy='cuda_graph') + assert torch.equal(self.optimized(warmup) if self.optimized else self._encoder(warmup),expected),'Graph altered acoustic latent' + for scale in [.05,.1]: + packed=torch.randn((self.batch_size,2,self.packer.chunk_samples),generator=g,device=self.device)*scale + assert torch.equal(self._run(packed),self._codes(packed)),'Graph/native dual tokens disagree' + report=dict(event='inference_validation_passed',step=self.receipt['step'],codebooks=10, + codebook_sizes=self.codebook_sizes,graph_token_agreement=1., + native_quantize_dual=True,teacher_layer=16,batch_size=self.batch_size,chunk_seconds=self.chunk_seconds, + peak_gib=torch.cuda.max_memory_allocated()/1024**3) + print(json.dumps(report),flush=True) + + def _external(self,packed): + b=packed.shape[0] + return packed[:,1:2].reshape(b,1,-1,2944)[...,:2940].reshape(b,1,-1) + + def _encoder(self,audio): + with torch.autocast('cuda',dtype=torch.bfloat16):return self.model.encoder(audio) + + def _dual(self,packed,optimized): + # Uses the exact CPU feature preprocessor and frozen teacher from training. + audio=packed[:,0:1].contiguous() + with torch.autocast('cuda',dtype=torch.bfloat16): + ssl=extract_ssl(self._external(packed),self.teacher) + latent=self.optimized(audio) if optimized and self.optimized is not None else self.model.encoder(audio) + result=self.model.quantize_dual(latent,ssl) + return result['codes'].transpose(1,2) + + def _codes(self,packed):return self._dual(packed,False) + def _run(self,packed):return self._dual(packed,True) + + def _prepare(self,audio,sample_rate): + if sample_rate!=44100:raise ValueError('Expected 44100 Hz') + audio=np.asarray(audio,dtype=np.float32) + if audio.ndim!=2 or audio.shape[0]!=1 or not audio.shape[-1]:raise ValueError('Expected nonempty mono audio') + if not np.isfinite(audio).all():raise ValueError('Nonfinite source audio') + with torch.inference_mode(): + wave=torch.from_numpy(np.ascontiguousarray(audio)).unsqueeze(0) + frames=(wave.shape[-1]+2939)//2940 + internal=resample_exact(wave,self.resample) + internal=F.pad(internal,(0,frames*2944-internal.shape[-1])) + external=F.pad(wave,(0,frames*2940-wave.shape[-1])).reshape(1,1,frames,2940) + external=F.pad(external,(0,4)).reshape(1,1,frames*2944) + return torch.cat([internal,external],dim=1) + + def metadata(self): + return dict(name=self.name,model='s1_s2_dac/hybrid_dual_encoding',checkpoint_step=self.receipt['step'], + checkpoint_sha256=self.receipt['sha256'],checkpoint=self.receipt['checkpoint'], + sample_rate=44100,internal_sample_rate=44160,hop_length=2940,frame_rate=15, + n_codebooks=10,codebook_sizes=self.codebook_sizes,semantic_codebook_index=0, + representation='discrete_codes',layout=['time','codebook'],output_dtype=np.dtype(np.int16).str, + batch_size=self.batch_size,chunk_seconds=self.chunk_seconds,continuation_context_seconds=self.context_seconds, + resample_policy='full_file_before_hop_aligned_chunking',long_file_policy='overlap_left_context_then_discard_context_tokens', + precision='fp32_weights_bf16_encoder_teacher_semantic_modules_fp32_rvq',execution=self.execution, + ssl_teacher_layer=16,ssl_teacher=self.teacher_dir, + ssl_preprocessing='native_training_44100_to_16000_fbank_stride2', + ssl_context_policy='native_bidirectional_teacher_on_independent_padded_lanes') + + def reference_metadata(self,audio,sample_rate,output): + expected=(audio.shape[-1]+2939)//2940 + if output.shape!=(expected,10):raise ValueError(f'Incorrect token shape {output.shape}, expected {(expected,10)}') + if output.min()<0 or np.any(output>=np.asarray(self.codebook_sizes)[None,:]):raise ValueError('Invalid codebook index') + return dict(audio_samples=int(audio.shape[-1]),audio_sample_rate=sample_rate,checkpoint_step=self.receipt['step']) + + def encode_stream(self,samples): + count=0;seconds=0.;start=time.monotonic() + for sample,codes in self.packer.encode_stream(samples): + if sample.error is None: + self.reference_metadata(sample.audio,sample.sample_rate,codes) + seconds+=sample.audio.shape[-1]/sample.sample_rate + count+=1 + if count%100==0:print(json.dumps(dict(event='encoding_progress',files=count,audio_hours=seconds/3600,audio_seconds_per_wall_second=seconds/(time.monotonic()-start))),flush=True) + yield sample,codes + + def encode(self,audio,sample_rate): + return next(iter(self.encode_stream([SimpleNamespace(audio=audio,sample_rate=sample_rate,error=None)])))[1] diff --git a/zonos3/codec/data_processing/__init__.py b/zonos3/codec/data_processing/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..66fb1772a217de5861f29f3fe78a51d0b22e1d5f --- /dev/null +++ b/zonos3/codec/data_processing/__init__.py @@ -0,0 +1 @@ +"""Lane batching and CUDA-graph helpers of the dual codec encoder.""" diff --git a/zonos3/codec/data_processing/independent_batcher.py b/zonos3/codec/data_processing/independent_batcher.py new file mode 100644 index 0000000000000000000000000000000000000000..4d9496deb20459743ea5c5455f4aa4461fdfce2c --- /dev/null +++ b/zonos3/codec/data_processing/independent_batcher.py @@ -0,0 +1,626 @@ +"""Fixed-shape batching for encoders that must keep files independent.""" + +from __future__ import annotations + +import concurrent.futures +import math +import os +import queue +import threading +import time +from collections import deque +from dataclasses import dataclass, replace +from typing import Callable, Iterable, Iterator, Optional + +import numpy as np + + +@dataclass +class _Piece: + waveform: object + context_frames: int + output_frames: int + trailing_context_frames: int + input_offset_frames: int = 0 + output_start_frame: int = 0 + fixed_shape: bool = True + output: Optional[np.ndarray] = None + + +@dataclass +class _Record: + sample: object + pieces: list[_Piece] + + @property + def complete(self) -> bool: + return self.sample.error is not None or all( + piece.output is not None for piece in self.pieces + ) + + +@dataclass +class _PreparedBatch: + records: list[_Record] + pieces: list[_Piece] + waveform: object + + +@dataclass +class _EncodedBatch: + pieces: list[_Piece] + host_output: object + device_output: object + ready: object + compute_started: object + compute_finished: object + + +class IndependentBatcher: + """Batch one causal sequence per lane without mixing file boundaries. + + Files longer than a lane are split on hop-aligned boundaries. Continuation + pieces carry real left context, and non-causal encoders may request real + right context as well. Initial pieces still begin at the native sequence + boundary rather than borrowing state from another file. + """ + + def __init__( + self, + *, + torch, + device, + sample_rate: int, + hop_length: int, + feature_dim: int, + prepare: Callable[[np.ndarray, int], object], + run: Callable[[object], object], + batch_size: int, + chunk_seconds: float, + continuation_context_seconds: float, + window: int, + output_dtype: np.dtype, + label: str, + trailing_context_seconds: float = 0.0, + preparation_workers: int = 1, + input_dtype=None, + input_channels: int = 1, + ): + if ( + min( + sample_rate, + hop_length, + feature_dim, + batch_size, + window, + preparation_workers, + input_channels, + ) + <= 0 + ): + raise ValueError("batcher dimensions and window must be positive") + if ( + chunk_seconds <= 0 + or continuation_context_seconds < 0 + or trailing_context_seconds < 0 + ): + raise ValueError("batcher durations are invalid") + + self.torch = torch + self.device = device + self.sample_rate = int(sample_rate) + self.hop_length = int(hop_length) + self.feature_dim = int(feature_dim) + self.prepare = prepare + self.run = run + self.batch_size = int(batch_size) + self.window = int(window) + self.preparation_workers = int(preparation_workers) + self.output_dtype = np.dtype(output_dtype) + self.label = label + self.input_dtype = input_dtype or torch.float32 + self.input_channels = int(input_channels) + + frames_per_second = self.sample_rate / self.hop_length + self.chunk_frames = max(1, math.floor(chunk_seconds * frames_per_second)) + self.context_frames = max( + 0, math.ceil(continuation_context_seconds * frames_per_second) + ) + self.trailing_context_frames = max( + 0, math.ceil(trailing_context_seconds * frames_per_second) + ) + if self.context_frames + self.trailing_context_frames >= self.chunk_frames: + raise ValueError("combined context must be shorter than a chunk") + self.chunk_samples = self.chunk_frames * self.hop_length + self.context_samples = self.context_frames * self.hop_length + self.trailing_context_samples = self.trailing_context_frames * self.hop_length + self.continuation_samples = self.chunk_samples - self.context_samples + self.continuation_samples -= self.trailing_context_samples + + def _record(self, sample) -> _Record: + if sample.error is not None: + return _Record(sample, []) + try: + waveform = self.prepare(sample.audio, sample.sample_rate) + if ( + waveform.ndim != 3 + or waveform.shape[0] != 1 + or waveform.shape[1] != self.input_channels + or waveform.shape[2] <= 0 + ): + raise ValueError( + "prepared audio must be non-empty " + f"[1, {self.input_channels}, time], got {tuple(waveform.shape)}" + ) + waveform = waveform.contiguous() + except Exception as exc: + failed = replace(sample, error=f"{type(exc).__name__}: {exc}") + return _Record(failed, []) + + if self.trailing_context_frames: + pieces = self._bidirectional_pieces(waveform) + return _Record(sample, pieces) + + pieces = [] + total_samples = int(waveform.shape[-1]) + start = 0 + while start < total_samples: + first = start == 0 + context_samples = 0 if first else self.context_samples + capacity = ( + self.chunk_samples - context_samples - self.trailing_context_samples + ) + end = min(total_samples, start + capacity) + history_start = start - context_samples + trailing_samples = min(self.trailing_context_samples, total_samples - end) + pieces.append( + _Piece( + waveform=waveform[..., history_start : end + trailing_samples], + context_frames=0 if first else self.context_frames, + output_frames=math.ceil((end - start) / self.hop_length), + trailing_context_frames=math.ceil( + trailing_samples / self.hop_length + ), + output_start_frame=0 if first else self.context_frames, + ) + ) + start = end + return _Record(sample, pieces) + + def _bidirectional_pieces(self, waveform) -> list[_Piece]: + """Split while retaining the sequence boundaries seen by the model. + + A fixed lane padded after a short file is not equivalent to running a + multilayer convolutional encoder on that file: biases create nonzero + activations past the real boundary. Head pieces are therefore anchored + at the lane start and final pieces at its end. Short files are stitched + from both anchors. Files too short to contain both context regions use + one exact, dynamic-shape invocation. + """ + + total_samples = int(waveform.shape[-1]) + if total_samples % self.hop_length: + raise ValueError( + "bidirectional batching requires hop-aligned prepared audio, got " + f"{total_samples} samples for hop {self.hop_length}" + ) + total_frames = total_samples // self.hop_length + if total_frames > self.chunk_frames: + pieces = [] + head_frames = self.chunk_frames - self.trailing_context_frames + pieces.append( + _Piece( + waveform=waveform[..., : self.chunk_samples], + context_frames=0, + output_frames=head_frames, + trailing_context_frames=self.trailing_context_frames, + ) + ) + start = head_frames + interior_frames = ( + self.chunk_frames - self.context_frames - self.trailing_context_frames + ) + while start < total_frames: + remaining = total_frames - start + if remaining + self.context_frames <= self.chunk_frames: + source_start = start - self.context_frames + source = waveform[..., source_start * self.hop_length :] + source_frames = int(source.shape[-1]) // self.hop_length + input_offset = self.chunk_frames - source_frames + pieces.append( + _Piece( + waveform=source, + context_frames=self.context_frames, + output_frames=remaining, + trailing_context_frames=0, + input_offset_frames=input_offset, + output_start_frame=input_offset + self.context_frames, + ) + ) + break + + end = start + interior_frames + source_start = start - self.context_frames + source_end = end + self.trailing_context_frames + pieces.append( + _Piece( + waveform=waveform[ + ..., + source_start * self.hop_length : source_end + * self.hop_length, + ], + context_frames=self.context_frames, + output_frames=interior_frames, + trailing_context_frames=self.trailing_context_frames, + output_start_frame=self.context_frames, + ) + ) + start = end + return pieces + + if total_frames == self.chunk_frames: + return [ + _Piece( + waveform=waveform, + context_frames=0, + output_frames=total_frames, + trailing_context_frames=0, + ) + ] + + if total_frames < self.context_frames + self.trailing_context_frames: + return [ + _Piece( + waveform=waveform, + context_frames=0, + output_frames=total_frames, + trailing_context_frames=0, + fixed_shape=False, + ) + ] + + earliest_tail = self.context_frames + latest_head = total_frames - self.trailing_context_frames + split = min(latest_head, max(earliest_tail, total_frames // 2)) + input_offset = self.chunk_frames - total_frames + return [ + _Piece( + waveform=waveform, + context_frames=0, + output_frames=split, + trailing_context_frames=self.trailing_context_frames, + ), + _Piece( + waveform=waveform, + context_frames=self.context_frames, + output_frames=total_frames - split, + trailing_context_frames=0, + input_offset_frames=input_offset, + output_start_frame=input_offset + split, + ), + ] + + def _prepare_batch( + self, records: list[_Record], pieces: list[_Piece] + ) -> _PreparedBatch: + batch = self.torch.zeros( + (self.batch_size, self.input_channels, self.chunk_samples), + device="cpu", + dtype=self.input_dtype, + pin_memory=self.device.type == "cuda", + ) + for lane, piece in enumerate(pieces): + start = piece.input_offset_frames * self.hop_length + end = start + piece.waveform.shape[-1] + batch[lane, :, start:end].copy_(piece.waveform[0]) + return _PreparedBatch(records, pieces, batch) + + def _prepare_direct(self, records: list[_Record], piece: _Piece) -> _PreparedBatch: + waveform = piece.waveform.to( + device="cpu", + dtype=self.input_dtype, + copy=True, + ) + if self.device.type == "cuda": + waveform = waveform.pin_memory() + return _PreparedBatch(records, [piece], waveform) + + def _stage(self, prepared: _PreparedBatch, transfer_stream): + """Enqueue one pinned-host batch without delaying the current encode.""" + + if transfer_stream is None: + return prepared.waveform.to(self.device), None + with self.torch.cuda.stream(transfer_stream): + batch = prepared.waveform.to(self.device, non_blocking=True) + ready = self.torch.cuda.Event() + ready.record(transfer_stream) + return batch, ready + + def _encode( + self, prepared: _PreparedBatch, batch, ready, transfer_stream + ) -> tuple[int, int, int, _EncodedBatch]: + pieces = prepared.pieces + if ready is not None: + self.torch.cuda.current_stream(self.device).wait_event(ready) + + compute_started = None + compute_finished = None + if self.device.type == "cuda": + compute_started = self.torch.cuda.Event(enable_timing=True) + compute_finished = self.torch.cuda.Event(enable_timing=True) + compute_started.record(self.torch.cuda.current_stream(self.device)) + with self.torch.inference_mode(): + outputs = self.run(batch) + if compute_finished is not None: + compute_finished.record(self.torch.cuda.current_stream(self.device)) + if ( + outputs.ndim != 3 + or outputs.shape[0] != batch.shape[0] + or outputs.shape[1] + < max(piece.output_start_frame + piece.output_frames for piece in pieces) + or outputs.shape[2] != self.feature_dim + ): + raise ValueError( + "encoder must return [batch, time, feature], got " + f"{tuple(outputs.shape)}" + ) + + if self.output_dtype == np.dtype(np.float32): + output_torch_dtype = self.torch.float32 + elif self.output_dtype == np.dtype(np.float16): + output_torch_dtype = self.torch.float16 + elif self.output_dtype == np.dtype(np.int16): + output_torch_dtype = self.torch.int16 + else: + raise TypeError(f"unsupported encoder output dtype: {self.output_dtype}") + + # The compiled callable may reuse its output storage. Copy into a + # private device buffer before allowing the next invocation to start. + device_output = outputs.to(dtype=output_torch_dtype, copy=True) + if transfer_stream is None: + host_output = device_output + output_ready = None + else: + host_output = self.torch.empty( + device_output.shape, + device="cpu", + dtype=output_torch_dtype, + pin_memory=True, + ) + compute_ready = self.torch.cuda.Event() + compute_ready.record(self.torch.cuda.current_stream(self.device)) + with self.torch.cuda.stream(transfer_stream): + transfer_stream.wait_event(compute_ready) + host_output.copy_(device_output, non_blocking=True) + output_ready = self.torch.cuda.Event() + output_ready.record(transfer_stream) + + content_frames = 0 + work_frames = 0 + for lane, piece in enumerate(pieces): + content_frames += piece.output_frames + work_frames += ( + piece.context_frames + + piece.output_frames + + piece.trailing_context_frames + ) + encoded = _EncodedBatch( + pieces, + host_output, + device_output, + output_ready, + compute_started, + compute_finished, + ) + scheduled_frames = int(batch.shape[0] * outputs.shape[1]) + return content_frames, work_frames, scheduled_frames, encoded + + def _collect(self, encoded: _EncodedBatch) -> float: + if encoded.ready is not None: + encoded.ready.synchronize() + host = encoded.host_output.numpy() + for lane, piece in enumerate(encoded.pieces): + start = piece.output_start_frame + end = start + piece.output_frames + piece.output = np.array( + host[lane, start:end], + dtype=self.output_dtype, + order="C", + copy=True, + ) + if encoded.compute_started is None: + return 0.0 + return encoded.compute_started.elapsed_time(encoded.compute_finished) / 1000.0 + + def encode_stream( + self, samples: Iterable[object] + ) -> Iterator[tuple[object, Optional[np.ndarray]]]: + if self.device.type == "cuda": + self.torch.cuda.set_device(self.device) + + end = object() + prepared: queue.Queue = queue.Queue(maxsize=min(4, self.window)) + stop = threading.Event() + + def put(item) -> bool: + while not stop.is_set(): + try: + prepared.put(item, timeout=0.1) + return True + except queue.Full: + pass + return False + + def produce() -> None: + try: + records = [] + pieces = [] + + def prepared_records(): + if self.preparation_workers == 1: + for sample in samples: + if stop.is_set(): + return + yield self._record(sample) + return + + pending = deque() + with concurrent.futures.ThreadPoolExecutor( + max_workers=self.preparation_workers, + thread_name_prefix=f"{self.label}-prepare", + ) as pool: + for sample in samples: + if stop.is_set(): + return + pending.append(pool.submit(self._record, sample)) + if len(pending) >= self.window: + yield pending.popleft().result() + while pending and not stop.is_set(): + yield pending.popleft().result() + + for record in prepared_records(): + records.append(record) + for piece in record.pieces: + if not piece.fixed_shape: + if pieces: + if not put(self._prepare_batch(records, pieces)): + return + records = [] + pieces = [] + if not put(self._prepare_direct(records, piece)): + return + records = [] + continue + pieces.append(piece) + if len(pieces) == self.batch_size: + if not put(self._prepare_batch(records, pieces)): + return + records = [] + pieces = [] + if records or pieces: + if not put(self._prepare_batch(records, pieces)): + return + except BaseException as exc: + put(exc) + finally: + put(end) + + producer = threading.Thread( + target=produce, name=f"{self.label}-input-preparation", daemon=True + ) + producer.start() + transfer_stream = ( + self.torch.cuda.Stream(device=self.device) + if self.device.type == "cuda" + else None + ) + records: list[_Record] = [] + pack_count = 0 + content_frames = 0 + work_frames = 0 + scheduled_frames = 0 + input_wait = 0.0 + encode_time = 0.0 + output_wait = 0.0 + gpu_compute_time = 0.0 + downstream_time = 0.0 + pending_outputs: list[_EncodedBatch] = [] + + def receive(): + nonlocal input_wait + started = time.perf_counter() + item = prepared.get() + input_wait += time.perf_counter() - started + if isinstance(item, BaseException): + raise item + return item + + def complete_records(): + nonlocal downstream_time + while records and records[0].complete: + record = records.pop(0) + output = None + if record.sample.error is None: + output = np.concatenate( + [piece.output for piece in record.pieces], axis=0 + ) + started = time.perf_counter() + yield record.sample, output + downstream_time += time.perf_counter() - started + + try: + item = receive() + staged = None + while item is not end: + if isinstance(item, BaseException): + raise item + records.extend(item.records) + + if item.pieces: + if staged is None: + staged = self._stage(item, transfer_stream) + + # Keep one H2D transfer in flight during the current model + # call. Never wait for prefetch: an empty producer queue + # should not postpone work that is already GPU-ready. + try: + next_item = prepared.get_nowait() + except queue.Empty: + next_item = None + next_staged = None + if isinstance(next_item, _PreparedBatch) and next_item.pieces: + next_staged = self._stage(next_item, transfer_stream) + + started = time.perf_counter() + content, work, scheduled, encoded = self._encode( + item, *staged, transfer_stream + ) + encode_time += time.perf_counter() - started + pending_outputs.append(encoded) + pack_count += 1 + content_frames += content + work_frames += work + scheduled_frames += scheduled + else: + next_item = None + next_staged = None + # One batch of slack lets output transfer overlap the next + # model call while bounding temporary device and pinned memory. + if len(pending_outputs) >= 2: + started = time.perf_counter() + gpu_compute_time += self._collect(pending_outputs.pop(0)) + output_wait += time.perf_counter() - started + yield from complete_records() + + if next_item is None: + item = receive() + staged = None + else: + item = next_item + staged = next_staged + while pending_outputs: + started = time.perf_counter() + gpu_compute_time += self._collect(pending_outputs.pop(0)) + output_wait += time.perf_counter() - started + yield from complete_records() + yield from complete_records() + if records: + raise RuntimeError("batcher retained incomplete records") + finally: + stop.set() + producer.join(timeout=5) + + rank = os.environ.get("RANK", os.environ.get("SLURM_PROCID", "0")) + work_fill = work_frames / scheduled_frames if scheduled_frames else 0.0 + content_fill = content_frames / scheduled_frames if scheduled_frames else 0.0 + print( + f"[rank {rank}] {self.label} stages: batches={pack_count} " + f"work_fill={work_fill:.4f} content_fill={content_fill:.4f} " + f"input_wait={input_wait:.3f}s encode={encode_time:.3f}s " + f"output_wait={output_wait:.3f}s gpu_compute={gpu_compute_time:.3f}s " + f"downstream={downstream_time:.3f}s", + flush=True, + ) + + +__all__ = ["IndependentBatcher"] diff --git a/zonos3/codec/data_processing/torch_utils.py b/zonos3/codec/data_processing/torch_utils.py new file mode 100644 index 0000000000000000000000000000000000000000..f23fd425038cfeaee2417651acbbf95c1b0dae80 --- /dev/null +++ b/zonos3/codec/data_processing/torch_utils.py @@ -0,0 +1,106 @@ +"""Small PyTorch helpers shared by offline autoencoder adapters.""" + +from __future__ import annotations + +import fcntl +import os +from pathlib import Path + + +def default_device(torch) -> str: + if not torch.cuda.is_available(): + return "cpu" + if torch.cuda.device_count() == 1: + return "cuda:0" + local_rank = int(os.environ.get("LOCAL_RANK", os.environ.get("SLURM_LOCALID", "0"))) + return f"cuda:{local_rank}" + + +def materialize_weight_norm(torch, model) -> None: + """Replace both legacy and parametrized weight normalization in eval models.""" + + for module in model.modules(): + try: + if torch.nn.utils.parametrize.is_parametrized(module, "weight"): + torch.nn.utils.parametrize.remove_parametrizations( + module, "weight", leave_parametrized=True + ) + continue + except (AttributeError, ValueError): + pass + try: + torch.nn.utils.remove_weight_norm(module) + except (AttributeError, ValueError): + pass + + +def compile_fixed( + torch, + function, + warmup, + *, + enabled: bool, + cache_name: str, + strategy: str = "inductor", +): + """Optimize one fixed CUDA shape with Inductor or a CUDA Graph. + + CUDA Graphs retain normal PyTorch kernels when discrete output stability is + important. Inductor is faster for continuous encoders, where small floating + point differences are expected and measured. + """ + + warmup_args = warmup if isinstance(warmup, tuple) else (warmup,) + device = warmup_args[0].device + if strategy not in {"inductor", "cuda_graph"}: + raise ValueError(f"unknown fixed-shape strategy: {strategy}") + if device.type != "cuda": + with torch.inference_mode(): + function(*warmup_args) + return None + + with torch.inference_mode(): + function(*warmup_args) + torch.cuda.synchronize(device) + if not enabled: + return None + + if strategy == "inductor": + cache_root = Path(os.environ.get("TMPDIR", "/tmp")) + cache_dir = cache_root / f"bingua2-{cache_name}-inductor-u{os.getuid()}" + os.environ.setdefault("TORCHINDUCTOR_CACHE_DIR", str(cache_dir)) + lock_path = cache_root / f"{cache_dir.name}.lock" + with lock_path.open("a+b") as compile_lock: + fcntl.flock(compile_lock, fcntl.LOCK_EX) + optimized = torch.compile( + function, mode="reduce-overhead", fullgraph=True + ) + optimized(*warmup_args) + # reduce-overhead may defer its CUDA-graph recording until the + # next invocation; complete it before processing timers start. + optimized(*warmup_args) + torch.cuda.synchronize(device) + return optimized + + for _ in range(2): + output = function(*warmup_args) + torch.cuda.synchronize(device) + graph = torch.cuda.CUDAGraph() + with torch.cuda.graph(graph): + output = function(*warmup_args) + torch.cuda.synchronize(device) + + def replay(*args): + if len(args) != len(warmup_args): + raise ValueError("fixed CUDA graph received the wrong argument count") + for static, current in zip(warmup_args, args): + if static.shape != current.shape or static.dtype != current.dtype: + raise ValueError("fixed CUDA graph received an incompatible tensor") + static.copy_(current) + graph.replay() + return output + + return replay + + +__all__ = ["compile_fixed", "default_device", "materialize_weight_norm"] diff --git a/zonos3/codec/hybrid10_dual_encoding/__init__.py b/zonos3/codec/hybrid10_dual_encoding/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..4f5ae2e414fad0a0aa6295dabe5eea46360f9fdc --- /dev/null +++ b/zonos3/codec/hybrid10_dual_encoding/__init__.py @@ -0,0 +1 @@ +"""Isolated hybrid-10CB dual-encoding experiment.""" diff --git a/zonos3/codec/hybrid10_dual_encoding/base_model.py b/zonos3/codec/hybrid10_dual_encoding/base_model.py new file mode 100644 index 0000000000000000000000000000000000000000..db6b6f5cd963fe8bc3cc1b70f41319106312d87e --- /dev/null +++ b/zonos3/codec/hybrid10_dual_encoding/base_model.py @@ -0,0 +1,230 @@ +"""MOSS-v2-style causal transformer codec with the existing semantic-first RVQ. + +Architecture reference: OpenMOSS-Team/MOSS-Audio-Tokenizer-v2 (Apache-2.0). +This training implementation retains the repository's attention/FFN dropout. +Boundary sinc conversion has finite FIR lookahead; waveform timestamps are +delay-compensated offline. Patch/attention processing is causal in frame time. +""" +import math +import torch +from torch import nn +from torch.nn import functional as F +from torch.utils.checkpoint import checkpoint +from torchaudio.transforms import Resample +from zonos3.codec.s1dac.vendor.modded_dac import CausalWNConv1d, EncoderBlock, DecoderBlock +from zonos3.codec.s1dac.vendor.rvq import DownsampleResidualVectorQuantize +from dac.nn.layers import Snake1d + + +class StableSnake1d(Snake1d): + """Identical S1 Snake math without JIT profiling changes during recompute.""" + def forward(self,x): + shape=x.shape + x=x.reshape(shape[0],shape[1],-1) + x=x+(self.alpha+1e-9).reciprocal()*torch.sin(self.alpha*x).pow(2) + return x.reshape(shape) + + +def stable_snakes(module): + for name,child in list(module.named_children()): + if isinstance(child,Snake1d): + replacement=StableSnake1d(child.alpha.shape[1]) + replacement.alpha=child.alpha + setattr(module,name,replacement) + else: + stable_snakes(child) + + +class CheckpointModule(nn.Module): + def __init__(self,module): + super().__init__() + self.module=module + + def forward(self,x): + if self.training and torch.is_grad_enabled(): + return checkpoint(self.module,x,use_reentrant=False,preserve_rng_state=True) + return self.module(x) + + +class Patch(nn.Module): + def __init__(self, size, up=False): + super().__init__() + self.size, self.up = size, up + + def forward(self, x): + b,c,t=x.shape + h=self.size + if self.up: + return x.reshape(b,c//h,h,t).permute(0,1,3,2).reshape(b,c//h,t*h) + return x.reshape(b,c,t//h,h).permute(0,1,3,2).reshape(b,c*h,t//h) + + +class MossLayer(nn.Module): + def __init__(self, spec): + super().__init__() + d=spec['d_model'] + self.heads=spec['num_heads'] + self.head_dim=d//self.heads + self.context=spec['context_frames'] + self.attention_dropout=spec['attention_dropout'] + self.norm1=nn.LayerNorm(d,eps=1e-5) + self.norm2=nn.LayerNorm(d,eps=1e-5) + self.qkv=nn.Linear(d,3*d,bias=False) + self.attention_out=nn.Linear(d,d,bias=False) + self.ffn=nn.Sequential(nn.Linear(d,spec['dim_feedforward'],bias=False), + nn.GELU(),nn.Dropout(spec['ffn_dropout']), + nn.Linear(spec['dim_feedforward'],d,bias=False)) + self.attention_scale=nn.Parameter(torch.full((d,),spec['layer_scale'])) + self.ffn_scale=nn.Parameter(torch.full((d,),spec['layer_scale'])) + + def attention(self,x): + b,t,d=x.shape + q,k,v=self.qkv(x).reshape(b,t,3,self.heads,self.head_dim).unbind(2) + # The released MOSS implementation rotates adjacent real/imag pairs + # in FP32 before returning Q/K to the compute dtype. + frequency=torch.exp(torch.arange(self.head_dim//2,device=x.device,dtype=torch.float32) + *(-math.log(10000.0)*2/self.head_dim)) + phase=torch.arange(t,device=x.device,dtype=torch.float32)[:,None]*frequency[None,:] + cos,sin=phase.cos()[None,:,None,:],phase.sin()[None,:,None,:] + def rope(z): + zf=z.float().reshape(b,t,self.heads,self.head_dim//2,2) + r,i=zf.unbind(-1) + return torch.stack((r*cos-i*sin,r*sin+i*cos),-1).flatten(-2).to(z.dtype) + q,k=rope(q),rope(k) + q,k,v=(z.transpose(1,2) for z in (q,k,v)) + outputs=[] + dropout=self.attention_dropout if self.training else 0.0 + # Bounded query/key blocks avoid a quadratic 4,800 x 4,800 bias and + # support the existing dropout on PyTorch's native SDPA backends. + for start in range(0,t,512): + end=min(t,start+512) + left=max(0,start-self.context+1) + qp=torch.arange(start,end,device=x.device) + kp=torch.arange(left,end,device=x.device) + delta=qp[:,None]-kp[None,:] + valid=(delta>=0)&(delta=4096)).any()): + raise ValueError('Code index outside [0,4096)') + with torch.autocast(codes.device.type,enabled=False): + z=self.quantizer.semantic_quantizer.from_codes(codes[:,:1])[0] + if codes.shape[1]>1: + z=z+self.quantizer.quantizer.from_codes(codes[:,1:])[0] + return self.decode_latent(z,length) diff --git a/zonos3/codec/hybrid10_dual_encoding/inference.py b/zonos3/codec/hybrid10_dual_encoding/inference.py new file mode 100644 index 0000000000000000000000000000000000000000..3e4afc3c45e285250466c16307430c27c7d136e9 --- /dev/null +++ b/zonos3/codec/hybrid10_dual_encoding/inference.py @@ -0,0 +1,24 @@ +"""Waveform encoding uses exactly the training SSL feature preprocessor.""" +import torch +from zonos3.codec.s1dac.same_data.npy_ogg_dataset import Wav2Vec2BertFeaturePreprocessor + + +@torch.no_grad() +def extract_ssl(audio, teacher): + preprocessor = Wav2Vec2BertFeaturePreprocessor(44100) + items = [] + for example in audio.detach().float().cpu(): + info = {} + preprocessor(example, info) + items.append(info) + features = torch.stack([item['w2v_bert_input_features'] for item in items]).to(audio.device) + masks = torch.stack([item['w2v_bert_attention_mask'] for item in items]).to(audio.device) + return teacher(features, masks) + + +@torch.no_grad() +def encode_audio(model, audio, teacher): + if model.training: + raise ValueError('Set the codec to eval mode before token encoding') + ssl = extract_ssl(audio, teacher) + return model.quantize_dual(model.encode_latent(audio), ssl)['codes'] diff --git a/zonos3/codec/hybrid10_dual_encoding/model.py b/zonos3/codec/hybrid10_dual_encoding/model.py new file mode 100644 index 0000000000000000000000000000000000000000..540eed4bb172498e79b510d769c0b9d3ad7fbb1b --- /dev/null +++ b/zonos3/codec/hybrid10_dual_encoding/model.py @@ -0,0 +1,88 @@ +"""DualCodec semantic encoding on the unchanged S1/MOSS waveform codec. + +The semantic stream follows DualCodec's ConvNeXt encoder -> Q1 -> decoder. +Baseline cosine supervision, feature pooling and codebook settings are retained. +SSL features are required at encoding time; token decoding is self-contained. +""" +import torch +from torch import nn +from torch.nn import functional as F +from dac.nn.layers import WNConv1d +from dac.nn.quantize import ResidualVectorQuantize +from zonos3.codec.s1dac.losses import average_ssl_frames +from .base_model import MossCodec as BaseCodec + + +class SemanticConvNeXt(nn.Module): + """Causal form of DualCodec's depthwise-conv/MLP residual block.""" + def __init__(self, width, hidden): + super().__init__() + self.dwconv = nn.Conv1d(width, width, 7, groups=width) + self.norm = nn.LayerNorm(width, eps=1e-6) + self.pwconv1 = nn.Linear(width, hidden) + self.pwconv2 = nn.Linear(hidden, width) + + def forward(self, x): + h = self.dwconv(F.pad(x, (6, 0))).transpose(1, 2) + h = self.pwconv2(F.gelu(self.pwconv1(self.norm(h)))) + return x + h.transpose(1, 2) + + +class MossCodec(BaseCodec): + def __init__(self, cfg): + # Preserve construction/initialization of the waveform branches and RVQ-rest. + super().__init__(cfg) + branch = cfg['dual_encoding'] + width, hidden, depth = branch['width'], branch['hidden'], branch['depth'] + self.semantic_encoder = nn.Sequential( + WNConv1d(1024, width, 1), + *[SemanticConvNeXt(width, hidden) for _ in range(depth)]) + self.semantic_head = nn.Sequential( + *[SemanticConvNeXt(width, hidden) for _ in range(depth)], + WNConv1d(width, 1024, 1)) + self.quantizer.semantic_quantizer = ResidualVectorQuantize( + input_dim=width, n_codebooks=1, + codebook_size=cfg['semantic_codebook_size'], + codebook_dim=cfg['codebook_dim'], quantizer_dropout=0.0) + self.quantizer.semantic_quantizer.apply(self.quantizer._init_weights) + + def quantize_dual(self, acoustic, ssl_features, n_quantizers=None): + if ssl_features.ndim != 3 or ssl_features.shape[0] != acoustic.shape[0] or ssl_features.shape[2] != 1024: + raise ValueError('Expected SSL features [batch,frames,1024]') + pooled = average_ssl_frames(ssl_features, acoustic.shape[-1], + self.cfg['dual_encoding']['window_ratio']) + semantic = self.semantic_encoder(pooled) + with torch.autocast(acoustic.device.type, enabled=False): + q1, c1, _, commitment1, codebook1 = self.quantizer.semantic_quantizer(semantic.float()) + semantic = self.semantic_head(q1) + with torch.autocast(acoustic.device.type, enabled=False): + residual = acoustic.float() - semantic.float() + qr, cr, _, commitmentr, codebookr = self.quantizer.quantizer(residual, n_quantizers=n_quantizers) + z = semantic.float() + qr + return dict(z=z, codes=torch.cat([c1, cr], dim=1), + semantic_prediction=semantic, + commitment=commitment1 + commitmentr, + codebook=codebook1 + codebookr) + + def forward(self, audio, ssl_features=None, **kwargs): + if ssl_features is None: + raise ValueError('Dual encoding requires frozen SSL features; use inference.encode_audio for waveform input') + output = self.quantize_dual(self.encode_latent(audio), ssl_features, **kwargs) + output['audio'] = self.decode_latent(output.pop('z'), audio.shape[-1]) + return output + + def decode_tokens(self, codes, length=None): + count = 1 + self.cfg['residual_codebooks'] + if codes.ndim != 3 or not 1 <= codes.shape[1] <= count: + raise ValueError(f'Expected [batch,1..{count},frames]') + limits = torch.tensor([self.cfg['semantic_codebook_size']] + [self.cfg['residual_codebook_size']] * (codes.shape[1]-1), device=codes.device).view(1,-1,1) + if bool(((codes < 0) | (codes >= limits)).any()): + raise ValueError('Code index outside its codebook vocabulary') + with torch.autocast(codes.device.type, enabled=False): + q1 = self.quantizer.semantic_quantizer.from_codes(codes[:, :1])[0] + semantic = self.semantic_head(q1) + with torch.autocast(codes.device.type, enabled=False): + z = semantic.float() + if codes.shape[1] > 1: + z = z + self.quantizer.quantizer.from_codes(codes[:, 1:])[0] + return self.decode_latent(z, length) diff --git a/zonos3/codec/istft_head_a_20261002/__init__.py b/zonos3/codec/istft_head_a_20261002/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..877809d84c7d1e28d9831bc629b5eff312a07bdc --- /dev/null +++ b/zonos3/codec/istft_head_a_20261002/__init__.py @@ -0,0 +1 @@ +"""Option A iSTFT head on the frozen fixed-600k decoder, trained from cached codes (2026-10-02).""" diff --git a/zonos3/codec/istft_head_a_20261002/model.py b/zonos3/codec/istft_head_a_20261002/model.py new file mode 100644 index 0000000000000000000000000000000000000000..8df3256f6280f8df4e1bcdce6468a348f115f0b9 --- /dev/null +++ b/zonos3/codec/istft_head_a_20261002/model.py @@ -0,0 +1,355 @@ +"""Option A: frozen fixed-600k decoder stages 0-8 (15 Hz -> 240 Hz transformers) + a trainable iSTFT head. + +The model consumes cached codes only. There is no encoder, no SSL teacher and no waveform-side conv tail: +decoder.8's 768->5888 output projection, the x23 patch, both S1 conv blocks and the Snake waveform head are +replaced by a small causal ConvNeXt stack, a LayerNorm, a Linear to n_fft+2 channels and an inverse STFT with +hop 184 = 44160/240 and n_fft 736 = 4*hop (periodic Hann, centered frames). Everything except `head.*` is frozen. +""" +import math +import torch +from torch import nn +from zonos3.codec.hybrid10_dual_encoding.model import MossCodec, SemanticConvNeXt +from torch.utils.checkpoint import checkpoint +from zonos3.codec.hybrid10_dual_encoding.base_model import MossStage, MossLayer, Patch + +KEPT_STAGES = 9 # decoder.0 .. decoder.8 +HEAD_FRAME_RATE = 240 + + +class ISTFTHead(nn.Module): + def __init__(self, dim, depth, hidden, n_fft, hop): + super().__init__() + if n_fft % hop or n_fft // hop < 2: + raise ValueError('n_fft must be an integer multiple (>= 2) of the hop') + self.n_fft, self.hop = int(n_fft), int(hop) + self.blocks = nn.Sequential(*[SemanticConvNeXt(dim, hidden) for _ in range(depth)]) + self.norm = nn.LayerNorm(dim, eps=1e-6) + self.out = nn.Linear(dim, self.n_fft + 2) + self.register_buffer('window', torch.hann_window(self.n_fft, periodic=True), persistent=False) + self.max_log_magnitude = math.log(100.0) # Vocos clips the magnitude at 1e2 + + def spectrum(self, x): + """x [batch, dim, frames] -> magnitude, phase [batch, n_fft//2+1, frames] (fp32).""" + h = self.blocks(x) + y = self.out(self.norm(h.transpose(1, 2))) + log_magnitude, phase = y.float().chunk(2, dim=-1) + magnitude = torch.exp(log_magnitude.clamp(max=self.max_log_magnitude)) + return magnitude.transpose(1, 2), phase.transpose(1, 2) + + def forward(self, x): + magnitude, phase = self.spectrum(x) + with torch.autocast(x.device.type, enabled=False): + spec = torch.complex(magnitude * torch.cos(phase), magnitude * torch.sin(phase)) + audio = torch.istft(spec, self.n_fft, hop_length=self.hop, win_length=self.n_fft, + window=self.window, center=True, length=magnitude.shape[-1] * self.hop) + return audio.unsqueeze(1) + + +class MultiResISTFTHead(nn.Module): + """Multi-resolution iSTFT head: one causal ConvNeXt trunk, one linear projection per window size, each synthesised + with its own centered iSTFT at the shared hop, then a linear FIR mixer (fp32, no nonlinearity) combines the branches. + + Compared with ISTFTHead: a deeper trunk, a long window branch (harmonic resolution: 2208 = 12 x 184 gives 20 Hz bins + at 50 ms) next to the short one (736: 60 Hz bins at 16.7 ms, transients), and a learned linear post-filter. Nothing + after the synthesis is nonlinear, so the output band above the features' content is a linear function of them. + + Warm start: `blocks.{0..k}` and `norm` match ISTFTHead's names; blocks beyond the warm-started ones are zero-initialised + at pwconv2 (identity at start); the mixer starts as a delta on branch 0 and zeros on the others, so at step 0 the + output equals the branch-0 head alone and the extra branches are switched in by gradient (zero-init gating).""" + + def __init__(self, dim, depth, hidden, n_ffts, hop, fir_kernel=127, warm_blocks=None): + super().__init__() + self.hop = int(hop) + self.n_ffts = [int(n) for n in n_ffts] + for n in self.n_ffts: + if n % self.hop or n // self.hop < 2: + raise ValueError('every n_fft must be an integer multiple (>= 2) of the hop') + self.blocks = nn.Sequential(*[SemanticConvNeXt(dim, hidden) for _ in range(depth)]) + self.norm = nn.LayerNorm(dim, eps=1e-6) + self.outs = nn.ModuleList([nn.Linear(dim, n + 2) for n in self.n_ffts]) + for i, n in enumerate(self.n_ffts): + self.register_buffer(f'window_{i}', torch.hann_window(n, periodic=True), persistent=False) + if fir_kernel % 2 == 0: + raise ValueError('fir_kernel must be odd (zero-phase at init)') + self.mixer = nn.Conv1d(len(self.n_ffts), 1, fir_kernel, padding=(fir_kernel - 1) // 2, bias=False) + with torch.no_grad(): + self.mixer.weight.zero_() + self.mixer.weight[0, 0, (fir_kernel - 1) // 2] = 1.0 # branch 0 passes through, other branches gated off + if warm_blocks is not None: + for block in list(self.blocks)[int(warm_blocks):]: + nn.init.zeros_(block.pwconv2.weight); nn.init.zeros_(block.pwconv2.bias) + self.max_log_magnitude = math.log(100.0) + + def spectra(self, x): + """x [batch, dim, frames] -> list of (magnitude, phase) [batch, n_fft//2+1, frames] (fp32).""" + h = self.norm(self.blocks(x).transpose(1, 2)) + out = [] + for lin in self.outs: + y = lin(h) + log_magnitude, phase = y.float().chunk(2, dim=-1) + magnitude = torch.exp(log_magnitude.clamp(max=self.max_log_magnitude)) + out.append((magnitude.transpose(1, 2), phase.transpose(1, 2))) + return out + + def forward(self, x): + frames = x.shape[-1] + branches = [] + with torch.autocast(x.device.type, enabled=False): + for i, (magnitude, phase) in enumerate(self.spectra(x)): + spec = torch.complex(magnitude * torch.cos(phase), magnitude * torch.sin(phase)) + n = self.n_ffts[i] + branches.append(torch.istft(spec, n, hop_length=self.hop, win_length=n, window=getattr(self, f'window_{i}'), + center=True, length=frames * self.hop)) + stacked = torch.stack(branches, dim=1) # [batch, branches, samples] + return self.mixer(stacked.float()) # [batch, 1, samples], linear, fp32 + + +class MossTailStage(MossStage): + """MossStage whose output projection (the waveform samples per frame) runs in fp32 outside autocast; everything else + (input projection, RoPE causal local attention layers, LayerScale, dropout, optional per-layer recompute) is the stock + MossStage used by decoder.0-8.""" + + def forward(self, x): + x = self.input_proj(x.transpose(1, 2)) + for layer in self.layers: + if self.checkpoint_layers and self.training and torch.is_grad_enabled(): + x = checkpoint(layer, x, use_reentrant=False, preserve_rng_state=True) + else: + x = layer(x) if self.training else layer.forward(x) + with torch.autocast(x.device.type, enabled=False): + return self.output_proj(x.float()).transpose(1, 2) + + +class MossTailHead(nn.Module): + """MOSS-v2 decoder tail in place of the iSTFT head (2026-10-08). + + Mirrors the last two modules of the OpenMOSS MOSS-Audio-Tokenizer-v2 decoder at this codec's rates, as in the + s1_frontend_moss_v2 proposal (moss_v2_proposals_20260904): decoder.8's output projection (768 -> 768, the stage-2 + `output_proj` the hybrid codec replaced with a 5888-wide conv adapter), PatchedPretransform x2 up (240 Hz, 768 ch -> + 480 Hz, 384 ch), one MossProjectedTransformer stage (d 768, 12 layers, 12 heads, ffn 3072, 1 s causal local context, + RoPE, LayerScale 0.01, dropout 0.1) projecting to 92 waveform samples per 480 Hz frame, PatchedPretransform x92 up + -> 44160 Hz waveform. No iSTFT, no Snake, no tanh. All parameters are fresh (MOSS from-scratch init: default Linear + init, LayerScale 0.01 so the stage starts as a linear map from the 240 Hz features to the waveform).""" + + def __init__(self, dim, hop, spec, patch_in=2): + super().__init__() + spec = dict(spec) + self.patch_in = int(patch_in) + self.samples_per_frame = int(spec['output_dimension']) + if spec['input_dimension'] * self.patch_in != dim: + raise ValueError(f"stage input_dimension x patch_in must equal the 240 Hz width {dim}") + if self.samples_per_frame * self.patch_in != hop: + raise ValueError(f"stage output_dimension x patch_in must equal the 240 Hz hop {hop}") + if spec.get('frame_rate') != HEAD_FRAME_RATE * self.patch_in: + raise ValueError(f"stage frame_rate must be {HEAD_FRAME_RATE * self.patch_in}") + self.proj = nn.Linear(dim, dim, bias=False) # decoder.8.output_proj as in the MOSS decoder (768 -> 768) + self.up = Patch(self.patch_in, up=True) # [b, 768, t] -> [b, 384, 2t] + self.stage = MossTailStage(spec, checkpoint_layers=False) # input_proj 384 -> 768, 12 layers, output_proj 768 -> 92 + self.unpatch = Patch(self.samples_per_frame, up=True) # [b, 92, 2t] -> [b, 1, 184t] + + def forward(self, x): + """x [batch, 768, frames @ 240 Hz] -> audio [batch, 1, frames * 184] at 44160 Hz (fp32).""" + h = self.proj(x.transpose(1, 2)).transpose(1, 2) + h = self.stage(self.up(h)) + return self.unpatch(h) + + +class ISTFTCodec(nn.Module): + """Frozen codes -> latent -> decoder.0..8 features at 240 Hz; trainable head -> 44160 Hz -> 44100 Hz.""" + + def __init__(self, cfg, head_cfg): + super().__init__() + stages = cfg['decoder_stages'] + assert stages[KEPT_STAGES - 1]['type'] == 'MossProjectedTransformer' + assert stages[KEPT_STAGES - 1]['frame_rate'] == HEAD_FRAME_RATE + assert stages[KEPT_STAGES]['type'] == 'PatchedPretransform' and stages[KEPT_STAGES]['patch_size'] == 23 + hop = cfg['internal_sample_rate'] // HEAD_FRAME_RATE + assert hop * HEAD_FRAME_RATE == cfg['internal_sample_rate'] and cfg['internal_hop_length'] == hop * (HEAD_FRAME_RATE // cfg['frame_rate']) + base = MossCodec(cfg) + kept = list(base.decoder)[:KEPT_STAGES] + kept[-1].output_proj = nn.Identity() # the 768->5888 projection only fed the removed patch/conv tail + for stage in kept: + if isinstance(stage, MossStage): + stage.checkpoint_layers = False + # Optional layer pruning of kept transformer stages, e.g. {"0": [0..7, 24..31]} keeps 16 of decoder.0's 32 layers + # (the middle 16 removed). load_pretrained maps each kept layer's step-600000 weights onto its new index. + self.stage_layers = {int(k): [int(i) for i in v] for k, v in head_cfg.get('stage_layers', {}).items()} + for si, keep in self.stage_layers.items(): + stage = kept[si] + assert isinstance(stage, MossStage), f'stage {si} is not a transformer stage' + assert keep == sorted(set(keep)) and keep and all(0 <= i < len(stage.layers) for i in keep), (si, keep) + stage.layers = nn.ModuleList(stage.layers[i] for i in keep) + self.stages = nn.Sequential(*kept) + self.quantizer = base.quantizer + self.semantic_head = base.semantic_head + self.to_external = base.to_external + del base + self.cfg = cfg + self.hop = hop + self.upsample = HEAD_FRAME_RATE // cfg['frame_rate'] # 16 head frames per code frame + self.external_hop = cfg['external_samples_per_frame'] + if head_cfg.get('type', 'istft') == 'moss_tail': + self.head = MossTailHead(dim=stages[KEPT_STAGES - 1]['d_model'], hop=hop, spec=head_cfg['stage'], + patch_in=head_cfg.get('patch_in', 2)) + elif head_cfg.get('type', 'istft') == 'mr_istft': + self.head = MultiResISTFTHead(dim=stages[KEPT_STAGES - 1]['d_model'], depth=head_cfg['depth'], hidden=head_cfg['hidden'], + n_ffts=head_cfg['n_ffts'], hop=hop, fir_kernel=head_cfg.get('fir_kernel', 127), + warm_blocks=head_cfg.get('warm_blocks')) + else: + self.head = ISTFTHead(dim=stages[KEPT_STAGES - 1]['d_model'], depth=head_cfg['depth'], + hidden=head_cfg['hidden'], n_fft=head_cfg['n_fft'], hop=hop) + # Optionally unfreeze a suffix of the kept transformer stages (e.g. [8] = the 240 Hz stage) with the head. + self.trainable_stages = sorted(set(int(i) for i in head_cfg.get('trainable_stages', []))) + assert self.trainable_stages == list(range(KEPT_STAGES - len(self.trainable_stages), KEPT_STAGES)), \ + 'trainable_stages must be a contiguous suffix of decoder.0..8' + self.trainable_prefixes = ('head.',) + tuple(f'stages.{i}.' for i in self.trainable_stages) + self.requires_grad_(False) + self.head.requires_grad_(True) + for i in self.trainable_stages: + self.stages[i].requires_grad_(True) + # Optional activation recompute (per-layer checkpointing) inside the trainable transformer stages only. + self.recompute_trainable_stages = bool(head_cfg.get('recompute_trainable_stages', False)) + if self.recompute_trainable_stages: + for i in self.trainable_stages: + if isinstance(self.stages[i], MossStage): + self.stages[i].checkpoint_layers = True + if isinstance(self.head, MossTailHead): + self.head.stage.checkpoint_layers = True + self.compile_trainable_stages = bool(head_cfg.get('compile_trainable_stages', True)) + self.train(True) + + def is_trainable_name(self, name): + return name.startswith(self.trainable_prefixes) + + # frozen modules stay in eval mode (no attention/FFN dropout); only trainable parts follow train()/eval() + def train(self, mode=True): + super().train(False) + self.training = bool(mode) + self.head.train(mode) + for i in self.trainable_stages: + self.stages[i].train(mode) + return self + + def frozen_parameters(self): + return [(n, p) for n, p in self.named_parameters() if not self.is_trainable_name(n)] + + def trainable_parameters(self): + return [p for n, p in self.named_parameters() if self.is_trainable_name(n)] + + def trainable_named_parameters(self): + return [(n, p) for n, p in self.named_parameters() if self.is_trainable_name(n)] + + def trainable_state_dict(self): + return {k: v for k, v in self.state_dict().items() if self.is_trainable_name(k)} + + def load_trainable_state_dict(self, state): + expected = set(self.trainable_state_dict()) + if set(state) != expected: + raise RuntimeError(f'trainable state keys differ: missing {sorted(expected - set(state))[:5]} unexpected {sorted(set(state) - expected)[:5]}') + result = self.load_state_dict(state, strict=False) + assert not result.unexpected_keys + + def assert_frozen(self): + roots = tuple(p.rstrip('.') for p in self.trainable_prefixes) + for name, p in self.named_parameters(): + assert p.requires_grad == self.is_trainable_name(name), name + if not self.is_trainable_name(name): + assert p.grad is None, name + for name, module in self.named_modules(): + if name and name not in roots and not self.is_trainable_name(name): + assert not module.training, name + + def load_pretrained(self, generator_state): + """Load quantizer, semantic head, resampler and decoder.0..8 (minus decoder.8.output_proj) from step 600000.""" + own = self.state_dict() + loaded = {} + pruned = 0 + for key, value in generator_state.items(): + if key.startswith('decoder.'): + index = int(key.split('.')[1]) + if index >= KEPT_STAGES or key.startswith(f'decoder.{KEPT_STAGES - 1}.output_proj.'): + continue + rest = key[len('decoder.'):] + if index in self.stage_layers: + parts = rest.split('.') + if len(parts) > 2 and parts[1] == 'layers': + old = int(parts[2]) + if old not in self.stage_layers[index]: + pruned += 1 + continue # a removed layer: its weights are dropped on purpose + parts[2] = str(self.stage_layers[index].index(old)) + rest = '.'.join(parts) + loaded['stages.' + rest] = value + elif key.startswith(('quantizer.', 'semantic_head.', 'to_external.')): + loaded[key] = value + missing = [k for k in own if k not in loaded and not k.startswith('head.')] + unexpected = [k for k in loaded if k not in own] + if missing or unexpected: + raise RuntimeError(f'pretrained mapping mismatch: missing {missing[:5]} unexpected {unexpected[:5]}') + result = self.load_state_dict(loaded, strict=False) + assert not result.unexpected_keys and all(k.startswith('head.') for k in result.missing_keys) + out = dict(loaded_tensors=len(loaded), + frozen_parameters=sum(p.numel() for _, p in self.frozen_parameters()), + head_parameters=sum(p.numel() for p in self.head.parameters())) + if self.stage_layers: + out.update(pruned_tensors=pruned, stage_layers={str(k): v for k, v in self.stage_layers.items()}) + return out + + def compile_stages(self): + """Compile each frozen transformer layer's forward (MossStage calls layer.forward in eval mode).""" + import torch._dynamo.config as dynamo_config + dynamo_config.recompile_limit = max(dynamo_config.recompile_limit, 32) + count = 0 + targets = list(self.stages) + if isinstance(self.head, MossTailHead) and self.compile_trainable_stages: + targets.append(self.head.stage) # the trainable MOSS tail layers compile like the unfrozen stages + for i, stage in enumerate(targets): + if i in self.trainable_stages and not self.compile_trainable_stages: + continue + for module in stage.modules(): + if isinstance(module, MossLayer): + module.forward = torch.compile(module.forward, dynamic=False) + count += 1 + return count + + @torch.no_grad() + def latent(self, codes, counts=None): + """codes [batch, 10, frames] (long); counts [batch] = residual codebooks kept (1..9), None = all. + + Mirrors MossCodec.decode_tokens / the viewer's decode path: fp32 RVQ lookups, fp32 semantic head. + Residual codebooks beyond `counts` are dropped per sample, reproducing the training-time codebook + dropout augmentation on cached codes.""" + if codes.ndim != 3 or codes.shape[1] != 1 + self.cfg['residual_codebooks']: + raise ValueError('Expected codes [batch, 10, frames]') + q = self.quantizer + with torch.autocast(codes.device.type, enabled=False): + q1 = q.semantic_quantizer.from_codes(codes[:, :1])[0] + z = self.semantic_head(q1).float() + for i, vq in enumerate(q.quantizer.quantizers): + z_i = vq.out_proj(vq.decode_code(codes[:, 1 + i])) + if counts is not None: + z_i = z_i * (counts > i).to(z_i.dtype)[:, None, None] + z = z + z_i + return z + + def features(self, codes, counts=None): + """240 Hz features [batch, 768, 16*frames] in bf16 autocast; frozen stages run without a graph.""" + x = self.latent(codes, counts) + with torch.autocast(codes.device.type, dtype=torch.bfloat16, enabled=codes.device.type == 'cuda'): + for i, stage in enumerate(self.stages): + if i in self.trainable_stages: + x = stage(x) + else: + with torch.no_grad(): + x = stage(x) + return x + + def forward(self, codes, counts=None, length=None): + feats = self.features(codes, counts) + with torch.autocast(codes.device.type, dtype=torch.bfloat16, enabled=codes.device.type == 'cuda'): + internal = self.head(feats) + with torch.autocast(codes.device.type, enabled=False): + audio = self.to_external(internal.float()) + expected = codes.shape[-1] * self.external_hop + audio = audio[..., :expected] + return audio if length is None else audio[..., :length] diff --git a/zonos3/codec/resample_exact.py b/zonos3/codec/resample_exact.py new file mode 100644 index 0000000000000000000000000000000000000000..0b1de35410dad6fff1322f74acc527d1b2c0a343 --- /dev/null +++ b/zonos3/codec/resample_exact.py @@ -0,0 +1,19 @@ +"""Torchaudio sinc kernels with integer-exact output length for long files.""" +import torch +from torch.nn import functional as F + +def output_length(samples,source_rate,target_rate): + return (int(samples)*int(target_rate)+int(source_rate)-1)//int(source_rate) + +def resample_exact(waveform,transform): + if transform.orig_freq==transform.new_freq:return waveform + original=transform.orig_freq//transform.gcd + new=transform.new_freq//transform.gcd + shape=waveform.shape + packed=waveform.reshape(-1,shape[-1]) + padded=F.pad(packed,(transform.width,transform.width+original)) + result=F.conv1d(padded[:,None],transform.kernel,stride=original) + result=result.transpose(1,2).reshape(packed.shape[0],-1) + target=output_length(shape[-1],original,new) + assert result.shape[-1]>=target + return result[...,:target].reshape(shape[:-1]+(target,)) diff --git a/zonos3/codec/s1dac/__init__.py b/zonos3/codec/s1dac/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/zonos3/codec/s1dac/losses.py b/zonos3/codec/s1dac/losses.py new file mode 100644 index 0000000000000000000000000000000000000000..77d087e1ef8dd92ad4f0a964a87cec98c55130d2 --- /dev/null +++ b/zonos3/codec/s1dac/losses.py @@ -0,0 +1,123 @@ +"""DAC GAN/reconstruction objectives and Mimi-style averaged cosine distillation.""" +import torch +from torch import nn +from torch.nn import functional as F +from audiotools import AudioSignal +from dac.nn.loss import MelSpectrogramLoss + + +class ReconstructionLoss(nn.Module): + def __init__(self): + super().__init__() + self.mel = MelSpectrogramLoss( + n_mels=[5,10,20,40,80,160,320], + window_lengths=[32,64,128,256,512,1024,2048], + mel_fmin=[0]*7, mel_fmax=[None]*7, + pow=1.0, clamp_eps=1e-5, mag_weight=0.0) + + def forward(self, fake, real): + with torch.autocast(fake.device.type, enabled=False): + return self.mel(AudioSignal(fake.float(),44100), AudioSignal(real.float(),44100)) + + +def _families(fake, real): + if not isinstance(fake, dict): + fake, real = {"all": fake}, {"all": real} + if fake.keys() != real.keys(): + raise ValueError("Real/fake discriminator families differ") + for name in fake: + if not fake[name] or len(fake[name]) != len(real[name]): + raise ValueError(f"Missing/mismatched discriminator branches: {name}") + yield name, fake[name], real[name] + + +def discriminator_loss(fake, real, return_families=False): + values = { + name: sum(x[-1].float().square().mean() + (1-y[-1].float()).square().mean() + for x, y in zip(fs, rs)) + for name, fs, rs in _families(fake, real) + } + total = sum(values.values()) + return (total, values) if return_families else total + + +def generator_losses(fake, real, return_families=False): + adversarial, feature = {}, {} + for name, fs, rs in _families(fake, real): + adversarial[name] = sum((1-x[-1].float()).square().mean() for x in fs) + feature[name] = sum( + F.l1_loss(x.float(), y.detach().float()) + for fake_branch, real_branch in zip(fs, rs) + for x, y in zip(fake_branch[:-1], real_branch[:-1])) + result = (sum(adversarial.values()), sum(feature.values())) + if return_families: + parts = {**{"adversarial/"+k: v for k, v in adversarial.items()}, + **{"feature_matching/"+k: v for k, v in feature.items()}} + return (*result, parts) + return result + + +def average_ssl_frames(target, student_frames, window_ratio=2.0): + """Noncausal box averages, including all overlapping SSL frame cells. + + Mimi uses kernel=8, stride=4 for 50 -> 12.5 Hz. Here a student interval + occupies target_frames/student_frames SSL frame cells, and the window is + window_ratio intervals wide, centered on that interval. With ratio 4 and + window_ratio 2 this is avg_pool1d(kernel=8,stride=4,padding=2, + count_include_pad=False). + + Fractional boundary cells contribute in proportion to their overlap. + Integral prefix sums implement exact piecewise-constant box integration + without interpolating feature vectors or rounding away any teacher frames. + Crop-edge windows are clipped and renormalized over available frames. + """ + if target.ndim != 3 or target.shape[1] < 1 or student_frames < 1: + raise ValueError("Expected nonempty SSL features [batch,frames,channels]") + if window_ratio <= 0: + raise ValueError("window_ratio must be positive") + with torch.autocast(target.device.type, enabled=False): + values = target.detach().float().transpose(1, 2) + teacher_frames = values.shape[-1] + ratio = teacher_frames / student_frames + centers = (torch.arange(student_frames, device=target.device, dtype=torch.float32) + 0.5) * ratio + half_width = 0.5 * window_ratio * ratio + left = (centers - half_width).clamp(0, teacher_frames) + right = (centers + half_width).clamp(0, teacher_frames) + prefix = F.pad(values.cumsum(dim=-1), (1, 0)) + def integral(position): + index = position.floor().long() + fraction = position - index + return (prefix.index_select(-1, index) + + values.index_select(-1, index.clamp(max=teacher_frames-1)) * fraction) + return (integral(right) - integral(left)) / (right-left) + + +def semantic_loss(prediction, target, window_ratio=2.0, eps=1e-8): + if prediction.ndim != 3 or target.ndim != 3: + raise ValueError("Prediction/SSL features must be rank three") + if prediction.shape[:2] != (target.shape[0], target.shape[2]): + raise ValueError("Prediction and SSL batch/channel dimensions differ") + with torch.autocast(prediction.device.type, enabled=False): + pooled = average_ssl_frames(target, prediction.shape[-1], window_ratio) + cosine = F.cosine_similarity(prediction.float(), pooled, dim=1, eps=eps) + return (1 - cosine.clamp(-1, 1)).mean() + + +class SemanticTeacher(nn.Module): + def __init__(self, path, layer=16, dtype=torch.bfloat16): + super().__init__() + if layer != 16: + raise ValueError("The recipe targets transformer layer 16") + from transformers import Wav2Vec2BertModel + self.model = Wav2Vec2BertModel.from_pretrained( + path, dtype=dtype, local_files_only=True) + self.model.encoder.layers = nn.ModuleList(list(self.model.encoder.layers[:layer])) + self.model.config.num_hidden_layers = layer + self.model.eval().requires_grad_(False) + + @torch.no_grad() + def forward(self, features, attention_mask): + self.model.eval() + return self.model( + input_features=features.to(next(self.model.parameters()).dtype), + attention_mask=attention_mask, return_dict=True).last_hidden_state diff --git a/zonos3/codec/s1dac/same_data/__init__.py b/zonos3/codec/s1dac/same_data/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/zonos3/codec/s1dac/same_data/npy_ogg_dataset.py b/zonos3/codec/s1dac/same_data/npy_ogg_dataset.py new file mode 100644 index 0000000000000000000000000000000000000000..f94007f2b3bccc6a41e30c8eb78c336845ae5a84 --- /dev/null +++ b/zonos3/codec/s1dac/same_data/npy_ogg_dataset.py @@ -0,0 +1,48 @@ +"""W2V-BERT feature preprocessing of the dual codec's SSL teacher (excerpt of s1dac/same_data/npy_ogg_dataset.py).""" + +from functools import lru_cache + +import torch +from torchaudio import transforms as T + + +@lru_cache(maxsize=32) +def _cached_resampler(input_rate: int, output_rate: int) -> T.Resample: + """Cache polyphase kernels per worker instead of rebuilding every sample.""" + return T.Resample(int(input_rate), int(output_rate)) + + +class Wav2Vec2BertFeaturePreprocessor: + """Exact public W2V-BERT 2.0 fbank/stride-stack preprocessing on CPU.""" + + def __init__(self, source_sample_rate: int): + from transformers import SeamlessM4TFeatureExtractor + + self.source_sample_rate = int(source_sample_rate) + self.target_sample_rate = 16000 + self.extractor = SeamlessM4TFeatureExtractor( + feature_size=80, + sampling_rate=self.target_sample_rate, + num_mel_bins=80, + padding_value=1, + stride=2, + ) + self.resampler = ( + _cached_resampler(self.source_sample_rate, self.target_sample_rate) + if self.source_sample_rate != self.target_sample_rate else None + ) + + def __call__(self, audio: torch.Tensor, info: dict) -> None: + # W2V-BERT is mono. The production mono recipe already requests an + # FFmpeg downmix; mean remains a harmless identity for that one channel + # and keeps this preprocessor valid for other callers. + mono = audio.float().mean(dim=0) + if self.resampler is not None: + mono = self.resampler(mono) + encoded = self.extractor( + mono.numpy(), + sampling_rate=self.target_sample_rate, + return_tensors="pt", + ) + info["w2v_bert_input_features"] = encoded.input_features[0] + info["w2v_bert_attention_mask"] = encoded.attention_mask[0].to(torch.bool) diff --git a/zonos3/codec/s1dac/vendor/__init__.py b/zonos3/codec/s1dac/vendor/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/zonos3/codec/s1dac/vendor/modded_dac.py b/zonos3/codec/s1dac/vendor/modded_dac.py new file mode 100644 index 0000000000000000000000000000000000000000..5f7d51e101d09f303c9fc6b810d47354934384d0 --- /dev/null +++ b/zonos3/codec/s1dac/vendor/modded_dac.py @@ -0,0 +1,1058 @@ +import math +import typing as tp +from dataclasses import dataclass +from typing import List, Optional, Union + +import numpy as np +import torch +from audiotools import AudioSignal +from audiotools.ml import BaseModel +from dac.model.base import CodecMixin +from dac.nn.layers import Snake1d, WNConv1d, WNConvTranspose1d +from torch import Tensor, nn +from torch.nn import functional as F +from torch.nn.utils.parametrizations import weight_norm +from torch.nn.utils.parametrize import remove_parametrizations + + +@dataclass +class VQResult: + z: torch.Tensor + codes: torch.Tensor + latents: torch.Tensor + codebook_loss: torch.Tensor + commitment_loss: torch.Tensor + semantic_distill_z: torch.Tensor | None = None + + +def find_multiple(n: int, k: int) -> int: + if n % k == 0: + return n + return n + k - (n % k) + + +@dataclass +class ModelArgs: + block_size: int = 2048 + n_layer: int = 8 + n_head: int = 8 + dim: int = 512 + intermediate_size: int = 1536 + n_local_heads: int = -1 + head_dim: int = 64 + rope_base: float = 10000 + norm_eps: float = 1e-5 + dropout_rate: float = 0.1 + attn_dropout_rate: float = 0.1 + channels_first: bool = True # to be compatible with conv1d input/output + pos_embed_type: str = "rope" # can be "rope" or "conformer" + max_relative_position: int = 128 # for conformer-style relative position embedding + window_size: int = 512 # for window limited attention + + def __post_init__(self): + if self.n_local_heads == -1: + self.n_local_heads = self.n_head + if self.intermediate_size is None: + hidden_dim = 4 * self.dim + n_hidden = int(2 * hidden_dim / 3) + self.intermediate_size = find_multiple(n_hidden, 256) + assert self.pos_embed_type in [ + "rope", + "conformer", + ], "pos_embed_type must be either 'rope' or 'conformer'" + + +class KVCache(nn.Module): + def __init__( + self, max_batch_size, max_seq_length, n_heads, head_dim, dtype=torch.bfloat16 + ): + super().__init__() + cache_shape = (max_batch_size, n_heads, max_seq_length, head_dim) + self.register_buffer("k_cache", torch.zeros(cache_shape, dtype=dtype)) + self.register_buffer("v_cache", torch.zeros(cache_shape, dtype=dtype)) + + def update(self, input_pos, k_val, v_val): + # input_pos: [S], k_val: [B, H, S, D] + assert input_pos.shape[0] == k_val.shape[2] + + k_out = self.k_cache + v_out = self.v_cache + k_out[:, :, input_pos] = k_val + v_out[:, :, input_pos] = v_val + + return ( + k_out[:, :, : input_pos.max() + 1, :], + v_out[:, :, : input_pos.max() + 1, :], + ) + + def clear_cache(self, prompt_len): + self.k_cache[:, :, prompt_len:, :] = torch.zeros_like( + self.k_cache[:, :, prompt_len:, :] + ) + self.v_cache[:, :, prompt_len:, :] = torch.zeros_like( + self.v_cache[:, :, prompt_len:, :] + ) + + +class Transformer(nn.Module): + def __init__(self, config: ModelArgs) -> None: + super().__init__() + self.config = config + + self.layers = nn.ModuleList( + TransformerBlock(config) for _ in range(config.n_layer) + ) + self.norm = RMSNorm(config.dim, eps=config.norm_eps) + + # Only compute RoPE frequencies if using RoPE + if config.pos_embed_type == "rope": + freqs_cis = precompute_freqs_cis( + self.config.block_size, self.config.head_dim, self.config.rope_base + ) + self.register_buffer("freqs_cis", freqs_cis, persistent=False) + else: + self.register_buffer("freqs_cis", None) + + causal_mask = None # WindowLimitedTransformer always supplies an explicit mask. + self.register_buffer("causal_mask", causal_mask, persistent=False) + + self.max_batch_size = -1 + self.max_seq_length = -1 + self.use_kv_cache = False + + def setup_caches(self, max_batch_size, max_seq_length): + """ + This method will only be called during inference when using KV cache. + """ + head_dim = self.config.dim // self.config.n_head + max_seq_length = find_multiple(max_seq_length, 8) + self.max_seq_length = max_seq_length + self.max_batch_size = max_batch_size + dtype = self.norm.weight.dtype + device = self.norm.weight.device + + for b in self.layers: + b.attention.kv_cache = KVCache( + max_batch_size, + max_seq_length, + self.config.n_local_heads, + head_dim, + dtype, + ).to(device) + + self.use_kv_cache = True + + def forward( + self, + x: Tensor, + input_pos: Optional[Tensor] = None, + mask: Optional[Tensor] = None, + ) -> Tensor: + if self.config.pos_embed_type == "rope": + assert ( + self.freqs_cis is not None + ), "RoPE frequencies must be initialized for RoPE positional embedding" + # print("MAX", input_pos.max()) + if x.shape[1] > self.freqs_cis.shape[0]: + self.freqs_cis = precompute_freqs_cis( + x.shape[1], self.config.head_dim, self.config.rope_base + ).to(x.device) + freqs_cis = self.freqs_cis[input_pos] + else: + freqs_cis = None + + if mask is None: # in case of non-causal model + if not self.training and self.use_kv_cache: + mask = self.causal_mask[None, None, input_pos] + mask = mask[..., : input_pos.max() + 1] + else: + mask = self.causal_mask[None, None, input_pos] + mask = mask[..., input_pos] + + for i, layer in enumerate(self.layers): + if getattr(self, "checkpoint_layers", False) and self.training and torch.is_grad_enabled(): + from torch.utils.checkpoint import checkpoint + x = checkpoint(layer, x, input_pos, freqs_cis, mask, use_reentrant=False) + else: + x = layer(x, input_pos, freqs_cis, mask) + x = self.norm(x) + return x + + +class TransformerBlock(nn.Module): + def __init__(self, config: ModelArgs) -> None: + super().__init__() + self.attention = Attention(config) + self.feed_forward = FeedForward(config) + self.ffn_norm = RMSNorm(config.dim, eps=config.norm_eps) + self.attention_norm = RMSNorm(config.dim, eps=config.norm_eps) + self.attention_layer_scale = LayerScale(config.dim, inplace=True) + self.ffn_layer_scale = LayerScale(config.dim, inplace=True) + + def forward( + self, + x: Tensor, + input_pos: Tensor, + freqs_cis: Tensor, + mask: Tensor, + ) -> Tensor: + h = x + self.attention_layer_scale( + self.attention(self.attention_norm(x), freqs_cis, mask, input_pos) + ) + out = h + self.ffn_layer_scale(self.feed_forward(self.ffn_norm(h))) + return out + + +class Attention(nn.Module): + def __init__(self, config: ModelArgs): + super().__init__() + assert config.dim % config.n_head == 0 + + total_head_dim = (config.n_head + 2 * config.n_local_heads) * config.head_dim + # key, query, value projections for all heads, but in a batch + self.wqkv = nn.Linear(config.dim, total_head_dim, bias=False) + self.wo = nn.Linear(config.head_dim * config.n_head, config.dim, bias=False) + self.kv_cache = None + + self.n_head = config.n_head + self.head_dim = config.head_dim + self.n_local_heads = config.n_local_heads + self.dim = config.dim + self.attn_dropout_rate = config.attn_dropout_rate + self.pos_embed_type = config.pos_embed_type + + # Add relative position embedding for conformer-style + if self.pos_embed_type == "conformer": + self.max_relative_position = config.max_relative_position + num_pos_embeddings = 2 * config.max_relative_position + 1 + self.rel_pos_embeddings = nn.Parameter( + torch.zeros(num_pos_embeddings, self.head_dim) + ) + nn.init.normal_(self.rel_pos_embeddings, mean=0.0, std=0.02) + + def _compute_conformer_pos_scores(self, q: Tensor, seqlen: int) -> Tensor: + # q: [B, H, S, D] + # Returns: [B, H, S, S] + positions = torch.arange(seqlen, device=q.device) + relative_positions = positions.unsqueeze(1) - positions.unsqueeze(0) # [S, S] + relative_positions = torch.clamp( + relative_positions + self.max_relative_position, + 0, + 2 * self.max_relative_position, + ) + rel_embeddings = self.rel_pos_embeddings[relative_positions] # [S, S, D] + + # Compute attention scores with relative position embeddings + q = q.transpose(1, 2) # [B, S, H, D] + rel_logits = torch.matmul(q, rel_embeddings.transpose(-2, -1)) # [B, S, H, S] + rel_logits = rel_logits.transpose(1, 2) # [B, H, S, S] + return rel_logits + + def forward( + self, + x: Tensor, + freqs_cis: Tensor, + mask: Tensor, + input_pos: Optional[Tensor] = None, + ) -> Tensor: + bsz, seqlen, _ = x.shape + + kv_size = self.n_local_heads * self.head_dim + q, k, v = self.wqkv(x).split([kv_size, kv_size, kv_size], dim=-1) + context_seqlen = seqlen + + q = q.view(bsz, seqlen, self.n_head, self.head_dim) + k = k.view(bsz, context_seqlen, self.n_local_heads, self.head_dim) + v = v.view(bsz, context_seqlen, self.n_local_heads, self.head_dim) + + if self.pos_embed_type == "rope": + q = apply_rotary_emb(q, freqs_cis) + k = apply_rotary_emb(k, freqs_cis) + + q, k, v = map(lambda x: x.transpose(1, 2), (q, k, v)) + + if self.kv_cache is not None: + k, v = self.kv_cache.update(input_pos, k, v) + + k = k.repeat_interleave(self.n_head // self.n_local_heads, dim=1) + v = v.repeat_interleave(self.n_head // self.n_local_heads, dim=1) + + if self.pos_embed_type == "conformer": + # Compute attention scores + scale = 1.0 / math.sqrt(self.head_dim) + scores = torch.matmul(q, k.transpose(-2, -1)) * scale + + # Add relative position embeddings for conformer-style + rel_scores = self._compute_conformer_pos_scores(q, seqlen) + scores = scores + rel_scores + + # Apply attention + if mask is not None: + scores = scores.masked_fill(~mask, float("-inf")) + + attn = F.softmax(scores, dim=-1) + if self.attn_dropout_rate > 0 and self.training: + attn = F.dropout(attn, p=self.attn_dropout_rate) + + y = torch.matmul(attn, v) + else: + y = F.scaled_dot_product_attention( + q, + k, + v, + dropout_p=self.attn_dropout_rate if self.training else 0.0, + attn_mask=mask, + ) + # is_causal=True) + y = ( + y.transpose(1, 2) + .contiguous() + .view(bsz, seqlen, self.head_dim * self.n_head) + ) + y = self.wo(y) + return y + + +class FeedForward(nn.Module): + def __init__(self, config: ModelArgs) -> None: + super().__init__() + self.w1 = nn.Linear(config.dim, config.intermediate_size, bias=False) + self.w3 = nn.Linear(config.dim, config.intermediate_size, bias=False) + self.w2 = nn.Linear(config.intermediate_size, config.dim, bias=False) + self.dropout = nn.Dropout(config.dropout_rate) + + def forward(self, x: Tensor) -> Tensor: + return self.w2(self.dropout(F.silu(self.w1(x)) * self.w3(x))) + + +class RMSNorm(nn.Module): + def __init__(self, dim: int, eps: float = 1e-5): + super().__init__() + self.eps = eps + self.weight = nn.Parameter(torch.ones(dim)) + + def _norm(self, x): + return x * torch.rsqrt(torch.mean(x * x, dim=-1, keepdim=True) + self.eps) + + def forward(self, x: Tensor) -> Tensor: + output = self._norm(x.float()).type_as(x) + return output * self.weight + + +class LayerScale(nn.Module): + def __init__( + self, + dim: int, + init_values: Union[float, Tensor] = 1e-2, + inplace: bool = False, + ) -> None: + super().__init__() + self.inplace = inplace + self.gamma = nn.Parameter(init_values * torch.ones(dim)) + + def forward(self, x: Tensor) -> Tensor: + return x.mul_(self.gamma) if self.inplace else x * self.gamma + + +class WindowLimitedTransformer(Transformer): + """ + Transformer with window limited attention, causal. + """ + + def __init__( + self, + config: ModelArgs, + input_dim: int = 512, + window_size: Optional[int] = None, + causal: bool = True, + look_ahead_conv: nn.Module = None, + ): + super().__init__(config) + self.window_size = window_size + self.causal = causal + self.channels_first = config.channels_first + self.look_ahead_conv = ( + look_ahead_conv if look_ahead_conv is not None else nn.Identity() + ) + self.input_proj = ( + nn.Linear(input_dim, config.dim) + if input_dim != config.dim + else nn.Identity() + ) + self.output_proj = ( + nn.Linear(config.dim, input_dim) + if input_dim != config.dim + else nn.Identity() + ) + + def make_window_limited_mask( + self, + max_length: int, + x_lens: Optional[Tensor] = None, + ) -> Tensor: + """ + Make mask to form window limited attention. + """ + if self.causal: + mask = torch.tril(torch.ones(max_length, max_length)) + row_indices = torch.arange(max_length).view(-1, 1) + window_size = self.window_size or max_length + valid_range = (row_indices - window_size + 1).clamp(min=0) + column_indices = torch.arange(max_length) + mask = (column_indices >= valid_range) & mask.bool() + else: + raise NotImplementedError + mask = mask.bool()[None, None] + return mask + + def make_mask( + self, + max_length: int, + x_lens: Optional[Tensor] = None, + ) -> Tensor: + """ + Make ordinary mask if window size is not specified. + """ + if self.causal: + mask = torch.tril(torch.ones(max_length, max_length)) + else: + mask = torch.ones(max_length, max_length) + mask = mask.bool()[None, None] + for i, x_len in enumerate(x_lens): + mask[:x_len, i] = 0 + mask = mask.bool()[None, None] + return mask + + def forward( + self, + x: Tensor, + x_lens: Optional[Tensor] = None, + ) -> Tensor: + if self.channels_first: + x = x.transpose(1, 2) + x = self.input_proj(x) # (B, T, D) + x = self.look_ahead_conv(x) + input_pos = torch.arange(x.shape[1], device=x.device) + # construct mask to form window limited attention + max_length = x.shape[1] + key = (max_length, x.device) + if getattr(self, "_mask_key", None) != key: + positions = torch.arange(max_length, device=x.device) + delta = positions[:, None] - positions[None, :] + mask = delta >= 0 + if self.window_size is not None: + mask = mask & (delta < self.window_size) + self._training_mask = mask[None, None] + self._mask_key = key + mask = self._training_mask + x = super().forward(x, input_pos, mask) + x = self.output_proj(x) # (B, T, D) + if self.channels_first: + x = x.transpose(1, 2) + return x + + +def precompute_freqs_cis( + seq_len: int, n_elem: int, base: int = 10000, dtype: torch.dtype = torch.bfloat16 +) -> Tensor: + freqs = 1.0 / ( + base ** (torch.arange(0, n_elem, 2)[: (n_elem // 2)].float() / n_elem) + ) + t = torch.arange(seq_len, device=freqs.device) + freqs = torch.outer(t, freqs) + freqs_cis = torch.polar(torch.ones_like(freqs), freqs) + cache = torch.stack([freqs_cis.real, freqs_cis.imag], dim=-1) + return cache.to(dtype=dtype) + + +def apply_rotary_emb(x: Tensor, freqs_cis: Tensor) -> Tensor: + xshaped = x.float().reshape(*x.shape[:-1], -1, 2) + freqs_cis = freqs_cis.view(1, xshaped.size(1), 1, xshaped.size(3), 2) + x_out2 = torch.stack( + [ + xshaped[..., 0] * freqs_cis[..., 0] - xshaped[..., 1] * freqs_cis[..., 1], + xshaped[..., 1] * freqs_cis[..., 0] + xshaped[..., 0] * freqs_cis[..., 1], + ], + -1, + ) + + x_out2 = x_out2.flatten(3) + return x_out2.type_as(x) + + +def init_weights(m): + if isinstance(m, nn.Conv1d): + nn.init.trunc_normal_(m.weight, std=0.02) + nn.init.constant_(m.bias, 0) + + +def unpad1d(x: torch.Tensor, paddings: tp.Tuple[int, int]): + """Remove padding from x, handling properly zero padding. Only for 1d!""" + padding_left, padding_right = paddings + assert padding_left >= 0 and padding_right >= 0, (padding_left, padding_right) + assert (padding_left + padding_right) <= x.shape[-1] + end = x.shape[-1] - padding_right + return x[..., padding_left:end] + + +def get_extra_padding_for_conv1d( + x: torch.Tensor, kernel_size: int, stride: int, padding_total: int = 0 +) -> int: + """See `pad_for_conv1d`.""" + length = x.shape[-1] + n_frames = (length - kernel_size + padding_total) / stride + 1 + ideal_length = (math.ceil(n_frames) - 1) * stride + (kernel_size - padding_total) + return ideal_length - length + + +def pad1d( + x: torch.Tensor, + paddings: tp.Tuple[int, int], + mode: str = "zeros", + value: float = 0.0, +): + """Tiny wrapper around F.pad, just to allow for reflect padding on small input. + If this is the case, we insert extra 0 padding to the right + before the reflection happen. + """ + length = x.shape[-1] + padding_left, padding_right = paddings + assert padding_left >= 0 and padding_right >= 0, (padding_left, padding_right) + if mode == "reflect": + max_pad = max(padding_left, padding_right) + extra_pad = 0 + if length <= max_pad: + extra_pad = max_pad - length + 1 + x = F.pad(x, (0, extra_pad)) + padded = F.pad(x, paddings, mode, value) + end = padded.shape[-1] - extra_pad + return padded[..., :end] + else: + return F.pad(x, paddings, mode, value) + + +class CausalConvNet(nn.Module): + def __init__( + self, + in_channels, + out_channels, + kernel_size, + dilation=1, + stride=1, + groups=1, + padding=None, + ): + super(CausalConvNet, self).__init__() + self.conv = nn.Conv1d( + in_channels, + out_channels, + kernel_size, + stride=stride, + dilation=dilation, + groups=groups, + ) + self.stride = stride + self.kernel_size = (kernel_size - 1) * dilation + 1 + self.dilation = dilation + self.padding = self.kernel_size - self.stride + + def forward(self, x): + pad = self.padding + extra_padding = get_extra_padding_for_conv1d( + x, self.kernel_size, self.stride, pad + ) + x = pad1d(x, (pad, extra_padding), mode="constant", value=0) + return self.conv(x).contiguous() + + def weight_norm(self, name="weight", dim=0): + self.conv = weight_norm(self.conv, name=name, dim=dim) + return self + + def remove_weight_norm(self): + self.conv = remove_parametrizations(self.conv) + return self + + +class CausalTransConvNet(nn.Module): + def __init__( + self, in_channels, out_channels, kernel_size, dilation=1, stride=1, padding=None + ): + super(CausalTransConvNet, self).__init__() + self.conv = nn.ConvTranspose1d( + in_channels, out_channels, kernel_size, stride=stride, dilation=dilation + ) + self.stride = stride + self.kernel_size = kernel_size + + def forward(self, x): + x = self.conv(x) + pad = self.kernel_size - self.stride + padding_right = math.ceil(pad) + padding_left = pad - padding_right + x = unpad1d(x, (padding_left, padding_right)) + return x.contiguous() + + def weight_norm(self, name="weight", dim=0): + self.conv = weight_norm(self.conv, name=name, dim=dim) + return self + + def remove_weight_norm(self): + self.conv = remove_parametrizations(self.conv) + return self + + +def CausalWNConv1d(*args, **kwargs): + return CausalConvNet(*args, **kwargs).weight_norm() + + +def CausalWNConvTranspose1d(*args, **kwargs): + return CausalTransConvNet(*args, **kwargs).weight_norm() + + +class ResidualUnit(nn.Module): + def __init__(self, dim: int = 16, dilation: int = 1, causal: bool = False): + super().__init__() + conv_class = CausalWNConv1d if causal else WNConv1d + pad = ((7 - 1) * dilation) // 2 + self.block = nn.Sequential( + Snake1d(dim), + conv_class(dim, dim, kernel_size=7, dilation=dilation, padding=pad), + Snake1d(dim), + conv_class(dim, dim, kernel_size=1), + ) + self.causal = causal + + def forward(self, x): + y = self.block(x) + pad = x.shape[-1] - y.shape[-1] + if pad > 0: + if self.causal: + x = x[..., :-pad] + else: + x = x[..., pad // 2 : -pad // 2] + return x + y + + +class EncoderBlock(nn.Module): + def __init__( + self, + dim: int = 16, + stride: int = 1, + causal: bool = False, + n_t_layer: int = 0, + transformer_general_config=None, + ): + super().__init__() + conv_class = CausalWNConv1d if causal else WNConv1d + transformer_module = ( + nn.Identity() + if n_t_layer == 0 + else ( + WindowLimitedTransformer( + causal=causal, + input_dim=dim, + window_size=getattr(transformer_general_config, "window_size", 512), + config=transformer_general_config( + n_layer=n_t_layer, + n_head=dim // 64, + dim=dim, + intermediate_size=dim * 3, + ), + ) + ) + ) + self.block = nn.Sequential( + ResidualUnit(dim // 2, dilation=1, causal=causal), + ResidualUnit(dim // 2, dilation=3, causal=causal), + ResidualUnit(dim // 2, dilation=9, causal=causal), + Snake1d(dim // 2), + conv_class( + dim // 2, + dim, + kernel_size=2 * stride, + stride=stride, + padding=math.ceil(stride / 2), + ), + transformer_module, + ) + + def forward(self, x): + return self.block(x) + + +class Encoder(nn.Module): + def __init__( + self, + d_model: int = 64, + strides: list = [2, 4, 8, 8], + d_latent: int = 64, + n_transformer_layers: list = [0, 0, 4, 4], + transformer_general_config: ModelArgs = None, + causal: bool = False, + ): + super().__init__() + conv_class = CausalWNConv1d if causal else WNConv1d + # Create first convolution + self.block = [conv_class(1, d_model, kernel_size=7, padding=3)] + + # Create EncoderBlocks that double channels as they downsample by `stride` + for stride, n_t_layer in zip(strides, n_transformer_layers): + d_model *= 2 + self.block += [ + EncoderBlock( + d_model, + stride=stride, + causal=causal, + n_t_layer=n_t_layer, + transformer_general_config=transformer_general_config, + ) + ] + + # Create last convolution + self.block += [ + Snake1d(d_model), + conv_class(d_model, d_latent, kernel_size=3, padding=1), + ] + + # Wrap black into nn.Sequential + self.block = nn.Sequential(*self.block) + self.enc_dim = d_model + + def forward(self, x): + return self.block(x) + + +class DecoderBlock(nn.Module): + def __init__( + self, + input_dim: int = 16, + output_dim: int = 8, + stride: int = 1, + causal: bool = False, + n_t_layer: int = 0, + transformer_general_config=None, + ): + super().__init__() + conv_trans_class = CausalWNConvTranspose1d if causal else WNConvTranspose1d + transformer_module = ( + nn.Identity() + if n_t_layer == 0 + else ( + WindowLimitedTransformer( + causal=causal, + input_dim=input_dim, + window_size=None, + config=transformer_general_config( + n_layer=n_t_layer, + n_head=input_dim // 64, + dim=input_dim, + intermediate_size=input_dim * 3, + ), + ) + ) + ) + self.block = nn.Sequential( + # transformer_module, + Snake1d(input_dim), + conv_trans_class( + input_dim, + output_dim, + kernel_size=2 * stride, + stride=stride, + padding=math.ceil(stride / 2), + ), + ResidualUnit(output_dim, dilation=1, causal=causal), + ResidualUnit(output_dim, dilation=3, causal=causal), + ResidualUnit(output_dim, dilation=9, causal=causal), + ) + + def forward(self, x): + return self.block(x) + + +class Decoder(nn.Module): + def __init__( + self, + input_channel, + channels, + rates, + d_out: int = 1, + causal: bool = False, + n_transformer_layers: list = [0, 0, 0, 0], + transformer_general_config=None, + ): + super().__init__() + conv_class = CausalWNConv1d if causal else WNConv1d + # Add first conv layer + layers = [conv_class(input_channel, channels, kernel_size=7, padding=3)] + + # Add upsampling + MRF blocks + for i, (stride, n_t_layer) in enumerate(zip(rates, n_transformer_layers)): + input_dim = channels // 2**i + output_dim = channels // 2 ** (i + 1) + layers += [ + DecoderBlock( + input_dim, + output_dim, + stride, + causal=causal, + n_t_layer=n_t_layer, + transformer_general_config=transformer_general_config, + ) + ] + + # Add final conv layer + layers += [ + Snake1d(output_dim), + conv_class(output_dim, d_out, kernel_size=7, padding=3), + nn.Tanh(), + ] + + self.model = nn.Sequential(*layers) + + def forward(self, x): + return self.model(x) + + +class DAC(BaseModel, CodecMixin): + def __init__( + self, + encoder_dim: int = 64, + encoder_rates: List[int] = [2, 4, 8, 8], + latent_dim: int = None, + decoder_dim: int = 1536, + decoder_rates: List[int] = [8, 8, 4, 2], + quantizer: torch.nn.Module = None, + sample_rate: int = 44100, + causal: bool = True, + encoder_transformer_layers: List[int] = [0, 0, 0, 0], + decoder_transformer_layers: List[int] = [0, 0, 0, 0], + overwrite_decoder: torch.nn.Module = None, + transformer_general_config=None, + ): + super().__init__() + + self.encoder_dim = encoder_dim + self.encoder_rates = encoder_rates + self.decoder_dim = decoder_dim + self.decoder_rates = decoder_rates + self.sample_rate = sample_rate + + if latent_dim is None: + latent_dim = encoder_dim * (2 ** len(encoder_rates)) + + self.latent_dim = latent_dim + + self.hop_length = np.prod(encoder_rates) + self.encoder = Encoder( + encoder_dim, + encoder_rates, + latent_dim, + causal=causal, + n_transformer_layers=encoder_transformer_layers, + transformer_general_config=transformer_general_config, + ) + + self.quantizer = quantizer + + if overwrite_decoder is not None: + self.decoder = overwrite_decoder + else: + self.decoder = Decoder( + latent_dim, + decoder_dim, + decoder_rates, + causal=causal, + n_transformer_layers=decoder_transformer_layers, + transformer_general_config=transformer_general_config, + ) + self.sample_rate = sample_rate + self.apply(init_weights) + + self.delay = self.get_delay() + + self.frame_length = self.hop_length * 4 + + def preprocess(self, audio_data, sample_rate): + if sample_rate is None: + sample_rate = self.sample_rate + assert sample_rate == self.sample_rate + + length = audio_data.shape[-1] + right_pad = math.ceil(length / self.hop_length) * self.hop_length - length + audio_data = nn.functional.pad(audio_data, (0, right_pad)) + + return audio_data + + def encode( + self, + audio_data: torch.Tensor, + audio_lengths: torch.Tensor = None, + n_quantizers: int = None, + **kwargs, + ): + """Encode given audio data and return quantized latent codes + + Parameters + ---------- + audio_data : Tensor[B x T] + Audio data to encode + n_quantizers : int, optional + Number of quantizers to use, by default None + If None, all quantizers are used. + + Returns + ------- + dict + A dictionary with the following keys: + "z" : Tensor[B x D x T] + Quantized continuous representation of input + "codes" : Tensor[B x N x T] + Codebook indices for each codebook + (quantized discrete representation of input) + "latents" : Tensor[B x N*D x T] + Projected latents (continuous representation of input before quantization) + "vq/commitment_loss" : Tensor[1] + Commitment loss to train encoder to predict vectors closer to codebook + entries + "vq/codebook_loss" : Tensor[1] + Codebook loss to update the codebook + "length" : int + Number of samples in input audio + """ + # pad to multiple of self.frame_length + if audio_data.ndim == 2: + audio_data = audio_data.unsqueeze(1) + length = audio_data.shape[-1] + right_pad = math.ceil(length / self.frame_length) * self.frame_length - length + audio_data = nn.functional.pad(audio_data, (0, right_pad)) + if audio_lengths is None: + audio_lengths = torch.LongTensor([length + right_pad]).to(audio_data.device) + + z = self.encoder(audio_data) + vq_results = self.quantizer(z, n_quantizers, **kwargs) + indices = vq_results.codes + indices_lens = torch.ceil(audio_lengths / self.frame_length).long() + return indices, indices_lens + + def from_indices(self, indices: torch.Tensor): + z = self.quantizer.decode(indices) + return self.decoder(z) + + def decode(self, z: torch.Tensor): + """Decode given latent codes and return audio data + + Parameters + ---------- + z : Tensor[B x D x T] + Quantized continuous representation of input + length : int, optional + Number of samples in output audio, by default None + + Returns + ------- + dict + A dictionary with the following keys: + "audio" : Tensor[B x 1 x length] + Decoded audio data. + """ + return self.decoder(z) + + def forward( + self, + audio_data: torch.Tensor, + template: torch.Tensor = None, + mask: torch.Tensor = None, + sample_rate: int = None, + n_quantizers: int = None, + **kwargs, + ): + """Model forward pass + + Parameters + ---------- + audio_data : Tensor[B x 1 x T] + Audio data to encode + sample_rate : int, optional + Sample rate of audio data in Hz, by default None + If None, defaults to `self.sample_rate` + n_quantizers : int, optional + Number of quantizers to use, by default None. + If None, all quantizers are used. + + Returns + ------- + dict + A dictionary with the following keys: + "z" : Tensor[B x D x T] + Quantized continuous representation of input + "codes" : Tensor[B x N x T] + Codebook indices for each codebook + (quantized discrete representation of input) + "latents" : Tensor[B x N*D x T] + Projected latents (continuous representation of input before quantization) + "vq/commitment_loss" : Tensor[1] + Commitment loss to train encoder to predict vectors closer to codebook + entries + "vq/codebook_loss" : Tensor[1] + Codebook loss to update the codebook + "length" : int + Number of samples in input audio + "audio" : Tensor[B x 1 x length] + Decoded audio data. + """ + length = audio_data.shape[-1] + audio_data = self.preprocess(audio_data, sample_rate) + vq_results = self.encode(audio_data, n_quantizers, **kwargs) + z = vq_results[0] if isinstance(vq_results, tuple) else vq_results.z + x = self.decode(z) + return x[..., :length], vq_results + + +if __name__ == "__main__": + import hydra + import numpy as np + import soundfile as sf + import torch + from omegaconf import OmegaConf + + # 配置路径 + config_path = "fish_speech/configs/modded_dac_vq.yaml" + checkpoint_path = "checkpoints/s2-pro/codec.pth" + codes_path = "./output/codes_0.npy" # 你的 codes 文件路径 + output_path = "reconstructed_from_codes.wav" + sample_rate = 44100 # 请确保采样率与模型训练时一致 + + with torch.inference_mode(): + # 1. 初始化模型 + model = hydra.utils.instantiate(OmegaConf.load(config_path)) + new_sd = torch.load(checkpoint_path, map_location="cpu") + model.load_state_dict(new_sd, strict=False) + model.cuda() + model.eval() + + # 2. 加载外部 codes (.npy) + # 预期 shape 通常为 [num_codebooks, seq_len] 或 [1, num_codebooks, seq_len] + codes_np = np.load(codes_path) + codes_tensor = torch.from_numpy(codes_np).to(torch.long).cuda() + + # 如果 codes 没有 batch 维度,增加一个维度 [1, num_codebooks, seq_len] + if len(codes_tensor.shape) == 2: + codes_tensor = codes_tensor.unsqueeze(0) + + print(f"Loaded codes shape: {codes_tensor.shape}") + + # 3. 直接从 codes 重建音频 (Decoding) + # 注意:fish_speech 的 model.from_indices 通常接受的输入是 LongTensor + fake_audio = model.from_indices(codes_tensor) + + # 4. 后处理与保存 + # fake_audio 形状通常为 [B, C, T] + audio_np = fake_audio.squeeze().cpu().numpy() + + # 如果是多声道,转置为 soundfile 要求的 (samples, channels) + if len(audio_np.shape) == 2: + audio_np = audio_np.T + + sf.write(output_path, audio_np, sample_rate) + print(f"重建完成。音频已保存至: {output_path}") diff --git a/zonos3/codec/s1dac/vendor/rvq.py b/zonos3/codec/s1dac/vendor/rvq.py new file mode 100644 index 0000000000000000000000000000000000000000..aa26a69f9f1004f40d080e750d5f9afa140bbffb --- /dev/null +++ b/zonos3/codec/s1dac/vendor/rvq.py @@ -0,0 +1,403 @@ +import math +import typing as tp +from dataclasses import dataclass + +import torch +import torch.nn as nn +import torch.nn.functional as F +from dac.nn.quantize import ResidualVectorQuantize +from torch.nn.utils.parametrizations import weight_norm +from torch.nn.utils.parametrize import remove_parametrizations + + +def unpad1d(x: torch.Tensor, paddings: tp.Tuple[int, int]): + """Remove padding from x, handling properly zero padding. Only for 1d!""" + padding_left, padding_right = paddings + assert padding_left >= 0 and padding_right >= 0, (padding_left, padding_right) + assert (padding_left + padding_right) <= x.shape[-1] + end = x.shape[-1] - padding_right + return x[..., padding_left:end] + + +def get_extra_padding_for_conv1d( + x: torch.Tensor, kernel_size: int, stride: int, padding_total: int = 0 +) -> int: + """See `pad_for_conv1d`.""" + length = x.shape[-1] + n_frames = (length - kernel_size + padding_total) / stride + 1 + ideal_length = (math.ceil(n_frames) - 1) * stride + (kernel_size - padding_total) + return ideal_length - length + + +def pad1d( + x: torch.Tensor, + paddings: tp.Tuple[int, int], + mode: str = "zeros", + value: float = 0.0, +): + """Tiny wrapper around F.pad, just to allow for reflect padding on small input. + If this is the case, we insert extra 0 padding to the right + before the reflection happen. + """ + length = x.shape[-1] + padding_left, padding_right = paddings + assert padding_left >= 0 and padding_right >= 0, (padding_left, padding_right) + if mode == "reflect": + max_pad = max(padding_left, padding_right) + extra_pad = 0 + if length <= max_pad: + extra_pad = max_pad - length + 1 + x = F.pad(x, (0, extra_pad)) + padded = F.pad(x, paddings, mode, value) + end = padded.shape[-1] - extra_pad + return padded[..., :end] + else: + return F.pad(x, paddings, mode, value) + + +class CausalConvNet(nn.Module): + def __init__( + self, + in_channels, + out_channels, + kernel_size, + dilation=1, + stride=1, + groups=1, + padding=None, + ): + super(CausalConvNet, self).__init__() + self.conv = nn.Conv1d( + in_channels, + out_channels, + kernel_size, + stride=stride, + dilation=dilation, + groups=groups, + ) + self.stride = stride + self.kernel_size = (kernel_size - 1) * dilation + 1 + self.dilation = dilation + self.padding = self.kernel_size - self.stride + + def forward(self, x): + pad = self.padding + extra_padding = get_extra_padding_for_conv1d( + x, self.kernel_size, self.stride, pad + ) + x = pad1d(x, (pad, extra_padding), mode="constant", value=0) + return self.conv(x).contiguous() + + def weight_norm(self, name="weight", dim=0): + self.conv = weight_norm(self.conv, name=name, dim=dim) + return self + + def remove_weight_norm(self): + self.conv = remove_parametrizations(self.conv) + return self + + +class CausalTransConvNet(nn.Module): + def __init__( + self, in_channels, out_channels, kernel_size, dilation=1, stride=1, padding=None + ): + super(CausalTransConvNet, self).__init__() + self.conv = nn.ConvTranspose1d( + in_channels, out_channels, kernel_size, stride=stride, dilation=dilation + ) + self.stride = stride + self.kernel_size = kernel_size + + def forward(self, x): + x = self.conv(x) + pad = self.kernel_size - self.stride + padding_right = math.ceil(pad) + padding_left = pad - padding_right + x = unpad1d(x, (padding_left, padding_right)) + return x.contiguous() + + def weight_norm(self, name="weight", dim=0): + self.conv = weight_norm(self.conv, name=name, dim=dim) + return self + + def remove_weight_norm(self): + self.conv = remove_parametrizations(self.conv) + return self + + +# ConvNeXt Block copied from https://github.com/fishaudio/fish-diffusion/blob/main/fish_diffusion/modules/convnext.py +class ConvNeXtBlock(nn.Module): + r"""ConvNeXt Block. There are two equivalent implementations: + (1) DwConv -> LayerNorm (channels_first) -> 1x1 Conv -> GELU -> 1x1 Conv; all in (N, C, H, W) + (2) DwConv -> Permute to (N, H, W, C); LayerNorm (channels_last) -> Linear -> GELU -> Linear; Permute back + We use (2) as we find it slightly faster in PyTorch + Args: + dim (int): Number of input channels. + drop_path (float): Stochastic depth rate. Default: 0.0 + layer_scale_init_value (float): Init value for Layer Scale. Default: 1e-6. + mlp_ratio (float): Ratio of mlp hidden dim to embedding dim. Default: 4.0. + kernel_size (int): Kernel size for depthwise conv. Default: 7. + dilation (int): Dilation for depthwise conv. Default: 1. + """ # noqa: E501 + + def __init__( + self, + dim: int, + layer_scale_init_value: float = 1e-6, + mlp_ratio: float = 4.0, + kernel_size: int = 7, + dilation: int = 1, + ): + super().__init__() + convnet_type = CausalConvNet + self.dwconv = convnet_type( + dim, + dim, + kernel_size=kernel_size, + # padding=int(dilation * (kernel_size - 1) / 2), + groups=dim, + dilation=dilation, + ) # depthwise conv + self.norm = nn.LayerNorm(dim, eps=1e-6) + self.pwconv1 = nn.Linear( + dim, int(mlp_ratio * dim) + ) # pointwise/1x1 convs, implemented with linear layers + self.act = nn.GELU() + self.pwconv2 = nn.Linear(int(mlp_ratio * dim), dim) + self.gamma = ( + nn.Parameter(layer_scale_init_value * torch.ones((dim)), requires_grad=True) + if layer_scale_init_value > 0 + else None + ) + + def forward(self, x, apply_residual: bool = True): + input = x + + x = self.dwconv(x) + x = x.permute(0, 2, 1) # (N, C, L) -> (N, L, C) + x = self.norm(x) + x = self.pwconv1(x) + x = self.act(x) + x = self.pwconv2(x) + + if self.gamma is not None: + x = self.gamma * x + + x = x.permute(0, 2, 1) # (N, L, C) -> (N, C, L) + + if apply_residual: + x = input + x + + return x + + +@dataclass +class VQResult: + z: torch.Tensor + codes: torch.Tensor + latents: torch.Tensor + codebook_loss: torch.Tensor + commitment_loss: torch.Tensor + semantic_distill_z: torch.Tensor | None = None + + +class DownsampleResidualVectorQuantize(nn.Module): + def __init__( + self, + input_dim: int = 1024, + n_codebooks: int = 9, + codebook_dim: int = 8, + quantizer_dropout: float = 0.5, + codebook_size: int = 1024, + semantic_codebook_size: int = 4096, + downsample_factor: tuple[int] = (2, 2), + downsample_dims: tuple[int] | None = None, + pre_module: nn.Module | None = None, + post_module: nn.Module | None = None, + semantic_predictor_module: nn.Module | None = None, + ): + super().__init__() + + if downsample_dims is None: + downsample_dims = [input_dim for _ in range(len(downsample_factor))] + + all_dims = (input_dim,) + tuple(downsample_dims) + + self.semantic_quantizer = ResidualVectorQuantize( + input_dim=input_dim, + n_codebooks=1, + codebook_size=semantic_codebook_size, + codebook_dim=codebook_dim, + quantizer_dropout=0.0, + ) + + self.quantizer = ResidualVectorQuantize( + input_dim=input_dim, + n_codebooks=n_codebooks, + codebook_size=codebook_size, + codebook_dim=codebook_dim, + quantizer_dropout=quantizer_dropout, + ) + + self.downsample_factor = downsample_factor + self.downsample_dims = downsample_dims + + convnet_type = CausalConvNet + transconvnet_type = CausalTransConvNet + + self.downsample = nn.Sequential( + *[ + nn.Sequential( + convnet_type( + all_dims[idx], + all_dims[idx + 1], + kernel_size=factor, + stride=factor, + ), + ConvNeXtBlock(dim=all_dims[idx + 1]), + ) + for idx, factor in enumerate(downsample_factor) + ] + ) + + self.upsample = nn.Sequential( + *[ + nn.Sequential( + transconvnet_type( + all_dims[idx + 1], + all_dims[idx], + kernel_size=factor, + stride=factor, + ), + ConvNeXtBlock(dim=all_dims[idx]), + ) + for idx, factor in reversed(list(enumerate(downsample_factor))) + ] + ) + self.apply(self._init_weights) + self.pre_module = ( + pre_module if pre_module is not None else nn.Identity() + ) # leave for transformer, LSTM or Mamba or something else + self.post_module = post_module if post_module is not None else nn.Identity() + self.semantic_predictor_module = ( + semantic_predictor_module + if semantic_predictor_module is not None + else nn.Identity() + ) + + def _init_weights(self, m): + if isinstance(m, (nn.Conv1d, nn.Linear)): + nn.init.trunc_normal_(m.weight, std=0.02) + nn.init.constant_(m.bias, 0) + + def forward( + self, z, n_quantizers: int = None, semantic_len: torch.Tensor = None, **kwargs + ): + # z: (B, D, T) + original_shape = z.shape + if semantic_len is None: + semantic_len = torch.LongTensor([z.shape[-1]]) + z = self.downsample(z) + z = self.pre_module(z) # B, T, D + # FP32 nearest-neighbour lookup, VQ losses and straight-through residuals. + with torch.autocast(z.device.type, enabled=False): + z = z.float() + ( + semantic_z, + semantic_codes, + semantic_latents, + semantic_commitment_loss, + semantic_codebook_loss, + ) = self.semantic_quantizer(z) + residual_z = z - semantic_z + residual_z, codes, latents, commitment_loss, codebook_loss = self.quantizer( + residual_z, n_quantizers=n_quantizers + ) + z = semantic_z + residual_z + commitment_loss = commitment_loss + semantic_commitment_loss + codebook_loss = codebook_loss + semantic_codebook_loss + codes = torch.cat([semantic_codes, codes], dim=1) + latents = torch.cat([semantic_latents, latents], dim=1) + z = self.post_module(z) + z = self.upsample(z) + # z: (B, D, T) + + # semantic distillation (disabled here since only used in training) + # semantic_distill_z = self.semantic_predictor_module(semantic_z, semantic_len).mT # wav2vec target is B, T, D + + # Pad or crop z to match original shape + diff = original_shape[-1] - z.shape[-1] + right = 0 + left = abs(diff) - right + + if diff > 0: + z = F.pad(z, (left, right)) + elif diff < 0: + z = z[..., left:] + + results = VQResult( + z=z, + codes=codes, + latents=latents, + commitment_loss=commitment_loss, + codebook_loss=codebook_loss, + semantic_distill_z=semantic_z, + ) + + return results + + # def encode(self, z): + # z = self.downsample(z) + # z = self.pre_module(z) + # _, indices, _, _, _ = self.quantizer(z.mT) + # indices = rearrange(indices, "g b l r -> b (g r) l") + # return indices + # + def decode(self, indices: torch.Tensor): + # indices = rearrange(indices, "b (g r) l -> g b l r", g=self.residual_fsq.groups) + indices[:, 0] = torch.clamp( + indices[:, 0], max=self.semantic_quantizer.codebook_size - 1 + ) + indices[:, 1:] = torch.clamp( + indices[:, 1:], max=self.quantizer.codebook_size - 1 + ) + + z_q_semantic = self.semantic_quantizer.from_codes(indices[:, :1])[0] + z_q_residual = self.quantizer.from_codes(indices[:, 1:])[0] + z_q = z_q_semantic + z_q_residual + z_q = self.post_module(z_q) + z_q = self.upsample(z_q) + return z_q + + # def from_latents(self, latents: torch.Tensor): + # z_q, z_p, codes = super().from_latents(latents) + # z_q = self.upsample(z_q) + # return z_q, z_p, codes + + +if __name__ == "__main__": + rvq = DownsampleResidualVectorQuantize( + input_dim=512, + n_codebooks=8, + codebook_dim=8, + codebook_size=1024, + quantizer_dropout=0.5, + downsample_factor=[2, 2], + ) + rvq.eval() + x = torch.randn(2, 512, 442) + + result = rvq(x) + print(rvq) + print(result.latents.shape, result.codes.shape, result.z.shape) + + # y = rvq.from_codes(result.codes) + # print(y[0].shape) + + # y = rvq.from_latents( + + result1 = rvq(x[:, :, :40]) + print(result1.latents.shape, result1.codes.shape, result1.z.shape) + + assert torch.allclose(result.z[:, :, :40], result1.z, atol=1e-8) + print("Success") diff --git a/zonos3/condition_buckets.py b/zonos3/condition_buckets.py new file mode 100644 index 0000000000000000000000000000000000000000..f68e93af2b1efa698b8bb7c8b79ef78af90cbc9f --- /dev/null +++ b/zonos3/condition_buckets.py @@ -0,0 +1,37 @@ +"""Per-table bucket counts of the condition rows (port of minisgl's CONDITION_BUCKET_COUNTS_20261031). + +The cond3 finetunes share one bucket count for their tables (params ``condition_n_buckets``; the id equal to the count +is the unknown row). The rate30 finetunes widen one table (params ``condition_bucket_counts`` [10, 10, 30]): table i +has counts[i] + 1 rows and its unknown id is counts[i]. Without the field every table has ``condition_n_buckets``. +""" +from __future__ import annotations + +from typing import Sequence + + +def bucket_counts(count: int, n_buckets: int, counts: Sequence[int] | None = None) -> tuple[int, ...]: + """One bucket count per condition table: ``counts`` when the checkpoint carries them, else ``n_buckets`` for every + table. A table's unknown id is its count.""" + if count <= 0: + return () + if not counts: + return (int(n_buckets),) * count + if len(counts) != count: + raise ValueError(f"condition_bucket_counts has {len(counts)} entries for {count} condition rows") + if any(int(c) < 2 for c in counts): + raise ValueError(f"condition_bucket_counts must be integers >= 2: {list(counts)}") + return tuple(int(c) for c in counts) + + +def check_ids(ids, counts: Sequence[int], what: str = "condition_buckets") -> list[int]: + """Validate one id per table (0..count, count = unknown) and return them as ints.""" + try: + ids = [int(b) for b in ids] + except (TypeError, ValueError): + raise ValueError(f"{what} must be integers") from None + counts = [int(u) for u in counts] + if len(ids) != len(counts) or any(not 0 <= b <= u for b, u in zip(ids, counts)): + raise ValueError( + f"{what} needs {len(counts)} ids, each in [0, count] for the bucket counts {counts} (count = unknown)" + ) + return ids diff --git a/zonos3/dub/__init__.py b/zonos3/dub/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/zonos3/dub/plan.py b/zonos3/dub/plan.py new file mode 100644 index 0000000000000000000000000000000000000000..0991e63cf4bd4895bb4cc57506b3caab644e3372 --- /dev/null +++ b/zonos3/dub/plan.py @@ -0,0 +1,513 @@ +"""Pure planning logic of the LACI dubbing tool (stdlib + numpy only). + +Imported by the server process and by the alignment worker (which runs in a separate venv). +""" + +from __future__ import annotations + +import bisect +import math +import re +import unicodedata +from dataclasses import dataclass, field +from typing import Mapping + +import numpy as np + +from zonos3 import languages + +# code (Whisper's, as FuseAlign takes it) -> Qwen3-ASR language name +REF_LANGUAGES = {lang.code: lang.name for lang in languages.SPOKEN} +# code -> (label, zonos3 TTS language for text normalization) +TARGET_LANGUAGES = {lang.code: (lang.name, lang.tts) for lang in languages.SPOKEN if lang.tts} +UNSPACED = frozenset(lang.code for lang in languages.SPOKEN if lang.unspaced) +MAX_REF_SECONDS = 180.0 # the longest reference a dub takes +MIN_REF_SECONDS = 0.5 # qwen_asr MIN_ASR_INPUT_SECONDS +MAX_VIDEO_BYTES = 1 << 30 +DEFAULT_MIN_PAUSE_S = 0.30 +MIN_PAUSE_RANGE = (0.10, 2.00) +MAX_SEGMENTS = 120 +CANDIDATE_BUCKET_OFFSETS = (0, -1, 1, -2, 2) +CANDIDATE_SEEDS = 2 +PRE_PAD_S, POST_PAD_S, MIN_GAP_S, FADE_S = 0.04, 0.06, 0.05, 0.01 +VOICE_PROMPT_MAX_S = 20.0 +FRAME_RATE = 15.0 +BREAK_PUNCT = ",.;:!?…、。,;:!?" +WINDOW_MAX_WP = 510 # mBERT positions minus [CLS]/[SEP] +WINDOW_STRIDE_FRACTION = 0.75 +BAND_MIN_WP, BAND_FRACTION = 40, 0.2 +_CJK_BLOCKS = ( + (0x3040, 0x30FF), + (0x31F0, 0x31FF), + (0x3400, 0x4DBF), + (0x4E00, 0x9FFF), + (0xF900, 0xFAFF), + (0xFF66, 0xFF9F), +) +_TOKEN = re.compile(r"\S+") + + +@dataclass +class RefSegment: + ref_start: float + ref_end: float + text: str = "" + bucket: int | None = None # speaking-rate bucket set by the user; None = from the text's rate + + +def _wordy(ch: str) -> bool: + return unicodedata.category(ch)[0] in "LN" or ch == "'" + + +def _cjk(ch: str) -> bool: + o = ord(ch) + return any(lo <= o <= hi for lo, hi in _CJK_BLOCKS) + + +def text_units(text: str, lang: str) -> list[dict]: + """Split the target text into word units ``{"text", "start", "end"}`` (char offsets); trailing punctuation sticks to its unit.""" + spans: list[list[int]] = [] # [start, end) + lead: int | None = None # start of non-wordy chars seen before the first unit + + def attach(start: int, end: int) -> None: + nonlocal lead + if spans: + spans[-1][1] = end + elif lead is None: + lead = start + + if lang in UNSPACED: + run_end = -1 # end of the open run of non-CJK wordy chars + for i, ch in enumerate(text): + if ch.isspace(): + continue + if _wordy(ch): + if _cjk(ch): + spans.append([i, i + 1]) + run_end = -1 + elif run_end == i: + spans[-1][1] = i + 1 + run_end = i + 1 + else: + spans.append([i, i + 1]) + run_end = i + 1 + else: + attach(i, i + 1) + else: + for m in _TOKEN.finditer(text): + if any(_wordy(c) for c in m.group()): + spans.append([m.start(), m.end()]) + else: + attach(m.start(), m.end()) + if spans and lead is not None: + spans[0][0] = lead + return [{"text": text[a:b], "start": a, "end": b} for a, b in spans] + + +def unit_bytes(text: str, units: list[dict]) -> list[int]: + out = [] + for k, u in enumerate(units): + stop = units[k + 1]["start"] if k + 1 < len(units) else u["end"] + out.append(len(text[u["start"] : stop].encode())) + return out + + +def break_after(text: str, units: list[dict]) -> list[bool]: + return [text[u["end"] - 1] in BREAK_PUNCT for u in units] + + +def span_text(text: str, units: list[dict], a: int, b: int) -> str: + if a == b: + return "" + return text[units[a]["start"] : units[b - 1]["end"]] + + +def join_words(words: list[str], lang: str) -> str: + return ("" if lang in UNSPACED else " ").join(words) + + +def ref_segments(words: list[dict], min_pause: float) -> list[tuple[int, int]]: + """Half-open word ranges split at pauses >= ``min_pause``; zero-width words never start a segment.""" + if not words: + return [] + starts = [0] + prev_end: float | None = None + for j, w in enumerate(words): + if w["end"] - w["start"] < 0.001: + continue + if prev_end is not None and j > 0 and w["start"] - prev_end >= min_pause: + starts.append(j) + prev_end = w["end"] + return [(a, b) for a, b in zip(starts, starts[1:] + [len(words)])] + + +def project_segments( + ref_ranges: list[tuple[int, int]], + ref_spans: list[tuple[float, float]], + links, + unit_bytes: list[int], + break_after: list[bool], +) -> list[tuple[int, int]]: + """One contiguous target unit range per reference segment (monotonic, covering ``[0, m)``, may be empty).""" + n_seg, m = len(ref_ranges), len(unit_bytes) + if n_seg == 0: + return [] + if n_seg == 1: + return [(0, m)] + seg_of: dict[int, int] = {} + for k, (a, b) in enumerate(ref_ranges): + for i in range(a, b): + seg_of[i] = k + # cross[k, j]: links into target unit j whose reference word lies outside segment k + per_unit = np.zeros((n_seg, m), dtype=np.float64) + for i, j in links: + if 0 <= j < m and i in seg_of: + per_unit[:, j] += 1.0 + per_unit[seg_of[i], j] -= 1.0 + prefix = np.concatenate([np.zeros((n_seg, 1)), np.cumsum(per_unit, axis=1)], axis=1) + cum_bytes = np.concatenate([[0.0], np.cumsum(np.asarray(unit_bytes, dtype=np.float64))]) + total_bytes = float(cum_bytes[-1]) + durations = [max(0.0, e - s) for s, e in ref_spans] + total_dur = sum(durations) + pen = np.zeros(m + 1) + for b in range(1, m): + if not break_after[b - 1]: + pen[b] = 0.5 + + idx = np.arange(m + 1) + upper = idx[:, None] <= idx[None, :] # a <= b + inf = np.inf + f = np.full(m + 1, inf) + f[0] = 0.0 + back: list[np.ndarray] = [] + for k in range(n_seg): + cost = prefix[k][None, :] - prefix[k][:, None] + if total_bytes > 0 and total_dur > 0: + share = (cum_bytes[None, :] - cum_bytes[:, None]) / total_bytes + cost = cost + np.abs(share - durations[k] / total_dur) + total = f[:, None] + cost + total = np.where(upper, total, inf) + arg = np.argmin(total, axis=0) # first minimum: smallest a + g = total[arg, idx] + if k < n_seg - 1: + g = g + pen + back.append(arg) + f = g + bounds = [m] + b = m + for k in range(n_seg - 1, -1, -1): + b = int(back[k][b]) + bounds.append(b) + bounds.reverse() # b_0 .. b_K + return [(bounds[k], bounds[k + 1]) for k in range(n_seg)] + + +@dataclass(frozen=True) +class RateScale: + """The speaking-rate buckets a dub language plans in: the condition row's buckets 0..n-1 and, where measured safe + for the language, tempo-steered buckets below 0 / from n up (README "Extended speaking-rate buckets"). Bucket i, + ``first`` <= i <= ``last``, spans [edges[i - first - 1], edges[i - first]) in UTF-8 bytes / s; ``doses`` holds the + tempo dose of every steered bucket (the rate row unknown).""" + + edges: tuple[float, ...] + first: int = 0 + doses: Mapping[int, float] = field(default_factory=dict) + + @classmethod + def extended(cls, row_edges, below, above, doses: Mapping[int, float]) -> "RateScale": + """The row's scale plus the steered buckets of ``doses`` (contiguous from the row): ``below[k]`` is the + nominal lower edge of bucket -k, ``above[k]`` the upper edge of bucket n - 1 + k.""" + n = len(row_edges) + 1 + lo = min((b for b in doses if b < 0), default=0) + hi = max((b for b in doses if b >= n), default=n - 1) + if set(doses) != set(range(lo, 0)) | set(range(n, hi + 1)): + raise ValueError(f"steered buckets {sorted(doses)} are not contiguous from the row's 0..{n - 1}") + if -lo > len(below) or hi - n + 1 > len(above): + raise ValueError(f"steered buckets {lo}..{hi} have no nominal edges") + edges = (*reversed(below[:-lo]), *row_edges, *above[: hi - n + 1]) + return cls(tuple(float(e) for e in edges), lo, {int(b): float(d) for b, d in doses.items()}) + + @property + def last(self) -> int: + return self.first + len(self.edges) + + def bucket(self, rate: float) -> int: + """The bucket of a rate.""" + return self.first + bisect.bisect_right(self.edges, rate) + + def rate(self, bucket: int) -> float: + """Nominal rate of a bucket: its midpoint; the open end buckets extend by half a neighbour (laci.RateBuckets).""" + e, i = self.edges, bucket - self.first + if i <= 0: + return e[0] - (e[1] - e[0]) / 2 + if i >= len(e): + return e[-1] + (e[-1] - e[-2]) / 2 + return (e[i - 1] + e[i]) / 2 + + +def candidate_plan(bucket: int, scale: RateScale, seed: int, segment_index: int) -> list[dict]: + out, used = [], set() + for oi, offset in enumerate(CANDIDATE_BUCKET_OFFSETS): + b = bucket + offset + if not scale.first <= b <= scale.last or b in used: + continue + used.add(b) + for r in range(CANDIDATE_SEEDS): + out.append({"bucket": b, "offset": offset, "seed": seed + 100 * segment_index + 10 * oi + r}) + return out + + +def pinned_candidate_plan(bucket: int, seed: int, segment_index: int) -> list[dict]: + """Candidates of a segment whose bucket the user set: the full count of an automatic plan, all in ``bucket``, + told apart by seed only.""" + n = len(CANDIDATE_BUCKET_OFFSETS) * CANDIDATE_SEEDS + return [{"bucket": bucket, "offset": 0, "seed": seed + 100 * segment_index + r} for r in range(n)] + + +def max_tokens_for(duration_s: float) -> int: + return min(9000, math.ceil(FRAME_RATE * (2.0 * duration_s + 3.0))) + + +def voice_prompt_span(segments, duration: float) -> tuple[float, float]: + start = max(0.0, segments[0].ref_start - 0.1) + end = None + for seg in segments: + cand = seg.ref_end + 0.1 + if cand - start <= VOICE_PROMPT_MAX_S and (end is None or cand > end): + end = cand + if end is None: + end = start + VOICE_PROMPT_MAX_S + return min(start, duration), min(end, duration) + + +def speech_span(items: list[dict], regions: list[list[float]] | None = None) -> tuple[float, float] | None: + """First start to last end of the take's aligned words (FuseAlign's unplaced ones, ``placed`` false, only carry + fallback times and are skipped); without any, from the first to the last of its VAD speech ``regions`` (the + FuseAlign worker's ``speech``); None without either.""" + spans = [(it["start"], it["end"]) for it in items if it.get("placed", True) and it["end"] > it["start"]] + if spans: + return min(s for s, _ in spans), max(e for _, e in spans) + if regions: + return float(regions[0][0]), float(regions[-1][1]) + return None + + +def candidate_score(c: dict | None, ref_dur: float, room: float) -> float | None: + if c is None or c["speech_s"] <= 0: + return None + score = abs(math.log(c["speech_s"] / ref_dur)) + if c["speech_s"] > room: + score += 0.5 + if c["capped"]: + score += 1.0 + if c["end"] == "max_tokens": + score += 1.0 + return score + + +def choose_candidate(cands: list[dict | None], ref_dur: float, room: float) -> int | None: + best, best_score = None, None + for i, c in enumerate(cands): + s = candidate_score(c, ref_dur, room) + if s is not None and (best_score is None or s < best_score): + best, best_score = i, s + return best + + +def place_segments(items: list[dict], ref_duration: float) -> tuple[list[dict], float]: + placed, prev_end, timeline = [], -math.inf, ref_duration + for it in items: + s0, s1 = it["s0"], it["s1"] + crop_start = max(0.0, s0 - PRE_PAD_S) + crop_end = min(it["take_len"], s1 + POST_PAD_S) + speech_start = max(it["ref_start"], prev_end + MIN_GAP_S) + speech_end = speech_start + (s1 - s0) + place_start = speech_start - (s0 - crop_start) + if place_start < 0: + crop_start += -place_start + place_start = 0.0 + prev_end = speech_end + timeline = max(timeline, place_start + crop_end - crop_start) + placed.append( + { + "crop_start": crop_start, + "crop_end": crop_end, + "place_start": place_start, + "speech_start": speech_start, + "speech_end": speech_end, + "shift": speech_start - it["ref_start"], + "start_error": speech_start - it["ref_start"], + "end_error": speech_end - it["ref_end"], + "duration_error": (s1 - s0) - (it["ref_end"] - it["ref_start"]), + } + ) + return placed, timeline + + +def word_windows(counts: list[int]) -> list[tuple[int, int]]: + n = len(counts) + if any(c > WINDOW_MAX_WP for c in counts): + raise ValueError(f"a word exceeds {WINDOW_MAX_WP} wordpieces") + windows, s = [], 0 + while n: + e, total = s, 0 + while e < n and total + counts[e] <= WINDOW_MAX_WP: + total += counts[e] + e += 1 + windows.append((s, e)) + if e == n: + break + s += max(1, int((e - s) * WINDOW_STRIDE_FRACTION)) + return windows + + +def window_of_words(windows: list[tuple[int, int]], n: int) -> list[int]: + owner, best = [0] * n, [-1] * n + for wi, (s, e) in enumerate(windows): + for w in range(s, e): + margin = min(w - s, e - 1 - w) + if margin > best[w]: + best[w], owner[w] = margin, wi + return owner + + +def band_mask(w1: int, w2: int) -> np.ndarray: + p = np.arange(w1, dtype=np.float64)[:, None] + q = np.arange(w2, dtype=np.float64)[None, :] + return np.abs(p * w2 / w1 - q) <= max(BAND_MIN_WP, BAND_FRACTION * w2) + + +@dataclass +class LipMap: + """AV-sync's time warp of a dub: at output time ``out_t[i]`` the warped dub plays the dub's time ``src_t[i]`` + (seconds, both increasing). Outside ``[out_t[0], out_t[-1]]`` (the face track) the offset of the nearer end holds, + so the warp is continuous over the whole dub.""" + + out_t: np.ndarray + src_t: np.ndarray + + @classmethod + def from_frames(cls, start: float, rate: float, src_frames) -> "LipMap": + """AV-sync's warp: the source frame of each output frame (``rate`` frames / s) of a span starting at ``start``. + The source times are made strictly increasing (the inverse needs it).""" + src = np.maximum.accumulate(np.asarray(src_frames, dtype=np.float64)) / rate + out = np.arange(len(src), dtype=np.float64) / rate + src = src + np.arange(len(src)) * 1e-9 + return cls(start + out, start + src) + + @staticmethod + def _map(t, xp, fp): + t = np.asarray(t, dtype=np.float64) + inside = np.interp(t, xp, fp) + return np.where(t < xp[0], t + (fp[0] - xp[0]), np.where(t > xp[-1], t + (fp[-1] - xp[-1]), inside)) + + def src_time(self, t): + """Dub time played at output time ``t``.""" + return self._map(t, self.out_t, self.src_t) + + def out_time(self, t): + """Output time at which the dub's time ``t`` plays.""" + return self._map(t, self.src_t, self.out_t) + + def shifts(self) -> np.ndarray: + """How far the warp moves the dub over the face track (seconds, + = later).""" + return self.out_t - self.src_t + + +# Local time scale of the lip-sync warp is measured over this span (about a phone); it is capped at LIP_SCALE_MAX +# either way (a warp that stands the dub still, or skips over it, reads as the cap). +LIP_SCALE_WINDOW_S = 0.05 +LIP_SCALE_MAX = 10.0 + +# Bounds of the lip-sync warp the server applies (guard_lip_frames): local playback rate and shift. +LIP_GUARD_MAX_RATE = 1.5 +LIP_GUARD_MAX_SHIFT_S = 0.4 +# The warp is kept only when it lowers the dub's mean SyncNet distance to the lips by more than this. +LIP_MIN_SYNC_GAIN = 0.0 + + +def guard_lip_frames(src_frames, rate: float, max_rate: float, max_shift_s: float) -> np.ndarray: + """Bound AV-sync's warp (``src_frames``: the dub frame, from the face track's start, each output frame of the track + plays; ``rate`` frames / s) so it cannot wreck the dub: every shift within ``max_shift_s``, no advance at the track's + first frame (before the track the warp holds that offset, so an advance there would play the dub's first words + before t = 0 and drop them), and the local playback rate within [1 / max_rate, max_rate]. A cross-language dub's + mouth shapes do not match the video's, and the unbounded DP path then stands the dub still (10x stretch) or skips + whole words. Shift bounds and rate bounds alternate; the last pass enforces the rate, the shift bound holds to + within the slack the rate bound needs.""" + src = np.maximum.accumulate(np.asarray(src_frames, dtype=np.float64)) + idx = np.arange(len(src), dtype=np.float64) + s = max_shift_s * rate + lo, hi = idx - s, idx + s + hi[0] = min(hi[0], 0.0) + lo_step, hi_step = 1.0 / max_rate, float(max_rate) + for _ in range(4): + src = np.clip(src, lo, hi) + for i in range(1, len(src)): + src[i] = min(max(src[i], src[i - 1] + lo_step), src[i - 1] + hi_step) + return src + + +def lip_warp(m: LipMap, src_start: float, src_end: float) -> dict: + """How much the lip-sync warp stretches and squeezes the dub's ``[src_start, src_end]`` (unwarped seconds). + + The local time scale s(t) = d out / d src over LIP_SCALE_WINDOW_S around output time t is > 1 where the dub is + stretched (played slower, longer) and < 1 where it is squeezed (played faster). Returns factors, 1 = untouched: + ``lip_scale`` (warped / unwarped length of the span), ``lip_stretch`` (largest s, >= 1), ``lip_squeeze`` + (largest 1 / s, >= 1: 1.25 plays 25 % faster) and ``lip_warp`` (geometric mean of max(s, 1 / s)). + """ + a, b = float(m.out_time(src_start)), float(m.out_time(src_end)) + if src_end - src_start < 1e-6 or b - a < 1e-6: + return {"lip_scale": 1.0, "lip_stretch": 1.0, "lip_squeeze": 1.0, "lip_warp": 1.0} + t = np.linspace(a, b, max(2, int((b - a) / 0.01) + 1)) + h = LIP_SCALE_WINDOW_S / 2 + scale = 2 * h / np.maximum(m.src_time(t + h) - m.src_time(t - h), 1e-9) + log_scale = np.log(np.clip(scale, 1 / LIP_SCALE_MAX, LIP_SCALE_MAX)) + return { + "lip_scale": (b - a) / (src_end - src_start), + "lip_stretch": float(np.exp(max(0.0, log_scale.max()))), + "lip_squeeze": float(np.exp(max(0.0, -log_scale.min()))), + "lip_warp": float(np.exp(np.abs(log_scale).mean())), + } + + +# WSOLA (waveform-similarity overlap-add, Verhelst & Roelands 1993) at 44.1 kHz: 23 ms Hann frames at 50 % overlap, +# each taken from within ±11.6 ms (one pitch period down to 86 Hz) of its nominal source position. +WSOLA_WINDOW = 1024 +WSOLA_TOLERANCE = 512 +# Correlation given up per tolerance of distance from the nominal position: of near-equal matches (a periodic voiced +# frame matches one pitch period apart too) the nearest wins, so the output does not drift from the map. +WSOLA_DRIFT_PENALTY = 0.05 + + +def wsola(x: np.ndarray, src_of, n_out: int, window: int = WSOLA_WINDOW, tolerance: int = WSOLA_TOLERANCE) -> np.ndarray: + """Time-warp ``x`` (1-D) without changing its pitch: output sample ``t`` plays about source sample ``src_of(t)``. + + ``src_of`` maps an array of output sample positions to source sample positions (any increasing map). Output frame + k is centred at ``k * hop`` (hop = window / 2); its source frame is the one within ``tolerance`` of + ``src_of(k * hop)`` that best continues the previous source frame (normalized cross-correlation with that frame's + natural continuation, less WSOLA_DRIFT_PENALTY per tolerance of distance), so the overlap-add stays phase-coherent. + A map of slope 1 reproduces the shifted input. + """ + x = np.asarray(x, dtype=np.float64) + hop, half = window // 2, window // 2 + win = np.hanning(window + 1)[:window] # periodic Hann: copies at 50 % overlap sum to 1 + pad = half + tolerance + hop + xp = np.concatenate([np.zeros(pad), x, np.zeros(pad)]) + n_frames = n_out // hop + 2 + nominal = np.rint(np.clip(np.asarray(src_of(np.arange(n_frames) * hop), dtype=np.float64), 0, len(x))).astype(int) + pad + size = 1 << int(math.ceil(math.log2(2 * window + 2 * tolerance))) + y = np.zeros(n_frames * hop + window) + penalty = WSOLA_DRIFT_PENALTY * np.abs(np.arange(2 * tolerance + 1) - tolerance) / max(tolerance, 1) + prev = None + for k, c in enumerate(nominal): + if prev is not None: + natural = xp[prev + hop - half : prev + hop + half] + region = xp[c - tolerance - half : c + tolerance + half] + corr = np.fft.irfft(np.fft.rfft(region, size) * np.conj(np.fft.rfft(natural, size)), size)[: 2 * tolerance + 1] + energy = np.cumsum(np.concatenate([[0.0], region * region])) + energy = energy[window:] - energy[:-window] + score = corr / np.sqrt(energy * float(natural @ natural) + 1e-12) + c = c - tolerance + int(np.argmax(score - penalty)) + y[k * hop : k * hop + window] += win * xp[c - half : c + half] + prev = c + return y[half : half + n_out] diff --git a/zonos3/dub/runtime.py b/zonos3/dub/runtime.py new file mode 100644 index 0000000000000000000000000000000000000000..9aa36824b0aeb8dfbdf18dd50f0a3e2567fe34a6 --- /dev/null +++ b/zonos3/dub/runtime.py @@ -0,0 +1,1029 @@ +"""Dubbing in the Python studio servers (``/v2/dub/*`` of zonos3_sgl and zonos3_mlx). + +``DubRuntime`` keeps the uploaded references and the generated dubs, runs the dubbing worker +(zonos3/workers/dub_align.py in .venv-asr: SimAlign, AV-sync), transcribes with the server's ASR worker +(zonos3.tts.edit_align.AsrWorker: Qwen3-ASR), aligns words with the server's FuseAlign worker +(zonos3.tts.edit_align.FuseAlignWorker; zonos3.tts.edit_align.align_words, with Qwen3-ASR anchors past 30 s) and plans, +picks and places the takes (zonos3.dub.plan). The takes are synthesized by the server's scheduler through the ``synthesize`` +callable the server hands in: the /v2/generate request path with laci=true and each take's LACI duration target +(zonos3.tts.laci.DurationTarget), so a dub take can use any studio voice and any steering control. The worker starts +on first use and again after it died; its calls run in threads, so nothing here blocks the server's event loop. +""" + +from __future__ import annotations + +import asyncio +import base64 +import collections +import copy +import io +import json +import logging +import math +import os +import re +import subprocess +import tempfile +import threading +import time +import uuid +from collections import OrderedDict +from dataclasses import dataclass, field +from pathlib import Path +from typing import Awaitable, Callable, Mapping + +import numpy as np +import soundfile as sf + +import zonos3 +import zonos3.workers +from zonos3.dub import plan as P +from zonos3.generation import SAMPLE_RATE +from zonos3.tts.align_text import align_tokens +from zonos3.tts.edit_align import ( + AsrWorker, + FuseAlignWorker, + WorkerError, + align_words, + asr_python, + transcribe_audio, +) + +logger = logging.getLogger("zonos3.dub") +DUB_ROOT = Path(__file__).resolve().parents[4] # the repo root +WORD_ALIGNER_MODEL = "google-bert/bert-base-multilingual-cased" +STORE_CAPACITY = 8 +VOICE_MODES = ("source", "studio") +MAX_REF_WORDS = 20000 +# Pronunciation groups (U+E000 IPA U+E001, phoneme-token checkpoints) in a target text: the TTS reads them, the forced +# aligner gets their IPA, the rate counts their symbols in letter-equivalents (zonos3.tts.edit_align.token_chars). +_GROUP_RE = re.compile("(\ue000[^\ue000\ue001]*\ue001)") + + +class AlignWorkerError(RuntimeError): + pass + + +class UnknownId(LookupError): + """A ref_id / dub_id the store no longer holds (HTTP 404).""" + + +class AlignWorker: + """One zonos3/workers/dub_align.py process (the .venv-asr interpreter); ``call`` is thread-safe.""" + + def __init__(self, python: str, device: str, word_aligner_model: str, avsync_home: str | None): + self.script = Path(zonos3.workers.__file__).parent / "dub_align.py" + if not Path(python).is_file(): + raise AlignWorkerError(f"alignment interpreter not found: {python} (run tools/setup_asr_env.sh)") + env = {k: v for k, v in os.environ.items() if k not in ("PYTHONPATH", "VIRTUAL_ENV")} + env["PYTHONPATH"] = str(Path(zonos3.__file__).resolve().parents[1]) # model/src + env["PYTHONDONTWRITEBYTECODE"] = "1" + env.setdefault("HF_HUB_OFFLINE", "1") + cmd = [ + python, + str(self.script), + "--device", + device, + "--word-aligner-model", + word_aligner_model, + ] + if avsync_home: + cmd += ["--avsync-home", avsync_home] + self._process = subprocess.Popen(cmd, env=env, stdin=subprocess.PIPE, stdout=subprocess.PIPE, text=True) + self._lock = threading.Lock() + self._next_id = 0 + + @property + def alive(self) -> bool: + return self._process.poll() is None + + def call(self, op: str, **payload) -> dict: + with self._lock: + self._next_id += 1 + request = {"id": self._next_id, "op": op, **payload} + try: + self._process.stdin.write(json.dumps(request) + "\n") + self._process.stdin.flush() + except (BrokenPipeError, OSError): + raise AlignWorkerError(f"alignment worker exited with code {self._process.wait()}") from None + line = self._process.stdout.readline() + if not line: + raise AlignWorkerError(f"alignment worker exited with code {self._process.wait()}") + resp = json.loads(line) + if resp.get("status") != "ok": + if resp.get("invalid"): # the input is at fault (e.g. no face in the video): HTTP 400 + raise ValueError(resp.get("message") or resp.get("error")) + raise AlignWorkerError(resp.get("error", "unknown error")) + return resp + + def close(self) -> None: + if self.alive: + self._process.stdin.close() + self._process.wait() + + +@dataclass(frozen=True) +class WorkerSettings: + """Where the dubbing worker and AV-sync live, and its word aligner. Defaults: the ASR worker's interpreter + (``ZONOS3_ASR_PYTHON``, else the repo's .venv-asr) and the repo's .avsync (tools/setup_asr_env.sh); + ZONOS3_DUB_AVSYNC_HOME / ZONOS3_ASR_DEVICE override the AV-sync checkout and the device.""" + + python: str = str(DUB_ROOT / ".venv-asr" / "bin" / "python") + avsync_home: str = str(DUB_ROOT / ".avsync") + device: str = "cuda" + word_aligner_model: str = WORD_ALIGNER_MODEL + + @classmethod + def from_env(cls) -> "WorkerSettings": + d = cls() + return cls( + python=asr_python(), + avsync_home=os.environ.get("ZONOS3_DUB_AVSYNC_HOME") or d.avsync_home, + device=os.environ.get("ZONOS3_ASR_DEVICE") or d.device, + ) + + @property + def installed(self) -> bool: + return Path(self.python).is_file() + + @property + def avsync_ready(self) -> bool: + data = Path(self.avsync_home) / "data" # zonos3/workers/dub_avsync.models_present + return (data / "syncnet_v2.model").is_file() and (data / "sfd_face.pth").is_file() + + +@dataclass(frozen=True) +class DubModel: + """What the dub needs to know of the served checkpoint and server.""" + + name: str + rate_edges: tuple[float, ...] # speaking-rate condition-row bucket edges (UTF-8 bytes / s) + n_buckets: int + laci_languages: frozenset[str] # TTS language codes with LACI alignment heads (--laci-heads) + studio_voices: bool # speaker-embedding checkpoint: studio voices (speaker_mode=embedding) + source_voice: bool # raw-reference checkpoint: the reference speaker is cloned from its audio + raw_controls: frozenset[str] = field(default_factory=frozenset) # steering ids that move the speaker embedding + phoneme_groups: bool = False + # voice mode ("source" / "studio") -> TTS language -> its speaking-rate scale when it has tempo-steered buckets past + # the row (the steering bundle's rate_extension; source voices only on the sides it lists); otherwise the row's + rate_scales: Mapping[str, Mapping[str, P.RateScale]] = field(default_factory=dict) + + +def rate_scales(extension, row_edges) -> dict[str, dict[str, P.RateScale]]: + """Voice mode ("studio" / "source") -> TTS language -> its speaking-rate scale with the tempo-steered buckets of the + steering bundle's ``extension`` (zonos3.tts.steering.RateExtension; README "Extended speaking-rate buckets"; source + voices, in reference mode, only on its reference_sides): ``DubModel.rate_scales``. Empty without an extension, or + when it was measured against other row edges than the checkpoint's ``row_edges``.""" + if extension is None: + return {} + edges = tuple(float(e) for e in row_edges) + if len(extension.row_edges) != len(edges) or not np.allclose(extension.row_edges, edges, rtol=0, atol=1e-6): + logger.warning("steering bundle rate_extension was measured on speaking-rate edges %s, the checkpoint has %s: " + "dubs plan in the row buckets only", list(extension.row_edges), list(edges)) + return {} + source = {lang: {b: d for b, d in doses.items() if ("slower" if b < 0 else "faster") in extension.reference_sides} + for lang, doses in extension.doses.items()} + return {mode: {lang: P.RateScale.extended(edges, extension.below, extension.above, doses) + for lang, doses in by_lang.items() if doses} + for mode, by_lang in (("studio", extension.doses), ("source", source))} + + +# Take synthesis (the server's): jobs -> per job (float32 audio at SAMPLE_RATE, or None for no audio; LACI record). +Synthesize = Callable[[list[dict], "str | None"], Awaitable[list[tuple["np.ndarray | None", dict]]]] +# Reference codes of a voice prompt (the server's codec): (mono float32 audio, sample rate) -> [[code] * C] * frames. +EncodeVoice = Callable[[np.ndarray, int], Awaitable[list[list[int]]]] + + +class _Store: + """Small LRU of uploaded references / generated dubs.""" + + def __init__(self, capacity: int = STORE_CAPACITY): + self._items: OrderedDict[str, dict] = OrderedDict() + self._lock = threading.Lock() + self._capacity = capacity + + def put(self, value: dict) -> str: + key = uuid.uuid4().hex + with self._lock: + self._items[key] = value + while len(self._items) > self._capacity: + self._items.popitem(last=False) + return key + + def get(self, key: str) -> dict: + with self._lock: + value = self._items.get(key) + if value is None: + raise UnknownId(key) + self._items.move_to_end(key) + return value + + +def _mean(xs: list[float]) -> float: + return float(sum(xs) / len(xs)) if xs else 0.0 + + +# ---------------------------------------------------------------------------------------------------- request shapes + + +def merge_controls(*maps: Mapping | None, where: str = "controls") -> dict[str, float] | None: + """Steering doses summed per control id (the voice's, then the segment's: as /v2/edit's region_controls), zero + doses dropped; None when nothing is left.""" + out: dict[str, float] = {} + for m in maps: + if m is None: + continue + if not isinstance(m, Mapping): + raise ValueError(f"{where}: controls must map control ids to doses") + for did, dose in m.items(): + try: + value = float(dose) + except (TypeError, ValueError): + raise ValueError(f"{where}: dose of {did!r} must be a number") from None + if not math.isfinite(value): + raise ValueError(f"{where}: dose of {did!r} must be finite") + out[str(did)] = out.get(str(did), 0.0) + value + out = {did: v for did, v in out.items() if v != 0.0} + return out or None + + +def normalize_voice(raw: Mapping | None, where: str) -> dict | None: + """A request's voice: None (inherit), ``{"mode": "source", "controls"?}`` (clone the reference speaker from its + own audio) or ``{"mode": "studio", "speaker_embedding_id", "controls"?}`` (a studio library / saved voice in + embedding mode with Cast-bench steering).""" + if raw is None: + return None + if not isinstance(raw, Mapping): + raise ValueError(f"{where}: voice must be an object") + unknown = sorted(set(raw) - {"mode", "speaker_embedding_id", "controls"}) + if unknown: + raise ValueError(f"{where}: unknown voice field(s) {unknown}") + mode = raw.get("mode") or "source" + controls = merge_controls(raw.get("controls"), where=f"{where}.controls") + if mode == "source": + if raw.get("speaker_embedding_id") is not None: + raise ValueError(f"{where}: a source voice clones the reference; speaker_embedding_id needs mode 'studio'") + return {"mode": "source", "controls": controls} + if mode == "studio": + sid = raw.get("speaker_embedding_id") + if not isinstance(sid, str) or not sid.strip(): + raise ValueError(f"{where}: a studio voice needs speaker_embedding_id") + return {"mode": "studio", "speaker_embedding_id": sid.strip(), "controls": controls} + raise ValueError(f"{where}: voice mode must be one of {list(VOICE_MODES)}") + + +def normalize_ref_words(raw, duration: float) -> list[dict]: + """Word timings the caller already has (``/v2/dub/analyze`` ``ref_words``): ``[{word, start, end}]`` in time order, + inside the reference.""" + if not isinstance(raw, list) or not raw: + raise ValueError("ref_words must be a non-empty list of {word, start, end}") + if len(raw) > MAX_REF_WORDS: + raise ValueError(f"ref_words: at most {MAX_REF_WORDS} words") + words, prev = [], 0.0 + for k, w in enumerate(raw): + if not isinstance(w, Mapping): + raise ValueError(f"ref_words[{k}] must be an object {{word, start, end}}") + text = str(w.get("word") or "").strip() + try: + start, end = float(w["start"]), float(w["end"]) + except (KeyError, TypeError, ValueError): + raise ValueError(f"ref_words[{k}]: start and end must be numbers (seconds)") from None + if not text: + raise ValueError(f"ref_words[{k}]: empty word") + if not (math.isfinite(start) and math.isfinite(end) and 0.0 <= start <= end <= duration + 0.05): + raise ValueError(f"ref_words[{k}]: need 0 <= start <= end <= {duration:.2f}") + if start < prev - 1e-6: + raise ValueError(f"ref_words[{k}]: words must be in time order") + prev = start + words.append({"word": text, "start": start, "end": end}) + return words + + +def spoken_text(text: str) -> str: + """The text the forced aligner reads: nonverbal markup removed (its enclosed words kept), each pronunciation + group by its IPA.""" + from zonos3.tts.markup import strip_nonverbal_markup + + return _GROUP_RE.sub(lambda m: m.group(0)[1:-1], strip_nonverbal_markup(text)) + + +def text_bytes(text: str) -> int: + """UTF-8 bytes of a target text for its speaking rate; a pronunciation group counts its IPA symbols in + letter-equivalents (zonos3.tts.edit_align.token_chars), nonverbal markers count nothing (their enclosed words + do).""" + from zonos3.tts.edit_align import token_chars + from zonos3.tts.markup import strip_nonverbal_markup + + return int(round(sum(token_chars(p) if p.startswith("\ue000") else len(p.encode()) + for p in _GROUP_RE.split(strip_nonverbal_markup(text)) if p))) + + +def decode_upload(path: str) -> tuple[np.ndarray, int]: + """Mono float32 audio of an uploaded file: a sound file, or the first audio stream of a video (ffmpeg).""" + try: + data, sr = sf.read(path, dtype="float32", always_2d=True) + except Exception: # noqa: BLE001 - not a sound file: try it as a video + with tempfile.TemporaryDirectory(prefix="dub-") as tmp: + wav = Path(tmp) / "audio.wav" + proc = subprocess.run( + ["ffmpeg", "-hide_banner", "-loglevel", "error", "-y", "-i", path, "-vn", "-map", "0:a:0", + "-ac", "1", "-ar", str(SAMPLE_RATE), "-c:a", "pcm_f32le", str(wav)], + capture_output=True, text=True, + ) + if proc.returncode != 0: + raise ValueError(f"upload an audio file or a video with an audio track ({proc.stderr.strip()[-200:]})") + data, sr = sf.read(str(wav), dtype="float32", always_2d=True) + return np.ascontiguousarray(data.mean(axis=1), dtype=np.float32), int(sr) + + +class DubRuntime: + def __init__(self, model: DubModel, synthesize: Synthesize, encode_voice: EncodeVoice, asr: AsrWorker, + aligner: FuseAlignWorker, worker: WorkerSettings | None = None): + self.model = model + self.synthesize = synthesize + self.encode_voice = encode_voice + # the server's ASR and FuseAlign workers (shared with speech editing; the server closes them) + self.asr = asr + self.aligner = aligner + self.settings = worker or WorkerSettings.from_env() + self.rate_edges = [float(x) for x in model.rate_edges] + self.n_buckets = int(model.n_buckets) + self.row_scale = P.RateScale(tuple(self.rate_edges)) + self._worker: AlignWorker | None = None + self._worker_lock = threading.Lock() # the worker is called from several request threads + self.refs, self.dubs = _Store(), _Store() + + # ---- alignment worker ------------------------------------------------------------------------------------- + + def _ensure_worker(self) -> AlignWorker: + with self._worker_lock: + if self._worker is not None and self._worker.alive: + return self._worker + s = self.settings + self._worker = AlignWorker(s.python, s.device, s.word_aligner_model, + s.avsync_home if s.avsync_ready else None) + return self._worker + + def _call_sync(self, op: str, **payload) -> dict: + return self._ensure_worker().call(op, **payload) + + async def _call(self, op: str, **payload) -> dict: + return await asyncio.to_thread(self._call_sync, op, **payload) + + def close(self) -> None: + if self._worker is not None: + self._worker.close() + + def rate_scale(self, target_lang: str, voice_mode: str) -> P.RateScale: + """The speaking-rate buckets of a dub target language for a voice mode: the row's, extended by its steered + buckets.""" + return self.model.rate_scales.get(voice_mode, {}).get(P.TARGET_LANGUAGES[target_lang][1], self.row_scale) + + def voice_modes(self) -> list[str]: + m = self.model + return [v for v, ok in (("source", m.source_voice), ("studio", m.studio_voices)) if ok] + + def buckets(self, laci: list[str]) -> list[dict]: + """Every bucket of the target languages' scales: index, label, nominal rate (UTF-8 bytes / s: its midpoint) + and edges ``low`` / ``high`` on the scale that has it furthest from its ends (the scales share their edges; + None: open below / above on every scale; a language's own lowest / highest bucket is open below / above), + steered, the target languages and voice modes that have it and, for a steered one, its tempo dose per + language.""" + if not self.rate_edges: + return [] + scales = {(v, c): self.rate_scale(c, v) for v in self.voice_modes() for c in laci} or {("", ""): self.row_scale} + out = [] + for b in range(min(s.first for s in scales.values()), max(s.last for s in scales.values()) + 1): + having = {vc: s for vc, s in scales.items() if s.first <= b <= s.last} + inner = max(having.values(), key=lambda s: min(b - s.first, s.last - b)) + i = b - inner.first + steered = not 0 <= b < self.n_buckets + entry = {"index": b, "label": str(b), "rate": inner.rate(b), + "low": inner.edges[i - 1] if i > 0 else None, "high": inner.edges[i] if i < len(inner.edges) else None, + "steered": steered, "languages": sorted({c for _, c in having if c}), + "voice_modes": sorted({v for v, _ in having if v})} + if steered: + entry["doses"] = {c: s.doses[b] for (_, c), s in sorted(having.items())} + out.append(entry) + return out + + def capabilities(self) -> dict: + """The dub's capabilities; blocks on the ASR and FuseAlign workers' pings (they start the workers), so run it + in a thread. A worker that is unavailable reports its model as "" and the dub as unavailable.""" + m = self.model + laci = sorted(c for c, (_, tts) in P.TARGET_LANGUAGES.items() if tts in m.laci_languages) + try: + asr_model = self.asr.model() + except WorkerError: + asr_model = "" + try: + aligner_model = self.aligner.model() + except WorkerError: + aligner_model = "" + return { + "available": (self.settings.installed and bool(asr_model) and bool(aligner_model) and bool(laci) + and bool(self.rate_edges)), + "ref_languages": [{"code": c, "name": n} for c, n in P.REF_LANGUAGES.items()], + "target_languages": [{"code": c, "label": v[0], "tts_language": v[1]} for c, v in P.TARGET_LANGUAGES.items() + if c in laci], + "max_ref_seconds": P.MAX_REF_SECONDS, + "max_video_bytes": P.MAX_VIDEO_BYTES, + "max_segments": P.MAX_SEGMENTS, + "default_min_pause_s": P.DEFAULT_MIN_PAUSE_S, + "min_pause_range": list(P.MIN_PAUSE_RANGE), + "sample_rate": SAMPLE_RATE, + "frame_rate": P.FRAME_RATE, + "rate_edges": self.rate_edges, + "n_buckets": self.n_buckets, + "buckets": self.buckets(laci), + "candidate_bucket_offsets": list(P.CANDIDATE_BUCKET_OFFSETS), + "candidate_seeds": P.CANDIDATE_SEEDS, + "model": m.name, + "asr_model": asr_model, + "aligner_model": aligner_model, + "word_aligner": self.settings.word_aligner_model, + "align_worker": {"installed": self.settings.installed, + "running": self._worker is not None and self._worker.alive}, + "lipsync": self.settings.installed and self.settings.avsync_ready, + "voice_modes": self.voice_modes(), + "segment_controls": True, + "phoneme_groups": m.phoneme_groups, + "ref_words": True, + } + + # ---- references ------------------------------------------------------------------------------------------- + + def add_ref(self, path: str) -> dict: + """A reference from an uploaded sound file or a video's audio track (runs in a request thread), with where its + speech is: the FuseAlign worker's VAD regions.""" + audio, sr = decode_upload(path) + duration = len(audio) / sr + if not P.MIN_REF_SECONDS <= duration <= P.MAX_REF_SECONDS: + raise ValueError(f"reference must be {P.MIN_REF_SECONDS}–{P.MAX_REF_SECONDS:g} s, got {duration:.1f} s") + with tempfile.TemporaryDirectory(prefix="dub-") as tmp: + wav = Path(tmp) / "ref.wav" + self._write_wav(wav, audio, sr) + regions = self.aligner.speech([str(wav)])[0] + ref_id = self.refs.put({"audio": audio, "sr": sr, "duration": duration}) + return {"ref_id": ref_id, "duration": duration, "sample_rate": sr, "speech_regions": regions} + + @staticmethod + def _write_wav(path: Path, audio: np.ndarray, sr: int) -> None: + sf.write(str(path), audio, sr, subtype="FLOAT") + + def _check_ref_lang(self, ref_lang: str | None) -> None: + if ref_lang is not None and ref_lang not in P.REF_LANGUAGES: + raise ValueError(f"unsupported reference language: {ref_lang}") + + async def _align(self, items: list[dict]) -> list[list[dict]]: + """FuseAlign forced alignment of ``[{audio, text, language, utterances?}]`` (``language`` a REF_LANGUAGES + code; ``utterances`` the long-form anchors of a transcript of the audio) -> per item one ``{word, start, end, + presence, placed}`` per ``align_tokens`` token of the text (an unplaced word keeps FuseAlign's fallback times). + Long-form items get Qwen3-ASR anchors (``align_words``).""" + reqs = [{"audio": it["audio"], "tokens": align_tokens(it["text"], it["language"]), + "language": P.REF_LANGUAGES.get(it["language"]), "utterances": it.get("utterances")} for it in items] + return await asyncio.to_thread(align_words, self.asr, self.aligner, reqs) + + async def transcribe(self, ref_id: str, ref_lang: str | None) -> dict: + """Qwen3-ASR transcript of the reference (``transcribe_audio``: chunk-wise past 30 s) and its words (FuseAlign, + anchored by the transcript's chunks) in the given language, else the detected one: Qwen3-ASR's (past 30 s the + first spoken chunk's), its first name when it reports several.""" + ref = self.refs.get(ref_id) + self._check_ref_lang(ref_lang) + with tempfile.TemporaryDirectory(prefix="dub-") as tmp: + wav = Path(tmp) / "ref.wav" + self._write_wav(wav, ref["audio"], ref["sr"]) + out = await asyncio.to_thread(transcribe_audio, self.asr, self.aligner, str(wav), + P.REF_LANGUAGES[ref_lang] if ref_lang else None) + name = out.language.split(",")[0].strip() + by_name = {n: c for c, n in P.REF_LANGUAGES.items()} + lang, text = ref_lang or by_name.get(name), out.text.strip() + words = [] + if lang and text: + items = (await self._align([{"audio": str(wav), "text": text, "language": lang, + "utterances": out.utterances}]))[0] + words = [{"word": it["word"], "start": it["start"], "end": it["end"]} for it in items] + return {"text": text, "language": lang, "language_name": name, "words": words} + + def prepare_lips(self, ref_id: str, video_path: str) -> dict: + """Face track and lip embeddings of the reference's video for the lip-sync step (AV-sync), kept with the + reference (runs in a request thread).""" + if not (self.settings.installed and self.settings.avsync_ready): + raise ValueError("lip-sync (AV-sync) is not set up on this server; run tools/setup_asr_env.sh") + ref = self.refs.get(ref_id) + lip_dir = tempfile.TemporaryDirectory(prefix="dub-lips-") # removed with the last reference / dub using it + out = Path(lip_dir.name) / "lips.pt" + r = self._call_sync("lips_prepare", video=video_path, out=str(out)) + ref["lips"] = {"dir": lip_dir, "path": str(out), "start": r["start"], "end": r["end"]} + return {k: r[k] for k in ("start", "end", "track_frames", "video_frames", "tracks")} + + def _lips_of(self, ref_id: str, lipsync: bool) -> dict | None: + if not lipsync: + return None + try: + lips = self.refs.get(ref_id).get("lips") + except UnknownId: + lips = None + if lips is None: + raise ValueError("lip-sync needs the video's face track: POST /v2/dub/lips/{ref_id} with the video first") + return lips + + # ---- analysis --------------------------------------------------------------------------------------------- + + async def analyze(self, req: dict) -> dict: + """Segments of the reference at its pauses, each with the span of the target transcript SimAlign projects onto + it. ``ref_words`` (timings the caller has) replace the forced alignment of ``ref_text``.""" + ref = self.refs.get(req["ref_id"]) + ref_lang, target_lang = req["ref_lang"], req["target_lang"] + self._check_ref_lang(ref_lang) + if target_lang not in P.TARGET_LANGUAGES: + raise ValueError(f"unsupported target language: {target_lang}") + target_text = (req.get("target_text") or "").strip() + if not target_text: + raise ValueError("the target transcript is required") + min_pause = float(req["min_pause_s"]) + if not P.MIN_PAUSE_RANGE[0] <= min_pause <= P.MIN_PAUSE_RANGE[1]: + raise ValueError(f"min_pause_s must be within {P.MIN_PAUSE_RANGE[0]}–{P.MIN_PAUSE_RANGE[1]} s") + + if req.get("ref_words") is not None: + words = normalize_ref_words(req["ref_words"], ref["duration"]) + else: + ref_text = (req.get("ref_text") or "").strip() + if not ref_text: + raise ValueError("send the reference transcript (ref_text) or its word timings (ref_words)") + with tempfile.TemporaryDirectory(prefix="dub-") as tmp: + wav = Path(tmp) / "ref.wav" + self._write_wav(wav, ref["audio"], ref["sr"]) + aligned = (await self._align([{"audio": str(wav), "text": ref_text, "language": ref_lang}]))[0] + if not aligned: + raise ValueError("the forced aligner returned no words; check the transcript and its language") + words = [{"word": it["word"], "start": it["start"], "end": it["end"]} for it in aligned] + + units = P.text_units(target_text, target_lang) + if not units: + raise ValueError("the target transcript has no words") + links = (await self._call("word_align", src=[w["word"] for w in words], + tgt=[spoken_text(u["text"]) for u in units]))["links"] + + ranges = P.ref_segments(words, min_pause) + if len(ranges) > P.MAX_SEGMENTS: + raise ValueError("too many pauses; raise the pause threshold") + spans = [ + (min(w["start"] for w in words[a:b]), max(w["end"] for w in words[a:b])) for a, b in ranges + ] + ubytes = P.unit_bytes(target_text, units) + breaks = P.break_after(target_text, units) + projected = P.project_segments(ranges, spans, [tuple(x) for x in links], ubytes, breaks) + segments = [] + for k, ((wa, wb), (ua, ub), (s, e)) in enumerate(zip(ranges, projected, spans)): + text = P.span_text(target_text, units, ua, ub) + segments.append( + { + "index": k, + "ref_start": s, + "ref_end": e, + "ref_word_range": [wa, wb], + "target_unit_range": [ua, ub], + "ref_text": P.join_words([w["word"] for w in words[wa:wb]], ref_lang), + "target_text": text, + # on the default voice's (source) scale; the studio's voices may have more steered buckets + "bucket_auto": (self.rate_scale(target_lang, "source" if self.model.source_voice else "studio") + .bucket(text_bytes(text) / (e - s)) if text and e > s else None), + } + ) + warnings = [] + if not links: + warnings.append("The word aligner found no links; segments are split by length") + return { + "duration": ref["duration"], + "ref_words": words, + "target_units": units, + "links": links, + "segments": segments, + "warnings": warnings, + } + + # ---- generation ------------------------------------------------------------------------------------------- + + def _segment_voice(self, k: int, voice: dict | None, own: Mapping | None) -> tuple[dict, dict | None]: + """A segment's effective voice and its own controls (checked against the voice: speaker-embedding controls + need a studio voice).""" + voice = voice or {"mode": "source", "controls": None} + if voice["mode"] == "source" and not self.model.source_voice: + raise ValueError(f"segment {k}: this checkpoint has no reference-clone path; choose a studio voice") + if voice["mode"] == "studio" and not self.model.studio_voices: + raise ValueError(f"segment {k}: this checkpoint has no speaker-embedding row for studio voices") + controls = merge_controls(own, where=f"segments[{k}].controls") + raw = sorted(d for d in (merge_controls(voice["controls"], controls) or {}) if d in self.model.raw_controls) + if raw and voice["mode"] != "studio": + raise ValueError(f"segment {k}: controls {', '.join(raw)} move the speaker embedding and need a studio voice") + return voice, controls + + async def generate(self, req: dict, session_id: str | None) -> dict: + ref = self.refs.get(req["ref_id"]) + target_lang, seed = req["target_lang"], int(req["seed"]) + if target_lang not in P.TARGET_LANGUAGES: + raise ValueError(f"unsupported target language: {target_lang}") + if seed < 0: + raise ValueError("seed must be >= 0") + raw = req["segments"] + if not 1 <= len(raw) <= P.MAX_SEGMENTS: + raise ValueError(f"need 1–{P.MAX_SEGMENTS} segments") + default_voice = normalize_voice(req.get("voice"), "voice") + duration, audio, sr = ref["duration"], ref["audio"], ref["sr"] + segs, voices, prev_end = [], [], 0.0 + for k, s in enumerate(raw): + a, b = float(s["ref_start"]), float(s["ref_end"]) + if not (0 <= a < b <= duration + 0.05): + raise ValueError(f"segment {k}: need 0 <= ref_start < ref_end <= {duration:.2f}") + if a < prev_end - 1e-6: + raise ValueError(f"segment {k}: segments must be sorted and non-overlapping") + prev_end = b + bucket = s.get("bucket") + segs.append(P.RefSegment(a, b, str(s["target_text"]).strip(), None if bucket is None else int(bucket))) + voices.append(self._segment_voice(k, normalize_voice(s.get("voice"), f"segments[{k}].voice") or default_voice, + s.get("controls"))) + if not any(seg.text for seg in segs): + raise ValueError("every segment is silent; enter target text") + + lipsync = bool(req.get("lipsync")) + dub = {"duration": duration, "target_lang": target_lang, "ref_codes": None, "takes": {}, + "ref_id": req["ref_id"], "lips": self._lips_of(req["ref_id"], lipsync), + "segments": [self._segment_entry(k, seg, seed, *voices[k], self.rate_scale(target_lang, voices[k][0]["mode"])) + for k, seg in enumerate(segs)]} + began = time.time() + await self._ensure_voice_prompt(dub, audio, sr, [seg for seg, (v, _) in zip(segs, voices) if v["mode"] == "source"]) + stats = await self._render(dub, [k for k, seg in enumerate(segs) if seg.text], session_id) + return await asyncio.to_thread(self._assemble, dub, stats, time.time() - began) + + async def regenerate(self, req: dict, session_id: str | None) -> dict: + """New takes for one segment of a dub (optionally with a new text, bucket, voice or controls); the others + keep theirs.""" + old = self.dubs.get(req["dub_id"]) + seed, k = int(req["seed"]), int(req["segment"]) + if seed < 0: + raise ValueError("seed must be >= 0") + if not 0 <= k < len(old["segments"]): + raise ValueError(f"segment must be in [0, {len(old['segments'])})") + seg = old["segments"][k] + text = str(req["target_text"]).strip() + bucket = req.get("bucket") + voice = normalize_voice(req.get("voice"), "voice") or seg["voice"] + own = req["controls"] if req.get("controls") is not None else seg["controls"] + voice, controls = self._segment_voice(k, voice, own) + lipsync = bool(req.get("lipsync")) + lips = (old["lips"] or self._lips_of(old["ref_id"], True)) if lipsync else None + dub = {**old, "segments": copy.deepcopy(old["segments"]), "takes": dict(old["takes"]), "lips": lips} + entry = self._segment_entry( + k, P.RefSegment(seg["ref_start"], seg["ref_end"], text, None if bucket is None else int(bucket)), seed, + voice, controls, self.rate_scale(old["target_lang"], voice["mode"]), + ) + dub["segments"][k] = entry + dub["takes"].pop(k, None) + if not text and not dub["takes"]: + raise ValueError("every segment would be silent; enter target text") + began = time.time() + if voice["mode"] == "source" and dub["ref_codes"] is None: + ref = self.refs.get(old["ref_id"]) # UnknownId (404): the reference left the store + await self._ensure_voice_prompt(dub, ref["audio"], ref["sr"], [P.RefSegment(entry["ref_start"], entry["ref_end"])]) + stats = await self._render(dub, [k] if text else [], session_id) + return await asyncio.to_thread(self._assemble, dub, stats, time.time() - began) + + async def _ensure_voice_prompt(self, dub: dict, audio: np.ndarray, sr: int, source_segs: list[P.RefSegment]) -> None: + """Reference codes of the source voice: the clip from the first source-voice segment, up to + P.VOICE_PROMPT_MAX_S (plan.voice_prompt_span), as the branch's offline dub.""" + if dub["ref_codes"] is not None or not source_segs: + return + a, b = P.voice_prompt_span(source_segs, dub["duration"]) + clip = np.ascontiguousarray(audio[int(a * sr) : int(b * sr)]) + dub["ref_codes"] = await self.encode_voice(clip, sr) + + def _segment_entry(self, k: int, seg: P.RefSegment, seed: int, voice: dict, controls: dict | None, + scale: P.RateScale) -> dict: + """The response entry of one segment, its candidate plan included (placement fields filled later). A set + ``seg.bucket`` pins every candidate to it; otherwise the plan spreads around the text's rate bucket. Buckets + are on the target language's ``scale`` (row buckets and its tempo-steered ones).""" + if seg.bucket is not None and not scale.first <= seg.bucket <= scale.last: + raise ValueError(f"segment {k}: bucket must be in [{scale.first}, {scale.last}] for this target language") + d = seg.ref_end - seg.ref_start + nbytes = text_bytes(seg.text) + entry = { + "index": k, + "ref_start": seg.ref_start, + "ref_end": seg.ref_end, + "target_text": seg.text, + "status": "ok" if seg.text else "silent", + "seed": seed, + "bytes": nbytes, + "rate": nbytes / d if seg.text else None, + "bucket": None, + "pinned": seg.bucket is not None, + "voice": voice, # the segment's effective voice (its own or the request's) + "controls": controls, # the segment's own direction, added to the voice's controls + "candidates": [], + "chosen": None, + "final_bucket": None, + "retries": None, + "fit": None, + "speech_start": None, + "speech_end": None, + "shift": None, + "start_error": None, + "end_error": None, + "duration_error": None, + "lip_start": None, # speech start / end after the lip-sync warp + "lip_end": None, + # how much the lip-sync warp time-scales the segment's speech (plan.lip_warp) + "lip_scale": None, + "lip_stretch": None, + "lip_squeeze": None, + "lip_warp": None, + } + if seg.text: + if seg.bucket is None: + entry["bucket"] = scale.bucket(entry["rate"]) + plan = P.candidate_plan(entry["bucket"], scale, seed, k) + else: + entry["bucket"] = seg.bucket + plan = P.pinned_candidate_plan(seg.bucket, seed, k) + entry["candidates"] = [ + {**c, "speech_s": None, "attempts": None, "retries": None, "final_bucket": None, + "end": None, "capped": None, "score": None} + for c in plan + ] + return entry + + async def _synthesize(self, dub: dict, jobs: list[dict], session_id: str | None) -> list[dict]: + """Every job's take under LACI on the server's scheduler, each with its segment's duration target: a miss is + retaken in the speaking-rate bucket the measured length asks for, or only recorded for a set bucket.""" + from zonos3.tts.laci import PACE_KINDS + + tts_lang = P.TARGET_LANGUAGES[dub["target_lang"]][1] + requests = [] + for j in jobs: + e = dub["segments"][j["segment"]] + voice = e["voice"] + scale = self.rate_scale(dub["target_lang"], voice["mode"]) + requests.append({ + "text": j["text"], "language": tts_lang, "seed": j["seed"], "max_tokens": j["max_tokens"], + "bucket": j["bucket"], "target_frames": j["target_frames"], "adjust_rate": not j["pinned"], + "voice": voice, "controls": merge_controls(voice["controls"], e["controls"]), + "ref_codes": dub["ref_codes"] if voice["mode"] == "source" else None, + # the segment's scale when it has steered buckets (a take's bucket and its retakes move on it) + "rate_scale": scale if scale.doses else None, + }) + out = [] + for audio, rec in await self.synthesize(requests, session_id): + out.append( + { + "audio": audio, + "attempts": rec["attempts"], + "retries": dict(collections.Counter(f["kind"] for f in rec["failures"] if not f["ignored"])), + "exhausted": rec["capped"], # used LACI's whole retry budget + "end": rec["end"], + # a content failure LACI could not repair; an unrepaired duration miss shows in the length + "capped": any(f["ignored"] and f["kind"] not in PACE_KINDS for f in rec["failures"]), + "failures": rec["failures"], + "final_bucket": rec["rate_bucket"], + } + ) + return out + + async def _render(self, dub: dict, ks: list[int], session_id: str | None) -> dict: + """Synthesize, align and choose the takes of segments ``ks`` into ``dub["takes"]``. Returns this request's + synthesis counts: candidates, LACI retries by kind over all of them, takes that used the whole budget, and + the synthesis / alignment wall times.""" + stats = {"candidates": 0, "retries": collections.Counter(), "exhausted": 0, "synthesis_s": 0.0, "align_s": 0.0} + if not ks: + return stats + info, target_lang = dub["segments"], dub["target_lang"] + jobs = [] + for k in ks: + e = info[k] + d = e["ref_end"] - e["ref_start"] + for slot, c in enumerate(e["candidates"]): + jobs.append({"bucket": c["bucket"], "seed": c["seed"], "segment": k, "slot": slot, "text": e["target_text"], + "max_tokens": P.max_tokens_for(d), "target_frames": d * P.FRAME_RATE, + "pinned": e["pinned"]}) + t0 = time.time() + takes = await self._synthesize(dub, jobs, session_id) + stats["synthesis_s"] = time.time() - t0 + stats["candidates"] = len(jobs) + for t in takes: + stats["retries"].update(t["retries"]) + stats["exhausted"] += t["exhausted"] + + t0 = time.time() + valid = [i for i, t in enumerate(takes) if t["audio"] is not None and len(t["audio"])] + aligned: dict[int, list[dict]] = {} + spans: dict[int, tuple[float, float]] = {} + with tempfile.TemporaryDirectory(prefix="dub-") as tmp: + reqs, paths = [], {} + for i in valid: + paths[i] = str(Path(tmp) / f"take{i}.wav") + self._write_wav(Path(paths[i]), takes[i]["audio"], SAMPLE_RATE) + reqs.append({"audio": paths[i], "text": spoken_text(jobs[i]["text"]), "language": target_lang}) + if reqs: + for i, items in zip(valid, await self._align(reqs)): + aligned[i] = items + # A take without a placed word is measured by where the VAD hears speech. + unplaced = [i for i in valid if P.speech_span(aligned[i]) is None] + regions = {} + if unplaced: + found = await asyncio.to_thread(self.aligner.speech, [paths[i] for i in unplaced]) + regions = dict(zip(unplaced, found, strict=True)) + stats["align_s"] = time.time() - t0 + for i in valid: + sp = P.speech_span(aligned[i], regions.get(i)) + if sp is not None and sp[1] > sp[0]: + spans[i] = sp + + nonempty = [j for j, e in enumerate(info) if e["status"] == "ok"] + for k in ks: + e = info[k] + d = e["ref_end"] - e["ref_start"] + later = [j for j in nonempty if j > k] + room = info[later[0]]["ref_start"] - P.MIN_GAP_S - e["ref_start"] if later else math.inf + mine = [i for i, j in enumerate(jobs) if j["segment"] == k] + cands = [] + for i in mine: + if i not in spans: + cands.append(None) + continue + t, (s0, s1) = takes[i], spans[i] + c = {"speech_s": s1 - s0, "capped": t["capped"], "end": t["end"]} + cands.append(c) + e["candidates"][jobs[i]["slot"]].update( + speech_s=s1 - s0, attempts=t["attempts"], retries=t["retries"], + final_bucket=t["final_bucket"], end=t["end"], capped=t["capped"], score=P.candidate_score(c, d, room), + ) + pick = P.choose_candidate(cands, d, room) + if pick is None: + raise RuntimeError(f"segment {k}: no usable take") + e["chosen"] = jobs[mine[pick]]["slot"] + t = takes[mine[pick]] + s0, s1 = spans[mine[pick]] + # the kept take: its LACI retries by kind, final speaking-rate bucket, and speech length over the segment's + e.update(final_bucket=t["final_bucket"], retries=t["retries"], fit=(s1 - s0) / d) + dub["takes"][k] = {"audio": t["audio"], "s0": s0, "s1": s1, + "items": aligned[mine[pick]], "attempts": t["attempts"], "retries": t["retries"]} + return stats + + def _assemble(self, dub: dict, stats: dict, generation_s: float) -> dict: + """Place every chosen take on the timeline, lip-sync it to the video (``dub["lips"]``, AV-sync) when asked, store + the dub and build the response (runs in a thread: the lip-sync call blocks on the worker).""" + info, takes = dub["segments"], dub["takes"] + nonempty = sorted(takes) + items = [ + {"ref_start": info[k]["ref_start"], "ref_end": info[k]["ref_end"], + "take_len": len(takes[k]["audio"]) / SAMPLE_RATE, "s0": takes[k]["s0"], "s1": takes[k]["s1"]} + for k in nonempty + ] + placed, timeline_len = P.place_segments(items, dub["duration"]) + + sr_out = SAMPLE_RATE + fade = max(1, int(P.FADE_S * sr_out)) + chunks = [] + for k, p in zip(nonempty, placed): + take = takes[k]["audio"] + piece = take[int(round(p["crop_start"] * sr_out)) : int(round(p["crop_end"] * sr_out))].astype(np.float32) + nf = min(fade, len(piece) // 2) + if nf: + ramp = np.linspace(0.0, 1.0, nf, dtype=np.float32) + piece[:nf] *= ramp + piece[-nf:] *= ramp[::-1] + chunks.append((int(round(p["place_start"] * sr_out)), piece)) + total = max([int(round(timeline_len * sr_out))] + [pos + len(pc) for pos, pc in chunks]) + mix = np.zeros(total, dtype=np.float32) + for pos, piece in chunks: + mix[pos : pos + len(piece)] += piece + lip_map, lipsync = None, None + lipsync_s = 0.0 + if dub["lips"] is not None: + t0 = time.time() + mix, lip_map, lipsync = self._lip_sync(dub["lips"], mix) + lipsync_s = time.time() - t0 + mix = np.clip(mix, -1.0, 1.0) + total = len(mix) + buf = io.BytesIO() + sf.write(buf, mix, sr_out, format="WAV", subtype="PCM_16") + wav_bytes = buf.getvalue() + + def warp(t: float) -> float: + return float(lip_map.out_time(t)) if lip_map is not None else t + + words = [] + for k, p in zip(nonempty, placed): + s0 = takes[k]["s0"] + info[k].update( + start=p["speech_start"], + end=p["speech_end"], + speech_start=p["speech_start"], + speech_end=p["speech_end"], + shift=p["shift"], + start_error=p["start_error"], + end_error=p["end_error"], + duration_error=p["duration_error"], + # skipped warp (no sync gain): the speech plays where it was placed, untouched + lip_start=warp(p["speech_start"]) if lipsync is not None else None, + lip_end=warp(p["speech_end"]) if lipsync is not None else None, + ) + if lip_map is not None: + info[k].update(P.lip_warp(lip_map, p["speech_start"], p["speech_end"])) + elif lipsync is not None: + info[k].update(lip_scale=1.0, lip_stretch=1.0, lip_squeeze=1.0, lip_warp=1.0) + for it in takes[k]["items"]: + words.append( + { + "word": it["word"], + "start": warp(p["speech_start"] + (it["start"] - s0)), + "end": warp(p["speech_start"] + (it["end"] - s0)), + "segment": k, + } + ) + metrics = { + "mean_abs_start_error_ms": 1000 * _mean([abs(p["start_error"]) for p in placed]), + "mean_abs_end_error_ms": 1000 * _mean([abs(p["end_error"]) for p in placed]), + "mean_abs_duration_error_ms": 1000 * _mean([abs(p["duration_error"]) for p in placed]), + "max_shift_ms": 1000 * max(p["shift"] for p in placed), + # LACI retries (by kind: skip, hallucination, truncation, pace_fast, pace_slow) of the dub's kept takes, and + # of every candidate this request synthesized (most retries happen on candidates that are not kept) + "laci_retries": sum(takes[k]["attempts"] for k in nonempty), + "retries_by_kind": dict(sum((collections.Counter(takes[k]["retries"]) for k in nonempty), collections.Counter())), + "all_retries": sum(stats["retries"].values()), + "all_retries_by_kind": dict(stats["retries"]), + "exhausted_takes": stats["exhausted"], # candidates that used LACI's whole retry budget + "candidates": stats["candidates"], # synthesized by this request + "generation_s": generation_s, + "synthesis_s": stats["synthesis_s"], + "align_s": stats["align_s"], + "lipsync_s": lipsync_s, + } + dub_id = self.dubs.put({**dub, "wav": wav_bytes}) + return { + "dub_id": dub_id, + "audio_base64": base64.b64encode(wav_bytes).decode("ascii"), + "sample_rate": sr_out, + "duration": total / sr_out, + "segments": [{"k": e["index"], **e} for e in info], + "words": words, + "metrics": metrics, + "lipsync": lipsync, + } + + def _lip_sync(self, lips: dict, mix: np.ndarray) -> tuple[np.ndarray, P.LipMap | None, dict]: + """AV-sync's warp of the dub timeline onto the lips of the video (alignment worker), bounded by the guard and + kept only when it lowers the mean SyncNet distance of lips and dub over the track by more than + P.LIP_MIN_SYNC_GAIN; otherwise the unwarped dub comes back (``applied`` false, no lip map).""" + sr = SAMPLE_RATE + with tempfile.TemporaryDirectory(prefix="dub-") as tmp: + src, out = Path(tmp) / "dub.wav", Path(tmp) / "synced.wav" + pad = max(0, int(math.ceil(lips["end"] * sr)) - len(mix)) # the warp reads the whole face track + self._write_wav(src, np.pad(mix, (0, pad)), sr) + r = self._call_sync("lips_sync", lips=lips["path"], audio=str(src), out=str(out), + max_rate=P.LIP_GUARD_MAX_RATE, max_shift_s=P.LIP_GUARD_MAX_SHIFT_S) + synced, _ = sf.read(str(out), dtype="float32") + lip_map = P.LipMap.from_frames(r["start"], r["rate"], r["src_frames"]) + shifts = np.abs(lip_map.shifts()) + track = P.lip_warp(lip_map, float(lip_map.src_t[0]), float(lip_map.src_t[-1])) + info = { + "start": r["start"], + "end": r["end"], + "max_shift_ms": 1000 * float(shifts.max()), + "mean_abs_shift_ms": 1000 * float(shifts.mean()), + "max_stretch": track["lip_stretch"], + "max_squeeze": track["lip_squeeze"], + "mean_warp": track["lip_warp"], + "sync_distance_before": r["sync_distance_before"], + "sync_distance_after": r["sync_distance_after"], + "guard": {"max_rate": P.LIP_GUARD_MAX_RATE, "max_shift_s": P.LIP_GUARD_MAX_SHIFT_S}, + } + gain = r["sync_distance_before"] - r["sync_distance_after"] + info["applied"] = gain > P.LIP_MIN_SYNC_GAIN + if not info["applied"]: + info["reason"] = (f"no sync gain: SyncNet distance {r['sync_distance_before']:.3f} unwarped, " + f"{r['sync_distance_after']:.3f} warped") + return mix, None, info + return synced, lip_map, info + + # ---- video ------------------------------------------------------------------------------------------------ + + def mux(self, dub_id: str, video_path: str, out_path: str) -> None: + """Replace the video's audio with the dub (video stream copied; re-encoded if the copy fails).""" + dub = self.dubs.get(dub_id) + dub_path = Path(video_path).with_name("dub.wav") + dub_path.write_bytes(dub["wav"]) + base = ["ffmpeg", "-hide_banner", "-loglevel", "error", "-y", "-i", video_path, "-i", str(dub_path)] + tail = ["-map", "0:v:0", "-map", "1:a:0"] + audio = ["-c:a", "aac", "-b:a", "192k", "-movflags", "+faststart", out_path] + copy = subprocess.run(base + tail + ["-c:v", "copy"] + audio, check=False, capture_output=True) + if copy.returncode == 0: + return + enc = subprocess.run( + base + tail + ["-c:v", "libx264", "-preset", "veryfast", "-crf", "20", "-pix_fmt", "yuv420p"] + audio, + check=False, + capture_output=True, + ) + if enc.returncode != 0: + err = enc.stderr.decode(errors="replace")[-400:] + raise ValueError(f"ffmpeg could not mux this video: {err}") diff --git a/zonos3/generation.py b/zonos3/generation.py new file mode 100644 index 0000000000000000000000000000000000000000..b63c48d6be4226785ff787b84260a8b0658e79eb --- /dev/null +++ b/zonos3/generation.py @@ -0,0 +1,30 @@ +"""The generation registry (``registries/generation.json``): the request defaults and limits of every server. + +``SAMPLING`` holds the v2 sampling defaults (``api/openapi.yaml`` repeats them), the rest the request limits the +request rules (``zonos3.tts.plan``) and the servers' upload paths enforce. The ggml server embeds the same file at +build time; the in-browser server imports it. +""" + +from __future__ import annotations + +import json +from pathlib import Path +from types import MappingProxyType + +REGISTRY = Path(__file__).resolve().parent / "registries" / "generation.json" + +_data = json.loads(REGISTRY.read_text(encoding="utf-8")) +SAMPLE_RATE: int = int(_data["sample_rate"]) +# temperature, topk, top_p, min_p, repetition_penalty, repetition_window, repetition_codebooks +SAMPLING = MappingProxyType(dict(_data["sampling"])) +TAG_CFG_MIN_SCALE: float = float(_data["tag_cfg_scale"]["min"]) +TAG_CFG_MAX_SCALE: float = float(_data["tag_cfg_scale"]["max"]) +SILENCE_PREFILL_DEFAULT_FRAMES: int = int(_data["silence_prefill_frames"]["default"]) +SILENCE_PREFILL_MAX_FRAMES: int = int(_data["silence_prefill_frames"]["max"]) +DECODE_CONTEXT_FRAMES: int = int(_data["decode_context_frames"]) +REFERENCE_MAX_FRAMES: int = int(_data["reference_max_frames"]) +MAX_FRAMES: int = int(_data["max_frames"]) +REFERENCE_AUDIO_MAX_SECONDS: float = float(_data["audio_max_seconds"]["reference"]) +UPLOAD_MAX_SECONDS: float = float(_data["audio_max_seconds"]["upload"]) +EDIT_MAX_SECONDS: float = float(_data["audio_max_seconds"]["edit"]) +del _data diff --git a/zonos3/languages.py b/zonos3/languages.py new file mode 100644 index 0000000000000000000000000000000000000000..aa6e81606372b53b21bf08606d2f03639d2943a8 --- /dev/null +++ b/zonos3/languages.py @@ -0,0 +1,51 @@ +"""The language registry (``registries/languages.json``): every server's and the studio's language tables. + +``SERVER`` are the TTS language codes requests use, ``SPOKEN`` the languages speech recognition, forced alignment and +dub references understand (by Whisper-style code), ``ESPEAK`` the espeak-ng voices that guess unknown words of a +pronunciation lexicon language. The ggml server embeds the same file at build time; the studio and the in-browser +server import it. +""" + +from __future__ import annotations + +import json +from dataclasses import dataclass +from pathlib import Path + +REGISTRY = Path(__file__).resolve().parent / "registries" / "languages.json" + + +@dataclass(frozen=True) +class ServerLanguage: + code: str # the request code (en_us, cmn, ...) + label: str # the studio's name + nemo: str # NeMo text-normalization package + lexicon: str # pronunciation lexicon language (ISO 639-3) + speech: str # its SPOKEN code + + +@dataclass(frozen=True) +class SpokenLanguage: + code: str # Whisper-style code (en, zh, yue, ...) + name: str # Qwen3-ASR language name; the dub's label + tts: str | None = None # the server language a dub into it speaks + unspaced: bool = False # written without spaces between words + + +_data = json.loads(REGISTRY.read_text(encoding="utf-8")) +SERVER: tuple[ServerLanguage, ...] = tuple(ServerLanguage(**row) for row in _data["server"]) +SPOKEN: tuple[SpokenLanguage, ...] = tuple(SpokenLanguage(**row) for row in _data["spoken"]) +ESPEAK: dict[str, str] = dict(_data["espeak"]) +del _data + +CODES: tuple[str, ...] = tuple(lang.code for lang in SERVER) +BY_CODE: dict[str, ServerLanguage] = {lang.code: lang for lang in SERVER} +SPOKEN_BY_CODE: dict[str, SpokenLanguage] = {lang.code: lang for lang in SPOKEN} + + +def normalize(language: str) -> str: + """A request's ``language`` as a server code (case-insensitive, ``-`` for ``_``); ValueError for another one.""" + normalized = str(language or "").strip().lower().replace("-", "_") + if normalized not in BY_CODE: + raise ValueError(f"Unsupported language code: {language!r}. Supported: {', '.join(CODES)}.") + return normalized diff --git a/zonos3/models/__init__.py b/zonos3/models/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/zonos3/models/accent_format.py b/zonos3/models/accent_format.py new file mode 100644 index 0000000000000000000000000000000000000000..fac2c274547cbff4984d8863cae0e168812f3df6 --- /dev/null +++ b/zonos3/models/accent_format.py @@ -0,0 +1,164 @@ +"""Accent adapter files (lingua ``apps.zonos.accent_adapter``, ``zonos-accent-lora/1`` and ``/2``). + +An adapter shifts linear weights by ``up @ down``, router balancing biases by a vector and, in ``/2``, every MoE +expert weight by its own ``up_e @ down_e``. A request served with adapter strength alpha runs ``base + alpha * +adapter``. ``load_adapter`` parses one ``.pt`` (the file stem is the name requests use) into module-keyed +factors; the servers and the reference apply them (zonos3_sgl.models.accent_adapters, zonos3.reference.accents). + +Module names are the checkpoint's: ``tools/convert_lingua_checkpoint.py`` keeps every non-expert tensor under its +lingua key. ``TARGETS`` mirrors lingua's ``apps.zonos.lora.DEFAULT_TARGETS``. Exact shifts: ``.balancing_biases`` +(float32 quantile thresholds); as in the converter, the legacy ZeroMean parametrization +``.parametrizations.balancing_biases.original`` maps to ``balancing_biases`` with its mean removed, and the training-only +router metrics (``ent_denom``, ``normalized_entropy``) are dropped. Any other exact shift is refused. + +Expert factors (``/2``): ``layers.N.feed_forward.experts.{w13,w2}`` carry ``up`` [E, out, r] and ``down`` [E, r, in] in +lingua's SonicExperts layout (w13 rows interleave gate/up), ``shape`` (E, out, in) and ``experts`` E. +""" + +from __future__ import annotations + +from dataclasses import dataclass, field +from pathlib import Path + +import torch + +FORMAT = "zonos-accent-lora/1" +FORMAT_EXPERTS = "zonos-accent-lora/2" +FORMATS = (FORMAT, FORMAT_EXPERTS) +# SonicExperts weights lingua's apps.zonos.lora adapts per expert. +EXPERT_WEIGHTS = ("w13", "w2") + +BALANCING_BIASES = ".balancing_biases" +_LEGACY_BALANCING_BIASES = ".parametrizations.balancing_biases.original" +# Router state the converter drops (training metrics, never used for routing). +_DROPPED_ROUTER_STATE = (".router.ent_denom", ".router.normalized_entropy") + +# Mirrors lingua apps.zonos.lora.DEFAULT_TARGETS. +TARGETS = ( + "attention.wq", + "attention.wkv", + "attention.wo", + "attention.gater", + "attention.in_proj", + "feed_forward.w_in", + "feed_forward.w_out", + "feed_forward.latent_down", + "feed_forward.latent_up", + "router.router_linear", + "multi_output", +) + + +def lora_target(module: str) -> str | None: + """The TARGETS entry a module name matches (lingua's suffix rule), or None.""" + for target in TARGETS: + if module == target or module.endswith("." + target): + return target + return None + + +def served_exact_name(name: str) -> tuple[str | None, bool]: + """Served tensor an exact shift lands on, and whether to remove its mean. + + Mirrors convert_lingua_checkpoint._output_key / convert_model_state for the + router state; None means the converter drops the tensor. + """ + if any(part in name for part in _DROPPED_ROUTER_STATE): + return None, False + if name.endswith(_LEGACY_BALANCING_BIASES): + return name.removesuffix(_LEGACY_BALANCING_BIASES) + BALANCING_BIASES, True + return name, False + + +def list_accent_adapters(directory: str | Path) -> list[str]: + """Adapter names in a directory, in slot order (slot = index + 1).""" + path = Path(directory) + if not path.is_dir(): + raise FileNotFoundError(f"accent adapter directory {path} does not exist") + names = sorted(file.stem for file in path.glob("*.pt")) + if not names: + raise FileNotFoundError(f"no accent adapters (*.pt) in {path}") + return names + + +@dataclass(frozen=True) +class AccentAdapter: + """One parsed adapter. + + ``linear``: LoRA module (e.g. ``layers.3.attention.wq``) -> (down [K, in], up [K, out]) float32, the shift being + ``(x @ down.T) @ up`` on the flat ``[out, in]`` product; ``shapes``: the weight shape each linear shift was trained + on. ``experts``: experts module (``layers.N.feed_forward.experts``) -> weight (``w13`` / ``w2``) -> (up [E, out, r], + down [E, r, in]) float32 in the SonicExperts layout. ``router_bias``: router module (``layers.N.feed_forward.router``) + -> float32 [experts] added to its balancing biases.""" + + name: str + format: str + linear: dict[str, tuple[torch.Tensor, torch.Tensor]] = field(default_factory=dict) + shapes: dict[str, tuple[int, ...]] = field(default_factory=dict) + experts: dict[str, dict[str, tuple[torch.Tensor, torch.Tensor]]] = field(default_factory=dict) + router_bias: dict[str, torch.Tensor] = field(default_factory=dict) + + @property + def rank(self) -> int: + """Columns the adapter's linear factors take (their largest rank).""" + return max((down.shape[0] for down, _ in self.linear.values()), default=0) + + +def load_adapter(path: str | Path) -> AccentAdapter: + """Parse ``.pt``; raises ValueError for a file no server can apply.""" + path = Path(path) + adapter = torch.load(path, map_location="cpu", weights_only=True) + fmt = adapter.get("format") + if fmt not in FORMATS: + raise ValueError(f"{path}: not a {' / '.join(FORMATS)} adapter") + router_bias: dict[str, torch.Tensor] = {} + for target, shift in adapter["exact"].items(): + served, zero_mean = served_exact_name(target) + if served is None: + continue + if not served.endswith(".router" + BALANCING_BIASES): + raise ValueError( + f"{path}: shifts {target}; accent serving applies only linear " + "factors and router balancing biases" + ) + shift = shift.float() + if zero_mean: + shift = shift - shift.mean() + router_bias[served.removesuffix(BALANCING_BIASES)] = shift + linear: dict[str, tuple[torch.Tensor, torch.Tensor]] = {} + shapes: dict[str, tuple[int, ...]] = {} + experts: dict[str, dict[str, tuple[torch.Tensor, torch.Tensor]]] = {} + for target, pair in adapter["factors"].items(): + if ".experts." in target or "experts" in pair: + if fmt != FORMAT_EXPERTS: + raise ValueError(f"{path}: {FORMAT} adapter shifts MoE expert weights ({target})") + module, _, weight = target.rpartition(".") + if not module.endswith("feed_forward.experts") or weight not in EXPERT_WEIGHTS: + raise ValueError( + f"accent adapter shifts expert tensor {target!r}; servable expert factors are " + f".feed_forward.experts.{{{','.join(EXPERT_WEIGHTS)}}}" + ) + up, down = pair["up"], pair["down"] + shape = tuple(pair["shape"]) + if ( + len(shape) != 3 + or pair.get("experts") != shape[0] + or tuple(up.shape) != (shape[0], shape[1], down.shape[-2]) + or tuple(down.shape) != (shape[0], down.shape[-2], shape[2]) + ): + raise ValueError( + f"{path.stem}: {target} factors up {tuple(up.shape)}, down {tuple(down.shape)}, shape {shape}, " + f"experts {pair.get('experts')} do not shift the [E, out, in] weight {shape}" + ) + experts.setdefault(module, {})[weight] = (up.float(), down.float()) + continue + if not target.endswith(".weight"): + raise ValueError(f"accent adapter factor {target!r} is not a weight") + module = target.removesuffix(".weight") + if lora_target(module) is None: + raise ValueError( + f"accent adapter shifts {module!r}, outside the LoRA targets {', '.join(TARGETS)}" + ) + linear[module] = (pair["down"].float(), pair["up"].float().T) + shapes[module] = tuple(pair["shape"]) + return AccentAdapter(path.stem, fmt, linear, shapes, experts, router_bias) diff --git a/zonos3/models/config.py b/zonos3/models/config.py new file mode 100644 index 0000000000000000000000000000000000000000..ad8643ddfa8a3880832fb0b4b2f66b95cb67b87e --- /dev/null +++ b/zonos3/models/config.py @@ -0,0 +1,362 @@ +from __future__ import annotations + +from dataclasses import dataclass +from typing import Any, Dict + +from zonos3.utils.moe_topk import normalize_special_topk_layers, resolve_layer_topk +from zonos3.condition_buckets import bucket_counts + + +@dataclass(frozen=True) +class RotaryConfig: + head_dim: int + rotary_dim: int + max_position: int + base: float + scaling: Dict[str, Any] | None + + +def normalize_moe_balancing_strategy(strategy: str) -> str: + normalized = strategy.strip().lower().replace("-", "_") + aliases = { + "current": "quantile", + "quantile": "quantile", + "qbalancing": "quantile", + "megatron": "quantile", + "megatron_qbalancing": "quantile", + "megatron_quantile": "quantile", + "quantile_balancing": "quantile", + "old": "legacy", + "legacy": "legacy", + "aux": "legacy", + "aux_loss": "legacy", + } + try: + return aliases[normalized] + except KeyError as exc: + raise ValueError( + "Unsupported model.moe_balancing_strategy=" + f"{strategy!r}. Expected one of: quantile, qbalancing, legacy, aux_loss." + ) from exc + + +def normalize_moe_router_type(router_type: str) -> str: + normalized = router_type.strip().lower().replace("-", "_") + aliases = {"mlp": "mlp", "linear": "linear", "single_linear": "linear"} + try: + return aliases[normalized] + except KeyError as exc: + raise ValueError( + f"Unsupported model.moe_router_type={router_type!r}. " + "Expected 'mlp' or 'linear'." + ) from exc + + +def get_routed_moe_dim(dim: int, alpha: float) -> int: + if not (0 < alpha <= 1.0): + raise ValueError(f"moe_alpha must be in (0, 1], got {alpha}.") + return max(1, int(round(dim * alpha))) + + +def compute_audio_vocab_size(codebook_size: int, span_end_id: int | None) -> int: + """Per-codebook audio vocabulary: codes 0..codebook_size-1, EOA, pad, then the optional span-end.""" + return int(codebook_size) + 2 + (0 if span_end_id is None else 1) + + +@dataclass(frozen=True) +class ModelConfig: + num_layers: int + num_qo_heads: int + num_kv_heads: int + head_dim: int + hidden_size: int + vocab_size: int + intermediate_size: int + rms_norm_eps: float + rotary_config: RotaryConfig + hidden_act: str + tie_word_embeddings: bool + num_experts: int + num_experts_per_tok: int + moe_intermediate_size: int + norm_topk_prob: bool + special_topk_layers: dict[int, int] | None = None + # Zonos3-specific fields + n_codebooks: int = 9 + codebook_size: int = 1024 + codebook_sizes: tuple[int, ...] | None = None + audio_codec: str = "opus_dual_3n_600k_sched600k_r4096_step600000" + text_vocab: int | None = None + # Text rows after the padding row: phoneme tokens (text_tokenizer_spec.phonemes) or speech-edit marker rows. + text_extra_tokens: int = 0 + moe_n_experts: int = 1 + moe_start_from_layer: int = 0 + moe_end_from_layer: int = 0 + moe_router_dim: int = 256 # Router hidden dimension + moe_router_type: str = "mlp" + moe_router_use_eda: bool = True + moe_alpha: float = 1.0 + moe_impl: str = "grouped" + moe_balancing_strategy: str = "legacy" + use_xsa: bool = False + attention_pattern: str = "global" + residual_type: str = "standard" + block_attnres_block_size: int = 4 + # TTS-specific fields + eoa_id: int = 1024 # End-of-audio token ID + audio_pad_id: int = 1025 # Audio padding token ID + span_end_id: int | None = None # Edit span-end token ID (audio_pad_id + 1) or None + loss_softcap: float = 15.0 # Logit soft capping value + speaker_enabled: bool = False + speaker_reference_prefix_enabled: bool = False + speaker_reference_max_seconds: float = 30.0 + speaker_embedding_dim: int = 128 + speaker_embedding_codec: str | None = None + speaker_lda_dim: int | None = None + speaker_background_token_enabled: bool = False + accurate_mode_token_enabled: bool = False + speaking_rate_num_buckets: int = 0 + speaking_rate_buckets: tuple[str, ...] = () + quality_num_buckets: int = 0 + quality_features: tuple[str, ...] = () + quality_buckets: Dict[str, tuple[str, ...]] | None = None + # Condition rows (loudness / fmax / speaking-rate buckets) of the cond3 finetunes; see utils/hf.py. One bucket + # count per table (ids 0..n-1, n = unknown); () without condition rows. + condition_tokens_enabled: bool = False + condition_bucket_counts: tuple[int, ...] = () + condition_count: int = 3 + condition_names: tuple[str, ...] = () + condition_edges: Dict[str, tuple[float, ...]] | None = None + condition_units: Dict[str, str] | None = None + condition_flags: Dict[str, dict] | None = None + quality_dropout: Dict[str, float] | None = None + + def __post_init__(self) -> None: + if self.attention_pattern not in {"global", "gdn3_global1"}: + raise ValueError(f"Unsupported attention pattern: {self.attention_pattern}") + object.__setattr__( + self, + "special_topk_layers", + normalize_special_topk_layers(self.special_topk_layers), + ) + object.__setattr__( + self, + "moe_router_type", + normalize_moe_router_type(self.moe_router_type), + ) + object.__setattr__( + self, + "moe_balancing_strategy", + normalize_moe_balancing_strategy(self.moe_balancing_strategy), + ) + get_routed_moe_dim(self.hidden_size, float(self.moe_alpha)) + residual_type = str(self.residual_type).strip().lower().replace("-", "_") + if residual_type not in {"standard", "block_attnres", "full_attnres"}: + raise ValueError( + "residual_type must be 'standard', 'block_attnres' or 'full_attnres', got " + f"{residual_type!r}." + ) + object.__setattr__(self, "residual_type", residual_type) + if self.block_attnres_block_size <= 0 or self.block_attnres_block_size % 2: + raise ValueError("block_attnres_block_size must be a positive even number.") + if self.speaker_reference_max_seconds <= 0: + raise ValueError("speaker_reference_max_seconds must be positive.") + codebook_sizes = self.codebook_sizes + if codebook_sizes is None: + codebook_sizes = (int(self.codebook_size),) * int(self.n_codebooks) + else: + codebook_sizes = tuple(int(item) for item in codebook_sizes) + if len(codebook_sizes) != int(self.n_codebooks): + raise ValueError("codebook_sizes must contain one size per codebook.") + if any(size <= 0 or size > int(self.codebook_size) for size in codebook_sizes): + raise ValueError("Invalid per-codebook vocabulary size.") + object.__setattr__(self, "codebook_sizes", codebook_sizes) + if self.span_end_id is not None and int(self.span_end_id) != int(self.audio_pad_id) + 1: + raise ValueError( + f"span_end_id must equal audio_pad_id + 1 ({int(self.audio_pad_id) + 1}), " + f"got {self.span_end_id}." + ) + + @property + def audio_vocab_size(self) -> int: + """Per-codebook audio vocabulary: ordinary codes, EOA, pad and the optional span-end.""" + return compute_audio_vocab_size(self.codebook_size, self.span_end_id) + + def get_num_experts_per_tok(self, layer_idx: int) -> int: + default_topk = self.num_experts_per_tok if self.num_experts_per_tok > 0 else 1 + return resolve_layer_topk(default_topk, self.special_topk_layers, layer_idx) + + @classmethod + def from_checkpoint_config(cls, config) -> ModelConfig: + return cls.from_zonos3_config(config) + + @classmethod + def from_zonos3_config(cls, config) -> ModelConfig: + """Create ModelConfig from Zonos3Config (training checkpoint format). + + Zonos3Config uses different field names than HuggingFace: + - n_layers -> num_layers + - dim -> hidden_size + - head_dim -> head_dim + - n_heads -> num_qo_heads + - n_kv_heads -> num_kv_heads + - ffn_dim_multiplier * dim -> intermediate_size + - moe_ffn_dim_multiplier * dim -> moe_intermediate_size (when set) + """ + # Calculate dimensions + head_dim = config.head_dim + dim = config.dim + n_heads = config.n_heads if config.n_heads is not None else dim // head_dim + n_kv_heads = config.n_kv_heads if config.n_kv_heads is not None else n_heads + + # Calculate intermediate size from ffn_dim_multiplier + ffn_dim = int(config.ffn_dim_multiplier * dim) + # Round to multiple_of + multiple_of = getattr(config, "multiple_of", 256) + intermediate_size = multiple_of * ((ffn_dim + multiple_of - 1) // multiple_of) + + # Expert FFNs can be intentionally finer or coarser than the dense + # FFNs while preserving total/active MoE capacity. Older checkpoints + # omit these fields and therefore retain the historical shared size. + moe_ffn_dim_multiplier = getattr(config, "moe_ffn_dim_multiplier", None) + if moe_ffn_dim_multiplier is None: + moe_ffn_dim_multiplier = config.ffn_dim_multiplier + moe_multiple_of = getattr(config, "moe_multiple_of", None) + if moe_multiple_of is None: + moe_multiple_of = multiple_of + moe_ffn_dim = int(moe_ffn_dim_multiplier * dim) + moe_intermediate_size = moe_multiple_of * ( + (moe_ffn_dim + moe_multiple_of - 1) // moe_multiple_of + ) + + # Total vocab = n_codebooks * audio_vocab + text_vocab (if present) + span_end_id = getattr(config, "span_end_id", None) + vocab_size = config.n_codebooks * compute_audio_vocab_size(config.codebook_size, span_end_id) + if config.text_vocab is not None: + vocab_size += config.text_vocab + 1 + int(getattr(config, "text_extra_tokens", 0)) + + # MoE settings + moe_n_experts = getattr(config, "moe_n_experts", 1) + moe_router_topk = getattr(config, "moe_router_topk", 1) + special_topk_layers = getattr(config, "special_topk_layers", None) + moe_router_dim = getattr(config, "moe_router_dim", 256) + moe_router_type = normalize_moe_router_type( + getattr(config, "moe_router_type", "mlp") + ) + moe_router_use_eda = bool( + getattr( + config, + "moe_router_use_eda", + getattr(config, "use_eda", True), + ) + ) + moe_alpha = float(getattr(config, "moe_alpha", 1.0)) + get_routed_moe_dim(dim, moe_alpha) + moe_impl = getattr(config, "moe_impl", "grouped") + moe_balancing_strategy = normalize_moe_balancing_strategy( + getattr(config, "moe_balancing_strategy", "legacy") + ) + + return cls( + attention_pattern=getattr(config, "attention_pattern", "global"), + num_layers=config.n_layers, + num_qo_heads=n_heads, + num_kv_heads=n_kv_heads, + head_dim=head_dim, + hidden_size=dim, + vocab_size=vocab_size, + intermediate_size=intermediate_size, + hidden_act="silu", # Zonos3 uses SiLU + rms_norm_eps=config.norm_eps, + tie_word_embeddings=False, + rotary_config=RotaryConfig( + head_dim=head_dim, + rotary_dim=head_dim, + max_position=config.max_seqlen, + base=config.rope_theta, + scaling=None, + ), + num_experts=moe_n_experts if moe_n_experts > 1 else 0, + num_experts_per_tok=moe_router_topk if moe_n_experts > 1 else 0, + special_topk_layers=special_topk_layers, + moe_intermediate_size=moe_intermediate_size if moe_n_experts > 1 else 0, + norm_topk_prob=bool(getattr(config, "norm_topk_prob", False)), + # Zonos3 fields + n_codebooks=config.n_codebooks, + codebook_size=config.codebook_size, + codebook_sizes=tuple( + getattr(config, "codebook_sizes", None) + or [config.codebook_size] * config.n_codebooks + ), + audio_codec=str(getattr(config, "audio_codec", "opus_dual_3n_600k_sched600k_r4096_step600000")), + text_vocab=config.text_vocab, + text_extra_tokens=int(getattr(config, "text_extra_tokens", 0)), + moe_n_experts=moe_n_experts, + moe_start_from_layer=getattr(config, "moe_start_from_layer", 0), + moe_end_from_layer=getattr(config, "moe_end_from_layer", 0), + moe_router_dim=moe_router_dim, + moe_router_type=moe_router_type, + moe_router_use_eda=moe_router_use_eda, + moe_alpha=moe_alpha, + moe_impl=moe_impl, + moe_balancing_strategy=moe_balancing_strategy, + use_xsa=bool(getattr(config, "use_xsa", False)), + residual_type=getattr(config, "residual_type", "standard"), + block_attnres_block_size=int( + getattr(config, "block_attnres_block_size", 4) + ), + # TTS fields + eoa_id=config.eoa_id, + audio_pad_id=config.audio_pad_id, + span_end_id=None if span_end_id is None else int(span_end_id), + loss_softcap=config.loss_softcap, + condition_tokens_enabled=bool(getattr(config, "condition_tokens_enabled", False)), + condition_bucket_counts=( + bucket_counts( + int(getattr(config, "condition_count", 3) or 3), + int(getattr(config, "condition_n_buckets", 10) or 10), + getattr(config, "condition_bucket_counts", None), + ) + if getattr(config, "condition_tokens_enabled", False) + else () + ), + condition_count=int(getattr(config, "condition_count", 3) or 3), + condition_names=tuple(str(item) for item in (getattr(config, "condition_names", None) or ())), + condition_edges={ + str(name): tuple(float(x) for x in (edges or ())) + for name, edges in (getattr(config, "condition_edges", None) or {}).items() + } + or None, + condition_units=dict(getattr(config, "condition_units", None) or {}) or None, + condition_flags={str(k): dict(v or {}) for k, v in (getattr(config, "condition_flags", None) or {}).items()} or None, + speaker_enabled=getattr(config, "speaker_enabled", False), + speaker_reference_prefix_enabled=bool( + getattr(config, "speaker_reference_prefix_enabled", False) + ), + speaker_reference_max_seconds=float( + getattr(config, "speaker_reference_max_seconds", 30.0) + ), + speaker_embedding_dim=getattr(config, "speaker_embedding_dim", 128), + speaker_embedding_codec=getattr(config, "speaker_embedding_codec", None), + speaker_lda_dim=getattr(config, "speaker_lda_dim", None), + speaker_background_token_enabled=bool( + getattr(config, "speaker_background_token_enabled", False) + ), + accurate_mode_token_enabled=bool( + getattr(config, "accurate_mode_token_enabled", False) + ), + speaking_rate_num_buckets=getattr(config, "speaking_rate_num_buckets", 0), + speaking_rate_buckets=tuple(getattr(config, "speaking_rate_buckets", None) or ()), + quality_num_buckets=int(getattr(config, "quality_num_buckets", 0) or 0), + quality_features=tuple(getattr(config, "quality_features", None) or ()), + quality_buckets={ + str(feature): tuple(str(item) for item in (buckets or ())) + for feature, buckets in (getattr(config, "quality_buckets", None) or {}).items() + } + or None, + quality_dropout=dict(getattr(config, "quality_dropout", None) or {}) or None, + ) + +# CONDITION_ROWS_RUNTIME_20261016 + +# CONDITION_FLAG_RUNTIME_20261017 diff --git a/zonos3/models/mect_speaker.py b/zonos3/models/mect_speaker.py new file mode 100644 index 0000000000000000000000000000000000000000..d973ff40f7fccc7727677cd2dfb3e6e740441560 --- /dev/null +++ b/zonos3/models/mect_speaker.py @@ -0,0 +1,161 @@ +"""Own-weights MECT-B2 speaker encoder for the `ownmect_s2`-style speaker-embedding codecs (2026-10-16). + +Mirrors George's training-side extractor (w2v-bert-sv-mect `local.mect_sv.MECTFbank`, `embed_prompt_scp.py`, infer config +`ownmect_b2_infer.yaml`, `use_amp: false`): waveform -> mono float32 at 16 kHz -> at most 60 s -> 80-d Kaldi fbank +(25 ms / 10 ms, hamming, dither 0, energy floor 0, waveform scaled by 2^15) -> AntSpeaker VPR (per-utterance CMN, +MECT_B2 backbone, ASTP pooling, BatchNorm, linear 192, fp32) -> (1, 192). The vectors equal the `ownmect_s2` column rows / +ZTTS2 prompt vectors the finetunes were trained and evaluated with (receipt: frozen_arch checks/mect-embedder-20261016.json). + +Which encoder serves which training codec comes from the speaker encoder registry (JSON, env +ZONOS3_SPEAKER_ENCODER_REGISTRY, default `zonos3/registries/speaker_encoder_registry.json`): `{codec: {type: "mect_fbank", +checkpoint, sha256, backbone_type, backbone_config, pooling, embed_dim, sample_rate, max_seconds, fbank}}`. +""" +from __future__ import annotations + +import hashlib +import json +import os +from functools import cache +from pathlib import Path + +import torch +import torch.nn as nn +import torchaudio +import torchaudio.compliance.kaldi as kaldi + +REGISTRY_ENV = "ZONOS3_SPEAKER_ENCODER_REGISTRY" +DEFAULT_REGISTRY = Path(__file__).resolve().parents[1] / "registries" / "speaker_encoder_registry.json" +MECT_FBANK = "mect_fbank" + + +def registry_path() -> Path: + from zonos3.utils.release import resolve_file # RELEASE_HF_20261021: the registry itself may live on hf:// + + return Path(resolve_file(os.environ.get(REGISTRY_ENV) or str(DEFAULT_REGISTRY))) + + +def load_registry() -> dict: + path = registry_path() + if not path.is_file(): + return {} + data = json.loads(path.read_text()) + return {k: v for k, v in data.items() if isinstance(v, dict) and not k.startswith("_")} + + +def registry_entry(codec: str | None) -> dict | None: + """The registry entry for a training codec name (exact string from the checkpoint's params.json), or None.""" + if not codec: + return None + entry = load_registry().get(str(codec)) + if entry is None: + return None + return dict(entry, codec=str(codec)) + + +def _sha256(path: Path) -> str: + h = hashlib.sha256() + with path.open("rb") as fh: + for block in iter(lambda: fh.read(1 << 22), b""): + h.update(block) + return h.hexdigest() + + +class MECTFbankSpeakerEmbedding(nn.Module): + """George's MECTFbank inference path: Kaldi fbank front-end + AntSpeaker VPR (MECT_B2 / ASTP), fp32.""" + + TYPE = MECT_FBANK + + def __init__(self, entry: dict, device: str | torch.device = "cuda"): + super().__init__() + if entry.get("type") != self.TYPE: + raise ValueError(f"speaker encoder entry {entry.get('codec')!r} is of type {entry.get('type')!r}, not {self.TYPE!r}") + self.codec = str(entry.get("codec", "")) + self.device = torch.device(device) + self.sample_rate = int(entry.get("sample_rate", 16_000)) + self.max_seconds = float(entry.get("max_seconds", 60.0)) + self.embedding_dim = int(entry.get("embed_dim", 192)) + fb = dict(entry.get("fbank") or {}) + self.waveform_scale = float(fb.pop("scale", 1 << 15)) + self.fbank_kwargs = dict( + num_mel_bins=int(fb.get("num_mel_bins", 80)), + frame_length=float(fb.get("frame_length", 25.0)), + frame_shift=float(fb.get("frame_shift", 10.0)), + dither=float(fb.get("dither", 0.0)), + energy_floor=float(fb.get("energy_floor", 0.0)), + window_type=str(fb.get("window_type", "hamming")), + sample_frequency=float(self.sample_rate), + ) + # the vendored AntSpeaker registry: importing .models registers VPR, the MECT_* backbones and the poolings + import zonos3.models.third_party.antspeaker.models # noqa: F401 + from zonos3.models.third_party.antspeaker.utils.registry import create_model + + cfg = { + "type": "VPR", + "config": { + "backbone": {"type": str(entry.get("backbone_type", "MECT_B2")), "config": dict(entry.get("backbone_config") or {})}, + "pooling": {"type": str(entry.get("pooling", "ASTP"))}, + "embed_dim": self.embedding_dim, + }, + } + self.model = create_model(cfg) # state-dict keys model.* as in George's MECTFbank wrapper + + checkpoint = entry.get("checkpoint") + if checkpoint: + from zonos3.utils.release import resolve_file as _resolve_release_file + + path = Path(_resolve_release_file(str(checkpoint))) # hf:// -> local cache + if not path.is_file(): + raise FileNotFoundError(f"speaker encoder checkpoint for {self.codec!r} not found: {path}") + expected = str(entry.get("sha256") or "").strip().lower() + if expected: + actual = _sha256(path) + if actual != expected: + raise ValueError(f"speaker encoder checkpoint {path} sha256 {actual} != registry {expected}") + state = torch.load(path, map_location="cpu", weights_only=True) + if isinstance(state, dict) and "modules" in state: + state = state["modules"]["spk_model"] + state = {k: v for k, v in state.items() if not k.startswith("bfbank.")} # training-only batched fbank buffers + self.load_state_dict(state, strict=True) + del state + self.checkpoint = str(checkpoint or "") + + self.to(self.device) + self.requires_grad_(False).eval() + + @property + def dtype(self): + return next(self.parameters()).dtype + + @cache + def _get_resampler(self, orig_sample_rate: int): + return torchaudio.transforms.Resample(orig_sample_rate, self.sample_rate).to(self.device) + + def prepare_input(self, wav: torch.Tensor, sample_rate: int) -> torch.Tensor: + if wav.ndim == 1: + wav = wav.unsqueeze(0) + elif wav.ndim == 2: + if wav.shape[0] > 1: + wav = wav.mean(dim=0, keepdim=True) + else: + raise ValueError(f"Expected mono/stereo waveform, got shape {tuple(wav.shape)}.") + wav = wav.to(self.device, torch.float32) + if int(sample_rate) != self.sample_rate: + wav = self._get_resampler(int(sample_rate))(wav) + return wav[..., : int(self.max_seconds * self.sample_rate)] + + def fbank(self, wav: torch.Tensor) -> torch.Tensor: + """(T,) float waveform in [-1, 1] -> (T', num_mel_bins) Kaldi fbank, as MECTFbank.fbank.""" + return kaldi.fbank(wav[None] * self.waveform_scale, **self.fbank_kwargs) + + def forward(self, wav: torch.Tensor, sample_rate: int) -> torch.Tensor: + wav = self.prepare_input(wav, int(sample_rate)) + with torch.autocast(device_type="cuda", enabled=False): + feats = self.fbank(wav[0].float())[None].transpose(1, 2) # (1, mel, T') + return self.model(feats).to(torch.float32) # (1, embed_dim) + + +def create_registry_speaker_embedder(entry: dict, device: str | torch.device = "cuda") -> nn.Module: + kind = entry.get("type") + if kind == MECT_FBANK: + return MECTFbankSpeakerEmbedding(entry, device=device) + raise ValueError(f"Unsupported speaker encoder type {kind!r} for codec {entry.get('codec')!r} in {registry_path()}") diff --git a/zonos3/models/speaker_cloning.py b/zonos3/models/speaker_cloning.py new file mode 100644 index 0000000000000000000000000000000000000000..2b718c8d228f02213b996fbb12c9af2f720500ba --- /dev/null +++ b/zonos3/models/speaker_cloning.py @@ -0,0 +1,308 @@ +from contextlib import nullcontext +from functools import cache +from pathlib import Path + +import torch +import torch.nn as nn +import torch.nn.functional as F +import torchaudio +from huggingface_hub import hf_hub_download +from transformers import ( + AutoFeatureExtractor, + AutoModel, + Wav2Vec2BertConfig, + Wav2Vec2BertModel, +) + +try: + from zonos.utils import DEFAULT_DEVICE +except Exception: + DEFAULT_DEVICE = "cuda" if torch.cuda.is_available() else "cpu" + + +class Qwen3SpeakerEmbedding(nn.Module): + """Qwen3 voice embedding extractor used by 2048D speaker-conditioned checkpoints.""" + + MODEL_NAME = "marksverdhei/Qwen3-Voice-Embedding-12Hz-1.7B" + TARGET_SAMPLE_RATE = 24_000 + N_FFT = 1024 + HOP_LENGTH = 256 + WIN_LENGTH = 1024 + N_MELS = 128 + F_MIN = 0.0 + F_MAX = 12_000.0 + + def __init__(self, device: str = DEFAULT_DEVICE): + super().__init__() + self.device = device + self.model = AutoModel.from_pretrained( + self.MODEL_NAME, + trust_remote_code=True, + ) + self.model.to(device) + self.model.eval() + + self.mel_transform = torchaudio.transforms.MelSpectrogram( + sample_rate=self.TARGET_SAMPLE_RATE, + n_fft=self.N_FFT, + win_length=self.WIN_LENGTH, + hop_length=self.HOP_LENGTH, + f_min=self.F_MIN, + f_max=self.F_MAX, + n_mels=self.N_MELS, + power=1.0, + center=False, + norm="slaney", + mel_scale="slaney", + ).to(device) + + self.requires_grad_(False).eval() + + @property + def dtype(self): + return next(self.model.parameters()).dtype + + @cache + def _get_resampler(self, orig_sample_rate: int): + return torchaudio.transforms.Resample(orig_sample_rate, self.TARGET_SAMPLE_RATE).to(self.device) + + def prepare_input(self, wav: torch.Tensor, sample_rate: int) -> torch.Tensor: + assert wav.ndim < 3 + if wav.ndim == 2: + wav = wav.mean(0, keepdim=True) + wav = wav.to(self.device, torch.float32) + if sample_rate != self.TARGET_SAMPLE_RATE: + wav = self._get_resampler(sample_rate)(wav) + return wav + + def _make_mel(self, wav: torch.Tensor) -> torch.Tensor: + # Mirror the standalone demo preprocessing: reflect-pad, magnitude mel, log clamp. + pad = (self.N_FFT - self.HOP_LENGTH) // 2 + wav = F.pad(wav.unsqueeze(1), (pad, pad), mode="reflect").squeeze(1) + mel = self.mel_transform(wav) + mel = torch.log(torch.clamp(mel, min=1e-5)) + return mel.transpose(1, 2) + + def forward(self, wav: torch.Tensor, sample_rate: int): + wav = self.prepare_input(wav, sample_rate) + mel = self._make_mel(wav) + return self.model(input_values=mel).last_hidden_state.to(torch.float32) + + +class _AttentiveStatisticsPooling(nn.Module): + """Pooling layer used by the published W2V-BERT speaker checkpoint.""" + + def __init__(self, input_dim: int, hidden_dim: int): + super().__init__() + self.attention = nn.Sequential( + nn.Conv1d(input_dim, hidden_dim, kernel_size=1), + nn.ReLU(inplace=True), + nn.BatchNorm1d(hidden_dim), + nn.Conv1d(hidden_dim, input_dim, kernel_size=1), + nn.Softmax(dim=2), + ) + + def forward(self, x: torch.Tensor) -> torch.Tensor: + weights = self.attention(x.transpose(1, 2)).transpose(1, 2) + mean = torch.sum(x * weights, dim=1) + std = torch.sqrt( + (torch.sum(x.square() * weights, dim=1) - mean.square()).clamp(min=1e-5) + ) + return torch.cat([mean, std], dim=1) + + +class W2VBertSVSpeakerEmbedding(nn.Module): + """Published 256D encoder behind the ``w2vbert_sv`` training records. + + The public checkpoint contains the full W2V-BERT 2.0 encoder together with + the per-layer adapters, attentive statistics pooling, and 256D bottleneck. + Its forward path intentionally mirrors the data-generation implementation + instead of calling the generic Transformers forward method. + """ + + MODEL_NAME = "facebook/w2v-bert-2.0" + CHECKPOINT_REPO = "zl389/w2v-bert-2.0_SV" + CHECKPOINT_FILE = "model_base_0.23.pth" + TARGET_SAMPLE_RATE = 16_000 + MAX_SECONDS = 60 + N_HIDDEN_STATES = 25 + ENCODER_DIM = 1024 + ADAPTER_DIM = 128 + EMBEDDING_DIM = 256 + + def __init__( + self, + device: str = DEFAULT_DEVICE, + checkpoint_path: str | Path | None = None, + ): + super().__init__() + self.device = torch.device(device) + self.feature_extractor = AutoFeatureExtractor.from_pretrained(self.MODEL_NAME) + + # Instantiate the architecture only. All weights, including the base + # encoder, are restored from model_base_0.23.pth below. + config = Wav2Vec2BertConfig.from_pretrained(self.MODEL_NAME) + config.apply_spec_augment = False + self.front = nn.Module() + self.front.encoder = Wav2Vec2BertModel(config) + # The training wrapper removes this unused SpecAugment parameter before + # saving, so doing the same gives us a strict state-dict load. + if hasattr(self.front.encoder, "masked_spec_embed"): + delattr(self.front.encoder, "masked_spec_embed") + + self.adapter_layers = nn.ModuleList( + [ + nn.Sequential( + nn.Linear(self.ENCODER_DIM, self.ADAPTER_DIM), + nn.LayerNorm(self.ADAPTER_DIM), + nn.ReLU(inplace=True), + nn.Linear(self.ADAPTER_DIM, self.ADAPTER_DIM), + ) + for _ in range(self.N_HIDDEN_STATES) + ] + ) + pooled_dim = self.N_HIDDEN_STATES * self.ADAPTER_DIM + self.pooling = _AttentiveStatisticsPooling(pooled_dim, self.ADAPTER_DIM) + self.bottleneck = nn.Linear(pooled_dim * 2, self.EMBEDDING_DIM) + + if checkpoint_path is None: + checkpoint_path = hf_hub_download( + self.CHECKPOINT_REPO, + self.CHECKPOINT_FILE, + ) + checkpoint = torch.load( + Path(checkpoint_path).expanduser(), + map_location="cpu", + weights_only=True, + mmap=True, + ) + try: + state = checkpoint["modules"]["spk_model"] + except (KeyError, TypeError) as exc: + raise ValueError( + "W2V-BERT speaker checkpoint must contain modules.spk_model." + ) from exc + self.load_state_dict(state, strict=True) + del checkpoint, state + + self.to(self.device) + self.requires_grad_(False).eval() + + @property + def dtype(self): + return next(self.parameters()).dtype + + @cache + def _get_resampler(self, orig_sample_rate: int): + return torchaudio.transforms.Resample( + orig_sample_rate, + self.TARGET_SAMPLE_RATE, + ).to(self.device) + + def prepare_input(self, wav: torch.Tensor, sample_rate: int) -> torch.Tensor: + if wav.ndim not in (1, 2): + raise ValueError(f"Expected mono/stereo waveform, got shape {tuple(wav.shape)}.") + if wav.ndim == 1: + wav = wav.unsqueeze(0) + elif wav.shape[0] > 1: + wav = wav.mean(dim=0, keepdim=True) + wav = wav.to(self.device, torch.float32) + if sample_rate != self.TARGET_SAMPLE_RATE: + wav = self._get_resampler(sample_rate)(wav) + return wav[..., : self.MAX_SECONDS * self.TARGET_SAMPLE_RATE] + + def _extract_features(self, wav: torch.Tensor) -> torch.Tensor: + features = self.feature_extractor( + wav.squeeze(0).detach().cpu().numpy(), + sampling_rate=self.TARGET_SAMPLE_RATE, + return_tensors="pt", + padding=False, + truncation=False, + return_attention_mask=False, + ) + return features.input_features.to(self.device, dtype=self.dtype) + + def forward(self, wav: torch.Tensor, sample_rate: int) -> torch.Tensor: + wav = self.prepare_input(wav, sample_rate) + input_features = self._extract_features(wav) + + autocast = ( + torch.autocast(device_type="cuda", dtype=torch.bfloat16) + if self.device.type == "cuda" + else nullcontext() + ) + with autocast: + x = self.front.encoder.feature_projection(input_features)[0] + hidden_states = [x] + for layer in self.front.encoder.encoder.layers: + x = layer(x)[0] + hidden_states.append(x) + + adapted = [ + adapter(hidden) + for adapter, hidden in zip(self.adapter_layers, hidden_states, strict=True) + ] + x = torch.cat(adapted, dim=-1) + x = self.pooling(x) + x = self.bottleneck(x) + return x.to(torch.float32) + + +def resolve_speaker_embedding_backend(codec: str | None, expected_dim: int) -> str: + """Resolve a checkpoint codec to an installed reference-audio encoder.""" + normalized = str(codec or "").strip().lower().replace("-", "_") + aliases = { + "qwen3": "qwen3", + "qwen3_voice_embedding": "qwen3", + "w2vbert_sv": "w2vbert_sv", + "w2v_bert_sv": "w2vbert_sv", + } + if normalized: + if normalized in aliases: + return aliases[normalized] + # codecs beyond the built-in encoders (e.g. ownmect_s2) come from the speaker encoder registry, keyed by the + # exact training codec name; the backend key is that name + from zonos3.models.mect_speaker import registry_entry, registry_path + + entry = registry_entry(codec) + if entry is not None: + if int(entry.get("embed_dim", expected_dim)) != int(expected_dim): + raise ValueError( + f"Speaker embedding codec {codec!r}: the checkpoint expects {expected_dim} dimensions but the " + f"registry entry produces {entry.get('embed_dim')} ({registry_path()})." + ) + return entry["codec"] + raise ValueError( + f"Unsupported speaker embedding codec: {codec!r} (not a built-in encoder and not in the speaker encoder " + f"registry {registry_path()})." + ) + + # Backward compatibility for older converted checkpoints that predate the + # explicit codec field. New conversions always preserve the training codec. + if expected_dim == 2048: + return "qwen3" + if expected_dim == 256: + return "w2vbert_sv" + raise ValueError( + "Checkpoint does not identify its speaker embedding codec and no " + f"legacy backend is known for {expected_dim} dimensions." + ) + + +def create_speaker_embedder( + codec: str | None, + expected_dim: int, + device: str = DEFAULT_DEVICE, +) -> nn.Module: + backend = resolve_speaker_embedding_backend(codec, expected_dim) + if backend == "qwen3": + return Qwen3SpeakerEmbedding(device=device) + if backend == "w2vbert_sv": + return W2VBertSVSpeakerEmbedding(device=device) + from zonos3.models.mect_speaker import create_registry_speaker_embedder, registry_entry + + entry = registry_entry(backend) + if entry is not None: + return create_registry_speaker_embedder(entry, device=device) + raise AssertionError(f"Unhandled speaker embedding backend: {backend}") +# MECT_SPEAKER_ENCODER_20261016 diff --git a/zonos3/models/third_party/__init__.py b/zonos3/models/third_party/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..cfcfb4d0fc37a8ca8edf27365f7fdde6517d9d0a --- /dev/null +++ b/zonos3/models/third_party/__init__.py @@ -0,0 +1 @@ +"""Third-party model code vendored into zonos3 (see each package's SOURCE.md).""" diff --git a/zonos3/models/third_party/antspeaker/SOURCE.md b/zonos3/models/third_party/antspeaker/SOURCE.md new file mode 100644 index 0000000000000000000000000000000000000000..e0459123f9b59b77eb74c9b54b0df56c9678f38c --- /dev/null +++ b/zonos3/models/third_party/antspeaker/SOURCE.md @@ -0,0 +1,14 @@ +# Vendored AntSpeaker model code + +`antspeaker/` = model code from https://github.com/ant-research/AntSpeaker at commit `41dcd09`: `models/{__init__,model,poolings}.py`, +`models/backbones/{__init__,mect,moe}.py`, `utils/registry.py`, taken from George's `w2v-bert-sv-mect` recipe +(`recipes/DeepASV/local/third_party/antspeaker`, copied there unmodified on 2026-10-06) on 2026-10-16. + +The only change here: the absolute import prefix `antspeaker.` is rewritten to `zonos3.models.third_party.antspeaker.` +so the package imports without a sys.path hack. Every `.py` file keeps its "Apache License, Version 2.0" header +(Copyright (c) 2026 Ant Group Co., Ltd.). The upstream repository's LICENSE / README state CC-BY-NC-SA 4.0 for the +released checkpoints (`mect_*.pt`): those are never loaded here. The weights served through this code are George's +own-weights MECT-B2 trained from scratch on our data (`ownmect_s2`, see `speaker_encoder_registry.json`). + +Used by `zonos3/models/mect_speaker.py` (MECTFbankSpeakerEmbedding) for checkpoints whose +`speaker_embedding_codec` names a registry entry of type `mect_fbank`. diff --git a/zonos3/models/third_party/antspeaker/__init__.py b/zonos3/models/third_party/antspeaker/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..3748efaa4a7022e32610ca40eceb10d5772fde5b --- /dev/null +++ b/zonos3/models/third_party/antspeaker/__init__.py @@ -0,0 +1 @@ +"""AntSpeaker architecture code (Apache-2.0), vendored; see SOURCE.md.""" diff --git a/zonos3/models/third_party/antspeaker/models/__init__.py b/zonos3/models/third_party/antspeaker/models/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..37f1bb103dda376575529de1b65700046147f147 --- /dev/null +++ b/zonos3/models/third_party/antspeaker/models/__init__.py @@ -0,0 +1,15 @@ +# Copyright (c) 2026 Ant Group Co., Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from zonos3.models.third_party.antspeaker.models.model import * diff --git a/zonos3/models/third_party/antspeaker/models/backbones/__init__.py b/zonos3/models/third_party/antspeaker/models/backbones/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..a03765608a96171a4a551144b2a05b096eff5a11 --- /dev/null +++ b/zonos3/models/third_party/antspeaker/models/backbones/__init__.py @@ -0,0 +1,16 @@ +# Copyright (c) 2026 Ant Group Co., Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from .mect import MECT_B2 + diff --git a/zonos3/models/third_party/antspeaker/models/backbones/mect.py b/zonos3/models/third_party/antspeaker/models/backbones/mect.py new file mode 100644 index 0000000000000000000000000000000000000000..58851454d908e53b279546c9e0a324a9ba015bc0 --- /dev/null +++ b/zonos3/models/third_party/antspeaker/models/backbones/mect.py @@ -0,0 +1,803 @@ +# Copyright (c) 2026 Ant Group Co., Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import math +import sys +import torch +import torchaudio +from torch import Tensor +import torch.nn as nn +import torch.nn.functional as F + +sys.path.append("../../../") +from zonos3.models.third_party.antspeaker.utils.registry import register_backbone +from zonos3.models.third_party.antspeaker.models.backbones.moe import HybridMoE + +class StreamingCache: + def __init__(self): + self.conv2d_cache = {} + self.pos_cache = {} + self.kv_cache = {} + + def clear(self): + self.conv2d_cache.clear() + self.pos_cache.clear() + self.kv_cache.clear() + + def get_conv2d_cache(self, name: str): + return self.conv2d_cache.get(name, None) + + def set_conv2d_cache(self, name: str, cache: torch.Tensor): + self.conv2d_cache[name] = cache + + def get_pos_cache(self, name: str): + return self.pos_cache.get(name, None) + + def set_pos_cache(self, name: str, cache: torch.Tensor): + self.pos_cache[name] = cache + + def get_kv_cache(self, layer_idx: int): + return self.kv_cache.get(layer_idx, None) + + def set_kv_cache(self, layer_idx: int, k_cache: torch.Tensor, v_cache: torch.Tensor): + self.kv_cache[layer_idx] = (k_cache, v_cache) + + +class LayerNorm(nn.Module): + """ LayerNorm that supports two data formats: channels_last (default) or channels_first. + The ordering of the dimensions in the inputs. channels_last corresponds to inputs with + shape (batch_size, T, channels) while channels_first corresponds to inputs + with shape (batch_size, channels, T). + """ + def __init__(self, C, eps=1e-6, data_format="channels_last"): + super().__init__() + self.weight = nn.Parameter(torch.ones(C)) + self.bias = nn.Parameter(torch.zeros(C)) + self.eps = eps + self.data_format = data_format + if self.data_format not in ["channels_last", "channels_first"]: + raise NotImplementedError + self.C = (C, ) + + def forward(self, x): + if self.data_format == "channels_last": + return F.layer_norm(x, self.C, self.weight, self.bias, self.eps) + elif self.data_format == "channels_first": + u = x.mean(1, keepdim=True) + s = (x - u).pow(2).mean(1, keepdim=True) + x = (x - u) / torch.sqrt(s + self.eps) + + w = self.weight + b = self.bias + for _ in range(x.ndim-2): + w = w.unsqueeze(-1) + b = b.unsqueeze(-1) + x = w * x + b + return x + else: + raise NotImplementedError + + def extra_repr(self) -> str: + return ", ".join([f"{k}={v}" for k,v in {"C" : self.C, "data_format" : self.data_format, "eps" : self.eps}.items()]) + +# ============================================ Transformer ================================================= + +class NewGELUActivation(nn.Module): + def forward(self, input: Tensor) -> Tensor: + return 0.5 * input * (1.0 + torch.tanh(math.sqrt(2.0 / math.pi) * (input + 0.044715 * torch.pow(input, 3.0)))) + + +class MultiHeadAttention(nn.Module): + """Multi-headed attention from ' Attention Is All You Need' paper""" + def __init__( + self, + embed_dim: int, + num_heads: int, + dropout: float = 0.0, + bias: bool = True, + ): + super().__init__() + self.embed_dim = embed_dim + self.num_heads = num_heads + self.dropout = dropout + self.head_dim = embed_dim // num_heads + + if (self.head_dim * num_heads) != self.embed_dim: + raise ValueError( + f"embed_dim must be divisible by num_heads (got ` embed_dim`: {self.embed_dim}" + f"and ` num_heads`: {num_heads})." + ) + self.scaling = self.head_dim**-0.5 + + self.k_proj = nn.Linear(embed_dim, embed_dim, bias= bias) + self.v_proj = nn.Linear(embed_dim, embed_dim, bias= bias) + self.q_proj = nn.Linear(embed_dim, embed_dim, bias= bias) + self.out_proj = nn.Linear(embed_dim, embed_dim, bias= bias) + + def _shape(self, tensor: torch.Tensor, seq_len: int, bsz: int): + return tensor.view(bsz, seq_len, self.num_heads, self.head_dim).transpose(1, 2).contiguous() + + def forward(self, hidden_states: torch.Tensor, use_cache=False, kv_cache=None, causal=False): + """Input shape: Batch x Time x Channel""" + bsz, tgt_len,_= hidden_states.size() + + # get query proj + query_states = self.q_proj(hidden_states) * self.scaling + # self_attention + key_states = self._shape(self.k_proj(hidden_states), -1, bsz) + value_states = self._shape(self.v_proj(hidden_states), -1, bsz) + + if use_cache and kv_cache is not None: + k_cache, v_cache = kv_cache + key_states = torch.cat([k_cache, key_states], dim=2) # [bsz, num_heads, cache_len+tgt_len, head_dim] + value_states = torch.cat([v_cache, value_states], dim=2) + + new_kv_cache = None + if use_cache: + new_kv_cache = (key_states.detach(), value_states.detach()) + + proj_shape = (bsz* self.num_heads, -1, self.head_dim) + query_states = self._shape(query_states, tgt_len, bsz).view(*proj_shape) + key_states = key_states.view(*proj_shape) + value_states = value_states.view(*proj_shape) + + src_len = key_states.size(1) + attn_weights = torch.bmm(query_states, key_states.transpose(1, 2)) + + if causal: + mask = torch.triu(torch.ones(tgt_len, tgt_len, device=attn_weights.device, dtype=torch.bool), diagonal=1) # [tgt_len, tgt_len] 上三角=True + if src_len > tgt_len: + prefix = torch.zeros(tgt_len, src_len - tgt_len, device=attn_weights.device, dtype=torch.bool) # 历史KV全可见 + mask = torch.cat([prefix, mask], dim=1) # [tgt_len, src_len] + attn_weights = attn_weights.masked_fill(mask.unsqueeze(0).expand(bsz * self.num_heads, -1, -1), float('-inf')) + + attn_weights = F.softmax(attn_weights, dim=-1) + + attn_probs = F.dropout(attn_weights, p=self.dropout, training=self.training) + + attn_output = torch.bmm(attn_probs, value_states) + + attn_output = attn_output.view(bsz, self.num_heads, tgt_len, self.head_dim) + attn_output = attn_output.transpose(1, 2) + + # Use the ` embed_dim` from the config (stored in the class) rather than` hidden_state` because ` attn_output` can be + # partitioned aross GPUs when using tensor-parallelism. + attn_output = attn_output.reshape(bsz, tgt_len, self.embed_dim) + + attn_output = self.out_proj(attn_output) + return attn_output, new_kv_cache + + +class FeedForward(nn.Module): + def __init__(self, + hidden_size: int, + intermediate_size: int, + activation_dropout: float=0.0, + hidden_dropout: float=0.0, + moe: bool = False, + moe_type: str = "token", + num_experts_shard: int = 6, + num_experts_token: int = 6, + top_k_shard: int = None, + top_k_token: int = None, + shard_scale: float = 1.0 + ): + super().__init__() + self.intermediate_dropout = nn.Dropout(activation_dropout) + if moe: + self.intermediate_dense = HybridMoE( + hidden_size, + intermediate_size, + num_experts_shard=num_experts_shard, + num_experts_token=num_experts_token, + top_k_shard=top_k_shard, + top_k_token=top_k_token, + moe_type=moe_type, + shard_scale=shard_scale + ) + else: + self.intermediate_dense = nn.Linear(hidden_size, intermediate_size) + self.intermediate_act_fn = NewGELUActivation() + self.output_dense = nn.Linear(intermediate_size, hidden_size) + self.output_dropout = nn.Dropout(hidden_dropout) + + def forward(self, hidden_states): + hidden_states = self.intermediate_dense(hidden_states) + hidden_states = self.intermediate_act_fn(hidden_states) + hidden_states = self.intermediate_dropout(hidden_states) + hidden_states = self.output_dense(hidden_states) + hidden_states = self.output_dropout(hidden_states) + return hidden_states + + +class TransformerEncoderLayer(nn.Module): + def __init__(self, + n_state: int, + n_mlp : int, + n_head: int, + channel_last: bool = False, + act_do: float = 0.0, + att_do: float = 0.0, + hid_do: float = 0.0, + ln_eps: float=1e-6, + moe: bool = False, + moe_type: str = "token", + num_experts_shard: int = 6, + num_experts_token: int = 6, + top_k_shard: int = None, + top_k_token: int = None, + shard_scale: float = 1.0, + erf_norm: bool = False + ): + + hidden_size=n_state + num_attention_heads=n_head + intermediate_size=n_mlp + activation_dropout= act_do + attention_dropout= att_do + hidden_dropout= hid_do + layer_norm_eps= ln_eps + + super().__init__() + self.channel_last = channel_last + self.attention = MultiHeadAttention( + embed_dim= hidden_size, + num_heads= num_attention_heads, + dropout= attention_dropout + ) + + self.layer_norm = nn.LayerNorm(hidden_size, eps=layer_norm_eps) + + self.feed_forward = FeedForward( + hidden_size= hidden_size, + intermediate_size= intermediate_size, + activation_dropout= activation_dropout, + hidden_dropout= hidden_dropout, + moe=moe, + moe_type=moe_type, + num_experts_shard=num_experts_shard, + num_experts_token=num_experts_token, + top_k_shard=top_k_shard, + top_k_token=top_k_token, + shard_scale=shard_scale + ) + self.final_layer_norm = nn.LayerNorm(hidden_size, eps=layer_norm_eps) + + def forward(self, hidden_states, use_cache=False, kv_cache=None, causal=False): + if not self.channel_last: + hidden_states = hidden_states.permute(0, 2, 1) + attn_residual = hidden_states + hidden_states, new_kv_cache = self.attention(hidden_states, use_cache=use_cache, kv_cache=kv_cache, causal=causal) + hidden_states = attn_residual + hidden_states + hidden_states = self.layer_norm(hidden_states) + hidden_states = hidden_states + self.feed_forward(hidden_states) + hidden_states = self.final_layer_norm(hidden_states) + + outputs = hidden_states + if not self.channel_last: + outputs = outputs.permute(0, 2, 1) + return outputs, new_kv_cache + +# ======================================= ResNet block ============================================= + +class BasicResBlock(nn.Module): + def __init__(self, in_channels, out_channels, group_divisor=None, stride=1, pw=True, causal=False): + super(BasicResBlock, self).__init__() + conv_groups = 1 if group_divisor is None else in_channels//group_divisor + + self.conv1 = nn.Conv2d(in_channels, out_channels, kernel_size=3, stride=stride, padding=0, groups=conv_groups, bias=False) + self.conv_pw1 = nn.Conv2d(out_channels, out_channels, 1) if (group_divisor is not None and pw) else nn.Identity() + self.bn1 = nn.BatchNorm2d(out_channels, affine=True) + self.act1 = nn.ReLU(inplace=True) + self.conv2 = nn.Conv2d(out_channels, out_channels, kernel_size=3, padding=0, groups=conv_groups, bias=False) + self.conv_pw2 = nn.Conv2d(out_channels, out_channels, 1) if (group_divisor is not None and pw) else nn.Identity() + self.bn2 = nn.BatchNorm2d(out_channels, affine=True) + self.act2 = nn.ReLU(inplace=True) + + + self.shortcut = nn.Sequential() + if stride != 1 or in_channels != out_channels: + self.shortcut = nn.Sequential( + nn.Conv2d(in_channels=in_channels, out_channels=out_channels, + padding=0, kernel_size=1, stride=stride, bias=False), + nn.BatchNorm2d(out_channels, affine=True) + ) + + # add for streaming + self.causal = causal + self.stride_t = stride[-1] if isinstance(stride, tuple) else stride + self.cache_frames = 2 + 2 * self.stride_t + + def forward(self, x): + if self.causal: + x_padded = F.pad(x, (2, 0, 1, 1)) + else: + x_padded = F.pad(x, (1, 1, 1, 1)) + out = self.conv1(x_padded) + out = self.conv_pw1(out) + out = self.bn1(out) + out = self.act1(out) + + if self.causal: + out = F.pad(out, (2, 0, 1, 1)) + else: + out = F.pad(out, (1, 1, 1, 1)) + out = self.conv2(out) + out = self.conv_pw2(out) + out = self.bn2(out) + out = self.act2(out) + + out = out + self.shortcut(x) + return out + + def streaming_forward(self, x, cache:StreamingCache, layer_name: str): + t = x.size()[-1] + + prev_input_cache = cache.get_conv2d_cache(f"{layer_name}_BasicResBlock") + if prev_input_cache is not None: + x_padded = torch.cat([prev_input_cache, x], dim=-1) + else: + x_padded = x + cache.set_conv2d_cache(f"{layer_name}_BasicResBlock", x_padded[..., -self.cache_frames:].detach()) + + x_padded = F.pad(x_padded, (2, 0, 1, 1)) + out = self.conv1(x_padded) + out = self.conv_pw1(out) + out = self.bn1(out) + out = self.act1(out) + + out = F.pad(out, (2, 0, 1, 1)) + out = self.conv2(out) + out = self.conv_pw2(out) + out = self.bn2(out) + out = self.act2(out) + + out = out[:,:,:,-t//self.stride_t:] + out = out + self.shortcut(x) + return out, cache + + +class PosConv(nn.Module): + def __init__(self, in_channels, out_channels, kernel_size, causal=False): + super(PosConv, self).__init__() + self.causal = causal + self.kernel_size = kernel_size + + self.pos_conv = nn.Sequential( + nn.Conv1d(in_channels, out_channels, kernel_size=kernel_size, padding=0, groups=out_channels), + nn.BatchNorm1d(out_channels), + nn.GELU(), + nn.Conv1d(out_channels, out_channels, 1, 1) + ) + + def forward(self, x): + if not self.causal: + x_pad = F.pad(x, (self.kernel_size//2, self.kernel_size//2)) + else: + x_pad = F.pad(x, (self.kernel_size//2 * 2, 0)) + out = self.pos_conv(x_pad) + return out + + +# ======================================= MECT block ============================================= + +class MECT_block(nn.Module): + def __init__(self, cnn_num, in_channels, out_channels, in_fdims, hidden_dims, group_divisor, stride=1, moe=True, + moe_type="local", + num_experts_shard=2, + num_experts_token=2, + top_k_shard=None, + top_k_token=None, + shard_scale=1.0, expansion=1, + causal=False + ): + super().__init__() + self.scale_f = stride[0] if isinstance(stride, tuple) else stride + self.scale_t = stride[-1] if isinstance(stride, tuple) else stride + self.in_channels = in_channels + self.causal = causal + + # resnet block + self.expansion = expansion + self.cnn_block = self._make_layer(BasicResBlock, int(out_channels * expansion), cnn_num, group_divisor, stride=stride) + + if expansion > 1: + self.reduce_conv = nn.Sequential( + nn.Conv2d(self.in_channels, in_channels * self.scale_f, kernel_size=1, stride=1), + nn.BatchNorm2d(in_channels * self.scale_f) + ) + else: + self.reduce_conv = nn.Identity() + + # project for transformer + self.fcdims = in_fdims * out_channels // self.scale_f + self.reduce_project = nn.Sequential( + nn.Conv1d(self.fcdims, hidden_dims, 1), + LayerNorm(hidden_dims, eps=1e-6, data_format="channels_first") + ) + + # positional embedding + self.pos_conv = PosConv(hidden_dims, hidden_dims, kernel_size=113, causal=causal) + + self.transformer = TransformerEncoderLayer( + n_state=hidden_dims, + n_mlp=hidden_dims, + n_head=4, + moe=moe, + moe_type=moe_type, + num_experts_shard=num_experts_shard, + num_experts_token=num_experts_token, + top_k_shard=top_k_shard, + top_k_token=top_k_token, + shard_scale=shard_scale + ) + + self.expansion_project = nn.Sequential( + nn.Conv1d(hidden_dims, self.fcdims, 1), + ) + + self.up_sample = nn.Upsample(scale_factor=self.scale_t, mode='nearest') + + # calculate the receptive field of the pos_conv layer + self.pos_conv_receptive_field = 113 - 1 + + def _make_layer(self, block, out_channels, num_blocks, group_divisor, stride): + strides = [stride] + [1] * (num_blocks - 1) + layers = [] + for stride in strides: + layers.append(block(self.in_channels, out_channels, group_divisor, stride, causal=self.causal)) + self.in_channels = out_channels + return nn.Sequential(*layers) + + + def forward(self, x): + t = x.size()[-1] + out = self.cnn_block(x) + out = self.reduce_conv(out) + b, c, f, _ = out.size() + + x2 = out.permute((0, 2, 1, 3)).reshape((b, c*f, -1)) + out = self.reduce_project(x2) + + out = out + self.pos_conv(out) + out, _ = self.transformer(out, causal=self.causal) + out = self.expansion_project(out) + out = out + x2 + + out = self.up_sample(out)[...,:t] + x.permute((0, 2, 1, 3)).reshape((b, c*f, -1)) # 上采样后保持和输入shape一致 + out = out.reshape((b,f,c,out.shape[-1])).permute((0,2,1,3)) + return out + + def streaming_forward(self, x: torch.Tensor, cache: StreamingCache, layer_name: str): + t = x.size()[-1] + + # cnn streaming + x_padded = x + for block_idx, block in enumerate(self.cnn_block): + x_padded, cache = block.streaming_forward(x_padded, cache, f"{layer_name}_{block_idx}") + + out = self.reduce_conv(x_padded) + out_t = t//self.scale_t + + b, c, f, _ = out.size() + + x2 = out.permute((0, 2, 1, 3)).reshape((b, c*f, -1)) + out = self.reduce_project(x2) + + # pos_conv streaming + pos_cache_key = f"{layer_name}_pos_input" + prev_pos_cache = cache.get_pos_cache(pos_cache_key) + + if prev_pos_cache is not None: + out_padded = torch.cat([prev_pos_cache, out], dim=-1) + else: + out_padded = out + + cache_frames = min(self.pos_conv_receptive_field, out_padded.size(-1)) + cache.set_pos_cache(pos_cache_key, out_padded[..., -cache_frames:].detach()) + + out = out + self.pos_conv(out_padded)[:,:,-out_t:] # cache 后截断当前chunk该有的长度 + + # Transformer KV Cache + prev_kv_cache = cache.get_kv_cache(f"{layer_name}_kv") + out, new_kv_cache = self.transformer(out, use_cache=True, kv_cache=prev_kv_cache, causal=True) + cache.set_kv_cache(f"{layer_name}_kv", new_kv_cache[0], new_kv_cache[1]) + + out = self.expansion_project(out) + out = out + x2 + + out = self.up_sample(out)[...,:t] + x.permute((0, 2, 1, 3)).reshape((b, c*f, -1)) # 上采样后保持和输入shape一致 + out = out.reshape((b,f,c,out.shape[-1])).permute((0,2,1,3)) + return out, cache + + +class DenseWeight(nn.Module): + def __init__(self, input_num, hidden_dim): + super().__init__() + self.inputs_weights = nn.Parameter(torch.zeros(1, input_num, hidden_dim, 1), requires_grad=True) + + def forward(self, xs): + w = F.softmax(self.inputs_weights, dim=1) + x = (w * xs).sum(dim=1) + return x + +# =============================== MECT ================================= +class MECT(nn.Module): + def __init__( + self, + in_channels, + feat_dim, + block1=[(16,80,16,128,4,1)] * 3, + block2=[(16,80,32,128,4,2)] + [(32,40,32,128,4,1)]*2, + block3=[(32,40,64,128,4,2)] + [(64,20,64,128,4,1)]*2, + block4=[(64,20,128,128,4,2)] + [(128,10,128,128,4,1)]*2, + moe_type="local", + num_experts_shard=2, + num_experts_token=2, + top_k_shard=None, + top_k_token=None, + shard_scale=1.0, + causal=False + ): + super().__init__() + if not causal: + self.head = nn.Sequential( + nn.Conv2d(1, in_channels, kernel_size=3, stride=1, padding=1), + nn.BatchNorm2d(in_channels, affine=True), + ) + else: + self.head = nn.Sequential( + nn.ConstantPad2d((2, 0, 1, 1), 0), + nn.Conv2d(1, in_channels, kernel_size=3, stride=1, padding=0), + nn.BatchNorm2d(in_channels, affine=True), + ) + + self.moe_type=moe_type + self.num_experts_shard=num_experts_shard + self.num_experts_token=num_experts_token + self.top_k_shard=top_k_shard + self.top_k_token=top_k_token + self.shard_scale=shard_scale + self.causal = causal + + self.in_channels = in_channels + self.feat_dim = feat_dim + self.channels = in_channels*feat_dim + self.mect_block1 = self._make_layer(MECT_block, block1) + self.mect_block2 = self._make_layer(MECT_block, block2) + self.mect_block3 = self._make_layer(MECT_block, block3) + self.mect_block4 = self._make_layer(MECT_block, block4) + + self.dense3 = DenseWeight(4, self.channels) + + + def _make_layer(self, block, block_cfg): + layers = [] + for cnn_num, out_channels, hidden_dims, group_divisor, stride, moe, expansion in block_cfg: + layers.append( + block(cnn_num, self.in_channels, out_channels, self.feat_dim, hidden_dims, group_divisor, stride=stride, moe=moe, + moe_type=self.moe_type, + num_experts_shard=self.num_experts_shard, + num_experts_token=self.num_experts_token, + top_k_shard=self.top_k_shard, + top_k_token=self.top_k_token, + shard_scale=self.shard_scale, expansion=expansion, causal=self.causal + ) + ) + scale_f = stride[0] if isinstance(stride, tuple) else stride + self.in_channels = out_channels + self.feat_dim = int(self.feat_dim // scale_f) + return nn.Sequential(*layers) + + def forward(self, x, device_labels=None): + x = x.unsqueeze(1) + x = self.head(x) + + x = self.mect_block1(x) + feat_1 = x.permute((0, 2, 1, 3)).reshape(x.size(0), -1, x.size(-1)) + + x = self.mect_block2(x) + feat_2 = x.permute((0, 2, 1, 3)).reshape(x.size(0), -1, x.size(-1)) + + x = self.mect_block3(x) + feat_3 = x.permute((0, 2, 1, 3)).reshape(x.size(0), -1, x.size(-1)) + + x = self.mect_block4(x) + feat_4 = x.permute((0, 2, 1, 3)).reshape(x.size(0), -1, x.size(-1)) + + x = self.dense3(torch.cat([feat_1.unsqueeze(1), feat_2.unsqueeze(1), feat_3.unsqueeze(1), feat_4.unsqueeze(1)], dim=1)) + return x + + + def get_out_dim(self): + return self.channels + + def streaming_forward(self, x: torch.Tensor, cache: StreamingCache, device_labels=None): + x = x.unsqueeze(1) + t = x.size()[-1] + + # [streaming head] + prev_input_cache = cache.get_conv2d_cache("head_cnn_input") + if prev_input_cache is not None: + x_padded = torch.cat([prev_input_cache, x], dim=-1) + else: + x_padded = x + cache.set_conv2d_cache("head_cnn_input", x_padded[..., -2:].detach()) + + x = self.head(x_padded)[:,:,:,-t:] + + # Block 1 + for block_idx, block in enumerate(self.mect_block1): + x, cache = block.streaming_forward(x, cache, f"block1_{block_idx}") + feat_1 = x.permute((0, 2, 1, 3)).reshape(x.size(0), -1, x.size(-1)) + + # Block 2 + for block_idx, block in enumerate(self.mect_block2): + x, cache = block.streaming_forward(x, cache, f"block2_{block_idx}") + feat_2 = x.permute((0, 2, 1, 3)).reshape(x.size(0), -1, x.size(-1)) + + # # Block 3 + for block_idx, block in enumerate(self.mect_block3): + x, cache = block.streaming_forward(x, cache, f"block3_{block_idx}") + feat_3 = x.permute((0, 2, 1, 3)).reshape(x.size(0), -1, x.size(-1)) + + # Block 4 + for block_idx, block in enumerate(self.mect_block4): + x, cache = block.streaming_forward(x, cache, f"block4_{block_idx}") + feat_4 = x.permute((0, 2, 1, 3)).reshape(x.size(0), -1, x.size(-1)) + + x = self.dense3(torch.cat([ + feat_1.unsqueeze(1), + feat_2.unsqueeze(1), + feat_3.unsqueeze(1), + feat_4.unsqueeze(1) + ], dim=1)) + + return x, cache + + def streaming_inference_test(self, x, chunk_size): + total_time = x.size()[-1] + cache = self.create_streaming_cache() + stream_outputs = [] + for i in range(0, total_time, chunk_size): + chunk = x[..., i:i+chunk_size] + if chunk.size()[-1] < chunk_size: + continue + out_chunk, cache = self.streaming_forward(chunk, cache) + stream_outputs.append(out_chunk) + streaming_output = torch.cat(stream_outputs, dim=-1) + return streaming_output + + + def create_streaming_cache(self) -> StreamingCache: + return StreamingCache() + + +@register_backbone.register_module("MECT_A1") +class MECT_A1(MECT): + def __init__(self, config={}): + in_channels=16 + feat_dim=80 + hidden_dim=64 + conv_group=1 + super().__init__( + in_channels=in_channels, + feat_dim=feat_dim, + block1=[(2, 16, hidden_dim, conv_group, 1, True, 4)] * 2, + block2=[(2, 32, hidden_dim, conv_group, (2,1), True, 2)] + [(2, 32, hidden_dim, conv_group, (1,2), True, 2)]*3, + block3=[(2, 64, hidden_dim, conv_group, (2,1), True, 2)] + [(2, 64, hidden_dim, conv_group, (1,2), True, 2)]*4, + block4=[(2, 128, hidden_dim, conv_group, (2,1), True, 1)] + [(1, 128, hidden_dim, conv_group, (1,2), True, 1)]*2, + moe_type=config.get("moe_type", "token"), + num_experts_shard=config.get("num_experts_shard", 2), + num_experts_token=config.get("num_experts_token", 4), + top_k_shard=config.get("top_k_shard", None), + top_k_token=config.get("top_k_token", None), + shard_scale=config.get("shard_scale", 1.0), + causal=config.get("causal", False) + ) + + +@register_backbone.register_module("MECT_A2") +class MECT_A2(MECT): + def __init__(self, config={}): + in_channels=16 + feat_dim=80 + hidden_dim=64 + conv_group=1 + super().__init__( + in_channels=in_channels, + feat_dim=feat_dim, + block1=[(3, 16, hidden_dim, conv_group, 1, True, 4)] * 2, + block2=[(3, 32, hidden_dim, conv_group, (2,1), True, 2)] + [(3, 32, hidden_dim, conv_group, (1,2), True, 2)]*3, + block3=[(3, 64, hidden_dim, conv_group, (2,1), True, 2)] + [(3, 64, hidden_dim, conv_group, (1,2), True, 2)]*4, + block4=[(3, 128, hidden_dim, conv_group, (2,1), True, 1)] + [(2, 128, hidden_dim, conv_group, (1,2), True, 1)]*2, + moe_type=config.get("moe_type", "token"), + num_experts_shard=config.get("num_experts_shard", 2), + num_experts_token=config.get("num_experts_token", 4), + top_k_shard=config.get("top_k_shard", None), + top_k_token=config.get("top_k_token", None), + shard_scale=config.get("shard_scale", 1.0), + causal=config.get("causal", False) + ) + + +@register_backbone.register_module("MECT_B1") +class MECT_B1(MECT): + def __init__(self, config={}): + in_channels=32 + feat_dim=80 + hidden_dim=64 + conv_group=1 + super().__init__( + in_channels=in_channels, + feat_dim=feat_dim, + block1=[(2, 32, hidden_dim, conv_group, 1, True, 4)] * 2, + block2=[(2, 64, hidden_dim, conv_group, (2,1), True, 2)] + [(2, 64, hidden_dim, conv_group, (1,2), True, 2)]*3, + block3=[(2, 128, hidden_dim, conv_group, (2,1), True, 2)] + [(2, 128, hidden_dim, conv_group, (1,2), True, 2)]*4, + block4=[(2, 256, hidden_dim, conv_group, (2,1), True, 1)] + [(1, 256, hidden_dim, conv_group, (1,2), True, 1)]*2, + moe_type=config.get("moe_type", "token"), + num_experts_shard=config.get("num_experts_shard", 2), + num_experts_token=config.get("num_experts_token", 4), + top_k_shard=config.get("top_k_shard", None), + top_k_token=config.get("top_k_token", None), + shard_scale=config.get("shard_scale", 1.0), + causal=config.get("causal", False) + ) + + +@register_backbone.register_module("MECT_B2") +class MECT_B2(MECT): + def __init__(self, config={}): + in_channels=32 + feat_dim=80 + hidden_dim=64 + conv_group=1 + super().__init__( + in_channels=in_channels, + feat_dim=feat_dim, + block1=[(3, 32, hidden_dim, conv_group, 1, True, 4)] * 2, + block2=[(3, 64, hidden_dim, conv_group, (2,1), True, 2)] + [(3, 64, hidden_dim, conv_group, (1,2), True, 2)]*3, + block3=[(3, 128, hidden_dim, conv_group, (2,1), True, 2)] + [(3, 128, hidden_dim, conv_group, (1,2), True, 2)]*4, + block4=[(3, 256, hidden_dim, conv_group, (2,1), True, 1)] + [(2, 256, hidden_dim, conv_group, (1,2), True, 1)]*2, + moe_type=config.get("moe_type", "token"), + num_experts_shard=config.get("num_experts_shard", 2), + num_experts_token=config.get("num_experts_token", 4), + top_k_shard=config.get("top_k_shard", None), + top_k_token=config.get("top_k_token", None), + shard_scale=config.get("shard_scale", 1.0), + causal=config.get("causal", False) + ) + +@register_backbone.register_module("MECT_B2_Causal") +class MECT_B2_Causal(MECT): + def __init__(self, config={}): + in_channels=32 + feat_dim=80 + hidden_dim=64 + conv_group=1 + super().__init__( + in_channels=in_channels, + feat_dim=feat_dim, + block1=[(3, 32, hidden_dim, conv_group, 1, True, 4)] * 2, + block2=[(3, 64, hidden_dim, conv_group, (2,1), True, 2)] + [(3, 64, hidden_dim, conv_group, (1,2), True, 2)]*3, + block3=[(3, 128, hidden_dim, conv_group, (2,1), True, 2)] + [(3, 128, hidden_dim, conv_group, (1,2), True, 2)]*4, + block4=[(3, 256, hidden_dim, conv_group, (2,1), True, 1)] + [(2, 256, hidden_dim, conv_group, (1,2), True, 1)]*2, + moe_type=config.get("moe_type", "token"), + num_experts_shard=config.get("num_experts_shard", 2), + num_experts_token=config.get("num_experts_token", 4), + top_k_shard=config.get("top_k_shard", None), + top_k_token=config.get("top_k_token", None), + shard_scale=config.get("shard_scale", 1.0), + causal=config.get("causal", True) + ) diff --git a/zonos3/models/third_party/antspeaker/models/backbones/moe.py b/zonos3/models/third_party/antspeaker/models/backbones/moe.py new file mode 100644 index 0000000000000000000000000000000000000000..a279b84d68ae7948d1a85bcfb9f56edf4b3dbbd6 --- /dev/null +++ b/zonos3/models/third_party/antspeaker/models/backbones/moe.py @@ -0,0 +1,245 @@ +# Copyright (c) 2026 Ant Group Co., Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import torch +import torch.nn as nn +from torch import Tensor +import torch.nn.functional as F +import math + + +class NewGELUActivation(nn.Module): + def forward(self, input: Tensor) -> Tensor: + return 0.5 * input * (1.0 + torch.tanh(math.sqrt(2.0 / math.pi) * (input + 0.044715 * torch.pow(input, 3.0)))) + + + +class TokenSMoE(nn.Module): + def __init__(self, hidden_size, intermediate_size, num_experts=6): + super().__init__() + self.hidden_size = hidden_size + self.num_experts = num_experts + self.gate = nn.Linear(self.hidden_size, self.num_experts, bias=False) + self.experts = nn.Linear(self.hidden_size, intermediate_size * self.num_experts, bias=False) + self.act_fn = NewGELUActivation() + + def forward(self, hidden_states: torch.Tensor) -> torch.Tensor: + batch_size, sequence_length, hidden_dim = hidden_states.shape + hidden_states = hidden_states.view(-1, hidden_dim) + router_logits = self.gate(hidden_states) + + routing_weights = F.softmax(router_logits, dim=1, dtype=torch.float) + + hidden_states_experts = self.act_fn(self.experts(hidden_states)).view(-1, self.num_experts, hidden_dim) + experts_out = hidden_states_experts * routing_weights.unsqueeze(2) + experts_out = experts_out.sum(dim=1).reshape(batch_size, sequence_length, hidden_dim) + + return experts_out + +class UtteranceSMoE(nn.Module): + def __init__(self, hidden_size, intermediate_size, num_experts=6): + super().__init__() + self.hidden_size = hidden_size + self.num_experts = num_experts + self.intermediate_size = intermediate_size + + self.gate = nn.Linear(hidden_size, num_experts, bias=False) + self.experts = nn.Linear(hidden_size, intermediate_size * num_experts, bias=False) + self.act_fn = NewGELUActivation() + + def forward(self, hidden_states: torch.Tensor) -> torch.Tensor: + B, seq_len, hidden_dim = hidden_states.shape + + utterance_feat = hidden_states.mean(dim=1) + router_logits = self.gate(utterance_feat) + routing_weights = F.softmax(router_logits, dim=1) # [B, num_experts] + + expert_outputs = self.experts(hidden_states) + expert_outputs = expert_outputs.view(B, seq_len, self.num_experts, self.intermediate_size) + expert_outputs = self.act_fn(expert_outputs) # [B, seq_len, num_experts,intermediate_size] + + routing_weights = routing_weights.unsqueeze(1).unsqueeze(-1) + + weighted = expert_outputs * routing_weights + + output = weighted.sum(dim=2) + + return output + + +class TokenMoE(nn.Module): + def __init__(self, hidden_size, intermediate_size, num_experts=6, top_k=1): + super().__init__() + self.hidden_size = hidden_size + self.intermediate_size = intermediate_size + self.num_experts = num_experts + self.top_k = min(top_k, num_experts) + + self.gate = nn.Linear(hidden_size, num_experts, bias=False) + + self.experts = nn.ModuleList([ + nn.Linear(hidden_size, intermediate_size, bias=False) + for _ in range(num_experts) + ]) + + self.act_fn = NewGELUActivation() + + def forward(self, hidden_states): + B, seq_len, hidden_dim = hidden_states.shape + + hidden_flat = hidden_states.view(-1, hidden_dim) # [B*seq_len, hidden] + + gate_logits = self.gate(hidden_flat) # [B*seq_len, num_experts] + top_logits, top_idx = torch.topk(gate_logits, self.top_k, dim=1) # [B*seq, K] + top_weights = F.softmax(top_logits.float(), dim=1) # [B*seq, K] + + experts_out = torch.zeros( + B * seq_len, self.intermediate_size, + device=hidden_states.device, dtype=hidden_states.dtype + ) + + for k_idx in range(self.top_k): + for e_idx in range(self.num_experts): + mask = (top_idx[:, k_idx] == e_idx) + if not mask.any(): + continue + + expert_input = hidden_flat[mask] # [N, hidden] + expert_output = self.experts[e_idx](expert_input) # [N, intermediate] + expert_output = self.act_fn(expert_output) + + experts_out[mask] += expert_output * top_weights[mask, k_idx:k_idx+1] + + experts_out = experts_out.view(B, seq_len, self.intermediate_size) + + return experts_out + + +class UtteranceMoE(nn.Module): + """ + 整句级别MoE:一条语音的所有帧共享相同的专家选择 + """ + def __init__(self, hidden_size, intermediate_size, num_experts=6, top_k=1): + super().__init__() + self.hidden_size = hidden_size + self.intermediate_size = intermediate_size + self.num_experts = num_experts + self.top_k = min(top_k, num_experts) + + self.gate = nn.Linear(hidden_size, num_experts, bias=False) + + self.experts = nn.ModuleList([ + nn.Linear(hidden_size, intermediate_size, bias=False) + for _ in range(num_experts) + ]) + + self.act_fn = NewGELUActivation() + + def forward(self, hidden_states): + B, seq_len, hidden_dim = hidden_states.shape + + utterance_feat = hidden_states.mean(dim=1) # [B, hidden_size] + gate_logits = self.gate(utterance_feat) # [B, num_experts] + + top_logits, top_idx = torch.topk(gate_logits, self.top_k, dim=1) # [B, K] + top_weights = F.softmax(top_logits, dim=1).unsqueeze(-1) # [B, K, 1] + + experts_out = torch.zeros( + B, seq_len, self.intermediate_size, + device=hidden_states.device, dtype=hidden_states.dtype + ) + + for k_idx in range(self.top_k): + expert_ids = top_idx[:, k_idx] # [B] + weights = top_weights[:, k_idx] # [B, 1] + + for e_idx in range(self.num_experts): + mask = (expert_ids == e_idx) # [B] + if not mask.any(): + continue + + expert_input = hidden_states[mask] # [N, seq_len, hidden] + expert_output = self.experts[e_idx](expert_input) # [N, seq_len, intermediate] + expert_output = self.act_fn(expert_output) + + experts_out[mask] += expert_output * weights[mask].unsqueeze(1) + + return experts_out + + +class HybridMoE(nn.Module): + def __init__( + self, + hidden_size, + intermediate_size, + num_experts_shard=6, + num_experts_token=6, + top_k_shard=None, + top_k_token=None, + moe_type="shard", + shard_scale=1, + ): + super().__init__() + self.hidden_size = hidden_size + self.intermediate_size = intermediate_size + + if moe_type == "shard": + if top_k_shard is not None: + self.shard_moe = UtteranceMoE( + hidden_size, intermediate_size, num_experts=num_experts_shard, top_k=top_k_shard + ) + else: + self.shard_moe = UtteranceSMoE( + hidden_size, intermediate_size, num_experts=num_experts_shard + ) + elif moe_type == "token": + if top_k_token is not None: + self.token_moe = TokenMoE( + hidden_size, intermediate_size, num_experts=num_experts_token, top_k=top_k_token + ) + else: + self.token_moe = TokenSMoE( + hidden_size, intermediate_size, num_experts=num_experts_token + ) + elif moe_type == "hmoe": + if top_k_shard is not None: + self.shard_moe = UtteranceMoE( + hidden_size, intermediate_size, num_experts=num_experts_shard, top_k=top_k_shard + ) + else: + self.shard_moe = UtteranceSMoE( + hidden_size, intermediate_size, num_experts=num_experts_shard + ) + if top_k_token is not None: + self.token_moe = TokenMoE( + hidden_size, intermediate_size, num_experts=num_experts_token, top_k=top_k_token + ) + else: + self.token_moe = TokenSMoE( + hidden_size, intermediate_size, num_experts=num_experts_token + ) + + self.moe_type = moe_type + self.shard_scale = shard_scale + + def forward(self, hidden_states, return_aux_loss=False): + if self.moe_type == "hmoe": + out = self.shard_moe(hidden_states) + out = self.token_moe(out) + out = out + hidden_states + elif self.moe_type == "shard": + out = self.shard_moe(hidden_states) + elif self.moe_type == "token": + out = self.token_moe(hidden_states) + return out diff --git a/zonos3/models/third_party/antspeaker/models/model.py b/zonos3/models/third_party/antspeaker/models/model.py new file mode 100644 index 0000000000000000000000000000000000000000..53a2a6128f4708dd1e03c4028a488df8cdfd77cc --- /dev/null +++ b/zonos3/models/third_party/antspeaker/models/model.py @@ -0,0 +1,64 @@ +# Copyright (c) 2026 Ant Group Co., Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import torch +import torch.nn as nn + +from zonos3.models.third_party.antspeaker.models.backbones import * +from zonos3.models.third_party.antspeaker.models.poolings import * +from zonos3.models.third_party.antspeaker.utils.registry import register_model, create_backbone, create_pooling + +@register_model.register_module("VPR") +class VPR(nn.Module): + """ + For recognition tasks that need to extract vectors: speaker recognition + """ + def __init__(self, config): + super().__init__() + self.cmn = config.get('cmn', True) + self.feature_extractor = create_backbone(config["backbone"]) + config["pooling"]["input_dim"] = self.feature_extractor.get_out_dim() + self.encoding_layers = create_pooling(config["pooling"]) + self.pool_out_dim = self.encoding_layers.get_out_dim() + self.bn = nn.BatchNorm1d(self.pool_out_dim) + self.embed_dim = config.get("embed_dim", 192) + self.linear = nn.Linear(self.pool_out_dim, self.embed_dim, bias=False) + + def forward(self, inputs): + if self.cmn: + with torch.no_grad(): + inputs = inputs - torch.mean(inputs, -1, keepdim=True) + x = self.feature_extractor(inputs) + x = self.encoding_layers(x) + embeddings = self.linear(self.bn(x)) + return embeddings + + def load_model(self, checkpoint_path): + checkpoint = torch.load(checkpoint_path, map_location=torch.device("cpu")) + own_state = self.state_dict() + for name, param in checkpoint["model"].items(): + if name not in own_state: + print ('{} not found'.format(name)) + continue + if param.data.shape != own_state[name].shape: + print ('{} not found different shape'.format(name)) + continue + # print ('{} loaded'.format(name)) + param = param.data + own_state[name].copy_(param) + for name in own_state: + if name not in checkpoint["model"]: + print('{} not found in checkpoint'.format(name)) + return self, checkpoint + diff --git a/zonos3/models/third_party/antspeaker/models/poolings.py b/zonos3/models/third_party/antspeaker/models/poolings.py new file mode 100644 index 0000000000000000000000000000000000000000..26b14c9d37ef92d966d32816858145626f6262b7 --- /dev/null +++ b/zonos3/models/third_party/antspeaker/models/poolings.py @@ -0,0 +1,164 @@ +# Copyright (c) 2026 Ant Group Co., Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import torch +import torch.nn as nn +import torch.nn.functional as F +import numpy as np +import sys +sys.path.append("../../") +from zonos3.models.third_party.antspeaker.utils.registry import register_pooling, create_pooling + + +@register_pooling.register_module("stats") +class Stats_pooling(nn.Module): + def __init__(self, input_dim=1500, config={}): + super().__init__() + self.input_dim = input_dim + self.mean = config.get("mean", True) + self.std = config.get("std", True) + self.combine_type = config.get("combine_type", "cat") # cat or div + + assert self.mean or self.std + assert self.combine_type == "cat"or self.combine_type == "div" + if self.mean and self.std and self.combine_type == "cat": + self.out_dim = 2 * self.input_dim + else: + self.out_dim = self.input_dim + + def forward(self, x): + """ + x.size() = [batch_size, frame, input_dim] + for x-vector the input_dim is 1500 + """ + if len(x.shape) == 4: + x = x.reshape(x.shape[0], -1, x.shape[-1]) + mean_frame = torch.mean(x, -1, keepdim=False) + std_frame = torch.sqrt(torch.var(x, dim=-1, keepdim=False) + 1e-7) + if self.std: + if self.mean: + if self.combine_type == "cat": + output = torch.cat([mean_frame, std_frame], dim=-1) + else: + output = mean_frame / std_frame.clamp(min=1e-10) + else: + output = std_frame + else: + output = mean_frame + output = output.view(-1, self.out_dim) + return output + + def get_out_dim(self): + return self.out_dim + + +@register_pooling.register_module("MQMHA") +class MQMHA(nn.Module): + def __init__(self, input_dim, config={}): + super(MQMHA, self).__init__() + self.input_dim = input_dim + self.num_heads = config.get("num_heads", 1) + self.num_query = config.get("num_query", 1) + self.att_bias = config.get("att_bias", False) + self.mean = config.get("mean", True) + self.std = config.get("std", True) + assert self.input_dim % self.num_heads == 0, \ + "head number should be divided by input dimension" + self.d_k = self.input_dim // self.num_heads + self.attention = nn.Conv1d(self.input_dim, self.num_query * self.num_heads, 1, stride=1, groups=self.num_heads, bias=self.att_bias) + if self.std and self.mean: + self.out_dim = input_dim * self.num_query * 2 + else: + self.out_dim = input_dim * self.num_query + + def forward(self, x): + if len(x.shape) == 4: + # as for resnet, dimension is 4 + x = x.reshape(x.shape[0], -1, x.shape[-1]) + + att = self.attention(x) # (b, num_head* num_query, t) + att = torch.softmax(att, dim=-1) # (b, num_head* num_query, t) + + att = att.reshape(att.shape[0], self.num_heads, self.num_query, att.shape[-1]).unsqueeze(-2) + x = x.reshape(x.shape[0], self.num_heads, self.d_k, x.shape[-1]).unsqueeze(-3) + + mean = torch.sum(att * x, dim=-1) + mean = mean.flatten(1) + if self.std: + var = torch.sum(torch.mul(att, x ** 2), dim=-1).flatten(1) - mean ** 2 + std = torch.sqrt(var.clamp_min(1e-8)) + if self.mean: + return torch.cat([mean, std], dim=-1) + else: + return std + else: + return mean + + + +@register_pooling.register_module("ASTP") +class ASTP(nn.Module): + """Attentive statistics pooling: Channel - and context-dependent statistics pooling, first used in ECAPA_TDNN. + """ + def __init__(self, + input_dim, + config={}): + super(ASTP, self).__init__() + self.input_dim = input_dim + self.bottleneck_dim = config.get("bottleneck_dim", 128) + self.global_context_att = config.get("global_context_att", False) + # Use Convld with stride == 1 rather than Linear, then we don't + # need to transpose inputs. + if self.global_context_att: + self.linear1 = nn.Conv1d( + input_dim * 3, self.bottleneck_dim, + kernel_size=1) # equals W and b in the paper + else: + self.linear1 = nn.Conv1d( + input_dim, self.bottleneck_dim, + kernel_size=1) # equals W and b in the paper + self.linear2 = nn.Conv1d(self.bottleneck_dim, input_dim, + kernel_size=1) # equals V and k in the paper + self.out_dim = 2 * self.input_dim + + def forward(self, x): + """ + x: a 3-dimensional tensor in tdnn-based architecture (B,F,T) + or a 4-dimensional tensor in resnet architecture (B,C,F,T) + 0-dim: batch-dimension, last-dim: time-dimension (frame-dimension) + """ + if len(x.shape) == 4: + x = x.reshape(x.shape[0], x.shape[1] * x.shape[2], x.shape[3]) + assert len(x.shape) == 3 + + if self.global_context_att: + context_mean = torch.mean(x, dim=-1, keepdim=True).expand_as(x) + context_std = torch.sqrt( + torch.var(x, dim=-1, keepdim=True) + 1e-7).expand_as(x) + x_in = torch.cat((x, context_mean, context_std), dim=1) + else: + x_in = x + + # DON'T use ReLU here! ReLU may be hard to converge. + alpha = torch.tanh(self.linear1(x_in)) # alpha= F.relu(self.linear1(x_ in)) + alpha = torch.softmax(self.linear2(alpha), dim=2) + mean = torch.sum(alpha * x, dim=2) + var = torch.sum(alpha* (x**2), dim=2) - mean**2 + std = torch.sqrt(var.clamp(min=1e-7)) + return torch.cat([mean, std], dim=1) + + def get_out_dim(self): + self.out_dim = 2 * self.input_dim + return self.out_dim + \ No newline at end of file diff --git a/zonos3/models/third_party/antspeaker/utils/__init__.py b/zonos3/models/third_party/antspeaker/utils/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/zonos3/models/third_party/antspeaker/utils/registry.py b/zonos3/models/third_party/antspeaker/utils/registry.py new file mode 100644 index 0000000000000000000000000000000000000000..a819402b165733cc5841f48013074f3f5d07c34a --- /dev/null +++ b/zonos3/models/third_party/antspeaker/utils/registry.py @@ -0,0 +1,71 @@ +# Copyright (c) 2026 Ant Group Co., Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +class Registry: + def __init__(self, name): + self.name = name + self.registry_dict = {} + + def register_module(self, module_name): + def decorator(cls): + self.registry_dict[module_name] = cls + return cls + return decorator + +register_model = Registry("model") +register_backbone = Registry("backbone") +register_pooling = Registry("pooling") +register_embedding = Registry("embedding") +register_loss = Registry("loss") +register_trainer = Registry("trainer") +register_scheduler = Registry("scheduler") + + +# 创建/加载 各类组件 + +def create_module(register, cfg_dict): + module_name = cfg_dict["type"] + if module_name not in register.registry_dict: + raise ValueError(f"Invalid module name: {module_name}") + args = cfg_dict.copy() + args.pop('type') + cls = register.registry_dict[module_name] + return cls(**args) + +def create_model(config, register=register_model): + return create_module(register_model, config) + +def create_backbone(config, register=register_backbone): + return create_module(register_backbone, config) + +def create_pooling(config, register=register_pooling): + return create_module(register_pooling, config) + +def create_embedding(config, register=register_embedding): + return create_module(register_embedding, config) + +def create_loss(config, register=register_loss): + return create_module(register_loss, config) + +def create_trainer(config, register=register_trainer): + return create_module(register_trainer, config) + +def create_scheduler(optimizer, config, register=register_scheduler): + module_name = config["type"] + if module_name not in register.registry_dict: + raise ValueError(f"Invalid module name: {type}") + args = config.copy() + args.pop('type') + cls = register.registry_dict[module_name] + return cls(optimizer, **args["config"]) \ No newline at end of file diff --git a/zonos3/reference/__init__.py b/zonos3/reference/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..76d5f41838621c92c70cd73b812de4deb2ab1488 --- /dev/null +++ b/zonos3/reference/__init__.py @@ -0,0 +1,3 @@ +"""Plain-PyTorch reference of the ZONOS3 LM and its generation features (the numerical oracle for both servers): +``lm`` (the model), ``accents`` (accent adapters), ``synth`` (a v2 GenerateRequest end to end), ``edit`` (speech-edit +infill) and the ``python -m zonos3.reference`` CLI.""" diff --git a/zonos3/reference/__main__.py b/zonos3/reference/__main__.py new file mode 100644 index 0000000000000000000000000000000000000000..3f6d04f004c54070fe487c6e648c46e9a989a826 --- /dev/null +++ b/zonos3/reference/__main__.py @@ -0,0 +1,93 @@ +"""python -m zonos3.reference --model (--text T | --request req.json) -o out.wav [options] + +Synthesizes one v2 GenerateRequest with the plain-PyTorch reference and writes 16-bit mono 44.1 kHz WAV. +``--dump-prompt ids.npy`` writes the prompt rows (float32 [rows, n_codebooks + 1]) and the ``ids.cond.json`` sidecar of +``zonos3-cli --build-prompt``; a CFG twin's rows go to ``ids.twin.npy`` / ``ids.twin.cond.json``. With +``--dump-prompt`` alone nothing is generated. +""" + +from __future__ import annotations + +import argparse +import json +import sys +import wave +from pathlib import Path + +import numpy as np +import torch + +from zonos3.generation import SAMPLE_RATE + + +def _cond_path(ids_path: Path) -> Path: + return ids_path.with_suffix(".cond.json") if ids_path.suffix == ".npy" else Path(str(ids_path) + ".cond.json") + + +def _dump(path: Path, rows: torch.Tensor, cond: dict) -> None: + np.save(path, rows.to(torch.float32).numpy()) + _cond_path(path).write_text(json.dumps(cond) + "\n") + + +def write_wav(path: str | Path, pcm: np.ndarray, sample_rate: int = SAMPLE_RATE) -> None: + samples = (np.clip(pcm, -1.0, 1.0) * 32767.0).astype(" int: + parser = argparse.ArgumentParser(prog="python -m zonos3.reference", description=__doc__, + formatter_class=argparse.RawDescriptionHelpFormatter) + parser.add_argument("--model", required=True, help="LM checkpoint directory or hf:// folder") + source = parser.add_mutually_exclusive_group(required=True) + source.add_argument("--text") + source.add_argument("--request", help="v2 GenerateRequest JSON file") + parser.add_argument("-o", "--out", help="output WAV") + parser.add_argument("--device", default="cuda" if torch.cuda.is_available() else "cpu") + parser.add_argument("--dtype", choices=("f32", "bf16"), default="f32") + parser.add_argument("--steer-bundle") + parser.add_argument("--accent-adapters") + parser.add_argument("--laci-heads", action="append", default=[], metavar="LANG=PATH") + parser.add_argument("--dump-prompt", metavar="IDS_NPY") + args = parser.parse_args(argv) + if not args.out and not args.dump_prompt: + parser.error("-o/--out is required unless --dump-prompt is given") + heads = {} + for item in args.laci_heads: + lang, sep, path = item.partition("=") + if not sep or not lang or not path: + parser.error(f"--laci-heads needs LANG=PATH, got {item!r}") + heads[lang] = path + request = {"text": args.text} if args.text is not None else json.loads(Path(args.request).read_text()) + + from zonos3.reference.lm import Zonos3LM + from zonos3.reference.synth import ReferenceAssets, plan_prompt, synthesize + + device = torch.device(args.device) + dtype = torch.float32 if args.dtype == "f32" else torch.bfloat16 + lm = Zonos3LM.load(args.model, device=device, dtype=dtype) + assets = ReferenceAssets.load(steer_bundle=args.steer_bundle, accent_adapters=args.accent_adapters, + laci_heads=heads) + if args.dump_prompt: + plan = plan_prompt(lm, request, assets=assets, device=device) + path = Path(args.dump_prompt) + _dump(path, plan.cond.input_ids, plan.cond_json()) + if plan.twin is not None: + twin = path.with_name(path.stem + ".twin" + (path.suffix or ".npy")) + _dump(twin, plan.twin.input_ids, plan.cond_json(plan.twin)) + print(f"prompt: {len(plan.cond.input_ids)} rows -> {path}" + (f" (+ {plan.cfg_kind} twin)" if plan.twin is not None else "")) + if args.out: + result = synthesize(lm, request, assets=assets, device=device, dtype=dtype) + write_wav(args.out, result.pcm) + seconds = len(result.pcm) / SAMPLE_RATE + print(f"{seconds:.2f} s, seed {result.seed}, {len(result.rows)} rows, eos frame {result.eos_frame} -> {args.out}") + if result.laci is not None: + print(json.dumps(result.laci)) + return 0 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/zonos3/reference/accents.py b/zonos3/reference/accents.py new file mode 100644 index 0000000000000000000000000000000000000000..ec45fedf6972ac81a7a338de0a1800da84d04d55 --- /dev/null +++ b/zonos3/reference/accents.py @@ -0,0 +1,76 @@ +"""Accent adapters on the reference LM: ``base + strength * adapter`` (the sgl server's per-request shifts). + +A target linear adds ``strength * ((x @ down.T) @ up)`` to its flat ``[out, in]`` product, the router adds +``strength * shift`` to its balancing biases, and each routed (token, expert) pair adds +``strength * up[e] @ (down[e] @ row)`` to its gate/up pre-activation (w13, SonicExperts interleaved rows) and its +expert output (w2) -- zonos3_sgl.layers.accent ``accent_shift`` / ``accent_router_bias`` / ``expert_pair_shift``. +""" + +from __future__ import annotations + +from dataclasses import dataclass + +import torch + +from zonos3.models.accent_format import AccentAdapter + + +@dataclass(frozen=True) +class AccentState: + adapter: AccentAdapter + strength: float + + @classmethod + def for_model(cls, lm, adapter: AccentAdapter, strength: float) -> "AccentState": + """The adapter's factors on ``lm``'s device and dtype, checked against its weights.""" + params = dict(lm.named_parameters()) + device, dtype = lm.device, lm.dtype + + def weight(module: str) -> torch.Tensor: + found = params.get(module + ".weight") + if found is None: + raise ValueError(f"accent {adapter.name!r} targets {module!r}, which the model lacks") + return found + + linear = {} + for module, (down, up) in adapter.linear.items(): + if adapter.shapes[module] != tuple(weight(module).shape): + raise ValueError(f"{adapter.name}: {module}.weight shape {adapter.shapes[module]} != model " + f"{tuple(weight(module).shape)}") + linear[module] = (down.to(device, dtype), up.to(device, dtype)) + experts = {} + for module, weights in adapter.experts.items(): + served = {"w13": params.get(module + ".gate_up_proj"), "w2": params.get(module + ".down_proj")} + if served["w13"] is None: + raise ValueError(f"accent {adapter.name!r} has expert factors on {module!r}, which is not MoE experts") + for name, (up, down) in weights.items(): + if (up.shape[0], up.shape[1], down.shape[2]) != tuple(served[name].shape): + raise ValueError(f"{adapter.name}: {module}.{name} factors do not shift the model's " + f"[E, out, in] {tuple(served[name].shape)}") + experts[module] = {name: (up.to(device, dtype), down.to(device, dtype)) for name, (up, down) in weights.items()} + router_bias = {} + for module, shift in adapter.router_bias.items(): + biases = params.get(module + ".balancing_biases") + if biases is None or biases.shape != shift.shape: + raise ValueError(f"accent {adapter.name!r} shifts {module}.balancing_biases, not a router of the model") + router_bias[module] = shift.to(device, torch.float32) + moved = AccentAdapter(adapter.name, adapter.format, linear, adapter.shapes, experts, router_bias) + return cls(moved, float(strength)) + + def linear(self, module: str, x: torch.Tensor, y: torch.Tensor) -> torch.Tensor: + factors = self.adapter.linear.get(module) + if factors is None: + return y + down, up = factors + return y + ((x @ down.T) * self.strength) @ up + + def router_bias(self, module: str, bias: torch.Tensor) -> torch.Tensor: + shift = self.adapter.router_bias.get(module) + return bias if shift is None else bias + self.strength * shift + + def expert_shift(self, module: str, weight: str, expert: int, row: torch.Tensor) -> torch.Tensor | None: + factors = self.adapter.experts.get(module, {}).get(weight) + if factors is None: + return None + up, down = factors + return self.strength * (up[expert] @ (down[expert] @ row)) diff --git a/zonos3/reference/edit.py b/zonos3/reference/edit.py new file mode 100644 index 0000000000000000000000000000000000000000..395598c5185ccf7049b03b115240d2da1813fb5d --- /dev/null +++ b/zonos3/reference/edit.py @@ -0,0 +1,73 @@ +"""Reference speech-edit infill: each masked span generated until the span-end token (zonos3_sgl TTSLLM.edit). + +The prompt is the training edit layout of zonos3.tts.edit (text, the unmasked context with infill markers, the fills +generated so far, the next marker), behind the condition rows and the speaker row like any prompt. The caller splices +the fills into the clip with ``zonos3.tts.edit.splice_edit``. +""" + +from __future__ import annotations + +from dataclasses import replace + +import torch + +from zonos3.condition_buckets import check_ids +from zonos3.reference.lm import Zonos3LM +from zonos3.reference.synth import Sampling, generate_rows, prompt_builder +from zonos3.tts.edit import edit_marker_rows, edit_prompt_tokens, extract_fill, validate_edit_spans +from zonos3.tts.plan import Branch + + +@torch.inference_mode() +def generate_edit_fill( + lm: Zonos3LM, + codes, + spans, + text_rows, + sampling: Sampling, + seed: int, + *, + speaker_embedding: torch.Tensor | None = None, + condition_values: list[int] | None = None, + min_frames: list[int] | None = None, + max_tokens: int = 1024, + accents=None, +) -> tuple[list[torch.Tensor], list[int | None]]: + """Fill every span ``(start, length)`` of ``codes`` [frames, n_codebooks] for the target ``text_rows`` (the prompt + builder's rows of the edited transcript). Returns the fills ([frames, n_codebooks] codec codes each) and each fill's + aligned span-end frame (None when it hit ``max_tokens``). Every span generates with ``seed``; ``min_frames`` (one per + span) masks the span-end token until the fill has that many frames.""" + c = lm.config + if c.span_end_id is None: + raise ValueError("Speech editing needs a checkpoint with a span-end audio token (span_end_id); " + "this checkpoint only has the end-of-utterance token") + builder = prompt_builder(lm) + max_spans = edit_marker_rows(c.text_extra_tokens, builder.config.text_tokenizer_spec) + if max_spans <= 0: + raise ValueError("Speech editing needs edit marker rows; this checkpoint's extra text rows are phoneme tokens") + codes = torch.as_tensor(codes, dtype=torch.int64, device="cpu") + validate_edit_spans(spans, len(codes), max_spans) + if codes.ndim != 2 or codes.shape[1] != c.n_codebooks or bool(((codes < 0) | (codes >= c.codebook_size)).any()): + raise ValueError("Invalid input codec frames") + values = list(c.condition_bucket_counts) if condition_values is None else condition_values + values = check_ids(values, c.condition_bucket_counts, "condition_values") + lead = [builder.condition_rows(c.condition_count)] + if speaker_embedding is not None: + lead.insert(0, builder.speaker_slot()) + start = 1 if speaker_embedding is not None else 0 + fills: list[torch.Tensor] = [] + eos_frames: list[int | None] = [] + for region in range(len(spans)): + prompt = edit_prompt_tokens(text_rows, codes, spans, fills, builder.config, span_end_id=c.span_end_id) + branch = Branch(torch.cat(lead + [prompt]).to(torch.int32), speaker_embedding, + 0 if speaker_embedding is not None else -1, values, start, steered=False) + region_sampling = replace(sampling, min_frames=min_frames[region] if min_frames else sampling.min_frames) + attempt = generate_rows(lm, branch, sampling=region_sampling, seed=seed, max_tokens=max_tokens, + stop_id=c.span_end_id, accents=accents) + # the finishing row is not part of the generated span (it only completes the delayed codebooks' flush) + rows = torch.stack(attempt.rows[:-1])[:, : c.n_codebooks] if len(attempt.rows) > 1 else \ + torch.zeros((0, c.n_codebooks), dtype=torch.int32) + fill, _ = extract_fill(rows, attempt.eos_frame, audio_pad_id=c.audio_pad_id, codebook_sizes=c.codebook_sizes) + fills.append(fill) + eos_frames.append(attempt.eos_frame) + return fills, eos_frames diff --git a/zonos3/reference/lm.py b/zonos3/reference/lm.py new file mode 100644 index 0000000000000000000000000000000000000000..7d28dafca905c8fa7a5a875772cb2404194fa99d --- /dev/null +++ b/zonos3/reference/lm.py @@ -0,0 +1,663 @@ +"""Plain-PyTorch ZONOS3 Mini LM (GDN/global backbone with Full AttnRes): the numerical oracle. + +Parameter names are the release checkpoint's flat state dict (``model.pth``; ``tools/convert_gguf.py lm`` maps them +through ``LM_NAMES``), so ``Zonos3LM.load`` is a strict ``load_state_dict``. The forward is the golden CPU oracle +(formerly ``tools/dump-golden.py`` ``Reference``; ``tools/dump_golden.py lm`` runs this module) with the serving-time +inputs of the sgl server's ``Zonos3ForCausalLM._forward_model``: speaker and condition rows replace their summed +embeddings before the weightless embedding norm, and hidden steering deltas add to Full AttnRes bank sources (0 = +embedding, 2i+1 = attention/GDN output of layer i, 2i+2 = FFN/MoE output of layer i). No custom kernels: the GDN +recurrence runs token by token in float32, MoE experts run per (token, expert) pair. +""" + +from __future__ import annotations + +import json +import math +import re +from dataclasses import dataclass, field +from pathlib import Path +from typing import NamedTuple + +import torch +import torch.nn as nn +import torch.nn.functional as F + +from zonos3.condition_buckets import bucket_counts +from zonos3.tts.probe import Head, clip_window, probe_weight, readout + +GDN_HEADS, GDN_HEAD_DIM, GDN_KERNEL = 4, 128, 4 +_GDN_PATTERN = re.compile(r"gdn(\d+)_global1") + +# Architecture keys of the release LM (the converter's validate_config): params.json must carry them +# with exactly these values. +_REQUIRED = { + "residual_type": "full_attnres", + "use_xsa": False, + "speaker_enabled": True, + "condition_tokens_enabled": True, + "moe_router_type": "linear", + "moe_router_use_eda": False, + "moe_balancing_strategy": "quantile", + "moe_router_topk": 2, + "moe_start_from_layer": 1, + "moe_end_from_layer": 0, +} +# Keys the converter checks in config.yaml; params.json may carry them, and then with these values. The legacy prompt +# tokens (speaking-rate / quality / background / accurate-mode rows) and the speaker LDA are not part of this +# architecture. +_IF_PRESENT = { + "embedding_norm": True, + "qknorm": True, + "qwen_gating_style": "headwise", + "flash_msa_every_n_layers": 0, + "sliding_window": -1, + "ffn_out_norm": False, + "attn_out_norm": False, + "moe_routed_outnorm": False, + "use_eda": None, + "rope_head_dim": None, + "speaker_lda_dim": None, + "speaking_rate_num_buckets": 0, + "quality_num_buckets": 0, + "speaker_background_token_enabled": False, + "accurate_mode_token_enabled": False, +} + + +def _unsupported(key, value): + raise ValueError(f"unsupported checkpoint: {key}={value!r} (the reference implements the ZONOS3 Mini architecture)") + + +def _round_up(value: float, multiple: int) -> int: + return multiple * ((int(value) + multiple - 1) // multiple) + + +@dataclass(frozen=True) +class Zonos3LMConfig: + n_layers: int + dim: int + head_dim: int + n_heads: int + n_kv_heads: int + norm_eps: float + rope_theta: float + max_seqlen: int + loss_softcap: float + gdn_period: int # every gdn_period-th layer (layer + 1 divisible) is a global attention layer + ffn_hidden: int # dense FFN (layer 0) width + moe_hidden: int # expert width + moe_routed_dim: int # latent MoE width (dim * moe_alpha) + n_experts: int + moe_topk: int + n_codebooks: int + codebook_size: int + eoa_id: int + audio_pad_id: int + span_end_id: int | None + text_vocab: int + text_extra_tokens: int + text_tokenizer_spec: dict | None + speaker_embedding_dim: int + speaker_embedding_codec: str | None + speaker_reference_prefix_enabled: bool + speaker_reference_max_seconds: float + condition_count: int + condition_bucket_counts: tuple[int, ...] # per condition table: ids 0..n-1, n = unknown + condition_names: tuple[str, ...] + condition_edges: dict[str, tuple[float, ...]] + condition_units: dict[str, str] + audio_codec: str + + @property + def audio_vocab(self) -> int: + """Per-codebook vocabulary: codes, EOA, pad and the optional span-end.""" + return self.codebook_size + 2 + (0 if self.span_end_id is None else 1) + + @property + def text_rows(self) -> int: + """Text embedding rows: the vocabulary, the padding row and the extra rows (edit markers, phoneme tokens).""" + return self.text_vocab + 1 + self.text_extra_tokens + + @property + def codebook_sizes(self) -> tuple[int, ...]: + return (self.codebook_size,) * self.n_codebooks + + @property + def n_sources(self) -> int: + """Full AttnRes bank sources: the embedding plus two per layer.""" + return 2 * self.n_layers + 1 + + @property + def gdn_inner(self) -> int: + return GDN_HEADS * GDN_HEAD_DIM + + def uses_gdn(self, layer: int) -> bool: + return (layer + 1) % self.gdn_period != 0 + + @property + def attention_layers(self) -> tuple[int, ...]: + return tuple(layer for layer in range(self.n_layers) if not self.uses_gdn(layer)) + + @classmethod + def from_params(cls, params: dict) -> "Zonos3LMConfig": + """Validate a ``params.json`` (the whole document or its ``model`` table) and derive the module sizes.""" + p = params.get("model", params) + for key, wanted in _REQUIRED.items(): + if p.get(key) != wanted: + _unsupported(key, p.get(key)) + for key, wanted in _IF_PRESENT.items(): + # absent-equivalent None is accepted where the expected value is falsy + if key in p and p[key] != wanted and not (p[key] is None and not wanted): + _unsupported(key, p[key]) + pattern = _GDN_PATTERN.fullmatch(str(p.get("attention_pattern"))) + if pattern is None or int(pattern.group(1)) < 1: + _unsupported("attention_pattern", p.get("attention_pattern")) + n_layers, dim, head_dim = int(p["n_layers"]), int(p["dim"]), int(p["head_dim"]) + n_heads, n_kv_heads = int(p["n_heads"]), int(p["n_kv_heads"]) + if n_layers < 1 or dim < 1 or head_dim % 2 or n_heads % n_kv_heads: + _unsupported("n_layers/dim/head_dim/n_heads/n_kv_heads", (n_layers, dim, head_dim, n_heads, n_kv_heads)) + n_codebooks, codebook_size = int(p["n_codebooks"]), int(p["codebook_size"]) + sizes = p.get("codebook_sizes") or [codebook_size] * n_codebooks + if list(sizes) != [codebook_size] * n_codebooks: + _unsupported("codebook_sizes", sizes) + if int(p["eoa_id"]) != codebook_size or int(p["audio_pad_id"]) != codebook_size + 1: + _unsupported("eoa_id/audio_pad_id", (p["eoa_id"], p["audio_pad_id"])) + span_end_id = p.get("span_end_id") + if span_end_id is not None and int(span_end_id) != codebook_size + 2: + _unsupported("span_end_id", span_end_id) + text_vocab = int(p["text_vocab"]) + extra = int(p.get("text_extra_tokens", 0) or 0) + if extra < 0: + _unsupported("text_extra_tokens", extra) + spec = p.get("text_tokenizer_spec") + if spec is not None: + if (spec.get("kind"), spec.get("offset"), spec.get("bos"), spec.get("eos")) != ("superbpe", 4, 2, 3) \ + or int(spec.get("vocab_size", -1)) + 4 != text_vocab: + _unsupported("text_tokenizer_spec", {k: spec.get(k) for k in ("kind", "offset", "bos", "eos", "vocab_size")}) + phonemes = spec.get("phonemes") + if phonemes is not None: + from zonos3.tts.superbpe import phoneme_token_count, rows_before_phonemes + + if int(phonemes["open_id"]) < text_vocab + 1 or int(phonemes["close_id"]) != int(phonemes["open_id"]) + 1: + _unsupported("text_tokenizer_spec.phonemes ids", (phonemes["open_id"], phonemes["close_id"])) + if rows_before_phonemes(spec, text_vocab) + phoneme_token_count(spec) != extra: + _unsupported("text_tokenizer_spec.phonemes vs text_extra_tokens", extra) + alpha = float(p["moe_alpha"]) + if not 0.0 < alpha <= 1.0: + _unsupported("moe_alpha", alpha) + n_experts = int(p["moe_n_experts"]) + if n_experts < 2: + _unsupported("moe_n_experts", n_experts) + multiple_of = int(p.get("multiple_of", 256)) + moe_multiple_of = int(p.get("moe_multiple_of") or multiple_of) + ffn_mult = float(p["ffn_dim_multiplier"]) + moe_mult = float(p.get("moe_ffn_dim_multiplier") or ffn_mult) + names = tuple(str(n) for n in p.get("condition_names") or ()) + count = int(p["condition_count"]) + if len(names) != count: + _unsupported("condition_names", names) + try: + counts = bucket_counts(count, int(p["condition_n_buckets"]), p.get("condition_bucket_counts")) + except ValueError: + _unsupported("condition_bucket_counts", p.get("condition_bucket_counts")) + edges = {str(k): tuple(float(v) for v in vs) for k, vs in (p.get("condition_edges") or {}).items()} + for name, values in edges.items(): + if name not in names or len(values) != counts[names.index(name)] - 1 \ + or not all(math.isfinite(v) for v in values) or any(b <= a for a, b in zip(values, values[1:])): + _unsupported(f"condition_edges.{name}", values) + return cls( + n_layers=n_layers, dim=dim, head_dim=head_dim, n_heads=n_heads, n_kv_heads=n_kv_heads, + norm_eps=float(p["norm_eps"]), rope_theta=float(p["rope_theta"]), max_seqlen=int(p["max_seqlen"]), + loss_softcap=float(p["loss_softcap"]), gdn_period=int(pattern.group(1)) + 1, + ffn_hidden=_round_up(ffn_mult * dim, multiple_of), moe_hidden=_round_up(moe_mult * dim, moe_multiple_of), + moe_routed_dim=max(1, int(round(dim * alpha))), n_experts=n_experts, moe_topk=int(p["moe_router_topk"]), + n_codebooks=n_codebooks, codebook_size=codebook_size, eoa_id=int(p["eoa_id"]), + audio_pad_id=int(p["audio_pad_id"]), span_end_id=None if span_end_id is None else int(span_end_id), + text_vocab=text_vocab, text_extra_tokens=extra, text_tokenizer_spec=spec, + speaker_embedding_dim=int(p["speaker_embedding_dim"]), + speaker_embedding_codec=p.get("speaker_embedding_codec"), + speaker_reference_prefix_enabled=bool(p.get("speaker_reference_prefix_enabled", False)), + speaker_reference_max_seconds=float(p.get("speaker_reference_max_seconds", 30.0)), + condition_count=count, condition_bucket_counts=counts, condition_names=names, condition_edges=edges, + condition_units={str(k): str(v) for k, v in (p.get("condition_units") or {}).items()}, + audio_codec=str(p.get("audio_codec", "")), + ) + + +# ----------------------------------------------------------------------------------------------------- module tree + + +def _param(*shape) -> nn.Parameter: + return nn.Parameter(torch.empty(*shape), requires_grad=False) + + +class _Weight(nn.Module): + def __init__(self, *shape): + super().__init__() + self.weight = _param(*shape) + + +def _linear(n_in: int, n_out: int, bias: bool = False) -> nn.Linear: + return nn.Linear(n_in, n_out, bias=bias).requires_grad_(False) + + +class _GDN(nn.Module): + def __init__(self, c: Zonos3LMConfig): + super().__init__() + inner = c.gdn_inner + self.in_proj = _linear(c.dim, 4 * inner + 2 * GDN_HEADS) + self.conv = _Weight(3 * inner, 1, GDN_KERNEL) + self.out_weight = _param(GDN_HEAD_DIM) + self.A_log = _param(GDN_HEADS) + self.dt_bias = _param(GDN_HEADS) + self.wo = _linear(inner, c.dim) + + +class _Attention(nn.Module): + def __init__(self, c: Zonos3LMConfig): + super().__init__() + self.wq = _linear(c.dim, c.n_heads * c.head_dim) + self.wkv = _Weight(2, c.n_kv_heads * c.head_dim, c.dim) + self.wo = _linear(c.n_heads * c.head_dim, c.dim) + self.temp = _param(1, c.n_heads, 1) + self.gater = _linear(c.dim, c.n_heads) + + +class _Dense(nn.Module): + def __init__(self, c: Zonos3LMConfig): + super().__init__() + self.w_in = _Weight(2, c.ffn_hidden, c.dim) + self.w_out = _linear(c.ffn_hidden, c.dim) + + +class _Experts(nn.Module): + def __init__(self, c: Zonos3LMConfig): + super().__init__() + # gate_up_proj rows [0, moe_hidden) are the gate, [moe_hidden, 2 moe_hidden) the up projection. + self.gate_up_proj = _param(c.n_experts, 2 * c.moe_hidden, c.moe_routed_dim) + self.down_proj = _param(c.n_experts, c.moe_routed_dim, c.moe_hidden) + + +class _Router(nn.Module): + def __init__(self, c: Zonos3LMConfig): + super().__init__() + self.router_linear = _linear(c.dim, c.n_experts) + self.rmsnorm_eda = _Weight(c.dim) + self.balancing_biases = _param(c.n_experts) + + +class _MoE(nn.Module): + def __init__(self, c: Zonos3LMConfig): + super().__init__() + self.experts = _Experts(c) + self.latent_down = _linear(c.dim, c.moe_routed_dim) + self.latent_up = _linear(c.moe_routed_dim, c.dim) + self.router = _Router(c) + + +class _Layer(nn.Module): + def __init__(self, c: Zonos3LMConfig, layer: int): + super().__init__() + self.attention_norm = _Weight(c.dim) + self.ffn_norm = _Weight(c.dim) + self.attention = _GDN(c) if c.uses_gdn(layer) else _Attention(c) + self.feed_forward = _Dense(c) if layer == 0 else _MoE(c) + + +class _MultiEmbedder(nn.Module): + def __init__(self, c: Zonos3LMConfig): + super().__init__() + rows = [c.audio_vocab] * c.n_codebooks + [c.text_rows] + self.embedders = nn.ModuleList(nn.Embedding(n, c.dim).requires_grad_(False) for n in rows) + + +# ----------------------------------------------------------------------------------------------------- state + + +@dataclass +class LMCache: + """Decoding state: the absolute position of the next row, the global layers' KV ([rows, kv heads, head dim]) and + each GDN layer's recurrent state ([heads, value, key], float32) and causal-conv history ([channels, kernel - 1]).""" + + position: int = 0 + kv: dict[int, tuple[torch.Tensor, torch.Tensor]] = field(default_factory=dict) + gdn_state: dict[int, torch.Tensor] = field(default_factory=dict) + conv_state: dict[int, torch.Tensor] = field(default_factory=dict) + + def fork(self) -> "LMCache": + return LMCache( + self.position, + {k: (a.clone(), b.clone()) for k, (a, b) in self.kv.items()}, + {k: v.clone() for k, v in self.gdn_state.items()}, + {k: v.clone() for k, v in self.conv_state.items()}, + ) + + +@dataclass(frozen=True) +class ProbeSpec: + """Alignment probe of one forward (zonos3.tts.probe): the probed heads, the BOS..EOS text rows of the prompt + (absolute start, length) and the ACI windows of the masked heads (None = unmasked). Masked heads have their + attention output recomputed with the text keys outside their window at -inf (non-text keys are never masked).""" + + heads: tuple[Head, ...] + text_start: int + text_len: int + windows: dict[Head, tuple[int, int]] | None = None + + +class LMOutput(NamedTuple): + logits: torch.Tensor # [rows, n_codebooks, audio_vocab], softcapped + probe: list[tuple[int, float]] | None # (argmax, centroid) per row when a probe was given + + +# ----------------------------------------------------------------------------------------------------- math + + +def full_attnres_route(sources, query, eps): + bank = torch.stack(sources) + keys = F.rms_norm(bank, (bank.shape[-1],), eps=eps) + scores = (keys * query).sum(-1, dtype=torch.float32) + weights = scores.softmax(0).to(bank.dtype) + return (bank * weights.unsqueeze(-1)).sum(0) + + +def rope_interleaved(x, positions, theta): + hd = x.shape[-1] + frequencies = theta ** (-torch.arange(0, hd, 2, dtype=torch.float32, device=x.device) / hd) + angles = positions.float()[:, None] * frequencies[None, :] + cos, sin = angles.cos()[:, None, :], angles.sin()[:, None, :] + pairs = x.float().reshape(*x.shape[:-1], hd // 2, 2) + a, b = pairs[..., 0], pairs[..., 1] + return torch.stack((a * cos - b * sin, a * sin + b * cos), -1).flatten(-2).to(x.dtype) + + +class Zonos3LM(nn.Module): + def __init__(self, config: Zonos3LMConfig): + super().__init__() + c = self.config = config + self.multi_embedder = _MultiEmbedder(c) + self.layers = nn.ModuleList(_Layer(c, layer) for layer in range(c.n_layers)) + self.out_norm = _Weight(c.dim) + self.multi_output = _linear(c.dim, c.n_codebooks * c.audio_vocab) + self.block_attnres_queries = _param(c.n_sources, c.dim) + self.speaker_projection = _linear(c.speaker_embedding_dim, c.dim, bias=True) + self.condition_embeddings = nn.ModuleList( + nn.Embedding(n + 1, c.dim).requires_grad_(False) for n in c.condition_bucket_counts + ) + self.root: Path | None = None # checkpoint directory (set by load) + self._capture: dict | None = None + self._accents = None + + # -- loading ---------------------------------------------------------------------------------------------------- + + @classmethod + def load(cls, path_or_hf, *, device="cpu", dtype: torch.dtype = torch.float32) -> "Zonos3LM": + """Load ``params.json`` + ``model.pth`` of a checkpoint directory or ``hf://`` folder (strict).""" + from zonos3.utils.release import resolve_dir_or_local + + root = Path(resolve_dir_or_local(str(path_or_hf))) + config = Zonos3LMConfig.from_params(json.loads((root / "params.json").read_text())) + with torch.device("meta"): + model = cls(config) + model.to_empty(device=device) + state = torch.load(root / "model.pth", map_location="cpu", mmap=True, weights_only=True) + model.load_state_dict(state, strict=True) + model.root = root + return model.cast(dtype) + + def cast(self, dtype: torch.dtype) -> "Zonos3LM": + """Weights in ``dtype``; the routers' balancing biases stay float32 (as in the checkpoint).""" + for name, param in self.named_parameters(): + param.data = param.data.to(torch.float32 if name.endswith("balancing_biases") else dtype) + return self + + @property + def dtype(self) -> torch.dtype: + return self.multi_output.weight.dtype + + @property + def device(self) -> torch.device: + return self.multi_output.weight.device + + # -- helpers ----------------------------------------------------------------------------------------------------- + + def _save(self, name, tensor): + if self._capture is not None: + self._capture[name] = tensor.detach().float().cpu().numpy().copy() + + def _rms(self, x, weight=None, eps=None): + return F.rms_norm(x, (x.shape[-1],), weight=weight, eps=self.config.norm_eps if eps is None else eps) + + def _lin(self, module, x, weight, bias=None): + y = F.linear(x, weight, bias) + return y if self._accents is None else self._accents.linear(module, x, y) + + # -- sublayers --------------------------------------------------------------------------------------------------- + + def _global_attention(self, x, layer, cache: LMCache, probe: ProbeSpec | None, queries: dict): + c, a, p = self.config, self.layers[layer].attention, f"layers.{layer}.attention." + n, nh, nkv, hd = len(x), c.n_heads, c.n_kv_heads, c.head_dim + gate = self._lin(p + "gater", x, a.gater.weight).sigmoid() + q = self._lin(p + "wq", x, a.wq.weight).view(n, nh, hd) + kv = self._lin(p + "wkv", x, a.wkv.weight.reshape(2 * nkv * hd, c.dim)) + k, v = kv[:, : nkv * hd].reshape(n, nkv, hd), kv[:, nkv * hd :].reshape(n, nkv, hd) + q = self._rms(q, eps=1e-6) * a.temp.abs().view(1, nh, 1) + k = self._rms(k, eps=1e-6) + positions = torch.arange(cache.position, cache.position + n, device=x.device) + q = rope_interleaved(q, positions, c.rope_theta) + k = rope_interleaved(k, positions, c.rope_theta) + old_k, old_v = cache.kv.get(layer, (k[:0], v[:0])) + k, v = torch.cat((old_k, k), 0), torch.cat((old_v, v), 0) + cache.kv[layer] = (k, v) + rep = nh // nkv + key = k.to(q.dtype).repeat_interleave(rep, 1).transpose(0, 1) + value = v.to(q.dtype).repeat_interleave(rep, 1).transpose(0, 1) + mask = torch.arange(len(k), device=x.device)[None, :] <= positions[:, None] + out = F.scaled_dot_product_attention(q.transpose(0, 1), key, value, + attn_mask=mask, scale=hd ** -0.5).transpose(0, 1) + if probe is not None: + queries[layer] = q + if probe.windows: + out = self._masked_heads(layer, q, k, v, out, mask, probe) + return self._lin(p + "wo", (out * gate.unsqueeze(-1)).reshape(n, nh * hd), a.wo.weight) + + def _masked_heads(self, layer, q, k, v, out, causal, probe: ProbeSpec): + """ACI hard mask: the masked heads' output over all keys with the text keys outside their window at -inf + (sgl align_probe._masked).""" + rep = self.config.n_heads // self.config.n_kv_heads + tidx = torch.arange(len(k), device=q.device) - probe.text_start + in_text = (tidx >= 0) & (tidx < probe.text_len) + out = out.clone() + for (head_layer, head), window in probe.windows.items(): + if head_layer != layer: + continue + lo, hi = clip_window(window, probe.text_len) + outside = in_text & ((tidx < lo) | (tidx > hi)) + logits = (q[:, head].float() @ k[:, head // rep].float().T) * self.config.head_dim ** -0.5 + weights = torch.softmax(logits.masked_fill(outside[None, :] | ~causal, float("-inf")), dim=-1) + out[:, head] = (weights @ v[:, head // rep].float()).to(out.dtype) + return out + + def _gdn(self, x, layer, cache: LMCache): + a, p = self.layers[layer].attention, f"layers.{layer}.attention." + heads, hd, kernel = GDN_HEADS, GDN_HEAD_DIM, GDN_KERNEL + inner = heads * hd + channels = 3 * inner + projection = self._lin(p + "in_proj", x, a.in_proj.weight) + qkv, z, aa, b = projection.split((3 * inner, inner, heads, heads), -1) + history = cache.conv_state.get(layer, torch.zeros(channels, kernel - 1, dtype=x.dtype, device=x.device)) + sequence = torch.cat((history, qkv.T), -1) + # Depthwise causal cross-correlation: weight[0] is oldest, weight[-1] current. + conv = F.conv1d(sequence.unsqueeze(0), a.conv.weight, groups=channels) + conv = F.silu(conv.squeeze(0).T) + cache.conv_state[layer] = sequence[:, -(kernel - 1):].clone() + q, k, v = [part.reshape(len(x), heads, hd).float() for part in conv.split(inner, -1)] + q = q * torch.rsqrt(q.square().sum(-1, keepdim=True) + 1e-6) + k = k * torch.rsqrt(k.square().sum(-1, keepdim=True) + 1e-6) + decay = torch.exp(-a.A_log.float().exp() * F.softplus(aa.float() + a.dt_bias.float())) + beta = b.float().sigmoid() + state = cache.gdn_state.get(layer, torch.zeros(heads, hd, hd, dtype=torch.float32, device=x.device)) + outputs = [] + for token in range(len(x)): + # FLA state_v_first=True: [heads, value, key], all accumulation in F32. + state = state * decay[token, :, None, None] + prediction = (state * k[token, :, None, :]).sum(-1) + delta = beta[token, :, None] * (v[token] - prediction) + state = state + delta[:, :, None] * k[token, :, None, :] + outputs.append((state * (q[token] * hd ** -0.5)[:, None, :]).sum(-1)) + cache.gdn_state[layer] = state + recurrent = torch.stack(outputs).to(x.dtype) + # FLA's rms_norm_gated has fixed eps=1e-5 and swish gate, per head. + normalized = self._rms(recurrent, a.out_weight, eps=1e-5) + gated = (normalized.float() * F.silu(z.reshape(len(x), heads, hd).float())).to(x.dtype).reshape(len(x), inner) + if self._capture is not None: + for name, tensor in (("gdn_conv", conv), ("gdn_q", q), ("gdn_k", k), ("gdn_v", v), + ("gdn_decay", decay), ("gdn_beta", beta), ("gdn_recurrent", recurrent), + ("gdn_gated", gated), ("gdn_state", state), + ("gdn_conv_state", cache.conv_state[layer])): + self._save(f"{name}_{layer}", tensor) + return self._lin(p + "wo", gated, a.wo.weight) + + def _feed_forward(self, x, layer): + f, p = self.layers[layer].feed_forward, f"layers.{layer}.feed_forward." + if layer == 0: + hidden = self.config.ffn_hidden + flat = self._lin(p + "w_in", x, f.w_in.weight.reshape(2 * hidden, -1)) + return self._lin(p + "w_out", flat[:, :hidden] * F.silu(flat[:, hidden:]), f.w_out.weight) + router_input = self._rms(x, f.router.rmsnorm_eda.weight) + logits = self._lin(p + "router.router_linear", router_input, f.router.router_linear.weight) + self._save(f"router_logits_{layer}", logits) + bias = f.router.balancing_biases.float() + if self._accents is not None: + bias = self._accents.router_bias(p + "router", bias) + choices = torch.topk(logits.float() - bias, self.config.moe_topk, -1).indices + weights = logits.float().gather(-1, choices).softmax(-1) + latent = self._lin(p + "latent_down", x, f.latent_down.weight) + gate_up_proj, w2 = f.experts.gate_up_proj, f.experts.down_proj + half = gate_up_proj.shape[1] // 2 + experts = p + "experts" + output = torch.zeros_like(latent) + for token in range(len(x)): + for rank in range(self.config.moe_topk): + expert = int(choices[token, rank]) + gate_up = F.linear(latent[token], gate_up_proj[expert]) + gate, up = gate_up[:half], gate_up[half:] + if self._accents is not None: + shift = self._accents.expert_shift(experts, "w13", expert, latent[token]) + if shift is not None: # SonicExperts layout: gate/up rows interleaved + gate, up = gate + shift[0::2], up + shift[1::2] + hidden = F.silu(gate) * up + expert_out = F.linear(hidden, w2[expert]) + if self._accents is not None: + shift = self._accents.expert_shift(experts, "w2", expert, hidden) + if shift is not None: + expert_out = expert_out + shift + output[token] += (expert_out.float() * weights[token, rank]).to(x.dtype) + return self._lin(p + "latent_up", output, f.latent_up.weight) + + def _replace_rows(self, x, lo, speaker_rows, condition_rows): + """Speaker / condition rows (absolute positions) replace their summed embeddings (sgl index_copy).""" + hi = lo + len(x) + if not speaker_rows and not condition_rows: + return x + x = x.clone() + for row, vec in (speaker_rows or {}).items(): + if lo <= row < hi: + w = self.speaker_projection + projected = F.linear(vec.to(x.device, w.weight.dtype).reshape(-1), w.weight, w.bias) + x[row - lo] = projected.to(x.dtype) + # condition table i serves the i-th condition row (rows ascending) + for table, row in enumerate(sorted(condition_rows or {})): + if lo <= row < hi: + x[row - lo] = self.condition_embeddings[table].weight[int(condition_rows[row])] + return x + + # -- forward ----------------------------------------------------------------------------------------------------- + + @torch.no_grad() + def forward( + self, + ids: torch.Tensor, + cache: LMCache, + *, + speaker_rows: dict[int, torch.Tensor] | None = None, + condition_rows: dict[int, int] | None = None, + hidden_deltas: dict[int, torch.Tensor] | None = None, + accents=None, + probe: ProbeSpec | None = None, + capture: dict | None = None, + ) -> LMOutput: + """Logits of ``ids`` [rows, n_codebooks + 1] continuing ``cache`` (updated in place). + + Rows are absolute positions in ``speaker_rows`` (speaker embedding replacing that row through the speaker + projection) and ``condition_rows`` (row -> bucket id; the i-th row in ascending order reads condition table i). + ``hidden_deltas`` maps a Full AttnRes bank source to a delta ([rows, dim] or [dim]) added to that source. + ``accents`` is a zonos3.reference.accents.AccentState; ``probe`` adds the alignment readout of every row; + ``capture`` receives the named intermediates ``tools/dump_golden.py lm`` writes (float32 numpy).""" + c = self.config + ids = ids.to(self.device, torch.long) + lo = cache.position + if lo + len(ids) > c.max_seqlen: + raise ValueError(f"{lo + len(ids)} rows exceed the model context {c.max_seqlen}") + self._capture, self._accents = capture, accents + try: + embedders = self.multi_embedder.embedders + x = sum(F.embedding(ids[:, cb], embedders[cb].weight) for cb in range(c.n_codebooks + 1)) + self._save("emb_sum", x) + x = self._replace_rows(x, lo, speaker_rows, condition_rows) + self._save("emb_cond", x) + x = self._rms(x) + self._save("emb_norm", x) + + def source(index, tensor): + delta = (hidden_deltas or {}).get(index) + return tensor if delta is None else tensor + delta.to(tensor.device, tensor.dtype) + + sources = [source(0, x)] + queries = self.block_attnres_queries + probe_queries: dict[int, torch.Tensor] = {} + for layer in range(c.n_layers): + block = self.layers[layer] + mixed = full_attnres_route(sources, queries[2 * layer], c.norm_eps) + self._save(f"attnres_attn_{layer}", mixed) + attn_in = self._rms(mixed, block.attention_norm.weight) + self._save(f"attn_in_{layer}", attn_in) + if c.uses_gdn(layer): + attention = self._gdn(attn_in, layer, cache) + else: + attention = self._global_attention(attn_in, layer, cache, probe, probe_queries) + self._save(f"attn_out_{layer}", attention) + sources.append(source(2 * layer + 1, attention)) + mixed = full_attnres_route(sources, queries[2 * layer + 1], c.norm_eps) + self._save(f"attnres_ffn_{layer}", mixed) + ffn_in = self._rms(mixed, block.ffn_norm.weight) + self._save(f"ffn_in_{layer}", ffn_in) + x = self._feed_forward(ffn_in, layer) + self._save(f"ffn_out_{layer}", x) + self._save(f"layer_x_{layer}", x) + sources.append(source(2 * layer + 2, x)) + mixed = full_attnres_route(sources, queries[-1], c.norm_eps) + self._save("attnres_final", mixed) + normalized = self._rms(mixed, self.out_norm.weight) + self._save("out_norm", normalized) + logits = self._lin("multi_output", normalized, self.multi_output.weight).view(len(ids), c.n_codebooks, + c.audio_vocab) + logits = c.loss_softcap * torch.tanh(logits / c.loss_softcap) + self._save("logits", logits) + cache.position = lo + len(ids) + readouts = None if probe is None else self._readout(probe, probe_queries, cache) + return LMOutput(logits, readouts) + finally: + self._capture = self._accents = None + + def _readout(self, probe: ProbeSpec, probe_queries: dict, cache: LMCache) -> list[tuple[int, float]]: + layers = self.config.attention_layers + weights = probe_weight(probe.heads, layers, self.config.n_heads) + text = slice(probe.text_start, probe.text_start + probe.text_len) + keys = torch.stack([cache.kv[layer][0][text] for layer in layers]) + rows = len(probe_queries[layers[0]]) + return [ + readout(torch.stack([probe_queries[layer][r] for layer in layers]), keys, layers, weights, probe.windows, + self.config.head_dim ** -0.5) + for r in range(rows) + ] diff --git a/zonos3/reference/synth.py b/zonos3/reference/synth.py new file mode 100644 index 0000000000000000000000000000000000000000..7b6caaba02c63310651f38715cc4e645a32b3c1b --- /dev/null +++ b/zonos3/reference/synth.py @@ -0,0 +1,626 @@ +"""Reference synthesis of one v2 ``GenerateRequest``: the sgl server's request path in plain PyTorch. + +``plan_prompt`` resolves the request's speaker inputs (an uploaded embedding file or clip, inline reference codes, a +clip encoded with the dual codec) and runs the shared request rules and prompt plan of every Python server +(``zonos3.tts.plan``) on the LM's config and the ``ReferenceAssets``. ``synthesize`` then generates with the TTS sampler +of zonos3_sgl.engine.sample (seeded per request), LACI and span-follow on the LM's alignment readout, and decodes the +whole utterance with the matched iSTFT codec as zonos3_sgl.tokenizer.vocoder does at end of stream. Speaker ids +(default voices, the session cache) are server state and are refused here. + +v2 hard-wires the former defaults of the dropped legacy fields (no speaking-rate token, no quality / background / +accurate-mode rows): ``Zonos3LMConfig.from_params`` only accepts checkpoints without those rows, so the prompt simply has +none. ``format``, ``stream`` and ``stream_decode`` are accepted and ignored (one whole decode). +""" + +from __future__ import annotations + +import base64 +import io +from dataclasses import dataclass, field, replace +from pathlib import Path + +import numpy as np +import torch + +from zonos3.generation import SAMPLE_RATE, SAMPLING +from zonos3.models.accent_format import AccentAdapter, list_accent_adapters, load_adapter +from zonos3.reference.accents import AccentState +from zonos3.reference.lm import LMCache, ProbeSpec, Zonos3LM +from zonos3.speaker_cfg import guided_logits +from zonos3.tts import plan as P +from zonos3.tts.delay import shear_up +from zonos3.tts.laci import LaciConfig, LaciHeads, LaciSession, RateBuckets +from zonos3.tts.probe import locate_text_span +from zonos3.tts.prompt import TTSPromptBuilder, TTSPromptConfig +from zonos3.tts.sampler import sample_tts +from zonos3.tts.span_follow import FollowConfig, SpanFollower +from zonos3.tts.steering import SteeringBundle, load_bundle, schedule_delta + +_DECODE_OVERLAP_FRAMES = 4 # TTSVocoderManager overlap_frames: already-counted rows re-decoded at EOS + + +# ----------------------------------------------------------------------------------------------------- assets + + +@dataclass +class ReferenceAssets: + """Everything a request may use besides the LM: the steering bundle, accent adapters, LACI heads per language; the + codec decoder, the speaker encoder and the text normalizer are loaded on first use.""" + + steer_bundle: SteeringBundle | None = None + accent_adapters: dict[str, AccentAdapter] = field(default_factory=dict) + laci_heads: dict[str, LaciHeads] = field(default_factory=dict) + _decoders: dict = field(default_factory=dict, repr=False) + _speaker_encoders: dict = field(default_factory=dict, repr=False) + _normalizer: object | None = field(default=None, repr=False) + + @classmethod + def load(cls, *, steer_bundle=None, accent_adapters=None, laci_heads: dict | None = None) -> "ReferenceAssets": + adapters = {} + if accent_adapters: + for name in list_accent_adapters(accent_adapters): + adapters[name] = load_adapter(Path(accent_adapters) / f"{name}.pt") + return cls( + steer_bundle=load_bundle(steer_bundle) if steer_bundle else None, + accent_adapters=adapters, + laci_heads={key: LaciHeads.load(path) for key, path in (laci_heads or {}).items()}, + ) + + def steering_sources(self) -> tuple[int, ...]: + """The Full AttnRes bank sources hidden deltas steer, ascending (sgl Engine._init_steering).""" + return () if self.steer_bundle is None else tuple(self.steer_bundle.hidden_sources) + + def accent_names(self) -> list[str]: + return list(self.accent_adapters) + + def normalizer(self): + if self._normalizer is None: + from zonos3.tokenizer.textnorm import TTSTextNormalizer + + self._normalizer = TTSTextNormalizer() + return self._normalizer + + def decoder(self, codec: str, device: torch.device): + """The matched codec's iSTFT decoder on ``device`` (zonos3.tokenizer.matched_codec).""" + key = (codec, str(device)) + if key not in self._decoders: + from zonos3.tokenizer import matched_codec + from zonos3.utils.release import resolve_file + + entry = matched_codec.entry(codec) + actual = matched_codec._sha256(resolve_file(entry["checkpoint"])) + if actual != entry["checkpoint_sha256"]: + raise ValueError(f"codec generator checkpoint sha256 {actual} != {entry['checkpoint_sha256']}") + self._decoders[key] = matched_codec.load_model(codec, device) + return self._decoders[key] + + def speaker_encoder(self, codec: str | None, dim: int, device: torch.device): + key = (codec, dim, str(device)) + if key not in self._speaker_encoders: + from zonos3.models.speaker_cloning import create_speaker_embedder + + self._speaker_encoders[key] = create_speaker_embedder(codec, dim, device=str(device)) + return self._speaker_encoders[key] + + +# ----------------------------------------------------------------------------------------------------- the plan + + +def decode_base64_blob(data: str, field_name: str) -> bytes: + payload = data.strip() + if payload.startswith("data:"): + if "," not in payload: + raise ValueError(f"Invalid data URL for {field_name}.") + payload = payload.split(",", 1)[1] + try: + return base64.b64decode(payload, validate=True) + except Exception as exc: + raise ValueError(f"{field_name} must be valid base64-encoded data.") from exc + + +def load_embedding_vector(embedding_bytes: bytes, *, expected_dim: int, file_name: str | None) -> torch.Tensor: + try: + loaded = np.load(io.BytesIO(embedding_bytes), allow_pickle=False) + except Exception as exc: + raise ValueError(f"{file_name or 'Speaker embedding file'} must be a valid .npy or .npz file saved without pickle.") from exc + if isinstance(loaded, np.lib.npyio.NpzFile): + try: + if "emb" in loaded.files: + arr = loaded["emb"] + elif len(loaded.files) == 1: + arr = loaded[loaded.files[0]] + else: + raise ValueError("Embedding archive must contain an 'emb' array or exactly one array.") + finally: + loaded.close() + else: + arr = loaded + if isinstance(arr, np.ndarray) and arr.dtype.names: + if "emb" in arr.dtype.names: + arr = arr["emb"] + elif len(arr.dtype.names) == 1: + arr = arr[arr.dtype.names[0]] + else: + raise ValueError("Structured embedding arrays must contain an 'emb' field.") + arr = np.squeeze(np.asarray(arr, dtype=np.float32)) + if arr.ndim == 1: + vector = arr + elif arr.ndim == 2: + if arr.shape[0] == 0: + raise ValueError("Speaker embedding file is empty.") + vector = arr[0] if arr.shape[0] == 1 else arr.mean(axis=0) + else: + raise ValueError(f"Unsupported embedding array shape {tuple(arr.shape)}. Expected (D,) or (N, D).") + vector = np.ascontiguousarray(vector, dtype=np.float32) + if vector.shape[-1] != expected_dim: + raise ValueError(f"Reference embedding dimension mismatch. Model expects {expected_dim}, " + f"but loaded file has {vector.shape[-1]}.") + return torch.from_numpy(vector).to(dtype=torch.float32, device="cpu") + + +def silence_frame(codec: str, device) -> torch.Tensor: + """The codec-matched silence frame (registry ``silence_frame``, else the dual encoder's steady state of 2 s of + silence, as TTSVocoderManager.silence_frame_codes).""" + from zonos3.tokenizer.matched_codec import entry + + frame = entry(codec).get("silence_frame") + if frame is not None: + return torch.tensor([int(v) for v in frame], dtype=torch.int32) + from zonos3.tokenizer.dual_reference import encode_dual_reference + + codes = encode_dual_reference(torch.zeros(1, 2 * SAMPLE_RATE), SAMPLE_RATE, max_seconds=5.0, device=str(device)) + return codes[-2].to(torch.int32).clone() + + +def prompt_builder(lm: Zonos3LM) -> TTSPromptBuilder: + from zonos3.tts.superbpe import load_spec + + c = lm.config + spec = load_spec(lm.root) if lm.root is not None else None + return TTSPromptBuilder(TTSPromptConfig(n_codebooks=c.n_codebooks, codebook_sizes=c.codebook_sizes, + audio_pad_id=c.audio_pad_id, text_vocab=c.text_vocab, + text_tokenizer_spec=spec)) + + +class ReferenceContext: + """The reference as ``zonos3.tts.plan.PromptContext``: the LM's config, the assets and ``device`` (where an uploaded + clip is encoded). The frame budget is the checkpoint's max_seqlen, the reference limit its + ``speaker_reference_max_seconds``.""" + + steer_hint = "start it with --steer-bundle" + + def __init__(self, lm: Zonos3LM, assets: ReferenceAssets, device: torch.device): + from zonos3.tokenizer.matched_codec import entry + + c = lm.config + self.config, self.assets, self.device = c, assets, device + self.n_codebooks, self.codebook_size = c.n_codebooks, c.codebook_size + self.audio_pad_id, self.text_vocab, self.span_end_id = c.audio_pad_id, c.text_vocab, c.span_end_id + self.hidden_size = c.dim + self.max_seqlen = self.max_frames = c.max_seqlen + self.condition_names, self.condition_bucket_counts = c.condition_names, c.condition_bucket_counts + self.condition_edges, self.condition_flags = c.condition_edges, {} + # the reference's architecture always has the speaker row + self.speaker_modes = (["reference"] if c.speaker_reference_prefix_enabled else []) + ["embedding"] + self._builder = prompt_builder(lm) + self.text_tokenizer_spec = self._builder.config.text_tokenizer_spec + self.accent_names = assets.accent_names() + self.steer_bundle, self.steering_sources = assets.steer_bundle, assets.steering_sources() + self.laci_languages = tuple(assets.laci_heads) + codec = entry(c.audio_codec) + self.reference_max_frames = P.reference_frame_limit(c.speaker_reference_max_seconds, codec["hop"], SAMPLE_RATE) + self.silence_available = codec.get("silence_frame") is not None or codec.get("family") == "dual" + + def prompt_builder(self) -> TTSPromptBuilder: + return self._builder + + def normalize_text(self, text: str, language: str, enabled: bool) -> str: + from zonos3.tokenizer.textnorm import collapse_line_breaks, normalization_enabled + + text = collapse_line_breaks(text) + if enabled and normalization_enabled(): + text = self.assets.normalizer().normalize(text, language) + return text + + def silence_frame(self) -> torch.Tensor: + return silence_frame(self.config.audio_codec, self.device) + + +def _speaker_embedding(lm: Zonos3LM, req: P.Request, assets: ReferenceAssets, device) -> torch.Tensor | None: + """speaker_mode=embedding: an uploaded embedding file or clip (MECT encoder) -> the speaker row's vector.""" + c = lm.config + if req.speaker_audio_base64 and req.speaker_embedding_base64: + raise ValueError("Provide either a reference audio file or a saved embedding file, not both.") + if req.speaker_embedding_base64: + return load_embedding_vector(decode_base64_blob(req.speaker_embedding_base64, "speaker_embedding_base64"), + expected_dim=c.speaker_embedding_dim, file_name=req.speaker_embedding_name) + if not req.speaker_audio_base64: + return None + from zonos3.tts.audio import _decode_audio_bytes + + wav, sample_rate = _decode_audio_bytes(decode_base64_blob(req.speaker_audio_base64, "speaker_audio_base64")) + encoder = assets.speaker_encoder(c.speaker_embedding_codec, c.speaker_embedding_dim, device) + with torch.inference_mode(): + output = encoder(wav, sample_rate) + candidates = output if isinstance(output, tuple) else (output,) + for candidate in candidates: + candidate = candidate.squeeze(0).to(dtype=torch.float32, device="cpu") + if candidate.numel() == c.speaker_embedding_dim: + return candidate + raise ValueError(f"Reference embedding dimension mismatch. Model expects {c.speaker_embedding_dim}.") + + +def _reference_codes(ctx: ReferenceContext, req: P.Request, mode: str | None) -> torch.Tensor | None: + """speaker_mode=reference: inline prefix codes, or an uploaded clip encoded with the dual codec.""" + if req.speaker_reference_codes is not None: + return P.reference_codes(ctx, req.speaker_reference_codes) + if mode != "reference" or not req.speaker_audio_base64: + return None + device = torch.device(ctx.device) + if device.type != "cuda": + raise ValueError("encoding reference audio with the dual codec needs a CUDA device") + from zonos3.tokenizer.dual_reference import encode_dual_reference + from zonos3.tts.audio import _decode_audio_bytes + + wav, sample_rate = _decode_audio_bytes(decode_base64_blob(req.speaker_audio_base64, "speaker_audio_base64")) + index = device.index if device.index is not None else torch.cuda.current_device() + return encode_dual_reference(wav, sample_rate, max_seconds=ctx.config.speaker_reference_max_seconds, + device=f"cuda:{index}") + + +def _resolve_speaker(lm: Zonos3LM, ctx: ReferenceContext, req: P.Request, mode: str | None) -> P.Speaker: + """The request's speaker inputs for ``mode``; speaker ids need a server's voices.""" + if req.speaker_embedding_id or req.speaker_blend_embedding_id_a or req.speaker_blend_embedding_id_b: + raise ValueError("speaker ids need a server") + if mode == "reference": + if req.speaker_embedding_base64: + raise ValueError("This checkpoint conditions on raw reference audio and does not accept " + "speaker embedding files or embedding blends.") + embedding = None + else: + embedding = _speaker_embedding(lm, req, ctx.assets, ctx.device) + return P.Speaker(mode, embedding, _reference_codes(ctx, req, mode)) + + +@torch.inference_mode() +def plan_prompt(lm: Zonos3LM, request: dict, *, assets: ReferenceAssets, device=None) -> P.PromptPlan: + """The prompt rows, conditioning and CFG twin the sgl server builds for ``request`` (no generation).""" + ctx = ReferenceContext(lm, assets, torch.device(device if device is not None else lm.device)) + return P.plan_prompt(ctx, request, lambda req, mode: _resolve_speaker(lm, ctx, req, mode)) + + +# ----------------------------------------------------------------------------------------------------- generation + + +@dataclass +class Sampling: + """Per-request sampler settings (zonos3_sgl.engine.sample.TTSSampler.prepare); the defaults are the registry's.""" + + temperature: float = SAMPLING["temperature"] + topk: int = SAMPLING["topk"] + top_p: float = SAMPLING["top_p"] + min_p: float = SAMPLING["min_p"] + repetition_window: int = SAMPLING["repetition_window"] + repetition_penalty: float = SAMPLING["repetition_penalty"] + repetition_codebooks: int = SAMPLING["repetition_codebooks"] + min_frames: int = 0 + + @classmethod + def from_request(cls, req: P.Request) -> "Sampling": + return cls(float(req.temperature), int(req.topk), float(req.top_p), float(req.min_p), + int(req.repetition_window), float(req.repetition_penalty), int(req.repetition_codebooks)) + + +class ProbeState: + """The per-attempt probe state an observer reads and sets (sgl AlignProbe).""" + + def __init__(self, heads, text_start: int, text_len: int, mask=None): + self.heads, self.text_start, self.text_len, self.mask = heads, text_start, text_len, mask + self.steps, self.stop = 0, False + + def spec(self) -> ProbeSpec: + return ProbeSpec(tuple(self.heads), self.text_start, self.text_len, self.mask) + + +@dataclass +class Attempt: + rows: list[torch.Tensor] # generated rows [n_codebooks + 1] (int32), the finishing row included + eos_frame: int | None # aligned EOS frame in generated rows + + +def sample_row(config, logits, sampling: Sampling, history: torch.Tensor, total_generated: int, history_rows: int, + stop_id: int, generator: torch.Generator) -> torch.Tensor: + """One sampled row; ``config`` supplies n_codebooks, codebook_size, codebook_sizes, audio_pad_id and text_vocab.""" + c = config + n_cb = c.n_codebooks + device = logits.device + window = max(int(sampling.repetition_window), 0) + penalty = max(float(sampling.repetition_penalty), 1.0) + codebooks = n_cb if sampling.repetition_codebooks < 0 else min(max(sampling.repetition_codebooks, 0), n_cb) + active = min(window, total_generated + history_rows, len(history)) if window > 0 and penalty > 1.0 and codebooks > 0 else 0 + repetition_ids = repetition_penalties = None + if active > 0: + recent = history[len(history) - active:, :n_cb].to(device=device, dtype=torch.int64).transpose(0, 1) + valid = (recent >= 0) & (recent < c.codebook_size) + valid[codebooks:] = False + repetition_ids = torch.where(valid, recent, torch.full_like(recent, -1)).unsqueeze(0) + repetition_penalties = torch.tensor([penalty], dtype=torch.float32, device=device) + stop_blocked = None + if sampling.min_frames > 0: + stop_blocked = torch.tensor([[total_generated < sampling.min_frames + cb for cb in range(n_cb)]], device=device) + row = sample_tts( + logits.float().unsqueeze(0), + torch.tensor([max(sampling.temperature, 1e-6)], dtype=torch.float32, device=device), + torch.tensor([sampling.topk if sampling.topk >= 1 else c.codebook_size], dtype=torch.int32, device=device), + torch.tensor([min(max(sampling.top_p, 0.0), 1.0)], dtype=torch.float32, device=device), + torch.tensor([max(sampling.min_p, 0.0)], dtype=torch.float32, device=device), + codebook_size=c.codebook_size, audio_pad_id=c.audio_pad_id, + stop_token_ids=torch.tensor([stop_id], dtype=torch.int64, device=device), + repetition_token_ids=repetition_ids, repetition_penalties=repetition_penalties, + codebook_sizes=c.codebook_sizes, text_vocab=c.text_vocab, generators=[generator], stop_blocked=stop_blocked, + )[0] + return torch.tensor(row, dtype=torch.int32) + + +def generate_rows( + lm: Zonos3LM, + cond: P.Branch, + *, + sampling: Sampling, + seed: int, + max_tokens: int, + stop_id: int, + twin: P.Branch | None = None, + cfg_scale: float = 1.0, + history_rows: int = 0, + accents: AccentState | None = None, + steer=None, + probe: ProbeState | None = None, + observer=None, + on_row=None, +) -> Attempt: + """One request's autoregressive generation (TTSScheduler prefill + decode steps, non-overlapped): ``steer(frame)`` + is the hidden delta (flattened per source) for generated frame ``frame`` or None; ``observer.on_step`` gets the probe + readout of every decode step (LACI, span follow); ``on_row(row, eos_frame)`` sees every generated row.""" + c = lm.config + n_cb, pad = c.n_codebooks, c.audio_pad_id + device = lm.device + generator = torch.Generator(device=device).manual_seed(int(seed)) + prompt = cond.input_ids.to(torch.int32) + has_audio_prefix = bool((prompt[-1, :n_cb] != pad).any()) + branches = [(cond, LMCache())] + ([] if twin is None else [(twin, LMCache())]) + + def forward(branch: P.Branch, cache: LMCache, ids: torch.Tensor, frame: int | None, with_probe: bool): + hidden = None + if frame is not None and branch.steered and steer is not None: + delta = steer(frame) + if delta is not None: + hidden = delta + return lm(ids, cache, speaker_rows=branch.speaker_rows(), + condition_rows=branch.condition_rows(), hidden_deltas=hidden, accents=accents, + probe=probe.spec() if with_probe and probe is not None else None) + + outs = [forward(b, cache, b.input_ids, None, False) for b, cache in branches] + rows: list[torch.Tensor] = [] + history = prompt[:, :n_cb].clone() + eos_frame, countdown = -1, -1 + remain = max_tokens + step = 0 + while True: + logits = outs[0].logits[-1].float() + if twin is not None: + logits = guided_logits(logits, outs[1].logits[-1].float(), cfg_scale) + total_generated = len(rows) + token = sample_row(lm.config, logits, sampling, history, total_generated, history_rows, stop_id, generator) + if not has_audio_prefix and total_generated < n_cb - 1: # cold-start delay triangle -> padding + token[total_generated + 1 : n_cb] = pad + if step > 0 and probe is not None and observer is not None: + probe.steps += 1 + if not probe.stop: + pos, m = outs[0].probe[-1] + observer.on_step(probe, probe.steps, int(pos), float(m)) + if probe.stop: + remain = 0 + rows.append(token) + history = torch.cat((history, token[None, :n_cb]), dim=0) + remain -= 1 + finished = remain <= 0 # a probe stop zeroed the remaining budget + # EOS (TTSReq.check_eos): any stop token starts the delayed countdown + if eos_frame < 0: + cols = [i for i, tok in enumerate(token[:n_cb].tolist()) if tok == stop_id] + if cols: + eos_frame = max(0, total_generated - max(cols)) + countdown = n_cb + 1 + if countdown > 0: + countdown -= 1 + if countdown == 0: + finished = True + if on_row is not None: + on_row(token, eos_frame if eos_frame >= 0 else None, finished) + if finished: + return Attempt(rows, eos_frame if eos_frame >= 0 else None) + step += 1 + frame = len(rows) + history_rows + ids = token[None] + outs = [forward(b, cache, ids, frame, i == 0) for i, (b, cache) in enumerate(branches)] + + +# ----------------------------------------------------------------------------------------------------- decoding + + +def decode_rows(lm: Zonos3LM, assets: ReferenceAssets, rows: list, *, prefill_rows: torch.Tensor | None, + eos_frame: int | None, context_codes: torch.Tensor | None, device) -> np.ndarray: + """End-of-stream decode of TTSVocoderManager.decode_frames / _decode_final: the prefill rows open the stream, the + EOS boundary is the earliest of the aligned EOS frame and every row's EOA column, the last overlap rows of the + prefill are re-decoded with the rest, and the reference tail is decoded as left context at the stream start.""" + from zonos3.tokenizer.matched_codec import decode_model, entry + + c = lm.config + n_cb = c.n_codebooks + eoa = c.audio_pad_id - 1 + buffer = [] if prefill_rows is None else [[int(v) for v in r[:n_cb]] for r in prefill_rows.tolist()] + prefill = len(buffer) + candidates = [] if eos_frame is None else [max(0, int(eos_frame)) + prefill] + for row in rows: + codes = [int(v) for v in row[:n_cb].tolist()] + buffer.append(codes) + cols = [i for i, tok in enumerate(codes) if tok == eoa] + if cols: + candidates.append(max(0, len(buffer) - 1 - max(cols))) + total = len(buffer) + target = total - (n_cb - 1) + if candidates: + target = min(target, min(candidates)) + if target <= prefill: + return np.zeros(0, dtype=np.float32) + start = prefill - min(_DECODE_OVERLAP_FRAMES, prefill) + raw_end = min(target + n_cb - 1, total) + codes = shear_up(torch.tensor(buffer[start:raw_end], dtype=torch.int64), c.audio_pad_id)[: target - start] + hop = int(entry(c.audio_codec)["hop"]) + context = 0 + if start == 0 and context_codes is not None and len(context_codes): + context = len(context_codes) + codes = torch.cat((torch.as_tensor(context_codes, dtype=torch.int64).reshape(-1, n_cb), codes), dim=0) + if bool(((codes < 0) | (codes >= c.codebook_size)).any()): + raise ValueError("decode rows hold non-codec tokens") + model = assets.decoder(c.audio_codec, torch.device(device)) + audio = decode_model(model, codes.unsqueeze(0), entry(c.audio_codec))[0].numpy().astype(np.float32) + return audio[context * hop:] + + +def output_gain(codec: str, headroom_db: float | None) -> float: + if headroom_db is None: + from zonos3.tokenizer.matched_codec import codec_names, decoder_headroom_db + + headroom_db = decoder_headroom_db(codec) if codec in codec_names() else 0.0 + return float(10.0 ** (-float(headroom_db) / 20.0)) + + +def fade_out(samples: np.ndarray, fade_out_ms: float) -> np.ndarray: + if fade_out_ms <= 0 or not len(samples): + return samples + n = min(len(samples), int(SAMPLE_RATE * fade_out_ms / 1000.0)) + if n <= 0: + return samples + samples = samples.copy() + samples[-n:] *= 0.5 * (1.0 + np.cos(np.linspace(0.0, np.pi, n, dtype=np.float32))) + return samples + + +# ----------------------------------------------------------------------------------------------------- synthesize + + +@dataclass +class SynthResult: + pcm: np.ndarray # float32 mono 44100 Hz + seed: int + laci: dict | None # LACI record (LaciSession.record) of a laci request + rows: list = field(default_factory=list) # generated rows (int32 [n_codebooks + 1]) + eos_frame: int | None = None + plan: P.PromptPlan | None = None + + +def steer_fn(plan: P.PromptPlan, follower: SpanFollower | None, base_delta=None): + """Hidden delta of generated frame f: the request's constant delta plus the span deltas active at f (the follower's + or the character-rate schedule's) -- TTSReq.steer_delta; None outside hidden mode.""" + if not plan.sources: + return None + delta0 = plan.hidden_delta if base_delta is None else base_delta + + def steer(frame: int): + if follower is not None: + span = follower.delta(frame) + elif plan.schedule is not None: + span = schedule_delta(plan.schedule, frame) + else: + span = None + delta = delta0 if span is None else (span if delta0 is None else delta0 + span) + if delta is None: + return None + per_source = delta.reshape(len(plan.sources), -1) + return {source: per_source[j] for j, source in enumerate(plan.sources)} + + return steer + + +@torch.inference_mode() +def synthesize(lm: Zonos3LM, request: dict, *, assets: ReferenceAssets, device=None, + dtype: torch.dtype | None = None) -> SynthResult: + """Generate and decode one v2 GenerateRequest.""" + device = torch.device(device if device is not None else lm.device) + if lm.device != device: + lm.to(device) + if dtype is not None and lm.dtype != dtype: + lm.cast(dtype) + plan = plan_prompt(lm, request, assets=assets, device=device) + c = lm.config + req = plan.request + sampling = Sampling.from_request(req) + accents = None + if plan.accent is not None: + accents = AccentState.for_model(lm, assets.accent_adapters[plan.accent[0]], plan.accent[1]) + follower = None + if plan.follow_tokens is not None and plan.schedule is not None: + lead, lag = plan.follow_gate + follower = SpanFollower(plan.follow_tokens, plan.schedule[:, 3:], FollowConfig(lead=float(lead), lag=float(lag))) + text_start, text_len = locate_text_span(plan.cond.input_ids, c.n_codebooks) + record = None + if plan.laci is None: + probe = None + if follower is not None: + probe = ProbeState(assets.laci_heads[plan.language].heads, text_start, text_len) + attempt = generate_rows(lm, plan.cond, sampling=sampling, seed=plan.seed, max_tokens=plan.max_tokens, + stop_id=c.eoa_id, twin=plan.twin, cfg_scale=plan.cfg_scale, accents=accents, + steer=steer_fn(plan, follower), probe=probe, observer=follower) + rows, eos_frame = attempt.rows, attempt.eos_frame + else: + rows, eos_frame, record = _laci(lm, plan, assets, sampling, accents, follower, text_start, text_len) + pcm = decode_rows(lm, assets, rows, prefill_rows=plan.prefill_rows, eos_frame=eos_frame, + context_codes=plan.context_codes, device=device) + pcm = fade_out(pcm * np.float32(output_gain(c.audio_codec, req.headroom_db)), float(req.fade_out_ms)) + return SynthResult(pcm.astype(np.float32), plan.seed, record, rows, eos_frame, plan) + + +def _laci(lm, plan: P.PromptPlan, assets, sampling, accents, follower, text_start, text_len): + """LACI (zonos3.tts.laci): attempts until the session's result is final; a rollback re-prefills the prompt plus the + kept rows (TTSScheduler._laci_rows) under seed + 1000 * attempt.""" + c = lm.config + names = list(c.condition_names) + edges = c.condition_edges.get("speaking_rate") + rates = (RateBuckets(names.index("speaking_rate"), tuple(edges), c.condition_bucket_counts[names.index("speaking_rate")]) + if c.condition_count and "speaking_rate" in names and edges else None) + width = c.n_codebooks + 1 + prefill = plan.prefill_rows if plan.prefill_rows is not None else torch.zeros((0, width), dtype=torch.int32) + session = LaciSession(heads=assets.laci_heads[plan.laci], cfg=LaciConfig(), prefill_rows=prefill, seed=plan.seed, + max_tokens=plan.max_tokens, n_codebooks=c.n_codebooks, rates=rates, + condition_values=None if plan.cond.condition_values is None else list(plan.cond.condition_values), + follower=follower) + template = plan.cond.input_ids + prompt = template[: len(template) - session.n_prefill] + branch, seed, max_tokens, history_rows, delta = plan.cond, plan.seed, plan.max_tokens, 0, plan.hidden_delta + while True: + probe = ProbeState(session.heads.heads, text_start, text_len, mask=session.probe_mask()) + state = {} + + def on_row(row, eos, finished): + session.append(row, eos) + if finished: + state["continuation"] = session.finish_attempt() + session.drain(final=state["continuation"] is None) + else: + session.drain() + + generate_rows(lm, branch, sampling=sampling, seed=seed, max_tokens=max_tokens, stop_id=c.eoa_id, + history_rows=history_rows, accents=accents, steer=steer_fn(plan, follower, delta), + probe=probe, observer=session, on_row=on_row) + cont = state["continuation"] + if cont is None: + break + branch = replace(branch, input_ids=torch.cat((prompt, cont.rows.to(prompt.dtype)), dim=0), + condition_values=cont.condition_values if cont.condition_values is not None + else branch.condition_values) + seed, max_tokens, history_rows = cont.seed, cont.max_tokens, cont.history_rows + if cont.swap_delta: + delta = cont.steering_delta + rows = session.stream[session.n_prefill:] + return rows, session.eos_frame(), session.record() diff --git a/zonos3/registries/codec_registry.json b/zonos3/registries/codec_registry.json new file mode 100644 index 0000000000000000000000000000000000000000..2f9d62b991ab16c52124c2b5e07fa786b715b889 --- /dev/null +++ b/zonos3/registries/codec_registry.json @@ -0,0 +1,50 @@ +{ + "3n_600k_sched600k_r4096": { + "key": "3n_600k_sched600k_r4096", + "codec": "opus_dual_3n_600k_sched600k_r4096_step600000", + "family": "dual", + "codebooks": 10, + "hop": 2940, + "frame_rate": 15.0, + "max_tokens": 450, + "codec_step": 600000, + "checkpoint": "hf://Zyphra/ZONOS3_Mini_release_ckpts/autoencoder/generator.pt", + "checkpoint_sha256": "1cedeb12d7d964026c0a16afc32abd1de23dc484533111f24c950775f1941172", + "teacher": "hf://Zyphra/ZONOS3_Mini_release_ckpts/autoencoder/teacher", + "tag": "3n_600k_sched600k_r4096_attnres_800m50k", + "codebook_sizes": [ + 4096, + 4096, + 4096, + 4096, + 4096, + 4096, + 4096, + 4096, + 4096, + 4096 + ], + "silence_frame": [ + 1918, + 746, + 3544, + 234, + 1267, + 2914, + 3944, + 2849, + 326, + 1337 + ], + "decoder": { + "kind": "istft_mr", + "label": "Multi-resolution iSTFT head + linear STFT loss, decoder.0-8 unfrozen (istft_head_a_20261002/full-unfreezeall-mr-50k, final step 50,000; release copy = step + trainable state); causal, fp32", + "campaign": "hf://Zyphra/ZONOS3_Mini_release_ckpts/autoencoder/heads/full_mr", + "config": "config_full_unfreezeall_mr.json", + "checkpoint": "step_0050000.pt", + "expect_step": 50000, + "headroom_db": 3.0, + "_note": "the 600k conv-tail decoder of generator.pt is NOT used for decoding (its encoder/quantizer still initialise the kept decoder stages and encode reference clips)" + } + } +} diff --git a/zonos3/registries/codec_registry_keep2_plain.json b/zonos3/registries/codec_registry_keep2_plain.json new file mode 100644 index 0000000000000000000000000000000000000000..01b5252e7b7a54e48a5c72e1d4c43dc8bfee5203 --- /dev/null +++ b/zonos3/registries/codec_registry_keep2_plain.json @@ -0,0 +1,50 @@ +{ + "3n_600k_sched600k_r4096": { + "key": "3n_600k_sched600k_r4096", + "codec": "opus_dual_3n_600k_sched600k_r4096_step600000", + "family": "dual", + "codebooks": 10, + "hop": 2940, + "frame_rate": 15.0, + "max_tokens": 450, + "codec_step": 600000, + "checkpoint": "hf://Zyphra/ZONOS3_Mini_release_ckpts/autoencoder/generator.pt", + "checkpoint_sha256": "1cedeb12d7d964026c0a16afc32abd1de23dc484533111f24c950775f1941172", + "teacher": "hf://Zyphra/ZONOS3_Mini_release_ckpts/autoencoder/teacher", + "tag": "3n_600k_sched600k_r4096_attnres_800m50k", + "codebook_sizes": [ + 4096, + 4096, + 4096, + 4096, + 4096, + 4096, + 4096, + 4096, + 4096, + 4096 + ], + "silence_frame": [ + 1918, + 746, + 3544, + 234, + 1267, + 2914, + 3944, + 2849, + 326, + 1337 + ], + "decoder": { + "kind": "istft_mr", + "label": "Multi-resolution iSTFT head + linear STFT loss, KEEP-2 pruned decoder (istft_head_a_20261002/full-unfreezeall-mr-drop30-4x10-50k, job 73313, final step 50,000: decoder.0 keeps layers 0+31, decoder.2/4/6/8 keep 0+11, cold-crop recipe; release copy = step + trainable state); causal, fp32", + "campaign": "hf://Zyphra/ZONOS3_Mini_release_ckpts/autoencoder/heads/keep2_plain", + "config": "config_full_unfreezeall_mr_drop30_4x10.json", + "checkpoint": "step_0050000.pt", + "expect_step": 50000, + "headroom_db": 3.0, + "_note": "the 600k conv-tail decoder of generator.pt is NOT used for decoding (its encoder/quantizer still initialise the kept decoder stages and encode reference clips)" + } + } +} diff --git a/zonos3/registries/generation.json b/zonos3/registries/generation.json new file mode 100644 index 0000000000000000000000000000000000000000..262b9dd0dded7af9ae1f628ec2bf84b01d92c53a --- /dev/null +++ b/zonos3/registries/generation.json @@ -0,0 +1,19 @@ +{ + "description": "Request defaults and limits of every server and the studio (zonos3.generation). sample_rate: the API's audio rate (Hz). sampling: the v2 sampling defaults (api/openapi.yaml repeats them; model/tests/test_generation.py keeps the two equal). tag_cfg_scale: the tag-CFG scale range. silence_prefill_frames: the server default length (ZONOS3_SILENCE_PREFILL_FRAMES overrides it) and the longest a request may ask for. decode_context_frames: the reference tail decoded ahead of the stream when a request leaves decode_context_frames unset or 0. reference_max_frames: the reference prefix of the GGUF servers (60 s at the dual codec's 2940-sample hop; longer reference codes keep their first frames). max_frames: the GGUF servers' default frame budget (--max). audio_max_seconds: the longest reference clip, upload and speech-edit clip.", + "sample_rate": 44100, + "sampling": { + "temperature": 0.75, + "topk": 80, + "top_p": 0.69, + "min_p": 0.0, + "repetition_penalty": 2.4, + "repetition_window": 96, + "repetition_codebooks": 6 + }, + "tag_cfg_scale": {"min": 1.0, "max": 4.0}, + "silence_prefill_frames": {"default": 3, "max": 30}, + "decode_context_frames": 30, + "reference_max_frames": 900, + "max_frames": 2000, + "audio_max_seconds": {"reference": 60, "upload": 600, "edit": 150} +} diff --git a/zonos3/registries/languages.json b/zonos3/registries/languages.json new file mode 100644 index 0000000000000000000000000000000000000000..44b12ccd12cdea498f2b1b18e8925c434ce9d88f --- /dev/null +++ b/zonos3/registries/languages.json @@ -0,0 +1,34 @@ +{ + "description": "The languages of every server and the studio (zonos3.languages). server: the TTS language codes requests use, in display order (label: the studio's name; nemo: the NeMo text-normalization package; lexicon: the pronunciation lexicon's ISO 639-3 code; speech: its row in spoken). spoken: the languages speech recognition, forced alignment and dub references understand, by Whisper-style code (name: the Qwen3-ASR language name, also the dub's label; unspaced: written without spaces between words; tts: the server language a dub into it speaks). espeak: lexicon code -> the espeak-ng voice that guesses its unknown words.", + "server": [ + {"code": "en_us", "label": "US English", "nemo": "en", "lexicon": "eng", "speech": "en"}, + {"code": "en_gb", "label": "UK English", "nemo": "en", "lexicon": "eng", "speech": "en"}, + {"code": "fr_fr", "label": "French", "nemo": "fr", "lexicon": "fra", "speech": "fr"}, + {"code": "de", "label": "German", "nemo": "de", "lexicon": "deu", "speech": "de"}, + {"code": "es", "label": "Spanish", "nemo": "es", "lexicon": "spa", "speech": "es"}, + {"code": "it", "label": "Italian", "nemo": "it", "lexicon": "ita", "speech": "it"}, + {"code": "pt_br", "label": "Portuguese", "nemo": "pt", "lexicon": "por", "speech": "pt"}, + {"code": "ja", "label": "Japanese", "nemo": "ja", "lexicon": "jpn", "speech": "ja"}, + {"code": "cmn", "label": "Mandarin", "nemo": "zh", "lexicon": "cmn", "speech": "zh"}, + {"code": "ko", "label": "Korean", "nemo": "ko", "lexicon": "kor", "speech": "ko"} + ], + "spoken": [ + {"code": "en", "name": "English", "tts": "en_us"}, + {"code": "fr", "name": "French", "tts": "fr_fr"}, + {"code": "de", "name": "German", "tts": "de"}, + {"code": "es", "name": "Spanish", "tts": "es"}, + {"code": "it", "name": "Italian", "tts": "it"}, + {"code": "pt", "name": "Portuguese", "tts": "pt_br"}, + {"code": "ja", "name": "Japanese", "tts": "ja", "unspaced": true}, + {"code": "zh", "name": "Chinese", "tts": "cmn", "unspaced": true}, + {"code": "ko", "name": "Korean", "tts": "ko"}, + {"code": "ru", "name": "Russian"}, + {"code": "yue", "name": "Cantonese", "unspaced": true} + ], + "espeak": { + "eng": "en-us", "deu": "de", "fra": "fr", "spa": "es-419", "ita": "it", "por": "pt-br", + "nld": "nl", "pol": "pl", "ces": "cs", "swe": "sv", "fin": "fi", "dan": "da", "nob": "nb", + "isl": "is", "hun": "hu", "ron": "ro", "cat": "ca", "tur": "tr", "ind": "id", "msa": "ms", + "rus": "ru", "ukr": "uk", "ell": "el", "heb": "he", "ara": "ar", "fas": "fa", "hin": "hi" + } +} diff --git a/zonos3/registries/speaker_encoder_registry.json b/zonos3/registries/speaker_encoder_registry.json new file mode 100644 index 0000000000000000000000000000000000000000..d8fb8c66922e02e721d75cce15b7d72c0c3807a8 --- /dev/null +++ b/zonos3/registries/speaker_encoder_registry.json @@ -0,0 +1,38 @@ +{ + "_comment": "Speaker-embedding encoders keyed by the checkpoint's speaker_embedding_codec; override with ZONOS3_SPEAKER_ENCODER_REGISTRY.", + "ownmect_s2": { + "type": "mect_fbank", + "description": "George's own-weights MECT-B2 speaker encoder (arXiv 2609.24061 architecture, trained from scratch at Zyphra on VoxCeleb2 + VoxBlink2, stage-2 large-margin finetune), 192-d; the ownmect_s2 column of data_shards_w2vsv (zv3subsample) and the ZTTS2 prompt vectors in ztts2_mect_prompts_20261015/vectors were extracted with this checkpoint", + "checkpoint": "hf://Zyphra/ZONOS3_Mini_release_ckpts/speaker_encoders/ownmect_s2/ckpt_0037.pth", + "sha256": "3cef65631f3161cbd8eacc6ea40e59a237c79656d85c7232dcbe0c8d07cae88f", + "backbone_type": "MECT_B2", + "backbone_config": { + "moe_type": "token", + "num_experts_shard": 2, + "num_experts_token": 4, + "top_k_shard": null, + "top_k_token": null, + "shard_scale": 1.0 + }, + "pooling": "ASTP", + "embed_dim": 192, + "sample_rate": 16000, + "max_seconds": 60, + "fbank": { + "num_mel_bins": 80, + "frame_length": 25, + "frame_shift": 10, + "dither": 0.0, + "energy_floor": 0.0, + "window_type": "hamming", + "scale": 32768 + }, + "provenance": { + "source_checkpoint": "/data/home/george/repos/w2v-bert-sv-mect-results/checkpoints/ownmect_s2_261009190656/ckpt_0037.pth", + "code": "/data/home/george/repos/w2v-bert-sv-mect (branch own-mect): recipes/DeepASV/local/mect_sv.py MECTFbank + local/third_party/antspeaker", + "infer_config": "hf://Zyphra/ZONOS3_Mini_release_ckpts/speaker_encoders/ownmect_s2/ownmect_b2_infer.yaml", + "train_config": "hf://Zyphra/ZONOS3_Mini_release_ckpts/speaker_encoders/ownmect_s2/train.yaml", + "extractor": "/data/groups/audio/gabriel/ztts2_mect_prompts_20261015/george/embed_prompt_scp.py (whole prompt, fp32, --emb-dim 192)" + } + } +} diff --git a/zonos3/server/__init__.py b/zonos3/server/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e0d56c420a7179ceea105fc381b7a3114403cf8d --- /dev/null +++ b/zonos3/server/__init__.py @@ -0,0 +1 @@ +"""HTTP pieces shared by the Python servers (zonos3_sgl, zonos3_mlx): request schemas, studio projects, keepalive.""" diff --git a/zonos3/server/dub.py b/zonos3/server/dub.py new file mode 100644 index 0000000000000000000000000000000000000000..ab91f166d8a94487e142b9550de0e8dc52deb882 --- /dev/null +++ b/zonos3/server/dub.py @@ -0,0 +1,121 @@ +"""The dubbing routes of the Python servers (/v2/dub/*) over the server's ``zonos3.dub.runtime.DubRuntime``.""" + +from __future__ import annotations + +import asyncio +import re +import tempfile +from pathlib import Path +from typing import Callable + +from fastapi import APIRouter, Header, HTTPException, Request +from fastapi.responses import Response + +from zonos3.server.edit import call +from zonos3.server.schemas import ( + DubAnalyzeRequest, + DubGenerateRequest, + DubRegenerateRequest, + DubTranscribeRequest, +) + +VIDEO_SUFFIXES = {".mp4", ".mov", ".m4v", ".webm", ".mkv", ".avi"} +AUDIO_SUFFIXES = {".wav", ".flac", ".mp3", ".ogg"} + + +async def upload(request: Request, name: str, directory: str) -> Path: + """Stream a request body (a file named ``name``) into ``directory``; 413 past the dub's upload cap.""" + from zonos3.dub.plan import MAX_VIDEO_BYTES + + declared = request.headers.get("content-length") + if declared is not None and int(declared) > MAX_VIDEO_BYTES: + raise HTTPException(status_code=413, detail="upload too large") + suffix = Path(name).suffix.lower() + path = Path(directory) / f"input{suffix if suffix in VIDEO_SUFFIXES | AUDIO_SUFFIXES else '.bin'}" + size = 0 + with open(path, "wb") as fh: + async for chunk in request.stream(): + size += len(chunk) + if size > MAX_VIDEO_BYTES: + raise HTTPException(status_code=413, detail="upload too large") + fh.write(chunk) + return path + + +def download_stem(name: str) -> str: + """The file-name stem of a muxed download (``_dub.mp4``).""" + return re.sub(r"[^A-Za-z0-9._-]+", "_", Path(name).stem).strip("._") or "video" + + +def make_router(get_runtime: Callable[[], "DubRuntime"], available: Callable[[], bool], # noqa: F821 + unavailable: str) -> APIRouter: + """``available()``: the server can dub (LACI heads and a speaking-rate condition row); ``unavailable``: the 400 + detail when it cannot.""" + router = APIRouter() + + def ready(): + if not available(): + raise HTTPException(status_code=400, detail=unavailable) + return get_runtime() + + @router.get("/v2/dub/capabilities") + async def capabilities(): + """Target languages, rate buckets, lip-sync, voice modes and limits of the dub (zonos3.dub.runtime).""" + return {**(await asyncio.to_thread(get_runtime().capabilities)), "enabled": available()} + + @router.post("/v2/dub/ref") + async def ref(request: Request, name: str = "audio"): + """A dub reference: raw audio bytes (any sound file), or a video whose audio track is taken.""" + rt = ready() + with tempfile.TemporaryDirectory(prefix="dub-") as tmp: + path = await upload(request, name, tmp) + return await call(asyncio.to_thread(rt.add_ref, str(path))) + + @router.post("/v2/dub/lips/{ref_id}") + async def lips(ref_id: str, request: Request, name: str = "video"): + """Face track + lip embeddings of the reference's video, for generate / regenerate with lipsync (AV-sync).""" + rt = ready() + + async def run(): + rt.refs.get(ref_id) # 404 before reading the body + with tempfile.TemporaryDirectory(prefix="dub-") as tmp: + video = await upload(request, name, tmp) + return await asyncio.to_thread(rt.prepare_lips, ref_id, str(video)) + + return await call(run()) + + @router.post("/v2/dub/transcribe") + async def transcribe(req: DubTranscribeRequest): + return await call(ready().transcribe(req.ref_id, req.ref_lang)) + + @router.post("/v2/dub/analyze") + async def analyze(req: DubAnalyzeRequest): + return await call(ready().analyze(req.model_dump())) + + @router.post("/v2/dub/generate") + async def generate(req: DubGenerateRequest, + x_tts_session_id: str | None = Header(default=None, alias="X-TTS-Session-ID")): + return await call(ready().generate(req.model_dump(), x_tts_session_id)) + + @router.post("/v2/dub/regenerate") + async def regenerate(req: DubRegenerateRequest, + x_tts_session_id: str | None = Header(default=None, alias="X-TTS-Session-ID")): + return await call(ready().regenerate(req.model_dump(), x_tts_session_id)) + + @router.post("/v2/dub/mux/{dub_id}") + async def mux(dub_id: str, request: Request, name: str = "video"): + """The video with the dub as its audio track (raw video bytes in, MP4 out).""" + rt = ready() + + async def run(): + rt.dubs.get(dub_id) # 404 before reading the body + with tempfile.TemporaryDirectory(prefix="dub-") as tmp: + video, out = await upload(request, name, tmp), Path(tmp) / "out.mp4" + await asyncio.to_thread(rt.mux, dub_id, str(video), str(out)) + return out.read_bytes() + + data = await call(run()) + return Response(data, media_type="video/mp4", + headers={"Content-Disposition": f'attachment; filename="{download_stem(name)}_dub.mp4"'}) + + return router diff --git a/zonos3/server/edit.py b/zonos3/server/edit.py new file mode 100644 index 0000000000000000000000000000000000000000..0f04c7219abe7f512ebfeb1af8c8f0a680a352c4 --- /dev/null +++ b/zonos3/server/edit.py @@ -0,0 +1,52 @@ +"""The speech-editing routes of the Python servers (/v2/edit/transcribe, /v2/edit/align, /v2/edit) over the server's +``zonos3.tts.edit_runtime.EditRuntime``, and the HTTP mapping of edit and dub errors.""" + +from __future__ import annotations + +from typing import Awaitable, Callable, TypeVar + +from fastapi import APIRouter, HTTPException + +from zonos3.server.schemas import EditAlignRequest, EditRequest, EditTranscribeRequest + +T = TypeVar("T") + + +async def call(awaitable: Awaitable[T]) -> T: + """Await an edit / dub runtime call, mapping its errors to HTTP statuses (zonos3.tts.edit_runtime.status_of).""" + from zonos3.dub.runtime import AlignWorkerError, UnknownId + from zonos3.tts.edit_runtime import status_of + + try: + return await awaitable + except UnknownId: + raise HTTPException(status_code=404, detail="unknown ref_id/dub_id; upload or generate again") from None + except AlignWorkerError as exc: + raise HTTPException(status_code=503, detail=f"alignment worker: {exc}") from exc + except Exception as exc: + status = status_of(exc) + if status is None: + raise + raise HTTPException(status_code=status, detail=str(exc)) from exc + + +def make_router(get_runtime: Callable[[], "EditRuntime"]) -> APIRouter: # noqa: F821 + router = APIRouter() + + @router.post("/v2/edit/transcribe") + async def transcribe(req: EditTranscribeRequest): + """Qwen3-ASR transcript of the audio to edit (chunk-wise past 30 s) and its words' FuseAlign timings.""" + return await call(get_runtime().transcribe(req)) + + @router.post("/v2/edit/align") + async def align(req: EditAlignRequest): + """FuseAlign forced alignment of the audio to ``text``: word timings, presences (``confidence``) and edit + tokens.""" + return await call(get_runtime().align(req)) + + @router.post("/v2/edit") + async def edit(req: EditRequest): + """Regenerate the edited regions of recorded speech; unedited codec frames are kept exactly.""" + return await call(get_runtime().edit(req)) + + return router diff --git a/zonos3/server/keepalive.py b/zonos3/server/keepalive.py new file mode 100644 index 0000000000000000000000000000000000000000..7f79e347211e4eae0c0b0ee1fe20b0dab16c4b4e --- /dev/null +++ b/zonos3/server/keepalive.py @@ -0,0 +1,63 @@ +"""Keep long JSON requests alive behind a proxy with a response deadline. + +A Cloudflare quick tunnel answers 524 when the origin has not responded within 100 s, which a cold alignment +worker or a long dub on a busy node can exceed. A POST to one of ``paths`` with the request header +``X-Keepalive: 1`` therefore gets its 200 status line at once, a space every ``interval`` seconds while the +endpoint works, and then the endpoint's JSON body (leading whitespace is valid JSON). An endpoint error keeps its +detail but travels in the body, since the status line is already sent: ``{"detail": ..., "status_code": 4xx}``. +Requests without the header take the normal path. +""" +from __future__ import annotations + +import asyncio +import json + +KEEPALIVE_HEADER = b"x-keepalive" + + +class KeepaliveMiddleware: + def __init__(self, app, paths: tuple[str, ...], interval: float = 10.0): + self.app, self.paths, self.interval = app, tuple(paths), float(interval) + + def _applies(self, scope) -> bool: + if scope["type"] != "http" or scope["method"] != "POST": + return False + path = scope["path"] + if not any(path == p or path.startswith(p.rstrip("/") + "/") for p in self.paths): + return False + return dict(scope.get("headers") or ()).get(KEEPALIVE_HEADER) == b"1" + + async def __call__(self, scope, receive, send): + if not self._applies(scope): + await self.app(scope, receive, send) + return + start: dict = {} + chunks: list[bytes] = [] + + async def capture(message): + if message["type"] == "http.response.start": + start.update(message) + elif message["type"] == "http.response.body": + chunks.append(message.get("body", b"")) + + task = asyncio.ensure_future(self.app(scope, receive, capture)) + await send({"type": "http.response.start", "status": 200, + "headers": [(b"content-type", b"application/json"), (b"cache-control", b"no-store"), + (b"x-keepalive", b"1")]}) + await send({"type": "http.response.body", "body": b" ", "more_body": True}) + while not task.done(): + done, _ = await asyncio.wait({task}, timeout=self.interval) + if not done: + await send({"type": "http.response.body", "body": b" ", "more_body": True}) + payload = b"".join(chunks) + exc = task.exception() + status = 500 if exc is not None else int(start.get("status", 500)) + if exc is not None: + payload = json.dumps({"detail": f"{type(exc).__name__}: {exc}"}).encode() + if status >= 400: + try: + detail = json.loads(payload).get("detail") + except (ValueError, AttributeError): + detail = payload.decode(errors="replace") + payload = json.dumps({"detail": detail, "status_code": status}).encode() + await send({"type": "http.response.body", "body": payload, "more_body": False}) diff --git a/zonos3/server/projects.py b/zonos3/server/projects.py new file mode 100644 index 0000000000000000000000000000000000000000..8757be350ae1bd24021fc72d4134313c7204ded9 --- /dev/null +++ b/zonos3/server/projects.py @@ -0,0 +1,418 @@ +"""Zonos Voice Studio projects on the server: shared by every browser with the studio link, kept across restarts. + +Layout under ``--studio-projects-dir`` (README "Projects on the server"): + +- ``projects/.json``: ``{id, name, revision, updated_at, media_bytes, data}``; ``data`` is the studio's project + document, ``revision`` an integer bumped by every save, ``updated_at`` epoch milliseconds. +- ``media/``: content-addressed blobs (written once, verified against their hash), ``media/.type`` + their optional MIME type. +- ``tmp/``: temp files, renamed into place (atomic writes on the same filesystem); ``.lock``: the write lock. + +A project's media references are the keys of ``data.media`` (``{: {type, size}}``, kept by the studio): a save +needs them all stored (400 lists the missing ones) and the GC keeps every blob some project lists. Saves carry the +revision they were based on, so two tabs or browsers never overwrite each other silently (409 with the stored one). +""" + +from __future__ import annotations + +import asyncio +import fcntl +import hashlib +import json +import os +import re +import tempfile +import threading +import time +from contextlib import contextmanager, suppress +from pathlib import Path +from typing import Any, AsyncIterable, Callable + +from fastapi import APIRouter, HTTPException, Request +from fastapi.exceptions import RequestValidationError +from fastapi.responses import FileResponse, JSONResponse, Response +from pydantic import ValidationError + +from zonos3.server.schemas import ProjectPutRequest + +MAX_PROJECT_BYTES = 20 * 1024**2 +MAX_MEDIA_BYTES = 2 * 1024**3 +GC_MIN_AGE_SECONDS = 3600.0 # newer unreferenced media may belong to a save in flight (media go up first) +_STALE_TMP_SECONDS = 86400.0 +_MEDIA_CACHE = "public, max-age=31536000, immutable" + +_ID = re.compile(r"[A-Za-z0-9][A-Za-z0-9_-]{0,127}") +_SHA256 = re.compile(r"[0-9a-f]{64}") +_MIME = re.compile(r"[A-Za-z0-9][\w.+-]*/[\w.+-]+(\s*;\s*[\w.+-]+=[\w.+\"-]+)*") +_MAX_NAME = 200 + + +class ProjectError(Exception): + """An HTTP error with extra JSON fields next to ``detail`` (409 ``revision``, 400 ``missing``).""" + + def __init__(self, status: int, detail: str, **extra: Any): + super().__init__(detail) + self.status, self.detail, self.extra = status, detail, extra + + def response(self) -> JSONResponse: + return JSONResponse({"detail": self.detail, **self.extra}, status_code=self.status, + headers={"Cache-Control": "no-store"}) + + +def check_id(project_id: str) -> str: + if not isinstance(project_id, str) or not _ID.fullmatch(project_id): + raise ProjectError(400, "invalid project id (1-128 of A-Z a-z 0-9 _ -, not starting with _ or -)") + return project_id + + +def check_sha256(sha256: str) -> str: + if not isinstance(sha256, str) or not _SHA256.fullmatch(sha256): + raise ProjectError(400, "invalid media hash (64 lowercase hex digits of the content's SHA-256)") + return sha256 + + +def media_refs(data: Any) -> list[str]: + """The hashes a project document references: the keys of ``data.media``.""" + media = data.get("media") if isinstance(data, dict) else None + if media is None: + return [] + if not isinstance(media, dict): + raise ProjectError(400, "data.media must be an object {sha256: {type, size}}") + return [check_sha256(key) for key in media] + + +def _reject_constant(name: str): + raise ValueError(f"{name} is not JSON") + + +def parse_json(body: bytes) -> Any: + """Strict JSON (no NaN / Infinity, which browsers' JSON.parse refuses).""" + try: + return json.loads(body, parse_constant=_reject_constant) + except (ValueError, UnicodeDecodeError) as exc: + raise ProjectError(400, f"invalid JSON: {exc}") from None + + +class ProjectStore: + def __init__(self, root: str | os.PathLike, max_project_bytes: int = MAX_PROJECT_BYTES, + max_media_bytes: int = MAX_MEDIA_BYTES): + self.root = Path(root) + self.projects_dir, self.media_dir, self.tmp_dir = (self.root / d for d in ("projects", "media", "tmp")) + for d in (self.projects_dir, self.media_dir, self.tmp_dir): + d.mkdir(parents=True, exist_ok=True) + self.max_project_bytes, self.max_media_bytes = int(max_project_bytes), int(max_media_bytes) + self._lock_path = self.root / ".lock" + self._thread_lock = threading.Lock() + self._list_cache: dict[str, tuple[tuple[int, int], dict]] = {} + cutoff = time.time() - _STALE_TMP_SECONDS + for tmp in self.tmp_dir.iterdir(): # leftovers of a killed server; fresh ones may be another server's + with suppress(OSError): + if tmp.stat().st_mtime < cutoff: + tmp.unlink() + + def capabilities(self) -> dict: + return {"enabled": True, "max_media_bytes": self.max_media_bytes, "max_project_bytes": self.max_project_bytes} + + # ------------------------------------------------------------------ internals + @contextmanager + def _locked(self): + """Serialize writers: threads of this server (thread lock) and other servers on the directory (flock).""" + with self._thread_lock, open(self._lock_path, "a+b") as fh: + fcntl.flock(fh, fcntl.LOCK_EX) + yield + + def _atomic_write(self, path: Path, payload: bytes) -> None: + """Temp file in tmp/, fsync, rename over ``path``: readers see the old or the new file, never a part.""" + fd, tmp = tempfile.mkstemp(dir=self.tmp_dir, prefix=path.name + ".") + try: + with os.fdopen(fd, "wb") as fh: + fh.write(payload) + fh.flush() + os.fsync(fh.fileno()) + os.replace(tmp, path) + except BaseException: + with suppress(FileNotFoundError): + os.unlink(tmp) + raise + + def _project_path(self, project_id: str) -> Path: + return self.projects_dir / f"{check_id(project_id)}.json" + + def _media_path(self, sha256: str) -> Path: + return self.media_dir / check_sha256(sha256) + + @staticmethod + def _read_record(path: Path) -> dict: + return json.loads(path.read_bytes()) + + # ------------------------------------------------------------------ projects + def list(self) -> list[dict]: + """``[{id, name, updated_at, revision, bytes, media_bytes, summary}]``, newest first.""" + entries, seen = [], set() + for path in self.projects_dir.glob("*.json"): + project_id = path.stem + if not _ID.fullmatch(project_id): + continue + try: + st = path.stat() + key = (st.st_mtime_ns, st.st_size) + cached = self._list_cache.get(project_id) + if cached is None or cached[0] != key: + record = self._read_record(path) + data = record.get("data") + entry = { + "id": project_id, "name": record.get("name"), "updated_at": record.get("updated_at"), + "revision": record.get("revision"), "bytes": st.st_size, + "media_bytes": record.get("media_bytes", 0), + "summary": data.get("summary") if isinstance(data, dict) else None, + } + cached = self._list_cache[project_id] = (key, entry) + except (OSError, ValueError): + continue # deleted meanwhile, or not ours + seen.add(project_id) + entries.append(cached[1]) + for gone in self._list_cache.keys() - seen: + self._list_cache.pop(gone, None) + entries.sort(key=lambda e: (-(e["updated_at"] or 0), e["id"])) + return entries + + def get_bytes(self, project_id: str) -> bytes: + """The stored ``{id, name, revision, updated_at, media_bytes, data}`` JSON, verbatim.""" + try: + return self._project_path(project_id).read_bytes() + except FileNotFoundError: + raise ProjectError(404, "no such project") from None + + def get(self, project_id: str) -> dict: + return json.loads(self.get_bytes(project_id)) + + def put(self, project_id: str, name: Any, data: Any, base_revision: Any) -> dict: + """Save ``data`` as ``project_id`` if ``base_revision`` is the stored revision (None for a new id).""" + path = self._project_path(project_id) + if not isinstance(name, str) or not name.strip() or len(name) > _MAX_NAME: + raise ProjectError(400, f"name must be a non-empty string of at most {_MAX_NAME} characters") + if not isinstance(data, dict): + raise ProjectError(400, "data must be a JSON object") + if base_revision is not None and (not isinstance(base_revision, int) or isinstance(base_revision, bool)): + raise ProjectError(400, "base_revision must be an integer or null") + refs = media_refs(data) + with self._locked(): + try: + stored = self._read_record(path)["revision"] + except FileNotFoundError: + stored = None + if base_revision != stored: + raise ProjectError(409, "the project changed elsewhere" if base_revision is not None and stored + else "a project with this id exists" if stored + else "the project does not exist (deleted elsewhere?)", revision=stored) + media_bytes, missing = 0, [] + for sha in refs: + try: + media_bytes += (self.media_dir / sha).stat().st_size + except FileNotFoundError: + missing.append(sha) + if missing: + raise ProjectError(400, f"{len(missing)} media not uploaded (PUT /v2/media/ first)", + missing=missing) + revision = (stored or 0) + 1 + updated_at = int(time.time() * 1000) + record = {"id": project_id, "name": name, "revision": revision, "updated_at": updated_at, + "media_bytes": media_bytes, "data": data} + payload = json.dumps(record, ensure_ascii=False, separators=(",", ":"), allow_nan=False).encode() + if len(payload) > self.max_project_bytes: + raise ProjectError(413, f"project too large ({len(payload)} > {self.max_project_bytes} bytes)") + self._atomic_write(path, payload) + return {"id": project_id, "revision": revision, "updated_at": updated_at} + + def delete(self, project_id: str) -> None: + path = self._project_path(project_id) + with self._locked(): + try: + path.unlink() + except FileNotFoundError: + raise ProjectError(404, "no such project") from None + self._list_cache.pop(project_id, None) + + def gc(self, min_age_seconds: float = GC_MIN_AGE_SECONDS) -> dict: + """Remove media no project's ``data.media`` lists, older than ``min_age_seconds`` (uploads of a save in + flight are newer). Returns ``{removed, freed_bytes, kept}``.""" + with self._locked(): + referenced: set[str] = set() + for path in self.projects_dir.glob("*.json"): + try: # an unreadable project could reference anything: keep every blob + referenced.update(media_refs(self._read_record(path).get("data"))) + except (OSError, ValueError, ProjectError) as exc: + raise ProjectError(500, f"gc aborted: {path.name} is unreadable ({exc})") from None + cutoff = time.time() - min_age_seconds + removed = freed = kept = 0 + for path in self.media_dir.iterdir(): + sha = path.name.removesuffix(".type") + if not _SHA256.fullmatch(sha) or sha in referenced: + kept += path.name == sha + continue + if path.name != sha: # a type file goes with its blob + if not (self.media_dir / sha).exists(): + path.unlink(missing_ok=True) + continue + st = path.stat() + if st.st_mtime > cutoff: + kept += 1 + continue + path.unlink(missing_ok=True) + (self.media_dir / f"{sha}.type").unlink(missing_ok=True) + removed, freed = removed + 1, freed + st.st_size + return {"removed": removed, "freed_bytes": freed, "kept": kept} + + # ------------------------------------------------------------------ media + def media(self, sha256: str) -> tuple[Path, str | None]: + """The blob's path and its stored MIME type; 404 when absent.""" + path = self._media_path(sha256) + if not path.is_file(): + raise ProjectError(404, "no such media") + try: + mime = (self.media_dir / f"{sha256}.type").read_text().strip() or None + except FileNotFoundError: + mime = None + return path, mime + + def _store_type(self, sha256: str, mime: str | None) -> None: + type_path = self.media_dir / f"{sha256}.type" + if mime and not type_path.exists(): + self._atomic_write(type_path, mime.encode()) + + async def put_media(self, sha256: str, chunks: AsyncIterable[bytes], mime: str | None = None) -> dict: + """Store a blob streamed in ``chunks`` under its SHA-256: written to tmp/ while hashed (never held in + memory), renamed into media/ when the hash matches (400 otherwise). Idempotent: a stored blob is kept and + the body not read. Returns ``{sha256, size, created}``.""" + check_sha256(sha256) + mime = (mime or "").strip() or None + if mime is not None and (len(mime) > 200 or not _MIME.fullmatch(mime)): + raise ProjectError(400, "invalid media type") + path = self.media_dir / sha256 + if path.is_file(): + with suppress(OSError): + os.utime(path) # restart the GC grace period: a save referencing it follows + await asyncio.to_thread(self._store_type, sha256, mime) + return {"sha256": sha256, "size": path.stat().st_size, "created": False} + digest, size = hashlib.sha256(), 0 + fd, tmp = tempfile.mkstemp(dir=self.tmp_dir, prefix=f"{sha256}.") + try: + with os.fdopen(fd, "wb") as fh: + async for chunk in chunks: + size += len(chunk) + if size > self.max_media_bytes: + raise ProjectError(413, f"media too large (> {self.max_media_bytes} bytes)") + digest.update(chunk) + fh.write(chunk) + fh.flush() + await asyncio.to_thread(os.fsync, fh.fileno()) + actual = digest.hexdigest() + if actual != sha256: + raise ProjectError(400, "content does not match its hash", sha256=actual) + os.replace(tmp, path) # a concurrent upload of the same blob renames identical bytes + except BaseException: + with suppress(FileNotFoundError): + os.unlink(tmp) + raise + await asyncio.to_thread(self._store_type, sha256, mime) + return {"sha256": sha256, "size": size, "created": True} + + +async def _read_body(request: Request, limit: int) -> bytes: + length = request.headers.get("content-length") + if length is not None and length.isdigit() and int(length) > limit: + raise ProjectError(413, f"request too large (> {limit} bytes)") + body = bytearray() + async for chunk in request.stream(): + body += chunk + if len(body) > limit: + raise ProjectError(413, f"request too large (> {limit} bytes)") + return bytes(body) + + +def make_router(get_store: Callable[[], ProjectStore | None]) -> APIRouter: + """``/projects`` and ``/media`` routes (mounted under ``/v2``) on the store ``get_store()`` returns (None: 404, + projects disabled).""" + router = APIRouter() + no_store = {"Cache-Control": "no-store"} + + def store() -> ProjectStore: + s = get_store() + if s is None: + raise HTTPException(status_code=404, detail="server-side projects are disabled (--studio-projects-dir)") + return s + + async def call(fn, *args): + try: + return await asyncio.to_thread(fn, *args) + except ProjectError as exc: + return exc.response() + + @router.get("/projects") + async def list_projects(): + result = await call(store().list) + return result if isinstance(result, Response) else JSONResponse(result, headers=no_store) + + @router.post("/projects/gc") + async def gc_projects(min_age_seconds: float = GC_MIN_AGE_SECONDS): + if not min_age_seconds >= 0: + raise HTTPException(status_code=400, detail="min_age_seconds must be >= 0") + result = await call(store().gc, min_age_seconds) + return result if isinstance(result, Response) else JSONResponse(result, headers=no_store) + + @router.get("/projects/{project_id}") + async def get_project(project_id: str): + result = await call(store().get_bytes, project_id) + if isinstance(result, Response): + return result + return Response(result, media_type="application/json", headers=no_store) + + @router.put("/projects/{project_id}") + async def put_project(project_id: str, request: Request): + s = store() + try: + check_id(project_id) + # 413 before the body is parsed; strict JSON (no NaN / Infinity) is a 400 as before + parsed = parse_json(await _read_body(request, s.max_project_bytes)) + except ProjectError as exc: + return exc.response() + # The body is a ProjectPutRequest (422 like every request schema of the API, loc under "body"); the store + # checks media references, revisions and sizes (400 / 409 / 413). + try: + body = ProjectPutRequest.model_validate(parsed) + except ValidationError as exc: + raise RequestValidationError( + [{**err, "loc": ("body", *err["loc"])} for err in exc.errors(include_url=False)] + ) from None + result = await call(s.put, project_id, body.name, body.data, body.base_revision) + return result if isinstance(result, Response) else JSONResponse(result, headers=no_store) + + @router.delete("/projects/{project_id}") + async def delete_project(project_id: str): + result = await call(store().delete, project_id) + return result if isinstance(result, Response) else JSONResponse({"deleted": project_id}, headers=no_store) + + @router.api_route("/media/{sha256}", methods=["GET", "HEAD"]) + async def get_media(sha256: str, request: Request): + result = await call(store().media, sha256) + if isinstance(result, Response): + return result + path, mime = result + headers = {"ETag": f'"{sha256}"', "Cache-Control": _MEDIA_CACHE} + if sha256 in request.headers.get("if-none-match", ""): + return Response(status_code=304, headers=headers) + return FileResponse(path, media_type=mime or "application/octet-stream", headers=headers) + + @router.put("/media/{sha256}") + async def put_media(sha256: str, request: Request, type: str | None = None): + s = store() + length = request.headers.get("content-length") + try: + if length is not None and length.isdigit() and int(length) > s.max_media_bytes: + raise ProjectError(413, f"media too large (> {s.max_media_bytes} bytes)") + result = await s.put_media(sha256, request.stream(), type or request.headers.get("content-type")) + except ProjectError as exc: + return exc.response() + return JSONResponse(result, status_code=201 if result["created"] else 200, headers=no_store) + + return router diff --git a/zonos3/server/schemas.py b/zonos3/server/schemas.py new file mode 100644 index 0000000000000000000000000000000000000000..b0216892d6cd0effec68cefe0de76cf0dbb6ed3a --- /dev/null +++ b/zonos3/server/schemas.py @@ -0,0 +1,270 @@ +"""Request bodies of the v2 HTTP API, transcribed from api/openapi.yaml (the contract: field names, types, defaults, +enums and ranges). Every model forbids unknown fields, so anything the schema can express fails with FastAPI's 422 +``{"detail": [{loc, msg, type}]}``; state- or semantics-dependent checks stay in the handlers (400).""" + +from __future__ import annotations + +from typing import Annotated, Any, Dict, List, Literal + +from pydantic import BaseModel, ConfigDict, Field, StrictInt + +from zonos3.generation import DECODE_CONTEXT_FRAMES, SAMPLING, TAG_CFG_MAX_SCALE, TAG_CFG_MIN_SCALE + + +class _Strict(BaseModel): + model_config = ConfigDict(extra="forbid") + + +Seed = Annotated[int, Field(ge=0, le=2**32 - 1)] +ConditionBuckets = Dict[str, int | None] | List[int | None] | None +ConditionValues = Dict[str, float | None] | List[float | None] | None +Controls = Dict[str, float] | None + + +# ----------------------------------------------------------------------------------------------------- generation +class ControlSpan(_Strict): + """Hidden-space controls over the characters [start, end) of a request's text.""" + + start: int = Field(ge=0) + end: int = Field(ge=0) + controls: Dict[str, float] + + +class GenerationOptions(_Strict): + """The generation fields GenerateRequest and SpeechRequest share.""" + + language: str = "en_us" + text_normalization: bool = True + # Codec-matched silence frames prefilled into the audio stream (None = the server default; 0 = off; at most the + # registry's maximum, checked by the request rules: 400). + silence_prefill_frames: int | None = None + # Decode the generated frames behind the last decode_context_frames of the reference prompt. + decode_context: bool = False + decode_context_frames: int = DECODE_CONTEXT_FRAMES # 0 = the registry's + # Sampling: the generation registry's defaults (zonos3.generation.SAMPLING). + temperature: float = SAMPLING["temperature"] + topk: int = SAMPLING["topk"] + top_p: float = SAMPLING["top_p"] + min_p: float = SAMPLING["min_p"] + max_tokens: int | None = None # None = the server's frame budget + fade_out_ms: float = 0.0 + repetition_window: int = SAMPLING["repetition_window"] + repetition_penalty: float = SAMPLING["repetition_penalty"] + repetition_codebooks: int = SAMPLING["repetition_codebooks"] + seed: Seed | None = None # None = drawn by the server (echoed in X-Seed) + # "prefix" streams prefix re-decodes (matched long-context codecs), "whole" one exact chunk at EOS. + stream_decode: Literal["prefix", "whole"] | None = None + speaker_mode: Literal["embedding", "reference"] | None = None + # Condition rows of the cond3 finetunes: bucket ids per name or raw values mapped through the checkpoint's edges. + condition_buckets: ConditionBuckets = None + condition_values: ConditionValues = None + headroom_db: Annotated[float, Field(ge=0.0, le=24.0)] | None = None # None = the decoder's registry value + speaker_audio_base64: str | None = None + speaker_audio_name: str | None = None + # Pre-encoded reference prefix codes [[cb0..cbN], ...] for raw-reference checkpoints. + speaker_reference_codes: Annotated[List[List[Annotated[int, Field(ge=0)]]], Field(min_length=1)] | None = None + speaker_embedding_base64: str | None = None + speaker_embedding_name: str | None = None + speaker_embedding_id: str | None = None + speaker_blend_embedding_id_a: str | None = None + speaker_blend_embedding_id_b: str | None = None + speaker_blend_t: Annotated[float, Field(ge=0.0, le=1.0)] | None = None + # Guidance on the hidden-space delta of controls / control_spans through a twin without it (1 = off; needs + # speaker_mode=embedding). + controls_cfg_scale: float = 1.0 + # Reference CFG: uncond + scale * (cond - uncond) (1 = off). + speaker_cfg_scale: float = Field(default=1.0, ge=0.0, allow_inf_nan=False) + # Tagged-vs-plain guidance on nonverbal markup (1 = off; above 1 needs markup and speaker / controls CFG at 1). + tag_cfg_scale: float = Field(default=1.0, ge=TAG_CFG_MIN_SCALE, le=TAG_CFG_MAX_SCALE) + # An accent adapter of GET /v2/capabilities "accents" (None = the base model). + accent: str | None = None + accent_strength: float = 1.0 + # Steering-bundle controls "." -> dose (GET /v2/controls). + controls: Controls = None + control_spans: List[ControlSpan] | None = None + control_span_rate: Annotated[float, Field(gt=0.0)] | None = None # frames per character (None = 1.0) + # "reading": the spans follow the LACI alignment heads' reading position (X-Control-Span-Follow says which ran). + control_span_follow: Literal["rate", "reading"] = "rate" + control_span_lead: Annotated[float, Field(ge=0.0, le=8.0)] | None = None + control_span_lag: Annotated[float, Field(ge=-4.0, le=8.0)] | None = None + # LACI: guard against skips, hallucinations and truncation (servers with --laci-heads). + laci: bool = False + + +class GenerateRequest(GenerationOptions): + text: str + stream: bool = True + # "pcm": float32 PCM; "wav": buffered 16-bit WAV (needs stream=false). + format: Literal["pcm", "wav"] = "pcm" + + +class SpeechRequest(GenerationOptions): + """OpenAI-compatible speech request: ``voice`` is a speaker id of GET /v2/speakers.""" + + model: str + input: str + voice: str | None = None + response_format: Literal["pcm", "wav"] = "pcm" + + +# ------------------------------------------------------------------------------------------------------- speakers +class SpeakerCreateRequest(_Strict): + label: str | None = None + speaker_audio_base64: str | None = None + speaker_audio_name: str | None = None + speaker_embedding_base64: str | None = None + speaker_embedding_name: str | None = None + + +# ------------------------------------------------------------------------------------------------------ phonemize +class PhonemizeRequest(_Strict): + text: str = Field(max_length=5000) + language: str = "en_us" + guess: bool = True + + +# ----------------------------------------------------------------------------------------------------------- edit +class EditTranscribeRequest(_Strict): + audio_base64: str + # The audio's language (server code, as /v2/generate): the Qwen3-ASR language and FuseAlign's tokenization. + language: str = "en_us" + + +class EditAlignRequest(_Strict): + audio_base64: str + text: str + language: str = "en_us" + + +class EditWordIn(_Strict): + """One word of the original with its timing (seconds), as /v2/edit/align returns it.""" + + word: str + start: float + end: float + tokens: List[str] | None = None # edit tokens (zonos3.tts.textmatch.tokens of the word) when missing + confidence: float | None = None + + +class EditRequest(_Strict): + """Edit recorded speech so it says ``target_text``. + + Regions come from ``spans`` ([start, end] seconds) when given, otherwise from a word diff between + ``original_text`` (Qwen3-ASR recognition when omitted) and ``target_text`` over a FuseAlign forced alignment of the + audio. + """ + + audio_base64: str + target_text: str + original_text: str | None = None + # Word timings of original_text the caller checked or corrected (in order): used instead of the server's FuseAlign + # alignment for windowing and expected fill lengths, and returned as `words`. + original_words: List[EditWordIn] | None = None + spans: List[Annotated[List[float], Field(min_length=2, max_length=2)]] | None = None + margin_seconds: float = Field(default=0.08, ge=0.0, le=1.0) + max_span_seconds: float = Field(default=30.0, gt=0.0, le=120.0) + language: str = "en_us" + text_normalization: bool = True + temperature: float = SAMPLING["temperature"] + topk: int = SAMPLING["topk"] + top_p: float = SAMPLING["top_p"] + min_p: float = SAMPLING["min_p"] + repetition_window: int = SAMPLING["repetition_window"] + repetition_penalty: float = SAMPLING["repetition_penalty"] + repetition_codebooks: int = SAMPLING["repetition_codebooks"] + seed: Seed | None = None + num_takes: int = Field(default=1, ge=1, le=4) + # Speaker-embedding checkpoints: embed the original clip into the speaker row in front of the text (False leaves + # the row out; the unmasked audio alone carries the voice). None = on when the checkpoint has the row: on the + # release finetune it lowered edited WER and halved collapsed fills. + speaker_embedding: bool | None = None + # Condition rows (cond3 checkpoints), as in /v2/generate; unset rows are unknown. + condition_buckets: ConditionBuckets = None + condition_values: ConditionValues = None + # Steering bundle controls ("." -> dose, as /v2/generate `controls`) on every regenerated region: + # raw directions move the clip's speaker-row embedding, hidden ones steer every frame the fill generates (the + # prefilled text and unmasked context are not steered). + controls: Controls = None + # One entry per `spans` entry (explicit spans only): region k uses controls + region_controls[k]. + region_controls: List[Dict[str, float] | None] | None = None + # Clips longer than max_context_seconds are edited on word-snapped windows: each region plus context_seconds of + # unedited audio per side (edit training saw 2-20 s clips). Shorter clips are edited whole. + max_context_seconds: float = Field(default=16.0, gt=0.0, le=20.0) + context_seconds: float = Field(default=4.0, ge=0.0, le=10.0) + # The span-end token is masked until a fill reaches min_fill_ratio x its expected length. 0 = off. + min_fill_ratio: float = Field(default=0.7, ge=0.0, le=1.0) + # Transcribe the edited audio with Qwen3-ASR and report WER/CER against target_text (and its FuseAlign words). + verify: bool = False + # Tag CFG is not offered for edits: any value other than 1.0 is refused (400) rather than ignored. + tag_cfg_scale: float = 1.0 + + +# ------------------------------------------------------------------------------------------------------------ dub +class DubTranscribeRequest(_Strict): + ref_id: str + ref_lang: str | None = None + + +class DubWord(_Strict): + word: str + start: float + end: float + + +class DubAnalyzeRequest(_Strict): + ref_id: str + ref_text: str | None = None + # Word timings the caller already has (a Scene mixdown, a Direct take): no forced alignment of ref_text. + ref_words: List[DubWord] | None = None + ref_lang: str = "en" + target_text: str + target_lang: str = "fr" + min_pause_s: float = 0.30 + + +class DubVoice(_Strict): + # "source": clone the reference speaker from its own audio; "studio": a studio voice (speaker_embedding_id, in + # speaker_mode=embedding) with Cast-bench steering controls (raw + hidden doses). + mode: Literal["source", "studio"] = "source" + speaker_embedding_id: str | None = None + controls: Controls = None + + +class DubSegmentIn(_Strict): + ref_start: float + ref_end: float + target_text: str + # speaking-rate bucket on the target language's scale (/v2/dub/capabilities.buckets: row buckets 0..n-1 and the + # tempo-steered ones below / above); None = from the text's rate + bucket: int | None = None + voice: DubVoice | None = None # None = the request's voice + controls: Controls = None # the segment's direction, added to its voice's controls + + +class DubGenerateRequest(_Strict): + ref_id: str + target_lang: str + seed: int = 0 + segments: List[DubSegmentIn] + lipsync: bool = False # warp the dub onto the lips of the reference's video (POST /v2/dub/lips first) + voice: DubVoice | None = None # None = {"mode": "source"} + + +class DubRegenerateRequest(_Strict): + dub_id: str + segment: int + target_text: str + seed: int = 0 + bucket: int | None = None # as DubSegmentIn.bucket; None = from the text's rate + lipsync: bool = False + voice: DubVoice | None = None # None = the segment's voice + controls: Controls = None # None = the segment's controls; {} clears them + + +# ------------------------------------------------------------------------------------------------------- projects +class ProjectPutRequest(_Strict): + """PUT /v2/projects/{id}: the store (zonos3.server.projects) checks media references, revisions and sizes.""" + + name: str = Field(min_length=1, max_length=200) + data: Dict[str, Any] + base_revision: StrictInt | None = None diff --git a/zonos3/speaker_cfg.py b/zonos3/speaker_cfg.py new file mode 100644 index 0000000000000000000000000000000000000000..00b9fca5f67db175658842fb408f61a541cb95f1 --- /dev/null +++ b/zonos3/speaker_cfg.py @@ -0,0 +1,89 @@ +"""Classifier-free guidance on the speaker conditioning: the raw codec reference prefix or the reserved speaker-embedding +row. The unconditional twin is the same prompt with that conditioning removed (and, on condition-row models, all-unknown +condition rows): the training-side evaluation generator's twin. guided = uncond + scale * (cond - uncond).""" +from __future__ import annotations +import math +from dataclasses import dataclass +from typing import Sequence + +import torch + + +def is_reserved_speaker_slot(frame: torch.Tensor, *, n_codebooks: int, audio_pad_id: int, text_vocab: int) -> bool: + """The all-pad row (audio pad on every codebook, text pad) whose embedding the speaker projection replaces.""" + return (frame.numel() > n_codebooks and bool(torch.all(frame[:n_codebooks] == int(audio_pad_id))) + and int(frame[n_codebooks]) == int(text_vocab)) + + +def unconditional_prompt(msg, *, n_codebooks: int, audio_pad_id: int, input_ids: torch.Tensor | None = None, + speaker_token_position: int | None = None, text_vocab: int | None = None) -> torch.Tensor: + """The prompt with its speaker conditioning removed, never padded in place: the recorded reference prefix (raw + reference path) or the reserved speaker row at position 0 (embedding path; `input_ids` / `speaker_token_position` + are the scheduler's final prompt when it added the row itself).""" + tokens = msg.input_ids if input_ids is None else input_ids + # A controls delta rides along: hidden-space (attnres_source) deltas steer both branches (the scheduler copies + # them to the twin). + if len(tokens) == 0: + raise ValueError('Speaker CFG requires a text-ending target prompt') + # text / condition / speaker rows are all-pad audio rows; rows after the text may be a prefilled audio opening + # (codec silence, 2026-10-17) that both branches keep + if not bool(torch.all(tokens[:, :n_codebooks] == audio_pad_id, dim=1).any()): + raise ValueError('Speaker CFG requires a text-ending target prompt') + prefix = int(msg.speaker_reference_prefix_length) + if msg.speaker_embedding is not None: + if prefix: + raise ValueError('Speaker CFG: a speaker embedding and a reference prefix are mutually exclusive') + position = msg.speaker_token_position if speaker_token_position is None else speaker_token_position + if (position != 0 or text_vocab is None or len(tokens) < 2 + or not is_reserved_speaker_slot(tokens[0], n_codebooks=n_codebooks, audio_pad_id=audio_pad_id, text_vocab=text_vocab)): + raise ValueError('Speaker CFG on the embedding path needs the reserved speaker row at position 0') + return tokens[1:].clone() + if not 0 < prefix < len(tokens): + raise ValueError('Speaker CFG requires a nonempty reference prefix and target prompt') + + return tokens[prefix:].clone() + + +@dataclass +class SpeakerCfgTwin: + input_ids: torch.Tensor + removed_rows: int # rows the twin lacks in front: the reference prefix or the speaker row + condition_values: list[int] | None # all unknown on condition-row models + condition_token_start: int # shifted back by removed_rows + + +def speaker_cfg_twin(msg, input_ids: torch.Tensor, *, n_codebooks: int, audio_pad_id: int, text_vocab: int, + speaker_token_position: int, condition_values: list[int] | None, condition_token_start: int, + condition_unknowns: Sequence[int]) -> SpeakerCfgTwin: + """Everything the scheduler needs for the speaker-CFG twin of a request: the prompt without its speaker conditioning, + no speaker embedding (the caller drops it), and on condition-row models all-unknown rows shifted back by the removed + rows. Identical for both paths to the evaluation generator's twin.""" + twin_ids = unconditional_prompt(msg, n_codebooks=n_codebooks, audio_pad_id=audio_pad_id, input_ids=input_ids, + speaker_token_position=speaker_token_position, text_vocab=text_vocab) + removed = int(len(input_ids) - len(twin_ids)) + if condition_values is not None: + if len(condition_unknowns) != len(condition_values): + raise ValueError("Speaker CFG twin: one unknown id per condition row") + values: list[int] | None = [int(u) for u in condition_unknowns] + start = int(condition_token_start) - removed + if start < 0: + raise ValueError('Speaker CFG twin: the condition rows would start before the prompt') + else: + values, start = None, int(condition_token_start) + return SpeakerCfgTwin(input_ids=twin_ids, removed_rows=removed, condition_values=values, condition_token_start=start) + + +def guided_logits(conditional: torch.Tensor, unconditional: torch.Tensor, scale: float) -> torch.Tensor: + """Mix raw logits in FP32 before any sampler transforms or invalid-code masks.""" + if not math.isfinite(scale) or scale < 0: + raise ValueError('Speaker CFG scale must be finite and nonnegative') + if conditional.shape != unconditional.shape: + raise ValueError('CFG branches must have identical logit shapes') + if scale == 1.0: + return conditional.float() + if scale == 0.0: + return unconditional.float() + return unconditional.float() + scale * (conditional.float() - unconditional.float()) +# EMBEDDING_CFG_20261016 + +# DECODE_CONTEXT_RUNTIME_20261017 diff --git a/zonos3/tokenizer/__init__.py b/zonos3/tokenizer/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/zonos3/tokenizer/dual_reference.py b/zonos3/tokenizer/dual_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..82e9fdfea4c8a09c5073b157b03760e192f31461 --- /dev/null +++ b/zonos3/tokenizer/dual_reference.py @@ -0,0 +1,133 @@ +"""Encode reference audio with the frozen fixed-600k dual codec (the family "dual" entry of the codec registry). + +This is the encoder side of the matched codec that decodes the ZONOS3 LM's tokens: the MossAutoencoder adapter of +zonos3.codec (native SSL teacher -> semantic Q1, acoustic residual RVQ, 10 x 4096 codes at 15 Hz, hop 2940), built +from the registry entry's generator checkpoint and SSL teacher. Preprocessing mirrors the codec evaluation's prompt +encoding: mono, resample to 44.1 kHz with torchaudio, peak normalize only above 1.0, keep whole codec frames at the +reference limit (the training selector's rule). +""" +from __future__ import annotations + +import math +import os +import sys +from pathlib import Path +from types import SimpleNamespace + +import numpy as np +import torch + +from zonos3.generation import UPLOAD_MAX_SECONDS +from zonos3.tokenizer import matched_codec +from zonos3.utils import release + +CODEC_RATE = 44100 +HOP = 2940 +CODEBOOKS = 10 +_ENCODERS: dict = {} + + +def _dual_entry() -> dict: + entries = [e for e in matched_codec.registry().values() if e.get("family") == "dual"] + if len(entries) != 1: + raise RuntimeError(f"expected exactly one dual-family codec in {matched_codec.REGISTRY}, found {len(entries)}") + return entries[0] + + +def get_encoder(device: str | None = None): + """The codec adapter's MossAutoencoder, one per device, loaded on first use.""" + device = device or os.environ.get("ZONOS3_AUDIO_CODEC_DEVICE", "cuda:0") + if device in _ENCODERS: + return _ENCODERS[device] + # The codec's Transformers teacher must not pick up the TTS runtime's pinned `kernels` module. + saved_kernels = sys.modules.get("kernels") + sys.modules["kernels"] = None # type: ignore[assignment] + try: + from transformers import Wav2Vec2BertModel # noqa: F401 (import under the shim) + finally: + if saved_kernels is None: + sys.modules.pop("kernels", None) + else: + sys.modules["kernels"] = saved_kernels + from zonos3.codec.codec_adapter import MossAutoencoder + + e = _dual_entry() + index = torch.device(device).index or 0 + previous = torch.cuda.current_device() + torch.cuda.set_device(index) + try: + encoder = MossAutoencoder( + SimpleNamespace( + hybrid_batch_size=1, + hybrid_chunk_seconds=20.0, + hybrid_context_seconds=10.0, + hybrid_cuda_graph=os.environ.get("ZONOS3_DUAL_CODEC_CUDA_GRAPH", "1") == "1", + ), + generator_path=release.resolve_file(e["checkpoint"]), + teacher_dir=release.resolve_dir_or_local(e["teacher"]), + step=int(e["codec_step"]), + codebook_sizes=e["codebook_sizes"], + name=e["codec"], + checkpoint_sha256=e["checkpoint_sha256"], + device=device, + ) + finally: + torch.cuda.set_device(previous) + _ENCODERS[device] = encoder + return encoder + + +def prepare_reference(waveform: torch.Tensor, sample_rate: int, max_seconds: float) -> torch.Tensor: + if not 0 < max_seconds <= UPLOAD_MAX_SECONDS: + raise ValueError(f"Codec input limit must be in (0, {UPLOAD_MAX_SECONDS:g}] seconds") + if waveform.ndim == 1: + waveform = waveform[None] + if waveform.ndim != 2 or not waveform.shape[-1] or not torch.isfinite(waveform).all(): + raise ValueError("Expected a finite, nonempty reference waveform") + waveform = waveform.detach().cpu().float().mean(0, keepdim=True) + if sample_rate != CODEC_RATE: + import torchaudio.functional as AF + + waveform = AF.resample(waveform, int(sample_rate), CODEC_RATE) + if waveform.shape[-1] < CODEC_RATE // 2: + raise ValueError("Reference shorter than 0.5 s") + peak = float(waveform.abs().amax()) + if peak > 1.0: # as encode_prompts.py / the interactive codec service + waveform = waveform / peak + maximum = math.floor(max_seconds * CODEC_RATE / HOP) * HOP + return waveform[:, :maximum].contiguous() + + +@torch.inference_mode() +def encode_dual_reference( + waveform: torch.Tensor, + sample_rate: int, + *, + max_seconds: float = 30.0, + device: str | None = None, +) -> torch.Tensor: + """Waveform -> int32 codes [frames, 10] for the reference prefix.""" + waveform = prepare_reference(waveform, sample_rate, max_seconds) + encoder = get_encoder(device) + index = torch.device(device or os.environ.get("ZONOS3_AUDIO_CODEC_DEVICE", "cuda:0")).index or 0 + previous_device = torch.cuda.current_device() + previous_stream = torch.cuda.current_stream(previous_device) + torch.cuda.set_device(index) + try: + codes = np.asarray(encoder.encode(waveform.numpy(), CODEC_RATE)) + finally: + torch.cuda.set_device(previous_device) + torch.cuda.set_stream(previous_stream) + expected = math.ceil(waveform.shape[-1] / HOP) + if codes.ndim != 2 or codes.shape != (expected, CODEBOOKS): + raise RuntimeError(f"dual codec returned codes of shape {codes.shape}; expected {(expected, CODEBOOKS)}") + if codes.min() < 0 or codes.max() >= 4096: + raise RuntimeError("dual codec returned out-of-range codes") + return torch.from_numpy(codes.astype(np.int32)).contiguous() + + +def encode_dual_reference_file(path: str | Path, *, max_seconds: float = 30.0, device: str | None = None) -> torch.Tensor: + import soundfile as sf + + wav, sr = sf.read(str(path), dtype="float32", always_2d=True) + return encode_dual_reference(torch.from_numpy(wav.T.copy()), int(sr), max_seconds=max_seconds, device=device) diff --git a/zonos3/tokenizer/matched_codec.py b/zonos3/tokenizer/matched_codec.py new file mode 100644 index 0000000000000000000000000000000000000000..ccb6887678f102efc544d45ca4133196ca20a982 --- /dev/null +++ b/zonos3/tokenizer/matched_codec.py @@ -0,0 +1,102 @@ +"""Decode the frozen codec used to tokenize each matched LM's training data. + +Decoding goes through the causal multi-resolution iSTFT head declared by the registry entry's ``decoder`` block: by +default the KEEP-2 pruned head (``codec_registry_keep2_plain.json``, istft_head_a_20261002 full-unfreezeall-mr-drop30-4x10; +KEEP2_DEFAULT_20261103); ``ZONOS3_CODEC_REGISTRY=/codec_registry.json`` selects the full-decoder MR head. +The 600k conv-tail decoder is never used. The 600k generator.pt only supplies the frozen encoder/quantizer and the +initial decoder stages that the head checkpoint then overrides.""" +import hashlib,json,os,time +from pathlib import Path +import torch +from zonos3.utils.release import hf_join,resolve_file # RELEASE_HF_20261021 +REGISTRY=os.environ.get('ZONOS3_CODEC_REGISTRY') or str(Path(__file__).resolve().parents[1]/'registries'/'codec_registry_keep2_plain.json') # may be hf:// +_CACHE={} +_INFO={} +def registry():return json.loads(Path(resolve_file(REGISTRY)).read_text()) +def codec_names():return {v['codec'] for v in registry().values()} +def entry(codec): + values=[v for v in registry().values() if v['codec']==codec] + if len(values)!=1:raise ValueError(f'Unknown matched codec {codec}') + return values[0] +def decoder_spec(codec): + """The registry's decoder block; every matched codec must declare a causal iSTFT decoder (no conv-tail fallback).""" + e=entry(codec) + spec=e.get('decoder') + if not spec or spec.get('kind')!='istft_mr': + raise RuntimeError(f'matched codec {codec!r} declares no iSTFT decoder in {REGISTRY}; the conv-tail decoder is disabled') + return spec +def decoder_headroom_db(codec): + return float(decoder_spec(codec).get('headroom_db',0.0)) +def decoder_info(codec): + spec=decoder_spec(codec) + info=dict(kind=spec['kind'],label=spec.get('label'),checkpoint=hf_join(spec['campaign'],spec['checkpoint']), + expect_step=spec.get('expect_step'),headroom_db=float(spec.get('headroom_db',0.0)),causal=True) + info.update(_INFO.get(codec,{})) + return info +def _sha256(path): + h=hashlib.sha256() + with open(path,'rb') as f: + for chunk in iter(lambda:f.read(16*1024*1024),b''):h.update(chunk) + return h.hexdigest() +def load_model(codec,device,prune=True): + """Build the iSTFT-head decoder exactly as the listening viewer's decode.py does: ISTFTCodec(cfg['model'], cfg['head']), + pretrained generator weights, then the run's trainable state (decoder stages + head) from the pinned checkpoint.""" + e=entry(codec);spec=decoder_spec(codec) + from zonos3.codec.istft_head_a_20261002.model import ISTFTCodec + campaign=spec['campaign'] + cfg=json.loads(Path(resolve_file(hf_join(campaign,spec['config']))).read_text()) + assert cfg.get('decoder',{}).get('type')!='original','the registry points at a conv-tail (original decoder) config' + generator_path=Path(resolve_file(cfg['init']['generator_checkpoint'])) + assert str(generator_path)==resolve_file(e['checkpoint']),(str(generator_path),e['checkpoint']) + generator_state=torch.load(generator_path,map_location='cpu',mmap=True,weights_only=True) + assert generator_state['step']==e['codec_step'] and generator_state['config']['model']==cfg['model'] + model=ISTFTCodec(cfg['model'],cfg['head']) + init=model.load_pretrained(generator_state['generator']) + checkpoint=Path(resolve_file(hf_join(campaign,spec['checkpoint']))) + state=torch.load(checkpoint,map_location='cpu',mmap=True,weights_only=False) + if spec.get('expect_step') is not None: + assert int(state['step'])==int(spec['expect_step']),(str(checkpoint),int(state['step']),spec['expect_step']) + if 'trainable' in state:model.load_trainable_state_dict(state['trainable']) + else: + assert not model.trainable_stages + model.head.load_state_dict(state['head'],strict=True) + model.eval().requires_grad_(False) + if prune:prune_model(model,e) + _INFO[codec]=dict(step=int(state['step']),checkpoint_bytes=checkpoint.stat().st_size, + checkpoint_mtime=time.strftime('%Y-%m-%dT%H:%M:%S',time.localtime(checkpoint.stat().st_mtime)), + model=type(model).__name__,init=init if isinstance(init,dict) else None) + del state,generator_state + return model.to(device) +def prune_model(model,e): + # ISTFTCodec never holds the encoder (its __init__ keeps only stages/quantizer/semantic_head/to_external of the base codec); + # semantic_head is used by features() and must stay. + for name in ('encoder','to_internal','semantic_encoder'): + if hasattr(model,name): + try:delattr(model,name) + except Exception:pass + +def decode_model(model,codes,e): + """[B, frames, codebooks] int -> float32 [B, samples]; fp32 with TF32 off, like the viewers' decode service.""" + device=next(model.parameters()).device + packed=codes.permute(0,2,1).to(device=device,dtype=torch.int64) + expected=packed.shape[-1]*e['hop'] + prev=(torch.backends.cuda.matmul.allow_tf32,torch.backends.cudnn.allow_tf32) + torch.backends.cuda.matmul.allow_tf32=False;torch.backends.cudnn.allow_tf32=False + try: + with torch.inference_mode(): + audio=model(packed) + finally: + torch.backends.cuda.matmul.allow_tf32,torch.backends.cudnn.allow_tf32=prev + if audio.shape!=(packed.shape[0],1,expected):raise RuntimeError(f'Codec output shape {tuple(audio.shape)}; expected {expected} samples') + if not torch.isfinite(audio).all():raise RuntimeError('Nonfinite codec audio') + return audio.float().squeeze(1).cpu() + +def decode(codes,codec): + e=entry(codec) + if codes.ndim!=3 or codes.shape[-1]!=e['codebooks'] or bool(((codes<0)|(codes>=4096)).any()):raise ValueError('Invalid matched codec tokens') + device=os.environ.get('ZONOS3_AUDIO_CODEC_DEVICE','cuda:0');key=(codec,device) + if key not in _CACHE: + actual=_sha256(resolve_file(e['checkpoint'])) + assert actual==e['checkpoint_sha256'],('generator checkpoint sha256',actual,e['checkpoint_sha256']) + _CACHE[key]=load_model(codec,device) + return decode_model(_CACHE[key],codes,e) diff --git a/zonos3/tokenizer/textnorm.py b/zonos3/tokenizer/textnorm.py new file mode 100644 index 0000000000000000000000000000000000000000..e6ff10bc9c1e2ed703768cd5f9eb1b7dc72f6a10 --- /dev/null +++ b/zonos3/tokenizer/textnorm.py @@ -0,0 +1,305 @@ +"""TTS text normalization using the vendored NeMo forward-TN grammars. + +Converts written text to its spoken form ("$5.32" -> "five dollars thirty two +cents") before tokenization. Grammar construction is expensive (~10-30s per +language) the first time; compiled WFSTs are cached as .far files under +ZONOS3_TTS_NORM_CACHE_DIR (default ~/.cache/zonos3-tts-norm) and reload in +well under a second. Use tools/build_tts_norm_fars.py to prewarm all caches. + +Disable globally with ZONOS3_TTS_NORM=0, or per request via the +text_normalization flag. +""" + +from __future__ import annotations + +import os +import re +import threading +from typing import Dict, Optional + +from zonos3 import languages +from zonos3.tts.markup import has_nonverbal_markup, split_nonverbal_markup +import logging + +logger = logging.getLogger(__name__) + +# Server language codes -> NeMo text_normalization language packages. +SERVER_TO_NEMO_LANG: Dict[str, str] = {lang.code: lang.nemo for lang in languages.SERVER} + +# Upstream's own tests run Korean grammars with lower_cased input; everything +# else uses cased. +LOWER_CASED_LANGS = {"ko"} + +# zh/ja verbalizers read a cached .far but never write one (upstream quirk); +# we post-write it after first compile so later loads are fast. Note ja reads +# a "jp_" prefixed name. +_VERBALIZER_FAR_PREFIX = {"zh": "zh", "ja": "jp"} + +# A digit directly followed by sentence punctuation confuses several upstream +# r1.2.0 grammars: pt's tagger raises FstOpError outright and de reads dates +# digit-by-digit (reproduced with upstream code and its pinned pynini +# 2.1.6.post1 — upstream bugs, not vendoring artifacts). Space the punctuation +# off before normalization; it is re-attached afterwards. +_DIGIT_PUNCT_RE = re.compile(r"(\d)([.!?,;:])(?=\s|$)") +_SPACE_PUNCT_RE = re.compile(r" +([.!?,;:])(?=\s|$)") + +# Moses-based punct_post_process re-attaches punctuation well for these +# languages. For the European languages it also glues currency symbols to the +# following word ("5,32 € am" -> "€am"), so there we skip moses and only +# collapse the spacing we introduced ourselves. +_MOSES_POSTPROCESS_LANGS = {"en", "zh", "ja", "ko"} + +# Line breaks (LINE_BREAKS_20261019). NeMo's tagger treats "\n" as whitespace, but post_process_punct (the Moses path +# above) re-matches the spacing around every ASCII punctuation mark to the ORIGINAL input and only knows " ": a period +# followed by a newline came back glued to the next word ("spend less.\n\nHunt" -> "spend less.Hunt", a bare "." token +# that the model speaks as "dot"), and after a digit the re-attach below failed too ("$5.\nNext" -> "five dollars .Next"). +# Any whitespace run that contains a line break, tab or other non-space whitespace becomes ONE plain space before +# normalization (the comparison input must already carry the space); runs of plain spaces are untouched, so single-line +# text is byte-identical. Training transcripts were single-line, so this is also the in-distribution shape for the +# tokenizer when normalization is off (a raw "\n\n" tokenizes to a never-seen ".ĊĊ" token). +_LINE_BREAK_RE = re.compile(r"\s*[^\S ]\s*") + + +def collapse_line_breaks(text: str) -> str: + """One plain space for every whitespace run that contains a line break, tab or non-breaking space.""" + return _LINE_BREAK_RE.sub(" ", text) if text else text + + +# Pronunciation groups of phoneme-token checkpoints (zonos3.tts.superbpe): never normalized. +_PHONEME_OPEN = "\ue000" +_PHONEME_GROUP_RE = re.compile("(\ue000[^\ue000\ue001]*\ue001)") + + +# Per-language pre-passes (TEXTNORM_PREPASS_20261019). Each one works around a reproduced upstream r1.2.0 grammar +# behaviour; single-line text in every other language is byte-identical to before. +# +# ja / zh: the ja grammar raises FstOpError on an ASCII space after sentence punctuation ("です。 次" -> the whole request +# used to come back raw), and neither language writes spaces between its own characters, so whitespace between two CJK +# characters (incl. CJK punctuation) is removed; spaces next to Latin letters or digits ("3.5 km") are kept. +_CJK = " -〿぀-ヿㇰ-ㇿ㐀-䶿一-鿿豈-﫿＀-￯" +_CJK_SPACE_RE = re.compile(rf"(?<=[{_CJK}])\s+(?=[{_CJK}])") +_CJK_LANGS = {"ja", "zh"} + +# de: "3." is both the ordinal "dritte" and a sentence-final cardinal. The generic digit rule turned every mid-sentence +# ordinal and day of month into a cardinal ("am 3. Oktober" -> "am drei. Oktober"), while leaving the period glued reads a +# sentence-final year as an ordinal ("Seit 1990." -> "neunzigste"). Heuristic: space the period off only at the end of +# the text (optionally before closing quotes / brackets) or after a number of three or more digits (years, counts); +# other punctuation after digits as in the generic rule. Known residue: "Platz 3. Dann" -> "dritte Dann". +_DE_OTHER_PUNCT_RE = re.compile(r"(\d)([!?,;:])(?=\s|$)") +_DE_FINAL_PERIOD_RE = re.compile(r"(\d)(\.)(?=[\"'»“”)\]]*\s*$)") +_DE_LONG_PERIOD_RE = re.compile(r"(\d{3,})(\.)(?=\s|$)") + +# pt: the grammar raises FstOpError whenever a token carrying a digit is directly followed by punctuation or a closing +# bracket ("10%;", "10 %;", "1º,", "9h.", "(de 10)."), or an opening bracket precedes one; the generic rule only covered +# a bare digit before the mark. Tokens carrying a digit, "%", "º" or "ª" count. Every such mark is spaced off and re-attached afterwards. +_PT_TRAIL_PUNCT_RE = re.compile(r"(\S*[\d%ºª]\S*?)([.!?,;:)\]]+)(?=\s|$)") +_PT_LEAD_BRACKET_RE = re.compile(r"(^|\s)([(\[])(?=\S*\d)") +_PT_SPACE_TRAIL_RE = re.compile(r" +([.!?,;:)\]]+)(?=\s|$)") +_PT_SPACE_LEAD_RE = re.compile(r"([(\[]) +") + +# en: spoken-form conventions the fraction / money grammars get wrong: "24/7" -> "twenty four sevenths", "50/50" -> +# "fifty fiftieths", "9/11" -> "nine elevenths", "$20k" -> "dollar twenty k". Rewritten before normalization. +_EN_SLASH_PAIRS = {("24", "7"), ("9", "11"), ("7", "11")} +_EN_SLASH_RE = re.compile(r"\b(\d{1,2})/(\d{1,2})\b") +_EN_MONEY_K_RE = re.compile(r"([$£€])(\d+(?:\.\d+)?)[kK]\b") + +# Sentence boundaries for the per-sentence retry after a grammar failure. +_SENTENCE_RE = re.compile(r"(?<=[.!?;:])\s+|(?<=[。!?])") + + +def _en_slash(m: "re.Match[str]") -> str: + a, b = m.group(1), m.group(2) + if (a, b) in _EN_SLASH_PAIRS or (len(a) == 2 and len(b) == 2 and int(a) + int(b) == 100): + return f"{a} {b}" + return m.group(0) + + +def _en_money_k(m: "re.Match[str]") -> str: + return f"{m.group(1)}{int(round(float(m.group(2)) * 1000)):,}" + + +def pre_normalize(text: str, lang: str) -> str: + """The language-specific rewrite applied right before the NeMo grammar (see the notes above).""" + if lang in _CJK_LANGS: + return _CJK_SPACE_RE.sub("", text) + if lang == "de": + text = _DE_OTHER_PUNCT_RE.sub(r"\1 \2", text) + text = _DE_FINAL_PERIOD_RE.sub(r"\1 \2", text) + return _DE_LONG_PERIOD_RE.sub(r"\1 \2", text) + if lang == "pt": + text = _PT_TRAIL_PUNCT_RE.sub(r"\1 \2", text) + return _PT_LEAD_BRACKET_RE.sub(r"\1\2 ", text) + text = _DIGIT_PUNCT_RE.sub(r"\1 \2", text) + if lang == "en": + text = _EN_SLASH_RE.sub(_en_slash, text) + text = _EN_MONEY_K_RE.sub(_en_money_k, text) + return text + + +def post_normalize(result: str, lang: str) -> str: + """Re-attach the punctuation pre_normalize() spaced off.""" + if lang == "pt": + result = _PT_SPACE_TRAIL_RE.sub(r"\1", result) + return _PT_SPACE_LEAD_RE.sub(r"\1", result) + return _SPACE_PUNCT_RE.sub(r"\1", result) + + +def default_cache_root() -> str: + return os.environ.get( + "ZONOS3_TTS_NORM_CACHE_DIR", + os.path.expanduser("~/.cache/zonos3-tts-norm"), + ) + + +def normalization_enabled() -> bool: + return os.environ.get("ZONOS3_TTS_NORM", "1") != "0" + + +class TTSTextNormalizer: + """Lazy per-language NeMo normalizers with .far caching. + + Construction and calls are serialized per language: the upstream + Normalizer shares a mutable TokenParser and is not thread-safe. + """ + + def __init__(self, cache_root: str | None = None): + self.cache_root = cache_root or default_cache_root() + self._normalizers: Dict[str, object] = {} + self._locks: Dict[str, threading.Lock] = {} + self._global_lock = threading.Lock() + + @staticmethod + def nemo_lang(language: str) -> Optional[str]: + return SERVER_TO_NEMO_LANG.get(language) + + def supported(self, language: str) -> bool: + return language in SERVER_TO_NEMO_LANG + + def _lang_lock(self, lang: str) -> threading.Lock: + with self._global_lock: + if lang not in self._locks: + self._locks[lang] = threading.Lock() + return self._locks[lang] + + def _build(self, lang: str): + from zonos3.vendor.nemo_text_processing.text_normalization import ( + Normalizer, + ) + + input_case = "lower_cased" if lang in LOWER_CASED_LANGS else "cased" + # One cache dir per (lang, case): upstream .far filenames collide + # across languages (e.g. ja's tagger writes a zh_-prefixed file). + cache_dir = os.path.join(self.cache_root, f"{lang}_{input_case}") + os.makedirs(cache_dir, exist_ok=True) + + logger.info("Loading TTS text normalizer for '%s' (%s)...", lang, input_case) + normalizer = Normalizer( + input_case=input_case, + lang=lang, + cache_dir=cache_dir, + overwrite_cache=False, + ) + + prefix = _VERBALIZER_FAR_PREFIX.get(lang) + if prefix is not None: + far_path = os.path.join( + cache_dir, f"{prefix}_tn_True_deterministic_verbalizer.far" + ) + if not os.path.exists(far_path): + from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import ( + generator_main, + ) + + generator_main(far_path, {"verbalize": normalizer.verbalizer.fst}) + return normalizer + + def get(self, lang: str): + with self._lang_lock(lang): + if lang not in self._normalizers: + self._normalizers[lang] = self._build(lang) + return self._normalizers[lang] + + def warmup(self, languages: list[str] | None = None) -> None: + """Construct normalizers ahead of time (server codes or NeMo codes).""" + langs = languages or sorted(set(SERVER_TO_NEMO_LANG.values())) + for lang in langs: + lang = SERVER_TO_NEMO_LANG.get(lang, lang) + try: + self.get(lang) + except Exception: # noqa: BLE001 + logger.exception("TTS text normalizer warmup failed for '%s'", lang) + + def _normalize_once(self, text: str, lang: str) -> str: + normalizer = self.get(lang) + text_in = pre_normalize(text, lang) + with self._lang_lock(lang): + result = normalizer.normalize(text_in, punct_post_process=lang in _MOSES_POSTPROCESS_LANGS) + if not isinstance(result, str) or not result.strip(): + raise ValueError("empty normalizer output") + return post_normalize(result, lang) + + def normalize(self, text: str, language: str) -> str: + """Normalize text for the given server language code. + + Returns the input (line breaks collapsed) for unsupported languages. A grammar failure on the whole text + (upstream FstOpError on some span) is retried sentence by sentence so only the failing sentence stays as + typed — normalization must never fail a request. Pronunciation groups (U+E000 IPA U+E001, phoneme-token + checkpoints) are kept as typed; the text between them is normalized stretch by stretch. + + Nonverbal markup ("", "...") is never handed to a grammar either (the source + NV runtime's rule, TAG_CFG_20261029): the text between the markers is normalized piece by piece (each piece + with its pronunciation groups as above) and re-joined around the unchanged markers, keeping a single space on + each side of a marker where the input had whitespace (the ja grammar raises on an ASCII space next to a + marker, which left the whole sentence unnormalized). Text without markup takes the unchanged path. + """ + text = collapse_line_breaks(text) # LINE_BREAKS_20261019: every return path hands back single-line text + if SERVER_TO_NEMO_LANG.get(language) is None or not has_nonverbal_markup(text): + return self._normalize_groups(text, language) + out = [] + for index, piece in enumerate(split_nonverbal_markup(text)): + core = piece.strip() + if index % 2 or not core: + out.append(piece if index % 2 else (" " if piece else "")) + continue + lead = " " if piece[0].isspace() else "" + trail = " " if piece[-1].isspace() else "" + out.append(lead + self._normalize_groups(core, language) + trail) + result = "".join(out).strip() + logger.debug("TTS norm [%s] around nonverbal markup: %r -> %r", language, text, result) + return result + + def _normalize_groups(self, text: str, language: str) -> str: + """Normalize markup-free single-line text, pronunciation groups kept as typed (see normalize).""" + if _PHONEME_OPEN in text: + pieces = _PHONEME_GROUP_RE.split(text) + for i in range(0, len(pieces), 2): + stretch = pieces[i] + if stretch.strip(): + lead, trail = stretch[: len(stretch) - len(stretch.lstrip())], stretch[len(stretch.rstrip()):] + pieces[i] = lead + self._normalize_text(stretch.strip(), language) + trail + return "".join(pieces) + return self._normalize_text(text, language) + + def _normalize_text(self, text: str, language: str) -> str: + lang = SERVER_TO_NEMO_LANG.get(language) + text = collapse_line_breaks(text) # LINE_BREAKS_20261019: every return path below hands back single-line text + if lang is None or not text.strip(): + return text + try: + result = self._normalize_once(text, lang) + except Exception: # noqa: BLE001 + logger.exception( + "TTS text normalization failed for lang=%s; retrying sentence by sentence", language + ) + pieces = [] + for piece in _SENTENCE_RE.split(text): + if not piece or not piece.strip(): + continue + try: + pieces.append(self._normalize_once(piece, lang)) + except Exception: # noqa: BLE001 + logger.warning("TTS text normalization failed for lang=%s on %r; kept as typed", language, piece) + pieces.append(piece) + result = ("" if lang in _CJK_LANGS else " ").join(pieces) + logger.debug("TTS norm [%s]: %r -> %r", language, text, result) + return result diff --git a/zonos3/tts/__init__.py b/zonos3/tts/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/zonos3/tts/align_text.py b/zonos3/tts/align_text.py new file mode 100644 index 0000000000000000000000000000000000000000..8ba143e9205fa41baa5f2bdd8e45e10c2bb6e276 --- /dev/null +++ b/zonos3/tts/align_text.py @@ -0,0 +1,14 @@ +"""The tokens a transcript is force-aligned by (FuseAlign: zonos3/workers/fusealign.py places one interval per token).""" + +from zonos3.dub.plan import UNSPACED, text_units + + +def align_tokens(text: str, lang: str) -> list[str]: + """The words of ``text`` for forced alignment; ``lang`` is a Whisper-style code (``en``, ``ja``, ``zh``, ...). + + Unspaced languages (``zonos3.dub.plan.UNSPACED``: ja, zh, yue) take the unit texts of ``text_units`` (one unit + per CJK character or Latin/digit run, trailing punctuation attached; whitespace inside a unit removed), every + other language the whitespace words.""" + if lang in UNSPACED: + return [token for token in ("".join(u["text"].split()) for u in text_units(text, lang)) if token] + return text.split() diff --git a/zonos3/tts/audio.py b/zonos3/tts/audio.py new file mode 100644 index 0000000000000000000000000000000000000000..ffc6e049190fb27acfc686d2ec5a00dd33638d41 --- /dev/null +++ b/zonos3/tts/audio.py @@ -0,0 +1,103 @@ +"""Reference-audio decoding (ffmpeg -> PCM WAV -> mono float tensor). + +Shared by the HTTP server and the offline :class:`~zonos3_sgl.tts.llm.TTSLLM`; has no +FastAPI / server dependency. +""" + +from __future__ import annotations + +import io +import subprocess +import wave + +import torch + +import logging + +logger = logging.getLogger(__name__) + +def _decode_wav_bytes(wav_bytes: bytes) -> tuple[torch.Tensor, int]: + try: + with wave.open(io.BytesIO(wav_bytes), "rb") as wav_file: + sample_rate = wav_file.getframerate() + channels = wav_file.getnchannels() + sample_width = wav_file.getsampwidth() + n_frames = wav_file.getnframes() + pcm = wav_file.readframes(n_frames) + except Exception as exc: # pragma: no cover - branch depends on invalid user payload + raise ValueError("Reference audio must be a valid PCM WAV file.") from exc + + if len(pcm) == 0: + raise ValueError("Reference audio is empty.") + + pcm_view = memoryview(bytearray(pcm)) + + if sample_width == 1: + audio = torch.frombuffer(pcm_view, dtype=torch.uint8).to(torch.float32) + audio = (audio - 128.0) / 128.0 + elif sample_width == 2: + audio = torch.frombuffer(pcm_view, dtype=torch.int16).to(torch.float32) + audio = audio / 32768.0 + elif sample_width == 4: + audio = torch.frombuffer(pcm_view, dtype=torch.int32).to(torch.float32) + audio = audio / 2147483648.0 + else: + raise ValueError("Unsupported WAV bit depth. Use 8/16/32-bit PCM WAV.") + + if channels > 1: + audio = audio.view(-1, channels).transpose(0, 1).contiguous() + else: + audio = audio.view(1, -1) + + return audio, sample_rate + + +def _transcode_audio_bytes_to_wav(audio_bytes: bytes) -> bytes: + if not audio_bytes: + raise ValueError("Reference file is empty.") + + try: + proc = subprocess.run( + [ + "ffmpeg", + "-nostdin", + "-hide_banner", + "-loglevel", + "error", + "-i", + "pipe:0", + "-map", + "0:a:0", + "-vn", + "-ac", + "1", + "-c:a", + "pcm_s16le", + "-f", + "wav", + "pipe:1", + ], + input=audio_bytes, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + check=False, + ) + except FileNotFoundError as exc: + raise ValueError( + "Reference file must contain an audio stream supported by ffmpeg." + ) from exc + + if proc.returncode != 0 or not proc.stdout: + stderr = proc.stderr.decode("utf-8", errors="replace").strip() + suffix = f" ffmpeg said: {stderr}" if stderr else "" + raise ValueError( + "Reference file must contain an audio stream supported by ffmpeg." + + suffix + ) + + logger.debug("Converted reference media to PCM WAV via ffmpeg for speaker embedding.") + return proc.stdout + + +def _decode_audio_bytes(audio_bytes: bytes) -> tuple[torch.Tensor, int]: + return _decode_wav_bytes(_transcode_audio_bytes_to_wav(audio_bytes)) diff --git a/zonos3/tts/conditioning.py b/zonos3/tts/conditioning.py new file mode 100644 index 0000000000000000000000000000000000000000..21cc0cf840843505b9d6e4458ef32c88689eaaa6 --- /dev/null +++ b/zonos3/tts/conditioning.py @@ -0,0 +1,21 @@ +"""Quality-token conditioning shared by the HTTP server (``api_server``) and the offline +:class:`~zonos3_sgl.tts.llm.TTSLLM`. + +Legacy quality-conditioned checkpoints read one quality token per configured feature; every request gets the +former request default, ``_DEFAULT_QUALITY_BUCKETS`` (trailing silence 0.25-0.5 s). The request's max_tokens budget is +``zonos3.tts.plan.max_tokens_budget``. +""" + +from __future__ import annotations + +from collections.abc import Sequence + +_DEFAULT_QUALITY_BUCKETS = {"trailing_silence_s": 3} + + +def default_quality_buckets(features: Sequence[str], bucket_counts: Sequence[int]) -> list[int | None] | None: + """The quality buckets of every request in the checkpoint's feature order (None per feature without a default); + None when the checkpoint has no quality tokens.""" + if not features or sum(int(count) for count in bucket_counts) <= 0: + return None + return [_DEFAULT_QUALITY_BUCKETS.get(str(feature)) for feature in features] diff --git a/zonos3/tts/delay.py b/zonos3/tts/delay.py new file mode 100644 index 0000000000000000000000000000000000000000..d50632b05c3456416f1da83e68c149034cc0521b --- /dev/null +++ b/zonos3/tts/delay.py @@ -0,0 +1,26 @@ +"""Delay pattern of the codebook rows.""" + +from __future__ import annotations + +import torch + + +def shear_up(x: torch.Tensor, pad_id: int) -> torch.Tensor: + """Remove delay: column j shifted up by j rows. + + This is the inverse of shear() - it removes the delay pattern applied + during generation to align all codebook outputs for decoding. + + Args: + x: Input tensor of shape (..., H, W) where H is frames and W is codebooks + pad_id: Padding value to fill empty positions + + Returns: + De-sheared tensor of same shape + """ + H, W = x.shape[-2:] + out = x.new_full(x.shape, pad_id) + for j in range(W): + if H > j: + out[..., : H - j, j] = x[..., j:, j] + return out diff --git a/zonos3/tts/directions.py b/zonos3/tts/directions.py new file mode 100644 index 0000000000000000000000000000000000000000..7d9ae5df326f07536c09b2898baecda46a15620a --- /dev/null +++ b/zonos3/tts/directions.py @@ -0,0 +1,154 @@ +"""Direction sets: the vectors a steering bundle (zonos3.tts.steering) serves as controls. + +A set directory holds ``manifest.json`` (``dim``, ``space`` and ``directions: {name: {"file": ..., "kind": ...}}``), +one ``.npy`` vector per direction and optionally ``calibration.json`` (per-direction doses chosen offline). + +``space`` selects where a set's directions apply: + +* ``"raw"`` -- the speaker-embedding space the encoder produces; the delta moves the speaker embedding. +* ``"attnres_source"`` -- the model's hidden space. The delta is added, on every generated frame, to source + ``source_index`` of the Full AttnRes bank (0 = embedding, 2i+1 = attention/GDN output of layer i, 2i+2 = FFN/MoE + output of layer i) before later sublayers and the head route from it. + +Vectors are stored as mean-difference vectors (not unit-normalised). This module does no GPU work. +""" + +from __future__ import annotations + +import json +import logging +from dataclasses import dataclass, field +from pathlib import Path +from typing import Dict, Iterable + +import numpy as np +import torch + +logger = logging.getLogger(__name__) + +MANIFEST_NAME = "manifest.json" +CALIBRATION_NAME = "calibration.json" + +RAW_SPACE = "raw" +HIDDEN_SPACE = "attnres_source" +SPACES = (RAW_SPACE, HIDDEN_SPACE) + +# Names treated as bipolar axes rather than named directions (besides manifest entries of kind "axis"). +AXIS_NAMES = ("valence", "arousal") + + +@dataclass +class Calibration: + """Per-speaker, per-direction raw dose chosen offline (a set's ``calibration.json``). + + ``strength(speaker_key, name)`` falls back per direction to ``default`` and finally to ``global_default`` for + unknown speakers/directions. A dose of 0 disables the direction for that speaker. Bipolar axes may carry a + separate dose for the negative pole under the key ``"-"``; ``"-": 0`` disables only the negative pole. + """ + + by_speaker: Dict[str, Dict[str, float]] = field(default_factory=dict) + default: Dict[str, float] = field(default_factory=dict) + global_default: float = 1.0 + + def strength(self, speaker_key: str | None, name: str) -> float: + s = self._lookup(speaker_key, name) + return float(self.global_default) if s is None else s + + def _lookup(self, speaker_key: str | None, key: str) -> float | None: + if speaker_key: + s = self.by_speaker.get(speaker_key, {}).get(key) + if s is not None: + return float(s) + s = self.default.get(key) + return None if s is None else float(s) + + def disabled(self, speaker_key: str | None, names: Iterable[str]) -> list[str]: + """Directions whose calibrated dose is 0 for this speaker. A negative pole disabled on its own is listed as + ``"-"``.""" + out = [] + for name in names: + if self.strength(speaker_key, name) == 0.0: + out.append(name) + elif self._lookup(speaker_key, name + "-") == 0.0: + out.append(name + "-") + return out + + def document(self) -> dict: + """The calibration as served by ``/v2/controls`` (schema ``ControlCalibration``).""" + return { + "default": {k: float(v) for k, v in self.default.items()}, + "by_speaker": {s: {k: float(v) for k, v in d.items()} for s, d in self.by_speaker.items()}, + "global_default": float(self.global_default), + } + + @classmethod + def load(cls, directory: str | Path) -> "Calibration | None": + path = Path(directory).expanduser() / CALIBRATION_NAME + if not path.is_file(): + return None + data = json.loads(path.read_text()) + return cls( + by_speaker={k: {e: float(v) for e, v in d.items()} for k, d in data.get("by_speaker", {}).items()}, + default={e: float(v) for e, v in data.get("default", {}).items()}, + global_default=float(data.get("global_default", 1.0)), + ) + + +@dataclass +class DirectionSet: + """One direction set: 1-D float32 CPU vectors of ``dim`` elements, split into named directions and axes.""" + + dim: int + named: Dict[str, torch.Tensor] = field(default_factory=dict) + axes: Dict[str, torch.Tensor] = field(default_factory=dict) + space: str = RAW_SPACE + source_index: int | None = None # Full AttnRes bank source of a HIDDEN_SPACE set + calibration: Calibration | None = None + + @property + def names(self) -> list[str]: + return [*self.named, *self.axes] + + def is_empty(self) -> bool: + return not self.named and not self.axes + + @classmethod + def load(cls, directory: str | Path) -> "DirectionSet | None": + """Load a set from a directory containing ``manifest.json`` (and optionally ``calibration.json``). + + Returns ``None`` when the directory or manifest is missing; raises ValueError for a space not in ``SPACES``. + """ + root = Path(directory).expanduser() + manifest_path = root / MANIFEST_NAME + if not manifest_path.is_file(): + return None + manifest = json.loads(manifest_path.read_text()) + dim = int(manifest["dim"]) + space = str(manifest.get("space", RAW_SPACE)) + if space not in SPACES: + raise ValueError(f"direction space {space!r} is not one of {list(SPACES)} ({manifest_path})") + named: Dict[str, torch.Tensor] = {} + axes: Dict[str, torch.Tensor] = {} + for name, entry in manifest.get("directions", {}).items(): + vec = _load_vector(root / entry["file"], expected_dim=dim, name=name) + if str(entry.get("kind")) == "axis" or name in AXIS_NAMES: + axes[name] = vec + else: + named[name] = vec + source_index = None + if space == HIDDEN_SPACE: + source_index = int(manifest["source_index"]) + if source_index < 0: + raise ValueError(f"source_index must be >= 0, got {source_index} ({manifest_path})") + directions = cls(dim=dim, named=named, axes=axes, space=space, source_index=source_index, + calibration=Calibration.load(root)) + if directions.is_empty(): + logger.warning("Direction set manifest at %s contains no directions.", manifest_path) + return directions + + +def _load_vector(path: Path, *, expected_dim: int, name: str) -> torch.Tensor: + arr = np.asarray(np.load(path), dtype=np.float32).reshape(-1) + if arr.shape[0] != expected_dim: + raise ValueError(f"Direction '{name}' has dim {arr.shape[0]}, expected {expected_dim} ({path}).") + return torch.from_numpy(np.ascontiguousarray(arr)).to(dtype=torch.float32, device="cpu") diff --git a/zonos3/tts/edit.py b/zonos3/tts/edit.py new file mode 100644 index 0000000000000000000000000000000000000000..291d168a424c76749e8cf294f54a66a5988c632d --- /dev/null +++ b/zonos3/tts/edit.py @@ -0,0 +1,110 @@ +"""Codec edit prompts, generated-fill extraction and exact unmasked-context splicing.""" +import torch +from zonos3.tts.delay import shear_up +from .prompt import TTSPromptConfig, shear + + +def edit_marker_rows(text_extra_tokens: int, text_tokenizer_spec: dict | None) -> int: + """Edit marker rows of a checkpoint: the extra text rows before the phoneme block (all of + them without phoneme tokens). Markers sit at text_vocab + 1 + j, where edit training put + them; superbpe.load_spec checks the phoneme block fills the rest of text_extra_tokens.""" + from .superbpe import phoneme_token_count, rows_before_phonemes + + if text_tokenizer_spec is None or text_tokenizer_spec.get("phonemes") is None: + return int(text_extra_tokens) + markers = rows_before_phonemes(text_tokenizer_spec, int(text_tokenizer_spec["vocab_size"]) + 4) + if markers + phoneme_token_count(text_tokenizer_spec) != int(text_extra_tokens): + raise ValueError("Phoneme tokens must be the last extra text rows") + return markers + + +def edit_marker_id(config: TTSPromptConfig, index: int) -> int: + return config.text_vocab + 1 + index + + +def validate_edit_spans(spans, total_frames: int, max_spans: int) -> None: + if not spans or len(spans) > max_spans: + raise ValueError("Edit requires between one and max_spans regions") + previous_end = -1 + for start, length in spans: + if start < 0 or length < 1 or start + length > total_frames or start <= previous_end: + raise ValueError("Edit spans must be ascending, separated and within the audio") + previous_end = start + length + + +def sheared_block(frames, config: TTSPromptConfig, *, end_id: int | None): + """Delay-stack frames (+ one all-``end_id`` row when given) followed by K-1 pad rows.""" + frames = torch.as_tensor(frames, dtype=torch.int32, device="cpu") + k = config.n_codebooks + if frames.ndim != 2 or frames.shape[1] != k: + raise ValueError("Invalid codec frame shape") + has_end = end_id is not None + audio = torch.full((len(frames) + int(has_end) + k - 1, k), config.audio_pad_id, dtype=torch.int32) + audio[:len(frames)] = frames + if has_end: + audio[len(frames)] = end_id + return torch.cat((shear(audio, config.audio_pad_id), torch.full((len(audio), 1), config.text_vocab, dtype=torch.int32)), dim=1) + + +def edit_prompt_tokens(text_rows, codes, spans, fills, config: TTSPromptConfig, *, span_end_id: int): + """Training edit layout up to the next infill marker. + + The unmasked context ends with EOA (audio_pad_id - 1); each already generated + fill ends with the span-end token. The prompt ends on marker ``len(fills)``. + """ + if span_end_id != config.audio_pad_id + 1: + raise ValueError("span_end_id must equal audio_pad_id + 1") + codes = torch.as_tensor(codes, dtype=torch.int32, device="cpu") + validate_edit_spans(spans, len(codes), len(spans)) + if len(fills) >= len(spans): + raise ValueError("Prompt needs an ungenerated span") + def marker(j): + row = torch.full((1, config.n_codebooks + 1), config.audio_pad_id, dtype=torch.int32) + row[0, -1] = edit_marker_id(config, j) + return row + parts = [torch.as_tensor(text_rows, dtype=torch.int32, device="cpu")] + cursor = 0 + for j, (start, length) in enumerate(spans): + if start > cursor: + parts.append(sheared_block(codes[cursor:start], config, end_id=None)) + parts.append(marker(j)) + cursor = start + length + parts.append(sheared_block(codes[cursor:], config, end_id=config.audio_pad_id - 1)) + for j, fill in enumerate(fills): + parts.extend((marker(j), sheared_block(fill, config, end_id=span_end_id))) + parts.append(marker(len(fills))) + return torch.cat(parts) + + +def extract_fill(delayed_rows, eos_frame: int | None, *, audio_pad_id: int, codebook_sizes): + """Codec frames of one generated span and whether it ended on span-end. + + ``delayed_rows`` are the generated delay-stacked rows without the finishing + row. Without an end token the incomplete K-1 delay tail is dropped; the fill + is cut before the first frame holding a non-codec token. + """ + limits = torch.tensor(tuple(codebook_sizes), dtype=torch.int64) + frames = shear_up(torch.as_tensor(delayed_rows, dtype=torch.int64).reshape(-1, len(limits)), audio_pad_id) + fill = frames[:max(0, eos_frame if eos_frame is not None else len(frames) - (len(limits) - 1))] + invalid = ((fill < 0) | (fill >= limits)).any(dim=1) + truncated = bool(invalid.any()) + if truncated: + fill = fill[:int(invalid.nonzero()[0, 0])] + return fill, eos_frame is not None and not truncated + + + +def splice_edit(codes, spans, fills): + codes = torch.as_tensor(codes, dtype=torch.int64, device="cpu") + validate_edit_spans(spans, len(codes), len(spans)) + if len(fills) != len(spans): + raise ValueError("One fill is required per span") + parts, cursor = [], 0 + for (start, length), fill in zip(spans, fills): + fill = torch.as_tensor(fill, dtype=torch.int64, device="cpu") + if fill.ndim != 2 or fill.shape[1] != codes.shape[1]: + raise ValueError("Invalid fill shape") + parts.extend((codes[cursor:start], fill)) + cursor = start + length + parts.append(codes[cursor:]) + return torch.cat(parts) diff --git a/zonos3/tts/edit_align.py b/zonos3/tts/edit_align.py new file mode 100644 index 0000000000000000000000000000000000000000..108a274208dfa59bb7c76f7474911a2a4e81ad31 --- /dev/null +++ b/zonos3/tts/edit_align.py @@ -0,0 +1,696 @@ +"""Speech-editing helpers: the speech-recognition (Qwen3-ASR) and forced-alignment (FuseAlign) worker clients shared by +speech editing and dubbing, their long-form orchestration, and transcript-diff edit regions. + +Both workers are JSON-lines processes, one of each per server, started on first use and again after they exited: +``AsrWorker`` runs zonos3/workers/asr.py in .venv-asr (``ZONOS3_ASR_PYTHON``; tools/setup_asr_env.sh) and +``FuseAlignWorker`` runs zonos3/workers/fusealign.py in the server's interpreter. Their failures are ``WorkerError``s +(``AsrError`` / ``FuseAlignError``: the worker is unavailable, HTTP 503) or ``ValueError``s (the input is at fault, +HTTP 400), each with its final message. + +Long-form alignment: a FuseAlign item whose audio is longer than ``LONG_FORM_SECONDS`` or whose tokens (joined with +spaces) exceed ``MAX_TEXT_BYTES`` UTF-8 bytes is routed by approximate word times. They come from Qwen3-ASR on the +recording's VAD chunks (the FuseAlign worker's ``segments``): every chunk transcribed (``start`` / ``end``) gives one +utterance ``{text, start, end}`` (empty texts dropped), sent as the item's ``utterances``; FuseAlign's built-in +Whisper anchoring never runs. A transcript Qwen3-ASR makes of a recording over ``LONG_FORM_SECONDS`` +(``transcribe_audio``) is made the same way, chunk by chunk, and its utterances anchor the alignments that follow. +""" +from dataclasses import dataclass +import difflib +import importlib.util +import json +import math +import os +import re +from pathlib import Path +import subprocess +import sys +import threading + +from zonos3 import languages + +from .align_text import align_tokens +from .markup import _NONVERBAL_MARKUP, has_nonverbal_markup +from . import textmatch + +REPO_ROOT = Path(__file__).resolve().parents[4] +MODEL_SRC = Path(__file__).resolve().parents[2] # model/src: PYTHONPATH of both workers +ASR_WORKER = MODEL_SRC / 'zonos3' / 'workers' / 'asr.py' +FUSEALIGN_WORKER = MODEL_SRC / 'zonos3' / 'workers' / 'fusealign.py' +LONG_FORM_SECONDS = 30.0 # fusealign_hub.aligner.MAX_SECONDS: one FuseAlign forward +MAX_TEXT_BYTES = 1022 # fusealign_hub.longform.MAX_TEXT_BYTES +# Qwen3-ASR names of the unspaced languages (zonos3.dub.plan.UNSPACED: ja, zh, yue): their chunk texts join with "". +UNSPACED_LANGUAGES = frozenset(lang.name for lang in languages.SPOKEN if lang.unspaced) + + +# Server language codes (normalized, as /v2/generate) -> (the Whisper-style code the edit's words are tokenized by, +# zonos3.tts.align_text.align_tokens; the Qwen3-ASR language name its recognition is forced to). Speech editing serves +# the entries whose Qwen3-ASR language the ASR worker supports (its ping). +EDIT_LANGUAGES = {lang.code: (lang.speech, languages.SPOKEN_BY_CODE[lang.speech].name) for lang in languages.SERVER} + + +def edit_language(language: str, supported) -> tuple[str, str]: + """``(code, Qwen3-ASR name)`` of a normalized server language code, given the ASR worker's ``supported`` language + names; ValueError for languages speech editing does not serve.""" + served = [k for k, (_, name) in EDIT_LANGUAGES.items() if name in supported] + if language not in served: + raise ValueError(f"Speech editing does not serve language {language!r} (supported: {', '.join(served)}).") + return EDIT_LANGUAGES[language] + + +class WorkerError(RuntimeError): + """A worker is unavailable: it could not start, exited twice in a row, or failed without the input being at fault + (e.g. its model could not be loaded). The message is final (HTTP 503).""" + + +class AsrError(WorkerError): + """The ASR worker is unavailable (``ASR is unavailable: ...``).""" + + +class FuseAlignError(WorkerError): + """The FuseAlign worker is unavailable (``FuseAlign alignment is unavailable: ...``).""" + + +def fusealign_installed() -> bool: + """Whether this interpreter, the FuseAlign worker's, has ``fusealign_hub`` (third_party/fusealign-multilingual).""" + return importlib.util.find_spec('fusealign_hub') is not None + + +def asr_python() -> str: + """The interpreter of the ASR worker and of the dubbing worker: ``ZONOS3_ASR_PYTHON``, else the repo's .venv-asr.""" + return os.environ.get('ZONOS3_ASR_PYTHON') or str(REPO_ROOT / '.venv-asr' / 'bin' / 'python') + + +class _JsonLinesWorker: + """A persistent worker process (``PYTHONPATH`` = model/src). It starts on the first call and again after it exited; + a call that meets an exited worker (EOF) is retried once on a fresh one. Thread-safe: calls are serialized. + + ``call`` raises ValueError (``: ``) when the worker reports the input at fault and ``error`` + (``: ``) otherwise.""" + + error: type[WorkerError] = WorkerError + name = 'worker' + unavailable = 'worker is unavailable' + failed = 'worker failed' + + def __init__(self, command: list[str]): + self._command = command + self._process: subprocess.Popen | None = None + self._lock = threading.Lock() + self._next_id = 0 + + @property + def alive(self) -> bool: + return self._process is not None and self._process.poll() is None + + def _start(self) -> subprocess.Popen: + env = {k: v for k, v in os.environ.items() if k not in ('PYTHONPATH', 'VIRTUAL_ENV')} + env['PYTHONPATH'] = str(MODEL_SRC) + env['PYTHONDONTWRITEBYTECODE'] = '1' + env.setdefault('HF_HUB_OFFLINE', '1') + try: + return subprocess.Popen(self._command, env=env, stdin=subprocess.PIPE, stdout=subprocess.PIPE, text=True, + encoding='utf-8') + except OSError as exc: + raise self.error(f'{self.unavailable}: cannot start the {self.name}: {exc}') from exc + + def call(self, op: str, **payload) -> dict: + with self._lock: + self._next_id += 1 + line = json.dumps({'id': self._next_id, 'op': op, **payload}, ensure_ascii=False) + '\n' + for _ in range(2): + if not self.alive: + self._process = self._start() + try: + self._process.stdin.write(line) + self._process.stdin.flush() + reply = self._process.stdout.readline() + except (BrokenPipeError, OSError): + reply = '' + if reply: + break + code = self._process.wait() + else: + raise self.error(f'{self.unavailable}: the {self.name} exited with code {code}') + response = json.loads(reply) + if response.get('status') != 'ok': + if response.get('invalid'): + raise ValueError(f"{self.failed}: {response.get('message') or response.get('error')}") + raise self.error(f"{self.unavailable}: {response.get('error', 'unknown error')}") + return response + + def close(self) -> None: + with self._lock: # after any in-flight call + if self.alive: + self._process.stdin.close() + if self._process is not None: + self._process.wait() + self._process = None + + +class AsrWorker(_JsonLinesWorker): + """The workers/asr.py process (Qwen3-ASR) in .venv-asr: one per server, shared by speech editing and dubbing. + ``device`` defaults to ``ZONOS3_ASR_DEVICE`` (else the worker's own default), ``model`` to the worker's.""" + + error = AsrError + name = 'ASR worker' + unavailable = 'ASR is unavailable' + failed = 'ASR failed' + + def __init__(self, python: str | None = None, device: str | None = None, model: str | None = None): + self.python = python or asr_python() + device = device or os.environ.get('ZONOS3_ASR_DEVICE') + super().__init__([self.python, str(ASR_WORKER)] + (['--device', device] if device else []) + + (['--model', model] if model else [])) + self._ping: dict | None = None + + @property + def installed(self) -> bool: + """Whether the worker's interpreter exists (tools/setup_asr_env.sh).""" + return Path(self.python).is_file() + + def _start(self) -> subprocess.Popen: + if not self.installed: + raise AsrError(f'{self.unavailable}: interpreter not found: {self.python} (run tools/setup_asr_env.sh)') + return super()._start() + + def ping(self) -> dict: + """``{"model", "languages"}`` of the worker (cached).""" + if self._ping is None: + response = self.call('ping') + self._ping = {'model': response['model'], 'languages': list(response['languages'])} + return self._ping + + def model(self) -> str: + return self.ping()['model'] + + def languages(self) -> list[str]: + """The Qwen3-ASR language names the worker transcribes.""" + return self.ping()['languages'] + + def transcribe(self, items: list[dict]) -> list[dict]: + """``[{audio, start?, end?, language}]`` -> per item ``{text, language}`` (workers/asr.py).""" + return self.call('transcribe', items=items)['results'] + + +class FuseAlignWorker(_JsonLinesWorker): + """The workers/fusealign.py process (this interpreter): one per server, shared by speech editing and dubbing.""" + + error = FuseAlignError + name = 'FuseAlign worker' + unavailable = 'FuseAlign alignment is unavailable' + failed = 'FuseAlign alignment failed' + + def __init__(self, device: str | None = None, checkpoint: str | None = None, python: str = sys.executable): + super().__init__([python, str(FUSEALIGN_WORKER)] + (['--device', device] if device else []) + + (['--checkpoint', checkpoint] if checkpoint else [])) + self._model: str | None = None + + def model(self) -> str: + """The checkpoint id the worker aligns with (its ``ping``).""" + if self._model is None: + self._model = self.call('ping')['model'] + return self._model + + def speech(self, audios: list[str]) -> list[list[list[float]]]: + """Per audio path its Silero VAD speech regions ``[[start, end], ...]`` (seconds, in time order).""" + return [r['regions'] for r in self.call('speech', items=[{'audio': a} for a in audios])['results']] + + def segments(self, audios: list[str]) -> list[list[list[float]]]: + """Per audio path its speech chunks ``[[start, end], ...]`` (seconds, each at most 25 s) for recognition.""" + return [r['chunks'] for r in self.call('segments', items=[{'audio': a} for a in audios])['results']] + + def align(self, items: list[dict]) -> list[list[dict]]: + """``[{audio, tokens, utterances?}]`` -> per item one ``{word, start, end, presence, placed}`` per token.""" + return [r['words'] for r in self.call('align', items=items)['results']] + + +def audio_seconds(path: str) -> float: + """Duration of a sound file (frames / sample rate).""" + import soundfile + + info = soundfile.info(path) + return info.frames / info.samplerate + + +def needs_anchors(seconds: float, tokens: list[str]) -> bool: + """Whether FuseAlign aligns an item long-form: audio over ``LONG_FORM_SECONDS`` or tokens over ``MAX_TEXT_BYTES``.""" + return seconds > LONG_FORM_SECONDS or len(' '.join(tokens).encode('utf-8')) > MAX_TEXT_BYTES + + +def chunk_utterances(asr: AsrWorker, aligner: FuseAlignWorker, audios: list[str], + languages: list[str | None]) -> list[list[dict]]: + """Per audio the Qwen3-ASR transcripts of its ``segments`` chunks (forced to its language, a Qwen3-ASR name, or + detected for None) as utterances ``{text, start, end, language}`` in time order, empty texts dropped. One + ``segments`` and one ``transcribe`` call for all of them.""" + if not audios: + return [] + chunks = aligner.segments(audios) + items = [{'audio': audio, 'start': start, 'end': end, 'language': language} + for audio, language, cs in zip(audios, languages, chunks, strict=True) for start, end in cs] + results = iter(asr.transcribe(items) if items else []) + out = [] + for cs in chunks: + utterances = [] + for start, end in cs: + r = next(results) + if r['text']: + utterances.append({'text': r['text'], 'start': start, 'end': end, 'language': r['language']}) + out.append(utterances) + return out + + +@dataclass +class Transcript: + text: str + language: str # as Qwen3-ASR reports it: the forced language, or the detected one(s), comma-joined + utterances: list[dict] | None # the chunk transcripts {text, start, end} of audio over LONG_FORM_SECONDS + + +def transcribe_audio(asr: AsrWorker, aligner: FuseAlignWorker, audio: str, language: str | None) -> Transcript: + """Qwen3-ASR transcript of a sound file, forced to ``language`` (a Qwen3-ASR name) or detected (None). + + Up to ``LONG_FORM_SECONDS`` one recognition of the whole file. Longer audio is transcribed chunk by chunk + (``chunk_utterances``): the text is the chunk texts joined with " " (with "" when the language, the forced one or + else the first spoken chunk's first detected one, is unspaced: ``UNSPACED_LANGUAGES``), the reported language is + the first spoken chunk's ("" without speech), and the utterances are returned to anchor later alignments of the + file (``align_words``).""" + if audio_seconds(audio) <= LONG_FORM_SECONDS: + r = asr.transcribe([{'audio': audio, 'language': language}])[0] + return Transcript(r['text'], r['language'], None) + utterances = chunk_utterances(asr, aligner, [audio], [language])[0] + reported = utterances[0]['language'] if utterances else '' + name = language or reported.split(',')[0].strip() + joiner = '' if name in UNSPACED_LANGUAGES else ' ' + return Transcript(joiner.join(u['text'] for u in utterances), reported, + [{k: u[k] for k in ('text', 'start', 'end')} for u in utterances]) + + +def align_words(asr: AsrWorker, aligner: FuseAlignWorker, items: list[dict]) -> list[list[dict]]: + """FuseAlign words of ``[{audio, tokens, language, utterances?}]`` (``language``: the Qwen3-ASR name anchors are + recognized in, None to detect; ``utterances``: anchors already made for the audio, e.g. ``Transcript.utterances``) + -> per item one ``{word, start, end, presence, placed}`` per token. + + An item that ``needs_anchors`` carries ``utterances``: its own, else ``chunk_utterances`` of its audio (one batch + for every such item); the other items carry none.""" + long = [k for k, it in enumerate(items) if it['tokens'] and needs_anchors(audio_seconds(it['audio']), it['tokens'])] + missing = [k for k in long if items[k].get('utterances') is None] + made = dict(zip(missing, chunk_utterances(asr, aligner, [items[k]['audio'] for k in missing], + [items[k].get('language') for k in missing]))) + requests = [] + for k, it in enumerate(items): + request = {'audio': it['audio'], 'tokens': list(it['tokens'])} + if k in long: + utterances = made[k] if k in made else it['utterances'] + request['utterances'] = [{'text': u['text'], 'start': u['start'], 'end': u['end']} for u in utterances] + requests.append(request) + return aligner.align(requests) + + +# Pronunciation groups (U+E000 IPA U+E001, phoneme-token checkpoints) in a target text. The edit tokens' normalize +# (zonos3.tts.textmatch) mangles them (IPA upper-cased, the private-use markers and tie bars become word breaks), so a +# group is never normalized: it is one target token of its own, the group string itself, which no recognized token of +# the original can equal (a changed word in the diff). Its length for the expected fill counts its IPA +# symbols in letter-equivalents: GROUP_LETTERS_PER_SYMBOL, fitted on edits that replace a word by a group +# and by the spelled word (z3m_mect_edit_phonemes, 4 words x 8 takes each: the letter count that gives a +# group fill the spelled fill's fill/expected; Siobhan 1.40, Niamh 1.67, route 1.39, data 1.17, median +# 1.39). The gold lexicon's English entries average 1.07 letters per symbol (1.17 over running text), which +# left group fills at 1.1-1.9x their expected length: spoken duration follows the word, and the short +# words and names people respell carry more letters per phone than the average entry. +GROUP_OPEN, GROUP_CLOSE = "\ue000", "\ue001" +GROUP_LETTERS_PER_SYMBOL = 1.4 +_GROUP_RE = re.compile("(\ue000[^\ue000\ue001]*\ue001)") +# a whitespace word's pieces: pronunciation groups, nonverbal markers (zonos3.tts.prompt) and the text around them +_PIECE_RE = re.compile(rf"({_GROUP_RE.pattern[1:-1]}|{_NONVERBAL_MARKUP.pattern})") + + +def is_group_token(token: str) -> bool: + return token.startswith(GROUP_OPEN) and token.endswith(GROUP_CLOSE) + + +def token_chars(token: str) -> float: + """Text length of a target token: characters, or a group's IPA symbols in letter-equivalents.""" + return GROUP_LETTERS_PER_SYMBOL * (len(token) - 2) if is_group_token(token) else len(token) + + +def is_marker_token(token: str) -> bool: + return _NONVERBAL_MARKUP.fullmatch(token) is not None + + +def canonical_markup(text: str) -> str: + """``text`` with the whitespace inside its nonverbal markers removed (```` -> ````), so every + marker is one whitespace word piece.""" + return _NONVERBAL_MARKUP.sub(lambda m: "".join(m.group(0).split()), text) if has_nonverbal_markup(text) else text + + +def target_tokens(target_text: str) -> list[list[str]]: + """``[target tokens, tokens of target word 0, of word 1, ...]`` over the whitespace words of ``target_text`` + (``zonos3.tts.textmatch.tokens``). Without groups or markup these are the tokens of the target and of its words; + with them only the plain pieces between them are normalized, each group is a token and each nonverbal marker + (``canonical_markup`` text) none: markup is text for the model only, outside the word diff, the alignment and + verify.""" + words = target_text.split() + if GROUP_OPEN not in target_text and not has_nonverbal_markup(target_text): + return [textmatch.tokens(target_text)] + [textmatch.tokens(word) for word in words] + pieces = [[piece for piece in _PIECE_RE.split(word) if piece] for word in words] + word_tokens = [[t for piece in word for t in ( + [piece] if is_group_token(piece) else [] if is_marker_token(piece) else textmatch.tokens(piece))] + for word in pieces] + return [[t for ts in word_tokens for t in ts]] + word_tokens + + +@dataclass +class AlignedWord: + word: str + start: float + end: float + confidence: float | None + tokens: list[str] + + +def aligned_words(words: list[dict], word_tokens: list[list[str]]) -> list[AlignedWord]: + """The edit's words of an alignment: FuseAlign's words (``FuseAlignWorker.align``, one per ``align_tokens`` + token) with each word's edit tokens (``textmatch.tokens`` of the word) and FuseAlign's presence as the + confidence. A word without tokens (punctuation only) carries nothing the edit reads and is dropped; an + unplaced word keeps FuseAlign's fallback times. FuseAlign does not repair order, so neighbours may overlap by a + few ms: an overlap is split at its midpoint, which keeps the words valid ``original_words`` (``edit_words``).""" + if len(words) != len(word_tokens): + raise ValueError("One token list is needed per aligned word.") + out = [AlignedWord(w['word'], float(w['start']), float(w['end']), float(w['presence']), list(tokens)) + for w, tokens in zip(words, word_tokens) if tokens] + for previous, word in zip(out, out[1:]): + if word.start < previous.end: + previous.end = word.start = (previous.end + word.start) / 2 + return out + + +def edit_aligned_words(asr: AsrWorker, aligner: FuseAlignWorker, audio: str, text: str, language: tuple[str, str], + utterances: list[dict] | None = None) -> list[AlignedWord]: + """The words of ``text`` in a sound file with their edit tokens: FuseAlign over ``align_tokens(text, code)`` + (``align_words``; ``language`` is the ``edit_language`` pair, ``utterances`` anchors already made for the file).""" + code, name = language + words = align_tokens(text, code) + aligned = align_words(asr, aligner, [{'audio': audio, 'tokens': words, 'language': name, + 'utterances': utterances}])[0] if words else [] + return aligned_words(aligned, [textmatch.tokens(w) for w in words]) + + +@dataclass +class EditDiff: + spans: list[tuple[int, int]] + new_target_tokens: list[int] + + +def seconds_to_spans(pairs, total_frames: int, frame_rate: float = 15.0) -> list[tuple[int, int]]: + """``[start, end]`` seconds -> ``(start_frame, length_frames)``, outward-rounded and clipped to the audio.""" + spans = [] + for start, end in pairs: + first = max(0, math.floor(start * frame_rate + 1e-6)) + spans.append((first, min(total_frames, math.ceil(end * frame_rate - 1e-6)) - first)) + return spans + + +def diff_spans(words, target_tokens, *, total_frames, frame_rate=15.0, margin_seconds=0.08, min_gap_frames=5, max_spans=3): + expanded = [(token, w) for w in words for token in w.tokens] + original = [token for token, _ in expanded] + spans, new_tokens = [], [] + for op, i1, i2, j1, j2 in difflib.SequenceMatcher(None, original, target_tokens, autojunk=False).get_opcodes(): + if op == 'equal': + continue + if i1 != i2: + t0, t1 = expanded[i1][1].start, expanded[i2 - 1][1].end + else: + t0 = expanded[i1 - 1][1].end if i1 else 0.0 + t1 = expanded[i1][1].start if i1 < len(expanded) else total_frames / frame_rate + start = min(total_frames - 1, max(0, math.floor((t0 - margin_seconds) * frame_rate))) + end = max(start + 1, min(total_frames, math.ceil((t1 + margin_seconds) * frame_rate))) + if spans and start - (spans[-1][0] + spans[-1][1]) < min_gap_frames: + previous_start, previous_length = spans[-1] + spans[-1] = (previous_start, max(end, previous_start + previous_length) - previous_start) + else: + spans.append((start, end - start)) + new_tokens.extend(range(j1, j2)) + if not spans: + raise ValueError('target text equals the original transcript') + if len(spans) > max_spans: + raise ValueError(f'edit touches {len(spans)} regions; at most {max_spans} are supported') + return EditDiff(spans, new_tokens) + + +def edit_words(words, word_tokens, original_tokens, *, duration) -> list[AlignedWord]: + """Caller-supplied word timings of the original (``{word, start, end, confidence?}`` in + order, e.g. corrected aligned words) as AlignedWords with ``word_tokens`` (edit tokens per word). + Raises ValueError unless the times are finite, each word has start < end, the words are + ascending and non-overlapping inside [0, duration] and their tokens spell ``original_tokens`` + (the edit tokens of the original text).""" + if not words: + raise ValueError("original_words is empty.") + previous_end = 0.0 + if float(words[0]["start"]) < 0: + raise ValueError(f"original_words[0] ({words[0]['word']!r}) starts before the clip.") + for k, w in enumerate(words): + start, end = float(w["start"]), float(w["end"]) + label = f"original_words[{k}] ({w['word']!r})" + if not (math.isfinite(start) and math.isfinite(end)): + raise ValueError(f"{label} has a non-finite time.") + if not start < end: + raise ValueError(f"{label} must start before it ends ({start:.3f} >= {end:.3f}).") + if start < previous_end - 1e-6: + raise ValueError(f"{label} starts at {start:.3f} s, before the previous word ends ({previous_end:.3f} s).") + if end > duration + 1e-3: + raise ValueError(f"{label} ends at {end:.3f} s, after the clip ({duration:.3f} s).") + previous_end = end + spelled = [t for tokens in word_tokens for t in tokens] + if spelled != list(original_tokens): + k = next((i for i, (a, b) in enumerate(zip(spelled, original_tokens)) if a != b), min(len(spelled), len(original_tokens))) + raise ValueError( + "original_words do not spell original_text: they read " + f"{' '.join(spelled[max(0, k - 2):k + 3]) or '(nothing)'!r} where the text reads " + f"{' '.join(original_tokens[max(0, k - 2):k + 3]) or '(nothing)'!r} (normalized)." + ) + return [AlignedWord(w["word"], float(w["start"]), float(w["end"]), w.get("confidence"), list(tokens)) + for w, tokens in zip(words, word_tokens)] + + +def new_word_confidence(words, token_indices) -> float | None: + indices = set(token_indices) + selected, cursor = [], 0 + for word in words: + if any(i in indices for i in range(cursor, cursor + len(word.tokens))): + selected.append(word.confidence) + cursor += len(word.tokens) + return sum(selected) / len(selected) if selected else None + + +@dataclass +class EditWindow: + """The audio frames ``[start, end)`` of the clip the model sees for some regions (indices into + the edit's spans) and the target text of that stretch.""" + start: int + end: int + regions: list[int] + text: str + + def spans(self, spans) -> list[tuple[int, int]]: + """This window's regions as window-relative ``(start_frame, length_frames)``.""" + return [(spans[k][0] - self.start, spans[k][1]) for k in self.regions] + + +def whole_clip_window(spans, total_frames: int, target_text: str) -> EditWindow: + return EditWindow(0, total_frames, list(range(len(spans))), target_text) + + +class WordDiff: + """The original's aligned words (with edit ``tokens``) against the target's whitespace words and + their edit tokens, diffed over the tokens: maps original word ranges to target word ranges.""" + + def __init__(self, words, target_words, target_word_tokens): + if len(target_word_tokens) != len(target_words): + raise ValueError("One token list is needed per target word.") + self.words, self.target_words, self.target_word_tokens = words, target_words, target_word_tokens + self.orig_start, self.tgt_start = [0], [0] + for w in words: + self.orig_start.append(self.orig_start[-1] + len(w.tokens)) + for tokens in target_word_tokens: + self.tgt_start.append(self.tgt_start[-1] + len(tokens)) + self.opcodes = difflib.SequenceMatcher( + None, [t for w in words for t in w.tokens], [t for ts in target_word_tokens for t in ts], autojunk=False + ).get_opcodes() + + def _target_cut(self, i, left): + """Target token position of a cut before original token ``i`` (an insertion at the cut + joins the range), or None inside a changed block.""" + for tag, i1, i2, j1, j2 in (self.opcodes if left else reversed(self.opcodes)): + if i1 < i < i2: + return j1 + i - i1 if tag == "equal" else None + if (i1 if left else i2) == i: + return j1 if left else j2 + return 0 if i == 0 else self.tgt_start[-1] + + def target_word(self, k, left): + """Target word index of a cut before original word ``k`` (as the ``left`` or right edge + of a range), or None when the cut falls inside a changed block or a target word.""" + j = self._target_cut(self.orig_start[k], left) + at = [t for t, start in enumerate(self.tgt_start) if start == j] if j is not None else [] + return (at[0] if left else at[-1]) if at else None + + def clean(self, a, b): + """Original word range [a, b) widened until both edges map onto target word boundaries.""" + while a > 0 and self.target_word(a, True) is None: + a -= 1 + while b < len(self.words) and self.target_word(b, False) is None: + b += 1 + return a, b + + def target_range(self, a, b): + """Target words aligned with the clean original word range [a, b).""" + return self.target_word(a, True), self.target_word(b, False) + + +def plan_edit_windows(spans, words, target_words, target_word_tokens, *, total_frames, frame_rate=15.0, + context_seconds=4.0, target_text=None) -> list[EditWindow]: + """Word-snapped context windows around edit regions of a long clip. + + ``words`` are the aligned words of the original (with edit ``tokens``); ``target_words`` the + whitespace words of the target text and ``target_word_tokens`` their edit tokens. Each region + takes the words within ``context_seconds`` of it; an edge inside a changed block of the + original -> target token diff (or inside a target word) moves outward to the block edge, and + overlapping windows merge. A window's audio is cut halfway between its edge words and their + neighbours; its text is the target words aligned with its original words. A window over the + whole clip takes ``target_text`` itself. + """ + n = len(words) + if not n: + raise ValueError("The aligner found no words in the audio, so the edit cannot be windowed.") + diff = WordDiff(words, target_words, target_word_tokens) + + def boundary(k): + if k == 0: + return 0 + if k == n: + return total_frames + return min(total_frames, round((words[k - 1].end + words[k].start) / 2 * frame_rate)) + + windows = [] + for index, (start, length) in enumerate(spans): + t0, t1 = start / frame_rate - context_seconds, (start + length) / frame_rate + context_seconds + a = next((k for k in range(n) if words[k].end > t0), n) + b = max(a, next((k + 1 for k in reversed(range(n)) if words[k].start < t1), 0)) + windows.append([*diff.clean(a, b), [index]]) + + def frames(window): + a, b, regions = window + first = min(spans[k][0] for k in regions) + last = max(spans[k][0] + spans[k][1] for k in regions) + return min(boundary(a), first), max(boundary(b), last) + + windows.sort(key=lambda w: (w[0], w[1])) + merged = [windows[0]] + for window in windows[1:]: + current = merged[-1] + if window[0] < current[1] or frames(window)[0] < frames(current)[1]: + current[0], current[1] = min(current[0], window[0]), max(current[1], window[1]) + current[2] = sorted(current[2] + window[2]) + else: + merged.append(window) + out = [] + for a, b, regions in merged: + start, end = frames([a, b, regions]) + if a == 0 and b == n and target_text is not None: + text = target_text + else: + ja, jb = diff.target_range(a, b) + text = " ".join(target_words[ja:jb]) + out.append(EditWindow(start, end, regions, text)) + return out + + +def expected_fill_seconds(spans, words, target_words, target_word_tokens, *, frame_rate=15.0) -> list[float]: + """How long each region's fill should take: the region's seconds scaled by the target over + the original text length (edit token characters) of the words in it (word midpoints inside + the region; the range widened to clean diff edges, so insertions at its edges count). A + region holding no original word (a pure insertion) takes the clip's characters per second.""" + diff = WordDiff(words, target_words, target_word_tokens) + + def chars(token_lists): + return sum(token_chars(t) for tokens in token_lists for t in tokens) + + spoken = sum(w.end - w.start for w in words) + rate = chars(w.tokens for w in words) / spoken if spoken > 0 else 0.0 + mids = [(w.start + w.end) / 2 for w in words] + out = [] + for start, length in spans: + r0, r1 = start / frame_rate, (start + length) / frame_rate + inside = [k for k, mid in enumerate(mids) if r0 <= mid < r1] + a = inside[0] if inside else next((k for k, mid in enumerate(mids) if mid >= r0), len(words)) + a, b = diff.clean(a, inside[-1] + 1 if inside else a) + ja, jb = diff.target_range(a, b) + original, target = chars(w.tokens for w in words[a:b]), chars(target_word_tokens[ja:jb]) + if original: + out.append((r1 - r0) * target / original) + else: + out.append(target / rate if rate > 0 else r1 - r0) + return out + + +def _levenshtein(a, b) -> int: + prev = list(range(len(b) + 1)) + for i, x in enumerate(a, 1): + cur = [i] + [0] * len(b) + for j, y in enumerate(b, 1): + cur[j] = min(prev[j] + 1, cur[j - 1] + 1, prev[j - 1] + (x != y)) + prev = cur + return prev[-1] + + +def wildcard_verify(reference_tokens, hypothesis_tokens) -> dict: + """WER / CER of a transcript against reference tokens in which each pronunciation group is a + wildcard word: it matches any one recognized word at no cost (a missing word still costs one). + Ties between word alignments go to the one with the fewest character edits on the plain words, + so a group takes the word recognized where it was spoken. Returns ``word_errors``, + ``ref_words``, ``cer`` (characters of the reference with each group replaced by the word heard + there, against the hypothesis, as textmatch.char_error_rate) and ``groups``: each group's IPA and + the recognized word aligned with it (None if none).""" + ref, hyp = list(reference_tokens), list(hypothesis_tokens) + n, m = len(ref), len(hyp) + wild = [is_group_token(t) for t in ref] + + def sub(i, j): # (word errors, character edits) of aligning ref[i] with hyp[j] + if wild[i]: + return (0, 0) + return (int(ref[i] != hyp[j]), _levenshtein(ref[i], hyp[j])) + + def add(a, b): + return (a[0] + b[0], a[1] + b[1]) + + cost = [[(0, 0)] * (m + 1) for _ in range(n + 1)] + for i in range(1, n + 1): + cost[i][0] = add(cost[i - 1][0], (1, 0 if wild[i - 1] else len(ref[i - 1]))) + for j in range(1, m + 1): + cost[0][j] = add(cost[0][j - 1], (1, len(hyp[j - 1]))) + for i in range(1, n + 1): + for j in range(1, m + 1): + cost[i][j] = min(add(cost[i - 1][j - 1], sub(i - 1, j - 1)), + add(cost[i - 1][j], (1, 0 if wild[i - 1] else len(ref[i - 1]))), + add(cost[i][j - 1], (1, len(hyp[j - 1])))) + heard, i, j = {}, n, m + while i > 0: + if j > 0 and cost[i][j] == add(cost[i - 1][j - 1], sub(i - 1, j - 1)): + if wild[i - 1]: + heard[i - 1] = hyp[j - 1] + i, j = i - 1, j - 1 + elif j > 0 and cost[i][j] == add(cost[i][j - 1], (1, len(hyp[j - 1]))): + j -= 1 + else: + i -= 1 + filled = "".join(heard.get(k, "") if wild[k] else t for k, t in enumerate(ref)) + said = "".join(hyp) + cer = 0.0 if not filled else 1.0 if not said else _levenshtein(filled, said) / len(filled) + return {"word_errors": cost[n][m][0], "ref_words": n, "cer": cer, + "groups": [{"ipa": t[1:-1], "heard": heard.get(k)} for k, t in enumerate(ref) if wild[k]]} + + +def fill_groups(text: str, heard) -> str: + """``text`` with its pronunciation groups replaced, in order, by the words in ``heard`` + (lower-cased; a group with nothing heard is dropped): plain text the aligner can place.""" + heard = iter(heard) + return " ".join(_GROUP_RE.sub(lambda _m: (next(heard) or "").lower(), text).split()) diff --git a/zonos3/tts/edit_runtime.py b/zonos3/tts/edit_runtime.py new file mode 100644 index 0000000000000000000000000000000000000000..5cf09a7d892eb9427b50b59056d9100898d742c0 --- /dev/null +++ b/zonos3/tts/edit_runtime.py @@ -0,0 +1,399 @@ +"""Speech editing in every server (``/v2/edit/transcribe``, ``/v2/edit/align``, ``/v2/edit``): ``EditRuntime``. + +The runtime holds everything of an edit that is not the model: request checks, the ASR transcript and FuseAlign word +timings (``zonos3.tts.edit_align``: the server's ``AsrWorker`` / ``FuseAlignWorker``, shared with dubbing), the word +diff, the context windows of a long clip, the fill lengths, the splice and ``verify``. What needs the served model goes +through the server's ``EditEngine``: decoding an upload, the speaker row and reference codes of the clip, the +engine-level request checks, one region's span-end-terminated generation and the decode of the spliced codes. The +CUDA and MLX servers implement the engine in-process; the ggml server runs this runtime in +zonos3/workers/edit_dub.py and answers the engine's calls over its pipe. + +Errors: ``ValueError`` is the request's fault (HTTP 400), ``zonos3.tts.edit_align.WorkerError`` an unavailable ASR / +FuseAlign worker (503), ``RuntimeError`` a failed generation or decode (500); ``status_of`` maps them. +""" + +from __future__ import annotations + +import asyncio +import base64 +import io +import os +import random +import tempfile +from dataclasses import dataclass, field +from typing import Any, Protocol + +import numpy as np + +from zonos3 import languages +from zonos3.generation import EDIT_MAX_SECONDS, SAMPLE_RATE +from zonos3.tts import edit_align, textmatch +from zonos3.tts.edit import extract_fill, splice_edit, validate_edit_spans +from zonos3.tts.edit_align import ( + GROUP_OPEN, + WorkerError, + canonical_markup, + diff_spans, + edit_words, + expected_fill_seconds, + fill_groups, + plan_edit_windows, + seconds_to_spans, + target_tokens, + whole_clip_window, + wildcard_verify, +) +from zonos3.tts.markup import strip_nonverbal_markup + + +@dataclass(frozen=True) +class EditModel: + """What an edit needs to know of the served checkpoint.""" + + frame_rate: float # codec frames per second + n_codebooks: int + audio_pad_id: int + codebook_sizes: tuple[int, ...] + max_spans: int # edit marker rows; 0 when the checkpoint cannot edit (no span_end_id or no marker rows) + speaker_row: bool # the checkpoint has a speaker-embedding row + + +@dataclass +class FillJob: + """One region's generation: the edit prompt of ``window_codes`` with ``spans`` masked and ``fills`` already + generated, ended by span-end (masked until ``min_frames`` rows), as a /v2/generate request would sample it.""" + + text: str # the window's target text (normalized by the engine when ``text_normalization``) + language: str # normalized server language code + text_normalization: bool + sampling: dict # temperature, topk, top_p, min_p, repetition_window, repetition_penalty, repetition_codebooks + seed: int + max_tokens: int # the engine clamps it to its own limit + min_frames: int + condition_buckets: Any + condition_values: Any + speaker_embedding: Any # the engine's embedding of the clip (``EditEngine.embed``), or None: no speaker row + controls: dict[str, float] | None # the region's steering doses (checked by ``EditEngine.check``) + controls_text: str # the text the doses' character spans refer to (the whole target text) + window_codes: np.ndarray # [frames, n_codebooks] int64 + spans: list[list[int]] # window-relative [start_frame, length_frames] + fills: list[np.ndarray] = field(default_factory=list) # [n, n_codebooks] int32 each, earlier regions of the window + + +class EditEngine(Protocol): + """The served model's part of an edit (see the module docstring). Every method raises ValueError for input at + fault and RuntimeError for a failure of the engine.""" + + model: EditModel + + async def decode_audio(self, audio: bytes) -> tuple[np.ndarray, int]: + """An upload (any sound file) -> (mono float32 PCM, its sample rate).""" + + async def embed(self, audio: bytes) -> Any: + """The speaker-row embedding of an upload (opaque to the runtime; handed back in ``FillJob``).""" + + async def encode(self, audio: bytes, max_seconds: float) -> np.ndarray: + """Ordinary codec codes ``[frames, n_codebooks]`` (int64) of an upload.""" + + async def check(self, target_text: str, doses: list[dict[str, float]] | None, condition_buckets, + condition_values) -> set[str]: + """Engine-level checks before any work: the target's pronunciation groups, every region's steering doses + against the server's bundle (ValueError without one) and the condition buckets / values. Returns the dosed + ids that move the speaker embedding (raw-space directions).""" + + async def fill(self, job: FillJob) -> tuple[np.ndarray, int]: + """The generated delay-stacked rows ``[n, n_codebooks]`` without the finishing row, and the aligned EOS frame + (-1 = none), of one region.""" + + async def decode(self, codes: np.ndarray) -> np.ndarray: + """Float32 44.1 kHz audio (with the server's output gain) of ordinary codes ``[frames, n_codebooks]``.""" + + +def status_of(exc: BaseException) -> int | None: + """The HTTP status of an edit / dub error (None: not one of theirs).""" + from zonos3.dub.runtime import AlignWorkerError, UnknownId + + if isinstance(exc, UnknownId): + return 404 + if isinstance(exc, (AlignWorkerError, WorkerError)): + return 503 + if isinstance(exc, ValueError): + return 400 + if isinstance(exc, RuntimeError): + return 500 + return None + + +def edit_capabilities(model: EditModel, available: bool) -> dict: + """The speech-editing keys of /v2/capabilities; ``available``: the server can run the ASR and FuseAlign workers and + encode reference audio.""" + editing = model.max_spans > 0 + return {"speech_editing": editing and available, "edit_max_spans": model.max_spans if editing else 0, + "edit_frame_rate": model.frame_rate if editing else None, "edit_max_seconds": EDIT_MAX_SECONDS, + "edit_align_max_seconds": EDIT_MAX_SECONDS} + + +def public_words(words) -> list[dict]: + return [{"word": w.word, "start": w.start, "end": w.end, "confidence": w.confidence, "tokens": w.tokens} + for w in words] + + +def region_doses(req, model: EditModel) -> list[dict[str, float]] | None: + """Steering doses of each edited region: ``controls`` plus ``region_controls[k]`` summed per id (zero doses + dropped), or None without controls.""" + if req.region_controls is not None: + if req.spans is None: + raise ValueError("region_controls needs explicit spans (one entry per span).") + if len(req.region_controls) != len(req.spans): + raise ValueError(f"region_controls has {len(req.region_controls)} entries for {len(req.spans)} spans; " + "send one per span (null for none).") + regions = len(req.spans) if req.spans is not None else 1 + doses = [] + for k in range(regions): + merged = {did: float(v) for did, v in (req.controls or {}).items()} + extra = req.region_controls[k] if req.region_controls is not None else None + for did, v in (extra or {}).items(): + merged[did] = merged.get(did, 0.0) + float(v) + doses.append({did: v for did, v in merged.items() if v != 0.0}) + return doses if any(doses) else None + + +def _wav16(audio: np.ndarray) -> bytes: + import soundfile as sf + + buf = io.BytesIO() + sf.write(buf, audio, SAMPLE_RATE, subtype="PCM_16", format="WAV") + return buf.getvalue() + + +class EditRuntime: + def __init__(self, engine: EditEngine, asr: edit_align.AsrWorker, aligner: edit_align.FuseAlignWorker): + self.engine = engine + # the server's ASR and FuseAlign workers (shared with dubbing; the server closes them) + self.asr = asr + self.aligner = aligner + + @property + def model(self) -> EditModel: + return self.engine.model + + def require_editing(self) -> None: + if self.model.max_spans <= 0: + raise ValueError("The loaded checkpoint does not support speech editing (needs span_end_id and marker " + "rows).") + + # ---- workers ---------------------------------------------------------------------------------------------- + + async def language(self, language: str) -> tuple[str, str]: + """``(Whisper-style code, Qwen3-ASR name)`` of a request's ``language`` (edit_align.edit_language over the + ASR worker's languages; ValueError for one editing does not serve).""" + normalized = languages.normalize(language) + return edit_align.edit_language(normalized, await asyncio.to_thread(self.asr.languages)) + + async def _transcribe(self, path: str, language: tuple[str, str]) -> edit_align.Transcript: + """Qwen3-ASR transcript of a clip in the edit's language (chunk-wise past 30 s).""" + return await asyncio.to_thread(edit_align.transcribe_audio, self.asr, self.aligner, path, language[1]) + + async def _aligned_words(self, path: str, text: str, language: tuple[str, str], utterances=None): + """The words of ``text`` in the clip with their edit tokens (``utterances``: the long-form anchors of a + transcript of the same clip).""" + return await asyncio.to_thread(edit_align.edit_aligned_words, self.asr, self.aligner, path, text, language, + utterances) + + async def _write_audio(self, audio: bytes, directory: str, max_seconds: float) -> tuple[str, float]: + """Decode an upload, check its length and store it as WAV for the ASR and FuseAlign workers.""" + import soundfile as sf + + pcm, sample_rate = await self.engine.decode_audio(audio) + duration = len(pcm) / sample_rate + if duration > max_seconds: + raise ValueError(f"Audio is {duration:.1f} s long; at most {max_seconds:.0f} s are supported here.") + path = os.path.join(directory, "original.wav") + sf.write(path, pcm, sample_rate, subtype="FLOAT") + return path, duration + + # ---- routes ----------------------------------------------------------------------------------------------- + + async def transcribe(self, req) -> dict: + """/v2/edit/transcribe: the Qwen3-ASR transcript (chunk-wise past 30 s) and its words' FuseAlign timings.""" + from zonos3.reference.synth import decode_base64_blob + + self.require_editing() + with tempfile.TemporaryDirectory(prefix="zonos3-edit-") as tmp: + path, duration = await self._write_audio(decode_base64_blob(req.audio_base64, "audio_base64"), tmp, + EDIT_MAX_SECONDS) + language = await self.language(req.language) + transcript = await self._transcribe(path, language) + words = await self._aligned_words(path, transcript.text, language, transcript.utterances) + return {"text": transcript.text, "duration": duration, "words": public_words(words)} + + async def align(self, req) -> dict: + """/v2/edit/align: FuseAlign word timings, presences (``confidence``) and edit tokens of ``text``.""" + from zonos3.reference.synth import decode_base64_blob + + self.require_editing() + text = req.text.strip() + if not text: + raise ValueError("text is empty.") + with tempfile.TemporaryDirectory(prefix="zonos3-edit-") as tmp: + path, duration = await self._write_audio(decode_base64_blob(req.audio_base64, "audio_base64"), tmp, + EDIT_MAX_SECONDS) + words = await self._aligned_words(path, text, await self.language(req.language)) + return {"text": text, "duration": duration, "words": public_words(words)} + + async def edit(self, req) -> dict: + """/v2/edit: regenerate the edited regions of recorded speech; unedited codec frames are kept exactly. + + Each region is one span-end-terminated generation over [speaker row][condition rows][text][unmasked + context][earlier fills][marker]. A clip longer than ``max_context_seconds`` is cut into word-snapped windows + around the regions (``plan_edit_windows``): each window's prompts hold its codes and its stretch of the target + text, and every fill splices into the full clip, which is decoded once. Region k's steering (``controls`` + + ``region_controls[k]``) moves its speaker row and adds its hidden delta on the frames it generates.""" + from zonos3.reference.synth import decode_base64_blob + + m = self.model + self.require_editing() + if req.tag_cfg_scale != 1.0: + raise ValueError("tag_cfg_scale is not supported by /v2/edit (speech-edit requests run without tag CFG); " + "use 1.0.") + frame_rate, n_cb = m.frame_rate, m.n_codebooks + # Nonverbal markup is text for the model only: markers (canonical, no inner whitespace) ride in the prompt + # text and never reach the ASR or FuseAlign (word diff, alignment, verify; target_tokens). + target_text = canonical_markup(req.target_text.strip()) + plain_target_text = strip_nonverbal_markup(target_text) + edit_lang = await self.language(req.language) # every ASR and FuseAlign call of the edit + if not target_text: + raise ValueError("target_text is empty.") + if req.original_words is not None and not (req.original_text or "").strip(): + raise ValueError("original_words needs the original_text they spell.") + doses = region_doses(req, m) + language = languages.normalize(req.language) + use_row = m.speaker_row if req.speaker_embedding is None else bool(req.speaker_embedding) + if use_row and not m.speaker_row: + raise ValueError("speaker_embedding needs a checkpoint with a speaker-embedding row.") + raw = await self.engine.check(target_text, doses, req.condition_buckets, req.condition_values) + if raw and not use_row: + raise ValueError(f"Controls {', '.join(sorted(raw))} move the speaker embedding and need the speaker row " + "(speaker_embedding true or unset, on a speaker-embedding checkpoint).") + audio = decode_base64_blob(req.audio_base64, "audio_base64") + with tempfile.TemporaryDirectory(prefix="zonos3-edit-") as tmp: + original_path, duration = await self._write_audio(audio, tmp, EDIT_MAX_SECONDS) + speaker_embedding = await self.engine.embed(audio) if use_row else None + codes = np.asarray(await self.engine.encode(audio, EDIT_MAX_SECONDS), dtype=np.int64) + # Longer clips are windowed and every fill gets a minimum length; both read word timings of the original + # (the caller's original_words, else a FuseAlign alignment) and the target words' edit tokens. Without + # original_text, a short clip with explicit spans is not transcribed: its regions' own lengths are + # expected. + windowed = len(codes) / frame_rate > req.max_context_seconds + target_words = target_text.split() + # [target tokens, tokens of each target word]; a pronunciation group is one target token. + normalized_target = target_tokens(target_text) + original_text, words = req.original_text, None + if original_text: + original_text = strip_nonverbal_markup(original_text) # what the workers read (and the response) + if req.original_words is not None: + given = [w.model_dump() for w in req.original_words] + for w in given: + if w["tokens"] is None: + w["tokens"] = textmatch.tokens(w["word"]) + words = edit_words(given, [w["tokens"] for w in given], textmatch.tokens(original_text), + duration=duration) + elif req.spans is None or windowed or (req.min_fill_ratio > 0 and original_text): + utterances = None + if not original_text: + transcript = await self._transcribe(original_path, edit_lang) + original_text, utterances = transcript.text, transcript.utterances + words = await self._aligned_words(original_path, original_text, edit_lang, utterances) + # verify with pronunciation groups: the reference's tokens, each group a wildcard word + verify_reference = normalized_target[0] if req.verify and GROUP_OPEN in target_text else None + if req.spans is not None: + spans = seconds_to_spans(req.spans, len(codes), frame_rate) + else: + spans = diff_spans(words, normalized_target[0], total_frames=len(codes), frame_rate=frame_rate, + margin_seconds=req.margin_seconds, max_spans=m.max_spans).spans + validate_edit_spans(spans, len(codes), m.max_spans) + windows = [whole_clip_window(spans, len(codes), target_text)] + if windowed: + windows = plan_edit_windows(spans, words, target_words, normalized_target[1:], + total_frames=len(codes), frame_rate=frame_rate, + context_seconds=req.context_seconds, target_text=target_text) + if words is not None: + expected = expected_fill_seconds(spans, words, target_words, normalized_target[1:], + frame_rate=frame_rate) + else: + expected = [length / frame_rate for _, length in spans] + # The span-end token is masked until a fill reaches min_fill_ratio of its expected length. + min_frames = [min(int(req.min_fill_ratio * seconds * frame_rate), int(req.max_span_seconds * frame_rate)) + for seconds in expected] + max_tokens = int(req.max_span_seconds * frame_rate) + n_cb + 1 + # Without explicit spans the request's controls apply to every diffed region alike. + region_controls = [None if doses is None else doses[k if req.spans is not None else 0] + for k in range(len(spans))] + base_seed = req.seed if req.seed is not None else random.randrange(2**31 - 8) + sampling = {"temperature": req.temperature, "topk": req.topk, "top_p": req.top_p, "min_p": req.min_p, + "repetition_window": req.repetition_window, "repetition_penalty": req.repetition_penalty, + "repetition_codebooks": req.repetition_codebooks} + + async def take(k: int) -> dict: + fills, stopped = [None] * len(spans), [None] * len(spans) + for window in windows: + window_codes = codes[window.start: window.end] + window_spans = [[int(start), int(length)] for start, length in window.spans(spans)] + window_fills: list[np.ndarray] = [] + for region in window.regions: + rows, eos_frame = await self.engine.fill(FillJob( + text=window.text, language=language, text_normalization=req.text_normalization, + sampling=sampling, seed=base_seed + k, max_tokens=max_tokens, + min_frames=min_frames[region], condition_buckets=req.condition_buckets, + condition_values=req.condition_values, speaker_embedding=speaker_embedding, + controls=region_controls[region], controls_text=target_text, window_codes=window_codes, + spans=window_spans, fills=list(window_fills))) + fill, ended = extract_fill(rows, None if eos_frame is None or eos_frame < 0 else eos_frame, + audio_pad_id=m.audio_pad_id, codebook_sizes=list(m.codebook_sizes)) + window_fills.append(np.asarray(fill, dtype=np.int32)) + fills[region], stopped[region] = window_fills[-1], ended + spliced = np.asarray(splice_edit(codes, spans, fills), dtype=np.int32) + edited = np.asarray(await self.engine.decode(spliced), dtype=np.float32) + verify, take_words = None, None + if req.verify: + import soundfile as sf + + edited_path = os.path.join(tmp, f"take{k}.wav") + sf.write(edited_path, edited, SAMPLE_RATE, subtype="FLOAT") + # The take's transcript (Qwen3-ASR) and its anchors for the alignment of the take's words. + heard = await self._transcribe(edited_path, edit_lang) + if verify_reference is None: + scored = textmatch.verify(plain_target_text, heard.text) + verify = {"asr_text": heard.text, "wer": scored["word_errors"] / max(1, scored["ref_words"]), + "cer": scored["cer"]} + take_words = public_words(await self._aligned_words(edited_path, plain_target_text, + edit_lang, heard.utterances)) + else: + # Groups are wildcard words: any one recognized word matches; the take's words come from + # aligning the target with each group replaced by the word heard. + scored = wildcard_verify(verify_reference, textmatch.tokens(heard.text)) + verify = {"asr_text": heard.text, "wer": scored["word_errors"] / max(1, scored["ref_words"]), + "cer": scored["cer"], "groups": scored["groups"]} + heard_text = fill_groups(plain_target_text, [g["heard"] for g in scored["groups"]]) + if heard_text: + take_words = public_words(await self._aligned_words(edited_path, heard_text, edit_lang, + heard.utterances)) + edited_regions, shift = [], 0 + for (start, length), fill in zip(spans, fills, strict=True): + edited_regions.append([(start + shift) / frame_rate, (start + shift + len(fill)) / frame_rate]) + shift += len(fill) - length + return {"seed": base_seed + k, "audio_base64": base64.b64encode(_wav16(edited)).decode("ascii"), + "duration": len(edited) / SAMPLE_RATE, "edited_regions": edited_regions, + "fill_seconds": [len(fill) / frame_rate for fill in fills], "stopped": stopped, + "verify": verify, "words": take_words} + + takes = await asyncio.gather(*(take(k) for k in range(req.num_takes))) + return { + "sample_rate": SAMPLE_RATE, "original_text": original_text, "target_text": target_text, + "words": None if words is None else public_words(words), + "spans": [[start / frame_rate, (start + length) / frame_rate] for start, length in spans], + # The audio the model saw per window (full-clip seconds); null when the clip was edited whole. + "contexts": [[w.start / frame_rate, w.end / frame_rate] for w in windows] if windowed else None, + # Each region's expected fill length (seconds); its fills last at least min_fill_ratio of it. + "expected_seconds": expected, "takes": list(takes), + } diff --git a/zonos3/tts/laci.py b/zonos3/tts/laci.py new file mode 100644 index 0000000000000000000000000000000000000000..a5042810d419f2cbef7b0695aa4ecee02faacf75 --- /dev/null +++ b/zonos3/tts/laci.py @@ -0,0 +1,738 @@ +"""LACI -- Localized Attention-Constrained Inference (arXiv 2609.16989) for ZONOS3 Mini. + +While a request decodes, the alignment heads' attention over the text (zonos3_sgl.tts.align_probe) is reduced to a reading +position per step and fed to a ``Detector``. A skip (the reading jumps past a token bin that got far fewer steps than +the bins before it), a hallucination (the reading stops advancing) or a truncation (EOS with two or more bins unread) +rolls the request back to the failure onset; it is regenerated from there with a new seed under an ACI hard attention +mask (arXiv 2404.19723) until the reading passes the detection point, at most ``max_retries`` times. Generation stops +once the last bin has been read (plus ``tail_frames``). + +The scheduler runs this for requests whose ``TTSUserMsg.laci`` names an alignment-head spec (``LaciHeads``), offline +(``TTSLLM.generate(laci=...)``) and in the server (``laci: true`` on the request) alike: a ``LaciSession`` per request +owns the stream, a rollback becomes a continuation request (the prompt plus the kept rows, re-prefilled) under the same +uid, and only rows no later rollback can change are handed downstream (``LaciSession.drain``), so the detokenizer and the +streamed response see one uninterrupted stream. Constraints: no CFG twin (speaker and controls CFG scale 1), the FA +attention backend, tensor parallel size 1. + +Vocabulary + row stream index: the request's prefill rows (codec silence) are 0..P-1, generated rows follow. + pos text-span index 0..text_len-1; 0 is BOS, text_len-1 is EOS. + bin b(pos) = pos // bin_tokens; nb = ceil(text_len / bin_tokens). + share(b) frames bin b is expected to take: pace_tok() * tokens_b, where pace_tok() is the median frames/token of the + last pace_window_bins bins below the frontier (the prior until warmup_bins exist). + frontier highest bin that has been read for at least cover_frac * share. +""" + +from __future__ import annotations + +import bisect +import json +import math +import statistics +from dataclasses import dataclass, field +from pathlib import Path + +import torch + +Head = tuple[int, int] # (layer_id, q_head) + + +@dataclass(frozen=True) +class LaciConfig: + bin_tokens: int = 8 + cover_frac: float = 0.5 + skip_frac: float = 0.15 + stall_factor: float = 3.0 + min_stall_frames: int = 45 + tail_frames: int = 15 + rollback_margin_frames: int = 8 + max_retries: int = 8 + pace_window_bins: int = 16 + warmup_bins: int = 2 + + +@dataclass(frozen=True) +class Failure: + kind: str # "skip" | "hallucination" | "truncation" + detect_row: int + onset_row: int + rollback_row: int + bin: int # skip: first skipped bin; hallucination/truncation: first unread bin + frontier: int # skip: the bin the reading jumped to; otherwise the frontier + + +class Detector: + """Streaming skip / hallucination / truncation detector. + + Feed one (row, pos) per decode step with strictly increasing rows. After a failure the caller rolls back with + truncate(rollback_row) and re-observes from that row. A returned failure leaves the detector state unchanged except + for the recorded observation; callers that ignore failures (retry budget spent) will see the same failure again on + later rows. + """ + + def __init__(self, text_len, frames_per_token_prior, cfg, min_rollback_row): + if text_len < 1: + raise ValueError(f"text_len must be >= 1, got {text_len}") + self.text_len = int(text_len) + self.prior = float(frames_per_token_prior) + self.cfg = cfg + self.min_rollback_row = int(min_rollback_row) + self.nb = -(-self.text_len // cfg.bin_tokens) + self._obs_rows = [] + self._obs_pos = [] + self._bumps = [] # rows of the truncate() calls that still lie inside the kept observations + self._reset() + + # -- state --------------------------------------------------------------- + + def _reset(self): + self._counts = [0] * self.nb + self._first_row = [None] * self.nb + self._frontier = 0 + self._last_advance_row = None + self._done_row = None + + def _tokens(self, b): + return min(self.cfg.bin_tokens, self.text_len - b * self.cfg.bin_tokens) + + @property + def frontier(self): + return self._frontier + + @property + def counts(self): + return list(self._counts) + + @property + def last_advance_row(self): + return self._last_advance_row + + @property + def done_row(self): + return self._done_row + + def pace_tok(self): + """Median frames/token over the last pace_window_bins bins below the frontier.""" + lo = max(0, self._frontier - self.cfg.pace_window_bins) + rates = [self._counts[x] / self._tokens(x) for x in range(lo, self._frontier)] + if len(rates) < self.cfg.warmup_bins: + return self.prior + return statistics.median(rates) + + def _share(self, b): + return self.pace_tok() * self._tokens(b) + + def last_pos_before(self, row): + """Last observed pos at a row < `row`; 0 if there is none.""" + i = bisect.bisect_left(self._obs_rows, row) + return self._obs_pos[i - 1] if i else 0 + + def stop_row(self): + if self._done_row is None: + return None + return self._done_row + self.cfg.tail_frames + + def commit_row(self, next_row): + """Every skip or hallucination this detector can still report (observing rows >= ``next_row``) rolls back to a + row >= the returned one. Truncation (``on_eos``) is bounded by the caller, which knows the EOS row. + + Hallucination onsets are the stall clock ``last_advance_row``, which never decreases. Skip onsets are the first + row seen in a bin above the skipped one, and a skipped bin lies above the frontier, so the onset is the first + row of a bin >= frontier + 2 (seen already, or a future row). Once the text is done neither can occur.""" + if self._done_row is not None: + return math.inf + onsets = [next_row if self._last_advance_row is None else self._last_advance_row, next_row] + onsets += [r for r in self._first_row[self._frontier + 2:] if r is not None] + return self._rollback(min(onsets)) + + # -- observation --------------------------------------------------------- + + def _rollback(self, onset): + return max(onset - self.cfg.rollback_margin_frames, self.min_rollback_row) + + def observe(self, row, pos): + if not 0 <= pos < self.text_len: + raise ValueError(f"pos {pos} outside text span [0, {self.text_len})") + if self._obs_rows and row <= self._obs_rows[-1]: + raise ValueError(f"rows must increase: got {row} after {self._obs_rows[-1]}") + self._obs_rows.append(row) + self._obs_pos.append(pos) + return self._step(row, pos) + + def _step(self, row, pos): + cfg = self.cfg + # 1. count + b = pos // cfg.bin_tokens + self._counts[b] += 1 + if self._first_row[b] is None: + self._first_row[b] = row + if self._last_advance_row is None: + self._last_advance_row = row + + # 2. frontier / skip + if b > self._frontier and self._counts[b] >= cfg.cover_frac * self._share(b): + for x in range(self._frontier + 1, b): + if self._counts[x] < cfg.skip_frac * self._share(x): + onset = min(self._first_row[y] for y in range(x + 1, self.nb) + if self._first_row[y] is not None) + return Failure("skip", detect_row=row, onset_row=onset, + rollback_row=self._rollback(onset), bin=x, frontier=b) + self._frontier = b + self._last_advance_row = row + + # 3. stall + if self._done_row is None: + limit = max(cfg.stall_factor * self.pace_tok() * cfg.bin_tokens, + cfg.min_stall_frames) + if row - self._last_advance_row > limit: + onset = self._last_advance_row + return Failure("hallucination", detect_row=row, onset_row=onset, + rollback_row=self._rollback(onset), + bin=self._frontier + 1, frontier=self._frontier) + + # 4. text done + if (self._done_row is None and self._frontier >= self.nb - 2 + and self._counts[self.nb - 1] >= self._share(self.nb - 1)): + self._done_row = row + return None + + def on_eos(self, row): + """Model emitted EOS at `row`: truncation iff two or more bins are unread.""" + if self._frontier < self.nb - 2: + return Failure("truncation", detect_row=row, onset_row=row, + rollback_row=self._rollback(row), + bin=self._frontier + 1, frontier=self._frontier) + return None + + def truncate(self, row): + """Drop observations at rows >= row and rebuild all derived state. + + The stall clock of what survives is moved up to `row`, so the regeneration gets a full stall budget. That + bump is part of the detector's history: each earlier truncate() whose row is still inside the kept + observations is re-applied at the same point of the replay, so repeated truncations replay without a stall + the live run never saw.""" + keep = bisect.bisect_left(self._obs_rows, row) + rows, poss = self._obs_rows[:keep], self._obs_pos[:keep] + bumps = [r for r in self._bumps if r < row] + self._obs_rows, self._obs_pos = [], [] + self._reset() + pending = list(bumps) + for r, p in zip(rows, poss): + while pending and r > pending[0]: + if self._last_advance_row is not None: + self._last_advance_row = max(self._last_advance_row, pending[0]) + pending.pop(0) + self._obs_rows.append(r) + self._obs_pos.append(p) + failure = self._step(r, p) + assert failure is None, f"replay raised {failure}" + if self._last_advance_row is not None: + self._last_advance_row = max(self._last_advance_row, row) + self._bumps = bumps + [row] + + +class AciCenter: + """ACI dynamic-programming attention centre (2404.19723, Eq. 2/5). + + d_t[l] = min(d_{t-1}[l], d_{t-1}[l-1]) + (m_t - l)^2 over the monotone paths that advance 0 or 1 text index per + step, starting at c0 with cost 0. The support grows by one index per step, capped at text_len-1. The centre is + argmin d_t (ties to the smaller index), held monotone and limited to +1 per update so the mask window never + retreats or jumps. + """ + + def __init__(self, c0, text_len): + self.text_len = int(text_len) + self.c0 = min(max(int(c0), 0), self.text_len - 1) + self._d = [0.0] # d[i] is the cost of index c0 + i + self.center = self.c0 + + def update(self, m): + d = self._d + if self.c0 + len(d) < self.text_len: + d.append(math.inf) + for i in range(len(d) - 1, 0, -1): + d[i] = min(d[i], d[i - 1]) + (m - (self.c0 + i)) ** 2 + d[0] += (m - self.c0) ** 2 + best = 0 + for i in range(1, len(d)): + if d[i] < d[best]: + best = i + self.center = min(max(self.c0 + best, self.center), self.center + 1) + return self.center + + +# ------------------------------------------------------------------------------------------------- request driver + + +@dataclass(frozen=True) +class LaciHeads: + """Alignment heads of one model and language (the JSON files in laci_heads/).""" + + heads: tuple[Head, ...] + radius: dict[Head, int] # ACI mask half-width per head + frames_per_token: float # pace prior until the reading has covered warmup_bins bins + + @classmethod + def load(cls, path: str | Path) -> "LaciHeads": + spec = json.loads(Path(path).read_text()) + if not spec.get("heads"): + raise ValueError(f"{path}: no alignment heads") + heads = tuple((int(h["layer"]), int(h["head"])) for h in spec["heads"]) + radius = {(int(h["layer"]), int(h["head"])): int(h["radius"]) for h in spec["heads"]} + return cls(heads, radius, float(spec["frames_per_token"])) + + +# ------------------------------------------------------------------------------------------------- duration targets +# +# A LACI request may also carry a ``DurationTarget``: the take's length is then held to it (the dubbing tool, +# zonos3.dub, uses it to fit a segment). The reading position reaches the last text token ~0.2 s before the speech +# ends, so (row of that moment - first generated row) / target estimates the take's duration ratio; mid-text it is too +# uneven per token to judge (calibrated on 124 en->fr dub takes, 2026-10-28). A take that reads the text too early, or +# has not read it PACE_TOLERANCE * target + PACE_SLACK_FRAMES frames after its target, is rolled back to its first row +# and regenerated in the speaking-rate bucket the ratio asks for (the continuation's condition rows), at most +# PACE_MAX_RETRIES times; with ``adjust_rate`` off a miss is only recorded. +# +# Two content checks also follow the target. A truncation (EOS with text unread) of a rate-adjustable take regenerates +# one speaking-rate bucket slower: in the fastest bucket the model often ends a short text within a few frames, and +# reseeding in the same bucket repeated that up to the retry cap (2026-10-29 dub log: 511 of 575 truncations in the +# first text bin; bucket 9 looped on 22 of 40 seeded takes where buckets 5-8 never did). And the PaceMonitor flags a +# stall once the reading has not advanced for stall_factor text bins at the target pace (at least +# DURATION_MIN_STALL_FRAMES): the detector's limit (stall_factor bins at the observed pace, at least min_stall_frames +# = 3 s) outlasts most dub segments, so a stall inside one only surfaced as a late pace_slow retake in a faster bucket +# instead of a rollback to its onset. It watches the smoothed position itself, not the detector's bins: until two bins +# are read (all of a short text) the detector's bins follow the heads' average pace, which dub takes read ~2x faster, +# so a shorter bin-based limit fired on clean takes (40 of 40 stalls in a test run), and a target-pace prior for the +# bins moved LACI's text-done stop early enough to cut last words. +PACE_TOLERANCE = 0.10 +PACE_SLACK_FRAMES = 3 +PACE_SMOOTH_STEPS = 5 +PACE_MAX_RETRIES = 2 +PACE_RATIO_RANGE = (0.5, 2.0) # clamp of the duration-ratio estimate a retry bucket is computed from +PACE_KINDS = ("pace_slow", "pace_fast") +DURATION_MIN_STALL_FRAMES = 15 + + +@dataclass(frozen=True) +class DurationTarget: + frames: float # target length of the take, in generated rows + adjust_rate: bool = True # on a miss, regenerate in the speaking-rate bucket the measured ratio asks for + + +@dataclass(frozen=True) +class RateBuckets: + """A speaking-rate scale: the checkpoint's speaking-rate condition (its condition-row index and ``n_buckets`` row + buckets; id ``n_buckets`` is "unknown") and the scale's bucket edges (UTF-8 bytes / s): bucket i, ``first`` <= i <= + ``last``, is [edges[i - first - 1], edges[i - first]). The row's own scale is first = 0, last = n_buckets - 1; an + extended scale (a dub take's, README "Extended speaking-rate buckets") adds buckets below 0 / above n_buckets - 1 + that are the rate row unknown plus a pace-steering dose (the take's per-bucket steering delta).""" + + index: int + edges: tuple[float, ...] + n_buckets: int + first: int = 0 + + @property + def last(self) -> int: + return self.first + len(self.edges) + + def row(self, bucket: int) -> int: + """Condition-row id of a bucket: itself for a row bucket, unknown for a steered one.""" + return bucket if 0 <= bucket < self.n_buckets else self.n_buckets + + def rate(self, bucket: int) -> float: + """Representative rate of a bucket: its midpoint; the open end buckets extend by half a neighbour.""" + e, i = self.edges, bucket - self.first + if i <= 0: + return e[0] - (e[1] - e[0]) / 2 + if i >= len(e): + return e[-1] + (e[-1] - e[-2]) / 2 + return (e[i - 1] + e[i]) / 2 + + def retry_bucket(self, bucket: int, ratio: float) -> int | None: + """Bucket of a pace retry: the rate that would have made the take's duration ratio 1 (``ratio`` > 1: faster), + at least one bucket away from ``bucket``; None when that leaves ``[first, last]``.""" + want = self.first + bisect.bisect_right(self.edges, self.rate(bucket) * ratio) + want = max(want, bucket + 1) if ratio > 1 else min(want, bucket - 1) + return want if self.first <= want <= self.last else None + + +@dataclass(frozen=True) +class PaceFailure: + """A duration miss; carries the attributes the failure records and rollbacks read.""" + + kind: str # "pace_slow" (text not read by the deadline) | "pace_fast" (text read too early) + detect_row: int + onset_row: int + rollback_row: int + bin: int + frontier: int + ratio: float # estimated take duration / target duration + + +class PaceMonitor: + """Duration check over the reading position (see PACE_TOLERANCE). + + ``observe`` takes one readout per decode step. The text counts as read once the median of the last + PACE_SMOOTH_STEPS positions reaches the last text token (``text_len - 2``; ``text_len - 1`` is EOS) or the detector + says so. Reading it before ``target * (1 - PACE_TOLERANCE) - PACE_SLACK_FRAMES`` frames is ``pace_fast``; not having + read it ``target * (1 + PACE_TOLERANCE) + PACE_SLACK_FRAMES`` frames in is ``pace_slow``, whose ratio is + extrapolated from the share of the text read so far. Both roll back to ``min_rollback_row`` (a fresh take). + + It also watches for stalls (see DURATION_MIN_STALL_FRAMES): before the text is read, a smoothed position that has + not advanced for ``stall_frames`` is a ``hallucination`` (a detector ``Failure``) with its onset at the last + advance, rolled back by ``cfg.rollback_margin_frames`` like the detector's own. + """ + + def __init__(self, target_frames: float, origin_row: int, min_rollback_row: int, cfg: LaciConfig = LaciConfig()): + if target_frames <= 0: + raise ValueError(f"target_frames must be > 0, got {target_frames}") + self.target = float(target_frames) + self.origin = int(origin_row) + self.min_rollback_row = int(min_rollback_row) + self.margin = PACE_TOLERANCE * self.target + PACE_SLACK_FRAMES + self.cfg = cfg + self.ignored: set[str] = set() # kinds already recorded as ignored + self.read_row: int | None = None # row at which the text counted as read + self._rows: list[int] = [] + self._pos: list[int] = [] + self._best: float | None = None # furthest smoothed position so far, and the row it was first reached + self._best_row: int | None = None + + def stall_frames(self, text_len: int) -> float: + """Rows without an advance that make a stall: stall_factor text bins at the target pace, at least + DURATION_MIN_STALL_FRAMES.""" + per_token = self.target / max(1, text_len) + return max(self.cfg.stall_factor * self.cfg.bin_tokens * per_token, DURATION_MIN_STALL_FRAMES) + + def observe(self, row: int, pos: int, text_len: int, text_done: bool = False, frontier: int = 0): + if self._rows and row <= self._rows[-1]: + raise ValueError(f"rows must increase: got {row} after {self._rows[-1]}") + self._rows.append(int(row)) + self._pos.append(int(pos)) + if self.read_row is not None: + return None # the tail + smooth = statistics.median(self._pos[-PACE_SMOOTH_STEPS:]) + if self._best is None or smooth > self._best: + self._best, self._best_row = smooth, int(row) + last = text_len - 2 + elapsed = row - self.origin + if smooth >= last or text_done: + self.read_row = int(row) + if elapsed < self.target - self.margin: + return self._failure("pace_fast", row, frontier, elapsed / self.target) + return None + if row - self._best_row > self.stall_frames(text_len): + onset = self._best_row + return Failure("hallucination", detect_row=int(row), onset_row=onset, + rollback_row=max(onset - self.cfg.rollback_margin_frames, self.min_rollback_row), + bin=int(frontier) + 1, frontier=int(frontier)) + if elapsed > self.target + self.margin: + share = (smooth - self._pos[0]) / max(1, last - self._pos[0]) # of the text, read so far + lower = elapsed / self.target # the take is at least this long + ratio = lower / share if share > 0 else PACE_RATIO_RANGE[1] + return self._failure("pace_slow", row, frontier, max(ratio, lower)) + return None + + def _failure(self, kind, row, frontier, ratio): + lo, hi = PACE_RATIO_RANGE + return PaceFailure(kind, detect_row=int(row), onset_row=self.min_rollback_row, + rollback_row=self.min_rollback_row, bin=int(frontier), frontier=int(frontier), + ratio=float(min(hi, max(lo, ratio)))) + + def truncate(self, row: int) -> None: + """Drop the observations at rows >= ``row`` (the stream was rolled back there).""" + keep = bisect.bisect_left(self._rows, row) + del self._rows[keep:], self._pos[keep:] + if self.read_row is not None and self.read_row >= row: + self.read_row = None + self._best = self._best_row = None + for k, r in enumerate(self._rows): + smooth = statistics.median(self._pos[max(0, k - PACE_SMOOTH_STEPS + 1) : k + 1]) + if self._best is None or smooth > self._best: + self._best, self._best_row = smooth, r + if self._best_row is not None: + self._best_row = max(self._best_row, int(row)) # the regeneration gets a full stall budget + + +# ---------------------------------------------------------------------------------------------------------- session + + +@dataclass(frozen=True) +class Continuation: + """A rolled-back request's regeneration: the original prompt (without its prefill rows) plus ``rows``.""" + + rows: torch.Tensor # stream rows [0, resume_row): the prefill rows and the kept generated rows + history_rows: int # rows of ``rows`` past the prefill rows (repetition-penalty history) + seed: int | None + max_tokens: int + condition_values: list[int] | None = None # the condition-row ids to regenerate under (None: the prompt's) + # the steering delta to regenerate under (the bucket's, on an extended rate scale); only when ``swap_delta`` + steering_delta: torch.Tensor | None = None + swap_delta: bool = False + + +def _failure_record(f, retry_seed, ignored: bool, resume_row: int | None = None, retry_bucket: int | None = None) -> dict: + """``rollback_row`` is where the regeneration resumed: the failure's own rollback row, or the first unsent row when + that lies above it (``clamped``). ``retry_bucket``: the speaking-rate bucket the regeneration switched to.""" + rollback = f.rollback_row if resume_row is None else int(resume_row) + return dict(kind=f.kind, detect_row=f.detect_row, onset_row=f.onset_row, rollback_row=rollback, + clamped=rollback != f.rollback_row, bin=f.bin, frontier=f.frontier, retry_seed=retry_seed, + ignored=ignored, retry_bucket=retry_bucket) + + +@dataclass(eq=False) +class LaciSession: + """One request under LACI: its stream, detector, retries and ACI probation (see the module docstring). + + The scheduler calls, per attempt: ``probe_mask()`` (the probe windows) when it prefills the attempt's request; + the probe's observer (``on_step``) after every decode step; ``append(row, eos_frame)`` for every row the request + emits and then ``drain()`` for the rows that are final; ``finish_attempt()`` when the request finishes, which + returns a ``Continuation`` to regenerate or None when the result is final (then ``drain(final=True)``, + ``eos_frame()``, ``record()``). + + With a ``duration`` target a ``PaceMonitor`` watches the same readout (see PACE_TOLERANCE): ``rates`` and + ``condition_values`` (the request's condition-row ids) let a miss regenerate in another speaking-rate bucket. On an + extended scale (``rates.first`` < 0 or ``rates.last`` >= ``rates.n_buckets``), ``bucket`` is the take's bucket + (its row id is unknown in a steered one) and ``rate_deltas[b - rates.first]`` the request's steering delta in + bucket b, which a regeneration in another bucket switches to.""" + + heads: LaciHeads + cfg: LaciConfig + prefill_rows: torch.Tensor # [P, frame width] rows that open the stream (codec silence); may be empty + seed: int | None + max_tokens: int + n_codebooks: int + stream: list = field(default_factory=list) # 1D int32 frames: the prefill rows, then the generated rows + attempt_start: int = 0 # stream row of the current attempt's first generated row + emitted: int = 0 # generated rows handed downstream (final) + detector: Detector | None = None + text_len: int = 0 + attempts: int = 0 + failures: list = field(default_factory=list) + probation: tuple | None = None # (Failure, AciCenter) while the ACI mask is on + pending_failure: Failure | None = None + text_done: bool = False + eos_row: int | None = None # current attempt's stream EOS row, once the model emitted EOS + generated_total: int = 0 + end: tuple | None = None # (kind, stream eos row or None) once final + _ignored: set = field(default_factory=set) + duration: DurationTarget | None = None + rates: RateBuckets | None = None + condition_values: list[int] | None = None # the current attempt's condition-row ids + bucket: int | None = None # the current attempt's speaking-rate bucket (default: its condition-row id) + rate_deltas: list | None = None # per bucket of ``rates``: the request's steering delta in that bucket + pace: PaceMonitor | None = None + pace_retries: int = 0 + # span steering by reading position (zonos3.tts.span_follow.SpanFollower): sees every readout, rolled back with + # the stream + follower: object | None = None + + def __post_init__(self): + self.stream = [r for r in self.prefill_rows.to(torch.int32)] + self.attempt_start = self.n_prefill + if self.duration is not None: + self.pace = PaceMonitor(self.duration.frames, self.n_prefill, self.n_prefill, self.cfg) + if self.duration.adjust_rate and (self.rates is None or self.condition_values is None): + raise ValueError("a duration target with adjust_rate needs the checkpoint's speaking-rate condition") + if self.bucket is None and self.rates is not None and self.condition_values is not None: + self.bucket = int(self.condition_values[self.rates.index]) + if self.rate_deltas is not None and len(self.rate_deltas) != self.rates.last - self.rates.first + 1: + raise ValueError(f"rate_deltas: {len(self.rate_deltas)} for {self.rates.last - self.rates.first + 1} buckets") + + @property + def rate_bucket(self) -> int | None: + if self.rates is None or self.condition_values is None: + return None + return self.bucket + + @property + def n_prefill(self) -> int: + return int(self.prefill_rows.shape[0]) + + # -- per attempt ----------------------------------------------------------------------------------------------- + + def window(self, center: int) -> dict: + return {h: (center - r + 1, center + r - 1) for h, r in self.heads.radius.items()} + + def probe_mask(self) -> dict[Head, tuple[int, int]] | None: + """Text windows of the next attempt's probe: the ACI window around the probation center, else None.""" + return self.window(self.probation[1].center) if self.probation is not None else None + + def on_step(self, probe, step, pos, m) -> None: + """Observer: one decode step of the current attempt, the reading position ``pos`` and centroid ``m``.""" + row = self.attempt_start + step + if self.follower is not None: + self.follower.observe(row - self.n_prefill, pos) + if self.detector is None: + self.text_len = probe.text_len + self.detector = Detector(probe.text_len, self.heads.frames_per_token, self.cfg, self.n_prefill) + det = self.detector + if self.probation is not None: + failure, aci = self.probation + probe.mask = self.window(aci.update(m)) + if det.frontier > failure.frontier: + self.probation, probe.mask = None, None + f = det.observe(row, pos) + if f is not None: + if self.attempts < self.cfg.max_retries: + self.pending_failure, probe.stop = f, True + return + self._ignore(f) + stop_row = det.stop_row() + # keep the rows the delayed codebooks of the last kept frame need (stop_row + n_codebooks - 1), with a margin + if stop_row is not None and row >= stop_row + self.n_codebooks + 2: + self.text_done, probe.stop = True, True + if self.pace is not None: + self._pace_step(probe, row, pos) + + def _rate_adjustable(self) -> bool: + return self.duration is not None and self.duration.adjust_rate + + def _pace_step(self, probe, row: int, pos: int) -> None: + det = self.detector + f = self.pace.observe(row, pos, probe.text_len, text_done=det.done_row is not None, frontier=det.frontier) + if f is None or probe.stop: # in time, or the attempt already ends (text read) + return + if not isinstance(f, PaceFailure): # a stall: a content failure like the detector's + if self.attempts < self.cfg.max_retries: + self.pending_failure, probe.stop = f, True + else: + self._ignore(f) + elif self._pace_retry_bucket(f) is not None: + self.pending_failure, probe.stop = f, True + elif f.kind not in self.pace.ignored: + self.pace.ignored.add(f.kind) + self.failures.append(_failure_record(f, None, True)) + + def _pace_retry_bucket(self, f: PaceFailure) -> int | None: + """Speaking-rate bucket a pace failure would regenerate in; None when it is only recorded.""" + if not self.duration.adjust_rate or self.pace_retries >= PACE_MAX_RETRIES: + return None + if self.attempts >= self.cfg.max_retries: + return None + return self.rates.retry_bucket(self.rate_bucket, f.ratio) + + def _pace_open(self) -> bool: + """Whether a pace failure can still roll the whole attempt back (then every generated row is held).""" + return (self.pace is not None and self.duration.adjust_rate and self.pace.read_row is None + and self.pace_retries < PACE_MAX_RETRIES and self.attempts < self.cfg.max_retries) + + def _ignore(self, f: Failure) -> None: + key = (f.kind, f.bin, f.onset_row) + if key not in self._ignored: + self._ignored.add(key) + self.failures.append(_failure_record(f, None, True)) + + def append(self, row: torch.Tensor, eos_frame: int | None) -> None: + """One row the current attempt's request emitted; ``eos_frame`` is the request's aligned EOS frame (counted in + its own generated rows) once the model emitted EOS.""" + self.stream.append(row.to(torch.int32)) + self.generated_total += 1 + if eos_frame is not None: + self.eos_row = self.attempt_start + int(eos_frame) + + def commit_row(self) -> int: + """Stream rows below this go downstream: they are outside every rollback the current detector state can still + report (``finish_attempt`` keeps any deeper rollback above them). The last row is always held back so the + final message has a row to carry.""" + n = len(self.stream) + if self.end is not None: + return n + if self.attempts >= self.cfg.max_retries: + row = n + elif self._pace_open(): + row = self.n_prefill + else: + # truncation: EOS at a stream row >= the EOS-bearing row - (n_codebooks - 1); not yet seen -> row >= n + eos = self.eos_row if self.eos_row is not None else n - (self.n_codebooks - 1) + row = max(eos - self.cfg.rollback_margin_frames, self.n_prefill) + if self.detector is not None: + row = min(row, self.detector.commit_row(n)) + else: + row = self.n_prefill + return max(self.n_prefill, min(row, n - 1)) + + def drain(self, final: bool = False) -> list[torch.Tensor]: + """Generated rows that became final since the last drain (all remaining ones when ``final``).""" + upto = len(self.stream) if final else self.commit_row() + start = self.n_prefill + self.emitted + out = self.stream[start:upto] + self.emitted += len(out) + return out + + def finish_attempt(self) -> Continuation | None: + """The current attempt's request finished: roll back (a ``Continuation``) or make the result final (None).""" + f = self.pending_failure + if f is None and self.eos_row is not None and self.detector is not None: + f = self.detector.on_eos(self.eos_row) + if f is not None and self.attempts >= self.cfg.max_retries: + self._ignore(f) + f = None + # Rows already handed downstream are final: a rollback whose row lies below them restarts at the first unsent + # row. commit_row() makes this rare: it holds back what the current detector state can still roll back, but + # a regeneration's own rollbacks (the margin again, or a bin the replayed state now counts as skipped) can + # reach below it. + resume = None if f is None else max(f.rollback_row, self.n_prefill + self.emitted) + if f is not None and self.max_tokens - (resume - self.n_prefill) <= 0: + self._ignore(f) # no budget left to regenerate from the rollback row: keep what was generated + f = None + if f is None: + if self.text_done: + self.end = ("text_done", self.detector.stop_row()) + elif self.eos_row is not None: + self.end = ("eos", self.eos_row) + else: + self.end = ("max_tokens", None) + return None + # the bucket a regeneration switches to, decided before the attempt counts + if isinstance(f, PaceFailure): + bucket = self._pace_retry_bucket(f) + elif f.kind == "truncation" and self._rate_adjustable() and self.rate_bucket > self.rates.first: + bucket = self.rate_bucket - 1 # ended too early: one bucket slower + else: + bucket = None + self.attempts += 1 + seed = None if self.seed is None else self.seed + 1000 * self.attempts + self.failures.append(_failure_record(f, seed, False, resume, bucket)) + del self.stream[resume:] + self.detector.truncate(resume) + if self.follower is not None: + self.follower.truncate(resume - self.n_prefill) + if self.pace is not None: + self.pace.truncate(resume) + if bucket is not None: + # a steered bucket's row is unknown: its pace comes from its steering delta (rate_deltas) + self.bucket = bucket + self.condition_values = list(self.condition_values) + self.condition_values[self.rates.index] = self.rates.row(bucket) + if isinstance(f, PaceFailure): + # a fresh take (rollback_row is the first row) in the bucket the measured duration asks for + self.pace_retries += 1 + self.probation = None + else: + self.probation = (f, AciCenter(self.detector.last_pos_before(resume), self.text_len)) + self.pending_failure, self.text_done, self.eos_row = None, False, None + self.attempt_start = resume + return Continuation(torch.stack(self.stream), resume - self.n_prefill, seed, + self.max_tokens - (resume - self.n_prefill), + None if self.condition_values is None else list(self.condition_values), + steering_delta=(None if self.rate_deltas is None + else self.rate_deltas[self.bucket - self.rates.first]), + swap_delta=self.rate_deltas is not None) + + # -- final ----------------------------------------------------------------------------------------------------- + + def eos_frame(self) -> int | None: + """The final result's EOS as an aligned frame counted in generated rows (None: no EOS, cap hit).""" + eos = self.end[1] + return None if eos is None else int(eos) - self.n_prefill + + def record(self) -> dict: + det = self.detector + kind, eos = self.end + final_rows = (len(self.stream) if eos is None else int(eos)) - self.n_prefill + return dict(attempts=self.attempts, capped=self.attempts >= self.cfg.max_retries, end=kind, + text_len=self.text_len, n_bins=det.nb if det else 0, final_rows=final_rows, + final_eos_row=None if eos is None else int(eos), generated_total=self.generated_total, + pace_tok=det.pace_tok() if det else None, heads=[list(h) for h in self.heads.heads], + failures=list(self.failures), pace_retries=self.pace_retries, rate_bucket=self.rate_bucket) diff --git a/zonos3/tts/markup.py b/zonos3/tts/markup.py new file mode 100644 index 0000000000000000000000000000000000000000..0eee6e12b9364c3a984a75258bc205fbe5f89c8e --- /dev/null +++ b/zonos3/tts/markup.py @@ -0,0 +1,52 @@ +"""Nonverbal (NV) markup of the nonverbal fine-tune recipe (torch-free).""" + +from __future__ import annotations + +import re + +# Rendered into training transcripts as point tags ("") and span tags ("Get out!"). +# Whispering, singing and clear-throat were dropped from that recipe, and synonyms like were never trained. +NONVERBAL_MARKUP_TAGS = ("laugh", "breath", "sigh", "cough", "panting", "shouting", "crying") +_NONVERBAL_MARKUP = re.compile(rf"") +_NONVERBAL_MARKUP_SPLIT = re.compile(f"({_NONVERBAL_MARKUP.pattern})") + + +def has_nonverbal_markup(text: str) -> bool: + """Whether text contains a recognized nonverbal annotation.""" + return _NONVERBAL_MARKUP.search(text) is not None + + +def split_nonverbal_markup(text: str) -> list[str]: + """Alternate text / marker pieces: even indices are the (possibly empty) text around the markers, odd ones the + markers themselves, so ``"".join(pieces) == text``.""" + return _NONVERBAL_MARKUP_SPLIT.split(text) + + +def nonverbal_marker_spans(text: str) -> list[tuple[int, int]]: + """Character ranges [start, end) of the recognized markers in ``text``.""" + return [m.span() for m in _NONVERBAL_MARKUP.finditer(text)] + + +def strip_nonverbal_markup(text: str) -> str: + """Remove learned nonverbal markers, preserving their enclosed spoken words.""" + if not has_nonverbal_markup(text): + return text + return " ".join(_NONVERBAL_MARKUP.sub(" ", text).split()) + + +def trained_on_tags(checkpoint_dir) -> bool: + """Whether a checkpoint was fine-tuned on nonverbal markup: its training config (``config.yaml`` next to + ``params.json``, kept by the converter and by tools/add_text_extra_rows.py) has a data source with + ``nonverbal: true`` (the NV recipe's tagged ``zv3subsample``). Other checkpoints read tags as ordinary text.""" + from pathlib import Path + + import yaml + + path = Path(checkpoint_dir) / "config.yaml" + if not path.is_file(): + return False + try: + sources = ((yaml.safe_load(path.read_text()) or {}).get("data") or {}).get("sources") or {} + except (OSError, yaml.YAMLError, AttributeError): + return False + return isinstance(sources, dict) and any(isinstance(s, dict) and s.get("nonverbal") is True for s in sources.values()) diff --git a/zonos3/tts/phonemes.py b/zonos3/tts/phonemes.py new file mode 100644 index 0000000000000000000000000000000000000000..fa631886d1d95162533cf39fecdfebecb6e3ec34 --- /dev/null +++ b/zonos3/tts/phonemes.py @@ -0,0 +1,317 @@ +"""Gold-lexicon phonemization for the ``(IPA)`` pronunciation input. + +Phoneme-trained checkpoints (E2-TTS "X2" substitution, lingua +``apps/zonos/phonemes.py``) read a word written as ``(IPA)`` as its +pronunciation. This module looks words up in the same LMDB lexicon the training +data used (``apps/zonos/build_phoneme_lexicon.py``), so a phonemized word gets +exactly the notation the model saw. Words whose deciding source has several +pronunciations are reported as ambiguous. With the optional ``phonemize`` +dependency group installed, espeak-ng guesses ambiguous and unknown words of the +space-delimited languages, mapped to the lexicon's notation. + +The lexicon format is shared with lingua: a ``meta`` JSON record and one named +DB per language whose keys are ``normalize_headword`` forms and whose values are +the IPA ("" = ambiguous). +""" + +from __future__ import annotations + +import ctypes +import itertools +import json +import re +import threading +import unicodedata +from functools import lru_cache + +import lmdb + +from zonos3 import languages + +LEXICON_VERSION = 1 +_MAX_KEY_BYTES = 500 # LMDB key limit; the builder skips longer headwords +_CJK_MAX = 8 # longest headword tried by maximum matching +_JA_PARTICLES = frozenset("はがをにでとのもへ") # hiragana that may follow a kanji word +# Server language codes (text normalization) -> lexicon language codes. +SERVER_LANGUAGES = {lang.code: lang.lexicon for lang in languages.SERVER} +# Lexicon languages espeak-ng can guess. Chinese, Japanese, Korean and Vietnamese +# are absent: espeak-ng writes their tones as ASCII digits or misreads the script. +ESPEAK_VOICES = languages.ESPEAK + + +def normalize_headword(word: str) -> str: + """Lexicon key of a word; must match lingua ``apps.zonos.phonemes.normalize_headword``.""" + return unicodedata.normalize("NFC", word.strip()).replace("’", "'").casefold() + + +@lru_cache(maxsize=None) +def _char_class(c: str) -> str: + if not unicodedata.category(c).startswith("L"): + return "" + name = unicodedata.name(c, "") + if name.startswith("HIRAGANA"): + return "hira" + if name.startswith("KATAKANA"): + return "kata" + if name.startswith("HANGUL SYLLABLE"): + return "hangul" + if "CJK UNIFIED IDEOGRAPH" in name or "CJK COMPATIBILITY IDEOGRAPH" in name or c == "々": + return "han" + return "letter" + + +def _status(value: str | None) -> str: + return "unknown" if value is None else "ambiguous" if value == "" else "ok" + + +class PhonemeLexicon: + def __init__(self, path: str): + self._env = lmdb.open(path, readonly=True, lock=False, readahead=False, max_dbs=64, subdir=True) + with self._env.begin() as txn: + raw = txn.get(b"meta") + if raw is None: + raise ValueError(f"{path} is not a phoneme lexicon (no meta record)") + meta = json.loads(raw) + if meta.get("version") != LEXICON_VERSION: + raise ValueError(f"Unsupported phoneme lexicon version {meta.get('version')!r}") + self.languages: dict[str, dict] = meta["languages"] + self._dbs = {code: self._env.open_db(code.encode(), create=False) for code in self.languages} + self._ties: dict[str, bool] = {} + + def resolve_language(self, language: str) -> str: + """Lexicon code for a server language code or a lexicon code.""" + code = SERVER_LANGUAGES.get(language, language) + if code not in self.languages: + raise ValueError(f"No pronunciation lexicon for language {language!r}") + return code + + @property + def server_languages(self) -> list[str]: + return [lang for lang, code in SERVER_LANGUAGES.items() if code in self.languages] + + def get(self, code: str, word: str) -> str | None: + """None: unknown; "": ambiguous; otherwise the gold IPA.""" + key = normalize_headword(word).encode() + if not key or len(key) > _MAX_KEY_BYTES: + return None + with self._env.begin(db=self._dbs[code]) as txn: + value = txn.get(key) + return None if value is None else value.decode() + + @property + def guess_languages(self) -> list[str]: + """Server languages whose unknown words espeak-ng can guess.""" + espeak = _espeak() + if espeak is None: + return [] + return [lang for lang, code in SERVER_LANGUAGES.items() if code in self.languages and code in espeak.voices] + + def uses_ties(self, code: str) -> bool: + """Whether the language's gold IPA writes affricates with a tie bar (t͡s vs ts).""" + if code not in self._ties: + tied = untied = 0 + with self._env.begin(db=self._dbs[code]) as txn: + for _, value in itertools.islice(txn.cursor(), 20000): + value = value.decode() + tied += value.count("\u0361") + untied += len(_AFFRICATE.findall(value)) + self._ties[code] = tied > untied + return self._ties[code] + + def phonemize(self, text: str, language: str, guess: bool = True) -> dict: + """Split ``text`` into segments; word segments carry their lexicon result. + + Segment texts concatenate back to ``text``. A word segment has ``status`` + "ok" (with ``ipa``), "ambiguous" (several pronunciations), "unknown" (not in + the lexicon) or, for Japanese/Chinese characters outside any multi-character + word, "skipped"; other text has ``status`` None. With ``guess``, ambiguous + and unknown words of an espeak-ng language get its pronunciation instead, + with ``status`` "guessed". + """ + code = self.resolve_language(language) + mode = self.languages[code]["mode"] + espeak = _espeak() if guess else None + if espeak is not None and code not in espeak.voices: + espeak = None + if mode == "words": + spans = [] + for a, b in self._word_spans(text): + value = self.get(code, text[a:b]) + guessed = None + if not value and espeak is not None: + guessed = harmonize_espeak(espeak.ipa(code, text[a:b]), code, self.uses_ties(code)) + if guessed: + spans.append((a, b, guessed, "guessed")) + else: + spans.append((a, b, value or None, _status(value))) + else: + spans = self._cjk_spans(text, code, mode) + segments, pos = [], 0 + for a, b, ipa, status in spans: + if a > pos: + segments.append(dict(text=text[pos:a], ipa=None, status=None)) + segments.append(dict(text=text[a:b], ipa=ipa, status=status)) + pos = b + if pos < len(text): + segments.append(dict(text=text[pos:], ipa=None, status=None)) + return dict(language=code, segments=segments) + + @staticmethod + def _word_spans(text: str) -> list[tuple[int, int]]: + """Runs that start at a letter and continue over letters, marks and inner apostrophes.""" + spans, i, n = [], 0, len(text) + while i < n: + if not _char_class(text[i]): + i += 1 + continue + j = i + 1 + while j < n: + if unicodedata.category(text[j])[0] in "LM": + j += 1 + elif text[j] in "'’" and j + 1 < n and _char_class(text[j + 1]): + j += 2 + else: + break + spans.append((i, j)) + i = j + return spans + + def _cjk_spans(self, text: str, code: str, mode: str) -> list[tuple[int, int, str | None, str]]: + """Training-compatible units: Korean eojeol; Japanese/Chinese headwords of 2+ characters. + + Hiragana and single kanji/hanzi are never units (particles and polyphonic + characters have no single reading). A Japanese kanji run followed by + okurigana (hiragana other than a particle) is skipped whole, since its + reading belongs to the inflected word. Both rules match the training data. + """ + if mode == "korean": + targets = {"hangul"} + elif mode == "japanese": + targets = {"han", "kata"} + else: + targets = {"han"} + spans, i, n = [], 0, len(text) + while i < n: + cls = _char_class(text[i]) + if cls not in targets: + i += 1 + continue + j = i + 1 + while j < n and _char_class(text[j]) == cls: + j += 1 + if mode == "korean": + value = self.get(code, text[i:j]) + spans.append((i, j, value or None, _status(value))) + elif cls == "han" and mode == "japanese" and j < n and _char_class(text[j]) == "hira" \ + and text[j] not in _JA_PARTICLES: + spans.append((i, j, None, "skipped")) + else: + spans.extend(self._max_match(text, i, j, code)) + i = j + return spans + + def _max_match(self, text: str, start: int, end: int, code: str) -> list[tuple[int, int, str | None, str]]: + """Forward maximum matching of 2+ character headwords inside one run. + + Characters no such headword covers are grouped into "skipped" spans. + """ + spans, i, pending = [], start, None + while i < end: + for length in range(min(_CJK_MAX, end - i), 1, -1): + value = self.get(code, text[i:i + length]) + if value is not None: + if pending is not None: + spans.append((pending, i, None, "skipped")) + pending = None + spans.append((i, i + length, value or None, _status(value))) + i += length + break + else: + pending = i if pending is None else pending + i += 1 + if pending is not None: + spans.append((pending, end, None, "skipped")) + return spans + + +# espeak-ng symbols -> the lexicon's notation where the two systematically differ. +_ESPEAK_SYMBOLS = { + # CMUdict-derived English: no length marks, rhotic ɝ/ɚ, no flaps or glottal stops. + "eng": ( + ("ɜː", "ɝ"), ("ɜ", "ɝ"), ("oːɹ", "ɔɹ"), ("ː", ""), ("ɐ", "ə"), ("ᵻ", "ɪ"), ("ɾ", "t"), + ("ʔ", "t"), ("n̩", "ən"), ("l̩", "əl"), ("m̩", "əm"), ("ɒ", "ɑ"), ("x", "k"), + ), + # WikiPron German: uvular ʁ, vocalized -er as ɐ, front long a, marked diphthongs. + "deu": (("ɾ", "ʁ"), ("r", "ʁ"), ("ɜ", "ɐ"), ("ɑː", "aː"), ("aʊ", "aʊ̯"), ("aɪ", "aɪ̯"), ("ɔø", "ɔɪ̯")), + # WikiPron Italian: geminates spelled double, no lax final vowels or taps. + "ita": ( + ("tʃː", "ttʃ"), ("dʒː", "ddʒ"), ("tsː", "tts"), ("dzː", "ddz"), + *((c + "ː", c + c) for c in "bdfklmnprstvzʃʎɲɡ"), + ("ɪ", "i"), ("ʊ", "u"), ("ɾ", "r"), + ), + # WikiPron Russian: retroflex ш/ж, ɨ for ы, plain l with ʲ, a/ə vowels. + "rus": (("ɭ", "l"), ("ʃ", "ʂ"), ("ʒ", "ʐ"), ("y", "ɨ"), ("ɑ", "a"), ("ʌ", "ə")), +} +_ESPEAK_DROP = str.maketrans("", "", " ˈˌ.‿'-_") +_AFFRICATE = re.compile(r"([td])([sʃzʒɕʑʂʐ])|(p)(f)") + + +def harmonize_espeak(raw: str, code: str, ties: bool) -> str | None: + """espeak-ng IPA in the lexicon's notation (the training ``canonical_ipa`` rules). + + Returns None for output the model never saw in parentheses: tones written as + ASCII digits, or leftover brackets. + """ + s = unicodedata.normalize("NFC", re.sub(r"\([a-z-]+\)", "", raw)) # (en) voice switches + s = s.translate(_ESPEAK_DROP).replace(":", "ː").replace("g", "ɡ") + for a, b in _ESPEAK_SYMBOLS.get(code, ()): + s = s.replace(a, b) + if ties: + s = _AFFRICATE.sub(lambda m: "\u0361".join(g for g in m.groups() if g), s) + if not s or any(c in "()/[]" or "0" <= c <= "9" for c in s): + return None + return s + + +class _Espeak: + """espeak-ng through ctypes (``espeakng-loader`` ships the library and its data).""" + + def __init__(self, library: str, data: str): + self._lib = ctypes.cdll.LoadLibrary(library) + self._lib.espeak_Initialize.argtypes = [ctypes.c_int, ctypes.c_int, ctypes.c_char_p, ctypes.c_int] + self._lib.espeak_SetVoiceByName.argtypes = [ctypes.c_char_p] + self._lib.espeak_TextToPhonemes.argtypes = [ctypes.POINTER(ctypes.c_char_p), ctypes.c_int, ctypes.c_int] + self._lib.espeak_TextToPhonemes.restype = ctypes.c_char_p + if self._lib.espeak_Initialize(2, 0, data.encode(), 0) <= 0: # AUDIO_OUTPUT_SYNCHRONOUS + raise RuntimeError(f"espeak-ng failed to initialize from {data}") + self._lock = threading.Lock() + self._voice = None + self.voices = {code: voice for code, voice in ESPEAK_VOICES.items() if self._select(voice)} + + def _select(self, voice: str) -> bool: + ok = self._lib.espeak_SetVoiceByName(voice.encode()) == 0 + self._voice = voice if ok else None + return ok + + def ipa(self, code: str, word: str) -> str: + """Raw espeak-ng IPA of one word.""" + with self._lock: + if self._voice != self.voices[code] and not self._select(self.voices[code]): + raise RuntimeError(f"espeak-ng voice {self.voices[code]} vanished") + text = ctypes.c_char_p(word.encode()) + parts = [] + while text.value: + phonemes = self._lib.espeak_TextToPhonemes(ctypes.byref(text), 1, 0x02) # UTF-8 in, IPA out + if phonemes: + parts.append(phonemes.decode()) + return "".join(parts) + + +@lru_cache(maxsize=1) +def _espeak() -> _Espeak | None: + """The optional guesser; None when the ``phonemize`` dependency group is not installed.""" + try: + import espeakng_loader + except ImportError: + return None + return _Espeak(espeakng_loader.get_library_path(), espeakng_loader.get_data_path()) diff --git a/zonos3/tts/plan.py b/zonos3/tts/plan.py new file mode 100644 index 0000000000000000000000000000000000000000..f75fe2a647ea3f5c4393982a7b1450df554fa09f --- /dev/null +++ b/zonos3/tts/plan.py @@ -0,0 +1,651 @@ +"""The v2 GenerateRequest rules and prompt plan of every Python server (the reference, the MLX and the sgl server). + +One request goes through three steps, in the order the sgl frontend has always checked them (api/openapi.yaml; the +rules R1-R16 the ggml and in-browser servers port natively and ``model/tests/fixtures/request_errors.json`` pins): + +1. ``request_head``: tag CFG (R1), the speaker mode (R2) and the condition rows (R3) -- everything the server needs + before it resolves the request's speaker inputs (uploads, voices, inline codes) into a ``Speaker``. +2. ``request_rules``: language (R4), the max_tokens budget (R5), the silence prefill (R6), the accent (R9), steering + controls (R10), the span-follow gate (R11), CFG (R12), pronunciation groups (R13), LACI (R14) and the seed (R16). + The sgl frontend stops here (its tokenizer worker builds the rows in another process). +3. ``build_prompt``: the prompt rows -- condition rows, the reference prefix (R7) or speaker row, the text and silence + rows, the decode context (R8) and the CFG twin -- and the budget shrunk to the context left (R5). + +``plan_prompt`` runs the three for a server whose speaker resolution is synchronous. A server supplies what the rules +read through ``RulesContext`` and, for the rows, ``PromptContext``; every refusal is a ValueError whose message is the +HTTP 400 detail. The defaults and limits come from the generation registry (``zonos3.generation``). +""" + +from __future__ import annotations + +import bisect +import math +import os +import secrets +from collections.abc import Callable, Collection, Mapping, Sequence +from dataclasses import dataclass, replace +from typing import Protocol + +import torch + +from zonos3 import languages +from zonos3.generation import ( + DECODE_CONTEXT_FRAMES, + SAMPLING, + SILENCE_PREFILL_DEFAULT_FRAMES, + SILENCE_PREFILL_MAX_FRAMES, + TAG_CFG_MAX_SCALE, + TAG_CFG_MIN_SCALE, +) +from zonos3.speaker_cfg import speaker_cfg_twin +from zonos3.tts.markup import NONVERBAL_MARKUP_TAGS, has_nonverbal_markup, strip_nonverbal_markup +from zonos3.tts.prompt import TTSPromptBuilder, silence_rows_from_codes +from zonos3.tts.span_follow import FollowConfig +from zonos3.tts.steering import SteeringBundle, resolve_controls + +# v2 GenerateRequest (api/openapi.yaml): every field and its default. +GENERATE_DEFAULTS: dict = { + "text": None, "language": "en_us", "text_normalization": True, "silence_prefill_frames": None, + "decode_context": False, "decode_context_frames": DECODE_CONTEXT_FRAMES, **SAMPLING, "max_tokens": None, + "fade_out_ms": 0.0, "seed": None, "stream": True, "stream_decode": None, "format": "pcm", + "speaker_mode": None, "condition_buckets": None, "condition_values": None, "headroom_db": None, + "speaker_audio_base64": None, "speaker_audio_name": None, "speaker_reference_codes": None, + "speaker_embedding_base64": None, "speaker_embedding_name": None, "speaker_embedding_id": None, + "speaker_blend_embedding_id_a": None, "speaker_blend_embedding_id_b": None, "speaker_blend_t": None, + "controls_cfg_scale": 1.0, "speaker_cfg_scale": 1.0, + "tag_cfg_scale": 1.0, "accent": None, "accent_strength": 1.0, "controls": None, "control_spans": None, + "control_span_rate": None, "control_span_follow": "rate", "control_span_lead": None, "control_span_lag": None, + "laci": False, +} +NO_CONDITION_ROWS = "This checkpoint has no condition rows (loudness / fmax / speaking rate)" + + +class Request(dict): + """A v2 GenerateRequest with its defaults filled in (attribute access).""" + + def __getattr__(self, name): + try: + return self[name] + except KeyError: + raise AttributeError(name) from None + + +def parse_request(request: Mapping) -> Request: + """``request`` (a JSON body or a schema model's ``model_dump()``) with the defaults of the fields it leaves out.""" + if isinstance(request, Request): + return request + unknown = sorted(set(request) - set(GENERATE_DEFAULTS)) + if unknown: + raise ValueError(f"unknown GenerateRequest field(s) {unknown}") + if not isinstance(request.get("text"), str): + raise ValueError("GenerateRequest.text is required") + return Request({**GENERATE_DEFAULTS, **request}) + + +# ----------------------------------------------------------------------------------------------------- contexts + + +class RulesContext(Protocol): + """What the request rules read from a server: the checkpoint, the loaded companions and the server limits.""" + + n_codebooks: int + codebook_size: int + hidden_size: int # the hidden-delta width per steered source + condition_names: Sequence[str] # the condition rows in prompt order; empty without condition rows + condition_bucket_counts: Sequence[int] # per condition row: ids 0..n-1, n = unknown + condition_edges: Mapping[str, Sequence[float]] # raw value -> bucket edges per name + condition_flags: Mapping[str, Mapping] # flag rows: name -> {"values": [...]} (default [0, 1]) + speaker_modes: Sequence[str] # "reference" (the prefix) and / or "embedding" (the speaker row), default first + text_tokenizer_spec: dict | None # SuperBPE spec (phoneme tokens); None = byte text + accent_names: Sequence[str] # the loaded accent adapters + steer_bundle: SteeringBundle | None + steer_hint: str # how this server loads a steering bundle (in the refusal of `controls` without one) + steering_sources: tuple[int, ...] # the Full AttnRes bank sources hidden deltas steer, ascending + laci_languages: Collection[str] # languages with LACI alignment heads + max_frames: int # the server's frame budget (R5) + reference_max_frames: int # longer reference codes keep their first frames (R7) + silence_available: bool # the codec has codec-matched silence frames (R6) + + +class PromptContext(RulesContext, Protocol): + """What the prompt rows read besides the rules.""" + + audio_pad_id: int + text_vocab: int + span_end_id: int | None + max_seqlen: int # the context capacity (R5) + + def prompt_builder(self) -> TTSPromptBuilder: ... + + def normalize_text(self, text: str, language: str, enabled: bool) -> str: ... + + def silence_frame(self) -> torch.Tensor | None: + """One codec-matched silence frame [n_codebooks] (called only when ``silence_available``).""" + ... + + +@dataclass +class Speaker: + """A request's speaker inputs as the server resolved them for its mode: the speaker-row embedding, the reference + prefix codes (``reference_codes``, already checked and cut to the reference limit) or the raw reference audio the + sgl tokenizer worker encodes (``reference_audio``).""" + + mode: str | None + embedding: torch.Tensor | None = None + reference_codes: torch.Tensor | None = None + reference_audio: bytes | None = None + + +# ----------------------------------------------------------------------------------------------------- the rules + + +def validate_tag_cfg(text: str, scale: float, *, speaker_cfg_scale: float, controls_cfg_scale: float) -> None: + """R1: tag CFG (tagged-vs-plain guidance on nonverbal markup). 1.0 is unguided; above it the text must carry + recognized markup whose removal changes it, and no speaker or controls CFG (one twin per request).""" + scale = float(scale) + if not math.isfinite(scale) or not TAG_CFG_MIN_SCALE <= scale <= TAG_CFG_MAX_SCALE: + raise ValueError(f"tag_cfg_scale must be finite and between {TAG_CFG_MIN_SCALE} and {TAG_CFG_MAX_SCALE}.") + if scale == 1.0: + return + if not has_nonverbal_markup(text) or strip_nonverbal_markup(text) == text: + raise ValueError( + "tag_cfg_scale above 1.0 requires recognized nonverbal markup in the text: point tags " + + ", ".join(f"<{tag}/>" for tag in NONVERBAL_MARKUP_TAGS) + + " or the same names as span tags (...)." + ) + if float(speaker_cfg_scale) != 1.0: + raise ValueError("tag_cfg_scale above 1.0 cannot be combined with speaker_cfg_scale; set speaker_cfg_scale to 1.0.") + if float(controls_cfg_scale) != 1.0: + raise ValueError("tag_cfg_scale above 1.0 cannot be combined with controls_cfg_scale; set controls_cfg_scale to 1.0.") + + +def resolve_speaker_mode(modes: Sequence[str], value: str | None) -> str | None: + """R2: the request's conditioning path. None = the checkpoint's first mode (None without any); an explicit value + must be one of ``modes`` exactly.""" + modes = list(modes) + if value is None: + return modes[0] if modes else None + if value not in modes: + raise ValueError(f"speaker_mode={value!r} is not available for this checkpoint (supported: {modes})") + return value + + +def resolve_condition_buckets(ctx: RulesContext, buckets, values) -> list[int] | None: + """R3: the bucket id of every condition row. Explicit ids win, raw values map through the edges (bucket i = + [edge_{i-1}, edge_i), the training loader's bisect_right) or, on a flag row, to ``1 if value >= 0.5 else 0``; + anything else is unknown (the row's bucket count, ``condition_bucket_counts[i]``). None for a checkpoint without + condition rows, which refuses a request that names any.""" + names = list(ctx.condition_names) + if not names: + if buckets not in (None, {}, []) or values not in (None, {}, []): + raise ValueError(NO_CONDITION_ROWS) + return None + flags = ctx.condition_flags + + def as_map(raw, what): + if raw is None: + return {} + if isinstance(raw, Mapping): + unknown = [str(k) for k in raw if str(k) not in names] + if unknown: + raise ValueError(f"{what}: unknown condition name(s) {unknown}; expected {names}") + return {str(k): v for k, v in raw.items()} + raw = list(raw) + if len(raw) != len(names): + raise ValueError(f"{what}: expected {len(names)} entries in the order {names}") + return dict(zip(names, raw)) + + ids_by_name = as_map(buckets, "condition_buckets") + values_by_name = as_map(values, "condition_values") + out = [] + for i, name in enumerate(names): + n_buckets = int(ctx.condition_bucket_counts[i]) + if ids_by_name.get(name) is not None: + try: + bucket = int(ids_by_name[name]) + except (TypeError, ValueError): + raise ValueError(f"condition_buckets[{name}] must be an integer") from None + flag = flags.get(name) + if flag is not None and bucket != n_buckets: + allowed = list(flag.get("values") or [0, 1]) + if bucket not in [int(v) for v in allowed]: + raise ValueError(f"condition_buckets[{name}] is a flag: one of {allowed} or {n_buckets} (= unknown)") + if not 0 <= bucket <= n_buckets: + raise ValueError(f"condition_buckets[{name}] must be in [0, {n_buckets - 1}] or {n_buckets} (= unknown)") + elif values_by_name.get(name) is not None: + try: + value = float(values_by_name[name]) + except (TypeError, ValueError): + raise ValueError(f"condition_values[{name}] must be a number") from None + if not math.isfinite(value): + raise ValueError(f"condition_values[{name}] must be finite") + if name in flags: + bucket = 1 if value >= 0.5 else 0 # a flag row: any truthy value means "yes" + else: + edges = ctx.condition_edges.get(name) + if not edges: + raise ValueError(f"the checkpoint carries no edges for {name}; send condition_buckets[{name}] instead") + bucket = int(bisect.bisect_right(list(edges), value)) + else: + bucket = n_buckets + out.append(bucket) + return out + + +def max_tokens_budget(requested, server_max: int) -> int: + """R5 before the prompt exists: the request's positive budget, at most the server's (its frame budget).""" + if requested is None: + return int(server_max) + if int(requested) <= 0: + raise ValueError("max_tokens must be positive.") + return min(int(requested), int(server_max)) + + +def fit_max_tokens(budget: int, prompt_len: int, capacity: int) -> int: + """R5 once the prompt exists: the budget shrunk to the context the prompt leaves (a prompt that fills the context + is refused).""" + if prompt_len >= capacity: + raise ValueError(f"TTS input len {prompt_len} exceeds {capacity}") + return min(int(budget), int(capacity) - int(prompt_len)) + + +@dataclass(frozen=True) +class SilenceDefault: + """The server's silence prefill for a request without silence_prefill_frames: ZONOS3_SILENCE_PREFILL_FRAMES frames + (the registry default, 3 = 0.2 s, when unset or not an integer), off with ZONOS3_SILENCE_PREFILL_DEFAULT=0 / false / + no / off or 0 frames.""" + + frames: int + on: bool + + @property + def length(self) -> int: + return self.frames if self.on else 0 + + +def silence_prefill_default() -> SilenceDefault: + try: + frames = max(0, int(os.environ.get("ZONOS3_SILENCE_PREFILL_FRAMES", str(SILENCE_PREFILL_DEFAULT_FRAMES)))) + except ValueError: + frames = SILENCE_PREFILL_DEFAULT_FRAMES + on = os.environ.get("ZONOS3_SILENCE_PREFILL_DEFAULT", "1").strip().lower() not in ("0", "false", "no", "off") + return SilenceDefault(frames, on and frames > 0) + + +def silence_prefill_frames(requested, *, available: bool = True) -> int: + """R6: the silence prefill length of a request. An explicit silence_prefill_frames must be an integer in + 0..registry max (never clamped); None = the server default (``silence_prefill_default``); 0 on a codec without + silence frames.""" + if requested is not None: + try: + frames = int(requested) + valid = not isinstance(requested, bool) and frames == requested + except (TypeError, ValueError): + valid = False + if not valid or not 0 <= frames <= SILENCE_PREFILL_MAX_FRAMES: + raise ValueError(f"silence_prefill_frames must be 0..{SILENCE_PREFILL_MAX_FRAMES}") + if not available: + return 0 + return silence_prefill_default().length if requested is None else frames + + +def reference_frame_limit(max_seconds: float, hop: int, sample_rate: int) -> int: + """R7 on a torch checkpoint: the reference prefix frames its ``speaker_reference_max_seconds`` holds.""" + return int(float(max_seconds) * int(sample_rate) // int(hop)) + + +def reference_codes(ctx: RulesContext, codes) -> torch.Tensor | None: + """R7: inline ``speaker_reference_codes`` ([frames, n_codebooks] codec ids) as int32, cut to their first + ``ctx.reference_max_frames`` frames; None when the request has none.""" + if codes is None: + return None + try: + tensor = torch.as_tensor(codes, dtype=torch.int32) + except (TypeError, ValueError, RuntimeError): + raise ValueError("speaker_reference_codes must be a non-empty [frames, codebooks] list") from None + if tensor.ndim != 2 or tensor.shape[0] == 0 or tensor.shape[1] != int(ctx.n_codebooks): + raise ValueError("speaker_reference_codes must be a non-empty [frames, codebooks] list") + if bool((tensor < 0).any()): + raise ValueError("speaker_reference_codes must be non-negative") + if bool((tensor >= int(ctx.codebook_size)).any()): + raise ValueError(f"speaker_reference_codes must be codec ids in [0, {int(ctx.codebook_size) - 1}]") + return truncate_reference(tensor, ctx.reference_max_frames) + + +def truncate_reference(codes: torch.Tensor, limit: int) -> torch.Tensor: + """R7: reference codes [frames, n_codebooks] cut to their first ``limit`` frames (never refused).""" + return codes[: int(limit)].contiguous() + + +def decode_context_codes(codes: torch.Tensor | None, decode_context: bool, frames) -> torch.Tensor | None: + """R8: the reference tail decoded as left context: the last ``frames`` (None or 0 = the registry's) frames of the + reference codes, at most all of them; None without decode_context or reference codes.""" + if not decode_context or codes is None: + return None + k = max(0, min(int(frames or DECODE_CONTEXT_FRAMES), int(codes.shape[0]))) + return codes[int(codes.shape[0]) - k:] if k > 0 else None + + +def resolve_accent(names: Sequence[str], accent, strength) -> tuple[str, float] | None: + """R9: (adapter, strength) of a request's accent; None for the base model.""" + if accent is None or accent == "" or accent == "none": + return None + if accent not in names: + loaded = ", ".join(names) or "none (load accent adapters)" + raise ValueError(f"Unknown accent {accent!r}; loaded accents: {loaded}.") + strength = float(strength) + if not math.isfinite(strength): + raise ValueError(f"accent_strength must be finite, got {strength!r}.") + return accent, strength + + +def validate_phoneme_groups(spec: dict | None, text: str) -> None: + """R13: the text's pronunciation groups (U+E000 phonemes U+E001) need phoneme tokens and must parse.""" + from zonos3.tts.superbpe import PHONEME_CLOSE, PHONEME_OPEN, payload_ids + + phonemes = None if spec is None else spec.get("phonemes") + open_, close = (PHONEME_OPEN, PHONEME_CLOSE) if phonemes is None else (phonemes["open_marker"], phonemes["close_marker"]) + if open_ not in text and close not in text: + return + if phonemes is None: + raise ValueError("This checkpoint has no phoneme tokens: remove the U+E000 / U+E001 pronunciation groups") + try: + payload_ids(text, spec) + except ValueError as exc: + raise ValueError(f"Pronunciation groups: {exc}") from exc + + +def check_laci(ctx: RulesContext, req: Request, language: str, *, duration_target: bool = False) -> None: + """R14: a laci=true request needs alignment heads for its language and no CFG; a LACI duration target (a dub + take) needs laci=true.""" + if not req.laci: + if duration_target: + raise ValueError("A LACI duration target needs laci=true") + return + heads = ctx.laci_languages + if not heads: + raise ValueError("LACI is not enabled on this server (start it with --laci-heads LANG=PATH)") + if language not in heads: + raise ValueError(f"No LACI alignment heads for language {language!r} (configured: {', '.join(sorted(heads))})") + if float(req.speaker_cfg_scale) != 1.0 or float(req.controls_cfg_scale) != 1.0: + raise ValueError("LACI needs speaker_cfg_scale = controls_cfg_scale = 1") + if float(req.tag_cfg_scale) != 1.0: + raise ValueError("LACI needs tag_cfg_scale = 1") + + +@dataclass(frozen=True) +class RequestHead: + """What the server needs before it resolves the speaker inputs: the speaker mode and the condition bucket ids.""" + + mode: str | None + condition_ids: list[int] | None + + +def request_head(ctx: RulesContext, req: Request) -> RequestHead: + """R1 tag CFG, R2 the speaker mode, R3 the condition rows.""" + validate_tag_cfg(req.text, req.tag_cfg_scale, speaker_cfg_scale=req.speaker_cfg_scale, + controls_cfg_scale=req.controls_cfg_scale) + mode = resolve_speaker_mode(ctx.speaker_modes, req.speaker_mode) + return RequestHead(mode, resolve_condition_buckets(ctx, req.condition_buckets, req.condition_values)) + + +@dataclass +class Rules: + """A request that passed every rule, with what the rules resolved (everything but the prompt rows).""" + + request: Request + speaker: Speaker + language: str + condition_ids: list[int] | None + max_tokens: int # the budget before the prompt shrinks it (R5) + silence_frames: int # 0 = no silence prefill (R6) + accent: tuple[str, float] | None + embedding: torch.Tensor | None # the speaker row's vector after the raw-space controls + sources: tuple[int, ...] # steered Full AttnRes bank sources + hidden_delta: torch.Tensor | None # constant hidden delta, flattened per source + schedule: torch.Tensor | None # span schedule [K, 3 + len(sources) * dim] + follow_chars: list[list[int]] | None # character range of every schedule row (control_span_follow "reading") + follow_gate: list[float] | None # [lead, lag] + cfg_kind: str | None # "speaker" | "controls" | "tag" + cfg_scale: float + seed: int + + +def request_rules(ctx: RulesContext, req: Request, head: RequestHead, speaker: Speaker, *, hidden_delta=None, + edit: bool = False, duration_target: bool = False) -> Rules: + """R4-R16 for the speaker inputs the server resolved for ``head.mode``. ``hidden_delta``: a server-side steering + delta added to the request's (a speech-edit region's); ``edit``: a speech-edit region (no silence prefill, no span + follow); ``duration_target``: the request carries a LACI duration target (a dub take).""" + language = languages.normalize(req.language) + max_tokens = max_tokens_budget(req.max_tokens, ctx.max_frames) + silence = 0 if edit else silence_prefill_frames(req.silence_prefill_frames, available=ctx.silence_available) + accent = resolve_accent(ctx.accent_names, req.accent, req.accent_strength) + embedding = speaker.embedding + sources = tuple(ctx.steering_sources) + delta = schedule = span_chars = None + if req.controls or req.control_spans: + if ctx.steer_bundle is None: + raise ValueError(f"This server has no steering bundle ({ctx.steer_hint}); `controls` are unavailable.") + resolved = resolve_controls(ctx.steer_bundle, req.controls, list(req.control_spans or []), text=req.text, + speaker_embedding=embedding, sources=sources, hidden_size=int(ctx.hidden_size), + frames_per_char=req.control_span_rate) + embedding, delta, schedule, span_chars = (resolved.speaker_embedding, resolved.hidden_delta, resolved.schedule, + resolved.span_chars) + if hidden_delta is not None: + delta = hidden_delta if delta is None else delta + hidden_delta + # R11: spans that follow the reading position need the language's alignment heads (else the character rate) + follow_chars = follow_gate = None + if req.control_span_follow == "reading" and span_chars and language in ctx.laci_languages and not edit: + default = FollowConfig() + follow_gate = [default.lead if req.control_span_lead is None else float(req.control_span_lead), + default.lag if req.control_span_lag is None else float(req.control_span_lag)] + follow_chars = [[int(a), int(b)] for a, b in span_chars] + # R12: one CFG twin per request (tag CFG's exclusivity is R1's); controls CFG needs a hidden delta and a speaker row + cfg_kind, cfg_scale = None, 1.0 + if float(req.speaker_cfg_scale) != 1.0: + has_reference = speaker.mode == "reference" and ( + speaker.reference_codes is not None or speaker.reference_audio is not None) + has_embedding = speaker.mode == "embedding" and embedding is not None + if not (has_reference or has_embedding): + raise ValueError("Speaker CFG needs a speaker prompt: speaker_mode=reference with reference audio or codes, " + "or speaker_mode=embedding with a clip or an embedding") + if float(req.controls_cfg_scale) != 1.0: + raise ValueError("Speaker and controls CFG cannot be combined") + cfg_kind, cfg_scale = "speaker", float(req.speaker_cfg_scale) + elif float(req.tag_cfg_scale) > 1.0: + cfg_kind, cfg_scale = "tag", float(req.tag_cfg_scale) + elif delta is not None and embedding is not None and float(req.controls_cfg_scale) != 1.0: + cfg_kind, cfg_scale = "controls", float(req.controls_cfg_scale) + validate_phoneme_groups(ctx.text_tokenizer_spec, req.text) + check_laci(ctx, req, language, duration_target=duration_target) + seed = int(req.seed) if req.seed is not None else secrets.randbelow(2**31) + return Rules(request=req, speaker=speaker, language=language, condition_ids=head.condition_ids, + max_tokens=max_tokens, silence_frames=silence, accent=accent, embedding=embedding, sources=sources, + hidden_delta=delta, schedule=schedule, follow_chars=follow_chars, follow_gate=follow_gate, + cfg_kind=cfg_kind, cfg_scale=cfg_scale, seed=seed) + + +# ----------------------------------------------------------------------------------------------------- the rows + + +@dataclass +class Branch: + """One LM input: the prompt rows, the speaker row (embedding replacing row ``speaker_row``; -1 = none), the + condition rows (bucket ids from ``condition_token_start``), and whether the request's hidden steering (constant + delta, span schedule / follower) applies to its generated frames.""" + + input_ids: torch.Tensor + speaker_embedding: torch.Tensor | None = None + speaker_row: int = -1 + condition_values: list[int] | None = None + condition_token_start: int = -1 + steered: bool = True + + def speaker_rows(self) -> dict | None: + return None if self.speaker_embedding is None else {self.speaker_row: self.speaker_embedding} + + def condition_rows(self) -> dict | None: + if self.condition_values is None or self.condition_token_start < 0: + return None + return {self.condition_token_start + i: int(v) for i, v in enumerate(self.condition_values)} + + +@dataclass +class TwinMsg: + """The fields zonos3.speaker_cfg.speaker_cfg_twin reads from a request.""" + + input_ids: torch.Tensor + speaker_reference_prefix_length: int + speaker_embedding: torch.Tensor | None + speaker_token_position: int + + +@dataclass +class PromptPlan: + request: Request + text: str # normalized text + language: str + cond: Branch + twin: Branch | None + cfg_kind: str | None # "speaker" | "controls" | "tag" + cfg_scale: float + reference_prefix_length: int + prefill_rows: torch.Tensor | None # [P, n_codebooks + 1] silence rows ending the prompt + context_codes: torch.Tensor | None # [K, n_codebooks] reference tail decoded as left context + sources: tuple[int, ...] # steered Full AttnRes bank sources + hidden_delta: torch.Tensor | None # constant hidden delta, flattened per source + schedule: torch.Tensor | None # span schedule [K, 3 + len(sources) * dim] + follow_tokens: list[list[int]] | None # token ranges of the schedule rows (control_span_follow "reading") + follow_gate: list[float] | None + accent: tuple[str, float] | None # adapter accent and strength + max_tokens: int + seed: int + laci: str | None # LACI head key (the language) + + @property + def speaker_rows(self) -> int: + """Leading rows before the condition rows: the reference prefix, or the speaker row.""" + return self.reference_prefix_length + (1 if self.cond.speaker_embedding is not None else 0) + + def cond_json(self, branch: Branch | None = None) -> dict: + """The ``.cond.json`` sidecar of ``zonos3-cli --build-prompt`` (servers/ggml/src/zonos3-cond-io.h).""" + b = self.cond if branch is None else branch + doc: dict = {"speaker_row": b.speaker_row if b.speaker_embedding is not None else -1} + if doc["speaker_row"] >= 0: + doc["speaker_embedding"] = [float(v) for v in b.speaker_embedding.reshape(-1).tolist()] + doc["condition_row"] = b.condition_token_start if b.condition_values is not None else -1 + doc["condition_buckets"] = [int(v) for v in (b.condition_values or [])] + # the speaker-CFG twin drops the reference prefix / speaker row; the tag and controls twins keep them + doc["speaker_rows"] = 0 if b is not self.cond and self.cfg_kind == "speaker" else self.speaker_rows + doc["prefill_frames"] = 0 if self.prefill_rows is None else int(len(self.prefill_rows)) + return doc + + +def text_rows(builder: TTSPromptBuilder, text: str, *, silence: torch.Tensor | None = None, edit=None, + span_end_id: int | None = None, quality_buckets=None) -> torch.Tensor: + """The text rows of a prompt and what follows them: a speech-edit region's layout (``edit``: its window + ``codes``, ``spans`` and the ``fills`` so far; needs ``span_end_id``), else the silence prefill rows.""" + prompt = builder.build(text, quality_buckets=quality_buckets) + if edit is not None: + from zonos3.tts.edit import edit_prompt_tokens + + if span_end_id is None: + raise ValueError("Speech editing needs a checkpoint with a span-end audio token") + return edit_prompt_tokens(prompt, edit.codes, edit.spans, edit.fills, builder.config, span_end_id=span_end_id) + return prompt if silence is None else torch.cat((prompt, silence.to(prompt.dtype)), dim=0) + + +@dataclass +class PromptRows: + """A prompt in the training layout ``[reference prefix | speaker row][condition rows] text rows``.""" + + input_ids: torch.Tensor + reference_prefix_length: int + speaker_row: int # 0 with a speaker row, else -1 + condition_token_start: int # the first condition row; -1 without condition rows + + def with_text(self, text_rows: torch.Tensor, plain_rows: torch.Tensor) -> torch.Tensor: + """The tag-CFG twin: these rows with the trailing ``text_rows`` replaced by the plain text's rows.""" + lead = len(self.input_ids) - len(text_rows) + if lead < 0 or not torch.equal(self.input_ids[lead:], text_rows.to(self.input_ids.dtype)): + raise ValueError("Tag CFG: the prompt does not end with its text rows") + return torch.cat((self.input_ids[:lead], plain_rows.to(self.input_ids.dtype)), dim=0) + + +def prompt_rows(builder: TTSPromptBuilder, text_rows: torch.Tensor, *, condition_count: int, + reference_codes: torch.Tensor | None, speaker_row: bool) -> PromptRows: + """The rows in front of ``text_rows``: ``condition_count`` condition rows, the reference prefix of + ``reference_codes`` and the speaker row (``speaker_row``), in that order towards the start.""" + t = text_rows + if condition_count: + t = torch.cat((builder.condition_rows(condition_count, dtype=t.dtype, device=t.device), t), dim=0) + prefix_length = 0 + if reference_codes is not None: + prefix = builder.speaker_reference_prefix(reference_codes) + prefix_length = len(prefix) + t = torch.cat((prefix.to(t.dtype), t), dim=0) + if speaker_row: + t = torch.cat((builder.speaker_slot(dtype=t.dtype, device=t.device), t), dim=0) + start = prefix_length + (1 if speaker_row else 0) if condition_count else -1 + return PromptRows(t, prefix_length, 0 if speaker_row else -1, start) + + +def build_prompt(ctx: PromptContext, rules: Rules, *, edit=None) -> PromptPlan: + """The prompt rows, conditioning and CFG twin of a request that passed ``request_rules``. ``edit``: a speech-edit + region (``text_rows``); its rules must have been resolved with ``edit=True``.""" + req, speaker = rules.request, rules.speaker + builder = ctx.prompt_builder() + text = ctx.normalize_text(req.text, rules.language, bool(req.text_normalization)) + silence = None + if rules.silence_frames > 0: + silence = silence_rows_from_codes(ctx.silence_frame(), rules.silence_frames, builder.config).to(torch.int32) + + def rows_of(t: str) -> torch.Tensor: + return text_rows(builder, t, silence=silence, edit=edit, span_end_id=ctx.span_end_id) + + tagged = rows_of(text) + follow_tokens = None + if rules.follow_chars is not None: + from zonos3.tts.span_follow import span_token_ranges + + follow_tokens = [list(r) for r in span_token_ranges(req.text, text, [tuple(x) for x in rules.follow_chars], + builder.config.text_tokenizer_spec)] + codes = speaker.reference_codes + embedding = rules.embedding + rows = prompt_rows(builder, tagged, condition_count=len(rules.condition_ids or ()), reference_codes=codes, + speaker_row=embedding is not None) + t = rows.input_ids + cond = Branch(t.to(torch.int32), embedding, rows.speaker_row, rules.condition_ids, rows.condition_token_start) + twin = None + if rules.cfg_kind == "speaker": + msg = TwinMsg(t, rows.reference_prefix_length, embedding, max(rows.speaker_row, 0)) + spec = speaker_cfg_twin(msg, t, n_codebooks=ctx.n_codebooks, audio_pad_id=ctx.audio_pad_id, + text_vocab=ctx.text_vocab, speaker_token_position=max(rows.speaker_row, 0), + condition_values=rules.condition_ids, condition_token_start=rows.condition_token_start, + condition_unknowns=tuple(ctx.condition_bucket_counts)) + twin = Branch(spec.input_ids.to(torch.int32), None, -1, spec.condition_values, spec.condition_token_start) + elif rules.cfg_kind == "tag": + twin = replace(cond, input_ids=rows.with_text(tagged, rows_of(strip_nonverbal_markup(text))).to(torch.int32)) + elif rules.cfg_kind == "controls": + twin = replace(cond, steered=False) + prompt_len = max(len(cond.input_ids), 0 if twin is None else len(twin.input_ids)) + return PromptPlan( + request=req, text=text, language=rules.language, cond=cond, twin=twin, cfg_kind=rules.cfg_kind, + cfg_scale=rules.cfg_scale, reference_prefix_length=rows.reference_prefix_length, prefill_rows=silence, + context_codes=decode_context_codes(codes, bool(req.decode_context), req.decode_context_frames), + sources=rules.sources, hidden_delta=rules.hidden_delta, schedule=rules.schedule, follow_tokens=follow_tokens, + follow_gate=rules.follow_gate, accent=rules.accent, + max_tokens=fit_max_tokens(rules.max_tokens, prompt_len, ctx.max_seqlen), seed=rules.seed, + laci=rules.language if req.laci else None, + ) + + +def plan_prompt(ctx: PromptContext, request: Mapping, resolve_speaker: Callable[[Request, str | None], Speaker], *, + hidden_delta=None, edit=None, duration_target: bool = False) -> PromptPlan: + """``request_head``, the server's ``resolve_speaker(request, mode)``, ``request_rules`` and ``build_prompt``.""" + req = parse_request(request) + head = request_head(ctx, req) + speaker = resolve_speaker(req, head.mode) + rules = request_rules(ctx, req, head, speaker, hidden_delta=hidden_delta, edit=edit is not None, + duration_target=duration_target) + return build_prompt(ctx, rules, edit=edit) diff --git a/zonos3/tts/probe.py b/zonos3/tts/probe.py new file mode 100644 index 0000000000000000000000000000000000000000..bc9c6062da8fa37bb9bf389a55f854b695a905e2 --- /dev/null +++ b/zonos3/tts/probe.py @@ -0,0 +1,86 @@ +"""Alignment-probe math shared by the servers and the reference: head weights, text windows and the readout. + +Positions are indices into the text span: 0 is the BOS row, ``text_len - 1`` the EOS row. +""" + +from __future__ import annotations + +import numpy as np +import torch + +Head = tuple[int, int] # (layer_id, q_head) + +_ATTENTION_LAYERS: set[int] = set() + + +def register_attention_layer(layer_id: int) -> None: + _ATTENTION_LAYERS.add(int(layer_id)) + + +def attention_layers() -> tuple[int, ...]: + return tuple(sorted(_ATTENTION_LAYERS)) + + +def clip_window(window: tuple[int, int], text_len: int) -> tuple[int, int]: + lo = max(0, min(int(window[0]), text_len - 1)) + return lo, min(text_len - 1, max(int(window[1]), lo)) + + +def locate_text_span(input_ids: torch.Tensor, n_codebooks: int, bos: int = 2, eos: int = 3) -> tuple[int, int]: + """(start, length) of the BOS..EOS text rows of a prompt, read from the text column (index ``n_codebooks``).""" + text = input_ids[:, n_codebooks] + starts = (text == bos).nonzero() + if starts.numel() == 0: + raise ValueError(f"no text BOS row (id {bos}) in the prompt") + start = int(starts[0]) + ends = (text[start + 1 :] == eos).nonzero() + if ends.numel() == 0: + raise ValueError(f"no text EOS row (id {eos}) after BOS in the prompt") + end = start + 1 + int(ends[0]) + if bool((text[start + 1 : end] < 4).any()): + raise ValueError("a row strictly inside the text span has a special text id (< 4)") + return start, end - start + 1 + + +def probe_weight(heads: tuple[Head, ...], layers: tuple[int, ...], n_heads: int) -> np.ndarray: + """[len(layers), n_heads] float32 head weights: 1 on every probed head.""" + w = np.zeros((len(layers), n_heads), dtype=np.float32) + for layer, head in heads: + if layer not in layers or not 0 <= head < n_heads: + raise ValueError(f"align probe head {(layer, head)} is not an attention head of this model") + w[layers.index(layer), head] = 1.0 + return w + + +def readout( + q: torch.Tensor, + text_keys: torch.Tensor, + heads: tuple[int, ...], + weights: np.ndarray | torch.Tensor, + windows: dict[Head, tuple[int, int]] | None, + scale: float, +) -> tuple[int, float]: + """Text-attention readout of one decode row (the single-request form of the batched server readout). + + q [L, H, D]: the row's queries at the attention layers ``heads`` (layer ids, in order); text_keys [L, T, KV, D]: + the keys of the BOS..EOS text rows at those layers; weights [L, H]: head weights (``probe_weight``); windows: + per-head inclusive text windows (masked heads read a window-renormalized distribution), or None. + Returns (argmax, centroid) of the weighted sum of the per-head text distributions.""" + n_layers, n_heads, head_dim = q.shape + text_len, kv = text_keys.shape[1], text_keys.shape[2] + w = torch.as_tensor(np.asarray(weights, dtype=np.float32)).to(q.device) + ar = torch.arange(text_len, device=q.device) + lo = torch.zeros((n_layers, n_heads), dtype=torch.long, device=q.device) + hi = torch.full((n_layers, n_heads), text_len - 1, dtype=torch.long, device=q.device) + for (layer, head), window in (windows or {}).items(): + lo[heads.index(layer), head], hi[heads.index(layer), head] = clip_window(window, text_len) + acc = torch.zeros(text_len, dtype=torch.float32, device=q.device) + for s in range(n_layers): + logits = torch.einsum( + "kgd,lkd->kgl", q[s].float().view(kv, n_heads // kv, head_dim), text_keys[s].float() + ).reshape(n_heads, text_len) * float(scale) + allowed = (ar[None, :] >= lo[s, :, None]) & (ar[None, :] <= hi[s, :, None]) + p = torch.softmax(logits.masked_fill(~allowed, float("-inf")), dim=-1) + acc = acc + (p * w[s, :, None]).sum(0) + m = (acc * ar).sum() / acc.sum().clamp_min(1e-30) + return int(acc.argmax()), float(m) diff --git a/zonos3/tts/prompt.py b/zonos3/tts/prompt.py new file mode 100644 index 0000000000000000000000000000000000000000..3a0fc1cb01760b0820efc64b6c63a2ca62cef21b --- /dev/null +++ b/zonos3/tts/prompt.py @@ -0,0 +1,472 @@ +from __future__ import annotations + +from dataclasses import dataclass + +import torch + +PAD_ID, UNK_ID, BOS_ID, EOS_ID = 0, 1, 2, 3 +SPECIAL_TOKEN_IDS = (PAD_ID, UNK_ID, BOS_ID, EOS_ID) + +# 192 legacy symbol IDs followed by 256 byte IDs. +# With 21 speaking-rate buckets, text_vocab is 469: +# bytes occupy 192..447, rate buckets occupy 448..468, and 469 is text padding. +LEGACY_SYMBOL_VOCAB_SIZE = 192 +BYTE_VOCAB_SIZE = 256 +BYTE_TEXT_VOCAB_SIZE = LEGACY_SYMBOL_VOCAB_SIZE + BYTE_VOCAB_SIZE + + +@dataclass(frozen=True) +class TTSPromptConfig: + n_codebooks: int = 9 + codebook_sizes: tuple[int, ...] | None = None + audio_pad_id: int = 1025 + text_vocab: int = BYTE_TEXT_VOCAB_SIZE + text_tokenizer_spec: dict | None = None + speaking_rate_num_buckets: int = 0 + quality_bucket_counts: tuple[int, ...] = () + speaker_background_num_buckets: int = 0 + accurate_mode_num_buckets: int = 0 + + def __post_init__(self) -> None: + n_codebooks = int(self.n_codebooks) + audio_pad_id = int(self.audio_pad_id) + if self.text_vocab is None: + raise ValueError("text_vocab is required for TTS prompt construction.") + text_vocab = int(self.text_vocab) + speaking_rate_num_buckets = int(self.speaking_rate_num_buckets) + quality_bucket_counts = _normalize_quality_bucket_counts(self.quality_bucket_counts) + speaker_background_num_buckets = int(self.speaker_background_num_buckets) + accurate_mode_num_buckets = int(self.accurate_mode_num_buckets) + + if n_codebooks <= 0: + raise ValueError("n_codebooks must be positive.") + if audio_pad_id < 0: + raise ValueError("audio_pad_id must be non-negative.") + if speaking_rate_num_buckets < 0: + raise ValueError("speaking_rate_num_buckets must be non-negative.") + if speaker_background_num_buckets < 0: + raise ValueError("speaker_background_num_buckets must be non-negative.") + if accurate_mode_num_buckets < 0: + raise ValueError("accurate_mode_num_buckets must be non-negative.") + + if text_vocab < BYTE_TEXT_VOCAB_SIZE: + raise ValueError( + "text_vocab must include the byte vocabulary; " + f"expected at least {BYTE_TEXT_VOCAB_SIZE}, got {text_vocab}." + ) + # Validates that all conditioning buckets fit inside text_vocab. + _conditioning_base_text_vocab( + text_vocab, + speaking_rate_num_buckets, + quality_bucket_counts, + speaker_background_num_buckets, + accurate_mode_num_buckets, + context="TTS prompt construction", + ) + + object.__setattr__(self, "n_codebooks", n_codebooks) + object.__setattr__(self, "audio_pad_id", audio_pad_id) + object.__setattr__(self, "text_vocab", text_vocab) + object.__setattr__(self, "speaking_rate_num_buckets", speaking_rate_num_buckets) + object.__setattr__(self, "quality_bucket_counts", quality_bucket_counts) + object.__setattr__(self, "speaker_background_num_buckets", speaker_background_num_buckets) + object.__setattr__(self, "accurate_mode_num_buckets", accurate_mode_num_buckets) + + +def byte_text_vocab_size() -> int: + return BYTE_TEXT_VOCAB_SIZE + + +def conditioned_text_vocab_size( + speaking_rate_num_buckets: int = 0, + quality_num_buckets: int = 0, + speaker_background_num_buckets: int = 0, + accurate_mode_num_buckets: int = 0, +) -> int: + counts = ( + int(speaking_rate_num_buckets), + int(quality_num_buckets), + int(speaker_background_num_buckets), + int(accurate_mode_num_buckets), + ) + if any(count < 0 for count in counts): + raise ValueError("conditioning bucket counts must be non-negative.") + return BYTE_TEXT_VOCAB_SIZE + sum(counts) + + +def text_to_byte_ids(text: str) -> list[int]: + return [BOS_ID, *(byte + LEGACY_SYMBOL_VOCAB_SIZE for byte in text.encode("utf-8")), EOS_ID] + + +def _normalize_quality_bucket_counts(quality_bucket_counts) -> tuple[int, ...]: + counts = tuple(int(count) for count in (quality_bucket_counts or ())) + if any(count < 0 for count in counts): + raise ValueError("quality_bucket_counts must be non-negative.") + return counts + + +def _conditioning_base_text_vocab( + text_vocab: int | None, + speaking_rate_num_buckets: int, + quality_bucket_counts=(), + speaker_background_num_buckets: int = 0, + accurate_mode_num_buckets: int = 0, + *, + context: str, +) -> int: + """First conditioning token id; everything below it is normal text vocabulary. + + Conditioning tokens occupy the tail of the text vocabulary in this order: + speaking-rate buckets (legacy checkpoints; never emitted, but they still + shift the ids after them), quality buckets (per feature), speaker-background + markers (clean, noisy), accurate-mode marker. text_vocab itself is padding. + """ + if text_vocab is None: + raise ValueError(f"text_vocab is required for {context}.") + + counts = _normalize_quality_bucket_counts(quality_bucket_counts) + base_text_vocab = ( + int(text_vocab) + - int(speaking_rate_num_buckets) + - sum(counts) + - int(speaker_background_num_buckets) + - int(accurate_mode_num_buckets) + ) + if base_text_vocab < 0: + raise ValueError( + "text_vocab is smaller than the configured conditioning buckets; " + "cannot locate conditioning tokens." + ) + return base_text_vocab + + +def quality_token_id( + text_vocab: int | None, + speaking_rate_num_buckets: int, + quality_bucket_counts, + feature_idx: int, + quality_bucket: int, + speaker_background_num_buckets: int = 0, + accurate_mode_num_buckets: int = 0, +) -> int: + counts = _normalize_quality_bucket_counts(quality_bucket_counts) + if not counts: + raise ValueError("Current model does not define quality buckets.") + + feature = int(feature_idx) + if feature < 0 or feature >= len(counts): + raise ValueError(f"quality feature index must be in [0, {len(counts) - 1}], got {feature}.") + + num_buckets = counts[feature] + if num_buckets <= 0: + raise ValueError(f"quality feature {feature} does not define buckets.") + + bucket = int(quality_bucket) + if bucket < 0 or bucket >= num_buckets: + raise ValueError( + f"quality bucket for feature {feature} must be in [0, {num_buckets - 1}], got {bucket}." + ) + + base_text_vocab = _conditioning_base_text_vocab( + text_vocab, + speaking_rate_num_buckets, + counts, + speaker_background_num_buckets, + accurate_mode_num_buckets, + context="quality conditioning", + ) + return ( + base_text_vocab + + int(speaking_rate_num_buckets) + + sum(counts[:feature]) + + bucket + ) + + +def speaker_background_token_id( + text_vocab: int | None, + speaking_rate_num_buckets: int, + quality_bucket_counts, + clean: bool, + speaker_background_num_buckets: int = 2, + accurate_mode_num_buckets: int = 0, +) -> int: + """Token id for the clean/noisy speaker-background marker.""" + num_buckets = int(speaker_background_num_buckets) + if num_buckets < 2: + raise ValueError( + "speaker_background_num_buckets must be at least 2 for background tokens." + ) + + counts = _normalize_quality_bucket_counts(quality_bucket_counts) + base_text_vocab = _conditioning_base_text_vocab( + text_vocab, + speaking_rate_num_buckets, + counts, + num_buckets, + accurate_mode_num_buckets, + context="speaker-background conditioning", + ) + return ( + base_text_vocab + + int(speaking_rate_num_buckets) + + sum(counts) + + (0 if bool(clean) else 1) + ) + + +def accurate_mode_token_id( + text_vocab: int | None, + speaking_rate_num_buckets: int, + quality_bucket_counts, + speaker_background_num_buckets: int = 2, + accurate_mode_num_buckets: int = 1, +) -> int: + """Token id for the accurate-mode marker (absent = expressive mode).""" + accurate_count = int(accurate_mode_num_buckets) + if accurate_count <= 0: + raise ValueError("accurate_mode_num_buckets must be positive.") + background_count = int(speaker_background_num_buckets) + if background_count < 2: + raise ValueError( + "speaker_background_num_buckets must be at least 2 for accurate-mode tokens." + ) + + counts = _normalize_quality_bucket_counts(quality_bucket_counts) + base_text_vocab = _conditioning_base_text_vocab( + text_vocab, + speaking_rate_num_buckets, + counts, + background_count, + accurate_count, + context="accurate-mode conditioning", + ) + return ( + base_text_vocab + + int(speaking_rate_num_buckets) + + sum(counts) + + background_count + ) + + +def tokens_to_prompt_tokens( + tokens: list[int], + n_codebooks: int = 9, + audio_pad_id: int = 1025, + text_vocab: int | None = None, + speaking_rate_num_buckets: int = 0, + quality_bucket_counts=(), + quality_buckets=None, + speaker_background_num_buckets: int = 0, + accurate_mode_num_buckets: int = 0, +) -> list[list[int]]: + quality_bucket_counts = _normalize_quality_bucket_counts(quality_bucket_counts) + if text_vocab is None: + text_vocab = conditioned_text_vocab_size( + speaking_rate_num_buckets, + sum(quality_bucket_counts), + speaker_background_num_buckets, + accurate_mode_num_buckets, + ) + config = TTSPromptConfig( + n_codebooks=n_codebooks, + audio_pad_id=audio_pad_id, + text_vocab=text_vocab, + speaking_rate_num_buckets=speaking_rate_num_buckets, + quality_bucket_counts=quality_bucket_counts, + speaker_background_num_buckets=speaker_background_num_buckets, + accurate_mode_num_buckets=accurate_mode_num_buckets, + ) + return _text_rows(tokens, config, quality_buckets=quality_buckets) + + +def text_to_prompt_tokens( + text: str, + n_codebooks: int = 9, + audio_pad_id: int = 1025, + text_vocab: int | None = None, + speaking_rate_num_buckets: int = 0, + quality_bucket_counts=(), + quality_buckets=None, + speaker_background_num_buckets: int = 0, + accurate_mode_num_buckets: int = 0, +) -> list[list[int]]: + return tokens_to_prompt_tokens( + text_to_byte_ids(text), + n_codebooks=n_codebooks, + audio_pad_id=audio_pad_id, + text_vocab=text_vocab, + speaking_rate_num_buckets=speaking_rate_num_buckets, + quality_bucket_counts=quality_bucket_counts, + quality_buckets=quality_buckets, + speaker_background_num_buckets=speaker_background_num_buckets, + accurate_mode_num_buckets=accurate_mode_num_buckets, + ) + + +def shear(x: torch.Tensor, pad: int) -> torch.Tensor: + T, C = x.shape + padded = x.new_full((C - 1 + T, C), pad) + padded[C - 1 :] = x + row_idx = (C - 1) + torch.arange(T, device=x.device).unsqueeze(1) - torch.arange( + C, device=x.device + ) + return padded.gather(0, row_idx) + + +def silence_rows_from_codes(frame: torch.Tensor, frames: int, config: TTSPromptConfig) -> torch.Tensor: + """Codec-matched silence prefill (2026-10-17): `frames` copies of one silence frame as the first rows of the audio + stream in the training layout (sheared, WITHOUT the flushed tail, so the LM continues the delay pattern from the + next row), text column = the text pad.""" + frames = int(frames) + if frames < 1: + raise ValueError("silence_prefill_frames must be >= 1") + codes = frame.to(torch.int32).reshape(1, -1) + if codes.shape[1] != config.n_codebooks: + raise ValueError(f"silence frame has {codes.shape[1]} codebooks, the model {config.n_codebooks}") + sheared = shear(codes.repeat(frames, 1), config.audio_pad_id)[:frames] + text_col = torch.full((frames, 1), config.text_vocab, dtype=torch.int32) + return torch.cat([sheared, text_col], dim=1) + + +def speaker_reference_prefix_tokens( + codes: torch.Tensor, + config: TTSPromptConfig, +) -> torch.Tensor: + """Encode raw codec codes exactly like the training reference prefix. + + The reference is unsupervised context before the text prompt. Each codebook + is delayed by its index and the tail is flushed with ordinary audio padding; + there is intentionally no separator or learned boundary token. + """ + + if codes.ndim != 2 or codes.shape[1] != config.n_codebooks: + raise ValueError( + "Speaker-reference codes must have shape " + f"[time, {config.n_codebooks}], got {tuple(codes.shape)}." + ) + if codes.shape[0] == 0: + raise ValueError("Speaker-reference codes must not be empty.") + sizes = config.codebook_sizes or (1024,) * config.n_codebooks + if len(sizes) != config.n_codebooks or any(v <= 0 for v in sizes): + raise ValueError("Invalid speaker-reference codebook sizes.") + limits = torch.tensor(sizes, device=codes.device)[None, :] + if bool(torch.any(codes < 0)) or bool(torch.any(codes >= limits)): + raise ValueError("Speaker-reference codes exceed their codebook vocabulary.") + + length = codes.shape[0] + config.n_codebooks - 1 + audio_columns = torch.full( + (length, config.n_codebooks), + config.audio_pad_id, + dtype=torch.int32, + device=codes.device, + ) + audio_columns[: codes.shape[0]] = codes.to(dtype=torch.int32) + delayed = shear(audio_columns, config.audio_pad_id) + text_column = torch.full( + (length, 1), + config.text_vocab, + dtype=torch.int32, + device=codes.device, + ) + return torch.cat((delayed, text_column), dim=1) + + +def make_speaker_slot( + config: TTSPromptConfig, + *, + dtype: torch.dtype = torch.int32, + device: torch.device | str | None = None, +) -> torch.Tensor: + slot = torch.full((1, config.n_codebooks + 1), config.audio_pad_id, dtype=dtype, device=device) + slot[:, config.n_codebooks] = config.text_vocab + return slot + + +def _text_rows( + tokens: list[int], + config: TTSPromptConfig, + *, + quality_buckets=None, +) -> list[list[int]]: + rows: list[list[int]] = [] + if quality_buckets is not None: + for feature_idx, bucket in enumerate(quality_buckets): + if bucket is None: + continue + rows.append( + [config.audio_pad_id] * config.n_codebooks + + [ + quality_token_id( + config.text_vocab, + config.speaking_rate_num_buckets, + config.quality_bucket_counts, + feature_idx, + bucket, + config.speaker_background_num_buckets, + config.accurate_mode_num_buckets, + ) + ] + ) + + rows.extend([config.audio_pad_id] * config.n_codebooks + [token] for token in tokens) + return rows + + +class TTSPromptBuilder: + def __init__(self, config: TTSPromptConfig): + self.config = config + if config.text_tokenizer_spec is not None: + from .superbpe import validate_spec + validate_spec(config.text_tokenizer_spec, config.text_vocab) + + def text_ids(self, text): + if self.config.text_tokenizer_spec is not None: + from .superbpe import text_ids + return text_ids(text, self.config.text_tokenizer_spec) + return text_to_byte_ids(text) + + def build_text_prompt( + self, + text: str, + *, + quality_buckets=None, + ) -> torch.Tensor: + rows = _text_rows(self.text_ids(text), self.config, quality_buckets=quality_buckets) + return torch.tensor(rows, dtype=torch.int32) + + def build( + self, + text: str, + *, + quality_buckets=None, + ) -> torch.Tensor: + return self.build_text_prompt(text, quality_buckets=quality_buckets) + + def condition_rows( + self, + count: int, + *, + dtype: torch.dtype = torch.int32, + device: torch.device | str | None = None, + ) -> torch.Tensor: + """``count`` all-pad rows (audio pad on every codebook, text pad) for the loudness / fmax / speaking-rate + buckets of the cond3 finetunes; the model replaces their embeddings by the bucket tables.""" + rows = torch.full((int(count), self.config.n_codebooks + 1), self.config.audio_pad_id, dtype=dtype, device=device) + rows[:, self.config.n_codebooks] = self.config.text_vocab + return rows + + def speaker_slot( + self, + *, + dtype: torch.dtype = torch.int32, + device: torch.device | str | None = None, + ) -> torch.Tensor: + return make_speaker_slot(self.config, dtype=dtype, device=device) + + def speaker_reference_prefix(self, codes: torch.Tensor) -> torch.Tensor: + return speaker_reference_prefix_tokens(codes, self.config) + +# CONDITION_ROWS_RUNTIME_20261016 + +# DECODE_CONTEXT_RUNTIME_20261017 diff --git a/zonos3/tts/sampler.py b/zonos3/tts/sampler.py new file mode 100644 index 0000000000000000000000000000000000000000..dec25a0bb0dcddd788390ba9efcac10dabc081cb --- /dev/null +++ b/zonos3/tts/sampler.py @@ -0,0 +1,320 @@ +from __future__ import annotations + +import logging +from typing import List + +import torch +import torch.nn.functional as F + +logger = logging.getLogger(__name__) + +EOA_TOKEN = 1024 # End of audio token + + +def sample_logits_in_fp32(model_config) -> bool: + """GDN-family checkpoints (attention_pattern != "global") decode eagerly and are sampled from float32 logits, + like the training generator; ZONOS3_SAMPLE_FP32_LOGITS=1 forces it for every model.""" + import os + + pattern = str(getattr(model_config, "attention_pattern", "global")) + return pattern != "global" or os.environ.get("ZONOS3_SAMPLE_FP32_LOGITS") == "1" + + +def apply_top_p(probs: torch.Tensor, p: float) -> torch.Tensor: + """Apply nucleus (top-p) sampling to probabilities.""" + if p <= 0.0 or p >= 1.0: + return probs + probs_sort, probs_idx = torch.sort(probs, dim=-1, descending=True) + probs_sum = torch.cumsum(probs_sort, dim=-1) + mask = probs_sum - probs_sort > p + probs_sort = probs_sort.masked_fill(mask, 0.0) + probs = probs.scatter(-1, probs_idx, probs_sort) + probs = probs / probs.sum(dim=-1, keepdim=True).clamp(min=1e-8) + return probs + + +def apply_min_p(probs: torch.Tensor, min_p: float) -> torch.Tensor: + """Apply min-p filtering to probabilities.""" + if min_p <= 0.0: + return probs + top_probs, _ = probs.max(dim=-1, keepdim=True) + tokens_to_remove = probs < (min_p * top_probs) + probs = probs.masked_fill(tokens_to_remove, 0.0) + probs = probs / probs.sum(dim=-1, keepdim=True).clamp(min=1e-8) + return probs + + +def apply_repetition_penalty( + logits: torch.Tensor, + repetition_token_ids: torch.Tensor | None, + repetition_penalties: torch.Tensor | None, +) -> torch.Tensor: + """Apply a per-sequence repetition penalty to per-codebook logits. + + repetition_token_ids is shaped (B, n_codebooks, window). A token id in one + codebook only penalizes the matching codebook's logits. + """ + if repetition_token_ids is None or repetition_penalties is None: + return logits + if repetition_token_ids.numel() == 0: + return logits + + B, C, V = logits.shape + safe_token_ids = repetition_token_ids.clamp(min=0, max=V - 1).long() + valid = (repetition_token_ids >= 0) & (repetition_token_ids < V) + + counts = torch.zeros((B, C, V), dtype=torch.int32, device=logits.device) + counts.scatter_add_(-1, safe_token_ids, valid.to(torch.int32)) + repeated = counts > 0 + + penalties = repetition_penalties.view(B, 1, 1).clamp(min=1.0) + adjusted_logits = torch.where(logits > 0, logits / penalties, logits * penalties) + return torch.where(repeated, adjusted_logits, logits) + + +_debug_sample_count = 0 + + +def _compute_logit_stats_debug(logits: torch.Tensor) -> dict: + """Compute per-codebook stats matching reference format. + + Args: + logits: (B, n_codebooks, vocab) - uses first batch element + + Returns: + Dict with per-codebook stats: entropy, top1_prob, margin, top5_ids + """ + lg = logits[0].float() # (n_codebooks, vocab) + + probs = F.softmax(lg, dim=-1) + log_probs = F.log_softmax(lg, dim=-1) + + # Entropy: -sum(p * log(p)) + entropy = -(probs * log_probs).sum(dim=-1) + + # Top-k probs and ids + sorted_probs, sorted_indices = probs.sort(dim=-1, descending=True) + top1_prob = sorted_probs[:, 0] + top5_ids = sorted_indices[:, :5] + + # Logit margin (top1 - top2) + sorted_logits, _ = lg.sort(dim=-1, descending=True) + margin = sorted_logits[:, 0] - sorted_logits[:, 1] + + return { + "entropy": entropy.tolist(), + "top1_prob": top1_prob.tolist(), + "margin": margin.tolist(), + "top5_ids": top5_ids.tolist(), + } + + +def sample_tts( + logits: torch.Tensor, + temperatures: torch.Tensor, + top_ks: torch.Tensor, + top_ps: torch.Tensor, + min_ps: torch.Tensor, + *, + codebook_size: int, + audio_pad_id: int, + stop_token_ids: torch.Tensor, + repetition_token_ids: torch.Tensor | None = None, + repetition_penalties: torch.Tensor | None = None, + codebook_sizes: tuple[int, ...] | list[int] | None = None, + text_vocab: int = 0, + generators: list[torch.Generator | None] | None = None, + stop_blocked: torch.Tensor | None = None, +) -> List[List[int]]: + """Functional interface for TTS sampling. + + Args: + logits: Shape (B, n_codebooks, vocab_size) + temperatures: Per-sequence temperatures (B,) + top_ks: Per-sequence top-k values (B,) + top_ps: Per-sequence top-p values (B,) + min_ps: Per-sequence min-p values (B,) + codebook_size: Shared ordinary-code limit; ids below it are codec codes, + ids at or above it are special (EOA, padding, optional span-end). + audio_pad_id: Audio padding id; never sampled. + stop_token_ids: Per-sequence stop id (B,), the only special id each row + may sample (EOA for utterances, span-end for edit spans). + repetition_token_ids: Recent token ids per sequence/codebook (B, C, W) + repetition_penalties: Per-sequence repetition penalties (B,), 1.0 disables + codebook_sizes: Valid ordinary-code range for each codebook. + text_vocab: Text vocabulary size (appended as placeholder) + stop_blocked: Optional (B, C) bool mask of the codebooks whose stop token is + not allowed yet (a request's min_frames); None leaves every stop id allowed. + + Returns: + List of unpacked tokens, each is [cb0, cb1, ..., cb8, text_placeholder] + """ + global _debug_sample_count + B, C, V = logits.shape + codebook_size = int(codebook_size) + audio_pad_id = int(audio_pad_id) + if not 0 < codebook_size < V or not codebook_size <= audio_pad_id < V: + raise ValueError( + f"Invalid codebook_size={codebook_size} / audio_pad_id={audio_pad_id} " + f"for vocabulary {V}" + ) + if tuple(stop_token_ids.shape) != (B,): + raise ValueError( + f"Expected stop_token_ids of shape ({B},), received {tuple(stop_token_ids.shape)}" + ) + + # Padding targets are ignored during training, so their logits are + # unconstrained and padding must never be sampled as an audio code. Of the + # end tokens only the row's own stop id stays available: it is a supervised + # target in every delayed codebook during the autoregressive flush, while + # the other end token (EOA vs span-end) would end the wrong kind of segment. + token_ids = torch.arange(V, device=logits.device).view(1, 1, V) + stop_ids = stop_token_ids.to(device=logits.device, dtype=token_ids.dtype).view(B, 1, 1) + invalid = (token_ids == audio_pad_id) | ( + (token_ids >= codebook_size) & (token_ids != stop_ids) + ) + + if codebook_sizes is not None: + sizes = tuple(int(item) for item in codebook_sizes) + if len(sizes) != C: + raise ValueError( + f"Expected {C} per-codebook sizes, received {len(sizes)}" + ) + if any(size <= 0 or size > codebook_size for size in sizes): + raise ValueError( + f"Invalid per-codebook sizes {sizes!r} for codebook size {codebook_size}" + ) + limits = torch.tensor(sizes, device=logits.device).view(1, C, 1) + invalid = invalid | ( + (token_ids >= limits) & (token_ids < codebook_size) + ) + if stop_blocked is not None: + invalid = invalid | ((token_ids == stop_ids) & stop_blocked.to(logits.device).view(B, C, 1)) + logits = logits.masked_fill(invalid, float("-inf")) + + # Debug: print detailed stats matching reference format for first 10 samples + # Guard with is_current_stream_capturing to avoid CUDA graph capture errors + if (logger.isEnabledFor(logging.DEBUG) + and _debug_sample_count < 10 + and EOA_TOKEN < V + and not torch.cuda.is_current_stream_capturing()): + _debug_sample_count += 1 + step = _debug_sample_count + + stats = _compute_logit_stats_debug(logits) + + logger.debug("Step %d per-codebook stats:", step) + for cb in range(C): + top5 = stats["top5_ids"][cb] + logger.debug( + " CB%d: entropy=%.4f, top1_prob=%.4f, top1_id=%d, margin=%.2f, top5=%s", + cb, stats["entropy"][cb], stats["top1_prob"][cb], + top5[0], stats["margin"][cb], top5, + ) + + probs_raw = F.softmax(logits[0], dim=-1) + eoa_probs = probs_raw[:, EOA_TOKEN].tolist() + eoa_logits = logits[0, :, EOA_TOKEN].tolist() + logger.debug( + "Step %d EOA(1024) logits: [%s]", + step, ", ".join(f"{x:.2f}" for x in eoa_logits), + ) + logger.debug( + "Step %d EOA(1024) probs: [%s]", + step, ", ".join(f"{x:.4f}" for x in eoa_probs), + ) + + logits = apply_repetition_penalty( + logits, + repetition_token_ids=repetition_token_ids, + repetition_penalties=repetition_penalties, + ) + + # Check if all greedy (temperature <= 0) + if (temperatures <= 0).all(): + next_ids = torch.argmax(logits, dim=-1) + else: + # Per-sequence temperature scaling: (B,) -> (B, 1, 1) for broadcasting + temp_broadcast = temperatures.view(B, 1, 1).clamp(min=1e-8) + logits = logits / temp_broadcast + logits_flat = logits.view(B * C, V) + + # Use min top_k across batch for efficient single topk call + top_k = int(top_ks.min().item()) + if 0 < top_k < V: + values, _ = torch.topk(logits_flat, top_k, dim=-1) + kth = values[..., -1].unsqueeze(-1) + mask = logits_flat < kth + logits_flat = logits_flat.masked_fill(mask, float("-inf")) + + probs = F.softmax(logits_flat, dim=-1) + + # Apply top_p (use max across batch - more restrictive) + top_p = float(top_ps.max().item()) + if 0.0 < top_p < 1.0: + probs = apply_top_p(probs, top_p) + + # Apply min_p (use max across batch - more restrictive) + min_p = float(min_ps.max().item()) + if min_p > 0.0: + probs = apply_min_p(probs, min_p) + + # An aggressive min_p (>1) or top_p can remove every token in a row, + # leaving an all-zero distribution. torch.multinomial would then raise a + # CUDA device-side assert that aborts the scheduler, so fall back to + # greedy (argmax) for any fully-masked row. + invalid_rows = probs.sum(dim=-1) <= 0 + if bool(invalid_rows.any()): + greedy = logits_flat.argmax(dim=-1) + fallback = torch.zeros_like(probs) + fallback.scatter_(-1, greedy.unsqueeze(-1), 1.0) + probs = torch.where(invalid_rows.unsqueeze(-1), fallback, probs) + + # Draw each row over the narrowest vocabulary prefix that holds its allowed ids: + # codes, EOA and pad (the base vocabulary), plus the trailing span-end column only + # for span rows. torch.multinomial draws one exponential per column, so an + # utterance on an edit checkpoint then consumes exactly the random numbers of the + # same checkpoint without the span-end row: same seed, same audio. + widths = [max(int(stop), audio_pad_id) + 1 for stop in stop_token_ids.tolist()] + # Use per-request generators for deterministic sampling when seeds are set + has_generators = generators and any(g is not None for g in generators) + if has_generators and B == 1 and generators[0] is not None: + # Fast path: single request with a generator + next_ids = torch.multinomial( + probs[:, : widths[0]].contiguous(), num_samples=1, generator=generators[0] + ).view(B, C) + elif has_generators: + # Batched with mixed generators: sample per-row + # probs is (B*C, V), each request owns C consecutive rows + rows = [] + for i in range(B): + row_probs = probs[i * C : (i + 1) * C, : widths[i]].contiguous() # (C, width) + gen = generators[i] if i < len(generators) else None + rows.append( + torch.multinomial(row_probs, num_samples=1, generator=gen) + ) + next_ids = torch.cat(rows, dim=0).view(B, C) + else: + next_ids = torch.multinomial( + probs[:, : max(widths)].contiguous(), num_samples=1 + ).view(B, C) + + # Return unpacked format: list of (audio codes + text placeholder) + next_ids_list = next_ids.tolist() + + # Debug: print sampled tokens for first 10 samples + if (logger.isEnabledFor(logging.DEBUG) + and _debug_sample_count <= 10 + and not torch.cuda.is_current_stream_capturing()): + step = _debug_sample_count + sampled = next_ids_list[0] if next_ids_list else [] + logger.debug("Step %d sampled: %s", step, sampled) + for i, row in enumerate(next_ids_list): + eoa_positions = [j for j, t in enumerate(row) if t == EOA_TOKEN] + if eoa_positions: + logger.debug( + "Step %d *** EOA SAMPLED at CB %s for batch %d ***", + step, eoa_positions, i, + ) + + return [row + [text_vocab] for row in next_ids_list] diff --git a/zonos3/tts/span_follow.py b/zonos3/tts/span_follow.py new file mode 100644 index 0000000000000000000000000000000000000000..59f7af856005359126761de78c5746902816cb75 --- /dev/null +++ b/zonos3/tts/span_follow.py @@ -0,0 +1,227 @@ +"""Span steering that follows the model's reading position (``control_span_follow: "reading"``). + +A request's ``control_spans`` (zonos3.tts.steering) are normally placed by character position at a frames-per-character +rate. Here they follow the alignment probe (zonos3_sgl.tts.align_probe, the LACI heads of the request's language) instead: + +- The tokenizer maps every span's characters (of the request text) to the text tokens that spell them: through text + normalization (``map_offsets``) to the normalized text, then to the SuperBPE tokens (or phoneme-group ids, or bytes) + covering them (``span_token_ranges``), as text-span positions [a, b) (0 is BOS, ``text_len - 1`` EOS). +- While the request decodes, its probe reads the alignment heads' argmax text position once per step; the + ``SpanFollower`` smooths it (median of the last ``smooth`` readouts, held monotone, at most +1 token per readout). + Span k ramps in (``ramp`` frames, linear) on the first frame decided with the smoothed position at or past + ``a - lead`` and ramps out on the first frame decided at or past ``b + lag``. Every decision is recorded per + generated frame, so the speaker-CFG twin and a LACI rollback (``truncate``) see the same weights for the frames + they share. + +The readout of a step reaches the host with its sampled tokens, so the frame decided now sees the readouts up to one or +two steps back (overlap scheduling); ``lead`` absorbs that and the ramp. A request without probe heads for its +language keeps the character-rate schedule. +""" +from __future__ import annotations + +import bisect +import difflib +import statistics +from dataclasses import dataclass +from typing import Sequence + +import torch + +from .markup import nonverbal_marker_spans +from .steering import RAMP_FRAMES + + +@dataclass(frozen=True) +class FollowConfig: + lead: float = 1.0 # tokens: ramp in once the reading reaches a span's first token - lead (README: dev-split pick) + lag: float = 0.0 # tokens: ramp out once the reading reaches the token after the span + lag + smooth: int = 3 # readouts in the running median + ramp: int = RAMP_FRAMES + + +# --------------------------------------------------------------------------------------------------- token mapping + + +def map_offsets(original: str, final: str, offsets: Sequence[int], *, end: bool = False) -> list[int]: + """Character offsets of ``original`` mapped into ``final`` (``original`` after normalization): exact inside + unchanged stretches, proportional inside rewritten ones (rounded outward: down for starts, up when ``end``).""" + if original == final: + return [int(o) for o in offsets] + # the blocks holding original characters partition [0, len(original)); insertions hold none + blocks = [op for op in difflib.SequenceMatcher(None, original, final, autojunk=False).get_opcodes() if op[2] > op[1]] + starts = [op[1] for op in blocks] + out = [] + for o in offsets: + o = int(o) + if o >= len(original): + out.append(len(final)) + continue + tag, i1, i2, j1, j2 = blocks[bisect.bisect_right(starts, o) - 1] + if tag == "equal": + out.append(j1 + o - i1) + else: + x = j1 + (o - i1) * (j2 - j1) / (i2 - i1) + out.append(int(-(-x // 1)) if end else int(x)) + return out + + +def token_char_ranges(text: str, spec: dict | None) -> list[tuple[int, int]]: + """Character range of ``text`` behind each id of its text span (``TTSPromptBuilder.text_ids``): BOS and EOS are + the empty ranges at 0 and ``len(text)``; SuperBPE tokens their offsets, a phoneme group's open id its open marker, + each phone id its code point, the close id the close marker; byte ids the character they encode.""" + if spec is None: + ranges = [(i, i + 1) for i, ch in enumerate(text) for _ in ch.encode("utf-8")] + else: + from .superbpe import tokenizer + + bpe = tokenizer(spec["path"], spec["sha256"], spec["vocab_size"]) + + def stretch(s: str, base: int) -> list[tuple[int, int]]: + return [(base + a, base + b) for a, b in bpe.encode(s, add_special_tokens=False).offsets] if s else [] + + phonemes = spec.get("phonemes") + if phonemes is None or (phonemes["open_marker"] not in text and phonemes["close_marker"] not in text): + ranges = stretch(text, 0) + else: + open_, close = phonemes["open_marker"], phonemes["close_marker"] + ranges, pos = [], 0 + while pos < len(text): + start = text.find(open_, pos) + ranges += stretch(text[pos:] if start < 0 else text[pos:start], pos) + if start < 0: + break + end = text.find(close, start + 1) # superbpe.payload_ids validated the groups + ranges += [(i, i + 1) for i in range(start, end + 1)] + pos = end + 1 + return [(0, 0), *ranges, (len(text), len(text))] + + +def span_token_ranges(text: str, final: str, spans: Sequence[tuple[int, int]], spec: dict | None) -> list[tuple[int, int]]: + """Text-span positions [a, b) of the tokens spelling each character span [start, end) of ``text``, once the text + is ``final`` (normalized): the tokens whose characters, outer whitespace trimmed, overlap the span's trimmed + characters. A span that maps onto no token keeps the token at its start (a zero-width span never steers). + Tokens inside a nonverbal marker (````, ````; zonos3.tts.prompt) do not open or close a span + that also covers spoken tokens (markers inside it stay in it); a span over markers only keeps them.""" + ranges = token_char_ranges(final, spec) + trimmed = [] + for a, b in ranges: + while a < b and final[a].isspace(): + a += 1 + while b > a and final[b - 1].isspace(): + b -= 1 + trimmed.append((a, b)) + markers = nonverbal_marker_spans(final) + in_marker = [a < b and any(s <= a and b <= e for s, e in markers) for a, b in trimmed] + out = [] + for start, end in spans: + while start < end and text[start].isspace(): + start += 1 + while end > start and text[end - 1].isspace(): + end -= 1 + s, e = map_offsets(text, final, [start])[0], map_offsets(text, final, [end], end=True)[0] + hit = [i for i, (a, b) in enumerate(trimmed) if a < b and a < e and s < b] + spoken = [i for i in hit if not in_marker[i]] + if spoken: + out.append((spoken[0], spoken[-1] + 1)) + elif hit: + out.append((hit[0], hit[-1] + 1)) + else: + first = next((i for i, (a, b) in enumerate(trimmed) if a < b and b > s), len(ranges) - 1) + out.append((first, first)) + return out + + +# --------------------------------------------------------------------------------------------------------- follower + + +class SpanFollower: + """The span gate of one request (see the module docstring). ``observe(frame, pos)`` takes the readout of the step + that generated ``frame`` (frames count the stream's generated rows: a LACI continuation's start at its + history_rows); ``delta(frame)`` decides and returns the summed span delta for the frame generated now (None when + no span is on); ``truncate(frame)`` forgets the readouts and decisions of frames >= ``frame`` (a rollback). + + As a probe observer (``on_step``) it maps step s of the probe to frame ``origin + s``.""" + + def __init__(self, ranges: Sequence[tuple[int, int]], deltas: torch.Tensor, cfg: FollowConfig = FollowConfig(), + origin: int = 0): + if deltas.dim() != 2 or deltas.shape[0] != len(ranges): + raise ValueError(f"span follower: {len(ranges)} token ranges for deltas of shape {tuple(deltas.shape)}") + if cfg.smooth < 1 or cfg.ramp < 1: + raise ValueError("span follower: smooth and ramp must be >= 1") + self.ranges = [(int(a), int(b)) for a, b in ranges] + self.deltas = deltas.to(torch.float32) + self.cfg = cfg + self.origin = int(origin) + self._frames: list[int] = [] # observed frames (increasing) and their readouts + self._pos: list[int] = [] + self._best = 0.0 # smoothed, monotone reading position (0 = BOS before any readout) + k = len(self.ranges) + self._enter = [None] * k # (decision frame, ramp anchor) per span + self._exit = [None] * k + self._weights: dict[int, list[float]] = {} # frame -> per-span weights decided for it + + # -- readout ------------------------------------------------------------------------------------------------- + + def on_step(self, probe, step: int, pos: int, m: float) -> None: + self.observe(self.origin + step, pos) + + def observe(self, frame: int, pos: int) -> None: + if self._frames and frame <= self._frames[-1]: + raise ValueError(f"span follower: frames must increase, got {frame} after {self._frames[-1]}") + self._frames.append(int(frame)) + self._pos.append(int(pos)) + self._advance(len(self._pos)) + + def _advance(self, n: int) -> None: + med = statistics.median(self._pos[max(0, n - self.cfg.smooth) : n]) + self._best = min(max(self._best, med), self._best + 1.0) + + @property + def position(self) -> float: + return self._best + + # -- decisions ----------------------------------------------------------------------------------------------- + + def weights(self, frame: int) -> list[float]: + frame = int(frame) + w = self._weights.get(frame) + if w is not None: + return w + cfg, s = self.cfg, self._best + for k, (a, b) in enumerate(self.ranges): + if a >= b: + continue + if self._enter[k] is None and s >= a - cfg.lead: + # on before any readout (a span at the start of the text): full weight at once, like the schedule + self._enter[k] = (frame, frame - cfg.ramp + 1 if not self._frames else frame) + if self._enter[k] is not None and self._exit[k] is None and s >= b + cfg.lag: + self._exit[k] = (frame, frame) + w = [] + for k in range(len(self.ranges)): + if self._enter[k] is None: + w.append(0.0) + continue + up = (frame - self._enter[k][1] + 1) / cfg.ramp + down = 1.0 if self._exit[k] is None else (self._exit[k][1] + cfg.ramp - 1 - frame) / cfg.ramp + w.append(min(1.0, max(0.0, min(up, down)))) + self._weights[frame] = w + return w + + def delta(self, frame: int) -> torch.Tensor | None: + w = self.weights(frame) + if not any(x > 0 for x in w): + return None + return (torch.tensor(w, dtype=torch.float32)[:, None] * self.deltas).sum(0) + + def truncate(self, frame: int) -> None: + frame = int(frame) + keep = bisect.bisect_left(self._frames, frame) + del self._frames[keep:], self._pos[keep:] + self._best = 0.0 + for n in range(1, keep + 1): + self._advance(n) + for events in (self._enter, self._exit): + for k, e in enumerate(events): + if e is not None and e[0] >= frame: + events[k] = None + self._weights = {f: w for f, w in self._weights.items() if f < frame} diff --git a/zonos3/tts/steering.py b/zonos3/tts/steering.py new file mode 100644 index 0000000000000000000000000000000000000000..11ad7d6bacef3e91cfef65804fa2ae3d405c2291 --- /dev/null +++ b/zonos3/tts/steering.py @@ -0,0 +1,293 @@ +"""Steering bundles: several direction sets served together, driven by one request field. + +A bundle file (``--steer-bundle``) names direction sets and carries the UI metadata +the studio reads from ``/v2/controls``:: + + {"name": "studio_mect60k", + "sets": {"identity": "speaker_attributes_mect60k", "delivery": "ears_styles_mect60k", ...}, + "timing": {"delivery.tempo": [[-2, 2.2], [0, 1.0], [2, 0.63]]}, + "ui": {...}} + +Set directories are relative to the bundle file. A request's ``controls`` maps +``.`` to a raw dose. Directions of ``raw`` sets move the speaker +embedding (their deltas summed, the result rescaled to the embedding's norm); +``attnres_source`` directions add to their Full +AttnRes bank source on every generated frame. ``control_spans`` apply hidden +directions to the frames generated while a character range of the text is spoken: +frames are placed by character position at ``frames_per_char`` (the client's +measurement from an earlier take, or a default), stretched inside each span by the +``timing`` table of the controls that change the pace, with linear ramps of +``RAMP_FRAMES`` at both edges. ``control_span_follow: "reading"`` places the same +span deltas by the model's reading position instead (zonos3.tts.span_follow). +""" +from __future__ import annotations + +import json +from dataclasses import dataclass, field +from pathlib import Path +from typing import Dict, List, Mapping, Sequence + +import numpy as np +import torch + +from .directions import HIDDEN_SPACE, RAW_SPACE, DirectionSet +from .markup import nonverbal_marker_spans + +RAMP_FRAMES = 3 # 0.2 s at 15 frames per second +DEFAULT_FRAMES_PER_CHAR = 1.0 # release LM, embedding mode, unsteered (15 fps, ~15 characters per second) + + +@dataclass +class Direction: + id: str + set: str + name: str + space: str + vector: torch.Tensor + source_index: int | None + + +@dataclass(frozen=True) +class RateExtension: + """Tempo-steered speaking-rate buckets past the condition row (bundle ``rate_extension``; + docs/guide.md "Extended speaking-rate buckets"): the pace direction, the row edges they continue, the nominal edges past + the row (``below[k]`` the lower edge of bucket -k, ``above[k]`` the upper edge of bucket n-1+k for the row's n + buckets) and per TTS language the buckets measured safe with their dose (bucket -> dose, contiguous from the row). + ``reference_sides`` ("slower" / "faster"): the sides that also serve reference-mode voices (a dub's source voice); + the buckets were validated in embedding mode.""" + + direction: str + row_edges: tuple[float, ...] + below: tuple[float, ...] + above: tuple[float, ...] + doses: Dict[str, Dict[int, float]] + reference_sides: tuple[str, ...] = ("slower", "faster") + + +@dataclass +class SteeringBundle: + name: str + path: Path + sets: Dict[str, DirectionSet] + directions: Dict[str, Direction] + timing: Dict[str, List[List[float]]] = field(default_factory=dict) + ui: dict = field(default_factory=dict) + rate_extension: RateExtension | None = None + + @property + def hidden_sources(self) -> List[int]: + return sorted({int(d.source_index) for d in self.sets.values() if d.space == HIDDEN_SPACE}) + + @property + def raw_dim(self) -> int | None: + dims = {int(d.dim) for d in self.sets.values() if d.space == RAW_SPACE} + return dims.pop() if dims else None + + +def load_bundle(path: str | Path) -> SteeringBundle: + path = Path(path).expanduser() + spec = json.loads(path.read_text()) + sets: Dict[str, DirectionSet] = {} + directions: Dict[str, Direction] = {} + raw_dims = set() + for set_name, rel in spec["sets"].items(): + if "." in set_name: + raise ValueError(f"{path}: set name {set_name!r} must not contain '.'") + directory = (path.parent / rel).resolve() + loaded = DirectionSet.load(directory) + if loaded is None or loaded.is_empty(): + raise ValueError(f"{path}: set {set_name!r} has no directions at {directory}") + if loaded.space == RAW_SPACE: + raw_dims.add(int(loaded.dim)) + sets[set_name] = loaded + for name, vec in {**loaded.named, **loaded.axes}.items(): + did = f"{set_name}.{name}" + directions[did] = Direction(did, set_name, name, loaded.space, vec, + loaded.source_index if loaded.space == HIDDEN_SPACE else None) + if len(raw_dims) > 1: + raise ValueError(f"{path}: raw sets disagree on the embedding dim: {sorted(raw_dims)}") + timing = spec.get("timing", {}) + unknown = sorted(set(timing) - set(directions)) + if unknown: + raise ValueError(f"{path}: timing for unknown directions {unknown}") + rate_extension = None + if spec.get("rate_extension"): + r = spec["rate_extension"] + if r["direction"] not in directions or directions[r["direction"]].space != HIDDEN_SPACE: + raise ValueError(f"{path}: rate_extension direction {r['direction']!r} is not a hidden direction of the bundle") + rate_extension = RateExtension( + direction=r["direction"], row_edges=tuple(float(e) for e in r["row_edges"]), + below=tuple(float(e) for e in r["below"]), above=tuple(float(e) for e in r["above"]), + doses={lang: {int(b): float(d) for b, d in doses.items()} for lang, doses in r["languages"].items()}, + reference_sides=tuple(r.get("reference_sides", ("slower", "faster"))), + ) + return SteeringBundle(name=spec.get("name", path.stem), path=path, sets=sets, directions=directions, + timing=timing, ui=spec.get("ui", {}), rate_extension=rate_extension) + + +def _duration_factor(bundle: SteeringBundle, controls: Mapping[str, float]) -> float: + """Expected duration multiplier of a set of controls (product over the timed ones).""" + factor = 1.0 + for did, table in bundle.timing.items(): + dose = float(controls.get(did, 0.0)) + if dose: + xs, ys = zip(*sorted((float(x), float(y)) for x, y in table)) + factor *= float(np.interp(dose, xs, ys)) + return factor + + +@dataclass +class ResolvedControls: + """What a request's controls do: the moved speaker embedding (or the original), the hidden + delta laid out per steered source (flattened; None if no hidden control), the span + schedule tensor [K, 3 + n_sources*hidden] (start frame, end frame, ramp frames, delta) or None, + and the character range [start, end) of each schedule row (zonos3.tts.span_follow places + the rows by the reading position instead).""" + + speaker_embedding: torch.Tensor | None + hidden_delta: torch.Tensor | None + schedule: torch.Tensor | None + span_chars: list[tuple[int, int]] | None = None + + +def check_controls(bundle: SteeringBundle, controls: Mapping[str, float], span_ids: Sequence[str] = ()) -> None: + """Raise ValueError for an id the bundle does not serve (in ``controls`` or ``span_ids``) + or a non-finite dose in ``controls``.""" + for did in list(controls) + list(span_ids): + if did not in bundle.directions: + raise ValueError(f"Unknown control {did!r}; see /v2/controls.") + for did, v in controls.items(): + if not np.isfinite(v): + raise ValueError(f"Control {did!r} must be finite, got {v!r}.") + + +def resolve_controls( + bundle: SteeringBundle, + controls: Mapping[str, float] | None, + spans: Sequence[Mapping] | None, + *, + text: str, + speaker_embedding: torch.Tensor | None, + sources: Sequence[int], + hidden_size: int, + frames_per_char: float | None = None, +) -> ResolvedControls: + controls = {k: float(v) for k, v in (controls or {}).items() if float(v) != 0.0} + spans = list(spans or []) + check_controls(bundle, controls, [d for s in spans for d in s.get("controls", {})]) + + def hidden_vector(doses: Mapping[str, float]) -> torch.Tensor | None: + parts = [(bundle.directions[d], v) for d, v in doses.items() + if float(v) != 0.0 and bundle.directions[d].space == HIDDEN_SPACE] + if not parts: + return None + out = torch.zeros(len(sources), hidden_size, dtype=torch.float32) + for d, v in parts: + if d.vector.numel() != hidden_size: + raise ValueError(f"Control {d.id!r} has dim {d.vector.numel()}, the model's hidden size is {hidden_size}.") + out[list(sources).index(int(d.source_index))] += float(v) * d.vector + return out.flatten() + + # speaker embedding: every raw control at once, norm kept + raw = {d: v for d, v in controls.items() if bundle.directions[d].space == RAW_SPACE} + embedding = speaker_embedding + if raw: + if speaker_embedding is None: + names = ", ".join(sorted(raw)) + raise ValueError(f"Controls {names} move the speaker embedding and need speaker_mode=embedding.") + base = speaker_embedding.detach().to(torch.float32, copy=True).reshape(-1).cpu() + delta = torch.zeros_like(base) + for did, v in raw.items(): + vec = bundle.directions[did].vector + if vec.numel() != base.numel(): + raise ValueError(f"Control {did!r} has dim {vec.numel()}, the speaker embedding has {base.numel()}.") + delta += v * vec + moved = base + delta + embedding = (moved * (torch.linalg.vector_norm(base) / torch.linalg.vector_norm(moved).clamp_min(1e-8))).contiguous() + + hidden = hidden_vector(controls) + + schedule, span_chars = None, None + if spans: + n = len(text) + rate = float(frames_per_char or DEFAULT_FRAMES_PER_CHAR) * _duration_factor(bundle, controls) + if rate <= 0: + raise ValueError("control_span_rate must be positive.") + cleaned = [] + for s in spans: + start, end = int(s["start"]), int(s["end"]) + doses = {k: float(v) for k, v in s.get("controls", {}).items() if float(v) != 0.0} + if not 0 <= start < end <= n: + raise ValueError(f"control span [{start}, {end}) is outside the text (0..{n}).") + for did in doses: + if bundle.directions[did].space != HIDDEN_SPACE: + raise ValueError(f"Control {did!r} moves the speaker embedding and cannot vary inside a request; " + "only hidden-space controls take spans.") + cleaned.append((start, end, doses)) + cleaned.sort() + for (s0, e0, _), (s1, _e1, _) in zip(cleaned, cleaned[1:]): + if s1 < e0: + raise ValueError(f"control spans [{s0}, {e0}) and [{s1}, ...) overlap.") + # frame position of every character boundary: span characters run at their own pace; nonverbal markers + # (zonos3.tts.prompt: "", "" ...) take no time (control_span_rate counts spoken characters) + per_char = np.full(n, rate) + for start, end, doses in cleaned: + per_char[start:end] = rate * _duration_factor(bundle, doses) + for start, end in nonverbal_marker_spans(text): + per_char[start:end] = 0.0 + frame_at = np.concatenate([[0.0], np.cumsum(per_char)]) + rows, chars = [], [] + for start, end, doses in cleaned: + vec = hidden_vector(doses) + if vec is None: + continue + head = torch.tensor([round(frame_at[start]), round(frame_at[end]), RAMP_FRAMES], dtype=torch.float32) + rows.append(torch.cat([head, vec])) + chars.append((start, end)) + schedule = torch.stack(rows) if rows else None + span_chars = chars if rows else None + return ResolvedControls(speaker_embedding=embedding, hidden_delta=hidden, schedule=schedule, span_chars=span_chars) + + +def schedule_delta(schedule: torch.Tensor | None, frame: int) -> torch.Tensor | None: + """Sum of the span deltas active at generated frame ``frame``: weight 1 inside [start, end), ramping + linearly to 0 over ``ramp`` frames on both sides.""" + if schedule is None: + return None + start, end, ramp = schedule[:, 0], schedule[:, 1], schedule[:, 2].clamp_min(1.0) + f = float(frame) + w = torch.minimum((f - (start - ramp)) / ramp, ((end + ramp) - f) / ramp).clamp(0.0, 1.0) + if not bool((w > 0).any()): + return None + return (w[:, None] * schedule[:, 3:]).sum(0) + + +def controls_document(bundle: SteeringBundle, *, speaker_embedding_dim: int | None) -> dict: + """The /v2/controls payload: sets (with their calibration), directions (raw vectors included for client-side + geometry) and UI metadata.""" + sets = {} + for name, d in bundle.sets.items(): + entry = {"space": d.space, "modes": ["embedding"] if d.space == RAW_SPACE else ["embedding", "reference"]} + if d.space == HIDDEN_SPACE: + entry["source_index"] = int(d.source_index) + if d.calibration is not None: + entry["calibration"] = d.calibration.document() + sets[name] = entry + directions = {} + for did, d in bundle.directions.items(): + kind = "axis" if d.name in bundle.sets[d.set].axes else "named" + entry = {"set": d.set, "space": d.space, "kind": kind, "norm": float(torch.linalg.vector_norm(d.vector))} + if d.space == RAW_SPACE: + entry["vector"] = [round(float(x), 6) for x in d.vector] + directions[did] = entry + return {"bundle": bundle.name, "embedding_dim": speaker_embedding_dim, "sets": sets, "directions": directions, + "timing": bundle.timing, "ui": bundle.ui} + + +def disabled_controls(bundle: SteeringBundle | None, speaker_id: str | None) -> list[str]: + """Control ids a set calibration gives this speaker dose 0 (a speaker object's ``disabled_controls``): + ``.``, or ``.-`` when only the negative pole is disabled; bundle direction order.""" + if bundle is None: + return [] + return [f"{name}.{c}" for name, d in bundle.sets.items() if d.calibration is not None + for c in d.calibration.disabled(speaker_id, d.names)] diff --git a/zonos3/tts/superbpe.py b/zonos3/tts/superbpe.py new file mode 100644 index 0000000000000000000000000000000000000000..5c6698f97ee9e6dd4c13af3219d2ae8c8a110908 --- /dev/null +++ b/zonos3/tts/superbpe.py @@ -0,0 +1,74 @@ +"""Frozen SuperBPE inference convention, identical to the training loader. + +Phoneme-token checkpoints (lingua data.phoneme_tokens_path, text_extra_tokens rows after the text +padding row) add ``phonemes`` to the spec: a pronunciation group in the text, written +``open_marker`` + IPA + ``close_marker`` (U+E000 / U+E001), encodes as open_id, one id per IPA +code point of ``symbols`` (open_id + 2 + index) and close_id, the text between groups as +SuperBPE on its own -- lingua apps.zonos.text_tokenization._phoneme_payload_ids. The phoneme block +is the last block of the extra rows: right after the padding row (open_id = text_vocab + 1), or +after the speech-edit marker rows of an edit checkpoint (open_id = text_vocab + 1 + markers). +""" +import hashlib,json +from functools import lru_cache +from pathlib import Path +PHONEME_OPEN,PHONEME_CLOSE="\ue000","\ue001" # lingua apps.zonos.phonemes markers (the spec carries its own) +@lru_cache(maxsize=8) +def tokenizer(path,sha,size): + from tokenizers import Tokenizer + raw=Path(path).read_bytes() + if hashlib.sha256(raw).hexdigest()!=sha: raise ValueError("SuperBPE SHA mismatch") + t=Tokenizer.from_str(raw.decode()) + if t.get_vocab_size(with_added_tokens=True)!=size or t.padding is not None or t.truncation is not None: raise ValueError("SuperBPE artifact mismatch") + return t +def validate_spec(spec,text_vocab): + if (spec['kind'],spec['offset'],spec['bos'],spec['eos'])!=('superbpe',4,2,3) or text_vocab!=spec['vocab_size']+4: raise ValueError("SuperBPE ID convention mismatch") + tokenizer(spec['path'],spec['sha256'],spec['vocab_size']) + phonemes=spec.get('phonemes') + if phonemes is not None: + symbols=phonemes['symbols'] + if phonemes['open_id']=0 else "" + if end<0 or not group or open_ in group: raise ValueError("Unbalanced or empty phoneme group") + unknown=sorted(set(group)-phone_ids.keys()) + if unknown: raise ValueError(f"Phones outside the inventory: {unknown}") + ids.append(phonemes['open_id']); ids.extend(phone_ids[s] for s in group); ids.append(phonemes['close_id']) + pos=end+1 + return ids +def text_ids(text,spec): + return [2]+payload_ids(text,spec)+[3] +def load_spec(model_path): + from zonos3.utils.release import resolve_dir_or_local,resolve_tokenizer_path # RELEASE_HF_20261021 + model_dir=resolve_dir_or_local(str(model_path)) + model=json.loads((Path(model_dir)/'params.json').read_text())['model'] + spec=model.get('text_tokenizer_spec') + if spec is not None: + spec=dict(spec,path=resolve_tokenizer_path(spec['path'],model_dir)); validate_spec(spec,model['text_vocab']) + if spec.get('phonemes') is not None and rows_before_phonemes(spec,model['text_vocab'])+phoneme_token_count(spec)!=int(model.get('text_extra_tokens',0)): raise ValueError("Phoneme tokens do not match text_extra_tokens (they must be the last extra rows)") + return spec diff --git a/zonos3/tts/textmatch.py b/zonos3/tts/textmatch.py new file mode 100644 index 0000000000000000000000000000000000000000..bf5686601c4c37689657c99490ab3f2cb2e27b9d --- /dev/null +++ b/zonos3/tts/textmatch.py @@ -0,0 +1,84 @@ +"""Transcript tokens and error rates of speech editing: the edit's word diff, verify WER and CER. + +``normalize`` and ``char_error_rate`` are copied verbatim from ``z_speech_alignment/textmatch.py`` (Zyphra's +z-speech-alignment, MIT License, Copyright (c) 2026 Sofian Mejjoute; licenses/z-speech-alignment-MIT.txt), which ported +``normalize`` from the k2-fsa/libriheavy corpus pipeline (``scripts/filter_by_cer.py``). ``word_errors`` is the word +Levenshtein of the edit's former recognition worker. +""" + +from __future__ import annotations + +import re + +# Curly quotes are folded so "don't" and "don’t" are one token. Every letter +# or digit of any script is kept: libriheavy's ``[A-Z0-9']`` rule reduced a +# Mandarin token to the empty string, so a guide in an unspaced script +# matched 5% of its own transcript (the empty tokens, against each other). +_QUOTES = str.maketrans({"\u2018": "'", "\u2019": "'", + "\u201b": "'", "\u02bc": "'"}) +_KEEP = re.compile(r"[^\w']+") + + +def normalize(text: str) -> str: + """Uppercase; keep word characters and ``'``; everything else becomes one space. + + Curly quotes are mapped to ``'`` first. Libriheavy's rule, widened from + ASCII to every script; ``_`` is a word character to ``\\w`` and is dropped. + """ + return _KEEP.sub(" ", text.translate(_QUOTES).replace("_", " ").upper()).strip() + + +def char_error_rate(reference: str, hypothesis: str) -> float: + """Levenshtein over :func:`normalize`d characters divided by ``len(reference)``. + + Returns 0.0 when the normalised reference is empty. This is + ``O(len(ref) * len(hyp))`` in time and belongs on segment-sized strings: + a whole-file rate is the length-weighted mean of the per-segment rates, + never one call over two transcripts. + + One deliberate departure from libriheavy's ``filter_by_cer``: word + delimiters are dropped before the DP rather than counted as characters. + Their reference and hypothesis come from the same tokenizer, so a space + is a real character there; here the hypothesis is a separate model's + greedy decode, and charging its word segmentation as character errors + would measure the tokenizer, not the transcript. + """ + ref = "".join(normalize(reference).split()) + hyp = "".join(normalize(hypothesis).split()) + if not ref: + return 0.0 + if not hyp: + return 1.0 + prev = list(range(len(hyp) + 1)) + cur = [0] * (len(hyp) + 1) + for i, rc in enumerate(ref, start=1): + cur[0] = i + for j, hc in enumerate(hyp, start=1): + cur[j] = min(prev[j] + 1, cur[j - 1] + 1, + prev[j - 1] + (rc != hc)) + prev, cur = cur, prev + return prev[len(hyp)] / len(ref) + + +def tokens(text: str) -> list[str]: + """The edit tokens of a text: the whitespace words of its ``normalize``.""" + return normalize(text).split() + + +def word_errors(reference: list[str], hypothesis: list[str]) -> int: + """Word-level Levenshtein distance (substitutions, insertions, deletions) between two token lists.""" + prev = list(range(len(hypothesis) + 1)) + for i, ref in enumerate(reference, 1): + row = [i] + for j, hyp in enumerate(hypothesis, 1): + row.append(min(row[-1] + 1, prev[j] + 1, prev[j - 1] + (ref != hyp))) + prev = row + return prev[-1] + + +def verify(reference: str, hypothesis: str) -> dict: + """``{"word_errors", "ref_words", "cer"}`` of a transcript ``hypothesis`` against the ``reference`` text: the word + errors over the tokens of each, the reference's token count and ``char_error_rate``.""" + ref = tokens(reference) + return {"word_errors": word_errors(ref, tokens(hypothesis)), "ref_words": len(ref), + "cer": char_error_rate(reference, hypothesis)} diff --git a/zonos3/utils/__init__.py b/zonos3/utils/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/zonos3/utils/hf.py b/zonos3/utils/hf.py new file mode 100644 index 0000000000000000000000000000000000000000..dfc6c1bc26336c1088865641317140069af2a258 --- /dev/null +++ b/zonos3/utils/hf.py @@ -0,0 +1,486 @@ +from __future__ import annotations + +import json +import re +from dataclasses import dataclass +from functools import lru_cache +from pathlib import Path +from typing import Optional + +import logging +from zonos3.utils.moe_topk import normalize_special_topk_layers + +logger = logging.getLogger(__name__) + +_HF_REPO_ID_RE = re.compile(r"^[\w.-]+/[\w.-]+$") + + +@lru_cache() +def resolve_model_path(model_path: str) -> str: + """Resolve a model path to a local directory. + + Local paths are returned as-is. A Hugging Face repo id (e.g. + ``hf://Zyphra/ZONOS3_Mini_release_ckpts/lm/mect_60k``) is downloaded to the local HF cache first. + """ + from zonos3.utils.release import is_hf, resolve_dir_or_local # RELEASE_HF_20261021 + + if is_hf(model_path): + return resolve_dir_or_local(model_path) + if Path(model_path).expanduser().exists(): + return model_path + if _HF_REPO_ID_RE.match(model_path): + from huggingface_hub import snapshot_download + + logger.info("Downloading checkpoint from Hugging Face: %s", model_path) + return snapshot_download( + model_path, + allow_patterns=["*.json", "*.pth", "*.pt", "*.yaml"], + ) + return model_path + + +@dataclass +class Zonos3Config: + """Config class for zonos3 models loaded from training checkpoints. + + This mimics the HuggingFace config interface for compatibility with the server. + """ + + model_type: str = "zonos2" + dtype: str = "bfloat16" + + # Model architecture + n_layers: int = 8 + dim: int = 512 + head_dim: int = 128 + n_heads: Optional[int] = None + n_kv_heads: Optional[int] = None + use_xsa: bool = False + attention_pattern: str = "global" + residual_type: str = "standard" + block_attnres_block_size: int = 4 + block_attnres_backend: str = "auto" + ffn_dim_multiplier: float = 4.0 + multiple_of: int = 256 + norm_eps: float = 1e-5 + rope_theta: float = 10000.0 + max_seqlen: int = 2048 + + # TTS-specific + n_codebooks: int = 9 + codebook_size: int = 1024 + codebook_sizes: Optional[list[int]] = None + audio_codec: str = "opus_dual_3n_600k_sched600k_r4096_step600000" + eoa_id: int = 1024 + audio_pad_id: int = 1025 + # Optional span-end audio token that ends a masked edit span (audio_pad_id + 1). + span_end_id: Optional[int] = None + text_vocab: Optional[int] = None + # Text rows after the padding row: phoneme tokens (text_tokenizer_spec.phonemes) or speech-edit marker rows. + text_extra_tokens: int = 0 + text_tokenizer_spec: Optional[dict] = None + speaker_enabled: bool = False + # Raw reference audio codes are prepended before text instead of being reduced + # to a learned speaker-vector slot. + speaker_reference_prefix_enabled: bool = False + speaker_reference_max_seconds: float = 30.0 + speaker_embedding_dim: int = 128 + # Name of the encoder that created the speaker vectors. This is required + # for extracting a matching embedding from uploaded reference audio. + speaker_embedding_codec: Optional[str] = None + # Optional LDA projection applied to speaker embeddings before the speaker + # projection. The projection weights live inside the model checkpoint. + speaker_lda_dim: Optional[int] = None + # Clean/noisy speaker-background marker tokens (2 ids at the text-vocab tail). + speaker_background_token_enabled: bool = False + # Accurate-mode marker token (1 id after the background markers). + accurate_mode_token_enabled: bool = False + speaking_rate_num_buckets: int = 0 + speaking_rate_buckets: Optional[list[str]] = None + quality_num_buckets: int = 0 + quality_features: Optional[list[str]] = None + quality_buckets: Optional[dict[str, list[str]]] = None + quality_dropout: Optional[dict[str, float]] = None + # Condition rows of the srcmix-cond3 finetunes (2026-10-15): three all-pad rows between the voice conditioning + # (reference prefix or speaker row) and BOS whose hidden states are replaced by learned bucket embeddings, one + # table per condition with condition_n_buckets + 1 rows (the last = unknown); the rate30 finetunes (2026-10-30) + # carry one count per table in condition_bucket_counts (table i: counts[i] + 1 rows, id counts[i] = unknown). + # condition_edges are the bucket edges (bucket i = [edge_{i-1}, edge_i)) the converter copies from the run's + # configs/condition_edges.json. + condition_tokens_enabled: bool = False + condition_n_buckets: int = 10 + condition_bucket_counts: Optional[list[int]] = None + condition_count: int = 3 + condition_names: Optional[list[str]] = None + condition_edges: Optional[dict[str, list[float]]] = None + condition_units: Optional[dict[str, str]] = None + # Flag rows (2026-10-17, the encode-start finetunes): {name: {values, labels, max_frames, note}}; no edges. + condition_flags: Optional[dict[str, dict]] = None + + # MoE config + moe_router_topk: int = 1 + norm_topk_prob: bool = False + special_topk_layers: dict[int, int] | None = None + moe_n_experts: int = 1 + moe_router_dim: int = 128 + moe_router_type: str = "mlp" + moe_router_use_eda: bool = True + # Upstream architecture-branch alias; normalized below when present. + use_eda: Optional[bool] = None + moe_alpha: float = 1.0 + # Training may size the expert FFNs independently from the dense FFNs. + # None retains compatibility with older checkpoints that used the dense + # multiplier and rounding multiple for both paths. + moe_ffn_dim_multiplier: Optional[float] = None + moe_multiple_of: Optional[int] = None + moe_start_from_layer: int = 0 + moe_end_from_layer: int = 0 + moe_impl: str = "grouped" + moe_balancing_strategy: str = "legacy" + + # Loss + loss_softcap: float = 15.0 + + def __post_init__(self) -> None: + self.special_topk_layers = normalize_special_topk_layers( + self.special_topk_layers + ) + if self.speaking_rate_buckets is not None: + self.speaking_rate_buckets = [str(item) for item in self.speaking_rate_buckets] + if self.quality_features is not None: + self.quality_features = [str(item) for item in self.quality_features] + if self.quality_buckets is not None: + self.quality_buckets = { + str(feature): [str(item) for item in (buckets or [])] + for feature, buckets in self.quality_buckets.items() + } + if self.quality_features is None: + self.quality_features = list(self.quality_buckets.keys()) + if int(self.quality_num_buckets or 0) <= 0: + self.quality_num_buckets = sum( + len(self.quality_buckets.get(feature, ())) + for feature in (self.quality_features or []) + ) + if self.quality_dropout is not None: + self.quality_dropout = { + str(feature): float(dropout) + for feature, dropout in self.quality_dropout.items() + } + if self.condition_names is not None: + self.condition_names = [str(item) for item in self.condition_names] + if self.condition_bucket_counts is not None: + self.condition_bucket_counts = [int(item) for item in self.condition_bucket_counts] + if self.condition_edges is not None: + self.condition_edges = { + str(name): [float(x) for x in (edges or [])] for name, edges in self.condition_edges.items() + } + if self.condition_units is not None: + self.condition_units = {str(name): str(unit) for name, unit in self.condition_units.items()} + if self.condition_flags is not None: + self.condition_flags = {str(name): dict(spec or {}) for name, spec in self.condition_flags.items()} + self.speaker_background_token_enabled = bool(self.speaker_background_token_enabled) + self.accurate_mode_token_enabled = bool(self.accurate_mode_token_enabled) + self.speaker_reference_prefix_enabled = bool( + self.speaker_reference_prefix_enabled + ) + self.residual_type = str(self.residual_type).strip().lower().replace("-", "_") + if self.residual_type not in {"standard", "block_attnres", "full_attnres"}: + raise ValueError( + "residual_type must be 'standard', 'block_attnres' or 'full_attnres', got " + f"{self.residual_type!r}." + ) + if int(self.block_attnres_block_size) <= 0 or int( + self.block_attnres_block_size + ) % 2: + raise ValueError("block_attnres_block_size must be a positive even number.") + if float(self.speaker_reference_max_seconds) <= 0: + raise ValueError("speaker_reference_max_seconds must be positive.") + if self.use_eda is not None: + self.moe_router_use_eda = bool(self.use_eda) + if self.speaker_embedding_codec is not None: + self.speaker_embedding_codec = str(self.speaker_embedding_codec) + self.audio_codec = str(self.audio_codec).strip().lower().replace("-", "_") + from zonos3.tokenizer.matched_codec import codec_names + supported_audio_codecs = codec_names() + if self.audio_codec not in supported_audio_codecs: + raise ValueError(f"Unsupported audio codec: {self.audio_codec!r}") + if self.codebook_sizes is None: + self.codebook_sizes = [int(self.codebook_size)] * int(self.n_codebooks) + else: + self.codebook_sizes = [int(item) for item in self.codebook_sizes] + if len(self.codebook_sizes) != int(self.n_codebooks): + raise ValueError( + "codebook_sizes must contain one size per codebook: " + f"{self.codebook_sizes!r}" + ) + if any(size <= 0 or size > int(self.codebook_size) for size in self.codebook_sizes): + raise ValueError( + "Each per-codebook size must be within the shared LM head: " + f"{self.codebook_sizes!r} vs {self.codebook_size}" + ) + + def to_dict(self): + return self.__dict__.copy() + + +def _load_zonos3_config(model_path: str) -> Zonos3Config: + """Load config from zonos3 training checkpoint format. + + Supports: + - config.yaml in parent directory (training run format) + - params.json in checkpoint directory (release checkpoint format) + """ + from pathlib import Path + + def _cfg_get(cfg, key: str, default=None): + if cfg is None: + return default + if isinstance(cfg, dict): + return cfg.get(key, default) + return getattr(cfg, key, default) + + def _apply_data_sidecar(model_params: dict, data_cfg) -> None: + if data_cfg is None: + return + + audio_codec = _cfg_get(data_cfg, "codec", None) + if audio_codec: + model_params.setdefault("audio_codec", str(audio_codec)) + + speaker_codec = _cfg_get(data_cfg, "speaker_embedding_codec", None) + if speaker_codec: + model_params.setdefault("speaker_embedding_codec", str(speaker_codec)) + + reference_index = _cfg_get(data_cfg, "speaker_reference_index_path", None) + sources = _cfg_get(data_cfg, "sources", None) or {} + if not reference_index and hasattr(sources, "values"): + reference_index = any( + _cfg_get(source, "speaker_reference_index", None) for source in sources.values() + ) + if reference_index: + model_params.setdefault("speaker_reference_prefix_enabled", True) + reference_max_seconds = _cfg_get( + data_cfg, "speaker_reference_max_seconds", None + ) + if reference_max_seconds is not None: + model_params.setdefault( + "speaker_reference_max_seconds", float(reference_max_seconds) + ) + + rate_buckets = _cfg_get(data_cfg, "speaking_rate_buckets", None) or [] + rate_buckets = [str(item) for item in rate_buckets] + if rate_buckets: + model_params["speaking_rate_buckets"] = rate_buckets + + rate_count = int(model_params.get("speaking_rate_num_buckets") or 0) + rate_enabled = bool(_cfg_get(data_cfg, "speaking_rate_enabled", False)) + if rate_enabled: + sidecar_rate_count = len(rate_buckets) + if sidecar_rate_count == 0: + sidecar_rate_count = int(_cfg_get(data_cfg, "speaking_rate_num_buckets", 0) or 0) + if sidecar_rate_count > 0: + rate_count = sidecar_rate_count + if not int(model_params.get("speaking_rate_num_buckets") or 0): + model_params["speaking_rate_num_buckets"] = rate_count + + # Quality conditioning lives in the data section of training configs. + if bool(_cfg_get(data_cfg, "quality_enabled", False)): + raw_features = _cfg_get(data_cfg, "quality_features", None) + if hasattr(raw_features, "items"): + quality_features = [ + str(feature) for feature, enabled in raw_features.items() if bool(enabled) + ] + else: + quality_features = [str(item) for item in (raw_features or ())] + raw_buckets = _cfg_get(data_cfg, "quality_buckets", None) or {} + quality_buckets = { + str(feature): [str(item) for item in (raw_buckets.get(feature, None) or ())] + for feature in (quality_features or raw_buckets.keys()) + } + if quality_buckets and "quality_buckets" not in model_params: + model_params["quality_buckets"] = quality_buckets + model_params["quality_features"] = quality_features or list( + quality_buckets.keys() + ) + raw_dropout = _cfg_get(data_cfg, "quality_dropout", None) + if raw_dropout is not None and "quality_dropout" not in model_params: + if hasattr(raw_dropout, "items"): + model_params["quality_dropout"] = { + str(feature): float(dropout) for feature, dropout in raw_dropout.items() + } + + # Training configs name the marker-token flags after their data pipeline. + background_enabled = _cfg_get(data_cfg, "speaker_embedding_origin_token_enabled", None) + if background_enabled is not None: + model_params.setdefault( + "speaker_background_token_enabled", bool(background_enabled) + ) + accurate_enabled = _cfg_get( + data_cfg, "speaker_embedding_cartesia_clone_source_token_enabled", None + ) + if accurate_enabled is not None: + model_params.setdefault("accurate_mode_token_enabled", bool(accurate_enabled)) + + if rate_count > 0 and model_params.get("text_vocab") is None: + try: + from zonos3.tts.prompt import conditioned_text_vocab_size + + quality_count = sum( + len(buckets) + for buckets in (model_params.get("quality_buckets") or {}).values() + ) + background_count = ( + 2 if model_params.get("speaker_background_token_enabled") else 0 + ) + accurate_count = ( + 1 + if model_params.get("accurate_mode_token_enabled") and background_count + else 0 + ) + model_params["text_vocab"] = conditioned_text_vocab_size( + rate_count, quality_count, background_count, accurate_count + ) + logger.debug( + "Resolved text_vocab=%d from data text vocabulary and conditioning buckets", + model_params["text_vocab"], + ) + except Exception as exc: + logger.debug("Could not resolve conditioned text_vocab from data config: %s", exc) + + def _validate_model_type(model_params: dict) -> None: + model_type = model_params.get("model_type") + if model_type is not None and str(model_type) != "zonos2": + raise ValueError( + f"Unsupported model_type={model_type!r}. ZONOS3 loads checkpoints whose params.json model_type is 'zonos2'." + ) + + def _validate_text_conditioning(model_params: dict) -> None: + value = model_params.get("text_conditioning", "bytes") + if value != "bytes": + raise ValueError(f"Unsupported text_conditioning={value!r}: ZONOS3 serves byte / SuperBPE text only.") + + model_path = Path(model_path) + + # Try params.json in checkpoint dir first + params_json = model_path / "params.json" + if params_json.exists(): + with open(params_json, "r") as f: + params = json.load(f) + # params.json may have nested structure + if "model" in params: + model_params = params["model"] + else: + model_params = params + spec = model_params.get("text_tokenizer_spec") # RELEASE_HF_20261021: hf:// or checkpoint-relative tokenizer file + if isinstance(spec, dict) and spec.get("path"): + from zonos3.utils.release import resolve_tokenizer_path + + spec["path"] = resolve_tokenizer_path(spec["path"], model_path) + + # Also check config.yaml for tokenizer sidecar fields stored in data. + for parent in [model_path, model_path.parent, model_path.parent.parent]: + config_yaml = parent / "config.yaml" + if config_yaml.exists(): + try: + from omegaconf import OmegaConf + + cfg = OmegaConf.load(config_yaml) + _apply_data_sidecar(model_params, getattr(cfg, "data", None)) + except ImportError: + import yaml + + with open(config_yaml, "r") as f: + cfg = yaml.safe_load(f) + _apply_data_sidecar( + model_params, cfg.get("data") if isinstance(cfg, dict) else None + ) + break + + _validate_model_type(model_params) + _validate_text_conditioning(model_params) + result = Zonos3Config( + **{k: v for k, v in model_params.items() if hasattr(Zonos3Config, k)} + ) + logger.debug("Loaded Zonos3Config from params.json") + return result + + # Try config.yaml in parent directories + for parent in [model_path, model_path.parent, model_path.parent.parent]: + config_yaml = parent / "config.yaml" + logger.debug("Checking for config at: %s", config_yaml) + if config_yaml.exists(): + logger.debug("Found config.yaml at: %s", config_yaml) + try: + from omegaconf import OmegaConf + + cfg = OmegaConf.load(config_yaml) + # Navigate to model config + if hasattr(cfg, "model"): + model_cfg = OmegaConf.to_container(cfg.model, resolve=True) + else: + model_cfg = OmegaConf.to_container(cfg, resolve=True) + # Also check data section for tokenizer sidecar fields. + _apply_data_sidecar(model_cfg, getattr(cfg, "data", None)) + _validate_model_type(model_cfg) + _validate_text_conditioning(model_cfg) + result = Zonos3Config( + **{k: v for k, v in model_cfg.items() if hasattr(Zonos3Config, k)} + ) + logger.debug("Loaded Zonos3Config from config.yaml") + return result + except ImportError: + # omegaconf not available, try as regular yaml + import yaml + + with open(config_yaml, "r") as f: + cfg = yaml.safe_load(f) + model_cfg = cfg.get("model", cfg) + # Also check data section for tokenizer sidecar fields. + _apply_data_sidecar(model_cfg, cfg.get("data") if isinstance(cfg, dict) else None) + _validate_model_type(model_cfg) + _validate_text_conditioning(model_cfg) + result = Zonos3Config( + **{k: v for k, v in model_cfg.items() if hasattr(Zonos3Config, k)} + ) + logger.debug("Loaded Zonos3Config from config.yaml (yaml)") + return result + + raise ValueError( + f"Could not find config.yaml or params.json for zonos3 checkpoint at {model_path}" + ) + + +def _is_zonos3_checkpoint(model_path: str) -> bool: + """Check if path is a zonos3 checkpoint with a loadable config.""" + model_path = Path(model_path) + + # Check for params.json + if (model_path / "params.json").exists(): + return True + + # Check for config.yaml in parent dirs (training run format) + for parent in [model_path, model_path.parent, model_path.parent.parent]: + if (parent / "config.yaml").exists(): + return True + + return False + + +@lru_cache() +def _load_config(model_path: str) -> Zonos3Config: + model_path = resolve_model_path(model_path) + if not _is_zonos3_checkpoint(model_path): + raise ValueError( + f"Unsupported checkpoint at {model_path!r}. This release only loads " + "Zonos3 TTS checkpoints with config.yaml or params.json." + ) + return _load_zonos3_config(model_path) + + +def cached_load_checkpoint_config(model_path: str) -> Zonos3Config: + config = _load_config(model_path) + return Zonos3Config(**config.to_dict()) + +# CONDITION_ROWS_RUNTIME_20261016 + +# CONDITION_FLAG_RUNTIME_20261017 diff --git a/zonos3/utils/moe_topk.py b/zonos3/utils/moe_topk.py new file mode 100644 index 0000000000000000000000000000000000000000..5e02740b51b32a70e6a77ba63739d7c8a72af53f --- /dev/null +++ b/zonos3/utils/moe_topk.py @@ -0,0 +1,37 @@ +from collections.abc import Mapping +from typing import Any + + +def normalize_special_topk_layers( + special_topk_layers: Mapping[Any, Any] | None, +) -> dict[int, int] | None: + if special_topk_layers is None: + return None + + normalized: dict[int, int] = {} + for layer_idx, topk in special_topk_layers.items(): + layer_idx = int(layer_idx) + topk = int(topk) + if topk < 1: + raise ValueError( + f"special_topk_layers[{layer_idx}] must be >= 1, got {topk}" + ) + normalized[layer_idx] = topk + return normalized + + +def resolve_layer_topk( + default_topk: int, + special_topk_layers: Mapping[Any, Any] | None, + layer_idx: int, +) -> int: + topk = default_topk + if special_topk_layers is not None: + topk = special_topk_layers.get( + layer_idx, special_topk_layers.get(str(layer_idx), default_topk) + ) + + topk = int(topk) + if topk < 1: + raise ValueError(f"top-k for layer {layer_idx} must be >= 1, got {topk}") + return topk diff --git a/zonos3/utils/release.py b/zonos3/utils/release.py new file mode 100644 index 0000000000000000000000000000000000000000..a4748190fa669cca376e2b80a5601be9f1e5dd10 --- /dev/null +++ b/zonos3/utils/release.py @@ -0,0 +1,98 @@ +"""hf:// locations for the ZONOS3 Mini release checkpoints (RELEASE_HF_20261021). + +Registries, configs and the server's default --model-path may name files and folders in a Hugging Face repo as +``hf:////``. ``resolve_file`` / ``resolve_dir_or_local`` fetch them into the local HF cache +(``HF_HOME``; ``HF_TOKEN`` or a stored login is needed while the repo is private) and return local paths; plain local paths pass +through unchanged, so the cluster servers keep running from their local registries. Default repo: ``ZONOS3_RELEASE_REPO`` +(Zyphra/ZONOS3_Mini_release_ckpts) and its language model ``lm/rate30_20k_r2grpo`` (R2GRPO_SWITCH_20261103: was ``lm/mect_60k``, +which was ``lm/fullenc_120k`` before MECT60K_SWITCH_20261022). +""" +from __future__ import annotations + +import os +import sys +from functools import lru_cache +from pathlib import Path + +PREFIX = "hf://" +RELEASE_REPO = os.environ.get("ZONOS3_RELEASE_REPO", "Zyphra/ZONOS3_Mini_release_ckpts") +RELEASE_LM = os.environ.get("ZONOS3_RELEASE_LM", f"{PREFIX}{RELEASE_REPO}/lm/rate30_20k_r2grpo") +RELEASE_CODEC_REGISTRY = f"{PREFIX}{RELEASE_REPO}/registries/codec_registry_keep2_plain.json" # KEEP2_DEFAULT_20261103 +RELEASE_SPEAKER_REGISTRY = f"{PREFIX}{RELEASE_REPO}/registries/speaker_encoder_registry.json" + + +def is_hf(path) -> bool: + return isinstance(path, str) and path.startswith(PREFIX) + + +def split(uri: str) -> tuple[str, str]: + """hf://owner/repo/a/b -> ('owner/repo', 'a/b'); hf://owner/repo -> ('owner/repo', '').""" + if not is_hf(uri): + raise ValueError(f"not an hf:// location: {uri!r}") + parts = uri[len(PREFIX):].strip("/").split("/", 2) + if len(parts) < 2 or not parts[0] or not parts[1]: + raise ValueError(f"hf:// location needs owner/repo: {uri!r}") + return f"{parts[0]}/{parts[1]}", (parts[2] if len(parts) > 2 else "") + + +def hf_join(base, *parts) -> str: + """Join path parts onto a base that may be an hf:// location (pathlib would collapse the '//').""" + if is_hf(base): + return base.rstrip("/") + "".join("/" + str(p).strip("/") for p in parts if str(p)) + return str(Path(str(base), *[str(p) for p in parts])) + + +def _token(): + return os.environ.get("HF_TOKEN") or os.environ.get("HUGGING_FACE_HUB_TOKEN") or None + + +@lru_cache(maxsize=None) +def resolve_file(path) -> str: + """Local path for a file: hf:// locations are downloaded into the HF cache (once per process), others pass through.""" + if path is None: + return path + path = str(path) + if not is_hf(path): + return os.path.expanduser(path) + repo_id, inside = split(path) + if not inside: + raise ValueError(f"hf:// file location needs a path inside the repo: {path!r}") + from huggingface_hub import hf_hub_download + + print(f"[release] fetching {path}", file=sys.stderr, flush=True) + return hf_hub_download(repo_id=repo_id, filename=inside, repo_type="model", token=_token()) + + +@lru_cache(maxsize=None) +def resolve_dir_or_local(path) -> str: + """Local directory for a folder: hf:// locations are snapshot-downloaded (that sub-folder only), others pass through.""" + if path is None: + return path + path = str(path) + if not is_hf(path): + return os.path.expanduser(path) + repo_id, inside = split(path) + from huggingface_hub import snapshot_download + + print(f"[release] fetching folder {path}", file=sys.stderr, flush=True) + root = snapshot_download(repo_id=repo_id, repo_type="model", token=_token(), + allow_patterns=[f"{inside}/*", f"{inside}/**"] if inside else None) + return str(Path(root) / inside) if inside else root + + +def resolve_tokenizer_path(path, model_dir) -> str: + """The text tokenizer file of a checkpoint: hf://, absolute, or relative to the checkpoint folder. A cluster-absolute + path that is missing here falls back to tokenizer/ next to params.json (the release layout).""" + if path is None: + return path + path = str(path) + if is_hf(path): + return resolve_file(path) + model_dir = Path(str(model_dir)) if model_dir is not None else None + p = Path(os.path.expanduser(path)) + if p.is_absolute(): + if p.exists() or model_dir is None: + return str(p) + alt = model_dir / "tokenizer" / p.name + return str(alt) if alt.exists() else str(p) + return str(model_dir / p) if model_dir is not None else str(p) diff --git a/zonos3/vendor/__init__.py b/zonos3/vendor/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..ad4f5f092f22219192c9f48320a2acd5e6baa0c6 --- /dev/null +++ b/zonos3/vendor/__init__.py @@ -0,0 +1 @@ +"""Vendored third-party code. See tools/vendor_nemo_tn.py.""" diff --git a/zonos3/vendor/nemo_text_processing/__init__.py b/zonos3/vendor/nemo_text_processing/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..bc443be41c4c3fcf0764eb9fd3e1828d63f8438c --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/package_info.py b/zonos3/vendor/nemo_text_processing/package_info.py new file mode 100644 index 0000000000000000000000000000000000000000..c51954122f14d009fa39356f441b351dfbc65efc --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/package_info.py @@ -0,0 +1,35 @@ +# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +MAJOR = 1 +MINOR = 2 +PATCH = 0 +PRE_RELEASE = '' + +# Use the following formatting: (major, minor, patch, pre-release) +VERSION = (MAJOR, MINOR, PATCH, PRE_RELEASE) + +__shortversion__ = '.'.join(map(str, VERSION[:3])) +__version__ = '.'.join(map(str, VERSION[:3])) + ''.join(VERSION[3:]) + +__package_name__ = 'nemo_text_processing' +__contact_names__ = 'NVIDIA' +__contact_emails__ = 'nemo-toolkit@nvidia.com' +__homepage__ = 'https://docs.nvidia.com/deeplearning/nemo/user-guide/docs/en/stable/' +__repository_url__ = 'https://github.com/nvidia/nemo-text-processing' +__download_url__ = 'https://github.com/NVIDIA/NeMo-text-processing/releases' +__description__ = 'NeMo text processing for ASR and TTS' +__license__ = 'Apache2' +__keywords__ = ' NeMo, nvidia, tts, asr, text processing, text normalization, inverse text normalization, language' diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..6168813d615ee47f1d4905842ba0fb95aa3ec58e --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/__init__.py @@ -0,0 +1,15 @@ +# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from zonos3.vendor.nemo_text_processing.text_normalization.normalize import Normalizer diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/data_loader_utils.py b/zonos3/vendor/nemo_text_processing/text_normalization/data_loader_utils.py new file mode 100644 index 0000000000000000000000000000000000000000..0f2dd008334cd7b793b47899061925225099d80b --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/data_loader_utils.py @@ -0,0 +1,361 @@ +# Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import json +import re +import string +import sys +import unicodedata +from collections import defaultdict, namedtuple +from typing import Dict, List, Optional, Set, Tuple +from unicodedata import category + +from zonos3.vendor.nemo_text_processing.utils.logging import logger + +NFC = 'NFC' +EOS_TYPE = "EOS" +PUNCT_TYPE = "PUNCT" +PLAIN_TYPE = "PLAIN" +Instance = namedtuple('Instance', 'token_type un_normalized normalized') +known_types = [ + "PLAIN", + "DATE", + "CARDINAL", + "LETTERS", + "VERBATIM", + "MEASURE", + "DECIMAL", + "ORDINAL", + "DIGIT", + "MONEY", + "TELEPHONE", + "ELECTRONIC", + "FRACTION", + "TIME", + "ADDRESS", + "ROMAN", + "RANGE", +] + + +def _load_kaggle_text_norm_file(file_path: str, to_lower: bool) -> List[Instance]: + """ + https://www.kaggle.com/richardwilliamsproat/text-normalization-for-english-russian-and-polish + Loads text file in the Kaggle Google text normalization file format: \t\t<`self` if trivial class or normalized text> + E.g. + PLAIN Brillantaisia + PLAIN is + PLAIN a + PLAIN genus + PLAIN of + PLAIN plant + PLAIN in + PLAIN family + PLAIN Acanthaceae + PUNCT . sil + + + Args: + file_path: file path to text file + + Returns: flat list of instances + """ + res = [] + with open(file_path, 'r') as fp: + for line in fp: + parts = line.strip().split("\t") + if parts[0] == "": + res.append(Instance(token_type=EOS_TYPE, un_normalized="", normalized="")) + else: + l_type, l_token, l_normalized = parts + if to_lower: + l_token = l_token.lower() + l_normalized = l_normalized.lower() + + if l_type == PLAIN_TYPE: + res.append(Instance(token_type=l_type, un_normalized=l_token, normalized=l_token)) + elif l_type != PUNCT_TYPE: + res.append(Instance(token_type=l_type, un_normalized=l_token, normalized=l_normalized)) + return res + + +def load_files(file_paths: List[str], load_func=_load_kaggle_text_norm_file, to_lower: bool = True) -> List[Instance]: + """ + Load given list of text files using the `load_func` function. + + Args: + file_paths: list of file paths + load_func: loading function + + Returns: flat list of instances + """ + res = [] + for file_path in file_paths: + res.extend(load_func(file_path=file_path, to_lower=to_lower)) + return res + + +def clean_generic(text: str) -> str: + """ + Cleans text without affecting semiotic classes. + + Args: + text: string + + Returns: cleaned string + """ + text = text.strip() + text = text.lower() + return text + + +def evaluate(preds: List[str], labels: List[str], input: Optional[List[str]] = None, verbose: bool = True) -> float: + """ + Evaluates accuracy given predictions and labels. + + Args: + preds: predictions + labels: labels + input: optional, only needed for verbosity + verbose: if true prints [input], golden labels and predictions + + Returns accuracy + """ + acc = 0 + nums = len(preds) + for i in range(nums): + pred_norm = clean_generic(preds[i]) + label_norm = clean_generic(labels[i]) + if pred_norm == label_norm: + acc = acc + 1 + else: + if input: + print(f"input: {json.dumps(input[i])}") + print(f"gold: {json.dumps(label_norm)}") + print(f"pred: {json.dumps(pred_norm)}") + return acc / nums + + +def training_data_to_tokens( + data: List[Instance], category: Optional[str] = None +) -> Dict[str, Tuple[List[str], List[str]]]: + """ + Filters the instance list by category if provided and converts it into a map from token type to list of un_normalized and normalized strings + + Args: + data: list of instances + category: optional semiotic class category name + + Returns Dict: token type -> (list of un_normalized strings, list of normalized strings) + """ + result = defaultdict(lambda: ([], [])) + for instance in data: + if instance.token_type != EOS_TYPE: + if category is None or instance.token_type == category: + result[instance.token_type][0].append(unicodedata.normalize(NFC, instance.un_normalized)) + result[instance.token_type][1].append(unicodedata.normalize(NFC, instance.normalized)) + return result + + +def training_data_to_sentences(data: List[Instance]) -> Tuple[List[str], List[str], List[Set[str]]]: + """ + Takes instance list, creates list of sentences split by EOS_Token + Args: + data: list of instances + Returns (list of unnormalized sentences, list of normalized sentences, list of sets of categories in a sentence) + """ + # split data at EOS boundaries + sentences = [] + sentence = [] + categories = [] + sentence_categories = set() + + for instance in data: + if instance.token_type == EOS_TYPE: + sentences.append(sentence) + sentence = [] + categories.append(sentence_categories) + sentence_categories = set() + else: + sentence.append(instance) + sentence_categories.update([instance.token_type]) + un_normalized = [ + " ".join([unicodedata.normalize(NFC, instance.un_normalized) for instance in sentence]) + for sentence in sentences + ] + normalized = [ + " ".join([unicodedata.normalize(NFC, instance.normalized) for instance in sentence]) for sentence in sentences + ] + return un_normalized, normalized, categories + + +def post_process_punctuation(text: str) -> str: + """ + Normalized quotes and spaces + + Args: + text: text + + Returns: text with normalized spaces and quotes + """ + text = ( + text.replace('( ', '(') + .replace(' )', ')') + .replace('{ ', '{') + .replace(' }', '}') + .replace('[ ', '[') + .replace(' ]', ']') + .replace(' ', ' ') + .replace('”', '"') + .replace("’", "'") + .replace("»", '"') + .replace("«", '"') + .replace("\\", "") + .replace("„", '"') + .replace("´", "'") + .replace("’", "'") + .replace('“', '"') + .replace("‘", "'") + .replace('`', "'") + .replace('- -', "--") + ) + + for punct in "!,.:;?": + text = text.replace(f' {punct}', punct) + return text.strip() + + +def pre_process(text: str) -> str: + """ + Optional text preprocessing before normalization (part of TTS TN pipeline) + + Args: + text: string that may include semiotic classes + + Returns: text with spaces around punctuation marks + """ + space_both = '[]' + for punct in space_both: + text = text.replace(punct, ' ' + punct + ' ') + + # remove extra space + text = re.sub(r' +', ' ', text) + return text + + +def load_file(file_path: str) -> List[str]: + """ + Loads given text file with separate lines into list of string. + + Args: + file_path: file path + + Returns: flat list of string + """ + res = [] + with open(file_path, 'r') as fp: + for line in fp: + res.append(line) + return res + + +def write_file(file_path: str, data: List[str]): + """ + Writes out list of string to file. + + Args: + file_path: file path + data: list of string + + """ + with open(file_path, 'w') as fp: + for line in data: + fp.write(line + '\n') + + +def post_process_punct(input: str, normalized_text: str, add_unicode_punct: bool = False): + """ + Post-processing of the normalized output to match input in terms of spaces around punctuation marks. + After NN normalization, Moses detokenization puts a space after + punctuation marks, and attaches an opening quote "'" to the word to the right. + E.g., input to the TN NN model is "12 test' example", + after normalization and detokenization -> "twelve test 'example" (the quote is considered to be an opening quote, + but it doesn't match the input and can cause issues during TTS voice generation.) + The current function will match the punctuation and spaces of the normalized text with the input sequence. + "12 test' example" -> "twelve test 'example" -> "twelve test' example" (the quote was shifted to match the input). + + Args: + input: input text (original input to the NN, before normalization or tokenization) + normalized_text: output text (output of the TN NN model) + add_unicode_punct: set to True to handle unicode punctuation marks as well as default string.punctuation (increases post processing time) + """ + # in the post-processing WFST graph "``" are repalced with '"" quotes (otherwise single quotes "`" won't be handled correctly) + # this function fixes spaces around them based on input sequence, so here we're making the same double quote replacement + # to make sure these new double quotes work with this function + if "``" in input and "``" not in normalized_text: + input = input.replace("``", '"') + input = [x for x in input] + normalized_text = [x for x in normalized_text] + punct_marks = [x for x in string.punctuation if x in input] + + if add_unicode_punct: + punct_unicode = [ + chr(i) + for i in range(sys.maxunicode) + if category(chr(i)).startswith("P") and chr(i) not in punct_marks and chr(i) in input + ] + punct_marks = punct_marks.extend(punct_unicode) + + for punct in punct_marks: + try: + equal = True + if input.count(punct) != normalized_text.count(punct): + equal = False + idx_in, idx_out = 0, 0 + while punct in input[idx_in:]: + idx_out = normalized_text.index(punct, idx_out) + idx_in = input.index(punct, idx_in) + + def _is_valid(idx_out, idx_in, normalized_text, input): + """Check if previous or next word match (for cases when punctuation marks are part of + semiotic token, i.e. some punctuation can be missing in the normalized text)""" + return (idx_out > 0 and idx_in > 0 and normalized_text[idx_out - 1] == input[idx_in - 1]) or ( + idx_out < len(normalized_text) - 1 + and idx_in < len(input) - 1 + and normalized_text[idx_out + 1] == input[idx_in + 1] + ) + + if not equal and not _is_valid(idx_out, idx_in, normalized_text, input): + idx_in += 1 + continue + if idx_in > 0 and idx_out > 0: + if normalized_text[idx_out - 1] == " " and input[idx_in - 1] != " ": + normalized_text[idx_out - 1] = "" + + elif normalized_text[idx_out - 1] != " " and input[idx_in - 1] == " ": + normalized_text[idx_out - 1] += " " + + if idx_in < len(input) - 1 and idx_out < len(normalized_text) - 1: + if normalized_text[idx_out + 1] == " " and input[idx_in + 1] != " ": + normalized_text[idx_out + 1] = "" + elif normalized_text[idx_out + 1] != " " and input[idx_in + 1] == " ": + normalized_text[idx_out] = normalized_text[idx_out] + " " + idx_out += 1 + idx_in += 1 + except: + logger.info(f"Skipping post-processing of {''.join(normalized_text)} for '{punct}'") + + normalized_text = "".join(normalized_text) + return re.sub(r' +', ' ', normalized_text) diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/de/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/de/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..7d200df57afefb446fde9b8fcd896f7e110f367f --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/de/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/de/data/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/de/data/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..7d200df57afefb446fde9b8fcd896f7e110f367f --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/de/data/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/de/data/electronic/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/de/data/electronic/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..7d200df57afefb446fde9b8fcd896f7e110f367f --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/de/data/electronic/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/de/data/electronic/domain.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/de/data/electronic/domain.tsv new file mode 100644 index 0000000000000000000000000000000000000000..771fc5049b1bf2c7dd0f53318ee496dcefbd10cf --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/de/data/electronic/domain.tsv @@ -0,0 +1,844 @@ +.com punkt com +.net punkt net +.org punkt org +.jp punkt jp +.de punkt de +.uk punkt uk +.fr punkt fr +.br punkt br +.it punkt it +.ru punkt ru +.es punkt es +.me punkt me +.gov punkt gov +.pl punkt pl +.ca punkt ca +.au punkt au +.cn punkt cn +.co punkt co +.in punkt in +.nl punkt nl +.edu punkt edu +.info punkt info +.eu punkt eu +.ch punkt ch +.id punkt id +.at punkt at +.kr punkt kr +.cz punkt cz +.mx punkt mx +.be punkt be +.tv punkt tv +.se punkt se +.tr punkt tr +.tw punkt tw +.al punkt al +.ua punkt ua +.ir punkt ir +.vn punkt vn +.cl punkt cl +.sk punkt sk +.ly punkt ly +.cc punkt cc +.to punkt to +.no punkt no +.fi punkt fi +.us punkt us +.pt punkt pt +.dk punkt dk +.ar punkt ar +.hu punkt hu +.tk punkt tk +.gr punkt gr +.il punkt il +.news punkt news +.ro punkt ro +.my punkt my +.biz punkt biz +.ie punkt ie +.za punkt za +.nz punkt nz +.sg punkt sg +.ee punkt ee +.th punkt th +.io punkt io +.xyz punkt xyz +.pe punkt pe +.bg punkt bg +.hk punkt hk +.rs punkt rs +.lt punkt lt +.link punkt link +.ph punkt ph +.club punkt club +.si punkt si +.site punkt site +.mobi punkt mobi +.by punkt by +.cat punkt cat +.wiki punkt wiki +.la punkt la +.ga punkt ga +.xxx punkt xxx +.cf punkt cf +.hr punkt hr +.ng punkt ng +.jobs punkt jobs +.online punkt online +.kz punkt kz +.ug punkt ug +.gq punkt gq +.ae punkt ae +.is punkt is +.lv punkt lv +.pro punkt pro +.fm punkt fm +.tips punkt tips +.ms punkt ms +.sa punkt sa +.app punkt app +.lat punkt lat +.pk punkt pk +.ws punkt ws +.top punkt top +.xn--p1ai punkt xn--p1ai +.pw punkt pw +.ai punkt ai +.kw punkt kw +.ml punkt ml +.su punkt su +.lu punkt lu +.nu punkt nu +.ec punkt ec +.uy punkt uy +.az punkt az +.ma punkt ma +.st punkt st +.asia punkt asia +.im punkt im +.am punkt am +.email punkt email +.ke punkt ke +.eg punkt eg +.live punkt live +.md punkt md +.uz punkt uz +.today punkt today +.ge punkt ge +.ba punkt ba +.bo punkt bo +.blog punkt blog +.lk punkt lk +.do punkt do +.one punkt one +.ve punkt ve +.media punkt media +.sh punkt sh +.vip punkt vip +.life punkt life +.guru punkt guru +.mp punkt mp +.int punkt int +.tz punkt tz +.desi punkt desi +.jo punkt jo +.mk punkt mk +.np punkt np +.py punkt py +.mu punkt mu +.mn punkt mn +.re punkt re +.travel punkt travel +.tn punkt tn +.gd punkt gd +.sn punkt sn +.cam punkt cam +.shop punkt shop +.mil punkt mil +.tokyo punkt tokyo +.gg punkt gg +.kg punkt kg +.cr punkt cr +.li punkt li +.cu punkt cu +.hn punkt hn +.eus punkt eus +.rocks punkt rocks +.bd punkt bd +.dev punkt dev +.fun punkt fun +.video punkt video +.gt punkt gt +.bz punkt bz +.space punkt space +.store punkt store +.mt punkt mt +.name punkt name +.work punkt work +.porn punkt porn +.pub punkt pub +.kh punkt kh +.icu punkt icu +.as punkt as +.cy punkt cy +.pr punkt pr +.careers punkt careers +.ps punkt ps +.dz punkt dz +.iq punkt iq +.ltd punkt ltd +.pa punkt pa +.sv punkt sv +.qa punkt qa +.design punkt design +.sc punkt sc +.sy punkt sy +.aero punkt aero +.tech punkt tech +.best punkt best +.scot punkt scot +.win punkt win +.ni punkt ni +.bzh punkt bzh +.lb punkt lb +.city punkt city +.digital punkt digital +.red punkt red +.pg punkt pg +.world punkt world +.ag punkt ag +.ci punkt ci +.report punkt report +.ac punkt ac +.center punkt center +.ad punkt ad +.ovh punkt ovh +.om punkt om +.cloud punkt cloud +.press punkt press +.zw punkt zw +.vg punkt vg +.cx punkt cx +.website punkt website +.plus punkt plus +.page punkt page +.bs punkt bs +.cd punkt cd +.gh punkt gh +.moe punkt moe +.help punkt help +.download punkt download +.ao punkt ao +.cm punkt cm +.af punkt af +.click punkt click +.mg punkt mg +.tm punkt tm +.na punkt na +.pics punkt pics +.mv punkt mv +.market punkt market +.rw punkt rw +.fo punkt fo +.fj punkt fj +.tl punkt tl +.gratis punkt gratis +.art punkt art +.mc punkt mc +.mo punkt mo +.gal punkt gal +.coop punkt coop +.nc punkt nc +.run punkt run +.mz punkt mz +.tj punkt tj +.zone punkt zone +.cv punkt cv +.bh punkt bh +.place punkt place +.gy punkt gy +.agency punkt agency +.kn punkt kn +.mm punkt mm +.bid punkt bid +.bj punkt bj +.je punkt je +.gs punkt gs +.global punkt global +.lol punkt lol +.tube punkt tube +.lc punkt lc +.bm punkt bm +.ninja punkt ninja +.bn punkt bn +.review punkt review +.bi punkt bi +.ht punkt ht +.sm punkt sm +.ax punkt ax +.pm punkt pm +.ink punkt ink +.vc punkt vc +.so punkt so +.tel punkt tel +.cw punkt cw +.uno punkt uno +.casa punkt casa +.network punkt network +.buzz punkt buzz +.mw punkt mw +.vu punkt vu +.guide punkt guide +.bf punkt bf +.mq punkt mq +.sex punkt sex +.sr punkt sr +.zm punkt zm +.onl punkt onl +.vet punkt vet +.bw punkt bw +.jm punkt jm +.bar punkt bar +.gp punkt gp +.pf punkt pf +.ne punkt ne +.va punkt va +.bt punkt bt +.sd punkt sd +.expert punkt expert +.kim punkt kim +.africa punkt africa +.mr punkt mr +.gi punkt gi +.tg punkt tg +.cg punkt cg +.ls punkt ls +.sb punkt sb +.ck punkt ck +.gf punkt gf +.yt punkt yt +.dm punkt dm +.realtor punkt realtor +.aw punkt aw +.sz punkt sz +.london punkt london +.et punkt et +.ky punkt ky +.cool punkt cool +.lr punkt lr +.bb punkt bb +.support punkt support +.taipei punkt taipei +.sl punkt sl +.company punkt company +.dj punkt dj +.social punkt social +.gm punkt gm +.xn--mgberp4a5d4ar punkt xn--mgberp4a5d4ar +.love punkt love +.cymru punkt cymru +.directory punkt directory +.games punkt games +.bio punkt bio +.wang punkt wang +.watch punkt watch +.cafe punkt cafe +.care punkt care +.supply punkt supply +.ooo punkt ooo +.group punkt group +.tools punkt tools +.sx punkt sx +.rest punkt rest +.law punkt law +.wales punkt wales +.movie punkt movie +.monster punkt monster +.studio punkt studio +.wtf punkt wtf +.direct punkt direct +.education punkt education +.ye punkt ye +.fit punkt fit +.events punkt events +.berlin punkt berlin +.services punkt services +.church punkt church +.pn punkt pn +.tc punkt tc +.tf punkt tf +.nyc punkt nyc +.town punkt town +.xn--90ais punkt xn--90ais +.xn--j1amh punkt xn--j1amh +.ist punkt ist +.bet punkt bet +.sale punkt sale +.sport punkt sport +.brussels punkt brussels +.moscow punkt moscow +.menu punkt menu +.express punkt express +.vlaanderen punkt vlaanderen +.blue punkt blue +.cars punkt cars +.deals punkt deals +.host punkt host +.academy punkt academy +.training punkt training +.vi punkt vi +.men punkt men +.team punkt team +.canon punkt canon +.leclerc punkt leclerc +.solutions punkt solutions +.community punkt community +.land punkt land +.basketball punkt basketball +.gallery punkt gallery +.sexy punkt sexy +.codes punkt codes +.swiss punkt swiss +.camp punkt camp +.software punkt software +.auction punkt auction +.nrw punkt nrw +.style punkt style +.coffee punkt coffee +.paris punkt paris +.graphics punkt graphics +.holiday punkt holiday +.wine punkt wine +.dog punkt dog +.dating punkt dating +.radio punkt radio +.pet punkt pet +.parts punkt parts +.international punkt international +.xin punkt xin +.bike punkt bike +.school punkt school +.stream punkt stream +.frl punkt frl +.tours punkt tours +.audio punkt audio +.legal punkt legal +.chat punkt chat +.xn--wgbl6a punkt xn--wgbl6a +.photo punkt photo +.surf punkt surf +.pink punkt pink +.xn--p1acf punkt xn--p1acf +.kiwi punkt kiwi +.doctor punkt doctor +.museum punkt museum +.science punkt science +.football punkt football +.xn--80asehdb punkt xn--80asehdb +.fail punkt fail +.moda punkt moda +.party punkt party +.rip punkt rip +.fan punkt fan +.loan punkt loan +.works punkt works +.business punkt business +.bayern punkt bayern +.money punkt money +.xn--9dbq2a punkt xn--9dbq2a +.show punkt show +.house punkt house +.futbol punkt futbol +.krd punkt krd +.fyi punkt fyi +.gold punkt gold +.nagoya punkt nagoya +.quebec punkt quebec +.xn--3e0b707e punkt xn--3e0b707e +.reviews punkt reviews +.farm punkt farm +.photography punkt photography +.photos punkt photos +.xn--tckwe punkt xn--tckwe +.cab punkt cab +.army punkt army +.hamburg punkt hamburg +.amsterdam punkt amsterdam +.pictures punkt pictures +.cash punkt cash +.adult punkt adult +.ski punkt ski +.poker punkt poker +.black punkt black +.fashion punkt fashion +.clinic punkt clinic +.gdn punkt gdn +.tatar punkt tatar +.exchange punkt exchange +.date punkt date +.trade punkt trade +.boutique punkt boutique +.shoes punkt shoes +.ren punkt ren +.green punkt green +.band punkt band +.ltda punkt ltda +.istanbul punkt istanbul +.health punkt health +.webcam punkt webcam +.earth punkt earth +.garden punkt garden +.yoga punkt yoga +.wien punkt wien +.ngo punkt ngo +.xn--80adxhks punkt xn--80adxhks +.xn--80aswg punkt xn--80aswg +.xn--fiqs8s punkt xn--fiqs8s +.repair punkt repair +.xn--90a3ac punkt xn--90a3ac +.fitness punkt fitness +.xn--c1avg punkt xn--c1avg +.immo punkt immo +.observer punkt observer +.vin punkt vin +.singles punkt singles +.haus punkt haus +.okinawa punkt okinawa +.corsica punkt corsica +.irish punkt irish +.university punkt university +.casino punkt casino +.how punkt how +.td punkt td +.dance punkt dance +.technology punkt technology +.barcelona punkt barcelona +.nf punkt nf +.golf punkt golf +.wf punkt wf +.estate punkt estate +.yokohama punkt yokohama +.systems punkt systems +.rugby punkt rugby +.wedding punkt wedding +.healthcare punkt healthcare +.koeln punkt koeln +.enterprises punkt enterprises +.film punkt film +.xn--node punkt xn--node +.accountant punkt accountant +.taxi punkt taxi +.tienda punkt tienda +.nr punkt nr +.toys punkt toys +.gent punkt gent +.vision punkt vision +.rent punkt rent +.fans punkt fans +.energy punkt energy +.jetzt punkt jetzt +.cards punkt cards +.domains punkt domains +.marketing punkt marketing +.soy punkt soy +.foundation punkt foundation +.horse punkt horse +.fish punkt fish +.promo punkt promo +.institute punkt institute +.restaurant punkt restaurant +.exposed punkt exposed +.flowers punkt flowers +.gift punkt gift +.jewelry punkt jewelry +.ki punkt ki +.coach punkt coach +.clothing punkt clothing +.fund punkt fund +.finance punkt finance +.dental punkt dental +.forsale punkt forsale +.tirol punkt tirol +.xn--mgbayh7gpa punkt xn--mgbayh7gpa +.family punkt family +.xn--80ao21a punkt xn--80ao21a +.gn punkt gn +.xn--d1acj3b punkt xn--d1acj3b +.madrid punkt madrid +.soccer punkt soccer +.eco punkt eco +.kitchen punkt kitchen +.consulting punkt consulting +.immobilien punkt immobilien +.xn--90ae punkt xn--90ae +.beer punkt beer +.capital punkt capital +.rio punkt rio +.miami punkt miami +.alsace punkt alsace +.archi punkt archi +.ruhr punkt ruhr +.lgbt punkt lgbt +.hosting punkt hosting +.delivery punkt delivery +.limited punkt limited +.properties punkt properties +.baby punkt baby +.bible punkt bible +.schule punkt schule +.bnpparibas punkt bnpparibas +.shopping punkt shopping +.partners punkt partners +.recipes punkt recipes +.bank punkt bank +.lighting punkt lighting +.ong punkt ong +.hm punkt hm +.srl punkt srl +.discount punkt discount +.gifts punkt gifts +.pizza punkt pizza +.vegas punkt vegas +.bot punkt bot +.builders punkt builders +.llc punkt llc +.tax punkt tax +.realty punkt realty +.equipment punkt equipment +.gmbh punkt gmbh +.tattoo punkt tattoo +.homes punkt homes +.saarland punkt saarland +.property punkt property +.kyoto punkt kyoto +.xn--y9a3aq punkt xn--y9a3aq +.solar punkt solar +.weber punkt weber +.gop punkt gop +.mom punkt mom +.fishing punkt fishing +.cricket punkt cricket +.faith punkt faith +.inc punkt inc +.rentals punkt rentals +.build punkt build +.college punkt college +.sharp punkt sharp +.camera punkt camera +.xn--h2brj9c punkt xn--h2brj9c +.cern punkt cern +.sydney punkt sydney +.dhl punkt dhl +.salon punkt salon +.cologne punkt cologne +.cyou punkt cyou +.game punkt game +.vote punkt vote +.flights punkt flights +.glass punkt glass +.melbourne punkt melbourne +.hiphop punkt hiphop +.mba punkt mba +.post punkt post +.voyage punkt voyage +.ventures punkt ventures +.courses punkt courses +.kaufen punkt kaufen +.productions punkt productions +.abudhabi punkt abudhabi +.hospital punkt hospital +.shiksha punkt shiksha +.racing punkt racing +.furniture punkt furniture +.capetown punkt capetown +.aq punkt aq +.engineering punkt engineering +.study punkt study +.luxury punkt luxury +.reisen punkt reisen +.sandvik punkt sandvik +.surgery punkt surgery +.hockey punkt hockey +.audi punkt audi +.contractors punkt contractors +.florist punkt florist +.cheap punkt cheap +.actor punkt actor +.computer punkt computer +.xn--mgbaam7a8h punkt xn--mgbaam7a8h +.coupons punkt coupons +.management punkt management +.organic punkt organic +.cooking punkt cooking +.markets punkt markets +.construction punkt construction +.voto punkt voto +.realestate punkt realestate +.xn--l1acc punkt xn--l1acc +.engineer punkt engineer +.lawyer punkt lawyer +.physio punkt physio +.yandex punkt yandex +.pharmacy punkt pharmacy +.insure punkt insure +.boston punkt boston +.xn--j6w193g punkt xn--j6w193g +.guitars punkt guitars +.saxo punkt saxo +.car punkt car +.osaka punkt osaka +.xn--mk1bu44c punkt xn--mk1bu44c +.industries punkt industries +.tennis punkt tennis +.abbott punkt abbott +.sap punkt sap +.xn--ses554g punkt xn--ses554g +.gw punkt gw +.credit punkt credit +.xn--kpry57d punkt xn--kpry57d +.supplies punkt supplies +.holdings punkt holdings +.ryukyu punkt ryukyu +.diamonds punkt diamonds +.apartments punkt apartments +.associates punkt associates +.cruises punkt cruises +.fk punkt fk +.theater punkt theater +.ceo punkt ceo +.rodeo punkt rodeo +.attorney punkt attorney +.viajes punkt viajes +.google punkt google +.auto punkt auto +.kp punkt kp +.diet punkt diet +.joburg punkt joburg +.gives punkt gives +.villas punkt villas +.financial punkt financial +.sarl punkt sarl +.catering punkt catering +.vacations punkt vacations +.rehab punkt rehab +.xn--fiqz9s punkt xn--fiqz9s +.gu punkt gu +.investments punkt investments +.qpon punkt qpon +.forex punkt forex +.gripe punkt gripe +.stockholm punkt stockholm +.career punkt career +.bingo punkt bingo +.limo punkt limo +.xn--d1alf punkt xn--d1alf +.storage punkt storage +.cleaning punkt cleaning +.dentist punkt dentist +.hiv punkt hiv +.degree punkt degree +.plumbing punkt plumbing +.citic punkt citic +.crs punkt crs +.edeka punkt edeka +.lease punkt lease +.bargains punkt bargains +.durban punkt durban +.condos punkt condos +.loans punkt loans +.xn--wgbh1c punkt xn--wgbh1c +.uol punkt uol +.accountants punkt accountants +.country punkt country +.seat punkt seat +.aws punkt aws +.yachts punkt yachts +.luxe punkt luxe +.barclays punkt barclays +.bradesco punkt bradesco +.xn--55qx5d punkt xn--55qx5d +.maison punkt maison +.kred punkt kred +.xn--czr694b punkt xn--czr694b +.xn--e1a4c punkt xn--e1a4c +.xn--ngbc5azd punkt xn--ngbc5azd +.komatsu punkt komatsu +.reise punkt reise +.xn--kput3i punkt xn--kput3i +.trading punkt trading +.claims punkt claims +.xn--q9jyb4c punkt xn--q9jyb4c +.mortgage punkt mortgage +.arpa punkt arpa +.xn--o3cw4h punkt xn--o3cw4h +.ricoh punkt ricoh +.xn--6qq986b3xl punkt xn--6qq986b3xl +.sener punkt sener +.xn--54b7fta0cc punkt xn--54b7fta0cc +.versicherung punkt versicherung +.mango punkt mango +.charity punkt charity +.feedback punkt feedback +.security punkt security +.ipiranga punkt ipiranga +.xn--qxam punkt xn--qxam +.xn--zfr164b punkt xn--zfr164b +.creditunion punkt creditunion +.afl punkt afl +.christmas punkt christmas +.broker punkt broker +.vodka punkt vodka +.xn--czru2d punkt xn--czru2d +.gay punkt gay +.tickets punkt tickets +.memorial punkt memorial +.xn--t60b56a punkt xn--t60b56a +.neustar punkt neustar +.mma punkt mma +.xn--io0a7i punkt xn--io0a7i +.xn--3ds443g punkt xn--3ds443g +.navy punkt navy +.aquarelle punkt aquarelle +.juegos punkt juegos +.km punkt km +.total punkt total +.democrat punkt democrat +.sucks punkt sucks +.tires punkt tires +.fage punkt fage +.xn--mgbab2bd punkt xn--mgbab2bd +.jll punkt jll +.blackfriday punkt blackfriday +.jcb punkt jcb +.xn--vuq861b punkt xn--vuq861b +.weir punkt weir +.aco punkt aco +.boats punkt boats +.republican punkt republican +.man punkt man +.motorcycles punkt motorcycles +.hsbc punkt hsbc +.abogado punkt abogado +.reit punkt reit +.axa punkt axa +.xn--6frz82g punkt xn--6frz82g +.sky punkt sky +.dvag punkt dvag +.insurance punkt insurance +.kpn punkt kpn +.praxi punkt praxi +.globo punkt globo +.statebank punkt statebank +.xn--fiq228c5hs punkt xn--fiq228c5hs +.bmw punkt bmw +.xn--g2xx48c punkt xn--g2xx48c +.abb punkt abb +.toray punkt toray +.hisamitsu punkt hisamitsu +.philips punkt philips +.schwarz punkt schwarz +.monash punkt monash +.airforce punkt airforce +.erni punkt erni +.latrobe punkt latrobe +.xn--czrs0t punkt xn--czrs0t \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/de/data/electronic/server_name.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/de/data/electronic/server_name.tsv new file mode 100644 index 0000000000000000000000000000000000000000..d2428d841a8f3ab70c096e5d878ed6381cdd05fb --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/de/data/electronic/server_name.tsv @@ -0,0 +1,17 @@ +gmail g mail +nvidia +outlook +hotmail +yahoo +live +yandex +orange +wanadoo +web +comcast +aol +signup +brettspielversand +Sinnesbereichen +sinnesbereichen +amazon \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/de/data/electronic/symbols.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/de/data/electronic/symbols.tsv new file mode 100644 index 0000000000000000000000000000000000000000..57a0317f86823a8f55a0e5a3e7e4614b8a367ffa --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/de/data/electronic/symbols.tsv @@ -0,0 +1,20 @@ +. punkt +: doppelpunkt +- bindestrich +_ unterstrich +! ausrufezeichen +# raute +$ dollar zeichen +% prozent zeichen +& und +' apostroph +* asterisk ++ plus +/ slash += gleichheitszeichen +? fragezeichen +^ zirkumflex +{ linke klammer auf +} rechte klammer zu +~ tilde +, komma \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/de/data/fractions.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/de/data/fractions.tsv new file mode 100644 index 0000000000000000000000000000000000000000..50d8847a1fc305cb4c82b951c6119baed7d5f512 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/de/data/fractions.tsv @@ -0,0 +1,30 @@ +halb zwei +drittel drei +viertel vier +fünftel fünf +sechstel sechs +siebtel sieben +achtel acht +neuntel neun +zehntel zehn +elftel elf +zwölftel zwölf +dreizehntel dreizehn +vierzehntel vierzehn +fünfzehntel fünfzehn +sechzehntel sechzehn +siebzehntel siebzehn +achtzehntel achtzehn +neunzehntel neunzehn +zwanzigstel zwanzig +dreißigstel dreißig +vierzigstel vierzig +fünfzigstel fünfzig +sechzigstel sechzig +siebzigstel siebzig +achtzigstel achtzig +neunzigstel neunzig +hundertstel hundert +tausendstel tausend +millionstel million +milliardstel milliarde \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/de/data/measure/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/de/data/measure/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..7d200df57afefb446fde9b8fcd896f7e110f367f --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/de/data/measure/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/de/data/measure/measurements.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/de/data/measure/measurements.tsv new file mode 100644 index 0000000000000000000000000000000000000000..8292eca7fa2c0adff9c3154114b2d67a023eab14 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/de/data/measure/measurements.tsv @@ -0,0 +1,82 @@ +% prozent +f fahrenheit +c celsius +°C grad celsius +°F grad fahrenheit +K kelvin +km kilometer +m meter +cm zentimeter +mm millimeter +μm mikrometer +nm nanometer +dm dezimeter +pm pikometer +hm hektometer +ha hektar +mi meile +m² quadrat meter -0.0001 +km² quadrat kilometer -0.0001 +mm² quadrat millimeter -0.0001 +cm² quadrat zentimeter -0.0001 +m³ kubik meter -0.0001 +km³ kubik kilometer -0.0001 +mm³ kubik millimeter -0.0001 +cm³ kubik zentimeter -0.0001 +m2 quadrat meter +km2 quadrat kilometer +mm2 quadrat millimeter +cm2 quadrat zentimeter +m3 kubik meter +km3 kubik kilometer +mm3 kubik millimeter +cm3 kubik zentimeter +ft fuß +g gramm +µg mikrogramm +mg milligramm +kg kilogramm +lb pfund +oz unze +cwt zentner +gr korn +dr drachne +μg mikrogramm +pg petagramm +h stunde +s sekunde +min minute +ds decisekunde +ms millisekunde +μs mikrosekunde +hz hertz +kw kilowatt +kwh kilowattstunde +ghz gigahertz +khz kilohertz +mhz megahertz +v volt +mc megacoulomb +mA milliampere +A ampere +tw terawatt +mv millivolt +mw megawatt +gw gigawatt +ω ohm +db dezibel +gb gigabyte +kb kilobit +pb petabit +mb megabyte +kb kilobyte +tb terabyte +kv kilovolt +mv megavolt +kn kilonewton +ml milliliter +l liter +ma megaampere +bar bar +kcal kilokalorie +cal kalorie \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/de/data/measure/suppletive.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/de/data/measure/suppletive.tsv new file mode 100644 index 0000000000000000000000000000000000000000..449d545f67b5ed0b79b7bbb98d5ace138d0d2850 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/de/data/measure/suppletive.tsv @@ -0,0 +1,10 @@ +meile meilen +unze unzen +drachne drachnen +stunde stunden +sekunde sekunden +minute minuten +minute minuten +bit bits +byte bytes +kalorie kalorien \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/de/data/money/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/de/data/money/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..7d200df57afefb446fde9b8fcd896f7e110f367f --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/de/data/money/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/de/data/money/currency.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/de/data/money/currency.tsv new file mode 100644 index 0000000000000000000000000000000000000000..fa6c618ce5a837bbcda12fb9338dfbc350c6942b --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/de/data/money/currency.tsv @@ -0,0 +1,25 @@ +€ euro +$ dollar +$ us dollar +£ pfund +₩ won +nzd neuseeland dollar +rs rupie +chf schweizer franken +dkk dänische krone +fim finnische mark +aed dirham +¥ yen +czk tschechische krone +mro ouguiya +pkr pakistanische rupie +crc colon +hkd hong kong dollar +npr nepalesische rupee +awg aruba florin +nok norwegische krone +tzs tansania schilling +sek schwedisch krone +cyp zypern pfund +dm d-mark +dm deutsche mark \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/de/data/money/currency_minor_plural.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/de/data/money/currency_minor_plural.tsv new file mode 100644 index 0000000000000000000000000000000000000000..9818ee7437939e98aa1e9dd98cbea43e1991ca8d --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/de/data/money/currency_minor_plural.tsv @@ -0,0 +1,3 @@ +$ cent +€ cent +£ pence \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/de/data/money/currency_minor_singular.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/de/data/money/currency_minor_singular.tsv new file mode 100644 index 0000000000000000000000000000000000000000..fe629d87b693de1180ee75c642190687a754e126 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/de/data/money/currency_minor_singular.tsv @@ -0,0 +1,3 @@ +$ cent +€ cent +£ penny \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/de/data/months/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/de/data/months/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..7d200df57afefb446fde9b8fcd896f7e110f367f --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/de/data/months/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/de/data/months/abbr_to_name.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/de/data/months/abbr_to_name.tsv new file mode 100644 index 0000000000000000000000000000000000000000..81a323845b149ef9b7a29ef3cc0d0fbe91582e25 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/de/data/months/abbr_to_name.tsv @@ -0,0 +1,13 @@ +jan januar +feb februar +mär märz +apr april +mai mai +jun juni +jul juli +aug august +sep september +sept september +okt oktober +nov november +dez dezember \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/de/data/months/numbers.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/de/data/months/numbers.tsv new file mode 100644 index 0000000000000000000000000000000000000000..012afcc2a34d3747f0d5f9ec73f5635f4ad231fb --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/de/data/months/numbers.tsv @@ -0,0 +1,24 @@ +1 januar +2 februar +3 märz +4 april +5 mai +6 juni +7 juli +8 august +9 september +10 oktober +11 november +12 dezember +01 januar +02 februar +03 märz +04 april +05 mai +06 juni +07 juli +08 august +09 september +10 oktober +11 november +12 dezember \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/de/data/numbers/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/de/data/numbers/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..7d200df57afefb446fde9b8fcd896f7e110f367f --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/de/data/numbers/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/de/data/numbers/digit.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/de/data/numbers/digit.tsv new file mode 100644 index 0000000000000000000000000000000000000000..7634e5ac545e4d33af493cf16c4652c8c964bc49 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/de/data/numbers/digit.tsv @@ -0,0 +1,8 @@ +zwei 2 +drei 3 +vier 4 +fünf 5 +sechs 6 +sieben 7 +acht 8 +neun 9 \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/de/data/numbers/ones.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/de/data/numbers/ones.tsv new file mode 100644 index 0000000000000000000000000000000000000000..7d12cd59b1d874b5fb550f3ce56f000c6530c76d --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/de/data/numbers/ones.tsv @@ -0,0 +1,3 @@ +eine 1 +ein 1 +eins 1 -0.0001 \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/de/data/numbers/quantities.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/de/data/numbers/quantities.tsv new file mode 100644 index 0000000000000000000000000000000000000000..712fe0f3851440d0f42b5f4aa9e5b461f719290e --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/de/data/numbers/quantities.tsv @@ -0,0 +1,12 @@ +million +millionen +milliarde +milliarden +billion +billionen +billiarde +billiarden +trillion +trillionen +trilliarde +trilliarde \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/de/data/numbers/teen.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/de/data/numbers/teen.tsv new file mode 100644 index 0000000000000000000000000000000000000000..854712ea61566a3374a35f45e360012b49be9161 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/de/data/numbers/teen.tsv @@ -0,0 +1,10 @@ +zehn 10 +elf 11 +zwölf 12 +dreizehn 13 +vierzehn 14 +fünfzehn 15 +sechzehn 16 +siebzehn 17 +achtzehn 18 +neunzehn 19 \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/de/data/numbers/ties.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/de/data/numbers/ties.tsv new file mode 100644 index 0000000000000000000000000000000000000000..28a3f80324558f078eeb46fe7b61ec3c578ed687 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/de/data/numbers/ties.tsv @@ -0,0 +1,8 @@ +zwanzig 2 +dreißig 3 +vierzig 4 +fünfzig 5 +sechzig 6 +siebzig 7 +achtzig 8 +neunzig 9 \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/de/data/numbers/zero.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/de/data/numbers/zero.tsv new file mode 100644 index 0000000000000000000000000000000000000000..e27b1c6405a456a712addc57b4199493bd5133a7 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/de/data/numbers/zero.tsv @@ -0,0 +1 @@ +null 0 \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/de/data/ordinals/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/de/data/ordinals/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..7d200df57afefb446fde9b8fcd896f7e110f367f --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/de/data/ordinals/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/de/data/ordinals/digit.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/de/data/ordinals/digit.tsv new file mode 100644 index 0000000000000000000000000000000000000000..31c91f635d8066c31f164456b776f139c5012d96 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/de/data/ordinals/digit.tsv @@ -0,0 +1,9 @@ +ers eins +zwei zwei +drit drei +vier vier +fünf fünf +sechs sechs +sieb sieben +ach acht +neun neun \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/de/data/ordinals/thousands.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/de/data/ordinals/thousands.tsv new file mode 100644 index 0000000000000000000000000000000000000000..a97b94c744da416806591ac180ebb07e2134bae8 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/de/data/ordinals/thousands.tsv @@ -0,0 +1,4 @@ +hunderts hundert +tausends tausend +millions million +milliards milliarde \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/de/data/ordinals/ties.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/de/data/ordinals/ties.tsv new file mode 100644 index 0000000000000000000000000000000000000000..4ab2bd5080460ee49a1858839f4b32fdb8098e6f --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/de/data/ordinals/ties.tsv @@ -0,0 +1,8 @@ +zwanzigs zwanzig +dreißigs dreißig +vierzigs vierzig +fünfzigs fünfzig +sechzigs sechzig +siebzigs siebzig +achtzigs achtzig +neunzigs neunzig \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/de/data/time/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/de/data/time/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..7d200df57afefb446fde9b8fcd896f7e110f367f --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/de/data/time/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/de/data/time/hour_to.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/de/data/time/hour_to.tsv new file mode 100644 index 0000000000000000000000000000000000000000..e681afc6c25c71eef187fc7a300df91cb411149b --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/de/data/time/hour_to.tsv @@ -0,0 +1,12 @@ +1 12 +2 1 +3 2 +4 3 +5 4 +6 5 +7 6 +8 7 +9 8 +10 9 +11 10 +12 11 \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/de/data/time/hour_to_night.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/de/data/time/hour_to_night.tsv new file mode 100644 index 0000000000000000000000000000000000000000..b7765ac2a3c6158197b46e5886345e0e08b6b3ac --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/de/data/time/hour_to_night.tsv @@ -0,0 +1,13 @@ +12 0 +1 13 +2 14 +3 15 +4 16 +5 17 +6 18 +7 19 +8 20 +9 21 +10 22 +11 23 +12 24 \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/de/data/time/minute_to.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/de/data/time/minute_to.tsv new file mode 100644 index 0000000000000000000000000000000000000000..edab4d5b03d6fd6c8187ea76523f61f0df3410b2 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/de/data/time/minute_to.tsv @@ -0,0 +1,59 @@ +1 59 +2 58 +3 57 +4 56 +5 55 +6 54 +7 53 +8 52 +9 51 +10 50 +11 49 +12 48 +13 47 +14 46 +15 45 +16 44 +17 43 +18 42 +19 41 +20 40 +21 39 +22 38 +23 37 +24 36 +25 35 +26 34 +27 33 +28 32 +29 31 +30 30 +31 29 +32 28 +33 27 +34 26 +35 25 +36 24 +37 23 +38 22 +39 21 +40 20 +41 19 +42 18 +43 17 +44 16 +45 15 +46 14 +47 13 +48 12 +49 11 +50 10 +51 9 +52 8 +53 7 +54 6 +55 5 +56 4 +57 3 +58 2 +59 1 diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/de/data/time/time_zone.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/de/data/time/time_zone.tsv new file mode 100644 index 0000000000000000000000000000000000000000..3e0ade467a844e4f040d51c3334341b729432174 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/de/data/time/time_zone.tsv @@ -0,0 +1,7 @@ +cst c s t +cet c e t +pst p s t +est e s t +pt p t +et e t +gmt g m t diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/de/data/whitelist.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/de/data/whitelist.tsv new file mode 100644 index 0000000000000000000000000000000000000000..9ac21da340603f3a2d4bca676039b7bd72f8d26a --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/de/data/whitelist.tsv @@ -0,0 +1,21 @@ +z.B. zum beispiel +d.h. dass heißt +Dr. doktor +Mr. mister +Mrs. misses +Ms. miss +Nr. nummer +2D zwei-D +2-D zwei-D +3D drei-D +3-D drei-D +3-D-Mammogram drei-D-Mammogram +3D-Mammogram drei-D-Mammogram +2-D-Mammogram zwei-D-Mammogram +2D-Mammogram zwei-D-Mammogram +3-D-Mammographie drei-D-Mammographie +3D-Mammographie drei-D-Mammographie +2-D-Mammographie zwei-D-Mammographie +2D-Mammographie zwei-D-Mammographie +3-D-Drucker drei-D-Drucker +3D-Drucker drei-D-Drucker \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/de/taggers/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/de/taggers/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..7d200df57afefb446fde9b8fcd896f7e110f367f --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/de/taggers/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/de/taggers/cardinal.py b/zonos3/vendor/nemo_text_processing/text_normalization/de/taggers/cardinal.py new file mode 100644 index 0000000000000000000000000000000000000000..9c8cf8c07102f683c3de34e60798428fab473e87 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/de/taggers/cardinal.py @@ -0,0 +1,200 @@ +# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from collections import defaultdict + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.de.utils import get_abs_path, load_labels +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import ( + NEMO_DIGIT, + NEMO_SIGMA, + GraphFst, + delete_space, + insert_space, +) + +AND = "und" + + +def get_ties_digit(digit_path: str, tie_path: str) -> 'pynini.FstLike': + """ + getting all inverse normalizations for numbers between 21 - 100 + + Args: + digit_path: file to digit tsv + tie_path: file to tie tsv, e.g. 20, 30, etc. + Returns: + res: fst that converts numbers to their verbalization + """ + + digits = defaultdict(list) + ties = defaultdict(list) + for k, v in load_labels(digit_path): + digits[v].append(k) + digits["1"] = ["ein"] + + for k, v in load_labels(tie_path): + ties[v].append(k) + + d = [] + for i in range(21, 100): + s = str(i) + if s[1] == "0": + continue + + for di in digits[s[1]]: + for ti in ties[s[0]]: + word = di + f" {AND} " + ti + d.append((word, s)) + + res = pynini.string_map(d) + return res + + +class CardinalFst(GraphFst): + """ + Finite state transducer for classifying cardinals, e.g. + "101" -> cardinal { integer: "ein hundert und zehn" } + + Args: + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, deterministic: bool = False): + super().__init__(name="cardinal", kind="classify", deterministic=deterministic) + + graph_zero = pynini.string_file(get_abs_path("data/numbers/zero.tsv")).invert() + graph_digit_no_one = pynini.string_file(get_abs_path("data/numbers/digit.tsv")).invert() + graph_one = pynini.string_file(get_abs_path("data/numbers/ones.tsv")).invert() + graph_digit = graph_digit_no_one | graph_one + self.digit = (graph_digit | graph_zero).optimize() + graph_teen = pynini.string_file(get_abs_path("data/numbers/teen.tsv")).invert() + + graph_ties = pynini.string_file(get_abs_path("data/numbers/ties.tsv")).invert() + # separator = "." + + def tens_no_zero(): + return ( + pynutil.delete("0") + graph_digit + | get_ties_digit( + get_abs_path("data/numbers/digit.tsv"), get_abs_path("data/numbers/ties.tsv") + ).invert() + | graph_teen + | (graph_ties + pynutil.delete("0")) + ) + + def hundred_non_zero(): + return (graph_digit_no_one + insert_space | pynini.cross("1", "ein ")) + pynutil.insert("hundert") + ( + pynini.closure(insert_space + pynutil.insert(AND, weight=0.0001), 0, 1) + insert_space + tens_no_zero() + | pynutil.delete("00") + ) | pynutil.delete("0") + tens_no_zero() + + def thousand(): + return (hundred_non_zero() + insert_space + pynutil.insert("tausend") | pynutil.delete("000")) + ( + insert_space + hundred_non_zero() | pynutil.delete("000") + ) + + optional_plural_quantity_en = pynini.closure(pynutil.insert("en", weight=-0.0001), 0, 1) + optional_plural_quantity_n = pynini.closure(pynutil.insert("n", weight=-0.0001), 0, 1) + graph_million = pynini.union( + hundred_non_zero() + insert_space + pynutil.insert("million") + optional_plural_quantity_en, + pynutil.delete("000"), + ) + + graph_billion = pynini.union( + hundred_non_zero() + insert_space + pynutil.insert("milliarde") + optional_plural_quantity_n, + pynutil.delete("000"), + ) + + graph_trillion = pynini.union( + hundred_non_zero() + insert_space + pynutil.insert("billion") + optional_plural_quantity_en, + pynutil.delete("000"), + ) + + graph_quadrillion = pynini.union( + hundred_non_zero() + insert_space + pynutil.insert("billiarde") + optional_plural_quantity_n, + pynutil.delete("000"), + ) + + graph_quintillion = pynini.union( + hundred_non_zero() + insert_space + pynutil.insert("trillion") + optional_plural_quantity_en, + pynutil.delete("000"), + ) + + graph_sextillion = pynini.union( + hundred_non_zero() + insert_space + pynutil.insert("trilliarde") + optional_plural_quantity_n, + pynutil.delete("000"), + ) + graph = pynini.union( + graph_sextillion + + insert_space + + graph_quintillion + + insert_space + + graph_quadrillion + + insert_space + + graph_trillion + + insert_space + + graph_billion + + insert_space + + graph_million + + insert_space + + thousand() + ) + + fix_syntax = [ + ("eins tausend", "ein tausend"), + ("eins millionen", "eine million"), + ("eins milliarden", "eine milliarde"), + ("eins billionen", "eine billion"), + ("eins billiarden", "eine billiarde"), + ] + fix_syntax = pynini.union(*[pynini.cross(*x) for x in fix_syntax]) + self.graph = ( + ((NEMO_DIGIT - "0" + pynini.closure(NEMO_DIGIT, 0)) - "0" - "1") + @ pynini.cdrewrite(pynini.closure(pynutil.insert("0")), "[BOS]", "", NEMO_SIGMA) + @ NEMO_DIGIT**24 + @ graph + @ pynini.cdrewrite(delete_space, "[BOS]", "", NEMO_SIGMA) + @ pynini.cdrewrite(delete_space, "", "[EOS]", NEMO_SIGMA) + @ pynini.cdrewrite(pynini.cross(" ", " "), "", "", NEMO_SIGMA) + @ pynini.cdrewrite(fix_syntax, "[BOS]", "", NEMO_SIGMA) + ) + self.graph |= graph_zero | pynini.cross("1", "eins") + + # self.graph = pynini.cdrewrite(pynutil.delete(separator), "", "", NEMO_SIGMA) @ self.graph + self.graph = self.graph.optimize() + + self.graph_hundred_component_at_least_one_none_zero_digit = ( + ((NEMO_DIGIT - "0" + pynini.closure(NEMO_DIGIT, 0)) - "0" - "1") + @ pynini.cdrewrite(pynini.closure(pynutil.insert("0")), "[BOS]", "", NEMO_SIGMA) + @ NEMO_DIGIT**3 + @ hundred_non_zero() + ) | pynini.cross("1", "eins") + + self.graph_hundred_component_at_least_one_none_zero_digit = ( + self.graph_hundred_component_at_least_one_none_zero_digit.optimize() + ) + + self.two_digit_non_zero = ( + pynini.closure(NEMO_DIGIT, 1, 2) @ self.graph_hundred_component_at_least_one_none_zero_digit + ) + + optional_minus_graph = pynini.closure(pynutil.insert("negative: ") + pynini.cross("-", "\"true\" "), 0, 1) + + final_graph = optional_minus_graph + pynutil.insert("integer: \"") + self.graph + pynutil.insert("\"") + final_graph = self.add_tokens(final_graph) + self.fst = final_graph.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/de/taggers/date.py b/zonos3/vendor/nemo_text_processing/text_normalization/de/taggers/date.py new file mode 100644 index 0000000000000000000000000000000000000000..bda3ea1f04f710dc913fc2d977bf9438dc36f9b7 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/de/taggers/date.py @@ -0,0 +1,142 @@ +# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.de.utils import get_abs_path, load_labels +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import ( + NEMO_CHAR, + NEMO_DIGIT, + TO_LOWER, + GraphFst, + insert_space, +) + +graph_teen = pynini.invert(pynini.string_file(get_abs_path("data/numbers/teen.tsv"))).optimize() +graph_digit = pynini.invert(pynini.string_file(get_abs_path("data/numbers/digit.tsv"))).optimize() +ties_graph = pynini.invert(pynini.string_file(get_abs_path("data/numbers/ties.tsv"))).optimize() +delete_leading_zero = (pynutil.delete("0") | (NEMO_DIGIT - "0")) + NEMO_DIGIT + + +def get_year_graph(cardinal: GraphFst) -> 'pynini.FstLike': + """ + Returns year verbalizations as fst + + < 2000 neunzehn (hundert) (vier und zwanzig), >= 2000 regular cardinal + **00 ** hundert + + Args: + delete_leading_zero: removed leading zero + cardinal: cardinal GraphFst + """ + + year_gt_2000 = (pynini.union("21", "20") + NEMO_DIGIT**2) @ cardinal.graph + + graph_two_digit = delete_leading_zero @ cardinal.two_digit_non_zero + hundred = pynutil.insert("hundert") + graph_double_double = ( + (pynini.accep("1") + NEMO_DIGIT) @ graph_two_digit + + insert_space + + pynini.closure(hundred + insert_space, 0, 1) + + graph_two_digit + ) + # for 20** + graph_double_double |= pynini.accep("20") @ graph_two_digit + insert_space + graph_two_digit + graph = ( + graph_double_double + | (pynini.accep("1") + NEMO_DIGIT) @ graph_two_digit + insert_space + pynutil.delete("00") + hundred + | year_gt_2000 + ) + return graph + + +class DateFst(GraphFst): + """ + Finite state transducer for classifying date, e.g. + "01.04.2010" -> date { day: "erster" month: "april" year: "zwei tausend zehn" preserve_order: true } + "1994" -> date { year: "neunzehn vier und neuzig" } + "1900" -> date { year: "neunzehn hundert" } + + Args: + cardinal: cardinal GraphFst + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, cardinal: GraphFst, deterministic: bool): + super().__init__(name="date", kind="classify", deterministic=deterministic) + + month_abbr_graph = load_labels(get_abs_path("data/months/abbr_to_name.tsv")) + number_to_month = pynini.string_file(get_abs_path("data/months/numbers.tsv")).optimize() + month_graph = pynini.union(*[x[1] for x in month_abbr_graph]).optimize() + month_abbr_graph = pynini.string_map(month_abbr_graph) + month_abbr_graph = ( + pynutil.add_weight(month_abbr_graph, weight=0.0001) + | ((TO_LOWER + pynini.closure(NEMO_CHAR)) @ month_abbr_graph) + ) + pynini.closure(pynutil.delete(".", weight=-0.0001), 0, 1) + + self.month_abbr = month_abbr_graph + month_graph |= (TO_LOWER + pynini.closure(NEMO_CHAR)) @ month_graph + # jan.-> januar, Jan-> januar, januar-> januar + month_graph |= month_abbr_graph + + numbers = cardinal.graph_hundred_component_at_least_one_none_zero_digit + optional_leading_zero = delete_leading_zero | NEMO_DIGIT + # 01, 31, 1 + digit_day = optional_leading_zero @ pynini.union(*[str(x) for x in range(1, 32)]) @ numbers + day = (pynutil.insert("day: \"") + digit_day + pynutil.insert("\"")).optimize() + + digit_month = optional_leading_zero @ pynini.union(*[str(x) for x in range(1, 13)]) + number_to_month = digit_month @ number_to_month + digit_month @= numbers + + month_name = (pynutil.insert("month: \"") + month_graph + pynutil.insert("\"")).optimize() + month_number = ( + pynutil.insert("month: \"") + + (pynutil.add_weight(digit_month, weight=0.0001) | number_to_month) + + pynutil.insert("\"") + ).optimize() + + # prefer cardinal over year + year = pynutil.add_weight(get_year_graph(cardinal=cardinal), weight=0.001) + self.year = year + + year_only = pynutil.insert("year: \"") + year + pynutil.insert("\"") + + graph_dmy = ( + day + + pynutil.delete(".") + + pynini.closure(pynutil.delete(" "), 0, 1) + + insert_space + + month_name + + pynini.closure(pynini.accep(" ") + year_only, 0, 1) + ) + + separators = ["."] + for sep in separators: + year_optional = pynini.closure(pynini.cross(sep, " ") + year_only, 0, 1) + new_graph = day + pynini.cross(sep, " ") + month_number + year_optional + graph_dmy |= new_graph + + dash = "-" + day_optional = pynini.closure(pynini.cross(dash, " ") + day, 0, 1) + graph_ymd = year_only + pynini.cross(dash, " ") + month_number + day_optional + + final_graph = graph_dmy + pynutil.insert(" preserve_order: true") + final_graph |= year_only + final_graph |= graph_ymd + + self.final_graph = final_graph.optimize() + self.fst = self.add_tokens(self.final_graph).optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/de/taggers/decimal.py b/zonos3/vendor/nemo_text_processing/text_normalization/de/taggers/decimal.py new file mode 100644 index 0000000000000000000000000000000000000000..e68433989ab66019cfdf0c55f78adcc266abb454 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/de/taggers/decimal.py @@ -0,0 +1,83 @@ +# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.de.utils import get_abs_path +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import GraphFst, insert_space + +quantities = pynini.string_file(get_abs_path("data/numbers/quantities.tsv")) + + +def get_quantity(decimal: 'pynini.FstLike', cardinal_up_to_hundred: 'pynini.FstLike') -> 'pynini.FstLike': + """ + Returns FST that transforms either a cardinal or decimal followed by a quantity into a numeral, + e.g. 1 million -> integer_part: "eine" quantity: "million" + e.g. 1.4 million -> integer_part: "eins" fractional_part: "vier" quantity: "million" + + Args: + decimal: decimal FST + cardinal_up_to_hundred: cardinal FST + """ + numbers = cardinal_up_to_hundred + + res = ( + pynutil.insert("integer_part: \"") + + numbers + + pynutil.insert("\"") + + pynini.accep(" ") + + pynutil.insert("quantity: \"") + + quantities + + pynutil.insert("\"") + ) + res |= decimal + pynini.accep(" ") + pynutil.insert("quantity: \"") + quantities + pynutil.insert("\"") + return res + + +class DecimalFst(GraphFst): + """ + Finite state transducer for classifying decimal, e.g. + -11,4006 billion -> decimal { negative: "true" integer_part: "elf" fractional_part: "vier null null sechs" quantity: "billion" preserve_order: true } + 1 billion -> decimal { integer_part: "eins" quantity: "billion" preserve_order: true } + Args: + cardinal: CardinalFst + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, cardinal: GraphFst, deterministic: bool = True): + super().__init__(name="decimal", kind="classify", deterministic=deterministic) + + graph_digit = pynini.string_file(get_abs_path("data/numbers/digit.tsv")).invert() + graph_digit |= pynini.string_file(get_abs_path("data/numbers/zero.tsv")).invert() + graph_digit |= pynini.cross("1", "eins") + self.graph = graph_digit + pynini.closure(insert_space + graph_digit).optimize() + + point = pynutil.delete(",") + optional_graph_negative = pynini.closure(pynutil.insert("negative: ") + pynini.cross("-", "\"true\" "), 0, 1) + + self.graph_fractional = pynutil.insert("fractional_part: \"") + self.graph + pynutil.insert("\"") + self.graph_integer = pynutil.insert("integer_part: \"") + cardinal.graph + pynutil.insert("\"") + final_graph_wo_sign = self.graph_integer + point + insert_space + self.graph_fractional + + self.final_graph_wo_negative = final_graph_wo_sign | get_quantity( + final_graph_wo_sign, cardinal.graph_hundred_component_at_least_one_none_zero_digit + ) + final_graph = optional_graph_negative + self.final_graph_wo_negative + final_graph += pynutil.insert(" preserve_order: true") + + final_graph = self.add_tokens(final_graph) + + self.fst = final_graph.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/de/taggers/electronic.py b/zonos3/vendor/nemo_text_processing/text_normalization/de/taggers/electronic.py new file mode 100644 index 0000000000000000000000000000000000000000..f890995f87dfe8a21dc0da1318edaadd288c7bba --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/de/taggers/electronic.py @@ -0,0 +1,83 @@ +# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.de.utils import get_abs_path, load_labels +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import NEMO_ALPHA, NEMO_DIGIT, GraphFst, insert_space + + +class ElectronicFst(GraphFst): + """ + Finite state transducer for classifying electronic: email addresses + e.g. "abc@hotmail.com" -> electronic { username: "abc" domain: "hotmail.com" preserve_order: true } + e.g. "www.abc.com/123" -> electronic { protocol: "www." domain: "abc.com/123" preserve_order: true } + + Args: + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="electronic", kind="classify", deterministic=deterministic) + + dot = pynini.accep(".") + + symbols = [x[0] for x in load_labels(get_abs_path("data/electronic/symbols.tsv"))] + symbols = pynini.union(*symbols) + # all symbols + symbols_no_period = pynini.difference(symbols, dot) # alphabet of accepted symbols excluding the '.' + accepted_characters = pynini.closure( + (NEMO_ALPHA | NEMO_DIGIT | symbols_no_period), 1 + ) # alphabet of accepted chars excluding the '.' + all_characters = pynini.closure( + (NEMO_ALPHA | NEMO_DIGIT | symbols), 1 + ) # alphabet of accepted chars including the '.' + + # domains + domain = dot + accepted_characters + domain_graph = ( + pynutil.insert('domain: "') + + (accepted_characters + pynini.closure(domain, 1)) + + dot.ques + + pynutil.insert('"') + ) + + # email + username = pynutil.insert('username: "') + all_characters + pynutil.insert('"') + pynini.cross("@", " ") + email = username + domain_graph + + # social media tags + tag = ( + pynini.cross("@", "") + + pynutil.insert('username: "') + + (accepted_characters | (accepted_characters + pynini.closure(domain, 1))) + + dot.ques + + pynutil.insert('"') + ) + + # url + protocol_start = pynini.accep("https://") | pynini.accep("http://") + protocol_end = pynini.accep("www.") + protocol = protocol_start | protocol_end | (protocol_start + protocol_end) + protocol = pynutil.insert('protocol: "') + protocol + pynutil.insert('"') + url = protocol + insert_space + (domain_graph) + + graph = url | domain_graph | email | tag + self.graph = graph + + final_graph = self.add_tokens(self.graph + pynutil.insert(" preserve_order: true")) + self.fst = final_graph.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/de/taggers/fraction.py b/zonos3/vendor/nemo_text_processing/text_normalization/de/taggers/fraction.py new file mode 100644 index 0000000000000000000000000000000000000000..61872a70dab416b2bda1c9f2aef3540d88cf447b --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/de/taggers/fraction.py @@ -0,0 +1,55 @@ +# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import GraphFst + + +class FractionFst(GraphFst): + """ + Finite state transducer for classifying fraction + "23 4/6" -> + fraction { integer: "drei und zwanzig" numerator: "vier" denominator: "sechs" preserve_order: true } + + Args: + cardinal: cardinal GraphFst + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, cardinal, deterministic: bool = True): + super().__init__(name="fraction", kind="classify", deterministic=deterministic) + cardinal_graph = cardinal.graph + + self.optional_graph_negative = pynini.closure( + pynutil.insert("negative: ") + pynini.cross("-", "\"true\" "), 0, 1 + ) + self.integer = pynutil.insert("integer_part: \"") + cardinal_graph + pynutil.insert("\"") + self.numerator = ( + pynutil.insert("numerator: \"") + cardinal_graph + pynini.cross(pynini.union("/", " / "), "\" ") + ) + self.denominator = pynutil.insert("denominator: \"") + cardinal_graph + pynutil.insert("\"") + + self.graph = ( + self.optional_graph_negative + + pynini.closure(self.integer + pynini.accep(" "), 0, 1) + + self.numerator + + self.denominator + ) + + graph = self.graph + pynutil.insert(" preserve_order: true") + final_graph = self.add_tokens(graph) + self.fst = final_graph.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/de/taggers/measure.py b/zonos3/vendor/nemo_text_processing/text_normalization/de/taggers/measure.py new file mode 100644 index 0000000000000000000000000000000000000000..f31399aa25c31a47c24cec5d2f7c53ee4c7405fa --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/de/taggers/measure.py @@ -0,0 +1,190 @@ +# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.examples import plurals +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.de.utils import get_abs_path +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import ( + NEMO_ALPHA, + NEMO_DIGIT, + NEMO_NON_BREAKING_SPACE, + NEMO_SIGMA, + GraphFst, + convert_space, + insert_space, +) + +unit_singular = pynini.string_file(get_abs_path("data/measure/measurements.tsv")) +suppletive = pynini.string_file(get_abs_path("data/measure/suppletive.tsv")) + + +def singular_to_plural(): + # plural endung n/en maskuline Nomen mit den Endungen e, ent, and, ant, ist, or + _n = NEMO_SIGMA + pynini.union("e") + pynutil.insert("n") + _en = ( + NEMO_SIGMA + + pynini.union("ent", "and", "ant", "ist", "or", "ion", "ik", "heit", "keit", "schaft", "tät", "ung") + + pynutil.insert("en") + ) + _nen = NEMO_SIGMA + pynini.union("in") + (pynutil.insert("e") | pynutil.insert("nen")) + _fremd = NEMO_SIGMA + pynini.union("ma", "um", "us") + pynutil.insert("en") + # maskuline Nomen mit den Endungen eur, ich, ier, ig, ling, ör + _e = NEMO_SIGMA + pynini.union("eur", "ich", "ier", "ig", "ling", "ör") + pynutil.insert("e") + _s = NEMO_SIGMA + pynini.union("a", "i", "o", "u", "y") + pynutil.insert("s") + + graph_plural = plurals._priority_union( + suppletive, pynini.union(_n, _en, _nen, _fremd, _e, _s), NEMO_SIGMA + ).optimize() + + return graph_plural + + +class MeasureFst(GraphFst): + """ + Finite state transducer for classifying measure, e.g. + "2,4 oz" -> measure { cardinal { integer_part: "zwei" fractional_part: "vier" units: "unzen" preserve_order: true } } + "1 oz" -> measure { cardinal { integer: "zwei" units: "unze" preserve_order: true } } + "1 million oz" -> measure { cardinal { integer: "eins" quantity: "million" units: "unze" preserve_order: true } } + This class also converts words containing numbers and letters + e.g. "a-8" —> "a acht" + e.g. "1,2-a" —> "ein komma zwei a" + + Args: + cardinal: CardinalFst + decimal: DecimalFst + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, cardinal: GraphFst, decimal: GraphFst, fraction: GraphFst, deterministic: bool = True): + super().__init__(name="measure", kind="classify", deterministic=deterministic) + cardinal_graph = cardinal.graph + + graph_unit_singular = convert_space(unit_singular) + graph_unit_plural = graph_unit_singular @ pynini.cdrewrite(convert_space(suppletive), "", "[EOS]", NEMO_SIGMA) + optional_graph_negative = pynini.closure("-", 0, 1) + + graph_unit_denominator = ( + pynini.cross("/", "pro") + pynutil.insert(NEMO_NON_BREAKING_SPACE) + graph_unit_singular + ) + + optional_unit_denominator = pynini.closure( + pynutil.insert(NEMO_NON_BREAKING_SPACE) + graph_unit_denominator, + 0, + 1, + ) + + unit_plural = ( + pynutil.insert("units: \"") + + (graph_unit_plural + (optional_unit_denominator) | graph_unit_denominator) + + pynutil.insert("\"") + ) + + unit_singular_graph = ( + pynutil.insert("units: \"") + + ((graph_unit_singular + optional_unit_denominator) | graph_unit_denominator) + + pynutil.insert("\"") + ) + + subgraph_decimal = decimal.fst + insert_space + pynini.closure(pynutil.delete(" "), 0, 1) + unit_plural + + subgraph_cardinal = ( + (optional_graph_negative + (pynini.closure(NEMO_DIGIT) - "1")) @ cardinal.fst + + insert_space + + pynini.closure(pynutil.delete(" "), 0, 1) + + unit_plural + ) + + subgraph_cardinal |= ( + (optional_graph_negative + pynini.accep("1")) + @ cardinal.fst + @ pynini.cdrewrite(pynini.cross("eins", "ein"), "", "", NEMO_SIGMA) + + insert_space + + pynini.closure(pynutil.delete(" "), 0, 1) + + unit_singular_graph + ) + + subgraph_fraction = fraction.fst + insert_space + pynini.closure(pynutil.delete(" "), 0, 1) + unit_plural + + cardinal_dash_alpha = ( + pynutil.insert("cardinal { integer: \"") + + cardinal_graph + + pynutil.delete('-') + + pynutil.insert("\" } units: \"") + + pynini.closure(NEMO_ALPHA, 1) + + pynutil.insert("\"") + ) + + alpha_dash_cardinal = ( + pynutil.insert("units: \"") + + pynini.closure(NEMO_ALPHA, 1) + + pynutil.delete('-') + + pynutil.insert("\"") + + pynutil.insert(" cardinal { integer: \"") + + cardinal_graph + + pynutil.insert("\" }") + ) + + decimal_dash_alpha = ( + pynutil.insert("decimal { ") + + decimal.final_graph_wo_negative + + pynutil.delete('-') + + pynutil.insert(" } units: \"") + + pynini.closure(NEMO_ALPHA, 1) + + pynutil.insert("\"") + ) + + decimal_times = ( + pynutil.insert("decimal { ") + + decimal.final_graph_wo_negative + + pynutil.insert(" } units: \"") + + pynini.union('x', 'X') + + pynutil.insert("\"") + ) + + cardinal_times = ( + pynutil.insert("cardinal { integer: \"") + + cardinal_graph + + pynutil.insert("\" } units: \"") + + pynini.union('x', 'X') + + pynutil.insert("\"") + ) + + alpha_dash_decimal = ( + pynutil.insert("units: \"") + + pynini.closure(NEMO_ALPHA, 1) + + pynutil.delete('-') + + pynutil.insert("\"") + + pynutil.insert(" decimal { ") + + decimal.final_graph_wo_negative + + pynutil.insert(" }") + ) + + final_graph = ( + subgraph_decimal + | subgraph_cardinal + | cardinal_dash_alpha + | alpha_dash_cardinal + | decimal_dash_alpha + | decimal_times + | alpha_dash_decimal + | subgraph_fraction + | cardinal_times + ) + final_graph += pynutil.insert(" preserve_order: true") + final_graph = self.add_tokens(final_graph) + + self.fst = final_graph.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/de/taggers/money.py b/zonos3/vendor/nemo_text_processing/text_normalization/de/taggers/money.py new file mode 100644 index 0000000000000000000000000000000000000000..cee716ba1ca13b5d36ac7517f424cb06df7fea79 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/de/taggers/money.py @@ -0,0 +1,149 @@ +# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.de.utils import get_abs_path, load_labels +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import ( + NEMO_ALPHA, + NEMO_DIGIT, + NEMO_SIGMA, + GraphFst, + convert_space, + insert_space, +) + +min_singular = pynini.string_file(get_abs_path("data/money/currency_minor_singular.tsv")) +min_plural = pynini.string_file(get_abs_path("data/money/currency_minor_plural.tsv")) +maj_singular = pynini.string_file((get_abs_path("data/money/currency.tsv"))) + + +class MoneyFst(GraphFst): + """ + Finite state transducer for classifying money, e.g. + "€1" -> money { currency_maj: "euro" integer_part: "ein"} + "€1,000" -> money { currency_maj: "euro" integer_part: "ein" } + "€1,001" -> money { currency_maj: "euro" integer_part: "eins" fractional_part: "null null eins"} + "£1,4" -> money { integer_part: "ein" currency_maj: "pfund" fractional_part: "vierzig" preserve_order: true} + -> money { integer_part: "ein" currency_maj: "pfund" fractional_part: "vierzig" currency_min: "pence" preserve_order: true} + "£0,01" -> money { fractional_part: "ein" currency_min: "penny" preserve_order: true} + "£0,01 million" -> money { currency_maj: "pfund" integer_part: "null" fractional_part: "null eins" quantity: "million"} + + Args: + cardinal: CardinalFst + decimal: DecimalFst + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, cardinal: GraphFst, decimal: GraphFst, deterministic: bool = True): + super().__init__(name="money", kind="classify", deterministic=deterministic) + cardinal_graph = cardinal.graph + graph_decimal_final = decimal.fst + + maj_singular_labels = load_labels(get_abs_path("data/money/currency.tsv")) + maj_singular_graph = convert_space(maj_singular) + maj_plural_graph = maj_singular_graph + + graph_maj_singular = pynutil.insert("currency_maj: \"") + maj_singular_graph + pynutil.insert("\"") + graph_maj_plural = pynutil.insert("currency_maj: \"") + maj_plural_graph + pynutil.insert("\"") + + optional_delete_fractional_zeros = pynini.closure( + pynutil.delete(",") + pynini.closure(pynutil.delete("0"), 1), 0, 1 + ) + graph_integer_one = pynutil.insert("integer_part: \"") + pynini.cross("1", "ein") + pynutil.insert("\"") + + # only for decimals where third decimal after comma is non-zero or with quantity + decimal_delete_last_zeros = ( + pynini.closure(NEMO_DIGIT, 1) + + pynini.accep(",") + + pynini.closure(NEMO_DIGIT, 2) + + (NEMO_DIGIT - "0") + + pynini.closure(pynutil.delete("0")) + ) + decimal_with_quantity = NEMO_SIGMA + NEMO_ALPHA + graph_decimal = ( + graph_maj_plural + insert_space + (decimal_delete_last_zeros | decimal_with_quantity) @ graph_decimal_final + ) + + graph_integer = ( + pynutil.insert("integer_part: \"") + ((NEMO_SIGMA - "1") @ cardinal_graph) + pynutil.insert("\"") + ) + + graph_integer_only = graph_maj_singular + insert_space + graph_integer_one + graph_integer_only |= graph_maj_plural + insert_space + graph_integer + + graph = (graph_integer_only + optional_delete_fractional_zeros) | graph_decimal + + # remove trailing zeros of non zero number in the first 2 digits and fill up to 2 digits + # e.g. 2000 -> 20, 0200->02, 01 -> 01, 10 -> 10 + # not accepted: 002, 00, 0, + two_digits_fractional_part = ( + pynini.closure(NEMO_DIGIT) + (NEMO_DIGIT - "0") + pynini.closure(pynutil.delete("0")) + ) @ ( + (pynutil.delete("0") + (NEMO_DIGIT - "0")) + | ((NEMO_DIGIT - "0") + pynutil.insert("0")) + | ((NEMO_DIGIT - "0") + NEMO_DIGIT) + ) + + graph_min_singular = pynutil.insert(" currency_min: \"") + min_singular + pynutil.insert("\"") + graph_min_plural = pynutil.insert(" currency_min: \"") + min_plural + pynutil.insert("\"") + + # format ** euro ** cent + decimal_graph_with_minor = None + for curr_symbol, _ in maj_singular_labels: + preserve_order = pynutil.insert(" preserve_order: true") + integer_plus_maj = graph_integer + insert_space + pynutil.insert(curr_symbol) @ graph_maj_plural + integer_plus_maj |= graph_integer_one + insert_space + pynutil.insert(curr_symbol) @ graph_maj_singular + # non zero integer part + integer_plus_maj = (pynini.closure(NEMO_DIGIT) - "0") @ integer_plus_maj + + graph_fractional_one = two_digits_fractional_part @ pynini.cross("1", "ein") + graph_fractional_one = pynutil.insert("fractional_part: \"") + graph_fractional_one + pynutil.insert("\"") + graph_fractional = ( + two_digits_fractional_part @ (pynini.closure(NEMO_DIGIT, 1, 2) - "1") @ cardinal.two_digit_non_zero + ) + graph_fractional = pynutil.insert("fractional_part: \"") + graph_fractional + pynutil.insert("\"") + + fractional_plus_min = graph_fractional + insert_space + pynutil.insert(curr_symbol) @ graph_min_plural + fractional_plus_min |= ( + graph_fractional_one + insert_space + pynutil.insert(curr_symbol) @ graph_min_singular + ) + + decimal_graph_with_minor_curr = integer_plus_maj + pynini.cross(",", " ") + fractional_plus_min + decimal_graph_with_minor_curr |= pynutil.add_weight( + integer_plus_maj + + pynini.cross(",", " ") + + pynutil.insert("fractional_part: \"") + + two_digits_fractional_part @ cardinal.two_digit_non_zero + + pynutil.insert("\""), + weight=0.0001, + ) + + decimal_graph_with_minor_curr |= pynutil.delete("0,") + fractional_plus_min + decimal_graph_with_minor_curr = ( + pynutil.delete(curr_symbol) + decimal_graph_with_minor_curr + preserve_order + ) + + decimal_graph_with_minor = ( + decimal_graph_with_minor_curr + if decimal_graph_with_minor is None + else pynini.union(decimal_graph_with_minor, decimal_graph_with_minor_curr) + ) + + final_graph = graph | decimal_graph_with_minor + + final_graph = self.add_tokens(final_graph) + self.fst = final_graph.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/de/taggers/ordinal.py b/zonos3/vendor/nemo_text_processing/text_normalization/de/taggers/ordinal.py new file mode 100644 index 0000000000000000000000000000000000000000..d68e20d35023914592efe212b289033192f68bd4 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/de/taggers/ordinal.py @@ -0,0 +1,50 @@ +# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Adapted from https://github.com/google/TextNormalizationCoveringGrammars +# Russian minimally supervised number grammar. + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import NEMO_DIGIT, GraphFst + + +class OrdinalFst(GraphFst): + """ + Finite state transducer for classifying cardinals, e.g. + "2." -> ordinal { integer: "zwei" } } + "2tes" -> ordinal { integer: "zwei" } } + + Args: + cardinal: cardinal GraphFst + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, cardinal: GraphFst, deterministic=False): + super().__init__(name="ordinal", kind="classify", deterministic=deterministic) + + cardinal_graph = cardinal.graph + endings = ["ter", "tes", "tem", "te", "ten"] + self.graph = ( + ( + pynini.closure(NEMO_DIGIT | pynini.accep(".")) + + pynutil.delete(pynutil.add_weight(pynini.union(*endings), weight=0.0001) | pynini.accep(".")) + ) + @ cardinal_graph + ).optimize() + final_graph = pynutil.insert("integer: \"") + self.graph + pynutil.insert("\"") + final_graph = self.add_tokens(final_graph) + self.fst = final_graph.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/de/taggers/telephone.py b/zonos3/vendor/nemo_text_processing/text_normalization/de/taggers/telephone.py new file mode 100644 index 0000000000000000000000000000000000000000..63522eb4c9308ed028b779e3f087111fb98ee124 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/de/taggers/telephone.py @@ -0,0 +1,73 @@ +# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.de.utils import get_abs_path +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import NEMO_DIGIT, GraphFst, insert_space + + +class TelephoneFst(GraphFst): + """ + Finite state transducer for classifying telephone, which includes country code, number part and extension + + E.g + "+49 1234-1233" -> telephone { country_code: "plus neun und vierzig" number_part: "eins zwei drei vier eins zwei drei drei" preserve_order: true } + "(012) 1234-1233" -> telephone { country_code: "null eins zwei" number_part: "eins zwei drei vier eins zwei drei drei" preserve_order: true } + (0**) + + Args: + cardinal: cardinal GraphFst + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, cardinal: GraphFst, deterministic: bool = True): + super().__init__(name="telephone", kind="classify", deterministic=deterministic) + + graph_zero = pynini.invert(pynini.string_file(get_abs_path("data/numbers/zero.tsv"))).optimize() + graph_digit_no_zero = pynini.invert( + pynini.string_file(get_abs_path("data/numbers/digit.tsv")) + ).optimize() | pynini.cross("1", "eins") + graph_digit = graph_digit_no_zero | graph_zero + + numbers_with_single_digits = pynini.closure(graph_digit + insert_space) + graph_digit + + two_digit_and_zero = (NEMO_DIGIT**2 @ cardinal.two_digit_non_zero) | graph_zero + # def add_space_after_two_digit(): + # return pynini.closure(two_digit_and_zero + insert_space) + ( + # two_digit_and_zero + # ) + + country_code = pynini.closure(pynini.cross("+", "plus "), 0, 1) + two_digit_and_zero + country_code |= ( + pynutil.delete("(") + graph_zero + insert_space + numbers_with_single_digits + pynutil.delete(")") + ) + country_code |= graph_zero + insert_space + numbers_with_single_digits + + country_code = pynutil.insert("country_code: \"") + country_code + pynutil.insert("\"") + + del_separator = pynini.cross(pynini.union("-", " "), " ") + # numbers_with_two_digits = pynini.closure(graph_digit + insert_space) + add_space_after_two_digit() + pynini.closure(insert_space + graph_digit) + # numbers = numbers_with_two_digits + pynini.closure(del_separator + numbers_with_two_digits, 0, 1) + numbers = numbers_with_single_digits + pynini.closure(del_separator + numbers_with_single_digits, 0, 1) + number_length = pynini.closure((NEMO_DIGIT | pynini.union("-", " ", ")", "(")), 7) + number_part = pynini.compose(number_length, numbers) + number = pynutil.insert("number_part: \"") + number_part + pynutil.insert("\"") + + graph = country_code + pynini.accep(" ") + number + self.graph = graph + final_graph = self.add_tokens(self.graph + pynutil.insert(" preserve_order: true")) + self.fst = final_graph.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/de/taggers/time.py b/zonos3/vendor/nemo_text_processing/text_normalization/de/taggers/time.py new file mode 100644 index 0000000000000000000000000000000000000000..4492382b3f31afb25c92960a24a80d58db32d397 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/de/taggers/time.py @@ -0,0 +1,98 @@ +# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.de.utils import get_abs_path +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import NEMO_DIGIT, GraphFst, convert_space, insert_space + + +class TimeFst(GraphFst): + """ + Finite state transducer for classifying time, e.g. + "02:15 Uhr est" -> time { hours: "2" minutes: "15" zone: "e s t"} + "2 Uhr" -> time { hours: "2" } + "09:00 Uhr" -> time { hours: "2" } + "02:15:10 Uhr" -> time { hours: "2" minutes: "15" seconds: "10"} + + Args: + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="time", kind="classify", deterministic=deterministic) + + final_suffix = pynutil.delete(" ") + pynutil.delete("Uhr") | pynutil.delete("uhr") + time_zone_graph = pynini.string_file(get_abs_path("data/time/time_zone.tsv")) + + labels_hour = [str(x) for x in range(0, 25)] + labels_minute_single = [str(x) for x in range(1, 10)] + labels_minute_double = [str(x) for x in range(10, 60)] + + delete_leading_zero_to_double_digit = (pynutil.delete("0").ques | (NEMO_DIGIT - "0")) + NEMO_DIGIT + + graph_hour = pynini.union(*labels_hour) + + graph_minute_single = pynini.union(*labels_minute_single) + graph_minute_double = pynini.union(*labels_minute_double) + + final_graph_hour_only = pynutil.insert('hours: "') + graph_hour + pynutil.insert('"') + final_graph_hour = ( + pynutil.insert('hours: "') + delete_leading_zero_to_double_digit @ graph_hour + pynutil.insert('"') + ) + final_graph_minute = ( + pynutil.insert('minutes: "') + + (pynutil.delete("0") + graph_minute_single | graph_minute_double) + + pynutil.insert('"') + ) + final_graph_second = ( + pynutil.insert('seconds: "') + + (pynutil.delete("0") + graph_minute_single | graph_minute_double) + + pynutil.insert('"') + ) + final_time_zone_optional = pynini.closure( + pynini.accep(" ") + pynutil.insert('zone: "') + convert_space(time_zone_graph) + pynutil.insert('"'), + 0, + 1, + ) + + # Accepts the following formats: 02:30 Uhr, 02.30 Uhr, 2:30 Uhr, 2.30 Uhr + graph_hm = ( + final_graph_hour + + (pynutil.delete(":") | pynutil.delete(".")) + + (pynutil.delete("00") | (insert_space + final_graph_minute)) + + final_suffix + + final_time_zone_optional + ) + + # 10:30:05 Uhr, + graph_hms = ( + final_graph_hour + + pynutil.delete(":") + + (pynini.cross("00", ' minutes: "0"') | (insert_space + final_graph_minute)) + + pynutil.delete(":") + + (pynini.cross("00", ' seconds: "0"') | (insert_space + final_graph_second)) + + final_suffix + + final_time_zone_optional + + pynutil.insert(" preserve_order: true") + ) + + # 2 Uhr est + graph_h = final_graph_hour_only + final_suffix + final_time_zone_optional + final_graph = (graph_hm | graph_h | graph_hms).optimize() + final_graph = self.add_tokens(final_graph) + self.fst = final_graph.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/de/taggers/tokenize_and_classify.py b/zonos3/vendor/nemo_text_processing/text_normalization/de/taggers/tokenize_and_classify.py new file mode 100644 index 0000000000000000000000000000000000000000..316a398d3c0084d9801550a43bb31c257602aa3d --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/de/taggers/tokenize_and_classify.py @@ -0,0 +1,151 @@ +# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import os + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.de.taggers.cardinal import CardinalFst +from zonos3.vendor.nemo_text_processing.text_normalization.de.taggers.date import DateFst +from zonos3.vendor.nemo_text_processing.text_normalization.de.taggers.decimal import DecimalFst +from zonos3.vendor.nemo_text_processing.text_normalization.de.taggers.electronic import ElectronicFst +from zonos3.vendor.nemo_text_processing.text_normalization.de.taggers.fraction import FractionFst +from zonos3.vendor.nemo_text_processing.text_normalization.de.taggers.measure import MeasureFst +from zonos3.vendor.nemo_text_processing.text_normalization.de.taggers.money import MoneyFst +from zonos3.vendor.nemo_text_processing.text_normalization.de.taggers.ordinal import OrdinalFst +from zonos3.vendor.nemo_text_processing.text_normalization.de.taggers.telephone import TelephoneFst +from zonos3.vendor.nemo_text_processing.text_normalization.de.taggers.time import TimeFst +from zonos3.vendor.nemo_text_processing.text_normalization.de.taggers.whitelist import WhiteListFst +from zonos3.vendor.nemo_text_processing.text_normalization.de.taggers.word import WordFst +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import ( + NEMO_CHAR, + NEMO_DIGIT, + GraphFst, + delete_extra_space, + delete_space, + generator_main, +) +from zonos3.vendor.nemo_text_processing.text_normalization.en.taggers.punctuation import PunctuationFst +from zonos3.vendor.nemo_text_processing.utils.logging import logger + + +class ClassifyFst(GraphFst): + """ + Final class that composes all other classification grammars. This class can process an entire sentence, that is lower cased. + For deployment, this grammar will be compiled and exported to OpenFst Finite State Archive (FAR) File. + More details to deployment at NeMo/tools/text_processing_deployment. + + Args: + input_case: accepting either "lower_cased" or "cased" input. + deterministic: if True will provide a single transduction option, + for False multiple options (used for audio-based normalization) + cache_dir: path to a dir with .far grammar file. Set to None to avoid using cache. + overwrite_cache: set to True to overwrite .far files + whitelist: path to a file with whitelist replacements + """ + + def __init__( + self, + input_case: str, + deterministic: bool = False, + cache_dir: str = None, + overwrite_cache: bool = False, + whitelist: str = None, + ): + super().__init__(name="tokenize_and_classify", kind="classify", deterministic=deterministic) + far_file = None + if cache_dir is not None and cache_dir != "None": + os.makedirs(cache_dir, exist_ok=True) + whitelist_file = os.path.basename(whitelist) if whitelist else "" + far_file = os.path.join( + cache_dir, + f"_{input_case}_de_tn_{deterministic}_deterministic{whitelist_file}.far", + ) + if not overwrite_cache and far_file and os.path.exists(far_file): + self.fst = pynini.Far(far_file, mode="r")["tokenize_and_classify"] + no_digits = pynini.closure(pynini.difference(NEMO_CHAR, NEMO_DIGIT)) + self.fst_no_digits = pynini.compose(self.fst, no_digits).optimize() + logger.info(f"ClassifyFst.fst was restored from {far_file}.") + else: + logger.info(f"Creating ClassifyFst grammars. This might take some time...") + + self.cardinal = CardinalFst(deterministic=deterministic) + cardinal_graph = self.cardinal.fst + + self.ordinal = OrdinalFst(cardinal=self.cardinal, deterministic=deterministic) + ordinal_graph = self.ordinal.fst + + self.decimal = DecimalFst(cardinal=self.cardinal, deterministic=deterministic) + decimal_graph = self.decimal.fst + + self.fraction = FractionFst(cardinal=self.cardinal, deterministic=deterministic) + fraction_graph = self.fraction.fst + self.measure = MeasureFst( + cardinal=self.cardinal, + decimal=self.decimal, + fraction=self.fraction, + deterministic=deterministic, + ) + measure_graph = self.measure.fst + self.date = DateFst(cardinal=self.cardinal, deterministic=deterministic) + date_graph = self.date.fst + word_graph = WordFst(deterministic=deterministic).fst + self.time = TimeFst(deterministic=deterministic) + time_graph = self.time.fst + self.telephone = TelephoneFst(cardinal=self.cardinal, deterministic=deterministic) + telephone_graph = self.telephone.fst + self.electronic = ElectronicFst(deterministic=deterministic) + electronic_graph = self.electronic.fst + self.money = MoneyFst( + cardinal=self.cardinal, + decimal=self.decimal, + deterministic=deterministic, + ) + money_graph = self.money.fst + self.whitelist = WhiteListFst(input_case=input_case, deterministic=deterministic, input_file=whitelist) + whitelist_graph = self.whitelist.fst + punct_graph = PunctuationFst(deterministic=deterministic).fst + + classify = ( + pynutil.add_weight(whitelist_graph, 1.01) + | pynutil.add_weight(time_graph, 1.1) + | pynutil.add_weight(measure_graph, 1.1) + | pynutil.add_weight(cardinal_graph, 1.1) + | pynutil.add_weight(fraction_graph, 1.1) + | pynutil.add_weight(date_graph, 1.1) + | pynutil.add_weight(ordinal_graph, 1.1) + | pynutil.add_weight(decimal_graph, 1.1) + | pynutil.add_weight(money_graph, 1.1) + | pynutil.add_weight(telephone_graph, 1.1) + | pynutil.add_weight(electronic_graph, 1.11) + ) + + classify |= pynutil.add_weight(word_graph, 100) + + punct = pynutil.insert("tokens { ") + pynutil.add_weight(punct_graph, weight=1.1) + pynutil.insert(" }") + token = pynutil.insert("tokens { ") + classify + pynutil.insert(" }") + token_plus_punct = ( + pynini.closure(punct + pynutil.insert(" ")) + token + pynini.closure(pynutil.insert(" ") + punct) + ) + + graph = token_plus_punct + pynini.closure((delete_extra_space).ques + token_plus_punct) + graph = delete_space + graph + delete_space + + self.fst = graph.optimize() + no_digits = pynini.closure(pynini.difference(NEMO_CHAR, NEMO_DIGIT)) + self.fst_no_digits = pynini.compose(self.fst, no_digits).optimize() + + if far_file: + generator_main(far_file, {"tokenize_and_classify": self.fst}) diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/de/taggers/whitelist.py b/zonos3/vendor/nemo_text_processing/text_normalization/de/taggers/whitelist.py new file mode 100644 index 0000000000000000000000000000000000000000..b5ce3d0f4013dcf0253b8385c8770f67b65423de --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/de/taggers/whitelist.py @@ -0,0 +1,64 @@ +# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.de.utils import get_abs_path, load_labels +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import GraphFst, convert_space + + +class WhiteListFst(GraphFst): + """ + Finite state transducer for classifying whitelist, e.g. + "Mr." -> tokens { name: "mister" } + This class has highest priority among all classifier grammars. Whitelisted tokens are defined and loaded from "data/whitelist.tsv". + + Args: + input_case: accepting either "lower_cased" or "cased" input. + deterministic: if True will provide a single transduction option, + for False multiple options (used for audio-based normalization) + input_file: path to a file with whitelist replacements + """ + + def __init__(self, input_case: str, deterministic: bool = True, input_file: str = None): + super().__init__(name="whitelist", kind="classify", deterministic=deterministic) + + def _get_whitelist_graph(input_case, file): + whitelist = load_labels(file) + if input_case == "lower_cased": + whitelist = [[x[0].lower()] + x[1:] for x in whitelist] + graph = pynini.string_map(whitelist) + return graph + + graph = _get_whitelist_graph(input_case, get_abs_path("data/whitelist.tsv")) + if not deterministic and input_case != "lower_cased": + graph |= pynutil.add_weight( + _get_whitelist_graph("lower_cased", get_abs_path("data/whitelist.tsv")), weight=0.0001 + ) + + if input_file: + whitelist_provided = _get_whitelist_graph(input_case, input_file) + if not deterministic: + graph |= whitelist_provided + else: + graph = whitelist_provided + + if not deterministic: + units_graph = _get_whitelist_graph(input_case, file=get_abs_path("data/measure/measurements.tsv")) + graph |= units_graph + + self.graph = graph + self.final_graph = convert_space(self.graph).optimize() + self.fst = (pynutil.insert("name: \"") + self.final_graph + pynutil.insert("\"")).optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/de/taggers/word.py b/zonos3/vendor/nemo_text_processing/text_normalization/de/taggers/word.py new file mode 100644 index 0000000000000000000000000000000000000000..2396d51e28d5ee316ba478f645df7c23cf9c81e1 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/de/taggers/word.py @@ -0,0 +1,34 @@ +# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import NEMO_NOT_SPACE, GraphFst + + +class WordFst(GraphFst): + """ + Finite state transducer for classifying word. + e.g. sleep -> tokens { name: "sleep" } + + Args: + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="word", kind="classify") + word = pynutil.insert("name: \"") + pynini.closure(NEMO_NOT_SPACE, 1) + pynutil.insert("\"") + self.fst = word.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/de/utils.py b/zonos3/vendor/nemo_text_processing/text_normalization/de/utils.py new file mode 100644 index 0000000000000000000000000000000000000000..5d785dec24354faad44441a175ec854f6aa84c5a --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/de/utils.py @@ -0,0 +1,48 @@ +# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import csv +import os + +from zonos3.vendor.nemo_text_processing.utils.logging import logger + + +def get_abs_path(rel_path): + """ + Get absolute path + + Args: + rel_path: relative path to this file + + Returns absolute path + """ + abs_path = os.path.dirname(os.path.abspath(__file__)) + os.sep + rel_path + + if not os.path.exists(abs_path): + logger.warning(f'{abs_path} does not exist') + return abs_path + + +def load_labels(abs_path): + """ + loads relative path file as dictionary + + Args: + abs_path: absolute path + + Returns dictionary of mappings + """ + with open(abs_path, encoding="utf-8") as label_tsv: + labels = list(csv.reader(label_tsv, delimiter="\t")) + return labels diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/de/verbalizers/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/de/verbalizers/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..7d200df57afefb446fde9b8fcd896f7e110f367f --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/de/verbalizers/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/de/verbalizers/cardinal.py b/zonos3/vendor/nemo_text_processing/text_normalization/de/verbalizers/cardinal.py new file mode 100644 index 0000000000000000000000000000000000000000..a8418d706c7319af06a111d5d0fe4d7c50712b78 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/de/verbalizers/cardinal.py @@ -0,0 +1,43 @@ +# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import NEMO_NOT_QUOTE, GraphFst + + +class CardinalFst(GraphFst): + """ + Finite state transducer for verbalizing cardinals + e.g. cardinal { integer: "zwei" } -> "zwei" + + Args: + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="cardinal", kind="verbalize", deterministic=deterministic) + optional_sign = pynini.closure(pynini.cross("negative: \"true\" ", "minus "), 0, 1) + self.optional_sign = optional_sign + integer = pynini.closure(NEMO_NOT_QUOTE, 1) + + self.integer = pynutil.delete(" \"") + integer + pynutil.delete("\"") + + integer = pynutil.delete("integer:") + self.integer + self.numbers = integer + graph = optional_sign + self.numbers + delete_tokens = self.delete_tokens(graph) + self.fst = delete_tokens.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/de/verbalizers/date.py b/zonos3/vendor/nemo_text_processing/text_normalization/de/verbalizers/date.py new file mode 100644 index 0000000000000000000000000000000000000000..446296fa86939bf58f970434693017f370b5e8d1 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/de/verbalizers/date.py @@ -0,0 +1,62 @@ +# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.de.utils import get_abs_path, load_labels +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import ( + NEMO_NOT_QUOTE, + NEMO_SIGMA, + GraphFst, + delete_preserve_order, +) + + +class DateFst(GraphFst): + """ + Finite state transducer for verbalizing date, e.g. + date { day: "vier" month: "april" year: "zwei tausend zwei" } -> "vierter april zwei tausend zwei" + date { day: "vier" month: "mai" year: "zwei tausend zwei" } -> "vierter mai zwei tausend zwei" + + Args: + ordinal: ordinal verbalizer GraphFst + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, ordinal: GraphFst, deterministic: bool = True): + super().__init__(name="date", kind="verbalize", deterministic=deterministic) + + day_cardinal = pynutil.delete("day: \"") + pynini.closure(NEMO_NOT_QUOTE, 1) + pynutil.delete("\"") + day = day_cardinal @ pynini.cdrewrite(ordinal.ordinal_stem, "", "[EOS]", NEMO_SIGMA) + pynutil.insert("ter") + + months_names = pynini.union(*[x[1] for x in load_labels(get_abs_path("data/months/abbr_to_name.tsv"))]) + month = pynutil.delete("month: \"") + pynini.closure(NEMO_NOT_QUOTE, 1) + pynutil.delete("\"") + final_month = month @ months_names + final_month |= month @ pynini.difference(NEMO_SIGMA, months_names) @ pynini.cdrewrite( + ordinal.ordinal_stem, "", "[EOS]", NEMO_SIGMA + ) + pynutil.insert("ter") + + year = pynutil.delete("year: \"") + pynini.closure(NEMO_NOT_QUOTE, 1) + pynutil.delete("\"") + + # day month year + graph_dmy = day + pynini.accep(" ") + final_month + pynini.closure(pynini.accep(" ") + year, 0, 1) + graph_dmy |= final_month + pynini.accep(" ") + year + + self.graph = graph_dmy | year + final_graph = self.graph + delete_preserve_order + + delete_tokens = self.delete_tokens(final_graph) + self.fst = delete_tokens.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/de/verbalizers/decimal.py b/zonos3/vendor/nemo_text_processing/text_normalization/de/verbalizers/decimal.py new file mode 100644 index 0000000000000000000000000000000000000000..5a7dadac7e701f3fe1f37a84a58d0c1e634995e9 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/de/verbalizers/decimal.py @@ -0,0 +1,59 @@ +# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.de.taggers.decimal import quantities +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import ( + NEMO_NOT_QUOTE, + GraphFst, + delete_preserve_order, + insert_space, +) + + +class DecimalFst(GraphFst): + """ + Finite state transducer for classifying decimal, e.g. + decimal { negative: "true" integer_part: "elf" fractional_part: "vier null sechs" quantity: "billionen" } -> minus elf komma vier null sechs billionen + decimal { integer_part: "eins" quantity: "billion" } -> eins billion + + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="decimal", kind="classify", deterministic=deterministic) + + delete_space = pynutil.delete(" ") + self.optional_sign = pynini.closure(pynini.cross("negative: \"true\"", "minus ") + delete_space, 0, 1) + self.integer = pynutil.delete("integer_part: \"") + pynini.closure(NEMO_NOT_QUOTE, 1) + pynutil.delete("\"") + self.fractional_default = ( + pynutil.delete("fractional_part: \"") + pynini.closure(NEMO_NOT_QUOTE, 1) + pynutil.delete("\"") + ) + + self.fractional = pynutil.insert(" komma ") + self.fractional_default + + self.quantity = ( + delete_space + insert_space + pynutil.delete("quantity: \"") + quantities + pynutil.delete("\"") + ) + self.optional_quantity = pynini.closure(self.quantity, 0, 1) + + graph = self.optional_sign + ( + self.integer + self.quantity | self.integer + delete_space + self.fractional + self.optional_quantity + ) + + self.numbers = graph + graph += delete_preserve_order + delete_tokens = self.delete_tokens(graph) + self.fst = delete_tokens.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/de/verbalizers/electronic.py b/zonos3/vendor/nemo_text_processing/text_normalization/de/verbalizers/electronic.py new file mode 100644 index 0000000000000000000000000000000000000000..6ee388d214f4f92708246f7fa0c06613d8c38af9 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/de/verbalizers/electronic.py @@ -0,0 +1,82 @@ +# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.de.utils import get_abs_path +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import ( + NEMO_ALPHA, + NEMO_NOT_QUOTE, + NEMO_SIGMA, + NEMO_SPACE, + GraphFst, + delete_preserve_order, + insert_space, +) + + +class ElectronicFst(GraphFst): + """ + Finite state transducer for verbalizing electronic + e.g. electronic { username: "abc" domain: "hotmail.com" } -> "a b c at hotmail punkt com" + -> "a b c at h o t m a i l punkt c o m" + -> "a b c at hotmail punkt c o m" + -> "a b c at h o t m a i l punkt com" + Args: + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="electronic", kind="verbalize", deterministic=deterministic) + graph_digit_no_zero = pynini.invert( + pynini.string_file(get_abs_path("data/numbers/digit.tsv")) + ).optimize() | pynini.cross("1", "eins") + graph_zero = pynini.invert(pynini.string_file(get_abs_path("data/numbers/zero.tsv"))).optimize() + graph_digit = graph_digit_no_zero | graph_zero + graph_symbols = pynini.string_file(get_abs_path("data/electronic/symbols.tsv")).optimize() + server_common = pynini.string_file(get_abs_path("data/electronic/server_name.tsv")) + domain_common = pynini.string_file(get_abs_path("data/electronic/domain.tsv")) + + def add_space_after_char(): + return pynini.closure(NEMO_NOT_QUOTE - pynini.accep(" ") + insert_space) + ( + NEMO_NOT_QUOTE - pynini.accep(" ") + ) + + verbalize_characters = pynini.cdrewrite(graph_symbols | graph_digit, "", "", NEMO_SIGMA) + + user_name = pynutil.delete('username: "') + add_space_after_char() + pynutil.delete('"') + user_name @= verbalize_characters + + convert_defaults = (pynutil.add_weight(NEMO_NOT_QUOTE, weight=0.0001) | server_common) | domain_common + domain = convert_defaults + pynini.closure(insert_space + convert_defaults) + domain @= verbalize_characters + + domain = pynutil.delete('domain: "') + domain + pynutil.delete('"') + protocol = ( + pynutil.delete('protocol: "') + + add_space_after_char() @ pynini.cdrewrite(graph_symbols, "", "", NEMO_SIGMA) + + pynutil.delete('"') + ) + self.graph = (pynini.closure(protocol + NEMO_SPACE, 0, 1) + domain) | ( + user_name + NEMO_SPACE + pynutil.insert("at ") + domain | (pynutil.insert("at ") + user_name) + ) + + # normalizes sentence-final periods following URLs + delete_tokens = self.delete_tokens(self.graph + delete_preserve_order) + preserve_final_period = pynini.cdrewrite(pynini.cross(" punkt", "."), "", "[EOS]", NEMO_SIGMA) + + delete_tokens = delete_tokens @ preserve_final_period + self.fst = delete_tokens.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/de/verbalizers/fraction.py b/zonos3/vendor/nemo_text_processing/text_normalization/de/verbalizers/fraction.py new file mode 100644 index 0000000000000000000000000000000000000000..66750928d8104e4af1575cc9fe17349bf37cb72c --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/de/verbalizers/fraction.py @@ -0,0 +1,72 @@ +# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import ( + NEMO_NOT_QUOTE, + NEMO_SIGMA, + GraphFst, + delete_preserve_order, + insert_space, +) + + +class FractionFst(GraphFst): + """ + Finite state transducer for verbalizing fraction + e.g. fraction { integer: "drei" numerator: "eins" denominator: "zwei" }-> drei ein halb + e.g. fraction { numerator: "vier" denominator: "zwei" } -> vier halbe + e.g. fraction { numerator: "drei" denominator: "vier" } -> drei viertel + + Args: + ordinal: ordinal GraphFst + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, ordinal: GraphFst, deterministic: bool = True): + super().__init__(name="fraction", kind="verbalize", deterministic=deterministic) + + optional_sign = pynini.closure(pynini.cross("negative: \"true\"", "minus ") + pynutil.delete(" "), 0, 1) + change_one = pynini.cdrewrite( + pynutil.add_weight(pynini.cross("eins", "ein"), weight=-0.0001), "[BOS]", "[EOS]", NEMO_SIGMA + ) + change_numerator_two = pynini.cdrewrite(pynini.cross("zweitel", "halbe"), "[BOS]", "[EOS]", NEMO_SIGMA) + integer = pynutil.delete("integer_part: \"") + change_one + pynutil.delete("\" ") + numerator = pynutil.delete("numerator: \"") + change_one + pynutil.delete("\" ") + denominator = ( + pynutil.delete("denominator: \"") + + pynini.closure(NEMO_NOT_QUOTE) + @ ( + pynini.cdrewrite(pynini.closure(ordinal.ordinal_stem, 0, 1), "", "[EOS]", NEMO_SIGMA) + + pynutil.insert("tel") + ) + @ change_numerator_two + + pynutil.delete("\"") + ) + + integer += insert_space + pynini.closure(pynutil.insert("und ", weight=0.001), 0, 1) + + denominator_one_half = pynini.cdrewrite(pynini.cross("ein halbe", "ein halb"), "[BOS]", "[EOS]", NEMO_SIGMA) + + fraction_default = (numerator + insert_space + denominator) @ denominator_one_half + + self.graph = optional_sign + pynini.closure(integer, 0, 1) + fraction_default + + graph = self.graph + delete_preserve_order + + delete_tokens = self.delete_tokens(graph) + self.fst = delete_tokens.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/de/verbalizers/measure.py b/zonos3/vendor/nemo_text_processing/text_normalization/de/verbalizers/measure.py new file mode 100644 index 0000000000000000000000000000000000000000..84d033613e4b5464c4c6ec4844c8b10f3d9566a8 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/de/verbalizers/measure.py @@ -0,0 +1,54 @@ +# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import ( + NEMO_NOT_QUOTE, + GraphFst, + delete_extra_space, + delete_preserve_order, +) + + +class MeasureFst(GraphFst): + """ + Finite state transducer for verbalizing measure, e.g. + measure { cardinal { integer: "zwei" units: "unzen" } } -> "zwei unzen" + measure { cardinal { integer_part: "zwei" quantity: "millionen" units: "unzen" } } -> "zwei millionen unzen" + + Args: + decimal: decimal GraphFst + cardinal: cardinal GraphFst + fraction: fraction GraphFst + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, decimal: GraphFst, cardinal: GraphFst, fraction: GraphFst, deterministic: bool): + super().__init__(name="measure", kind="verbalize", deterministic=deterministic) + unit = pynutil.delete("units: \"") + pynini.closure(NEMO_NOT_QUOTE) + pynutil.delete("\"") + + graph_decimal = decimal.fst + graph_cardinal = cardinal.fst + graph_fraction = fraction.fst + + graph = (graph_cardinal | graph_decimal | graph_fraction) + pynini.accep(" ") + unit + + graph |= unit + delete_extra_space + (graph_cardinal | graph_decimal) + graph += delete_preserve_order + + delete_tokens = self.delete_tokens(graph) + self.fst = delete_tokens.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/de/verbalizers/money.py b/zonos3/vendor/nemo_text_processing/text_normalization/de/verbalizers/money.py new file mode 100644 index 0000000000000000000000000000000000000000..eb134a5e9a7ee177dceba5d2b502e190ed311022 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/de/verbalizers/money.py @@ -0,0 +1,74 @@ +# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import NEMO_NOT_QUOTE, GraphFst, delete_preserve_order + + +class MoneyFst(GraphFst): + """ + Finite state transducer for verbalizing money, e.g. + money { currency_maj: "euro" integer_part: "ein"} -> "ein euro" + money { currency_maj: "euro" integer_part: "eins" fractional_part: "null null eins"} -> "eins komma null null eins euro" + money { integer_part: "ein" currency_maj: "pfund" fractional_part: "vierzig" preserve_order: true} -> "ein pfund vierzig" + money { integer_part: "ein" currency_maj: "pfund" fractional_part: "vierzig" currency_min: "pence" preserve_order: true} -> "ein pfund vierzig pence" + money { fractional_part: "ein" currency_min: "penny" preserve_order: true} -> "ein penny" + money { currency_maj: "pfund" integer_part: "null" fractional_part: "null eins" quantity: "million"} -> "null komma null eins million pfund" + + Args: + decimal: GraphFst + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, decimal: GraphFst, deterministic: bool = True): + super().__init__(name="money", kind="verbalize", deterministic=deterministic) + + keep_space = pynini.accep(" ") + + maj = pynutil.delete("currency_maj: \"") + pynini.closure(NEMO_NOT_QUOTE, 1) + pynutil.delete("\"") + min = pynutil.delete("currency_min: \"") + pynini.closure(NEMO_NOT_QUOTE, 1) + pynutil.delete("\"") + + fractional_part = ( + pynutil.delete("fractional_part: \"") + pynini.closure(NEMO_NOT_QUOTE, 1) + pynutil.delete("\"") + ) + + integer_part = pynutil.delete("integer_part: \"") + pynini.closure(NEMO_NOT_QUOTE, 1) + pynutil.delete("\"") + optional_add_and = pynini.closure(pynutil.insert("und "), 0, 1) + + # *** currency_maj + graph_integer = integer_part + keep_space + maj + + # *** currency_maj + (***) | ((und) *** current_min) + graph_integer_with_minor = ( + integer_part + + keep_space + + maj + + keep_space + + (fractional_part | (optional_add_and + fractional_part + keep_space + min)) + + delete_preserve_order + ) + + # *** komma *** currency_maj + graph_decimal = decimal.fst + keep_space + maj + + # *** current_min + graph_minor = fractional_part + keep_space + min + delete_preserve_order + + graph = graph_integer | graph_integer_with_minor | graph_decimal | graph_minor + + delete_tokens = self.delete_tokens(graph) + self.fst = delete_tokens.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/de/verbalizers/ordinal.py b/zonos3/vendor/nemo_text_processing/text_normalization/de/verbalizers/ordinal.py new file mode 100644 index 0000000000000000000000000000000000000000..57f5443d8c0407938ca0f1d1611c9348ecf8a682 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/de/verbalizers/ordinal.py @@ -0,0 +1,54 @@ +# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.de.utils import get_abs_path +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import NEMO_NOT_QUOTE, NEMO_SIGMA, GraphFst + + +class OrdinalFst(GraphFst): + """ + Finite state transducer for verbalizing roman numerals + e.g. ordinal { integer: "vier" } } -> "vierter" + -> "viertes" ... + + Args: + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="ordinal", kind="verbalize", deterministic=deterministic) + graph_digit = pynini.string_file(get_abs_path("data/ordinals/digit.tsv")).invert() + graph_ties = pynini.string_file(get_abs_path("data/ordinals/ties.tsv")).invert() + graph_thousands = pynini.string_file(get_abs_path("data/ordinals/thousands.tsv")).invert() + + graph = pynutil.delete("integer: \"") + pynini.closure(NEMO_NOT_QUOTE, 1) + pynutil.delete("\"") + + suffixes = pynini.union("ten", "tem", "ter", "tes", "te") + convert_rest = pynutil.insert(suffixes, weight=0.01) + self.ordinal_stem = graph_digit | graph_ties | graph_thousands + + suffix = pynini.cdrewrite( + pynini.closure(self.ordinal_stem, 0, 1) + convert_rest, + "", + "[EOS]", + NEMO_SIGMA, + ).optimize() + self.graph = pynini.compose(graph, suffix) + self.suffix = suffix + delete_tokens = self.delete_tokens(self.graph) + self.fst = delete_tokens.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/de/verbalizers/telephone.py b/zonos3/vendor/nemo_text_processing/text_normalization/de/verbalizers/telephone.py new file mode 100644 index 0000000000000000000000000000000000000000..3fac950256150278bc4688c78645dfca25e535da --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/de/verbalizers/telephone.py @@ -0,0 +1,43 @@ +# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import NEMO_NOT_QUOTE, GraphFst, delete_preserve_order + + +class TelephoneFst(GraphFst): + """ + Finite state transducer for verbalizing telephone, e.g. + telephone { country_code: "plus neun und vierzig" number_part: "null eins eins eins null null null" } + -> "plus neun und vierzig null eins eins eins null null null" + + Args: + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="telephone", kind="verbalize", deterministic=deterministic) + + country_code = pynutil.delete("country_code: \"") + pynini.closure(NEMO_NOT_QUOTE, 1) + pynutil.delete("\"") + + number_part = pynutil.delete("number_part: \"") + pynini.closure(NEMO_NOT_QUOTE, 1) + pynutil.delete("\"") + + self.graph = country_code + pynini.accep(" ") + number_part + + graph = self.graph + delete_preserve_order + delete_tokens = self.delete_tokens(graph) + self.fst = delete_tokens.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/de/verbalizers/time.py b/zonos3/vendor/nemo_text_processing/text_normalization/de/verbalizers/time.py new file mode 100644 index 0000000000000000000000000000000000000000..e08a4bcf71fae926e8a2d49d03b5cb630e745674 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/de/verbalizers/time.py @@ -0,0 +1,121 @@ +# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.de.utils import get_abs_path, load_labels +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import ( + NEMO_DIGIT, + NEMO_SIGMA, + GraphFst, + convert_space, + delete_preserve_order, +) + + +class TimeFst(GraphFst): + """ + Finite state transducer for verbalizing electronic, e.g. + time { hours: "2" minutes: "15"} -> "zwei uhr fünfzehn" + time { minutes: "15" hours: "2" } -> "viertel nach zwei" + time { minutes: "15" hours: "2" } -> "fünfzehn nach zwei" + time { hours: "14" minutes: "15"} -> "vierzehn uhr fünfzehn" + time { minutes: "15" hours: "14" } -> "viertel nach zwei" + time { minutes: "15" hours: "14" } -> "fünfzehn nach drei" + time { minutes: "45" hours: "14" } -> "viertel vor drei" + + Args: + cardinal_tagger: cardinal_tagger tagger GraphFst + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, cardinal_tagger: GraphFst, deterministic: bool = True): + super().__init__(name="time", kind="verbalize", deterministic=deterministic) + + # add weight so when using inverse text normalization this conversion is depriotized + night_to_early = pynutil.add_weight( + pynini.invert(pynini.string_file(get_abs_path("data/time/hour_to_night.tsv"))).optimize(), weight=0.0001 + ) + hour_to = pynini.invert(pynini.string_file(get_abs_path("data/time/hour_to.tsv"))).optimize() + minute_to = pynini.invert(pynini.string_file(get_abs_path("data/time/minute_to.tsv"))).optimize() + time_zone_graph = pynini.invert( + convert_space(pynini.union(*[x[1] for x in load_labels(get_abs_path("data/time/time_zone.tsv"))])) + ) + + graph_zero = pynini.invert(pynini.string_file(get_abs_path("data/numbers/zero.tsv"))).optimize() + number_verbalization = graph_zero | cardinal_tagger.two_digit_non_zero + hour = pynutil.delete("hours: \"") + pynini.closure(NEMO_DIGIT, 1) + pynutil.delete("\"") + hour_verbalized = hour @ number_verbalization @ pynini.cdrewrite( + pynini.cross("eins", "ein"), "[BOS]", "[EOS]", NEMO_SIGMA + ) + pynutil.insert(" uhr") + minute = pynutil.delete("minutes: \"") + pynini.closure(NEMO_DIGIT, 1) + pynutil.delete("\"") + zone = pynutil.delete("zone: \"") + time_zone_graph + pynutil.delete("\"") + optional_zone = pynini.closure(pynini.accep(" ") + zone, 0, 1) + second = pynutil.delete("seconds: \"") + pynini.closure(NEMO_DIGIT, 1) + pynutil.delete("\"") + graph_hms = ( + hour_verbalized + + pynini.accep(" ") + + minute @ number_verbalization + + pynutil.insert(" minuten") + + pynini.accep(" ") + + second @ number_verbalization + + pynutil.insert(" sekunden") + + optional_zone + ) + graph_hms @= pynini.cdrewrite( + pynini.cross("eins minuten", "eine minute") | pynini.cross("eins sekunden", "eine sekunde"), + pynini.union(" ", "[BOS]"), + "", + NEMO_SIGMA, + ) + + min_30 = [str(x) for x in range(1, 31)] + min_30 = pynini.union(*min_30) + min_29 = [str(x) for x in range(1, 30)] + min_29 = pynini.union(*min_29) + + graph_h = hour_verbalized + graph_hm = hour_verbalized + pynini.accep(" ") + minute @ number_verbalization + + graph_m_past_h = ( + minute @ min_30 @ (number_verbalization | pynini.cross("15", "viertel")) + + pynini.accep(" ") + + pynutil.insert("nach ") + # + hour @ number_verbalization + + hour @ pynini.cdrewrite(night_to_early, "[BOS]", "[EOS]", NEMO_SIGMA) @ number_verbalization + ) + graph_m30_h = ( + minute @ pynini.cross("30", "halb") + + pynini.accep(" ") + + hour @ pynini.cdrewrite(night_to_early, "[BOS]", "[EOS]", NEMO_SIGMA) @ hour_to @ number_verbalization + ) + graph_m_to_h = ( + minute @ minute_to @ min_29 @ (number_verbalization | pynini.cross("15", "viertel")) + + pynini.accep(" ") + + pynutil.insert("vor ") + + hour @ pynini.cdrewrite(night_to_early, "[BOS]", "[EOS]", NEMO_SIGMA) @ hour_to @ number_verbalization + ) + + self.graph = ( + graph_hms + | graph_h + | graph_hm + | pynutil.add_weight(graph_m_past_h, weight=0.0001) + | pynutil.add_weight(graph_m30_h, weight=0.0001) + | pynutil.add_weight(graph_m_to_h, weight=0.0001) + ) + optional_zone + delete_tokens = self.delete_tokens(self.graph + delete_preserve_order) + self.fst = delete_tokens.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/de/verbalizers/verbalize.py b/zonos3/vendor/nemo_text_processing/text_normalization/de/verbalizers/verbalize.py new file mode 100644 index 0000000000000000000000000000000000000000..881e213db4b53853474804c622563946f117f156 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/de/verbalizers/verbalize.py @@ -0,0 +1,76 @@ +# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from zonos3.vendor.nemo_text_processing.text_normalization.de.taggers.cardinal import CardinalFst as CardinalTagger +from zonos3.vendor.nemo_text_processing.text_normalization.de.verbalizers.cardinal import CardinalFst +from zonos3.vendor.nemo_text_processing.text_normalization.de.verbalizers.date import DateFst +from zonos3.vendor.nemo_text_processing.text_normalization.de.verbalizers.decimal import DecimalFst +from zonos3.vendor.nemo_text_processing.text_normalization.de.verbalizers.electronic import ElectronicFst +from zonos3.vendor.nemo_text_processing.text_normalization.de.verbalizers.fraction import FractionFst +from zonos3.vendor.nemo_text_processing.text_normalization.de.verbalizers.measure import MeasureFst +from zonos3.vendor.nemo_text_processing.text_normalization.de.verbalizers.money import MoneyFst +from zonos3.vendor.nemo_text_processing.text_normalization.de.verbalizers.ordinal import OrdinalFst +from zonos3.vendor.nemo_text_processing.text_normalization.de.verbalizers.telephone import TelephoneFst +from zonos3.vendor.nemo_text_processing.text_normalization.de.verbalizers.time import TimeFst +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import GraphFst +from zonos3.vendor.nemo_text_processing.text_normalization.en.verbalizers.whitelist import WhiteListFst + + +class VerbalizeFst(GraphFst): + """ + Composes other verbalizer grammars. + For deployment, this grammar will be compiled and exported to OpenFst Finite State Archive (FAR) File. + More details to deployment at NeMo/tools/text_processing_deployment. + + Args: + deterministic: if True will provide a single transduction option, + for False multiple options (used for audio-based normalization) + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="verbalize", kind="verbalize", deterministic=deterministic) + cardinal_tagger = CardinalTagger(deterministic=deterministic) + cardinal = CardinalFst(deterministic=deterministic) + cardinal_graph = cardinal.fst + ordinal = OrdinalFst(deterministic=deterministic) + ordinal_graph = ordinal.fst + decimal = DecimalFst(deterministic=deterministic) + decimal_graph = decimal.fst + fraction = FractionFst(ordinal=ordinal, deterministic=deterministic) + fraction_graph = fraction.fst + date = DateFst(ordinal=ordinal) + date_graph = date.fst + measure = MeasureFst(cardinal=cardinal, decimal=decimal, fraction=fraction, deterministic=deterministic) + measure_graph = measure.fst + electronic = ElectronicFst(deterministic=deterministic) + electronic_graph = electronic.fst + whitelist_graph = WhiteListFst(deterministic=deterministic).fst + money_graph = MoneyFst(decimal=decimal).fst + telephone_graph = TelephoneFst(deterministic=deterministic).fst + time_graph = TimeFst(cardinal_tagger=cardinal_tagger, deterministic=deterministic).fst + + graph = ( + cardinal_graph + | measure_graph + | decimal_graph + | ordinal_graph + | date_graph + | electronic_graph + | money_graph + | fraction_graph + | whitelist_graph + | telephone_graph + | time_graph + ) + self.fst = graph diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/de/verbalizers/verbalize_final.py b/zonos3/vendor/nemo_text_processing/text_normalization/de/verbalizers/verbalize_final.py new file mode 100644 index 0000000000000000000000000000000000000000..d5702f80660bf74fbb3d1e8336fd416a38f4acf5 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/de/verbalizers/verbalize_final.py @@ -0,0 +1,70 @@ +# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import os + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.de.verbalizers.verbalize import VerbalizeFst +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import ( + GraphFst, + delete_extra_space, + delete_space, + generator_main, +) +from zonos3.vendor.nemo_text_processing.text_normalization.en.verbalizers.word import WordFst +from zonos3.vendor.nemo_text_processing.utils.logging import logger + + +class VerbalizeFinalFst(GraphFst): + """ + Finite state transducer that verbalizes an entire sentence + + Args: + deterministic: if True will provide a single transduction option, + for False multiple options (used for audio-based normalization) + cache_dir: path to a dir with .far grammar file. Set to None to avoid using cache. + overwrite_cache: set to True to overwrite .far files + """ + + def __init__(self, deterministic: bool = True, cache_dir: str = None, overwrite_cache: bool = False): + super().__init__(name="verbalize_final", kind="verbalize", deterministic=deterministic) + + far_file = None + if cache_dir is not None and cache_dir != "None": + os.makedirs(cache_dir, exist_ok=True) + far_file = os.path.join(cache_dir, f"de_tn_{deterministic}_deterministic_verbalizer.far") + if not overwrite_cache and far_file and os.path.exists(far_file): + self.fst = pynini.Far(far_file, mode="r")["verbalize"] + logger.info(f'VerbalizeFinalFst graph was restored from {far_file}.') + else: + verbalize = VerbalizeFst(deterministic=deterministic).fst + word = WordFst(deterministic=deterministic).fst + + types = verbalize | word + graph = ( + pynutil.delete("tokens") + + delete_space + + pynutil.delete("{") + + delete_space + + types + + delete_space + + pynutil.delete("}") + ) + graph = delete_space + pynini.closure(graph + delete_extra_space) + graph + delete_space + + self.fst = graph.optimize() + if far_file: + generator_main(far_file, {"verbalize": self.fst}) diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/en/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..c4762391d3b46a0b26b0c86840e2514edc2447cf --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/__init__.py @@ -0,0 +1,17 @@ +# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from zonos3.vendor.nemo_text_processing.text_normalization.en.taggers.tokenize_and_classify import ClassifyFst +from zonos3.vendor.nemo_text_processing.text_normalization.en.verbalizers.verbalize import VerbalizeFst +from zonos3.vendor.nemo_text_processing.text_normalization.en.verbalizers.verbalize_final import VerbalizeFinalFst diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/clean_eval_data.py b/zonos3/vendor/nemo_text_processing/text_normalization/en/clean_eval_data.py new file mode 100644 index 0000000000000000000000000000000000000000..fbe05ea5ae2e790ae229622bd94cb9514d8708dd --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/clean_eval_data.py @@ -0,0 +1,342 @@ +# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from argparse import ArgumentParser +from typing import List + +import regex as re + +from zonos3.vendor.nemo_text_processing.text_normalization.data_loader_utils import ( + EOS_TYPE, + Instance, + load_files, + training_data_to_sentences, +) + +""" +This file is for evaluation purposes. +filter_loaded_data() cleans data (list of instances) for text normalization. Filters and cleaners can be specified for each semiotic class individually. +For example, normalized text should only include characters and whitespace characters but no punctuation. + Cardinal unnormalized instances should contain at least one integer and all other characters are removed. +""" + + +class Filter: + """ + Filter class + + Args: + class_type: semiotic class used in dataset + process_func: function to transform text + filter_func: function to filter text + + """ + + def __init__(self, class_type: str, process_func: object, filter_func: object): + self.class_type = class_type + self.process_func = process_func + self.filter_func = filter_func + + def filter(self, instance: Instance) -> bool: + """ + filter function + + Args: + filters given instance with filter function + + Returns: True if given instance fulfills criteria or does not belong to class type + """ + if instance.token_type != self.class_type: + return True + return self.filter_func(instance) + + def process(self, instance: Instance) -> Instance: + """ + process function + + Args: + processes given instance with process function + + Returns: processed instance if instance belongs to expected class type or original instance + """ + if instance.token_type != self.class_type: + return instance + return self.process_func(instance) + + +def filter_cardinal_1(instance: Instance) -> bool: + ok = re.search(r"[0-9]", instance.un_normalized) + return ok + + +def process_cardinal_1(instance: Instance) -> Instance: + un_normalized = instance.un_normalized + normalized = instance.normalized + un_normalized = re.sub(r"[^0-9]", "", un_normalized) + normalized = re.sub(r"[^a-z ]", "", normalized) + return Instance(token_type=instance.token_type, un_normalized=un_normalized, normalized=normalized) + + +def filter_ordinal_1(instance: Instance) -> bool: + ok = re.search(r"(st|nd|rd|th)\s*$", instance.un_normalized) + return ok + + +def process_ordinal_1(instance: Instance) -> Instance: + un_normalized = instance.un_normalized + normalized = instance.normalized + un_normalized = re.sub(r"[,\s]", "", un_normalized) + normalized = re.sub(r"[^a-z ]", "", normalized) + return Instance(token_type=instance.token_type, un_normalized=un_normalized, normalized=normalized) + + +def filter_decimal_1(instance: Instance) -> bool: + ok = re.search(r"[0-9]", instance.un_normalized) + return ok + + +def process_decimal_1(instance: Instance) -> Instance: + un_normalized = instance.un_normalized + un_normalized = re.sub(r",", "", un_normalized) + normalized = instance.normalized + normalized = re.sub(r"[^a-z ]", "", normalized) + return Instance(token_type=instance.token_type, un_normalized=un_normalized, normalized=normalized) + + +def filter_measure_1(instance: Instance) -> bool: + ok = True + return ok + + +def process_measure_1(instance: Instance) -> Instance: + un_normalized = instance.un_normalized + normalized = instance.normalized + un_normalized = re.sub(r",", "", un_normalized) + un_normalized = re.sub(r"m2", "m²", un_normalized) + un_normalized = re.sub(r"(\d)([^\d.\s])", r"\1 \2", un_normalized) + normalized = re.sub(r"[^a-z\s]", "", normalized) + normalized = re.sub(r"per ([a-z\s]*)s$", r"per \1", normalized) + normalized = re.sub(r"[^a-z ]", "", normalized) + return Instance(token_type=instance.token_type, un_normalized=un_normalized, normalized=normalized) + + +def filter_money_1(instance: Instance) -> bool: + ok = re.search(r"[0-9]", instance.un_normalized) + return ok + + +def process_money_1(instance: Instance) -> Instance: + un_normalized = instance.un_normalized + normalized = instance.normalized + un_normalized = re.sub(r",", "", un_normalized) + un_normalized = re.sub(r"a\$", r"$", un_normalized) + un_normalized = re.sub(r"us\$", r"$", un_normalized) + un_normalized = re.sub(r"(\d)m\s*$", r"\1 million", un_normalized) + un_normalized = re.sub(r"(\d)bn?\s*$", r"\1 billion", un_normalized) + normalized = re.sub(r"[^a-z ]", "", normalized) + return Instance(token_type=instance.token_type, un_normalized=un_normalized, normalized=normalized) + + +def filter_time_1(instance: Instance) -> bool: + ok = re.search(r"[0-9]", instance.un_normalized) + return ok + + +def process_time_1(instance: Instance) -> Instance: + un_normalized = instance.un_normalized + un_normalized = re.sub(r": ", ":", un_normalized) + un_normalized = re.sub(r"(\d)\s?a\s?m\s?", r"\1 a.m.", un_normalized) + un_normalized = re.sub(r"(\d)\s?p\s?m\s?", r"\1 p.m.", un_normalized) + normalized = instance.normalized + normalized = re.sub(r"[^a-z ]", "", normalized) + return Instance(token_type=instance.token_type, un_normalized=un_normalized, normalized=normalized) + + +def filter_plain_1(instance: Instance) -> bool: + ok = True + return ok + + +def process_plain_1(instance: Instance) -> Instance: + un_normalized = instance.un_normalized + normalized = instance.normalized + return Instance(token_type=instance.token_type, un_normalized=un_normalized, normalized=normalized) + + +def filter_punct_1(instance: Instance) -> bool: + ok = True + return ok + + +def process_punct_1(instance: Instance) -> Instance: + un_normalized = instance.un_normalized + normalized = instance.normalized + return Instance(token_type=instance.token_type, un_normalized=un_normalized, normalized=normalized) + + +def filter_date_1(instance: Instance) -> bool: + ok = True + return ok + + +def process_date_1(instance: Instance) -> Instance: + un_normalized = instance.un_normalized + un_normalized = re.sub(r",", "", un_normalized) + normalized = instance.normalized + normalized = re.sub(r"[^a-z ]", "", normalized) + return Instance(token_type=instance.token_type, un_normalized=un_normalized, normalized=normalized) + + +def filter_letters_1(instance: Instance) -> bool: + ok = True + return ok + + +def process_letters_1(instance: Instance) -> Instance: + un_normalized = instance.un_normalized + normalized = instance.normalized + normalized = re.sub(r"[^a-z ]", "", normalized) + return Instance(token_type=instance.token_type, un_normalized=un_normalized, normalized=normalized) + + +def filter_verbatim_1(instance: Instance) -> bool: + ok = True + return ok + + +def process_verbatim_1(instance: Instance) -> Instance: + un_normalized = instance.un_normalized + normalized = instance.normalized + return Instance(token_type=instance.token_type, un_normalized=un_normalized, normalized=normalized) + + +def filter_digit_1(instance: Instance) -> bool: + ok = re.search(r"[0-9]", instance.un_normalized) + return ok + + +def process_digit_1(instance: Instance) -> Instance: + un_normalized = instance.un_normalized + normalized = instance.normalized + normalized = re.sub(r"[^a-z ]", "", normalized) + return Instance(token_type=instance.token_type, un_normalized=un_normalized, normalized=normalized) + + +def filter_telephone_1(instance: Instance) -> bool: + ok = re.search(r"[0-9]", instance.un_normalized) + return ok + + +def process_telephone_1(instance: Instance) -> Instance: + un_normalized = instance.un_normalized + normalized = instance.normalized + normalized = re.sub(r"[^a-z ]", "", normalized) + return Instance(token_type=instance.token_type, un_normalized=un_normalized, normalized=normalized) + + +def filter_electronic_1(instance: Instance) -> bool: + ok = re.search(r"[0-9]", instance.un_normalized) + return ok + + +def process_electronic_1(instance: Instance) -> Instance: + un_normalized = instance.un_normalized + normalized = instance.normalized + normalized = re.sub(r"[^a-z ]", "", normalized) + return Instance(token_type=instance.token_type, un_normalized=un_normalized, normalized=normalized) + + +def filter_fraction_1(instance: Instance) -> bool: + ok = re.search(r"[0-9]", instance.un_normalized) + return ok + + +def process_fraction_1(instance: Instance) -> Instance: + un_normalized = instance.un_normalized + normalized = instance.normalized + normalized = re.sub(r"[^a-z ]", "", normalized) + return Instance(token_type=instance.token_type, un_normalized=un_normalized, normalized=normalized) + + +def filter_address_1(instance: Instance) -> bool: + ok = True + return ok + + +def process_address_1(instance: Instance) -> Instance: + un_normalized = instance.un_normalized + normalized = instance.normalized + normalized = re.sub(r"[^a-z ]", "", normalized) + return Instance(token_type=instance.token_type, un_normalized=un_normalized, normalized=normalized) + + +filters = [] +filters.append(Filter(class_type="CARDINAL", process_func=process_cardinal_1, filter_func=filter_cardinal_1)) +filters.append(Filter(class_type="ORDINAL", process_func=process_ordinal_1, filter_func=filter_ordinal_1)) +filters.append(Filter(class_type="DECIMAL", process_func=process_decimal_1, filter_func=filter_decimal_1)) +filters.append(Filter(class_type="MEASURE", process_func=process_measure_1, filter_func=filter_measure_1)) +filters.append(Filter(class_type="MONEY", process_func=process_money_1, filter_func=filter_money_1)) +filters.append(Filter(class_type="TIME", process_func=process_time_1, filter_func=filter_time_1)) + +filters.append(Filter(class_type="DATE", process_func=process_date_1, filter_func=filter_date_1)) +filters.append(Filter(class_type="PLAIN", process_func=process_plain_1, filter_func=filter_plain_1)) +filters.append(Filter(class_type="PUNCT", process_func=process_punct_1, filter_func=filter_punct_1)) +filters.append(Filter(class_type="LETTERS", process_func=process_letters_1, filter_func=filter_letters_1)) +filters.append(Filter(class_type="VERBATIM", process_func=process_verbatim_1, filter_func=filter_verbatim_1)) +filters.append(Filter(class_type="DIGIT", process_func=process_digit_1, filter_func=filter_digit_1)) +filters.append(Filter(class_type="TELEPHONE", process_func=process_telephone_1, filter_func=filter_telephone_1)) +filters.append(Filter(class_type="ELECTRONIC", process_func=process_electronic_1, filter_func=filter_electronic_1)) +filters.append(Filter(class_type="FRACTION", process_func=process_fraction_1, filter_func=filter_fraction_1)) +filters.append(Filter(class_type="ADDRESS", process_func=process_address_1, filter_func=filter_address_1)) +filters.append(Filter(class_type=EOS_TYPE, process_func=lambda x: x, filter_func=lambda x: True)) + + +def filter_loaded_data(data: List[Instance], verbose: bool = False) -> List[Instance]: + """ + Filters list of instances + + Args: + data: list of instances + + Returns: filtered and transformed list of instances + """ + updates_instances = [] + for instance in data: + updated_instance = False + for fil in filters: + if fil.class_type == instance.token_type and fil.filter(instance): + instance = fil.process(instance) + updated_instance = True + if updated_instance: + if verbose: + print(instance) + updates_instances.append(instance) + return updates_instances + + +def parse_args(): + parser = ArgumentParser() + parser.add_argument("--input", help="input file path", type=str, default='./en_with_types/output-00001-of-00100') + parser.add_argument("--verbose", help="print filtered instances", action='store_true') + return parser.parse_args() + + +if __name__ == "__main__": + args = parse_args() + file_path = args.input + + print("Loading training data: " + file_path) + instance_list = load_files([file_path]) # List of instances + filtered_instance_list = filter_loaded_data(instance_list, args.verbose) + training_data_to_sentences(filtered_instance_list) diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/data/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..bc443be41c4c3fcf0764eb9fd3e1828d63f8438c --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/data/address/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/address/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..7d200df57afefb446fde9b8fcd896f7e110f367f --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/address/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/data/address/address_word.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/address/address_word.tsv new file mode 100644 index 0000000000000000000000000000000000000000..2e9e71615acd7b08addd723d7941a079c7267098 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/address/address_word.tsv @@ -0,0 +1,14 @@ +st Street +street Street +expy Expressway +fwy Freeway +hwy Highway +dr Drive +ct Court +ave Avenue +av Avenue +cir Circle +blvd Boulevard +alley Alley +way Way +jct Junction \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/data/address/state.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/address/state.tsv new file mode 100644 index 0000000000000000000000000000000000000000..4eb59eb4bdef06d9e923915950063e65a0ad7745 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/address/state.tsv @@ -0,0 +1,49 @@ +Alabama AL +Alaska AK +Arizona AZ +Arkansas AR +California CA +Colorado CO +Connecticut CT +Delaware DE +Florida FL +Georgia GA +Hawaii HI +Idaho ID +Illinois IL +Indiana IND +Iowa IA +Kansas KS +Kentucky KY +Louisiana LA +Maine ME +Maryland MD +Massachusetts MA +Michigan MI +Minnesota MN +Mississippi MS +Missouri MO +Montana MT +Nebraska NE +Nevada NV +New Hampshire NH +New Jersey NJ +New Mexico NM +New York NY +North Carolina NC +North Dakota ND +Oregon OR +Pennsylvania PA +Rhode Island RI +South Carolina SC +South Dakota SD +Tennessee TN +Tennessee TENN +Texas TX +Utah UT +Vermont VT +Virginia VA +Washington WA +West Virginia WV +Wisconsin WI +Wyoming WY \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/data/date/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/date/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..bc443be41c4c3fcf0764eb9fd3e1828d63f8438c --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/date/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/data/date/day.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/date/day.tsv new file mode 100644 index 0000000000000000000000000000000000000000..ef8dd7af285253aae82202206f5a574f7741184d --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/date/day.tsv @@ -0,0 +1,31 @@ +one +two +three +four +five +six +seven +eight +nine +ten +eleven +twelve +thirteen +fourteen +fifteen +sixteen +seventeen +eighteen +nineteen +twenty +twenty one +twenty two +twenty three +twenty four +twenty five +twenty six +twenty seven +twenty eight +twenty nine +thirty +thirty one \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/data/date/month_abbr.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/date/month_abbr.tsv new file mode 100644 index 0000000000000000000000000000000000000000..e70e41045b3bc9b693a0e8791cfecfa2001cf4fc --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/date/month_abbr.tsv @@ -0,0 +1,12 @@ +jan january +feb february +mar march +apr april +jun june +jul july +aug august +sep september +sept september +oct october +nov november +dec december diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/data/date/month_name.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/date/month_name.tsv new file mode 100644 index 0000000000000000000000000000000000000000..1c05ac02a39e1e568ff94dfd7a08f2670573aed6 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/date/month_name.tsv @@ -0,0 +1,12 @@ +january +february +march +april +may +june +july +august +september +october +november +december diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/data/date/month_number.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/date/month_number.tsv new file mode 100644 index 0000000000000000000000000000000000000000..f0cacd5d1ed32680df0dd38af4354a89b37b0223 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/date/month_number.tsv @@ -0,0 +1,24 @@ +1 january +2 february +3 march +4 april +5 may +6 june +7 july +8 august +9 september +10 october +11 november +12 december +01 january +02 february +03 march +04 april +05 may +06 june +07 july +08 august +09 september +10 october +11 november +12 december \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/data/date/year_suffix.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/date/year_suffix.tsv new file mode 100644 index 0000000000000000000000000000000000000000..8c799ddbcfba20ea267a9cd3951e563a3fdf55f0 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/date/year_suffix.tsv @@ -0,0 +1,16 @@ +A. D AD +A.D AD +a. d AD +a.d AD +a. d. AD +a.d. AD +B. C BC +B.C BC +b. c BC +b.c BC +A. D. AD +A.D. AD +B. C. BC +B.C. BC +b. c. BC +b.c. BC diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/data/electronic/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/electronic/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..a1cf281f0908d225f51d921e9ddbdf92f9b14d99 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/electronic/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/data/electronic/cc_cues.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/electronic/cc_cues.tsv new file mode 100644 index 0000000000000000000000000000000000000000..c42d25f1395a43949b9a2b01c1d14ad6751a734e --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/electronic/cc_cues.tsv @@ -0,0 +1,5 @@ +card ending in +credit card number +credit card +debit card number +debit card \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/data/electronic/domain.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/electronic/domain.tsv new file mode 100644 index 0000000000000000000000000000000000000000..01da3f0bde9022f97e71724af1b995fc6b5cb96a --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/electronic/domain.tsv @@ -0,0 +1,13 @@ +.com dot com +.org dot org +.gov dot gov +.edu dot edu +.uk dot UK +.fr dot FR +.net dot net +.br dot BR +.in dot IN +.ru dot RU +.de dot DE +.it dot IT +.jpg dot jpeg \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/data/electronic/symbol.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/electronic/symbol.tsv new file mode 100644 index 0000000000000000000000000000000000000000..5e8973f415334d3a72cf6e49fecf84a803ed2ecc --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/electronic/symbol.tsv @@ -0,0 +1,19 @@ +. dot +- dash +_ underscore +! exclamation mark +# number sign +$ dollar sign +% percent +& ampersand +' quote +* asterisk ++ plus +/ slash += equal sign +? question mark +^ circumflex +` right single quote +| vertical bar +~ tilde +, comma \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/data/electronic/words.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/electronic/words.tsv new file mode 100644 index 0000000000000000000000000000000000000000..784c17d49be9fb5e390ea94d739ebd46baaf7620 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/electronic/words.tsv @@ -0,0 +1,16 @@ +drive +sim +early +access +program +rtx RTX +developer +basepod BASEPOD +cuda CUDA +cv +enterprise +services +nvidia NVIDIA +dgx DGX +pro +help diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/data/measure/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/measure/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..bc443be41c4c3fcf0764eb9fd3e1828d63f8438c --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/measure/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/data/measure/math_operation.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/measure/math_operation.tsv new file mode 100644 index 0000000000000000000000000000000000000000..21e72fd0c40556748d53abc4dbd565300e18aa60 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/measure/math_operation.tsv @@ -0,0 +1,8 @@ ++ plus +- minus +/ divided +÷ divided +: divided +× times +* times +· times \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/data/measure/unit.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/measure/unit.tsv new file mode 100644 index 0000000000000000000000000000000000000000..6a3ad687d070acdd13d6693257031f5b6b3382f7 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/measure/unit.tsv @@ -0,0 +1,135 @@ +amu atomic mass unit +bar bar +° degree +º degree +°c degree Celsius +°C degree Celsius +ºc degree Celsius +ºC degree Celsius +℃ degree Celsius +cm2 square centimeter +cm² square centimeter +cm3 cubic centimeter +cm³ cubic centimeter +cm centimeter +cwt hundredweight +db decibel +dm3 cubic decimeter +dm³ cubic decimeter +dm decimeter +ds decisecond +°f degree Fahrenheit +°F degree Fahrenheit +℉ degree Fahrenheit +ft foot +ghz gigahertz +gw gigawatt +gwh gigawatt hour +hz hertz +" inch +kbps kilobit per second +kcal kilo calory +kgf kilogram force +kg kilogram +khz kilohertz +km2 square kilometer +km² square kilometer +km3 cubic kilometer +km³ cubic kilometer +km kilometer +kpa kilopascal +kwh kilowatt hour +kw kilowatt +kW kilowatt +lb pound +lbs pound +m2 square meter +m² square meter +m3 cubic meter +m³ cubic meter +mbps megabit per second +mg milligram +mhz megahertz +mi2 square mile +mi² square mile +mi3 cubic mile +mi³ cubic mile +cu mi cubic mile +mi mile +min minute +ml milliliter +mm2 square millimeter +mm² square millimeter +mol mole +mpa megapascal +mph mile per hour +ng nanogram +nm nanometer +ns nanosecond +oz ounce +pa pascal +% percent +rad radian +rpm revolution per minute +sq ft square foot +sq mi square mile +sv sievert +tb terabyte +tj terajoule +tl teraliter +v volt +yd yard +μg microgram +μm micrometer +μs microsecond +ω ohm +atm ATM +au AU +bq BQ +cc CC +cd CD +da DA +eb EB +ev EV +f F +gb GB +g G +gl GL +gpa GPA +gy GY +ha HA +h H +hl HL +hp GP +hs HS +kb KB +kl KL +kn KN +kt KT +kv KV +lm LM +ma MA +mA MA +mb MB +mc MC +mf MF +m M +mm MM +ms MS +mv MV +mw MW +pb PB +pg PG +ps PS +s S +tb TB +tb YB +zb ZB +sec second +min minute +hr hour +d day +wk week +mo month +yr year +svc service \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/data/measure/unit_alternatives.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/measure/unit_alternatives.tsv new file mode 100644 index 0000000000000000000000000000000000000000..77e4057ae70b8d7296606f6e21335e2097dc071b --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/measure/unit_alternatives.tsv @@ -0,0 +1,43 @@ +atm atmosphere +bq becquerel +cd candela +da dalton +eb exabyte +f degree Fahrenheit +gb gigabyte +g gram +gl gigaliter +ha hectare +h hour +hl hectoliter +hp horsepower +hp horsepower +kb kilobit +kb kilobyte +ma megaampere +mA megaampere +ma milliampere +mA milliampere +mb megabyte +mc megacoulomb +mf megafarad +m meter +m minute +mm millimeter +mm millimeter +mm millimeter +ms megasecond +ms mega siemens +ms millisecond +mv millivolt +mV millivolt +mw megawatt +mW megawatt +pb petabyte +pg petagram +ps petasecond +s second +tb terabyte +tb terabyte +yb yottabyte +zb zettabyte diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/data/money/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/money/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..bc443be41c4c3fcf0764eb9fd3e1828d63f8438c --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/money/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/data/money/currency_major.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/money/currency_major.tsv new file mode 100644 index 0000000000000000000000000000000000000000..5201efd8a3a2b36e6042b6725974ee5b149ae78d --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/money/currency_major.tsv @@ -0,0 +1,39 @@ +$ dollar +$ us dollar +US$ us dollar +฿ Thai Baht +£ pound +€ euro +₩ won +nzd new zealand dollar +rs rupee +chf swiss franc +dkk danish kroner +fim finnish markka +aed arab emirates dirham +¥ yen +czk czech koruna +mro mauritanian ouguiya +pkr pakistani rupee +crc costa rican colon +hk$ hong kong dollar +npr nepalese rupee +awg aruban florin +nok norwegian kroner +tzs tanzanian shilling +sek swedish kronor +cyp cypriot pound +r real +sar saudi riyal +cve cape verde escudo +rsd serbian dinar +dm german mark +shp saint helena pounds +php philippine peso +cad canadian dollar +ssp south sudanese pound +scr seychelles rupee +mvr maldivian rufiyaa +DH dirham +Dh dirham +Dhs. dirham diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/data/money/currency_minor_plural.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/money/currency_minor_plural.tsv new file mode 100644 index 0000000000000000000000000000000000000000..a2f67b3a3d00d67490514623bac7f815720f10b2 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/money/currency_minor_plural.tsv @@ -0,0 +1,4 @@ +$ cents +US$ cents +€ cents +£ pence \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/data/money/currency_minor_singular.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/money/currency_minor_singular.tsv new file mode 100644 index 0000000000000000000000000000000000000000..fe629d87b693de1180ee75c642190687a754e126 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/money/currency_minor_singular.tsv @@ -0,0 +1,3 @@ +$ cent +€ cent +£ penny \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/data/money/per_unit.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/money/per_unit.tsv new file mode 100644 index 0000000000000000000000000000000000000000..40804ca56e887706bcfbc15a967e4064163a71db --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/money/per_unit.tsv @@ -0,0 +1,70 @@ +/ea each +/dozen per dozen +/sec per second +/min per minute +/hr per hour +/h per hour +/d per day +/wk per week +/mo per month +/yr per year +/svc per service +/L per liter +/l per liter +/gal per gallon +/gallon per gallon +/kg per kilogram +/g per gram +/lb per pound +/pound per pound +/oz per ounce +/ounce per ounce +/unit per unit +/ft per foot +/foot per foot +/' per foot +/in per inch +/inch per inch +/" per inch +/m per meter +/meter per meter +/yard per yard +/yd per yard +/mile per mile +/mi per mile +/square meter per square meter +/sq meter per square meter +/sq m per square meter +/m² per square meter +/square foot per square foot +/sq foot per square foot +/sq ft per square foot +/ft² per square foot +/cubic foot per cubic foot +/cu foot per cubic foot +/cu ft per cubic foot +/ft³ per cubic foot +/cubic meter per cubic meter +/cu meter per cubic meter +/cu m per cubic meter +/m³ per cubic meter +/visit per visit +/page per page +/pg per page +/usr per user +/user per user +/night per night +/passenger per passenger +/word per word +/wd per word +/GB per gigabyte +/MB per megabyte +/TB per terrabyte +/cycle per cycle +/load per load +/person per person +/task per task +/shift per shift +/project per project +/class per class +/session per session \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/data/number/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/number/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..bc443be41c4c3fcf0764eb9fd3e1828d63f8438c --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/number/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/data/number/cardinal_number_name.far b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/number/cardinal_number_name.far new file mode 100644 index 0000000000000000000000000000000000000000..ba070eedfebde1cfae5a9efbed1c7f4a73afff65 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/number/cardinal_number_name.far @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b71c8a37eeba429c5277970fec247023e2f8eccfd8858dbf526b9108bc957cac +size 325078 diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/data/number/cardinal_number_name_au.far b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/number/cardinal_number_name_au.far new file mode 100644 index 0000000000000000000000000000000000000000..24ab297b29716769826c37e00c9a7173ce6d79ca Binary files /dev/null and b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/number/cardinal_number_name_au.far differ diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/data/number/digit.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/number/digit.tsv new file mode 100644 index 0000000000000000000000000000000000000000..fa329799db6f086e618c8028829b6d2f4b03e88f --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/number/digit.tsv @@ -0,0 +1,9 @@ +one 1 +two 2 +three 3 +four 4 +five 5 +six 6 +seven 7 +eight 8 +nine 9 \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/data/number/fraction.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/number/fraction.tsv new file mode 100644 index 0000000000000000000000000000000000000000..0085ad53ffaa3db2fe0ba3a0c138f582a401142a --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/number/fraction.tsv @@ -0,0 +1,18 @@ +¼ 1/4 +½ 1/2 +¾ 3/4 +⅐ 1/7 +⅑ 1/9 +⅒ 1/10 +⅓ 1/3 +⅔ 2/3 +⅕ 1/5 +⅖ 2/5 +⅗ 3/5 +⅘ 4/5 +⅙ 1/6 +⅚ 5/6 +⅛ 1/8 +⅜ 3/8 +⅝ 5/8 +⅞ 7/8 diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/data/number/hundred.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/number/hundred.tsv new file mode 100644 index 0000000000000000000000000000000000000000..10e2b9645a530cfded1cddc74a8cffbf9ed7395f --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/number/hundred.tsv @@ -0,0 +1 @@ +hundred \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/data/number/quantity_abbr.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/number/quantity_abbr.tsv new file mode 100644 index 0000000000000000000000000000000000000000..7dba4f03713c1e05aeafcf64fcc1a62d44865344 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/number/quantity_abbr.tsv @@ -0,0 +1,10 @@ +M million +MLN million +m million +mln million +B billion +b billion +BN billion +bn billion +K thousand +k thousand \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/data/number/teen.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/number/teen.tsv new file mode 100644 index 0000000000000000000000000000000000000000..8e60fa1d3cb3cb8fce06150f33e298bee291462a --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/number/teen.tsv @@ -0,0 +1,10 @@ +ten 10 +eleven 11 +twelve 12 +thirteen 13 +fourteen 14 +fifteen 15 +sixteen 16 +seventeen 17 +eighteen 18 +nineteen 19 \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/data/number/thousand.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/number/thousand.tsv new file mode 100644 index 0000000000000000000000000000000000000000..bf30542bb6bc1d32435348cd09be00708993dc7b --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/number/thousand.tsv @@ -0,0 +1,22 @@ +thousand +million +billion +trillion +quadrillion +quintillion +sextillion +septillion +octillion +nonillion +decillion +undecillion +duodecillion +tredecillion +quattuordecillion +quindecillion +sexdecillion +septendecillion +octodecillion +novemdecillion +vigintillion +centillion \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/data/number/ty.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/number/ty.tsv new file mode 100644 index 0000000000000000000000000000000000000000..65f9839fda6de480d5b9601ecbc2989749716906 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/number/ty.tsv @@ -0,0 +1,8 @@ +twenty 2 +thirty 3 +forty 4 +fifty 5 +sixty 6 +seventy 7 +eighty 8 +ninety 9 \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/data/number/zero.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/number/zero.tsv new file mode 100644 index 0000000000000000000000000000000000000000..a1b116c10f09fab957175a55f4e19530db49cb3d --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/number/zero.tsv @@ -0,0 +1 @@ +zero 0 diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/data/ordinal/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/ordinal/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..bc443be41c4c3fcf0764eb9fd3e1828d63f8438c --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/ordinal/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/data/ordinal/digit.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/ordinal/digit.tsv new file mode 100644 index 0000000000000000000000000000000000000000..4b7fc24f1606194e7da3b936bb7413eee5723dea --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/ordinal/digit.tsv @@ -0,0 +1,9 @@ +first one +second two +third three +fourth four +fifth five +sixth sixth +seventh seven +eighth eight +ninth nine \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/data/ordinal/teen.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/ordinal/teen.tsv new file mode 100644 index 0000000000000000000000000000000000000000..496fefc086d195f89f422f015594cdbe17158e1b --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/ordinal/teen.tsv @@ -0,0 +1 @@ +twelfth twelve \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/data/roman/README.md b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/roman/README.md new file mode 100644 index 0000000000000000000000000000000000000000..398e1974f823feed75354215533b84b85fa3918d --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/roman/README.md @@ -0,0 +1,20 @@ +`female.tsv` - List of common female names. Copyright (c) January 1991 by Mark Kantrowitz, 4987 names, Version 1.3 (29-MAR-94) +Source: [https://www.cs.cmu.edu/Groups/AI/areas/nlp/corpora/names/female.txt](https://www.cs.cmu.edu/Groups/AI/areas/nlp/corpora/names/female.txt) + +`male.tsv` - List of common male names. Copyright (c) January 1991 by Mark Kantrowitz, 2940 names, Version 1.3 (29-MAR-94) +Source: [https://www.cs.cmu.edu/Groups/AI/areas/nlp/corpora/names/male.txt](https://www.cs.cmu.edu/Groups/AI/areas/nlp/corpora/names/male.txt) + +[Corpora Readme.txt](https://www.cs.cmu.edu/Groups/AI/areas/nlp/corpora/names/readme.txt): + +You may use the lists of names for any purpose, so long as credit is given +in any published work. You may also redistribute the list if you +provide the recipients with a copy of this README file. The lists are +not in the public domain (I retain the copyright on the lists) but are +freely redistributable. + +If you have any additions to the lists of names, I would appreciate +receiving them. + +My email address is mkant+@cs.cmu.edu. + +Mark Kantrowitz \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/data/roman/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/roman/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..bc443be41c4c3fcf0764eb9fd3e1828d63f8438c --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/roman/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/data/roman/female.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/roman/female.tsv new file mode 100644 index 0000000000000000000000000000000000000000..4e248ce2ab7cd08dd038d5c71d91feb10799d599 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/roman/female.tsv @@ -0,0 +1,4998 @@ +Abagael +Abagail +Abbe +Abbey +Abbi +Abbie +Abby +Abigael +Abigail +Abigale +Abra +Acacia +Ada +Adah +Adaline +Adara +Addie +Addis +Adel +Adela +Adelaide +Adele +Adelice +Adelina +Adelind +Adeline +Adella +Adelle +Adena +Adey +Adi +Adiana +Adina +Adora +Adore +Adoree +Adorne +Adrea +Adria +Adriaens +Adrian +Adriana +Adriane +Adrianna +Adrianne +Adrien +Adriena +Adrienne +Aeriel +Aeriela +Aeriell +Ag +Agace +Agata +Agatha +Agathe +Aggi +Aggie +Aggy +Agna +Agnella +Agnes +Agnese +Agnesse +Agneta +Agnola +Agretha +Aida +Aidan +Aigneis +Aila +Aile +Ailee +Aileen +Ailene +Ailey +Aili +Ailina +Ailyn +Aime +Aimee +Aimil +Aina +Aindrea +Ainslee +Ainsley +Ainslie +Ajay +Alaine +Alameda +Alana +Alanah +Alane +Alanna +Alayne +Alberta +Albertina +Albertine +Albina +Alecia +Aleda +Aleece +Aleecia +Aleen +Alejandra +Alejandrina +Alena +Alene +Alessandra +Aleta +Alethea +Alex +Alexa +Alexandra +Alexandrina +Alexi +Alexia +Alexina +Alexine +Alexis +Alfie +Alfreda +Ali +Alia +Alica +Alice +Alicea +Alicia +Alida +Alidia +Alina +Aline +Alis +Alisa +Alisha +Alison +Alissa +Alisun +Alix +Aliza +Alla +Alleen +Allegra +Allene +Alli +Allianora +Allie +Allina +Allis +Allison +Allissa +Allsun +Ally +Allyce +Allyn +Allys +Allyson +Alma +Almeda +Almeria +Almeta +Almira +Almire +Aloise +Aloisia +Aloysia +Alpa +Alta +Althea +Alvera +Alvina +Alvinia +Alvira +Alyce +Alyda +Alys +Alysa +Alyse +Alysia +Alyson +Alyss +Alyssa +Amabel +Amabelle +Amalea +Amalee +Amaleta +Amalia +Amalie +Amalita +Amalle +Amanda +Amandi +Amandie +Amandy +Amara +Amargo +Amata +Amber +Amberly +Ambrosia +Ambur +Ame +Amelia +Amelie +Amelina +Ameline +Amelita +Ami +Amie +Amity +Ammamaria +Amy +Ana +Anabel +Anabella +Anabelle +Anais +Analiese +Analise +Anallese +Anallise +Anastasia +Anastasie +Anastassia +Anatola +Andee +Andi +Andie +Andra +Andrea +Andreana +Andree +Andrei +Andria +Andriana +Andriette +Andromache +Andromeda +Andy +Anestassia +Anet +Anett +Anetta +Anette +Ange +Angel +Angela +Angele +Angelia +Angelica +Angelika +Angelina +Angeline +Angelique +Angelita +Angelle +Angie +Angil +Angy +Ania +Anica +Anissa +Anita +Anitra +Anja +Anjanette +Anjela +Ann +Ann-Mari +Ann-Marie +Anna +Anna-Diana +Anna-Diane +Anna-Maria +Annabal +Annabel +Annabela +Annabell +Annabella +Annabelle +Annadiana +Annadiane +Annalee +Annalena +Annaliese +Annalisa +Annalise +Annalyse +Annamari +Annamaria +Annamarie +Anne +Anne-Corinne +Anne-Mar +Anne-Marie +Annecorinne +Anneliese +Annelise +Annemarie +Annetta +Annette +Anni +Annice +Annie +Annissa +Annmaria +Annmarie +Annnora +Annora +Anny +Anselma +Ansley +Anstice +Anthe +Anthea +Anthia +Antoinette +Antonella +Antonetta +Antonia +Antonie +Antonietta +Antonina +Anya +Aphrodite +Appolonia +Aprilette +Ara +Arabel +Arabela +Arabele +Arabella +Arabelle +Arda +Ardath +Ardeen +Ardelia +Ardelis +Ardella +Ardelle +Arden +Ardene +Ardenia +Ardine +Ardis +Ardith +Ardra +Ardyce +Ardys +Ardyth +Aretha +Ariadne +Ariana +Arianne +Aridatha +Ariel +Ariela +Ariella +Arielle +Arlana +Arlee +Arleen +Arlen +Arlena +Arlene +Arleta +Arlette +Arleyne +Arlie +Arliene +Arlina +Arlinda +Arline +Arly +Arlyn +Arlyne +Aryn +Ashely +Ashlee +Ashleigh +Ashlen +Ashley +Ashli +Ashlie +Ashly +Asia +Astra +Astrid +Astrix +Atalanta +Athena +Athene +Atlanta +Atlante +Auberta +Aubine +Aubree +Aubrette +Aubrey +Aubrie +Aubry +Audi +Audie +Audra +Audre +Audrey +Audrie +Audry +Audrye +Audy +Augusta +Auguste +Augustina +Augustine +Aura +Aurea +Aurel +Aurelea +Aurelia +Aurelie +Auria +Aurie +Aurilia +Aurlie +Auroora +Aurora +Aurore +Austin +Austina +Austine +Ava +Aveline +Averil +Averyl +Avie +Avis +Aviva +Avivah +Avril +Avrit +Ayn +Bab +Babara +Babette +Babita +Babs +Bambi +Bambie +Bamby +Barb +Barbabra +Barbara +Barbara-Anne +Barbaraanne +Barbe +Barbee +Barbette +Barbey +Barbi +Barbie +Barbra +Barby +Bari +Barrie +Barry +Basia +Bathsheba +Batsheva +Bea +Beatrice +Beatrisa +Beatrix +Beatriz +Beau +Bebe +Becca +Becka +Becki +Beckie +Becky +Bee +Beilul +Beitris +Bekki +Bel +Belia +Belicia +Belinda +Belita +Bell +Bella +Bellamy +Bellanca +Belle +Bellina +Belva +Belvia +Bendite +Benedetta +Benedicta +Benedikta +Benetta +Benita +Benni +Bennie +Benny +Benoite +Berenice +Beret +Berget +Berna +Bernadene +Bernadette +Bernadina +Bernadine +Bernardina +Bernardine +Bernelle +Bernete +Bernetta +Bernette +Berni +Bernice +Bernie +Bernita +Berny +Berri +Berrie +Berry +Bert +Berta +Berte +Bertha +Berthe +Berti +Bertie +Bertina +Bertine +Berty +Beryl +Beryle +Bess +Bessie +Bessy +Beth +Bethanne +Bethany +Bethena +Bethina +Betsey +Betsy +Betta +Bette +Bette-Ann +Betteann +Betteanne +Betti +Bettie +Bettina +Bettine +Betty +Bettye +Beulah +Bev +Beverie +Beverlee +Beverlie +Beverly +Bevvy +Bianca +Bianka +Biddy +Bidget +Bill +Billi +Billie +Billy +Binni +Binnie +Binny +Bird +Birdie +Birgit +Birgitta +Blair +Blaire +Blake +Blakelee +Blakeley +Blanca +Blanch +Blancha +Blanche +Blinni +Blinnie +Blinny +Bliss +Blisse +Blithe +Blondell +Blondelle +Blondie +Blondy +Blythe +Bo +Bobbette +Bobbi +Bobbie +Bobby +Bobette +Bobina +Bobine +Bobinette +Bonita +Bonnee +Bonni +Bonnie +Bonny +Brana +Brandais +Brande +Brandea +Brandi +Brandice +Brandie +Brandise +Brandy +Brea +Breanne +Brear +Bree +Breena +Bren +Brena +Brenda +Brenn +Brenna +Brett +Bria +Briana +Brianna +Brianne +Bride +Bridget +Bridgett +Bridgette +Bridie +Brier +Brietta +Brigid +Brigida +Brigit +Brigitta +Brigitte +Brina +Briney +Briny +Brit +Brita +Britaney +Britani +Briteny +Britney +Britni +Britt +Britta +Brittan +Brittany +Britte +Brittney +Brook +Brooke +Brooks +Brunella +Brunhilda +Brunhilde +Bryana +Bryn +Bryna +Brynn +Brynna +Brynne +Buffy +Bunni +Bunnie +Bunny +Burta +Cabrina +Cacilia +Cacilie +Caitlin +Caitrin +Cal +Calida +Calla +Calley +Calli +Callida +Callie +Cally +Calypso +Cam +Camala +Camel +Camella +Camellia +Cameo +Cami +Camila +Camile +Camilla +Camille +Cammi +Cammie +Cammy +Canada +Candace +Candi +Candice +Candida +Candide +Candie +Candis +Candra +Candy +Cappella +Caprice +Cara +Caralie +Caren +Carena +Caresa +Caressa +Caresse +Carey +Cari +Caria +Carie +Caril +Carilyn +Carin +Carina +Carine +Cariotta +Carissa +Carita +Caritta +Carla +Carlee +Carleen +Carlen +Carlena +Carlene +Carley +Carli +Carlie +Carlin +Carlina +Carline +Carlisle +Carlita +Carlota +Carlotta +Carly +Carlye +Carlyn +Carlynn +Carlynne +Carma +Carmel +Carmela +Carmelia +Carmelina +Carmelita +Carmella +Carmelle +Carmen +Carmina +Carmine +Carmita +Carmon +Caro +Carol +Carol-Jean +Carola +Carolan +Carolann +Carole +Carolee +Caroleen +Carolie +Carolin +Carolina +Caroline +Caroljean +Carolyn +Carolyne +Carolynn +Caron +Carree +Carri +Carrie +Carrissa +Carrol +Carroll +Carry +Cary +Caryl +Caryn +Casandra +Casey +Casi +Casia +Casie +Cass +Cassandra +Cassandre +Cassandry +Cassaundra +Cassey +Cassi +Cassie +Cassondra +Cassy +Cat +Catarina +Cate +Caterina +Catha +Catharina +Catharine +Cathe +Cathee +Catherin +Catherina +Catherine +Cathi +Cathie +Cathleen +Cathlene +Cathrin +Cathrine +Cathryn +Cathy +Cathyleen +Cati +Catie +Catina +Catlaina +Catlee +Catlin +Catrina +Catriona +Caty +Cayla +Cecelia +Cecil +Cecile +Ceciley +Cecilia +Cecilla +Cecily +Ceil +Cele +Celene +Celesta +Celeste +Celestia +Celestina +Celestine +Celestyn +Celestyna +Celia +Celie +Celina +Celinda +Celine +Celinka +Celisse +Celle +Cesya +Chad +Chanda +Chandal +Chandra +Channa +Chantal +Chantalle +Charil +Charin +Charis +Charissa +Charisse +Charita +Charity +Charla +Charlean +Charleen +Charlena +Charlene +Charline +Charlot +Charlott +Charlotta +Charlotte +Charmain +Charmaine +Charmane +Charmian +Charmine +Charmion +Charo +Charyl +Chastity +Chelsae +Chelsea +Chelsey +Chelsie +Chelsy +Cher +Chere +Cherey +Cheri +Cherianne +Cherice +Cherida +Cherie +Cherilyn +Cherilynn +Cherin +Cherise +Cherish +Cherlyn +Cherri +Cherrita +Cherry +Chery +Cherye +Cheryl +Cheslie +Chiarra +Chickie +Chicky +Chiquita +Chloe +Chloette +Chloris +Chris +Chriss +Chrissa +Chrissie +Chrissy +Christa +Christabel +Christabella +Christabelle +Christal +Christalle +Christan +Christean +Christel +Christen +Christi +Christian +Christiana +Christiane +Christie +Christin +Christina +Christine +Christy +Christyna +Chrysa +Chrysler +Chrystal +Chryste +Chrystel +Ciara +Cicely +Cicily +Ciel +Cilka +Cinda +Cindee +Cindelyn +Cinderella +Cindi +Cindie +Cindra +Cindy +Cinnamon +Cissie +Cissy +Clair +Claire +Clara +Clarabelle +Clare +Claresta +Clareta +Claretta +Clarette +Clarey +Clari +Claribel +Clarice +Clarie +Clarinda +Clarine +Clarisa +Clarissa +Clarisse +Clarita +Clary +Claude +Claudelle +Claudetta +Claudette +Claudia +Claudie +Claudina +Claudine +Clea +Clem +Clemence +Clementia +Clementina +Clementine +Clemmie +Clemmy +Cleo +Cleopatra +Clerissa +Cleva +Clio +Clo +Cloe +Cloris +Clotilda +Clovis +Codee +Codi +Codie +Cody +Coleen +Colene +Coletta +Colette +Colleen +Collete +Collette +Collie +Colline +Colly +Con +Concettina +Conchita +Concordia +Conney +Conni +Connie +Conny +Consolata +Constance +Constancia +Constancy +Constanta +Constantia +Constantina +Constantine +Consuela +Consuelo +Cookie +Cora +Corabel +Corabella +Corabelle +Coral +Coralie +Coraline +Coralyn +Cordelia +Cordelie +Cordey +Cordie +Cordula +Cordy +Coreen +Corella +Corena +Corenda +Corene +Coretta +Corette +Corey +Cori +Corie +Corilla +Corina +Corine +Corinna +Corinne +Coriss +Corissa +Corliss +Corly +Cornela +Cornelia +Cornelle +Cornie +Corny +Correna +Correy +Corri +Corrianne +Corrie +Corrina +Corrine +Corrinne +Corry +Cortney +Cory +Cosetta +Cosette +Courtenay +Courtney +Cresa +Cris +Crissie +Crissy +Crista +Cristabel +Cristal +Cristen +Cristi +Cristie +Cristin +Cristina +Cristine +Cristionna +Cristy +Crysta +Crystal +Crystie +Cyb +Cybal +Cybel +Cybelle +Cybil +Cybill +Cyndi +Cyndy +Cynthea +Cynthia +Cynthie +Cynthy +Dacey +Dacia +Dacie +Dacy +Dael +Daffi +Daffie +Daffy +Dafna +Dagmar +Dahlia +Daile +Daisey +Daisi +Daisie +Daisy +Dale +Dalenna +Dalia +Dalila +Dallas +Daloris +Damara +Damaris +Damita +Dana +Danell +Danella +Danelle +Danette +Dani +Dania +Danica +Danice +Daniel +Daniela +Daniele +Daniella +Danielle +Danika +Danila +Danit +Danita +Danna +Danni +Dannie +Danny +Dannye +Danya +Danyelle +Danyette +Daphene +Daphna +Daphne +Dara +Darb +Darbie +Darby +Darcee +Darcey +Darci +Darcie +Darcy +Darda +Dareen +Darell +Darelle +Dari +Daria +Darice +Darla +Darleen +Darlene +Darline +Darryl +Darsey +Darsie +Darya +Daryl +Daryn +Dasha +Dasi +Dasie +Dasya +Datha +Daune +Daveen +Daveta +Davida +Davina +Davine +Davita +Dawn +Dawna +Dayle +Dayna +Dea +Deana +Deane +Deanna +Deanne +Deb +Debbi +Debbie +Debbra +Debby +Debee +Debera +Debi +Debor +Debora +Deborah +Debra +Dede +Dedie +Dedra +Dee +Dee Dee +Deeann +Deeanne +Deedee +Deena +Deerdre +Dehlia +Deidre +Deina +Deirdre +Del +Dela +Delaney +Delcina +Delcine +Delia +Delila +Delilah +Delinda +Dell +Della +Delly +Delora +Delores +Deloria +Deloris +Delphina +Delphine +Delphinia +Demeter +Demetra +Demetria +Demetris +Dena +Deni +Denice +Denise +Denna +Denni +Dennie +Denny +Deny +Denys +Denyse +Deonne +Desaree +Desdemona +Desirae +Desiree +Desiri +Deva +Devan +Devi +Devin +Devina +Devinne +Devon +Devondra +Devonna +Devonne +Devora +Dew +Di +Diahann +Diamond +Dian +Diana +Diandra +Diane +Diane-Marie +Dianemarie +Diann +Dianna +Dianne +Diannne +Didi +Dido +Diena +Dierdre +Dina +Dinah +Dinnie +Dinny +Dion +Dione +Dionis +Dionne +Dita +Dix +Dixie +Dode +Dodi +Dodie +Dody +Doe +Doll +Dolley +Dolli +Dollie +Dolly +Dolora +Dolores +Dolorita +Doloritas +Dominica +Dominique +Dona +Donella +Donelle +Donetta +Donia +Donica +Donielle +Donna +Donnajean +Donnamarie +Donni +Donnie +Donny +Dora +Doralia +Doralin +Doralyn +Doralynn +Doralynne +Dorcas +Dore +Doreen +Dorelia +Dorella +Dorelle +Dorena +Dorene +Doretta +Dorette +Dorey +Dori +Doria +Dorian +Dorice +Dorie +Dorine +Doris +Dorisa +Dorise +Dorit +Dorita +Doro +Dorolice +Dorolisa +Dorotea +Doroteya +Dorothea +Dorothee +Dorothy +Dorree +Dorri +Dorrie +Dorris +Dorry +Dorthea +Dorthy +Dory +Dosi +Dot +Doti +Dotti +Dottie +Dotty +Dove +Drea +Drew +Dulce +Dulcea +Dulci +Dulcia +Dulciana +Dulcie +Dulcine +Dulcinea +Dulcy +Dulsea +Dusty +Dyan +Dyana +Dyane +Dyann +Dyanna +Dyanne +Dyna +Dynah +E'Lane +Eada +Eadie +Eadith +Ealasaid +Eartha +Easter +Eba +Ebba +Ebonee +Ebony +Eda +Eddi +Eddie +Eddy +Ede +Edee +Edeline +Eden +Edi +Edie +Edin +Edita +Edith +Editha +Edithe +Ediva +Edna +Edwina +Edy +Edyth +Edythe +Effie +Eileen +Eilis +Eimile +Eirena +Ekaterina +Elaina +Elaine +Elana +Elane +Elayne +Elberta +Elbertina +Elbertine +Eleanor +Eleanora +Eleanore +Electra +Elena +Elene +Eleni +Elenore +Eleonora +Eleonore +Elfie +Elfreda +Elfrida +Elfrieda +Elga +Elianora +Elianore +Elicia +Elie +Elinor +Elinore +Elisa +Elisabet +Elisabeth +Elisabetta +Elise +Elisha +Elissa +Elita +Eliza +Elizabet +Elizabeth +Elka +Elke +Ella +Elladine +Elle +Ellen +Ellene +Ellette +Elli +Ellie +Ellissa +Elly +Ellyn +Ellynn +Elmira +Elna +Elnora +Elnore +Eloisa +Eloise +Elonore +Elora +Elsa +Elsbeth +Else +Elsey +Elsi +Elsie +Elsinore +Elspeth +Elsy +Elva +Elvera +Elvina +Elvira +Elwina +Elwira +Elyn +Elyse +Elysee +Elysha +Elysia +Elyssa +Em +Ema +Emalee +Emalia +Emanuela +Emelda +Emelia +Emelina +Emeline +Emelita +Emelyne +Emera +Emilee +Emili +Emilia +Emilie +Emiline +Emily +Emlyn +Emlynn +Emlynne +Emma +Emmalee +Emmaline +Emmalyn +Emmalynn +Emmalynne +Emmeline +Emmey +Emmi +Emmie +Emmy +Emmye +Emogene +Emyle +Emylee +Endora +Engracia +Enid +Enrica +Enrichetta +Enrika +Enriqueta +Enya +Eolanda +Eolande +Eran +Erda +Erena +Erica +Ericha +Ericka +Erika +Erin +Erina +Erinn +Erinna +Erma +Ermengarde +Ermentrude +Ermina +Erminia +Erminie +Erna +Ernaline +Ernesta +Ernestine +Ertha +Eryn +Esma +Esmaria +Esme +Esmeralda +Esmerelda +Essa +Essie +Essy +Esta +Estel +Estele +Estell +Estella +Estelle +Ester +Esther +Estrella +Estrellita +Ethel +Ethelda +Ethelin +Ethelind +Etheline +Ethelyn +Ethyl +Etta +Etti +Ettie +Etty +Eudora +Eugenia +Eugenie +Eugine +Eula +Eulalie +Eunice +Euphemia +Eustacia +Eva +Evaleen +Evangelia +Evangelin +Evangelina +Evangeline +Evania +Evanne +Eve +Eveleen +Evelina +Eveline +Evelyn +Evette +Evey +Evie +Evita +Evonne +Evvie +Evvy +Evy +Eyde +Eydie +Fabrianne +Fabrice +Fae +Faina +Faith +Fallon +Fan +Fanchette +Fanchon +Fancie +Fancy +Fanechka +Fania +Fanni +Fannie +Fanny +Fanya +Fara +Farah +Farand +Farica +Farra +Farrah +Farrand +Fatima +Faun +Faunie +Faustina +Faustine +Fawn +Fawna +Fawne +Fawnia +Fay +Faydra +Faye +Fayette +Fayina +Fayre +Fayth +Faythe +Federica +Fedora +Felecia +Felicdad +Felice +Felicia +Felicity +Felicle +Felipa +Felisha +Felita +Feliza +Fenelia +Feodora +Ferdinanda +Ferdinande +Fern +Fernanda +Fernande +Fernandina +Ferne +Fey +Fiann +Fianna +Fidela +Fidelia +Fidelity +Fifi +Fifine +Filia +Filide +Filippa +Fina +Fiona +Fionna +Fionnula +Fiorenze +Fleur +Fleurette +Flo +Flor +Flora +Florance +Flore +Florella +Florence +Florencia +Florentia +Florenza +Florette +Flori +Floria +Florice +Florida +Florie +Florina +Florinda +Floris +Florri +Florrie +Florry +Flory +Flossi +Flossie +Flossy +Flower +Fortuna +Fortune +Fran +France +Francene +Frances +Francesca +Francesmary +Francine +Francis +Francisca +Franciska +Francoise +Francyne +Frank +Frankie +Franky +Franni +Frannie +Franny +Frayda +Fred +Freda +Freddi +Freddie +Freddy +Fredelia +Frederica +Fredericka +Fredi +Fredia +Fredra +Fredrika +Freida +Frieda +Friederike +Fulvia +Gabbey +Gabbi +Gabbie +Gabey +Gabi +Gabie +Gabriel +Gabriela +Gabriell +Gabriella +Gabrielle +Gabriellia +Gabrila +Gaby +Gae +Gael +Gail +Gale +Gale +Galina +Garland +Garnet +Garnette +Gates +Gavra +Gavrielle +Gay +Gayla +Gayle +Gayleen +Gaylene +Gaynor +Gelya +Gen +Gena +Gene +Geneva +Genevieve +Genevra +Genia +Genna +Genni +Gennie +Gennifer +Genny +Genovera +Genvieve +George +Georgeanna +Georgeanne +Georgena +Georgeta +Georgetta +Georgette +Georgia +Georgiamay +Georgiana +Georgianna +Georgianne +Georgie +Georgina +Georgine +Gera +Geralda +Geraldina +Geraldine +Gerda +Gerhardine +Geri +Gerianna +Gerianne +Gerladina +Germain +Germaine +Germana +Gerri +Gerrie +Gerrilee +Gerry +Gert +Gerta +Gerti +Gertie +Gertrud +Gertruda +Gertrude +Gertrudis +Gerty +Giacinta +Giana +Gianina +Gianna +Gigi +Gilberta +Gilberte +Gilbertina +Gilbertine +Gilda +Gill +Gillan +Gilli +Gillian +Gillie +Gilligan +Gilly +Gina +Ginelle +Ginevra +Ginger +Ginni +Ginnie +Ginnifer +Ginny +Giorgia +Giovanna +Gipsy +Giralda +Gisela +Gisele +Gisella +Giselle +Gizela +Glad +Gladi +Gladis +Gladys +Gleda +Glen +Glenda +Glenine +Glenn +Glenna +Glennie +Glennis +Glori +Gloria +Gloriana +Gloriane +Glorianna +Glory +Glyn +Glynda +Glynis +Glynnis +Godiva +Golda +Goldarina +Goldi +Goldia +Goldie +Goldina +Goldy +Grace +Gracia +Gracie +Grata +Gratia +Gratiana +Gray +Grayce +Grazia +Gredel +Greer +Greta +Gretal +Gretchen +Grete +Gretel +Grethel +Gretna +Gretta +Grier +Griselda +Grissel +Guendolen +Guenevere +Guenna +Guglielma +Gui +Guillema +Guillemette +Guinevere +Guinna +Gunilla +Gunvor +Gus +Gusella +Gussi +Gussie +Gussy +Gusta +Gusti +Gustie +Gusty +Gwen +Gwendolen +Gwendolin +Gwendolyn +Gweneth +Gwenette +Gwenn +Gwenneth +Gwenni +Gwennie +Gwenny +Gwenora +Gwenore +Gwyn +Gwyneth +Gwynne +Gypsy +Hadria +Hailee +Haily +Haleigh +Halette +Haley +Hali +Halie +Halimeda +Halley +Halli +Hallie +Hally +Hana +Hanna +Hannah +Hanni +Hannibal +Hannie +Hannis +Hanny +Happy +Harlene +Harley +Harli +Harlie +Harmonia +Harmonie +Harmony +Harri +Harrie +Harriet +Harriett +Harrietta +Harriette +Harriot +Harriott +Hatti +Hattie +Hatty +Havivah +Hayley +Hazel +Heath +Heather +Heda +Hedda +Heddi +Heddie +Hedi +Hedvig +Hedwig +Hedy +Heida +Heide +Heidi +Heidie +Helaina +Helaine +Helen +Helen-Elizabeth +Helena +Helene +Helga +Helge +Helise +Hellene +Helli +Heloise +Helsa +Helyn +Hendrika +Henka +Henrie +Henrieta +Henrietta +Henriette +Henryetta +Hephzibah +Hermia +Hermina +Hermine +Herminia +Hermione +Herta +Hertha +Hester +Hesther +Hestia +Hetti +Hettie +Hetty +Hilarie +Hilary +Hilda +Hildagard +Hildagarde +Hilde +Hildegaard +Hildegarde +Hildy +Hillary +Hilliary +Hinda +Holley +Holli +Hollie +Holly +Holly-Anne +Hollyanne +Honey +Honor +Honoria +Hope +Horatia +Hortense +Hortensia +Hulda +Hyacinth +Hyacintha +Hyacinthe +Hyacinthia +Hyacinthie +Hynda +Ianthe +Ibbie +Ibby +Ida +Idalia +Idalina +Idaline +Idell +Idelle +Idette +Ike +Ikey +Ilana +Ileana +Ileane +Ilene +Ilise +Ilka +Illa +Ilona +Ilsa +Ilse +Ilysa +Ilyse +Ilyssa +Imelda +Imogen +Imogene +Imojean +Ina +Inci +Indira +Ines +Inesita +Inessa +Inez +Inga +Ingaberg +Ingaborg +Inge +Ingeberg +Ingeborg +Inger +Ingrid +Ingunna +Inna +Ioana +Iolande +Iolanthe +Iona +Iormina +Ira +Irena +Irene +Irina +Iris +Irita +Irma +Isa +Isabeau +Isabel +Isabelita +Isabella +Isabelle +Isador +Isadora +Isadore +Isahella +Iseabal +Isidora +Isis +Isobel +Issi +Issie +Issy +Ivett +Ivette +Ivie +Ivonne +Ivory +Ivy +Izabel +Izzi +Jacenta +Jacinda +Jacinta +Jacintha +Jacinthe +Jackelyn +Jacki +Jackie +Jacklin +Jacklyn +Jackquelin +Jackqueline +Jacky +Jaclin +Jaclyn +Jacquelin +Jacqueline +Jacquelyn +Jacquelynn +Jacquenetta +Jacquenette +Jacquetta +Jacquette +Jacqui +Jacquie +Jacynth +Jada +Jade +Jaime +Jaimie +Jaine +Jaleh +Jami +Jamie +Jamima +Jammie +Jan +Jana +Janaya +Janaye +Jandy +Jane +Janean +Janeczka +Janeen +Janel +Janela +Janella +Janelle +Janene +Janenna +Janessa +Janet +Janeta +Janetta +Janette +Janeva +Janey +Jania +Janice +Janie +Janifer +Janina +Janine +Janis +Janith +Janka +Janna +Jannel +Jannelle +Janot +Jany +Jaquelin +Jaquelyn +Jaquenetta +Jaquenette +Jaquith +Jasmin +Jasmina +Jasmine +Jayme +Jaymee +Jayne +Jaynell +Jazmin +Jean +Jeana +Jeane +Jeanelle +Jeanette +Jeanie +Jeanine +Jeanna +Jeanne +Jeannette +Jeannie +Jeannine +Jehanna +Jelene +Jemie +Jemima +Jemimah +Jemmie +Jemmy +Jen +Jena +Jenda +Jenelle +Jenette +Jeni +Jenica +Jeniece +Jenifer +Jeniffer +Jenilee +Jenine +Jenn +Jenna +Jennee +Jennette +Jenni +Jennica +Jennie +Jennifer +Jennilee +Jennine +Jenny +Jeraldine +Jeralee +Jere +Jeri +Jermaine +Jerrie +Jerrilee +Jerrilyn +Jerrine +Jerry +Jerrylee +Jess +Jessa +Jessalin +Jessalyn +Jessamine +Jessamyn +Jesse +Jesselyn +Jessi +Jessica +Jessie +Jessika +Jessy +Jewel +Jewell +Jewelle +Jill +Jillana +Jillane +Jillayne +Jilleen +Jillene +Jilli +Jillian +Jillie +Jilly +Jinny +Jo +Jo Ann +Jo-Ann +Jo-Anne +JoAnn +JoAnne +Joan +Joana +Joane +Joanie +Joann +Joanna +Joanne +Joannes +Jobey +Jobi +Jobie +Jobina +Joby +Jobye +Jobyna +Jocelin +Joceline +Jocelyn +Jocelyne +Jodee +Jodi +Jodie +Jody +Joela +Joelie +Joell +Joella +Joelle +Joellen +Joelly +Joellyn +Joelynn +Joete +Joey +Johanna +Johannah +Johnette +Johnna +Joice +Jojo +Jolee +Joleen +Jolene +Joletta +Joli +Jolie +Joline +Joly +Jolyn +Jolynn +Jonell +Joni +Jonie +Jonis +Jordain +Jordan +Jordana +Jordanna +Jorey +Jori +Jorie +Jorrie +Jorry +Joscelin +Josee +Josefa +Josefina +Joselyn +Josepha +Josephina +Josephine +Josey +Josi +Josie +Joslyn +Josselyn +Josy +Jourdan +Joy +Joya +Joyan +Joyann +Joyce +Joycelin +Joye +Joyous +Juana +Juanita +Jude +Judi +Judie +Judith +Juditha +Judy +Judye +Julee +Juli +Julia +Juliana +Juliane +Juliann +Julianna +Julianne +Julie +Julienne +Juliet +Julieta +Julietta +Juliette +Julina +Juline +Julissa +Julita +Junette +Junia +Junie +Junina +Justin +Justina +Justine +Jyoti +Kacey +Kacie +Kacy +Kai +Kaia +Kaila +Kaile +Kailey +Kaitlin +Kaitlyn +Kaitlynn +Kaja +Kakalina +Kala +Kaleena +Kali +Kalie +Kalila +Kalina +Kalinda +Kalindi +Kalli +Kally +Kameko +Kamila +Kamilah +Kamillah +Kandace +Kandy +Kania +Kanya +Kara +Kara-Lynn +Karalee +Karalynn +Kare +Karee +Karel +Karen +Karena +Kari +Karia +Karie +Karil +Karilynn +Karin +Karina +Karine +Kariotta +Karisa +Karissa +Karita +Karla +Karlee +Karleen +Karlen +Karlene +Karlie +Karlotta +Karlotte +Karly +Karlyn +Karmen +Karna +Karol +Karola +Karole +Karolina +Karoline +Karoly +Karon +Karrah +Karrie +Karry +Kary +Karyl +Karylin +Karyn +Kasey +Kass +Kassandra +Kassey +Kassi +Kassia +Kassie +Kaster +Kat +Kata +Katalin +Kate +Katee +Katerina +Katerine +Katey +Kath +Katha +Katharina +Katharine +Katharyn +Kathe +Katheleen +Katherina +Katherine +Katheryn +Kathi +Kathie +Kathleen +Kathlene +Kathlin +Kathrine +Kathryn +Kathryne +Kathy +Kathye +Kati +Katie +Katina +Katine +Katinka +Katleen +Katlin +Katrina +Katrine +Katrinka +Katti +Kattie +Katuscha +Katusha +Katy +Katya +Kay +Kaycee +Kaye +Kayla +Kayle +Kaylee +Kayley +Kaylil +Kaylyn +Kee +Keeley +Keelia +Keely +Kelcey +Kelci +Kelcie +Kelcy +Kelila +Kellen +Kelley +Kelli +Kellia +Kellie +Kellina +Kellsie +Kelly +Kellyann +Kelsey +Kelsi +Kelsy +Kendra +Kendre +Kenna +Keren +Keri +Keriann +Kerianne +Kerri +Kerrie +Kerrill +Kerrin +Kerry +Kerstin +Kesley +Keslie +Kessia +Kessiah +Ketti +Kettie +Ketty +Kevina +Kevyn +Ki +Kia +Kiah +Kial +Kiele +Kiersten +Kikelia +Kiley +Kim +Kimberlee +Kimberley +Kimberli +Kimberly +Kimberlyn +Kimbra +Kimmi +Kimmie +Kimmy +Kinna +Kip +Kipp +Kippie +Kippy +Kira +Kirbee +Kirbie +Kirby +Kiri +Kirsten +Kirsteni +Kirsti +Kirstie +Kirstin +Kirstyn +Kissee +Kissiah +Kissie +Kit +Kitti +Kittie +Kitty +Kizzee +Kizzie +Klara +Klarika +Klarrisa +Konstance +Konstanze +Koo +Kora +Koral +Koralle +Kordula +Kore +Korella +Koren +Koressa +Kori +Korie +Korney +Korrie +Korry +Kourtney +Kris +Krissie +Krissy +Krista +Kristal +Kristan +Kriste +Kristel +Kristen +Kristi +Kristien +Kristin +Kristina +Kristine +Kristy +Kristyn +Krysta +Krystal +Krystalle +Krystle +Krystyna +Kyla +Kyle +Kylen +Kylie +Kylila +Kylynn +Kym +Kynthia +Kyrstin +La +Lacee +Lacey +Lacie +Lacy +Ladonna +Laetitia +Laila +Laina +Lainey +Lamb +Lana +Lane +Lanette +Laney +Lani +Lanie +Lanita +Lanna +Lanni +Lanny +Lara +Laraine +Lari +Larina +Larine +Larisa +Larissa +Lark +Laryssa +Latashia +Latia +Latisha +Latrena +Latrina +Laura +Lauraine +Laural +Lauralee +Laure +Lauree +Laureen +Laurel +Laurella +Lauren +Laurena +Laurene +Lauretta +Laurette +Lauri +Laurianne +Laurice +Laurie +Lauryn +Lavena +Laverna +Laverne +Lavina +Lavinia +Lavinie +Layla +Layne +Layney +Lea +Leah +Leandra +Leann +Leanna +Leanne +Leanor +Leanora +Lebbie +Leda +Lee +LeeAnn +Leeann +Leeanne +Leela +Leelah +Leena +Leesa +Leese +Legra +Leia +Leiah +Leigh +Leigha +Leila +Leilah +Leisha +Lela +Lelah +Leland +Lelia +Lena +Lenee +Lenette +Lenka +Lenna +Lenora +Lenore +Leodora +Leoine +Leola +Leoline +Leona +Leonanie +Leone +Leonelle +Leonie +Leonora +Leonore +Leontine +Leontyne +Leora +Leorah +Leshia +Lesley +Lesli +Leslie +Lesly +Lesya +Leta +Lethia +Leticia +Letisha +Letitia +Letta +Letti +Lettie +Letty +Leyla +Lezlie +Lia +Lian +Liana +Liane +Lianna +Lianne +Lib +Libbey +Libbi +Libbie +Libby +Licha +Lida +Lidia +Lil +Lila +Lilah +Lilas +Lilia +Lilian +Liliane +Lilias +Lilith +Lilla +Lilli +Lillian +Lillis +Lilllie +Lilly +Lily +Lilyan +Lin +Lina +Lind +Linda +Lindi +Lindie +Lindsay +Lindsey +Lindsy +Lindy +Linea +Linell +Linet +Linette +Linn +Linnea +Linnell +Linnet +Linnie +Linzy +Liora +Liorah +Lira +Lisa +Lisabeth +Lisandra +Lisbeth +Lise +Lisetta +Lisette +Lisha +Lishe +Lissa +Lissi +Lissie +Lissy +Lita +Liuka +Livia +Liz +Liza +Lizabeth +Lizbeth +Lizette +Lizzie +Lizzy +Loella +Lois +Loise +Lola +Lolande +Loleta +Lolita +Lolly +Lona +Lonee +Loni +Lonna +Lonni +Lonnie +Lora +Lorain +Loraine +Loralee +Loralie +Loralyn +Loree +Loreen +Lorelei +Lorelle +Loren +Lorena +Lorene +Lorenza +Loretta +Lorettalorna +Lorette +Lori +Loria +Lorianna +Lorianne +Lorie +Lorilee +Lorilyn +Lorinda +Lorine +Lorita +Lorna +Lorne +Lorraine +Lorrayne +Lorri +Lorrie +Lorrin +Lorry +Lory +Lotta +Lotte +Lotti +Lottie +Lotty +Lou +Louella +Louisa +Louise +Louisette +Love +Luana +Luanna +Luce +Luci +Lucia +Luciana +Lucie +Lucienne +Lucila +Lucilia +Lucille +Lucina +Lucinda +Lucine +Lucita +Lucky +Lucretia +Lucy +Luella +Luelle +Luisa +Luise +Lula +Lulita +Lulu +Luna +Lura +Lurette +Lurleen +Lurlene +Lurline +Lusa +Lust +Lyda +Lydia +Lydie +Lyn +Lynda +Lynde +Lyndel +Lyndell +Lyndsay +Lyndsey +Lyndsie +Lyndy +Lynea +Lynelle +Lynett +Lynette +Lynn +Lynna +Lynne +Lynnea +Lynnell +Lynnelle +Lynnet +Lynnett +Lynnette +Lynsey +Lysandra +Lyssa +Mab +Mabel +Mabelle +Mable +Mada +Madalena +Madalyn +Maddalena +Maddi +Maddie +Maddy +Madel +Madelaine +Madeleine +Madelena +Madelene +Madelin +Madelina +Madeline +Madella +Madelle +Madelon +Madelyn +Madge +Madlen +Madlin +Madona +Madonna +Mady +Mae +Maegan +Mag +Magda +Magdaia +Magdalen +Magdalena +Magdalene +Maggee +Maggi +Maggie +Maggy +Magna +Mahala +Mahalia +Maia +Maible +Maiga +Mair +Maire +Mairead +Maisey +Maisie +Mala +Malanie +Malcah +Malena +Malia +Malina +Malinda +Malinde +Malissa +Malissia +Malka +Malkah +Mallissa +Mallorie +Mallory +Malorie +Malory +Malva +Malvina +Malynda +Mame +Mamie +Manda +Mandi +Mandie +Mandy +Manon +Manya +Mara +Marabel +Marcela +Marcelia +Marcella +Marcelle +Marcellina +Marcelline +Marchelle +Marci +Marcia +Marcie +Marcile +Marcille +Marcy +Mareah +Maren +Marena +Maressa +Marga +Margalit +Margalo +Margaret +Margareta +Margarete +Margaretha +Margarethe +Margaretta +Margarette +Margarita +Margaux +Marge +Margeaux +Margery +Marget +Margette +Margi +Margie +Margit +Marglerite +Margo +Margot +Margret +Marguerite +Margurite +Margy +Mari +Maria +Mariam +Marian +Mariana +Mariann +Marianna +Marianne +Maribel +Maribelle +Maribeth +Marice +Maridel +Marie +Marie-Ann +Marie-Jeanne +Marieann +Mariejeanne +Mariel +Mariele +Marielle +Mariellen +Marietta +Mariette +Marigold +Marijo +Marika +Marilee +Marilin +Marillin +Marilyn +Marin +Marina +Marinna +Marion +Mariquilla +Maris +Marisa +Mariska +Marissa +Marit +Marita +Maritsa +Mariya +Marj +Marja +Marje +Marji +Marjie +Marjorie +Marjory +Marjy +Marketa +Marla +Marlane +Marleah +Marlee +Marleen +Marlena +Marlene +Marley +Marlie +Marline +Marlo +Marlyn +Marna +Marne +Marney +Marni +Marnia +Marnie +Marquita +Marrilee +Marris +Marrissa +Marry +Marsha +Marsiella +Marta +Martelle +Martguerita +Martha +Marthe +Marthena +Marti +Martica +Martie +Martina +Martita +Marty +Martynne +Mary +Marya +Maryangelyn +Maryann +Maryanna +Maryanne +Marybelle +Marybeth +Maryellen +Maryjane +Maryjo +Maryl +Marylee +Marylin +Marylinda +Marylou +Marylynne +Maryrose +Marys +Marysa +Masha +Matelda +Mathilda +Mathilde +Matilda +Matilde +Matti +Mattie +Matty +Maud +Maude +Maudie +Maura +Maure +Maureen +Maureene +Maurene +Maurine +Maurise +Maurita +Mavis +Mavra +Max +Maxi +Maxie +Maxine +Maxy +Maya +Maybelle +Mayda +Maye +Mead +Meade +Meagan +Meaghan +Meara +Mechelle +Meg +Megan +Megen +Meggan +Meggi +Meggie +Meggy +Meghan +Meghann +Mehetabel +Mei +Meira +Mel +Mela +Melamie +Melania +Melanie +Melantha +Melany +Melba +Melesa +Melessa +Melicent +Melina +Melinda +Melinde +Melisa +Melisande +Melisandra +Melisenda +Melisent +Melissa +Melisse +Melita +Melitta +Mella +Melli +Mellicent +Mellie +Mellisa +Mellisent +Mellissa +Melloney +Melly +Melodee +Melodie +Melody +Melonie +Melony +Melosa +Melva +Mercedes +Merci +Mercie +Mercy +Meredith +Meredithe +Meridel +Meridith +Meriel +Merilee +Merilyn +Meris +Merissa +Merl +Merla +Merle +Merlina +Merline +Merna +Merola +Merralee +Merridie +Merrie +Merrielle +Merrile +Merrilee +Merrili +Merrill +Merrily +Merry +Mersey +Meryl +Meta +Mia +Micaela +Michaela +Michaelina +Michaeline +Michaella +Michal +Michel +Michele +Michelina +Micheline +Michell +Michelle +Micki +Mickie +Micky +Midge +Mignon +Mignonne +Miguela +Miguelita +Mildred +Mildrid +Milena +Milicent +Milissent +Milka +Milli +Millicent +Millie +Millisent +Milly +Milzie +Mimi +Min +Mina +Minda +Mindy +Minerva +Minetta +Minette +Minna +Minni +Minnie +Minny +Minta +Miquela +Mira +Mirabel +Mirabella +Mirabelle +Miran +Miranda +Mireielle +Mireille +Mirella +Mirelle +Miriam +Mirilla +Mirna +Misha +Missie +Missy +Misti +Misty +Mitra +Mitzi +Mmarianne +Modesta +Modestia +Modestine +Modesty +Moina +Moira +Moll +Mollee +Molli +Mollie +Molly +Mommy +Mona +Monah +Monica +Monika +Monique +Mora +Moreen +Morena +Morgan +Morgana +Morganica +Morganne +Morgen +Moria +Morissa +Morlee +Morna +Moselle +Moya +Moyna +Moyra +Mozelle +Muffin +Mufi +Mufinella +Muire +Mureil +Murial +Muriel +Murielle +Myna +Myra +Myrah +Myranda +Myriam +Myrilla +Myrle +Myrlene +Myrna +Myrta +Myrtia +Myrtice +Myrtie +Myrtle +Nada +Nadean +Nadeen +Nadia +Nadine +Nadiya +Nady +Nadya +Nalani +Nan +Nana +Nananne +Nance +Nancee +Nancey +Nanci +Nancie +Nancy +Nanete +Nanette +Nani +Nanice +Nanine +Nannette +Nanni +Nannie +Nanny +Nanon +Naoma +Naomi +Nara +Nari +Nariko +Nat +Nata +Natala +Natalee +Natalia +Natalie +Natalina +Nataline +Natalya +Natasha +Natassia +Nathalia +Nathalie +Natka +Natty +Neala +Neda +Nedda +Nedi +Neely +Neila +Neile +Neilla +Neille +Nela +Nelia +Nelie +Nell +Nelle +Nelli +Nellie +Nelly +Nena +Nerissa +Nerita +Nert +Nerta +Nerte +Nerti +Nertie +Nerty +Nessa +Nessi +Nessie +Nessy +Nesta +Netta +Netti +Nettie +Nettle +Netty +Nevsa +Neysa +Nichol +Nichole +Nicholle +Nicki +Nickie +Nicky +Nicol +Nicola +Nicole +Nicolea +Nicolette +Nicoli +Nicolina +Nicoline +Nicolle +Nidia +Nike +Niki +Nikki +Nikkie +Nikoletta +Nikolia +Nil +Nina +Ninetta +Ninette +Ninnetta +Ninnette +Ninon +Nisa +Nissa +Nisse +Nissie +Nissy +Nita +Nitin +Nixie +Noami +Noel +Noelani +Noell +Noella +Noelle +Noellyn +Noelyn +Noemi +Nola +Nolana +Nolie +Nollie +Nomi +Nona +Nonah +Noni +Nonie +Nonna +Nonnah +Nora +Norah +Norean +Noreen +Norene +Norina +Norine +Norma +Norri +Norrie +Norry +Nova +Novelia +Nydia +Nyssa +Octavia +Odele +Odelia +Odelinda +Odella +Odelle +Odessa +Odetta +Odette +Odilia +Odille +Ofelia +Ofella +Ofilia +Ola +Olenka +Olga +Olia +Olimpia +Olive +Olivette +Olivia +Olivie +Oliy +Ollie +Olly +Olva +Olwen +Olympe +Olympia +Olympie +Ondrea +Oneida +Onida +Onlea +Oona +Opal +Opalina +Opaline +Ophelia +Ophelie +Oprah +Ora +Oralee +Oralia +Oralie +Oralla +Oralle +Orel +Orelee +Orelia +Orelie +Orella +Orelle +Oreste +Oriana +Orly +Orsa +Orsola +Ortensia +Otha +Othelia +Othella +Othilia +Othilie +Ottilie +Pacifica +Page +Paige +Paloma +Pam +Pamela +Pamelina +Pamella +Pammi +Pammie +Pammy +Pandora +Pansie +Pansy +Paola +Paolina +Parwane +Pat +Patience +Patrica +Patrice +Patricia +Patrizia +Patsy +Patti +Pattie +Patty +Paula +Paula-Grace +Paule +Pauletta +Paulette +Pauli +Paulie +Paulina +Pauline +Paulita +Pauly +Pavia +Pavla +Pearl +Pearla +Pearle +Pearline +Peg +Pegeen +Peggi +Peggie +Peggy +Pen +Penelopa +Penelope +Penni +Pennie +Penny +Pepi +Pepita +Peri +Peria +Perl +Perla +Perle +Perri +Perrine +Perry +Persis +Pet +Peta +Petra +Petrina +Petronella +Petronia +Petronilla +Petronille +Petunia +Phaedra +Phaidra +Phebe +Phedra +Phelia +Phil +Philipa +Philippa +Philippe +Philippine +Philis +Phillida +Phillie +Phillis +Philly +Philomena +Phoebe +Phylis +Phyllida +Phyllis +Phyllys +Phylys +Pia +Pier +Pierette +Pierrette +Pietra +Piper +Pippa +Pippy +Polly +Pollyanna +Pooh +Poppy +Portia +Pris +Prisca +Priscella +Priscilla +Prissie +Pru +Prudence +Prudi +Prudy +Prue +Prunella +Queada +Queenie +Quentin +Querida +Quinn +Quinta +Quintana +Quintilla +Quintina +Rachael +Rachel +Rachele +Rachelle +Rae +Raf +Rafa +Rafaela +Rafaelia +Rafaelita +Ragnhild +Rahal +Rahel +Raina +Raine +Rakel +Ralina +Ramona +Ramonda +Rana +Randa +Randee +Randene +Randi +Randie +Randy +Ranee +Rani +Rania +Ranice +Ranique +Ranna +Raphaela +Raquel +Raquela +Rasia +Rasla +Raven +Ray +Raychel +Raye +Rayna +Raynell +Rayshell +Rea +Reba +Rebbecca +Rebe +Rebeca +Rebecca +Rebecka +Rebeka +Rebekah +Rebekkah +Ree +Reeba +Reena +Reeta +Reeva +Regan +Reggi +Reggie +Regina +Regine +Reiko +Reina +Reine +Remy +Rena +Renae +Renata +Renate +Rene +Renee +Renel +Renell +Renelle +Renie +Rennie +Reta +Retha +Revkah +Rey +Reyna +Rhea +Rheba +Rheta +Rhetta +Rhiamon +Rhianna +Rhianon +Rhoda +Rhodia +Rhodie +Rhody +Rhona +Rhonda +Riane +Riannon +Rianon +Rica +Ricca +Rici +Ricki +Rickie +Ricky +Riki +Rikki +Rina +Risa +Rissa +Rita +Riva +Rivalee +Rivi +Rivkah +Rivy +Roana +Roanna +Roanne +Robbi +Robbie +Robbin +Robby +Robbyn +Robena +Robenia +Roberta +Robin +Robina +Robinet +Robinett +Robinetta +Robinette +Robinia +Roby +Robyn +Roch +Rochell +Rochella +Rochelle +Rochette +Roda +Rodi +Rodie +Rodina +Romola +Romona +Romonda +Romy +Rona +Ronalda +Ronda +Ronica +Ronna +Ronni +Ronnica +Ronnie +Ronny +Roobbie +Rora +Rori +Rorie +Rory +Ros +Rosa +Rosabel +Rosabella +Rosabelle +Rosaleen +Rosalia +Rosalie +Rosalind +Rosalinda +Rosalinde +Rosaline +Rosalyn +Rosalynd +Rosamond +Rosamund +Rosana +Rosanna +Rosanne +Rosario +Rose +Roseann +Roseanna +Roseanne +Roselia +Roselin +Roseline +Rosella +Roselle +Roselyn +Rosemaria +Rosemarie +Rosemary +Rosemonde +Rosene +Rosetta +Rosette +Roshelle +Rosie +Rosina +Rosita +Roslyn +Rosmunda +Rosy +Row +Rowe +Rowena +Roxana +Roxane +Roxanna +Roxanne +Roxi +Roxie +Roxine +Roxy +Roz +Rozalie +Rozalin +Rozamond +Rozanna +Rozanne +Roze +Rozele +Rozella +Rozelle +Rozina +Rubetta +Rubi +Rubia +Rubie +Rubina +Ruby +Ruella +Ruperta +Ruth +Ruthann +Ruthanne +Ruthe +Ruthi +Ruthie +Ruthy +Ryann +Rycca +Saba +Sabina +Sabine +Sabra +Sabrina +Sacha +Sada +Sadella +Sadie +Sal +Sallee +Salli +Sallie +Sally +Sallyann +Sallyanne +Salome +Sam +Samantha +Samara +Samaria +Sammy +Samuela +Samuella +Sande +Sandi +Sandie +Sandra +Sandy +Sandye +Sapphira +Sapphire +Sara +Sara-Ann +Saraann +Sarah +Sarajane +Saree +Sarena +Sarene +Sarette +Sari +Sarina +Sarine +Sarita +Sascha +Sasha +Sashenka +Saudra +Saundra +Savina +Sayre +Scarlet +Scarlett +Scotty +Sean +Seana +Secunda +Seka +Sela +Selena +Selene +Selestina +Selia +Selie +Selina +Selinda +Seline +Sella +Selle +Selma +Sena +Sephira +Serena +Serene +Shaina +Shaine +Shalna +Shalne +Shamit +Shana +Shanda +Shandee +Shandie +Shandra +Shandy +Shane +Shani +Shanie +Shanna +Shannah +Shannen +Shannon +Shanon +Shanta +Shantee +Shara +Sharai +Shari +Sharia +Sharie +Sharity +Sharl +Sharla +Sharleen +Sharlene +Sharline +Sharna +Sharon +Sharona +Sharra +Sharron +Sharyl +Shaun +Shauna +Shawn +Shawna +Shawnee +Shay +Shayla +Shaylah +Shaylyn +Shaylynn +Shayna +Shayne +Shea +Sheba +Sheela +Sheelagh +Sheelah +Sheena +Sheeree +Sheila +Sheila-Kathryn +Sheilah +Sheilakathryn +Shel +Shela +Shelagh +Shelba +Shelbi +Shelby +Shelia +Shell +Shelley +Shelli +Shellie +Shelly +Shena +Sher +Sheree +Sheri +Sherie +Sheril +Sherill +Sherilyn +Sherline +Sherri +Sherrie +Sherry +Sherye +Sheryl +Shilpa +Shina +Shir +Shira +Shirah +Shirl +Shirlee +Shirleen +Shirlene +Shirley +Shirline +Shoshana +Shoshanna +Shoshie +Siana +Sianna +Sib +Sibbie +Sibby +Sibeal +Sibel +Sibella +Sibelle +Sibilla +Sibley +Sibyl +Sibylla +Sibylle +Sidoney +Sidonia +Sidonnie +Sigrid +Sile +Sileas +Silva +Silvana +Silvia +Silvie +Simona +Simone +Simonette +Simonne +Sindee +Sinead +Siobhan +Sioux +Siouxie +Sisely +Sisile +Sissie +Sissy +Sofia +Sofie +Solange +Sondra +Sonia +Sonja +Sonni +Sonnie +Sonnnie +Sonny +Sonya +Sophey +Sophi +Sophia +Sophie +Sophronia +Sorcha +Sosanna +Stace +Stacee +Stacey +Staci +Stacia +Stacie +Stacy +Stafani +Star +Starla +Starlene +Starlin +Starr +Stefa +Stefania +Stefanie +Steffane +Steffi +Steffie +Stella +Stepha +Stephana +Stephani +Stephanie +Stephannie +Stephenie +Stephi +Stephie +Stephine +Stesha +Stevana +Stevena +Stoddard +Storey +Storm +Stormi +Stormie +Stormy +Sue +Sue-elle +Suellen +Sukey +Suki +Sula +Sunny +Sunshine +Susan +Susana +Susanetta +Susann +Susanna +Susannah +Susanne +Susette +Susi +Susie +Sussi +Susy +Suzan +Suzann +Suzanna +Suzanne +Suzetta +Suzette +Suzi +Suzie +Suzy +Suzzy +Sybil +Sybila +Sybilla +Sybille +Sybyl +Sydel +Sydelle +Sydney +Sylvia +Sylvie +Tabatha +Tabbatha +Tabbi +Tabbie +Tabbitha +Tabby +Tabina +Tabitha +Taffy +Talia +Tallia +Tallie +Tally +Talya +Talyah +Tamar +Tamara +Tamarah +Tamarra +Tamera +Tami +Tamiko +Tamma +Tammara +Tammi +Tammie +Tammy +Tamra +Tana +Tandi +Tandie +Tandy +Tani +Tania +Tansy +Tanya +Tara +Tarah +Tarra +Tarrah +Taryn +Tasha +Tasia +Tate +Tatiana +Tatiania +Tatum +Tawnya +Tawsha +Teane +Ted +Tedda +Teddi +Teddie +Teddy +Tedi +Tedra +Teena +Tella +Teodora +Tera +Teresa +TeresaAnne +Terese +Teresina +Teresita +Teressa +Teri +Teriann +Terina +Terra +Terri +Terri-Jo +Terrianne +Terrie +Terry +Terrye +Tersina +Teryl +Terza +Tess +Tessa +Tessi +Tessie +Tessy +Thalia +Thea +Theada +Theadora +Theda +Thekla +Thelma +Theo +Theodora +Theodosia +Theresa +Theresa-Marie +Therese +Theresina +Theresita +Theressa +Therine +Thia +Thomasa +Thomasin +Thomasina +Thomasine +Tia +Tiana +Tiena +Tierney +Tiertza +Tiff +Tiffani +Tiffanie +Tiffany +Tiffi +Tiffie +Tiffy +Tilda +Tildi +Tildie +Tildy +Tillie +Tilly +Tim +Timi +Timmi +Timmie +Timmy +Timothea +Tina +Tine +Tiphani +Tiphanie +Tiphany +Tish +Tisha +Tobe +Tobey +Tobi +Tobie +Toby +Tobye +Toinette +Toma +Tomasina +Tomasine +Tomi +Tomiko +Tommi +Tommie +Tommy +Toni +Tonia +Tonie +Tony +Tonya +Tootsie +Torey +Tori +Torie +Torrie +Tory +Tova +Tove +Trace +Tracee +Tracey +Traci +Tracie +Tracy +Trenna +Tresa +Trescha +Tressa +Tricia +Trina +Trish +Trisha +Trista +Trix +Trixi +Trixie +Trixy +Truda +Trude +Trudey +Trudi +Trudie +Trudy +Trula +Tuesday +Twila +Twyla +Tybi +Tybie +Tyne +Ula +Ulla +Ulrica +Ulrika +Ulrike +Umeko +Una +Ursa +Ursala +Ursola +Ursula +Ursulina +Ursuline +Uta +Val +Valaree +Valaria +Vale +Valeda +Valencia +Valene +Valenka +Valentia +Valentina +Valentine +Valera +Valeria +Valerie +Valery +Valerye +Valida +Valina +Valli +Vallie +Vally +Valma +Valry +Van +Vanda +Vanessa +Vania +Vanna +Vanni +Vannie +Vanny +Vanya +Veda +Velma +Velvet +Vena +Venita +Ventura +Venus +Vera +Veradis +Vere +Verena +Verene +Veriee +Verile +Verina +Verine +Verla +Verna +Vernice +Veronica +Veronika +Veronike +Veronique +Vi +Vicki +Vickie +Vicky +Victoria +Vida +Viki +Vikki +Vikkie +Vikky +Vilhelmina +Vilma +Vin +Vina +Vinita +Vinni +Vinnie +Vinny +Viola +Violante +Viole +Violet +Violetta +Violette +Virgie +Virgina +Virginia +Virginie +Vita +Vitia +Vitoria +Vittoria +Viv +Viva +Vivi +Vivia +Vivian +Viviana +Vivianna +Vivianne +Vivie +Vivien +Viviene +Vivienne +Viviyan +Vivyan +Vivyanne +Vonni +Vonnie +Vonny +Wallie +Wallis +Wally +Waly +Wanda +Wandie +Wandis +Waneta +Wenda +Wendeline +Wendi +Wendie +Wendy +Wenona +Wenonah +Whitney +Wileen +Wilhelmina +Wilhelmine +Wilie +Willa +Willabella +Willamina +Willetta +Willette +Willi +Willie +Willow +Willy +Willyt +Wilma +Wilmette +Wilona +Wilone +Wilow +Windy +Wini +Winifred +Winna +Winnah +Winne +Winni +Winnie +Winnifred +Winny +Winona +Winonah +Wren +Wrennie +Wylma +Wynn +Wynne +Wynnie +Wynny +Xaviera +Xena +Xenia +Xylia +Xylina +Yalonda +Yehudit +Yelena +Yetta +Yettie +Yetty +Yevette +Yoko +Yolanda +Yolande +Yolane +Yolanthe +Yonina +Yoshi +Yoshiko +Yovonnda +Yvette +Yvonne +Zabrina +Zahara +Zandra +Zaneta +Zara +Zarah +Zaria +Zarla +Zea +Zelda +Zelma +Zena +Zenia +Zia +Zilvia +Zita +Zitella +Zoe +Zola +Zonda +Zondra +Zonnya +Zora +Zorah +Zorana +Zorina +Zorine +Zsa Zsa +Zsazsa +Zulema +Zuzana +Mikako +Kaari +Gita +Geeta diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/data/roman/key_word.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/roman/key_word.tsv new file mode 100644 index 0000000000000000000000000000000000000000..861285b439e6d4d08fef5295421123df2972a26b --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/roman/key_word.tsv @@ -0,0 +1,6 @@ +chapter +class +part +article +section +paragraph diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/data/roman/male.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/roman/male.tsv new file mode 100644 index 0000000000000000000000000000000000000000..08236aad9b693fa3e28401cec2cc549d7596d7fb --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/roman/male.tsv @@ -0,0 +1,2946 @@ +Aamir +Aaron +Abbey +Abbie +Abbot +Abbott +Abby +Abdel +Abdul +Abdulkarim +Abdullah +Abe +Abel +Abelard +Abner +Abraham +Abram +Ace +Adair +Adam +Adams +Addie +Adger +Aditya +Adlai +Adnan +Adolf +Adolfo +Adolph +Adolphe +Adolpho +Adolphus +Adrian +Adrick +Adrien +Agamemnon +Aguinaldo +Aguste +Agustin +Aharon +Ahmad +Ahmed +Ahmet +Ajai +Ajay +Al +Alaa +Alain +Alan +Alasdair +Alastair +Albatros +Albert +Alberto +Albrecht +Alden +Aldis +Aldo +Aldric +Aldrich +Aldus +Aldwin +Alec +Aleck +Alejandro +Aleks +Aleksandrs +Alessandro +Alex +Alexander +Alexei +Alexis +Alf +Alfie +Alfonse +Alfonso +Alfonzo +Alford +Alfred +Alfredo +Algernon +Ali +Alic +Alister +Alix +Allah +Allan +Allen +Alley +Allie +Allin +Allyn +Alonso +Alonzo +Aloysius +Alphonse +Alphonso +Alston +Alton +Alvin +Alwin +Amadeus +Ambros +Ambrose +Ambrosi +Ambrosio +Ambrosius +Amenhotep +Amery +Amory +Amos +Anatol +Anatole +Anatollo +Anatoly +Anders +Andie +Andonis +Andre +Andrea +Andreas +Andrej +Andres +Andrew +Andrey +Andri +Andros +Andrus +Andrzej +Andy +Angel +Angelico +Angelo +Angie +Angus +Ansel +Ansell +Anselm +Anson +Anthony +Antin +Antoine +Anton +Antone +Antoni +Antonin +Antonino +Antonio +Antonius +Antony +Anurag +Apollo +Apostolos +Aram +Archibald +Archibold +Archie +Archon +Archy +Arel +Ari +Arie +Ariel +Aristotle +Arlo +Armand +Armando +Armond +Armstrong +Arne +Arnie +Arnold +Arnoldo +Aron +Arron +Art +Arther +Arthur +Artie +Artur +Arturo +Arvie +Arvin +Arvind +Arvy +Ash +Ashby +Ashish +Ashley +Ashton +Aub +Aube +Aubert +Aubrey +Augie +Augustin +Augustine +Augusto +Augustus +Austen +Austin +Ave +Averell +Averil +Averill +Avery +Avi +Avraham +Avram +Avrom +Axel +Aylmer +Aziz +Bailey +Bailie +Baillie +Baily +Baird +Baldwin +Bancroft +Barbabas +Barclay +Bard +Barde +Barn +Barnabas +Barnabe +Barnaby +Barnard +Barnebas +Barnett +Barney +Barnie +Barny +Baron +Barr +Barret +Barrett +Barri +Barrie +Barris +Barron +Barry +Bart +Bartel +Barth +Barthel +Bartholemy +Bartholomeo +Bartholomeus +Bartholomew +Bartie +Bartlet +Bartlett +Bartolemo +Bartolomei +Bartolomeo +Barton +Barty +Bary +Basil +Batholomew +Baxter +Bay +Bayard +Beale +Bealle +Bear +Bearnard +Beau +Beaufort +Beauregard +Beck +Bela +Ben +Benedict +Bengt +Benito +Benjamen +Benjamin +Benji +Benjie +Benjy +Benn +Bennet +Bennett +Bennie +Benny +Benson +Bentley +Benton +Beowulf +Berchtold +Berk +Berke +Berkeley +Berkie +Berkley +Bernard +Bernardo +Bernd +Bernhard +Bernie +Bert +Bertie +Bertram +Bertrand +Bharat +Biff +Bill +Billie +Billy +Bing +Binky +Bishop +Bjorn +Bjorne +Blaine +Blair +Blake +Blare +Blayne +Bo +Bob +Bobbie +Bobby +Bogart +Bogdan +Boniface +Boris +Boyce +Boyd +Brad +Braden +Bradford +Bradley +Bradly +Brady +Brandon +Brandy +Brant +Brendan +Brent +Bret +Brett +Brewer +Brewster +Brian +Brice +Briggs +Brinkley +Britt +Brock +Broddie +Broddy +Broderic +Broderick +Brodie +Brody +Bronson +Brook +Brooke +Brooks +Bruce +Bruno +Bryan +Bryant +Bryce +Bryn +Bryon +Bubba +Buck +Bucky +Bud +Buddy +Burgess +Burke +Burl +Burnaby +Burt +Burton +Buster +Butch +Butler +Byram +Byron +Caesar +Cain +Cal +Caldwell +Caleb +Calhoun +Calvin +Cam +Cameron +Cammy +Carey +Carl +Carleigh +Carlie +Carlin +Carlo +Carlos +Carlton +Carlyle +Carmine +Carroll +Carson +Carsten +Carter +Cary +Caryl +Case +Casey +Caspar +Casper +Cass +Cat +Cecil +Cesar +Chad +Chadd +Chaddie +Chaddy +Chadwick +Chaim +Chalmers +Chan +Chance +Chancey +Chanderjit +Chandler +Chane +Chariot +Charles +Charleton +Charley +Charlie +Charlton +Chas +Chase +Chaunce +Chauncey +Che +Chelton +Chen +Chester +Cheston +Chet +Chev +Chevalier +Chevy +Chip +Chris +Chrissy +Christ +Christian +Christiano +Christie +Christof +Christofer +Christoph +Christophe +Christopher +Christorpher +Christos +Christy +Chrisy +Chuck +Churchill +Clair +Claire +Clancy +Clarance +Clare +Clarence +Clark +Clarke +Claude +Claudio +Claudius +Claus +Clay +Clayborn +Clayborne +Claybourne +Clayton +Cleland +Clem +Clemens +Clement +Clemente +Clemmie +Cletus +Cleveland +Cliff +Clifford +Clifton +Clint +Clinten +Clinton +Clive +Clyde +Cob +Cobb +Cobbie +Cobby +Cody +Colbert +Cole +Coleman +Colin +Collin +Collins +Conan +Connie +Connolly +Connor +Conrad +Conroy +Constantin +Constantine +Constantinos +Conway +Cooper +Corbin +Corby +Corey +Corky +Cornelius +Cornellis +Corrie +Cortese +Corwin +Cory +Cosmo +Costa +Courtney +Craig +Crawford +Creighton +Cris +Cristopher +Curt +Curtice +Curtis +Cy +Cyril +Cyrill +Cyrille +Cyrillus +Cyrus +Dabney +Daffy +Dale +Dallas +Dalton +Damian +Damien +Damon +Dan +Dana +Dane +Dani +Danie +Daniel +Dannie +Danny +Dante +Darby +Darcy +Daren +Darian +Darien +Darin +Dario +Darius +Darrel +Darrell +Darren +Darrick +Darrin +Darryl +Darth +Darwin +Daryl +Daryle +Dave +Davey +David +Davidde +Davide +Davidson +Davie +Davin +Davis +Davon +Davoud +Davy +Dawson +Dean +Deane +Del +Delbert +Dell +Delmar +Demetre +Demetri +Demetris +Demetrius +Demosthenis +Denis +Dennie +Dennis +Denny +Derby +Derek +Derick +Derk +Derrek +Derrick +Derrin +Derrol +Derron +Deryl +Desmond +Desmund +Devin +Devon +Dewey +Dewitt +Dexter +Dick +Dickey +Dickie +Diego +Dieter +Dietrich +Dillon +Dimitri +Dimitrios +Dimitris +Dimitrou +Dimitry +Dino +Dion +Dionis +Dionysus +Dirk +Dmitri +Dom +Domenic +Domenico +Dominic +Dominick +Dominique +Don +Donal +Donald +Donn +Donnie +Donny +Donovan +Dorian +Dory +Doug +Douggie +Dougie +Douglas +Douglass +Douglis +Dov +Doyle +Drake +Drew +Dru +Dryke +Duane +Dudley +Duffie +Duffy +Dugan +Duke +Dunc +Duncan +Dunstan +Durand +Durant +Durante +Durward +Dustin +Dwain +Dwaine +Dwane +Dwayne +Dwight +Dylan +Dyson +Earl +Earle +Easton +Eben +Ebeneser +Ebenezer +Eberhard +Ed +Eddie +Eddy +Edgar +Edgardo +Edie +Edmond +Edmund +Edouard +Edsel +Eduard +Eduardo +Edward +Edwin +Efram +Egbert +Ehud +Elbert +Elden +Eldon +Eli +Elias +Elihu +Elijah +Eliot +Eliott +Elisha +Elliot +Elliott +Ellis +Ellsworth +Ellwood +Elmer +Elmore +Elnar +Elric +Elroy +Elton +Elvin +Elvis +Elwin +Elwood +Elwyn +Ely +Emanuel +Emerson +Emery +Emil +Emile +Emilio +Emmanuel +Emmery +Emmet +Emmett +Emmit +Emmott +Emmy +Emory +Ender +Engelbart +Engelbert +Englebart +Englebert +Enoch +Enrico +Enrique +Ephraim +Ephram +Ephrayim +Ephrem +Er +Erasmus +Erastus +Erek +Erhard +Erhart +Eric +Erich +Erick +Erik +Erin +Erl +Ernest +Ernesto +Ernie +Ernst +Erny +Errol +Ervin +Erwin +Esau +Esme +Esteban +Ethan +Ethelbert +Ethelred +Etienne +Euclid +Eugen +Eugene +Eustace +Ev +Evan +Evelyn +Everard +Everett +Ewan +Ewart +Ez +Ezechiel +Ezekiel +Ezra +Fabian +Fabio +Fairfax +Farley +Fazeel +Federico +Felice +Felicio +Felipe +Felix +Ferd +Ferdie +Ferdinand +Ferdy +Fergus +Ferguson +Ferinand +Fernando +Fidel +Filbert +Filip +Filipe +Filmore +Finley +Finn +Fitz +Fitzgerald +Flem +Fleming +Flemming +Fletch +Fletcher +Flin +Flinn +Flint +Flipper +Florian +Floyd +Flynn +Fons +Fonsie +Fonz +Fonzie +Forbes +Ford +Forest +Forester +Forrest +Forrester +Forster +Foster +Fowler +Fox +Fran +Francesco +Francis +Francisco +Francois +Frank +Frankie +Franklin +Franklyn +Franky +Frans +Franz +Fraser +Frazier +Fred +Freddie +Freddy +Frederic +Frederich +Frederick +Frederico +Frederik +Fredric +Fredrick +Freeman +Freemon +Fremont +French +Friedric +Friedrich +Friedrick +Fritz +Fulton +Fyodor +Gabe +Gabriel +Gabriele +Gabriell +Gabriello +Gail +Gale +Galen +Gallagher +Gamaliel +Garcia +Garcon +Gardener +Gardiner +Gardner +Garey +Garfield +Garfinkel +Garold +Garp +Garret +Garrett +Garrot +Garrott +Garry +Garth +Garv +Garvey +Garvin +Garvy +Garwin +Garwood +Gary +Gaspar +Gasper +Gaston +Gav +Gaven +Gavin +Gavriel +Gay +Gayle +Gearard +Gene +Geo +Geof +Geoff +Geoffrey +Geoffry +Georg +George +Georges +Georgia +Georgie +Georgy +Gerald +Geraldo +Gerard +Gere +Gerhard +Gerhardt +Geri +Germaine +Gerold +Gerome +Gerrard +Gerri +Gerrit +Gerry +Gershom +Gershon +Giacomo +Gian +Giancarlo +Giavani +Gibb +Gideon +Giff +Giffard +Giffer +Giffie +Gifford +Giffy +Gil +Gilbert +Gilberto +Gilburt +Giles +Gill +Gilles +Ginger +Gino +Giordano +Giorgi +Giorgio +Giovanne +Giovanni +Giraldo +Giraud +Giuseppe +Glen +Glenn +Glynn +Godard +Godart +Goddard +Goddart +Godfree +Godfrey +Godfry +Godwin +Gomer +Gonzales +Gonzalo +Goober +Goose +Gordan +Gordie +Gordon +Grace +Grady +Graehme +Graeme +Graham +Graig +Grant +Granville +Greg +Gregg +Greggory +Gregor +Gregorio +Gregory +Gretchen +Griff +Griffin +Griffith +Griswold +Grove +Grover +Guido +Guillaume +Guillermo +Gunner +Gunter +Gunther +Gus +Gustaf +Gustav +Gustave +Gustavo +Gustavus +Guthrey +Guthrie +Guthry +Guy +Hadleigh +Hadley +Hadrian +Hagan +Hagen +Hailey +Hakeem +Hakim +Hal +Hale +Haleigh +Haley +Hall +Hallam +Halvard +Ham +Hamel +Hamid +Hamil +Hamilton +Hamish +Hamlen +Hamlet +Hamlin +Hammad +Hamnet +Han +Hanan +Hanford +Hank +Hannibal +Hans +Hans-Peter +Hansel +Hanson +Harald +Harcourt +Hari +Harlan +Harland +Harley +Harlin +Harman +Harmon +Harold +Harris +Harrison +Harrold +Harry +Hart +Hartley +Hartwell +Harv +Harvard +Harvey +Harvie +Harwell +Hasheem +Hashim +Haskel +Haskell +Hassan +Hastings +Hasty +Haven +Hayden +Haydon +Hayes +Hayward +Haywood +Hazel +Heath +Heathcliff +Hebert +Hector +Heinrich +Heinz +Helmuth +Henderson +Hendrick +Hendrik +Henri +Henrie +Henrik +Henrique +Henry +Herb +Herbert +Herbie +Herby +Hercule +Hercules +Herculie +Herman +Hermann +Hermon +Hermy +Hernando +Herold +Herrick +Herrmann +Hersch +Herschel +Hersh +Hershel +Herve +Hervey +Hew +Hewe +Hewet +Hewett +Hewie +Hewitt +Heywood +Hezekiah +Higgins +Hilary +Hilbert +Hill +Hillard +Hillary +Hillel +Hillery +Hilliard +Hilton +Hiralal +Hiram +Hiro +Hirsch +Hobart +Hodge +Hogan +Hollis +Holly +Homer +Horace +Horacio +Horatio +Horatius +Horst +Howard +Howie +Hoyt +Hubert +Hudson +Huey +Hugh +Hugo +Humbert +Humphrey +Hunt +Hunter +Huntington +Huntlee +Huntley +Hurley +Husain +Husein +Hussein +Hy +Hyatt +Hyman +Hymie +Iago +Iain +Ian +Ibrahim +Ichabod +Iggie +Iggy +Ignace +Ignacio +Ignacius +Ignatius +Ignaz +Ignazio +Igor +Ike +Ikey +Immanuel +Ingamar +Ingelbert +Ingemar +Inglebert +Ingmar +Ingram +Inigo +Innocent +Ira +Irvin +Irvine +Irving +Irwin +Isa +Isaac +Isaak +Isador +Isadore +Isaiah +Ishmael +Isidore +Ismail +Israel +Istvan +Ivan +Ivor +Izaak +Izak +Izzy +Jabez +Jack +Jackie +Jackson +Jacob +Jacques +Jae +Jaime +Jake +Jakob +James +Jameson +Jamey +Jamie +Jan +Janos +Janus +Jared +Jarrett +Jarvis +Jason +Jasper +Javier +Jay +Jean +Jean-Christophe +Jean-Francois +Jean-Lou +Jean-Luc +Jean-Marc +Jean-Paul +Jean-Pierre +Jeb +Jed +Jedediah +Jef +Jeff +Jefferey +Jefferson +Jeffery +Jeffie +Jeffrey +Jeffry +Jefry +Jehu +Jennings +Jens +Jephthah +Jerald +Jeramie +Jere +Jereme +Jeremiah +Jeremias +Jeremie +Jeremy +Jermain +Jermaine +Jermayne +Jerold +Jerome +Jeromy +Jerri +Jerrie +Jerrold +Jerrome +Jerry +Jervis +Jerzy +Jess +Jesse +Jessee +Jessey +Jessie +Jesus +Jeth +Jethro +Jim +Jimbo +Jimmie +Jimmy +Jo +Joab +Joachim +Joao +Joaquin +Job +Jock +Jodi +Jodie +Jody +Joe +Joel +Joey +Johan +Johann +Johannes +John +John-David +John-Patrick +Johnathan +Johnathon +Johnnie +Johnny +Johny +Jon +Jonah +Jonas +Jonathan +Jonathon +Jonny +Jordan +Jordon +Jordy +Jorge +Jory +Jose +Josef +Joseph +Josephus +Josh +Joshua +Joshuah +Josiah +Jotham +Juan +Juanita +Jud +Judah +Judas +Judd +Jude +Judith +Judson +Judy +Juergen +Jule +Jules +Julian +Julie +Julio +Julius +Justin +Justis +Kaiser +Kaleb +Kalil +Kalle +Kalman +Kalvin +Kam +Kane +Kareem +Karel +Karim +Karl +Karsten +Kaspar +Keefe +Keenan +Keene +Keil +Keith +Kellen +Kelley +Kelly +Kelsey +Kelvin +Kelwin +Ken +Kendal +Kendall +Kendrick +Kenn +Kennedy +Kenneth +Kenny +Kent +Kenton +Kenyon +Kermie +Kermit +Kerry +Kevan +Kevin +Kim +Kimball +Kimmo +Kin +Kincaid +King +Kingsley +Kingsly +Kingston +Kip +Kirby +Kirk +Kit +Klaus +Klee +Knox +Konrad +Konstantin +Kory +Kostas +Kraig +Kris +Krishna +Kristian +Kristopher +Kristos +Kurt +Kurtis +Kyle +Laird +Lamar +Lambert +Lamont +Lance +Lancelot +Lane +Langston +Lanny +Larry +Lars +Laurance +Lauren +Laurence +Laurens +Laurent +Laurie +Lawerence +Lawrence +Lawson +Lawton +Lay +Layton +Lazar +Lazare +Lazaro +Lazarus +Lazlo +Lee +Lefty +Leif +Leigh +Leighton +Leland +Lem +Lemar +Lemmie +Lemmy +Lemuel +Len +Lenard +Lennie +Lenny +Leo +Leon +Leonard +Leonardo +Leonerd +Leonhard +Leonid +Leonidas +Leopold +Leroy +Les +Lesley +Leslie +Lester +Lev +Levi +Levin +Levon +Levy +Lew +Lewis +Lex +Liam +Lin +Lincoln +Lind +Lindsay +Lindsey +Lindy +Linoel +Linus +Lion +Lionel +Lionello +Llewellyn +Lloyd +Locke +Lockwood +Logan +Lon +Lonnie +Lonny +Loren +Lorenzo +Lorne +Lorrie +Lothar +Lou +Louie +Louis +Lovell +Lowell +Lucas +Luce +Lucian +Luciano +Lucien +Lucio +Lucius +Ludvig +Ludwig +Luigi +Luis +Lukas +Luke +Luther +Lyle +Lyn +Lyndon +Lynn +Mac +Mace +Mack +Mackenzie +Maddie +Maddy +Madison +Magnum +Magnus +Mahesh +Mahmoud +Mahmud +Maison +Major +Malcolm +Manfred +Manish +Manny +Manuel +Marc +Marcel +Marcello +Marcellus +Marcelo +Marchall +Marcio +Marco +Marcos +Marcus +Marietta +Marilu +Mario +Marion +Marius +Mark +Marko +Markos +Markus +Marlin +Marlo +Marlon +Marlow +Marlowe +Marmaduke +Marsh +Marshal +Marshall +Mart +Martainn +Marten +Martie +Martin +Martino +Marty +Martyn +Marv +Marve +Marven +Marvin +Marwin +Mason +Mateo +Mathew +Mathias +Matias +Matt +Matteo +Matthaeus +Mattheus +Matthew +Matthias +Matthieu +Matthiew +Matthus +Mattias +Mattie +Matty +Maurice +Mauricio +Maurie +Maurise +Maurits +Mauritz +Maury +Max +Maxfield +Maxie +Maxim +Maximilian +Maximilien +Maxwell +Mayer +Maynard +Maynord +Mayor +Mead +Meade +Meier +Meir +Mel +Melvin +Melvyn +Menard +Mendel +Mendie +Meredeth +Meredith +Merell +Merill +Merle +Merlin +Merrel +Merrick +Merril +Merrill +Merry +Merv +Mervin +Merwin +Meryl +Meyer +Mic +Micah +Michael +Michail +Michal +Michale +Micheal +Micheil +Michel +Michele +Mick +Mickey +Mickie +Micky +Miguel +Mika +Mikael +Mike +Mikel +Mikey +Mikhail +Miles +Millicent +Milo +Milt +Milton +Mischa +Mitch +Mitchael +Mitchel +Mitchell +Moe +Mohamad +Mohamed +Mohammad +Mohammed +Mohan +Moise +Moises +Moishe +Monroe +Montague +Monte +Montgomery +Monty +Moore +Mordecai +Morgan +Morlee +Morley +Morly +Morrie +Morris +Morry +Morse +Mort +Morten +Mortie +Mortimer +Morton +Morty +Mose +Moses +Moshe +Moss +Muffin +Mugsy +Muhammad +Munmro +Munroe +Murdoch +Murdock +Murphy +Murray +Mustafa +Myke +Myles +Mylo +Myron +Nahum +Napoleon +Nat +Natale +Nate +Nathan +Nathanael +Nathanial +Nathaniel +Nathanil +Neal +Neale +Neall +Nealon +Nealson +Nealy +Ned +Neddie +Neddy +Neel +Neil +Nels +Nelsen +Nelson +Nero +Neron +Nester +Nestor +Nev +Nevil +Nevile +Neville +Nevin +Nevins +Newton +Niall +Niccolo +Nicholas +Nichole +Nichols +Nick +Nickey +Nickie +Nickolas +Nicky +Nico +Nicolas +Niels +Nigel +Niki +Nikita +Nikki +Nikolai +Nikos +Niles +Nils +Nilson +Niven +Noach +Noah +Noam +Noble +Noe +Noel +Nolan +Noland +Norbert +Norm +Norman +Normand +Normie +Norris +Northrop +Northrup +Norton +Norwood +Nunzio +Obadiah +Obadias +Oberon +Obie +Octavius +Odell +Odie +Odin +Odysseus +Olaf +Olag +Ole +Oleg +Olin +Oliver +Olivier +Olle +Ollie +Omar +Oral +Oran +Orazio +Orbadiah +Oren +Orin +Orion +Orlando +Orren +Orrin +Orson +Orton +Orville +Osbert +Osborn +Osborne +Osbourn +Osbourne +Oscar +Osgood +Osmond +Osmund +Ossie +Oswald +Oswell +Otes +Othello +Otho +Otis +Otto +Owen +Ozzie +Ozzy +Pablo +Pace +Paco +Paddie +Paddy +Padraig +Page +Paige +Pail +Palmer +Paolo +Park +Parke +Parker +Parnell +Parrnell +Parry +Parsifal +Partha +Pascal +Pascale +Pasquale +Pat +Pate +Patel +Paten +Patin +Paton +Patric +Patrice +Patricio +Patrick +Patrik +Patsy +Pattie +Patty +Paul +Paulo +Pavel +Pearce +Pedro +Peirce +Pembroke +Pen +Penn +Pennie +Penny +Penrod +Pepe +Pepillo +Pepito +Perceval +Percival +Percy +Perry +Pete +Peter +Petey +Petr +Peyter +Peyton +Phil +Philbert +Philip +Phillip +Phillipe +Phillipp +Phineas +Phip +Pierce +Pierre +Pierson +Piet +Pieter +Pietro +Piggy +Pincas +Pinchas +Pincus +Piotr +Pip +Pius +Plato +Pooh +Porter +Poul +Powell +Praneetf +Prasad +Prasun +Prent +Prentice +Prentiss +Prescott +Preston +Price +Prince +Pryce +Puff +Purcell +Putnam +Pyotr +Quent +Quentin +Quiggly +Quigly +Quigman +Quill +Quillan +Quincey +Quincy +Quinlan +Quinn +Quint +Quintin +Quinton +Quintus +Rab +Rabbi +Rabi +Rad +Radcliffe +Rafael +Rafe +Ragnar +Raimund +Rainer +Raj +Rajeev +Raleigh +Ralf +Ralph +Ram +Rameses +Ramesh +Ramon +Ramsay +Ramsey +Rand +Randal +Randall +Randell +Randi +Randie +Randolf +Randolph +Randy +Ransell +Ransom +Raoul +Raphael +Raul +Ravi +Ravil +Rawley +Ray +Raymond +Raymund +Raymundo +Raynard +Rayner +Raynor +Reagan +Red +Redford +Redmond +Reece +Reed +Rees +Reese +Reg +Regan +Regen +Reggie +Reggis +Reggy +Reginald +Reginauld +Reid +Reilly +Reinhard +Reinhold +Rem +Remington +Remus +Renado +Renaldo +Renard +Renato +Renaud +Renault +Rene +Reube +Reuben +Reuven +Rex +Rey +Reynard +Reynold +Reynolds +Reza +Rhett +Ric +Ricard +Ricardo +Riccardo +Rice +Rich +Richard +Richardo +Richie +Richmond +Richy +Rick +Rickard +Rickey +Ricki +Rickie +Ricky +Rik +Rikki +Riley +Rinaldo +Ripley +Ritch +Ritchie +Roarke +Rob +Robb +Robbert +Robbie +Robert +Roberto +Robin +Robinson +Rochester +Rock +Rockwell +Rocky +Rod +Rodd +Roddie +Roddy +Roderic +Roderich +Roderick +Roderigo +Rodge +Rodger +Rodney +Rodolfo +Rodolph +Rodolphe +Rodrick +Rodrigo +Rodrique +Rog +Roger +Rogers +Roice +Roland +Rolando +Rolf +Rolfe +Rolland +Rollin +Rollins +Rollo +Rolph +Romain +Roman +Romeo +Ron +Ronald +Ronen +Roni +Ronnie +Ronny +Roosevelt +Rory +Roscoe +Ross +Roth +Rourke +Rowland +Roy +Royal +Royce +Rube +Ruben +Rubin +Ruby +Rudd +Ruddie +Ruddy +Rudie +Rudiger +Rudolf +Rudolfo +Rudolph +Rudy +Rudyard +Rufe +Rufus +Rupert +Ruperto +Russ +Russel +Russell +Rustie +Rustin +Rusty +Rutger +Rutherford +Rutledge +Rutter +Ryan +Sal +Salem +Salim +Salman +Salmon +Salomo +Salomon +Salomone +Salvador +Salvatore +Salvidor +Sam +Sammie +Sammy +Sampson +Samson +Samuel +Samuele +Sancho +Sander +Sanders +Sanderson +Sandor +Sandro +Sandy +Sanford +Sanson +Sansone +Sarge +Sargent +Sascha +Sasha +Saul +Sauncho +Saunder +Saunders +Saunderson +Saundra +Saw +Sawyer +Sawyere +Sax +Saxe +Saxon +Say +Sayer +Sayers +Sayre +Sayres +Scarface +Schroeder +Schuyler +Scot +Scott +Scotti +Scottie +Scotty +Seamus +Sean +Sebastian +Sebastiano +Sebastien +See +Selby +Selig +Serge +Sergeant +Sergei +Sergent +Sergio +Seth +Seymour +Shadow +Shaine +Shalom +Shamus +Shamshi-Adad +Shanan +Shane +Shannan +Shannon +Shaughn +Shaun +Shaw +Shawn +Shay +Shayne +Shea +Sheff +Sheffie +Sheffield +Sheffy +Shelby +Shelden +Sheldon +Shell +Shelley +Shelton +Shem +Shep +Shepard +Shepherd +Sheppard +Shepperd +Sheridan +Sherlock +Sherlocke +Sherman +Sherwin +Sherwood +Sherwynd +Shimon +Shlomo +Sholom +Shorty +Shurlock +Shurlocke +Shurwood +Si +Sibyl +Sid +Siddhartha +Sidnee +Sidney +Siegfried +Siffre +Sig +Sigfrid +Sigfried +Sigmund +Silas +Silvain +Silvan +Silvano +Silvanus +Silvester +Silvio +Sim +Simeon +Simmonds +Simon +Simone +Sinclair +Sinclare +Sivert +Siward +Sixtus +Skell +Skelly +Skip +Skipp +Skipper +Skippie +Skippy +Skipton +Sky +Skye +Skylar +Skyler +Slade +Slim +Sloan +Sloane +Sly +Smith +Smitty +Socrates +Sol +Sollie +Solly +Solomon +Somerset +Son +Sonnie +Sonny +Sparky +Spence +Spencer +Spense +Spenser +Spike +Spiro +Spiros +Spud +Srinivas +Stacy +Staffard +Stafford +Staford +Stan +Standford +Stanfield +Stanford +Stanislaw +Stanleigh +Stanley +Stanly +Stanton +Stanwood +Stavros +Stearn +Stearne +Stefan +Stefano +Steffen +Stephan +Stephanus +Stephen +Sterling +Stern +Sterne +Steve +Steven +Stevie +Stevy +Stew +Steward +Stewart +Stig +Stillman +Stillmann +Sting +Stinky +Stirling +Stu +Stuart +Sturgis +Sullivan +Sully +Sumner +Sunny +Sutherland +Sutton +Sven +Swen +Syd +Sydney +Sylvan +Sylvester +Tab +Tabb +Tabbie +Tabby +Taber +Tabor +Tad +Tadd +Taddeo +Taddeus +Tadeas +Tailor +Tait +Taite +Talbert +Talbot +Tallie +Tally +Tam +Tamas +Tammie +Tammy +Tan +Tann +Tanner +Tanney +Tannie +Tanny +Tarrance +Tarrant +Tarzan +Tate +Taylor +Teador +Ted +Tedd +Teddie +Teddy +Tedie +Tedman +Tedmund +Tedrick +Temp +Temple +Templeton +Teodoor +Teodor +Teodorico +Teodoro +Terence +Terencio +Terrance +Terrel +Terrell +Terrence +Terri +Terrill +Terry +Thacher +Thad +Thaddeus +Thaddius +Thaddus +Thadeus +Thain +Thaine +Thane +Tharen +Thatch +Thatcher +Thaxter +Thayne +Thebault +Thedric +Thedrick +Theo +Theobald +Theodor +Theodore +Theodoric +Theophyllus +Thibaud +Thibaut +Thom +Thomas +Thor +Thorn +Thorndike +Thornie +Thornton +Thorny +Thorpe +Thorstein +Thorsten +Thorvald +Thurstan +Thurston +Tibold +Tiebold +Tiebout +Tiler +Tim +Timmie +Timmy +Timothee +Timotheus +Timothy +Tirrell +Tito +Titos +Titus +Tobe +Tobiah +Tobias +Tobie +Tobin +Tobit +Toby +Tod +Todd +Toddie +Toddy +Tom +Tomas +Tome +Tomkin +Tomlin +Tommie +Tommy +Tonnie +Tony +Tore +Torey +Torin +Torr +Torrance +Torre +Torrence +Torrey +Torrin +Torry +Town +Towney +Townie +Townsend +Towny +Trace +Tracey +Tracie +Tracy +Traver +Travers +Travis +Tray +Tre +Tremain +Tremaine +Tremayne +Trent +Trenton +Trev +Trevar +Trever +Trevor +Trey +Trip +Tristan +Troy +Truman +Tuck +Tucker +Tuckie +Tucky +Tudor +Tull +Tulley +Tully +Turner +Ty +Tybalt +Tye +Tyler +Tymon +Tymothy +Tynan +Tyrone +Tyrus +Tyson +Udale +Udall +Udell +Ugo +Ulberto +Uli +Ulick +Ulises +Ulric +Ulrich +Ulrick +Ulysses +Umberto +Upton +Urbain +Urban +Urbano +Urbanus +Uri +Uriah +Uriel +Urson +Vachel +Vaclav +Vail +Val +Valdemar +Vale +Valentin +Valentine +Valentinian +Van +Vance +Vasili +Vasilis +Vasily +Vassili +Vassily +Vaughan +Vaughn +Venkat +Verge +Vergil +Vern +Verne +Vernen +Verney +Vernon +Vernor +Vic +Vick +Victor +Vijay +Vilhelm +Vin +Vince +Vincent +Vincents +Vinnie +Vinny +Vinod +Virge +Virgie +Virgil +Virgilio +Vite +Vito +Vlad +Vladamir +Vladimir +Voltaire +Von +Wade +Wadsworth +Wain +Waine +Wainwright +Wait +Waite +Waiter +Wake +Wakefield +Wald +Waldemar +Walden +Waldo +Waldon +Waleed +Walker +Wallace +Wallache +Wallas +Wallie +Wallis +Wally +Walsh +Walt +Walter +Walther +Walton +Wang +Ward +Warde +Warden +Ware +Waring +Warner +Warren +Wash +Washington +Wat +Waverley +Waverly +Way +Waylan +Wayland +Waylen +Waylin +Waylon +Wayne +Web +Webb +Weber +Webster +Weidar +Weider +Welbie +Welby +Welch +Wells +Welsh +Wendall +Wendel +Wendell +Werner +Wes +Wesley +Weslie +West +Westbrook +Westbrooke +Westleigh +Westley +Weston +Weylin +Wheeler +Whit +Whitaker +Whitby +Whitman +Whitney +Whittaker +Wiatt +Wilber +Wilbert +Wilbur +Wilburn +Wilburt +Wilden +Wildon +Wilek +Wiley +Wilfred +Wilfrid +Wilhelm +Will +Willard +Willdon +Willem +Willey +Willi +William +Willie +Willis +Willmott +Willy +Wilmar +Wilmer +Wilson +Wilt +Wilton +Win +Windham +Winfield +Winford +Winfred +Winifield +Winn +Winnie +Winny +Winslow +Winston +Winthrop +Winton +Wit +Witold +Wittie +Witty +Wojciech +Wolfgang +Wolfie +Wolfram +Wolfy +Woochang +Woodie +Woodman +Woodrow +Woody +Worden +Worthington +Worthy +Wright +Wyatan +Wyatt +Wye +Wylie +Wyn +Wyndham +Wynn +Wynton +Xavier +Xenos +Xerxes +Xever +Ximenes +Ximenez +Xymenes +Yaakov +Yacov +Yale +Yanaton +Yance +Yancey +Yancy +Yank +Yankee +Yard +Yardley +Yehudi +Yigal +Yule +Yuri +Yves +Zach +Zacharia +Zachariah +Zacharias +Zacharie +Zachary +Zacherie +Zachery +Zack +Zackariah +Zak +Zalman +Zane +Zared +Zary +Zeb +Zebadiah +Zebedee +Zebulen +Zebulon +Zechariah +Zed +Zedekiah +Zeke +Zelig +Zerk +Zeus +Zippy +Zollie +Zolly +Zorro +Rahul +Shumeet +Vibhu diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/data/roman/roman_to_spoken.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/roman/roman_to_spoken.tsv new file mode 100644 index 0000000000000000000000000000000000000000..971c90e37b22d78de53c7b6430c7847922ce5e16 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/roman/roman_to_spoken.tsv @@ -0,0 +1,2000 @@ +I one +II two +III three +IV four +V five +VI six +VII seven +VIII eight +IX nine +X ten +XI eleven +XII twelve +XIII thirteen +XIV fourteen +XV fifteen +XVI sixteen +XVII seventeen +XVIII eighteen +XIX nineteen +XX twenty +XXI twenty one +XXII twenty two +XXIII twenty three +XXIV twenty four +XXV twenty five +XXVI twenty six +XXVII twenty seven +XXVIII twenty eight +XXIX twenty nine +XXX thirty +XXXI thirty one +XXXII thirty two +XXXIII thirty three +XXXIV thirty four +XXXV thirty five +XXXVI thirty six +XXXVII thirty seven +XXXVIII thirty eight +XXXIX thirty nine +XL forty +XLI forty one +XLII forty two +XLIII forty three +XLIV forty four +XLV forty five +XLVI forty six +XLVII forty seven +XLVIII forty eight +XLIX forty nine +L fifty +LI fifty one +LII fifty two +LIII fifty three +LIV fifty four +LV fifty five +LVI fifty six +LVII fifty seven +LVIII fifty eight +LIX fifty nine +LX sixty +LXI sixty one +LXII sixty two +LXIII sixty three +LXIV sixty four +LXV sixty five +LXVI sixty six +LXVII sixty seven +LXVIII sixty eight +LXIX sixty nine +LXX seventy +LXXI seventy one +LXXII seventy two +LXXIII seventy three +LXXIV seventy four +LXXV seventy five +LXXVI seventy six +LXXVII seventy seven +LXXVIII seventy eight +LXXIX seventy nine +LXXX eighty +LXXXI eighty one +LXXXII eighty two +LXXXIII eighty three +LXXXIV eighty four +LXXXV eighty five +LXXXVI eighty six +LXXXVII eighty seven +LXXXVIII eighty eight +LXXXIX eighty nine +XC ninety +XCI ninety one +XCII ninety two +XCIII ninety three +XCIV ninety four +XCV ninety five +XCVI ninety six +XCVII ninety seven +XCVIII ninety eight +XCIX ninety nine +C one hundred +CI one hundred one +CII one hundred two +CIII one hundred three +CIV one hundred four +CV one hundred five +CVI one hundred six +CVII one hundred seven +CVIII one hundred eight +CIX one hundred nine +CX one hundred ten +CXI one hundred eleven +CXII one hundred twelve +CXIII one hundred thirteen +CXIV one hundred fourteen +CXV one hundred fifteen +CXVI one hundred sixteen +CXVII one hundred seventeen +CXVIII one hundred eighteen +CXIX one hundred nineteen +CXX one hundred twenty +CXXI one hundred twenty one +CXXII one hundred twenty two +CXXIII one hundred twenty three +CXXIV one hundred twenty four +CXXV one hundred twenty five +CXXVI one hundred twenty six +CXXVII one hundred twenty seven +CXXVIII one hundred twenty eight +CXXIX one hundred twenty nine +CXXX one hundred thirty +CXXXI one hundred thirty one +CXXXII one hundred thirty two +CXXXIII one hundred thirty three +CXXXIV one hundred thirty four +CXXXV one hundred thirty five +CXXXVI one hundred thirty six +CXXXVII one hundred thirty seven +CXXXVIII one hundred thirty eight +CXXXIX one hundred thirty nine +CXL one hundred forty +CXLI one hundred forty one +CXLII one hundred forty two +CXLIII one hundred forty three +CXLIV one hundred forty four +CXLV one hundred forty five +CXLVI one hundred forty six +CXLVII one hundred forty seven +CXLVIII one hundred forty eight +CXLIX one hundred forty nine +CL one hundred fifty +CLI one hundred fifty one +CLII one hundred fifty two +CLIII one hundred fifty three +CLIV one hundred fifty four +CLV one hundred fifty five +CLVI one hundred fifty six +CLVII one hundred fifty seven +CLVIII one hundred fifty eight +CLIX one hundred fifty nine +CLX one hundred sixty +CLXI one hundred sixty one +CLXII one hundred sixty two +CLXIII one hundred sixty three +CLXIV one hundred sixty four +CLXV one hundred sixty five +CLXVI one hundred sixty six +CLXVII one hundred sixty seven +CLXVIII one hundred sixty eight +CLXIX one hundred sixty nine +CLXX one hundred seventy +CLXXI one hundred seventy one +CLXXII one hundred seventy two +CLXXIII one hundred seventy three +CLXXIV one hundred seventy four +CLXXV one hundred seventy five +CLXXVI one hundred seventy six +CLXXVII one hundred seventy seven +CLXXVIII one hundred seventy eight +CLXXIX one hundred seventy nine +CLXXX one hundred eighty +CLXXXI one hundred eighty one +CLXXXII one hundred eighty two +CLXXXIII one hundred eighty three +CLXXXIV one hundred eighty four +CLXXXV one hundred eighty five +CLXXXVI one hundred eighty six +CLXXXVII one hundred eighty seven +CLXXXVIII one hundred eighty eight +CLXXXIX one hundred eighty nine +CXC one hundred ninety +CXCI one hundred ninety one +CXCII one hundred ninety two +CXCIII one hundred ninety three +CXCIV one hundred ninety four +CXCV one hundred ninety five +CXCVI one hundred ninety six +CXCVII one hundred ninety seven +CXCVIII one hundred ninety eight +CXCIX one hundred ninety nine +CC two hundred +CCI two hundred one +CCII two hundred two +CCIII two hundred three +CCIV two hundred four +CCV two hundred five +CCVI two hundred six +CCVII two hundred seven +CCVIII two hundred eight +CCIX two hundred nine +CCX two hundred ten +CCXI two hundred eleven +CCXII two hundred twelve +CCXIII two hundred thirteen +CCXIV two hundred fourteen +CCXV two hundred fifteen +CCXVI two hundred sixteen +CCXVII two hundred seventeen +CCXVIII two hundred eighteen +CCXIX two hundred nineteen +CCXX two hundred twenty +CCXXI two hundred twenty one +CCXXII two hundred twenty two +CCXXIII two hundred twenty three +CCXXIV two hundred twenty four +CCXXV two hundred twenty five +CCXXVI two hundred twenty six +CCXXVII two hundred twenty seven +CCXXVIII two hundred twenty eight +CCXXIX two hundred twenty nine +CCXXX two hundred thirty +CCXXXI two hundred thirty one +CCXXXII two hundred thirty two +CCXXXIII two hundred thirty three +CCXXXIV two hundred thirty four +CCXXXV two hundred thirty five +CCXXXVI two hundred thirty six +CCXXXVII two hundred thirty seven +CCXXXVIII two hundred thirty eight +CCXXXIX two hundred thirty nine +CCXL two hundred forty +CCXLI two hundred forty one +CCXLII two hundred forty two +CCXLIII two hundred forty three +CCXLIV two hundred forty four +CCXLV two hundred forty five +CCXLVI two hundred forty six +CCXLVII two hundred forty seven +CCXLVIII two hundred forty eight +CCXLIX two hundred forty nine +CCL two hundred fifty +CCLI two hundred fifty one +CCLII two hundred fifty two +CCLIII two hundred fifty three +CCLIV two hundred fifty four +CCLV two hundred fifty five +CCLVI two hundred fifty six +CCLVII two hundred fifty seven +CCLVIII two hundred fifty eight +CCLIX two hundred fifty nine +CCLX two hundred sixty +CCLXI two hundred sixty one +CCLXII two hundred sixty two +CCLXIII two hundred sixty three +CCLXIV two hundred sixty four +CCLXV two hundred sixty five +CCLXVI two hundred sixty six +CCLXVII two hundred sixty seven +CCLXVIII two hundred sixty eight +CCLXIX two hundred sixty nine +CCLXX two hundred seventy +CCLXXI two hundred seventy one +CCLXXII two hundred seventy two +CCLXXIII two hundred seventy three +CCLXXIV two hundred seventy four +CCLXXV two hundred seventy five +CCLXXVI two hundred seventy six +CCLXXVII two hundred seventy seven +CCLXXVIII two hundred seventy eight +CCLXXIX two hundred seventy nine +CCLXXX two hundred eighty +CCLXXXI two hundred eighty one +CCLXXXII two hundred eighty two +CCLXXXIII two hundred eighty three +CCLXXXIV two hundred eighty four +CCLXXXV two hundred eighty five +CCLXXXVI two hundred eighty six +CCLXXXVII two hundred eighty seven +CCLXXXVIII two hundred eighty eight +CCLXXXIX two hundred eighty nine +CCXC two hundred ninety +CCXCI two hundred ninety one +CCXCII two hundred ninety two +CCXCIII two hundred ninety three +CCXCIV two hundred ninety four +CCXCV two hundred ninety five +CCXCVI two hundred ninety six +CCXCVII two hundred ninety seven +CCXCVIII two hundred ninety eight +CCXCIX two hundred ninety nine +CCC three hundred +CCCI three hundred one +CCCII three hundred two +CCCIII three hundred three +CCCIV three hundred four +CCCV three hundred five +CCCVI three hundred six +CCCVII three hundred seven +CCCVIII three hundred eight +CCCIX three hundred nine +CCCX three hundred ten +CCCXI three hundred eleven +CCCXII three hundred twelve +CCCXIII three hundred thirteen +CCCXIV three hundred fourteen +CCCXV three hundred fifteen +CCCXVI three hundred sixteen +CCCXVII three hundred seventeen +CCCXVIII three hundred eighteen +CCCXIX three hundred nineteen +CCCXX three hundred twenty +CCCXXI three hundred twenty one +CCCXXII three hundred twenty two +CCCXXIII three hundred twenty three +CCCXXIV three hundred twenty four +CCCXXV three hundred twenty five +CCCXXVI three hundred twenty six +CCCXXVII three hundred twenty seven +CCCXXVIII three hundred twenty eight +CCCXXIX three hundred twenty nine +CCCXXX three hundred thirty +CCCXXXI three hundred thirty one +CCCXXXII three hundred thirty two +CCCXXXIII three hundred thirty three +CCCXXXIV three hundred thirty four +CCCXXXV three hundred thirty five +CCCXXXVI three hundred thirty six +CCCXXXVII three hundred thirty seven +CCCXXXVIII three hundred thirty eight +CCCXXXIX three hundred thirty nine +CCCXL three hundred forty +CCCXLI three hundred forty one +CCCXLII three hundred forty two +CCCXLIII three hundred forty three +CCCXLIV three hundred forty four +CCCXLV three hundred forty five +CCCXLVI three hundred forty six +CCCXLVII three hundred forty seven +CCCXLVIII three hundred forty eight +CCCXLIX three hundred forty nine +CCCL three hundred fifty +CCCLI three hundred fifty one +CCCLII three hundred fifty two +CCCLIII three hundred fifty three +CCCLIV three hundred fifty four +CCCLV three hundred fifty five +CCCLVI three hundred fifty six +CCCLVII three hundred fifty seven +CCCLVIII three hundred fifty eight +CCCLIX three hundred fifty nine +CCCLX three hundred sixty +CCCLXI three hundred sixty one +CCCLXII three hundred sixty two +CCCLXIII three hundred sixty three +CCCLXIV three hundred sixty four +CCCLXV three hundred sixty five +CCCLXVI three hundred sixty six +CCCLXVII three hundred sixty seven +CCCLXVIII three hundred sixty eight +CCCLXIX three hundred sixty nine +CCCLXX three hundred seventy +CCCLXXI three hundred seventy one +CCCLXXII three hundred seventy two +CCCLXXIII three hundred seventy three +CCCLXXIV three hundred seventy four +CCCLXXV three hundred seventy five +CCCLXXVI three hundred seventy six +CCCLXXVII three hundred seventy seven +CCCLXXVIII three hundred seventy eight +CCCLXXIX three hundred seventy nine +CCCLXXX three hundred eighty +CCCLXXXI three hundred eighty one +CCCLXXXII three hundred eighty two +CCCLXXXIII three hundred eighty three +CCCLXXXIV three hundred eighty four +CCCLXXXV three hundred eighty five +CCCLXXXVI three hundred eighty six +CCCLXXXVII three hundred eighty seven +CCCLXXXVIII three hundred eighty eight +CCCLXXXIX three hundred eighty nine +CCCXC three hundred ninety +CCCXCI three hundred ninety one +CCCXCII three hundred ninety two +CCCXCIII three hundred ninety three +CCCXCIV three hundred ninety four +CCCXCV three hundred ninety five +CCCXCVI three hundred ninety six +CCCXCVII three hundred ninety seven +CCCXCVIII three hundred ninety eight +CCCXCIX three hundred ninety nine +CD four hundred +CDI four hundred one +CDII four hundred two +CDIII four hundred three +CDIV four hundred four +CDV four hundred five +CDVI four hundred six +CDVII four hundred seven +CDVIII four hundred eight +CDIX four hundred nine +CDX four hundred ten +CDXI four hundred eleven +CDXII four hundred twelve +CDXIII four hundred thirteen +CDXIV four hundred fourteen +CDXV four hundred fifteen +CDXVI four hundred sixteen +CDXVII four hundred seventeen +CDXVIII four hundred eighteen +CDXIX four hundred nineteen +CDXX four hundred twenty +CDXXI four hundred twenty one +CDXXII four hundred twenty two +CDXXIII four hundred twenty three +CDXXIV four hundred twenty four +CDXXV four hundred twenty five +CDXXVI four hundred twenty six +CDXXVII four hundred twenty seven +CDXXVIII four hundred twenty eight +CDXXIX four hundred twenty nine +CDXXX four hundred thirty +CDXXXI four hundred thirty one +CDXXXII four hundred thirty two +CDXXXIII four hundred thirty three +CDXXXIV four hundred thirty four +CDXXXV four hundred thirty five +CDXXXVI four hundred thirty six +CDXXXVII four hundred thirty seven +CDXXXVIII four hundred thirty eight +CDXXXIX four hundred thirty nine +CDXL four hundred forty +CDXLI four hundred forty one +CDXLII four hundred forty two +CDXLIII four hundred forty three +CDXLIV four hundred forty four +CDXLV four hundred forty five +CDXLVI four hundred forty six +CDXLVII four hundred forty seven +CDXLVIII four hundred forty eight +CDXLIX four hundred forty nine +CDL four hundred fifty +CDLI four hundred fifty one +CDLII four hundred fifty two +CDLIII four hundred fifty three +CDLIV four hundred fifty four +CDLV four hundred fifty five +CDLVI four hundred fifty six +CDLVII four hundred fifty seven +CDLVIII four hundred fifty eight +CDLIX four hundred fifty nine +CDLX four hundred sixty +CDLXI four hundred sixty one +CDLXII four hundred sixty two +CDLXIII four hundred sixty three +CDLXIV four hundred sixty four +CDLXV four hundred sixty five +CDLXVI four hundred sixty six +CDLXVII four hundred sixty seven +CDLXVIII four hundred sixty eight +CDLXIX four hundred sixty nine +CDLXX four hundred seventy +CDLXXI four hundred seventy one +CDLXXII four hundred seventy two +CDLXXIII four hundred seventy three +CDLXXIV four hundred seventy four +CDLXXV four hundred seventy five +CDLXXVI four hundred seventy six +CDLXXVII four hundred seventy seven +CDLXXVIII four hundred seventy eight +CDLXXIX four hundred seventy nine +CDLXXX four hundred eighty +CDLXXXI four hundred eighty one +CDLXXXII four hundred eighty two +CDLXXXIII four hundred eighty three +CDLXXXIV four hundred eighty four +CDLXXXV four hundred eighty five +CDLXXXVI four hundred eighty six +CDLXXXVII four hundred eighty seven +CDLXXXVIII four hundred eighty eight +CDLXXXIX four hundred eighty nine +CDXC four hundred ninety +CDXCI four hundred ninety one +CDXCII four hundred ninety two +CDXCIII four hundred ninety three +CDXCIV four hundred ninety four +CDXCV four hundred ninety five +CDXCVI four hundred ninety six +CDXCVII four hundred ninety seven +CDXCVIII four hundred ninety eight +CDXCIX four hundred ninety nine +D five hundred +DI five hundred one +DII five hundred two +DIII five hundred three +DIV five hundred four +DV five hundred five +DVI five hundred six +DVII five hundred seven +DVIII five hundred eight +DIX five hundred nine +DX five hundred ten +DXI five hundred eleven +DXII five hundred twelve +DXIII five hundred thirteen +DXIV five hundred fourteen +DXV five hundred fifteen +DXVI five hundred sixteen +DXVII five hundred seventeen +DXVIII five hundred eighteen +DXIX five hundred nineteen +DXX five hundred twenty +DXXI five hundred twenty one +DXXII five hundred twenty two +DXXIII five hundred twenty three +DXXIV five hundred twenty four +DXXV five hundred twenty five +DXXVI five hundred twenty six +DXXVII five hundred twenty seven +DXXVIII five hundred twenty eight +DXXIX five hundred twenty nine +DXXX five hundred thirty +DXXXI five hundred thirty one +DXXXII five hundred thirty two +DXXXIII five hundred thirty three +DXXXIV five hundred thirty four +DXXXV five hundred thirty five +DXXXVI five hundred thirty six +DXXXVII five hundred thirty seven +DXXXVIII five hundred thirty eight +DXXXIX five hundred thirty nine +DXL five hundred forty +DXLI five hundred forty one +DXLII five hundred forty two +DXLIII five hundred forty three +DXLIV five hundred forty four +DXLV five hundred forty five +DXLVI five hundred forty six +DXLVII five hundred forty seven +DXLVIII five hundred forty eight +DXLIX five hundred forty nine +DL five hundred fifty +DLI five hundred fifty one +DLII five hundred fifty two +DLIII five hundred fifty three +DLIV five hundred fifty four +DLV five hundred fifty five +DLVI five hundred fifty six +DLVII five hundred fifty seven +DLVIII five hundred fifty eight +DLIX five hundred fifty nine +DLX five hundred sixty +DLXI five hundred sixty one +DLXII five hundred sixty two +DLXIII five hundred sixty three +DLXIV five hundred sixty four +DLXV five hundred sixty five +DLXVI five hundred sixty six +DLXVII five hundred sixty seven +DLXVIII five hundred sixty eight +DLXIX five hundred sixty nine +DLXX five hundred seventy +DLXXI five hundred seventy one +DLXXII five hundred seventy two +DLXXIII five hundred seventy three +DLXXIV five hundred seventy four +DLXXV five hundred seventy five +DLXXVI five hundred seventy six +DLXXVII five hundred seventy seven +DLXXVIII five hundred seventy eight +DLXXIX five hundred seventy nine +DLXXX five hundred eighty +DLXXXI five hundred eighty one +DLXXXII five hundred eighty two +DLXXXIII five hundred eighty three +DLXXXIV five hundred eighty four +DLXXXV five hundred eighty five +DLXXXVI five hundred eighty six +DLXXXVII five hundred eighty seven +DLXXXVIII five hundred eighty eight +DLXXXIX five hundred eighty nine +DXC five hundred ninety +DXCI five hundred ninety one +DXCII five hundred ninety two +DXCIII five hundred ninety three +DXCIV five hundred ninety four +DXCV five hundred ninety five +DXCVI five hundred ninety six +DXCVII five hundred ninety seven +DXCVIII five hundred ninety eight +DXCIX five hundred ninety nine +DC six hundred +DCI six hundred one +DCII six hundred two +DCIII six hundred three +DCIV six hundred four +DCV six hundred five +DCVI six hundred six +DCVII six hundred seven +DCVIII six hundred eight +DCIX six hundred nine +DCX six hundred ten +DCXI six hundred eleven +DCXII six hundred twelve +DCXIII six hundred thirteen +DCXIV six hundred fourteen +DCXV six hundred fifteen +DCXVI six hundred sixteen +DCXVII six hundred seventeen +DCXVIII six hundred eighteen +DCXIX six hundred nineteen +DCXX six hundred twenty +DCXXI six hundred twenty one +DCXXII six hundred twenty two +DCXXIII six hundred twenty three +DCXXIV six hundred twenty four +DCXXV six hundred twenty five +DCXXVI six hundred twenty six +DCXXVII six hundred twenty seven +DCXXVIII six hundred twenty eight +DCXXIX six hundred twenty nine +DCXXX six hundred thirty +DCXXXI six hundred thirty one +DCXXXII six hundred thirty two +DCXXXIII six hundred thirty three +DCXXXIV six hundred thirty four +DCXXXV six hundred thirty five +DCXXXVI six hundred thirty six +DCXXXVII six hundred thirty seven +DCXXXVIII six hundred thirty eight +DCXXXIX six hundred thirty nine +DCXL six hundred forty +DCXLI six hundred forty one +DCXLII six hundred forty two +DCXLIII six hundred forty three +DCXLIV six hundred forty four +DCXLV six hundred forty five +DCXLVI six hundred forty six +DCXLVII six hundred forty seven +DCXLVIII six hundred forty eight +DCXLIX six hundred forty nine +DCL six hundred fifty +DCLI six hundred fifty one +DCLII six hundred fifty two +DCLIII six hundred fifty three +DCLIV six hundred fifty four +DCLV six hundred fifty five +DCLVI six hundred fifty six +DCLVII six hundred fifty seven +DCLVIII six hundred fifty eight +DCLIX six hundred fifty nine +DCLX six hundred sixty +DCLXI six hundred sixty one +DCLXII six hundred sixty two +DCLXIII six hundred sixty three +DCLXIV six hundred sixty four +DCLXV six hundred sixty five +DCLXVI six hundred sixty six +DCLXVII six hundred sixty seven +DCLXVIII six hundred sixty eight +DCLXIX six hundred sixty nine +DCLXX six hundred seventy +DCLXXI six hundred seventy one +DCLXXII six hundred seventy two +DCLXXIII six hundred seventy three +DCLXXIV six hundred seventy four +DCLXXV six hundred seventy five +DCLXXVI six hundred seventy six +DCLXXVII six hundred seventy seven +DCLXXVIII six hundred seventy eight +DCLXXIX six hundred seventy nine +DCLXXX six hundred eighty +DCLXXXI six hundred eighty one +DCLXXXII six hundred eighty two +DCLXXXIII six hundred eighty three +DCLXXXIV six hundred eighty four +DCLXXXV six hundred eighty five +DCLXXXVI six hundred eighty six +DCLXXXVII six hundred eighty seven +DCLXXXVIII six hundred eighty eight +DCLXXXIX six hundred eighty nine +DCXC six hundred ninety +DCXCI six hundred ninety one +DCXCII six hundred ninety two +DCXCIII six hundred ninety three +DCXCIV six hundred ninety four +DCXCV six hundred ninety five +DCXCVI six hundred ninety six +DCXCVII six hundred ninety seven +DCXCVIII six hundred ninety eight +DCXCIX six hundred ninety nine +DCC seven hundred +DCCI seven hundred one +DCCII seven hundred two +DCCIII seven hundred three +DCCIV seven hundred four +DCCV seven hundred five +DCCVI seven hundred six +DCCVII seven hundred seven +DCCVIII seven hundred eight +DCCIX seven hundred nine +DCCX seven hundred ten +DCCXI seven hundred eleven +DCCXII seven hundred twelve +DCCXIII seven hundred thirteen +DCCXIV seven hundred fourteen +DCCXV seven hundred fifteen +DCCXVI seven hundred sixteen +DCCXVII seven hundred seventeen +DCCXVIII seven hundred eighteen +DCCXIX seven hundred nineteen +DCCXX seven hundred twenty +DCCXXI seven hundred twenty one +DCCXXII seven hundred twenty two +DCCXXIII seven hundred twenty three +DCCXXIV seven hundred twenty four +DCCXXV seven hundred twenty five +DCCXXVI seven hundred twenty six +DCCXXVII seven hundred twenty seven +DCCXXVIII seven hundred twenty eight +DCCXXIX seven hundred twenty nine +DCCXXX seven hundred thirty +DCCXXXI seven hundred thirty one +DCCXXXII seven hundred thirty two +DCCXXXIII seven hundred thirty three +DCCXXXIV seven hundred thirty four +DCCXXXV seven hundred thirty five +DCCXXXVI seven hundred thirty six +DCCXXXVII seven hundred thirty seven +DCCXXXVIII seven hundred thirty eight +DCCXXXIX seven hundred thirty nine +DCCXL seven hundred forty +DCCXLI seven hundred forty one +DCCXLII seven hundred forty two +DCCXLIII seven hundred forty three +DCCXLIV seven hundred forty four +DCCXLV seven hundred forty five +DCCXLVI seven hundred forty six +DCCXLVII seven hundred forty seven +DCCXLVIII seven hundred forty eight +DCCXLIX seven hundred forty nine +DCCL seven hundred fifty +DCCLI seven hundred fifty one +DCCLII seven hundred fifty two +DCCLIII seven hundred fifty three +DCCLIV seven hundred fifty four +DCCLV seven hundred fifty five +DCCLVI seven hundred fifty six +DCCLVII seven hundred fifty seven +DCCLVIII seven hundred fifty eight +DCCLIX seven hundred fifty nine +DCCLX seven hundred sixty +DCCLXI seven hundred sixty one +DCCLXII seven hundred sixty two +DCCLXIII seven hundred sixty three +DCCLXIV seven hundred sixty four +DCCLXV seven hundred sixty five +DCCLXVI seven hundred sixty six +DCCLXVII seven hundred sixty seven +DCCLXVIII seven hundred sixty eight +DCCLXIX seven hundred sixty nine +DCCLXX seven hundred seventy +DCCLXXI seven hundred seventy one +DCCLXXII seven hundred seventy two +DCCLXXIII seven hundred seventy three +DCCLXXIV seven hundred seventy four +DCCLXXV seven hundred seventy five +DCCLXXVI seven hundred seventy six +DCCLXXVII seven hundred seventy seven +DCCLXXVIII seven hundred seventy eight +DCCLXXIX seven hundred seventy nine +DCCLXXX seven hundred eighty +DCCLXXXI seven hundred eighty one +DCCLXXXII seven hundred eighty two +DCCLXXXIII seven hundred eighty three +DCCLXXXIV seven hundred eighty four +DCCLXXXV seven hundred eighty five +DCCLXXXVI seven hundred eighty six +DCCLXXXVII seven hundred eighty seven +DCCLXXXVIII seven hundred eighty eight +DCCLXXXIX seven hundred eighty nine +DCCXC seven hundred ninety +DCCXCI seven hundred ninety one +DCCXCII seven hundred ninety two +DCCXCIII seven hundred ninety three +DCCXCIV seven hundred ninety four +DCCXCV seven hundred ninety five +DCCXCVI seven hundred ninety six +DCCXCVII seven hundred ninety seven +DCCXCVIII seven hundred ninety eight +DCCXCIX seven hundred ninety nine +DCCC eight hundred +DCCCI eight hundred one +DCCCII eight hundred two +DCCCIII eight hundred three +DCCCIV eight hundred four +DCCCV eight hundred five +DCCCVI eight hundred six +DCCCVII eight hundred seven +DCCCVIII eight hundred eight +DCCCIX eight hundred nine +DCCCX eight hundred ten +DCCCXI eight hundred eleven +DCCCXII eight hundred twelve +DCCCXIII eight hundred thirteen +DCCCXIV eight hundred fourteen +DCCCXV eight hundred fifteen +DCCCXVI eight hundred sixteen +DCCCXVII eight hundred seventeen +DCCCXVIII eight hundred eighteen +DCCCXIX eight hundred nineteen +DCCCXX eight hundred twenty +DCCCXXI eight hundred twenty one +DCCCXXII eight hundred twenty two +DCCCXXIII eight hundred twenty three +DCCCXXIV eight hundred twenty four +DCCCXXV eight hundred twenty five +DCCCXXVI eight hundred twenty six +DCCCXXVII eight hundred twenty seven +DCCCXXVIII eight hundred twenty eight +DCCCXXIX eight hundred twenty nine +DCCCXXX eight hundred thirty +DCCCXXXI eight hundred thirty one +DCCCXXXII eight hundred thirty two +DCCCXXXIII eight hundred thirty three +DCCCXXXIV eight hundred thirty four +DCCCXXXV eight hundred thirty five +DCCCXXXVI eight hundred thirty six +DCCCXXXVII eight hundred thirty seven +DCCCXXXVIII eight hundred thirty eight +DCCCXXXIX eight hundred thirty nine +DCCCXL eight hundred forty +DCCCXLI eight hundred forty one +DCCCXLII eight hundred forty two +DCCCXLIII eight hundred forty three +DCCCXLIV eight hundred forty four +DCCCXLV eight hundred forty five +DCCCXLVI eight hundred forty six +DCCCXLVII eight hundred forty seven +DCCCXLVIII eight hundred forty eight +DCCCXLIX eight hundred forty nine +DCCCL eight hundred fifty +DCCCLI eight hundred fifty one +DCCCLII eight hundred fifty two +DCCCLIII eight hundred fifty three +DCCCLIV eight hundred fifty four +DCCCLV eight hundred fifty five +DCCCLVI eight hundred fifty six +DCCCLVII eight hundred fifty seven +DCCCLVIII eight hundred fifty eight +DCCCLIX eight hundred fifty nine +DCCCLX eight hundred sixty +DCCCLXI eight hundred sixty one +DCCCLXII eight hundred sixty two +DCCCLXIII eight hundred sixty three +DCCCLXIV eight hundred sixty four +DCCCLXV eight hundred sixty five +DCCCLXVI eight hundred sixty six +DCCCLXVII eight hundred sixty seven +DCCCLXVIII eight hundred sixty eight +DCCCLXIX eight hundred sixty nine +DCCCLXX eight hundred seventy +DCCCLXXI eight hundred seventy one +DCCCLXXII eight hundred seventy two +DCCCLXXIII eight hundred seventy three +DCCCLXXIV eight hundred seventy four +DCCCLXXV eight hundred seventy five +DCCCLXXVI eight hundred seventy six +DCCCLXXVII eight hundred seventy seven +DCCCLXXVIII eight hundred seventy eight +DCCCLXXIX eight hundred seventy nine +DCCCLXXX eight hundred eighty +DCCCLXXXI eight hundred eighty one +DCCCLXXXII eight hundred eighty two +DCCCLXXXIII eight hundred eighty three +DCCCLXXXIV eight hundred eighty four +DCCCLXXXV eight hundred eighty five +DCCCLXXXVI eight hundred eighty six +DCCCLXXXVII eight hundred eighty seven +DCCCLXXXVIII eight hundred eighty eight +DCCCLXXXIX eight hundred eighty nine +DCCCXC eight hundred ninety +DCCCXCI eight hundred ninety one +DCCCXCII eight hundred ninety two +DCCCXCIII eight hundred ninety three +DCCCXCIV eight hundred ninety four +DCCCXCV eight hundred ninety five +DCCCXCVI eight hundred ninety six +DCCCXCVII eight hundred ninety seven +DCCCXCVIII eight hundred ninety eight +DCCCXCIX eight hundred ninety nine +CM nine hundred +CMI nine hundred one +CMII nine hundred two +CMIII nine hundred three +CMIV nine hundred four +CMV nine hundred five +CMVI nine hundred six +CMVII nine hundred seven +CMVIII nine hundred eight +CMIX nine hundred nine +CMX nine hundred ten +CMXI nine hundred eleven +CMXII nine hundred twelve +CMXIII nine hundred thirteen +CMXIV nine hundred fourteen +CMXV nine hundred fifteen +CMXVI nine hundred sixteen +CMXVII nine hundred seventeen +CMXVIII nine hundred eighteen +CMXIX nine hundred nineteen +CMXX nine hundred twenty +CMXXI nine hundred twenty one +CMXXII nine hundred twenty two +CMXXIII nine hundred twenty three +CMXXIV nine hundred twenty four +CMXXV nine hundred twenty five +CMXXVI nine hundred twenty six +CMXXVII nine hundred twenty seven +CMXXVIII nine hundred twenty eight +CMXXIX nine hundred twenty nine +CMXXX nine hundred thirty +CMXXXI nine hundred thirty one +CMXXXII nine hundred thirty two +CMXXXIII nine hundred thirty three +CMXXXIV nine hundred thirty four +CMXXXV nine hundred thirty five +CMXXXVI nine hundred thirty six +CMXXXVII nine hundred thirty seven +CMXXXVIII nine hundred thirty eight +CMXXXIX nine hundred thirty nine +CMXL nine hundred forty +CMXLI nine hundred forty one +CMXLII nine hundred forty two +CMXLIII nine hundred forty three +CMXLIV nine hundred forty four +CMXLV nine hundred forty five +CMXLVI nine hundred forty six +CMXLVII nine hundred forty seven +CMXLVIII nine hundred forty eight +CMXLIX nine hundred forty nine +CML nine hundred fifty +CMLI nine hundred fifty one +CMLII nine hundred fifty two +CMLIII nine hundred fifty three +CMLIV nine hundred fifty four +CMLV nine hundred fifty five +CMLVI nine hundred fifty six +CMLVII nine hundred fifty seven +CMLVIII nine hundred fifty eight +CMLIX nine hundred fifty nine +CMLX nine hundred sixty +CMLXI nine hundred sixty one +CMLXII nine hundred sixty two +CMLXIII nine hundred sixty three +CMLXIV nine hundred sixty four +CMLXV nine hundred sixty five +CMLXVI nine hundred sixty six +CMLXVII nine hundred sixty seven +CMLXVIII nine hundred sixty eight +CMLXIX nine hundred sixty nine +CMLXX nine hundred seventy +CMLXXI nine hundred seventy one +CMLXXII nine hundred seventy two +CMLXXIII nine hundred seventy three +CMLXXIV nine hundred seventy four +CMLXXV nine hundred seventy five +CMLXXVI nine hundred seventy six +CMLXXVII nine hundred seventy seven +CMLXXVIII nine hundred seventy eight +CMLXXIX nine hundred seventy nine +CMLXXX nine hundred eighty +CMLXXXI nine hundred eighty one +CMLXXXII nine hundred eighty two +CMLXXXIII nine hundred eighty three +CMLXXXIV nine hundred eighty four +CMLXXXV nine hundred eighty five +CMLXXXVI nine hundred eighty six +CMLXXXVII nine hundred eighty seven +CMLXXXVIII nine hundred eighty eight +CMLXXXIX nine hundred eighty nine +CMXC nine hundred ninety +CMXCI nine hundred ninety one +CMXCII nine hundred ninety two +CMXCIII nine hundred ninety three +CMXCIV nine hundred ninety four +CMXCV nine hundred ninety five +CMXCVI nine hundred ninety six +CMXCVII nine hundred ninety seven +CMXCVIII nine hundred ninety eight +CMXCIX nine hundred ninety nine +M one thousand +MI one thousand one +MII one thousand two +MIII one thousand three +MIV one thousand four +MV one thousand five +MVI one thousand six +MVII one thousand seven +MVIII one thousand eight +MIX one thousand nine +MX one thousand ten +MXI one thousand eleven +MXII one thousand twelve +MXIII one thousand thirteen +MXIV one thousand fourteen +MXV one thousand fifteen +MXVI one thousand sixteen +MXVII one thousand seventeen +MXVIII one thousand eighteen +MXIX one thousand nineteen +MXX one thousand twenty +MXXI one thousand twenty one +MXXII one thousand twenty two +MXXIII one thousand twenty three +MXXIV one thousand twenty four +MXXV one thousand twenty five +MXXVI one thousand twenty six +MXXVII one thousand twenty seven +MXXVIII one thousand twenty eight +MXXIX one thousand twenty nine +MXXX one thousand thirty +MXXXI one thousand thirty one +MXXXII one thousand thirty two +MXXXIII one thousand thirty three +MXXXIV one thousand thirty four +MXXXV one thousand thirty five +MXXXVI one thousand thirty six +MXXXVII one thousand thirty seven +MXXXVIII one thousand thirty eight +MXXXIX one thousand thirty nine +MXL one thousand forty +MXLI one thousand forty one +MXLII one thousand forty two +MXLIII one thousand forty three +MXLIV one thousand forty four +MXLV one thousand forty five +MXLVI one thousand forty six +MXLVII one thousand forty seven +MXLVIII one thousand forty eight +MXLIX one thousand forty nine +ML one thousand fifty +MLI one thousand fifty one +MLII one thousand fifty two +MLIII one thousand fifty three +MLIV one thousand fifty four +MLV one thousand fifty five +MLVI one thousand fifty six +MLVII one thousand fifty seven +MLVIII one thousand fifty eight +MLIX one thousand fifty nine +MLX one thousand sixty +MLXI one thousand sixty one +MLXII one thousand sixty two +MLXIII one thousand sixty three +MLXIV one thousand sixty four +MLXV one thousand sixty five +MLXVI one thousand sixty six +MLXVII one thousand sixty seven +MLXVIII one thousand sixty eight +MLXIX one thousand sixty nine +MLXX one thousand seventy +MLXXI one thousand seventy one +MLXXII one thousand seventy two +MLXXIII one thousand seventy three +MLXXIV one thousand seventy four +MLXXV one thousand seventy five +MLXXVI one thousand seventy six +MLXXVII one thousand seventy seven +MLXXVIII one thousand seventy eight +MLXXIX one thousand seventy nine +MLXXX one thousand eighty +MLXXXI one thousand eighty one +MLXXXII one thousand eighty two +MLXXXIII one thousand eighty three +MLXXXIV one thousand eighty four +MLXXXV one thousand eighty five +MLXXXVI one thousand eighty six +MLXXXVII one thousand eighty seven +MLXXXVIII one thousand eighty eight +MLXXXIX one thousand eighty nine +MXC one thousand ninety +MXCI one thousand ninety one +MXCII one thousand ninety two +MXCIII one thousand ninety three +MXCIV one thousand ninety four +MXCV one thousand ninety five +MXCVI one thousand ninety six +MXCVII one thousand ninety seven +MXCVIII one thousand ninety eight +MXCIX one thousand ninety nine +MC one thousand, one hundred +MCI one thousand, one hundred one +MCII one thousand, one hundred two +MCIII one thousand, one hundred three +MCIV one thousand, one hundred four +MCV one thousand, one hundred five +MCVI one thousand, one hundred six +MCVII one thousand, one hundred seven +MCVIII one thousand, one hundred eight +MCIX one thousand, one hundred nine +MCX one thousand, one hundred ten +MCXI one thousand, one hundred eleven +MCXII one thousand, one hundred twelve +MCXIII one thousand, one hundred thirteen +MCXIV one thousand, one hundred fourteen +MCXV one thousand, one hundred fifteen +MCXVI one thousand, one hundred sixteen +MCXVII one thousand, one hundred seventeen +MCXVIII one thousand, one hundred eighteen +MCXIX one thousand, one hundred nineteen +MCXX one thousand, one hundred twenty +MCXXI one thousand, one hundred twenty one +MCXXII one thousand, one hundred twenty two +MCXXIII one thousand, one hundred twenty three +MCXXIV one thousand, one hundred twenty four +MCXXV one thousand, one hundred twenty five +MCXXVI one thousand, one hundred twenty six +MCXXVII one thousand, one hundred twenty seven +MCXXVIII one thousand, one hundred twenty eight +MCXXIX one thousand, one hundred twenty nine +MCXXX one thousand, one hundred thirty +MCXXXI one thousand, one hundred thirty one +MCXXXII one thousand, one hundred thirty two +MCXXXIII one thousand, one hundred thirty three +MCXXXIV one thousand, one hundred thirty four +MCXXXV one thousand, one hundred thirty five +MCXXXVI one thousand, one hundred thirty six +MCXXXVII one thousand, one hundred thirty seven +MCXXXVIII one thousand, one hundred thirty eight +MCXXXIX one thousand, one hundred thirty nine +MCXL one thousand, one hundred forty +MCXLI one thousand, one hundred forty one +MCXLII one thousand, one hundred forty two +MCXLIII one thousand, one hundred forty three +MCXLIV one thousand, one hundred forty four +MCXLV one thousand, one hundred forty five +MCXLVI one thousand, one hundred forty six +MCXLVII one thousand, one hundred forty seven +MCXLVIII one thousand, one hundred forty eight +MCXLIX one thousand, one hundred forty nine +MCL one thousand, one hundred fifty +MCLI one thousand, one hundred fifty one +MCLII one thousand, one hundred fifty two +MCLIII one thousand, one hundred fifty three +MCLIV one thousand, one hundred fifty four +MCLV one thousand, one hundred fifty five +MCLVI one thousand, one hundred fifty six +MCLVII one thousand, one hundred fifty seven +MCLVIII one thousand, one hundred fifty eight +MCLIX one thousand, one hundred fifty nine +MCLX one thousand, one hundred sixty +MCLXI one thousand, one hundred sixty one +MCLXII one thousand, one hundred sixty two +MCLXIII one thousand, one hundred sixty three +MCLXIV one thousand, one hundred sixty four +MCLXV one thousand, one hundred sixty five +MCLXVI one thousand, one hundred sixty six +MCLXVII one thousand, one hundred sixty seven +MCLXVIII one thousand, one hundred sixty eight +MCLXIX one thousand, one hundred sixty nine +MCLXX one thousand, one hundred seventy +MCLXXI one thousand, one hundred seventy one +MCLXXII one thousand, one hundred seventy two +MCLXXIII one thousand, one hundred seventy three +MCLXXIV one thousand, one hundred seventy four +MCLXXV one thousand, one hundred seventy five +MCLXXVI one thousand, one hundred seventy six +MCLXXVII one thousand, one hundred seventy seven +MCLXXVIII one thousand, one hundred seventy eight +MCLXXIX one thousand, one hundred seventy nine +MCLXXX one thousand, one hundred eighty +MCLXXXI one thousand, one hundred eighty one +MCLXXXII one thousand, one hundred eighty two +MCLXXXIII one thousand, one hundred eighty three +MCLXXXIV one thousand, one hundred eighty four +MCLXXXV one thousand, one hundred eighty five +MCLXXXVI one thousand, one hundred eighty six +MCLXXXVII one thousand, one hundred eighty seven +MCLXXXVIII one thousand, one hundred eighty eight +MCLXXXIX one thousand, one hundred eighty nine +MCXC one thousand, one hundred ninety +MCXCI one thousand, one hundred ninety one +MCXCII one thousand, one hundred ninety two +MCXCIII one thousand, one hundred ninety three +MCXCIV one thousand, one hundred ninety four +MCXCV one thousand, one hundred ninety five +MCXCVI one thousand, one hundred ninety six +MCXCVII one thousand, one hundred ninety seven +MCXCVIII one thousand, one hundred ninety eight +MCXCIX one thousand, one hundred ninety nine +MCC one thousand, two hundred +MCCI one thousand, two hundred one +MCCII one thousand, two hundred two +MCCIII one thousand, two hundred three +MCCIV one thousand, two hundred four +MCCV one thousand, two hundred five +MCCVI one thousand, two hundred six +MCCVII one thousand, two hundred seven +MCCVIII one thousand, two hundred eight +MCCIX one thousand, two hundred nine +MCCX one thousand, two hundred ten +MCCXI one thousand, two hundred eleven +MCCXII one thousand, two hundred twelve +MCCXIII one thousand, two hundred thirteen +MCCXIV one thousand, two hundred fourteen +MCCXV one thousand, two hundred fifteen +MCCXVI one thousand, two hundred sixteen +MCCXVII one thousand, two hundred seventeen +MCCXVIII one thousand, two hundred eighteen +MCCXIX one thousand, two hundred nineteen +MCCXX one thousand, two hundred twenty +MCCXXI one thousand, two hundred twenty one +MCCXXII one thousand, two hundred twenty two +MCCXXIII one thousand, two hundred twenty three +MCCXXIV one thousand, two hundred twenty four +MCCXXV one thousand, two hundred twenty five +MCCXXVI one thousand, two hundred twenty six +MCCXXVII one thousand, two hundred twenty seven +MCCXXVIII one thousand, two hundred twenty eight +MCCXXIX one thousand, two hundred twenty nine +MCCXXX one thousand, two hundred thirty +MCCXXXI one thousand, two hundred thirty one +MCCXXXII one thousand, two hundred thirty two +MCCXXXIII one thousand, two hundred thirty three +MCCXXXIV one thousand, two hundred thirty four +MCCXXXV one thousand, two hundred thirty five +MCCXXXVI one thousand, two hundred thirty six +MCCXXXVII one thousand, two hundred thirty seven +MCCXXXVIII one thousand, two hundred thirty eight +MCCXXXIX one thousand, two hundred thirty nine +MCCXL one thousand, two hundred forty +MCCXLI one thousand, two hundred forty one +MCCXLII one thousand, two hundred forty two +MCCXLIII one thousand, two hundred forty three +MCCXLIV one thousand, two hundred forty four +MCCXLV one thousand, two hundred forty five +MCCXLVI one thousand, two hundred forty six +MCCXLVII one thousand, two hundred forty seven +MCCXLVIII one thousand, two hundred forty eight +MCCXLIX one thousand, two hundred forty nine +MCCL one thousand, two hundred fifty +MCCLI one thousand, two hundred fifty one +MCCLII one thousand, two hundred fifty two +MCCLIII one thousand, two hundred fifty three +MCCLIV one thousand, two hundred fifty four +MCCLV one thousand, two hundred fifty five +MCCLVI one thousand, two hundred fifty six +MCCLVII one thousand, two hundred fifty seven +MCCLVIII one thousand, two hundred fifty eight +MCCLIX one thousand, two hundred fifty nine +MCCLX one thousand, two hundred sixty +MCCLXI one thousand, two hundred sixty one +MCCLXII one thousand, two hundred sixty two +MCCLXIII one thousand, two hundred sixty three +MCCLXIV one thousand, two hundred sixty four +MCCLXV one thousand, two hundred sixty five +MCCLXVI one thousand, two hundred sixty six +MCCLXVII one thousand, two hundred sixty seven +MCCLXVIII one thousand, two hundred sixty eight +MCCLXIX one thousand, two hundred sixty nine +MCCLXX one thousand, two hundred seventy +MCCLXXI one thousand, two hundred seventy one +MCCLXXII one thousand, two hundred seventy two +MCCLXXIII one thousand, two hundred seventy three +MCCLXXIV one thousand, two hundred seventy four +MCCLXXV one thousand, two hundred seventy five +MCCLXXVI one thousand, two hundred seventy six +MCCLXXVII one thousand, two hundred seventy seven +MCCLXXVIII one thousand, two hundred seventy eight +MCCLXXIX one thousand, two hundred seventy nine +MCCLXXX one thousand, two hundred eighty +MCCLXXXI one thousand, two hundred eighty one +MCCLXXXII one thousand, two hundred eighty two +MCCLXXXIII one thousand, two hundred eighty three +MCCLXXXIV one thousand, two hundred eighty four +MCCLXXXV one thousand, two hundred eighty five +MCCLXXXVI one thousand, two hundred eighty six +MCCLXXXVII one thousand, two hundred eighty seven +MCCLXXXVIII one thousand, two hundred eighty eight +MCCLXXXIX one thousand, two hundred eighty nine +MCCXC one thousand, two hundred ninety +MCCXCI one thousand, two hundred ninety one +MCCXCII one thousand, two hundred ninety two +MCCXCIII one thousand, two hundred ninety three +MCCXCIV one thousand, two hundred ninety four +MCCXCV one thousand, two hundred ninety five +MCCXCVI one thousand, two hundred ninety six +MCCXCVII one thousand, two hundred ninety seven +MCCXCVIII one thousand, two hundred ninety eight +MCCXCIX one thousand, two hundred ninety nine +MCCC one thousand, three hundred +MCCCI one thousand, three hundred one +MCCCII one thousand, three hundred two +MCCCIII one thousand, three hundred three +MCCCIV one thousand, three hundred four +MCCCV one thousand, three hundred five +MCCCVI one thousand, three hundred six +MCCCVII one thousand, three hundred seven +MCCCVIII one thousand, three hundred eight +MCCCIX one thousand, three hundred nine +MCCCX one thousand, three hundred ten +MCCCXI one thousand, three hundred eleven +MCCCXII one thousand, three hundred twelve +MCCCXIII one thousand, three hundred thirteen +MCCCXIV one thousand, three hundred fourteen +MCCCXV one thousand, three hundred fifteen +MCCCXVI one thousand, three hundred sixteen +MCCCXVII one thousand, three hundred seventeen +MCCCXVIII one thousand, three hundred eighteen +MCCCXIX one thousand, three hundred nineteen +MCCCXX one thousand, three hundred twenty +MCCCXXI one thousand, three hundred twenty one +MCCCXXII one thousand, three hundred twenty two +MCCCXXIII one thousand, three hundred twenty three +MCCCXXIV one thousand, three hundred twenty four +MCCCXXV one thousand, three hundred twenty five +MCCCXXVI one thousand, three hundred twenty six +MCCCXXVII one thousand, three hundred twenty seven +MCCCXXVIII one thousand, three hundred twenty eight +MCCCXXIX one thousand, three hundred twenty nine +MCCCXXX one thousand, three hundred thirty +MCCCXXXI one thousand, three hundred thirty one +MCCCXXXII one thousand, three hundred thirty two +MCCCXXXIII one thousand, three hundred thirty three +MCCCXXXIV one thousand, three hundred thirty four +MCCCXXXV one thousand, three hundred thirty five +MCCCXXXVI one thousand, three hundred thirty six +MCCCXXXVII one thousand, three hundred thirty seven +MCCCXXXVIII one thousand, three hundred thirty eight +MCCCXXXIX one thousand, three hundred thirty nine +MCCCXL one thousand, three hundred forty +MCCCXLI one thousand, three hundred forty one +MCCCXLII one thousand, three hundred forty two +MCCCXLIII one thousand, three hundred forty three +MCCCXLIV one thousand, three hundred forty four +MCCCXLV one thousand, three hundred forty five +MCCCXLVI one thousand, three hundred forty six +MCCCXLVII one thousand, three hundred forty seven +MCCCXLVIII one thousand, three hundred forty eight +MCCCXLIX one thousand, three hundred forty nine +MCCCL one thousand, three hundred fifty +MCCCLI one thousand, three hundred fifty one +MCCCLII one thousand, three hundred fifty two +MCCCLIII one thousand, three hundred fifty three +MCCCLIV one thousand, three hundred fifty four +MCCCLV one thousand, three hundred fifty five +MCCCLVI one thousand, three hundred fifty six +MCCCLVII one thousand, three hundred fifty seven +MCCCLVIII one thousand, three hundred fifty eight +MCCCLIX one thousand, three hundred fifty nine +MCCCLX one thousand, three hundred sixty +MCCCLXI one thousand, three hundred sixty one +MCCCLXII one thousand, three hundred sixty two +MCCCLXIII one thousand, three hundred sixty three +MCCCLXIV one thousand, three hundred sixty four +MCCCLXV one thousand, three hundred sixty five +MCCCLXVI one thousand, three hundred sixty six +MCCCLXVII one thousand, three hundred sixty seven +MCCCLXVIII one thousand, three hundred sixty eight +MCCCLXIX one thousand, three hundred sixty nine +MCCCLXX one thousand, three hundred seventy +MCCCLXXI one thousand, three hundred seventy one +MCCCLXXII one thousand, three hundred seventy two +MCCCLXXIII one thousand, three hundred seventy three +MCCCLXXIV one thousand, three hundred seventy four +MCCCLXXV one thousand, three hundred seventy five +MCCCLXXVI one thousand, three hundred seventy six +MCCCLXXVII one thousand, three hundred seventy seven +MCCCLXXVIII one thousand, three hundred seventy eight +MCCCLXXIX one thousand, three hundred seventy nine +MCCCLXXX one thousand, three hundred eighty +MCCCLXXXI one thousand, three hundred eighty one +MCCCLXXXII one thousand, three hundred eighty two +MCCCLXXXIII one thousand, three hundred eighty three +MCCCLXXXIV one thousand, three hundred eighty four +MCCCLXXXV one thousand, three hundred eighty five +MCCCLXXXVI one thousand, three hundred eighty six +MCCCLXXXVII one thousand, three hundred eighty seven +MCCCLXXXVIII one thousand, three hundred eighty eight +MCCCLXXXIX one thousand, three hundred eighty nine +MCCCXC one thousand, three hundred ninety +MCCCXCI one thousand, three hundred ninety one +MCCCXCII one thousand, three hundred ninety two +MCCCXCIII one thousand, three hundred ninety three +MCCCXCIV one thousand, three hundred ninety four +MCCCXCV one thousand, three hundred ninety five +MCCCXCVI one thousand, three hundred ninety six +MCCCXCVII one thousand, three hundred ninety seven +MCCCXCVIII one thousand, three hundred ninety eight +MCCCXCIX one thousand, three hundred ninety nine +MCD one thousand, four hundred +MCDI one thousand, four hundred one +MCDII one thousand, four hundred two +MCDIII one thousand, four hundred three +MCDIV one thousand, four hundred four +MCDV one thousand, four hundred five +MCDVI one thousand, four hundred six +MCDVII one thousand, four hundred seven +MCDVIII one thousand, four hundred eight +MCDIX one thousand, four hundred nine +MCDX one thousand, four hundred ten +MCDXI one thousand, four hundred eleven +MCDXII one thousand, four hundred twelve +MCDXIII one thousand, four hundred thirteen +MCDXIV one thousand, four hundred fourteen +MCDXV one thousand, four hundred fifteen +MCDXVI one thousand, four hundred sixteen +MCDXVII one thousand, four hundred seventeen +MCDXVIII one thousand, four hundred eighteen +MCDXIX one thousand, four hundred nineteen +MCDXX one thousand, four hundred twenty +MCDXXI one thousand, four hundred twenty one +MCDXXII one thousand, four hundred twenty two +MCDXXIII one thousand, four hundred twenty three +MCDXXIV one thousand, four hundred twenty four +MCDXXV one thousand, four hundred twenty five +MCDXXVI one thousand, four hundred twenty six +MCDXXVII one thousand, four hundred twenty seven +MCDXXVIII one thousand, four hundred twenty eight +MCDXXIX one thousand, four hundred twenty nine +MCDXXX one thousand, four hundred thirty +MCDXXXI one thousand, four hundred thirty one +MCDXXXII one thousand, four hundred thirty two +MCDXXXIII one thousand, four hundred thirty three +MCDXXXIV one thousand, four hundred thirty four +MCDXXXV one thousand, four hundred thirty five +MCDXXXVI one thousand, four hundred thirty six +MCDXXXVII one thousand, four hundred thirty seven +MCDXXXVIII one thousand, four hundred thirty eight +MCDXXXIX one thousand, four hundred thirty nine +MCDXL one thousand, four hundred forty +MCDXLI one thousand, four hundred forty one +MCDXLII one thousand, four hundred forty two +MCDXLIII one thousand, four hundred forty three +MCDXLIV one thousand, four hundred forty four +MCDXLV one thousand, four hundred forty five +MCDXLVI one thousand, four hundred forty six +MCDXLVII one thousand, four hundred forty seven +MCDXLVIII one thousand, four hundred forty eight +MCDXLIX one thousand, four hundred forty nine +MCDL one thousand, four hundred fifty +MCDLI one thousand, four hundred fifty one +MCDLII one thousand, four hundred fifty two +MCDLIII one thousand, four hundred fifty three +MCDLIV one thousand, four hundred fifty four +MCDLV one thousand, four hundred fifty five +MCDLVI one thousand, four hundred fifty six +MCDLVII one thousand, four hundred fifty seven +MCDLVIII one thousand, four hundred fifty eight +MCDLIX one thousand, four hundred fifty nine +MCDLX one thousand, four hundred sixty +MCDLXI one thousand, four hundred sixty one +MCDLXII one thousand, four hundred sixty two +MCDLXIII one thousand, four hundred sixty three +MCDLXIV one thousand, four hundred sixty four +MCDLXV one thousand, four hundred sixty five +MCDLXVI one thousand, four hundred sixty six +MCDLXVII one thousand, four hundred sixty seven +MCDLXVIII one thousand, four hundred sixty eight +MCDLXIX one thousand, four hundred sixty nine +MCDLXX one thousand, four hundred seventy +MCDLXXI one thousand, four hundred seventy one +MCDLXXII one thousand, four hundred seventy two +MCDLXXIII one thousand, four hundred seventy three +MCDLXXIV one thousand, four hundred seventy four +MCDLXXV one thousand, four hundred seventy five +MCDLXXVI one thousand, four hundred seventy six +MCDLXXVII one thousand, four hundred seventy seven +MCDLXXVIII one thousand, four hundred seventy eight +MCDLXXIX one thousand, four hundred seventy nine +MCDLXXX one thousand, four hundred eighty +MCDLXXXI one thousand, four hundred eighty one +MCDLXXXII one thousand, four hundred eighty two +MCDLXXXIII one thousand, four hundred eighty three +MCDLXXXIV one thousand, four hundred eighty four +MCDLXXXV one thousand, four hundred eighty five +MCDLXXXVI one thousand, four hundred eighty six +MCDLXXXVII one thousand, four hundred eighty seven +MCDLXXXVIII one thousand, four hundred eighty eight +MCDLXXXIX one thousand, four hundred eighty nine +MCDXC one thousand, four hundred ninety +MCDXCI one thousand, four hundred ninety one +MCDXCII one thousand, four hundred ninety two +MCDXCIII one thousand, four hundred ninety three +MCDXCIV one thousand, four hundred ninety four +MCDXCV one thousand, four hundred ninety five +MCDXCVI one thousand, four hundred ninety six +MCDXCVII one thousand, four hundred ninety seven +MCDXCVIII one thousand, four hundred ninety eight +MCDXCIX one thousand, four hundred ninety nine +MD one thousand, five hundred +MDI one thousand, five hundred one +MDII one thousand, five hundred two +MDIII one thousand, five hundred three +MDIV one thousand, five hundred four +MDV one thousand, five hundred five +MDVI one thousand, five hundred six +MDVII one thousand, five hundred seven +MDVIII one thousand, five hundred eight +MDIX one thousand, five hundred nine +MDX one thousand, five hundred ten +MDXI one thousand, five hundred eleven +MDXII one thousand, five hundred twelve +MDXIII one thousand, five hundred thirteen +MDXIV one thousand, five hundred fourteen +MDXV one thousand, five hundred fifteen +MDXVI one thousand, five hundred sixteen +MDXVII one thousand, five hundred seventeen +MDXVIII one thousand, five hundred eighteen +MDXIX one thousand, five hundred nineteen +MDXX one thousand, five hundred twenty +MDXXI one thousand, five hundred twenty one +MDXXII one thousand, five hundred twenty two +MDXXIII one thousand, five hundred twenty three +MDXXIV one thousand, five hundred twenty four +MDXXV one thousand, five hundred twenty five +MDXXVI one thousand, five hundred twenty six +MDXXVII one thousand, five hundred twenty seven +MDXXVIII one thousand, five hundred twenty eight +MDXXIX one thousand, five hundred twenty nine +MDXXX one thousand, five hundred thirty +MDXXXI one thousand, five hundred thirty one +MDXXXII one thousand, five hundred thirty two +MDXXXIII one thousand, five hundred thirty three +MDXXXIV one thousand, five hundred thirty four +MDXXXV one thousand, five hundred thirty five +MDXXXVI one thousand, five hundred thirty six +MDXXXVII one thousand, five hundred thirty seven +MDXXXVIII one thousand, five hundred thirty eight +MDXXXIX one thousand, five hundred thirty nine +MDXL one thousand, five hundred forty +MDXLI one thousand, five hundred forty one +MDXLII one thousand, five hundred forty two +MDXLIII one thousand, five hundred forty three +MDXLIV one thousand, five hundred forty four +MDXLV one thousand, five hundred forty five +MDXLVI one thousand, five hundred forty six +MDXLVII one thousand, five hundred forty seven +MDXLVIII one thousand, five hundred forty eight +MDXLIX one thousand, five hundred forty nine +MDL one thousand, five hundred fifty +MDLI one thousand, five hundred fifty one +MDLII one thousand, five hundred fifty two +MDLIII one thousand, five hundred fifty three +MDLIV one thousand, five hundred fifty four +MDLV one thousand, five hundred fifty five +MDLVI one thousand, five hundred fifty six +MDLVII one thousand, five hundred fifty seven +MDLVIII one thousand, five hundred fifty eight +MDLIX one thousand, five hundred fifty nine +MDLX one thousand, five hundred sixty +MDLXI one thousand, five hundred sixty one +MDLXII one thousand, five hundred sixty two +MDLXIII one thousand, five hundred sixty three +MDLXIV one thousand, five hundred sixty four +MDLXV one thousand, five hundred sixty five +MDLXVI one thousand, five hundred sixty six +MDLXVII one thousand, five hundred sixty seven +MDLXVIII one thousand, five hundred sixty eight +MDLXIX one thousand, five hundred sixty nine +MDLXX one thousand, five hundred seventy +MDLXXI one thousand, five hundred seventy one +MDLXXII one thousand, five hundred seventy two +MDLXXIII one thousand, five hundred seventy three +MDLXXIV one thousand, five hundred seventy four +MDLXXV one thousand, five hundred seventy five +MDLXXVI one thousand, five hundred seventy six +MDLXXVII one thousand, five hundred seventy seven +MDLXXVIII one thousand, five hundred seventy eight +MDLXXIX one thousand, five hundred seventy nine +MDLXXX one thousand, five hundred eighty +MDLXXXI one thousand, five hundred eighty one +MDLXXXII one thousand, five hundred eighty two +MDLXXXIII one thousand, five hundred eighty three +MDLXXXIV one thousand, five hundred eighty four +MDLXXXV one thousand, five hundred eighty five +MDLXXXVI one thousand, five hundred eighty six +MDLXXXVII one thousand, five hundred eighty seven +MDLXXXVIII one thousand, five hundred eighty eight +MDLXXXIX one thousand, five hundred eighty nine +MDXC one thousand, five hundred ninety +MDXCI one thousand, five hundred ninety one +MDXCII one thousand, five hundred ninety two +MDXCIII one thousand, five hundred ninety three +MDXCIV one thousand, five hundred ninety four +MDXCV one thousand, five hundred ninety five +MDXCVI one thousand, five hundred ninety six +MDXCVII one thousand, five hundred ninety seven +MDXCVIII one thousand, five hundred ninety eight +MDXCIX one thousand, five hundred ninety nine +MDC one thousand, six hundred +MDCI one thousand, six hundred one +MDCII one thousand, six hundred two +MDCIII one thousand, six hundred three +MDCIV one thousand, six hundred four +MDCV one thousand, six hundred five +MDCVI one thousand, six hundred six +MDCVII one thousand, six hundred seven +MDCVIII one thousand, six hundred eight +MDCIX one thousand, six hundred nine +MDCX one thousand, six hundred ten +MDCXI one thousand, six hundred eleven +MDCXII one thousand, six hundred twelve +MDCXIII one thousand, six hundred thirteen +MDCXIV one thousand, six hundred fourteen +MDCXV one thousand, six hundred fifteen +MDCXVI one thousand, six hundred sixteen +MDCXVII one thousand, six hundred seventeen +MDCXVIII one thousand, six hundred eighteen +MDCXIX one thousand, six hundred nineteen +MDCXX one thousand, six hundred twenty +MDCXXI one thousand, six hundred twenty one +MDCXXII one thousand, six hundred twenty two +MDCXXIII one thousand, six hundred twenty three +MDCXXIV one thousand, six hundred twenty four +MDCXXV one thousand, six hundred twenty five +MDCXXVI one thousand, six hundred twenty six +MDCXXVII one thousand, six hundred twenty seven +MDCXXVIII one thousand, six hundred twenty eight +MDCXXIX one thousand, six hundred twenty nine +MDCXXX one thousand, six hundred thirty +MDCXXXI one thousand, six hundred thirty one +MDCXXXII one thousand, six hundred thirty two +MDCXXXIII one thousand, six hundred thirty three +MDCXXXIV one thousand, six hundred thirty four +MDCXXXV one thousand, six hundred thirty five +MDCXXXVI one thousand, six hundred thirty six +MDCXXXVII one thousand, six hundred thirty seven +MDCXXXVIII one thousand, six hundred thirty eight +MDCXXXIX one thousand, six hundred thirty nine +MDCXL one thousand, six hundred forty +MDCXLI one thousand, six hundred forty one +MDCXLII one thousand, six hundred forty two +MDCXLIII one thousand, six hundred forty three +MDCXLIV one thousand, six hundred forty four +MDCXLV one thousand, six hundred forty five +MDCXLVI one thousand, six hundred forty six +MDCXLVII one thousand, six hundred forty seven +MDCXLVIII one thousand, six hundred forty eight +MDCXLIX one thousand, six hundred forty nine +MDCL one thousand, six hundred fifty +MDCLI one thousand, six hundred fifty one +MDCLII one thousand, six hundred fifty two +MDCLIII one thousand, six hundred fifty three +MDCLIV one thousand, six hundred fifty four +MDCLV one thousand, six hundred fifty five +MDCLVI one thousand, six hundred fifty six +MDCLVII one thousand, six hundred fifty seven +MDCLVIII one thousand, six hundred fifty eight +MDCLIX one thousand, six hundred fifty nine +MDCLX one thousand, six hundred sixty +MDCLXI one thousand, six hundred sixty one +MDCLXII one thousand, six hundred sixty two +MDCLXIII one thousand, six hundred sixty three +MDCLXIV one thousand, six hundred sixty four +MDCLXV one thousand, six hundred sixty five +MDCLXVI one thousand, six hundred sixty six +MDCLXVII one thousand, six hundred sixty seven +MDCLXVIII one thousand, six hundred sixty eight +MDCLXIX one thousand, six hundred sixty nine +MDCLXX one thousand, six hundred seventy +MDCLXXI one thousand, six hundred seventy one +MDCLXXII one thousand, six hundred seventy two +MDCLXXIII one thousand, six hundred seventy three +MDCLXXIV one thousand, six hundred seventy four +MDCLXXV one thousand, six hundred seventy five +MDCLXXVI one thousand, six hundred seventy six +MDCLXXVII one thousand, six hundred seventy seven +MDCLXXVIII one thousand, six hundred seventy eight +MDCLXXIX one thousand, six hundred seventy nine +MDCLXXX one thousand, six hundred eighty +MDCLXXXI one thousand, six hundred eighty one +MDCLXXXII one thousand, six hundred eighty two +MDCLXXXIII one thousand, six hundred eighty three +MDCLXXXIV one thousand, six hundred eighty four +MDCLXXXV one thousand, six hundred eighty five +MDCLXXXVI one thousand, six hundred eighty six +MDCLXXXVII one thousand, six hundred eighty seven +MDCLXXXVIII one thousand, six hundred eighty eight +MDCLXXXIX one thousand, six hundred eighty nine +MDCXC one thousand, six hundred ninety +MDCXCI one thousand, six hundred ninety one +MDCXCII one thousand, six hundred ninety two +MDCXCIII one thousand, six hundred ninety three +MDCXCIV one thousand, six hundred ninety four +MDCXCV one thousand, six hundred ninety five +MDCXCVI one thousand, six hundred ninety six +MDCXCVII one thousand, six hundred ninety seven +MDCXCVIII one thousand, six hundred ninety eight +MDCXCIX one thousand, six hundred ninety nine +MDCC one thousand, seven hundred +MDCCI one thousand, seven hundred one +MDCCII one thousand, seven hundred two +MDCCIII one thousand, seven hundred three +MDCCIV one thousand, seven hundred four +MDCCV one thousand, seven hundred five +MDCCVI one thousand, seven hundred six +MDCCVII one thousand, seven hundred seven +MDCCVIII one thousand, seven hundred eight +MDCCIX one thousand, seven hundred nine +MDCCX one thousand, seven hundred ten +MDCCXI one thousand, seven hundred eleven +MDCCXII one thousand, seven hundred twelve +MDCCXIII one thousand, seven hundred thirteen +MDCCXIV one thousand, seven hundred fourteen +MDCCXV one thousand, seven hundred fifteen +MDCCXVI one thousand, seven hundred sixteen +MDCCXVII one thousand, seven hundred seventeen +MDCCXVIII one thousand, seven hundred eighteen +MDCCXIX one thousand, seven hundred nineteen +MDCCXX one thousand, seven hundred twenty +MDCCXXI one thousand, seven hundred twenty one +MDCCXXII one thousand, seven hundred twenty two +MDCCXXIII one thousand, seven hundred twenty three +MDCCXXIV one thousand, seven hundred twenty four +MDCCXXV one thousand, seven hundred twenty five +MDCCXXVI one thousand, seven hundred twenty six +MDCCXXVII one thousand, seven hundred twenty seven +MDCCXXVIII one thousand, seven hundred twenty eight +MDCCXXIX one thousand, seven hundred twenty nine +MDCCXXX one thousand, seven hundred thirty +MDCCXXXI one thousand, seven hundred thirty one +MDCCXXXII one thousand, seven hundred thirty two +MDCCXXXIII one thousand, seven hundred thirty three +MDCCXXXIV one thousand, seven hundred thirty four +MDCCXXXV one thousand, seven hundred thirty five +MDCCXXXVI one thousand, seven hundred thirty six +MDCCXXXVII one thousand, seven hundred thirty seven +MDCCXXXVIII one thousand, seven hundred thirty eight +MDCCXXXIX one thousand, seven hundred thirty nine +MDCCXL one thousand, seven hundred forty +MDCCXLI one thousand, seven hundred forty one +MDCCXLII one thousand, seven hundred forty two +MDCCXLIII one thousand, seven hundred forty three +MDCCXLIV one thousand, seven hundred forty four +MDCCXLV one thousand, seven hundred forty five +MDCCXLVI one thousand, seven hundred forty six +MDCCXLVII one thousand, seven hundred forty seven +MDCCXLVIII one thousand, seven hundred forty eight +MDCCXLIX one thousand, seven hundred forty nine +MDCCL one thousand, seven hundred fifty +MDCCLI one thousand, seven hundred fifty one +MDCCLII one thousand, seven hundred fifty two +MDCCLIII one thousand, seven hundred fifty three +MDCCLIV one thousand, seven hundred fifty four +MDCCLV one thousand, seven hundred fifty five +MDCCLVI one thousand, seven hundred fifty six +MDCCLVII one thousand, seven hundred fifty seven +MDCCLVIII one thousand, seven hundred fifty eight +MDCCLIX one thousand, seven hundred fifty nine +MDCCLX one thousand, seven hundred sixty +MDCCLXI one thousand, seven hundred sixty one +MDCCLXII one thousand, seven hundred sixty two +MDCCLXIII one thousand, seven hundred sixty three +MDCCLXIV one thousand, seven hundred sixty four +MDCCLXV one thousand, seven hundred sixty five +MDCCLXVI one thousand, seven hundred sixty six +MDCCLXVII one thousand, seven hundred sixty seven +MDCCLXVIII one thousand, seven hundred sixty eight +MDCCLXIX one thousand, seven hundred sixty nine +MDCCLXX one thousand, seven hundred seventy +MDCCLXXI one thousand, seven hundred seventy one +MDCCLXXII one thousand, seven hundred seventy two +MDCCLXXIII one thousand, seven hundred seventy three +MDCCLXXIV one thousand, seven hundred seventy four +MDCCLXXV one thousand, seven hundred seventy five +MDCCLXXVI one thousand, seven hundred seventy six +MDCCLXXVII one thousand, seven hundred seventy seven +MDCCLXXVIII one thousand, seven hundred seventy eight +MDCCLXXIX one thousand, seven hundred seventy nine +MDCCLXXX one thousand, seven hundred eighty +MDCCLXXXI one thousand, seven hundred eighty one +MDCCLXXXII one thousand, seven hundred eighty two +MDCCLXXXIII one thousand, seven hundred eighty three +MDCCLXXXIV one thousand, seven hundred eighty four +MDCCLXXXV one thousand, seven hundred eighty five +MDCCLXXXVI one thousand, seven hundred eighty six +MDCCLXXXVII one thousand, seven hundred eighty seven +MDCCLXXXVIII one thousand, seven hundred eighty eight +MDCCLXXXIX one thousand, seven hundred eighty nine +MDCCXC one thousand, seven hundred ninety +MDCCXCI one thousand, seven hundred ninety one +MDCCXCII one thousand, seven hundred ninety two +MDCCXCIII one thousand, seven hundred ninety three +MDCCXCIV one thousand, seven hundred ninety four +MDCCXCV one thousand, seven hundred ninety five +MDCCXCVI one thousand, seven hundred ninety six +MDCCXCVII one thousand, seven hundred ninety seven +MDCCXCVIII one thousand, seven hundred ninety eight +MDCCXCIX one thousand, seven hundred ninety nine +MDCCC one thousand, eight hundred +MDCCCI one thousand, eight hundred one +MDCCCII one thousand, eight hundred two +MDCCCIII one thousand, eight hundred three +MDCCCIV one thousand, eight hundred four +MDCCCV one thousand, eight hundred five +MDCCCVI one thousand, eight hundred six +MDCCCVII one thousand, eight hundred seven +MDCCCVIII one thousand, eight hundred eight +MDCCCIX one thousand, eight hundred nine +MDCCCX one thousand, eight hundred ten +MDCCCXI one thousand, eight hundred eleven +MDCCCXII one thousand, eight hundred twelve +MDCCCXIII one thousand, eight hundred thirteen +MDCCCXIV one thousand, eight hundred fourteen +MDCCCXV one thousand, eight hundred fifteen +MDCCCXVI one thousand, eight hundred sixteen +MDCCCXVII one thousand, eight hundred seventeen +MDCCCXVIII one thousand, eight hundred eighteen +MDCCCXIX one thousand, eight hundred nineteen +MDCCCXX one thousand, eight hundred twenty +MDCCCXXI one thousand, eight hundred twenty one +MDCCCXXII one thousand, eight hundred twenty two +MDCCCXXIII one thousand, eight hundred twenty three +MDCCCXXIV one thousand, eight hundred twenty four +MDCCCXXV one thousand, eight hundred twenty five +MDCCCXXVI one thousand, eight hundred twenty six +MDCCCXXVII one thousand, eight hundred twenty seven +MDCCCXXVIII one thousand, eight hundred twenty eight +MDCCCXXIX one thousand, eight hundred twenty nine +MDCCCXXX one thousand, eight hundred thirty +MDCCCXXXI one thousand, eight hundred thirty one +MDCCCXXXII one thousand, eight hundred thirty two +MDCCCXXXIII one thousand, eight hundred thirty three +MDCCCXXXIV one thousand, eight hundred thirty four +MDCCCXXXV one thousand, eight hundred thirty five +MDCCCXXXVI one thousand, eight hundred thirty six +MDCCCXXXVII one thousand, eight hundred thirty seven +MDCCCXXXVIII one thousand, eight hundred thirty eight +MDCCCXXXIX one thousand, eight hundred thirty nine +MDCCCXL one thousand, eight hundred forty +MDCCCXLI one thousand, eight hundred forty one +MDCCCXLII one thousand, eight hundred forty two +MDCCCXLIII one thousand, eight hundred forty three +MDCCCXLIV one thousand, eight hundred forty four +MDCCCXLV one thousand, eight hundred forty five +MDCCCXLVI one thousand, eight hundred forty six +MDCCCXLVII one thousand, eight hundred forty seven +MDCCCXLVIII one thousand, eight hundred forty eight +MDCCCXLIX one thousand, eight hundred forty nine +MDCCCL one thousand, eight hundred fifty +MDCCCLI one thousand, eight hundred fifty one +MDCCCLII one thousand, eight hundred fifty two +MDCCCLIII one thousand, eight hundred fifty three +MDCCCLIV one thousand, eight hundred fifty four +MDCCCLV one thousand, eight hundred fifty five +MDCCCLVI one thousand, eight hundred fifty six +MDCCCLVII one thousand, eight hundred fifty seven +MDCCCLVIII one thousand, eight hundred fifty eight +MDCCCLIX one thousand, eight hundred fifty nine +MDCCCLX one thousand, eight hundred sixty +MDCCCLXI one thousand, eight hundred sixty one +MDCCCLXII one thousand, eight hundred sixty two +MDCCCLXIII one thousand, eight hundred sixty three +MDCCCLXIV one thousand, eight hundred sixty four +MDCCCLXV one thousand, eight hundred sixty five +MDCCCLXVI one thousand, eight hundred sixty six +MDCCCLXVII one thousand, eight hundred sixty seven +MDCCCLXVIII one thousand, eight hundred sixty eight +MDCCCLXIX one thousand, eight hundred sixty nine +MDCCCLXX one thousand, eight hundred seventy +MDCCCLXXI one thousand, eight hundred seventy one +MDCCCLXXII one thousand, eight hundred seventy two +MDCCCLXXIII one thousand, eight hundred seventy three +MDCCCLXXIV one thousand, eight hundred seventy four +MDCCCLXXV one thousand, eight hundred seventy five +MDCCCLXXVI one thousand, eight hundred seventy six +MDCCCLXXVII one thousand, eight hundred seventy seven +MDCCCLXXVIII one thousand, eight hundred seventy eight +MDCCCLXXIX one thousand, eight hundred seventy nine +MDCCCLXXX one thousand, eight hundred eighty +MDCCCLXXXI one thousand, eight hundred eighty one +MDCCCLXXXII one thousand, eight hundred eighty two +MDCCCLXXXIII one thousand, eight hundred eighty three +MDCCCLXXXIV one thousand, eight hundred eighty four +MDCCCLXXXV one thousand, eight hundred eighty five +MDCCCLXXXVI one thousand, eight hundred eighty six +MDCCCLXXXVII one thousand, eight hundred eighty seven +MDCCCLXXXVIII one thousand, eight hundred eighty eight +MDCCCLXXXIX one thousand, eight hundred eighty nine +MDCCCXC one thousand, eight hundred ninety +MDCCCXCI one thousand, eight hundred ninety one +MDCCCXCII one thousand, eight hundred ninety two +MDCCCXCIII one thousand, eight hundred ninety three +MDCCCXCIV one thousand, eight hundred ninety four +MDCCCXCV one thousand, eight hundred ninety five +MDCCCXCVI one thousand, eight hundred ninety six +MDCCCXCVII one thousand, eight hundred ninety seven +MDCCCXCVIII one thousand, eight hundred ninety eight +MDCCCXCIX one thousand, eight hundred ninety nine +MCM one thousand, nine hundred +MCMI one thousand, nine hundred one +MCMII one thousand, nine hundred two +MCMIII one thousand, nine hundred three +MCMIV one thousand, nine hundred four +MCMV one thousand, nine hundred five +MCMVI one thousand, nine hundred six +MCMVII one thousand, nine hundred seven +MCMVIII one thousand, nine hundred eight +MCMIX one thousand, nine hundred nine +MCMX one thousand, nine hundred ten +MCMXI one thousand, nine hundred eleven +MCMXII one thousand, nine hundred twelve +MCMXIII one thousand, nine hundred thirteen +MCMXIV one thousand, nine hundred fourteen +MCMXV one thousand, nine hundred fifteen +MCMXVI one thousand, nine hundred sixteen +MCMXVII one thousand, nine hundred seventeen +MCMXVIII one thousand, nine hundred eighteen +MCMXIX one thousand, nine hundred nineteen +MCMXX one thousand, nine hundred twenty +MCMXXI one thousand, nine hundred twenty one +MCMXXII one thousand, nine hundred twenty two +MCMXXIII one thousand, nine hundred twenty three +MCMXXIV one thousand, nine hundred twenty four +MCMXXV one thousand, nine hundred twenty five +MCMXXVI one thousand, nine hundred twenty six +MCMXXVII one thousand, nine hundred twenty seven +MCMXXVIII one thousand, nine hundred twenty eight +MCMXXIX one thousand, nine hundred twenty nine +MCMXXX one thousand, nine hundred thirty +MCMXXXI one thousand, nine hundred thirty one +MCMXXXII one thousand, nine hundred thirty two +MCMXXXIII one thousand, nine hundred thirty three +MCMXXXIV one thousand, nine hundred thirty four +MCMXXXV one thousand, nine hundred thirty five +MCMXXXVI one thousand, nine hundred thirty six +MCMXXXVII one thousand, nine hundred thirty seven +MCMXXXVIII one thousand, nine hundred thirty eight +MCMXXXIX one thousand, nine hundred thirty nine +MCMXL one thousand, nine hundred forty +MCMXLI one thousand, nine hundred forty one +MCMXLII one thousand, nine hundred forty two +MCMXLIII one thousand, nine hundred forty three +MCMXLIV one thousand, nine hundred forty four +MCMXLV one thousand, nine hundred forty five +MCMXLVI one thousand, nine hundred forty six +MCMXLVII one thousand, nine hundred forty seven +MCMXLVIII one thousand, nine hundred forty eight +MCMXLIX one thousand, nine hundred forty nine +MCML one thousand, nine hundred fifty +MCMLI one thousand, nine hundred fifty one +MCMLII one thousand, nine hundred fifty two +MCMLIII one thousand, nine hundred fifty three +MCMLIV one thousand, nine hundred fifty four +MCMLV one thousand, nine hundred fifty five +MCMLVI one thousand, nine hundred fifty six +MCMLVII one thousand, nine hundred fifty seven +MCMLVIII one thousand, nine hundred fifty eight +MCMLIX one thousand, nine hundred fifty nine +MCMLX one thousand, nine hundred sixty +MCMLXI one thousand, nine hundred sixty one +MCMLXII one thousand, nine hundred sixty two +MCMLXIII one thousand, nine hundred sixty three +MCMLXIV one thousand, nine hundred sixty four +MCMLXV one thousand, nine hundred sixty five +MCMLXVI one thousand, nine hundred sixty six +MCMLXVII one thousand, nine hundred sixty seven +MCMLXVIII one thousand, nine hundred sixty eight +MCMLXIX one thousand, nine hundred sixty nine +MCMLXX one thousand, nine hundred seventy +MCMLXXI one thousand, nine hundred seventy one +MCMLXXII one thousand, nine hundred seventy two +MCMLXXIII one thousand, nine hundred seventy three +MCMLXXIV one thousand, nine hundred seventy four +MCMLXXV one thousand, nine hundred seventy five +MCMLXXVI one thousand, nine hundred seventy six +MCMLXXVII one thousand, nine hundred seventy seven +MCMLXXVIII one thousand, nine hundred seventy eight +MCMLXXIX one thousand, nine hundred seventy nine +MCMLXXX one thousand, nine hundred eighty +MCMLXXXI one thousand, nine hundred eighty one +MCMLXXXII one thousand, nine hundred eighty two +MCMLXXXIII one thousand, nine hundred eighty three +MCMLXXXIV one thousand, nine hundred eighty four +MCMLXXXV one thousand, nine hundred eighty five +MCMLXXXVI one thousand, nine hundred eighty six +MCMLXXXVII one thousand, nine hundred eighty seven +MCMLXXXVIII one thousand, nine hundred eighty eight +MCMLXXXIX one thousand, nine hundred eighty nine +MCMXC one thousand, nine hundred ninety +MCMXCI one thousand, nine hundred ninety one +MCMXCII one thousand, nine hundred ninety two +MCMXCIII one thousand, nine hundred ninety three +MCMXCIV one thousand, nine hundred ninety four +MCMXCV one thousand, nine hundred ninety five +MCMXCVI one thousand, nine hundred ninety six +MCMXCVII one thousand, nine hundred ninety seven +MCMXCVIII one thousand, nine hundred ninety eight +MCMXCIX one thousand, nine hundred ninety nine +MM two thousand diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/data/suppletive.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/suppletive.tsv new file mode 100644 index 0000000000000000000000000000000000000000..4718e27bd13433c5376acc1fcf509bfa64edc42d --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/suppletive.tsv @@ -0,0 +1,112 @@ +deer +fish +sheep +foot feet +goose geese +man men +mouse mice +tooth teeth +woman women +won +child children +ox oxen +wife wives +wolf wolves +analysis analyses +criterion criteria +lbs +focus foci +percent +hertz +kroner krone +inch inches +calory calories +yen +megahertz +gigahertz +kilohertz +hertz +CC +c c +horsepower +hundredweight +kilogram force kilograms force +mega siemens +revolution per minute revolutions per minute +mile per hour miles per hour +megabit per second megabits per second +square foot square feet +centimeter per second centimeters per second +meter per second meters per second +kilometer per second kilometers per second +meter per hour meters per hour +bit per second bits per second +kilometer per hour kilometers per hour +kilobit per second kilobits per second +kilo bit per second kilo bits per second +megabit per second megabits per second +mega bit per second mega bits per second +gigabit per second gigabits per second +giga bit per second giga bits per second +terabit per second terabits per second +tera bit per second tera bits per second +petabit per second petabits per second +peta bit per second peta bits per second +byte per second bytes per second +kilobyte per second kilobytes per second +kilo byte per second kilo bytes per second +megabyte per second megabytes per second +mega byte per second mega bytes per second +gigabyte per second gigabytes per second +giga byte per second giga bytes per second +terabyte per second terabytes per second +tera byte per second tera bytes per second +petabyte per second petabytes per second +peta byte per second peta bytes per second +degree Celsius degrees Celsius +degree Fahrenheit degrees Fahrenheit +degree celsius degrees celsius +degree fahrenheit degrees fahrenheit +kelvin kelvin +ATM +AU +BQ +CC +CD +DA +EB +EV +F +GB +G +GL +GPA +GY +HA +H +HL +GP +HS +KB +KL +KN +KT +KV +LM +MA +MA +MB +MC +MF +M +MM +MS +MV +MW +PB +PG +PS +S +TB +YB +ZB diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/data/telephone/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/telephone/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..a1cf281f0908d225f51d921e9ddbdf92f9b14d99 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/telephone/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/data/telephone/ip_prompt.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/telephone/ip_prompt.tsv new file mode 100644 index 0000000000000000000000000000000000000000..03e2529895d9abd2ece193be4bd354497bd82d68 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/telephone/ip_prompt.tsv @@ -0,0 +1,2 @@ +IP address is +IP is \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/data/telephone/ssn_prompt.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/telephone/ssn_prompt.tsv new file mode 100644 index 0000000000000000000000000000000000000000..8bbdb9f752f7739c24b8dcaa075d50454423adad --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/telephone/ssn_prompt.tsv @@ -0,0 +1,4 @@ +ssn is SSN is +ssn is SSN is +SSN is +SSN \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/data/telephone/telephone_prompt.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/telephone/telephone_prompt.tsv new file mode 100644 index 0000000000000000000000000000000000000000..6dcfb6cad223f69c6763a53fb745c21a089c340c --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/telephone/telephone_prompt.tsv @@ -0,0 +1,5 @@ +call me at +reach at +reached at +my number is +hit me up at \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/data/time/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/time/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..bc443be41c4c3fcf0764eb9fd3e1828d63f8438c --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/time/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/data/time/suffix.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/time/suffix.tsv new file mode 100644 index 0000000000000000000000000000000000000000..026a6a90ccceac64bdfd8ecff7bfba28298331ea --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/time/suffix.tsv @@ -0,0 +1,12 @@ +p.m. PM +p.m PM +pm PM +P.M. PM +P.M PM +PM PM +a.m. AM +a.m AM +am AM +A.M. AM +A.M AM +AM AM diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/data/time/zone.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/time/zone.tsv new file mode 100644 index 0000000000000000000000000000000000000000..0fda04208c8741d41f7a837b5bc60680b1787229 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/time/zone.tsv @@ -0,0 +1,14 @@ +cst CST +c.s.t CST +cet CET +c.e.t CET +pst PST +p.s.t PST +est EST +e.s.t EST +pt PT +p.t PT +et ET +e.t ET +gmt GMT +g.m.t GMT diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/data/whitelist/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/whitelist/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..bc443be41c4c3fcf0764eb9fd3e1828d63f8438c --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/whitelist/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/data/whitelist/alternatives.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/whitelist/alternatives.tsv new file mode 100644 index 0000000000000000000000000000000000000000..0ee8e2c1d79bf2dd2c16513600e217670821f5b1 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/whitelist/alternatives.tsv @@ -0,0 +1,45 @@ +Hon. Honorable +Mr. Mister +Mrs. Misses +Ms. Miss +Mr Mister +Mrs Misses +Ms Miss +AC air conditioning +AC air conditioner +AC air conditioners +AC alternating current +&Co. and Co. +&Co. and Company +Mon Monday +Tu Tuesday +Wed Wednesday +Th Thursday +Thur Thursday +Thurs Thursday +Fri Friday +Sat Saturday +Sun Sunday +Mon Mon +Tu Tu +Wed Wed +Th Th +Thur Thur +Thurs Thurs +Fri Fri +Sat Sat +Sun Sun += equals +# number +No. number +No number +NO number +NO. number +NO nitrogen monoxide +NO NO +NO. NO. +No. No. +No No +VOL Volume +VOL. Volume +TV Television diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/data/whitelist/alternatives_all_format.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/whitelist/alternatives_all_format.tsv new file mode 100644 index 0000000000000000000000000000000000000000..449195c4f41f0d5fdb13451be58f13ea3eb6cd9b --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/whitelist/alternatives_all_format.tsv @@ -0,0 +1,14 @@ +st street +st saint +dr doctor +dr drive +mt mount +sr senior +prof professor +mt mountain +sr senior +jr junior +vol volume +rd road +ave avenue +approx approximately diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/data/whitelist/asr.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/whitelist/asr.tsv new file mode 100644 index 0000000000000000000000000000000000000000..19577a21ec0d3156304ec94896488e6e9166ea86 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/whitelist/asr.tsv @@ -0,0 +1,14713 @@ +Ph.D. p h d +Hon. honorable +& and +Mt. Mount +Maj. Major +Rev. Reverend +# hash +Gov. governor +vs. versus +vs versus +dept. department +vol volume +vol. volume +bldg. building +Bldg. Building +apt. apartment +Apt. Apartment +Σ sigma +η eta +κ kappa +ω omega +σ sigma +α alpha +ν nu +δ delta +ι iota +_ underscore +% percent +& ampersand +* asterisk ++ plus +/ slash += equal sign +^ circumflex +{ left brace +| vertical bar +} right brace +~ tilde +ltd limited +int'l international +$ dollar +A. A. a a +A.A. a a +A.A.A. a a a +A&A a and a +AAAI a a a i +AAAM a a a m +AAAs a a a's +AAAS a a a s +AAAW a a a w +AABA a a b a +AaB a a b +A. A. B. a a b +AAB a a b +AABC a a b c +Aabo a a b o +AABP a a b p +AABW a a b w +aac a a c +AAC a a c +AACAR a a c a r +AACC a a c c +AACCUP a a c c u p +AACMI a a c m i +AACNo a a c n o +AACR a a c r +AACS a a c s +AACSB a a c s b +AACTA a a c t a +AACUPR a a c u p r +A.A.D. a a d +AADT a a d t +AADTs a a d t's +Aadu a a d u +AAEA a a e a +AAE a a e +AAERT a a e r t +AAF a a f +AAFCA a a f c a +AAFC a a f c +AAFC's a a f c's +AAFld a a f l d +AAFPOA a a f p o a +AAGPBL a a g p b l +AAHHE a a h h e +AAI a a i +AAIB a a i b +AAIP a a i p +AAK a a k +Aap a a p +AAP a a p +AAPB a a p b +AAPC a a p c +AAPEP a a p e p +AAPG a a p g +AAPM a a p m +AAPT a a p t +A.A.R.M. a a r m +A.B.A. a b a +A. B. a b +A.B. a b +A.B.A. J. a b a j +A.B.C. a b c +A. B. G. a b g +ABG a b g +ABH a b h +ABHD a b h d +Abhi a b h i +ABK a b k +abl a b l +Abl a b l +ABL a b l +ABLV a b l v +ABM a b m +ABMC a b m c +ABN a b n +ABN's a b n's +Abp a b p +ABP a b p +ABPD a b p d +ABPI a b p i +ABPN a b p n +ABPP a b p p +ABPRS a b p r s +ABPW a b p w +Abr a b r +ABR a b r +abv a b v +ABV a b v +ABW a b w +ABX a b x +Abz a b z +A.C.A. a c a +ACA a c a +A&C a and c +A. C. a c +A.C. a c +acac a c a c +Acad a c a d +ACAD a c a d +A.C.A.P. a c a p +ACAP a c a p +ACAS a c a s +ACAZ a c a z +ACBA a c b a +ACB a c b +ACBL a c b l +ACBS a c b s +ACBSP a c b s p +ACCA a c c a +ACC a c c +ACCC a c c c +ACCJ a c c j +ACC&S a c c and s +ACC's a c c's +ACCS a c c s +ACD a c d +ACDC a c d c +A.C. D.F.C. A.F.C. a c d f c a f c +A.C.E. a c e +ACF a c f +ACFE a c f e +A.C.G. a c g +ACG a c g +ACGIH's a c g i h's +A.C.H. a c h +ACH a c h +ACHP a c h p +ACHR a c h r +ACHRE a c h r e +Achs a c h's +ACHS a c h s +ACIA a c i a +ACI a c i +ACICS a c i c s +ACIGA a c i g a +ACIP a c i p +Acis a c i's +ACIS a c i s +ACLA a c l a +A.C.L. a c l +ACL a c l +A.C.L.N. a c l n +acls a c l s +ACL's a c l's +ACLS a c l s +ACLU a c l u +ACM a c m +ACMI a c m i +ACMs a c m's +ACN a c n +ACO's a c o's +AcpA a c p a +ACP a c p +AcpB a c p b +ACPI a c p i +ACPO a c p o +ACPP a c p p +ACPSEM a c p s e m +acq a c q +A&CR a and c r +ACR a c r +ACRPS a c r p s +ACSA a c s a +ACSAC a c s a c +ACSBR a c s b r +ACSCN a c s c n +ACSEL a c s e l +ACSIA a c s i a +ACSI a c s i +AcSOC a c s o c +ACSR a c s r +ACSS a c s s +ACSS's a c s s's +A.C.T. a c t +A.C.T.A.F.L. a c t a f l +acu a c u +ACU a c u +ACU's a c u's +ACUS a c u s +ACUV a c u v +ACV a c v +ACWA a c w a +AC&W a c and w +ACW a c w +ACWM a c w m +ACWS a c w s +Acy a c y +ADAA a d a a +A&D a and d +Adab a d a b +ADAC a d a c +A. D. a d +A.D. a d +A.D.A.M. adam +AdaSL a d a s l +ADATA a d a t a +ADBAC a d b a c +ADB a d b +ADBGR a d b g r +ADBICA a d b i c a +ADCA a d c a +AdC a d c +A.D.C. a d c +ADC a d c +ADCAF a d c a f +ADCC a d c c +ADC's a d c's +ADCs a d c's +ADCY a d c y +ADDA a d d a +AD&D a d and d +ADF a d f +ADF's a d f's +ADFS a d f s +ADG a d g +ADGB a d g b +ADH a d h +ADHD a d h d +ADHM a d h m +ADHS a d h s +ADIAC a d i a c +AdK a d k +ADK a d k +Adl a d l +ADL a d l +ADLL a d l l +ADLs a d l's +A.D.M.A.C. a d m a c +adm a d m +Adm a d m +ADM a d m +ADMK a d m k +admn a d m n +ADMN a d m n +ADNAC a d n a c +ADNEC a d n e c +ADNs a d n's +AdP a d p +A.D.P. a d p +ADP a d p +ADPCM a d p c m +ADPF a d p f +ADQ a d q +ADQ's a d q's +ADR a d r +ADRC a d r c +ADRP a d r p +ADRs a d r's +ADSB a d s b +ADSL a d s l +ADSR a d s r +ADSRs a d s r's +ADSs a d s's +ADT a d t +ADTG a d t g +Adwa a d w a +ADWC a d w c +ADX a d x +AEA a e a +A&E a and e +A. E. a e +A.E. a e +AEBN a e b n +A.E.C. a e c +AEC a e c +AECL a e c l +AECR a e c r +AEC's a e c's +Aed a e d +AED a e d +AEE a e e +AEF a e f +AEG a e g +A.E.G.I.S. a e g i s +aegte a e g t e +AEHL a e h l +AEIA a e i a +AEI a e i +AEIOU a e i o u +Aeka a e k a +AEK a e k +ael a e l +AEL a e l +Aema a e m a +AEM a e m +aen a e n +AEO a e o +AEPA a e p a +AEP a e p +aere a e r e +AEre a e r e +AErn a e r n +AERN a e r n +Aert a e r t +AESA a e s a +Aes a e's +AES a e s +aet a e t +AET a e t +AETC a e t c +AEU a e u +AEV a e v +AEW a e w +AEX a e x +Afa a f a +AFA a f a +af a f +Af a f +A. F. a f +A.F. a f +AF a f +Afaf a f a f +AFAP a f a p +AFB a f b +AFCA a f c a +afc a f c +A.F.C. a f c +AFC a f c +AFCEC a f c e c +AFCO a f c o +AFC's a f c's +AFCS a f c s +AFCSThe a f c s t h e +Afd a f d +AfD a f d +AfDB a f d b +AFDD a f d d +Afe a f e +AFE a f e +Aff a f f +AFF a f f +AFG a f g +AFGM a f g m +AFH a f h +AFIA a f i a +Afi a f i +AFI a f i +AFIP a f i p +Afiq a f i q +AFI's a f i's +AFJ a f j +A.F.L. a f l +AFL a f l +AFLEG a f l e g +AFLPA a f l p a +AFLP a f l p +AFL's a f l's +AFLUA a f l u a +A. F.M.A. a f m a +AFM a f m +AFMC a f m c +AFMs a f m's +AFN a f n +AFNET a f n e t +AFNOR a f n o r +AfNS a f n s +Afo a f o +AFO a f o +AFOP a f o p +AFP a f p +AFRA a f r a +Afr a f r +AFR a f r +AFRC a f r c +AFRL a f r l +AFROTC a f r o t c +AFRTS a f r t s +AFS a f s +AFSC a f s c +AFSPC a f s p c +A. F. T. a f t +AFTRA a f t r a +AFTRA's a f t r a's +AFTRS a f t r s +AFV a f v +AFW a f w +AFWS a f w s +AFX a f x +A. G. a g +A.G. a g +AGB a g b +AGC a g c +Agco a g c o +AGCO a g c o +Agda a g d a +AGD a g d +A.G.E. a g e +AGF a g f +AG&G a g and g +agg a g g +Agi a g i +AGI a g i +AGID a g i d +AGIR a g i r +Agis a g i's +A.G.J. a g j +A. G. K. a g k +AGL a g l +agli a g l i +AGM a g m +Agn a g n +AgN a g n +AGN a g n +AGNs a g n's +A.G.P. a g p +AGP a g p +AGPL a g p l +AGPS a g p s +AGPW a g p w +AGRs a g r's +AGS a g s +AGSM a g s m +Agsu a g s u +agt a g t +AGT a g t +Agte a g t e +Agu a g u +AGU a g u +AGV a g v +A.H.A. a h a +A. H. a h +A.H. a h +A. H. C. a h c +AHC a h c +AHD a h d +Ahdhra a h d h r a +AHDR a h d r +ahe a h e +Ahe a h e +AHEC a h e c +AHF a h f +Ahirs a h i r's +Ahk a h k +AHL's a h l's +AHP a h p +AHRC a h r c +AHRS a h r s +AHSAA a h s a a +Ahsa'i a h s a i +Ahta a h t a +aht a h t +AHT a h t +AHTD a h t d +Ahu a h u +Ahva a h v a +AHV a h v +AIAA a i a a +A.I.A. a i a +A&I a and i +A. I. a i +A.I. a i +AI a i +AIAP a i a p +Aias a i a's +AIAS a i a s +AIATSIS a i a t s i s +AIAW a i a w +AIAWU a i a w u +A.I.B.A. a i b a +AIB a i b +AIBO's a i b o's +AIBS a i b s +AIC a i c +AICAR a i c a r +AICC a i c c +AICCCR a i c c c r +aici a i c i +Aicme a i c m e +AICN a i c n +AICPA a i c p a +AICP a i c p +AICPS a i c p s +AICs a i c's +AICTE a i c t e +AICUF a i c u f +AIDA a i d a +AIDN a i d n +AIEC a i e c +AIEE a i e e +Aiel a i e l +AIEP a i e p +AIFA a i f a +AIF a i f +AIFB a i f b +Aife a i f e +AIFF a i f f +AIFM a i f m +AIFMD a i f m d +AiG a i g +AIG a i g +Aigis a i g i's +AIHA a i h a +AIH a i h +AIHL a i h l +AIIMS a i i m s +Aija a i j a +Aik a i k +AIK a i k +AIKR a i k r +A.I.M. a i m +AIP a i p +A.I.R. a i r +AIs a i's +AISC a i s c +AISD a i s d +AISRI a i s r i +Aist a i s t +AIST a i s t +AIT's a i t's +Aitu a i t u +Aiud a i u d +aius a i u s +AIVC a i v c +AIW a i w +AIX a i x +A. J. a j +A.J. a j +Ajba a j b a +A.J.B. a j b +AJC a j c +A.J.E. a j e +A.J.G.C. a j g c +A. J. J. a j j +A.J.K. a j k +AJK a j k +AJKF a j k f +AJL a j l +A. J. M. a j m +Ajmi a j m i +AJN a j n +AJO a j o +Ajok a j o k +A. J. P. a j p +A.J.P. a j p +AJPW a j p w +A.J.R. a j r +AJR a j r +Ajsa a j s a +A.J.S. a j s +AJS a j s +A. J. T. a j t +A.J.T. a j t +AJT a j t +Aju a j u +AJUFE a j u f e +AJUSCO a j u s c o +AJV a j v +AJW a j w +AJWRC a j w r c +Akaa a k a a +a.k.a. a k a +aka. a k a +aka a k a +Aka. a k a +Aka a k a +AKA a k a +A&K a and k +A. K. a k +A.K. a k +AK a k +AKAP a k a p +AKAPs a k a p's +akas a k a's +AKAs a k a's +AKB a k b +AKC a k c +AKCR a k c r +AKD a k d +AKG a k g +AKG's a k g's +akh a k h +AKH a k h +AKHS a k h s +AKM a k m +AKN a k n +Akpa a k p a +AKP a k p +AKPD a k p d +AKQA a k q a +AKR a k r +A.K.S. a k s +AKS a k s +Aku a k u +AKU a k u +AKW a k w +A&L a and l +A. L. a l +A.L. a l +ALDF a l d f +ALDH a l d h +ALDS a l d s +ALDT a l d t +ALFASID a l f a s i d +ALFIDI a l f i d i +ALFTP a l f t p +Alh a l h +ALH a l h +A. L. M. a l m +A.L.P. a l p +ALPG a l p g +ALR a l r +ALSC a l s c +ALSF a l s f +ALSP a l s p +ALUs a l u's +A.L.V. a l v +ALVF a l v f +ALW a l w +ALWS a l w s +AMAA a m a a +A'ma a m a +A&M a and m +a.m. a m +a.m a m +A. M. a m +A.M. a m +AMAP a m a p +AMARC a m a r c +AMAs a m a's +amb a m b +Amb a m b +AMB a m b +AmBX a m b x +A.M.C. a m c +AMC a m c +AMC's a m c's +AMCs a m c's +Amda a m d a +Amd a m d +AMD a m d +AMDH a m d h +AMDISA a m d i s a +AMD's a m d's +A.M.E. a m e +AMF a m f +AM&FM a m and f m +A. M. G. a m g +AMG a m g +AMGTV a m g t v +Amha a m h a +AMH a m h +A.M.H.S. a m h s +A. M. J. a m j +AMJ a m j +A. M. K. a m k +A.M.K. a m k +AMK a m k +aml a m l +AML a m l +Amli a m l i +AMLS a m l s +Amlwch a m l w c h +Amm a m m +A. M. M. a m m +AMM a m m +AMMAYI a m m a y i +AMMB a m m b +AMMK a m m k +AMN a m n +AMNH a m n h +AMNRL a m n r l +AM&O a m and o +AMPK a m p k +AMPL a m p l +AMP's a m p's +Ampt a m p t +AMPTP a m p t p +amr a m r +A. M. R. a m r +AMREF a m r e f +AMSA a m s a +A&M's a and m's +Ams' a m's +amsl a m s l +AMSO's a m s o's +AMSRS a m s r s +AMS's a m s's +AMSS a m s s +AMSU a m s u +Amta a m t a +amt a m t +Amt a m t +A.M.T. a m t +AMT a m t +AMTB a m t b +AMTPAT a m t p a t +Amts a m t's +AMTV a m t v +Amu a m u +AMU a m u +AMU's a m u's +A.M.V.M. a m v m +AMW a m w +AMX a m x +AMYF a m y f +A. N. a n +A.N. a n +ANB a n b +ANBO a n b o +ANC a n c +ANCC a n c c +ANC's a n c's +andFHL a n d f h l +ANDOC a n d o c +ANDP a n d p +ANDPOP a n d p o p +andPPP a n d p p p +Anej a n e j +ANELFA a n e l f a +ANF a n f +ANFIS a n f i s +ANFP's a n f p's +ANGB a n g b +ANGPTL a n g p t l +ANGRAU a n g r a u +Angti a n g t i +Angu a n g u +Anhe a n h e +ANI a n i +ANL a n l +ANM a n m +ANP a n p +ANPP a n p p +ANPR a n p r +Anr a n r +ANR a n r +ANRC a n r c +ANREF's a n r e f's +Anrep a n r e p +ANRS a n r s +ANRW a n r w +A.N.S. a n s +ANS a n s +ANSF a n s f +ANTB a n t b +ANTM a n t m +ANTV a n t v +ANUGA a n u g a +ANWB a n w b +ANX a n x +ANZ a n z +A&O a and o +AOA a o a +AOAC a o a c +A. O. a o +A.O. a o +AOB a o b +AOC a o c +AOCB a o c b +AOCCs a o c c's +AOCE a o c e +AOD a o d +Aodh a o d h +Aodla a o d l a +AODV a o d v +AOE a o e +AOGCC a o g c c +Aogo a o g o +AOH a o h +Aoke a o k e +Aoko a o k o +AOKP a o k p +Aola a o l a +Aol a o l +AOL a o l +AOL's a o l's +AOLTV a o l t v +AOM a o m +AOMC a o m c +AONB a o n b +Aone a o n e +Aoni a o n i +Aoos a o o's +AOPA a o p a +AOP a o p +aor a o r +AOR a o r +AORs a o r's +AORS a o r s +aos a o s +AoS a o s +AOS a o s +Aotus a o t u's +AOTW a o t w +aov a o v +aovf a o v f +AOWC a o w c +A&P a and p +A. P. a p +A.P. a p +APBA a p b a +APB a p b +APBL a p b l +APCA a p c a +Apc a p c +APC a p c +APCCR a p c c r +APCh a p c h +APCR a p c r +APCRDA a p c r d a +APC's a p c's +APCs a p c's +APDA a p d a +APD a p d +APDM a p d m +APEGBC a p e g b c +APFA a p f a +APF a p f +APFCT a p f c t +APFOL a p f o l +APFSDS a p f s d s +APFUTU a p f u t u +apg a p g +APG a p g +APGAW a p g a w +Aph a p h +A.P.H. a p h +APH a p h +APHEDA a p h e d a +APHL a p h l +Apiao a p i a o +Api a p i +APi a p i +API a p i +Apic a p i c +APICv a p i c v +API's a p i's +A.P.J. a p j +APJ a p j +Apl a p l +APL a p l +APLP a p l p +APLS a p l s +Aplu a p l u +APM a p m +APML a p m l +APMR a p m r +APMSO a p m s o +APN a p n +A.P.N.C. a p n c +Apphttp a p p h t t p +Appl a p p l +APPO's a p p o's +appr a p p r +Appts a p p t's +appu a p p u +Appu a p p u +APRA's a p r a's +APRC a p r c +APR's a p r's +APRS a p r s +APRST a p r s t +A&P's a and p's +Aps a p's +APs a p's +APS a p s +APSF a p s f +APSL a p s l +APTA a p t a +AP&T a p and t +APW a p w +APX a p x +APXS a p x s +Aqa a q a +AQA a q a +AQC a q c +AQI a q i +Aql a q l +AQP a q p +Aqr a q r +A&R a and r +ARA a r a +A. R. a r +A.R. a r +A.R.B. a r b +ARD a r d +ARDF a r d f +A.R.E. a r e +A.R.F. a r f +ARF a r f +A.R.G. a r g +ArgR a r g r +ARGs a r g's +ARGT a r g t +ArH a r h +ARJ a r j +ARL a r l +ARLFC a r l f c +A. R. M. a r m +ARMv a r m v +Arnd a r n d +ARNG a r n g +ARNT a r n t +A.R.P. a r p +ARQ a r q +ARTL a r t l +A.R.U. a r u +arv a r v +Arv a r v +ARV a r v +ARVD a r v d +ARVN a r v n +ARW a r w +Arwi a r w i +ARWU a r w u +A.S.A. a s a +ASA a s a +As'ad a s a d +Asai a s a i +Asao a s a o +A.s a's +A. S. a s +A.S. a s +ASAS a s a s +Asasp a s a s p +ASAU a s a u +A.S.B. a s b +ASB a s b +ASBDA a s b d a +asbl a s b l +ASBM a s b m +ASBMH a s b m h +ASBO a s b o +A.S.C. a s c +ASC a s c +ASCB a s c b +ASCE a s c e +asci a s c i +Asci a s c i +ASCP a s c p +ASCW a s c w +A.S.D. a s d +ASD a s d +ASDIC a s d i c +Asdis a s d i's +ASE a s e +ASEC a s e c +ASEE a s e e +ASEF a s e f +ASFA a s f a +ASF a s f +Asfi a s f i +ASGA a s g a +ASG a s g +ASGC a s g c +ASGE a s g e +ASGS a s g s +A. S. H. a s h +A.S.I. a s i +ASL a s l +A.S.M. a s m +ASM a s m +ASMD a s m d +ASME a s m e +ASMIK a s m i k +ASML a s m l +ASMPH a s m p h +ASMSU a s m s u +Asn a s n +ASN a s n +Aso a s o +ASO a s o +ASP a s p +ASPCA a s p c a +Aspe a s p e +ASPTS a s p t s +Asr a s r +ASR a s r +Assn a s s n +assoc a s s o c +Assoc a s s o c +ASSPs a s s p's +ASSR a s s r +Asst a s s t +ASSU a s s u +A. S. T. a s t +ASTAT a s t a t +ASTCL a s t c l +Aste a s t e +ASTE a s t e +ASTM a s t m +ASTR a s t r +Astt a s t t +A.S.U. a s u +ASU a s u +A.S.V. a s v +ASV a s v +Aswa a s w a +ASW a s w +ASX a s x +A&T a and t +atac a t a c +Atac a t a c +Atad a t a d +Ata's a t a's +Atas a t a's +ATA's a t a's +A. T. a t +A.T. a t +ATBF a t b f +ATBs a t b's +atc a t c +A.T.C. a t c +ATC a t c +atcc a t c c +ATCC a t c c +ATCDE a t c d e +ATCL a t c l +ATDC a t d c +ATF a t f +Atg a t g +ATG a t g +ATGM a t g m +ath a t h +Ath a t h +ATH a t h +ATHN a t h n +ATIA a t i a +Atia's a t i a's +Ati a t i +ATi a t i +ATI a t i +Atid a t i d +Atiiq a t i i q +Atil a t i l +ATINC a t i n c +ATIP a t i p +Atiq a t i q +Ativ a t i v +ATJ a t j +Atka a t k a +ATK a t k +ATKN a t k n +ATK's a t k's +Atl a t l +ATL a t l +Atli a t l i +ATLY a t l y +A.T.M.A. a t m a +atm a t m +Atm a t m +ATM a t m +ATMs a t m's +ATN a t n +ATO a t o +Atos a t o's +ATO's a t o's +ATOs a t o's +ATOS a t o s +ATP a t p +atpB a t p b +A.T.Q. a t q +ATR a t r +atri a t r i +Atri a t r i +ATRP a t r p +A&T's a and t's +A.T.s a t's +A.T.S. a t s +ATS a t s +ATSC a t s c +ATSDR a t s d r +AT&SF a t and s f +ATSF a t s f +ATSIC a t s i c +AT&T a t and t +attd a t t d +ATTESA a t t e s a +ATTF a t t f +AT&T's a t and t's +ATTS a t t s +ATTWI a t t w i +ATTWX's a t t w x's +ATU's a t u's +atv a t v +ATV a t v +ATV's a t v's +ATVs a t v's +ATW a t w +AtxA a t x a +ATX a t x +ATXN a t x n +A. U. a u +A.U. a u +Aub a u b +Aubl a u b l +AUC a u c +AUVs a u v's +Auw a u w +avab a v a b +AVAC a v a c +A. V. a v +A.V. a v +AVCA a v c a +AVC a v c +AVCHD a v c h d +AVCs a v c's +AVCS a v c s +AVD a v d +avg a v g +AVG a v g +AVK a v k +AVL a v l +A. V. M. a v m +AVM a v m +Avn a v n +AVN a v n +Avo a v o +AvP a v p +AVP a v p +AVR a v r +AVRs a v r's +AVSA a v s a +Avs' a v's +Avs a v's +AVS a v s +AVSM a v s m +AVU a v u +avvo a v v o +AVX a v x +Awa a w a +A. W. A. a w a +AWA a w a +A. W. A. M. a w a m +AWAs a w a's +A. W. a w +A.W. a w +A. W. B. a w b +A.W.B. a w b +AWB a w b +AWB's a w b's +A.W.C. a w c +AWC a w c +AWD a w d +A. W. F. a w f +AWG a w g +AWGIE a w g i e +AWGN a w g n +A. W. H. a w h +AWHL a w h l +AWI a w i +AWM a w m +Awo a w o +AWP a w p +AWP's a w p's +AWR a w r +AWSA a w s a +AWU a w u +Awwa a w w a +AXAF a x a f +A. X. a x +AXS a x s +AXV a x v +A. Y. a y +A.Y. a y +AYF a y f +AYK a y k +AYP a y p +A. Z. a z +A.Z. a z +AZE a z e +Azg a z g +Azi a z i +AZI a z i +AZL a z l +azm a z m +AZN a z n +AZS a z s +AZSTA's a z s t a's +AZT a z t +AzTV a z t v +Baad b a a d +BAAG b a a g +Ba'al b a a l +Baal b a a l +BAAL b a a l +Baam b a a m +Baap b a a p +ba'as b a a's +Baat b a a t +Ba'ath b a a t h +B. A. b a +B.A. b a +B&A b and a +Bac b a c +B.A.C. b a c +BAC b a c +bae b a e +Bae b a e +BAe b a e +BAE b a e +BAFA b a f a +BAF b a f +B.A.R. b a r +BARV b a r v +BASCA b a s c a +BASEC b a s e c +BASF b a s f +B.A.S.P. b a s p +BATVG b a t v g +Bauw b a u w +B'Av b a v +BAV b a v +BBA b b a +BBAG b b a g +B&B b and b +bb b b +B. B. b b +B.B. b b +BB b b +BBB b b b +bbc b b c +B.B.C. b b c +BBC b b c +BBCBBC b b c b b c +BB&CI b b and c i +BBC&PJR b b c and p j r +BBC's b b c's +B.B.D. b b d +BBDO b b d o +BBE b b e +BBF b b f +BBFC b b f c +BBFF b b f f +BBG b b g +BBH b b h +BBI b b i +BBK b b k +BBKL b b k l +BBLB b b l b +BBL b b l +BBM b b m +BBMP b b m p +BBNG b b n g +BBN's b b n's +BBO b b o +BBP b b p +BBQ'er b b q e r +B&Bs b and b's +BB&S b b and s +BBS b b s +BBSes b b s e's +BBS's b b s's +BB&T b b and t +BBT b b t +BBTV b b t v +BBU b b u +BBVA b b v a +BbvCI b b v c i +BBV's b b v's +BBWAA b b w a a +BBWA b b w a +BBWR's b b w r's +BBYA b b y a +BBYO b b y o +BCA b c a +BCAD b c a d +BCAM b c a m +BCATP b c a t p +BCBA b c b a +BCB b c b +bc b c +B. C. b c +B.C. b c +BC b c +BCCA b c c a +BCC b c c +BCCCA b c c c a +Bcci b c c i +BCCI b c c i +BCCP b c c p +BCC's b c c's +BCDA b c d a +BCD b c d +BCEA b c e a +BCE b c e +BCE's b c e's +BCF b c f +BCG b c g +BCG's b c g's +BCHL b c h l +BCHR's b c h r's +BCHS b c h s +BCI b c i +B. C. J. b c j +BCL b c l +BCLR b c l r +BCMA b c m a +BCM b c m +BCMG b c m g +BCMHS b c m h s +BCMS b c m s +BCN b c n +BCN's b c n's +BCP b c p +BCPM b c p m +BCR b c r +BCRF's b c r f's +B.C.'s b c's +BC's b c's +BCs b c's +BCS b c s +BCSC b c s c +BCSic b c s i c +BCSN b c s n +BCT b c t +BCTC b c t c +BCU b c u +BCYP b c y p +BdA b d a +BDA b d a +bd b d +B. D. b d +B.D. b d +BD b d +BDBL b d b l +BDC b d c +BDC's b d c's +BDD b d d +Bde b d e +B. D. E. b d e +BDE b d e +BDF b d f +BDI b d i +BDJ b d j +BDK b d k +BDK's b d k's +BDMI b d m i +BDN b d n +BDNF b d n f +BDO b d o +BDO's b d o's +BDOS b d o s +BDP b d p +BDR b d r +bds b d s +BDS b d s +BDSM b d s m +BdU b d u +BDU b d u +BDV b d v +B. D. W. b d w +B.E.A. b e a +B. E. b e +B.E. b e +Bedw b e d w +B.E.E. b e e +bef b e f +B.E.F. b e f +BEF b e f +BEF's b e f's +bei b e i +Bei b e i +Beih b e i h +BEIR b e i r +Beis b e i's +bej b e j +B.E.M. b e m +BEMs b e m's +BEP b e p +Ber b e r +BER b e r +Bes b e's +B.E.S. b e s +BES b e s +B.F.A. b f a +BFA b f a +bf b f +B. F. b f +B.F. b f +BF b f +BFCA b f c a +BFC b f c +BFC's b f c's +BFDG b f d g +BFES b f e s +BFF b f f +BFFs b f f's +B. F. G. b f g +BFG b f g +BFG's b f g's +BFI b f i +BFI's b f i's +BFJA b f j a +BFKL b f k l +BFL b f l +BFM b f m +BFO b f o +BFRA b f r a +BFR b f r +BFSA b f s a +BFS b f s +BFT b f t +BFU b f u +bfy b f y +BGAB b g a b +BGA b g a +BGB b g b +B. G. b g +B.G. b g +BGC b g c +BGCI b g c i +BGD b g d +BGEA b g e a +B. G. E. b g e +BGH b g h +B. G. J. S. b g j s +BGL b g l +BglII b g l i i +BGM b g m +BGP b g p +BGRA b g r a +BGR b g r +BGRC b g r c +BGRSO b g r s o +bgs b g s +B.G.S. b g s +BGS b g s +BGSU b g s u +BGT b g t +Bgy b g y +Bha b h a +B&H b and h +B. H. b h +B.H. b h +BHCC b h c c +BHDP b h d p +BH&E b h and e +Bhe b h e +BHL b h l +BHMA b h m a +BHMO b h m o +BHMs b h m's +BHMT b h m t +BHO b h o +B. H. P. b h p +BHP b h p +BHRT b h r t +BHS b h s +BHSN b h s n +BHSU b h s u +bhttp b h t t p +BHU b h u +BHUSD b h u s d +BHVS b h v s +B. I. b i +B.I. b i +Bie b i e +BIE b i e +biedt b i e d t +Biem b i e m +B.I.G. b i g +B.I.G.'s b i g's +BiH b i h +BIH b i h +B.I.O.L.A. b i o l a +B. J. b j +B.J. b j +BJCC b j c c +BJCP b j c p +BJD b j d +B.J.F. b j f +B. J. I. b j i +BJJ b j j +BJP b j p +BJP's b j p's +BJPs b j p's +BJPS b j p s +B.J.'s b j's +B.J.T. b j t +BJT b j t +BJU b j u +BJY b j y +B.K.A. b k a +B&K b and k +B. K. b k +B.K. b k +BKCa b k c a +BKC b k c +BKF b k f +BKI b k i +BKN's b k n's +BKO b k o +B.K.R. b k r +BKR b k r +BK's b k's +BKS b k s +BKT b k t +BKTV b k t v +BKV b k v +B. L. b l +B.L. b l +BL b l +BLC b l c +BLCC b l c c +BLCN b l c n +ble b l e +bleg b l e g +blev b l e v +BLG b l g +bli b l i +BLI b l i +Blla b l l a +BLL b l l +BLM b l m +BLMC b l m c +BLOU's b l o u's +BLPP b l p p +BLR b l r +BLRC b l r c +BLR&D b l r and d +B.L.S. b l s +BLS b l s +BLT b l t +BLTF b l t f +BLTs b l t's +BLV b l v +BMAA b m a a +B.M.A. b m a +BMA b m a +BMAL b m a l +BMARC b m a r c +BMA's b m a's +B&M b and m +BMB b m b +B. M. b m +B.M. b m +BMCA b m c a +B.M.C. b m c +BMC b m c +bmd b m d +BMD b m d +BME b m e +BMF b m f +BMG b m g +BMHS b m h s +bmi b m i +BMI b m i +BMIC b m i c +BMIR b m i r +BMI's b m i's +BMIT b m i t +BMJ b m j +BMK b m k +BMKG b m k g +BMMO b m m o +BMNA b m n a +BMNH b m n h +BMNP b m n p +BMO b m o +BMP b m p +BMPs b m p's +BMR b m r +BMRs b m r's +BMSA b m s a +B.M.S. b m s +BMS b m s +bmt b m t +B. M. T. b m t +B.M.T. b m t +BMT b m t +BMT's b m t's +BMU b m u +B.M.V. b m v +BMV b m v +B. M. W. b m w +BMW b m w +BMW M b m w +BMW's b m w's +BMX b m x +BNA b n a +B&N b and n +bnb b n b +BNB b n b +B. N. b n +B.N. b n +BNC b n c +BNCI b n c i +BNCM b n c m +BNCT b n c t +BND b n d +BNDY b n d y +BNET b n e t +BNF b n f +BNFL b n f l +BNI b n i +BNIC b n i c +BNL b n l +BNO b n o +BNP b n p +BNR b n r +BNRC b n r c +BNS b n s +BNSF b n s f +BNST b n s t +BNT b n t +BNU b n u +BNY b n y +BNZ b n z +Boac b o a c +BOAC b o a c +B&O b and o +B. O. b o +B.O. b o +Boc b o c +BoC b o c +BOC b o c +BOCs b o c's +BOCS b o c s +boj b o j +Boj b o j +BOJ b o j +B.O.M.B. b o m b +B&O's b and o's +B.O.S. b o s +BOYZZ b o y z z +BPA b p a +BPB b p b +bp b p +B. P. b p +B.P. b p +BP b p +BPC b p c +BPD b p d +BPER b p e r +B.P.H. b p h +BPI b p i +BPJ b p j +BPK b p k +bpl b p l +BPL b p l +B. P. M. b p m +BPM b p m +BPMN b p m n +B.P.N. b p n +BPN b p n +B.P.O. b p o +BPO b p o +BPPA b p p a +BPP b p p +BPR b p r +B.P.R.D. b p r d +BPRD b p r d +BPSA b p s a +BP's b p's +BPS b p s +BPSK b p s k +BPUP b p u p +BPV b p v +BPY b p y +B&Q b and q +BQB b q b +B. Q. b q +BRAC's b r a c's +BRAM b r a m +BRBDP b r b d p +Brbic b r b i c +B. R. b r +B.R. b r +BRBR b r b r +BRBs b r b's +BRCA b r c a +BRC b r c +BRCC b r c c +BRD b r d +BRF b r f +BRGF b r g f +BRGM b r g m +BRHS b r h s +B.R.I.C.K. b r i c k +BRK b r k +BRL b r l +BRM b r m +BRMS b r m s +BRN b r n +BRNC b r n c +Brne b r n e +Brno b r n o +BRNV b r n v +BRP b r p +BRPS b r p s +BRRA b r r a +BRS b r s +BRSCC's b r s c c's +BRT b r t +BRTs b r t's +BRTS b r t s +BRVM b r v m +BRW b r w +BRWK b r w k +Brza b r z a +BRZ b r z +brzu b r z u +brzy b r z y +Brzyk b r z y k +BSAA b s a a +B.S.A. b s a +BSA b s a +BSAC b s a c +BsaL b s a l +BSBA b s b a +BSB b s b +BSBI b s b i +B. s b's +B.'s b's +Bs b's +B. S. b s +B.S. b s +BS b s +B.S.C. b s c +BSC b s c +BSCL b s c l +bsd b s d +BSD b s d +BSDE b s d e +BSE b s e +BSET b s e t +BSFA b s f a +BSF b s f +BSG b s g +BSH b s h +BSIB b s i b +BSI b s i +BSK b s k +BSL b s l +BSM b s m +BSME b s m e +BSN b s n +BSNL b s n l +BSOG b s o g +BSPA b s p a +BSP b s p +BSPP b s p p +BSR b s r +BSRN b s r n +BSS b s s +BSU b s u +BSV b s v +BSX b s x +BTA b t a +BTAF b t a f +BTB b t b +BTBD b t b d +bt b t +B. T. b t +B.T. b t +BT b t +BTCA b t c a +BTC b t c +BTCC b t c c +BTD b t d +BTF b t f +BTG b t g +BTH b t h +BTK b t k +BTL b t l +BTM b t m +BTN b t n +BTNK b t n k +BTOB b t o b +BTO b t o +BTP b t p +BTRC b t r c +BTRDA b t r d a +Btry b t r y +btsan b t s a n +BT's b t's +BTS b t s +BTT b t t +BTU b t u +btus b t u s +BTUs b t u's +BTV b t v +B.U. b u +B.U.M. b u m +BUV b u v +BVA b v a +BVB b v b +BVB's b v b's +B. V. b v +B.V. b v +BVC b v c +BVFB b v f b +BVI b v i +BVM b v m +BVO b v o +BVR b v r +BVRC b v r c +BVT b v t +BVVL b v v l +Bwa b w a +BWAF b w a f +B&W b and w +BWB b w b +BWBR b w b r +B. W. b w +B.W. b w +B.W.C. b w c +BWC b w c +BWF b w f +BWFC b w f c +BWHBC b w h b c +B. W. I. b w i +BWI b w i +BWIR b w i r +BWO b w o +BWR b w r +BWS b w s +BWT b w t +BWTs b w t's +BWV b w v +BWW b w w +bwwtv b w w t v +Bxa b x a +BX b x +Bxe b x e +BXML b x m l +BYA's b y a's +BYB b y b +B. Y. b y +byc b y c +BYC b y c +BYD b y d +BYFC b y f c +BYG b y g +bygd b y g d +Byk b y k +byn b y n +BYOB b y o b +Byo b y o +BYO b y o +Byou b y o u +BYR b y r +Byrl b y r l +bySLC b y s l c +BYST b y s t +byt b y t +B.Y.U. b y u +BYU b y u +BYU's b y u's +BYX b y x +BYZ b y z +B.Z. b z +BZ b z +BZD b z d +bzhed b z h e d +Bzik b z i k +BZK b z k +BZP b z p +Bzyb b z y b +CAA c a a +CAAC c a a c +CAAC's c a a c's +CAAHEP c a a h e p +CAAM c a a m +CAAS c a a s +CAASE c a a s e +Caat c a a t +CAAT c a a t +C. A. c a +C.A. c a +CA c a +C&A c and a +CAC c a c +CA&CC c a and c c +CACC c a c c +CACM c a c m +Cadw c a d w +CADW c a d w +caeca c a e c a +Cae c a e +CAE c a e +C.A.F.B. c a f b +CAFTT c a f t t +C. A. G. c a g +CAG c a g +CAGM c a g m +C. A. I. c a i +C. A. J. c a j +CALUX c a l u x +CAMC c a m c +CAMLG c a m l g +C.A.M.'s c a m's +C. A. N. c a n +Capt. captain +C. A. R. c a r +cas c a s +Cas c a's +C.A.S. c a s +CAS c a s +Casc c a s c +CASC c a s c +CASD c a s d +CASF c a s f +CASG c a s g +CASQ c a s q +C. A. T. c a t +C.A.T. c a t +CATV c a t v +C.A.W. c a w +CBA c b a +CBBB c b b b +CBB c b b +CBBC c b b c +CBBS c b b s +CBCA c b c a +cb c b +C. B. c b +C.B. c b +CB c b +cbc c b c +CBC c b c +CB&CNS c b and c n s +CBC's c b c's +CBCS c b c s +CBDA c b d a +CBD c b d +CBDs c b d's +C.B.E. c b e +CBE c b e +CBEF c b e f +CBE's c b e's +CBF c b f +CBGB c b g b +CBGB's c b g b's +CBGBs c b g b's +CBG c b g +CBH c b h +CBHG c b h g +CBI c b i +CBI's c b i's +CbiXS c b i x s +CBKB c b k b +CBK c b k +CBKMT c b k m t +CBKRT c b k r t +CBL c b l +CBL's c b l's +CBM c b m +CBMS c b m s +CBN c b n +CBN's c b n's +CBNT c b n t +CBO c b o +CBOT c b o t +CBP c b p +CBPE c b p e +CB&Q c b and q +CBR c b r +CBRE c b r e +CBRN c b r n +CBRNE c b r n e +CBSA c b s a +CBs c b's +CBS c b s +C.B.S.E. c b s e +CBSE c b s e +CBS's c b s's +CBT c b t +CBTC c b t c +CBTU c b t u +CBU c b u +CBUT c b u t +CBV c b v +CBWT c b w t +CBX c b x +CBYT c b y t +CBZH c b z h +'c c +CcaA c c a a +CCAA c c a a +CCAAT c c a a t +cca c c a +Cca c c a +CCA c c a +CCAF c c a f +CCAP c c a p +CCAR c c a r +CCAS c c a s +CCB c c b +CCBCC c c b c c +CCBE c c b e +CCCA c c c a +C&C c and c +C. C. c c +C.C. c c +CCCE c c c e +CCCF c c c f +CCCP c c c p +CCC's c c c's +CCDB c c d b +CCDC c c d c +ccd c c d +CCD c c d +CCDev c c d e v +CCDI c c d i +CCDI's c c d i's +CCDM c c d m +CCDR c c d r +CCD's c c d's +CCDs c c d's +CCEd c c e d +C.C.E.D. c c e d +CCF c c f +CCFO c c f o +CCG c c g +C.C.G.S. c c g s +CCGS c c g s +CCHA c c h a +CCHC c c h c +C.C.H. c c h +CCH c c h +CCHD c c h d +CCHS c c h s +C.C.I.A.A. c c i a a +CCIAA c c i a a +CCi c c i +CCI c c i +CCID c c i d +CCIE c c i e +CCIH c c i h +CCITT c c i t t +CCJ c c j +CCK c c k +CCLC c c l c +CCL c c l +CCMA c c m a +ccm c c m +CCM c c m +CCMM c c m m +CCMP c c m p +CCMS c c m s +CCN c c n +CCNY c c n y +CCO c c o +CCOKC c c o k c +CCOO c c o o +CCOP c c o p +C.C.O.W.E. E.T.F. c c o w e e t f +CCP c c p +CCPD c c p d +CCPL c c p l +CCPN c c p n +CCP's c c p's +CCQ c c q +CCRC c c r c +CCR c c r +CCRCs c c r c's +CCRH c c r h +CCRS c c r s +CCSA c c s a +CCSC c c s c +CC's c c's +CCS c c s +CCSD c c s d +C.C.S.D.N.Y. c c s d n y +C.C.S.M. c c s m +CCSN c c s n +CCSR c c s r +CCS's c c s's +cct c c t +CCT c c t +CCTF c c t f +CCTRN c c t r n +CCTT c c t t +CCTV c c t v +CCUA c c u a +CCU c c u +ccus c c u s +CCV c c v +CCVG c c v g +C. C. W. c c w +CCWD c c w d +CDA c d a +CDAT c d a t +CDB c d b +CDBS c d b s +CDCA c d c a +C&D c and d +cdc c d c +CDC c d c +cd c d +C. D. c d +C.D. c d +CD c d +CDC's c d c's +CDDB c d d b +CD&DR c d and d r +CDE c d e +CDF c d f +CDFI c d f i +CDFW c d f w +CDH c d h +CDi c d i +CDI c d i +CDISC c d i s c +CDI's c d i's +CDK c d k +CDKN c d k n +CDL c d l +CDLI c d l i +CDLS c d l s +CDMA c d m a +CDM c d m +cDNA c d n a +cdnas c d n a s +cDNAs c d n a's +CDN c d n +CDN's c d n's +CDO c d o +CDOs c d o's +CDPC c d p c +CDP c d p +CDP's c d p's +CDPs c d p's +CD&R c d and r +CDR c d r +cds c d s +CD's c d's +CDs c d's +CDS c d s +CDSG c d s g +CDSP c d s p +CDSPCo c d s p c o +CdtA c d t a +CDT c d t +CdTe c d t e +CDTi c d t i +CDTI c d t i +CDT's c d t's +CDTV c d t v +CDTV's c d t v's +CDU c d u +CDU's c d u's +CD&V c d and v +CDV c d v +CDW c d w +CDWP c d w p +Cec c e c +CEC c e c +c'e c e +ce c e +C'e c e +Ce c e +C. E. c e +C.E. c e +CE c e +CECP c e c p +CEDA c e d a +CEDO c e d o +CEDR c e d r +CEDS c e d s +CEEBA c e e b a +CEEB c e e b +CEEH c e e h +Ceel c e e l +CEEOL c e e o l +CEESA c e e s a +CEFC c e f c +CEF c e f +Cefn c e f n +CEFP c e f p +CEFR c e f r +CEGB c e g b +C.E.G. c e g +C. E. H. c e h +CEI c e i +C&EI's c and e i's +C. E. M. c e m +C&EN c and e n +cen c e n +Cen c e n +CEN c e n +ceo c e o +C.E.O. c e o +CEO c e o +Ceol c e o l +CEOP c e o p +Ceorl c e o r l +Ceos c e o's +CEO's c e o's +CEOs' c e o's +CEOs c e o's +C.E.P. c e p +cer c e r +Cer c e r +CER c e r +CERP c e r p +CERPER c e r p e r +CERS c e r s +ces c e s +Ces c e's +C.E.S. c e s +CES c e s +CESL c e s l +CESO c e s o +CETB c e t b +C. E. T. c e t +CEV c e v +CEVCP c e v c p +CEVG c e v g +CEW c e w +Cex c e x +CeX c e x +CEX c e x +CEZ c e z +CEZMS c e z m s +CFAB c f a b +Cfa c f a +CFA c f a +CFAS c f a s +C. F. B. c f b +CFB c f b +CFBG c f b g +CFBISD c f b i s d +CFB's c f b's +C&F c and f +CFC c f c +cf c f +C. F. c f +C.F. c f +CF c f +CFC's c f c's +CFDA c f d a +CFD c f d +C.F.E. c f e +CFE c f e +CFFC c f f c +C. F. F. c f f +CFF c f f +C. F. H. c f h +CFH c f h +CFHS c f h s +CFI c f i +CFIT c f i t +CFJL c f j l +CFJR c f j r +CFL c f l +CFL's c f l's +CFM c f m +CFMEU c f m e u +CFMI c f m i +CFND c f n d +CFNY c f n y +C.F.O.A. c f o a +CFO c f o +CFOP c f o p +CFOs c f o's +CFPI c f p i +CFPL c f p l +CFQ c f q +CFRB c f r b +C.F.R. c f r +CFR c f r +CFRP c f r p +CFS c f s +CFSCI c f s c i +CFSP c f s p +CFTA c f t a +CFT c f t +CFTO c f t o +CFTR c f t r +CFTs c f t's +CFTXOP c f t x o p +CFU c f u +CFYN c f y n +CFZ c f z +CGA c g a +CGAP c g a p +CGB c g b +C&G c and g +CGCFAD c g c f a d +C. G. c g +C.G. c g +CGCRI c g c r i +CGCS c g c s +CGD c g d +CGDK c g d k +CGE c g e +CGF c g f +CGFP c g f p +CGG c g g +CGI c g i +CGIL c g i l +CGKD c g k d +cgl c g l +CGL c g l +CGP c g p +CGPM c g p m +CGPME c g p m e +CGPW c g p w +CGR c g r +CGRP c g r p +CGS c g s +CGSS c g s s +CGT c g t +CGTG c g t g +CGTIC c g t i c +CGU c g u +CGW c g w +CGW's c g w's +C.H.B. c h b +CHBM c h b m +CHBX c h b x +C&H c and h +C.H.C. c h c +C. H. c h +C.H. c h +CHCO c h c o +CHD c h d +CHDK c h d k +CHDS c h d s +CHF c h f +CHFI c h f i +C.H.G. c h g +CHGO c h g o +CHH c h h +CHHOTO c h h o t o +CHHS c h h s +Chhu c h h u +Chirs c h i r's +CHISMS c h i s m s +CHISZ c h i s z +CHK c h k +CHL c h l +CHLR c h l r +CHL's c h l's +C. H. M. c h m +CHM c h m +CHN c h n +CHP c h p +CHP'den c h p d e n +CHPs c h p's +CHPS c h p s +CHR c h r +CHRDI c h r d i +CHRGD c h r g d +C.H.S. c h s +CHS c h s +CHSE c h s e +CHT c h t +CHV c h v +CHX c h x +Chy c h y +CHYR c h y r +CIAC c i a c +Cia c i a +C.I.A. c i a +CIA c i a +CIC c i c +ci c i +Ci c i +C. I. c i +C.I. c i +CI c i +Cicic c i c i c +CICL c i c l +C.I.C.M. c i c m +CICO c i c o +CIC's c i c's +C.I.D. c i d +CIFF c i f f +CIFL c i f l +CIHE c i h e +CIHR c i h r +cii c i i +CII c i i +CIID c i i d +CIJ c i j +CIKM c i k m +C.I.L. c i l +CIL c i l +cim c i m +Cim c i m +CIM c i m +Cio c i o +C.I.O. c i o +CIO c i o +CIOs c i o's +CIOT c i o t +CIPCA c i p c a +Cip c i p +C.I.P. c i p +CIP c i p +CIPD c i p d +CIPFA c i p f a +CIPM c i p m +CISA c i s a +CISC c i s c +cis c i s +CIs c i's +CIS c i s +CITB c i t b +cit c i t +CIT c i t +CiTD c i t d +CITM c i t m +CITN c i t n +CITP c i t p +citS c i t s +CITV c i t v +CITWF c i t w f +CitX c i t x +Ciuc c i u c +Ciu c i u +CiU c i u +CIU c i u +CIUT c i u t +CIVD c i v d +CIW c i w +CIWS c i w s +CIX c i x +Cixi c i x i +CIY c i y +CIZN c i z n +CJA c j a +CJBHL c j b h l +CJCA c j c a +CJCB c j c b +CJC c j c +C. J. c j +C.J. c j +CJD c j d +C. J. E. c j e +CJFL c j f l +CJFT c j f t +CJFX c j f x +CJGC c j g c +CJGO c j g o +CJHL c j h l +CJK c j k +CJL c j l +CJLS c j l s +CJM c j m +CJNT c j n t +CJOC c j o c +CJP c j p +C. J. R. c j r +C.J.R. c j r +CJR c j r +CJSC c j s c +C. J. S. c j s +CJS c j s +CJT c j t +CJUF c j u f +CJWC c j w c +CKAC c k a c +CKC c k c +C. K. c k +C.K. c k +CK c k +CKD c k d +CKE c k e +CKLM c k l m +CKLQ c k l q +CKLW c k l w +CKS c k s +CKSO c k s o +CKVL c k v l +C. K. W. c k w +CKWK c k w k +ckx c k x +CKXX c k x x +CKY c k y +CLAC c l a c +CLA c l a +CLAS c l a s +CLBs c l b's +clc c l c +CLC c l c +cl c l +C. L. c l +C.L. c l +CL c l +CLCN c l c n +CLD c l d +Cle c l e +CLE c l e +CLF c l f +C.L.G. c l g +CLG c l g +CLHIA c l h i a +CLHS c l h s +CLI c l i +CLK c l k +cllr c l l r +CLM c l m +CLMD c l m d +CLMP c l m p +CL&N c l and n +Clo c l o +CL&P c l and p +CLP c l p +CLRC c l r c +C. L. R. c l r +C.L.R. c l r +CLR c l r +CLRK c l r k +CLSA c l s a +CLSC c l s c +CLs c l's +CLS c l s +CLT c l t +CLTD c l t d +CLTPA c l t p a +CLTs c l t's +Clu c l u +CLU c l u +CLUK c l u k +CLV c l v +Clwyd c l w y d +CLX c l x +C&MA c and m a +CMAC c m a c +C.M.A. c m a +CMA c m a +CMAL c m a l +CMAP's c m a p's +CMAS c m a s +CMAT c m a t +C.M.B. c m b +CMB c m b +CMCC c m c c +CMCCDI c m c c d i +C.M.C. c m c +CMC c m c +cm c m +C. M. c m +C.M. c m +CM c m +CMCs c m c's +CMCS c m c s +CMD c m d +Cmde c m d e +CMDISE c m d i s e +cmdr c m d r +CMEC c m e c +CME c m e +CMF c m f +CMFS c m f s +C. M. G. c m g +C.M.G. c m g +CMG c m g +CMHC c m h c +CMH c m h +CMHR c m h r +CMI c m i +CMJ c m j +CMLA c m l a +cml c m l +C.M.L. c m l +CML c m l +CMLDP c m l d p +CMLL c m l l +CMLL's c m l l's +CMM c m m +CMMI c m m i +CMMs c m m's +cmn c m n +CMO c m o +CMO's c m o's +CMPC c m p c +CMP c m p +CMPS c m p s +CMPSO c m p s o +CMPV c m p v +CMQ c m q +CMQT c m q t +C. M. R. c m r +CMR c m r +CMSAF c m s a f +C.M.S. c m s +CMS c m s +C.M.S.L. c m s l +CMT c m t +Cmte c m t e +CMT's c m t's +CMTU c m t u +CMUCL c m u c l +CMU c m u +CMU's c m u's +CMV c m v +CMVM c m v m +CMVSS c m v s s +CMWF c m w f +CMXXII c m x x i i +CMYK c m y k +CNA c n a +CNBC c n b c +CNB c n b +CNC c n c +cn c n +C. N. c n +C.N. c n +CN c n +CNC's c n c's +CND c n d +CNDL c n d l +CNEB c n e b +CNE c n e +CNF c n f +CNFE c n f e +CNFK c n f k +CNG c n g +CNI c n i +CNJ c n j +CNJF c n j f +CNK c n k +C. N. L. c n l +C.N.L. c n l +CNL c n l +CNMs c n m's +CNN c n n +CNO c n o +CNPC c n p c +CNP c n p +cnr c n r +CNR c n r +CNRMA c n r m a +CNRS c n r s +CNSA c n s a +CNs c n's +CNS c n s +CNSS c n s s +CNSW c n s w +CNTA c n t a +CNT c n t +CNTE c n t e +CNTI c n t i +CNTK c n t k +CNTN c n t n +CNTs c n t's +CNTS c n t s +CNTV c n t v +CNU c n u +Cnut's c n u t's +CNV c n v +CNVs c n v's +CNW c n w +CNWS c n w s +CNZ c n z +COA c o a +C&O c and o +C. O. c o +C.O. c o +Co. company +C.O.D. c o d +Col. colonel +C.O.M.L. c o m l +CPAC c p a c +CPA c p a +CPA's c p a's +CPB c p b +CPBL c p b l +C&P c and p +CPC c p c +cp c p +C. P. c p +C.P. c p +CP c p +CPC's c p c's +CPCs c p c's +CPCS c p c s +CPD c p d +CPDM c p d m +CPD's c p d's +CPEB c p e b +CPEC c p e c +C.P.E. c p e +CPE c p e +CPEO c p e o +CPF c p f +CPFO c p f o +CPG c p g +CPHC c p h c +CPH c p h +CPI c p i +CPIFL c p i f l +CPIM c p i m +CPI's c p i's +CPJ c p j +CPL c p l +CPLP c p l p +CPM c p m +CPN c p n +CPNI c p n i +cpo c p o +C.P.O. c p o +CPO c p o +CPOE c p o e +CPPA c p p a +CPPCC c p p c c +CPP c p p +CPPE c p p e +CPPIB c p p i b +CPPM c p p m +CPQ c p q +CPR c p r +CPRS c p r s +CPSA c p s a +CPSC c p s c +CPS c p s +CPSF c p s f +CPSK c p s k +CPSL c p s l +CPSU c p s u +CPTA c p t a +CPT c p t +CPTM c p t m +CPUC c p u c +CPU c p u +CPUID c p u i d +CPUSA c p u s a +CPUs c p u's +CPUT c p u t +CPVA c p v a +CPV c p v +CPW c p w +CQAC c q a c +CQBR c q b r +CQC c q c +cq c q +CQ c q +CQD c q d +CQDs c q d's +CQM c q m +CQO c q o +CQU c q u +C. R. A. c r a +CRA c r a +C.R.A.Z.Y. c r a z y +CRBC c r b c +CRC c r c +cr c r +C. R. c r +C.R. c r +CR c r +Cre c r e +CRE c r e +CRF c r f +CRG c r g +CRHK c r h k +CRH's c r h's +CRHS c r h s +CRJ c r j +crk c r k +Crkva c r k v a +crkve c r k v e +CRL c r l +CRLs c r l's +crm c r m +CRM c r m +CRNA c r n a +CRN c r n +Crne c r n e +Crni c r n i +Crno c r n o +CRP c r p +CRPF c r p f +CRRF c r r f +CRs c r's +CRS c r s +CRSP c r s p +CRST c r s t +CRTC c r t c +CRT c r t +CRTC's c r t c's +CRUA c r u a +CRWRC c r w r c +CRW's c r w's +CRX c r x +CSAC c s a c +csa c s a +Csa c s a +C.S.A. c s a +CSA c s a +CSAH c s a h +Csak c s a k +Csaky c s a k y +CSAR c s a r +CSAT c s a t +CSAV c s a v +CSB c s b +C&S c and s +C.S.C. c s c +CSC c s c +CSCD c s c d +CSCE c s c e +CSCR c s c r +cs c s +C.s c's +Cs c's +C. S. c s +C.S. c s +CS c s +CSC's c s c's +CSDA c s d a +CSDB c s d b +CSD c s d +CSDL c s d l +CSDN c s d n +CSDP c s d p +CSD's c s d's +CSDS c s d s +CSE c s e +C&SF c and s f +CSF c s f +CSFL c s f l +CSFSO c s f s o +CSGA c s g a +csg c s g +CSG c s g +CSG's c s g's +CSH c s h +CSHL c s h l +CSIC c s i c +CsI c s i +CSI c s i +CSIDC c s i d c +CSILUS c s i l u s +CSIO c s i o +CSIR c s i r +CSIRO c s i r o +CSis c s i's +CSIs c s i's +CSIS c s i s +CSIU c s i u +CSKA c s k a +CSKA's c s k a's +CSK c s k +CSK's c s k's +CSL c s l +CSLI c s l i +CSM c s m +CSNB c s n b +CSNBX c s n b x +CSN c s n +CSN's c s n's +CSOB c s o b +CSO c s o +CSO's c s o's +CSOs c s o's +cspA c s p a +csp c s p +CSP c s p +CSPH c s p h +CSPI c s p i +CSPRA c s p r a +CSPs c s p's +CSRA c s r a +CSR c s r +CSRS c s r s +CSRT c s r t +CSRTT c s r t t +CSSA c s s a +CSS c s s +CSSD c s s d +CSSE c s s e +CSSL c s s l +CSSNCs c s s n c's +CSSR c s s r +CSSS c s s s +CSST c s s t +CSTB c s t b +CST c s t +CSTF c s t f +CSTI c s t i +CSTS c s t s +CSUB c s u b +CSU c s u +CSU's c s u's +Csuz c s u z +CSV c s v +CSW c s w +CSWF c s w f +CSWIP c s w i p +CSWS c s w s +CSX c s x +CSX's c s x's +CSXT c s x t +C.T.A. c t a +CTA c t a +CTAF c t a f +CTARL c t a r l +CTA's c t a's +CTAs c t a's +CTBT c t b t +CTBTO c t b t o +C&T c and t +CTC c t c +ct c t +C. T. c t +C.T. c t +CT c t +CTD c t d +cte c t e +CTE c t e +CTEQ c t e q +CTF c t f +CTGF c t g f +CTI c t i +CTLA c t l a +CTL c t l +CTLLS c t l l s +CTLs c t l's +CTM c t m +CTN c t n +CTO c t o +CTP c t p +ctr c t r +CTRG c t r g +Ctrip c t r i p +CTRL c t r l +CTRP c t r p +CTR's c t r's +CTS c t s +CTSD c t s d +CTSF c t s f +CTSG c t s g +CTUC c t u c +CTU c t u +CTUG c t u g +CTU's c t u's +CTVA c t v a +ctv c t v +CTV c t v +CTV's c t v's +CTX c t x +CTZ c t z +cu c u +C. U. c u +CU c u +C.U.L. c u l +C. U. S. c u s +C. U. T. c u t +CUW c u w +Cuyp c u y p +CVA c v a +CVAK c v a k +CVARG c v a r g +CVB c v b +C&V c and v +CVC c v c +cvcp c v c p +'cv c v +cv c v +C. V. c v +C.V. c v +CV c v +CVD c v d +CVEs c v e's +CVG c v g +CVI c v i +CVJM c v j m +CVM c v m +C.V.N. c v n +CVN c v n +C.V.O. c v o +CVO c v o +CVODE c v o d e +CVOs c v o's +CVP c v p +CVR c v r +CVs c v's +CVS c v s +CVSNT c v s n t +CVT c v t +CVTs c v t's +CVV c v v +CVVHDF c v v h d f +CVW c v w +CVZ c v z +CWA c w a +CWBI c w b i +CWBL c w b l +CWC c w c +C. W. c w +C.W. c w +CWD c w d +CWDS c w d s +C. W. E. c w e +CWE c w e +Cwej c w e j +Cwele c w e l e +CWF c w f +CWGC c w g c +CWG c w g +CWI c w i +C. W. K. c w k +cwm c w m +CWM c w m +CWO c w o +CWPA c w p a +CWR c w r +cwrt c w r t +CWRU c w r u +CWSAC c w s a c +CW's c w's +CWS c w s +CWTS c w t s +CWUR c w u r +C. W. Y. c w y +CWYFL c w y f l +CXC c x c +CXCL c x c l +CXCR c x c r +C.X. c x +C. Y. c y +C.Y. c y +cyl c y l +Cyn c y n +CYOG c y o g +CyP c y p +CYP c y p +Cyrl c y r l +Cys c y's +CYS c y s +CYSK c y s k +CYSY c y s y +czci c z c i +cz c z +C.Z. c z +CZ c z +CZE c z e +CZM c z m +CZW c z w +czy c z y +DAAD d a a d +Daai d a a i +D. A. d a +D.A. d a +D&AD d and a d +D. A. H. d a h +D.A.M. d a m +D.A.N.C.E. dance +D. A. T. d a t +Dav d a v +D.A.V. d a v +DAV d a v +DAV's d a v's +dBa d b a +DBA d b a +DBC d b c +DBCS d b c s +db d b +D. B. d b +D.B. d b +DB d b +DBE d b e +DBI d b i +DBL d b l +DBLE d b l e +DBLP d b l p +DBM d b m +DBMS d b m s +DBR d b r +DB's d b's +D. B. S. d b s +DBS d b s +DBU d b u +DBYC d b y c +DBZ d b z +DCA d c a +DCAF d c a f +DCAM d c a m +DCB d c b +DCCC d c c c +DCCCD d c c c d +DCC d c c +DCCG d c c g +DCCs d c c's +D&C d and c +dc d c +D. C. d c +D.C. d c +DC d c +DCE d c e +DCFC d c f c +DCF d c f +DCG d c g +DCH d c h +DCI d c i +DCK d c k +D.C.L. d c l +DCL d c l +DCMA d c m a +DCM d c m +DCMF d c m f +DCMI d c m i +DCMS d c m s +DCO d c o +DCom d c o m +DCOM d c o m +DCP d c p +DCR d c r +D.C.'s d c's +DC's d c's +DCs d c's +DCS d c s +DCSD d c s d +DCSO d c s o +DCSPER d c s p e r +DCSS d c s s +DCTA d c t a +DCT d c t +DCU d c u +DCUO d c u o +DCUs d c u's +DDA d d a +DDB d d b +D.D.C. d d c +DDC d d c +D&D d and d +D. D. d d +D.D. d d +DDF d d f +DDG d d g +DDHH d d h h +DDi d d i +DDI d d i +DDK d d k +DDLJ d d l j +DDM d d m +DDMS d d m s +DDN d d n +DDNOS d d n o s +Ddoc d d o c +DDO d d o +DDP d d p +DDR d d r +DDRMAX d d r m a x +DDSB d d s b +D.D.S. d d s +DDS d d s +DDT d d t +DDTV d d t v +Ddu d d u +DDWFTTW d d w f t t w +DDX d d x +D.E.A.F. d e a f +Deah d e a h +DEA's d e a's +DECC d e c c +DEC d e c +DECS d e c s +DEDD d e d d +D. E. d e +D.E. d e +deg d e g +D. E. G. d e g +DEG d e g +DEH d e h +DEHP d e h p +dei d e i +Dei d e i +DeI d e i +DEI d e i +Deijm d e i j m +Deip d e i p +D. E. J. d e j +D.E.R. d e r +dez d e z +Dez d e z +Dfa d f a +DFA d f a +DFB d f b +D.F.C. d f c +DFC d f c +DFCs d f c's +D. F. d f +D.F. d f +DFD's d f d's +DfE d f e +D.F.E. d f e +DFE d f e +DfES d f e s +DFF d f f +DFG d f g +DFJ d f j +DFL d f l +DFM d f m +DFOA d f o a +DFO d f o +DFP d f p +DFPs d f p's +DFRC d f r c +DFR d f r +DFs d f's +DFS d f s +DFT d f t +DFW d f w +dfx d f x +DFX d f x +DGAC d g a c +DGA d g a +DGALS d g a l s +DGAP d g a p +DGB d g b +DGCA d g c a +DGC d g c +DGCR d g c r +D&G d and g +D. G. d g +D.G. d g +D. G. E. d g e +DGE d g e +DGERT d g e r t +DGF d g f +DGFI d g f i +DGH d g h +DGK d g k +D. G. L. R. d g l r +DGM d g m +DGMO d g m o +DGP d g p +DGPS d g p s +DGR d g r +Dha d h a +DHA d h a +DHB d h b +DHBs d h b's +DHCP d h c p +D&H d and h +dh d h +D. H. d h +D.H. d h +DH d h +DHEA d h e a +d'HEC d h e c +dhe d h e +DHE d h e +Dheku d h e k u +DHFS d h f s +DHHC d h h c +DHH d h h +DHL d h l +DHMO d h m o +DHNC d h n c +D.H.N. d h n +DHNS d h n s +Dhod d h o d +dhol d h o l +Dhol d h o l +Dhoo d h o o +Dhor d h o r +Dhou d h o u +DHP d h p +DHPH d h p h +DHQ d h q +dhr d h r +D.H.R. d h r +DHRS d h r s +DHS d h s +DHSs d h s's +DHSS d h s s +DHT d h t +DHV d h v +DHW d h w +DHX d h x +D.I. d i +DIFC d i f c +DISD d i s d +DIW d i w +DIX d i x +diy d i y +DiY d i y +D.I.Y. d i y +DIY d i y +Diyn d i y n +DIYs d i y's +D. J. A. d j a +Djam d j a m +dj d j +D. J. d j +D.J. d j +DJ d j +DJ'ed d j e d +Djem d j e m +D.J.H. d j h +Dji d j i +DJI d j i +D.J.N. d j n +Djo d j o +D'Jok d j o k +djr d j r +DJR d j r +D.J.s d j's +DJ's d j's +DJs d j's +D. J. S. d j s +D.J.T. d j t +DjVu d j v u +DJVU d j v u +DjVus d j v u's +D. J. Y. d j y +DKC d k c +D. K. d k +D.K. d k +DKI d k i +DKIM d k i m +DKK d k k +DKNY d k n y +DKPP d k p p +D. K. R. d k r +DKW d k w +dla d l a +DLA d l a +DLC d l c +DLD d l d +dl d l +D. L. d l +D.L. d l +DL d l +DLE d l e +D.L.F. d l f +DLF d l f +DLFN d l f n +DLG d l g +D. L. H. d l h +dlia d l i a +DLI d l i +DLJ d l j +DLJ's d l j's +DLK d l k +DLL d l l +DL&LR d l and l r +DLL's d l l's +DLLs d l l's +DLM d l m +DLMPST d l m p s t +dlo d l o +DLP d l p +DLPFC d l p f c +DLP's d l p's +DLR d l r +DLS d l s +DLSS d l s s +DLSU d l s u +DLSU's d l s u's +DLT d l t +DL&W d l and w +DLZ d l z +DMAA d m a a +DMA d m a +DMB d m b +DMBT d m b t +DMCA d m c a +DMCC d m c c +DMC d m c +DMCM d m c m +D.M.C.'s d m c's +D&M d and m +DMD d m d +DMDK d m d k +D. M. d m +D.M. d m +DM d m +DMDS d m d s +DMed d m e d +DM&E d m and e +DME d m e +DMF d m f +DMG d m g +DMGT d m g t +DMHS d m h s +DMI d m i +DMK d m k +DML d m l +DMN d m n +DMO d m o +DMOFD d m o f d +DMOZ d m o z +DMP d m p +DMRC d m r c +DMR d m r +DMRG d m r g +DMs d m's +DMS d m s +DMSII d m s i i +DMT d m t +DMTF d m t f +DMU d m u +DMUs d m u's +DMV d m v +DMX d m x +DMZ d m z +Dna d n a +DnA d n a +DNA d n a +DNADTC d n a d t c +DNAITV d n a i t v +DNAJA d n a j a +DNAJC d n a j c +DnaJ d n a j +DNAN d n a n +DNB d n b +DNBY d n b y +DNC d n c +DNCG d n c g +DND d n d +D. N. d n +D.N. d n +Dnepr d n e p r +dnes d n e s +Dnes d n e's +DNES d n e s +DNF d n f +DNF's d n f's +DNFs d n f's +DNG d n g +DNJO d n j o +DNKA d n k a +DNK d n k +DNM d n m +DNMT d n m t +DNP d n p +DNQ d n q +DNR d n r +DNSBLs d n s b l's +dns d n s +D.N.S. d n s +DNS d n s +DNSS d n s s +DNT d n t +DNU d n u +DNVP d n v p +D.O.A. d o a +D.O.A.'s d o a's +DOAS d o a s +D.O.B. d o b +D.O.C. d o c +DOCG d o c g +dod d o d +Dod d o d +DoD d o d +DOD d o d +D. O. d o +D.O. d o +DOD's d o d's +D.O.E. d o e +DOGNY d o g n y +DOHC d o h c +D'oh d o h +DOJ d o j +DOJ's d o j's +dok d o k +Dok d o k +domt d o m t +Domt d o m t +Dop d o p +DOP d o p +DOPR d o p r +DOSAAF d o s a a f +DOTC d o t c +dotCMS d o t c m s +DOTD d o t d +DOTP d o t p +DotSVN d o t s v n +Douw d o u w +DOW d o w +DOXO d o x o +dozd d o z d +d'OZ d o z +Dozhd d o z h d +DPAA's d p a a's +DPA d p a +DPB d p b +DPD d p d +dp d p +D. P. d p +D.P. d p +DP d p +DPG d p g +DPJ d p j +DPMA d p m a +DPM d p m +DPN d p n +DPNM d p n m +DPO d p o +dpon d p o n +DPP d p p +DPP's d p p's +DPPX d p p x +DPR d p r +DPRK d p r k +DPRK's d p r k's +DProf d p r o f +DPRP d p r p +DPRT d p r t +DPs d p's +DPS d p s +DPSS d p s s +DPSSL d p s s l +DPT d p t +DPW d p w +DPW's d p w's +DPX d p x +DPYS d p y s +D.Q. d q +DQOY d q o y +DQV d q v +DRB d r b +DRBG d r b g +DRB's d r b's +DRCA d r c a +drc d r c +DRC d r c +DRDA d r d a +DRDC d r d c +DRD d r d +Dr. doctor +D. R. d r +D.R. d r +DRG d r g +dri d r i +Dri d r i +DRI d r i +DRIs d r i's +DRITTES d r i t t e s +Driu d r i u +Driv d r i v +DRJTBC d r j t b c +DRK d r k +DRL d r l +DRLR d r l r +DRMC d r m c +D.R.M. d r m +DRM d r m +Drnis d r n i's +Dro d r o +DRO d r o +DRP d r p +Drs. doctors +DR's d r's +DRS d r s +Drska d r s k a +DRT d r t +druj d r u j +DSA d s a +DsbA d s b a +DS&BB d s and b b +DSB d s b +DSBL d s b l +D.S.C. d s c +DSC d s c +D.S.C.H. d s c h +DSCM d s c m +DSCR d s c r +DSCS d s c s +DSDB d s d b +DSD d s d +DSDM d s d m +dsDNA d s d n a +DSDP d s d p +ds d s +Ds d's +D. S. d s +D.S. d s +DS d s +DSDS d s d s +DSG d s g +DSGi d s g i +DSIC d s i c +dsi d s i +DSi d s i +DSI d s i +DSIF d s i f +DSIR d s i r +DSJ d s j +dsl d s l +D. S. L. d s l +DSL d s l +DSLR d s l r +DSMB d s m b +D.S.M. d s m +DSM d s m +DSMs d s m's +dsn d s n +D&SNGRR d and s n g r r +DSNP d s n p +D.S.O. d s o +DSO d s o +DSPA d s p a +DSP d s p +DSR d s r +DS's d s's +DSS d s s +DST d s t +dsu' d s u +DSU d s u +DSV d s v +DSW d s w +DSX d s x +DSZG d s z g +D.T.A. d t a +DTA d t a +DTC d t c +DTC's d t c's +DTCs d t c's +DTDC d t d c +DTD d t d +DTDs d t d's +D. T. d t +D.T. d t +DT&E d t and e +DTE d t e +DTEK d t e k +DTES d t e s +DTG d t g +DTH d t h +DTIC d t i c +DT&I d t and i +DTI d t i +DTLA d t l a +dtl d t l +DTL d t l +DTLLS d t l l s +DTLS d t l s +DTM d t m +DTO d t o +DTPA d t p a +DTPC d t p c +DTRA d t r a +DTR d t r +DTRS d t r s +DTs d t's +DTS d t s +DTT d t t +D.T.U. d t u +DTU d t u +DTV d t v +dty d t y +D.U. d u +dva d v a +Dva d v a +DVA d v a +DVB d v b +DVBE d v b e +DVBIC d v b i c +DVC d v c +DVCs d v c's +DVCS d v c s +dvd d v d +DVD d v d +DVD's d v d's +DVDs d v d's +dv d v +D. V. d v +D.V. d v +DV d v +dve d v e +dvfb d v f b +DVFS d v f s +DVGS d v g s +DVHS d v h s +dvi d v i +DVI d v i +dvije d v i j e +Dvin d v i n +Dvir d v i r +DVLA d v l a +DVLA's d v l a's +DVL d v l +DVM d v m +DVP d v p +DVR d v r +DVRJRBC d v r j r b c +DVR's d v r's +DVSC d v s c +DVS d v s +DVT d v t +DVV d v v +DVVT d v v t +DVWK d v w k +Dwa d w a +DWA d w a +D&W d and w +D. W. d w +D.W. d w +Dwedw d w e d w +DWET d w e t +DWF d w f +DWG d w g +D.W.H. d w h +Dwi d w i +DWI d w i +DWM d w m +DWN d w n +DWNU d w n u +DWP d w p +dwr d w r +DWR d w r +DWRFC d w r f c +DWS d w s +DWT d w t +DWTS d w t s +dwur d w u r +dxa d x a +DXA d x a +dx d x +D.X. d x +DX d x +DXED d x e d +DXers d x e r's +DXII d x i i +DXK d x k +DXR d x r +DXZ d x z +Dydd d y d d +dy d y +Dy d y +D. Y. d y +DY d y +DYFI d y f i +DYIS d y i s +DYNC d y n c +dypl d y p l +dyr d y r +DYSP d y s p +DZBB d z b b +DZB d z b +dz d z +DZEC d z e c +DZEM d z e m +dzis d z i s +DZNE d z n e +Dzog d z o g +Dzor d z o r +DZRH d z r h +DZRH's d z r h's +DZS d z s +Dzus d z u's +DZXL d z x l +DZZ d z z +EAAB e a a b +EAA e a a +EAAP e a a p +E. A. C. e a c +EAC e a c +EACEF e a c e f +EACS e a c s +EAD e a d +E. A. e a +E.A. e a +EAF e a f +EAGE e a g e +E.A.H. e a h +EAH e a h +EAI e a i +EAIE e a i e +E. A. J. e a j +EAMs e a m's +EAP e a p +E.A.R.L. e a r l +E.A.R.T.H. e a r t h +EASA e a s a +EASB e a s b +eas e a s +Eas e a's +EA's e a's +EAS e a s +Eav e a v +EAX e a x +E. B. e b +E.B. e b +EBL e b l +Ebn e b n +EBNF e b n f +EBOV e b o v +E&BR e and b r +EBR e b r +Ebru e b r u +EBS e b s +EBSL e b s l +EBT e b t +EBU e b u +EBV e b v +E.B.W. e b w +EBWs e b w's +EBZR e b z r +ECAC e c a c +ECA e c a +ECAR e c a r +ECB e c b +ECBJ e c b j +ECBL e c b l +ECCA e c c a +ECCC e c c c +ecc e c c +ECC e c c +ECCI e c c i +Eccl e c c l +ECCRFA e c c r f a +ECCW e c c w +ECD e c d +ec e c +Ec e c +E. C. e c +E.C. e c +EC e c +ece e c e +Ece e c e +ECE e c e +Ecem e c e m +ECFA e c f a +ECF e c f +ECFR e c f r +ECFU e c f u +ecg e c g +ECG e c g +ECH e c h +ECHL e c h l +ECHR e c h r +ECI e c i +ECJ e c j +ECLAC e c l a c +ECLA e c l a +ECLC e c l c +ECL e c l +ECLI e c l i +ECLSS e c l s s +ecma e c m a +ECMA e c m a +ECMC e c m c +ECMDB e c m d b +E.C.M. e c m +ECM e c m +ECMI e c m i +ECML e c m l +ECMLRUS e c m l r u s +ECMWF e c m w f +ECN e c n +ECNP e c n p +ECNs e c n's +ECNS e c n s +ECNZ e c n z +ECP&DA's e c p and d a's +ECP e c p +ECPR e c p r +ECQ e c q +ECR e c r +eCRM e c r m +ECRR e c r r +ECR's e c r's +ECSA e c s a +EC's e c's +E. C. S. e c s +E.C.S. e c s +ECS e c s +ect e c t +E. C. T. e c t +ECT e c t +ECTLO e c t l o +ECTN e c t n +ECTS e c t s +ECV e c v +ECVs e c v's +ECWA e c w a +ECW e c w +edb e d b +EDB e d b +EDC e d c +E. D. e d +E.D. e d +EDF e d f +Edh e d h +EDH e d h +edhe e d h e +EDHF e d h f +EDIB e d i b +EDI e d i +EDK e d k +EDL e d l +EDMA e d m a +EDM e d m +EDMs e d m's +EDMW e d m w +Edmx e d m x +edn e d n +Edn e d n +EDN e d n +EDP e d p +EDQH e d q h +E.D.R. e d r +EDRP e d r p +EDSA e d s a +EDSC e d s c +eds e d s +Eds e d's +E. D. S. e d s +EDS e d s +EDSP e d s p +EDTA e d t a +EDT e d t +EDVAC e d v a c +EDWDO e d w d o +Edw e d w +EDXRD e d x r d +EEA e e a +EEAF e e a f +EEAS e e a s +EEBC e e b c +Eeb e e b +EEC e e c +EECS e e c s +E. E. e e +E.E. e e +Eef e e f +EEF e e f +Eega e e g a +EEI e e i +EEI's e e i's +EEJF e e j f +EELC e e l c +eene e e n e +EEOC e e o c +EEPCO e e p c o +eep e e p +EEP e e p +EERC e e r c +EERI e e r i +Ees e e's +EES e e s +EEST e e s t +EEUU e e u u +eeuw e e u w +Eeuw e e u w +EEZs e e z's +EFA e f a +EFAS e f a s +EFCC e f c c +efc e f c +EFC e f c +EFCJ e f c j +EFD e f d +ef e f +Ef e f +E. F. e f +E.F. e f +EF e f +E. F. J. e f j +E. F. K. e f k +EFL e f l +EFM e f m +EFNB e f n b +EFPA e f p a +EFP e f p +EFQUEL e f q u e l +EFR e f r +EFRU e f r u +EFSA e f s a +eFS e f s +Efs e f's +EFSET e f s e t +EFTPOS e f t p o s +EFUA e f u a +Efu e f u +EFV e f v +EFVR e f v r +EFVS e f v s +E. F. W. e f w +EFX e f x +EFY e f y +E. G. A. e g a +EGA e g a +Egba e g b a +EGBA e g b a +EGBT e g b t +EGC e g c +EGD e g d +EGF e g f +egfl e g f l +EGFL e g f l +e.g. for example +e. g. for example +EGFR e g f r +EG&G e g and g +E. G. H. e g h +Egi e g i +EGL e g l +EGM e g m +E&GR e and g r +EGR e g r +EGREM e g r e m +EGSC e g s c +EGX e g x +egy e g y +EGY e g y +Egyl e g y l +EHAAT e h a a t +EHAs e h a's +EHC e h c +EHCI e h c i +EHD e h d +E. H. e h +E.H. e h +ehf e h f +EHF e h f +E. H. M. e h m +EHP e h p +EHRC e h r c +EHR e h r +EHS e h s +EHSH e h s h +Ehttp e h t t p +EIA e i a +EIC e i c +EiCs e i c's +EIC's e i c's +E. I. e i +E.I. e i +EIES e i e s +eIF e i f +EIF e i f +EIFF e i f f +EIF's e i f's +EIT e i t +EITI e i t i +Eitr e i t r +EITs e i t's +EIU e i u +E. J. A. e j a +EJB e j b +EJBs e j b's +EJC e j c +ej e j +E. J. e j +E.J. e j +EJ e j +E. J. H. e j h +E.J.H. e j h +EJH e j h +EJHL e j h l +EJMA e j m a +E. J. M. e j m +EJML e j m l +E. J. R. e j r +E.J.S. e j s +EJSM e j s m +EJV e j v +EKB e k b +EKBO e k b o +EKCO's e k c o's +EKD e k d +E. K. e k +E.K. e k +EKF e k f +EKG e k g +eki e k i +EKIZ e k i z +EKL e k l +EKLR e k l r +Ekma e k m a +EKNU e k n u +Ekow e k o w +eks e k s +Eks e k's +EKS e k s +E. K. U. e k u +EKU e k u +E. L. C. e l c +E. L. e l +E.L. e l +ELH e l h +ELTs e l t's +ELUs e l u's +ELV e l v +EMA e m a +EMAS e m a s +Embd e m b d +EMB e m b +eMC e m c +EMC e m c +EMD e m d +EMD's e m d's +EMDs e m d's +EMDS e m d s +Emea e m e a +EMEA e m e a +E&M e and m +E. M. e m +E.M. e m +EMF e m f +Emge e m g e +EMG e m g +EMLL e m l l +E.M.M. e m m +EMNLP e m n l p +EMP e m p +emra e m r a +EMR e m r +EMSC e m s c +E.M.S. e m s +EMTE e m t e +EMT e m t +EMV e m v +E&NA e and n a +Enas e n a's +ENAS e n a s +EnBW e n b w +ENC e n c +EncFS e n c f s +Encyc e n c y c +E.N.D. e n d +ENEC e n e c +E. N. e n +E.N. e n +Enes e n e's +engl e n g l +Engl e n g l +ENGM e n g m +Engr e n g r +Eni e n i +ENI e n i +enn e n n +Enn e n n +ENP e n p +ENR e n r +ens e n s +Ens e n's +ENS e n s +Enso e n s o +ENSO e n s o +ENTJs e n t j's +ENTP e n t p +ENTV e n t v +EOC e o c +EOC's e o c's +EoD e o d +EOD e o d +E. O. e o +E.O. e o +EOFFTV e o f f t v +EOG e o g +Eois e o i's +EOKA e o k a +eok e o k +Eole e o l e +Eol e o l +EOL e o l +Eolss e o l s's +Eom e o m +EOOW e o o w +eop e o p +eoptta e o p t t a +Eora e o r a +EOR e o r +Eorl e o r l +Eors e o r's +EOSHD e o s h d +EOTC e o t c +EOTDC e o t d c +EOU e o u +E.O.W. e o w +E&P e and p +Epe e p e +E. P. E. e p e +EPEG e p e g +ep e p +Ep e p +E. P. e p +E.P. e p +EP e p +EPF e p f +EPFL e p f l +EPG e p g +EPHAR e p h a r +EPHB e p h b +Eph e p h +EPH e p h +Ephs e p h's +EPIA e p i a +epi e p i +Epi e p i +EPI e p i +E.P.J. e p j +EPL e p l +EPLF e p l f +EPM e p m +EPOC e p o c +ePO e p o +EPO e p o +epos' e p o's +epos e p o s +Epos e p o's +EPRDF e p r d f +EPR e p r +EPRI e p r i +EPRO e p r o +EPSC e p s c +E.P.s e p's +EPT e p t +EPV e p v +EPZA e p z a +EPZ e p z +EQAO e q a o +eq e q +Eq e q +EQ e q +EQG e q g +EQN e q n +EQP e q p +EQS e q s +EQT e q t +E.R.A. e r a +ERAF e r a f +ERAU e r a u +ERCB e r c b +ERC e r c +ERCES e r c e s +ERCIM e r c i m +ERCS e r c s +E. R. D. e r d +E. R. e r +E.R. e r +ERF e r f +ERH e r h +ERJs e r j's +ERK e r k +ERP e r p +ERPM e r p m +ERPMRP e r p m r p +ERRC e r r c +E. R. R. e r r +E.R.R. e r r +ERSAR e r s a r +ERT e r t +Eru e r u +ERU e r u +ERUUF e r u u f +Eruv e r u v +Erv e r v +ERW e r w +ES3 e s three +Esa e s a +E.S.A. e s a +ESA e s a +Esam e s a m +Esa's e s a's +ESA's e s a's +Esat e s a t +ESB e s b +ESC e s c +ESCHL e s c h l +ESCs e s c's +Esd e s d +ESD e s d +ESDI e s d i +E.S.E. e s e +E. S. e s +E.S. e s +ESF e s f +ESFG e s f g +E.S.G. e s g +ESG e s g +ESGR e s g r +esi e s i +ESI e s i +ESL e s l +ESM e s m +ESMLC e s m l c +ESMT e s m t +ESNAGI e s n a g i +ESN e s n +ESPA e s p a +ESPC e s p c +ESPD e s p d +ESP e s p +espn e s p n +ESPN e s p n +ESPNhttp e s p n h t t p +ESPN's e s p n's +ESPNU e s p n u +ESPNW's e s p n w's +esq e s q +Esq e s q +Esq. esquire +Esraa e s r a a +Esra e s r a +ESRB e s r b +ESRC e s r c +Esref e s r e f +ESR e s r +ESRF e s r f +Esri e s r i +ESRI e s r i +ESSR e s s r +estd e s t d +Estd e s t d +EST e s t +ESTP e s t p +esu e s u +ESU e s u +ESU's e s u's +Esva e s v a +ESV e s v +ESWAT e s w a t +ESW e s w +Etad e t a d +ETA e t a +ETAF e t a f +ETA's e t a's +ETASU e t a s u +ETB e t b +ETBs e t b's +E.T.C. e t c +ETCO's e t c o's +ETCS e t c s +ETCSL e t c s l +ETD e t d +E. T. e t +E.T. e t +ETF e t f +ETFs e t f's +ETFS e t f s +Et'hem e t h e m +ETH e t h +Eti e t i +ETI e t i +ETIM e t i m +ETIM's e t i m's +etj e t j +ETJ e t j +ETL e t l +ETNZ e t n z +Eto e t o +ETO e t o +ETRM e t r m +ETRS e t r s +ETSEIB e t s e i b +ets e t s +Ets e t's +ET's e t's +ETs e t's +ETS e t s +ett e t t +Ett e t t +ETT e t t +Ettre e t t r e +Etts e t t's +ETU e t u +ETV e t v +Etz e t z +EUA e u a +EUB e u b +EUBs e u b's +EUBS e u b s +EUCAP e u c a p +EUCE e u c e +EUC e u c +EUCOM's e u c o m's +EUDEC e u d e c +EUD e u d +E. U. e u +E.U. e u +EU e u +eup e u p +EUP e u p +Eurwg e u r w g +EUSA e u s a +Euse e u s e +EU's e u's +EUS e u s +EUSEW e u s e w +Eusi e u s i +EUV e u v +EUX e u x +EVAAP e v a a p +EvaGT e v a g t +EVDC e v d c +EVD e v d +EVDO e v d o +E. V. e v +E.V. e v +EVEX e v e x +EVIT e v i t +evl e v l +EVL e v l +EVM e v m +Evna e v n a +EVN e v n +EVNS e v n s +evnt e v n t +E.V.O. e v o +E.V.O.L. e v o l +EVP e v p +EVR e v r +EVs e v's +EVS e v s +evv e v v +EVV e v v +Ewa's e w a's +EWD e w d +EWEB e w e b +E. W. e w +E.W. e w +EWF e w f +EWF's e w f's +Ewha e w h a +EWH e w h +E.W.K. e w k +EWLA e w l a +EWL e w l +EWO e w o +EWOs e w o's +EWP e w p +EW's e w's +EWS e w s +EWTN e w t n +Ewu e w u +EWU e w u +excl e x c l +exd e x d +E.X. e x +exhb e x h b +exh e x h +EXI e x i +EXIF e x i f +EXIN e x i n +EXL e x l +EXLM e x l m +E. X. M. e x m +Exptl e x p t l +EXR e x r +exsul e x s u l +EXT e x t +EYA e y a +EYCN e y c n +EYD e y d +E&Y e and y +E. Y. e y +EY e y +Eyk e y k +eyu e y u +Ezaa e z a a +ez e z +Ez e z +EZ e z +Ezh e z h +EZH e z h +EZO e z o +EZR e z r +EZTV e z t v +Ezu e z u +EZW e z w +Ezy e z y +Faaa f a a a +faa f a a +Faa f a a +FAA f a a +faama f a a m a +FAANP f a a n p +FabH f a b h +FABM f a b m +FabR f a b r +F.A.B.'s f a b's +F.A.C.E. f a c e +FACR f a c r +F.A.C.S. f a c s +FADD f a d d +Fadl f a d l +FADS f a d s +FAEM f a e m +fa f a +Fa f a +F. A. f a +F.A. f a +FA f a +Faf f a f +FAFG f a f g +Fafhrd f a f h r d +FAFL f a f l +F. A. G. f a g +F.A.H. f a h +fai f a i +Fai f a i +FAI f a i +FAIM f a i m +FAIP f a i p +FAIPs f a i p's +Faiq f a i q +fajn f a j n +FAK f a k +Fal f a l +FAL f a l +F.A.M.E. f a m e +F.A.M. f a m +FAQ f a q +FARC's f a r c's +FARDC f a r d c +F.A.R. f a r +farw f a r w +FASA f a s a +FASB f a s b +fasc f a s c +Fasc f a s c +fas f a s +Fas f a's +FAs f a's +F.A.S. f a s +FAS f a s +FASG f a s g +FasL f a s l +FASRE f a s r e +FATF f a t f +FAUP f a u p +FAVC f a v c +FBA f b a +FBD f b d +FBFA f b f a +F. B. f b +F.B. f b +FB f b +F.B.G.s f b g's +F.B.I. f b i +FBI f b i +FBI's f b i's +FBK f b k +FBL f b l +FBMW f b m w +FBN f b n +FBO f b o +FBOs f b o's +FBPA f b p a +FBR f b r +FBS f b s +FBSN f b s n +FBSU f b s u +FBT f b t +FCA f c a +fcb f c b +FCB f c b +FCBF f c b f +F.C.B.I. f c b i +FCBL f c b l +FCBs f c b's +F.C.C. f c c +FCC f c c +FCD f c d +F&C f and c +fc f c +F. C. f c +F.C. f c +FCF f c f +FCGR f c g r +F. C. H. f c h +F.C.H.L. f c h l +FCIAC f c i a c +FCIC f c i c +FCI f c i +FCIP f c i p +FCK f c k +FCL f c l +FCNM f c n m +FCNZ f c n z +FCO f c o +FCP f c p +F.C.P.R.E.M.I.X. f c p r e m i x +FCPS f c p s +FCRLA f c r l a +F.C.'s f c's +FC's f c's +FCS f c s +FCT f c t +FCU f c u +FCUL f c u l +FCV f c v +F. C. W. f c w +FCW f c w +FCW's f c w's +FDA f d a +FDCC f d c c +FD&C f d and c +FDCPA f d c p a +FDCPAs f d c p a's +FDD f d d +FDDI f d d i +FDE f d e +F. D. f d +F.D. f d +FDFL f d f l +FDGB f d g b +FDG f d g +FDICs f d i c's +FdI f d i +FDI f d i +FDIO f d i o +FDJ f d j +FDL f d l +FDLT f d l t +FDM f d m +FDMNES f d m n e s +FDNY f d n y +FDP f d p +FDP's f d p's +FDR f d r +FDU f d u +F. E. f e +F.E. f e +FEFK f e f k +FEFSI f e f s i +FEFY f e f y +FEG f e g +FEGs f e g's +FEP f e p +F.E.R.S. f e r s +Fes f e's +FES f e s +FFA f f a +FFAK f f a k +ffc f f c +FFC f f c +FFC's f f c's +FFDO f f d o +ff f f +F. F. f f +F.F. f f +FF f f +FFF f f f +FFG f f g +FFH f f h +FFI f f i +FFK f f k +FFL f f l +FFL's f f l's +FFME f f m e +ffm f f m +FFOM f f o m +FFP f f p +FFPIR f f p i r +FFR f f r +FFSA f f s a +FF's f f's +FFs f f's +FFS f f s +FFU f f u +FFV f f v +FFWD f f w d +FGCU f g c u +FGFA f g f a +FGF f g f +F. G. f g +F.G. f g +FGFR f g f r +FGID f g i d +fgk f g k +FGL f g l +FGM f g m +FGR f g r +FGs f g's +FGS f g s +FGU f g u +FGV f g v +F. H. A. f h a +FHA f h a +FHAR f h a r +F. H. C. f h c +FHFA f h f a +F. H. f h +F.H. f h +FHI's f h i's +FHL f h l +fhm f h m +FHM f h m +FHM's f h m's +FHQ f h q +FHSAA f h s a a +FHS f h s +FHWA f h w a +F. H. W. f h w +FIAC f i a c +fiadh f i a d h +fia f i a +FIA f i a +FIAPO f i a p o +FIA's f i a's +FIAS f i a s +FIBCO f i b c o +F. I. B. f i b +FiBL f i b l +FIBT f i b t +FIC f i c +Fi'd f i d +FIDH f i d h +F.I f +F&I f and i +F. I. f i +F.I. f i +FIFTA f i f t a +FIGC f i g c +Figl f i g l +FIH f i h +FIH's f i h's +fija f i j a +FIJL f i j l +FIK f i k +F.I.M. f i m +FIM f i m +FIMI f i m i +Fio f i o +FiO f i o +FIO f i o +F.I.R. f i r +F.I.T.T. f i t t +FIU f i u +FIVB f i v b +F. J. A. f j a +FJE f j e +F. J. f j +F.J. f j +F.J.G. f j g +FJK f j k +F. J. M. f j m +FKA f k a +FKBP f k b p +F. K. f k +F.K. f k +FKK f k k +FKL's f k l's +FKS f k s +FKY f k y +Fla f l a +FLB f l b +FLCL f l c l +FLCS f l c s +FLD f l d +FLDS f l d s +FLEC f l e c +FLE f l e +Fles f l e's +FLEST f l e s t +FLETC f l e t c +fl f l +F. L. f l +F.L. f l +FL f l +FLH f l h +fli f l i +FLI f l i +FLI's f l i's +FLL f l l +F.L.M. f l m +FLM f l m +FLNB f l n b +FLN f l n +FLP f l p +FLPP f l p p +FLQ f l q +FLRA f l r a +FLR f l r +FLRL f l r l +FLS f l s +FLSW f l s w +FLT f l t +FLTK f l t k +FLTR f l t r +FLTS f l t s +FLV f l v +FLW f l w +flyr f l y r +FMA f m a +FMARS f m a r s +FMC f m c +FMCG f m c g +FMCSA f m c s a +FMCS f m c s +FMF f m f +fm f m +F. M. f m +F.M. f m +FM f m +FMH f m h +FMHS f m h s +FMI f m i +FMJD f m j d +FMLN f m l n +FMM f m m +FMN f m n +FMNJ f m n j +FMNP f m n p +FMPA's f m p a's +FMP f m p +FMQB f m q b +FMR f m r +fMRI f m r i +FMRP f m r p +FMRU f m r u +FM's f m's +FMs f m's +FMS f m s +FMSF's f m s f's +FMSO f m s o +FMV f m v +FMW f m w +FMX f m x +FMY f m y +FNAC f n a c +F. N. A. f n a +FNA f n a +FNB f n b +FNC f n c +F. N. D. f n d +FNE f n e +F. N. f n +F.N. f n +FNIC f n i c +FNI f n i +FNLA f n l a +FNLC f n l c +FNLC's f n l c's +FNL f n l +FNO f n o +FNP f n p +FNPI f n p i +FNSEA f n s e a +FNU f n u d s a +FOF f o f +F. O. f o +FPA f p a +FPB f p b +FPC f p c +FPCP f p c p +F.P.D. f p d +FPDs f p d's +fp f p +F. P. f p +F.P. f p +FP f p +FPGA f p g a +FPGAs f p g a's +FPI f p i +FPJ f p j +FPK f p k +F. P. L. f p l +FPL f p l +FPMR f p m r +FPM&SA f p m and s a +FPO f p o +FPP f p p +FPPS f p p s +F.P.R. f p r +FPR f p r +FPSC f p s c +fps f p s +FPS f p s +FPSO f p s o +FPSs f p s's +FPTP f p t p +FPU f p u +FQAD f q a d +F.Q. f q +FRA f r a +FRA's f r a's +FRAXA f r a x a +FRB f r b +FRBNF f r b n f +FRCC f r c c +F. R. C. f r c +FRC f r c +FRCNA f r c n a +FRCP f r c p +FRCS f r c s +FRDF f r d f +F.R.D. f r d +fr f r +F. R. f r +F.R. f r +FR f r +FRFS f r f s +FRFT f r f t +FRG f r g +F.R.G.S. f r g s +F.R.H.S. f r h s +F.R.I.B.A. f r i b a +FRMN f r m n +FRMR f r m r +FRMS f r m s +F. R. P. f r p +FRP f r p +FRR f r r +F.R.S.A. f r s a +FRSA f r s a +FRSC f r s c +FRSE f r s e +frs f r s +F. R. S. f r s +F.R.S. f r s +FRS f r s +FRSL f r s l +Fru f r u +FRU f r u +FRV f r v +FRWT f r w t +Frwydr f r w y d r +FSA f s a +FSB f s b +FSC f s c +FSCS f s c s +FSE f s e +fsf f s f +FSF f s f +FSFH f s f h +FSFLA f s f l a +fs f s +F. s f's +Fs f's +F. S. f s +F.S. f s +FS f s +FSFS f s f s +FSG f s g +FSGS f s g s +FSH f s h +FSIC f s i c +FSI f s i +FSIL f s i l +FSK f s k +FSKN f s k n +FSLF f s l f +FSL f s l +FSLN f s l n +FSM f s m +FSM's f s m's +fsn f s n +FSN f s n +FSO f s o +FSP f s p +FSPS f s p s +FSR f s r +FSRU f s r u +FSSB f s s b +FSS f s s +FSSM f s s m +FSSRU f s s r u +FSSs f s s's +FST f s t +FSU f s u +FSU's f s u's +FSV f s v +FTA f t a +FTAs f t a's +F.T.B. f t b +FTC f t c +FTD f t d +FTDI f t d i +FTE f t e +FTF f t f +Ft. Fort +F. T. f t +F.T. f t +FTI f t i +FTII f t i i +FTJ f t j +FTK f t k +FTL f t l +FTM f t m +FTN f t n +FTO f t o +ftp f t p +FTP f t p +FTPI f t p i +FTPL f t p l +FTRA f t r a +FTR f t r +FtsA f t s a +FT's f t's +FTS f t s +FTT f t t +FTTH f t t h +FTUC f t u c +Ftuh f t u h +FTU's f t u's +FTV f t v +F. V. B. f v b +F. V. f v +F.V. f v +FVGM f v g m +FVHS f v h s +FVJC f v j c +FVL f v l +FVP f v p +FVW f v w +FVWM f v w m +FWAA f w a a +FWA f w a +FWCD f w c d +FWD f w d +FWE f w e +F&W f and w +F. W. f w +F.W. f w +FWH f w h +FWI f w i +FWMW f w m w +FWO f w o +fwr f w r +F.W.R. f w r +F. W. S. f w s +F.W.S. f w s +FWS f w s +FWX f w x +FXCM's f x c m's +FXE f x e +FXFL f x f l +fx f x +FX f x +FXI f x i +F.X.R. f x r +FX's f x's +FXS f x s +FXX f x x +FXX's f x x's +FXXT f x x t +Fyb f y b +FYCO f y c o +F.Y. f y +F.Y.I. f y i +FYI f y i +Fyn f y n +FYN f y n +FYP f y p +fyr f y r +F.Y.R. f y r +FYR f y r +FYT f y t +FYU f y u +Fyw f y w +FZCI f z c i +FZD f z d +F.Z. f z +FZG f z g +FZJD f z j d +FZKA f z k a +Gaac g a a c +GAAF g a a f +G.A.A. g a a +G. A. g a +G.A. g a +G.A.R. g a r +GASL g a s l +GATA g a t a +GATV g a t v +GATX g a t x +G. A. W. g a w +GBA g b a +GBAG g b a g +GBASE g b a s e +GBA's g b a's +GBB g b b +GBBI g b b i +GBCA g b c a +GBC g b c +GBCM g b c m +GBD g b d +Gbe g b e +GbE g b e +GBE g b e +G. B. g b +G.B. g b +GBGC g b g c +GBGM g b g m +GBH g b h +GBIB g b i b +GBIF g b i f +GBI g b i +GBK g b k +GBL g b l +GBMA g b m a +G. B. M. g b m +GB&NDR g b and n d r +GBP g b p +GBR g b r +GB's g b's +GBS g b s +GBV g b v +GBX g b x +GBYLA g b y l a +GCAC g c a c +GCAF g c a f +GCA g c a +G. C. B. g c b +GCB g c b +GCC g c c +GCCN g c c n +GCC's g c c's +GCCS g c c s +GCD g c d +G.C.E. g c e +GCEP g c e p +GCF g c f +G&C g and c +G. C. g c +G.C. g c +GCHQ g c h q +GCI g c i +GCIP g c i p +GCIT's g c i t's +GCIV g c i v +GCJ g c j +GCL g c l +GCMC g c m c +G.C.M. g c m +GCM g c m +GCMG g c m g +GCN g c n +GCNT g c n t +GCOEC g c o e c +GCOS g c o s +GCPD g c p d +GCPH g c p h +GCR g c r +GCRIO g c r i o +GCSE g c s e +GCSEs g c s e's +GC&SF g c and s f +GCS g c s +GCSI g c s i +GCU g c u +GCV g c v +GCVO g c v o +GCVS g c v s +GDA g d a +Gdal g d a l +GDAL g d a l +GDAP g d a p +GDB g d b +GDC g d c +GDD g d d +GDDM g d d m +GDDR g d d r +Gde g d e +G. D. F. g d f +GDF g d f +gd g d +G. D. g d +G.D. g d +GD g d +GDI g d i +G.D.L. g d l +GDN g d n +G.D.O.D. g d o d +Gdow g d o w +G.D.P. g d p +GDP g d p +GDPs g d p's +gdr g d r +GDR g d r +GDR's g d r's +GDS g d s +GDST g d s t +GDT g d t +GDV g d v +Gebr g e b r +Gebt g e b t +GEC g e c +Ged g e d +GED g e d +GEF g e f +GEGB g e g b +ge g e +G. E. g e +G.E. g e +GE g e +GEHA g e h a +GEHX g e h x +Gek g e k +G.E.M. g e m +Gen. general +G.E.O. g e o +G. E. P. g e p +geq g e q +Geu g e u +GEU g e u +Gev g e v +GeV g e v +GEV g e v +Gfa g f a +GFA g f a +GF&A g f and a +GFC g f c +GFD g f d +GFDL g f d l +GFE g f e +GFF g f f +G. F. g f +G.F. g f +GFM g f m +GFP g f p +G. F. R. g f r +GFR g f r +GFS g f s +GFSN g f s n +GFSR g f s r +GFT g f t +GFWC g f w c +GFW g f w +GFY g f y +G. G. g g +G.G. g g +G. G. J. g g j +GGL g g l +GGM g g m +GGMRC g g m r c +GGS g g s +G.H.A. g h a +GHB g h b +GHC g h c +GHD g h d +Ghe g h e +G. H. g h +G.H. g h +GHGs g h g's +Ghir g h i r +GHK g h k +GHMC g h m c +G.H.N. g h n +G.H.Q. g h q +GHQ g h q +ghra g h r a +GHR g h r +GH&SA g h and s a +GHSA g h s a +GHSFHA g h s f h a +GHS g h s +GHSR g h s r +GHSU g h s u +GHU g h u +G.H.W. g h w +GICL g i c l +Giei g i e i +GIFV g i f v +G. I. g i +G.I. g i +G.J.B. g j b +G. J. g j +G.J. g j +G. K. g k +G.K. g k +Gla g l a +GLA g l a +GLB g l b +GLBT g l b t +GLBTQ g l b t q +GLC g l c +G&L g and l +G. L. g l +G.L. g l +gli g l i +Gli g l i +GLI g l i +Glis g l i's +GLK g l k +GLL g l l +GLLI g l l i +GLM g l m +glnA g l n a +G.L.O.R.Y. g l o r y +Glos g l o's +GLRS g l r s +GLS g l s +GLT g l t +GLVC g l v c +GLX g l x +GMAC g m a c +gma g m a +GMA g m a +GMAM g m a m +GMA's g m a's +GMAT g m a t +GMB g m b +GmbH g m b h +GMBH g m b h +GMB's g m b's +GMCC g m c c +GMC g m c +GMCL g m c l +GMC's g m c's +GMDSS g m d s s +GME g m e +Gmel g m e l +GMES g m e s +GMFF g m f f +GMF g m f +GMG g m g +gm g m +G. M. g m +G.M. g m +GM g m +GMG's g m g's +gmin g m i n +GMM g m m +GMO g m o +GMOs g m o's +GMPC g m p c +GMPE g m p e +GMP g m p +GMPTE g m p t e +GMR g m r +GMRL g m r l +GM's g m's +GMs g m's +GMS g m s +gmt g m t +GMT g m t +GMTV g m t v +Gmul g m u l +GNAA g n a a +GNA g n a +gnb g n b +GNB g n b +GNCC g n c c +G. N. C. g n c +GNC g n c +G. N. g n +G.N. g n +GNL g n l +GNP&BR g n p and b r +GNPDA g n p d a +gnp g n p +GNP g n p +GNPs g n p's +GNRD g n r d +GNR g n r +GNR's g n r's +GNS g n s +GNSS g n s s +GNT g n t +G.O. g o +G.O.O.D. g o o d +GOPB g o p b +G.O.P. g o p +GOP g o p +GOPIO g o p i o +GOP's g o p's +GOQ g o q +GPA g p a +GPB g p b +G.P.C. g p c +GPC g p c +GPCR g p c r +GPCRs g p c r's +GPD g p d +GPdI g p d i +GPDSC g p d s c +GPF g p f +GPFS g p f s +G&P g and p +GPG g p g +gp g p +G. P. g p +G.P. g p +GP g p +GPGPU g p g p u +GPI g p i +GpIIb g p i i b +GPIO g p i o +GPL g p l +GPMGs g p m g's +G.P.O. g p o +GPO g p o +GPP g p p +GPRA g p r a +GPRF g p r f +GPR g p r +GPRs g p r's +GPRS g p r s +GPSC g p s c +GPS g p s +GPT g p t +GPU g p u +GPUs g p u's +GPX g p x +G. Q. g q +GQ g q +GQNYGK g q n y g k +GQ's g q's +GQT's g q t's +G.R.A.B. g r a b +grac g r a c +gra g r a +Gra g r a +GRA g r a +Grbac g r b a c +GRB g r b +GRBs g r b's +grc g r c +GRC g r c +GRCs g r c's +GRDA g r d a +GRDC g r d c +G.R.D. g r d +GRD g r d +gre g r e +Gre g r e +GRE g r e +GRF g r f +GRG g r g +gr g r +G. R. g r +G.R. g r +GR g r +GRK g r k +G.R.L. g r l +GRL g r l +GRMG g r m g +GRM g r m +GRO g r o +GRP g r p +grrl g r r l +G. R. S. g r s +GRS g r s +GRT g r t +GRU g r u +GRX g r x +Gryf g r y f +gry g r y +Gry g r y +GRY g r y +grz g r z +GSA g s a +GSAPP g s a p p +GSAS g s a s +GSB g s b +GSC g s c +GSDF g s d f +GSD g s d +G.S.E. g s e +GSE g s e +GSFC g s f c +GSF g s f +G&S g and s +GSG g s g +Gs g's +G. S. g s +G.S. g s +GS g s +GSHD g s h d +GSH g s h +GSI g s i +GSIs g s i's +GSIS g s i s +GSK g s k +GSL g s l +GSLV g s l v +GSMA g s m a +GSM g s m +GSNAS g s n a s +G. S. N. g s n +GSN g s n +GSNM g s n m +GSN's g s n's +GSO g s o +GSOM's g s o m's +GSOp g s o p +GSPC g s p c +G. S. P. g s p +GSP g s p +GSR g s r +GSSE g s s e +GSS g s s +GSSP g s s p +GSTA g s t a +G.S.T. g s t +GST g s t +GSU g s u +GSUSA g s u s a +GSVD g s v d +GSVS g s v s +GSX g s x +GTAA g t a a +GTA g t a +GTAs g t a's +GTB g t b +GTBK g t b k +GTBP g t b p +GTC g t c +GTCR g t c r +GTD g t d +GTEC g t e c +GTE g t e +GTF g t f +GTFT g t f t +GTFU g t f u +gt g t +G. T. g t +G.T. g t +GT g t +G. T. H. g t h +GTi g t i +GTI g t i +GTK g t k +GTL g t l +GTMO g t m o +G. T. O. g t o +GTO g t o +GTPBP g t p b p +GTP g t p +GTPR g t p r +GTRA g t r a +GTR g t r +GTRI g t r i +GTs g t's +GTS g t s +GTSV g t s v +GTT g t t +GTTP g t t p +GTU g t u +GTV g t v +GTW g t w +GTW's g t w's +GTX g t x +G. U. g u +G.U. g u +GUI's g u i's +GUIs g u i's +G.U.Y. g u y +GVA g v a +GVAV g v a v +GVBA g v b a +GVC g v c +G. V. g v +G.V. g v +GVHSS g v h s s +GVJZ g v j z +GVK g v k +GvpA g v p a +GVP g v p +GVRD g v r d +GVSU g v s u +GVT g v t +GVU g v u +GVVV g v v v +GVW g v w +GVWR g v w r +GWA g w a +GWB g w b +G. W. C. g w c +GWe g w e +Gwet g w e t +G.W.F. g w f +GWF g w f +gw g w +G. W. g w +G.W. g w +GW g w +G. W. H. g w h +GWHS g w h s +Gwi g w i +GWK g w k +G.W.L. g w l +GWO g w o +GWOT g w o t +gwr g w r +GWR g w r +GWR's g w r's +GW's g w's +G. W. S. g w s +GWS g w s +GWU g w u +GXG g x g +GX g x +GXP g x p +GYAN's g y a n's +GYC g y c +GYF g y f +Gy g y +G. Y. g y +GY g y +Gyn g y n +GYN g y n +Gyps g y p's +gyu g y u +Gyu g y u +GZA g z a +GZ g z +GZR g z r +HAFV h a f v +H. A. h a +H.A. h a +H&A h and a +HBA h b a +HBA's h b a's +HBBO h b b o +HBC h b c +HBCo h b c o +HBC's h b c's +HBCU h b c u +HBES h b e s +HBF h b f +HBGAs h b g a's +H. B. h b +H.B. h b +HB h b +HBI h b i +HBK h b k +HBLX h b l x +HBMP h b m p +HBO h b o +HBO's h b o's +HBPU h b p u +H&BR h and b r +HBR h b r +HBRN h b r n +HBRY h b r y +HB's h b's +HBS h b s +HBSS h b s s +HBU's h b u's +HBV h b v +HBW h b w +HCA h c a +HCAW h c a w +HCBE h c b e +HCB h c b +HCBS h c b s +HCCA h c c a +HCCB h c c b +HCCC h c c c +HCC h c c +HCDCH h c d c h +HCE h c e +HCEs h c e's +HCF h c f +H. C. G. h c g +HCGVN h c g v n +H. C. h c +H.C. h c +HC h c +HCH h c h +HCHS h c h s +HCI h c i +HCJB h c j b +hcl h c l +HCL h c l +HClO h c l o +HCMC's h c m c's +HCME h c m e +HCM h c m +HCN h c n +HCO h c o +HCoV h c o v +HCPA h c p a +H. C. P. h c p +HCP h c p +HCPs h c p's +HCR h c r +HCS h c s +HCT h c t +HCTV's h c t v's +HCUP h c u p +HCV h c v +Hcy h c y +HDAC h d a c +Hdad h d a d +hDAF h d a f +HDA h d a +HDB h d b +HDCAM h d c a m +HDC h d c +HDCP h d c p +HDD h d d +HDDs h d d's +HDFC h d f c +H.D.F. h d f +HDFM h d f m +H.D.G. h d g +HDG h d g +hd h d +H. D. h d +H.D. h d +HD h d +hdh h d h +HDi h d i +HDI h d i +HDLC h d l c +HDL h d l +HDLS h d l s +HDM h d m +HDMI h d m i +HDPE h d p e +HDP h d p +HDR h d r +HDRO h d r o +HDRR h d r r +H. E. h e +H.E. h e +hezb h e z b +Hezb h e z b +HFA h f a +HFB h f b +HFC h f c +HFCS h f c s +HFDF h f d f +HFF h f f +HFF's h f f's +H&F h and f +H. F. h f +H.F. h f +HFI h f i +H. F. J. h f j +HFNB h f n b +HFPA h f p a +HFP h f p +HFPPV h f p p v +HFRS h f r s +HFS h f s +HFTP h f t p +H.G.B. h g b +hgcA h g c a +HGC h g c +HGF h g f +hg h g +H. G. h g +H.G. h g +HG h g +HGH h g h +HGNC h g n c +HgO h g o +H. G. O. h g o +HGPIN h g p i n +HGPs h g p's +HGTV h g t v +HGTV's h g t v's +HgU h g u +HGVs h g v's +HGY h g y +HHA h h a +H. H. B. h h b +HHC h h c +HHD h h d +HHDP h h d p +HHG h h g +H&H h and h +HHHDB h h h d b +H. H. h h +H.H. h h +HHPC h h p c +HHSAA h h s a a +HHS h h s +H.H.T. h h t +H. I. h i +H.I. h i +H.I.V.E. h i v e +HIV h i v +HIY h i y +Hizb h i z b +hja h j a +HJC h j c +H. J. h j +H.J. h j +HJ h j +HJK h j k +H.J.M. h j m +HJN h j n +H. J. R. h j r +H.J.R. h j r +H. J. W. h j w +HJW h j w +HKAA h k a a +Hkam h k a m +HKB h k b +HKCEC h k c e c +HKCEE h k c e e +HKDF h k d f +HKD h k d +HKDSE h k d s e +HKFC h k f c +H&K h and k +H. K. h k +H.K. h k +HK h k +H. K. J. h k j +HKK h k k +HKMA h k m a +HKN h k n +H.K.P. h k p +HKP h k p +HKSAR h k s a r +HK's h k's +HKT h k t +HKTWU h k t w u +HKU h k u +Hla h l a +HLA h l a +HLBN h l b n +HLE h l e +HLH h l h +H. L. h l +H.L. h l +HLL h l l +HLLS h l l s +HLN h l n +HLN's h l n's +HLS h l s +HLT h l t +HLTV h l t v +Hluk h l u k +hlutr h l u t r +HLV h l v +Hly h l y +HMAC h m a c +HMA h m a +Hman h m a n +H.M.A.S. h m a s +HMAS h m a s +HMB h m b +HMC h m c +HMCS h m c s +HMDA h m d a +HMD h m d +HMDI h m d i +HMDP h m d p +HME h m e +HMEL h m e l +HMF h m f +HMGA h m g a +HMG h m g +HMGIC h m g i c +HMGN h m g n +H&M h and m +HMH h m h +hm h m +H. M. h m +H.M. h m +HM h m +HMI h m i +HMIS h m i s +HMMC h m m c +HMM h m m +HMMWV h m m w v +HMN h m n +HMNZS h m n z s +HMNZT h m n z t +HMO h m o +HMOs h m o's +HMPC h m p c +HMP h m p +HMRC h m r c +hMRE h m r e +H&M's h and m's +H. M. S. h m s +H.M.S. h m s +HMS h m s +HMSN h m s n +H.M.S.O. h m s o +HMSO h m s o +H. N. h n +H.N. h n +HNI h n i +HNK h n k +HNL h n l +HNLMS h n l m s +HNMT h n m t +HNN h n n +HNO h n o +HNS h n s +H. O. h o +H.O. h o +HPA h p a +H.P.B. h p b +hpc h p c +HPC h p c +HPCT h p c t +H. P. D. h p d +HPD h p d +HPE h p e +HPH h p h +hp h p +H. P. h p +H.P. h p +HP h p +HPI h p i +HPLC h p l c +HPL h p l +HPP h p p +HPRA h p r a +HPR h p r +HPRT h p r t +HP's h p's +HPS h p s +H. P. T. h p t +HPV h p v +HQAA h q a a +HQDA h q d a +H.Q. h q +HQ h q +HRG h r g +H&R h and r +H.R.H. h r h +HRH h r h +H. R. h r +H.R. h r +HR h r +HRK h r k +HRL h r l +HRM h r m +hroa h r o a +HRo h r o +HRO h r o +HRP h r p +HRSA h r s a +HRSA's h r s a's +HRSG h r s g +hrs h r s +HRs h r's +HRST h r s t +HRT h r t +HRV h r v +HRW h r w +HRX h r x +HSA h s a +HSAN h s a n +HSBC h s b c +HSB h s b +HSCA h s c a +HSC h s c +hscy h s c y +HSD h s d +HSDPA h s d p a +Hsee h s e e +HSE h s e +HSE's h s e's +HSF h s f +HSG h s g +HSHB h s h b +H.S.H. h s h +hs h s +Hs h's +H. S. h s +H.S. h s +HS h s +HSHS h s h s +hsi h s i +HSJ h s j +HSK h s k +HSL h s l +hSlo h s l o +H.S.M. h s m +HSM h s m +HSMR h s m r +HSN h s n +HSNY's h s n y's +HSPA h s p a +HSPA's h s p a's +HSPG h s p g +HSPH h s p h +HSP h s p +HSP's h s p's +HSPs h s p's +HSRC h s r c +HSR h s r +HSSCCT h s s c c t +HSSF h s s f +HSS h s s +HST h s t +HST's h s t's +HSTs h s t's +HSTS h s t s +hsv h s v +HSV h s v +HSX h s x +HSY h s y +HSYK's h s y k's +HSZ h s z +HTA h t a +hTAS h t a s +HTAs h t a's +htc h t c +HTC h t c +HTC's h t c's +HTGL h t g l +HTHC h t h c +ht h t +H. T. h t +H.T. h t +HT h t +HTIB h t i b +hti h t i +Htin h t i n +HTK h t k +HTLA h t l a +HTLV h t l v +HTML h t m l +HTM's h t m's +Htoo h t o o +HTPB h t p b +HTPC h t p c +HTP h t p +HtrA h t r a +HTR h t r +HTRs h t r's +HTS h t s +http h t t p +HTTP h t t p +https h t t p s +HTTPS h t t p s +HTV h t v +HTV's h t v's +Htwa h t w a +HTW h t w +HTX h t x +H. U. h u +HVC h v c +HVCs h v c's +hvcv h v c v +HVDC h v d c +hvem h v e m +Hvem h v e m +HVF h v f +HVHS h v h s +H. V. h v +H.V. h v +H.W.A. h w a +H. W. F. h w f +H. W. h w +H.W. h w +H.W.L. h w l +HWL h w l +HWM h w m +HWRT h w r t +HWT h w t +HWV h w v +hwy h w y +Hwy h w y +hxt h x t +H. Y. h y +H.Y. h y +H. Z. h z +HZ&PC h z and p c +iaaf i a a f +IAAF i a a f +IAAF's i a a f's +IAA i a a +IAAPA i a a p a +IAAP i a a p +IaaS i a a s +IAAS i a a s +IABSE i a b s e +Iaca i a c a +IACC i a c c +IACD i a c d +IAC i a c +Iacob i a c o b +IACR i a c r +IAC's i a c's +IACTs i a c t's +Iacub i a c u b +IACUC i a c u c +IACW i a c w +IAD i a d +IAD's i a d's +IAEA i a e a +IAEG i a e g +I.A.E. i a e +IAE i a e +IAF i a f +IAF's i a f's +IAG i a g +IAG's i a g's +iagt i a g t +IAHP i a h p +IAHRC i a h r c +I. A. i a +I.A. i a +I.A.M. i a m +IAO i a o +Iapa i a p a +IAPHC i a p h c +IAP i a p +iar i a r +Iar i a r +IAR i a r +IAST i a s t +IATA i a t a +I.A.T. i a t +IAT i a t +IATR i a t r +IAUC i a u c +IAUCs i a u c's +IAU i a u +IAV i a v +IAWTV i a w t v +Iax i a x +IAX i a x +Ibac i b a c +Ibaes i b a e's +IBA's i b a's +IBB i b b +IBC i b c +IBCs i b c's +IBCT i b c t +IBDA'A i b d a a +Ibda i b d a +ibdal i b d a l +IBDB i b d b +IBDE i b d e +IBD i b d +IBE i b e +IBF i b f +IBGE i b g e +IBH i b h +I. B. i b +I.B. i b +IBJJF i b j j f +IBL i b l +IBLT i b l t +IBMA's i b m a's +IBMC i b m c +Ibm i b m +I.B.M. i b m +IBM i b m +IBM's i b m's +IBMXF i b m x f +Ibne i b n e +ibn i b n +IBO i b o +IBPA i b p a +IBP i b p +Ibra i b r a +IBRA i b r a +IBRC i b r c +IBR i b r +IBRO i b r o +Ibsa i b s a +IBSA i b s a +IBSF i b s f +Ibs i b's +IBS i b s +IBSL i b s l +IBTC i b t c +iBT i b t +IBTS i b t s +Ibu i b u +IBU i b u +IBV i b v +IBWFF i b w f f +iby i b y +ICBA i c b a +ICBC i c b c +ICB i c b +ICBL i c b l +ICBM i c b m +ICBMs i c b m's +ICBP i c b p +ICBS i c b s +ICBTT i c b t t +ICCC i c c c +ICCC's i c c c's +ICCEC i c c e c +ICCF i c c f +Icche i c c h e +I.C.C. i c c +ICC i c c +ICCID i c c i d +ICCI i c c i +ICCR i c c r +ICC's i c c's +ICCS i c c s +ICCW i c c w +ICDC i c d c +ICD i c d +ICDS i c d s +I.C.E. i c e +ICFF i c f f +icf i c f +ICF i c f +ICFR i c f r +ICG i c g +ICHC i c h c +I&C i and c +ic i c +Ic i c +I. C. i c +I.C. i c +IC i c +Ici i c i +ICI i c i +ICJ i c j +ICL i c l +ICL's i c l's +ICMA i c m a +ICME i c m e +I.C.M. i c m +ICM i c m +iCN i c n +ICN i c n +Ico i c o +ICO i c o +ICOP i c o p +ICPC i c p c +ICPD i c p d +ICP i c p +ICP's i c p's +ICQ i c q +ICRC i c r c +ICRF i c r f +ICR i c r +IcRn i c r n +ICRP i c r p +ICRS i c r s +ICRW i c r w +ICSA i c s a +ICSB i c s b +ICSC i c s c +ICSE i c s e +ICSG i c s g +ics i c s +ICs i c's +ICS i c s +ICSS i c s s +ICSSR i c s s r +ICTA i c t a +ICT i c t +ICTM i c t m +ICTP i c t p +ICTSF i c t s f +ICTs i c t's +ICTS i c t s +ICTU i c t u +ICTUR i c t u r +ICTVdB i c t v d b +ICTV's i c t v's +ICTY i c t y +ICU i c u +ICUN i c u n +ICU's i c u's +ICv i c v +ICV i c v +ICVS i c v s +ICWA i c w a +ICWC i c w c +ICW i c w +ICW's i c w's +iCyt i c y t +ICZ i c z +ICZN i c z n +IDAF i d a f +IDBF i d b f +IDB i d b +IDBI i d b i +IDC i d c +Iddaa i d d a a +Idd i d d +ID'd i d d +IDEF i d e f +IDE i d e +IDFA i d f a +IDFG i d f g +IDF i d f +IDFL i d f l +IDF's i d f's +IDG i d g +I. D. H. i d h +IDH i d h +id i d +I. D. i d +I.D. i d +ID i d +Idi i d i +Idir i d i r +IDIS i d i s +IDLHs i d l h's +IDL i d l +Idm i d m +IDM i d m +IDMR i d m r +IDMS i d m s +IDNA i d n a +IDN i d n +IDNR i d n r +IDNR's i d n r's +IDPs i d p's +IDRC i d r c +IDRO i d r o +IDSA i d s a +IDSA's i d s a's +IDSF i d s f +ids i d s +ID's i d's +IDs i d's +IDV i d v +IDW i d w +IDWO i d w o +IDW's i d w's +IDx i d x +IDX i d x +IEA i e a +I.E.M. i e m +IEM i e m +I.E.S. i e s +IES i e s +i.e. that is +Ifa i f a +IFA i f a +IFBB i f b b +IFBC i f b c +I.F.B. i f b +IFCC i f c c +ifc i f c +IFC i f c +IFC's i f c's +IfF i f f +I. F. F. i f f +IFF i f f +IFFI i f f i +IFFK i f f k +Ifft i f f t +IFHA i f h a +IFHP i f h p +ifi i f i +Ifi i f i +IFI i f i +IFIP i f i p +IFIs i f i's +IFK i f k +IFLA i f l a +IFL i f l +IfM i f m +IFM i f m +IFN i f n +Ifni i f n i +IFNs i f n's +IFO i f o +Ifop i f o p +IFP i f p +IFPI i f p i +IFPRI i f p r i +IFRC i f r c +IFR i f r +IFRS i f r s +IFRSs i f r s's +IFSB i f s b +IFSC i f s c +IFSTA i f s t a +IFTA i f t a +IFTF i f t f +IFT i f t +Iga i g a +IgA i g a +IGA i g a +IGA's i g a's +IGBT i g b t +IGC i g c +IGCP i g c p +IGCSE i g c s e +IGD i g d +IGF i g f +IGFI i g f i +IGFs i g f's +IGIB i g i b +'ig i g +Ig i g +I.G. i g +IG i g +igi i g i +IGI i g i +IgM i g m +IGM i g m +IGMP i g m p +ign i g n +Ign i g n +IGN i g n +IHF i h f +IHGS i h g s +IHH i h h +Ih i h +I. H. i h +IH i h +ihi i h i +IHI i h i +IHL i h l +IHL's i h l's +IHMC i h m c +IHME i h m e +ihm i h m +ihn i h n +Ihn i h n +IHOM i h o m +Ihor i h o r +IHPK i h p k +IHRC i h r c +IHSAA i h s a a +IHSA i h s a +IHS i h s +Iht i h t +IIA i i a +IIb i i b +IIB i i b +IIc i i c +IIDC i i d c +IID i i d +IIDI i i d i +IIDS i i d s +IIDX i i d x +IIED i i e d +IIFA i i f a +IIF i i f +IIfx i i f x +Iiga i i g a +IIga i i g a +IIG i i g +IIgs i i g's +IIGs i i g's +IIGS i i g s +IIGS's i i g s's +IIHF i i h f +IIHR i i h r +IIHS i i h s +IIIA i i i a +IIIb i i i b +IIIB i i i b +IIIBy i i i b y +IIIc i i i c +IIId i i i d +IIIF i i i f +I. I. i i +I.I. i i +ija i j a +Ija i j a +IJA i j a +IJF i j f +IJGL i j g l +IJHCD i j h c d +IJHL i j h l +ij i j +I. J. i j +IJ i j +IJN i j n +Ijok i j o k +IJSB i j s b +IJSE i j s e +IJSEM i j s e m +IJS i j s +Ijui i j u i +IJVM i j v m +IKBN i k b n +IKCO i k c o +IKF i k f +Ikh i k h +I.K. i k +IKK i k k +IKL i k l +IKr i k r +Iksa i k s a +IKTA i k t a +Iku i k u +Ilbe i l b e +ILB i l b +ILC i l c +ILCS i l c s +ILD i l d +ILDIS i l d i s +ILFC i l f c +ILF i l f +IL&FS i l and f s +ili i l i +Ili i l i +ILI i l i +I. L. i l +I.L. i l +Ilm i l m +ILM i l m +ILM's i l m's +ILN i l n +ILP i l p +ILR i l r +ILRS i l r s +ilu i l u +Ilu i l u +ILU i l u +IMbd i m b d +IMBD i m b d +IMB i m b +IMCB i m c b +IMCI i m c i +imc i m c +IMC i m c +imdb i m d b +IMDb. i m d b +IMDb i m d b +IMDB i m d b +IMD i m d +IMD's i m d's +ime i m e +IME i m e +IMF i m f +IMG i m g +I&M i and m +IMI i m i +I. M. i m +I.M. i m +IMIS i m i s +IMK i m k +Iml i m l +IMMEX i m m e x +Imm i m m +Imms' i m m's +imoa i m o a +IMO's i m o's +IMPA i m p a +IMPDH i m p d h +impr i m p r +Impr i m p r +IMPSA i m p s a +IMR i m r +IMSLP i m s l p +iMSNs i m s n's +Imst i m s t +IMTA i m t a +IMT i m t +IMTV i m t v +IMUK i m u k +IMU's i m u's +IMWF i m w f +INAC i n a c +Inba i n b a +INBA i n b a +INBF i n b f +inb i n b +incl i n c l +INDC i n d c +ind i n d +Ind i n d +IND i n d +INFJ i n f j +I.N.F.O. i n f o +Infs i n f's +ING i n g +INGR i n g r +inHg i n h g +INH i n h +INI i n i +I. N. i n +I.N. i n +InlB i n l b +INL i n l +INM i n m +INPD i n p d +INPE i n p e +InP i n p +INP i n p +INPP i n p p +Inre i n r e +I.N.R.I. i n r i +INR i n r +INSB i n s b +INSDC i n s d c +INSD i n s d +Inspx i n s p x +INSS i n s s +INTF i n t f +Ints i n t's +INTs i n t's +Intu i n t u +INVA i n v a +inv i n v +INXS i n x s +INXS's i n x s's +Ioba i o b a +IOCG i o c g +IOC i o c +IOCP i o c p +IODP i o d p +IODs i o d's +IOE i o e +IOFB i o f b +IOF i o f +io. i o +io i o +.I.o. i o +Io. i o +Io i o +.IO i o +I/O i o +IO i o +Ioka i o k a +Iok i o k +IOL i o l +IoM i o m +IOM i o m +IOPI i o p i +IOP i o p +IOPs i o p's +IORG i o r g +IOR i o r +IORM i o r m +IOSA i o s a +IOSB i o s b +iOS i o s +Io's i o's +I/Os i o's +I.O.'s i o's +IOS i o s +IOSR i o s r +Iosu i o s u +IoT i o t +IOT i o t +I.O.U. i o u +IOU i o u +IoW i o w +IOW i o w +IPA i p a +IPA's i p a's +IPB i p b +IPCC i p c c +IPCC's i p c c's +IPC i p c +IPCRI i p c r i +IPCs i p c's +IPDA i p d a +IPDI i p d i +IPD i p d +IPE i p e +IPFA i p f a +IPFI i p f i +IPF i p f +IPFP i p f p +IPFW i p f w +IPG i p g +IPH i p h +ip i p +Ip i p +I.P. i p +IP i p +IPL i p l +IPMG i p m g +IPM i p m +IPNI i p n i +IPN i p n +Ipo i p o +I.P.O. i p o +IPO i p o +IPP i p p +IPPL i p p l +IPPs i p p's +IPPT i p p t +Ippu i p p u +iPPV i p p v +IPR i p r +iPSC i p s c +IPSC i p s c +iPSCs i p s c's +ipse i p s e +IPSF i p s f +iPS i p s +IPs i p's +I.P.S. i p s +IPS i p s +IPTA i p t a +IPTC i p t c +IPTG i p t g +IPT i p t +IPTL i p t l +IPTV i p t v +IPU i p u +IPUM i p u m +IPv i p v +IPWA i p w a +IPW i p w +IPX i p x +iQ i q +I.Q. i q +IQ i q +IRAC i r a c +I.R.A. i r a +IRB i r b +IRBM i r b m +IRCA i r c a +IRC i r c +IRCM i r c m +IRCTC i r c t c +IRCT i r c t +IRD i r d +IRDS i r d s +IREC i r e c +I.R.E. i r e +IRE i r e +IRFCA i r f c a +IRFC i r f c +IRF i r f +IRFU i r f u +IRGC i r g c +Irgm i r g m +IRHG i r h g +IRHT i r h t +IRIB i r i b +Irig i r i g +IRI i r i +Iril i r i l +IRIN i r i n +i'r i r +ir i r +Ir i r +I. R. i r +I.R. i r +IR i r +IRIX i r i x +Irla i r l a +IRL i r l +IRM i r m +Irmis i r m i's +IRM's i r m's +IRNE i r n e +IRN i r n +iro i r o +Iro i r o +IRO i r o +IRP i r p +IRP's i r p's +IRPS i r p s +IRQ i r q +Irra i r r a +IRRI i r r i +IRR i r r +IRs i r's +I.R.S. i r s +IRS i r s +IRSN i r s n +I.R.T. i r t +IRT i r t +iru i r u +Iru i r u +ISA i s a +ISAv i s a v +Isba i s b a +ISBA i s b a +ISBER i s b e r +ISBHF i s b h f +ISB i s b +isbn i s b n +ISBN i s b n +ISBNs i s b n's +ISBO i s b o +ISCB i s c b +ISCE i s c e +isCf i s c f +ISCI i s c i +iSC i s c +Isc i s c +ISC i s c +ISCM i s c m +ISCM's i s c m's +ISCP i s c p +ISDA i s d a +Isd i s d +ISD i s d +isdn i s d n +ISDN i s d n +ISDS i s d s +ISDT i s d t +ISFI i s f i +ISF i s f +Isgec i s g e c +ISG i s g +ISHC i s h c +ishq i s h q +Ishq i s h q +ISHS i s h s +I. S. i s +I.S. i s +ISKB i s k b +ISK i s k +Isl i s l +ISL i s l +ISMF i s m f +ISMIR i s m i r +ISMNs i s m n's +ISN i s n +ISNTUC i s n t u c +ISOGG i s o g g +ISO i s o +ISO's i s o's +I.S.P.C.K. i s p c k +ISPF i s p f +ISPI i s p i +ISP i s p +ISPL i s p l +ISPR i s p r +ISPs i s p's +Isra'il i s r a i l +Isra i s r a +ISRA i s r a +ISR i s r +ISRN i s r n +ISRO i s r o +ISRP i s r p +ISSCC i s s c c +ISSF i s s f +iss i s s +Iss i s's +ISS i s s +ISSN i s s n +ISSNs i s s n's +ISSSSP i s s s s p +ISSUU i s s u u +ISTAF i s t a f +ISTD i s t d +Isu i s u +ISU i s u +ISU's i s u's +ISWC i s w c +ISWI i s w i +ISW i s w +I.T.A. i t a +ITA i t a +ITB i t b +ITC i t c +Ite i t e +ITE i t e +ITF i t f +ITG i t g +ITHF i t h f +I.T.H.M. i t h m +ITHs i t h's +iti i t i +Iti i t i +ITI i t i +I.T. i t +itk i t k +Itk i t k +ITK i t k +ITM i t m +ITMO i t m o +ITN i t n +ITNNs i t n n's +ITN's i t n's +Itoi i t o i +ITPF i t p f +iTP i t p +ITP i t p +ITRD i t r d +Itse i t s e +ITSF i t s f +ITTF i t t f +itt i t t +ITT i t t +ITUC i t u c +Itu i t u +ITU i t u +ITV i t v +ITV's i t v's +ITWF i t w f +ITW i t w +Itz i t z +IUB i u b +I.U.C.N.B. i u c n b +Iucn i u c n +IUCN i u c n +IUCN's i u c n's +IUD i u d +IUDs i u d's +IU i u +IUT i u t +IUU i u u +Iuz i u z +IVAA i v a a +IVAW i v a w +IVB i v b +I. V. i v +I.V. i v +IVL i v l +IVLP i v l p +IVM's i v m's +IVP i v p +IVPP i v p p +IVPTC i v p t c +IVRCL i v r c l +IVs i v's +Ivu i v u +IVWA i v w a +IWA i w a +Iwas i w a's +Iwaz i w a z +IWBs i w b's +IWC i w c +IWD i w d +IWF i w f +IWFL i w f l +IWF's i w f's +IWFS i w f s +IWG i w g +IWGP i w g p +iwi i w i +iw i w +I. W. i w +IW i w +IWL i w l +IWMF i w m f +IWM i w m +IWPR i w p r +iwrg i w r g +IWRG i w r g +IWR i w r +IWRS i w r s +IWSA i w s a +iwspy i w s p y +Iwuh i w u h +IWU's i w u's +I.W.W. i w w +IWW i w w +IXA i x a +IXb i x b +IXBs i x b's +IXC i x c +IXCs i x c's +IXe i x e +IX i x +iXL i x l +IXO i x o +ixtle i x t l e +IXV i x v +Iya i y a +IYA i y a +Iyar i y a r +IYC i y c +iyem i y e m +IYHF i y h f +Iyi i y i +iy i y +I. Y. i y +I.Y. i y +IY i y +J.A.A. j a a +J. A. B. j a b +Jaf j a f +J.A.G. j a g +JAG j a g +JAIR j a i r +J. A. j a +J.A.K.E. j a k e +J. A. N. j a n +J.A.P. j a p +J.A.S. j a s +JBA j b a +JBBA j b b a +JBB j b b +JBC j b c +JBG j b g +J&B j and b +jb j b +J. B. j b +J.B. j b +JB j b +J.B.L.D. j b l d +JBL j b l +J.B.M. j b m +JBM j b m +JB's j b's +J. B. S. j b s +J.B.S. j b s +JBT j b t +JBZ j b z +JCA j c a +JCB j c b +JCC j c c +JCF j c f +JCFS j c f s +J.C.G. j c g +JCG j c g +JCGM j c g m +JCIB j c i b +JCI j c i +jcis j c i s +jc j c +J. C. j c +J.C. j c +JC j c +JCJC j c j c +J. C. L. j c l +JCPA j c p a +J. C. P. j c p +JCP j c p +JCPV j c p v +JCRB j c r b +JCR j c r +JCRs j c r's +J.C.S. j c s +JCS j c s +JCSR j c s r +JCVI j c v i +J. C. W. j c w +JCW j c w +J. D. A. j d a +JDA j d a +JDBC j d b c +JDC j d c +JdeBP j d e b p +J.D.E. j d e +JDE j d e +JDENET j d e n e t +J.D.F. j d f +JDF j d f +jdi j d i +JDI j d i +jd j d +J. D. j d +J.D. j d +JD j d +jdk j d k +JDK j d k +J.D.M. j d m +JDM j d m +JDO j d o +JDRF j d r f +J&D's j and d's +J.D.s j d's +JDT j d t +JDU j d u +JDV j d v +J. E. A. j e a +J.E.A.L. j e a l +J.E.B. j e b +J. E. C. j e c +J. E. E. j e e +J. E. j e +J.E. j e +J.F.G. j f g +JFH j f h +jf j f +J. F. j f +J.F. j f +JF j f +JFK j f k +JFN j f n +JFQA j f q a +JFS j f s +J. G. A. j g a +J.G.B. j g b +JGI j g i +J. G. j g +J.G. j g +J. G. L. j g l +JGLS j g l s +J. G. M. j g m +J.G.M. j g m +JGO j g o +JGP j g p +JGR j g r +JGR's j g r's +JGSDF j g s d f +JGTC j g t c +JGU j g u +J.H.B. j h b +JHB j h b +J. H. C. j h c +JHC j h c +JHED j h e d +J.H.F. j h f +J.H.H. j h h +jh j h +J. H. j h +J.H. j h +JH j h +JHL j h l +J. H. M. j h m +J.H.R. j h r +JHs j h's +JHS j h s +JHSVs j h s v's +JHud j h u d +JHU j h u +J. I. j i +J.I. j i +J.J.A. j j a +JJB j j b +J. J. C. j j c +J.J.G. j j g +J&J j and j +J. J. j j +J.J. j j +JJ j j +JJK j j k +J. J. L. j j l +J.J.M. j j m +J.J.N. j j n +JJN j j n +Jka j k a +JKA j k a +JKC j k c +jkd j k d +JKH j k h +J&K j and k +J.K. J. j k j +J. K. j k +J.K. j k +JK j k +JKNPP j k n p p +J. K. S. j k s +JKT j k t +jkx j k x +JKX j k x +JLA j l a +J.L.B. j l b +JLB j l b +JLC j l c +J. L. E. j l e +J.L.E. j l e +JLG j l g +JLI j l i +J. L. j l +J.L. j l +J.L.L. j l l +JLM j l m +JLO's j l o's +JLPGA j l p g a +JLP j l p +JLS j l s +JLT j l t +JMA j m a +JMBG j m b g +J.M.C. j m c +JMC j m c +J. M. D. j m d +JMD j m d +J. M. E. j m e +JMI j m i +J. M. J. j m j +J.M.J. j m j +J. M. j m +J.M. j m +JMKR j m k r +J. M. L. j m l +JML j m l +JMM j m m +JMP j m p +JMS j m s +JMU j m u +JMV j m v +J. M. W. j m w +J.M.W. j m w +JMX j m x +JNA j n a +jnb j n b +JNF j n f +JNG j n g +JNI j n i +J. N. j n +J.N. j n +JN j n +JNK j n k +J. N. L. j n l +Jno j n o +JNPT j n p t +jnr j n r +JNR j n r +JNS's j n s's +JOJ j o j +J. O. j o +J.O. j o +J.P.D.B. j p d b +J. P. F. j p f +JPF j p f +jpg j p g +JPG j p g +JPH j p h +J&P j and p +jp j p +J.P. j p +JP j p +J.P.R. j p r +J.Q. j q +JQ j q +J.R.A. j r a +JRA j r a +J.R.C. j r c +JRC j r c +J.R.E. j r e +JRG j r g +JRHU j r h u +J. R. I. j r i +J&R j and r +J. R. j r +J.R. j r +JR j r +JRJ's j r j's +Jr. junior +jr. junior +Jr junior +jr junior +JRPG j r p g +J. R. P. j r p +J. R. R. j r r +J.R.R. j r r +J.R.'s j r's +JRSP j r s p +J. R. T. j r t +JRU j r u +JRX j r x +JSA j s a +JSAP j s a p +JSA's j s a's +jsb j s b +JSCA j s c a +JSC j s c +J.S.D. j s d +JSD j s d +JSE j s e +JSF j s f +JSH j s h +Js j's +J. S. j s +J.S. j s +JS j s +J.S.K. j s k +J.S.L. j s l +JSL j s l +J. S. M. j s m +JSM j s m +JSNN j s n n +JSOC j s o c +JSO j s o +JSP j s p +JSPS j s p s +JSR j s r +JSS j s s +JSW j s w +JSW's j s w's +JSX j s x +JTA j t a +J.T.B. j t b +JTB j t b +JTC j t c +JTF j t f +JTG j t g +JTI j t i +J&T j and t +J. T. j t +J.T. j t +JT j t +JT&KW j t and k w +JTL j t l +JTO j t o +JTR j t r +JTRO j t r o +JTS j t s +JTTF j t t f +JTT j t t +JTV j t v +J. U. j u +J.U.L.I.A. j u l i a +J.V.B. j v b +JVB j v b +JVC j v c +J.V.E. j v e +JVG j v g +JVH j v h +J&V j and v +J. V. j v +J.V. j v +JV j v +JVM j v m +JVNW j v n w +JVP j v p +JVRA j v r a +JVS j v s +Jwa j w a +J. W. A. j w a +J. W. B. j w b +JWB j w b +J.W.C. U.S. j w c u s +JWHA j w h a +J.W.J. j w j +J. W. j w +J.W. j w +JWM j w m +J. W. P. j w p +JWP j w p +JWRC j w r c +J. W. S. j w s +J.W.S. j w s +JWS j w s +JWST j w s t +JWT j w t +jx j x +JX j x +J.X.W.P. j x w p +JYJ j y j +JYJ's j y j's +J. Y. j y +J.Y. j y +JY j y +Jym j y m +Jymn j y m n +JYP j y p +J. Y. S. j y s +J. Z. j z +J.Z. j z +JZ j z +K.A.A. k a a +K. A. k a +K.A. k a +K.A.N. k a n +K. A. R. k a r +K.A.S. k a s +KBBI k b b i +KBB k b b +KBCI k b c i +KBC k b c +KBCO k b c o +KBD k b d +KBE k b e +KBFC k b f c +KBFL k b f l +KBFR k b f r +KBGD k b g d +KBG k b g +KBIG k b i g +kbi k b i +K&B k and b +K. B. k b +K.B. k b +KBKR k b k r +KBKS k b k s +KBKW k b k w +KBL k b l +KBMT k b m t +KBND k b n d +KBNZ k b n z +KBO k b o +KBRC k b r c +KBR k b r +KBS k b s +KBSN k b s n +KCB k c b +KCBS k c b s +KCCC k c c c +KCCI k c c i +KCC k c c +KCCO k c c o +KCDC k c d c +K. C. D. k c d +KCD k c d +KCED k c e d +KCET k c e t +KCG k c g +KCHS k c h s +K.C.I.E. k c i e +K. C. k c +K.C. k c +KCK k c k +KCKM k c k m +KCLU k c l u +K.C.M.G. k c m g +KCMG k c m g +KCNA k c n a +KCNH k c n h +KCNJ k c n j +KCN k c n +KCNN k c n n +KCNQ k c n q +KCNV k c n v +KCPD k c p d +KCPI k c p i +KCPM k c p m +KCPQ k c p q +KCPQ's k c p q's +KCQL k c q l +KCRA k c r a +KCRC k c r c +KCRH k c r h +KCR k c r +KCRW k c r w +KCSD k c s d +KCSG k c s g +K.C.S.I. k c s i +KCSI k c s i +K.C.'s k c's +KCS k c s +KCSP k c s p +KCTD k c t d +KCT k c t +KCTL k c t l +KCTV k c t v +KCUB k c u b +KCU k c u +KCVO k c v o +KCYX k c y x +kDa k d a +KDA k d a +kdal k d a l +KDAL k d a l +KDB k d b +KDCE k d c e +KDCO k d c o +KDDG k d d g +KDDI k d d i +KDD k d d +KDE k d e +KDFW k d f w +KDFX k d f x +K. D. G. k d g +KDGS k d g s +KDHS k d h s +KDKA k d k a +K&D k and d +kd k d +K. D. k d +K.D. k d +KD k d +KDP k d p +KDPM k d p m +KDR k d r +K. D.'s k d's +K.D.'s k d's +KDS k d s +ke k e +Ke k e +K. E. k e +K.E. k e +KE k e +KFAC k f a c +KFAED k f a e d +KFAI k f a i +KFA k f a +KFBK k f b k +KFBT k f b t +KFCC k f c c +KFCD k f c d +kfc k f c +K.F.C. k f c +KFC k f c +KFC's k f c's +KFD k f d +KFDM k f d m +KFEM k f e m +KFFL k f f l +KFH k f h +KFI k f i +KFJB k f j b +K.F. k f +KFLX k f l x +KFMB's k f m b's +KFMJ k f m j +K. F. M. k f m +K.F.M. k f m +KFOR k f o r +KFQC k f q c +KFQ k f q +KFRC k f r c +KFRC's k f r c's +KFRD k f r d +KFRG k f r g +KFRH k f r h +KFRO k f r o +KFSD k f s d +KFSN k f s n +KFST k f s t +KFT k f t +KFTL k f t l +KFUM's k f u m's +KFVD k f v d +KFV k f v +KFWB k f w b +KFXO k f x o +KFYO's k f y o's +KGA k g a +K.G.B. k g b +KGB k g b +KGC k g c +KGPH k g p h +KGP k g p +KGRI k g r i +kgr k g r +KGRK k g r k +KGS k g s +kgt k g t +KGT k g t +KGTV k g t v +KgU k g u +KGU k g u +KGUN k g u n +kgv k g v +K.G.V. k g v +KGWB k g w b +KGW k g w +KHHZ k h h z +KHI k h i +Khizr k h i z r +KHJ k h j +K. H. k h +K.H. k h +KH k h +KHK k h k +KHKV k h k v +Khlav k h l a v +KHL k h l +KHL's k h l's +Khmu k h m u +KHMY k h m y +KHOJ k h o j +KHOW k h o w +KHQA k h q a +KHQ k h q +Khri k h r i +Khru k h r u +KHRW k h r w +KHSAA k h s a a +KHS k h s +KHTL k h t l +KHTZ k h t z +KHUI k h u i +KHUT k h u t +KHWI k h w i +K.I.D. k i d +K. I. k i +K.I. k i +K.I.M. k i m +KIP k i p +K.I.S.S. k i s s +KJCE k j c e +KJCT k j c t +KJEF k j e f +Kjer k j e r +KJHK k j h k +KJI k j i +KJIN k j i n +kj k j +K. J. k j +K.J. k j +KJ k j +KJKP k j k p +KJMM k j m m +KJNE k j n e +KJNW k j n w +Kjop k j o p +KJo's k j o's +KJQY k j q y +KJV k j v +KJZI k j z i +KKBL k k b l +KKBQ k k b q +KKCR k k c r +KKDA k k d a +K.K.E. k k e +KKE k k e +K. K. k k +K.K. k k +KKMC k k m c +KKMI k k m i +KKM k k m +KKMX k k m x +KKRG k k r g +KKR k k r +KKSF k k s f +KK's k k's +KKSY k k s y +KKT k k t +KLA k l a +KLBK k l b k +KLBM k l b m +KLCI k l c i +KLC k l c +KLDS k l d s +Kle k l e +KLE k l e +KLF k l f +KLGH k l g h +KLH k l h +KLK k l k +kl k l +K. L. k l +K.L. k l +KL k l +KLKS k l k s +KLLP k l l p +KLLV k l l v +KLM k l m +KLN's k l n's +KLQQ k l q q +KLQT k l q t +KLRY k l r y +KLSC k l s c +KLSD k l s d +KLS k l s +KLSX k l s x +KLT k l t +KLX k l x +KMB k m b +KMC k m c +KMD k m d +KMGO k m g o +KMGT k m g t +KMIH k m i h +KMIR k m i r +KMITL k m i t l +KMJ k m j +K&M k and m +KMK k m k +km k m +K. M. k m +K.M. k m +KM k m +KMLA k m l a +KML k m l +KMME k m m e +KMML k m m l +KMRL k m r l +KMS k m s +KMSP k m s p +KMT k m t +KMTP k m t p +KMTV k m t v +KMVA k m v a +KMXW k m x w +KMZ k m z +KNFM k n f m +KNHP k n h p +K&N k and n +kn k n +K. N. k n +K.N. k n +KN k n +KNKT k n k t +KNLA k n l a +KNMI k n m i +KNNV k n n v +KNPN k n p n +KNPR k n p r +KNPU k n p u +KNRE k n r e +KNRS k n r s +KNS k n s +KNSM k n s m +KNST k n s t +KNTH k n t h +K.N.T. k n t +KNTN k n t n +KNTU k n t u +KNVA's k n v a's +KNVB k n v b +KNVN k n v n +KNX k n x +KNXT k n x t +K.O.D. k o d +k'o k o +K. O. k o +K.O. k o +KOTC k o t c +KOTD k o t d +K.O.T. k o t +KOWL k o w l +K. P. A. C. k p a c +KPAC k p a c +KPA k p a +KPAN k p a n +KPCC k p c c +KPC k p c +KPD k p d +KPE k p e +KPIF k p i f +KPI k p i +KPIs k p i's +K&P k and p +K. P. k p +K.P. k p +KP k p +KPLC k p l c +KPL k p l +KPLZ k p l z +KPMG k p m g +KPM k p m +KPNA k p n a +KPNB k p n b +KPO k p o +Kppen k p p e n +KPPV k p p v +KPS k p s +kptm k p t m +KPTV k p t v +KPU k p u +KPVD k p v d +KPVX k p v x +KPWR k p w r +KPXE k p x e +KQA k q a +KQED k q e d +KQHN k q h n +KQKK k q k k +KQKS k q k s +KQLT k q l t +KQLZ k q l z +KQMO k q m o +KQV k q v +KQXR k q x r +KRBM k r b m +krc k r c +KRCR k r c r +KRCs k r c's +KRF k r f +KRH k r h +K.R.I.T. k r i t +K.R.I.T.'s k r i t's +Krka k r k a +KRKC k r k c +KRK k r k +kr k r +K. R. k r +K.R. k r +KR k r +KRMT k r m t +Krne k r n e +KRNS k r n s +KRNV k r n v +KROQ k r o q +kroz k r o z +Kroz k r o z +KRPS k r p s +KRRT k r r t +K. R. S. k r s +KRS k r s +KRT k r t +Kru k r u +KRU k r u +KRWC k r w c +KRX k r x +K.R.Y. k r y +KRZA k r z a +ksa k s a +KSA k s a +K. S. B. k s b +KSBW k s b w +KSBY k s b y +KSCB k s c b +KSC k s c +KSCO k s c o +KSC's k s c's +KSCS k s c s +KSDB k s d b +KSDO k s d o +KSEB k s e b +KSEG k s e g +KSE k s e +KSEQ k s e q +kset k s e t +KSET k s e t +Kseur k s e u r +Ksevt k s e v t +KSFO k s f o +KSG k s g +KSHB k s h b +KSI's k s i's +KSJR k s j r +KSKJ k s k j +KSKK k s k k +K.S.K. k s k +KSK k s k +ks k s +K. S. k s +K.S. k s +KS k s +KSLC k s l c +KSL k s l +KSLM k s l m +KSLU k s l u +KSMB k s m b +KSNR k s n r +KSNV k s n v +KSP k s p +KSPS k s p s +KSTE k s t e +KSTH k s t h +KST k s t +KSTP k s t p +KSU k s u +K.S.V. k s v +KSWD k s w d +KSWT k s w t +KSWW k s w w +KSYL k s y l +KSZR k s z r +Ktav k t a v +KTAV k t a v +KTBS k t b s +KTCC k t c c +KTC k t c +KTCZ k t c z +KTDA k t d a +KTDD k t d d +KTE k t e +KTH k t h +KT&K k t and k +kt k t +K. T. k t +K.T. k t +KT k t +KTKZ k t k z +KTLA k t l a +K. T. M. k t m +KTM k t m +KTN k t n +KTOK k t o k +KTO k t o +KTRE k t r e +KTRH k t r h +KTRK k t r k +KTR k t r +KT's k t's +KTSM k t s m +KTT k t t +KTTN k t t n +KTTV k t t v +KTU k t u +KTUM k t u m +KTVA k t v a +KTVK k t v k +KTVS k t v s +KTVT k t v t +KTVU k t v u +KTVZ k t v z +KTWD's k t w d's +KTWO k t w o +KTX k t x +KTXL k t x l +Kuaa k u a a +Kud k u d +KUFM k u f m +KUGB k u g b +kuih k u i h +K. U. k u +K.U. k u +Kutb k u t b +KUTV k u t v +KUUU k u u u +KUWL k u w l +KUYI k u y i +KVAB k v a b +KVBC k v b c +KVB k v b +K.V.G.K. k v g k +KVHV k v h v +Kvik k v i k +KVI k v i +Kvit k v i t +KVIT k v i t +KVK k v k +K. V. k v +K.V. k v +KVLO k v l o +KVLY k v l y +KVM k v m +KVMRT k v m r t +KVMX k v m x +KVNG k v n g +KVN k v n +KVP k v p +KVTV k v t v +KVVS's k v v s's +KVVV k v v v +Kvyat k v y a t +KVZ k v z +kwa k w a +KWBM k w b m +KWC k w c +KWD k w d +KWEI k w e i +kwe k w e +KWG k w g +KWJJ k w j j +KWKH k w k h +KWKW k w k w +KWMR k w m r +KWMT k w m t +KWNA k w n a +KWNK k w n k +KWOA k w o a +KWP k w p +KWPT k w p t +KWQC k w q c +KWRE k w r e +KWRU k w r u +KWSB k w s b +KWSX k w s x +KWU k w u +KWWL's k w w l's +KXAN k x a n +KXAS k x a s +KXI k x i +KXJB k x j b +KXKS k x k s +KX k x +KXLX k x l x +KXLY k x l y +KXMC k x m c +KXNA k x n a +KXOL's k x o l's +KXTA k x t a +KXTN k x t n +KXTX k x t x +KYAY k y a y +KYBE k y b e +KYEZ k y e z +KYNM k y n m +Kyse k y s e +KYSL k y s l +KYTC k y t c +kyt k y t +Kyt k y t +KYW k y w +kz k z +K. Z. k z +KZ k z +KZLZ k z l z +KZMP k z m p +KZMU k z m u +KZQX k z q x +KZZQ k z z q +L. A. G. l a g +L. A. l a +L.A.'s l a's +Lay's l a y's +L.B.A. l b a +LBA l b a +LBCC l b c c +LBC l b c +LBC's l b c's +LBE l b e +LBF l b f +LBi l b i +LBJ l b j +LBJ's l b j's +L. B. l b +L.B. l b +LB l b +LBL l b l +LBM l b m +LBN l b n +LBNL l b n l +LBP l b p +LBPs l b p's +LBR l b r +LBS l b s +LBV l b v +LBW l b w +LCAC l c a c +LCA l c a +LCAs l c a's +LCAS l c a s +L.C.B. l c b +LCBL l c b l +LCBM l c b m +lcc l c c +LCC l c c +LCCN l c c n +LCCs l c c's +LCCS l c c s +LCDB l c d b +LCD l c d +LCDP l c d p +LC&DR l c and d r +LCDR l c d r +LCDs l c d's +L.C.E. l c e +LCFC l c f c +LCF l c f +LCH l c h +LCI l c i +LCIs l c i's +L. C. l c +L.C. l c +LC l c +LCL l c l +LCMC l c m c +LCM l c m +LCMR l c m r +LCMV l c m v +lcn l c n +LCO l c o +LCP l c p +LCQ l c q +LCR l c r +LCSB l c s b +LCSC l c s c +LC's l c's +LCS l c s +LCSs l c s's +LCST l c s t +LCT l c t +LCTs l c t's +LCU l c u +LCV l c v +LCVP l c v p +LCVPs l c v p's +LCZ l c z +Lda l d a +LDA l d a +LDAP l d a p +LDB l d b +LDBV l d b v +L.D.C. l d c +LDC l d c +LDCM l d c m +LDCs l d c's +LDD l d d +LDDP l d d p +LDF l d f +LDH l d h +L.D.I. l d i +LDK l d k +L. D. l d +L.D. l d +LDL l d l +LDLR l d l r +LDM l d m +LDMR l d m r +LDN l d n +LDP l d p +LDS l d s +LDU l d u +LDV l d v +LEB l e b +L. E. l e +L.E. l e +LFA l f a +L.F.C. l f c +LFC l f c +L.F.D. l f d +LFE l f e +LFFCs l f f c's +LFF l f f +LFG l f g +LFHC l f h c +LFH l f h +L. F. l f +L.F. l f +LFL l f l +LFM l f m +LFOC l f o c +LFO l f o +LFOM l f o m +LFPB l f p b +LFP l f p +LFQD l f q d +LFRJ l f r j +LFR l f r +LFs l f's +LFS l f s +LFSRs l f s r's +LFTR l f t r +LFXA l f x a +LGA l g a +LGB l g b +LGBTI l g b t i +LGBT l g b t +LGBTQ l g b t q +LGC l g c +LGD l g d +LGI l g i +L. G. l g +L.G. l g +LG l g +LGMB l g m b +LGMs l g m's +LGN l g n +LGPL l g p l +LGPZ l g p z +LG&RDD l g and r d d +LGR l g r +LGs l g's +LGS l g s +LGTB l g t b +LGT's l g t's +LGU l g u +LGUs l g u's +LGV l g v +LGVs l g v's +Lha l h a +LHB l h b +L. H. C. l h c +LHC l h c +LHD l h d +LHFP l h f p +LHICE l h i c e +LHI l h i +L. H. l h +L.H. l h +LHMC l h m c +L.H.M. l h m +LHO l h o +L. H. P. l h p +LHP l h p +LHS l h s +LHW l h w +LHX l h x +LHY l h y +L. I. l i +L.I. l i +LJBL l j b l +Lje l j e +LJJ l j j +L. J. K. l j k +L. J. l j +L.J. l j +L.J.V. l j v +LKB l k b +LKG l k g +LKK l k k +L. K. l k +LK l k +LKL l k l +LKML l k m l +LKPR l k p r +LKRN l k r n +lks l k s +LKS l k s +LKTI l k t i +Llapi l l a p i +LLAW l l a w +L.L.B. l l b +LLB l l b +LLCC l l c c +L.L.C. l l c +LLC l l c +LLD l l d +LL.D l l d +lle l l e +LLE l l e +LLHS l l h s +lli l l i +LLI l l i +L&L l and l +LLLE l l l e +L. L. l l +L.L. l l +LL l l +LLL l l l +LLLP l l l p +LLM l l m +LLMNR l l m n r +LLPFX l l p f x +llp l l p +LLP l l p +LLPX l l p x +LLRW l l r w +LLT l l t +LLTV l l t v +llu l l u +LLVM l l v m +LLWS l l w s +LMA l m a +LMC l m c +LMCT l m c t +LMDB l m d b +LMDC l m d c +LMD l m d +LME l m e +LMFAO's l m f a o's +LMFF l m f f +LMG l m g +LMGs l m g's +LMGTE l m g t e +LMH l m h +LMHS l m h s +lm l m +L. M. l m +L.M. l m +LM l m +LMM l m m +LMP l m p +LMPs l m p's +LMQ l m q +LMQs l m q's +L.M.S. l m s +LMS l m s +LMT l m t +LMTP l m t p +LMU l m u +LMWH l m w h +LMX l m x +LnAIB l n a i b +LNA l n a +LNAV l n a v +LNBF l n b f +LNB l n b +L.N.C. l n c +LNCS l n c s +L.N.E.R. l n e r +LNER l n e r +LNFS l n f s +LNG l n g +LNH l n h +L&N l and n +L. N. l n +L.N. l n +L.O.C.'s l o c's +Lokk l o k k +l'OL l o l +L.O.L. l o l +L. O. l o +L.O. l o +L.O.V.E. l o v e +L.O.V. l o v +LOXL l o x l +LPA l p a +L.P.A.M. l p a m +LPAM l p a m +LPARs l p a r's +LPAVS l p a v s +LPBG l p b g +L.P.B. l p b +LPB l p b +LPC l p c +LPCM l p c m +LPDA l p d a +LPDR l p d r +LPE l p e +LPF l p f +LPFM l p f m +LPGA l p g a +LPG l p g +L.P.H. l p h +LPH l p h +LPI l p i +LPLA l p l a +L&P l and p +LPL l p l +lp l p +L. P. l p +L.P. l p +LP l p +L&PM l and p m +LPMN l p m n +LPMud l p m u d +LPMUD l p m u d +LPN l p n +LPO l p o +LPRP l p r p +LPSC l p s c +LP's l p's +LPs l p's +LPS l p s +LPSN l p s n +LPTB l p t b +LPThe l p t h e +LPTV l p t v +LQ l q +LRAD l r a d +LRA l r a +LRCD l r c d +LRC l r c +L.R.C.P. l r c p +LRCP l r c p +LRDG l r d g +LRG l r g +lr l r +L. R. l r +L.R. l r +LR l r +LRO l r o +L.R.P.C. l r p c +LRP l r p +LRPPRC l r p p r c +LRRI l r r i +LRRP l r r p +LRS l r s +LRTA l r t a +LRT l r t +LRTR l r t r +LRTs l r t's +LRVs l r v's +LRY l r y +LSAC l s a c +LSA l s a +LSBC l s b c +LSB l s b +LSC l s c +LSCS l s c s +LSDHH l s d h h +L.S.D. l s d +LSD l s d +LSDP l s d p +LSDs l s d's +LSE l s e +LSF l s f +LSG l s g +LSH l s h +LSi l s i +LSI l s i +LSJ l s j +LSK l s k +L.S.L. l s l +ls l s +Ls l's +L. S. l s +L.S. l s +LSM l s m +LSO l s o +LSP l s p +LSPN l s p n +LSQC l s q c +LSRI l s r i +L. S. R. l s r +LSS l s s +LSSP l s s p +LSSR l s s r +LST l s t +LSTM l s t m +LSTs l s t's +LSUA l s u a +LSU l s u +LSU's l s u's +LSVCCs l s v c c's +LSV l s v +LSWR l s w r +LTAF l t a f +L. T. B. l t b +LTB l t b +LTCF l t c f +LTCI l t c i +L. T. C. l t c +L.T.C. l t c +LTC l t c +Ltda l t d a +LTDA l t d a +Ltd. limited +LTE l t e +LTFA l t f a +LTHS l t h s +LTI l t i +LTK l t k +L&T l and t +Lt. lieutenant +LTL l t l +lt l t +L. T. l t +L.T. l t +L.T.M. l t m +LTM l t m +LTMPS l t m p s +LTN l t n +ltoh l t o h +LTP l t p +LTRPC l t r p c +LTTE l t t e +LTTR l t t r +LTU l t u +LTV l t v +L. U. l u +lv l v +L. V. l v +L.V. l v +LV l v +LVMH l v m h +LWDB l w d b +LWD l w d +LWDS l w d s +LWE l w e +LWF l w f +LWH l w h +L. W. l w +L.W. l w +L.Y. l y +L&YR l and y r +M.A.D.E. m a d e +M.A.D. m a d +M.A.J. m a j +M.A.K. m a k +M. A. m a +M.A. m a +M&A m and a +M. A. O. m a o +M.A.O. m a o +M.A.R. m a r +M.A.S.K. m a s k +M.A.S. m a s +M.A.S.S. m a s s +M.B.A. m b a +M.B.B.S. m b b s +MBBS m b b s +MBC m b c +MBC's m b c's +MBDA m b d a +MBD m b d +M.B. D.P.M. m b d p m +M.B.E. m b e +MBE m b e +Mbewu m b e w u +MBF m b f +MBFW m b f w +MBGN m b g n +MBH m b h +mbi m b i +MBI m b i +M. B. J. m b j +MBJ m b j +MBK m b k +MBL m b l +M. B. m b +M.B. m b +MBM m b m +MBNA m b n a +mBo m b o +MBO m b o +MBPJ m b p j +MBP m b p +Mbre m b r e +mbr m b r +MBR m b r +MBSE m b s e +MBSI m b s i +MBS m b s +MBTI m b t i +MBT m b t +MBU's m b u's +MBX m b x +MCAF m c a f +MCAL m c a l +M.C.A. m c a +MCA m c a +MCA's m c a's +MCAS m c a s +MCB m c b +M. C. C. m c c +M.C.C. m c c +MCC m c c +MCC's m c c's +MCCs m c c's +MCCU m c c u +MCDA m c d a +MCDC m c d c +MCD m c d +MCDM m c d m +MCE m c e +MCFA m c f a +M. C. F. m c f +MCF m c f +MCFM m c f m +MCGJCW m c g j c w +MCG m c g +MCI m c i +MCJ m c j +MCLA m c l a +MCL m c l +M. C. m c +M.C. m c +MCMC m c m c +M. C. M. m c m +MCM m c m +MCN m c n +MCO m c o +MCOT's m c o t's +MCPC m c p c +MCPI m c p i +MCP m c p +MCPON m c p o n +MCPP m c p p +MCQ m c q +MCRD m c r d +MCR m c r +MCRP m c r p +MCSBA m c s b a +MCs m c's +M.C. S. m c s +MCS m c s +MCST m c s t +MCTFS m c t f s +MCT m c t +MCTU m c t u +MCTV m c t v +MCU m c u +MCV m c v +MCVTS m c v t s +MCW m c w +mcyG m c y g +MCYO m c y o +MCZ m c z +MDAA m d a a +MDAH m d a h +MDA m d a +mdb m d b +MDB m d b +MDC m d c +MDC's m d c's +MDCs m d c's +MDCT m d c t +mdDA m d d a +MD&DI m d and d i +Mde m d e +MDE m d e +MDF m d f +MDG m d g +MDGs m d g's +MDH m d h +MDHUs m d h u's +mDia m d i a +MDIB m d i b +MDic m d i c +MDI m d i +MDJT's m d j t's +MDK m d k +mdla m d l a +MDL m d l +MDMA m d m a +md m d +M. D. m d +M.D. m d +MD m d +MDM m d m +MDNA m d n a +M.D.N. m d n +MDPD's m d p d's +MDP m d p +MDPPP m d p p p +MDPS m d p s +MDPV m d p v +MDQ m d q +MDRC m d r c +mdr m d r +MDR m d r +MDT m d t +MDV m d v +MDX m d x +M. E. m e +M.E. m e +M.E.N. m e n +M. E. P. m e p +M.F.A. m f a +MFA m f a +MFB m f b +MFCC m f c c +MFC m f c +MFCS m f c s +MFD m f d +MFDs m f d's +MFe m f e +MFF m f f +MFG m f g +MFI m f i +MFJ m f j +MFK m f k +M. F. m f +M.F. m f +MFMF m f m f +MFM m f m +MFN m f n +MFNW m f n w +MFP m f p +MFR m f r +MFS m f s +MFS's m f s's +MFTBC m f t b c +MFT m f t +MFTs m f t's +Mgadla m g a d l a +Mgal m g a l +mga m g a +Mga m g a +MGA m g a +MGB m g b +Mgbo m g b o +MGCCC m g c c c +MGC m g c +MGE m g e +MGen m g e n +MGG m g g +MGH m g h +MGIMO m g i m o +MGIT m g i t +MGJH m g j h +MGK m g k +M.G.L. m g l +M&G m and g +M. G. m g +M.G. m g +M. G. M. m g m +MGM m g m +MGM's m g m's +MGMT m g m t +M&GN m and g n +MGN m g n +MGO m g o +MGP m g p +M&GR's m and g r's +Mha m h a +M.H.A. m h a +MHA m h a +MHB's m h b's +MHC m h c +MHCs m h c's +MHD m h d +MHI m h i +MHK m h k +MH&L m h and l +MHL m h l +M&H m and h +M. H. m h +M.H. m h +Mhor m h o r +Mhow m h o w +MHPL m h p l +M.H.P. m h p +MHP m h p +MHP's m h p's +MHRA m h r a +M. H. R. m h r +MHSA m h s a +MHSC m h s c +MHS m h s +MHT m h t +M.I.A. m i a +M.I.A.'s m i a's +M.I.C.M. m i c m +M.I.H. m i h +M&I m and i +M. I. m i +M.I. m i +M.I.N. m i n +M.I.R.V. m i r v +M.I.S. m i s +M.I.T. m i t +MJAHL's m j a h l's +M.J.A. m j a +MJA m j a +MJBHA m j b h a +MJB m j b +MJC m j c +M.J.F. m j f +MJF m j f +MJG m j g +MJHL m j h l +MJHL's m j h l's +M&J m and j +M. J. m j +M.J. m j +M. J. Y. m j y +MKBHD m k b h d +MKB m k b +MKDE m k d e +MKE m k e +MKFM m k f m +MKG m k g +MKK m k k +MKMF m k m f +M. K. m k +M.K. m k +MKNG m k n g +MKP m k p +MKRN m k r n +MKs m k's +MKS m k s +MKT m k t +MKTO m k t o +MKTV m k t v +MKZ's m k z's +M.L.A. m l a +MLA m l a +MLANA m l a n a +MLAs m l a's +MLB m l b +MLBPA m l b p a +MLCA m l c a +mlc m l c +M.L.C. m l c +MLC m l c +MLCs m l c's +MLD m l d +MLE m l e +MLF m l f +mlg m l g +MLG m l g +MLH m l h +MLIA m l i a +mli m l i +MLI m l i +MLIM m l i m +MLK m l k +MLK's m l k's +Mlle m l l e +MLL m l l +MLLT m l l t +M&L m and l +M. L. m l +M.L. m l +MLM m l m +MLND m l n d +M.L.N. m l n +MLN m l n +MLPH m l p h +MLP m l p +MLPs m l p's +M. L. R. m l r +MLR m l r +MLSE m l s e +M. L. S. m l s +M.L.S. m l s +MLS m l s +MLT m l t +MLW m l w +MLWS m l w s +MM&A m m and a +M. M. J. m m j +MMK m m k +MML m m l +M&M m and m +M. M. m m +M.M. m m +MMSA m m s a +M&M's m and m's +M. M. S. m m s +MMS m m s +MMST m m s t +MMTB's m m t b's +MMTS m m t s +MMTV m m t v +MMWR m m w r +MMX m m x +MNA m n a +MNBA m n b a +MNC m n c +MNCPPC m n c p p c +MNCs m n c's +MNDM m n d m +MNDNR m n d n r +MNDO m n d o +MNDR m n d r +M&NF m and n f +MNF m n f +MNG m n g +MNI m n i +MNLA m n l a +MNLA's m n l a's +MNLF m n l f +MNM m n m +M. N. m n +M.N. m n +MNNA m n n a +MNN m n n +MNP m n p +MNPP m n p p +MNRG m n r g +MNSD m n s d +MNS m n s +MNTC m n t c +MNT m n t +MNZM m n z m +MNZ m n z +MOBKL m o b k l +MOBK m o b k +M.O.B. m o b +M.O.D. m o d +M.O.D.O.K. m o d o k +M.O.G.U.E.R.A.'s m o g u e r a's +M. O. H. m o h +M. O. m o +M.O. m o +M.O.P. m o p +M.O.R. m o r +M.O.T. m o t +MPAA m p a a +MpA m p a +MPA m p a +MPAs m p a's +MPB m p b +MPBN m p b n +MPBu m p b u +MPCA m p c a +MPCI m p c i +MPC m p c +MPD m p d +MPE m p e +MPF m p f +MPG m p g +M.P.H. m p h +MPH m p h +MP&I m p and i +MPi m p i +MPI m p i +MPIO m p i o +MPKAB m p k a b +MPLAD m p l a d +MPLA m p l a +MPL m p l +MPLMs m p l m's +MPLR m p l r +MPLS m p l s +M&P m and p +MPM m p m +M. P. m p +M.P. m p +MPO m p o +MPPJ m p p j +M.P.P. m p p +MPP m p p +MPPSC m p p s c +MPPs m p p's +MPQC m p q c +MPR m p r +MPRO m p r o +MPRP m p r p +MPRS m p r s +MPSE m p s e +MPSF m p s f +M.P.'s m p's +MP's m p's +MPs m p's +MPS m p s +MPThe m p t h e +MPT m p t +Mpu m p u +MPU m p u +MPV m p v +MPW m p w +MPZ m p z +MQM m q m +M. Q. m q +Mra m r a +MRA m r a +M. R. B. m r b +MRB m r b +MRBs m r b's +MRCB m r c b +MRCK m r c k +MRCM m r c m +MRC m r c +M.R.C.S. m r c s +MRCS m r c s +MRDC m r d c +MRD m r d +mre m r e +MRF m r f +MR&LE m r and l e +MRL m r l +Mr. mister +MRM m r m +M. R. m r +M.R. m r +mRNA m r n a +mRNAs m r n a's +MRPGM m r p g m +MRP m r p +MRPS m r p s +MRR m r r +MRSA m r s a +M.R.S.C. m r s c +Mrs. misses +MRSM m r s m +MRT m r t +MRTs m r t's +MRTS m r t s +MRTT m r t t +MRU m r u +MSAA m s a a +MSAC m s a c +MSAD m s a d +MSA m s a +M.S.A.S. m s a s +MSAW m s a w +MSB m s b +MSBO m s b o +MSBSD m s b s d +MSCC m s c c +M.S.C. m s c +MSC m s c +msd m s d +MSD m s d +MSDN m s d n +MSDS m s d s +Mse m s e +MSFC m s f c +M.S.F. m s f +MSF m s f +MSFT m s f t +MSG m s g +MSI m s i +MSJ m s j +MSK m s k +MSL m s l +M&S m and s +Ms. miss +MSML m s m l +M.S.M. m s m +MSM m s m +M. S. m s +M.S. m s +MSNBC m s n b c +MSNBC's m s n b c's +MSN m s n +MSOB m s o b +MSOM m s o m +M.S.P. m s p +MSP m s p +MSPs m s p's +MSR m s r +MSRP m s r p +MSRTC m s r t c +MSSH m s s h +MSSK m s s k +MSSMLP m s s m l p +MSSM m s s m +MSS m s s +MSTA m s t a +mst m s t +MST m s t +MSTS m s t s +MSU's m s u's +MSVCC m s v c c +MSV m s v +MSVU m s v u +MSX m s x +MSY m s y +MSZP m s z p +MTAC m t a c +Mta m t a +M.T.A. m t a +MTA m t a +MTA's m t a's +MTAs m t a's +MTBE m t b e +MTBI m t b i +MTB m t b +MTC m t c +MTDB m t d b +M.T.D. m t d +MTD m t d +MTD's m t d's +MTG m t g +MTHFR m t h f r +MTHL m t h l +MTIC m t i c +MTI m t i +MTJ m t j +MTK m t k +MTKO m t k o +M&T m and t +MTM m t m +MTMR m t m r +M. T. m t +M.T. m t +Mtor m t o r +MTOSI m t o s i +M.T.O.W. m t o w +MTPA m t p a +MTPC m t p c +MTP m t p +MTQ m t q +MTRCB m t r c b +MTRC m t r c +MTRJ m t r j +MTR m t r +M. T. S. m t s +MTS m t s +MTSU m t s u +MTTM m t t m +MTT m t t +MTU m t u +MTV m t v +MTVR m t v r +MTV's m t v's +mtvU m t v u +MTVu m t v u +MTVU m t v u +MTY m t y +MTZ m t z +MUKW m u k w +M. U. m u +MUSL m u s l +M.U.s m u's +M. U.S. m u s +MVA m v a +M. V. C. m v c +M.V.C. m v c +MVC m v c +M. V. D. m v d +MVD m v d +MVH m v h +MVK m v k +M.V.M. m v m +MVM m v m +MVMs m v m's +M. V. m v +M.V. m v +M.V.O. m v o +MVO m v o +MVP m v p +MVPs m v p's +MVPS m v p s +M.V. P.T. m v p t +MVs m v's +MVS m v s +MVSN m v s n +MVSR m v s r +MVT m v t +MVV m v v +M.W.A.M. m w a m +MWA m w a +MWC m w c +MWe m w e +M. W. E. m w e +MWF m w f +MWHL m w h l +MWIFF m w i f f +MWI m w i +MWJCHL m w j c h l +MWJHL m w j h l +M. W. J. m w j +M. W. m w +M.W. m w +M. X. m x +myb m y b +myc m y c +Myc m y c +MYC m y c +MYCN m y c n +MyDD m y d d +M. Y. m y +M.Y. m y +MySQL m y s q l +MYSQL m y s q l +MZC m z c +MZH m z h +MZM m z m +M. Z. m z +MZP m z p +MZT m z t +NAACCR n a a c c r +NAACL n a a c l +NAAC n a a c +N.A.A.C.P. n a a c p +NAACP n a a c p +NAACP's n a a c p's +N.A.C.L. n a c l +NAFBL n a f b l +NAFC n a f c +NAFC's n a f c's +NAFH n a f h +NAFI n a f i +N. A. n a +N.A. n a +NBADL n b a d l +N.B.A. n b a +NBA n b a +N.B.A.'s n b a's +NBA's n b a's +NBAs n b a's +NBCC n b c c +NBC n b c +NBC's n b c's +NBCSN n b c s n +NBDL n b d l +NBD n b d +NBFA's n b f a's +NBF n b f +NBG n b g +NBI n b i +NBK n b k +NBL n b l +N. B. n b +N.B. n b +N.B.N. n b n +NBN n b n +NBP n b p +NBQ n b q +NBR n b r +NBR's n b r's +NBSK n b s k +nbs n b s +NBS n b s +NBSP n b s p +NBTE n b t e +NBT n b t +NBTwo n b t w o +NBTY n b t y +NBW n b w +NCAAs n c a a's +NCAM n c a m +NCA n c a +NCAP n c a p +NCBC n c b c +NCBI n c b i +NCCC n c c c +NCCF n c c f +NCCMH n c c m h +NCC n c c +NCCP n c c p +NCCs n c c's +NCCS n c c s +NCCU n c c u +NCDC n c d c +NCDD's n c d d's +NCD n c d +NCES n c e s +NCFA n c f a +N.C.F. n c f +NCF n c f +NCG n c g +NCGS n c g s +NCHC n c h c +NCH n c h +NCHU n c h u +NCID n c i d +NCI n c i +NCIS n c i s +NCIS's n c i s's +NCKU n c k u +NCLB n c l b +NCLC n c l c +NCL n c l +NCLR n c l r +NCLT n c l t +NCMA n c m a +NCMC n c m c +NCMM n c m m +NCM n c m +NCMP n c m p +NCNB n c n b +N. C. n c +N.C. n c +N.C.O. n c o +NCO n c o +NCO's n c o's +NCOs n c o's +NCPA n c p a +NCPC n c p c +NCP n c p +NCPO n c p o +NCRC n c r c +NCR n c r +NCSU n c s u +NCSY n c s y +NCTA n c t a +NCTC n c t c +NCTE n c t e +NCT n c t +NCUA n c u a +NCVO n c v o +NCVS n c v s +NCVT n c v t +NCWM n c w m +NCW n c w +NDA n d a +NDE n d e +NDEP n d e p +NDFB n d f b +NDFT n d f t +N.D.G. n d g +N. D. n d +N.D. n d +N.D.N.Y. n d n y +NDPH n d p h +NDPK n d p k +N.D.P. n d p +NDP n d p +NDP's n d p's +NDRC n d r c +NDRE n d r e +NDRF n d r f +N.E.A.R. n e a r +NECW n e c w +N. E. n e +N.E. n e +N.E.R.D. n e r d +NERFU n e r f u +ner n e r +N.E.R. n e r +NER n e r +N.E.W.S.T. n e w s t +NFA n f a +NFATc n f a t c +NFAT n f a t +NFB n f b +NFB's n f b's +NFC n f c +NFC's n f c's +NFD n f d +NFEA n f e a +nfed n f e d +NFFC n f f c +NFF n f f +NFH n f h +NFHS n f h s +NFIB n f i b +NFI n f i +NFISD n f i s d +N.F.L. n f l +NFL n f l +NFLPA n f l p a +NFL's n f l's +N. F. n f +N.F. n f +NFO n f o +NFPA n f p a +NFPF n f p f +NFP n f p +NFPW n f p w +NFRS n f r s +NFS n f s +NGC n g c +Nge n g e +NGF n g f +N.G.L. n g l +N. G. n g +N.G. n g +NGO n g o +NGO's n g o's +NGOs n g o's +NGRC n g r c +N.G.R. n g r +NGR n g r +NGRR n g r r +NGS n g s +NGSS n g s s +NGST n g s t +NGTC n g t c +Nha n h a +NHA n h a +NHCEs n h c e's +NHC n h c +NHCP n h c p +NHCs n h c's +NHD n h d +NHHD n h h d +NHHI n h h i +nhi n h i +NHI n h i +NHK n h k +NHK's n h k's +N.H.L. n h l +NHM&W n h m and w +N. H. n h +N.H. n h +NHP n h p +NHPs n h p's +NHPS n h p s +NHRA n h r a +NHRC n h r c +NHSCT n h s c t +NHS n h s +NHST n h s t +NHW n h w +N.I.B.B.L.E. n i b b l e +NIBC n i b c +NIBR n i b r +N. I. n i +N.I. n i +N'I n i +N.J.A.C. n j a c +N. J. A. n j a +NJA n j a +N. J. C. n j c +NJC n j c +NJIT n j i t +N. J. M. n j m +NJM n j m +N. J. n j +N.J. n j +NJN n j n +Njoo n j o o +NJPS n j p s +NJPW n j p w +N.J.S.A. n j s a +N.J.'s n j's +NKL n k l +N. K. n k +N.K. n k +N. K. N. n k n +NKP n k p +NKP's n k p's +NKR n k r +NKT n k t +NKU n k u +nkvd n k v d +NKVD n k v d +NKVM n k v m +nkv n k v +NKX n k x +NLAES n l a e s +NLAI n l a i +NLA n l a +NLB n l b +NLCF n l c f +NLC n l c +NLCS n l c s +NLDC n l d c +NLD n l d +NLD's n l d's +NLDS n l d s +N. L. n l +N.L. n l +NLP n l p +NLRB n l r b +NLRP n l r p +NLRs n l r's +NLW n l w +NLX n l x +NMAA n m a a +NMA n m a +NMBS n m b s +NMBU n m b u +NMCA n m c a +NMCB n m c b +NMC n m c +N. M. n m +N.M. n m +NMP n m p +NMR n m r +NMRW n m r w +NMT n m t +NMU n m u +NMV n m v +NMW n m w +NNCL n n c l +NNFL n n f l +NNF n n f +N. N. n n +N.N. n n +NNSA n n s a +NNSS n n s s +NNSU n n s u +NNSW n n s w +N.O.R. n o r +NPA n p a +NPBD n p b d +NPBL n p b l +NPB n p b +NPC n p c +NPCs n p c's +NPDC n p d c +NPD n p d +NPF n p f +NPF's n p f's +NPGL n p g l +NPG n p g +NPGS n p g s +NPH n p h +NPHS n p h s +NPIM n p i m +NPI n p i +NPJ n p j +NPK n p k +NPL n p l +NPMA n p m a +NPM n p m +NPMs n p m's +N. P. n p +N.P. n p +NP n p +NPO n p o +NPP n p p +NPP's n p p's +NPRL n p r l +NPRN n p r n +NPR n p r +NPRR n p r r +NPR's n p r's +NPRSO n p r s o +NPSC n p s c +NPSG n p s g +NPSL n p s l +NP's n p's +NPs n p's +NPS n p s +NPTI n p t i +NPT n p t +NPV n p v +NPWE n p w e +NPWS n p w s +NPY n p y +NQAI n q a i +NQEA n q e a +NQHS n q h s +N. Q. n q +nri n r i +Nri n r i +NRI n r i +NRIs n r i's +NRJ n r j +NRJs n r j's +NRK n r k +NRLA n r l a +NRL n r l +NRL's n r l's +NRMA n r m a +NRM n r m +NRN n r n +nr n r +N. R. n r +N.R. n r +N.R.A. n r a +NSA n s a +NSAP n s a p +NSA's n s a's +NSB n s b +NSC n s c +NSD n s d +NSE n s e +NSFE n s f e +NSF n s f +NSFW n s f w +NSG n s g +NSI n s i +NSL n s l +NSM n s m +NSN n s n +N. S. n s +N.S. n s +NSO n s o +NSOs n s o's +NSPCC n s p c c +NSPC n s p c +NSP n s p +NSRI n s r i +NSRL n s r l +NSR n s r +NSSCD n s s c d +NSSDC n s s d c +NSS n s s +NSTA n s t a +NST n s t +NSU n s u +NSV n s v +NSVT n s v t +NSWBLF n s w b l f +NSWC n s w c +NSWCV n s w c v +NSWEC n s w e c +NSWGR n s w g r +N.S.W. n s w +NSW n s w +Nta n t a +NTA n t a +NTA's n t a's +ntb n t b +NTB n t b +NTC n t c +NTD n t d +NTFL n t f l +NTF n t f +NTI n t i +NTKF n t k f +NTL n t l +N. T. n t +N.T. n t +NTR n t r +NTR's n t r's +NTSB n t s b +NTSB's n t s b's +NTSC n t s c +NTS n t s +NTTF n t t f +NTT n t t +NTTR n t t r +NTUC n t u c +NTU n t u +NTVB n t v b +NTV n t v +ntw n t w +N.U. n u +NVA n v a +NVAO n v a o +NVC n v c +NVDA n v d a +NvDA's n v d a's +NVFC n v f c +NVGOP n v g o p +NVHJ's n v h j's +NVH n v h +NVI n v i +NVL n v l +N. V. n v +N.V. n v +NWAFU n w a f u +nwa n w a +N.W.A. n w a +NWA n w a +NWA's n w a's +N.W.F.P. n w f p +NWFP n w f p +NWMP n w m p +N&W n and w +NWN n w n +N. W. n w +N.W. n w +NWPD n w p d +N.W.P. n w p +NWP n w p +NWS n w s +N.W.T. n w t +NWT n w t +nyc n y c +N.Y.C. n y c +NYC n y c +NYC's n y c's +N.Y. G.O.P. n y g o p +N.Y.L. n y l +N. Y. n y +N.Y. n y +N.Y.P.D. n y p d +NYPD n y p d +NYPD's n y p d's +NYPL n y p l +N.Y.P. n y p +NY's n y's +N.Y.S. n y s +N.Y.S.V. n y s v +N.Y.U. n y u +NYU n y u +NYU's n y u's +NYYC n y y c +NZAID n z a i d +NZAOD n z a o d +NZCA n z c a +NZDT n z d t +NZEF n z e f +NZETC n z e t c +NZFC n z f c +NZF n z f +N'Zif n z i f +NZiK n z i k +N'Zi n z i +NZIV n z i v +NZL n z l +NZLP n z l p +N.Z. n z +NZPA n z p a +NZSAS n z s a s +NZ's n z's +NZS n z s +NZTA n z t a +N.Z.W.P.W. n z w p w +O.A.C. o a c +O. A. o a +O.A. o a +O.A.R. o a r +O.A.S. o a s +O.B.E. o b e +obl o b l +Oblt o b l t +O.B. o b +O. C. o c +O.C. o c +Octl o c t l +O.C.T. o c t +O. D. o d +O.E. o e +O.F.M. o f m +O.F. o f +ofr o f r +O.F.R. o f r +OFR o f r +O.F.T.B. o f t b +OGL o g l +O&G o and g +O. G. o g +O.G. o g +O.G.S. o g s +OGS o g s +O.H.A. o h a +O. H. o h +O.H. o h +OHV o h v +O. I. o i +O.I. o i +O. J. o j +O.J. o j +OJ o j +OJSC o j s c +OKBM o k b m +OKB o k b +OKC o k c +OK'd o k d +OKd o k d +OKD o k d +oke o k e +Oke o k e +OKH o k h +O.K.I. o k i +OKK o k k +OKM o k m +O&K o and k +O. K. o k +O.K. o k +O.L.F.A.L. o l f a l +O. L. K. o l k +O. L. o l +O.L. o l +Olo o l o +Olov o l o v +OLPC o l p c +OLPH o l p h +ols o l s +OLs o l's +OLS o l s +OLSR o l s r +OLTL o l t l +OLVT o l v t +olvwm o l v w m +olwm o l w m +OMB o m b +OMC o m c +OMCS o m c s +OMD o m d +O&MFL o and m f l +OMF o m f +omg o m g +OMG o m g +OMGs o m g's +O. M. o m +O.M. o m +OmOm o m o m +Om's o m's +OMTP o m t p +OMVG o m v g +OMW o m w +OMX o m x +ONCHR o n c h r +ONC o n c +oncu o n c u +ONDH o n d h +ond o n d +onf o n f +ONF o n f +ONGC o n g c +ONIR o n i r +ONJSC o n j s c +ONM o n m +ONMR o n m r +O. N. o n +O.N. o n +O&O o and o +OOOA o o o a +O. O. o o +O.O. o o +OO o o +OOO's o o o's +Oop o o p +OOP o o p +OOPSLA o o p s l a +oor o o r +oose o o s e +Oo's o o's +OOTP o o t p +Ootw o o t w +OOUR o o u r +OPAC o p a c +OPAG o p a g +O.P.A. o p a +OPBF o p b f +OPB o p b +OPC o p c +OPCS o p c s +OPCW o p c w +OPD o p d +O.P.I. o p i +OPIRG o p i r g +OPJHL o p j h l +OPLC o p l c +OPL o p l +OPMB o p m b +OPM o p m +OPMs o p m's +OPN o p n +O. P. o p +O.P. o p +opr o p r +Opr o p r +OPR o p r +O.R.C. o r c +ORECA o r e c a +ORFs o r f's +ORMO o r m o +ORNL o r n l +OR&N o r and n +O. R. o r +osaa o s a a +OSAA o s a a +osa o s a +Osa o s a +O.S.A. o s a +OSA o s a +O.S.B. o s b +OSB o s b +OSBs o s b's +O.S.N. o s n +OSN o s n +O. S. o s +O.S. o s +OSP o s p +OSR o s r +OSTM o s t m +O.S.T. o s t +OSTP o s t p +OSTs o s t's +osv o s v +OSV o s v +OTB o t b +OTC o t c +OTJ o t j +OTL o t l +OTMH o t m h +OTO o t o +O.T. o t +OTP o t p +OTR o t r +OTs o t's +OTS o t s +Otu o t u +OTU o t u +otv o t v +O.U. o u +OU o u +OUP o u p +OUSA o u s a +OVA's o v a's +ovca o v c a +Ovca o v c a +OVC o v c +OVC's o v c's +Ovda o v d a +OVF o v f +OVM o v m +Ovo o v o +OVO o v o +ov o v +Ov o v +O. V. o v +O.V. o v +OV o v +OVP o v p +OVS o v s +OVT o v t +OVW o v w +O.W.A. o w a +OWBT o w b t +OWCs o w c's +OWGR o w g r +OWHA's o w h a's +OWIU o w i u +OWM o w m +O. W. o w +O.W. o w +P. A. C. p a c +P. A. J. p a j +P.A.J. p a j +P. A. M. p a m +P.A.M. p a m +pa p a +P. A. p a +P.A. p a +PA p a +PAQ p a q +P.A.R. p a r +P. A. S. p a s +PBAA p b a a +PBA p b a +PBA's p b a's +PBB p b b +PBCC p b c c +pBCE p b c e +pbc p b c +P.B.C. p b c +PBF p b f +PBG p b g +PBIL p b i l +PBI p b i +PBK p b k +PBL p b l +PBM p b m +PBMR p b m r +PBO p b o +pb p b +P. B. p b +P.B. p b +PB p b +PBP p b p +PBR p b r +PBS p b s +PBT p b t +PBX p b x +PBY p b y +P. C. A. p c a +PCA p c a +PCB p c b +PCB's p c b's +PCBs p c b's +PCBS p c b s +PCC p c c +PCCS p c c s +PCCW p c c w +PCCW's p c c w's +PCDDs p c d d's +PCDHB p c d h b +PCDH p c d h +PCD p c d +PCE p c e +PCeU p c e u +PCFCL p c f c l +PCFL p c f l +PCF p c f +PCFS p c f s +PCG p c g +PCGS p c g s +PCHA p c h a +PCHA's p c h a's +P.C.H. p c h +PCH p c h +PCHR p c h r +PCIe p c i e +pci p c i +PCI p c i +PCJHL p c j h l +P. C. J. p c j +PCJ p c j +PCK p c k +PCLM p c l m +pcl p c l +PCL p c l +PCMCIA p c m c i a +PCMNO p c m n o +PCM p c m +PCMS p c m s +PCNA p c n a +PCN p c n +PcoA p c o a +PCOE p c o e +PCO p c o +pc p c +P. C. p c +P.C. p c +PC p c +PCPFL p c p f l +PCP p c p +PCPV p c p v +PCRC p c r c +PCRE p c r e +PCRev p c r e v +PCRM p c r m +PCR p c r +PCSK p c s k +PCSOM p c s o m +pcs p c s +P.C.s p c's +PC's p c's +PCTL p c t l +PCT p c t +PCTV p c t v +PCU p c u +PCU's p c u's +PCW p c w +PCX p c x +pDAB p d a b +PDAB p d a b +PDA p d a +PDAs p d a's +PDBML p d b m l +PDB p d b +pdbp p d b p +PDBsum p d b s u m +PDCI p d c i +PDC p d c +PDCPD p d c p d +PDC's p d c's +PDCs p d c's +PD&D p d and d +PDD p d d +PDE p d e +PDEs p d e's +PDES p d e s +pdf p d f +PDF p d f +PDFs p d f's +PDFT p d f t +PDGF p d g f +PDG p d g +PDHJ p d h j +PDH p d h +PDI p d i +PDJ p d j +PDK p d k +PDL p d l +PDN p d n +PDO p d o +P&D p and d +P. D. p d +P.D. p d +PD p d +PDP p d p +PDP's p d p's +PDPs p d p's +P. D. Q. p d q +PDR p d r +PDSA p d s a +PDSI p d s i +PD's p d's +PDs p d's +P.D.S. p d s +PDS p d s +PDSP p d s p +PDT p d t +P.E.I. p e i +P.E.I.'s p e i's +P.E.N. p e n +P. E. p e +P.E. p e +P.F.L. p f l +PF's p f's +PFs p f's +PFS p f s +PFU p f u +PFV p f v +PFW&C p f w and c +P.G.A. p g a +PGA p g a +PGM p g m +PGMs p g m's +PG&N p g and n +P&G p and g +P. G. p g +P.G. p g +P.G.T. p g t +PHD p h d +P. H. G. p h g +PHH p h h +PHHS p h h s +PHLF p h l f +Phlo p h l o +PHL p h l +PHN p h n +P&H p and h +P. H. p h +P.H. p h +php p h p +PHP p h p +PHPs p h p's +P.I.D.E. p i d e +P&I p and i +P. I. p i +P.I. p i +P. I. W. p i w +Piz p i z +PJB p j b +PJC p j c +PJD p j d +P. J. F. p j f +P.J.K. p j k +pj p j +P. J. p j +P.J. p j +PJ p j +PJ's p j's +PJs p j's +P.J.T. p j t +P. K. p k +P.K. p k +PK p k +PLCC p l c c +plc p l c +PLC p l c +PLC's p l c's +PLCs p l c's +P.L.O. p l o +P. L. p l +P.L. p l +PLP p l p +PLX p l x +P. M. A. p m a +PMC p m c +PMG p m g +PML p m l +PMLP p m l p +PMMA p m m a +PMMoV p m m o v +PMM p m m +PMMS p m m s +PMMT p m m t +PMOI p m o i +PMO p m o +PMPC p m p c +PMPF p m p f +p.m. p m +p.m p m +P. M. p m +P.M. p m +PM p m +PMP p m p +PMP's p m p's +PMRN p m r n +PMRO p m r o +PMR p m r +PMRR p m r r +PMSE p m s e +PMSL p m s l +PMSM p m s m +PM's p m's +PMs p m's +P. M. S. p m s +PMS p m s +PMSSY p m s s y +PMT p m t +PMVY p m v y +PMWA p m w a +PNaCl p n a c l +pna p n a +PNA p n a +Pnau p n a u +pnb p n b +PNB p n b +PNC p n c +PNE p n e +PNE's p n e's +PNEs p n e's +PNETs p n e t's +pneus p n e u s +PNFA p n f a +PNF p n f +PNGIA p n g i a +png p n g +PNG p n g +PNH p n h +PNI p n i +PNL p n l +PNL's p n l's +PNMT p n m t +PNNL p n n l +PNNs p n n's +PNoy p n o y +pn p n +P. N. p n +P.N. p n +PN p n +PNP p n p +P.N.R.A. p n r a +P.O.D. p o d +P.O.D.'s p o d's +P&O p and o +P. O. p o +P.O. p o +P.O.S. p o s +P.O.V. p o v +P.O.W. p o w +P.O.W.'s p o w's +PPACA p p a c a +PPA p p a +PPBS p p b s +PPC p p c +PPD p p d +PPE p p e +PPF p p f +PPG p p g +P&PH p and p h +PPH p p h +PPi p p i +P.P.I. p p i +PPI p p i +PPJ p p j +PPKM p p k m +PPK p p k +PPL p p l +PPM p p m +PPNB p p n b +PPN p p n +PPO p p o +P. P. p p +P.P. p p +PPRP p p r p +PPR p p r +PP's p p's +PPS p p s +PPT p p t +PPTV p p t v +PPV p p v +PPVs p p v's +PPy p p y +PQDT p q d t +PQ p q +PQQ p q q +PQ's p q's +PQS p q s +PRB p r b +PRCA p r c a +PRC p r c +PRCS p r c s +PRDM p r d m +PRD p r d +PRD's p r d's +P.R.I.M.E. p r i m e +pr p r +P. R. p r +P.R. p r +PR p r +P.S.A. p s a +P.S.C. p s c +P.S.K. p s k +PSP p s p +P. s p's +P.'s p's +Ps p's +P. S. p s +P.S. p s +PSQL p s q l +PSR p s r +PSRU p s r u +PSSA p s s a +PSSA's p s s a's +PSSAs p s s a's +PSSI p s s i +PSS p s s +PSS's p s s's +PST p s t +PSU p s u +PSV p s v +PSW p s w +pTA p t a +PTA p t a +PTA's p t a's +PTAs p t a's +PTB p t b +PTBT p t b t +PTCH p t c h +PTC p t c +Pte p t e +PTEs p t e's +PTFE p t f e +ptf p t f +PTF p t f +PTH p t h +Ptie p t i e +PTI p t i +PTI's p t i's +PTK p t k +PTLLS p t l l s +PTL p t l +PTLs p t l's +PTNNT p t n n t +Ptol p t o l +PTO p t o +PTPN p t p n +PTP p t p +pt p t +P. T. p t +P.T. p t +PT p t +PTSD p t s d +PTSE p t s e +PTS p t s +PTTGC p t t g c +PTTG p t t g +PTTOW p t t o w +PTT p t t +PTTs p t t's +PTUN p t u n +PTV p t v +PTV's p t v's +P'Twa p t w a +PTY p t y +P.U.F. p u f +Puiu p u i u +PUKKE p u k k e +PUK p u k +Pul p u l +P. U. M. p u m +PVA p v a +PVAs p v a's +PVB p v b +P.V.C. p v c +PVC p v c +PvdA p v d a +PVEM p v e m +pve p v e +PVH p v h +P.V.L. p v l +PVL p v l +PVN p v n +PVO p v o +PVP p v p +P. V. p v +P.V. p v +PV p v +pvr p v r +PVR p v r +PVRS p v r s +PVs p v's +PVS p v s +PVU p v u +PWA p w a +PWB p w b +PWC p w c +PWD p w d +PWF p w f +P. W. G. p w g +P.W.G. p w g +PWG p w g +PWI p w i +pwll p w l l +PWM p w m +P.W.O. p w o +P&W p and w +P. W. p w +P.W. p w +PW p w +Pyi p y i +PYI p y i +Pyk p y k +PYK p y k +Pyl p y l +PyL p y l +PYP p y p +P. Y. p y +Pyu p y u +Pyw p y w +Pyx p y x +PZB p z b +PZL p z l +PZP p z p +P. Z. p z +Q. A. P. q a p +QAP q a p +Q. A. q a +QA q a +Q&A q and a +Q&A's q and a's +Q&As q and a's +QbA q b a +QBE q b e +QBH q b h +QBL q b l +Q.B. q b +QB q b +Q.C.B. q c b +QCD q c d +Q.C. q c +QD q d +QDS q d s +QEA q e a +QEC q e c +Q.E.D. q e d +QED q e d +Q.E.H. q e h +Q. E. q e +Q.H.C. q h c +QHP q h p +Q.H. q h +Q.I. q i +Q. J. q j +QJ q j +Q. J. R. q j r +Q. N. q n +QPF q p f +QPFS q p f s +QPM q p m +QPO q p o +QPOs q p o's +QPP q p p +QP q p +Q.P.R. q p r +QPR q p r +QQ q q +QRL q r l +QRL's q r l's +QRNA q r n a +QROPS q r o p s +QRP q r p +QR q r +QRS q r s +QRT q r t +QRV q r v +QSAR q s a r +QSES q s e s +QSI q s i +QSL q s l +QSM q s m +QSO q s o +QST q s t +QSY q s y +QVC q v c +QVD q v d +QVM q v m +Q.V. q v +R.A.B. r a b +R. A. E. r a e +R.A.F. r a f +R.A.J. r a j +R. A. r a +R.A. r a +R&A r and a +RAV r a v +R&AW r and a w +RAZR r a z r +RBAC r b a c +RbAg r b a g +RBA r b a +RBBP r b b p +RBC r b c +RBCs r b c's +RBD r b d +RBE r b e +RBGE r b g e +RBG r b g +RBI r b i +RBIs r b i's +R. B. J. r b j +R.B.J. r b j +RBK r b k +R.B.L. r b l +RBL r b l +RBMG r b m g +RBMG's r b m g's +RBM r b m +RBMY r b m y +RBO r b o +RBP r b p +R&B r and b +R. B. r b +R.B. r b +RBR r b r +RBS r b s +RBTCO's r b t c o's +RBTH r b t h +RBWH r b w h +RBW r b w +RBX r b x +RBZ r b z +RCAC r c a c +RCAF r c a f +rca r c a +R.C.A. r c a +RCA r c a +RCA's r c a's +RCBC r c b c +RCB r c b +RCCA r c c a +RCCD r c c d +RCCL r c c l +RCCM r c c m +RCC r c c +RCI r c i +R. C. K. r c k +RCL r c l +R.C.M. r c m +RCM r c m +RCN r c n +RCPO r c p o +RCP r c p +RCPT r c p t +R&C r and c +rc r c +R. C. r c +R.C. r c +RCRD r c r d +RCR r c r +RCSB r c s b +RCS r c s +RCT r c t +RCTs r c t's +RCTS r c t s +RCTV r c t v +RCV r c v +RCW r c w +RDB r d b +RDC r d c +RDD r d d +RdE r d e +RDFC r d f c +RDF r d f +R.D.G. r d g +R&D r and d +R. D. r d +R.D. r d +R.E.A. r e a +R. E. B. r e b +R.E.D. r e d +R.E.L. r e l +R.E.M. r e m +R.E.M.'s r e m's +R.E.O. r e o +REPL r e p l +REPLs r e p l's +R.E.P. r e p +R. E. r e +R.E. r e +R.E.R. r e r +R.F.A. r f a +R.F.C. r f c +R. F. r f +R.F. r f +R. F.S. r f s +R.F.W. r f w +RFW r f w +RFX r f x +RGB r g b +RGD r g d +RGF r g f +RGG r g g +RGI r g i +RGK r g k +RGMA r g m a +RGNL r g n l +RGPH r g p h +R&G r and g +R. G. r g +R.G. r g +RGR r g r +RGS r g s +RGS's r g s's +RGTP r g t p +RGU r g u +RGV r g v +RGX r g x +R. H. C. r h c +RHC r h c +RHD r h d +RHHF r h h f +RHH r h h +RHHS r h h s +RHIBs r h i b's +RHIC r h i c +RHI r h i +Rhiw r h i w +RHK r h k +rhl r h l +RHM r h m +RhoG r h o g +Rho's r h o's +RHP r h p +R. H. r h +R.H. r h +R.H.S.J. r h s j +R. I. C. r i c +R.I.C. r i c +R. I. P. r i p +R.I.P. r i p +R&I r and i +R. I. r i +R.I. r i +riu r i u +Riu r i u +rivs r i v s +Rivu r i v u +RIXS r i x s +Rixt r i x t +RJB r j b +RJD r j d +RJE r j e +rjf r j f +RJHS r j h s +R. J. J. r j j +RJJ r j j +RJL r j l +RJN r j n +R. J. r j +R.J. r j +RJ r j +RJR r j r +RJ's r j's +RJTD r j t d +R. K. B. r k b +RKD r k d +RKI r k i +RKKA r k k a +RKL r k l +R.K.O. r k o +RKO r k o +RKO's r k o's +R. K. r k +R.K. r k +RLM r l m +RLM's r l m's +R. L. r l +R.L. r l +RL r l +RLV r l v +rly r l y +RMAF r m a f +RMAG r m a g +RMA r m a +RMB r m b +RMCH r m c h +RMCL r m c l +R.M.C. r m c +RMC r m c +RMDs r m d's +R.M.E.S. r m e s +RMFL r m f l +R.M.F. r m f +RMF r m f +RMG r m g +R. M. H. r m h +RMI r m i +RMIT r m i t +RMIT's r m i t's +RMJM r m j m +R.M.K. r m k +RMK r m k +R. M. L. r m l +RML r m l +RMLs r m l's +RMM r m m +RMP r m p +rm r m +R. M. r m +R.M. r m +RM r m +RMR r m r +RMRS r m r s +RMSD r m s d +RMSDs r m s d's +RMSE r m s e +RMs r m's +RMS r m s +R. M. W. r m w +R.M.W. r m w +RMW r m w +RMX r m x +RNAO r n a o +rna r n a +RNA r n a +RNA's r n a's +RNAs r n a's +RNAS r n a s +RNC r n c +RND r n d +RNE r n e +Rnet r n e t +RNF r n f +RNG r n g +Rnic r n i c +RNJD r n j d +RNK r n k +RNLAF r n l a f +RNLI r n l i +RNLI's r n l i's +RNNs r n n's +RNOH r n o h +RNP r n p +RNPs r n p's +RNPS r n p s +R. N. r n +R.N. r n +RN r n +R.N.R. r n r +RNZ r n z +R.O.C.K. r o c k +R.O.C. r o c +ROKMC r o k m c +ROKN r o k n +rOmpB r o m p b +Rooi r o o i +ROP r o p +R. O. r o +R.O. r o +ROVs r o v's +Roxb r o x b +Roxx r o x x +RPA r p a +RPAYC r p a y c +RPB r p b +RP&C r p and c +rpc r p c +RPC r p c +Rpe r p e +RPE r p e +RPF r p f +RPGA r p g a +rpg r p g +RPG r p g +RPG's r p g's +RPGs r p g's +RPI r p i +RPI's r p i's +RPK r p k +RPL r p l +rpm r p m +RPM r p m +RPMS r p m s +RPO r p o +RPP r p p +R. P. r p +R.P. r p +RP r p +RPs r p's +R.P.S. r p s +RPS r p s +RPT r p t +RPVE r p v e +RPV r p v +R. Q. r q +R.Q. r q +RQW r q w +rra r r a +RRA r r a +RRC r r c +RRDE r r d e +rrd r r d +Rreli r r e l i +rre r r e +RRE r r e +RRG r r g +R. R. H. r r h +RRH r r h +RRKM r r k m +R.R.K. r r k +rRNA r r n a +rRNAs r r n a's +RRN r r n +RRP r r p +R&R r and r +rr r r +R. R. r r +R.R. r r +RR r r +RRR r r r +RRSR r r s r +RRS r r s +RSAF r s a f +R. S. A. r s a +RSA r s a +RSCG r s c g +RSCJ r s c j +R.S.C. r s c +RSC r s c +RSCS r s c s +RSD r s d +RSE r s e +RSF r s f +RSFSR r s f s r +RSG r s g +RSHA r s h a +rsh r s h +RSHS r s h s +RSICC r s i c c +RSID r s i d +RSI r s i +Rsis r s i's +RSI's r s i's +RSIS r s i s +RSK r s k +RSL r s l +rsly r s l y +RsmA r s m a +RSMC r s m c +RSMI r s m i +RSML r s m l +RSM r s m +RSM's r s m's +RSNO r s n o +RSN r s n +RSNZ r s n z +R. S. O. r s o +RSO r s o +RSPB r s p b +RSPCA r s p c a +RSpec r s p e c +RSPK r s p k +RSPO r s p o +R. S. P. r s p +RSP r s p +RSR r s r +rs r s +Rs r's +R. S. r s +R.S. r s +RS r s +RSSI r s s i +R. S. S. r s s +RSS r s s +RSSSF r s s s f +RSTC r s t c +RST r s t +RSu r s u +R.S.U. r s u +RSU r s u +RSU's r s u's +RSVP r s v p +RSV r s v +RSX r s x +RTAFB r t a f b +RTA r t a +RTBF r t b f +rtb r t b +RTB r t b +RTCG's r t c g's +RTC r t c +RTCs r t c's +RTD r t d +RTEC r t e c +RTEjr r t e j r +RTeOR r t e o r +RTE r t e +RTE's r t e's +RTFB r t f b +RTFM r t f m +RTF r t f +RTF's r t f's +RTFS r t f s +RTHK r t h k +RTHK's r t h k's +RTHL r t h l +RTIP r t i p +RTI r t i +RTKL r t k l +RTK r t k +RTLM r t l m +RTL r t l +RTL's r t l's +RTML r t m l +RTMP r t m p +RTM r t m +RTN r t n +RTO r t o +RTOs r t o's +RTOS r t o s +rtPA r t p a +RTP r t p +RTR r t r +rt r t +R. T. r t +R.T. r t +RT r t +rts r t s +RTS r t s +RTS's r t s's +RTTOV r t t o v +RTT r t t +RTTY r t t y +RTUK r t u k +RTU r t u +RTVC r t v c +RTVE r t v e +RTVFBiH r t v f b i h +RTV r t v +RTVV r t v v +RTW r t w +RTXC r t x c +RTX r t x +RTZ r t z +Ruao r u a o +RUC r u c +RUC's r u c's +RUFC r u f c +Rukn r u k n +Ruk r u k +RUMC r u m c +RUNX r u n x +Rupf r u p f +Rupr r u p r +rup r u p +Rup r u p +RUP r u p +R.U.R. r u r +RUR r u r +R. U. r u +R.U. r u +RU r u +RUSD r u s d +RutB r u t b +Ruu r u u +RUV r u v +Ruwa r u w a +Ruy r u y +Ruyt r u y t +RVAR r v a r +Rvat r v a t +RVC r v c +RVCT r v c t +RVD r v d +R. V. E. r v e +RVE r v e +RVGK r v g k +R.V.G. r v g +R. V. J. r v j +R.V.J. r v j +RVM r v m +RVNG r v n g +Rvo r v o +RVO r v o +RVR r v r +R. V. r v +R.V. r v +RV r v +rvs r v s +RVTD's r v t d's +RVU r v u +rwa r w a +Rwa r w a +RWA r w a +rwb r w b +RWB r w b +RWC r w c +RWD r w d +RWDSU r w d s u +RWE r w e +RWEs r w e's +RWFC r w f c +RWIS r w i s +rwjf r w j f +R.W.R.J. r w r j +R. W. r w +R.W. r w +RW r w +RWSL r w s l +R. W. S. r w s +RWS r w s +Rxa r x a +RXL r x l +RX r x +RZR r z r +rz r z +R. Z. r z +RZ r z +RZS r z s +S.A.B. s a b +S.A.D. s a d +SAIC s a i c +Sa'id s a i d +S.A.I. s a i +SAIT's s a i t's +SAKEC s a k e c +S. A. L. s a l +S.A.P.A. s a p a +S.A.P.I. s a p i +S. A. R. s a r +S.A.R. s a r +S. A. s a +S.A. s a +SA s a +S.A.S. s a s +SAS s a s +S.A.V.A. s a v a +Saxl s a x l +Sa'yo s a y o +SAZU s a z u +SBAC's s b a c's +Sbai s b a i +S.B.A. s b a +SBA s b a +SBBK s b b k +SBB s b b +SBCM s b c m +SBCMT s b c m t +sbc s b c +SBC s b c +SBCs s b c's +SBDE s b d e +SBD s b d +SBE s b e +SBF s b f +SBI s b i +SBKP s b k p +sbk s b k +SBK s b k +SBL s b l +SBML s b m l +SBMNH s b m n h +SBM s b m +SBN s b n +SBOE s b o e +SBOL s b o l +SBOP s b o p +Sborz s b o r z +SBP s b p +SBRJ s b r j +sb s b +S. B. s b +S.B. s b +SB s b +SBSE s b s e +SBS s b s +SBS's s b s's +SBTDC s b t d c +SBT s b t +SBTU s b t u +Sbu s b u +SBU s b u +SBY s b y +SBZ s b z +S.C.A. s c a +SCA s c a +SCBA s c b a +SCB s c b +SCBWI s c b w i +SCCA s c c a +SCCA's s c c a's +SCCC s c c c +SCCI s c c i +SCCP s c c p +S.C.C. s c c +SCC s c c +scr s c r +SCR s c r +SCRs s c r's +SCRS s c r s +SCRTC s c r t c +scry s c r y +sc s c +S. C. s c +S.C. s c +SC s c +S.C.S.C. s c s c +SC's s c's +SCS s c s +SCTC s c t c +SCTE s c t e +SCTO s c t o +SCTP s c t p +SCT s c t +SCTS s c t s +SCTV s c t v +SCUAA s c u a a +Scuf s c u f +SCU's s c u's +SCW s c w +Scymn s c y m n +SD&AE s d and a e +SDAP s d a p +SDAPS s d a p s +SDA s d a +SDAS s d a s +SDASS s d a s s +SDAT s d a t +SDAX s d a x +SDB s d b +SDCC s d c c +SDCG s d c g +SDC s d c +SDDI s d d i +SDDOT s d d o t +SDD s d d +SDDS s d d s +Sdei s d e i +sde s d e +Sde s d e +SDF s d f +SDG&E s d g and e +SDHA s d h a +SDHC s d h c +SDHD s d h d +SDHHD s d h h d +SDH s d h +SDI s d i +SDJ s d j +sdk s d k +SDK s d k +SDK's s d k's +SDLC s d l c +SDLP s d l p +SDLP's s d l p's +S. D. L. s d l +S.D.N.Y. s d n y +S. D. s d +S.D. s d +SDSM&T's s d s m and t's +S. D. S. s d s +S.E.C. s e c +Sejms s e j m's +sejr s e j r +Sekl s e k l +Sek s e k +SEK s e k +S. E. s e +S.E. s e +SESL s e s l +ses s e s +Ses s e's +SEs s e's +S.E.S. s e s +SES s e s +S.E.S.'s s e s's +S.E.X. s e x +Seyh s e y h +sfadb s f a d b +SFA s f a +SFA's s f a's +Sfax s f a x +S.F.B.J. s f b j +SFB s f b +SFCC s f c c +SFCH s f c h +SFC s f c +SFDR s f d r +SFD s f d +SFE s f e +SFES s f e s +SFFAS s f f a s +SFFCo s f f c o +SFFH s f f h +SFF s f f +SFG s f g +SFI s f i +S. F. L. s f l +SFL s f l +sfn s f n +SFN s f n +SFOR s f o r +SFO s f o +SFPA s f p a +SFPD s f p d +SFP s f p +SFRA s f r a +SFRJ s f r j +SFR s f r +'sf s f +sf s f +S. F. s f +S.F. s f +SF s f +SFSG s f s g +SFSR s f s r +sfs s f s +S.F.'s s f's +SFS s f s +SFSS s f s s +SFSU s f s u +SFU s f u +SFWA s f w a +SFX s f x +SFX's s f x's +SGAE s g a e +SGAP s g a p +SGA s g a +SG&A s g and a +SGA's s g a's +sgb s g b +SGB s g b +S.G.C. s g c +SGC s g c +SGD s g d +SGE s g e +S. G. F. s g f +SGF s g f +SGH s g h +Sgip s g i p +SGI s g i +SGL s g l +sgml s g m l +SGML s g m l +SGP s g p +SGRAM s g r a m +sgra s g r a +SGR s g r +S. G. s g +S.G. s g +SGSN s g s n +SGSNs s g s n's +SGS s g s +SGSY s g s y +Sgt. sergeant +sgt s g t +SGT s g t +SGU s g u +SGV s g v +SGX s g x +SHBG s h b g +SHB s h b +SHBT s h b t +SHCA s h c a +SHC s h c +SHG s h g +SHH s h h +S.H.I.E.L.D.'s s h i e l d's +S.H.I.E.L. s h i e l +SHL s h l +Shma s h m a +SHMD s h m d +SHM s h m +SHN s h n +S. H. s h +S.H. s h +S.I.D. s i d +SIF s i f +S.I.R. s i r +S. I. s i +S.I. s i +S.I.T. s i t +SJAM s j a m +SJCH s j c h +SJC s j c +SJDA s j d a +S.J.D. s j d +sjef s j e f +SJEM s j e m +S. J. J. F. s j j f +SJK s j k +S.J.L. s j l +SJL s j l +SJM s j m +Sjon s j o n +SJPCD s j p c d +SJP s j p +SJPT s j p t +SJR s j r +SJR's s j r's +S. J. s j +S.J. s j +SJ s j +SKB s k b +SKC s k c +SKD s k d +S. K. F. s k f +SKF s k f +SKG s k g +SKH s k h +SKJ s k j +SKPC s k p c +SKP s k p +SKR s k r +SKSD s k s d +S. K. s k +S.K. s k +SK s k +S. K. S. s k s +S.L.A.A.'s s l a a's +SLAF s l a f +sla s l a +SLA s l a +SLAs s l a's +SLCO s l c o +SLC s l c +SLDL s l d l +SLD s l d +S.L.E. s l e +SLF s l f +SLG s l g +SLHS s l h s +S.L.I.F.E.R. s l i f e r +SLL s l l +SLMC s l m c +S. L. M. s l m +SLM s l m +SLN s l n +SLPIM s l p i m +SLP s l p +SLRC s l r c +SLR s l r +S&L s and l +SLS&E s l s and e +SLSF s l s f +SLSK s l s k +S. L. s l +S.L. s l +SL s l +SLS s l s +SLVR s l v r +SLV s l v +S.M.A.R.T. s m a r t +S.M.A.S.H. s m a s h +SMA s m a +SMB s m b +SMe s m e +SME s m e +SME's s m e's +SMEs s m e's +SMF s m f +SMG s m g +SMHI s m h i +SMH s m h +SmI s m i +SMI s m i +SMJR s m j r +SMK s m k +SMLS s m l s +SMMT s m m t +SMN s m n +SMNS s m n s +SMP s m p +SMP's s m p's +SMPSs s m p s's +SMPTE s m p t e +SMRJ s m r j +smr s m r +SMR s m r +S&M s and m +sm s m +S. M. s m +S.M. s m +SM s m +S.M.'s s m's +SMs s m s +S.M.S. s m s +SMS s m s +SMS's s m s's +SMSU s m s u +SMTP s m t p +S.M.T. s m t +SMT s m t +SMTV s m t v +SMU s m u +SMW s m w +SMX s m x +Smyl s m y l +SMYS s m y s +SNA s n a +SNBA s n b a +SNB s n b +SNCB s n c b +SNCC s n c c +SNCF s n c f +SNC s n c +SNDC s n d c +SND s n d +SNEP s n e p +SNESjr s n e s j r +SNES s n e s +SNET s n e t +SNF s n f +SNFU s n f u +sngle s n g l e +SNG s n g +SNK s n k +SNLA s n l a +SNL s n l +SNLS s n l s +SNMCMG s n m c m g +SNMC s n m c +SNMMA s n m m a +SNMP s n m p +SNNPR s n n p r +SNNR s n n r +SNPJ s n p j +SNP s n p +SNPs s n p's +SNRI s n r i +SNR s n r +SNSD's s n s d's +SnSe s n s e +S. N. s n +S.N. s n +SN s n +SNS s n s +S.O.E. s o e +S. O. s o +S.O. s o +Sos s o's +S.O.S. s o s +SOS s o s +Sovn s o v n +Sov s o v +SOX s o x +S. O. Y. s o y +S&P 500 s and p five hundred +S.P.A.L. s p a l +SPB s p b +SPCAs s p c a's +SPCG s p c g +SPCK s p c k +S.P.C. s p c +SPC s p c +SPDI s p d i +SPD s p d +Spe s p e +SPE s p e +SPES s p e s +SPFH s p f h +SPFL s p f l +SPF s p f +SPG s p g +SPHL s p h l +SPH s p h +SPINE's s p i n e's +SPIN's s p i n's +SPIR s p i r +SPI s p i +S.P.I.T. s p i t +SPJA s p j a +SPK s p k +SPLA s p l a +SPLC s p l c +SPL s p l +SPME s p m e +SPML s p m l +SPMRL s p m r l +SPM s p m +SPNJ s p n j +SPNM s p n m +SPNN s p n n +SPN s p n +Spoa s p o a +SPOC s p o c +SPOF s p o f +SPO s p o +SPOU s p o u +SpPIn s p p i n +SPP s p p +SPP's s p p's +SPQA s p q a +SPRL s p r l +SPRM s p r m +SPR s p r +SPRU s p r u +S&P s and p +SPSA s p s a +SPSL s p s l +S. P. s p +S.P. s p +SP s p +SP's s p's +SPs s p's +SPS s p s +SPSS s p s s +SPTA s p t a +SPT s p t +SPUC s p u c +SPUP s p u p +SPU s p u +SPUs s p u's +SPV s p v +SQA s q a +SQBB s q b b +SQI s q i +sql s q l +SQL s q l +SQM s q m +sq s q +S. Q. s q +SQ s q +Sra s r a +SRA s r a +SRAs s r a's +Srba s r b a +SRBIJA s r b i j a +Srbi s r b i +SRBOC s r b o c +SRBP s r b p +SRB s r b +SRBs s r b's +SRBY s r b y +SRCC s r c c +SRCL s r c l +SRC s r c +SRC's s r c's +SRCS s r c s +S.R.E. s r e +SRE s r e +SRFC s r f c +S.R.F. s r f +SRF s r f +S.R.G. s r g +SRG s r g +SRGs s r g's +Srhir s r h i r +SRH s r h +S. R. J. s r j +SRK s r k +SRK's s r k's +SRLGs s r l g's +S.R.L. s r l +SRL s r l +SRMC s r m c +S.R.M. s r m +SRM s r m +SRMs s r m's +Srni s r n i +SRN s r n +srp s r p +SRPT s r p t +S. R. R. s r r +SRR s r r +sr s r +S. R. s r +S.R. s r +SR s r +SRS s r s +SRT s r t +SRT's s r t's +Srul s r u l +SRU s r u +SRU's s r u's +SRV s r v +srx s r x +SRY s r y +SSAA s s a a +SSAB s s a b +SSAC s s a c +SSAR s s a r +SSA s s a +SSAs s s a's +SSBSE s s b s e +S.S.B. s s b +SSB s s b +SSCCC s s c c c +S.S.C. s s c +SSC s s c +SSCV s s c v +SSDB s s d b +SSDL s s d l +SSDP s s d p +S.S.D. s s d +SSD s s d +SSDs s s d's +SSE s s e +SSFL s s f l +SSF s s f +SSGRC s s g r c +SSG s s g +SSHSA's s s h s a's +SSH s s h +SSI s s i +SSIS s s i s +SSJA s s j a +SSKI's s s k i's +SSK s s k +SSLAM s s l a m +ssl s s l +SSL s s l +SSLT s s l t +SSME s s m e +SSM s s m +SSN s s n +SSOD s s o d +SSOF s s o f +SSO s s o +SSoSV s s o s v +SSPA s s p a +SSPH s s p h +SSPR s s p r +SSP s s p +SSPX s s p x +SSQ s s q +SSRAA s s r a a +SSRF s s r f +SSRI s s r i +SSRIs s s r i's +SSRN s s r n +SSRP s s r p +SSR s s r +S&S s and s +SSSC s s s c +SSSI s s s i +SSSR s s s r +ss s s +S. s s's +Ss s's +S. S. s s +S.S. s s +SSS s s s +SSTH s s t h +SSTL s s t l +SSTR s s t r +SST s s t +Ssu s s u +SSU s s u +SSVC s s v c +SSV s s v +SSWAHS s s w a h s +SSWC s s w c +ssw s s w +SSW s s w +SSX s s x +Ssy s s y +ST&AJ s t and a j +S.T.A.L.K.E.R. s t a l k e r +S.T.A.T.U.S. s t a t u s +STB s t b +STCC s t c c +S.T.C. s t c +STC s t c +STCW s t c w +STDP s t d p +STDs s t d's +STD s t d +STF s t f +stfv s t f v +STGs s t g's +STG s t g +STIs s t i's +STIS s t i s +STi s t i +STI s t i +STK s t k +stl s t l +S.T.L. s t l +STL s t l +STMB s t m b +STMIK s t m i k +STM's s t m's +STM s t m +STNS s t n s +STN s t n +STPI s t p i +STPNS s t p n s +STPRI s t p r i +STP s t p +S.T.R.I.D.E. s t r i d e +STRV s t r v +Stryj s t r y j +STRZ s t r z +S&T s and t +STScI s t s c i +ST's s t's +STS s t s +S. T. s t +S.T. s t +STT s t t +STVL s t v l +STVS s t v s +STV s t v +STXBP s t x b p +STX s t x +S.U.C. s u c +SUDV s u d v +suo s u o +Suo s u o +S. U. s u +SUSV s u s v +Susz s u s z +SUTs s u t's +SUT s u t +Suu s u u +SUVF s u v f +SUVs s u v's +SUV s u v +SUWN s u w n +SUW s u w +Suy s u y +Svac s v a c +svar s v a r +SVA s v a +SVB s v b +SVC s v c +SVD s v d +sve s v e +Sve s v e +SVGA s v g a +SVG s v g +SVGT s v g t +SVIA s v i a +SVM's s v m's +SVMs s v m's +SVM s v m +svn s v n +svom s v o m +SVOPC s v o p c +SVO s v o +SVP s v p +SVPW s v p w +SVSCEP s v s c e p +SVSC s v s c +SVS s v s +sv s v +S. V. s v +S.V. s v +SV s v +SVTs s v t's +SVT s v t +S.V.U. s v u +SVU s v u +SVV s v v +SVW s v w +SVYASA s v y a s a +SVZ s v z +SWABC s w a b c +SWAC s w a c +S.W.A. s w a +SWC s w c +SWD s w d +S.W.E.A.T. s w e a t +Swe s w e +SWE s w e +SWF s w f +SWG s w g +SWHL s w h l +SWHS s w h s +SWH s w h +SWJN s w j n +S. W. K. s w k +SWMRS s w m r s +SWM s w m +SWNH s w n h +SWOC s w o c +S.W.O.R.D. s w o r d +SWPA s w p a +SWPL s w p l +SWP s w p +SwRI s w r i +SWR s w r +S&W s and w +SWS s w s +sw s w +S. W. s w +S.W. s w +SW s w +SWTPC s w t p c +SWT s w t +SWWTP s w w t p +SXCT s x c t +SXN s x n +SXSW s x s w +sx s x +S.X. s x +SX s x +SXY s x y +SXZ s x z +SysML s y s m l +SysRq s y s r q +Sys s y's +SYS s y s +SysV s y s v +S. Y. s y +S.Y. s y +SyT s y t +syv s y v +Syxx s y x x +SZA s z a +Szasz s z a s z +SZDSZ s z d s z +Szer s z e r +szkic s z k i c +Szklo s z k l o +Szlak s z l a k +SzMME s z m m e +Szpir s z p i r +SZSE s z s e +sz s z +S. Z. s z +SZ s z +Szu s z u +Szyk s z y k +SZZ s z z +taf t a f +Taf t a f +TAF t a f +T.A.P. t a p +T.A.S. t a s +T. A. t a +T.A. t a +T&A t and a +TAZ t a z +TBA t b a +TBCA t b c a +TBCs t b c's +TBCS t b c s +TBD t b d +TBE t b e +TBF t b f +TBHS t b h s +TBI t b i +TBK t b k +TBL t b l +TBMA t b m a +TBMM t b m m +TBMs t b m's +T.B.M. t b m +TBM t b m +TBNJ t b n j +TBN t b n +TBP t b p +TBSC t b s c +TBS t b s +T. B. t b +T.B. t b +TB t b +TBTG t b t g +TBT t b t +TBV t b v +TBWA t b w a +TBX t b x +TCAR t c a r +TCA t c a +TCC t c c +TCDB t c d b +TCDC t c d c +TCDD t c d d +TCDOG t c d o g +TCDSB t c d s b +TCEB t c e b +T.C.E. t c e +TCE t c e +TCFAQ t c f a q +TCF t c f +TCGA t c g a +TCG t c g +TCHC t c h c +TCHRD t c h r d +TCH t c h +TCiAP t c i a p +TCI t c i +TCKs t c k's +TCLP t c l p +TCL t c l +TCM t c m +TCO t c o +TCPL t c p l +TCPMP t c p m p +TCP's t c p's +TCP t c p +TCR t c r +T. C. S. t c s +TCS t c s +tc t c +T. C. t c +T.C. t c +TC t c +TCT t c t +TCU's t c u's +TCUs t c u's +tcu t c u +TCU t c u +TCV t c v +TCWC t c w c +TCWP t c w p +TCW t c w +TDA t d a +tdb t d b +TDCC t d c c +TDCi t d c i +TDCJ t d c j +TDC's t d c's +TDC t d c +TDD t d d +TDE t d e +TDF t d f +TDH t d h +TdIF t d i f +TDI t d i +TDK t d k +TDLAS t d l a s +TDMA t d m a +TDME t d m e +TDM t d m +TDO t d o +TDP t d p +TDRS t d r s +TDR t d r +TDSB's t d s b's +TD's t d's +TDs t d's +T. D. t d +T.D. t d +TDT t d t +Teatr t e a t r +TEBD t e b d +T. E. t e +T.E. t e +TEVT t e v t +TFAP t f a p +TFAS t f a s +TFA t f a +TFC t f c +TFCU t f c u +TFF t f f +TFG t f g +T.F.H. t f h +TFH t f h +TFIH t f i h +TFIID t f i i d +TFK t f k +TFL t f l +TFM t f m +TFN t f n +TFO t f o +TFP t f p +TFR t f r +TFSA t f s a +TFSI t f s i +TFSP t f s p +TFS t f s +T&F t and f +TFTC t f t c +tf t f +T. F. t f +T.F. t f +TF t f +TFTR t f t r +TFT t f t +TFVC t f v c +TFWA t f w a +TFW t f w +TGA t g a +T. G. C. t g c +TGC t g c +tge t g e +T.G.E. t g e +TGE t g e +tgf t g f +TGF t g f +TGG t g g +TGIF t g i f +TGL t g l +TGM's t g m's +TGM t g m +TGP t g p +TGS t g s +tg t g +T. G. t g +T.G. t g +TG t g +TGVs t g v's +tgv t g v +TGV t g v +THB t h b +THCF t h c f +THC t h c +T.H.E.M. t h e m +T.H.F. t h f +THF t h f +THG t h g +THHK t h h k +T.H.I.N.K. B.I.G. t h i n k b i g +THLL t h l l +THL t h l +THMP t h m p +THM t h m +THNN t h n n +Thok t h o k +T.H.P. t h p +THQ's t h q's +THQ t h q +THR's t h r's +THR t h r +ThSe t h s e +THSR t h s r +T. H. S. t h s +T. H. t h +T.H. t h +T.H.U.N.D.E.R. t h u n d e r +THW t h w +THX t h x +TIAA t i a a +T. I. A. t i a +TIFR t i f r +TIF t i f +T.I.'s t i's +T.I. t i +Tiu t i u +tiv t i v +Tiv t i v +TIYM t i y m +Tiy's t i y's +TJFR t j f r +T.J.F. t j f +T. J. J. t j j +TJJ t j j +TJP t j p +TJRC t j r c +T. J. S. t j s +T. J. t j +T.J. t j +TJ t j +t'ju t j u +TJX t j x +tjz t j z +TKAG t k a g +TKA's t k a's +TKA t k a +T. K. B. t k b +TKD t k d +TKE t k e +TKI t k i +tko t k o +Tko t k o +TKO t k o +TKP t k p +TK's t k's +TKS t k s +tk t k +T. K. t k +T.K. t k +TK t k +TKT t k t +Tlas t l a's +TLA t l a +TLC's t l c's +TLC t l c +TlCu t l c u +TLDs t l d's +TLDS t l d s +TLD t l d +TLE t l e +TLF t l f +TLG t l g +TLH t l h +tli t l i +TLI t l i +TLM t l m +TLN t l n +tlp t l p +TLP t l p +TLRs t l r's +TLR t l r +TLs t l's +TLS t l s +TLTB t l t b +tl t l +T. L. t l +T.L. t l +TL t l +Tluk t l u k +TLU's t l u's +Tluszcz t l u s z c z +TLV t l v +TMA t m a +TMBG t m b g +TMB t m b +tmc t m c +TMC t m c +TMDL t m d l +TMD t m d +TMEM t m e m +TMF t m f +TMGs t m g's +TMG t m g +TMI t m i +TMJ t m j +T. M. M. t m m +TMMTX t m m t x +TMNT t m n t +TMOK t m o k +tmos t m o s +TMO's t m o's +TMOS t m o s +TMO t m o +TMPRSS t m p r s s +TMP t m p +tmRNA t m r n a +TMRS t m r s +TMR t m r +TMSI t m s i +TMSs t m s's +T.M.s t m's +TM's t m's +TMS t m s +tm t m +T. M. t m +T.M. t m +TM t m +T.M.T. t m t +TMT t m t +TMU t m u +TMX t m x +TMZ t m z +TNA's t n a's +TNAS t n a s +tna t n a +TNA t n a +tnbc t n b c +TNCA t n c a +TNCC t n c c +TNCDSB t n c d s b +TNC t n c +TNFA t n f a +TNFRSF t n f r s f +TNFSF t n f s f +TNF t n f +TNGHT t n g h t +TNG t n g +TNIP t n i p +TNI t n i +TNL t n l +TNMM t n m m +TNMS t n m s +TNM t n m +TNNC t n n c +TNN t n n +TNO t n o +TNPL t n p l +TNP t n p +TNQ t n q +TNRIS t n r i s +TNRP t n r p +TNR t n r +TNSDL t n s d l +TNSTC t n s t c +TNS t n s +TNTAs t n t a's +tn t n +T. N. t n +T.N. t n +TN t n +TNT's t n t's +TNT t n t +T.O.'s t o's +T. O. t o +T.O. t o +TOTP t o t p +tou t o u +Tou t o u +ToU t o u +TOU t o u +TPAC t p a c +TPAO t p a o +tPA t p a +TPA t p a +TPB t p b +TPC t p c +TPEC t p e c +TPF t p f +TPG t p g +TPH t p h +TPI t p i +TPLF t p l f +TPMS t p m s +TPM t p m +TPO t p o +TPP t p p +tpr t p r +TPR t p r +TPS t p s +tp t p +T. P. t p +T.P. t p +TP t p +TPU t p u +TPVs t p v's +TPWS t p w s +TPW t p w +TQR t q r +TQS t q s +T.Q. t q +TQ t q +tra t r a +Tra t r a +TRA t r a +TRAXX t r a x x +Trbic t r b i c +T. R. B. t r b +TRB t r b +Trcek t r c e k +TRC t r c +TRD t r d +TRFA t r f a +TRF t r f +TRG t r g +TRHS t r h s +TRH t r h +T.R.I.B.E. t r i b e +TRIZ t r i z +TrkA t r k a +TRL t r l +Trmcic t r m c i c +TRMM t r m m +T.R.M.P.A. t r m p a +T. R. M. t r m +tRNA t r n a +TRNC t r n c +TRPC t r p c +TRPM t r p m +TRPP t r p p +TRP's t r p's +TRPs t r p's +TRP t r p +TRPV t r p v +TRPY t r p y +TRSC t r s c +TRSI t r s i +trs t r s +T.R.S. t r s +TRS t r s +TRSV t r s v +tr t r +T. R. t r +T.R. t r +TR t r +TRT t r t +T.R.U. t r u +truTV t r u t v +TruTV t r u t v +Trve t r v e +TRVL t r v l +TRV t r v +TRW t r w +TRX t r x +TRZ t r z +Tsa t s a +TSA t s a +TSB t s b +TSCC t s c c +TSC t s c +TSF t s f +TSG t s g +TSH t s h +TSI t s i +tsit t s i t +Tsiv t s i v +TSJDF t s j d f +TSLA t s l a +TSLC t s l c +TSL t s l +TSN t s n +T.S.O.L. t s o l +tso t s o +Tso t s o +T.S.O. t s o +TSO t s o +TSP t s p +TSRA t s r a +TSRTC t s r t c +tsr t s r +TSR t s r +TSSA t s s a +TSS t s s +TSTA t s t a +TSTC t s t c +Ts t's +T. S. t s +T.S. t s +TS t s +TST t s t +tsus t s u s +Tsvi t s v i +TSV t s v +TSW t s w +TSX t s x +TTAB t t a b +Tta t t a +TTA t t a +TTBB t t b b +TTCP t t c p +TTC's t t c's +TTC t t c +TTDC t t d c +TTD t t d +tteok t t e o k +tte t t e +TTFF t t f f +TTHS t t h s +TTH t t h +TTI t t i +TTKG t t k g +TTKST t t k s t +TTL t t l +T.T.N. t t n +ttp t t p +TTP t t p +TTR t t r +TTS t t s +T&T t and t +T. T. t t +T.T. t t +TT t t +TTU t t u +TTV t t v +TTW t t w +TUAW t u a w +TUBB t u b b +TUDCA t u d c a +TUHUS t u h u s +TUKP's t u k p's +T'uqu t u q u +TUSCC t u s c c +TUSC t u s c +T.U. t u +TU t u +Tuzk t u z k +tvaan t v a a n +Tvam t v a m +TVARK t v a r k +tva t v a +TVA t v a +TVB's t v b's +TVB t v b +TVCM t v c m +TVC t v c +TVD t v d +TVETs t v e t's +TVE t v e +TVF t v f +TVGN t v g n +TVGOS t v g o s +TVii t v i i +TVIn t v i n +TVi t v i +TVI t v i +TVL t v l +TVMK t v m k +TVM t v m +TVN t v n +TVNZ's t v n z's +TVNZ t v n z +tvo t v o +Tvo t v o +TVO t v o +TVP t v p +TVRi t v r i +tvr t v r +TVR t v r +TVSpy t v s p y +tvs t v s +TV's t v's +TVs t v's +TVS t v s +tVTA t v t a +TVT t v t +tv t v +T. V. t v +T.V. t v +TV t v +TVXQ's t v x q's +TVXQ t v x q +TVX t v x +TWAP t w a p +TWA's t w a's +Twa t w a +TWA t w a +T. W. B. t w b +TWCS t w c s +TWC t w c +TWF t w f +Twi t w i +TWI t w i +TWK t w k +T.W.P. t w p +TWP t w p +TWR t w r +TWTs t w t's +TWT t w t +T. W. t w +T.W. t w +TW t w +T.W.U. t w u +TWU t w u +TXC t x c +TxDOT t x d o t +TXII t x i i +TXJS t x j s +TXK t x k +TXMM t x m m +TXNDC t x n d c +TXP t x p +TXTC t x t c +TXT t x t +T.X. t x +TX t x +TXU t x u +tya t y a +TYC t y c +TYIB t y i b +TYIN t y i n +Tyk t y k +Tza'ar t z a a r +Tze t z e +TZL t z l +Tzrif t z r i f +Tzuh t z u h +TZUM t z u m +Tzvi t z v i +UAAP's u a a p's +UAAP u a a p +UAB's u a b's +UAB u a b +UAC u a c +UADY u a d y +UAE's u a e's +U.A.E. u a e +UAE u a e +UAF u a f +UAHC u a h c +UAIC u a i c +UAI u a i +UALR u a l r +UAL u a l +UALVP u a l v p +UAM u a m +UANL u a n l +UAN u a n +UAOC u a o c +UAP u a p +UAR's u a r's +UARS u a r s +UAR u a r +UASLP u a s l p +UASL u a s l +Ua's u a's +UAs u a's +UAS u a s +uat u a t +U.A. u a +UA u a +UAVs u a v's +UAV u a v +U.A.W. u a w +UAW u a w +Uba u b a +UBA u b a +UBBC u b b c +UBB u b b +UbcM u b c m +UBC's u b c's +UBC u b c +UBD u b d +Ube u b e +UBE u b e +ubi u b i +Ubi u b i +U.B.I. u b i +UBI u b i +UBM's u b m's +UBM u b m +UBOS u b o s +UBO u b o +UBPR u b p r +UBP u b p +UBRE u b r e +UBRS u b r s +UB's u b's +UBS u b s +UB u b +UBU u b u +UBV u b v +UBX u b x +UCAC u c a c +Ucar u c a r +UCAR u c a r +Uca u c a +UCA u c a +UCAV u c a v +UCBH u c b h +UCBTLA u c b t l a +UCB u c b +UCCE u c c e +UCCJ u c c j +UCCS u c c s +UCC u c c +UCDA u c d a +UCDP u c d p +UCD u c d +UCF's u c f's +UCF u c f +UCG u c g +UCIEP u c i e p +UCI's u c i's +UCI u c i +UCLA's u c l a's +UCLA u c l a +UCLH u c l h +UCL u c l +Ucmak u c m a k +UCMJ u c m j +UCMMA u c m m a +UCMP u c m p +UCM u c m +Ucn u c n +UCOS u c o s +UCO u c o +UCP u c p +UCREF u c r e f +UCR u c r +UCSB u c s b +UCSC u c s c +UCSD's u c s d's +UCSD u c s d +UCSF u c s f +UCSN u c s n +uCs u c's +UCS u c s +UCTI u c t i +UCT u c t +Uc u c +U.C. u c +UC u c +Ucuncu u c u n c u +UCU u c u +UCVTS u c v t s +UCW u c w +Uczta u c z t a +UDAR u d a r +UDA's u d a's +Uda u d a +UDA u d a +UDC u d c +UDF u d f +UDG u d g +UDHR u d h r +UDICHI u d i c h i +Udit u d i t +UDK u d k +UDN u d n +Udny u d n y +UDP u d p +UDRP u d r p +UDR u d r +UDS u d s +UDTs u d t's +UDT u d t +ud u d +Ud u d +U. D. u d +UD u d +udu u d u +Udu u d u +UDYCO u d y c o +UEA u e a +UEBT u e b t +UEC u e c +Ueda's u e d a's +Uéda u e acute d a +UEFA's u e f a's +UEFA u e f a +UEFI u e f i +UEFS u e f s +UEF u e f +UEGCL u e g c l +UEI u e i +UET u e t +U. E. u e +UE u e +UFABC u f a b c +UFA's u f a's +UFCO u f c o +UFC's u f c's +UFC u f c +UFCW u f c w +UFD u f d +UFE u f e +UFF u f f +UFIA u f i a +UFIP u f i p +UFI u f i +UFJ u f j +UFL's u f l's +UFL u f l +UFM u f m +UFOFU u f o f u +UFORE u f o r e +UFO's u f o's +UFOs u f o's +Ufot u f o t +ufo u f o +Ufo u f o +UFO u f o +UFPE u f p e +UFPLS u f p l s +UFPR u f p r +UFRGS u f r g s +UFRJ u f r j +UFSB u f s b +UFSM u f s m +UF's u f's +UFS u f s +UFTP u f t p +UFT u f t +U. F. u f +UF u f +UFU u f u +UFW u f w +Uga u g a +UGA u g a +UGCCWA u g c c w a +UGC u g c +Uge u g e +UGK u g k +UGME u g m e +Ugni u g n i +UGP u g p +Ugra u g r a +Ugrszke u g r s z k e +UGS u g s +UGT u g t +Ug u g +UG u g +UHD u h d +UHF u h f +Uhha u h h a +UHMW u h m w +uhn u h n +UHOA u h o a +UHPT u h p t +UHP u h p +UHRA u h r a +UHRF u h r f +UHSAA u h s a a +UHTCs u h t c's +UHTI u h t i +Uhud u h u d +U.H. u h +uhur u h u r +UIAA u i a a +Uiam u i a m +UIA u i a +UIAW u i a w +Uibh u i b h +Uible u i b l e +UIC u i c +UID u i d +UIFL u i f l +Uig u i g +UIL u i l +UIMC u i m c +UIM u i m +UIN u i n +UIP u i p +uisae u i s a e +UISD u i s d +UiS u i s +UI's u i's +UIS u i s +UiTM u i t m +uit u i t +Uit u i t +UIT u i t +UI u i +UIV u i v +Uiy u i y +UJA u j a +UJC u j c +Ujed u j e d +UJEP u j e p +Ujsag u j s a g +UJS u j s +uj u j +U.J. u j +UJ u j +Uka u k a +UKA u k a +UKCC u k c c +UKC u k c +Ukhra u k h r a +Ukic u k i c +UKIP's u k i p's +Uki u k i +UKM u k m +UKNC u k n c +Ukoh u k o h +Uko u k o +UKPC u k p c +UKRDA's u k r d a's +UKRDA u k r d a +ukr u k r +Ukr u k r +UKR u k r +UK's u k's +UKTV's u k t v's +UKTV u k t v +Ukui u k u i +u'k u k +uk u k +Uk u k +U.K. u k +UK u k +UKUP u k u p +UKVRN u k v r n +UKW u k w +Ukwu u k w u +ULC u l c +ULDB u l d b +ULEB u l e b +ULEV u l e v +ULFA u l f a +Ulic u l i c +Ull u l l +Ulms u l m's +UL's u l's +ULS u l s +UlSU u l s u +Uluj u l u j +U.L. u l +UL u l +ulus u l u s +Ulus u l u's +ULV u l v +Ulwa u l w a +Ulwe u l w e +UMBC u m b c +Umbr u m b r +UMCC u m c c +UMC u m c +UMD u m d +umelcu u m e l c u +UMe u m e +UMF u m f +UMG u m g +UMHB u m h b +UMH u m h +UMKC's u m k c's +UMKC u m k c +UMK u m k +Umla u m l a +UML u m l +Umme u m m e +UMMSM u m m s m +UMNO's u m n o's +Umno u m n o +UMNO u m n o +UMN u m n +UMO u m o +UMPP u m p p +UMP's u m p's +Umri u m r i +UM's u m's +UMTS u m t s +UMTV u m t v +UMUC u m u c +U. M. u m +U.M. u m +UMWA's u m w a's +UMWA u m w a +UMW's u m w's +UNAB u n a b +UNAFF u n a f f +UNAH u n a h +UNAMIR u n a m i r +UNAPACK's u n a p a c k's +UNB u n b +UNCAC u n c a c +UNCAF u n c a f +UNCG's u n c g's +UNCG u n c g +UNCHE u n c h e +UNCHS u n c h s +UNCMAC u n c m a c +UNCRO u n c r o +UNC's u n c's +UNCTAD u n c t a d +UNC u n c +UNCW u n c w +UNFCCC u n f c c c +UNFICYP u n f i c y p +UNFPA u n f p a +UNFP u n f p +UNF u n f +UNFWP u n f w p +UNGC u n g c +UNHCR u n h c r +UNHRC's u n h r c's +UNH u n h +UNJLC u n j l c +Unli u n l i +UNL u n l +Unlu u n l u +UNLV u n l v +UNMCK u n m c k +UNMC u n m c +UNMEE's u n m e e's +UNMEE u n m e e +UNMIH u n m i h +UNMIK u n m i k +UNMIL u n m i l +UNMOVIC u n m o v i c +unm u n m +UNM u n m +UNNC u n n c +unnd u n n d +UNODC u n o d c +UNOMIG u n o m i g +UNPA u n p a +UNPD u n p d +UNPO u n p o +UNP u n p +UNRA u n r a +UNRSGN u n r s g n +UNRWA u n r w a +UNSCOM u n s c o m +UNSCR u n s c r +UNSC's u n s c's +UNSC u n s c +UNSh u n s h +Unst u n s t +Uns u n's +U.N.'s u n's +UNSW u n s w +UNTSO u n t s o +UNTS u n t s +Unt u n t +UNT u n t +U.N. u n +UNU u n u +UNV u n v +UNWE u n w e +UNWTO u n w t o +Unz u n z +UOCl u o c l +UODA u o d a +UofM u o f m +UOHI u o h i +Uoho u o h o +UOJCA u o j c a +UOL u o l +UOMINI u o m i n i +UoMs u o m's +UOP u o p +uORF u o r f +UOR u o r +UO's u o's +UO u o +UoW u o w +UPABA u p a b a +UPBs u p b's +UPCI u p c i +UPC u p c +UPDRS u p d r s +UPDS u p d s +Upd u p d +UPD u p d +UPEC u p e c +UPFA u p f a +UPF's u p f's +Upf u p f +UPF u p f +UPGMA u p g m a +UPHSD u p h s d +UPIN u p i n +Upir u p i r +UPI's u p i's +UPI u p i +UPLA u p l a +UPLB u p l b +UPL u p l +UPMC u p m c +UPMSS u p m s s +UPND u p n d +UPNE u p n e +UPnP u p n p +UPN u p n +UPOV u p o v +UPPP u p p p +Uppu u p p u +UPRR u p r r +UPR u p r +UPSC u p s c +U.P.S.E.B. u p s e b +UPSIDC u p s i d c +UPSID u p s i d +UPSI u p s i +UPSMF u p s m f +UPTI u p t i +UPTU u p t u +U.P. u p +UPW u p w +UPX u p x +UPyD u p y d +UQAIB u q a i b +UQAM's u q a m's +UQC u q c +U.Q.P. u q p +UQP u q p +uq u q +UQ u q +URAA u r a a +URAC u r a c +URAP u r a p +URBACT u r b a c t +URBED u r b e d +Urbz u r b z +URCL u r c l +URCSA u r c s a +URCs u r c's +URC u r c +Urdd u r d d +Urei u r e i +urf u r f +Urla u r l a +URLhttp u r l h t t p +URLs u r l's +URL u r l +URNU u r n u +UROC u r o c +URRACA u r r a c a +URSB u r s b +URSEC u r s e c +URSS u r s s +URW's u r w's +URW u r w +URZ u r z +USAACE u s a a c e +USAAC u s a a c +U.S.A.A.F. u s a a f +USAAF u s a a f +USAB u s a b +USACE u s a c e +USAC u s a c +USAFE u s a f e +USAF u s a f +USAHA u s a h a +USAID's u s a i d's +USAID u s a i d +Usal u s a l +usan u s a n +Usan u s a n +USAN u s a n +usao u s a o +USAO u s a o +USAPA u s a p a +USARPS u s a r p s +USASA u s a s a +USA's u s a's +usata u s a t a +USATF u s a t f +USAT u s a t +usa u s a +.USA u s a +U.S.A. u s a +U.S.A u s a +USA u s a +USAya u s a y a +USBA u s b a +USBC's u s b c's +USBC u s b c +USBs u s b's +USB u s b +USBWA u s b w a +USCCB u s c c b +USCF u s c f +USCGAUX u s c g a u x +USCGC u s c g c +USCG u s c g +USCHS u s c h s +Uscie u s c i e +USCIRF u s c i r f +USCIS u s c i s +USCITA u s c i t a +USCOB u s c o b +USCRP u s c r p +U.S.C.'s u s c's +USC's u s c's +USCT u s c t +U.S.C. u s c +USC u s c +USDA's u s d a's +U.S.D.A. u s d a +USDA u s d a +USDoE u s d o e +USDOJ u s d o j +USDP u s d p +USDTV u s d t v +usd u s d +USD u s d +USEER u s e e r +USENIX u s e n i x +USFbA u s f b a +USFE u s f e +USFF u s f f +USFLPA u s f l p a +USFL u s f l +USFS u s f s +USF u s f +USF&WS u s f and w s +USFWS u s f w s +USFW u s f w +USGA u s g a +U.S.G.S. u s g s +USGS u s g s +U.S. H.R. u s h r +UShs u s h's +Usia u s i a +USIA u s i a +usih u s i h +USIP's u s i p's +USIP u s i p +USISL u s i s l +USIS u s i s +USIU u s i u +USJA u s j a +USJ u s j +USLES u s l e s +USLHE u s l h e +USLMRA u s l m r a +USLTA u s l t a +USL u s l +Uslu u s l u +Usmar u s m a r +USMA u s m a +USMC M u s m c +USMCR u s m c r +USMC's u s m c's +USMC u s m c +USMLE u s m l e +USML u s m l +USMMA u s m m a +USM u s m +Usna u s n a +USNA u s n a +USNG u s n g +Usnic u s n i c +USNM u s n m +USNO u s n o +USNR u s n r +USNSCS u s n s c s +USNS u s n s +USNTDP u s n t d p +U.S.N. u s n +USN u s n +USOC's u s o c's +USOC u s o c +Usoi u s o i +Usos u s o's +Uso u s o +USO u s o +USPHL u s p h l +USPO u s p o +USPPD u s p p d +U.S.P.Q. u s p q +USPSA u s p s a +USPs u s p's +USPS u s p s +USPTA u s p t a +USPTO u s p t o +U.S.P. u s p +USP u s p +USRA u s r a +USRC u s r c +USSA u s s a +USSBA u s s b a +USSB u s s b +USSD u s s d +USSF's u s s f's +USSF u s s f +USSR's u s s r's +USSR u s s r +U.S.S.R u s s r +U.S.'s u s's +US's u s's +U.S.S. u s s +USS u s s +Usti u s t i +Ustka u s t k a +USTR's u s t r's +USTR u s t r +UST's u s t's +Usui u s u i +usum u s u m +U. S. u s +U.S. u s +Usut u s u t +USVC u s v c +Usvit u s v i t +USVI u s v i +U.S.V. u s v +USWA u s w a +USWNT's u s w n t's +USWNT u s w n t +U.S.W. u s w +USW u s w +Uta's u t a's +uta u t a +Uta u t a +UTA u t a +UTB u t b +Utca u t c a +UTC u t c +Utd's u t d's +Utd u t d +utea u t e a +UTEP u t e p +Utes u t e's +UTET u t e t +UTF u t f +Uth u t h +uti u t i +Uti u t i +UTJ u t j +UTMB u t m b +UTMF u t m f +UTM u t m +Utne u t n e +Utnur u t n u r +Uto u t o +UTO u t o +UTPB u t p b +UTP u t p +utrci u t r c i +UTRGV u t r g v +UTR u t r +utsav u t s a v +Utsav u t s a v +UTSC u t s c +UTSI u t s i +UT's u t's +UTS u t s +Utsu u t s u +UTTR u t t r +U.T. u t +Utu u t u +Utva u t v a +UTVA u t v a +UTV u t v +UUA u u a +UUCP u u c p +Uuh u u h +UUKKY u u k k y +Uul u u l +Uulu u u l u +UUP u u p +Uusi u u s i +UUs u u's +Uuto u u t o +UUT u u t +Uvac u v a c +UVB u v b +UVC u v c +Uvea u v e a +UVF u v f +UVIMB u v i m b +UVI u v i +uvnitr u v n i t r +Uvo u v o +UVT u v t +UVU u v u +U.V. u v +UV u v +UWAP u w a p +Uwasa u w a s a +UWASA u w a s a +U.W.A. u w a +UWA u w a +UWB u w b +UWC u w c +UWFi u w f i +UWF u w f +UWG u w g +UWH u w h +UWI u w i +UWM's u w m's +UWP u w p +UWRF u w r f +UWSP's u w s p's +UWSU u w s u +UW's u w's +UWS u w s +UW u w +UWW u w w +VASP v a s p +VA's v a's +V. A. v a +V.A. v a +VA v a +V&A v and a +Vav v a v +VAV v a v +Vay v a y +VBA v b a +VBBS v b b s +VBE v b e +VBI v b i +VBM v b m +VBR v b r +vb v b +V. B. v b +V.B. v b +VB v b +VCA's v c a's +VCA v c a +VCCS v c c s +VCDs v c d's +VCD v c d +VCE v c e +VCH v c h +VCIT v c i t +VCI v c i +VCJ v c j +V. C. M. v c m +VCO v c o +VCP v c p +VCQ v c q +VCRs v c r's +VCR v c r +VCSELs v c s e l's +VCSEL v c s e l +VCs v c's +VCS v c s +VCTs v c t's +VCT v c t +VCU v c u +vc v c +V. C. v c +V.C. v c +VC v c +VCXIV v c x i v +VCY v c y +VDAC v d a c +vda v d a +Vda v d a +VDCs v d c's +VDC v d c +vdiq v d i q +VDJ v d j +VDL's v d l's +VDL v d l +vdm v d m +VDM v d m +VDP v d p +VDR v d r +VDSL v d s l +VDUP v d u p +VDU v d u +V. D. v d +V.D. v d +VD v d +VDV v d v +V. D. W. v d w +vez v e z +Vez v e z +VEZ v e z +V.F.A. v f a +VFA v f a +VFC v f c +VFDS v f d s +V.F.D. v f d +VFD v f d +VFIL v f i l +VFLI v f l i +VFL's v f l's +VFL v f l +VFMC v f m c +VFM v f m +vfp v f p +vfr v f r +VFR v f r +VF's v f's +VFS v f s +VFTS v f t s +VFTX v f t x +VFU v f u +V. F. v f +V.F. v f +VF v f +VFW v f w +VFX v f x +VGA v g a +V'Ger v g e r +VGIK v g i k +VGKO v g k o +VGMA v g m a +vgmdb v g m d b +VGMDB v g m d b +VGM v g m +VGo v g o +VGP v g p +VGSCs v g s c's +VGSoM v g s o m +VGTU v g t u +VGU v g u +V. G. v g +V.G. v g +VG v g +VGV v g v +VGX v g x +VHB v h b +VHC v h c +VHD v h d +VHF v h f +VHL v h l +VHP v h p +VHR v h r +VHSL v h s l +VHS v h s +V. H. v h +VH v h +V.I.C.'s v i c's +Vict v i c t +VICT v i c t +viita v i i t a +vijf v i j f +vij v i j +Vij v i j +V.I.P.s v i p's +VIPs v i p's +V.I.P. v i p +VIP v i p +V. I. v i +V.I. v i +V. J. J. v j j +VJL v j l +VJs v j's +VJTF v j t f +V. J. v j +V.J. v j +VJ v j +VKG v k g +VKIBC's v k i b c's +V. K. N. v k n +VKOS v k o s +VKS v k s +V. K. v k +V.K. v k +VK v k +Vlah v l a h +VLA v l a +VLBA v l b a +VLBI v l b i +VLB v l b +VLCCs v l c c's +VLCS v l c s +VLC v l c +VLDB v l d b +VLDL v l d l +vlei v l e i +VLE v l e +VLEX v l e x +VLF v l f +Vlijt v l i j t +VLN v l n +VLQ v l q +VLR v l r +VLSI v l s i +VLS v l s +VLT v l t +V. L. v l +V.L. v l +VL v l +VMAs v m a's +VMAT v m a t +VMA v m a +VMCAS v m c a s +VMCM v m c m +VME v m e +VMFM v m f m +VMF v m f +VMG v m g +VMI's v m i's +VMI v m i +VMK v m k +VMM v m m +VMPS v m p s +VMS v m s +VMT v m t +vm v m +V. M. v m +V.M. v m +VM v m +VNAF v n a f +VNAV v n a v +VNCH v n c h +VNC v n c +vner v n e r +V.N.E. v n e +VNI v n i +VNO v n o +VNPT v n p t +VNQDD v n q d d +VNR v n r +VNSA v n s a +VNS v n s +VNTH v n t h +VNTR v n t r +VNU v n u +V. N. v n +V.N. v n +VN v n +V.O. v o +VO v o +Vov v o v +VOX's v o x's +Voz v o z +VPAL v p a l +VPD v p d +VPH v p h +vpis v p i s +V. P. I. v p i +VPI v p i +VPLS v p l s +VPL v p l +VPM v p m +VPNs v p n's +VPN v p n +VPO's v p o's +VPP v p p +VPRO's v p r o's +VPRO v p r o +VPS v p s +vpu v p u +V. P. v p +V.P. v p +VP v p +VQT v q t +vq v q +VQ v q +vrak v r a k +VRA v r a +Vrba v r b a +Vrbuv v r b u v +VRD v r d +Vrej v r e j +vrem v r e m +VRE v r e +VRF v r f +Vrin v r i n +VRI v r i +vrj v r j +VRLA v r l a +vrn v r n +vroee v r o e e +vrou v r o u +vrouw v r o u w +Vrouw v r o u w +VRO v r o +VRR v r r +Vrsac v r s a c +VRSA v r s a +VR's v r's +VRS v r s +Vrtis v r t i's +VRT's v r t's +VRT v r t +V&R v and r +vr v r +V. R. v r +V.R. v r +VR v r +VRV v r v +VSANs v s a n's +VSAN v s a n +VSAP's v s a p's +VSATs v s a t's +VSB's v s b's +VSB v s b +VSCP v s c p +VSC v s c +VSD v s d +Vsekh v s e k h +vse v s e +VSE v s e +VSFV v s f v +VSG v s g +VSI v s i +VSM v s m +VSNL v s n l +vso v s o +VSO v s o +VSPs v s p's +VSP v s p +VSS v s s +VSTM v s t m +VST v s t +VSU v s u +vs. versus +_vs._ versus +VSV v s v +VSW v s w +VSX v s x +vsyo v s y o +VSZ v s z +VTA v t a +VTB v t b +VTCO v t c o +VTD v t d +VTEC v t e c +VTE v t eL +Vtic v t i c +VTi v t i +VTL v t l +VTM v t m +VTR v t r +VTSK v t s k +V&T's v and t's +VTS v t s +VTU v t u +V&T v and t +VTVL v t v l +V.T. v t +VT v t +VTV v t v +Vuur v u u r +VUU v u u +V.V.B. v v b +VVCS v v c s +VVD v v d +VVIPs v v i p's +VVI v v i +VVMC v v m c +VVO v v o +VVS v v s +VVT v v t +V. V. v v +V.V. v v +VV v v +VWM v w m +VWR v w r +VW's v w's +VWs v w's +VWS v w s +VW v w +VXL v x l +VXR v x r +VX v x +Vyg v y g +vyr v y r +vy v y +VY v y +vz v z +V. Z. v z +WAAAAAGH w a a a a a g h +WAAAF w a a a f +WAAC w a a c +WAAF w a a f +WAAI w a a i +WAAV w a a v +Waay w a a y +WABB w a b b +WABC w a b c +WABD w a b d +WABG's w a b g's +WABG w a b g +W. A. C. w a c +W.A.C. w a c +Wa'il w a i l +WAIO w a i o +W.A.J. w a j +Wakf w a k f +W.A.K.O. w a k o +wa'l w a l +WANFL w a n f l +WAOK w a o k +waqf w a q f +waqt w a q t +Waqt w a q t +WAQZ w a q z +WARH w a r h +W.A.R. w a r +WASC w a s c +Wasl w a s l +WASL w a s l +W. A. S. w a s +W.A.S. w a s +Watfa w a t f a +WATL w a t l +WATW w a t w +wau w a u +Wau w a u +WAU w a u +WAVF w a v f +WAVM w a v m +W. A. w a +W.A. w a +WA w a +WAWLI w a w l i +waw w a w +WAWZ w a w z +WAYH w a y h +waza w a z a +Waza w a z a +WBAL's w b a l's +WBAM w b a m +WBA w b a +WBBL w b b l +WBBM w b b m +WBBP w b b p +WBCA w b c a +WBCN w b c n +W.B.C. w b c +WBC w b c +WBCY w b c y +WBEV w b e v +WBEZ w b e z +WBFJ w b f j +WBFO w b f o +WBF w b f +WBG w b g +WBHY w b h y +WBIC w b i c +WBIL w b i l +WBJEE w b j e e +WBKO w b k o +WBK w b k +WBLQ w b l q +WBME w b m e +WBNI w b n i +WBNX w b n x +WBON w b o n +WBO w b o +WBQC w b q c +WBRC w b r c +WBRE w b r e +WBRO w b r o +WBRZ w b r z +WBs w b's +WBS w b s +WBTI w b t i +WBT's w b t's +WBT w b t +WBTW w b t w +WBTZ w b t z +WBUR w b u r +WBVE w b v e +WBV w b v +W. B. w b +W.B. w b +WB w b +WBXH w b x h +WBZB w b z b +WBZ w b z +WCAA w c a a +WCAG w c a g +WCAU w c a u +WCA w c a +WCBA w c b a +WCBN w c b n +W&CBR w and c b r +WCBR w c b r +WCBS w c b s +WCB w c b +WCCES w c c e s +WCCG w c c g +WCCO w c c o +WCC's w c c's +WCC w c c +WCDA w c d a +WCEO w c e o +WCFL w c f l +WCF w c f +WCG w c g +WCHA w c h a +WCHL's w c h l's +WCHL w c h l +WCHS w c h s +WCHV w c h v +WCIU w c i u +WCKD w c k d +WCKY w c k y +WCLN w c l n +WCLU w c l u +WCLV w c l v +WCL w c l +WCMA w c m a +WCMC w c m c +WCMFA w c m f a +WCMH w c m h +WCMR w c m r +WCM w c m +WCNB w c n b +WCOZ w c o z +WCPO w c p o +WCPW w c p w +WCRC w c r c +WCRE w c r e +WCRL w c r l +WCSA w c s a +WCSM w c s m +WCS w c s +WCTD w c t d +WCTG w c t g +W.C.T.U. w c t u +WCTU w c t u +WCTV w c t v +WCT w c t +WCTX w c t x +WCVB's w c v b's +WCVB w c v b +WCVE w c v e +WCWA w c w a +wc w c +W. C. w c +W.C. w c +WC w c +WCWC w c w c +WCW w c w +WCXR w c x r +WCYB w c y b +WCZE w c z e +WDAF w d a f +WDA w d a +WDC w d c +WDDM w d d m +WDFN w d f n +WDF w d f +WDGY w d g y +WDH w d h +WDIA w d i a +WDIF w d i f +WDIG w d i g +WDIS w d i s +WDIV w d i v +WDJT w d j t +WDLA w d l a +WDL w d l +WDM w d m +WDNN w d n n +WDNS w d n s +WDNT w d n t +WDOK w d o k +WDO w d o +WDRE w d r e +WDR w d r +WDSE w d s e +WDSN w d s n +WDSO w d s o +WDSU w d s u +WDS w d s +WDTM w d t m +WDUQ w d u q +WDVE w d v e +WDVR w d v r +W. D. w d +W.D. w d +WDWS w d w s +WDW w d w +WDXZ w d x z +WDYZ w d y z +W. E. B. w e b +W.E.B. w e b +W. E. H. w e h +W.E.H. w e h +WEVD w e v d +WEVV w e v v +W. E. w e +W.E. w e +WEZQ w e z q +WFAA w f a a +WFAL w f a l +WFAN w f a n +WFB w f b +WFCA w f c a +WFC w f c +WFDC w f d c +WFDD w f d d +WFDF w f d f +WFDU w f d u +WFD w f d +WFGF w f g f +WFHE w f h e +W.F.H. w f h +WFH w f h +WFIKKN w f i k k n +WFIL w f i l +WFIRST w f i r s t +WFL's w f l's +WFL w f l +WFLX w f l x +WFMT w f m t +WFMU w f m u +W. F. M. w f m +WFM w f m +WF&NW w f and n w +WFNZ w f n z +WFOY w f o y +WFPC w f p c +WFPF w f p f +WFPMA w f p m a +W.F.P. w f p +WFP w f p +WFSBP w f s b p +WFS w f s +WFTDA w f t d a +WFTM w f t m +WFTV w f t v +WFT w f t +WFVA w f v a +W&F w and f +WFWA w f w a +W. F. w f +W.F. w f +WF w f +WFWM w f w m +WFXR w f x r +wga w g a +WGA w g a +WGBH w g b h +WGBI w g b i +W. G. B. w g b +WGB w g b +WGCB w g c b +W.G.C. w g c +WGC w g c +WGEM w g e m +WGFT w g f t +WGGH w g g h +WGHP w g h p +WGH w g h +WGHW w g h w +WGI w g i +WGN's w g n's +WGNT w g n t +wgn w g n +WGN w g n +WGOK w g o k +WGO w g o +WGP w g p +WGPX w g p x +WGRP w g r p +WGRT w g r t +WGRV w g r v +WGSA w g s a +WGSS w g s s +WGS w g s +WGUN w g u n +wg w g +W. G. w g +W.G. w g +WG w g +WGWW w g w w +WGZR w g z r +W.H.B. w h b +WHCA w h c a +WHCB w h c b +WHCC w h c c +W. H. C. w h c +W.H.C. w h c +WHC w h c +WHDG w h d g +WHDI w h d i +W.H.D. w h d +WHEC w h e c +WHFA w h f a +WHFM w h f m +WHFS w h f s +WHHS w h h s +W.H.H. w h h +WHJA w h j a +W.H.J. w h j +WHJY w h j y +WHKT w h k t +WHL's w h l's +WHL w h l +WHNO w h n o +WHP w h p +WHRC w h r c +WHSN w h s n +WHSS w h s s +W.H.S. w h s +WHS w h s +W. H. T. w h t +WHTZ w h t z +W&H w and h +W. H. w h +W.H. w h +WH w h +Whyld w h y l d +WHYT w h y t +W.I.B.C. w i b c +Wica w i c a +wici w i c i +WIC's w i c's +WICU w i c u +Wif w i f +WIF w i f +WIJD w i j d +Wijk w i j k +WIP w i p +W.I.S.E. w i s e +W.I.T.C.H. w i t c h +Wiwa w i w a +W. I. w i +WIXY's w i x y's +WJAL w j a l +WJAR w j a r +wjaz w j a z +WJBC w j b c +WJBF w j b f +WJBK w j b k +WJBR w j b r +WJCI w j c i +WJC w j c +WJEC w j e c +WJEF w j e f +WJER w j e r +WJET w j e t +W. J. J. O. w j j o +W.J.J.O. w j j o +WJJZ w j j z +WJKA's w j k a's +WJKA w j k a +WJKS w j k s +WJLA w j l a +WJMK w j m k +WJM w j m +WJOI w j o i +WJRD w j r d +WJR w j r +WJSC w j s c +W&J's w and j's +WJTD w j t d +WJUX w j u x +W&J w and j +W. J. w j +W.J. w j +WJ w j +WJXX w j x x +WJYL w j y l +WJYM w j y m +WJZA w j z a +WJZJ w j z j +WJZ w j z +WKAG w k a g +WKAQ w k a q +WKAR w k a r +WKA w k a +WKBD w k b d +WKBF's w k b f's +WKB w k b +WKBW w k b w +W. K. C. w k c +WKDM w k d m +WKDN w k d n +WKDZ w k d z +WKFS w k f s +W.K.H. w k h +WKH w k h +WKIK w k i k +WKIP w k i p +WKKB w k k b +WKKD w k k d +WKKZ w k k z +WKLH w k l h +WKNDS w k n d s +WKN w k n +WKQI w k q i +WKRR w k r r +WKSE w k s e +WKSM w k s m +WKSU w k s u +WKTU's w k t u's +WKTU w k t u +W.K.V. w k v +W. K. w k +W.K. w k +WKXJ w k x j +WKX w k x +WKYS's w k y s's +WKYT w k y t +WKY w k y +W.L.A.K. w l a k +WLB w l b +WLCH w l c h +W&LE w and l e +Wley w l e y +WLGH w l g h +WLH w l h +WLII w l i i +WLIR w l i r +WLJY w l j y +WLKT w l k t +WLKY w l k y +WLLM w l l m +WLNP w l n p +WLNQ w l n q +WLNS w l n s +WLPA w l p a +WLPR w l p r +WLPWR w l p w r +wlrs w l r s +WLSG w l s g +WLS w l s +WLTM w l t m +WLUK's w l u k's +WLUK w l u k +WLWC w l w c +W. L. w l +W.L. w l +WL w l +WLW w l w +WLYH's w l y h's +WLYN w l y n +WLY w l y +WLZK w l z k +WMAC w m a c +WMAG w m a g +WMAP w m a p +WMAQ w m a q +WMATA's w m a t a's +WMATA w m a t a +W.M.A. w m a +WMA w m a +WMAZ w m a z +WMBG w m b g +WMCAT w m c a t +WMCA w m c a +WMDB w m d b +WMDI w m d i +WMD w m d +WMEE w m e e +WMEN w m e n +WMET w m e t +WME w m e +WMEX w m e x +WMFC w m f c +WMFM w m f m +WMFP w m f p +W.M.F. w m f +WMF w m f +WMGF w m g f +WMG w m g +WMGY w m g y +WMHG w m h g +WMHT w m h t +WMIX w m i x +WMJR w m j r +WMJZ w m j z +WMKQ w m k q +WMKW w m k w +wml w m l +WMLW w m l w +WMLY w m l y +WMMS w m m s +W. M. M. w m m +WMNF w m n f +WMN w m n +WMOB w m o b +WMO w m o +WMRA w m r a +WMRO w m r o +WMSG w m s g +W.M.S. w m s +WMS w m s +WMTS w m t s +WMT w m t +WMTW w m t w +WMUB w m u b +WMU w m u +WMVM w m v m +WMV w m v +W&M w and m +W. M. w m +W.M. w m +WM w m +WMWM w m w m +WMXB w m x b +WMX w m x +WMYE w m y e +WMYL w m y l +WNAK w n a k +W.N.B.A. w n b a +WNBA w n b a +WNBC w n b c +WNBL w n b l +WNBR w n b r +WNB w n b +WNCN w n c n +WNC w n c +WNCX w n c x +WND w n d +WNED w n e d +WNEL w n e l +WNEM w n e m +WNEP w n e p +WNET w n e t +WNEW's w n e w's +WNEW w n e w +WNFM w n f m +WNGL w n g l +WNIT w n i t +WNJN w n j n +WNJO w n j o +WNJY w n j y +WNK w n k +WNLO w n l o +WNLU w n l u +WNL w n l +WNMX w n m x +WNO w n o +WNPT w n p t +WNRN w n r n +WNR's w n r's +WNRV w n r v +WNSH w n s h +WNSR w n s r +WNTM w n t m +WNT w n t +WNUA w n u a +WNUF w n u f +WNUSP w n u s p +WNWBL w n w b l +W. N. w n +W.N. w n +WN w n +WNWO w n w o +WNWS w n w s +WNW w n w +WNYA w n y a +WNYC's w n y c's +WNYC w n y c +WNYM w n y m +WNY w n y +WNYZ w n y z +wnzaa w n z a a +WOAA w o a a +WOAK w o a k +WOA w o a +WOC w o c +W&OD w and o d +W.O.G. w o g +WOGX's w o g x's +WOJG w o j g +WOLH w o l h +WOOM w o o m +WOPC w o p c +Worh w o r h +WOSM w o s m +W. O. w o +W.O. w o +WOWOW w o w o w +WOXY w o x y +WOZN w o z n +WPAC w p a c +WPA w p a +WPBC w p b c +WPBSA w p b s a +WPBS w p b s +WPBT w p b t +W. P. C. w p c +WPC w p c +WPDH w p d h +WPD w p d +WPFF w p f f +WPFL w p f l +WPF w p f +WPGC w p g c +WPHL w p h l +WPH w p h +WPIAL w p i a l +WPI w p i +WPIX w p i x +WPLA w p l a +WPLG w p l g +WPLS w p l s +WPMW w p m w +WPO w p o +WPPT w p p t +WPP w p p +WPRI w p r i +WPRO w p r o +WPRP w p r p +WPSC w p s c +WPSL w p s l +WPS w p s +WPTB w p t b +WPTD's w p t d's +wpt w p t +WPT w p t +WPTY w p t y +W. P. U. w p u +wp w p +W. P. w p +W.P. w p +WP w p +WPXN w p x n +WPYR w p y r +WQDE w q d e +WQHT w q h t +WQIV w q i v +WQLR w q l r +WQLZ w q l z +WQMS w q m s +WQOK w q o k +WQSO w q s o +WQSX w q s x +WQ w q +WQXI w q x i +WQXR w q x r +W. R. A. S. w r a s +WRAT w r a t +WRBU w r b u +WRCB w r c b +WRCN w r c n +WRC w r c +WRDL w r d l +Wrec w r e c +WRFD w r f d +WRFK w r f k +WRFM w r f m +WRFX w r f x +WRGO w r g o +WRGP w r g p +W. R. G. w r g +WRHA w r h a +WRHC w r h c +WRHI w r h i +W.R.I. w r i +WRKA w r k a +WRKO w r k o +WRKT w r k t +W.R.K. w r k +WRKY w r k y +WRNS w r n s +WRN w r n +WRNY w r n y +WRNZ w r n z +WROJ w r o j +WROK w r o k +WROO w r o o +WRPT w r p t +WRQQ w r q q +WRTA w r t a +WRTC w r t c +WRUV w r u v +WRU w r u +WRVL w r v l +WRVS w r v s +WRWB w r w b +W. R. w r +W.R. w r +WR w r +W.R.W. w r w +WRXT w r x t +WSAR w s a r +WSAV w s a v +W.S.A. w s a +WSA w s a +WSAZ w s a z +WSBG w s b g +WSBM w s b m +WSBT w s b t +WSB w s b +WSCA's w s c a's +WSCR w s c r +W. S. C. w s c +WSC w s c +WSDD w s d d +WSDG w s d g +WSDOT w s d o t +WSDP w s d p +WSDR w s d r +WSEG w s e g +WSEK w s e k +WSE w s e +WSFA w s f a +WSFL w s f l +WSFM w s f m +WSFS w s f s +WSFX w s f x +WSGE w s g e +WSGW w s g w +WSHL w s h l +WSHU w s h u +WSH w s h +WSIPC w s i p c +WSIS w s i s +WSJM w s j m +WSJO w s j o +WSJ w s j +WSLU w s l u +WSL w s l +WSMK w s m k +W.S.M. w s m +WSM w s m +WSNJ w s n j +WSNS w s n s +WSNT w s n t +WSN w s n +WSOF w s o f +WSOPE w s o p e +WSOP's w s o p's +WSOP w s o p +WSORR w s o r r +WSO w s o +WSOY w s o y +WSPA w s p a +WSPC w s p c +WSPD w s p d +WSPN w s p n +WSPS w s p s +WSPU w s p u +WSP w s p +WSRA w s r a +WSRE's w s r e's +WSRF w s r f +WSSA w s s a +WSSCC w s s c c +WSSSA w s s s a +WSS w s s +WSTE w s t e +WSTR w s t r +WSUA w s u a +WSUD w s u d +WSUE w s u e +WSUS w s u s +WSU w s u +WSV w s v +WSVZ w s v z +WSWI w s w i +ws w s +W. S. w s +W.S. w s +WS w s +WSW w s w +WSYN w s y n +WSYX w s y x +WTAA w t a a +WTAE w t a e +WTAF w t a f +WTAG w t a g +WTAM's w t a m's +W. T. A. w t a +WTA w t a +WTAW w t a w +WTCC w t c c +W. T. C. w t c +W.T.C. w t c +WTC w t c +WTDY w t d y +WTEL w t e l +WTEV's w t e v's +WTEV w t e v +WTF w t f +WTGB w t g b +WTHR's w t h r's +WTHS w t h s +WTIU w t i u +WTI w t i +WTIX w t i x +WTKG w t k g +WTKO w t k o +WTKR w t k r +WTKS w t k s +WTLS w t l s +WTMA w t m a +WTNH w t n h +WTN w t n +WTOP w t o p +WTO's w t o's +WTOS w t o s +WTO w t o +WTPA w t p a +WTPQ w t p q +WTR w t r +WTs w t's +WTS w t s +WTTF w t t f +WTTM w t t m +WTTs w t t's +WTT w t t +WTTW w t t w +WTTZ w t t z +WTVA w t v a +WTVC w t v c +WTVD w t v d +WTVI w t v i +WTVM w t v m +WTVU w t v u +WTVW w t v w +WTVX w t v x +WTWF w t w f +W. T. w t +W.T. w t +WT w t +WTX w t x +WUAB w u a b +WUAP w u a p +WUAs w u a's +WUC w u c +Wudl w u d l +Wuhr w u h r +Wuhu w u h u +WUKB w u k b +WUPG w u p g +WUPN w u p n +WUPZ w u p z +Wu's w u's +WUSW w u s w +WUTK w u t k +WUVC w u v c +wuv w u v +W. U. w u +Wuz w u z +WVa w v a +WVBX w v b x +WVCA w v c a +WVIT w v i t +WVJC w v j c +WVJP w v j p +WVLZ w v l z +WVNI w v n i +WVNY w v n y +W. V. O. w v o +WVO w v o +WVPA w v p a +WVPO w v p o +WVSSAC w v s s a c +WVSU w v s u +WVTU's w v t u's +WVTU w v t u +WVUE w v u e +WVU w v u +WVUW w v u w +W. V. w v +W.V. w v +WV w v +WWAA w w a a +WWAMI w w a m i +WWASP w w a s p +WWA w w a +WWAX w w a x +WWBZ w w b z +WWCD w w c d +WWC w w c +WWDB's w w d b's +WWDC w w d c +WWDR w w d r +WWD w w d +WWE's w w e's +Wwe w w e +WWE w w e +WWF's w w f's +WWF w w f +WWGC w w g c +WWHT w w h t +WWHW w w h w +WWIS w w i s +WWJP w w j p +WWKB w w k b +WWKL w w k l +WWML w w m l +WWMM w w m m +WWMX w w m x +WWMY w w m y +WWN w w n +WWNW w w n w +WWNY w w n y +WWOX w w o x +WWPG w w p g +WWP w w p +WWPW w w p w +WWRFC w w r f c +WWRV w w r v +WWSS w w s s +WWS w w s +WWTI's w w t i's +WWTI w w t i +WWTN w w t n +WWU w w u +WWVA w w v a +WWVR w w v r +WWV w w v +WWWF w w w f +WWWQ's w w w q's +W. W. w w +W.W. w w +WW w w +WWW w w w +WWWW w w w w +WWYD w w y d +WXB w x b +WXCN w x c n +WXDU w x d u +WXEL w x e l +WXIL w x i l +WXIN's w x i n's +WXIN w x i n +WXJM's w x j m's +WXJ w x j +WXN w x n +WXQW w x q w +WXTG w x t g +WXW w x w +wx w x +WX w x +W.Y. w y +WY w y +wyzc w y z c +WZBC w z b c +WZFG w z f g +WZFT w z f t +WZGC w z g c +WZJQ w z j q +WZKC w z k c +WZLR w z l r +WZLX w z l x +WZRB w z r b +WZRD w z r d +WZST w z s t +W. Z. w z +WZ w z +WZX w z x +WZZM w z z m +WZZX w z z x +xbg x b g +XBMC x b m c +XBM x b m +Xbra x b r a +XBRL x b r l +XBV x b v +XCB x c b +XCE x c e +XCMS x c m s +XCOM x c o m +XCOR x c o r +xCo x c o +XCR x c r +XCT x c t +XCVI x c v i +XCV x c v +X. C. x c +XC x c +XCX x c x +xda x d a +XDDM x d d m +XDH x d h +XDK x d k +XDRs x d r's +XDR x d r +XD's x d's +XDS x d s +X. D. x d +XD x d +Xfce x f c e +XFC x f c +XFDL x f d l +XFD x f d +XFL x f l +XFM x f m +XFS x f s +XFU x f u +xf x f +X.F. x f +XF x f +XHVFC x h v f c +xh x h +X. H. x h +XH x h +XJD x j d +XJ x j +XKE x k e +XKL x k l +xk x k +XK x k +XL x l +XMB x m b +xmc x m c +xml x m l +XML x m l +XMMS x m m s +XMPP x m p p +XMP x m p +XMRV x m r v +XMSN x m s n +XM's x m's +XMU x m u +X.M. x m +XM x m +XN x n +xO x o +X.O. x o +XO x o +XPA x p a +XPD x p d +XPe x p e +XPL x p l +XPN x p n +XP's x p's +XPS x p s +XPT x p t +XPW x p w +XP x p +X.Q. x q +XQ x q +XRCC x r c c +XRCO x r c o +XRDS x r d s +XRD x r d +XRE x r e +XR x r +XSD x s d +XSi x s i +XSI x s i +XSLT x s l t +xsr x s r +XS x s +XTB x t b +XTC x t c +XTG x t g +XTwas x t w a's +xt x t +XT x t +XVAS x v a +XV x v +XWA x w a +XWB x w b +XWF x w f +XWIS x w i s +X. W. x w +XYNU x y n u +XYP x y p +xy x y +XY x y +xyz x y z +xyZ x y z +XYZ x y z +XZ x z +Y. A. y a +Y.A. y a +YBA y b a +YBL y b l +YBNL y b n l +YBN y b n +YBR y b r +YBX y b x +Y. B. y b +Y.B. y b +YB y b +YBYS y b y s +YCC y c c +YCD y c d +ycia y c i a +ycie y c i e +YCL y c l +YCO y c o +YCU y c u +YCV y c v +yc y c +Y. C. y c +Y.C. y c +YC y c +YCYW y c y w +YDA y d a +Ydby y d b y +Yde y d e +YDG y d g +YdiB y d i b +YDK y d k +YDNC y d n c +yd y d +Y. D. y d +Y.D. y d +YD y d +Y.E. y e +YFCMD y f c m d +YFCs y f c's +YFCU y f c u +YFC y f c +yfle y f l e +YF&R y f and r +YF y f +YGB y g b +YGEX y g e x +YGLA y g l a +YGL y g l +YG's y g's +yg y g +Y. G. y g +Y.G. y g +YG y g +YHA y h a +YHWH y h w h +Y. H. y h +YH y h +YIF y i f +YIG y i g +YITP y i t p +Y. I. y i +Y.I. y i +YJO y j o +yj y j +Y. J. y j +YJ y j +Ykt y k t +Y. K. y k +Y.K. y k +YK y k +YKY y k y +Yle y l e +YLE y l e +YLF y l f +yl y l +Y. L. y l +YL y l +YMCA's y m c a's +Y.M.C.A. y m c a +YMCA y m c a +YMF y m f +Ymke y m k e +Y.M.M. y m m +YMM y m m +YMO y m o +ym y m +Y. M. y m +YM y m +yndi y n d i +Yndi y n d i +yne y n e +Yngve y n g v e +Ynis y n i's +YNK y n k +YNU y n u +yn y n +Yn y n +Y. N. y n +Y.N. y n +YN y n +Y.O. y o +YO y o +ypa y p a +YPC y p c +YPF y p f +YPG y p g +YPM y p m +YPO y p o +Y.P.P. y p p +YPP y p p +Y.P.S. y p s +YPT y p t +YPU y p u +Y.P. y p +YP y p +Y. Q. y q +YQ y q +yra y r a +Yra y r a +YRC y r c +YRF y r f +YRK y r k +YRM y r m +YRT y r t +Y&R y and r +YSK'da y s k d a +YSK'ya y s k y a +YSK y s k +YSL y s l +YSRCP y s r c p +YSR y s r +YSU's y s u's +YSU y s u +Ys y's +Y.S. y s +YS y s +YSY y s y +yta y t a +YTB y t b +Ytre y t r e +YTS y t s +YTV's y t v's +YTV y t v +Y&T y and t +Y. T. y t +Y.T. y t +YT y t +Y. V. y v +YWCA y w c a +YWC y w c +Y. W. y w +Y.Y. y y +Z. A. B. z a b +Z. A. z a +Z.A. z a +ZBC z b c +ZBS z b s +ZB z b +ZCE z c e +ZCGWM z c g w m +ZCMI z c m i +ZCTA z c t a +ZCY z c y +ZC z c +Zdar z d a r +zda z d a +ZDF z d f +ZDR z d r +Z.E.R.O. z e r o +ZFC z f c +ZFK z f k +ZFM z f m +ZFP z f p +ZFS z f s +ZFX z f x +ZF z f +ZGE z g e +ZGI z g i +zg z g +Z.G. z g +ZG z g +zh z h +Z. H. z h +Z.H. z h +ZH z h +zijn z i j n +zij z i j +Zij z i j +Z. I. z i +Z. J. z j +ZKK z k k +ZKM z k m +Z.K. z k +Z.L. z l +Z.M. z m +ZNA z n a +ZNF z n f +ZNK z n k +ZnO z n o +ZNW z n w +ZPAP z p a p +Zpav z p a v +ZPAV z p a v +ZPA z p a +ZPK z p k +Z.P. z p +ZP z p +ZQ z q +ZRC z r c +ZrI z r i +ZRK z r k +ZSC z s c +ZSE z s e +ZSF z s f +ZSG's z s g's +ZSIS z s i s +ZSL z s l +ZSO z s o +ZSSS z s s s +Zsuzsa z s u z s a +ZTE z t e +ZWYCI z w y c i +Z.W. z w +Z.X.V. z x v +Z.X. z x +ZYF z y f +Z. Y. z y +Z.Y. z y +Z. Z. z z +Z.Z. z z diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/data/whitelist/asr_with_pc.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/whitelist/asr_with_pc.tsv new file mode 100644 index 0000000000000000000000000000000000000000..44e44242fe4cf042d5683af530cc7ced6fc52c4f --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/whitelist/asr_with_pc.tsv @@ -0,0 +1,71 @@ +Hon. honorable +Mt. Mount +Maj. Major +Rev. Reverend +# hash +Gov. governor +vs. versus +vs versus +dept. department +vol volume +vol. volume +bldg. building +Bldg. Building +apt. apartment +Apt. Apartment +Σ sigma +η eta +κ kappa +ω omega +σ sigma +α alpha +ν nu +δ delta +ι iota +_ underscore +% percent +& ampersand +* asterisk ++ plus +/ slash += equal sign +^ circumflex +{ left brace +| vertical bar +} right brace +~ tilde +ltd limited +int'l international +$ dollar +BMW M b m w +Capt. captain +Co. company +Col. colonel +Dr. doctor +Drs. doctors +e.g. for example +e. g. for example +ES3 e s three +Esq. esquire +F.I f +FNU f n u d s a +Ft. Fort +Gen. general +i.e. that is +Jr. junior +jr. junior +Jr junior +jr junior +Ltd. limited +Lt. lieutenant +Mr. mister +Mrs. misses +Ms. miss +Sgt. sergeant +S&P 500 s and p five hundred +Uéda u e acute d a +USMC M u s m c +vs. versus +_vs._ versus +VTE v t eL +XVAS x v a diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/data/whitelist/ipa_symbols.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/whitelist/ipa_symbols.tsv new file mode 100644 index 0000000000000000000000000000000000000000..f5559c7116309e621659b6b4b1db91d91836abcf --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/whitelist/ipa_symbols.tsv @@ -0,0 +1,521 @@ +a +aoj +aəj +aː +aːʲ +aː͡j +aː͡ɨ̯ +aˤ +aˤː +a̠ +a̠ː +a̰ +a͡e +a͡i +a͡iː +a͡i̯ +a͡j +a͡o +a͡u +a͡uː +a͡u̯ +a͡w +a͡ə +a͡ɨ̯ +a͡ɪ +a͡ʊ +b +bʱ +bʲ +bː +b̥ +c +cʰ +cː +ç +d +dʲ +dː +d̥ +d̪ +d̪ʱ +d͡z +d͡zʷ +d͡zː +d͡ʑ +d͡ʒ +d͡ʒʱ +d͡ʒʲ +d͡ʒː +e +eː +eːʲ +eː͡j +ẽː +ẽ͡j̃ +e̞ +e̞ː +e̯ +e͡i +e͡iː +e͡ɨ̯ +f +fʲ +fː +h +hː +i +iəj +iəw +iʲ +iː +iːʲ +ĩː +i̥ +i̯ +i͡u +i͡ə +i͡ɛ +j +jː +j̃ +k +kʰ +kʰː +kʲ +kʲʼ +kʷ +kʷʼ +kʼ +kː +k̚ +k̚ʲ +k̟̚ +k͈ +k͡p̚ +l +lʲ +lː +l̥ +l̩ +m +mʲ +mʲː +mː +m̥ +m̩ +n +nʲ +nː +n̥ +n̩ +o +oʲ +oː +oːʲ +ò +õ͡j̃ +õ͡w̃ +o̝ +o̞ +o̞ː +o̯ +o̰ +o͡u +o͡uː +p +pʰ +pʰː +pʲ +pʷʼ +pʼ +pː +p̚ +p̚ʲ +p͈ +p͜f +p͡f +q +qʷ +qʼ +r +rʲ +rː +r̂ +r̂ː +r̥ +r̩ +s +sʰ +sʲ +sʼ +sː +s͈ +t +tʰ +tʰː +tʲ +tʷʼ +tʼ +tː +t̚ +t̪ +t̪ʰ +t͈ +t͜s +t͡s +t͡sʰ +t͡sʰː +t͡sʲ +t͡sʷ +t͡sʼ +t͡sː +t͡ɕ +t͡ɕʰ +t͡ɕ͈ +t͡ʂ +t͡ʂʼ +t͡ʃ +t͡ʃʰ +t͡ʃʰː +t͡ʃʲ +t͡ʃʷ +t͡ʃʼ +t͡ʃː +u +uəj +uʲ +uː +uːʲ +ũː +ũ͡j̃ +u̯ +u͡e +u͡i +u͡j +u͡ɔ +u͡ə +v +vʲ +vː +w +w̃ +x +xʷ +xː +y +yː +yːʲ +y̯ +z +zʲ +zː +z̥ +à +àː +á +áː +â +âː +ã +ã̠ +æ +æː +æ̀ +æ̀ː +æ̂ +æ̂ː +æ͡ɪ +æ͡ʉ +ç +è +èː +é +éː +ê +êː +ì +ìː +í +íː +î +îː +ï +ð +ò +òː +ó +óː +ô +ôː +õ +õː +õ̞ +ø +øː +øːʲ +ø̯ +ù +ùː +ú +úː +û +ûː +ā +āː +ē +ēː +ĕ +ĕ͡ə +ě +ěː +ħ +ĩ +ĩː +ī +īː +ŋ +ŋʲ +ŋ̊ +ŋ̍ +ŋ̟ +ŋ̩ +ŋ͡m +ō +ŏ +ŏ͡ə +œ +œː +œ̃ +œ͡i +œ͡iː +œ͡ʏ +ř +řː +ũ +ũː +ū +ūː +ŭ +ŭ͡ə +ǎ +ǎː +ǐ +ǐː +ǒ +ǒː +ǔ +ǔː +ǣ +ǣː +ɐ +ɐː +ɐ̃ +ɐ̃͡j̃ +ɐ̃͡w̃ +ɐ̯ +ɐ̯̯ +ɑ +ɑː +ɑ̃ +ɑ̃ː +ɒ +ɒʲ +ɒː +ɓ +ɔ +ɔː +ɔˤː +ɔ̀ +ɔ̀ː +ɔ́ +ɔ́ː +ɔ̃ +ɔ̃ː +ɔ̰ +ɔ͡i̯ +ɔ͡ə +ɔ͡ɨ̯ +ɔ͡ɪ +ɔ͡ʊ +ɕ +ɕʰ +ɕː +ɕ͈ +ɖ +ɖʱ +ɗ +ɘ +ɘː +ə +əː +əˤ +ə̀ +ə́ +ə̃ +ə̯ +ə͡u̯ +ə͡w +ə͡ɨ +ə͡ɨ̯ +ɚ +ɛ +ɛʲ +ɛː +ɛˤː +ɛ̀ +ɛ̀ː +ɛ́ +ɛ́ː +ɛ̂ +ɛ̂ː +ɛ̃ +ɛ̃ː +ɛ̄ +ɛ̄ː +ɛ̰ +ɛ͡i +ɛ͡i̯ +ɛ͡u +ɛ͡u̯ +ɛ͡ɪ +ɛ͡ʊ +ɜ +ɜː +ɝ +ɝː +ɟ +ɟː +ɟ͡ʝ +ɡ +ɡʱ +ɡʲ +ɡʷ +ɡː +ɡ̊ +ɣ +ɤ +ɥ +ɦ +ɨ +ɨəj +ɨː +ɨ̃ᵝ +ɨ̞ +ɨ̥ᵝ +ɨ̯ +ɨ͡u̯ +ɨ͡w +ɨ͡ə +ɨᵝ +ɨᵝː +ɪ +ɪː +ɪ̀ +ɪ́ +ɪ̃ +ɪ̯ +ɪ̰ +ɪ͡u̯ +ɪ͡ʊ +ɫ +ɫː +ɬ +ɬʼ +ɭ +ɮ +ɯ +ɯː +ɯ̟̃ᵝ +ɯ̟̊ᵝ +ɯ̟ᵝ +ɯ̟ᵝː +ɰ +ɰ̃ +ɰᵝ +ɱ +ɱ̩ +ɲ +ɲː +ɲ̊ +ɲ̟ +ɳ +ɴ +ɸ +ɸʷ +ɹ +ɻ +ɽ +ɽʱ +ɾ +ɾʲ +ɾː +ɾ̝̊ +ʀ +ʁ +ʁʷ +ʁː +ʂ +ʂʷ +ʃ +ʃʰ +ʃʲ +ʃʷ +ʃʷʼ +ʃʼ +ʃː +ʈ +ʈʰ +ʉ +ʉː +ʊ +ʊ̀ +ʊ́ +ʊ̃ +ʊ̯ +ʊ̯͡i +ʊ̯͡ɨ +ʊ̰ +ʋ +ʌ +ʌ̹ +ʍ +ʎ +ʏ +ʏː +ʏ̯ +ʐ +ʐʷ +ʑ +ʒ +ʒʲ +ʒʷ +ʒː +ʔ +ʔʲ +ʔʷ +ʝ +˦ˀ˥ +˦˥ +˦˧˥ +˦˩ +˧ˀ˨ +˧˦ +˧˧ +˧˨ +˧˩ +˨˩ +˨˩˦ +˨˩˨ +β +θ +χ +χʷ +χː +ḛ +ḭ +ṵ +ẽ +ẽː +ẽ̞ +‿ \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/data/whitelist/lj_speech.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/whitelist/lj_speech.tsv new file mode 100644 index 0000000000000000000000000000000000000000..a55a04b9ab680ab621153af96c1144854a3c046c --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/whitelist/lj_speech.tsv @@ -0,0 +1,21 @@ +Mr. mister +Mrs. misses +Dr. doctor +Drs. doctors +Co. company +Lt. lieutenant +Sgt. sergeant +St. saint +Jr. junior +Maj. major +Hon. honorable +Gov. governor +Capt. captain +Esq. esquire +Gen. general +Ltd. limited +Rev. reverend +Col. colonel +Mt. mount +Ft. fort +etc. et cetera diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/data/whitelist/symbol.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/whitelist/symbol.tsv new file mode 100644 index 0000000000000000000000000000000000000000..bd698fad850b19e938dc65ca7c96de930bccc522 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/whitelist/symbol.tsv @@ -0,0 +1,23 @@ +& and +# hash +@ at +§ section +™ trademark +® registered trademark +© copyright +_ underscore +% percent +* asterisk ++ plus +/ slash += equal sign +^ circumflex +| vertical bar +~ tilde +$ dollar +£ pound +€ euro +₩ won +¥ yen +° degree +º degree diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/data/whitelist/tts.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/whitelist/tts.tsv new file mode 100644 index 0000000000000000000000000000000000000000..758691676048f0894e2648c9732fdec92da735d9 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/data/whitelist/tts.tsv @@ -0,0 +1,3890 @@ +Ph.D. PHD +Hon. honorable +Mt. Mount +Maj. Major +Rev. Reverend +w/o without +a/c number account number +c/o care of +Gov. governor +vs. versus +vs versus +dept. department +prof. professor +est. estimated +vol volume +vol. volume +bldg. building +Bldg. Building +apt. apartment +Apt. Apartment +World War I World War one +World War II World War two +etc. etcetera. +SnO2 tin four oxide +dept department +HVAC H-vac +SPDR spider +ZIP zip +~ approximately +κ kappa +ω omega +α alpha +ν nu +δ delta +Δ delta +Α alpha +β beta +Β beta +χ chi +Χ chi +ε epsilon +Ε epsilon +φ phi +Φ phi +γ gamma +Γ gamma +η eta +Η eta +ι iota +Ι iota +κ kappa +Κ kappa +λ lambda +Λ lambda +μ mu +Μ mu +ν nu +Ν nu +ο omicron +Ο omicron +π pi +Π pi +θ theta +Θ theta +ρ rho +Ρ rho +σ sigma +Σ sigma +τ tau +Τ tau +υ upsilon +Υ upsilon +ω omega +Ω omega +ξ xi +Ξ xi +ψ psi +Ψ psi +ζ zeta +Ζ zeta +ltd limited +int'l international +A. D AD +A.D AD +a. d AD +a.d AD +a. d. AD +a.d. AD +B. C BC +B.C BC +b. c BC +b.c BC +A. D. AD +A.D. AD +B. C. BC +B.C. BC +b. c. BC +b.c. BC +A. A. a a +A.A. AA +A&A AANDA +A100 AONEHUNDRED +AAAs AAA's +AaB AAB +Aabo AABO +aac AAC +AACNo AACNO +AADTs AADT's +Aadu AADU +AAFld AAFLD +Aap AAP +A. B. AB +A.B. AB +Abhi ABHI +abl ABL +Abl ABL +Abp ABP +Abr ABR +abv ABV +Abz ABZ +A&C AANDC +A. C. AC +A.C. AC +A/C AC +acac ACAC +Acad ACAD +ACC&S ACC and S +Achs ACH's +Acis ACI's +acls ACLS +ACMs ACM's +AcpA ACPA +AcpB ACPB +acq ACQ +A&CR AANDCR +AcSOC ACSOC +acu ACU +AC&W AC and W +Acy ACY +A&D AANDD +Adab ADAB +A. D. AD +A.D. AD +A.D.A.M. adam +AdaSL ADASL +AdC ADC +ADCs ADC's +AD&D AD and D +AdK ADK +Adl ADL +ADLs ADL's +adm ADM +Adm ADM +admn ADMN +ADNs ADN's +AdP ADP +ADRs ADR's +ADSRs ADSR's +ADSs ADS's +Adwa ADWA +A&E AANDE +A. E. AE +A.E. AE +Aed AED +aegte AEGTE +Aeka AEKA +ael AEL +Aema AEMA +aen AEN +aere AERE +AEre AERE +AErn AERN +Aert AERT +Aes AE's +aet AET +Afa AFA +af AF +Af AF +A. F. AF +A.F. AF +Afaf AFAF +afc AFC +AFCSThe AFCSTHE +Afd AFD +AfD AFD +AfDB AFDB +Afe AFE +Aff AFF +Afi AFI +Afiq AFIQ +AFMs AFM's +AfNS AFNS +Afo AFO +Afr AFR +A. G. AG +A.G. AG +Agco AGCO +Agda AGDA +AG&G AG and G +agg AGG +Agi AGI +Agis AGI's +agli AGLI +Agn AGN +AgN AGN +AGNs AGN's +AGRs AGR's +Agsu AGSU +agt AGT +Agte AGTE +Agu AGU +A. H. AH +A.H. AH +Ahdhra AHDHRA +ahe AHE +Ahe AHE +Ahirs AHIR's +Ahk AHK +Ahsa'i AHSAI +Ahta AHTA +aht AHT +Ahu AHU +Ahva AHVA +A&I AANDI +A. I. AI +A.I. AI +Aias AIA's +aici AICI +Aicme AICME +AICs AIC's +Aiel AIEL +Aife AIFE +AiG AIG +Aigis AIGI's +Aija AIJA +Aik AIK +AIs AI's +Aist AIST +Aitu AITU +Aiud AIUD +aius AIUS +A. J. AJ +A.J. AJ +Ajba AJBA +Ajmi AJMI +Ajok AJOK +Ajsa AJSA +Aju AJU +Akaa AKAA +a.k.a. AKA +aka. AKA +aka AKA +Aka. AKA +Aka AKA +A&K AANDK +A. K. AK +A.K. AK +AKAPs AKAP's +akas AKA's +AKAs AKA's +akh AKH +Akpa AKPA +Aku AKU +A&L AANDL +A. L. AL +A.L. AL +Alh ALH +ALUs ALU's +A'ma AMA +A&M AANDM +a.m. AM +a.m AM +A. M. AM +A.M. AM +AMAs AMA's +amb AMB +Amb AMB +AmBX AMBX +AMCs AMC's +Amda AMDA +Amd AMD +AM&FM AM and FM +Amha AMHA +aml AML +Amli AMLI +Amlwch AMLWCH +Amm AMM +AM&O AM and O +Ampt AMPT +amr AMR +A&M's AANDM's +Ams' AM's +amsl AMSL +Amta AMTA +amt AMT +Amt AMT +Amts AMT's +Amu AMU +A. N. AN +A.N. AN +andFHL ANDFHL +andPPP ANDPPP +Anej ANEJ +Angti ANGTI +Angu ANGU +Anhe ANHE +Anr ANR +Anrep ANREP +A&O AANDO +A. O. AO +A.O. AO +AOCCs AOCC's +Aodh AODH +Aodla AODLA +Aogo AOGO +Aoke AOKE +Aoko AOKO +Aola AOLA +Aol AOL +Aone AONE +Aoni AONI +Aoos AOO's +aor AOR +AORs AOR's +aos AOS +AoS AOS +Aotus AOTU's +aov AOV +aovf AOVF +A&P AANDP +A. P. AP +A.P. AP +Apc APC +APCh APCH +APCs APC's +apg APG +Aph APH +Apiao APIAO +Api API +APi API +Apic APIC +APICv APICV +Apl APL +Aplu APLU +Apphttp APPHTTP +Appl APPL +appr APPR +Appts APPT's +appu APPU +Appu APPU +A&P's AANDP's +Aps AP's +APs AP's +AP&T AP and T +Aqa AQA +Aql AQL +Aqr AQR +A&R AANDR +A. R. AR +A.R. AR +ArgR ARGR +ARGs ARG's +ArH ARH +ARMv ARMV +Arnd ARND +arv ARV +Arv ARV +Arwi ARWI +As'ad ASAD +Asai ASAI +Asao ASAO +A.s A's +A. S. AS +A.S. AS +Asasp ASASP +asbl ASBL +asci ASCI +Asci ASCI +Asdis ASDI's +Asfi ASFI +Asn ASN +Aso ASO +Aspe ASPE +Asr ASR +Assn ASSN +assoc ASSOC +Assoc ASSOC +ASSPs ASSP's +Asst ASST +Aste ASTE +Astt ASTT +Aswa ASWA +A&T AANDT +atac ATAC +Atac ATAC +Atad ATAD +Ata's ATA's +Atas ATA's +A. T. AT +A.T. AT +ATBs ATB's +atc ATC +atcc ATCC +Atg ATG +ath ATH +Ath ATH +Atia's ATIA's +Ati ATI +ATi ATI +Atid ATID +Atiiq ATIIQ +Atil ATIL +Atiq ATIQ +Ativ ATIV +Atka ATKA +Atl ATL +Atli ATLI +atm ATM +Atm ATM +ATMs ATM's +Atos ATO's +ATOs ATO's +atpB ATPB +atri ATRI +Atri ATRI +A&T's AANDT's +A.T.s AT's +AT&SF AT and SF +AT&T ATANDT +attd ATTD +AT&T's ATANDTS +atv ATV +ATVs ATV's +AtxA ATXA +A. U. AU +A.U. AU +Aub AUB +Aubl AUBL +AUVs AUV's +Auw AUW +avab AVAB +A. V. AV +A.V. AV +AVCs AVC's +avg AVG +Avn AVN +Avo AVO +AvP AVP +AVRs AVR's +Avs' AV's +Avs AV's +avvo AVVO +Awa AWA +AWAs AWA's +A. W. AW +A.W. AW +Awo AWO +Awwa AWWA +A. X. AX +A. Y. AY +A.Y. AY +A. Z. AZ +A.Z. AZ +Azg AZG +Azi AZI +azm AZM +AzTV AZTV +Baad BAAD +Ba'al BAAL +Baal BAAL +Baam BAAM +Baap BAAP +ba'as BAA's +Baat BAAT +Ba'ath BAATH +B. A. BA +B.A. BA +B&A B and A +Bac BAC +bae BAE +Bae BAE +BAe BAE +Bauw BAUW +B'Av BAV +B&B B and B +bb BB +B. B. BB +B.B. BB +bbc BBC +BB&CI BB and CI +BBC&PJR BBC and PJR +BBQ'er BBQER +B&Bs B and B's +BB&S BB and S +BBSes BBSE's +BB&T BB and T +BbvCI BBVCI +bc BC +B. C. BC +B.C. BC +Bcci BCCI +B.C.'s BC's +BCs BC's +BCSic BCSIC +BdA BDA +bd BD +B. D. BD +B.D. BD +Bde BDE +bds BDS +BdU BDU +B. E. BE +B.E. BE +Bedw BEDW +bef BEF +bei BEI +Bei BEI +Beih BEIH +Beis BEI's +bej BEJ +BEMs BEM's +Ber BER +Bes BE's +bf BF +B. F. BF +B.F. BF +BFFs BFF's +bfy BFY +B. G. BG +B.G. BG +BglII BGLII +bgs BGS +Bgy BGY +Bha BHA +B&H B and H +B. H. BH +B.H. BH +BH&E BH and E +Bhe BHE +BHMs BHM's +bhttp BHTTP +B. I. BI +B.I. BI +Bie BIE +biedt BIEDT +Biem BIEM +B.I.G.'s BIG's +BiH BIH +B. J. BJ +B.J. BJ +BJPs BJP's +B.J.'s BJ's +B&K B and K +B. K. BK +B.K. BK +BKCa BKCA +B. L. BL +B.L. BL +ble BLE +bleg BLEG +blev BLEV +bli BLI +Blla BLLA +BLR&D BLR and D +BLTs BLT's +B&M B and M +B. M. BM +B.M. BM +bmd BMD +bmi BMI +BMPs BMP's +BMRs BMR's +bmt BMT +B&N B and N +bnb BNB +B. N. BN +B.N. BN +Boac BOAC +B&O B and O +B. O. BO +B.O. BO +Boc BOC +BoC BOC +BOCs BOC's +boj BOJ +Boj BOJ +B&O's B and O's +bp BP +B. P. BP +B.P. BP +bpl BPL +B&Q B and Q +B. Q. BQ +Brbic BRBIC +B. R. BR +B.R. BR +BRBs BRB's +Brne BRNE +Brno BRNO +BRTs BRT's +Brza BRZA +brzu BRZU +brzy BRZY +Brzyk BRZYK +BsaL BSAL +B. s B's +B.'s B's +Bs B's +B. S. BS +B.S. BS +bsd BSD +bt BT +B. T. BT +B.T. BT +Btry BTRY +btsan BTSAN +btus BTUS +BTUs BTU's +B.U. BU +B. V. BV +B.V. BV +Bwa BWA +B&W B and W +B. W. BW +B.W. BW +BWTs BWT's +bwwtv BWWTV +Bxa BXA +Bxe BXE +B. Y. BY +byc BYC +bygd BYGD +Byk BYK +byn BYN +Byo BYO +Byou BYOU +Byrl BYRL +bySLC BYSLC +byt BYT +B.Z. BZ +bzhed BZHED +Bzik BZIK +Bzyb BZYB +Caat CAAT +C. A. CA +C.A. CA +C&A CANDA +CA&CC CA and CC +Cadw CADW +caeca CAECA +Cae CAE +C.A.M.'s CAM's +Capt. captain +cas CAS +Cas CA's +Casc CASC +cb CB +C. B. CB +C.B. CB +cbc CBC +CB&CNS CB and CNS +CBDs CBD's +CBGBs CBGB's +CbiXS CBIXS +CB&Q CB and Q +CBs CB's +'c C +CcaA CCAA +cca CCA +Cca CCA +C&C C and C +C. C. CC +C.C. CC +ccd CCD +CCDev CCDEV +CCDs CCD's +CCEd CCED +CCi CCI +ccm CCM +CCRCs CCRC's +cct CCT +ccus CCUS +C&D C and D +cdc CDC +cd CD +C. D. CD +C.D. CD +CD&DR CD and DR +CDi CDI +cDNA CDNA +cdnas CDNAS +cDNAs CDNA's +CDOs CDO's +CDPs CDP's +CD&R CD and R +cds CDS +CDs CD's +CDSPCo CDSPCO +CdtA CDTA +CdTe CDTE +CDTi CDTI +CD&V CD and V +Cec CEC +c'e CE +ce CE +C'e CE +Ce CE +C. E. CE +C.E. CE +Ceel CEEL +Cefn CEFN +C&EI's C and EI's +C&EN C and EN +cen CEN +Cen CEN +ceo CEO +Ceol CEOL +Ceorl CEORL +Ceos CEO's +CEOs' CEO's +CEOs CEO's +cer CER +Cer CER +ces CES +Ces CE's +Cex CEX +CeX CEX +Cfa CFA +C&F C and F +cf CF +C. F. CF +C.F. CF +CFOs CFO's +CFTs CFT's +C&G C and G +C. G. CG +C.G. CG +cgl CGL +C&H C and H +C. H. CH +C.H. CH +Chhu CHHU +Chirs CHIR's +CHP'den CHPDEN +CHPs CHP's +Chy CHY +Cia CIA +ci CI +Ci CI +C. I. CI +C.I. CI +Cicic CICIC +cii CII +cim CIM +Cim CIM +Cio CIO +CIOs CIO's +Cip CIP +cis CIS +CIs CI's +cit CIT +CiTD CITD +citS CITS +CitX CITX +Ciuc CIUC +Ciu CIU +CiU CIU +Cixi CIXI +C. J. CJ +C.J. CJ +C. K. CK +C.K. CK +ckx CKX +CLBs CLB's +clc CLC +cl CL +C. L. CL +C.L. CL +Cle CLE +cllr CLLR +CL&N CL and N +Clo CLO +CL&P CL and P +CLs CL's +CLTs CLT's +Clu CLU +Clwyd CLWYD +C&MA C and MA +cm CM +C. M. CM +C.M. CM +CMCs CMC's +Cmde CMDE +cmdr CMDR +cml CML +CMMs CMM's +cmn CMN +Cmte CMTE +cn CN +C. N. CN +C.N. CN +CNMs CNM's +cnr CNR +CNs CN's +CNTs CNT's +Cnut's CNUT's +CNVs CNV's +C&O C and O +C. O. CO +C.O. CO +Co. company +Col. colonel +C&P C and P +cp CP +C. P. CP +C.P. CP +CPCs CPC's +cpo CPO +CPUs CPU's +cq CQ +CQDs CQD's +cr CR +C. R. CR +C.R. CR +Cre CRE +crk CRK +Crkva CRKVA +crkve CRKVE +CRLs CRL's +crm CRM +Crne CRNE +Crni CRNI +Crno CRNO +CRs CR's +csa CSA +Csa CSA +Csak CSAK +Csaky CSAKY +C&S C and S +cs CS +C.s C's +Cs C's +C. S. CS +C.S. CS +C&SF C and SF +csg CSG +CsI CSI +CSis CSI's +CSIs CSI's +CSOs CSO's +cspA CSPA +csp CSP +CSPs CSP's +CSSNCs CSSNC's +Csuz CSUZ +CTAs CTA's +C&T C and T +cte CTE +CTLs CTL's +ctr CTR +Ctrip CTRIP +ctv CTV +cu CU +C. U. CU +Cuyp CUYP +C&V C and V +cvcp CVCP +'cv CV +cv CV +C. V. CV +C.V. CV +CVEs CVE's +CVOs CVO's +CVs CV's +CVTs CVT's +C. W. CW +C.W. CW +Cwej CWEJ +Cwele CWELE +cwm CWM +cwrt CWRT +C.X. CX +C. Y. CY +C.Y. CY +cyl CYL +Cyn CYN +CyP CYP +Cyrl CYRL +Cys CY's +czci CZCI +cz CZ +C.Z. CZ +czy CZY +Daai DAAI +D. A. DA +D.A. DA +D&AD DANDAD +D.A.N.C.E. dance +Dav DAV +dBa DBA +db DB +D. B. DB +D.B. DB +DCCs DCC's +D&C D and C +dc DC +D. C. DC +D.C. DC +DCom DCOM +D.C.'s DC's +DCs DC's +DCUs DCU's +D&D D and D +D. D. DD +D.D. DD +DDi DDI +Ddoc DDOC +Ddu DDU +Deah DEAH +D. E. DE +D.E. DE +deg DEG +dei DEI +Dei DEI +DeI DEI +Deijm DEIJM +Deip DEIP +dez DEZ +Dez DEZ +Dfa DFA +DFCs DFC's +D. F. DF +D.F. DF +DfE DFE +DfES DFES +DFPs DFP's +DFs DF's +dfx DFX +D&G D and G +D. G. DG +D.G. DG +Dha DHA +DHBs DHB's +D&H D and H +dh DH +D. H. DH +D.H. DH +d'HEC DHEC +dhe DHE +Dheku DHEKU +Dhod DHOD +dhol DHOL +Dhol DHOL +Dhoo DHOO +Dhor DHOR +Dhou DHOU +dhr DHR +DHSs DHS's +D.I. DI +diy DIY +DiY DIY +Diyn DIYN +DIYs DIY's +Djam DJAM +dj DJ +D. J. DJ +D.J. DJ +DJ'ed DJED +Djem DJEM +Dji DJI +Djo DJO +D'Jok DJOK +djr DJR +D.J.s DJ's +DJs DJ's +DjVu DJVU +DjVus DJVU's +D. K. DK +D.K. DK +dla DLA +dl DL +D. L. DL +D.L. DL +dlia DLIA +DL&LR DL and LR +DLLs DLL's +dlo DLO +DL&W DL and W +D.M.C.'s DMC's +D&M D and M +D. M. DM +D.M. DM +DMed DMED +DM&E DM and E +DMs DM's +DMUs DMU's +Dna DNA +DnA DNA +DnaJ DNAJ +D. N. DN +D.N. DN +Dnepr DNEPR +dnes DNES +Dnes DNE's +DNFs DNF's +DNSBLs DNSBL's +dns DNS +D.O.A.'s DOA's +dod DOD +Dod DOD +DoD DOD +D. O. DO +D.O. DO +D'oh DOH +dok DOK +Dok DOK +domt DOMT +Domt DOMT +Dop DOP +dotCMS DOTCMS +DotSVN DOTSVN +Douw DOUW +dozd DOZD +d'OZ DOZ +Dozhd DOZHD +dp DP +D. P. DP +D.P. DP +dpon DPON +DProf DPROF +DPs DP's +D.Q. DQ +drc DRC +Dr. doctor +D. R. DR +D.R. DR +dri DRI +Dri DRI +DRIs DRI's +Driu DRIU +Driv DRIV +Drnis DRNI's +Dro DRO +Drs. doctors +Drska DRSKA +druj DRUJ +DsbA DSBA +DS&BB DS and BB +dsDNA DSDNA +ds DS +Ds D's +D. S. DS +D.S. DS +DSGi DSGI +dsi DSI +DSi DSI +dsl DSL +DSMs DSM's +dsn DSN +D&SNGRR D and SNGRR +dsu' DSU +DTCs DTC's +DTDs DTD's +D. T. DT +D.T. DT +DT&E DT and E +DT&I DT and I +dtl DTL +DTs DT's +dty DTY +D.U. DU +dva DVA +Dva DVA +DVCs DVC's +dvd DVD +DVDs DVD's +dv DV +D. V. DV +D.V. DV +dve DVE +dvfb DVFB +dvi DVI +dvije DVIJE +Dvin DVIN +Dvir DVIR +Dwa DWA +D&W D and W +D. W. DW +D.W. DW +Dwedw DWEDW +Dwi DWI +dwr DWR +dwur DWUR +dxa DXA +dx DX +D.X. DX +DXers DXER's +Dydd DYDD +dy DY +Dy DY +D. Y. DY +dypl DYPL +dyr DYR +dz DZ +dzis DZIS +Dzog DZOG +Dzor DZOR +Dzus DZU's +E. A. EA +E.A. EA +EAMs EAM's +eas EAS +Eas EA's +Eav EAV +E. B. EB +E.B. EB +Ebn EBN +E&BR E and BR +Ebru EBRU +EBWs EBW's +ecc ECC +Eccl ECCL +ec EC +Ec EC +E. C. EC +E.C. EC +ece ECE +Ece ECE +Ecem ECEM +ecg ECG +ecma ECMA +ECNs ECN's +ECP&DA's ECP and DA's +eCRM ECRM +ect ECT +ECVs ECV's +edb EDB +E. D. ED +E.D. ED +Edh EDH +edhe EDHE +EDMs EDM's +Edmx EDMX +edn EDN +Edn EDN +eds EDS +Eds ED's +Edw EDW +Eeb EEB +E. E. EE +E.E. EE +Eef EEF +Eega EEGA +eene EENE +eep EEP +Ees EE's +eeuw EEUW +Eeuw EEUW +EEZs EEZ's +efc EFC +ef EF +Ef EF +E. F. EF +E.F. EF +eFS EFS +Efs EF's +Efu EFU +Egba EGBA +egfl EGFL +e.g. for example +e. g. for example +EG&G EG and G +Egi EGI +E&GR E and GR +egy EGY +Egyl EGYL +EHAs EHA's +E. H. EH +E.H. EH +ehf EHF +Ehttp EHTTP +EiCs EIC's +E. I. EI +E.I. EI +eIF EIF +Eitr EITR +EITs EIT's +EJBs EJB's +ej EJ +E. J. EJ +E.J. EJ +E. K. EK +E.K. EK +eki EKI +Ekma EKMA +Ekow EKOW +eks EKS +Eks EK's +E. L. EL +E.L. EL +ELTs ELT's +ELUs ELU's +Embd EMBD +eMC EMC +EMDs EMD's +Emea EMEA +E&M E and M +E. M. EM +E.M. EM +Emge EMGE +emra EMRA +E&NA E and NA +Enas ENA's +EnBW ENBW +EncFS ENCFS +Encyc ENCYC +E. N. EN +E.N. EN +Enes ENE's +engl ENGL +Engl ENGL +Engr ENGR +Eni ENI +enn ENN +Enn ENN +ens ENS +Ens EN's +Enso ENSO +ENTJs ENTJ's +EoD EOD +E. O. EO +E.O. EO +Eois EOI's +eok EOK +Eole EOLE +Eol EOL +Eolss EOLS's +Eom EOM +eop EOP +eoptta EOPTTA +Eora EORA +Eorl EORL +Eors EOR's +E&P E and P +Epe EPE +ep EP +Ep EP +E. P. EP +E.P. EP +Eph EPH +Ephs EPH's +epi EPI +Epi EPI +ePO EPO +epos' EPO's +epos EPOS +Epos EPO's +E.P.s EP's +eq EQ +Eq EQ +E. R. ER +E.R. ER +ERJs ERJ's +Eru ERU +Eruv ERUV +Erv ERV +ES3 ES three +Esa ESA +Esam ESAM +Esa's ESA's +Esat ESAT +ESCs ESC's +Esd ESD +E. S. ES +E.S. ES +esi ESI +espn ESPN +ESPNhttp ESPNHTTP +esq ESQ +Esq ESQ +Esq. esquire +Esraa ESRAA +Esra ESRA +Esref ESREF +Esri ESRI +estd ESTD +Estd ESTD +esu ESU +Esva ESVA +Etad ETAD +ETBs ETB's +E. T. ET +E.T. ET +ETFs ETF's +Et'hem ETHEM +Eti ETI +etj ETJ +Eto ETO +ets ETS +Ets ET's +ETs ET's +ett ETT +Ett ETT +Ettre ETTRE +Etts ETT's +Etz ETZ +EUBs EUB's +E. U. EU +E.U. EU +eup EUP +Eurwg EURWG +Euse EUSE +Eusi EUSI +EvaGT EVAGT +E. V. EV +E.V. EV +evl EVL +Evna EVNA +evnt EVNT +EVs EV's +evv EVV +Ewa's EWA's +E. W. EW +E.W. EW +Ewha EWHA +EWOs EWO's +Ewu EWU +excl EXCL +exd EXD +E.X. EX +exhb EXHB +exh EXH +Exptl EXPTL +exsul EXSUL +E&Y E and Y +E. Y. EY +Eyk EYK +eyu EYU +Ezaa EZAA +ez EZ +Ez EZ +Ezh EZH +Ezu EZU +Ezy EZY +Faaa FAAA +faa FAA +Faa FAA +faama FAAMA +FabH FABH +FabR FABR +F.A.B.'s FAB's +Fadl FADL +fa FA +Fa FA +F. A. FA +F.A. FA +Faf FAF +Fafhrd FAFHRD +fai FAI +Fai FAI +FAIPs FAIP's +Faiq FAIQ +fajn FAJN +Fal FAL +farw FARW +fasc FASC +Fasc FASC +fas FAS +Fas FA's +FAs FA's +FasL FASL +F. B. FB +F.B. FB +F.B.G.s FBG's +FBOs FBO's +fcb FCB +FCBs FCB's +F&C F and C +fc FC +F. C. FC +F.C. FC +F.C.'s FC's +FD&C FD and C +FDCPAs FDCPA's +F. D. FD +F.D. FD +FDICs FDIC's +FdI FDI +F. E. FE +F.E. FE +FEGs FEG's +Fes FE's +ffc FFC +ff FF +F. F. FF +F.F. FF +ffm FFM +FFs FF's +F. G. FG +F.G. FG +fgk FGK +FGs FG's +F. H. FH +F.H. FH +fhm FHM +fiadh FIADH +fia FIA +FiBL FIBL +Fi'd FID +F.I F +F&I F and I +F. I. FI +F.I. FI +Figl FIGL +fija FIJA +Fio FIO +FiO FIO +F. J. FJ +F.J. FJ +F. K. FK +F.K. FK +Fla FLA +Fles FLE's +fl FL +F. L. FL +F.L. FL +fli FLI +flyr FLYR +fm FM +F. M. FM +F.M. FM +fMRI FMRI +FMs FM's +F. N. FN +F.N. FN +F. O. FO +FPDs FPD's +fp FP +F. P. FP +F.P. FP +FPGAs FPGA's +FPM&SA FPM and SA +fps FPS +FPSs FPS's +F.Q. FQ +fr FR +F. R. FR +F.R. FR +frs FRS +Fru FRU +Frwydr FRWYDR +fsf FSF +fs FS +F. s F's +Fs F's +F. S. FS +F.S. FS +fsn FSN +FSSs FSS's +FTAs FTA's +Ft. Fort +F. T. FT +F.T. FT +ftp FTP +FtsA FTSA +Ftuh FTUH +F. V. FV +F.V. FV +F&W F and W +F. W. FW +F.W. FW +fwr FWR +fx FX +Fyb FYB +F.Y. FY +Fyn FYN +fyi FYI +fyr FYR +Fyw FYW +F.Z. FZ +Gaac GAAC +G. A. GA +G.A. GA +Gbe GBE +GbE GBE +G. B. GB +G.B. GB +GB&NDR GB and NDR +G&C G and C +G. C. GC +G.C. GC +GCSEs GCSE's +GC&SF GC and SF +Gdal GDAL +Gde GDE +gd GD +G. D. GD +G.D. GD +Gdow GDOW +GDPs GDP's +gdr GDR +Gebr GEBR +Gebt GEBT +Ged GED +ge GE +G. E. GE +G.E. GE +Gek GEK +Gen. general +geq GEQ +Geu GEU +Gev GEV +GeV GEV +Gfa GFA +GF&A GFANDA +G. F. GF +G.F. GF +G. G. GG +G.G. GG +Ghe GHE +G. H. GH +G.H. GH +GHGs GHG's +Ghir GHIR +ghra GHRA +GH&SA GH and SA +Giei GIEI +G. I. GI +G.I. GI +G. J. GJ +G.J. GJ +G. K. GK +G.K. GK +Gla GLA +G&L G and L +G. L. GL +G.L. GL +gli GLI +Gli GLI +Glis GLI's +glnA GLNA +Glos GLO's +gma GMA +GmbH GMBH +Gmel GMEL +gm GM +G. M. GM +G.M. GM +gmin GMIN +GMOs GMO's +GMs GM's +gmt GMT +Gmul GMUL +gnb GNB +G. N. GN +G.N. GN +GNP&BR GNP and BR +gnp GNP +GNPs GNP's +G.O. GO +GPCRs GPCR's +GPdI GPDI +G&P G and P +gp GP +G. P. GP +G.P. GP +GpIIb GPIIB +GPMGs GPMG's +GPRs GPR's +GPUs GPU's +G. Q. GQ +grac GRAC +gra GRA +Gra GRA +Grbac GRBAC +GRBs GRB's +grc GRC +GRCs GRC's +gre GRE +Gre GRE +gr GR +G. R. GR +G.R. GR +grrl GRRL +Gryf GRYF +gry GRY +Gry GRY +grz GRZ +G&S G and S +Gs G's +G. S. GS +G.S. GS +GSIs GSI's +GSOp GSOP +GTAs GTA's +gt GT +G. T. GT +G.T. GT +GTi GTI +GTs GT's +G. U. GU +G.U. GU +GUIs GUI's +G. V. GV +G.V. GV +GvpA GVPA +GWe GWE +Gwet GWET +gw GW +G. W. GW +G.W. GW +Gwi GWI +gwr GWR +Gy GY +G. Y. GY +Gyn GYN +Gyps GYP's +gyu GYU +Gyu GYU +H. A. HA +H.A. HA +H&A H and A +HBCo HBCO +HBGAs HBGA's +H. B. HB +H.B. HB +H&BR H and BR +HCEs HCE's +H. C. HC +H.C. HC +hcl HCL +HClO HCLO +HCoV HCOV +HCPs HCP's +Hcy HCY +Hdad HDAD +hDAF HDAF +HDDs HDD's +hd HD +H. D. HD +H.D. HD +hdh HDH +HDi HDI +H. E. HE +H.E. HE +hezb HEZB +Hezb HEZB +H&F H and F +H. F. HF +H.F. HF +hgcA HGCA +hg HG +H. G. HG +H.G. HG +HgO HGO +HGPs HGP's +HgU HGU +HGVs HGV's +H&H H and H +H. H. HH +H.H. HH +H. I. HI +H.I. HI +Hizb HIZB +hja HJA +H. J. HJ +H.J. HJ +Hkam HKAM +H&K H and K +H. K. HK +H.K. HK +Hla HLA +H. L. HL +H.L. HL +Hluk HLUK +hlutr HLUTR +Hly HLY +Hman HMAN +H&M H and M +hm HM +H. M. HM +H.M. HM +HMOs HMO's +hMRE HMRE +H&M's H and M's +H. N. HN +H.N. HN +H. O. HO +H.O. HO +hpc HPC +hp HP +H. P. HP +H.P. HP +H.Q. HQ +H&R H and R +H. R. HR +H.R. HR +hroa HROA +HRo HRO +hrs HRS +HRs HR's +hscy HSCY +Hsee HSEE +hs HS +Hs H's +H. S. HS +H.S. HS +hsi HSI +hSlo HSLO +HSPs HSP's +HSTs HST's +hsv HSV +hTAS HTAS +HTAs HTA's +htc HTC +ht HT +H. T. HT +H.T. HT +hti HTI +Htin HTIN +Htoo HTOO +HtrA HTRA +HTRs HTR's +http HTTP +https HTTPS +Htwa HTWA +H. U. HU +HVCs HVC's +hvcv HVCV +hvem HVEM +Hvem HVEM +H. V. HV +H.V. HV +H. W. HW +H.W. HW +hwy HWY +Hwy HWY +hxt HXT +H. Y. HY +H.Y. HY +H. Z. HZ +HZ&PC HZ and PC +iaaf IAAF +IaaS IAAS +Iaca IACA +Iacob IACOB +IACTs IACT's +Iacub IACUB +iagt IAGT +I. A. IA +I.A. IA +Iapa IAPA +iar IAR +Iar IAR +IAUCs IAUC's +Iax IAX +Ibac IBAC +Ibaes IBAE's +IBCs IBC's +IBDA'A IBDAA +Ibda IBDA +ibdal IBDAL +I. B. IB +I.B. IB +Ibm IBM +Ibne IBNE +ibn IBN +Ibra IBRA +Ibsa IBSA +Ibs IB's +iBT IBT +Ibu IBU +iby IBY +ICBMs ICBM's +Icche ICCHE +icf ICF +I&C I and C +ic IC +Ic IC +I. C. IC +I.C. IC +Ici ICI +iCN ICN +Ico ICO +IcRn ICRN +ics ICS +ICs IC's +ICTs ICT's +ICTVdB ICTVDB +ICv ICV +iCyt ICYT +Iddaa IDDAA +Idd IDD +ID'd IDD +id ID +I. D. ID +I.D. ID +Idi IDI +Idir IDIR +IDLHs IDLH's +Idm IDM +IDPs IDP's +ids IDS +IDs ID's +IDx IDX +i.e. that is +Ifa IFA +ifc IFC +IfF IFF +Ifft IFFT +ifi IFI +Ifi IFI +IFIs IFI's +IfM IFM +Ifni IFNI +IFNs IFN's +Ifop IFOP +IFRSs IFRS's +Iga IGA +IgA IGA +IGFs IGF's +'ig IG +Ig IG +I.G. IG +igi IGI +IgM IGM +ign IGN +Ign IGN +Ih IH +I. H. IH +ihi IHI +ihm IHM +ihn IHN +Ihn IHN +Ihor IHOR +Iht IHT +IIb IIB +IIc IIC +IIfx IIFX +Iiga IIGA +IIga IIGA +IIgs IIG's +IIGs IIG's +IIIb IIIB +IIIBy IIIBY +IIIc IIIC +IIId IIID +I. I. II +I.I. II +ija IJA +Ija IJA +ij IJ +I. J. IJ +Ijok IJOK +Ijui IJUI +Ikh IKH +I.K. IK +IKr IKR +Iksa IKSA +Iku IKU +Ilbe ILBE +IL&FS IL and FS +ili ILI +Ili ILI +I. L. IL +I.L. IL +Ilm ILM +ilu ILU +Ilu ILU +IMbd IMBD +imc IMC +imdb IMDB +IMDb. IMDB +IMDb IMDB +ime IME +I&M I and M +I. M. IM +I.M. IM +Iml IML +Imm IMM +Imms' IMM's +imoa IMOA +impr IMPR +Impr IMPR +iMSNs IMSN's +Imst IMST +Inba INBA +inb INB +incl INCL +ind IND +Ind IND +Infs INF's +inHg INHG +I. N. IN +I.N. IN +InlB INLB +InP INP +Inre INRE +Inspx INSPX +Ints INT's +INTs INT's +Intu INTU +inv INV +Ioba IOBA +IODs IOD's +io. IO +io IO +.I.o. IO +Io. IO +Io IO +.IO IO +I/O IO +Ioka IOKA +Iok IOK +IoM IOM +IOPs IOP's +iOS IOS +Io's IO's +I/Os IO's +I.O.'s IO's +Iosu IOSU +IoT IOT +IoW IOW +IPCs IPC's +ip IP +Ip IP +I.P. IP +Ipo IPO +IPPs IPP's +Ippu IPPU +iPPV IPPV +iPSC IPSC +iPSCs IPSC's +ipse IPSE +iPS IPS +IPs IP's +IPv IPV +iQ IQ +I.Q. IQ +Irgm IRGM +Irig IRIG +Iril IRIL +i'r IR +ir IR +Ir IR +I. R. IR +I.R. IR +Irla IRLA +Irmis IRMI's +iro IRO +Iro IRO +Irra IRRA +IRs IR's +iru IRU +Iru IRU +ISAv ISAV +Isba ISBA +isbn ISBN +ISBNs ISBN's +isCf ISCF +iSC ISC +Isc ISC +Isd ISD +isdn ISDN +Isgec ISGEC +ishq ISHQ +Ishq ISHQ +I. S. IS +I.S. IS +Isl ISL +ISMNs ISMN's +ISPs ISP's +Isra'il ISRAIL +Isra ISRA +iss ISS +Iss IS's +ISSNs ISSN's +Isu ISU +Ite ITE +ITHs ITH's +iti ITI +Iti ITI +I.T. IT +itk ITK +Itk ITK +ITNNs ITNN's +Itoi ITOI +iTP ITP +Itse ITSE +itt ITT +Itu ITU +Itz ITZ +Iucn IUCN +IUDs IUD's +Iuz IUZ +I. V. IV +I.V. IV +IVs IV's +Ivu IVU +Iwas IWA's +Iwaz IWAZ +IWBs IWB's +iwi IWI +iw IW +I. W. IW +iwrg IWRG +iwspy IWSPY +Iwuh IWUH +IXb IXB +IXBs IXB's +IXCs IXC's +IXe IXE +iXL IXL +ixtle IXTLE +Iya IYA +Iyar IYAR +iyem IYEM +Iyi IYI +iy IY +I. Y. IY +I.Y. IY +Jaf JAF +J. A. JA +J&B J and B +jb JB +J. B. JB +J.B. JB +jcis JCIS +jc JC +J. C. JC +J.C. JC +JCRs JCR's +JdeBP JDEBP +jdi JDI +jd JD +J. D. JD +J.D. JD +jdk JDK +J&D's J and D's +J.D.s JD's +J. E. JE +J.E. JE +jf JF +J. F. JF +J.F. JF +J. G. JG +J.G. JG +jh JH +J. H. JH +J.H. JH +JHs JH's +JHSVs JHSV's +JHud JHUD +J. I. JI +J.I. JI +J&J JANDJ +J. J. JJ +J.J. JJ +Jka JKA +jkd JKD +J&K J and K +J. K. JK +J.K. JK +jkx JKX +J. L. JL +J.L. JL +J. M. JM +J.M. JM +jnb JNB +J. N. JN +J.N. JN +Jno JNO +jnr JNR +J. O. JO +J.O. JO +jpg JPG +J&P J and P +jp JP +J.P. JP +J.Q. JQ +J&R J and R +J. R. JR +J.R. JR +Jr. junior +jr. junior +Jr junior +jr junior +J.R.'s JR's +jsb JSB +Js J's +J. S. JS +J.S. JS +J&T J and T +J. T. JT +J.T. JT +JT&KW JT and KW +J. U. JU +J&V J and V +J. V. JV +J.V. JV +Jwa JWA +J. W. JW +J.W. JW +jx JX +J. Y. JY +J.Y. JY +Jym JYM +Jymn JYMN +J. Z. JZ +J.Z. JZ +K8S KUBERNETES +K. A. KA +K.A. KA +kbi KBI +K&B K and B +K. B. KB +K.B. KB +K. C. KC +K.C. KC +K.C.'s KC's +kDa KDA +kdal KDAL +K&D K and D +kd KD +K. D. KD +K.D. KD +K. D.'s KD's +K.D.'s KD's +ke KE +Ke KE +K. E. KE +K.E. KE +kfc KFC +K.F. KF +kgr KGR +kgt KGT +KgU KGU +kgv KGV +Khizr KHIZR +K. H. KH +K.H. KH +Khlav KHLAV +Khmu KHMU +Khri KHRI +Khru KHRU +K. I. KI +K.I. KI +Kjer KJER +kj KJ +K. J. KJ +K.J. KJ +Kjop KJOP +KJo's KJO's +K. K. KK +K.K. KK +Kle KLE +kl KL +K. L. KL +K.L. KL +K&M K and M +km KM +K. M. KM +K.M. KM +K&N K and N +kn KN +K. N. KN +K.N. KN +k'o KO +K. O. KO +K.O. KO +KPIs KPI's +K&P K and P +K. P. KP +K.P. KP +Kppen KPPEN +kptm KPTM +krc KRC +KRCs KRC's +K.R.I.T.'s KRIT's +Krka KRKA +kr KR +K. R. KR +K.R. KR +Krne KRNE +kroz KROZ +Kroz KROZ +Kru KRU +ksa KSA +kset KSET +Kseur KSEUR +Ksevt KSEVT +ks KS +K. S. KS +K.S. KS +Ktav KTAV +KT&K KT and K +kt KT +K. T. KT +K.T. KT +Kuaa KUAA +Kud KUD +kuih KUIH +K. U. KU +K.U. KU +Kutb KUTB +Kvik KVIK +Kvit KVIT +K. V. KV +K.V. KV +Kvyat KVYAT +kwa KWA +kwe KWE +Kyse KYSE +kyt KYT +Kyt KYT +kz KZ +K. Z. KZ +L. A. LA +L.A.'s LA's +Lay's LAY's +LBi LBI +L. B. LB +L.B. LB +LBPs LBP's +LCAs LCA's +lcc LCC +LCCs LCC's +LC&DR LC and DR +LCDs LCD's +LCIs LCI's +L. C. LC +L.C. LC +lcn LCN +LCSs LCS's +LCTs LCT's +LCVPs LCVP's +Lda LDA +LDCs LDC's +L. D. LD +L.D. LD +L. E. LE +L.E. LE +LFFCs LFFC's +L. F. LF +L.F. LF +LFs LF's +LFSRs LFSR's +L. G. LG +L.G. LG +LGMs LGM's +LG&RDD LG and RDD +LGs LG's +LGUs LGU's +LGVs LGV's +Lha LHA +L. H. LH +L.H. LH +L. I. LI +L.I. LI +Lje LJE +L. J. LJ +L.J. LJ +L. K. LK +lks LKS +Llapi LLAPI +lle LLE +lli LLI +L&L L and L +L. L. LL +L.L. LL +llp LLP +llu LLU +LMGs LMG's +lm LM +L. M. LM +L.M. LM +LMPs LMP's +LMQs LMQ's +LnAIB LNAIB +L&N L and N +L. N. LN +L.N. LN +L.O.C.'s LOC's +Lokk LOKK +l'OL LOL +L. O. LO +L.O. LO +LPARs LPAR's +L&P L and P +lp LP +L. P. LP +L.P. LP +L&PM L and PM +LPMud LPMUD +LPs LP's +LPThe LPTHE +lr LR +L. R. LR +L.R. LR +LRTs LRT's +LRVs LRV's +LSDs LSD's +LSi LSI +ls LS +Ls L's +L. S. LS +L.S. LS +LSTs LST's +LSVCCs LSVCC's +Ltda LTDA +Ltd. limited +L&T L and T +Lt. lieutenant +lt LT +L. T. LT +L.T. LT +ltoh LTOH +L. U. LU +lv LV +L. V. LV +L.V. LV +L. W. LW +L.W. LW +L.Y. LY +L&YR L and YR +M. A. MA +M.A. MA +MAX-Q MAXQ +M&A M and A +Mbewu MBEWU +mbi MBI +M. B. MB +M.B. MB +mBo MBO +Mbre MBRE +mbr MBR +MCCs MCC's +M. C. MC +M.C. MC +MCs MC's +mcyG MCYG +mdb MDB +MDCs MDC's +mdDA MDDA +MD&DI MD and DI +Mde MDE +MDGs MDG's +MDHUs MDHU's +mDia MDIA +MDic MDIC +mdla MDLA +md MD +M. D. MD +M.D. MD +mdr MDR +M. E. ME +M.E. ME +MFDs MFD's +MFe MFE +M. F. MF +M.F. MF +MFTs MFT's +Mgadla MGADLA +Mgal MGAL +mga MGA +Mga MGA +Mgbo MGBO +MGen MGEN +M&G M and G +M. G. MG +M.G. MG +M&GN M and GN +M&GR's M and GR's +Mha MHA +MHCs MHC's +MH&L MH and L +M&H M and H +M. H. MH +M.H. MH +Mhor MHOR +Mhow MHOW +M.I.A.'s MIA's +M&I M and I +M. I. MI +M.I. MI +M&J M and J +M. J. MJ +M.J. MJ +M. K. MK +M.K. MK +MKs MK's +MLAs MLA's +mlc MLC +MLCs MLC's +mlg MLG +mli MLI +Mlle MLLE +M&L M and L +M. L. ML +M.L. ML +MLPs MLP's +MM&A MMANDA +M&M M and M +M. M. MM +M.M. MM +M&M's M and M's +MNCs MNC's +M&NF M and NF +M. N. MN +M.N. MN +M.O.G.U.E.R.A.'s MOGUERA's +M. O. MO +M.O. MO +MpA MPA +MPAs MPA's +MPBu MPBU +MP&I MP and I +MPi MPI +MPLMs MPLM's +M&P M and P +M. P. MP +M.P. MP +MPPs MPP's +M.P.'s MP's +MPs MP's +MPThe MPTHE +Mpu MPU +M. Q. MQ +Mra MRA +MRBs MRB's +mre MRE +MR&LE MR and LE +Mr. mister +M. R. MR +M.R. MR +mRNA MRNA +mRNAs MRNA's +Mrs. misses +MRTs MRT's +msd MSD +Mse MSE +M&S M and S +Ms. miss +M. S. MS +M.S. MS +MSPs MSP's +mst MST +Mta MTA +MTAs MTA's +M&T M and T +M. T. MT +M.T. MT +Mtor MTOR +mtvU MTVU +MTVu MTVU +M. U. MU +M.U.s MU's +MVMs MVM's +M. V. MV +M.V. MV +MVPs MVP's +MVs MV's +MWe MWE +M. W. MW +M.W. MW +M. X. MX +myb MYB +myc MYC +Myc MYC +MyDD MYDD +M. Y. MY +M.Y. MY +MySQL MYSQL +M. Z. MZ +N. A. NA +N.A. NA +N.B.A.'s NBA's +NBAs NBA's +N. B. NB +N.B. NB +nbs NBS +NBTwo NBTWO +NCAAs NCAA's +NCCs NCC's +N. C. NC +N.C. NC +NCOs NCO's +N. D. ND +N.D. ND +N. E. NE +N.E. NE +ner NER +NFATc NFATC +nfed NFED +N. F. NF +N.F. NF +Nge NGE +N. G. NG +N.G. NG +NGOs NGO's +Nha NHA +NHCEs NHCE's +NHCs NHC's +nhi NHI +NHM&W NHM and W +N. H. NH +N.H. NH +NHPs NHP's +N. I. NI +N.I. NI +N'I NI +N. J. NJ +N.J. NJ +Njoo NJOO +N.J.'s NJ's +N. K. NK +N.K. NK +nkvd NKVD +nkv NKV +N. L. NL +N.L. NL +NLRs NLR's +N. M. NM +N.M. NM +N. N. NN +N.N. NN +NPCs NPC's +NPMs NPM's +N. P. NP +N.P. NP +NPs NP's +N. Q. NQ +nri NRI +Nri NRI +NRIs NRI's +NRJs NRJ's +nr NR +N. R. NR +N.R. NR +N. S. NS +N.S. NS +NSOs NSO's +Nta NTA +ntb NTB +N. T. NT +N.T. NT +ntw NTW +N.U. NU +NvDA's NVDA's +N. V. NV +N.V. NV +nwa NWA +N&W N and W +N. W. NW +N.W. NW +nyc NYC +N. Y. NY +N.Y. NY +NX-SOC NXSOC +N'Zif NZIF +NZiK NZIK +N'Zi NZI +N.Z. NZ +O. A. OA +O.A. OA +obl OBL +Oblt OBLT +O.B. OB +O. C. OC +O.C. OC +Octl OCTL +O. D. OD +O.E. OE +O.F. OF +ofr OFR +O&G O and G +O. G. OG +O.G. OG +O. H. OH +O.H. OH +O. I. OI +O.I. OI +O. J. OJ +O.J. OJ +OK'd OKD +OKd OKD +oke OKE +Oke OKE +O&K O and K +O. K. OK +O.K. OK +O. L. OL +O.L. OL +Olo OLO +Olov OLOV +ols OLS +OLs OL's +olvwm OLVWM +olwm OLWM +O&MFL O and MFL +omg OMG +OMGs OMG's +O. M. OM +O.M. OM +OmOm OMOM +Om's OM's +oncu ONCU +ond OND +onf ONF +O. N. ON +O.N. ON +O&O O and O +O. O. OO +O.O. OO +Oop OOP +oor OOR +oose OOSE +Oo's OO's +Ootw OOTW +OPMs OPM's +O. P. OP +O.P. OP +opr OPR +Opr OPR +ORFs ORF's +OR&N OR and N +O. R. OR +osaa OSAA +osa OSA +Osa OSA +OSBs OSB's +O. S. OS +O.S. OS +OSTs OST's +osv OSV +O.T. OT +OTs OT's +Otu OTU +otv OTV +O.U. OU +ovca OVCA +Ovca OVCA +Ovda OVDA +Ovo OVO +ov OV +Ov OV +O. V. OV +O.V. OV +OWCs OWC's +O. W. OW +O.W. OW +pa PA +P. A. PA +P.A. PA +pBCE PBCE +pbc PBC +pb PB +P. B. PB +P.B. PB +PCBs PCB's +PCDDs PCDD's +PCeU PCEU +PCIe PCIE +pci PCI +pcl PCL +PcoA PCOA +pc PC +P. C. PC +P.C. PC +PCRev PCREV +pcs PCS +P.C.s PC's +pDAB PDAB +PDAs PDA's +pdbp PDBP +PDBsum PDBSUM +PDCs PDC's +PD&D PD and D +PDEs PDE's +pdf PDF +PDFs PDF's +P&D P and D +P. D. PD +P.D. PD +PDPs PDP's +PDs PD's +P.E.I.'s PEI's +P. E. PE +P.E. PE +PFs PF's +PFW&C PFW and C +PGMs PGM's +PG&N PG and N +P&G P and G +P. G. PG +P.G. PG +Phlo PHLO +P&H P and H +P. H. PH +P.H. PH +php PHP +PHPs PHP's +P&I P and I +P. I. PI +P.I. PI +Piz PIZ +pj PJ +P. J. PJ +P.J. PJ +PJs PJ's +P. K. PK +P.K. PK +plc PLC +PLCs PLC's +P. L. PL +P.L. PL +PMMoV PMMOV +p.m. PM +p.m PM +P. M. PM +P.M. PM +PMs PM's +PNaCl PNACL +pna PNA +Pnau PNAU +pnb PNB +PNEs PNE's +PNETs PNET's +pneus PNEUS +png PNG +PNNs PNN's +PNoy PNOY +pn PN +P. N. PN +P.N. PN +P.O.D.'s POD's +P&O P and O +P. O. PO +P.O. PO +P.O.W.'s POW's +P&PH P and PH +PPi PPI +P. P. PP +P.P. PP +PPVs PPV's +PPy PPY +pr PR +P. R. PR +P.R. PR +P. s P's +P.'s P's +Ps P's +P. S. PS +P.S. PS +PSSAs PSSA's +pTA PTA +PTAs PTA's +Pte PTE +PTEs PTE's +ptf PTF +Ptie PTIE +PTLs PTL's +Ptol PTOL +pt PT +P. T. PT +P.T. PT +PTTs PTT's +P'Twa PTWA +Puiu PUIU +Pul PUL +PVAs PVA's +PvdA PVDA +pve PVE +P. V. PV +P.V. PV +pvr PVR +PVs PV's +pwll PWLL +P&W P and W +P. W. PW +P.W. PW +Pyi PYI +Pyk PYK +Pyl PYL +PyL PYL +P. Y. PY +Pyu PYU +Pyw PYW +Pyx PYX +P. Z. PZ +Q. A. QA +Q&A QANDA +Q&A's QANDA's +Q&As QANDAS +QbA QBA +Q.B. QB +Q.C. QC +Q. E. QE +Q.H. QH +Q.I. QI +Q. J. QJ +Q. N. QN +QPOs QPO's +Q.V. QV +R. A. RA +R.A. RA +R&A R and A +R&AW R and AW +RbAg RBAG +RBCs RBC's +RBIs RBI's +R&B R and B +R. B. RB +R.B. RB +rca RCA +R&C R and C +rc RC +R. C. RC +R.C. RC +RCTs RCT's +RdE RDE +R&D R and D +R. D. RD +R.D. RD +R.E.M.'s REM's +REPLs REPL's +R. E. RE +R.E. RE +R. F. RF +R.F. RF +R&G R and G +R. G. RG +R.G. RG +RHIBs RHIB's +Rhiw RHIW +rhl RHL +RhoG RHOG +Rho's RHO's +R. H. RH +R.H. RH +R&I R and I +R. I. RI +R.I. RI +riu RIU +Riu RIU +rivs RIVS +Rivu RIVU +Rixt RIXT +rjf RJF +R. J. RJ +R.J. RJ +R. K. RK +R.K. RK +R. L. RL +R.L. RL +rly RLY +RMDs RMD's +RMLs RML's +rm RM +R. M. RM +R.M. RM +RMSDs RMSD's +RMs RM's +rna RNA +RNAs RNA's +Rnet RNET +Rnic RNIC +RNNs RNN's +RNPs RNP's +R. N. RN +R.N. RN +rOmpB ROMPB +Rooi ROOI +R. O. RO +R.O. RO +ROVs ROV's +Roxb ROXB +Roxx ROXX +RP&C RP and C +rpc RPC +Rpe RPE +rpg RPG +RPGs RPG's +rpm RPM +R. P. RP +R.P. RP +RPs RP's +R. Q. RQ +R.Q. RQ +rra RRA +rrd RRD +Rreli RRELI +rre RRE +rRNA RRNA +rRNAs RRNA's +R&R R and R +rr RR +R. R. RR +R.R. RR +rsh RSH +Rsis RSI's +rsly RSLY +RsmA RSMA +RSpec RSPEC +rs RS +Rs R's +R. S. RS +R.S. RS +RSu RSU +rtb RTB +RTCs RTC's +RTEjr RTEJR +RTeOR RTEOR +RTOs RTO's +rtPA RTPA +rt RT +R. T. RT +R.T. RT +rts RTS +RTVFBiH RTVFBIH +Ruao RUAO +Rukn RUKN +Ruk RUK +Rupf RUPF +Rupr RUPR +rup RUP +Rup RUP +R. U. RU +R.U. RU +RUN:AI RUN AI +RutB RUTB +Ruu RUU +Ruwa RUWA +Ruy RUY +Ruyt RUYT +Rvat RVAT +Rvo RVO +R. V. RV +R.V. RV +rvs RVS +rwa RWA +Rwa RWA +rwb RWB +RWEs RWE's +rwjf RWJF +R. W. RW +R.W. RW +Rxa RXA +rz RZ +R. Z. RZ +Sa'id SAID +S. A. SA +S.A. SA +Saxl SAXL +Sa'yo SAYO +Sbai SBAI +sbc SBC +SBCs SBC's +sbk SBK +Sborz SBORZ +sb SB +S. B. SB +S.B. SB +Sbu SBU +scr SCR +SCRs SCR's +scry SCRY +sc SC +S. C. SC +S.C. SC +Scuf SCUF +Scymn SCYMN +SD&AE SD and AE +Sdei SDEI +sde SDE +Sde SDE +SDG&E SDG and E +sdk SDK +S. D. SD +S.D. SD +SDSM&T's SDSM and T's +Sejms SEJM's +sejr SEJR +Sekl SEKL +Sek SEK +S. E. SE +S.E. SE +ses SES +Ses SE's +SEs SE's +S.E.S.'s SES's +Seyh SEYH +sfadb SFADB +Sfax SFAX +SFFCo SFFCO +sfn SFN +'sf SF +sf SF +S. F. SF +S.F. SF +sfs SFS +S.F.'s SF's +SG&A SGANDA +sgb SGB +Sgip SGIP +sgml SGML +sgra SGRA +S. G. SG +S.G. SG +SGSNs SGSN's +Sgt. sergeant +sgt SGT +S.H.I.E.L.D.'s SHIELD's +Shma SHMA +S. H. SH +S.H. SH +S. I. SI +S.I. SI +sjef SJEF +Sjon SJON +S. J. SJ +S.J. SJ +S. K. SK +S.K. SK +S.L.A.A.'s SLAA's +sla SLA +SLAs SLA's +S&L S and L +SLS&E SLS and E +S. L. SL +S.L. SL +SMe SME +SMEs SME's +SmI SMI +SMPSs SMPS's +smr SMR +S&M S and M +sm SM +S. M. SM +S.M. SM +S.M.'s SM's +SMs SMS +Smyl SMYL +SNESjr SNESJR +sngle SNGLE +SNPs SNP's +SnSe SNSE +S. N. SN +S.N. SN +S. O. SO +S.O. SO +Sos SO's +Sovn SOVN +Sov SOV +S&P 500 S and P five hundred +SPCAs SPCA's +Spe SPE +Spoa SPOA +SpPIn SPPIN +S&P S and P +S. P. SP +S.P. SP +SPs SP's +SPUs SPU's +sql SQL +sq SQ +S. Q. SQ +Sra SRA +SRAs SRA's +Srba SRBA +Srbi SRBI +SRBs SRB's +SRGs SRG's +Srhir SRHIR +SRLGs SRLG's +SRMs SRM's +Srni SRNI +srp SRP +sr SR +S. R. SR +S.R. SR +Srul SRUL +srx SRX +SSAs SSA's +SSDs SSD's +ssl SSL +SSoSV SSOSV +SSRIs SSRI's +S&S S and S +ss SS +S. s S's +Ss S's +S. S. SS +S.S. SS +Ssu SSU +ssw SSW +Ssy SSY +ST&AJ ST and AJ +STDs STD's +stfv STFV +STG-TWO STGTWO +STGs STG's +STIs STI's +STi STI +stl STL +Stryj STRYJ +S&T S and T +STScI STSCI +S. T. ST +S.T. ST +suo SUO +Suo SUO +S. U. SU +Susz SUSZ +SUTs SUT's +Suu SUU +SUVs SUV's +Suy SUY +Svac SVAC +svar SVAR +sve SVE +Sve SVE +SVMs SVM's +svn SVN +svom SVOM +sv SV +S. V. SV +S.V. SV +SVTs SVT's +Swe SWE +SwRI SWRI +S&W S and W +sw SW +S. W. SW +S.W. SW +sx SX +S.X. SX +SysML SYSML +SysRq SYSRQ +Sys SY's +SysV SYSV +S. Y. SY +S.Y. SY +SyT SYT +syv SYV +Syxx SYXX +Szasz SZASZ +Szer SZER +szkic SZKIC +Szklo SZKLO +Szlak SZLAK +SzMME SZMME +Szpir SZPIR +sz SZ +S. Z. SZ +Szu SZU +Szyk SZYK +taf TAF +Taf TAF +T. A. TA +T.A. TA +T&A T and A +TBCs TBC's +TBMs TBM's +tbh TBH +T. B. TB +T.B. TB +TCiAP TCIAP +TCKs TCK's +tc TC +T. C. TC +T.C. TC +TCUs TCU's +tcu TCU +tdb TDB +TDCi TDCI +TdIF TDIF +TDs TD's +T. D. TD +T.D. TD +Teatr TEATR +T. E. TE +T.E. TE +T&F T and F +tf TF +T. F. TF +T.F. TF +tge TGE +tgf TGF +tg TG +T. G. TG +T.G. TG +TGVs TGV's +tgv TGV +Thok THOK +ThSe THSE +T. H. TH +T.H. TH +T.I.'s TI's +T.I. TI +Tiu TIU +tiv TIV +Tiv TIV +Tiy's TIY's +T. J. TJ +T.J. TJ +t'ju TJU +tjz TJZ +tko TKO +Tko TKO +tk TK +T. K. TK +T.K. TK +Tlas TLA's +TlCu TLCU +TLDs TLD's +tli TLI +tlp TLP +TLRs TLR's +TLs TL's +tl TL +T. L. TL +T.L. TL +Tluk TLUK +Tluszcz TLUSZCZ +tmc TMC +TMGs TMG's +tmos TMOS +tmRNA TMRNA +TMSs TMS's +T.M.s TM's +tm TM +T. M. TM +T.M. TM +tna TNA +tnbc TNBC +TNTAs TNTA's +tn TN +T. N. TN +T.N. TN +T.O.'s TO's +T. O. TO +T.O. TO +tou TOU +Tou TOU +ToU TOU +tPA TPA +tpr TPR +tp TP +T. P. TP +T.P. TP +TPVs TPV's +T.Q. TQ +tra TRA +Tra TRA +Trbic TRBIC +Trcek TRCEK +TrkA TRKA +Trmcic TRMCIC +tRNA TRNA +TRPs TRP's +trs TRS +tr TR +T. R. TR +T.R. TR +truTV TRUTV +TruTV TRUTV +Trve TRVE +Tsa TSA +tsit TSIT +Tsiv TSIV +tso TSO +Tso TSO +tsr TSR +Ts T's +T. S. TS +T.S. TS +tsus TSUS +Tsvi TSVI +Tta TTA +tteok TTEOK +tte TTE +ttp TTP +T&T T and T +T. T. TT +T.T. TT +T'uqu TUQU +T.U. TU +Tuzk TUZK +tvaan TVAAN +Tvam TVAM +tva TVA +TVETs TVET's +TVii TVII +TVIn TVIN +TVi TVI +tvo TVO +Tvo TVO +TVRi TVRI +tvr TVR +TVSpy TVSPY +tvs TVS +TVs TV's +tVTA TVTA +tv TV +T. V. TV +T.V. TV +Twa TWA +Twi TWI +TWTs TWT's +T. W. TW +T.W. TW +TxDOT TXDOT +T.X. TX +tya TYA +Tyk TYK +Tza'ar TZAAR +Tze TZE +Tzrif TZRIF +Tzuh TZUH +Tzvi TZVI +Ua's UA's +UAs UA's +uat UAT +U.A. UA +UAVs UAV's +Uba UBA +UbcM UBCM +Ube UBE +ubi UBI +Ubi UBI +Ucar UCAR +Uca UCA +Ucmak UCMAK +Ucn UCN +uCs UC's +Uc UC +U.C. UC +Ucuncu UCUNCU +Uczta UCZTA +Uda UDA +Udit UDIT +Udny UDNY +UDTs UDT's +ud UD +Ud UD +U. D. UD +udu UDU +Udu UDU +Ueda's UEDA's +Uéda UE acute DA +U. E. UE +UFOs UFO's +Ufot UFOT +ufo UFO +Ufo UFO +U. F. UF +Uga UGA +Uge UGE +Ugni UGNI +Ugra UGRA +Ugrszke UGRSZKE +Ug UG +Uhha UHHA +uhn UHN +UHTCs UHTC's +Uhud UHUD +U.H. UH +uhur UHUR +Uiam UIAM +Uibh UIBH +Uible UIBLE +Uig UIG +uisae UISAE +UiS UIS +UiTM UITM +uit UIT +Uit UIT +Uiy UIY +Ujed UJED +Ujsag UJSAG +uj UJ +U.J. UJ +Uka UKA +Ukhra UKHRA +Ukic UKIC +Uki UKI +Ukoh UKOH +Uko UKO +ukr UKR +Ukr UKR +Ukui UKUI +u'k UK +uk UK +Uk UK +U.K. UK +Ukwu UKWU +Ulic ULIC +Ull ULL +Ulms ULM's +UlSU ULSU +Uluj ULUJ +U.L. UL +ulus ULUS +Ulus ULU's +Ulwa ULWA +Ulwe ULWE +Umbr UMBR +umelcu UMELCU +UMe UME +Umla UMLA +Umme UMME +Umno UMNO +Umri UMRI +U. M. UM +U.M. UM +Unli UNLI +Unlu UNLU +unm UNM +unnd UNND +UNSh UNSH +Unst UNST +Uns UN's +U.N.'s UN's +Unt UNT +U.N. UN +Unz UNZ +UOCl UOCL +UofM UOFM +Uoho UOHO +UoMs UOM's +uORF UORF +UoW UOW +UPBs UPB's +Upd UPD +Upf UPF +Upir UPIR +UPnP UPNP +Uppu UPPU +U.P. UP +UPyD UPYD +uq UQ +Urbz URBZ +URCs URC's +Urdd URDD +Urei UREI +urf URF +Urla URLA +URLhttp URLHTTP +URLs URL's +Usal USAL +usan USAN +Usan USAN +usao USAO +usata USATA +usa USA +.USA USA +USAya USAYA +USBs USB's +Uscie USCIE +U.S.C.'s USC's +USDoE USDOE +usd USD +USFbA USFBA +USF&WS USF and WS +UShs USH's +Usia USIA +usih USIH +Uslu USLU +Usmar USMAR +Usna USNA +Usnic USNIC +Usoi USOI +Usos USO's +Uso USO +USPs USP's +U.S.'s US's +Usti USTI +Ustka USTKA +Usui USUI +usum USUM +U. S. US +U.S. US +Usut USUT +Usvit USVIT +Uta's UTA's +uta UTA +Uta UTA +Utca UTCA +Utd's UTD's +Utd UTD +utea UTEA +Utes UTE's +Uth UTH +uti UTI +Uti UTI +Utne UTNE +Utnur UTNUR +Uto UTO +utrci UTRCI +utsav UTSAV +Utsav UTSAV +Utsu UTSU +U.T. UT +Utu UTU +Utva UTVA +Uuh UUH +Uul UUL +Uulu UULU +Uusi UUSI +UUs UU's +Uuto UUTO +Uvac UVAC +Uvea UVEA +uvnitr UVNITR +Uvo UVO +U.V. UV +Uwasa UWASA +UWFi UWFI +V. A. VA +V.A. VA +V&A V and A +Vav VAV +Vay VAY +vb VB +V. B. VB +V.B. VB +VCDs VCD's +VCRs VCR's +VCSELs VCSEL's +VCs VC's +VCTs VCT's +vc VC +V. C. VC +V.C. VC +vda VDA +Vda VDA +VDCs VDC's +vdiq VDIQ +vdm VDM +V. D. VD +V.D. VD +vez VEZ +Vez VEZ +vfp VFP +vfr VFR +V. F. VF +V.F. VF +V'Ger VGER +vgmdb VGMDB +VGo VGO +VGSCs VGSC's +VGSoM VGSOM +V. G. VG +V.G. VG +V. H. VH +V.I.C.'s VIC's +Vict VICT +viita VIITA +vijf VIJF +vij VIJ +Vij VIJ +V.I.P.s VIP's +VIPs VIP's +V. I. VI +V.I. VI +VJs VJ's +V. J. VJ +V.J. VJ +V. K. VK +V.K. VK +Vlah VLAH +VLCCs VLCC's +vlei VLEI +Vlijt VLIJT +V. L. VL +V.L. VL +VMAs VMA's +vm VM +V. M. VM +V.M. VM +vner VNER +V. N. VN +V.N. VN +V.O. VO +Vov VOV +Voz VOZ +vpis VPIS +VPNs VPN's +vpu VPU +V. P. VP +V.P. VP +vq VQ +vrak VRAK +Vrba VRBA +Vrbuv VRBUV +Vrej VREJ +vrem VREM +Vrin VRIN +vrj VRJ +vrn VRN +vroee VROEE +vrou VROU +vrouw VROUW +Vrouw VROUW +Vrsac VRSAC +Vrtis VRTI's +V&R V and R +vr VR +V. R. VR +V.R. VR +VSANs VSAN's +VSATs VSAT's +Vsekh VSEKH +vse VSE +vso VSO +VSPs VSP's +vs. versus +_vs._ versus +vsyo VSYO +VTE VT eL +Vtic VTIC +VTi VTI +V&T's V and T's +V&T V and T +V.T. VT +Vuur VUUR +VVIPs VVIP's +V. V. VV +V.V. VV +VWs VW's +Vyg VYG +vyr VYR +vy VY +vz VZ +V. Z. VZ +Waay WAAY +Wa'il WAIL +Wakf WAKF +wa'l WAL +waqf WAQF +waqt WAQT +Waqt WAQT +Wasl WASL +Watfa WATFA +wau WAU +Wau WAU +W. A. WA +W.A. WA +waw WAW +waza WAZA +Waza WAZA +WBs WB's +W. B. WB +W.B. WB +W&CBR W and CBR +wc WC +W. C. WC +W.C. WC +W. D. WD +W.D. WD +W. E. WE +W.E. WE +WF&NW WF and NW +W&F W and F +W. F. WF +W.F. WF +wga WGA +wgn WGN +wg WG +W. G. WG +W.G. WG +W&H W and H +W. H. WH +W.H. WH +Whyld WHYLD +Wica WICA +wici WICI +Wif WIF +Wijk WIJK +Wiwa WIWA +W. I. WI +wjaz WJAZ +W&J's W and J's +W&J W and J +W. J. WJ +W.J. WJ +W. K. WK +W.K. WK +W&LE W and LE +Wley WLEY +wlrs WLRS +W. L. WL +W.L. WL +wml WML +W&M W and M +W. M. WM +W.M. WM +W. N. WN +W.N. WN +wnzaa WNZAA +W&OD W and OD +Worh WORH +W. O. WO +W.O. WO +wpt WPT +wp WP +W. P. WP +W.P. WP +Wrec WREC +W. R. WR +W.R. WR +ws WS +W. S. WS +W.S. WS +WTs WT's +WTTs WTT's +W. T. WT +W.T. WT +WUAs WUA's +Wudl WUDL +Wuhr WUHR +Wuhu WUHU +Wu's WU's +wuv WUV +W. U. WU +Wuz WUZ +WVa WVA +W. V. WV +W.V. WV +Wwe WWE +W. W. WW +W.W. WW +wx WX +W.Y. WY +wyzc WYZC +W. Z. WZ +xbg XBG +Xbra XBRA +xCo XCO +X. C. XC +xda XDA +XDRs XDR's +X. D. XD +Xfce XFCE +xf XF +X.F. XF +xh XH +X. H. XH +xk XK +xmc XMC +xml XML +X.M. XM +xO XO +X.O. XO +XPe XPE +X.Q. XQ +XSi XSI +xsr XSR +XTwas XTWA's +xt XT +X. W. XW +xy XY +xyz XYZ +xyZ XYZ +Y. A. YA +Y.A. YA +Y. B. YB +Y.B. YB +ycia YCIA +ycie YCIE +yc YC +Y. C. YC +Y.C. YC +Ydby YDBY +Yde YDE +YdiB YDIB +yd YD +Y. D. YD +Y.D. YD +Y.E. YE +YFCs YFC's +yfle YFLE +YF&R YF and R +yg YG +Y. G. YG +Y.G. YG +Y. H. YH +Y. I. YI +Y.I. YI +yj YJ +Y. J. YJ +Ykt YKT +Y. K. YK +Y.K. YK +Yle YLE +yl YL +Y. L. YL +Ymke YMKE +ym YM +Y. M. YM +yndi YNDI +Yndi YNDI +yne YNE +Yngve YNGVE +Ynis YNI's +yn YN +Yn YN +Y. N. YN +Y.N. YN +Y.O. YO +ypa YPA +Y.P. YP +Y. Q. YQ +yra YRA +Yra YRA +Y&R Y and R +YSK'da YSKDA +YSK'ya YSKYA +Ys Y's +Y.S. YS +yta YTA +Ytre YTRE +Y&T Y and T +Y. T. YT +Y.T. YT +Y. V. YV +Y. W. YW +Y.Y. YY +Z. A. ZA +Z.A. ZA +Zdar ZDAR +zda ZDA +zg ZG +Z.G. ZG +zh ZH +Z. H. ZH +Z.H. ZH +zijn ZIJN +zij ZIJ +Zij ZIJ +Z. I. ZI +Z. J. ZJ +Z.K. ZK +Z.L. ZL +Z.M. ZM +ZnO ZNO +Zpav ZPAV +Z.P. ZP +ZrI ZRI +Zsuzsa ZSUZSA +Z.W. ZW +Z.X. ZX +Z. Y. ZY +Z.Y. ZY +Z. Z. ZZ +Z.Z. ZZ +2.5G two point five g +7-eleven seven eleven +AAA triple a +C# c sharp +DeepMind deep mind +DeepStream deep stream +DevOps dev ops +DisplayPort display port +HuggingFace hugging face +ServiceNow service now +SuperCloud super cloud +Wi-Fi wifi +7-Eleven seven eleven +Deepmind deep mind +Deepstream deep stream +Devops dev ops +Displayport display port +Huggingface hugging face +Servicenow service now +Supercloud super cloud +wi-fi wifi +deepmind deep mind +deepstream deep stream +devops dev ops +displayport display port +huggingface hugging face +servicenow service now +supercloud super cloud +wi-fi wifi +3-D three d +401k four oh one k +401(k) four oh one k +401 (k) four oh one k \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/graph_utils.py b/zonos3/vendor/nemo_text_processing/text_normalization/en/graph_utils.py new file mode 100644 index 0000000000000000000000000000000000000000..417668871351df66f256035a8289219184036f0e --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/graph_utils.py @@ -0,0 +1,337 @@ +# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. +# Copyright 2015 and onwards Google, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import os +import string +from pathlib import Path +from typing import Dict + +import pynini +from pynini import Far +from pynini.examples import plurals +from pynini.export import export +from pynini.lib import byte, pynutil, utf8 + +from zonos3.vendor.nemo_text_processing.text_normalization.en.utils import get_abs_path, load_labels +from zonos3.vendor.nemo_text_processing.utils.logging import logger + +NEMO_CHAR = utf8.VALID_UTF8_CHAR + +NEMO_DIGIT = byte.DIGIT +NEMO_LOWER = pynini.union(*string.ascii_lowercase).optimize() +NEMO_UPPER = pynini.union(*string.ascii_uppercase).optimize() +NEMO_ALPHA = pynini.union(NEMO_LOWER, NEMO_UPPER).optimize() +NEMO_ALNUM = pynini.union(NEMO_DIGIT, NEMO_ALPHA).optimize() +NEMO_HEX = pynini.union(*string.hexdigits).optimize() +NEMO_NON_BREAKING_SPACE = "\u00a0" +NEMO_SPACE = " " +NEMO_WHITE_SPACE = pynini.union(" ", "\t", "\n", "\r", "\u00a0").optimize() +NEMO_NOT_SPACE = pynini.difference(NEMO_CHAR, NEMO_WHITE_SPACE).optimize() +NEMO_NOT_QUOTE = pynini.difference(NEMO_CHAR, r'"').optimize() + +NEMO_PUNCT = pynini.union(*map(pynini.escape, string.punctuation)).optimize() +NEMO_GRAPH = pynini.union(NEMO_ALNUM, NEMO_PUNCT).optimize() + +NEMO_SIGMA = pynini.closure(NEMO_CHAR) +NEMO_LOWER_NOT_A = pynini.union( + "b", + "c", + "d", + "e", + "f", + "g", + "h", + "i", + "j", + "k", + "l", + "m", + "n", + "o", + "p", + "q", + "r", + "s", + "t", + "u", + "v", + "w", + "x", + "y", + "z", +).optimize() + +delete_space = pynutil.delete(pynini.closure(NEMO_WHITE_SPACE)) +delete_zero_or_one_space = pynutil.delete(pynini.closure(NEMO_WHITE_SPACE, 0, 1)) +insert_space = pynutil.insert(" ") +delete_extra_space = pynini.cross(pynini.closure(NEMO_WHITE_SPACE, 1), " ") +delete_preserve_order = pynini.closure( + pynutil.delete(" preserve_order: true") + | (pynutil.delete(' field_order: "') + NEMO_NOT_QUOTE + pynutil.delete('"')) +) + + +# Common string literals; expand as you see fit. +username_string = "username" +double_quotes = '"' +domain_string = "domain" +protocol_string = "protocol" +slash = "/" +double_slash = "//" +triple_slash = "///" +file = "file" +period = "." +at = "@" +colon = ":" +https = "https" +http = "http" +www = "www" + + +suppletive = pynini.string_file(get_abs_path("data/suppletive.tsv")) +# _v = pynini.union("a", "e", "i", "o", "u") +_c = pynini.union( + "b", + "c", + "d", + "f", + "g", + "h", + "j", + "k", + "l", + "m", + "n", + "p", + "q", + "r", + "s", + "t", + "v", + "w", + "x", + "y", + "z", +) +_ies = NEMO_SIGMA + _c + pynini.cross("y", "ies") +_es = NEMO_SIGMA + pynini.union("s", "sh", "ch", "x", "z") + pynutil.insert("es") +_s = NEMO_SIGMA + pynutil.insert("s") + +graph_plural = plurals._priority_union( + suppletive, + plurals._priority_union(_ies, plurals._priority_union(_es, _s, NEMO_SIGMA), NEMO_SIGMA), + NEMO_SIGMA, +).optimize() + +SINGULAR_TO_PLURAL = graph_plural +PLURAL_TO_SINGULAR = pynini.invert(graph_plural) +TO_LOWER = pynini.union(*[pynini.cross(x, y) for x, y in zip(string.ascii_uppercase, string.ascii_lowercase)]) +TO_UPPER = pynini.invert(TO_LOWER) +MIN_NEG_WEIGHT = -0.0001 +MIN_POS_WEIGHT = 0.0001 +INPUT_CASED = "cased" +INPUT_LOWER_CASED = "lower_cased" +MINUS = pynini.union("minus", "Minus").optimize() + + +def capitalized_input_graph( + graph: "pynini.FstLike", + original_graph_weight: float = None, + capitalized_graph_weight: float = None, +) -> "pynini.FstLike": + """ + Allow graph input to be capitalized, e.g. for ITN) + + Args: + graph: FstGraph + original_graph_weight: weight to add to the original `graph` + capitalized_graph_weight: weight to add to the capitalized graph + """ + capitalized_graph = pynini.compose(TO_LOWER + NEMO_SIGMA, graph).optimize() + + if original_graph_weight is not None: + graph = pynutil.add_weight(graph, weight=original_graph_weight) + + if capitalized_graph_weight is not None: + capitalized_graph = pynutil.add_weight(capitalized_graph, weight=capitalized_graph_weight) + + graph |= capitalized_graph + return graph + + +def generator_main(file_name: str, graphs: Dict[str, "pynini.FstLike"]): + """ + Exports graph as OpenFst finite state archive (FAR) file with given file name and rule name. + + Args: + file_name: exported file name + graphs: Mapping of a rule name and Pynini WFST graph to be exported + """ + exporter = export.Exporter(file_name) + for rule, graph in graphs.items(): + exporter[rule] = graph.optimize() + exporter.close() + logger.info(f"Created {file_name}") + + +def get_plurals(fst): + """ + Given singular returns plurals + + Args: + fst: Fst + + Returns plurals to given singular forms + """ + return SINGULAR_TO_PLURAL @ fst + + +def get_singulars(fst): + """ + Given plural returns singulars + + Args: + fst: Fst + + Returns singulars to given plural forms + """ + return PLURAL_TO_SINGULAR @ fst + + +def convert_space(fst) -> "pynini.FstLike": + """ + Converts space to nonbreaking space. + Used only in tagger grammars for transducing token values within quotes, e.g. name: "hello kitty" + This is making transducer significantly slower, so only use when there could be potential spaces within quotes, otherwise leave it. + + Args: + fst: input fst + + Returns output fst where breaking spaces are converted to non breaking spaces + """ + return fst @ pynini.cdrewrite(pynini.cross(NEMO_SPACE, NEMO_NON_BREAKING_SPACE), "", "", NEMO_SIGMA) + + +def string_map_cased(input_file: str, input_case: str = INPUT_LOWER_CASED): + labels = load_labels(input_file) + + if input_case == INPUT_CASED: + additional_labels = [] + for written, spoken, *weight in labels: + written_capitalized = written[0].upper() + written[1:] + additional_labels.extend( + [ + [ + written_capitalized, + spoken.capitalize(), + ], # first letter capitalized + [ + written_capitalized, + spoken.upper().replace(" AND ", " and "), + ], # # add pairs with the all letters capitalized + ] + ) + + spoken_no_space = spoken.replace(" ", "") + # add abbreviations without spaces (both lower and upper case), i.e. "BMW" not "B M W" + if len(spoken) == (2 * len(spoken_no_space) - 1): + logger.debug(f"This is weight {weight}") + if len(weight) == 0: + additional_labels.extend( + [ + [written, spoken_no_space], + [written_capitalized, spoken_no_space.upper()], + ] + ) + else: + additional_labels.extend( + [ + [written, spoken_no_space, weight[0]], + [written_capitalized, spoken_no_space.upper(), weight[0]], + ] + ) + labels += additional_labels + + whitelist = pynini.string_map(labels).invert().optimize() + return whitelist + + +class GraphFst: + """ + Base class for all grammar fsts. + + Args: + name: name of grammar class + kind: either 'classify' or 'verbalize' + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, name: str, kind: str, deterministic: bool = True): + self.name = name + self.kind = kind + self._fst = None + self.deterministic = deterministic + + self.far_path = Path(os.path.dirname(__file__) + "/grammars/" + kind + "/" + name + ".far") + if self.far_exist(): + self._fst = Far(self.far_path, mode="r", arc_type="standard", far_type="default").get_fst() + + def far_exist(self) -> bool: + """ + Returns true if FAR can be loaded + """ + return self.far_path.exists() + + @property + def fst(self) -> "pynini.FstLike": + return self._fst + + @fst.setter + def fst(self, fst): + self._fst = fst + + def add_tokens(self, fst) -> "pynini.FstLike": + """ + Wraps class name around to given fst + + Args: + fst: input fst + + Returns: + Fst: fst + """ + return pynutil.insert(f"{self.name} {{ ") + fst + pynutil.insert(" }") + + def delete_tokens(self, fst) -> "pynini.FstLike": + """ + Deletes class name wrap around output of given fst + + Args: + fst: input fst + + Returns: + Fst: fst + """ + res = ( + pynutil.delete(f"{self.name}") + + delete_space + + pynutil.delete("{") + + delete_space + + fst + + delete_space + + pynutil.delete("}") + ) + return res @ pynini.cdrewrite(pynini.cross("\u00a0", " "), "", "", NEMO_SIGMA) diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/taggers/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/en/taggers/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..bc443be41c4c3fcf0764eb9fd3e1828d63f8438c --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/taggers/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/taggers/abbreviation.py b/zonos3/vendor/nemo_text_processing/text_normalization/en/taggers/abbreviation.py new file mode 100644 index 0000000000000000000000000000000000000000..da48195fc8b98bc683b0026721207357b6503e57 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/taggers/abbreviation.py @@ -0,0 +1,51 @@ +# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import NEMO_UPPER, GraphFst, insert_space + + +class AbbreviationFst(GraphFst): + """ + Finite state transducer for classifying electronic: as URLs, email addresses, etc. + e.g. "ABC" -> tokens { abbreviation { value: "A B C" } } + + Args: + whitelist: whitelist FST + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, whitelist: 'pynini.FstLike', deterministic: bool = True): + super().__init__(name="abbreviation", kind="classify", deterministic=deterministic) + + dot = pynini.accep(".") + # A.B.C. -> A. B. C. + graph = NEMO_UPPER + dot + pynini.closure(insert_space + NEMO_UPPER + dot, 1) + # A.B.C. -> A.B.C. + graph |= NEMO_UPPER + dot + pynini.closure(NEMO_UPPER + dot, 1) + # ABC -> A B C + graph |= NEMO_UPPER + pynini.closure(insert_space + NEMO_UPPER, 1) + + # exclude words that are included in the whitelist + graph = pynini.compose( + pynini.difference(pynini.project(graph, "input"), pynini.project(whitelist.graph, "input")), graph + ) + + graph = pynutil.insert("value: \"") + graph.optimize() + pynutil.insert("\"") + graph = self.add_tokens(graph) + self.fst = graph.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/taggers/cardinal.py b/zonos3/vendor/nemo_text_processing/text_normalization/en/taggers/cardinal.py new file mode 100644 index 0000000000000000000000000000000000000000..88ee94b3e2fd04f8b943c41f134b039952e61bbf --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/taggers/cardinal.py @@ -0,0 +1,151 @@ +# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import pynini +from pynini.examples import plurals +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import ( + NEMO_DIGIT, + NEMO_NOT_QUOTE, + NEMO_SIGMA, + GraphFst, + insert_space, +) +from zonos3.vendor.nemo_text_processing.text_normalization.en.taggers.date import get_four_digit_year_graph +from zonos3.vendor.nemo_text_processing.text_normalization.en.utils import get_abs_path + + +class CardinalFst(GraphFst): + """ + Finite state transducer for classifying cardinals, e.g. + -23 -> cardinal { negative: "true" integer: "twenty three" } } + + Args: + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, deterministic: bool = True, lm: bool = False): + super().__init__(name="cardinal", kind="classify", deterministic=deterministic) + + self.lm = lm + self.deterministic = deterministic + # TODO replace to have "oh" as a default for "0" + graph = pynini.Far(get_abs_path("data/number/cardinal_number_name.far")).get_fst() + graph_au = pynini.Far(get_abs_path("data/number/cardinal_number_name_au.far")).get_fst() + self.graph_hundred_component_at_least_one_none_zero_digit = ( + pynini.closure(NEMO_DIGIT, 2, 3) | pynini.difference(NEMO_DIGIT, pynini.accep("0")) + ) @ graph + + graph_digit = pynini.string_file(get_abs_path("data/number/digit.tsv")) + graph_zero = pynini.string_file(get_abs_path("data/number/zero.tsv")) + + single_digits_graph = pynini.invert(graph_digit | graph_zero) + self.single_digits_graph = single_digits_graph + pynini.closure(insert_space + single_digits_graph) + + if not deterministic: + # for a single token allow only the same normalization + # "007" -> {"oh oh seven", "zero zero seven"} not {"oh zero seven"} + single_digits_graph_zero = pynini.invert(graph_digit | graph_zero) + single_digits_graph_oh = pynini.invert(graph_digit) | pynini.cross("0", "oh") + + self.single_digits_graph = single_digits_graph_zero + pynini.closure( + insert_space + single_digits_graph_zero + ) + self.single_digits_graph |= single_digits_graph_oh + pynini.closure(insert_space + single_digits_graph_oh) + + single_digits_graph_with_commas = pynini.closure( + self.single_digits_graph + insert_space, 1, 3 + ) + pynini.closure( + pynutil.delete(",") + + single_digits_graph + + insert_space + + single_digits_graph + + insert_space + + single_digits_graph, + 1, + ) + + optional_minus_graph = pynini.closure(pynutil.insert("negative: ") + pynini.cross("-", "\"true\" "), 0, 1) + + graph = ( + pynini.closure(NEMO_DIGIT, 1, 3) + + (pynini.closure(pynutil.delete(",") + NEMO_DIGIT**3) | pynini.closure(NEMO_DIGIT**3)) + ) @ graph + + self.graph = graph + self.graph_with_and = self.add_optional_and(graph) + + if deterministic: + long_numbers = pynini.compose(NEMO_DIGIT ** (5, ...), self.single_digits_graph).optimize() + self.long_numbers = plurals._priority_union(long_numbers, self.graph_with_and, NEMO_SIGMA).optimize() + cardinal_with_leading_zeros = pynini.compose( + pynini.accep("0") + pynini.closure(NEMO_DIGIT), self.single_digits_graph + ) + final_graph = self.long_numbers | cardinal_with_leading_zeros + final_graph |= self.add_optional_and(graph_au) + else: + leading_zeros = pynini.compose(pynini.closure(pynini.accep("0"), 1), self.single_digits_graph) + cardinal_with_leading_zeros = ( + leading_zeros + pynutil.insert(" ") + pynini.compose(pynini.closure(NEMO_DIGIT), self.graph_with_and) + ) + self.long_numbers = self.graph_with_and | pynutil.add_weight(self.single_digits_graph, 0.0001) + # add small weight to non-default graphs to make sure the deterministic option is listed first + final_graph = ( + self.long_numbers + | get_four_digit_year_graph() # allows e.g. 4567 be pronounced as forty five sixty seven + | pynutil.add_weight(single_digits_graph_with_commas, 0.0001) + | cardinal_with_leading_zeros + ).optimize() + + one_to_a_replacement_graph = ( + pynini.cross("one hundred", "a hundred") + | pynini.cross("one thousand", "thousand") + | pynini.cross("one million", "a million") + ) + final_graph |= pynini.compose(final_graph, one_to_a_replacement_graph.optimize() + NEMO_SIGMA).optimize() + # remove commas for 4 digits numbers + four_digit_comma_graph = (NEMO_DIGIT - "0") + pynutil.delete(",") + NEMO_DIGIT**3 + final_graph |= pynini.compose(four_digit_comma_graph.optimize(), final_graph).optimize() + + self.final_graph = final_graph + final_graph = optional_minus_graph + pynutil.insert("integer: \"") + final_graph + pynutil.insert("\"") + final_graph = self.add_tokens(final_graph) + self.fst = final_graph.optimize() + + def add_optional_and(self, graph): + graph_with_and = graph + + if not self.lm: + graph_with_and = pynutil.add_weight(graph, 0.00001) + not_quote = pynini.closure(NEMO_NOT_QUOTE) + no_thousand_million = pynini.difference( + not_quote, not_quote + pynini.union("thousand", "million") + not_quote + ).optimize() + integer = ( + not_quote + pynutil.add_weight(pynini.cross("hundred ", "hundred and ") + no_thousand_million, -0.0001) + ).optimize() + + no_hundred = pynini.difference(NEMO_SIGMA, not_quote + pynini.accep("hundred") + not_quote).optimize() + integer |= ( + not_quote + pynutil.add_weight(pynini.cross("thousand ", "thousand and ") + no_hundred, -0.0001) + ).optimize() + + optional_hundred = pynini.compose((NEMO_DIGIT - "0") ** 3, graph).optimize() + optional_hundred = pynini.compose(optional_hundred, NEMO_SIGMA + pynini.cross(" hundred", "") + NEMO_SIGMA) + graph_with_and |= pynini.compose(graph, integer).optimize() + graph_with_and |= optional_hundred + return graph_with_and diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/taggers/date.py b/zonos3/vendor/nemo_text_processing/text_normalization/en/taggers/date.py new file mode 100644 index 0000000000000000000000000000000000000000..6177ed5a93738e0afeab9a80eeb723102272fa58 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/taggers/date.py @@ -0,0 +1,386 @@ +# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.examples import plurals +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import ( + NEMO_CHAR, + NEMO_DIGIT, + NEMO_LOWER, + NEMO_SIGMA, + TO_LOWER, + GraphFst, + delete_extra_space, + delete_space, + insert_space, +) +from zonos3.vendor.nemo_text_processing.text_normalization.en.utils import ( + augment_labels_with_punct_at_end, + get_abs_path, + load_labels, +) + +graph_teen = pynini.invert(pynini.string_file(get_abs_path("data/number/teen.tsv"))).optimize() +graph_digit = pynini.invert(pynini.string_file(get_abs_path("data/number/digit.tsv"))).optimize() +ties_graph = pynini.invert(pynini.string_file(get_abs_path("data/number/ty.tsv"))).optimize() +year_suffix = load_labels(get_abs_path("data/date/year_suffix.tsv")) +year_suffix.extend(augment_labels_with_punct_at_end(year_suffix)) +year_suffix = pynini.string_map(year_suffix).optimize() + + +def get_ties_graph(deterministic: bool = True): + """ + Returns two digit transducer, e.g. + 03 -> o three + 12 -> thirteen + 20 -> twenty + """ + graph = graph_teen | ties_graph + pynutil.delete("0") | ties_graph + insert_space + graph_digit + + if deterministic: + graph = graph | pynini.cross("0", "oh") + insert_space + graph_digit + else: + graph = graph | (pynini.cross("0", "oh") | pynini.cross("0", "zero")) + insert_space + graph_digit + + return graph.optimize() + + +def get_four_digit_year_graph(deterministic: bool = True): + """ + Returns a four digit transducer which is combination of ties/teen or digits + (using hundred instead of thousand format), e.g. + 1219 -> twelve nineteen + 3900 -> thirty nine hundred + """ + graph_ties = get_ties_graph(deterministic) + + graph_with_s = ( + (graph_ties + insert_space + graph_ties) + | (graph_teen + insert_space + (ties_graph | pynini.cross("1", "ten"))) + ) + pynutil.delete("0s") + + graph_with_s |= (graph_teen | graph_ties) + insert_space + pynini.cross("00", "hundred") + pynutil.delete("s") + graph_with_s = graph_with_s @ pynini.cdrewrite( + pynini.cross("y", "ies") | pynutil.insert("s"), "", "[EOS]", NEMO_SIGMA + ) + + graph = graph_ties + insert_space + graph_ties + graph |= (graph_teen | graph_ties) + insert_space + pynini.cross("00", "hundred") + + thousand_graph = ( + graph_digit + + insert_space + + pynini.cross("00", "thousand") + + (pynutil.delete("0") | insert_space + graph_digit) + ) + thousand_graph |= ( + graph_digit + + insert_space + + pynini.cross("000", "thousand") + + pynini.closure(pynutil.delete(" "), 0, 1) + + pynini.accep("s") + ) + + graph |= graph_with_s + if deterministic: + graph = plurals._priority_union(thousand_graph, graph, NEMO_SIGMA) + else: + graph |= thousand_graph + + return graph.optimize() + + +def _get_two_digit_year_with_s_graph(): + # to handle '70s -> seventies + graph = ( + pynini.closure(pynutil.delete("'"), 0, 1) + + pynini.compose( + ties_graph + pynutil.delete("0s"), pynini.cdrewrite(pynini.cross("y", "ies"), "", "[EOS]", NEMO_SIGMA) + ) + ).optimize() + return graph + + +def _get_year_graph(cardinal_graph, deterministic: bool = True): + """ + Transducer for year, only from 1000 - 2999 e.g. + 1290 -> twelve nineteen + 2000 - 2009 will be verbalized as two thousand. + + Transducer for 3 digit year, e.g. 123-> one twenty three + + Transducer for year with suffix + 123 A.D., 4200 B.C + """ + graph = get_four_digit_year_graph(deterministic) + graph = (pynini.union("1", "2") + (NEMO_DIGIT**3) + pynini.closure(pynini.cross(" s", "s") | "s", 0, 1)) @ graph + + graph |= _get_two_digit_year_with_s_graph() + + three_digit_year = (NEMO_DIGIT @ cardinal_graph) + insert_space + (NEMO_DIGIT**2) @ cardinal_graph + year_with_suffix = ( + (get_four_digit_year_graph(deterministic=True) | three_digit_year) + delete_space + insert_space + year_suffix + ) + graph |= year_with_suffix + return graph.optimize() + + +def _get_two_digit_year(cardinal_graph, single_digits_graph): + two_digit_year = NEMO_DIGIT ** (2) @ plurals._priority_union(cardinal_graph, single_digits_graph, NEMO_SIGMA) + return two_digit_year + + +def _get_financial_period_graph(): + # 1H23 -> first half of twenty three + # 3Q22 -> third quarter of twenty two + + h_ordinals = pynini.cross('1', 'first') | pynini.cross('2', 'second') + q_ordinals = h_ordinals | pynini.cross('3', 'third') | pynini.cross('4', 'fourth') + + h_graph = h_ordinals + pynini.cross('H', ' half') + q_graph = q_ordinals + pynini.cross('Q', ' quarter') + period_graph = h_graph | q_graph + + return period_graph + + +class DateFst(GraphFst): + """ + Finite state transducer for classifying date, e.g. + jan. 5, 2012 -> date { month: "january" day: "five" year: "twenty twelve" preserve_order: true } + jan. 5 -> date { month: "january" day: "five" preserve_order: true } + 5 january 2012 -> date { day: "five" month: "january" year: "twenty twelve" preserve_order: true } + 2012-01-05 -> date { year: "twenty twelve" month: "january" day: "five" } + 2012.01.05 -> date { year: "twenty twelve" month: "january" day: "five" } + 2012/01/05 -> date { year: "twenty twelve" month: "january" day: "five" } + 2012 -> date { year: "twenty twelve" } + + Args: + cardinal: CardinalFst + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, cardinal: GraphFst, deterministic: bool, lm: bool = False): + super().__init__(name="date", kind="classify", deterministic=deterministic) + + # january + month_graph = pynini.string_file(get_abs_path("data/date/month_name.tsv")).optimize() + # January, JANUARY + month_graph |= pynini.compose(TO_LOWER + pynini.closure(NEMO_CHAR), month_graph) | pynini.compose( + TO_LOWER ** (2, ...), month_graph + ) + + # jan + month_abbr_graph = pynini.string_file(get_abs_path("data/date/month_abbr.tsv")).optimize() + # jan, Jan, JAN + month_abbr_graph = ( + month_abbr_graph + | pynini.compose(TO_LOWER + pynini.closure(NEMO_LOWER, 1), month_abbr_graph).optimize() + | pynini.compose(TO_LOWER ** (2, ...), month_abbr_graph).optimize() + ) + pynini.closure(pynutil.delete("."), 0, 1) + month_graph |= month_abbr_graph.optimize() + + month_numbers_labels = pynini.string_file(get_abs_path("data/date/month_number.tsv")).optimize() + cardinal_graph = cardinal.graph_hundred_component_at_least_one_none_zero_digit + + year_graph = _get_year_graph(cardinal_graph=cardinal_graph, deterministic=deterministic) + + # three_digit_year = (NEMO_DIGIT @ cardinal_graph) + insert_space + (NEMO_DIGIT ** 2) @ cardinal_graph + # year_graph |= three_digit_year + + month_graph = pynutil.insert("month: \"") + month_graph + pynutil.insert("\"") + month_numbers_graph = pynutil.insert("month: \"") + month_numbers_labels + pynutil.insert("\"") + + endings = ["rd", "th", "st", "nd"] + endings += [x.upper() for x in endings] + endings = pynini.union(*endings) + + day_graph = ( + pynutil.insert("day: \"") + + pynini.closure(pynutil.delete("the "), 0, 1) + + ( + ((pynini.union("1", "2") + NEMO_DIGIT) | NEMO_DIGIT | (pynini.accep("3") + pynini.union("0", "1"))) + + pynini.closure(pynutil.delete(endings), 0, 1) + ) + @ cardinal_graph + + pynutil.insert("\"") + ) + + two_digit_year = _get_two_digit_year( + cardinal_graph=cardinal_graph, single_digits_graph=cardinal.single_digits_graph + ) + two_digit_year = pynutil.insert("year: \"") + two_digit_year + pynutil.insert("\"") + + # if lm: + # two_digit_year = pynini.compose(pynini.difference(NEMO_DIGIT, "0") + NEMO_DIGIT ** (3), two_digit_year) + # year_graph = pynini.compose(pynini.difference(NEMO_DIGIT, "0") + NEMO_DIGIT ** (2), year_graph) + # year_graph |= pynini.compose(pynini.difference(NEMO_DIGIT, "0") + NEMO_DIGIT ** (4, ...), year_graph) + + graph_year = pynutil.insert(" year: \"") + pynutil.delete(" ") + year_graph + pynutil.insert("\"") + graph_year |= ( + pynutil.insert(" year: \"") + + pynini.accep(",") + + pynini.closure(pynini.accep(" "), 0, 1) + + year_graph + + pynutil.insert("\"") + ) + optional_graph_year = pynini.closure(graph_year, 0, 1) + + year_graph = pynutil.insert("year: \"") + year_graph + pynutil.insert("\"") + + graph_mdy = month_graph + ( + (delete_extra_space + day_graph) + | (pynini.accep(" ") + day_graph) + | graph_year + | (delete_extra_space + day_graph + graph_year) + ) + + graph_mdy |= ( + month_graph + + pynini.cross("-", " ") + + day_graph + + pynini.closure(((pynini.cross("-", " ") + NEMO_SIGMA) @ graph_year), 0, 1) + ) + + for x in ["-", "/", "."]: + delete_sep = pynutil.delete(x) + graph_mdy |= ( + month_numbers_graph + + delete_sep + + insert_space + + pynini.closure(pynutil.delete("0"), 0, 1) + + day_graph + + delete_sep + + insert_space + + (year_graph | two_digit_year) + ) + + graph_dmy = day_graph + delete_extra_space + month_graph + optional_graph_year + day_ex_month = (NEMO_DIGIT**2 - pynini.project(month_numbers_graph, "input")) @ day_graph + for x in ["-", "/", "."]: + delete_sep = pynutil.delete(x) + graph_dmy |= ( + day_ex_month + + delete_sep + + insert_space + + month_numbers_graph + + delete_sep + + insert_space + + (year_graph | two_digit_year) + ) + + graph_ymd = pynini.accep("") + for x in ["-", "/", "."]: + delete_sep = pynutil.delete(x) + graph_ymd |= ( + (year_graph | two_digit_year) + + delete_sep + + insert_space + + month_numbers_graph + + delete_sep + + insert_space + + pynini.closure(pynutil.delete("0"), 0, 1) + + day_graph + ) + + final_graph = graph_mdy | graph_dmy + + if not deterministic or lm: + final_graph += pynini.closure(pynutil.insert(" preserve_order: true"), 0, 1) + m_sep_d = ( + month_numbers_graph + + pynutil.delete(pynini.union("-", "/")) + + insert_space + + pynini.closure(pynutil.delete("0"), 0, 1) + + day_graph + ) + final_graph |= m_sep_d + else: + final_graph += pynutil.insert(" preserve_order: true") + + period_fy = pynutil.insert("text: \"") + _get_financial_period_graph() + pynutil.insert("\"") + graph_fy = period_fy + insert_space + two_digit_year + + final_graph |= graph_ymd | year_graph | graph_fy + + if not deterministic or lm: + ymd_to_mdy_graph = None + ymd_to_dmy_graph = None + mdy_to_dmy_graph = None + md_to_dm_graph = None + + for month in [x[0] for x in load_labels(get_abs_path("data/date/month_name.tsv"))]: + for day in [x[0] for x in load_labels(get_abs_path("data/date/day.tsv"))]: + ymd_to_mdy_curr = ( + pynutil.insert("month: \"" + month + "\" day: \"" + day + "\" ") + + pynini.accep('year:') + + NEMO_SIGMA + + pynutil.delete(" month: \"" + month + "\" day: \"" + day + "\"") + ) + + # YY-MM-DD -> MM-DD-YY + ymd_to_mdy_curr = pynini.compose(graph_ymd, ymd_to_mdy_curr) + ymd_to_mdy_graph = ( + ymd_to_mdy_curr + if ymd_to_mdy_graph is None + else pynini.union(ymd_to_mdy_curr, ymd_to_mdy_graph) + ) + + ymd_to_dmy_curr = ( + pynutil.insert("day: \"" + day + "\" month: \"" + month + "\" ") + + pynini.accep('year:') + + NEMO_SIGMA + + pynutil.delete(" month: \"" + month + "\" day: \"" + day + "\"") + ) + + # YY-MM-DD -> MM-DD-YY + ymd_to_dmy_curr = pynini.compose(graph_ymd, ymd_to_dmy_curr).optimize() + ymd_to_dmy_graph = ( + ymd_to_dmy_curr + if ymd_to_dmy_graph is None + else pynini.union(ymd_to_dmy_curr, ymd_to_dmy_graph) + ) + + mdy_to_dmy_curr = ( + pynutil.insert("day: \"" + day + "\" month: \"" + month + "\" ") + + pynutil.delete("month: \"" + month + "\" day: \"" + day + "\" ") + + pynini.accep('year:') + + NEMO_SIGMA + ).optimize() + # MM-DD-YY -> verbalize as MM-DD-YY (February fourth 1991) or DD-MM-YY (the fourth of February 1991) + mdy_to_dmy_curr = pynini.compose(graph_mdy, mdy_to_dmy_curr).optimize() + mdy_to_dmy_graph = ( + mdy_to_dmy_curr + if mdy_to_dmy_graph is None + else pynini.union(mdy_to_dmy_curr, mdy_to_dmy_graph).optimize() + ).optimize() + + md_to_dm_curr = pynutil.insert("day: \"" + day + "\" month: \"" + month + "\"") + pynutil.delete( + "month: \"" + month + "\" day: \"" + day + "\"" + ) + md_to_dm_curr = pynini.compose(m_sep_d, md_to_dm_curr).optimize() + + md_to_dm_graph = ( + md_to_dm_curr + if md_to_dm_graph is None + else pynini.union(md_to_dm_curr, md_to_dm_graph).optimize() + ).optimize() + + final_graph |= mdy_to_dmy_graph | md_to_dm_graph | ymd_to_mdy_graph | ymd_to_dmy_graph + + final_graph = self.add_tokens(final_graph) + self.fst = final_graph.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/taggers/decimal.py b/zonos3/vendor/nemo_text_processing/text_normalization/en/taggers/decimal.py new file mode 100644 index 0000000000000000000000000000000000000000..6066bc040e6fb5f0da602e90e826fe04b9110d0c --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/taggers/decimal.py @@ -0,0 +1,130 @@ +# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import NEMO_SIGMA, TO_UPPER, GraphFst, get_abs_path + +delete_space = pynutil.delete(" ") +quantities = pynini.string_file(get_abs_path("data/number/thousand.tsv")) +quantities_abbr = pynini.string_file(get_abs_path("data/number/quantity_abbr.tsv")) +quantities_abbr |= TO_UPPER @ quantities_abbr + + +def get_quantity( + decimal: 'pynini.FstLike', cardinal_up_to_hundred: 'pynini.FstLike', include_abbr: bool +) -> 'pynini.FstLike': + """ + Returns FST that transforms either a cardinal or decimal followed by a quantity into a numeral, + e.g. 1 million -> integer_part: "one" quantity: "million" + e.g. 1.5 million -> integer_part: "one" fractional_part: "five" quantity: "million" + + Args: + decimal: decimal FST + cardinal_up_to_hundred: cardinal FST + """ + quantity_wo_thousand = pynini.project(quantities, "input") - pynini.union("k", "K", "thousand") + if include_abbr: + quantity_wo_thousand |= pynini.project(quantities_abbr, "input") - pynini.union("k", "K", "thousand") + res = ( + pynutil.insert("integer_part: \"") + + cardinal_up_to_hundred + + pynutil.insert("\"") + + pynini.closure(pynutil.delete(" "), 0, 1) + + pynutil.insert(" quantity: \"") + + (quantity_wo_thousand @ (quantities | quantities_abbr)) + + pynutil.insert("\"") + ) + if include_abbr: + quantity = quantities | quantities_abbr + else: + quantity = quantities + res |= ( + decimal + + pynini.closure(pynutil.delete(" "), 0, 1) + + pynutil.insert("quantity: \"") + + quantity + + pynutil.insert("\"") + ) + return res + + +class DecimalFst(GraphFst): + """ + Finite state transducer for classifying decimal, e.g. + -12.5006 billion -> decimal { negative: "true" integer_part: "12" fractional_part: "five o o six" quantity: "billion" } + 1 billion -> decimal { integer_part: "one" quantity: "billion" } + + cardinal: CardinalFst + """ + + def __init__(self, cardinal: GraphFst, deterministic: bool): + super().__init__(name="decimal", kind="classify", deterministic=deterministic) + + cardinal_graph = cardinal.graph_with_and + cardinal_graph_hundred_component_at_least_one_none_zero_digit = ( + cardinal.graph_hundred_component_at_least_one_none_zero_digit + ) + + self.graph = cardinal.single_digits_graph.optimize() + + if not deterministic: + self.graph = self.graph | cardinal_graph + + point = pynutil.delete(".") + optional_graph_negative = pynini.closure(pynutil.insert("negative: ") + pynini.cross("-", "\"true\" "), 0, 1) + + self.graph_fractional = pynutil.insert("fractional_part: \"") + self.graph + pynutil.insert("\"") + self.graph_integer = pynutil.insert("integer_part: \"") + cardinal_graph + pynutil.insert("\"") + final_graph_wo_sign = ( + pynini.closure(self.graph_integer + pynutil.insert(" "), 0, 1) + + point + + pynutil.insert(" ") + + self.graph_fractional + ) + + quantity_w_abbr = get_quantity( + final_graph_wo_sign, cardinal_graph_hundred_component_at_least_one_none_zero_digit, include_abbr=True + ) + quantity_wo_abbr = get_quantity( + final_graph_wo_sign, cardinal_graph_hundred_component_at_least_one_none_zero_digit, include_abbr=False + ) + self.final_graph_wo_negative_w_abbr = final_graph_wo_sign | quantity_w_abbr + self.final_graph_wo_negative = final_graph_wo_sign | quantity_wo_abbr + + # reduce options for non_deterministic and allow either "oh" or "zero", but not combination + if not deterministic: + no_oh_zero = pynini.difference( + NEMO_SIGMA, + (NEMO_SIGMA + "oh" + NEMO_SIGMA + "zero" + NEMO_SIGMA) + | (NEMO_SIGMA + "zero" + NEMO_SIGMA + "oh" + NEMO_SIGMA), + ).optimize() + no_zero_oh = pynini.difference( + NEMO_SIGMA, NEMO_SIGMA + pynini.accep("zero") + NEMO_SIGMA + pynini.accep("oh") + NEMO_SIGMA + ).optimize() + + self.final_graph_wo_negative |= pynini.compose( + self.final_graph_wo_negative, + pynini.cdrewrite( + pynini.cross("integer_part: \"zero\"", "integer_part: \"oh\""), NEMO_SIGMA, NEMO_SIGMA, NEMO_SIGMA + ), + ) + self.final_graph_wo_negative = pynini.compose(self.final_graph_wo_negative, no_oh_zero).optimize() + self.final_graph_wo_negative = pynini.compose(self.final_graph_wo_negative, no_zero_oh).optimize() + + final_graph = optional_graph_negative + self.final_graph_wo_negative + + final_graph = self.add_tokens(final_graph) + self.fst = final_graph.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/taggers/electronic.py b/zonos3/vendor/nemo_text_processing/text_normalization/en/taggers/electronic.py new file mode 100644 index 0000000000000000000000000000000000000000..351becd356946961736e0979f84d9077f0bbb6cd --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/taggers/electronic.py @@ -0,0 +1,179 @@ +# Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import ( # common string literals + MIN_NEG_WEIGHT, + NEMO_ALPHA, + NEMO_DIGIT, + NEMO_NOT_SPACE, + NEMO_SIGMA, + NEMO_UPPER, + TO_UPPER, + GraphFst, + get_abs_path, + insert_space, +) + + +class ElectronicFst(GraphFst): + """ + Finite state transducer for classifying electronic: as URLs, email addresses, etc. + e.g. cdf1@abc.edu -> tokens { electronic { username: "cdf1" domain: "abc.edu" } } + + Args: + cardinal: CardinalFst + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, cardinal: GraphFst, deterministic: bool = True): + super().__init__(name="electronic", kind="classify", deterministic=deterministic) + + if deterministic: + numbers = NEMO_DIGIT + else: + numbers = pynutil.insert(" ") + cardinal.long_numbers + pynutil.insert(" ") + + cc_cues = pynutil.add_weight( + pynini.string_file(get_abs_path("data/electronic/cc_cues.tsv")), + MIN_NEG_WEIGHT, + ) + + cc_cues = pynutil.add_weight( + pynini.string_file(get_abs_path("data/electronic/cc_cues.tsv")), + MIN_NEG_WEIGHT, + ) + + accepted_symbols = pynini.project(pynini.string_file(get_abs_path("data/electronic/symbol.tsv")), "input") + + accepted_common_domains = pynini.project( + pynini.string_file(get_abs_path("data/electronic/domain.tsv")), "input" + ) + + dict_words = pynutil.add_weight( + pynini.string_file(get_abs_path("data/electronic/words.tsv")), + MIN_NEG_WEIGHT, + ) + + dict_words_without_delimiter = dict_words + pynini.closure( + pynutil.add_weight(pynutil.insert(" ") + dict_words, MIN_NEG_WEIGHT), + 1, + ) + dict_words_graph = dict_words_without_delimiter | dict_words + + all_accepted_symbols_start = ( + dict_words_graph | pynini.closure(TO_UPPER) | pynini.closure(NEMO_UPPER) | accepted_symbols + ).optimize() + + all_accepted_symbols_end = ( + dict_words_graph | numbers | pynini.closure(TO_UPPER) | pynini.closure(NEMO_UPPER) | accepted_symbols + ).optimize() + + graph_symbols = pynini.string_file(get_abs_path("data/electronic/symbol.tsv")).optimize() + + username = (NEMO_ALPHA | dict_words_graph) + pynini.closure( + NEMO_ALPHA | numbers | accepted_symbols | dict_words_graph + ) + + username = pynutil.insert('username: "') + username + pynutil.insert('"') + pynini.cross("@", " ") + + domain_graph = all_accepted_symbols_start + pynini.closure( + all_accepted_symbols_end | pynutil.add_weight(accepted_common_domains, MIN_NEG_WEIGHT) + ) + + protocol_symbols = pynini.closure((graph_symbols | pynini.cross(":", "colon")) + pynutil.insert(" ")) + + protocol_start = (pynini.cross("https", "HTTPS ") | pynini.cross("http", "HTTP ")) + ( + pynini.accep("://") @ protocol_symbols + ) + + protocol_file_start = pynini.accep("file") + insert_space + (pynini.accep(":///") @ protocol_symbols) + + protocol_end = pynutil.add_weight(pynini.cross("www", "WWW ") + pynini.accep(".") @ protocol_symbols, -1000) + + protocol = protocol_file_start | protocol_start | protocol_end | (protocol_start + protocol_end) + + domain_graph_with_class_tags = ( + pynutil.insert('domain: "') + + pynini.compose( + NEMO_ALPHA + pynini.closure(NEMO_NOT_SPACE) + (NEMO_ALPHA | NEMO_DIGIT | pynini.accep("/")), + domain_graph, + ).optimize() + + pynutil.insert('"') + ) + + protocol = pynutil.insert('protocol: "') + pynutil.add_weight(protocol, MIN_NEG_WEIGHT) + pynutil.insert('"') + + # email + graph = pynini.compose( + NEMO_SIGMA + pynini.accep("@") + NEMO_SIGMA + pynini.accep(".") + NEMO_SIGMA, + username + domain_graph_with_class_tags, + ) + + full_stop_accep = pynini.accep(".") + dollar_accep = pynini.accep("$") # Include for the correct transduction of the money graph + excluded_symbols = full_stop_accep | dollar_accep | pynini.accep(",") + filtered_symbols = pynini.difference(accepted_symbols, excluded_symbols) + accepted_characters = NEMO_ALPHA | NEMO_DIGIT | filtered_symbols + domain_component = full_stop_accep + pynini.closure(accepted_characters, 2) + graph_domain = pynutil.add_weight( + pynutil.insert('domain: "') + + (pynini.closure(accepted_characters, 1) + pynini.closure(domain_component, 1)) + + pynutil.insert('"'), + 0.1, + ).optimize() + + graph |= pynutil.add_weight(graph_domain, MIN_NEG_WEIGHT) + + # www.abc.com/sdafsdf, or https://www.abc.com/asdfad or www.abc.abc/asdfad + graph |= protocol + pynutil.insert(" ") + domain_graph_with_class_tags + + # recursively handles the "/" in strings like: + # update/upgrade -> update slash upgrade + # update/upgrade/downgrade -> update slash upgrade slash downgrade + + slash_string = ( + pynini.accep(" ").ques + pynini.accep("/") + pynini.accep(" ").ques + pynini.closure(NEMO_ALPHA, 1) + ) + + graph |= ( + pynutil.insert('domain: "') + + (pynini.closure(NEMO_ALPHA, 1) - "and") + + pynini.closure(slash_string, 1) + + pynutil.insert('"') + ).optimize() + + if deterministic: + # credit card cues + numbers = pynini.closure(NEMO_DIGIT, 4, 16) + cc_phrases = ( + pynutil.insert('protocol: "') + cc_cues + pynutil.insert('" domain: "') + numbers + pynutil.insert('"') + ) + graph |= cc_phrases + + if deterministic: + # credit card cues + numbers = pynini.closure(NEMO_DIGIT, 4, 16) + cc_phrases = ( + pynutil.insert('protocol: "') + cc_cues + pynutil.insert('" domain: "') + numbers + pynutil.insert('"') + ) + graph |= cc_phrases + + final_graph = self.add_tokens(graph) + + self.fst = final_graph.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/taggers/fraction.py b/zonos3/vendor/nemo_text_processing/text_normalization/en/taggers/fraction.py new file mode 100644 index 0000000000000000000000000000000000000000..ca747d5191fcc6d6a8ed95fbd069f66a9bfa67fe --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/taggers/fraction.py @@ -0,0 +1,56 @@ +# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import GraphFst, get_abs_path + + +class FractionFst(GraphFst): + """ + Finite state transducer for classifying fraction + "23 4/5" -> + tokens { fraction { integer: "twenty three" numerator: "four" denominator: "five" } } + "23 4/5th" -> + tokens { fraction { integer: "twenty three" numerator: "four" denominator: "five" } } + + Args: + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, cardinal, deterministic: bool = True): + super().__init__(name="fraction", kind="classify", deterministic=deterministic) + cardinal_graph = cardinal.graph + + integer = pynutil.insert("integer_part: \"") + cardinal_graph + pynutil.insert("\"") + numerator = ( + pynutil.insert("numerator: \"") + cardinal_graph + (pynini.cross("/", "\" ") | pynini.cross(" / ", "\" ")) + ) + + endings = ["rd", "th", "st", "nd"] + endings += [x.upper() for x in endings] + optional_end = pynini.closure(pynini.cross(pynini.union(*endings), ""), 0, 1) + + denominator = pynutil.insert("denominator: \"") + cardinal_graph + optional_end + pynutil.insert("\"") + + graph = pynini.closure(integer + pynini.accep(" "), 0, 1) + (numerator + denominator) + graph |= pynini.closure(integer + (pynini.accep(" ") | pynutil.insert(" ")), 0, 1) + pynini.compose( + pynini.string_file(get_abs_path("data/number/fraction.tsv")), (numerator + denominator) + ) + + self.graph = graph + final_graph = self.add_tokens(self.graph) + self.fst = final_graph.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/taggers/measure.py b/zonos3/vendor/nemo_text_processing/text_normalization/en/taggers/measure.py new file mode 100644 index 0000000000000000000000000000000000000000..b4741c493fc1852ed2a03f1d67b55d522d047672 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/taggers/measure.py @@ -0,0 +1,332 @@ +# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.examples import plurals +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import ( + NEMO_ALPHA, + NEMO_DIGIT, + NEMO_NON_BREAKING_SPACE, + NEMO_SIGMA, + NEMO_SPACE, + NEMO_UPPER, + SINGULAR_TO_PLURAL, + TO_LOWER, + GraphFst, + convert_space, + delete_space, + delete_zero_or_one_space, + insert_space, +) +from zonos3.vendor.nemo_text_processing.text_normalization.en.taggers.ordinal import OrdinalFst as OrdinalTagger +from zonos3.vendor.nemo_text_processing.text_normalization.en.taggers.whitelist import get_formats +from zonos3.vendor.nemo_text_processing.text_normalization.en.utils import get_abs_path, load_labels +from zonos3.vendor.nemo_text_processing.text_normalization.en.verbalizers.ordinal import OrdinalFst as OrdinalVerbalizer + + +class MeasureFst(GraphFst): + """ + Finite state transducer for classifying measure, suppletive aware, e.g. + -12kg -> measure { negative: "true" cardinal { integer: "twelve" } units: "kilograms" } + 1kg -> measure { cardinal { integer: "one" } units: "kilogram" } + .5kg -> measure { decimal { fractional_part: "five" } units: "kilograms" } + + Args: + cardinal: CardinalFst + decimal: DecimalFst + fraction: FractionFst + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__( + self, + cardinal: GraphFst, + decimal: GraphFst, + fraction: GraphFst, + deterministic: bool = True, + ): + super().__init__(name="measure", kind="classify", deterministic=deterministic) + cardinal_graph = cardinal.graph_with_and | self.get_range(cardinal.graph_with_and) + + graph_unit = pynini.string_file(get_abs_path("data/measure/unit.tsv")) + if not deterministic: + graph_unit |= pynini.string_file(get_abs_path("data/measure/unit_alternatives.tsv")) + + graph_unit |= pynini.compose( + pynini.closure(TO_LOWER, 1) + (NEMO_ALPHA | TO_LOWER) + pynini.closure(NEMO_ALPHA | TO_LOWER), + graph_unit, + ).optimize() + + graph_unit_plural = convert_space(graph_unit @ SINGULAR_TO_PLURAL) + graph_unit = convert_space(graph_unit) + + optional_graph_negative = pynini.closure(pynutil.insert("negative: ") + pynini.cross("-", '"true" '), 0, 1) + + graph_unit2 = ( + pynini.cross("/", "per") + delete_zero_or_one_space + pynutil.insert(NEMO_NON_BREAKING_SPACE) + graph_unit + ) + + optional_graph_unit2 = pynini.closure( + delete_zero_or_one_space + pynutil.insert(NEMO_NON_BREAKING_SPACE) + graph_unit2, + 0, + 1, + ) + + unit_plural = ( + pynutil.insert('units: "') + (graph_unit_plural + optional_graph_unit2 | graph_unit2) + pynutil.insert('"') + ) + + unit_singular = ( + pynutil.insert('units: "') + (graph_unit + optional_graph_unit2 | graph_unit2) + pynutil.insert('"') + ) + + subgraph_decimal = ( + pynutil.insert("decimal { ") + + optional_graph_negative + + decimal.final_graph_wo_negative + + delete_space + + pynutil.insert(" } ") + + unit_plural + ) + + # support radio FM/AM + subgraph_decimal |= ( + pynutil.insert("decimal { ") + + decimal.final_graph_wo_negative + + delete_space + + pynutil.insert(" } ") + + pynutil.insert('units: "') + + pynini.union("AM", "FM") + + pynutil.insert('"') + ) + + subgraph_cardinal = ( + pynutil.insert("cardinal { ") + + optional_graph_negative + + pynutil.insert('integer: "') + + ((NEMO_SIGMA - "1") @ cardinal_graph) + + delete_space + + pynutil.insert('"') + + pynutil.insert(" } ") + + unit_plural + ) + + subgraph_cardinal |= ( + pynutil.insert("cardinal { ") + + optional_graph_negative + + pynutil.insert('integer: "') + + pynini.cross("1", "one") + + delete_space + + pynutil.insert('"') + + pynutil.insert(" } ") + + unit_singular + ) + + unit_graph = ( + pynutil.insert('cardinal { integer: "-" } units: "') + + ((pynini.cross("/", "per") + delete_zero_or_one_space) | (pynini.accep("per") + pynutil.delete(" "))) + + pynutil.insert(NEMO_NON_BREAKING_SPACE) + + graph_unit + + pynutil.insert('" preserve_order: true') + ) + + decimal_dash_alpha = ( + pynutil.insert("decimal { ") + + decimal.final_graph_wo_negative + + pynini.cross("-", "") + + pynutil.insert(' } units: "') + + pynini.closure(NEMO_ALPHA, 1) + + pynutil.insert('"') + ) + + decimal_times = ( + pynutil.insert("decimal { ") + + decimal.final_graph_wo_negative + + pynutil.insert(' } units: "') + + (pynini.cross(pynini.union("x", "X"), "x") | pynini.cross(pynini.union("x", "X"), " times")) + + pynutil.insert('"') + ) + + alpha_dash_decimal = ( + pynutil.insert('units: "') + + pynini.closure(NEMO_ALPHA, 1) + + pynini.accep("-") + + pynutil.insert('"') + + pynutil.insert(" decimal { ") + + decimal.final_graph_wo_negative + + pynutil.insert(" } preserve_order: true") + ) + + subgraph_fraction = ( + pynutil.insert("fraction { ") + fraction.graph + delete_space + pynutil.insert(" } ") + unit_plural + ) + + address = self.get_address_graph(cardinal) + address = ( + pynutil.insert('units: "address" cardinal { integer: "') + + address + + pynutil.insert('" } preserve_order: true') + ) + + math_operations = pynini.string_file(get_abs_path("data/measure/math_operation.tsv")) + delimiter = pynini.accep(" ") | pynutil.insert(" ") + + math = ( + (cardinal_graph | NEMO_ALPHA) + + delimiter + + math_operations + + (delimiter | NEMO_ALPHA) + + cardinal_graph + + delimiter + + pynini.cross("=", "equals") + + delimiter + + (cardinal_graph | NEMO_ALPHA) + ) + + math |= ( + (cardinal_graph | NEMO_ALPHA) + + delimiter + + pynini.cross("=", "equals") + + delimiter + + (cardinal_graph | NEMO_ALPHA) + + delimiter + + math_operations + + delimiter + + cardinal_graph + ) + + math = ( + pynutil.insert('units: "math" cardinal { integer: "') + math + pynutil.insert('" } preserve_order: true') + ) + final_graph = ( + subgraph_decimal + | subgraph_cardinal + | unit_graph + | decimal_dash_alpha + | decimal_times + | alpha_dash_decimal + | subgraph_fraction + | address + | math + ) + + final_graph = self.add_tokens(final_graph) + self.fst = final_graph.optimize() + + def get_range(self, cardinal: GraphFst): + """ + Returns range forms for measure tagger, e.g. 2-3, 2x3, 2*2 + + Args: + cardinal: cardinal GraphFst + """ + range_graph = cardinal + pynini.cross(pynini.union("-", " - "), " to ") + cardinal + + for x in [" x ", "x"]: + range_graph |= cardinal + pynini.cross(x, " by ") + cardinal + if not self.deterministic: + range_graph |= cardinal + pynini.cross(x, " times ") + pynini.closure(cardinal, 0, 1) + + for x in ["*", " * "]: + range_graph |= cardinal + pynini.cross(x, " times ") + cardinal + return range_graph.optimize() + + def get_address_graph(self, cardinal): + """ + Finite state transducer for classifying serial. + The serial is a combination of digits, letters and dashes, e.g.: + 2788 San Tomas Expy, Santa Clara, CA 95051 -> + units: "address" cardinal + { integer: "two seven eight eight San Tomas Expressway Santa Clara California nine five zero five one" } + preserve_order: true + """ + ordinal_verbalizer = OrdinalVerbalizer().graph + ordinal_tagger = OrdinalTagger(cardinal=cardinal).graph + ordinal_num = pynini.compose( + pynutil.insert('integer: "') + ordinal_tagger + pynutil.insert('"'), + ordinal_verbalizer, + ) + + address_num = NEMO_DIGIT ** (1, 2) @ cardinal.graph_hundred_component_at_least_one_none_zero_digit + address_num += insert_space + NEMO_DIGIT**2 @ ( + pynini.closure(pynini.cross("0", "zero "), 0, 1) + + cardinal.graph_hundred_component_at_least_one_none_zero_digit + ) + # to handle the rest of the numbers + address_num = pynini.compose(NEMO_DIGIT ** (3, 4), address_num) + address_num = plurals._priority_union(address_num, cardinal.graph, NEMO_SIGMA) + + direction = ( + pynini.cross("E", "East") + | pynini.cross("S", "South") + | pynini.cross("W", "West") + | pynini.cross("N", "North") + ) + pynini.closure(pynutil.delete("."), 0, 1) + + direction = pynini.closure(pynini.accep(NEMO_SPACE) + direction, 0, 1) + address_words = get_formats(get_abs_path("data/address/address_word.tsv")) + address_words = ( + pynini.accep(NEMO_SPACE) + + (pynini.closure(ordinal_num, 0, 1) | NEMO_UPPER + pynini.closure(NEMO_ALPHA, 1)) + + NEMO_SPACE + + pynini.closure(NEMO_UPPER + pynini.closure(NEMO_ALPHA) + NEMO_SPACE) + + address_words + ) + + city = pynini.closure(NEMO_ALPHA | pynini.accep(NEMO_SPACE), 1) + city = pynini.closure(pynini.accep(",") + pynini.accep(NEMO_SPACE) + city, 0, 1) + + states = load_labels(get_abs_path("data/address/state.tsv")) + + additional_options = [] + for x, y in states: + additional_options.append((x, f"{y[0]}.{y[1:]}")) + states.extend(additional_options) + state_graph = pynini.string_map(states) + state = pynini.invert(state_graph) + state = pynini.closure(pynini.accep(",") + pynini.accep(NEMO_SPACE) + state, 0, 1) + + zip_code = pynini.compose(NEMO_DIGIT**5, cardinal.single_digits_graph) + zip_code = pynini.closure( + pynini.closure(pynini.accep(","), 0, 1) + pynini.accep(NEMO_SPACE) + zip_code, + 0, + 1, + ) + + address = address_num + direction + address_words + pynini.closure(city + state + zip_code, 0, 1) + + # Handles sentences ending in terminal period abbreviations, when followed by another sentence + # (e.g. Nancy lived on 1428 Elm St. It was a strange place-> Nancy lived on fourteen twenty eight Elm Street. It was a strange place.) + + hyphen = pynini.accep("-") + alpha_chars = NEMO_ALPHA | hyphen + + address_eos = ( + address_num + + direction + + address_words + + pynini.accep(".") + + pynini.closure(NEMO_SPACE, 1, 2) + + NEMO_UPPER + + pynini.closure(alpha_chars) + ) + + address |= pynutil.add_weight(address_eos, -0.001) + + address |= address_num + direction + address_words + pynini.closure(pynini.cross(".", ""), 0, 1) + + return address diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/taggers/money.py b/zonos3/vendor/nemo_text_processing/text_normalization/en/taggers/money.py new file mode 100644 index 0000000000000000000000000000000000000000..ac4d416d22290e84b201271374da21b70e29c228 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/taggers/money.py @@ -0,0 +1,199 @@ +# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import ( + NEMO_ALPHA, + NEMO_DIGIT, + NEMO_SIGMA, + SINGULAR_TO_PLURAL, + GraphFst, + convert_space, + insert_space, +) +from zonos3.vendor.nemo_text_processing.text_normalization.en.utils import get_abs_path, load_labels + +min_singular = pynini.string_file(get_abs_path("data/money/currency_minor_singular.tsv")) +min_plural = pynini.string_file(get_abs_path("data/money/currency_minor_plural.tsv")) +maj_singular = pynini.string_file((get_abs_path("data/money/currency_major.tsv"))) +per_units = pynini.string_file(get_abs_path("data/money/per_unit.tsv")) + + +class MoneyFst(GraphFst): + """ + Finite state transducer for classifying money, suppletive aware, e.g. + $12.05 -> money { integer_part: "twelve" currency_maj: "dollars" fractional_part: "five" currency_min: "cents" preserve_order: true } + $12.0500 -> money { integer_part: "twelve" currency_maj: "dollars" fractional_part: "five" currency_min: "cents" preserve_order: true } + $1 -> money { currency_maj: "dollar" integer_part: "one" } + $1.00 -> money { currency_maj: "dollar" integer_part: "one" } + $0.05 -> money { fractional_part: "five" currency_min: "cents" preserve_order: true } + $1 million -> money { currency_maj: "dollars" integer_part: "one" quantity: "million" } + $1.2 million -> money { currency_maj: "dollars" integer_part: "one" fractional_part: "two" quantity: "million" } + $1.2320 -> money { currency_maj: "dollars" integer_part: "one" fractional_part: "two three two" } + + Args: + cardinal: CardinalFst + decimal: DecimalFst + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, cardinal: GraphFst, decimal: GraphFst, deterministic: bool = True): + super().__init__(name="money", kind="classify", deterministic=deterministic) + cardinal_graph = cardinal.graph_with_and + graph_decimal_final = decimal.final_graph_wo_negative_w_abbr + + maj_singular_labels = load_labels(get_abs_path("data/money/currency_major.tsv")) + maj_unit_plural = convert_space(maj_singular @ SINGULAR_TO_PLURAL) + maj_unit_singular = convert_space(maj_singular) + + graph_maj_singular = pynutil.insert('currency_maj: "') + maj_unit_singular + pynutil.insert('"') + graph_maj_plural = pynutil.insert('currency_maj: "') + maj_unit_plural + pynutil.insert('"') + + optional_delete_fractional_zeros = pynini.closure( + pynutil.delete(".") + pynini.closure(pynutil.delete("0"), 1), 0, 1 + ) + + graph_integer_one = pynutil.insert('integer_part: "') + pynini.cross("1", "one") + pynutil.insert('"') + # only for decimals where third decimal after comma is non-zero or with quantity + decimal_delete_last_zeros = ( + pynini.closure(NEMO_DIGIT | pynutil.delete(",")) + + pynini.accep(".") + + pynini.closure(NEMO_DIGIT, 2) + + (NEMO_DIGIT - "0") + + pynini.closure(pynutil.delete("0")) + ) + decimal_with_quantity = NEMO_SIGMA + NEMO_ALPHA + + graph_decimal = ( + graph_maj_plural + insert_space + (decimal_delete_last_zeros | decimal_with_quantity) @ graph_decimal_final + ) + + graph_integer = pynutil.insert('integer_part: "') + ((NEMO_SIGMA - "1") @ cardinal_graph) + pynutil.insert('"') + + graph_integer_only = graph_maj_singular + insert_space + graph_integer_one + graph_integer_only |= graph_maj_plural + insert_space + graph_integer + + final_graph = (graph_integer_only + optional_delete_fractional_zeros) | graph_decimal + + # remove trailing zeros of non zero number in the first 2 digits and fill up to 2 digits + # e.g. 2000 -> 20, 0200->02, 01 -> 01, 10 -> 10 + # not accepted: 002, 00, 0, + two_digits_fractional_part = ( + pynini.closure(NEMO_DIGIT) + (NEMO_DIGIT - "0") + pynini.closure(pynutil.delete("0")) + ) @ ( + (pynutil.delete("0") + (NEMO_DIGIT - "0")) + | ((NEMO_DIGIT - "0") + pynutil.insert("0")) + | ((NEMO_DIGIT - "0") + NEMO_DIGIT) + ) + + graph_min_singular = pynutil.insert(' currency_min: "') + min_singular + pynutil.insert('"') + graph_min_plural = pynutil.insert(' currency_min: "') + min_plural + pynutil.insert('"') + # format ** dollars ** cent + decimal_graph_with_minor = None + integer_graph_reordered = None + decimal_default_reordered = None + for curr_symbol, _ in maj_singular_labels: + preserve_order = pynutil.insert(" preserve_order: true") + integer_plus_maj = graph_integer + insert_space + pynutil.insert(curr_symbol) @ graph_maj_plural + integer_plus_maj |= graph_integer_one + insert_space + pynutil.insert(curr_symbol) @ graph_maj_singular + + integer_plus_maj_with_comma = pynini.compose( + NEMO_DIGIT - "0" + pynini.closure(NEMO_DIGIT | pynutil.delete(",")), + integer_plus_maj, + ) + integer_plus_maj = pynini.compose(pynini.closure(NEMO_DIGIT) - "0", integer_plus_maj) + integer_plus_maj |= integer_plus_maj_with_comma + + graph_fractional_one = two_digits_fractional_part @ pynini.cross("1", "one") + graph_fractional_one = pynutil.insert('fractional_part: "') + graph_fractional_one + pynutil.insert('"') + graph_fractional = ( + two_digits_fractional_part + @ (pynini.closure(NEMO_DIGIT, 1, 2) - "1") + @ cardinal.graph_hundred_component_at_least_one_none_zero_digit + ) + graph_fractional = pynutil.insert('fractional_part: "') + graph_fractional + pynutil.insert('"') + + fractional_plus_min = graph_fractional + insert_space + pynutil.insert(curr_symbol) @ graph_min_plural + fractional_plus_min |= ( + graph_fractional_one + insert_space + pynutil.insert(curr_symbol) @ graph_min_singular + ) + + decimal_graph_with_minor_curr = integer_plus_maj + pynini.cross(".", " ") + fractional_plus_min + + if not deterministic: + decimal_graph_with_minor_curr |= pynutil.add_weight( + integer_plus_maj + + pynini.cross(".", " ") + + pynutil.insert('fractional_part: "') + + two_digits_fractional_part @ cardinal.graph_hundred_component_at_least_one_none_zero_digit + + pynutil.insert('"'), + weight=0.0001, + ) + default_fraction_graph = (decimal_delete_last_zeros | decimal_with_quantity) @ graph_decimal_final + decimal_graph_with_minor_curr |= ( + pynini.closure(pynutil.delete("0"), 0, 1) + pynutil.delete(".") + fractional_plus_min + ) + decimal_graph_with_minor_curr = ( + pynutil.delete(curr_symbol) + decimal_graph_with_minor_curr + preserve_order + ) + + decimal_graph_with_minor = ( + decimal_graph_with_minor_curr + if decimal_graph_with_minor is None + else pynini.union(decimal_graph_with_minor, decimal_graph_with_minor_curr).optimize() + ) + + if not deterministic: + integer_graph_reordered_curr = ( + pynutil.delete(curr_symbol) + integer_plus_maj + preserve_order + ).optimize() + + integer_graph_reordered = ( + integer_graph_reordered_curr + if integer_graph_reordered is None + else pynini.union(integer_graph_reordered, integer_graph_reordered_curr).optimize() + ) + decimal_default_reordered_curr = ( + pynutil.delete(curr_symbol) + + default_fraction_graph + + insert_space + + pynutil.insert(curr_symbol) @ graph_maj_plural + ) + + decimal_default_reordered = ( + decimal_default_reordered_curr + if decimal_default_reordered is None + else pynini.union(decimal_default_reordered, decimal_default_reordered_curr) + ).optimize() + + # weight for SH + final_graph |= pynutil.add_weight(decimal_graph_with_minor, -0.0001) + + # utilizes morphosyntactic features to append "per units" + graph_per_units = pynutil.insert(' morphosyntactic_features: "') + per_units + pynutil.insert('"') + + if not deterministic: + final_graph |= integer_graph_reordered | decimal_default_reordered + # to handle "$2.00" cases + final_graph |= pynini.compose( + NEMO_SIGMA + pynutil.delete(".") + pynini.closure(pynutil.delete("0"), 1), + integer_graph_reordered, + ) + + final_graph += graph_per_units.ques + final_graph = self.add_tokens(final_graph.optimize()) + self.fst = final_graph.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/taggers/ordinal.py b/zonos3/vendor/nemo_text_processing/text_normalization/en/taggers/ordinal.py new file mode 100644 index 0000000000000000000000000000000000000000..5271105850882277aef4b42dbda3a40180653c48 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/taggers/ordinal.py @@ -0,0 +1,62 @@ +# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import NEMO_DIGIT, GraphFst + + +class OrdinalFst(GraphFst): + """ + Finite state transducer for classifying ordinal, e.g. + 13th -> ordinal { integer: "thirteen" } + + Args: + cardinal: CardinalFst + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, cardinal: GraphFst, deterministic: bool = True): + super().__init__(name="ordinal", kind="classify", deterministic=deterministic) + + cardinal_graph = cardinal.graph + cardinal_format = pynini.closure(NEMO_DIGIT | pynini.accep(",")) + st_format = ( + pynini.closure(cardinal_format + (NEMO_DIGIT - "1"), 0, 1) + + pynini.accep("1") + + pynutil.delete(pynini.union("st", "ST", "ˢᵗ")) + ) + nd_format = ( + pynini.closure(cardinal_format + (NEMO_DIGIT - "1"), 0, 1) + + pynini.accep("2") + + pynutil.delete(pynini.union("nd", "ND", "ⁿᵈ")) + ) + rd_format = ( + pynini.closure(cardinal_format + (NEMO_DIGIT - "1"), 0, 1) + + pynini.accep("3") + + pynutil.delete(pynini.union("rd", "RD", "ʳᵈ")) + ) + th_format = pynini.closure( + (NEMO_DIGIT - "1" - "2" - "3") + | (cardinal_format + "1" + NEMO_DIGIT) + | (cardinal_format + (NEMO_DIGIT - "1") + (NEMO_DIGIT - "1" - "2" - "3")), + 1, + ) + pynutil.delete(pynini.union("th", "TH", "ᵗʰ")) + self.graph = (st_format | nd_format | rd_format | th_format) @ cardinal_graph + final_graph = pynutil.insert("integer: \"") + self.graph + pynutil.insert("\"") + final_graph = self.add_tokens(final_graph) + self.fst = final_graph.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/taggers/punctuation.py b/zonos3/vendor/nemo_text_processing/text_normalization/en/taggers/punctuation.py new file mode 100644 index 0000000000000000000000000000000000000000..9cd1f18ef65098787afc1b257c812cd881220dfd --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/taggers/punctuation.py @@ -0,0 +1,66 @@ +# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import sys +from unicodedata import category + +import pynini +from pynini.examples import plurals +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import NEMO_NOT_SPACE, NEMO_SIGMA, GraphFst +from zonos3.vendor.nemo_text_processing.text_normalization.en.utils import get_abs_path, load_labels + + +class PunctuationFst(GraphFst): + """ + Finite state transducer for classifying punctuation + e.g. a, -> tokens { name: "a" } tokens { name: "," } + + Args: + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="punctuation", kind="classify", deterministic=deterministic) + s = "!#%&\'()*+,-./:;<=>?@^_`{|}~\"" + + punct_symbols_to_exclude = ["[", "]"] + punct_unicode = [ + chr(i) + for i in range(sys.maxunicode) + if category(chr(i)).startswith("P") and chr(i) not in punct_symbols_to_exclude + ] + [r"\[", r"\]"] + + whitelist_symbols = load_labels(get_abs_path("data/whitelist/symbol.tsv")) + whitelist_symbols = [x[0] for x in whitelist_symbols] + self.punct_marks = [p for p in punct_unicode + list(s) if p not in whitelist_symbols] + + punct = pynini.union(*self.punct_marks) + punct = pynini.closure(punct, 1) + + emphasis = ( + pynini.accep("<") + + ( + (pynini.closure(NEMO_NOT_SPACE - pynini.union("<", ">"), 1) + pynini.closure(pynini.accep("/"), 0, 1)) + | (pynini.accep("/") + pynini.closure(NEMO_NOT_SPACE - pynini.union("<", ">"), 1)) + ) + + pynini.accep(">") + ) + punct = plurals._priority_union(emphasis, punct, NEMO_SIGMA) + + self.graph = punct + self.fst = (pynutil.insert("name: \"") + self.graph + pynutil.insert("\"")).optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/taggers/range.py b/zonos3/vendor/nemo_text_processing/text_normalization/en/taggers/range.py new file mode 100644 index 0000000000000000000000000000000000000000..a9508fae4216e7e18d1eb5f3db29b489eca41b3d --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/taggers/range.py @@ -0,0 +1,128 @@ +# Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import NEMO_DIGIT, GraphFst, convert_space + + +class RangeFst(GraphFst): + """ + This class is a composite class of two other class instances + + Args: + time: composed tagger and verbalizer + date: composed tagger and verbalizer + cardinal: tagger + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + lm: whether to use for hybrid LM + """ + + def __init__( + self, + time: GraphFst, + date: GraphFst, + cardinal: GraphFst, + deterministic: bool = True, + lm: bool = False, + ): + super().__init__(name="range", kind="classify", deterministic=deterministic) + + delete_space = pynini.closure(pynutil.delete(" "), 0, 1) + + approx = pynini.cross("~", "approximately") + + # TIME + time_graph = time + delete_space + pynini.cross("-", " to ") + delete_space + time + self.graph = time_graph | (approx + time) + + cardinal = cardinal.graph_with_and + # YEAR + date_year_four_digit = (NEMO_DIGIT**4 + pynini.closure(pynini.accep("s"), 0, 1)) @ date + date_year_two_digit = (NEMO_DIGIT**2 + pynini.closure(pynini.accep("s"), 0, 1)) @ date + year_to_year_graph = ( + date_year_four_digit + + delete_space + + pynini.cross("-", " to ") + + delete_space + + (date_year_four_digit | date_year_two_digit | (NEMO_DIGIT**2 @ cardinal)) + ) + mid_year_graph = pynini.accep("mid") + pynini.cross("-", " ") + (date_year_four_digit | date_year_two_digit) + + self.graph |= year_to_year_graph + self.graph |= mid_year_graph + + # ADDITION + range_graph = cardinal + pynini.closure(pynini.cross("+", " plus ") + cardinal, 1) + range_graph |= cardinal + pynini.closure(pynini.cross(" + ", " plus ") + cardinal, 1) + range_graph |= approx + cardinal + range_graph |= cardinal + (pynini.cross("...", " ... ") | pynini.accep(" ... ")) + cardinal + + if not deterministic or lm: + # cardinal ---- + cardinal_to_cardinal_graph = ( + cardinal + delete_space + pynini.cross("-", pynini.union(" to ", " minus ")) + delete_space + cardinal + ) + + range_graph |= cardinal_to_cardinal_graph | ( + cardinal + delete_space + pynini.cross(":", " to ") + delete_space + cardinal + ) + + # MULTIPLY + for x in [" x ", "x"]: + range_graph |= cardinal + pynini.cross(x, pynini.union(" by ", " times ")) + cardinal + + # 40x -> "40 times" ("40 x" cases is covered in serial) + for x in [" x", "x"]: + range_graph |= cardinal + pynini.cross(x, " times") + + # 5x to 7x-> five to seven x/times + range_graph |= ( + cardinal + + pynutil.delete(x) + + pynini.union(" to ", "-", " - ") + + cardinal + + pynini.cross(x, pynini.union(" x", " times")) + ) + + for x in ["*", " * "]: + range_graph |= cardinal + pynini.closure(pynini.cross(x, " times ") + cardinal, 1) + + # supports "No. 12" -> "Number 12" + range_graph |= ( + (pynini.cross(pynini.union("NO", "No"), "Number") | pynini.cross("no", "number")) + + pynini.closure(pynini.union(". ", " "), 0, 1) + + cardinal + ) + + for x in ["/", " / "]: + range_graph |= cardinal + pynini.closure(pynini.cross(x, " divided by ") + cardinal, 1) + + # 10% to 20% -> ten to twenty percent + range_graph |= ( + cardinal + + pynini.closure(pynini.cross("%", " percent") | pynutil.delete("%"), 0, 1) + + pynini.union(" to ", "-", " - ") + + cardinal + + pynini.cross("%", " percent") + ) + + self.graph |= range_graph + + self.graph = self.graph.optimize() + graph = pynutil.insert("name: \"") + convert_space(self.graph).optimize() + pynutil.insert("\"") + self.fst = graph.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/taggers/roman.py b/zonos3/vendor/nemo_text_processing/text_normalization/en/taggers/roman.py new file mode 100644 index 0000000000000000000000000000000000000000..bafc35ea8fdb3b2ea63f70c51e247d6808391062 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/taggers/roman.py @@ -0,0 +1,115 @@ +# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import NEMO_ALPHA, NEMO_SIGMA, GraphFst +from zonos3.vendor.nemo_text_processing.text_normalization.en.utils import get_abs_path, load_labels + + +class RomanFst(GraphFst): + """ + Finite state transducer for classifying roman numbers: + e.g. "IV" -> tokens { roman { integer: "four" } } + + Args: + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, deterministic: bool = True, lm: bool = False): + super().__init__(name="roman", kind="classify", deterministic=deterministic) + + roman_dict = load_labels(get_abs_path("data/roman/roman_to_spoken.tsv")) + default_graph = pynini.string_map(roman_dict).optimize() + default_graph = pynutil.insert("integer: \"") + default_graph + pynutil.insert("\"") + ordinal_limit = 19 + + if deterministic: + # exclude "I" + start_idx = 1 + else: + start_idx = 0 + + graph_teens = pynini.string_map([x[0] for x in roman_dict[start_idx:ordinal_limit]]).optimize() + + # roman numerals up to ordinal_limit with a preceding name are converted to ordinal form + names = get_names() + graph = ( + pynutil.insert("key_the_ordinal: \"") + + names + + pynutil.insert("\"") + + pynini.accep(" ") + + graph_teens @ default_graph + ).optimize() + + # single symbol roman numerals with preceding key words (multiple formats) are converted to cardinal form + key_words = [] + for k_word in load_labels(get_abs_path("data/roman/key_word.tsv")): + key_words.append(k_word) + key_words.append([k_word[0][0].upper() + k_word[0][1:]]) + key_words.append([k_word[0].upper()]) + + key_words = pynini.string_map(key_words).optimize() + graph |= ( + pynutil.insert("key_cardinal: \"") + key_words + pynutil.insert("\"") + pynini.accep(" ") + default_graph + ).optimize() + + if deterministic or lm: + # two digit roman numerals up to 49 + roman_to_cardinal = pynini.compose( + pynini.closure(NEMO_ALPHA, 2), + ( + pynutil.insert("default_cardinal: \"default\" ") + + (pynini.string_map([x[0] for x in roman_dict[:50]]).optimize()) @ default_graph + ), + ) + graph |= roman_to_cardinal + elif not lm: + # two or more digit roman numerals + roman_to_cardinal = pynini.compose( + pynini.difference(NEMO_SIGMA, "I"), + ( + pynutil.insert("default_cardinal: \"default\" integer: \"") + + pynini.string_map(roman_dict).optimize() + + pynutil.insert("\"") + ), + ).optimize() + graph |= roman_to_cardinal + + # convert three digit roman or up with suffix to ordinal + roman_to_ordinal = pynini.compose( + pynini.closure(NEMO_ALPHA, 3), + (pynutil.insert("default_ordinal: \"default\" ") + graph_teens @ default_graph + pynutil.delete("th")), + ) + + graph |= roman_to_ordinal + graph = self.add_tokens(graph.optimize()) + + self.fst = graph.optimize() + + +def get_names(): + """ + Returns the graph that matched common male and female names. + """ + male_labels = load_labels(get_abs_path("data/roman/male.tsv")) + female_labels = load_labels(get_abs_path("data/roman/female.tsv")) + male_labels.extend([[x[0].upper()] for x in male_labels]) + female_labels.extend([[x[0].upper()] for x in female_labels]) + names = pynini.string_map(male_labels).optimize() + names |= pynini.string_map(female_labels).optimize() + return names diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/taggers/serial.py b/zonos3/vendor/nemo_text_processing/text_normalization/en/taggers/serial.py new file mode 100644 index 0000000000000000000000000000000000000000..04c23baf18bf7e7374b8b112b884fd73e2c90f6a --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/taggers/serial.py @@ -0,0 +1,143 @@ +# Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import pynini +from pynini.examples import plurals +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import ( + NEMO_ALPHA, + NEMO_DIGIT, + NEMO_NOT_SPACE, + NEMO_SIGMA, + GraphFst, + convert_space, +) +from zonos3.vendor.nemo_text_processing.text_normalization.en.utils import get_abs_path, load_labels + + +class SerialFst(GraphFst): + """ + This class is a composite class of two other class instances + + Args: + time: composed tagger and verbalizer + date: composed tagger and verbalizer + cardinal: tagger + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + lm: whether to use for hybrid LM + """ + + def __init__(self, cardinal: GraphFst, ordinal: GraphFst, deterministic: bool = True, lm: bool = False): + super().__init__(name="integer", kind="classify", deterministic=deterministic) + + """ + Finite state transducer for classifying serial (handles only cases without delimiters, + values with delimiters are handled by default). + The serial is a combination of digits, letters and dashes, e.g.: + c325b -> tokens { cardinal { integer: "c three two five b" } } + """ + if deterministic: + num_graph = pynini.compose(NEMO_DIGIT ** (6, ...), cardinal.single_digits_graph).optimize() + num_graph |= pynini.compose(NEMO_DIGIT ** (1, 5), cardinal.graph).optimize() + # to handle numbers starting with zero + num_graph |= pynini.compose( + pynini.accep("0") + pynini.closure(NEMO_DIGIT), cardinal.single_digits_graph + ).optimize() + else: + num_graph = cardinal.final_graph + + # TODO: "#" doesn't work from the file + symbols_graph = pynini.string_file(get_abs_path("data/whitelist/symbol.tsv")).optimize() | pynini.cross( + "#", "hash" + ) + num_graph |= symbols_graph + + if not self.deterministic and not lm: + num_graph |= cardinal.single_digits_graph + num_graph |= pynini.compose(num_graph, NEMO_SIGMA + pynutil.delete("hundred ") + NEMO_SIGMA) + # also allow double digits to be pronounced as integer in serial number + num_graph |= pynutil.add_weight( + NEMO_DIGIT**2 @ cardinal.graph_hundred_component_at_least_one_none_zero_digit, weight=0.0001 + ) + + # add space between letter and digit/symbol + symbols = [x[0] for x in load_labels(get_abs_path("data/whitelist/symbol.tsv"))] + symbols = pynini.union(*symbols) + digit_symbol = NEMO_DIGIT | symbols + + graph_with_space = pynini.compose( + pynini.cdrewrite(pynutil.insert(" "), NEMO_ALPHA | symbols, digit_symbol, NEMO_SIGMA), + pynini.cdrewrite(pynutil.insert(" "), digit_symbol, NEMO_ALPHA | symbols, NEMO_SIGMA), + ) + + # serial graph with delimiter + delimiter = pynini.accep("-") | pynini.accep("/") | pynini.accep(" ") + if not deterministic: + delimiter |= pynini.cross("-", " dash ") | pynini.cross("/", " slash ") + + alphas = pynini.closure(NEMO_ALPHA, 1) + letter_num = alphas + delimiter + num_graph + num_letter = pynini.closure(num_graph + delimiter, 1) + alphas + next_alpha_or_num = pynini.closure(delimiter + (alphas | num_graph)) + next_alpha_or_num |= pynini.closure( + delimiter + + num_graph + + plurals._priority_union(pynini.accep(" "), pynutil.insert(" "), NEMO_SIGMA).optimize() + + alphas + ) + + serial_graph = letter_num + next_alpha_or_num + serial_graph |= num_letter + next_alpha_or_num + # numbers only with 2+ delimiters + serial_graph |= ( + num_graph + delimiter + num_graph + delimiter + num_graph + pynini.closure(delimiter + num_graph) + ) + # 2+ symbols + serial_graph |= pynini.compose(NEMO_SIGMA + symbols + NEMO_SIGMA, num_graph + delimiter + num_graph) + + # exclude ordinal numbers from serial options + serial_graph = pynini.compose( + pynini.difference(NEMO_SIGMA, pynini.project(ordinal.graph, "input")), serial_graph + ).optimize() + + serial_graph = pynutil.add_weight(serial_graph, 0.0001) + serial_graph |= ( + pynini.closure(NEMO_NOT_SPACE, 1) + + (pynini.cross("^2", " squared") | pynini.cross("^3", " cubed")).optimize() + ) + + # at least one serial graph with alpha numeric value and optional additional serial/num/alpha values + serial_graph = ( + pynini.closure((serial_graph | num_graph | alphas) + delimiter) + + serial_graph + + pynini.closure(delimiter + (serial_graph | num_graph | alphas)) + ) + + serial_graph |= pynini.compose(graph_with_space, serial_graph.optimize()).optimize() + serial_graph = pynini.compose(pynini.closure(NEMO_NOT_SPACE, 2), serial_graph).optimize() + + # this is not to verbolize "/" as "slash" in cases like "import/export" + serial_graph = pynini.compose( + pynini.difference( + NEMO_SIGMA, pynini.closure(NEMO_ALPHA, 1) + pynini.accep("/") + pynini.closure(NEMO_ALPHA, 1) + ), + serial_graph, + ) + + self.graph = serial_graph.optimize() + graph = pynutil.insert("name: \"") + convert_space(self.graph).optimize() + pynutil.insert("\"") + self.fst = graph.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/taggers/telephone.py b/zonos3/vendor/nemo_text_processing/text_normalization/en/taggers/telephone.py new file mode 100644 index 0000000000000000000000000000000000000000..78f41d828b40c4dc9363c8a4972f8239c2cf535a --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/taggers/telephone.py @@ -0,0 +1,134 @@ +# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import ( + NEMO_ALPHA, + NEMO_DIGIT, + NEMO_SIGMA, + GraphFst, + delete_extra_space, + delete_space, + insert_space, + plurals, +) +from zonos3.vendor.nemo_text_processing.text_normalization.en.utils import get_abs_path + + +class TelephoneFst(GraphFst): + """ + Finite state transducer for classifying telephone, and IP, and SSN which includes country code, number part and extension + country code optional: +*** + number part: ***-***-****, or (***) ***-**** + extension optional: 1-9999 + E.g + +1 123-123-5678-1 -> telephone { country_code: "one" number_part: "one two three, one two three, five six seven eight" extension: "one" } + 1-800-GO-U-HAUL -> telephone { country_code: "one" number_part: "one, eight hundred GO U HAUL" } + Args: + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="telephone", kind="classify", deterministic=deterministic) + + add_separator = pynutil.insert(", ") # between components + zero = pynini.cross("0", "zero") + if not deterministic: + zero |= pynini.cross("0", pynini.union("o", "oh")) + digit = pynini.invert(pynini.string_file(get_abs_path("data/number/digit.tsv"))).optimize() | zero + + telephone_prompts = pynini.string_file(get_abs_path("data/telephone/telephone_prompt.tsv")) + country_code = ( + pynini.closure(telephone_prompts + delete_extra_space, 0, 1) + + pynini.closure(pynini.cross("+", "plus "), 0, 1) + + pynini.closure(digit + insert_space, 0, 2) + + digit + + pynutil.insert(",") + ) + country_code |= telephone_prompts + country_code = pynutil.insert("country_code: \"") + country_code + pynutil.insert("\"") + country_code = country_code + pynini.closure(pynutil.delete("-"), 0, 1) + delete_space + insert_space + + area_part_default = pynini.closure(digit + insert_space, 2, 2) + digit + area_part = pynini.cross("800", "eight hundred") | pynini.compose( + pynini.difference(NEMO_SIGMA, "800"), area_part_default + ) + + area_part = ( + (area_part + (pynutil.delete("-") | pynutil.delete("."))) + | ( + pynutil.delete("(") + + area_part + + ((pynutil.delete(")") + pynini.closure(pynutil.delete(" "), 0, 1)) | pynutil.delete(")-")) + ) + ) + add_separator + + del_separator = pynini.closure(pynini.union("-", " ", "."), 0, 1) + number_length = ((NEMO_DIGIT + del_separator) | (NEMO_ALPHA + del_separator)) ** 7 + number_words = pynini.closure( + (NEMO_DIGIT @ digit) + (insert_space | (pynini.cross("-", ', '))) + | NEMO_ALPHA + | (NEMO_ALPHA + pynini.cross("-", ' ')) + ) + number_words |= pynini.closure( + (NEMO_DIGIT @ digit) + (insert_space | (pynini.cross(".", ', '))) + | NEMO_ALPHA + | (NEMO_ALPHA + pynini.cross(".", ' ')) + ) + number_words = pynini.compose(number_length, number_words) + number_part = area_part + number_words + number_part = pynutil.insert("number_part: \"") + number_part + pynutil.insert("\"") + extension = ( + pynutil.insert("extension: \"") + pynini.closure(digit + insert_space, 0, 3) + digit + pynutil.insert("\"") + ) + extension = pynini.closure(insert_space + extension, 0, 1) + + graph = plurals._priority_union(country_code + number_part, number_part, NEMO_SIGMA).optimize() + graph = plurals._priority_union(country_code + number_part + extension, graph, NEMO_SIGMA).optimize() + graph = plurals._priority_union(number_part + extension, graph, NEMO_SIGMA).optimize() + + # ip + ip_prompts = pynini.string_file(get_abs_path("data/telephone/ip_prompt.tsv")) + digit_to_str_graph = digit + pynini.closure(pynutil.insert(" ") + digit, 0, 2) + ip_graph = digit_to_str_graph + (pynini.cross(".", " dot ") + digit_to_str_graph) ** 3 + graph |= ( + pynini.closure( + pynutil.insert("country_code: \"") + ip_prompts + pynutil.insert("\"") + delete_extra_space, 0, 1 + ) + + pynutil.insert("number_part: \"") + + ip_graph.optimize() + + pynutil.insert("\"") + ) + # ssn + ssn_prompts = pynini.string_file(get_abs_path("data/telephone/ssn_prompt.tsv")) + three_digit_part = digit + (pynutil.insert(" ") + digit) ** 2 + two_digit_part = digit + pynutil.insert(" ") + digit + four_digit_part = digit + (pynutil.insert(" ") + digit) ** 3 + ssn_separator = pynini.cross("-", ", ") + ssn_graph = three_digit_part + ssn_separator + two_digit_part + ssn_separator + four_digit_part + + graph |= ( + pynini.closure( + pynutil.insert("country_code: \"") + ssn_prompts + pynutil.insert("\"") + delete_extra_space, 0, 1 + ) + + pynutil.insert("number_part: \"") + + ssn_graph.optimize() + + pynutil.insert("\"") + ) + + final_graph = self.add_tokens(graph) + self.fst = final_graph.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/taggers/time.py b/zonos3/vendor/nemo_text_processing/text_normalization/en/taggers/time.py new file mode 100644 index 0000000000000000000000000000000000000000..80fbca56cd30f3a5e1b9ee3216ad05e530586adc --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/taggers/time.py @@ -0,0 +1,133 @@ +# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import ( + NEMO_DIGIT, + GraphFst, + convert_space, + delete_space, + insert_space, +) +from zonos3.vendor.nemo_text_processing.text_normalization.en.utils import ( + augment_labels_with_punct_at_end, + get_abs_path, + load_labels, +) + + +class TimeFst(GraphFst): + """ + Finite state transducer for classifying time, e.g. + 12:30 a.m. est -> time { hours: "twelve" minutes: "thirty" suffix: "a m" zone: "e s t" } + 2.30 a.m. -> time { hours: "two" minutes: "thirty" suffix: "a m" } + 02.30 a.m. -> time { hours: "two" minutes: "thirty" suffix: "a m" } + 2.00 a.m. -> time { hours: "two" suffix: "a m" } + 2 a.m. -> time { hours: "two" suffix: "a m" } + 02:00 -> time { hours: "two" } + 2:00 -> time { hours: "two" } + 10:00:05 a.m. -> time { hours: "ten" minutes: "zero" seconds: "five" suffix: "a m" } + + Args: + cardinal: CardinalFst + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, cardinal: GraphFst, deterministic: bool = True): + super().__init__(name="time", kind="classify", deterministic=deterministic) + suffix_labels = load_labels(get_abs_path("data/time/suffix.tsv")) + suffix_labels.extend(augment_labels_with_punct_at_end(suffix_labels)) + suffix_graph = pynini.string_map(suffix_labels) + + time_zone_graph = pynini.string_file(get_abs_path("data/time/zone.tsv")) + + # only used for < 1000 thousand -> 0 weight + cardinal = cardinal.graph + + labels_hour = [str(x) for x in range(0, 24)] + labels_minute_single = [str(x) for x in range(1, 10)] + labels_minute_double = [str(x) for x in range(10, 60)] + + delete_leading_zero_to_double_digit = (NEMO_DIGIT + NEMO_DIGIT) | ( + pynini.closure(pynutil.delete("0"), 0, 1) + NEMO_DIGIT + ) + + graph_hour = delete_leading_zero_to_double_digit @ pynini.union(*labels_hour) @ cardinal + + graph_minute_single = pynini.union(*labels_minute_single) @ cardinal + graph_minute_double = pynini.union(*labels_minute_double) @ cardinal + + final_graph_hour = pynutil.insert("hours: \"") + graph_hour + pynutil.insert("\"") + final_graph_minute = ( + pynutil.insert("minutes: \"") + + (pynini.cross("0", "o") + insert_space + graph_minute_single | graph_minute_double) + + pynutil.insert("\"") + ) + final_graph_second = ( + pynutil.insert("seconds: \"") + + (pynini.cross("0", "o") + insert_space + graph_minute_single | graph_minute_double) + + pynutil.insert("\"") + ) + final_suffix = pynutil.insert("suffix: \"") + convert_space(suffix_graph) + pynutil.insert("\"") + final_suffix_optional = pynini.closure(delete_space + insert_space + final_suffix, 0, 1) + final_time_zone_optional = pynini.closure( + delete_space + + insert_space + + pynutil.insert("zone: \"") + + convert_space(time_zone_graph) + + pynutil.insert("\""), + 0, + 1, + ) + + # 2:30 pm, 02:30, 2:00 + graph_hm = ( + final_graph_hour + + pynutil.delete(":") + + (pynutil.delete("00") | insert_space + final_graph_minute) + + final_suffix_optional + + final_time_zone_optional + ) + + # 10:30:05 pm, + graph_hms = ( + final_graph_hour + + pynutil.delete(":") + + (pynini.cross("00", " minutes: \"zero\"") | insert_space + final_graph_minute) + + pynutil.delete(":") + + (pynini.cross("00", " seconds: \"zero\"") | insert_space + final_graph_second) + + final_suffix_optional + + final_time_zone_optional + ) + + # 2.xx pm/am + graph_hm2 = ( + final_graph_hour + + pynutil.delete(".") + + (pynutil.delete("00") | insert_space + final_graph_minute) + + delete_space + + insert_space + + final_suffix + + final_time_zone_optional + ) + # 2 pm est + graph_h = final_graph_hour + delete_space + insert_space + final_suffix + final_time_zone_optional + final_graph = (graph_hm | graph_h | graph_hm2 | graph_hms).optimize() + + final_graph = self.add_tokens(final_graph) + self.fst = final_graph.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/taggers/tokenize_and_classify.py b/zonos3/vendor/nemo_text_processing/text_normalization/en/taggers/tokenize_and_classify.py new file mode 100644 index 0000000000000000000000000000000000000000..3451aebc20bc2790b3a90b450592b71dfc17f76c --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/taggers/tokenize_and_classify.py @@ -0,0 +1,241 @@ +# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import os +import time + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import ( + NEMO_WHITE_SPACE, + GraphFst, + delete_extra_space, + delete_space, + generator_main, +) +from zonos3.vendor.nemo_text_processing.text_normalization.en.taggers.abbreviation import AbbreviationFst +from zonos3.vendor.nemo_text_processing.text_normalization.en.taggers.cardinal import CardinalFst +from zonos3.vendor.nemo_text_processing.text_normalization.en.taggers.date import DateFst +from zonos3.vendor.nemo_text_processing.text_normalization.en.taggers.decimal import DecimalFst +from zonos3.vendor.nemo_text_processing.text_normalization.en.taggers.electronic import ElectronicFst +from zonos3.vendor.nemo_text_processing.text_normalization.en.taggers.fraction import FractionFst +from zonos3.vendor.nemo_text_processing.text_normalization.en.taggers.measure import MeasureFst +from zonos3.vendor.nemo_text_processing.text_normalization.en.taggers.money import MoneyFst +from zonos3.vendor.nemo_text_processing.text_normalization.en.taggers.ordinal import OrdinalFst +from zonos3.vendor.nemo_text_processing.text_normalization.en.taggers.punctuation import PunctuationFst +from zonos3.vendor.nemo_text_processing.text_normalization.en.taggers.range import RangeFst as RangeFst +from zonos3.vendor.nemo_text_processing.text_normalization.en.taggers.roman import RomanFst +from zonos3.vendor.nemo_text_processing.text_normalization.en.taggers.serial import SerialFst +from zonos3.vendor.nemo_text_processing.text_normalization.en.taggers.telephone import TelephoneFst +from zonos3.vendor.nemo_text_processing.text_normalization.en.taggers.time import TimeFst +from zonos3.vendor.nemo_text_processing.text_normalization.en.taggers.whitelist import WhiteListFst +from zonos3.vendor.nemo_text_processing.text_normalization.en.taggers.word import WordFst +from zonos3.vendor.nemo_text_processing.text_normalization.en.verbalizers.date import DateFst as vDateFst +from zonos3.vendor.nemo_text_processing.text_normalization.en.verbalizers.ordinal import OrdinalFst as vOrdinalFst +from zonos3.vendor.nemo_text_processing.text_normalization.en.verbalizers.time import TimeFst as vTimeFst +from zonos3.vendor.nemo_text_processing.utils.logging import logger + + +class ClassifyFst(GraphFst): + """ + Final class that composes all other classification grammars. This class can process an entire sentence including punctuation. + For deployment, this grammar will be compiled and exported to OpenFst Finite State Archive (FAR) File. + More details to deployment at NeMo/tools/text_processing_deployment. + + Args: + input_case: accepting either "lower_cased" or "cased" input. + deterministic: if True will provide a single transduction option, + for False multiple options (used for audio-based normalization) + cache_dir: path to a dir with .far grammar file. Set to None to avoid using cache. + overwrite_cache: set to True to overwrite .far files + whitelist: path to a file with whitelist replacements + """ + + def __init__( + self, + input_case: str, + deterministic: bool = True, + cache_dir: str = None, + overwrite_cache: bool = False, + whitelist: str = None, + ): + super().__init__(name="tokenize_and_classify", kind="classify", deterministic=deterministic) + + far_file = None + if cache_dir is not None and cache_dir != "None": + os.makedirs(cache_dir, exist_ok=True) + whitelist_file = os.path.basename(whitelist) if whitelist else "" + far_file = os.path.join( + cache_dir, + f"en_tn_{deterministic}_deterministic_{input_case}_{whitelist_file}_tokenize.far", + ) + if not overwrite_cache and far_file and os.path.exists(far_file): + self.fst = pynini.Far(far_file, mode="r")["tokenize_and_classify"] + logger.info(f"ClassifyFst.fst was restored from {far_file}.") + else: + logger.info(f"Creating ClassifyFst grammars.") + + start_time = time.time() + cardinal = CardinalFst(deterministic=deterministic) + cardinal_graph = cardinal.fst + logger.debug(f"cardinal: {time.time() - start_time: .2f}s -- {cardinal_graph.num_states()} nodes") + + start_time = time.time() + ordinal = OrdinalFst(cardinal=cardinal, deterministic=deterministic) + ordinal_graph = ordinal.fst + logger.debug(f"ordinal: {time.time() - start_time: .2f}s -- {ordinal_graph.num_states()} nodes") + + start_time = time.time() + decimal = DecimalFst(cardinal=cardinal, deterministic=deterministic) + decimal_graph = decimal.fst + logger.debug(f"decimal: {time.time() - start_time: .2f}s -- {decimal_graph.num_states()} nodes") + + start_time = time.time() + fraction = FractionFst(deterministic=deterministic, cardinal=cardinal) + fraction_graph = fraction.fst + logger.debug(f"fraction: {time.time() - start_time: .2f}s -- {fraction_graph.num_states()} nodes") + + start_time = time.time() + measure = MeasureFst( + cardinal=cardinal, + decimal=decimal, + fraction=fraction, + deterministic=deterministic, + ) + measure_graph = measure.fst + logger.debug(f"measure: {time.time() - start_time: .2f}s -- {measure_graph.num_states()} nodes") + + start_time = time.time() + date_graph = DateFst(cardinal=cardinal, deterministic=deterministic).fst + logger.debug(f"date: {time.time() - start_time: .2f}s -- {date_graph.num_states()} nodes") + + start_time = time.time() + time_graph = TimeFst(cardinal=cardinal, deterministic=deterministic).fst + logger.debug(f"time: {time.time() - start_time: .2f}s -- {time_graph.num_states()} nodes") + + start_time = time.time() + telephone_graph = TelephoneFst(deterministic=deterministic).fst + logger.debug(f"telephone: {time.time() - start_time: .2f}s -- {telephone_graph.num_states()} nodes") + + start_time = time.time() + electonic_graph = ElectronicFst(cardinal=cardinal, deterministic=deterministic).fst + logger.debug(f"electronic: {time.time() - start_time: .2f}s -- {electonic_graph.num_states()} nodes") + + start_time = time.time() + money_graph = MoneyFst(cardinal=cardinal, decimal=decimal, deterministic=deterministic).fst + logger.debug(f"money: {time.time() - start_time: .2f}s -- {money_graph.num_states()} nodes") + + start_time = time.time() + whitelist_graph = WhiteListFst( + input_case=input_case, deterministic=deterministic, input_file=whitelist + ).fst + logger.debug(f"whitelist: {time.time() - start_time: .2f}s -- {whitelist_graph.num_states()} nodes") + + start_time = time.time() + punctuation = PunctuationFst(deterministic=deterministic) + punct_graph = punctuation.fst + logger.debug(f"punct: {time.time() - start_time: .2f}s -- {punct_graph.num_states()} nodes") + + start_time = time.time() + word_graph = WordFst(punctuation=punctuation, deterministic=deterministic).fst + logger.debug(f"word: {time.time() - start_time: .2f}s -- {word_graph.num_states()} nodes") + + start_time = time.time() + serial_graph = SerialFst(cardinal=cardinal, ordinal=ordinal, deterministic=deterministic).fst + logger.debug(f"serial: {time.time() - start_time: .2f}s -- {serial_graph.num_states()} nodes") + + start_time = time.time() + v_time_graph = vTimeFst(deterministic=deterministic).fst + v_ordinal_graph = vOrdinalFst(deterministic=deterministic) + v_date_graph = vDateFst(ordinal=v_ordinal_graph, deterministic=deterministic).fst + time_final = pynini.compose(time_graph, v_time_graph) + date_final = pynini.compose(date_graph, v_date_graph) + range_graph = RangeFst( + time=time_final, + date=date_final, + cardinal=cardinal, + deterministic=deterministic, + ).fst + logger.debug(f"range: {time.time() - start_time: .2f}s -- {range_graph.num_states()} nodes") + + # A quick fix to address money ranges: + # $150-$200 -> one hundred and fifty dollars to two hundred dollars + + dash = (pynutil.insert('name: "') + pynini.cross("-", "to") + pynutil.insert('"')).optimize() + + graph_range_money = pynini.closure( + money_graph + + pynutil.insert(" }") + + pynutil.insert(" tokens { ") + + dash + + pynutil.insert(" } ") + + pynutil.insert("tokens { ") + + money_graph, + 1, + ) + + classify = ( + pynutil.add_weight(whitelist_graph, 1.01) + | pynutil.add_weight(time_graph, 1.1) + | pynutil.add_weight(date_graph, 1.09) + | pynutil.add_weight(decimal_graph, 1.1) + | pynutil.add_weight(measure_graph, 1.1) + | pynutil.add_weight(cardinal_graph, 1.1) + | pynutil.add_weight(ordinal_graph, 1.1) + | pynutil.add_weight(money_graph, 1.1) + | pynutil.add_weight(telephone_graph, 1.1) + | pynutil.add_weight(electonic_graph, 1.11) + | pynutil.add_weight(fraction_graph, 1.1) + | pynutil.add_weight(range_graph, 1.1) + | pynutil.add_weight(serial_graph, 1.12) # should be higher than the rest of the classes + | pynutil.add_weight(graph_range_money, 1.1) + ) + + # roman_graph = RomanFst(deterministic=deterministic).fst + # classify |= pynutil.add_weight(roman_graph, 1.1) + + if not deterministic: + abbreviation_graph = AbbreviationFst(deterministic=deterministic).fst + classify |= pynutil.add_weight(abbreviation_graph, 100) + + punct = pynutil.insert("tokens { ") + pynutil.add_weight(punct_graph, weight=2.1) + pynutil.insert(" }") + punct = pynini.closure( + pynini.compose(pynini.closure(NEMO_WHITE_SPACE, 1), delete_extra_space) + | (pynutil.insert(" ") + punct) + | punct, + 1, + ) + + classify |= pynutil.add_weight(word_graph, 100) + token = pynutil.insert("tokens { ") + classify + pynutil.insert(" }") + token_plus_punct = ( + pynini.closure(punct + pynutil.insert(" ")) + token + pynini.closure(pynutil.insert(" ") + punct) + ) + + graph = token_plus_punct + pynini.closure( + ( + pynini.compose(pynini.closure(NEMO_WHITE_SPACE, 1), delete_extra_space) + | (pynutil.insert(" ") + punct + pynutil.insert(" ")) + ) + + token_plus_punct + ) + + graph = delete_space + graph + delete_space + graph |= punct + + self.fst = graph.optimize() + + if far_file: + generator_main(far_file, {"tokenize_and_classify": self.fst}) diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/taggers/tokenize_and_classify_lm.py b/zonos3/vendor/nemo_text_processing/text_normalization/en/taggers/tokenize_and_classify_lm.py new file mode 100644 index 0000000000000000000000000000000000000000..5ac152656f0ff45cb53a988b0106485b0e6ec676 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/taggers/tokenize_and_classify_lm.py @@ -0,0 +1,227 @@ +# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import os + +import pynini +from pynini.examples import plurals +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import ( + NEMO_CHAR, + NEMO_DIGIT, + NEMO_NOT_SPACE, + NEMO_SIGMA, + NEMO_WHITE_SPACE, + GraphFst, + delete_extra_space, + delete_space, + generator_main, +) +from zonos3.vendor.nemo_text_processing.text_normalization.en.taggers.cardinal import CardinalFst +from zonos3.vendor.nemo_text_processing.text_normalization.en.taggers.date import DateFst +from zonos3.vendor.nemo_text_processing.text_normalization.en.taggers.decimal import DecimalFst +from zonos3.vendor.nemo_text_processing.text_normalization.en.taggers.electronic import ElectronicFst +from zonos3.vendor.nemo_text_processing.text_normalization.en.taggers.fraction import FractionFst +from zonos3.vendor.nemo_text_processing.text_normalization.en.taggers.measure import MeasureFst +from zonos3.vendor.nemo_text_processing.text_normalization.en.taggers.money import MoneyFst +from zonos3.vendor.nemo_text_processing.text_normalization.en.taggers.ordinal import OrdinalFst +from zonos3.vendor.nemo_text_processing.text_normalization.en.taggers.punctuation import PunctuationFst +from zonos3.vendor.nemo_text_processing.text_normalization.en.taggers.range import RangeFst as RangeFst +from zonos3.vendor.nemo_text_processing.text_normalization.en.taggers.roman import RomanFst +from zonos3.vendor.nemo_text_processing.text_normalization.en.taggers.serial import SerialFst +from zonos3.vendor.nemo_text_processing.text_normalization.en.taggers.telephone import TelephoneFst +from zonos3.vendor.nemo_text_processing.text_normalization.en.taggers.time import TimeFst +from zonos3.vendor.nemo_text_processing.text_normalization.en.taggers.whitelist import WhiteListFst +from zonos3.vendor.nemo_text_processing.text_normalization.en.taggers.word import WordFst +from zonos3.vendor.nemo_text_processing.text_normalization.en.verbalizers.cardinal import CardinalFst as vCardinal +from zonos3.vendor.nemo_text_processing.text_normalization.en.verbalizers.date import DateFst as vDate +from zonos3.vendor.nemo_text_processing.text_normalization.en.verbalizers.decimal import DecimalFst as vDecimal +from zonos3.vendor.nemo_text_processing.text_normalization.en.verbalizers.electronic import ElectronicFst as vElectronic +from zonos3.vendor.nemo_text_processing.text_normalization.en.verbalizers.fraction import FractionFst as vFraction +from zonos3.vendor.nemo_text_processing.text_normalization.en.verbalizers.measure import MeasureFst as vMeasure +from zonos3.vendor.nemo_text_processing.text_normalization.en.verbalizers.money import MoneyFst as vMoney +from zonos3.vendor.nemo_text_processing.text_normalization.en.verbalizers.ordinal import OrdinalFst as vOrdinal +from zonos3.vendor.nemo_text_processing.text_normalization.en.verbalizers.roman import RomanFst as vRoman +from zonos3.vendor.nemo_text_processing.text_normalization.en.verbalizers.telephone import TelephoneFst as vTelephone +from zonos3.vendor.nemo_text_processing.text_normalization.en.verbalizers.time import TimeFst as vTime +from zonos3.vendor.nemo_text_processing.text_normalization.en.verbalizers.word import WordFst as vWord +from zonos3.vendor.nemo_text_processing.utils.logging import logger + + +class ClassifyFst(GraphFst): + """ + Final class that composes all other classification grammars. This class can process an entire sentence including punctuation. + For deployment, this grammar will be compiled and exported to OpenFst Finite State Archive (FAR) File. + More details to deployment at NeMo/tools/text_processing_deployment. + + Args: + input_case: accepting either "lower_cased" or "cased" input. + deterministic: if True will provide a single transduction option, + for False multiple options (used for audio-based normalization) + cache_dir: path to a dir with .far grammar file. Set to None to avoid using cache. + overwrite_cache: set to True to overwrite .far files + whitelist: path to a file with whitelist replacements + """ + + def __init__( + self, + input_case: str, + deterministic: bool = True, + cache_dir: str = None, + overwrite_cache: bool = True, + whitelist: str = None, + ): + super().__init__(name="tokenize_and_classify", kind="classify", deterministic=deterministic) + + far_file = None + if cache_dir is not None and cache_dir != 'None': + os.makedirs(cache_dir, exist_ok=True) + whitelist_file = os.path.basename(whitelist) if whitelist else "" + far_file = os.path.join( + cache_dir, f"_{input_case}_en_tn_{deterministic}_deterministic{whitelist_file}_lm.far" + ) + if not overwrite_cache and far_file and os.path.exists(far_file): + self.fst = pynini.Far(far_file, mode='r')['tokenize_and_classify'] + no_digits = pynini.closure(pynini.difference(NEMO_CHAR, NEMO_DIGIT)) + self.fst_no_digits = pynini.compose(self.fst, no_digits).optimize() + logger.info(f'ClassifyFst.fst was restored from {far_file}.') + else: + logger.info(f'Creating ClassifyFst grammars. This might take some time...') + # TAGGERS + cardinal = CardinalFst(deterministic=True, lm=True) + cardinal_tagger = cardinal + cardinal_graph = cardinal.fst + + ordinal = OrdinalFst(cardinal=cardinal, deterministic=True) + ordinal_graph = ordinal.fst + + decimal = DecimalFst(cardinal=cardinal, deterministic=True) + decimal_graph = decimal.fst + fraction = FractionFst(deterministic=True, cardinal=cardinal) + fraction_graph = fraction.fst + + measure = MeasureFst(cardinal=cardinal, decimal=decimal, fraction=fraction, deterministic=True) + measure_graph = measure.fst + date = DateFst(cardinal=cardinal, deterministic=True, lm=True) + date_graph = date.fst + punctuation = PunctuationFst(deterministic=True) + punct_graph = punctuation.graph + word_graph = WordFst(punctuation=punctuation, deterministic=deterministic).graph + time_graph = TimeFst(cardinal=cardinal, deterministic=True).fst + telephone_graph = TelephoneFst(deterministic=True).fst + electronic_graph = ElectronicFst(cardinal=cardinal, deterministic=True).fst + money_graph = MoneyFst(cardinal=cardinal, decimal=decimal, deterministic=False).fst + whitelist = WhiteListFst(input_case=input_case, deterministic=False, input_file=whitelist) + whitelist_graph = whitelist.graph + serial_graph = SerialFst(cardinal=cardinal, ordinal=ordinal, deterministic=deterministic, lm=True).fst + + # VERBALIZERS + cardinal = vCardinal(deterministic=True) + v_cardinal_graph = cardinal.fst + decimal = vDecimal(cardinal=cardinal, deterministic=True) + v_decimal_graph = decimal.fst + ordinal = vOrdinal(deterministic=True) + v_ordinal_graph = ordinal.fst + fraction = vFraction(deterministic=True, lm=True) + v_fraction_graph = fraction.fst + v_telephone_graph = vTelephone(deterministic=True).fst + v_electronic_graph = vElectronic(deterministic=True).fst + measure = vMeasure(decimal=decimal, cardinal=cardinal, fraction=fraction, deterministic=False) + v_measure_graph = measure.fst + v_time_graph = vTime(deterministic=True).fst + v_date_graph = vDate(ordinal=ordinal, deterministic=deterministic, lm=True).fst + v_money_graph = vMoney(decimal=decimal, deterministic=deterministic).fst + v_roman_graph = vRoman(deterministic=deterministic).fst + v_word_graph = vWord(deterministic=deterministic).fst + + cardinal_or_date_final = plurals._priority_union(date_graph, cardinal_graph, NEMO_SIGMA) + cardinal_or_date_final = pynini.compose(cardinal_or_date_final, (v_cardinal_graph | v_date_graph)) + + time_final = pynini.compose(time_graph, v_time_graph) + ordinal_final = pynini.compose(ordinal_graph, v_ordinal_graph) + sem_w = 1 + word_w = 100 + punct_w = 2 + classify_and_verbalize = ( + pynutil.add_weight(time_final, sem_w) + | pynutil.add_weight(pynini.compose(decimal_graph, v_decimal_graph), sem_w) + | pynutil.add_weight(pynini.compose(measure_graph, v_measure_graph), sem_w) + | pynutil.add_weight(ordinal_final, sem_w) + | pynutil.add_weight(pynini.compose(telephone_graph, v_telephone_graph), sem_w) + | pynutil.add_weight(pynini.compose(electronic_graph, v_electronic_graph), sem_w) + | pynutil.add_weight(pynini.compose(fraction_graph, v_fraction_graph), sem_w) + | pynutil.add_weight(pynini.compose(money_graph, v_money_graph), sem_w) + | pynutil.add_weight(cardinal_or_date_final, sem_w) + | pynutil.add_weight(whitelist_graph, sem_w) + | pynutil.add_weight( + pynini.compose(serial_graph, v_word_graph), 1.1001 + ) # should be higher than the rest of the classes + ).optimize() + + roman_graph = RomanFst(deterministic=deterministic, lm=True).fst + # the weight matches the word_graph weight for "I" cases in long sentences with multiple semiotic tokens + classify_and_verbalize |= pynutil.add_weight(pynini.compose(roman_graph, v_roman_graph), sem_w) + + date_final = pynini.compose(date_graph, v_date_graph) + range_graph = RangeFst( + time=time_final, cardinal=cardinal_tagger, date=date_final, deterministic=deterministic + ).fst + classify_and_verbalize |= pynutil.add_weight(pynini.compose(range_graph, v_word_graph), sem_w) + classify_and_verbalize = pynutil.insert("< ") + classify_and_verbalize + pynutil.insert(" >") + classify_and_verbalize |= pynutil.add_weight(word_graph, word_w) + + punct_only = pynutil.add_weight(punct_graph, weight=punct_w) + punct = pynini.closure( + pynini.compose(pynini.closure(NEMO_WHITE_SPACE, 1), delete_extra_space) + | (pynutil.insert(" ") + punct_only), + 1, + ) + + def get_token_sem_graph(classify_and_verbalize): + token_plus_punct = ( + pynini.closure(punct + pynutil.insert(" ")) + + classify_and_verbalize + + pynini.closure(pynutil.insert(" ") + punct) + ) + + graph = token_plus_punct + pynini.closure( + ( + pynini.compose(pynini.closure(NEMO_WHITE_SPACE, 1), delete_extra_space) + | (pynutil.insert(" ") + punct + pynutil.insert(" ")) + ) + + token_plus_punct + ) + + graph |= punct_only + pynini.closure(punct) + graph = delete_space + graph + delete_space + + remove_extra_spaces = pynini.closure(NEMO_NOT_SPACE, 1) + pynini.closure( + delete_extra_space + pynini.closure(NEMO_NOT_SPACE, 1) + ) + remove_extra_spaces |= ( + pynini.closure(pynutil.delete(" "), 1) + + pynini.closure(NEMO_NOT_SPACE, 1) + + pynini.closure(delete_extra_space + pynini.closure(NEMO_NOT_SPACE, 1)) + ) + + graph = pynini.compose(graph.optimize(), remove_extra_spaces).optimize() + return graph + + self.fst = get_token_sem_graph(classify_and_verbalize) + no_digits = pynini.closure(pynini.difference(NEMO_CHAR, NEMO_DIGIT)) + self.fst_no_digits = pynini.compose(self.fst, no_digits).optimize() + + if far_file: + generator_main(far_file, {"tokenize_and_classify": self.fst}) diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/taggers/tokenize_and_classify_with_audio.py b/zonos3/vendor/nemo_text_processing/text_normalization/en/taggers/tokenize_and_classify_with_audio.py new file mode 100644 index 0000000000000000000000000000000000000000..1ca1d651f355e8b19ebb0e96950c4960eeea4c53 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/taggers/tokenize_and_classify_with_audio.py @@ -0,0 +1,229 @@ +# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import os + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import ( + NEMO_CHAR, + NEMO_DIGIT, + NEMO_NOT_SPACE, + NEMO_WHITE_SPACE, + GraphFst, + delete_extra_space, + delete_space, + generator_main, +) +from zonos3.vendor.nemo_text_processing.text_normalization.en.taggers.abbreviation import AbbreviationFst +from zonos3.vendor.nemo_text_processing.text_normalization.en.taggers.cardinal import CardinalFst +from zonos3.vendor.nemo_text_processing.text_normalization.en.taggers.date import DateFst +from zonos3.vendor.nemo_text_processing.text_normalization.en.taggers.decimal import DecimalFst +from zonos3.vendor.nemo_text_processing.text_normalization.en.taggers.electronic import ElectronicFst +from zonos3.vendor.nemo_text_processing.text_normalization.en.taggers.fraction import FractionFst +from zonos3.vendor.nemo_text_processing.text_normalization.en.taggers.measure import MeasureFst +from zonos3.vendor.nemo_text_processing.text_normalization.en.taggers.money import MoneyFst +from zonos3.vendor.nemo_text_processing.text_normalization.en.taggers.ordinal import OrdinalFst +from zonos3.vendor.nemo_text_processing.text_normalization.en.taggers.punctuation import PunctuationFst +from zonos3.vendor.nemo_text_processing.text_normalization.en.taggers.range import RangeFst as RangeFst +from zonos3.vendor.nemo_text_processing.text_normalization.en.taggers.roman import RomanFst +from zonos3.vendor.nemo_text_processing.text_normalization.en.taggers.serial import SerialFst +from zonos3.vendor.nemo_text_processing.text_normalization.en.taggers.telephone import TelephoneFst +from zonos3.vendor.nemo_text_processing.text_normalization.en.taggers.time import TimeFst +from zonos3.vendor.nemo_text_processing.text_normalization.en.taggers.whitelist import WhiteListFst +from zonos3.vendor.nemo_text_processing.text_normalization.en.taggers.word import WordFst +from zonos3.vendor.nemo_text_processing.text_normalization.en.verbalizers.abbreviation import AbbreviationFst as vAbbreviation +from zonos3.vendor.nemo_text_processing.text_normalization.en.verbalizers.cardinal import CardinalFst as vCardinal +from zonos3.vendor.nemo_text_processing.text_normalization.en.verbalizers.date import DateFst as vDate +from zonos3.vendor.nemo_text_processing.text_normalization.en.verbalizers.decimal import DecimalFst as vDecimal +from zonos3.vendor.nemo_text_processing.text_normalization.en.verbalizers.electronic import ElectronicFst as vElectronic +from zonos3.vendor.nemo_text_processing.text_normalization.en.verbalizers.fraction import FractionFst as vFraction +from zonos3.vendor.nemo_text_processing.text_normalization.en.verbalizers.measure import MeasureFst as vMeasure +from zonos3.vendor.nemo_text_processing.text_normalization.en.verbalizers.money import MoneyFst as vMoney +from zonos3.vendor.nemo_text_processing.text_normalization.en.verbalizers.ordinal import OrdinalFst as vOrdinal +from zonos3.vendor.nemo_text_processing.text_normalization.en.verbalizers.roman import RomanFst as vRoman +from zonos3.vendor.nemo_text_processing.text_normalization.en.verbalizers.telephone import TelephoneFst as vTelephone +from zonos3.vendor.nemo_text_processing.text_normalization.en.verbalizers.time import TimeFst as vTime +from zonos3.vendor.nemo_text_processing.text_normalization.en.verbalizers.word import WordFst as vWord +from zonos3.vendor.nemo_text_processing.utils.logging import logger + + +class ClassifyFst(GraphFst): + """ + Final class that composes all other classification grammars. This class can process an entire sentence including punctuation. + For deployment, this grammar will be compiled and exported to OpenFst Finite State Archive (FAR) File. + More details to deployment at NeMo/tools/text_processing_deployment. + + Args: + input_case: accepting either "lower_cased" or "cased" input. + deterministic: if True will provide a single transduction option, + for False multiple options (used for audio-based normalization) + cache_dir: path to a dir with .far grammar file. Set to None to avoid using cache. + overwrite_cache: set to True to overwrite .far files + whitelist: path to a file with whitelist replacements + """ + + def __init__( + self, + input_case: str, + deterministic: bool = True, + cache_dir: str = None, + overwrite_cache: bool = True, + whitelist: str = None, + ): + super().__init__(name="tokenize_and_classify", kind="classify", deterministic=deterministic) + + far_file = None + if cache_dir is not None and cache_dir != 'None': + os.makedirs(cache_dir, exist_ok=True) + whitelist_file = os.path.basename(whitelist) if whitelist else "" + far_file = os.path.join( + cache_dir, f"_{input_case}_en_tn_{deterministic}_deterministic{whitelist_file}.far" + ) + if not overwrite_cache and far_file and os.path.exists(far_file): + self.fst = pynini.Far(far_file, mode='r')['tokenize_and_classify'] + logger.info(f'ClassifyFst.fst was restored from {far_file}.') + else: + logger.info(f'Creating ClassifyFst grammars. This might take some time...') + # TAGGERS + cardinal = CardinalFst(deterministic=deterministic) + cardinal_graph = cardinal.fst + + ordinal = OrdinalFst(cardinal=cardinal, deterministic=deterministic) + deterministic_ordinal = OrdinalFst(cardinal=cardinal, deterministic=True) + ordinal_graph = ordinal.fst + + decimal = DecimalFst(cardinal=cardinal, deterministic=deterministic) + decimal_graph = decimal.fst + fraction = FractionFst(deterministic=deterministic, cardinal=cardinal) + fraction_graph = fraction.fst + + measure = MeasureFst(cardinal=cardinal, decimal=decimal, fraction=fraction, deterministic=deterministic) + measure_graph = measure.fst + date_graph = DateFst(cardinal=cardinal, deterministic=deterministic).fst + punctuation = PunctuationFst(deterministic=True) + punct_graph = punctuation.graph + word_graph = WordFst(punctuation=punctuation, deterministic=deterministic).graph + time_graph = TimeFst(cardinal=cardinal, deterministic=deterministic).fst + telephone_graph = TelephoneFst(deterministic=deterministic).fst + electronic_graph = ElectronicFst(cardinal=cardinal, deterministic=deterministic).fst + money_graph = MoneyFst(cardinal=cardinal, decimal=decimal, deterministic=deterministic).fst + whitelist = WhiteListFst(input_case=input_case, deterministic=deterministic, input_file=whitelist) + whitelist_graph = whitelist.graph + serial_graph = SerialFst(cardinal=cardinal, ordinal=deterministic_ordinal, deterministic=deterministic).fst + + # VERBALIZERS + cardinal = vCardinal(deterministic=deterministic) + v_cardinal_graph = cardinal.fst + decimal = vDecimal(cardinal=cardinal, deterministic=deterministic) + v_decimal_graph = decimal.fst + ordinal = vOrdinal(deterministic=deterministic) + v_ordinal_graph = ordinal.fst + fraction = vFraction(deterministic=deterministic) + v_fraction_graph = fraction.fst + v_telephone_graph = vTelephone(deterministic=deterministic).fst + v_electronic_graph = vElectronic(deterministic=deterministic).fst + measure = vMeasure(decimal=decimal, cardinal=cardinal, fraction=fraction, deterministic=deterministic) + v_measure_graph = measure.fst + v_time_graph = vTime(deterministic=deterministic).fst + v_date_graph = vDate(ordinal=ordinal, deterministic=deterministic).fst + v_money_graph = vMoney(decimal=decimal, deterministic=deterministic).fst + v_roman_graph = vRoman(deterministic=deterministic).fst + v_abbreviation = vAbbreviation(deterministic=deterministic).fst + + det_v_time_graph = vTime(deterministic=True).fst + det_v_date_graph = vDate(ordinal=vOrdinal(deterministic=True), deterministic=True).fst + time_final = pynini.compose(time_graph, det_v_time_graph) + date_final = pynini.compose(date_graph, det_v_date_graph) + range_graph = RangeFst( + time=time_final, date=date_final, cardinal=CardinalFst(deterministic=True), deterministic=deterministic + ).fst + v_word_graph = vWord(deterministic=deterministic).fst + + sem_w = 1 + word_w = 100 + punct_w = 2 + classify_and_verbalize = ( + pynutil.add_weight(whitelist_graph, sem_w) + | pynutil.add_weight(pynini.compose(time_graph, v_time_graph), sem_w) + | pynutil.add_weight(pynini.compose(decimal_graph, v_decimal_graph), sem_w) + | pynutil.add_weight(pynini.compose(measure_graph, v_measure_graph), sem_w) + | pynutil.add_weight(pynini.compose(cardinal_graph, v_cardinal_graph), sem_w) + | pynutil.add_weight(pynini.compose(ordinal_graph, v_ordinal_graph), sem_w) + | pynutil.add_weight(pynini.compose(telephone_graph, v_telephone_graph), sem_w) + | pynutil.add_weight(pynini.compose(electronic_graph, v_electronic_graph), sem_w) + | pynutil.add_weight(pynini.compose(fraction_graph, v_fraction_graph), sem_w) + | pynutil.add_weight(pynini.compose(money_graph, v_money_graph), sem_w) + | pynutil.add_weight(word_graph, word_w) + | pynutil.add_weight(pynini.compose(date_graph, v_date_graph), sem_w - 0.01) + | pynutil.add_weight(pynini.compose(range_graph, v_word_graph), sem_w) + | pynutil.add_weight( + pynini.compose(serial_graph, v_word_graph), 1.1001 + ) # should be higher than the rest of the classes + ).optimize() + + if not deterministic: + roman_graph = RomanFst(deterministic=deterministic).fst + # the weight matches the word_graph weight for "I" cases in long sentences with multiple semiotic tokens + classify_and_verbalize |= pynutil.add_weight(pynini.compose(roman_graph, v_roman_graph), word_w) + + abbreviation_graph = AbbreviationFst(whitelist=whitelist, deterministic=deterministic).fst + classify_and_verbalize |= pynutil.add_weight( + pynini.compose(abbreviation_graph, v_abbreviation), word_w + ) + + punct_only = pynutil.add_weight(punct_graph, weight=punct_w) + punct = pynini.closure( + pynini.compose(pynini.closure(NEMO_WHITE_SPACE, 1), delete_extra_space) + | (pynutil.insert(" ") + punct_only), + 1, + ) + + token_plus_punct = ( + pynini.closure(punct + pynutil.insert(" ")) + + classify_and_verbalize + + pynini.closure(pynutil.insert(" ") + punct) + ) + + graph = token_plus_punct + pynini.closure( + ( + pynini.compose(pynini.closure(NEMO_WHITE_SPACE, 1), delete_extra_space) + | (pynutil.insert(" ") + punct + pynutil.insert(" ")) + ) + + token_plus_punct + ) + + graph |= punct_only + pynini.closure(punct) + graph = delete_space + graph + delete_space + + remove_extra_spaces = pynini.closure(NEMO_NOT_SPACE, 1) + pynini.closure( + delete_extra_space + pynini.closure(NEMO_NOT_SPACE, 1) + ) + remove_extra_spaces |= ( + pynini.closure(pynutil.delete(" "), 1) + + pynini.closure(NEMO_NOT_SPACE, 1) + + pynini.closure(delete_extra_space + pynini.closure(NEMO_NOT_SPACE, 1)) + ) + + graph = pynini.compose(graph.optimize(), remove_extra_spaces).optimize() + self.fst = graph + + if far_file: + generator_main(far_file, {"tokenize_and_classify": self.fst}) + + # to remove normalization options that still contain digits and some special symbols + # e.g., "P&E" -> {P and E, P&E}, "P & E" will be removed from the list of normalization options + no_digits = pynini.closure(pynini.difference(NEMO_CHAR, pynini.union(NEMO_DIGIT, "&"))) + self.fst_no_digits = pynini.compose(self.fst, no_digits).optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/taggers/whitelist.py b/zonos3/vendor/nemo_text_processing/text_normalization/en/taggers/whitelist.py new file mode 100644 index 0000000000000000000000000000000000000000..b24e64a2fb6830eada3ef2ffedbe09d0c32d9f67 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/taggers/whitelist.py @@ -0,0 +1,153 @@ +# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import ( + INPUT_CASED, + INPUT_LOWER_CASED, + NEMO_CHAR, + NEMO_NOT_SPACE, + NEMO_SIGMA, + NEMO_UPPER, + SINGULAR_TO_PLURAL, + GraphFst, + convert_space, +) +from zonos3.vendor.nemo_text_processing.text_normalization.en.taggers.roman import get_names +from zonos3.vendor.nemo_text_processing.text_normalization.en.utils import ( + augment_labels_with_punct_at_end, + get_abs_path, + load_labels, +) + + +class WhiteListFst(GraphFst): + """ + Finite state transducer for classifying whitelist, e.g. + misses -> tokens { name: "mrs" } + for non-deterministic case: "Dr. Abc" -> + tokens { name: "drive" } tokens { name: "Abc" } + tokens { name: "doctor" } tokens { name: "Abc" } + tokens { name: "Dr." } tokens { name: "Abc" } + This class has highest priority among all classifier grammars. Whitelisted tokens are defined and loaded from "data/whitelist.tsv". + + Args: + input_case: accepting either "lower_cased" or "cased" input. + deterministic: if True will provide a single transduction option, + for False multiple options (used for audio-based normalization) + input_file: path to a file with whitelist replacements + """ + + def __init__(self, input_case: str, deterministic: bool = True, input_file: str = None): + super().__init__(name="whitelist", kind="classify", deterministic=deterministic) + + def _get_whitelist_graph(input_case, file, keep_punct_add_end: bool = False): + whitelist = load_labels(file) + if input_case == INPUT_LOWER_CASED: + whitelist = [[x.lower(), y] for x, y in whitelist] + else: + whitelist = [[x, y] for x, y in whitelist] + + if keep_punct_add_end: + whitelist.extend(augment_labels_with_punct_at_end(whitelist)) + + graph = pynini.string_map(whitelist) + return graph + + graph = _get_whitelist_graph(input_case, get_abs_path("data/whitelist/tts.tsv")) + graph |= pynini.compose( + pynini.difference(NEMO_SIGMA, pynini.accep("/")).optimize(), + _get_whitelist_graph(input_case, get_abs_path("data/whitelist/symbol.tsv")), + ).optimize() + + if deterministic: + names = get_names() + graph |= ( + pynini.cross(pynini.union("st", "St", "ST"), "Saint") + + pynini.closure(pynutil.delete(".")) + + pynini.accep(" ") + + names + ) + else: + graph |= _get_whitelist_graph( + input_case, get_abs_path("data/whitelist/alternatives.tsv"), keep_punct_add_end=True + ) + + for x in [".", ". "]: + graph |= ( + NEMO_UPPER + + pynini.closure(pynutil.delete(x) + NEMO_UPPER, 2) + + pynini.closure(pynutil.delete("."), 0, 1) + ) + + if not deterministic: + multiple_forms_whitelist_graph = get_formats(get_abs_path("data/whitelist/alternatives_all_format.tsv")) + graph |= multiple_forms_whitelist_graph + + graph_unit = pynini.string_file(get_abs_path("data/measure/unit.tsv")) | pynini.string_file( + get_abs_path("data/measure/unit_alternatives.tsv") + ) + graph_unit_plural = graph_unit @ SINGULAR_TO_PLURAL + units_graph = pynini.compose(NEMO_CHAR ** (3, ...), convert_space(graph_unit | graph_unit_plural)) + graph |= units_graph + + # convert to states only if comma is present before the abbreviation to avoid converting all caps words, + # e.g. "IN", "OH", "OK" + # TODO or only exclude above? + states = load_labels(get_abs_path("data/address/state.tsv")) + additional_options = [] + for x, y in states: + if input_case == INPUT_LOWER_CASED: + x = x.lower() + additional_options.append((x, f"{y[0]}.{y[1:]}")) + if not deterministic: + additional_options.append((x, f"{y[0]}.{y[1:]}.")) + + states.extend(additional_options) + state_graph = pynini.string_map(states) + graph |= pynini.closure(NEMO_NOT_SPACE, 1) + pynini.union(", ", ",") + pynini.invert(state_graph).optimize() + + if input_file: + whitelist_provided = _get_whitelist_graph(input_case, input_file) + if not deterministic: + graph |= whitelist_provided + else: + graph = whitelist_provided + + self.graph = (convert_space(graph)).optimize() + + self.fst = (pynutil.insert("name: \"") + self.graph + pynutil.insert("\"")).optimize() + + +def get_formats(input_f, input_case=INPUT_CASED, is_default=True): + """ + Adds various abbreviation format options to the list of acceptable input forms + """ + multiple_formats = load_labels(input_f) + additional_options = [] + for x, y in multiple_formats: + if input_case == INPUT_LOWER_CASED: + x = x.lower() + additional_options.append((f"{x}.", y)) # default "dr" -> doctor, this includes period "dr." -> doctor + additional_options.append((f"{x[0].upper() + x[1:]}", f"{y[0].upper() + y[1:]}")) # "Dr" -> Doctor + additional_options.append((f"{x[0].upper() + x[1:]}.", f"{y[0].upper() + y[1:]}")) # "Dr." -> Doctor + multiple_formats.extend(additional_options) + + if not is_default: + multiple_formats = [(x, f"|raw_start|{x}|raw_end||norm_start|{y}|norm_end|") for (x, y) in multiple_formats] + + multiple_formats = pynini.string_map(multiple_formats) + return multiple_formats diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/taggers/word.py b/zonos3/vendor/nemo_text_processing/text_normalization/en/taggers/word.py new file mode 100644 index 0000000000000000000000000000000000000000..87aec0aea85330424f248795d5d1d50477956bd7 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/taggers/word.py @@ -0,0 +1,91 @@ +# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.examples import plurals +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import ( + MIN_NEG_WEIGHT, + NEMO_ALPHA, + NEMO_DIGIT, + NEMO_NOT_SPACE, + NEMO_SIGMA, + GraphFst, + convert_space, + get_abs_path, +) +from zonos3.vendor.nemo_text_processing.text_normalization.en.taggers.punctuation import PunctuationFst + + +class WordFst(GraphFst): + """ + Finite state transducer for classifying word. Considers sentence boundary exceptions. + e.g. sleep -> tokens { name: "sleep" } + + Args: + punctuation: PunctuationFst + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, punctuation: GraphFst, deterministic: bool = True): + super().__init__(name="word", kind="classify", deterministic=deterministic) + + punct = PunctuationFst().graph + default_graph = pynini.closure(pynini.difference(NEMO_NOT_SPACE, punct.project("input")), 1) + symbols_to_exclude = (pynini.union("$", "€", "₩", "£", "¥", "#", "%") | NEMO_DIGIT).optimize() + graph = pynini.closure(pynini.difference(NEMO_NOT_SPACE, symbols_to_exclude), 1) + graph = pynutil.add_weight(graph, MIN_NEG_WEIGHT) | default_graph + + # leave phones of format [HH AH0 L OW1] untouched + phoneme_unit = pynini.closure(NEMO_ALPHA, 1) + pynini.closure(NEMO_DIGIT) + phoneme = ( + pynini.accep(pynini.escape("[")) + + pynini.closure(phoneme_unit + pynini.accep(" ")) + + phoneme_unit + + pynini.accep(pynini.escape("]")) + ) + + # leave IPA phones of format [ˈdoʊv] untouched, single words and sentences with punctuation marks allowed + punct_marks = pynini.union(*punctuation.punct_marks).optimize() + stress = pynini.union("ˈ", "'", "ˌ") + ipa_phoneme_unit = pynini.string_file(get_abs_path("data/whitelist/ipa_symbols.tsv")) + # word in ipa form + ipa_phonemes = ( + pynini.closure(stress, 0, 1) + + pynini.closure(ipa_phoneme_unit, 1) + + pynini.closure(stress | ipa_phoneme_unit) + ) + # allow sentences of words in IPA format separated with spaces or punct marks + delim = (punct_marks | pynini.accep(" ")) ** (1, ...) + ipa_phonemes = ipa_phonemes + pynini.closure(delim + ipa_phonemes) + pynini.closure(delim, 0, 1) + ipa_phonemes = (pynini.accep(pynini.escape("[")) + ipa_phonemes + pynini.accep(pynini.escape("]"))).optimize() + + if not deterministic: + phoneme = ( + pynini.accep(pynini.escape("[")) + + pynini.closure(pynini.accep(" "), 0, 1) + + pynini.closure(phoneme_unit + pynini.accep(" ")) + + phoneme_unit + + pynini.closure(pynini.accep(" "), 0, 1) + + pynini.accep(pynini.escape("]")) + ).optimize() + ipa_phonemes = ( + pynini.accep(pynini.escape("[")) + ipa_phonemes + pynini.accep(pynini.escape("]")) + ).optimize() + + phoneme |= ipa_phonemes + self.graph = plurals._priority_union(convert_space(phoneme.optimize()), graph, NEMO_SIGMA) + self.fst = (pynutil.insert("name: \"") + self.graph + pynutil.insert("\"")).optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/utils.py b/zonos3/vendor/nemo_text_processing/text_normalization/en/utils.py new file mode 100644 index 0000000000000000000000000000000000000000..a2a765a06cb6ddba97575cba8662f2498140f606 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/utils.py @@ -0,0 +1,60 @@ +# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import csv +import os + + +def get_abs_path(rel_path): + """ + Get absolute path + + Args: + rel_path: relative path to this file + + Returns absolute path + """ + return os.path.dirname(os.path.abspath(__file__)) + '/' + rel_path + + +def load_labels(abs_path): + """ + loads relative path file as dictionary + + Args: + abs_path: absolute path + + Returns dictionary of mappings + """ + with open(abs_path, encoding="utf-8") as label_tsv: + labels = list(csv.reader(label_tsv, delimiter="\t")) + return labels + + +def augment_labels_with_punct_at_end(labels): + """ + augments labels: if key ends on a punctuation that value does not have, add a new label + where the value maintains the punctuation + + Args: + labels : input labels + Returns: + additional labels + """ + res = [] + for label in labels: + if len(label) > 1: + if label[0][-1] == "." and label[1][-1] != ".": + res.append([label[0], label[1] + "."] + label[2:]) + return res diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/verbalizers/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/en/verbalizers/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..bc443be41c4c3fcf0764eb9fd3e1828d63f8438c --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/verbalizers/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/verbalizers/abbreviation.py b/zonos3/vendor/nemo_text_processing/text_normalization/en/verbalizers/abbreviation.py new file mode 100644 index 0000000000000000000000000000000000000000..d8c9854532ffdefcbe71fd273fa622f73902a149 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/verbalizers/abbreviation.py @@ -0,0 +1,36 @@ +# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import NEMO_NOT_QUOTE, GraphFst + + +class AbbreviationFst(GraphFst): + """ + Finite state transducer for verbalizing abbreviations + e.g. tokens { abbreviation { value: "A B C" } } -> "ABC" + + Args: + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="abbreviation", kind="verbalize", deterministic=deterministic) + + graph = pynutil.delete("value: \"") + pynini.closure(NEMO_NOT_QUOTE, 1) + pynutil.delete("\"") + delete_tokens = self.delete_tokens(graph) + self.fst = delete_tokens.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/verbalizers/cardinal.py b/zonos3/vendor/nemo_text_processing/text_normalization/en/verbalizers/cardinal.py new file mode 100644 index 0000000000000000000000000000000000000000..8d5bb9811187c99bc2ebd20a59690164bc74037e --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/verbalizers/cardinal.py @@ -0,0 +1,48 @@ +# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import NEMO_NOT_QUOTE, GraphFst, delete_space + + +class CardinalFst(GraphFst): + """ + Finite state transducer for verbalizing cardinal, e.g. + cardinal { negative: "true" integer: "23" } -> minus twenty three + + Args: + deterministic: if True will provide a single transduction option, + for False multiple options (used for audio-based normalization) + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="cardinal", kind="verbalize", deterministic=deterministic) + + self.optional_sign = pynini.cross("negative: \"true\"", "minus ") + if not deterministic: + self.optional_sign |= pynini.cross("negative: \"true\"", "negative ") + self.optional_sign |= pynini.cross("negative: \"true\"", "dash ") + + self.optional_sign = pynini.closure(self.optional_sign + delete_space, 0, 1) + + integer = pynini.closure(NEMO_NOT_QUOTE) + + self.integer = delete_space + pynutil.delete("\"") + integer + pynutil.delete("\"") + integer = pynutil.delete("integer:") + self.integer + + self.numbers = self.optional_sign + integer + delete_tokens = self.delete_tokens(self.numbers) + self.fst = delete_tokens.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/verbalizers/date.py b/zonos3/vendor/nemo_text_processing/text_normalization/en/verbalizers/date.py new file mode 100644 index 0000000000000000000000000000000000000000..bf42b7a3f0a580bff1706fc259c1d6bbaa63ffab --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/verbalizers/date.py @@ -0,0 +1,107 @@ +# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.examples import plurals +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import ( + NEMO_NOT_QUOTE, + NEMO_SIGMA, + GraphFst, + delete_extra_space, + delete_space, +) + + +class DateFst(GraphFst): + """ + Finite state transducer for verbalizing date, e.g. + date { month: "february" day: "five" year: "twenty twelve" preserve_order: true } -> february fifth twenty twelve + date { day: "five" month: "february" year: "twenty twelve" preserve_order: true } -> the fifth of february twenty twelve + + Args: + ordinal: OrdinalFst + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, ordinal: GraphFst, deterministic: bool = True, lm: bool = False): + super().__init__(name="date", kind="verbalize", deterministic=deterministic) + + phrase = pynini.closure(NEMO_NOT_QUOTE, 1) + day_cardinal = ( + pynutil.delete("day:") + + delete_space + + pynutil.delete("\"") + + pynini.closure(NEMO_NOT_QUOTE, 1) + + pynutil.delete("\"") + ) + day = day_cardinal @ ordinal.suffix + period = pynutil.delete("text:") + delete_space + pynutil.delete("\"") + phrase + pynutil.delete("\"") + month = pynutil.delete("month:") + delete_space + pynutil.delete("\"") + phrase + pynutil.delete("\"") + + year = ( + pynutil.delete("year:") + + delete_space + + pynutil.delete("\"") + + pynini.closure(NEMO_NOT_QUOTE, 1) + + delete_space + + pynutil.delete("\"") + ) + + # financial period + graph_fy = ( + pynutil.insert("the ") + period + pynutil.insert(" of ") + pynini.closure(delete_extra_space + year, 0, 1) + ) + + # month (day) year + graph_mdy = ( + month + pynini.closure(delete_extra_space + day, 0, 1) + pynini.closure(delete_extra_space + year, 0, 1) + ) + # may 5 -> may five + if not deterministic and not lm: + graph_mdy |= ( + month + + pynini.closure(delete_extra_space + day_cardinal, 0, 1) + + pynini.closure(delete_extra_space + year, 0, 1) + ) + + # day month year + graph_dmy = ( + pynutil.insert("the ") + + day + + delete_extra_space + + pynutil.insert("of ") + + month + + pynini.closure(delete_extra_space + year, 0, 1) + ) + + optional_preserve_order = pynini.closure( + pynutil.delete("preserve_order:") + delete_space + pynutil.delete("true") + delete_space + | pynutil.delete("field_order:") + + delete_space + + pynutil.delete("\"") + + NEMO_NOT_QUOTE + + pynutil.delete("\"") + + delete_space + ) + + final_graph = ( + (plurals._priority_union(graph_mdy, pynutil.add_weight(graph_dmy, 0.0001), NEMO_SIGMA) | year | graph_fy) + + delete_space + + optional_preserve_order + ) + delete_tokens = self.delete_tokens(final_graph) + self.fst = delete_tokens.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/verbalizers/decimal.py b/zonos3/vendor/nemo_text_processing/text_normalization/en/verbalizers/decimal.py new file mode 100644 index 0000000000000000000000000000000000000000..efbb42de9404f62206bc3d0dc2d2b5f0918a0f2f --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/verbalizers/decimal.py @@ -0,0 +1,85 @@ +# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import ( + NEMO_NOT_QUOTE, + NEMO_SIGMA, + GraphFst, + delete_space, + insert_space, +) + + +class DecimalFst(GraphFst): + """ + Finite state transducer for verbalizing decimal, e.g. + decimal { negative: "true" integer_part: "twelve" fractional_part: "five o o six" quantity: "billion" } -> minus twelve point five o o six billion + + Args: + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, cardinal, deterministic: bool = True): + super().__init__(name="decimal", kind="verbalize", deterministic=deterministic) + self.optional_sign = pynini.cross("negative: \"true\"", "minus ") + if not deterministic: + self.optional_sign |= pynini.cross("negative: \"true\"", "negative ") + self.optional_sign = pynini.closure(self.optional_sign + delete_space, 0, 1) + self.integer = pynutil.delete("integer_part:") + cardinal.integer + self.optional_integer = pynini.closure(self.integer + delete_space + insert_space, 0, 1) + self.fractional_default = ( + pynutil.delete("fractional_part:") + + delete_space + + pynutil.delete("\"") + + pynini.closure(NEMO_NOT_QUOTE, 1) + + pynutil.delete("\"") + ) + + self.fractional = pynutil.insert("point ") + self.fractional_default + + self.quantity = ( + delete_space + + insert_space + + pynutil.delete("quantity:") + + delete_space + + pynutil.delete("\"") + + pynini.closure(NEMO_NOT_QUOTE, 1) + + pynutil.delete("\"") + ) + self.optional_quantity = pynini.closure(self.quantity, 0, 1) + + graph = self.optional_sign + ( + self.integer + | (self.integer + self.quantity) + | (self.optional_integer + self.fractional + self.optional_quantity) + ) + + self.numbers = graph + delete_tokens = self.delete_tokens(graph) + if not deterministic: + delete_tokens |= pynini.compose( + delete_tokens, + NEMO_SIGMA + + ( + pynini.cross(" point five", " and a half") + | pynini.cross("zero point five", "half") + | pynini.cross(" point two five", " and a quarter") + | pynini.cross("zero point two five", "quarter") + ), + ).optimize() + self.fst = delete_tokens.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/verbalizers/electronic.py b/zonos3/vendor/nemo_text_processing/text_normalization/en/verbalizers/electronic.py new file mode 100644 index 0000000000000000000000000000000000000000..9f9bb17b3723c131bf9253f01a32b2998f4564e3 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/verbalizers/electronic.py @@ -0,0 +1,122 @@ +# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.examples import plurals +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import ( + MIN_NEG_WEIGHT, + NEMO_ALPHA, + NEMO_CHAR, + NEMO_LOWER, + NEMO_NOT_QUOTE, + NEMO_SIGMA, + NEMO_SPACE, + TO_LOWER, + GraphFst, + delete_extra_space, + delete_space, + insert_space, +) +from zonos3.vendor.nemo_text_processing.text_normalization.en.utils import get_abs_path + + +class ElectronicFst(GraphFst): + """ + Finite state transducer for verbalizing electronic + e.g. tokens { electronic { username: "cdf1" domain: "abc.edu" } } -> c d f one at a b c dot e d u + + Args: + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="electronic", kind="verbalize", deterministic=deterministic) + graph_digit_no_zero = pynini.invert(pynini.string_file(get_abs_path("data/number/digit.tsv"))).optimize() + graph_zero = pynini.cross("0", "zero") + long_numbers = pynutil.add_weight(graph_digit_no_zero + pynini.cross("000", " thousand"), MIN_NEG_WEIGHT) + + if not deterministic: + graph_zero |= pynini.cross("0", "o") | pynini.cross("0", "oh") + + graph_digit = graph_digit_no_zero | graph_zero + graph_symbols = pynini.string_file(get_abs_path("data/electronic/symbol.tsv")).optimize() + + NEMO_NOT_BRACKET = pynini.difference(NEMO_CHAR, pynini.union("{", "}")).optimize() + dict_words = pynini.project(pynini.string_file(get_abs_path("data/electronic/words.tsv")), "output") + default_chars_symbols = pynini.cdrewrite( + pynutil.insert(" ") + (graph_symbols | graph_digit | long_numbers) + pynutil.insert(" "), + "", + "", + NEMO_SIGMA, + ) + default_chars_symbols = pynini.compose( + pynini.closure(NEMO_NOT_BRACKET), default_chars_symbols.optimize() + ).optimize() + + # this is far cases when user name was split by dictionary words, i.e. "sevicepart@ab.com" -> "service part" + space_separated_dict_words = pynutil.add_weight( + NEMO_ALPHA + + pynini.closure(NEMO_ALPHA | NEMO_SPACE) + + NEMO_SPACE + + pynini.closure(NEMO_ALPHA | NEMO_SPACE), + MIN_NEG_WEIGHT, + ) + + user_name = ( + pynutil.delete("username:") + + delete_space + + pynutil.delete("\"") + + (default_chars_symbols | space_separated_dict_words).optimize() + + pynutil.delete("\"") + ) + + domain_common = pynini.string_file(get_abs_path("data/electronic/domain.tsv")) + + # this will be used for a safe fallback + domain_all = pynini.compose( + default_chars_symbols, + pynini.closure(TO_LOWER | NEMO_LOWER | NEMO_SPACE | pynutil.add_weight(dict_words, MIN_NEG_WEIGHT)), + ) + + domain = ( + domain_all + + insert_space + + plurals._priority_union( + domain_common, pynutil.add_weight(pynini.cross(".", "dot"), weight=0.0001), NEMO_SIGMA + ) + + pynini.closure(insert_space + default_chars_symbols, 0, 1) + ) + + domain = ( + pynutil.delete("domain:") + + delete_space + + pynutil.delete("\"") + + (domain | pynutil.add_weight(domain_all, weight=100)).optimize() + + delete_space + + pynutil.delete("\"") + ).optimize() + + protocol = pynutil.delete("protocol: \"") + pynini.closure(NEMO_NOT_QUOTE, 1) + pynutil.delete("\"") + graph = ( + pynini.closure(protocol + delete_space, 0, 1) + + pynini.closure(user_name + delete_space + pynutil.insert(" at ") + delete_space, 0, 1) + + domain + + delete_space + ).optimize() @ pynini.cdrewrite(delete_extra_space, "", "", NEMO_SIGMA) + + delete_tokens = self.delete_tokens(graph) + self.fst = delete_tokens.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/verbalizers/fraction.py b/zonos3/vendor/nemo_text_processing/text_normalization/en/verbalizers/fraction.py new file mode 100644 index 0000000000000000000000000000000000000000..7c98c8a6c279cbf2f70815499e2b5ac4ee364302 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/verbalizers/fraction.py @@ -0,0 +1,89 @@ +# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.examples import plurals +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import NEMO_NOT_QUOTE, NEMO_SIGMA, GraphFst, insert_space +from zonos3.vendor.nemo_text_processing.text_normalization.en.verbalizers.ordinal import OrdinalFst + + +class FractionFst(GraphFst): + """ + Finite state transducer for verbalizing fraction + e.g. tokens { fraction { integer: "twenty three" numerator: "four" denominator: "five" } } -> + twenty three and four fifth + + Args: + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, deterministic: bool = True, lm: bool = False): + super().__init__(name="fraction", kind="verbalize", deterministic=deterministic) + suffix = OrdinalFst().suffix + + integer = pynutil.delete("integer_part: \"") + pynini.closure(NEMO_NOT_QUOTE) + pynutil.delete("\" ") + denominator_one = pynini.cross("denominator: \"one\"", "over one") + denominator_half = pynini.cross("denominator: \"two\"", "half") + denominator_quarter = pynini.cross("denominator: \"four\"", "quarter") + + denominator_rest = ( + pynutil.delete("denominator: \"") + pynini.closure(NEMO_NOT_QUOTE) @ suffix + pynutil.delete("\"") + ) + + denominators = plurals._priority_union( + denominator_one, + plurals._priority_union( + denominator_half, + plurals._priority_union(denominator_quarter, denominator_rest, NEMO_SIGMA), + NEMO_SIGMA, + ), + NEMO_SIGMA, + ).optimize() + if not deterministic: + denominators |= pynutil.delete("denominator: \"") + (pynini.accep("four") @ suffix) + pynutil.delete("\"") + + numerator_one = pynutil.delete("numerator: \"") + pynini.accep("one") + pynutil.delete("\" ") + numerator_one = numerator_one + insert_space + denominators + numerator_rest = ( + pynutil.delete("numerator: \"") + + (pynini.closure(NEMO_NOT_QUOTE) - pynini.accep("one")) + + pynutil.delete("\" ") + ) + numerator_rest = numerator_rest + insert_space + denominators + numerator_rest @= pynini.cdrewrite( + plurals._priority_union(pynini.cross("half", "halves"), pynutil.insert("s"), NEMO_SIGMA), + "", + "[EOS]", + NEMO_SIGMA, + ) + + graph = numerator_one | numerator_rest + + conjunction = pynutil.insert("and ") + if not deterministic and not lm: + conjunction = pynini.closure(conjunction, 0, 1) + + integer = pynini.closure(integer + insert_space + conjunction, 0, 1) + + graph = integer + graph + graph @= pynini.cdrewrite( + pynini.cross("and one half", "and a half") | pynini.cross("over ones", "over one"), "", "[EOS]", NEMO_SIGMA + ) + + self.graph = graph + delete_tokens = self.delete_tokens(self.graph) + self.fst = delete_tokens.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/verbalizers/measure.py b/zonos3/vendor/nemo_text_processing/text_normalization/en/verbalizers/measure.py new file mode 100644 index 0000000000000000000000000000000000000000..076cb3a4f4c31a70537218c830bd5288728c09a0 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/verbalizers/measure.py @@ -0,0 +1,122 @@ +# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import ( + NEMO_NOT_QUOTE, + NEMO_SIGMA, + GraphFst, + delete_space, + insert_space, +) + + +class MeasureFst(GraphFst): + """ + Finite state transducer for verbalizing measure, e.g. + measure { negative: "true" cardinal { integer: "twelve" } units: "kilograms" } -> minus twelve kilograms + measure { decimal { integer_part: "twelve" fractional_part: "five" } units: "kilograms" } -> twelve point five kilograms + tokens { measure { units: "covid" decimal { integer_part: "nineteen" fractional_part: "five" } } } -> covid nineteen point five + + Args: + decimal: DecimalFst + cardinal: CardinalFst + fraction: FractionFst + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, decimal: GraphFst, cardinal: GraphFst, fraction: GraphFst, deterministic: bool = True): + super().__init__(name="measure", kind="verbalize", deterministic=deterministic) + optional_sign = cardinal.optional_sign + unit = ( + pynutil.delete("units: \"") + + pynini.difference(pynini.closure(NEMO_NOT_QUOTE, 1), pynini.union("address", "math")) + + pynutil.delete("\"") + + delete_space + ) + + if not deterministic: + unit |= pynini.compose(unit, pynini.cross(pynini.union("inch", "inches"), "\"")) + + graph_decimal = ( + pynutil.delete("decimal {") + + delete_space + + optional_sign + + delete_space + + decimal.numbers + + delete_space + + pynutil.delete("}") + ) + + if not deterministic: + graph_decimal |= pynini.compose( + graph_decimal, + NEMO_SIGMA + + ( + pynini.cross(" point five", " and a half") + | pynini.cross("zero point five", "half") + | pynini.cross(" point two five", " and a quarter") + | pynini.cross("zero point two five", "quarter") + ), + ).optimize() + + graph_cardinal = ( + pynutil.delete("cardinal {") + + delete_space + + optional_sign + + delete_space + + cardinal.numbers + + delete_space + + pynutil.delete("}") + ) + + graph_fraction = ( + pynutil.delete("fraction {") + delete_space + fraction.graph + delete_space + pynutil.delete("}") + ) + + graph = (graph_cardinal | graph_decimal | graph_fraction) + delete_space + insert_space + unit + + # SH adds "preserve_order: true" by default + preserve_order = pynutil.delete("preserve_order:") + delete_space + pynutil.delete("true") + delete_space + graph |= unit + insert_space + (graph_cardinal | graph_decimal) + delete_space + pynini.closure(preserve_order) + # for only unit + graph |= ( + pynutil.delete("cardinal { integer: \"-\"") + + delete_space + + pynutil.delete("}") + + delete_space + + unit + + pynini.closure(preserve_order) + ) + address = ( + pynutil.delete("units: \"address\" ") + + delete_space + + graph_cardinal + + delete_space + + pynini.closure(preserve_order) + ) + math = ( + pynutil.delete("units: \"math\" ") + + delete_space + + graph_cardinal + + delete_space + + pynini.closure(preserve_order) + ) + graph |= address | math + + delete_tokens = self.delete_tokens(graph) + self.fst = delete_tokens.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/verbalizers/money.py b/zonos3/vendor/nemo_text_processing/text_normalization/en/verbalizers/money.py new file mode 100644 index 0000000000000000000000000000000000000000..7a6321bb0789f97fbf1f2f20c7d81637bdf144df --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/verbalizers/money.py @@ -0,0 +1,85 @@ +# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import ( + NEMO_NOT_QUOTE, + GraphFst, + delete_extra_space, + delete_preserve_order, +) + +from zonos3.vendor.nemo_text_processing.text_normalization.en.utils import get_abs_path + +per_units = pynini.string_file(get_abs_path("data/money/per_unit.tsv")) + + +class MoneyFst(GraphFst): + """ + Finite state transducer for verbalizing money, e.g. + money { integer_part: "twelve" fractional_part: "o five" currency: "dollars" } -> twelve o five dollars + + Args: + decimal: DecimalFst + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, decimal: GraphFst, deterministic: bool = True): + super().__init__(name="money", kind="verbalize", deterministic=deterministic) + keep_space = pynini.accep(" ") + maj = pynutil.delete('currency_maj: "') + pynini.closure(NEMO_NOT_QUOTE, 1) + pynutil.delete('"') + min = pynutil.delete('currency_min: "') + pynini.closure(NEMO_NOT_QUOTE, 1) + pynutil.delete('"') + + fractional_part = ( + pynutil.delete('fractional_part: "') + pynini.closure(NEMO_NOT_QUOTE, 1) + pynutil.delete('"') + ) + + integer_part = decimal.integer + + # *** currency_maj + graph_integer = integer_part + keep_space + maj + + # *** currency_maj + (***) | ((and) *** current_min) + fractional = fractional_part + delete_extra_space + min + + if not deterministic: + fractional |= pynutil.insert("and ") + fractional + + graph_integer_with_minor = integer_part + keep_space + maj + keep_space + fractional + delete_preserve_order + + # *** point *** currency_maj + graph_decimal = decimal.numbers + keep_space + maj + + # *** current_min + graph_minor = fractional_part + delete_extra_space + min + delete_preserve_order + + graph = graph_integer | graph_integer_with_minor | graph_decimal | graph_minor + + if not deterministic: + graph |= graph_integer + delete_preserve_order + + per_units_normalized = pynini.project(per_units, "output") + remove_per_units_normalized = ( + pynutil.delete(' morphosyntactic_features: "') + + pynutil.insert(" ") + + per_units_normalized + + pynutil.delete('" ') + ) + graph += remove_per_units_normalized.ques + + delete_tokens = self.delete_tokens(graph) + self.fst = delete_tokens.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/verbalizers/ordinal.py b/zonos3/vendor/nemo_text_processing/text_normalization/en/verbalizers/ordinal.py new file mode 100644 index 0000000000000000000000000000000000000000..1b63cabd3de4db8c7568c06c6ee8446621da7661 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/verbalizers/ordinal.py @@ -0,0 +1,57 @@ +# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import NEMO_NOT_QUOTE, NEMO_SIGMA, GraphFst, delete_space +from zonos3.vendor.nemo_text_processing.text_normalization.en.utils import get_abs_path + + +class OrdinalFst(GraphFst): + """ + Finite state transducer for verbalizing ordinal, e.g. + ordinal { integer: "thirteen" } } -> thirteenth + + Args: + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="ordinal", kind="verbalize", deterministic=deterministic) + + graph_digit = pynini.string_file(get_abs_path("data/ordinal/digit.tsv")).invert() + graph_teens = pynini.string_file(get_abs_path("data/ordinal/teen.tsv")).invert() + + graph = ( + pynutil.delete("integer:") + + delete_space + + pynutil.delete("\"") + + pynini.closure(NEMO_NOT_QUOTE, 1) + + pynutil.delete("\"") + ) + convert_rest = pynutil.insert("th") + + suffix = pynini.cdrewrite( + graph_digit | graph_teens | pynini.cross("ty", "tieth") | convert_rest, + "", + "[EOS]", + NEMO_SIGMA, + ).optimize() + self.graph = pynini.compose(graph, suffix) + self.suffix = suffix + delete_tokens = self.delete_tokens(self.graph) + self.fst = delete_tokens.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/verbalizers/post_processing.py b/zonos3/vendor/nemo_text_processing/text_normalization/en/verbalizers/post_processing.py new file mode 100644 index 0000000000000000000000000000000000000000..726411d2e920bbf0e6d5ac956c85ff564e6e5092 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/verbalizers/post_processing.py @@ -0,0 +1,182 @@ +# Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import os + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import ( + MIN_NEG_WEIGHT, + NEMO_ALPHA, + NEMO_CHAR, + NEMO_SIGMA, + NEMO_SPACE, + generator_main, +) +from zonos3.vendor.nemo_text_processing.text_normalization.en.taggers.punctuation import PunctuationFst +from zonos3.vendor.nemo_text_processing.utils.logging import logger + + +class PostProcessingFst: + """ + Finite state transducer that post-processing an entire sentence after verbalization is complete, e.g. + removes extra spaces around punctuation marks " ( one hundred and twenty three ) " -> "(one hundred and twenty three)" + + Args: + cache_dir: path to a dir with .far grammar file. Set to None to avoid using cache. + overwrite_cache: set to True to overwrite .far files + """ + + def __init__(self, cache_dir: str = None, overwrite_cache: bool = False): + + far_file = None + if cache_dir is not None and cache_dir != "None": + os.makedirs(cache_dir, exist_ok=True) + far_file = os.path.join(cache_dir, "en_tn_post_processing.far") + if not overwrite_cache and far_file and os.path.exists(far_file): + self.fst = pynini.Far(far_file, mode="r")["post_process_graph"] + logger.info(f'Post processing graph was restored from {far_file}.') + else: + self.set_punct_dict() + self.fst = self.get_punct_postprocess_graph() + + if far_file: + generator_main(far_file, {"post_process_graph": self.fst}) + + def set_punct_dict(self): + self.punct_marks = { + "'": [ + "'", + '´', + 'ʹ', + 'ʻ', + 'ʼ', + 'ʽ', + 'ʾ', + 'ˈ', + 'ˊ', + 'ˋ', + '˴', + 'ʹ', + '΄', + '՚', + '՝', + 'י', + '׳', + 'ߴ', + 'ߵ', + 'ᑊ', + 'ᛌ', + '᾽', + '᾿', + '`', + '´', + '῾', + '‘', + '’', + '‛', + '′', + '‵', + 'ꞌ', + ''', + '`', + '𖽑', + '𖽒', + ], + } + + def get_punct_postprocess_graph(self): + """ + Returns graph to post process punctuation marks. + + {``} quotes are converted to {"}. Note, if there are spaces around single quote {'}, they will be kept. + By default, a space is added after a punctuation mark, and spaces are removed before punctuation marks. + """ + punct_marks_all = PunctuationFst().punct_marks + + # no_space_before_punct assume no space before them + quotes = ["'", "\"", "``", "«"] + dashes = ["-", "—"] + brackets = ["<", "{", "(", r"\["] + open_close_single_quotes = [ + ("`", "`"), + ] + + open_close_double_quotes = [('"', '"'), ("``", "``"), ("“", "”")] + open_close_symbols = open_close_single_quotes + open_close_double_quotes + allow_space_before_punct = ["&"] + quotes + dashes + brackets + [k[0] for k in open_close_symbols] + + no_space_before_punct = [m for m in punct_marks_all if m not in allow_space_before_punct] + no_space_before_punct = pynini.union(*no_space_before_punct) + no_space_after_punct = pynini.union(*brackets) + delete_space = pynutil.delete(" ") + delete_space_optional = pynini.closure(delete_space, 0, 1) + + # non_punct allows space + # delete space before no_space_before_punct marks, if present + non_punct = pynini.difference(NEMO_CHAR, no_space_before_punct).optimize() + graph = ( + pynini.closure(non_punct) + + pynini.closure( + no_space_before_punct | pynutil.add_weight(delete_space + no_space_before_punct, MIN_NEG_WEIGHT) + ) + + pynini.closure(non_punct) + ) + graph = pynini.closure(graph).optimize() + graph = pynini.compose( + graph, pynini.cdrewrite(pynini.cross("``", '"'), "", "", NEMO_SIGMA).optimize() + ).optimize() + + # remove space after no_space_after_punct (even if there are no matching closing brackets) + no_space_after_punct = pynini.cdrewrite(delete_space, no_space_after_punct, NEMO_SIGMA, NEMO_SIGMA).optimize() + graph = pynini.compose(graph, no_space_after_punct).optimize() + + # remove space around text in quotes + single_quote = pynutil.add_weight(pynini.accep("`"), MIN_NEG_WEIGHT) + double_quotes = pynutil.add_weight(pynini.accep('"'), MIN_NEG_WEIGHT) + quotes_graph = ( + single_quote + delete_space_optional + NEMO_ALPHA + NEMO_SIGMA + delete_space_optional + single_quote + ).optimize() + + # this is to make sure multiple quotes are tagged from right to left without skipping any quotes in the left + not_alpha = pynini.difference(NEMO_CHAR, NEMO_ALPHA).optimize() | pynutil.add_weight( + NEMO_SPACE, MIN_NEG_WEIGHT + ) + end = pynini.closure(pynutil.add_weight(not_alpha, MIN_NEG_WEIGHT)) + quotes_graph |= ( + double_quotes + + delete_space_optional + + NEMO_ALPHA + + NEMO_SIGMA + + delete_space_optional + + double_quotes + + end + ) + + quotes_graph = pynutil.add_weight(quotes_graph, MIN_NEG_WEIGHT) + quotes_graph = NEMO_SIGMA + pynini.closure(NEMO_SIGMA + quotes_graph + NEMO_SIGMA) + + graph = pynini.compose(graph, quotes_graph).optimize() + + # remove space between a word and a single quote followed by s + remove_space_around_single_quote = pynini.cdrewrite( + delete_space_optional + pynini.union(*self.punct_marks["'"]) + delete_space, + NEMO_ALPHA, + pynini.union("s ", "s[EOS]"), + NEMO_SIGMA, + ) + + graph = pynini.compose(graph, remove_space_around_single_quote).optimize() + return graph diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/verbalizers/roman.py b/zonos3/vendor/nemo_text_processing/text_normalization/en/verbalizers/roman.py new file mode 100644 index 0000000000000000000000000000000000000000..38837108f33ac99f15bbe713c98578ef2e97494b --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/verbalizers/roman.py @@ -0,0 +1,69 @@ +# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import NEMO_NOT_QUOTE, GraphFst +from zonos3.vendor.nemo_text_processing.text_normalization.en.verbalizers.ordinal import OrdinalFst + + +class RomanFst(GraphFst): + """ + Finite state transducer for verbalizing roman numerals + e.g. tokens { roman { integer: "one" } } -> one + + Args: + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="roman", kind="verbalize", deterministic=deterministic) + suffix = OrdinalFst().suffix + + cardinal = pynini.closure(NEMO_NOT_QUOTE) + ordinal = pynini.compose(cardinal, suffix) + + graph = ( + pynutil.delete("key_cardinal: \"") + + pynini.closure(NEMO_NOT_QUOTE, 1) + + pynutil.delete("\"") + + pynini.accep(" ") + + pynutil.delete("integer: \"") + + cardinal + + pynutil.delete("\"") + ).optimize() + + graph |= ( + pynutil.delete("default_cardinal: \"default\" integer: \"") + cardinal + pynutil.delete("\"") + ).optimize() + + graph |= ( + pynutil.delete("default_ordinal: \"default\" integer: \"") + ordinal + pynutil.delete("\"") + ).optimize() + + graph |= ( + pynutil.delete("key_the_ordinal: \"") + + pynini.closure(NEMO_NOT_QUOTE, 1) + + pynutil.delete("\"") + + pynini.accep(" ") + + pynutil.delete("integer: \"") + + pynini.closure(pynutil.insert("the "), 0, 1) + + ordinal + + pynutil.delete("\"") + ).optimize() + + delete_tokens = self.delete_tokens(graph) + self.fst = delete_tokens.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/verbalizers/telephone.py b/zonos3/vendor/nemo_text_processing/text_normalization/en/verbalizers/telephone.py new file mode 100644 index 0000000000000000000000000000000000000000..e01ccb982902e7c151f2c725e53f4f970baa97b7 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/verbalizers/telephone.py @@ -0,0 +1,64 @@ +# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import NEMO_NOT_QUOTE, GraphFst, delete_space, insert_space + + +class TelephoneFst(GraphFst): + """ + Finite state transducer for verbalizing telephone numbers, e.g. + telephone { country_code: "one" number_part: "one two three, one two three, five six seven eight" extension: "one" } + -> one, one two three, one two three, five six seven eight, one + + Args: + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="telephone", kind="verbalize", deterministic=deterministic) + + optional_country_code = pynini.closure( + pynutil.delete("country_code: \"") + + pynini.closure(NEMO_NOT_QUOTE, 1) + + pynutil.delete("\"") + + delete_space + + insert_space, + 0, + 1, + ) + + number_part = ( + pynutil.delete("number_part: \"") + + pynini.closure(NEMO_NOT_QUOTE, 1) + + pynini.closure(pynutil.add_weight(pynutil.delete(" "), -0.0001), 0, 1) + + pynutil.delete("\"") + ) + + optional_extension = pynini.closure( + delete_space + + insert_space + + pynutil.delete("extension: \"") + + pynini.closure(NEMO_NOT_QUOTE, 1) + + pynutil.delete("\""), + 0, + 1, + ) + + graph = optional_country_code + number_part + optional_extension + delete_tokens = self.delete_tokens(graph) + self.fst = delete_tokens.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/verbalizers/time.py b/zonos3/vendor/nemo_text_processing/text_normalization/en/verbalizers/time.py new file mode 100644 index 0000000000000000000000000000000000000000..7f8e88f384acf3462cbf6af7817823fd1789cdd4 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/verbalizers/time.py @@ -0,0 +1,103 @@ +# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import ( + NEMO_NOT_QUOTE, + NEMO_SIGMA, + GraphFst, + delete_space, + insert_space, +) + + +class TimeFst(GraphFst): + """ + Finite state transducer for verbalizing time, e.g. + time { hours: "twelve" minutes: "thirty" suffix: "a m" zone: "e s t" } -> twelve thirty a m e s t + time { hours: "twelve" } -> twelve o'clock + + Args: + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="time", kind="verbalize", deterministic=deterministic) + hour = ( + pynutil.delete("hours:") + + delete_space + + pynutil.delete("\"") + + pynini.closure(NEMO_NOT_QUOTE, 1) + + pynutil.delete("\"") + ) + minute = ( + pynutil.delete("minutes:") + + delete_space + + pynutil.delete("\"") + + pynini.closure(NEMO_NOT_QUOTE, 1) + + pynutil.delete("\"") + ) + suffix = ( + pynutil.delete("suffix:") + + delete_space + + pynutil.delete("\"") + + pynini.closure(NEMO_NOT_QUOTE, 1) + + pynutil.delete("\"") + ) + optional_suffix = pynini.closure(delete_space + insert_space + suffix, 0, 1) + zone = ( + pynutil.delete("zone:") + + delete_space + + pynutil.delete("\"") + + pynini.closure(NEMO_NOT_QUOTE, 1) + + pynutil.delete("\"") + ) + optional_zone = pynini.closure(delete_space + insert_space + zone, 0, 1) + second = ( + pynutil.delete("seconds:") + + delete_space + + pynutil.delete("\"") + + pynini.closure(NEMO_NOT_QUOTE, 1) + + pynutil.delete("\"") + ) + graph_hms = ( + hour + + pynutil.insert(" hours ") + + delete_space + + minute + + pynutil.insert(" minutes and ") + + delete_space + + second + + pynutil.insert(" seconds") + + optional_suffix + + optional_zone + ) + graph_hms @= pynini.cdrewrite(pynini.cross("one hours", "one hour"), "[BOS]", "", NEMO_SIGMA) + graph_hms @= pynini.cdrewrite( + pynutil.delete("o ") + | pynutil.add_weight(pynini.cross("o one minutes", "one minute"), -0.01) + | pynutil.add_weight(pynini.cross("o one seconds", "one second"), -0.01), + " ", + "", + NEMO_SIGMA, + ) + graph = hour + delete_space + insert_space + minute + optional_suffix + optional_zone + graph |= hour + insert_space + pynutil.insert("o'clock") + optional_zone + graph |= hour + delete_space + insert_space + suffix + optional_zone + graph |= graph_hms + delete_tokens = self.delete_tokens(graph) + self.fst = delete_tokens.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/verbalizers/verbalize.py b/zonos3/vendor/nemo_text_processing/text_normalization/en/verbalizers/verbalize.py new file mode 100644 index 0000000000000000000000000000000000000000..8a4ed1ca382aaedfdc94b3e2e28cb6e1526678b5 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/verbalizers/verbalize.py @@ -0,0 +1,82 @@ +# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import GraphFst +from zonos3.vendor.nemo_text_processing.text_normalization.en.verbalizers.abbreviation import AbbreviationFst +from zonos3.vendor.nemo_text_processing.text_normalization.en.verbalizers.cardinal import CardinalFst +from zonos3.vendor.nemo_text_processing.text_normalization.en.verbalizers.date import DateFst +from zonos3.vendor.nemo_text_processing.text_normalization.en.verbalizers.decimal import DecimalFst +from zonos3.vendor.nemo_text_processing.text_normalization.en.verbalizers.electronic import ElectronicFst +from zonos3.vendor.nemo_text_processing.text_normalization.en.verbalizers.fraction import FractionFst +from zonos3.vendor.nemo_text_processing.text_normalization.en.verbalizers.measure import MeasureFst +from zonos3.vendor.nemo_text_processing.text_normalization.en.verbalizers.money import MoneyFst +from zonos3.vendor.nemo_text_processing.text_normalization.en.verbalizers.ordinal import OrdinalFst +from zonos3.vendor.nemo_text_processing.text_normalization.en.verbalizers.roman import RomanFst +from zonos3.vendor.nemo_text_processing.text_normalization.en.verbalizers.telephone import TelephoneFst +from zonos3.vendor.nemo_text_processing.text_normalization.en.verbalizers.time import TimeFst +from zonos3.vendor.nemo_text_processing.text_normalization.en.verbalizers.whitelist import WhiteListFst + + +class VerbalizeFst(GraphFst): + """ + Composes other verbalizer grammars. + For deployment, this grammar will be compiled and exported to OpenFst Finite State Archive (FAR) File. + More details to deployment at NeMo/tools/text_processing_deployment. + + Args: + deterministic: if True will provide a single transduction option, + for False multiple options (used for audio-based normalization) + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="verbalize", kind="verbalize", deterministic=deterministic) + cardinal = CardinalFst(deterministic=deterministic) + cardinal_graph = cardinal.fst + decimal = DecimalFst(cardinal=cardinal, deterministic=deterministic) + decimal_graph = decimal.fst + ordinal = OrdinalFst(deterministic=deterministic) + ordinal_graph = ordinal.fst + fraction = FractionFst(deterministic=deterministic) + fraction_graph = fraction.fst + telephone_graph = TelephoneFst(deterministic=deterministic).fst + electronic_graph = ElectronicFst(deterministic=deterministic).fst + measure = MeasureFst(decimal=decimal, cardinal=cardinal, fraction=fraction, deterministic=deterministic) + measure_graph = measure.fst + time_graph = TimeFst(deterministic=deterministic).fst + date_graph = DateFst(ordinal=ordinal, deterministic=deterministic).fst + money_graph = MoneyFst(decimal=decimal, deterministic=deterministic).fst + whitelist_graph = WhiteListFst(deterministic=deterministic).fst + + graph = ( + time_graph + | date_graph + | money_graph + | measure_graph + | ordinal_graph + | decimal_graph + | cardinal_graph + | telephone_graph + | electronic_graph + | fraction_graph + | whitelist_graph + ) + + roman_graph = RomanFst(deterministic=deterministic).fst + graph |= roman_graph + + if not deterministic: + abbreviation_graph = AbbreviationFst(deterministic=deterministic).fst + graph |= abbreviation_graph + + self.fst = graph diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/verbalizers/verbalize_final.py b/zonos3/vendor/nemo_text_processing/text_normalization/en/verbalizers/verbalize_final.py new file mode 100644 index 0000000000000000000000000000000000000000..38902457a954a82d28e85eecfaa960dca9073be6 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/verbalizers/verbalize_final.py @@ -0,0 +1,75 @@ +# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import os + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import ( + GraphFst, + delete_extra_space, + delete_space, + generator_main, +) +from zonos3.vendor.nemo_text_processing.text_normalization.en.verbalizers.verbalize import VerbalizeFst +from zonos3.vendor.nemo_text_processing.text_normalization.en.verbalizers.word import WordFst +from zonos3.vendor.nemo_text_processing.utils.logging import logger + + +class VerbalizeFinalFst(GraphFst): + """ + Finite state transducer that verbalizes an entire sentence, e.g. + tokens { name: "its" } tokens { time { hours: "twelve" minutes: "thirty" } } tokens { name: "now" } tokens { name: "." } -> its twelve thirty now . + + Args: + deterministic: if True will provide a single transduction option, + for False multiple options (used for audio-based normalization) + cache_dir: path to a dir with .far grammar file. Set to None to avoid using cache. + overwrite_cache: set to True to overwrite .far files + """ + + def __init__(self, deterministic: bool = True, cache_dir: str = None, overwrite_cache: bool = False): + super().__init__(name="verbalize_final", kind="verbalize", deterministic=deterministic) + + far_file = None + if cache_dir is not None and cache_dir != "None": + os.makedirs(cache_dir, exist_ok=True) + far_file = os.path.join(cache_dir, f"en_tn_{deterministic}_deterministic_verbalizer.far") + if not overwrite_cache and far_file and os.path.exists(far_file): + self.fst = pynini.Far(far_file, mode="r")["verbalize"] + logger.info(f'VerbalizeFinalFst graph was restored from {far_file}.') + else: + verbalize = VerbalizeFst(deterministic=deterministic).fst + word = WordFst(deterministic=deterministic).fst + types = verbalize | word + + if deterministic: + graph = ( + pynutil.delete("tokens") + + delete_space + + pynutil.delete("{") + + delete_space + + types + + delete_space + + pynutil.delete("}") + ) + else: + graph = delete_space + types + delete_space + + graph = delete_space + pynini.closure(graph + delete_extra_space) + graph + delete_space + + self.fst = graph.optimize() + if far_file: + generator_main(far_file, {"verbalize": self.fst}) diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/verbalizers/whitelist.py b/zonos3/vendor/nemo_text_processing/text_normalization/en/verbalizers/whitelist.py new file mode 100644 index 0000000000000000000000000000000000000000..1cda0fbc51daa603ce7ce1b5e26dd5549c64e0a2 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/verbalizers/whitelist.py @@ -0,0 +1,40 @@ +# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import NEMO_CHAR, NEMO_SIGMA, GraphFst, delete_space + + +class WhiteListFst(GraphFst): + """ + Finite state transducer for verbalizing whitelist + e.g. tokens { name: "misses" } } -> misses + + Args: + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="whitelist", kind="verbalize", deterministic=deterministic) + graph = ( + pynutil.delete("name:") + + delete_space + + pynutil.delete("\"") + + pynini.closure(NEMO_CHAR - " ", 1) + + pynutil.delete("\"") + ) + graph = graph @ pynini.cdrewrite(pynini.cross(u"\u00a0", " "), "", "", NEMO_SIGMA) + self.fst = graph.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/en/verbalizers/word.py b/zonos3/vendor/nemo_text_processing/text_normalization/en/verbalizers/word.py new file mode 100644 index 0000000000000000000000000000000000000000..426c9b9510bf2919b9b8e1fcc0e12c93157dcc35 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/en/verbalizers/word.py @@ -0,0 +1,36 @@ +# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import NEMO_CHAR, NEMO_SIGMA, GraphFst, delete_space + + +class WordFst(GraphFst): + """ + Finite state transducer for verbalizing word + e.g. tokens { name: "sleep" } -> sleep + + Args: + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="word", kind="verbalize", deterministic=deterministic) + chars = pynini.closure(NEMO_CHAR - " ", 1) + char = pynutil.delete("name:") + delete_space + pynutil.delete("\"") + chars + pynutil.delete("\"") + graph = char @ pynini.cdrewrite(pynini.cross(u"\u00a0", " "), "", "", NEMO_SIGMA) + + self.fst = graph.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/README.md b/zonos3/vendor/nemo_text_processing/text_normalization/es/README.md new file mode 100644 index 0000000000000000000000000000000000000000..ec946a614da8661eb38cf96d7b4b2145fd367e2f --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/README.md @@ -0,0 +1,22 @@ +# Localization Note + +Depending on locale, Spanish number strings will vary in formatting. In the EU and South American countries, it is common to use a period (".") or space to delineate groupings of three +digits. e.g. + `1.000.000` -> "un millón" + `1 000 000` -> "un millón" + +and commas (",") to seperate cardinal and decimal strings. e.g. + + `1,00` -> "uno coma cero cero" + +While Central and Northern America will use commas (",") to delineate groupings of three digits, e.g. + `1,000,000` -> "un millón" + +and periods (".") to seperate cardinal and decimal strings. e.g. + + `1.00` -> "uno coma cero cero" + +As inclusion of both forms will create inherrent ambiguity for verbalization, this module defaults to the former formatting (periods for cardinal delineation and commas for decimals). + +To toggle the alternate formatting, you may edit the `LOCALIZATION` variable in `nemo_text_processing.text_normalization.es.__init__` with the value of `'am'`. This will perform necessary +adjustments to all affected classes. \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/es/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..bd1fc7d433efa6efa41a9182829300774b1c233d --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/__init__.py @@ -0,0 +1,15 @@ +# Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +LOCALIZATION = "eu" # Set to am for alternate formatting diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/data/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..a1cf281f0908d225f51d921e9ddbdf92f9b14d99 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/data/dates/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/dates/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..a1cf281f0908d225f51d921e9ddbdf92f9b14d99 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/dates/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/data/dates/days_abbr.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/dates/days_abbr.tsv new file mode 100644 index 0000000000000000000000000000000000000000..bb4a9e73bcfb58181d1f6cdf030880093c031987 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/dates/days_abbr.tsv @@ -0,0 +1,27 @@ +LU lunes +lun. lunes +LUN lunes +ma. martes +MA martes +mar. martes +mi. miércoles +mié. miércoles +miér. miércoles +MIÉ miércoles +mié miércoles +miér miércoles +ju. jueves +JU jueves +jue jueves +JUE jueves +vie. viernes +vier. viernes +vie viernes +vier. viernes +sá. sábado +sáb sábado +sáb. sábado +SÁB sábado +do. domingo +dom. domingo +DOM domingo diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/data/dates/months.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/dates/months.tsv new file mode 100644 index 0000000000000000000000000000000000000000..7cfdf329aa5b2f13f94c650d7cbab5d5fe616ddd --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/dates/months.tsv @@ -0,0 +1,12 @@ +1 enero +2 febrero +3 marzo +4 abril +5 mayo +6 junio +7 julio +8 agosto +9 septiembre +10 octubre +11 noviembre +12 diciembre \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/data/dates/months_abbr.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/dates/months_abbr.tsv new file mode 100644 index 0000000000000000000000000000000000000000..d08bba36c5432b1e69e9f8e68a078a2434e09e85 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/dates/months_abbr.tsv @@ -0,0 +1,44 @@ +ene. enero +en. enero +ENE enero +febr. febrero +FEB febrero +feb. febrero +mzo. marzo +mzo marzo +MAR marzo +mar. marzo +abr. abril +ABR abril +abr abril +my. mayo +MAY mayo +may. mayo +may mayo +jun. junio +JUN junio +jun junio +jul. julio +JUL julio +jul julio +AGO agosto +ag. agosto +agt. agosto +ago. agosto +set. septiembre +sept. septiembre +setbre. septiembre +sept septiembre +setbre septiembre +SEP septiembre +oct. octubre +OCT octubre +oct octubre +nov. noviembre +novbre. noviembre +NOV noviembre +nov noviembre +novbre noviembre +dic. diciembre +dicbre. diciembre +DIC diciembre diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/data/dates/year_suffix.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/dates/year_suffix.tsv new file mode 100644 index 0000000000000000000000000000000000000000..455b05d3e1b48388a88c8084c70a8de8af44094f --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/dates/year_suffix.tsv @@ -0,0 +1,51 @@ +ane antes de nuestra era +a.n.e. antes de nuestra era +a. n. e. antes de nuestra era +aec antes de la era común +a.e.c antes de la era común +a. e. c. antes de la era común +ac antes de cristo +a.c. antes de cristo +a. c. antes de cristo +adc antes de cristo +a.d.c. antes de cristo +a. d. c. antes de cristo +a. de c. antes de cristo +ajc antes de jesucristo +a.j.c. antes de jesucristo +a. j. c. antes de jesucristo +adjc antes de jesucristo +a.d.j.c. antes de jesucristo +a. d. j. c. antes de jesucristo +a. de j.c. antes de jesucristo +a. de j. c. antes de jesucristo +ap antes del presente +a.p. antes del presente +a. p. antes del presente +bp antes del presente +b.p. antes del presente +b. p. antes del presente +ne nuestra era +n.e. nuestra era +n. e. nuestra era +ec era común +e.c. era común +e. c. era común +dc después de cristo +d.c. después de cristo +d. c. después de cristo +ddc después de cristo +d.d.c después de cristo +d. d. c. después de cristo +d. de c. después de cristo +ddjc después de jesucristo +d.d.j.c después de jesucristo +d. d. j. c. después de jesucristo +d. de j.c. después de jesucristo +d. de j. c. después de jesucristo +bc b c +b.c. b c +b. c. b c +ad a d +a.d. a d +a. d. a d diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/data/electronic/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/electronic/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..2db92b2574167fb3436c079fd7941450ae0c316b --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/electronic/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/data/electronic/domain.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/electronic/domain.tsv new file mode 100644 index 0000000000000000000000000000000000000000..06581ba1395c8606e04c1d82e2c56feafb19f186 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/electronic/domain.tsv @@ -0,0 +1,6 @@ +.com punto com +.gov punto gov +.net punto net +.in punto in +.ru punto ru +.gob punto gob diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/data/electronic/server_name.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/electronic/server_name.tsv new file mode 100644 index 0000000000000000000000000000000000000000..9a0c7562948684993372a2c389c9f32297550e5f --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/electronic/server_name.tsv @@ -0,0 +1,11 @@ +gmail +nvidia +outlook +hotmail +yahoo +live +yandex +orange +wanadoo +web +comcast \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/data/electronic/symbols.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/electronic/symbols.tsv new file mode 100644 index 0000000000000000000000000000000000000000..77f5d50a4b9068cbb3b3056fc94f22ae227d316e --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/electronic/symbols.tsv @@ -0,0 +1,22 @@ +. punto +- guión +_ barra baja +! signo de exclamación +# almohadilla +$ signo de dólar +% signo de porcentaje +& et +' comilla +* asterisco ++ signo más +/ barra += signo igual +? signo de interrogación +^ acento circunflejo +` acento grave +{ llave izquierda +| barra vertical +} llave derecha +~ tilde +, coma +: dos puntos diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/data/fractions/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/fractions/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..a1cf281f0908d225f51d921e9ddbdf92f9b14d99 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/fractions/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/data/fractions/fraction_symbols.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/fractions/fraction_symbols.tsv new file mode 100644 index 0000000000000000000000000000000000000000..ffebd210552da18e3be34229f81195342c978e7f --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/fractions/fraction_symbols.tsv @@ -0,0 +1,15 @@ +⅓ 1/3 +⅔ 2/3 +⅕ 1/5 +⅖ 2/5 +⅗ 3/5 +⅘ 4/5 +⅙ 1/6 +⅚ 5/6 +⅛ 1/8 +⅜ 3/8 +⅝ 5/8 +⅞ 7/8 +¼ 1/4 +½ 1/2 +¾ 3/4 diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/data/fractions/ordinal_exceptions.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/fractions/ordinal_exceptions.tsv new file mode 100644 index 0000000000000000000000000000000000000000..32cc3930a0e6e77cddf3fdb01e9da87a63071fdc --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/fractions/ordinal_exceptions.tsv @@ -0,0 +1,2 @@ +segundo medio +tercero tercio \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/data/fractions/powers_of_ten.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/fractions/powers_of_ten.tsv new file mode 100644 index 0000000000000000000000000000000000000000..021dc0a101e03ba7815d43f4076a340af4dc37a7 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/fractions/powers_of_ten.tsv @@ -0,0 +1,9 @@ +millón millonésimo +millones millonésimo +billón billonésimo +billones billonésimo +trillón trillonésimo +trillones trillonésimo +mil millones mil millonésimo +mil billones mil billonésimo +mil trillones mil trillonésimo \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/data/fractions/powers_of_ten_fem.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/fractions/powers_of_ten_fem.tsv new file mode 100644 index 0000000000000000000000000000000000000000..9e1a4ca4ce9f21ccef7f1d06a1bb068adb1f4561 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/fractions/powers_of_ten_fem.tsv @@ -0,0 +1,6 @@ +décimo décima +centésimo centésima +milésimo milésima +millonésimo millonésima +billonésimo billonésima +trillonésimo trillonésima \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/data/measures/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/measures/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..a1cf281f0908d225f51d921e9ddbdf92f9b14d99 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/measures/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/data/measures/math_symbols.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/measures/math_symbols.tsv new file mode 100644 index 0000000000000000000000000000000000000000..9a2a150c8939351d5f8786cc997cd639253a86f8 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/measures/math_symbols.tsv @@ -0,0 +1,7 @@ ++ más +- menos +* por +× por +· por +/ entre +÷ entre diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/data/measures/measurements.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/measures/measurements.tsv new file mode 100644 index 0000000000000000000000000000000000000000..2107c4691370f6121220b8f3b907ac16b685935c --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/measures/measurements.tsv @@ -0,0 +1,18 @@ +cm centímetro +g gramo +h hora +kg kilogramo +km kilómetro +km² kilómetro cuadrado +l litro +m metro +m² metro cuadrado +m³ metro cúbico +ml mililitro +mm milímetro +ms milisegundo +min minuto +s segundo +° c grado centígrado +° f grado farenheit +° k grado kelvin diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/data/measures/measurements_complex.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/measures/measurements_complex.tsv new file mode 100644 index 0000000000000000000000000000000000000000..8cc7dae9982fa7899278895ac7d20b8ee91f6399 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/measures/measurements_complex.tsv @@ -0,0 +1,5 @@ +% por ciento +mph milla por hora +kph kilómetro por hora +gsm gramo por metro cuadrado +psi p s i diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/data/measures/measurements_plural_fem.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/measures/measurements_plural_fem.tsv new file mode 100644 index 0000000000000000000000000000000000000000..eb3ae2322e7a06e88c4abae5cf3cee6847ea1e10 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/measures/measurements_plural_fem.tsv @@ -0,0 +1,3 @@ +hora horas +milla por hora millas por hora +milla millas diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/data/measures/measurements_plural_masc.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/measures/measurements_plural_masc.tsv new file mode 100644 index 0000000000000000000000000000000000000000..a7733c2558ad644245a0686f1d52d0530cf55b92 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/measures/measurements_plural_masc.tsv @@ -0,0 +1,21 @@ +centímetro centímetros +gramo gramos +kilogramo kilogramos +kilómetro kilómetros +kilómetro cuadrado kilómetros cuadrados +litro litros +metro metros +metro cuadrado metros cuadrados +metro cúbico metros cúbicos +mililitro mililitros +milímetro milímetros +milisegundo milisegundos +minuto minutos +segundo segundos +por ciento por ciento +kilómetro por hora kilómetros por hora +gramo por metro cuadrado gramos por metro cuadrado +p s i p s i +grado centígrado grados centígrados +grado farenheit grados farenheit +grado kelvin grados kelvin diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/data/money/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/money/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..a1cf281f0908d225f51d921e9ddbdf92f9b14d99 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/money/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/data/money/currency_major.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/money/currency_major.tsv new file mode 100644 index 0000000000000000000000000000000000000000..9dfd19ba570e5dac0cfafb0c1ce2e26677965997 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/money/currency_major.tsv @@ -0,0 +1,64 @@ +ars peso argentino +ar$ peso argentino +awg florín arubeño +bob boliviano +brl real brasileño +cad dólar canadiense +chf franco suizo +clp peso chileno +cny yuan chino +cop peso colombiano +crc colón costarricense +₡ colón +cup peso cubano +dop peso dominicano +rd$ peso dominicano +eur euro +gtq quetzal +gyd dólar guyanés +hkd dólar de hong kong +hnl lempira +htg gourde +inr rupia india +jpy yen +kr corona +kr. corona +krw won +mxn peso mexicano +nio córdoba +pab balboa +pen sol +s/ sol +pyg guaraní +₲ guaraní +rs rupia +rs. rupia +svc colón salvadoreño +ttd dólar de trinidad y tobago +usd dólar estadounidense +uyu peso uruguayo +uyw unidad previsional uruguaya +ves​ bolívar soberano +arp peso argentino +bop peso boliviano +cle escudo chileno +ecs sucre ecuatoriano +mxp peso mexicano +peh sol de oro +svc colón salvadoreño +veb bolívar venezolano +vef bolívar fuerte +€ euro +$ dólar +£ libra +₩ won +fr franco +mk marco +¥ yen +r$ real +₧ peseta +ptas peseta +us$ dólar estadounidense +mex$ peso mexicano +q quetzal +us $ dólar estadounidense diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/data/money/currency_major_ext.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/money/currency_major_ext.tsv new file mode 100644 index 0000000000000000000000000000000000000000..092b50202e49dd91cbb7ff71d0c24b7a28f6ce1d --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/money/currency_major_ext.tsv @@ -0,0 +1,215 @@ +# Additional currencies are listed below. +# To use them, simply copy them to the main currency_major.tsv file. + +aed dírham +dh dírham +dhs dírham +afn afgani +all lek +amd dram armenio +ang florín antillano neerlandés +aoa kwanza +aok primer kwanza +aon nuevo kwanza +aor kwanza reajustado +azn manat azerbaiyano +bam marco convertible +bbd dólar barbadense +bdt taka +bgn leva búlgara +bhd dinar bareiní +bif franco de burundi +bmd dólar bermudeño +bd$ dólar bermudeño +bnd dólar de brunéi +bsd dólar bahameño +b$ dólar bahameño +btn ngultrum +bwp pula +byn rublo bielorruso +bzd dólar beliceño +bz$ dólar beliceño +cdf franco congoleño +cou unidad de valor real +cve escudo caboverdiano +czk corona checa +djf franco yibutiano +dkk corona danesa +dzd dinar argelino +egp libra egipcia +ern nakfa +etb birr etíope +fjd dólar fiyiano +fj$ dólar fiyiano +fkp libra malvinense +gbp libra esterlina +gel lari +ghs cedi ghanés +gip libra de gibraltar +gmd dalasi +gnf franco guineano +hrk kuna +huf forinto +idr rupia indonesia +ils nuevo séquel israelí +iqd dinar iraquí +irr rial iraní +isk corona islandesa +jmd dólar jamaiquino +jod dinar jordano +kes chelín keniano +kgs som +khr riel +kmf franco comorense +kpw won norcoreano +kwd dinar kuwaití +kyd dólar de las islas caimán +kzt tenge +lak kip +lbp libra libanesa +lkr rupia de sri lanka +lrd dólar liberiano +lsl loti +lyd dinar libio +mad dírham marroquí +mdl leu moldavo +mga ariary malgache +mkd denar +mmk kyat +mnt tugrik +₮ tugrik +mop pataca +mop$ pataca +mru uguiya +mur rupia de mauricio +mvr rufiyaa +mwk kwacha +myr ringgit malayo +mzn metical mozambiqueño +nad dólar namibio +ngn naira +₦ naira +nok corona noruega +npr rupia nepalí +nzd dólar neozelandés +nz$ dólar neozelandés +omr rial omaní +pgk kina +php peso filipino +₱ peso filipino +P peso filipino +pkr rupia pakistaní +pln esloti +zł esloti +zł. esloti +qar rial catarí +ron leu rumano +rsd dinar serbio +rub rublo ruso +rwf franco ruandés +sar rial saudí +sbd dólar de las islas salomón +scr rupia seychelense +sdg libra sudanesa +sek corona sueca +shp libra de santa elena +sll leone +sos chelín somalí +srd dólar surinamés +ssp libra sursudanesa +stn dobra +syp libra siria +szl lilangeni +thb baht +฿ baht +tjs somoni tayiko +tmt manat turcomano +tnd dinar tunecino +top paʻanga +try lira turca +twd nuevo dólar taiwanés +tzs chelín tanzano +uah grivna +ugx chelín ugandés +uzs som uzbeko +vnd dong vietnamita +₫ dong vietnamita +vuv vatu +wst tala +xaf franco c f a de áfrica central +xof franco c f a de áfrica occidental +xpf franco c f p +xsu sistema unitario de compensación regional +xua unidad de cuenta del banco africano de desarrollo +yer rial yemení +zar rand +zmw kwacha zambiano +zwl dólar zimbabuense +adf franco andorrano +adp peseta andorrana +afa afgani +aon kwanza angoleño +aor kwanza angoleño reajustado +ats chelín austríaco +bec franco belga +bef franco belga +bel franco belga +bgl lev búlgaro +csd dinar serbio +csk corona checoslovaca +cyp libra chipriota +ddm marco de rda +dem marco alemán +eek corona estonia +ehp peseta saharaui +fim marco finlandés +frf franco francés +grd dracma griega +iep libra irlandesa +itl lira italiana +luf franco luxemburgués +mtl lira maltesa +nlg florín neerlandés +pei inti +plz esloti polaco +pte escudo portugués +rur rublo ruso +sit tólar esloveno +skk corona eslovaca +srg guilder surinamés +sur rublo de la unión soviética +trl lira turca +yud nuevo dinar yugoslavo +yum dinar yugoslavo +zal rand surafricano código de fondos +zrn nuevo zaire +zrz zaire +zml kwacha zambiano +kč corona checa +aud dólar australiano +bov boliviano con mantenimiento de valor respecto al dólar estadounidense +che euro wir +chw franco wir +clf unidad de fomento +cuc peso convertible +mxv unidad de inversión mexicana +sgd dólar de singapur +usn dólar estadounidense siguiente día +uyi peso uruguayo en unidades indexadas +xag plata +xau oro +xcd dólar del caribe oriental +xdr derecho especial de giro +xpd paladio +xpt platino +ara austral argentino +arc peso moneda corriente argentino +arf peso fuerte argentino +arg peso oro sellado argentino +arl peso ley argentino +arm peso moneda nacional argentino +ecv unidad de valor constante ecuatoriana +esa peseta española +esb peseta española +esp peseta española +xeu unidad monetaria europea diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/data/money/currency_minor.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/money/currency_minor.tsv new file mode 100644 index 0000000000000000000000000000000000000000..f61f345f60dd7ade187b65fd14e2ef00d91a1ca9 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/money/currency_minor.tsv @@ -0,0 +1,64 @@ +ars centavo +ar$ centavo +awg centavo +bob centavo +brl centavo +cad centavo +chf céntimo +clp centavo +cny jiao +cop centavo +crc céntimo +₡ céntimo +cup centavo +dop centavo +rd$ centavo +eur centavo +gtq centavo +gyd centavo +hkd centavo +hnl centavo +htg céntimo +inr paisa +jpy centavo +kr øre +kr. øre +krw chon +mxn centavo +nio centavo +pab centésimo +pen céntimo +s/ céntimo +pyg céntimo +₲ céntimo +rs paisa +rs. paisa +svc centavo +ttd céntimo +usd centavo +uyu centésimo +uyw centésimo +ves​ céntimo +arp centavo +bop centavo +cle centésimo +ecs centésimo +mxp centavo +peh centavo +svc centavo +veb céntimo +vef céntimo +€ céntimo +$ centavo +£ penique +₩ chon +fr céntimo +mk céntimo +¥ centavo +r$ centavo +₧ céntimo +ptas céntimo +us$ centavo +mex$ centavo +q centavo +us $ centavo diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/data/money/currency_minor_ext.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/money/currency_minor_ext.tsv new file mode 100644 index 0000000000000000000000000000000000000000..80cda16e94f12d19b34c93b99bbff788baa50b74 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/money/currency_minor_ext.tsv @@ -0,0 +1,181 @@ +# Additional currencies are listed below. +# To use them, simply copy them to the main currency_minor.tsv file. + +aed fils +dh fils +dhs fils +afn pul +all qindarke +amd luma +ang centavo +aoa céntimo +aok lwei +aon lwei +aor lwei +aud centavo +azn qəpik +bam feninga +bbd centavo +bdt poisha +bgn stotinka +bhd fils +bif céntimo +bmd centavo +bd$ centavo +bnd centavo +bov centavo con mantenimiento de valor respecto al Dólar estadounidense +r$ centavo +bsd centavo +b$ centavo +btn chertum +bwp thebe +byn kap +bzd centavo +bz$ centavo +cdf céntimo +che centavo +chw céntimo +cuc centavo +cve centavo +czk haléř +djf céntimo +dkk øre +dzd céntimo +egp piastra +ern céntimo +etb santim +fjd centavo +fj$ centavo +fkp penique +gbp penique +gel tetri +ghs pesewa +gip penique +gmd butut +gnf céntimo +hrk lipa +huf krajczár +idr sen +ils agorot +iqd fils +irr dinar +isk aurar +jmd céntimo +jod qirsh +kes centavo +kgs tiyin +khr sen +kmf céntimo +kpw chon +kwd fils +kyd centavo +kzt tiyin +lak att +lbp piastra +lkr céntimo +lrd centavo +lsl sente +mad céntimo +mdl ban +mkd deni +mmk pya +mnt mongo +₮ mongo +mop avo +mop$ avo +mru jum +mur centavo +mvr laari +mwk támbala +myr sen +nad centavo +ngn kobo +₦ kobo +nok øre +npr paisa +nzd centavo +nz$ centavo +omr baisa +pgk toea +php céntimo +₱ céntimo +P céntimo +pkr paisa +pln groszy +zł groszy +zł. groszy +qar dirham +ron ban +rsd para +rub kopek +rwf céntimo +sar halalá +sbd centavo +scr centavo +sdg piastra +sek öre +sgd centavo +shp penique +sos céntimo +srd centavo +ssp piastra +stn céntimo +syp piastra +szl centavo +thb satang +฿ satang +tjs diram +tmt teňňe +tnd millime +top seniti +try kuruş +tzs céntimo +uah kopek +ugx centavo +usn centavo +uyi centésimo +uzs tiyin +vnd xu +₫ xu +wst sene +xcd centavo +xpf céntimo +yer fils +zmw ngwee +zwl centavo +adf céntimo +adp céntimo +afa pul +ara centavo +arc centavo +arf centavo +arg centavo +arl centavo +arm centavo +bec céntimo +bef céntimo +bel céntimo +bgl stotinki +csd para +csk heller +cyp céntimo +ddm pfennig +dem pfennig +eek céntimo +esa céntimo +esb céntimo +esp céntimo +frf céntimo +iep penique +luf céntimo +mtl céntimo +nlg céntimo +pei céntimo +plz groszy +rur kopek +sit stotin +skk heller +sur kopek +trl kuruş +zml ngwee +kč haléř diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/data/money/currency_plural_fem.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/money/currency_plural_fem.tsv new file mode 100644 index 0000000000000000000000000000000000000000..c1d94fd87be3fa2e4034be40f90b84b658f439b3 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/money/currency_plural_fem.tsv @@ -0,0 +1,8 @@ +gourde gourdes +rupia india rupias indias +corona coronas +córdoba córdobas +rupia rupias +unidad previsional uruguaya unidades previsionales uruguayas +libra libras +peseta pesetas diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/data/money/currency_plural_fem_ext.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/money/currency_plural_fem_ext.tsv new file mode 100644 index 0000000000000000000000000000000000000000..3d7c27559d78164e672bbe848d509ce412de2163 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/money/currency_plural_fem_ext.tsv @@ -0,0 +1,56 @@ +# Additional currencies are listed below. +# To use them, simply copy them to the main currency_plural_fem.tsv file. + +leva búlgara levas búlgaras +pula pula +unidad de fomento unidades de fomento +unidad de valor real unidades de valor real +corona checa coronas checas +corona danesa coronas danesas +libra egipcia libras egipcias +libra malvinense libras malvinenses +libra esterlina libras esterlinas +libra de gibraltar libras de gibraltar +kuna kuna +rupia indonesia rupias indonesias +corona islandesa coronas islandesas +libra libanesa libras libanesas +rupia de sri lanka rupias de sri lanka +pataca patacas +uguiya uguiya +rupia de mauricio rupias de mauricio +unidad de inversión mexicana unidades de inversión mexicana +rufiyaa rufiyaa +corona noruega coronas noruegas +rupia nepalí rupias nepalíes +rupia pakistaní rupias pakistaníes +rupia seychelense rupias seychelenses +libra sudanesa libras sudanesas +corona sueca coronas suecas +libra de santa elena libras de santa elena +libra siria libras sirias +lira turca liras turcas +grivna grivnas +unidad de cuenta del banco africano de desarrollo unidades de cuenta del banco africano de desarrollo +peseta andorrana pesetas andorranas +corona checoslovaca coronas checoslovacas +libra chipriota libras chipriotas +unidad de valor constante ecuatoriana unidades de valor constante ecuatorianas +corona estonia coronas estonias +peseta saharaui pesetas saharauies +peseta española pesetas españolas +dracma griega dracmas griegas +libra irlandesa libras irlandesas +lira italiana liras italianas +lira maltesa liras maltesas +corona eslovaca coronas eslovacas +lira turca liras turcas +unidad monetaria europea unidades monetaria europea +feninga feninga +poisha poisha +stotinka stotinki +piastra piastras +pesewa pesewas +pya pyas +támbala támbala +corona checa coronas checas diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/data/money/currency_plural_masc.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/money/currency_plural_masc.tsv new file mode 100644 index 0000000000000000000000000000000000000000..76954cc0d5614f6a8bdd695264efef45dbb44e4a --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/money/currency_plural_masc.tsv @@ -0,0 +1,51 @@ +real brasileño reales brasileños +peso argentino pesos argentinos +florín arubeño florines arubeños +boliviano bolivianos +dólar canadiense dólares canadienses +franco suizo francos suizos +peso chileno pesos chilenos +yuan chino yuan chinos +peso colombiano pesos colombianos +colón costarricense colones costarricenses +peso cubano pesos cubanos +peso dominicano pesos dominicanos +euro euros +quetzal quetzales +dólar guyanés dólares guyaneses +dólar de hong kong dólares de hong kong +lempira lempiras +yen yenes +won wones +balboa balboas +sol soles +guaraní guaraníes +dólar de trinidad y tobago dólares de trinidad y tobago +dólar estadounidense dólares estadounidenses +peso uruguayo pesos uruguayos +bolívar soberano bolívares soberanos +peso argentino pesos argentinos +peso boliviano pesos bolivianos +escudo chileno escudos chilenos +sucre ecuatoriano sucres ecuatorianos +peso mexicano pesos mexicanos +sol de oro soles de oro +colón salvadoreño colones salvadoreños +bolívar venezolano bolívares venezolanos +bolívar fuerte bolívares fuertes +centavo centavos +céntimo céntimos +øre øre +penique peniques +paisa paise +chon chon +øre øre +centésimo centésimos +dólar dólares +won wones +franco francos +marco marcos +yen yenes +real reales +colón colones +quetzal quetzales diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/data/money/currency_plural_masc_ext.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/money/currency_plural_masc_ext.tsv new file mode 100644 index 0000000000000000000000000000000000000000..548558b3463bb06e5105186204da1234367ca366 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/money/currency_plural_masc_ext.tsv @@ -0,0 +1,199 @@ +# Additional currencies are listed below. +# To use them, simply copy them to the main currency_plural_masc.tsv file. + +dírham dírhams +afgani afganis +lek lekë +dram armenio dram armenios +florín antillano neerlandés florines antillanos neerlandeses +kwanza kwanzas +primer kwanza primeros kwanzas +nuevo kwanza nuevos kwanzas +kwanza reajustado kwanzas reajustados +dólar australiano dólares australianos +manat azerbaiyano manat azerbaiyanos +marco convertible marcos convertibles +dólar barbadense dólares barbadenses +taka taka +dinar bareiní dinares bareinís +franco de burundi francos de burundi +dólar bermudeño dólares bermudeños +dólar de brunéi dólares de brunéi +boliviano con mantenimiento de valor respecto al dólar estadounidense bolivianos con mantenimiento de valor respecto al dólar estadounidense +dólar bahameño dólares bahameños +ngultrum ngultrum +rublo bielorruso rublos bielorrusos +dólar beliceño dólares beliceños +franco congoleño francos congoleños +euro wir euros wir +franco wir francos wir +peso convertible pesos convertibles +escudo caboverdiano escudos caboverdianos +franco yibutiano francos yibutianos +dinar argelino dinares argelinos +nakfa nakfa +birr etíope birr etíopes +dólar fiyiano dólares fiyianos +lari lari +cedi ghanés cedis ghaneses +dalasi dalasis +franco guineano francos guineanos +forinto forintos +nuevo séquel israelí nuevos séqueles israelíes +dinar iraquí dinares iraquíes +rial iraní riales iraníes +dólar jamaiquino dólares jamaiquinos +dinar jordano dinares jordanos +chelín keniano chelines kenianos +som som +riel riel +franco comorense francos comorenses +won norcoreano wones norcoreanos +dinar kuwaití dinares kuwaitíes +dólar de las islas caimán dólares de las islas caimán +tenge tenge +kip kip +dólar liberiano dólares liberianos +loti maloti +dinar libio dinares libios +dírham marroquí dírhams marroquíes +leu moldavo lei moldavos +ariary malgache ariary +denar denares +kyat kyats +tugrik tugrik +kwacha kwacha +ringgit malayo ringgit malayos +metical mozambiqueño meticales mozambiqueños +dólar namibio dólares namibios +naira naira +dólar neozelandés dólares neozelandeses +rial omaní riales omaníes +kina kina +peso filipino pesos filipinos +esloti eslotis +rial catarí riales cataríes +leu rumano lei rumanos +dinar serbio dinares serbios +rublo ruso rublos rusos +franco ruandés francos ruandeses +rial saudí riales saudíes +dólar de las islas salomón dólares de las islas salomón +dólar de singapur dólares de singapur +leone leones +chelín somalí chelines somalíes +dólar surinamés dólares surinameses +libra sursudanesa libras sursudanesas +dobra dobras +lilangeni emalangeni +baht baht +somoni tayiko somoni tayikos +manat turcomano manat turcomanos +dinar tunecino dinares tunecinos +paʻanga paʻanga +nuevo dólar taiwanés nuevos dólares taiwaneses +chelín tanzano chelines tanzanos +chelín ugandés chelines ugandeses +dólar estadounidense siguiente día dólares estadounidenses siguiente día +peso uruguayo en unidades indexadas pesos uruguayos en unidades indexadas +som uzbeko som uzbekos +dong vietnamita dong vietnamitas +vatu vatu +tala tala +franco c f a de áfrica central francos c f a de áfrica central +plata plata +oro oro +dólar del caribe oriental dólares del caribe oriental +derecho especial de giro derechos especiales de giro +franco c f a de áfrica occidental francos c f a de áfrica occidental +paladio paladio +franco c f p francos c f p +platino platino +sistema unitario de compensación regional sistemas unitarios de compensación regional +rial yemení riales yemeníes +rand rand +kwacha zambiano kwacha zambianos +dólar zimbabuense dólares zimbabuenses +franco andorrano francos andorranos +kwanza angoleño kwanzas angoleños +kwanza angoleño reajustado kwanzas angoleños reajustados +austral argentino australes argentinos +peso moneda corriente argentino pesos moneda corriente argentinos +peso fuerte argentino pesos fuertes argentinos +peso oro sellado argentino pesos oro sellado argentinos +peso ley argentino pesos ley argentinos +peso moneda nacional argentino pesos moneda nacional argentinos +chelín austríaco chelines austríacos +franco belga francos belgas +lev búlgaro lev búlgaros +dinar serbio dinares serbios +marco de rda marcos de rda +marco alemán marcos alemanes +marco finlandés marcos finlandeses +franco francés francos franceses +franco luxemburgués francos luxemburgueses +florín neerlandés florines neerlandeses +inti intis +esloti polaco eslotis polacos +escudo portugués escudos portugueses +rublo ruso rublos rusos +tólar esloveno tólares eslovenos +guilder surinamés guilder surinameses +rublo de la unión soviética rublos de la unión soviética +nuevo dinar yugoslavo nuevos dinares yugoslavos +dinar yugoslavo dinares yugoslavos +rand surafricano código de fondos rands surafricanos código de fondos +nuevo zaire nuevos zaires +zaire zaires +kwacha zambiano kwacha zambianos +fils fils +pul pul +qindarke qindarka +luma luma +lwei lwei +qəpik qəpik +centavo con mantenimiento de valor respecto al dólar estadounidense centavos con mantenimiento de valor respecto al dólar estadounidense +chertum chertums +thebe thebe +kap kopeks +haléř haléř +santim santim +tetri tetri +butut bututs +lipa lipa +krajczár krajczár +sen sen +agorot agorot +dinar dinares +aurar aurar +qirsh qirsh +tiyin tiyin +att att +sente lisente +ban bani +deni deni +mongo mongo +avo avos +jum jums +laari laari +kobo kobo +baisa baise +toea toea +groszy groszy +dirham dirhams +öre öre +diram dirams +pfennig pfennigs +kopek kopeks +para para +halalá halalás +satang satang +teňňe teňňe +millime millimes +seniti seniti +kuruş kuruş +xu xu +sene sene +ngwee ngwee +heller hellers +stotin stotinov diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/data/numbers/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/numbers/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..a1cf281f0908d225f51d921e9ddbdf92f9b14d99 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/numbers/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/data/numbers/digit.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/numbers/digit.tsv new file mode 100644 index 0000000000000000000000000000000000000000..462803637ed571078f22949c75a146655ceff0ad --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/numbers/digit.tsv @@ -0,0 +1,9 @@ +un 1 +dos 2 +tres 3 +cuatro 4 +cinco 5 +seis 6 +siete 7 +ocho 8 +nueve 9 \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/data/numbers/hundreds.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/numbers/hundreds.tsv new file mode 100644 index 0000000000000000000000000000000000000000..bf651cd0a9786151f7b26e02a2f5ba09b0c5c3f8 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/numbers/hundreds.tsv @@ -0,0 +1,8 @@ +doscientos 2 +trescientos 3 +cuatrocientos 4 +quinientos 5 +seiscientos 6 +setecientos 7 +ochocientos 8 +novecientos 9 \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/data/numbers/quantities.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/numbers/quantities.tsv new file mode 100644 index 0000000000000000000000000000000000000000..58bce3e5dcff0019538bb75996b0822c7827fbf0 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/numbers/quantities.tsv @@ -0,0 +1,6 @@ +millón +millones +billón +billones +trillón +trillones \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/data/numbers/teen.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/numbers/teen.tsv new file mode 100644 index 0000000000000000000000000000000000000000..370526ea57c3edce5fd6e7e4f8647a1715dc76e4 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/numbers/teen.tsv @@ -0,0 +1,10 @@ +diez 10 +once 11 +doce 12 +trece 13 +catorce 14 +quince 15 +dieciséis 16 +diecisiete 17 +dieciocho 18 +diecinueve 19 \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/data/numbers/ties.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/numbers/ties.tsv new file mode 100644 index 0000000000000000000000000000000000000000..51b21081b3e35e10d6efbc87b4b274e20e183af8 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/numbers/ties.tsv @@ -0,0 +1,7 @@ +treinta 3 +cuarenta 4 +cincuenta 5 +sesenta 6 +setenta 7 +ochenta 8 +noventa 9 \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/data/numbers/twenties.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/numbers/twenties.tsv new file mode 100644 index 0000000000000000000000000000000000000000..c378a3ad9817d72e60c7b9a762f6c5a3dd804098 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/numbers/twenties.tsv @@ -0,0 +1,10 @@ +veinte 20 +veintiún 21 +veintidós 22 +veintitrés 23 +veinticuatro 24 +veinticinco 25 +veintiséis 26 +veintisiete 27 +veintiocho 28 +veintinueve 29 \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/data/numbers/zero.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/numbers/zero.tsv new file mode 100644 index 0000000000000000000000000000000000000000..945785283a516d40edc75a693777ec6ef4a72c01 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/numbers/zero.tsv @@ -0,0 +1 @@ +cero 0 \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/data/ordinals/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/ordinals/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..a1cf281f0908d225f51d921e9ddbdf92f9b14d99 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/ordinals/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/data/ordinals/digit.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/ordinals/digit.tsv new file mode 100644 index 0000000000000000000000000000000000000000..08d86ac928b4ce0bb7220acba13173af6f998816 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/ordinals/digit.tsv @@ -0,0 +1,11 @@ +primero uno +primera una +primero un +segundo dos +tercero tres +cuarto cuatro +quinto cinco +sexto seis +séptimo siete +octavo ocho +noveno nueve \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/data/ordinals/gender_suffix.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/ordinals/gender_suffix.tsv new file mode 100644 index 0000000000000000000000000000000000000000..10eabb11de3ca51a0fbc508a8b88129d626b0e7a --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/ordinals/gender_suffix.tsv @@ -0,0 +1,20 @@ +ᵉʳ apocope +er apocope +º gender_masc +° gender_masc +ro gender_masc +ero gender_masc +do gender_masc +o gender_masc +to gender_masc +mo gender_masc +vo gender_masc +ª gender_fem +ra gender_fem +era gender_fem +a gender_fem +da gender_fem +ta gender_fem +ma gender_fem +va gender_fem +na gender_fem diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/data/ordinals/hundreds.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/ordinals/hundreds.tsv new file mode 100644 index 0000000000000000000000000000000000000000..65867fd84ecacd446bc23ba1572c9c921d1d186c --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/ordinals/hundreds.tsv @@ -0,0 +1,18 @@ +centésimo ciento +centésimo cien +ducentésimo doscientos +ducentésima doscientas +tricentésimo trescientos +tricentésima trescientas +cuadringentésimo cuatrocientos +cuadringentésima cuatrocientas +quingentésimo quinientos +quingentésima quinientas +sexcentésimo seiscientos +sexcentésima seiscientas +septingentésimo setecientos +septingentésima setecientas +octingentésimo ochocientos +octingentésima ochocientas +noningentésimo novecientos +noningentésima novecientas \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/data/ordinals/roman_exceptions.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/ordinals/roman_exceptions.tsv new file mode 100644 index 0000000000000000000000000000000000000000..688da504d26484ca584567da6c63e96781ac74c9 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/ordinals/roman_exceptions.tsv @@ -0,0 +1,10 @@ +di +mi +vi +i +v +x +l +c +d +m \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/data/ordinals/teen.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/ordinals/teen.tsv new file mode 100644 index 0000000000000000000000000000000000000000..1ffcfb2697d45d0a583925ee927bdd2b5b775a62 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/ordinals/teen.tsv @@ -0,0 +1,10 @@ +décimo diez +undécimo once +duodécimo doce +decimotercero trece +decimocuarto catorce +decimoquinto quince +decimosexto dieciséis +decimoséptimo diecisiete +decimooctavo dieciocho +decimonoveno diecinueve \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/data/ordinals/ties.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/ordinals/ties.tsv new file mode 100644 index 0000000000000000000000000000000000000000..21c488ef2ab870a98d54119013cb068b56d66d35 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/ordinals/ties.tsv @@ -0,0 +1,8 @@ +vigésimo veinte +trigésimo treinta +cuadragésimo cuarenta +quincuagésimo cincuenta +sexagésimo sesenta +septuagésimo setenta +octogésimo ochenta +nonagésimo noventa \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/data/ordinals/twenties.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/ordinals/twenties.tsv new file mode 100644 index 0000000000000000000000000000000000000000..8fd7634438a375c10b86d4e0681e8e82a71a044f --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/ordinals/twenties.tsv @@ -0,0 +1,11 @@ +vigesimoprimero veintiuno +vigesimoprimera veintiuna +vigesimoprimero veintiún +vigesimosegundo veintidós +vigesimotercero veintitrés +vigesimocuarto veinticuatro +vigesimoquinto veinticinco +vigesimosexto veintiséis +vigesimoséptimo veintisiete +vigesimoctavo veintiocho +vigesimonoveno veintinueve diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/data/roman/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/roman/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..2db92b2574167fb3436c079fd7941450ae0c316b --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/roman/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/data/roman/digit.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/roman/digit.tsv new file mode 100644 index 0000000000000000000000000000000000000000..0610b4a54ff3c9c90ad16a4ae9a9428a2a5484f4 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/roman/digit.tsv @@ -0,0 +1,9 @@ +i 1 +ii 2 +iii 3 +iv 4 +v 5 +vi 6 +vii 7 +viii 8 +ix 9 \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/data/roman/hundreds.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/roman/hundreds.tsv new file mode 100644 index 0000000000000000000000000000000000000000..cdbdb68147261048298134373f77c3ade2689659 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/roman/hundreds.tsv @@ -0,0 +1,9 @@ +c 1 +cc 2 +ccc 3 +cd 4 +d 5 +dc 6 +dcc 7 +dccc 8 +cm 9 \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/data/roman/thousands.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/roman/thousands.tsv new file mode 100644 index 0000000000000000000000000000000000000000..19e96b9c6decb7c9760ad34e21a9602bc6393d7d --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/roman/thousands.tsv @@ -0,0 +1,3 @@ +m 1 +mm 2 +mmm 3 diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/data/roman/ties.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/roman/ties.tsv new file mode 100644 index 0000000000000000000000000000000000000000..ac043aa146bfeb1600a76b37ec59ef5254dc60b8 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/roman/ties.tsv @@ -0,0 +1,9 @@ +x 1 +xx 2 +xxx 3 +xl 4 +l 5 +lx 6 +lxx 7 +lxxx 8 +xc 9 \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/data/telephone/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/telephone/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..6ebc808fad7ac87484dbabf02dacacdd7f826c14 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/telephone/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/data/telephone/ip_prompt.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/telephone/ip_prompt.tsv new file mode 100644 index 0000000000000000000000000000000000000000..fc226eb30488da403e43c8b43dffa434b06805a7 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/telephone/ip_prompt.tsv @@ -0,0 +1,2 @@ +la dirección de ip es la dirección de i p es +el ip es el i p es diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/data/telephone/telephone_prompt.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/telephone/telephone_prompt.tsv new file mode 100644 index 0000000000000000000000000000000000000000..33efe4550791ae50613088c4696813e263a23281 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/telephone/telephone_prompt.tsv @@ -0,0 +1,10 @@ +llámame al +llámeme al +llamar al +llama al +llame al +marque +mi número es +mi teléfono es +mi número de teléfono es +el número de teléfono es diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/data/time/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/time/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..a1cf281f0908d225f51d921e9ddbdf92f9b14d99 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/time/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/data/time/afternoon_times.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/time/afternoon_times.tsv new file mode 100644 index 0000000000000000000000000000000000000000..0c266580597bdc279fe0ad53c60d7e9f7c866484 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/time/afternoon_times.tsv @@ -0,0 +1,6 @@ +una +dos +tres +cuatro +cinco +seis diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/data/time/alt_minutes.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/time/alt_minutes.tsv new file mode 100644 index 0000000000000000000000000000000000000000..6bdff30993d42bdc60725e9a507a83d3df537213 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/time/alt_minutes.tsv @@ -0,0 +1,2 @@ +quince cuarto +treinta media \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/data/time/evening_times.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/time/evening_times.tsv new file mode 100644 index 0000000000000000000000000000000000000000..d10160d0673f43006e0151c641fd7ff7b024e914 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/time/evening_times.tsv @@ -0,0 +1,5 @@ +siete +ocho +nueve +diez +once diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/data/time/hour_to_12.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/time/hour_to_12.tsv new file mode 100644 index 0000000000000000000000000000000000000000..e681afc6c25c71eef187fc7a300df91cb411149b --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/time/hour_to_12.tsv @@ -0,0 +1,12 @@ +1 12 +2 1 +3 2 +4 3 +5 4 +6 5 +7 6 +8 7 +9 8 +10 9 +11 10 +12 11 \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/data/time/hour_to_24.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/time/hour_to_24.tsv new file mode 100644 index 0000000000000000000000000000000000000000..13f43dc5b9b94144846e164611b8391010b94c22 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/time/hour_to_24.tsv @@ -0,0 +1,25 @@ +1 0 +2 1 +3 2 +4 3 +5 4 +6 5 +7 6 +8 7 +9 8 +10 9 +11 10 +12 11 +13 12 +14 13 +15 14 +16 15 +17 16 +18 17 +19 18 +20 19 +21 20 +22 21 +23 22 +0 23 +1 24 \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/data/time/hour_to_night.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/time/hour_to_night.tsv new file mode 100644 index 0000000000000000000000000000000000000000..b7765ac2a3c6158197b46e5886345e0e08b6b3ac --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/time/hour_to_night.tsv @@ -0,0 +1,13 @@ +12 0 +1 13 +2 14 +3 15 +4 16 +5 17 +6 18 +7 19 +8 20 +9 21 +10 22 +11 23 +12 24 \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/data/time/minute_to.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/time/minute_to.tsv new file mode 100644 index 0000000000000000000000000000000000000000..edab4d5b03d6fd6c8187ea76523f61f0df3410b2 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/time/minute_to.tsv @@ -0,0 +1,59 @@ +1 59 +2 58 +3 57 +4 56 +5 55 +6 54 +7 53 +8 52 +9 51 +10 50 +11 49 +12 48 +13 47 +14 46 +15 45 +16 44 +17 43 +18 42 +19 41 +20 40 +21 39 +22 38 +23 37 +24 36 +25 35 +26 34 +27 33 +28 32 +29 31 +30 30 +31 29 +32 28 +33 27 +34 26 +35 25 +36 24 +37 23 +38 22 +39 21 +40 20 +41 19 +42 18 +43 17 +44 16 +45 15 +46 14 +47 13 +48 12 +49 11 +50 10 +51 9 +52 8 +53 7 +54 6 +55 5 +56 4 +57 3 +58 2 +59 1 diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/data/time/morning_times.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/time/morning_times.tsv new file mode 100644 index 0000000000000000000000000000000000000000..e329184d2bd0c46ed5c8fa10609b77a1c553197c --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/time/morning_times.tsv @@ -0,0 +1,12 @@ +un +una +dos +tres +cuatro +cinco +seis +siete +ocho +nueve +diez +once \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/data/time/time_suffix.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/time/time_suffix.tsv new file mode 100644 index 0000000000000000000000000000000000000000..9ba6b1ceb1704b78d07af0f3c5567bbebe5f8b34 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/time/time_suffix.tsv @@ -0,0 +1,20 @@ +p.m. pm +p. m. pm +p.m pm +p m. pm +pm pm +P.M. pm +P.M pm +P M. pm +P. M. pm +PM pm +a.m. am +a.m. am +a.m am +a m. am +am am +A.M. am +A.M am +A M. am +A. M. am +AM am \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/data/time/time_zone.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/time/time_zone.tsv new file mode 100644 index 0000000000000000000000000000000000000000..6c86a3e4e40c94dbdf734d4599f6396f648fdf39 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/time/time_zone.tsv @@ -0,0 +1,42 @@ +utc u t c +cst c s t +cet c e t +pst p s t +est e s t +mdt m d t +mst m s t +pt p t +et e t +mt m t +gmt g m t +adt hora de verano del atlántico +amt hora estándar del amazonas +art hora estándar de argentina +ast hora estándar del atlántico +bot hora de bolivia +brt hora estándar de brasilia +clst hora de verano de chile +clt hora estándar de chile +cot hora estándar de colombia +east hora estándar de la isla de pascua +ect hora de ecuador +eeast hora de verano de la isla de pascua +eest hora de verano de europa oriental +eet hora estándar de europa oriental +fkst hora de verano de las malvinas +fnt hora estándar de fernando de noronha +galt hora de galápagos +gft hora de la guayana francesa +gyt hora de guyana +hkt hora estándar de hong kong +jst hora estándar de japón +kst hora estándar de corea +pet hora estándar de perú +pyst hora de verano de paraguay +pyt hora estándar de paraguay +sgt hora de singapur +uyst hora de verano de uruguay +uyt hora de uruguay +vet hora de venezuela +west hora de verano de europa oriental +wet hora estándar de europa oriental diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/data/time/time_zone_ext.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/time/time_zone_ext.tsv new file mode 100644 index 0000000000000000000000000000000000000000..7f94b24b7205549e279303188871b6dba1f620c9 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/time/time_zone_ext.tsv @@ -0,0 +1,105 @@ +# Additional time zones are listed below. +# To use them, simply copy them to the main time_zone.tsv file. + +acdt hora de verano de australia central +acst hora estándar de australia central +act hora de acre +acwst hora estándar de australia centroccidental +aedt hora de verano de australia oriental +aest hora estándar de australia oriental +aft hora de afganistán +akdt tiempo de verano de alaska +akst tiempo estándar de alaska +almt hora de almá-atá +aqtt hora de aktobé +awst hora estándar de australia occidental +azost hora de verano de las azores +azot hora estándar de las azores +azt hora estándar de azerbaiyán +bdt hora de brunéi +bnt hora de brunéi darussalam +bst hora de verano británica +btt hora de bután +cast hora de casey +cat hora de áfrica central +cct hora de las islas cocos +cest hora de verano de europa central +chut hora de chuuk +cvt hora estándar de cabo verde +cxt hora de la isla de navidad +chst hora estándar de chamorro +eat hora de áfrica oriental +egst hora de verano de groenlandia oriental +egt hora estándar de groenlandia oriental +fjst hora de verano de fiyi +fjt hora estándar de fiyi +gamt hora de gambier +ict hora de indochina +idt hora de verano de israel +iot hora del océano índico +irdt hora de verano de irán +irst hora estándar de irán +ist i s t +kgt hora de kirguistán +krat hora estándar de krasnoyarsk +lint hora de las espóradas ecuatoriales +magt hora estándar de magadán +mart hora de las islas marquesas +mmt hora de birmania +msk hora estándar de moscú +mut hora estándar de mauricio +mvt hora de maldivas +myt hora de malasia +nct hora estándar de nueva caledonia +ndt hora de verano de terranova +nft hora de las islas norfolk +vot hora estándar de novosibirsk +npt hora de nepal +nrt hora de nauru +nst hora estándar de terranova +nzdt hora de verano de nueva zelanda +hzst hora estándar de nueva zelanda +omst hora estándar de omsk +orat hora de kazajistán occidental +pett hora de kamchatka +pgt hora de papúa nueva guinea +phot hora de las islas fénix +pkt hora estándar de pakistán +pmdt hora de verano de san pedro y miquelón +pmst hora estándar de san predo y miquelón +pont hora de pohnpei +pwt hora de palaos +qyzt hora de quizilordá +ret hora de reunión +sakt hora estándar de sajalín +samt hora de samara +sast hora de sudáfrica +sbt hora de las islas salomón +sret hora de srednekolimsk +srt hora de surinam +sst hora estándar de samoa +taht hora de tahití +tft hora de las tierras australes y antárticas francesas +tjt hora de tayikistán +tkt hora de tokelau +tlt hora de timor oriental +tmt hora estándar de turkmenistán +tot hora estándar de tonga +trt hora estándar de turquía +tvt hora de tuvalu +ulat hora estándar de ulán bator +uzt hora estándar de uzbekistán +vlat hora estándar de vladivostok +volt hora estándar de volgogrado +vost hora de vostok +vut hora estándar de vanuatu +wakt hora de la isla wake +wat hora estándar de áfrica occidental +wgst hora de verano de groenlandia occidental +wgt hora estándar de groenlandia occidental +wib hora de indonesia occidental +wit hora de indonesia oriental +wita hora de indonesia central +wst hora de samoa occidental +yakt hora estándar de yakutsk +yekt hora estándar de ekaterimburgo diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/data/whitelist.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/whitelist.tsv new file mode 100644 index 0000000000000000000000000000000000000000..f86e6d1a5d78f40fec101c35e04fcbfd3337256b --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/data/whitelist.tsv @@ -0,0 +1,62 @@ +ud. usted +Ud. usted +uds. ustedes +Uds. ustedes +Vd. vosotros +Vds. vosotros +vd. vosotros +vds. vosotros +D. Don +Da. Doña +Dr. Doctor +Dra. Doctora +dr. doctor +dra. doctora +d. don +da. doña +EE. UU. Estados Unidos +ee. uu. estados unidos +Gob. gobierno +gob. gobierno +esq. esquina +Av. avenida +Avda. avenida +av. avenida +avda. avenida +avd. avenida +pág. página +p.ej. por ejemplo +p. ej. por ejemplo +Prof. profesor +Profa. profesora +prof. profesor +profa. profesora +S sur +N norte +Sr. señor +sr. señor +Sra. señora +sra. señora +Srta. señorita +srta. señorita +tel. teléfono +arr.º arrollo +blvr. bulevar +blvd. bulevar +c/ calle +c.° camino +c.º a. camino alto +c.º b. camino bajo +c.º v. camino viejo +carr.ª carrera +ctra. carretera +carret. carretera +cta. cuenta +pje. pasaje +p.º paseo +p.º a. paseo alto +p.º b. paseo bajo +pza. plaza +plza. plaza +rbla. rambla +vda. vereda diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/graph_utils.py b/zonos3/vendor/nemo_text_processing/text_normalization/es/graph_utils.py new file mode 100644 index 0000000000000000000000000000000000000000..b8622c2176d3a76bb3068ad311ce06561e8a80bf --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/graph_utils.py @@ -0,0 +1,218 @@ +# Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved. +# Copyright 2015 and onwards Google, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import NEMO_SIGMA, NEMO_SPACE +from zonos3.vendor.nemo_text_processing.text_normalization.es import LOCALIZATION +from zonos3.vendor.nemo_text_processing.text_normalization.es.utils import get_abs_path, load_labels + +digits = pynini.project(pynini.string_file(get_abs_path("data/numbers/digit.tsv")), "input") +tens = pynini.project(pynini.string_file(get_abs_path("data/numbers/ties.tsv")), "input") +teens = pynini.project(pynini.string_file(get_abs_path("data/numbers/teen.tsv")), "input") +twenties = pynini.project(pynini.string_file(get_abs_path("data/numbers/twenties.tsv")), "input") +hundreds = pynini.project(pynini.string_file(get_abs_path("data/numbers/hundreds.tsv")), "input") + +accents = pynini.string_map([("á", "a"), ("é", "e"), ("í", "i"), ("ó", "o"), ("ú", "u")]) + +if LOCALIZATION == "am": # Setting localization for central and northern america formatting + cardinal_separator = pynini.string_map([",", NEMO_SPACE]) + decimal_separator = pynini.accep(".") +else: + cardinal_separator = pynini.string_map([".", NEMO_SPACE]) + decimal_separator = pynini.accep(",") + +ones = pynini.union("un", "ún") +fem_ones = pynini.union(pynini.cross("un", "una"), pynini.cross("ún", "una"), pynini.cross("uno", "una")) +one_to_one_hundred = pynini.union(digits, "uno", tens, teens, twenties, tens + pynini.accep(" y ") + digits) +fem_hundreds = hundreds @ pynini.cdrewrite(pynini.cross("ientos", "ientas"), "", "", NEMO_SIGMA) + + +ES_MINUS = pynini.union("menos", "Menos", "MENOS").optimize() +ES_PLUS = pynini.union("más", "Más", "MÁS").optimize() + + +def strip_accent(fst: "pynini.FstLike") -> "pynini.FstLike": + """ + Converts all accented vowels to non-accented equivalents + + Args: + fst: Any fst. Composes vowel conversion onto fst's output strings + """ + return fst @ pynini.cdrewrite(accents, "", "", NEMO_SIGMA) + + +def shift_cardinal_gender(fst: "pynini.FstLike") -> "pynini.FstLike": + """ + Applies gender conversion rules to a cardinal string. These include: rendering all masculine forms of "uno" (including apocopated forms) as "una" and + Converting all gendered numbers in the hundreds series (200,300,400...) to feminine equivalent (e.g. "doscientos" -> "doscientas"). Conversion only applies + to value place for <1000 and multiple of 1000. (e.g. "doscientos mil doscientos" -> "doscientas mil doscientas".) For place values greater than the thousands, there + is no gender shift as the higher powers of ten ("millones", "billones") are masculine nouns and any conversion would be formally + ungrammatical. + e.g. + "doscientos" -> "doscientas" + "doscientos mil" -> "doscientas mil" + "doscientos millones" -> "doscientos millones" + "doscientos mil millones" -> "doscientos mil millones" + "doscientos millones doscientos mil doscientos" -> "doscientos millones doscientas mil doscientas" + + Args: + fst: Any fst. Composes conversion onto fst's output strings + """ + before_mil = ( + NEMO_SPACE + + (pynini.accep("mil") | pynini.accep("milésimo")) + + pynini.closure(NEMO_SPACE + hundreds, 0, 1) + + pynini.closure(NEMO_SPACE + one_to_one_hundred, 0, 1) + + pynini.union(pynini.accep("[EOS]"), pynini.accep('"'), decimal_separator) + ) + before_double_digits = pynini.closure(NEMO_SPACE + one_to_one_hundred, 0, 1) + pynini.union( + pynini.accep("[EOS]"), pynini.accep('"') + ) + + fem_allign = pynini.cdrewrite(fem_hundreds, "", before_mil, NEMO_SIGMA) # doscientas mil dosciento + fem_allign @= pynini.cdrewrite(fem_hundreds, "", before_double_digits, NEMO_SIGMA) # doscientas mil doscienta + + fem_allign @= pynini.cdrewrite( + fem_ones, "", pynini.union("[EOS]", '"', decimal_separator), NEMO_SIGMA + ) # If before a quote or EOS, we know it's the end of a string + + return fst @ fem_allign + + +def shift_number_gender(fst: "pynini.FstLike") -> "pynini.FstLike": + """ + Performs gender conversion on all verbalized numbers in output. All values in the hundreds series (200,300,400) are changed to + feminine gender (e.g. "doscientos" -> "doscientas") and all forms of "uno" (including apocopated forms) are converted to "una". + This has no boundary restriction and will perform shift across all values in output string. + e.g. + "doscientos" -> "doscientas" + "doscientos millones" -> "doscientas millones" + "doscientos millones doscientos" -> "doscientas millones doscientas" + + Args: + fst: Any fst. Composes conversion onto fst's output strings + """ + fem_allign = pynini.cdrewrite(fem_hundreds, "", "", NEMO_SIGMA) + fem_allign @= pynini.cdrewrite( + fem_ones, + "", + pynini.union(NEMO_SPACE, pynini.accep("[EOS]"), pynini.accep('"')), + NEMO_SIGMA, + ) # If before a quote or EOS, we know it's the end of a string + + return fst @ fem_allign + + +def strip_cardinal_apocope(fst: "pynini.FstLike") -> "pynini.FstLike": + """ + Reverts apocope on cardinal strings in line with formation rules. e.g. "un" -> "uno". Due to cardinal formation rules, this in effect only + affects strings where the final value is a variation of "un". + e.g. + "un" -> "uno" + "veintiún" -> "veintiuno" + + Args: + fst: Any fst. Composes conversion onto fst's output strings + """ + # Since cardinals use apocope by default for large values (e.g. "millón"), this only needs to act on the last instance of one + strip = pynini.cross("un", "uno") | pynini.cross("ún", "uno") + strip = pynini.cdrewrite(strip, "", pynini.union("[EOS]", '"'), NEMO_SIGMA) + return fst @ strip + + +def add_cardinal_apocope_fem(fst: "pynini.FstLike") -> "pynini.FstLike": + """ + Adds apocope on cardinal strings in line with stressing rules. e.g. "una" -> "un". This only occurs when "una" precedes a stressed "a" sound in formal speech. This is not predictable + with text string, so is included for non-deterministic cases. + e.g. + "una" -> "un" + "veintiuna" -> "veintiun" + + Args: + fst: Any fst. Composes conversion onto fst's output strings + """ + # Since the stress trigger follows the cardinal string and only affects the preceding sound, this only needs to act on the last instance of one + strip = pynini.cross("una", "un") | pynini.cross("veintiuna", "veintiún") + strip = pynini.cdrewrite(strip, "", pynini.union("[EOS]", '"'), NEMO_SIGMA) + return fst @ strip + + +def roman_to_int(fst: "pynini.FstLike") -> "pynini.FstLike": + """ + Alters given fst to convert Roman integers (lower and upper cased) into Arabic numerals. Valid for values up to 1000. + e.g. + "V" -> "5" + "i" -> "1" + + Args: + fst: Any fst. Composes fst onto Roman conversion outputs. + """ + + def _load_roman(file: str, upper_casing: bool): + roman = load_labels(get_abs_path(file)) + if upper_casing: + roman_numerals = [(x.upper(), y) for x, y in roman] + else: + roman_numerals = [(x, y) for x, y in roman] + return pynini.string_map(roman_numerals) + + # A split between all upper-case and all lower-case Roman numerals is introduced in order to preserve orthographic accuracy, + # and to prevent cases in which certain proper nouns e.g. (Li, Xi, Yi, etc.) are transduced to Roman numerals. + + digit_lower = _load_roman("data/roman/digit.tsv", False) + digit_upper = _load_roman("data/roman/digit.tsv", True) + ties_lower = _load_roman("data/roman/ties.tsv", False) + ties_upper = _load_roman("data/roman/ties.tsv", True) + hundreds_lower = _load_roman("data/roman/hundreds.tsv", False) + hundreds_upper = _load_roman("data/roman/hundreds.tsv", True) + thousands_lower = _load_roman("data/roman/thousands.tsv", False) + thousands_upper = _load_roman("data/roman/thousands.tsv", True) + + graph = ( + (digit_upper | digit_lower) + | ( + (ties_upper + (digit_upper | pynutil.add_weight(pynutil.insert("0"), 0.01))) + | (ties_lower + (digit_lower | pynutil.add_weight(pynutil.insert("0"), 0.01))) + ) + | ( + ( + hundreds_upper + + (ties_upper | pynutil.add_weight(pynutil.insert("0"), 0.01)) + + (digit_upper | pynutil.add_weight(pynutil.insert("0"), 0.01)) + ) + | ( + hundreds_lower + + (ties_lower | pynutil.add_weight(pynutil.insert("0"), 0.01)) + + (digit_lower | pynutil.add_weight(pynutil.insert("0"), 0.01)) + ) + ) + | ( + ( + thousands_upper + + (hundreds_upper | pynutil.add_weight(pynutil.insert("0"), 0.01)) + + (ties_upper | pynutil.add_weight(pynutil.insert("0"), 0.01)) + + (digit_upper | pynutil.add_weight(pynutil.insert("0"), 0.01)) + ) + | ( + thousands_lower + + (hundreds_lower | pynutil.add_weight(pynutil.insert("0"), 0.01)) + + (ties_lower | pynutil.add_weight(pynutil.insert("0"), 0.01)) + + (digit_lower | pynutil.add_weight(pynutil.insert("0"), 0.01)) + ) + ) + ).optimize() + + return graph @ fst diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/taggers/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/es/taggers/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..a1cf281f0908d225f51d921e9ddbdf92f9b14d99 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/taggers/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/taggers/cardinal.py b/zonos3/vendor/nemo_text_processing/text_normalization/es/taggers/cardinal.py new file mode 100644 index 0000000000000000000000000000000000000000..e44a8bf09c81b1bc2c851377b2bc9432e597275d --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/taggers/cardinal.py @@ -0,0 +1,177 @@ +# Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import ( + NEMO_ALPHA, + NEMO_DIGIT, + NEMO_SIGMA, + NEMO_SPACE, + NEMO_WHITE_SPACE, + GraphFst, + delete_space, + insert_space, +) +from zonos3.vendor.nemo_text_processing.text_normalization.es.graph_utils import cardinal_separator +from zonos3.vendor.nemo_text_processing.text_normalization.es.utils import get_abs_path + +zero = pynini.invert(pynini.string_file(get_abs_path("data/numbers/zero.tsv"))) +digit = pynini.invert(pynini.string_file(get_abs_path("data/numbers/digit.tsv"))) +teen = pynini.invert(pynini.string_file(get_abs_path("data/numbers/teen.tsv"))) +ties = pynini.invert(pynini.string_file(get_abs_path("data/numbers/ties.tsv"))) +twenties = pynini.invert(pynini.string_file(get_abs_path("data/numbers/twenties.tsv"))) +hundreds = pynini.invert(pynini.string_file(get_abs_path("data/numbers/hundreds.tsv"))) + + +def filter_punctuation(fst: 'pynini.FstLike') -> 'pynini.FstLike': + """ + Helper function for parsing number strings. Converts common cardinal strings (groups of three digits delineated by 'cardinal_separator' - see graph_utils) + and converts to a string of digits: + "1 000" -> "1000" + "1.000.000" -> "1000000" + Args: + fst: Any pynini.FstLike object. Function composes fst onto string parser fst + + Returns: + fst: A pynini.FstLike object + """ + exactly_three_digits = NEMO_DIGIT**3 # for blocks of three + up_to_three_digits = pynini.closure(NEMO_DIGIT, 1, 3) # for start of string + + cardinal_string = pynini.closure( + NEMO_DIGIT, 1 + ) # For string w/o punctuation (used for page numbers, thousand series) + + cardinal_string |= ( + up_to_three_digits + + pynutil.delete(cardinal_separator) + + pynini.closure(exactly_three_digits + pynutil.delete(cardinal_separator)) + + exactly_three_digits + ) + + return cardinal_string @ fst + + +class CardinalFst(GraphFst): + """ + Finite state transducer for classifying cardinals, e.g. + "1000" -> cardinal { integer: "mil" } + "2.000.000" -> cardinal { integer: "dos millones" } + + Args: + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="cardinal", kind="classify", deterministic=deterministic) + + # Any single digit + graph_digit = digit + digits_no_one = (NEMO_DIGIT - "1") @ graph_digit + + # Any double digit + graph_tens = teen + graph_tens |= ties + (pynutil.delete('0') | (pynutil.insert(" y ") + graph_digit)) + graph_tens |= twenties + + self.tens = graph_tens.optimize() + + self.two_digit_non_zero = pynini.union( + graph_digit, graph_tens, (pynini.cross("0", NEMO_SPACE) + graph_digit) + ).optimize() + + # Three digit strings + graph_hundreds = hundreds + pynini.union( + pynutil.delete("00"), (insert_space + graph_tens), (pynini.cross("0", NEMO_SPACE) + graph_digit) + ) + graph_hundreds |= pynini.cross("100", "cien") + graph_hundreds |= ( + pynini.cross("1", "ciento") + insert_space + pynini.union(graph_tens, pynutil.delete("0") + graph_digit) + ) + + self.hundreds = graph_hundreds.optimize() + + # For all three digit strings with leading zeroes (graph appends '0's to manage place in string) + graph_hundreds_component = pynini.union(graph_hundreds, pynutil.delete("0") + graph_tens) + + graph_hundreds_component_at_least_one_none_zero_digit = graph_hundreds_component | ( + pynutil.delete("00") + graph_digit + ) + graph_hundreds_component_at_least_one_none_zero_digit_no_one = graph_hundreds_component | ( + pynutil.delete("00") + digits_no_one + ) + + graph_thousands_component_at_least_one_none_zero_digit = pynini.union( + pynutil.delete("000") + graph_hundreds_component_at_least_one_none_zero_digit, + graph_hundreds_component_at_least_one_none_zero_digit_no_one + + pynutil.insert(" mil") + + ((insert_space + graph_hundreds_component_at_least_one_none_zero_digit) | pynutil.delete("000")), + pynini.cross("001", "mil") + + ((insert_space + graph_hundreds_component_at_least_one_none_zero_digit) | pynutil.delete("000")), + ) + + graph_thousands_component_at_least_one_none_zero_digit_no_one = pynini.union( + pynutil.delete("000") + graph_hundreds_component_at_least_one_none_zero_digit_no_one, + graph_hundreds_component_at_least_one_none_zero_digit_no_one + + pynutil.insert(" mil") + + ((insert_space + graph_hundreds_component_at_least_one_none_zero_digit) | pynutil.delete("000")), + pynini.cross("001", "mil") + + ((insert_space + graph_hundreds_component_at_least_one_none_zero_digit) | pynutil.delete("000")), + ) + + graph_million = pynutil.add_weight(pynini.cross("000001", "un millón"), -0.001) + graph_million |= graph_thousands_component_at_least_one_none_zero_digit_no_one + pynutil.insert(" millones") + graph_million |= pynutil.delete("000000") + graph_million += insert_space + + graph_billion = pynutil.add_weight(pynini.cross("000001", "un billón"), -0.001) + graph_billion |= graph_thousands_component_at_least_one_none_zero_digit_no_one + pynutil.insert(" billones") + graph_billion |= pynutil.delete("000000") + graph_billion += insert_space + + graph_trillion = pynutil.add_weight(pynini.cross("000001", "un trillón"), -0.001) + graph_trillion |= graph_thousands_component_at_least_one_none_zero_digit_no_one + pynutil.insert(" trillones") + graph_trillion |= pynutil.delete("000000") + graph_trillion += insert_space + + graph = ( + graph_trillion + + graph_billion + + graph_million + + (graph_thousands_component_at_least_one_none_zero_digit | pynutil.delete("000000")) + ) + + self.graph = ( + ((NEMO_DIGIT - "0") + pynini.closure(NEMO_DIGIT, 0)) + @ pynini.cdrewrite(pynini.closure(pynutil.insert("0")), "[BOS]", "", NEMO_SIGMA) + @ NEMO_DIGIT**24 + @ graph + @ pynini.cdrewrite(delete_space, "[BOS]", "", NEMO_SIGMA) + @ pynini.cdrewrite(delete_space, "", "[EOS]", NEMO_SIGMA) + @ pynini.cdrewrite( + pynini.cross(pynini.closure(NEMO_WHITE_SPACE, 2), NEMO_SPACE), NEMO_ALPHA, NEMO_ALPHA, NEMO_SIGMA + ) + ) + self.graph |= zero + + self.graph = filter_punctuation(self.graph).optimize() + + optional_minus_graph = pynini.closure(pynutil.insert("negative: ") + pynini.cross("-", "\"true\" "), 0, 1) + + final_graph = optional_minus_graph + pynutil.insert("integer: \"") + self.graph + pynutil.insert("\"") + + final_graph = self.add_tokens(final_graph) + self.fst = final_graph.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/taggers/date.py b/zonos3/vendor/nemo_text_processing/text_normalization/es/taggers/date.py new file mode 100644 index 0000000000000000000000000000000000000000..8312ec1a0fd8531e9338645b16e833fd638eebae --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/taggers/date.py @@ -0,0 +1,128 @@ +# Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import NEMO_DIGIT, NEMO_SPACE, GraphFst, delete_extra_space +from zonos3.vendor.nemo_text_processing.text_normalization.es.graph_utils import roman_to_int, strip_cardinal_apocope +from zonos3.vendor.nemo_text_processing.text_normalization.es.utils import get_abs_path + +articles = pynini.union("de", "del", "el", "del año", "año") +delete_leading_zero = (pynutil.delete("0") | (NEMO_DIGIT - "0")) + NEMO_DIGIT +month_numbers = pynini.string_file(get_abs_path("data/dates/months.tsv")) +month_abbr = pynini.string_file(get_abs_path("data/dates/months_abbr.tsv")) +weekdays = pynini.string_file(get_abs_path("data/dates/days_abbr.tsv")) +year_suffix = pynini.string_file(get_abs_path("data/dates/year_suffix.tsv")) + + +class DateFst(GraphFst): + """ + Finite state transducer for classifying date, e.g. + "01.04.2010" -> date { day: "un" month: "enero" year: "dos mil diez" preserve_order: true } + "marzo 4 2000" -> date { month: "marzo" day: "cuatro" year: "dos mil" } + "1990-20-01" -> date { year: "mil novecientos noventa" day: "veinte" month: "enero" } + + Args: + cardinal: cardinal GraphFst + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, cardinal: GraphFst, deterministic: bool): + super().__init__(name="date", kind="classify", deterministic=deterministic) + + number_to_month = month_numbers.optimize() + month_graph = pynini.project(number_to_month, "output") + + abbr_to_month = month_abbr.optimize() + month_graph |= abbr_to_month + + numbers = cardinal.graph + optional_leading_zero = delete_leading_zero | NEMO_DIGIT + + # 01, 31, 1 + digit_day = optional_leading_zero @ pynini.union(*[str(x) for x in range(1, 32)]) @ numbers + + # weekdays + optional_weekdays = pynini.closure(weekdays + NEMO_SPACE, 0, 1) + day = (pynutil.insert("day: \"") + optional_weekdays + digit_day + pynutil.insert("\"")).optimize() + + digit_month = optional_leading_zero @ pynini.union(*[str(x) for x in range(1, 13)]) + number_to_month = digit_month @ number_to_month + + month_name = (pynutil.insert("month: \"") + month_graph + pynutil.insert("\"")).optimize() + month_number = (pynutil.insert("month: \"") + number_to_month + pynutil.insert("\"")).optimize() + + # prefer cardinal over year + year = (NEMO_DIGIT - "0") + pynini.closure(NEMO_DIGIT, 1, 3) # 90, 990, 1990 + year = strip_cardinal_apocope(year @ numbers) + self.year = year + + # handle roman centuries and years + roman_numbers = roman_to_int(numbers) + roman_centuries = pynini.union("siglo ", "año ") + roman_numbers + roman_centuries_graph = ( + pynutil.insert("year: \"") + + roman_centuries + + pynutil.insert("\"") + + pynutil.insert(" preserve_order: true") + ).optimize() + + year_only = pynutil.insert("year: \"") + year + pynutil.insert("\"") + year_with_articles = ( + pynutil.insert("year: \"") + pynini.closure(articles + NEMO_SPACE, 0, 1) + year + pynutil.insert("\"") + ) + + # handle years with eras + year_suffix_graph = ( + pynutil.insert("year: \"") + + (numbers | roman_centuries) + + pynini.closure(NEMO_SPACE, 0, 1) + + year_suffix + + pynutil.insert("\"") + ) + + graph_dmy = ( + day + + pynini.closure(pynutil.delete(" de")) + + NEMO_SPACE + + month_name + + pynini.closure(NEMO_SPACE + year_with_articles, 0, 1) + ) + + graph_mdy = ( # English influences on language + month_name + delete_extra_space + day + pynini.closure(NEMO_SPACE + year_with_articles, 0, 1) + ) + + separators = [".", "-", "/"] + for sep in separators: + year_optional = pynini.closure(pynini.cross(sep, NEMO_SPACE) + year_only, 0, 1) + new_graph = day + pynini.cross(sep, NEMO_SPACE) + month_number + year_optional + graph_dmy |= new_graph + if not deterministic: + new_graph = month_number + pynini.cross(sep, NEMO_SPACE) + day + year_optional + graph_mdy |= new_graph + + dash = "-" + day_optional = pynini.closure(pynini.cross(dash, NEMO_SPACE) + day, 0, 1) + graph_ymd = NEMO_DIGIT**4 @ year_only + pynini.cross(dash, NEMO_SPACE) + month_number + day_optional + + final_graph = graph_dmy + pynutil.insert(" preserve_order: true") + final_graph |= graph_ymd + final_graph |= graph_mdy + final_graph |= roman_centuries_graph + final_graph |= year_suffix_graph + + self.final_graph = final_graph.optimize() + self.fst = self.add_tokens(self.final_graph).optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/taggers/decimals.py b/zonos3/vendor/nemo_text_processing/text_normalization/es/taggers/decimals.py new file mode 100644 index 0000000000000000000000000000000000000000..5a9eb0aa2595546318469dad1a06b35875867bc6 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/taggers/decimals.py @@ -0,0 +1,133 @@ +# Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import ( + NEMO_DIGIT, + NEMO_SIGMA, + NEMO_SPACE, + GraphFst, + delete_space, + insert_space, +) +from zonos3.vendor.nemo_text_processing.text_normalization.es.graph_utils import ( + cardinal_separator, + decimal_separator, + strip_cardinal_apocope, +) +from zonos3.vendor.nemo_text_processing.text_normalization.es.utils import get_abs_path + +quantities = pynini.string_file(get_abs_path("data/numbers/quantities.tsv")) +digit = pynini.invert(pynini.string_file(get_abs_path("data/numbers/digit.tsv"))) +zero = pynini.invert(pynini.string_file(get_abs_path("data/numbers/zero.tsv"))) + + +def get_quantity(decimal_graph: "pynini.FstLike", cardinal_graph: "pynini.FstLike") -> "pynini.FstLike": + """ + Returns FST that transforms either a cardinal or decimal followed by a quantity into a numeral, + e.g. 2 millones -> integer_part: "dos" quantity: "millones" + e.g. 2,4 millones -> integer_part: "dos" fractional_part: "cuatro" quantity: "millones" + + Args: + decimal_graph: DecimalFST + cardinal_graph: CardinalFST + """ + numbers = pynini.closure(NEMO_DIGIT, 1, 6) @ cardinal_graph + numbers = pynini.cdrewrite(pynutil.delete(cardinal_separator), "", "", NEMO_SIGMA) @ numbers + + res = ( + pynutil.insert('integer_part: "') + + numbers # The cardinal we're passing only produces 'un' for one, so gender agreement is safe (all quantities are masculine). Limit to 10^6 power. + + pynutil.insert('"') + + NEMO_SPACE + + pynutil.insert('quantity: "') + + quantities + + pynutil.insert('"') + ) + res |= decimal_graph + NEMO_SPACE + pynutil.insert('quantity: "') + quantities + pynutil.insert('"') + return res + + +class DecimalFst(GraphFst): + """ + Finite state transducer for classifying decimal, e.g. + -11,4006 billones -> decimal { negative: "true" integer_part: "once" fractional_part: "cuatro cero cero seis" quantity: "billones" preserve_order: true } + 1 billón -> decimal { integer_part: "un" quantity: "billón" preserve_order: true } + Args: + cardinal: CardinalFst + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, cardinal: GraphFst, deterministic: bool = True): + super().__init__(name="decimal", kind="classify", deterministic=deterministic) + graph_digit = digit | zero + + if not deterministic: + graph = pynini.union(graph_digit, cardinal.hundreds, cardinal.tens) + graph += pynini.closure(insert_space + graph) + + else: + # General pattern is 1-3 digits: map as cardinal, default to tens followed by digits otherwise \ + graph = pynini.union( + pynutil.add_weight(graph_digit + pynini.closure(insert_space + zero), -0.00001), + pynutil.add_weight(cardinal.tens + pynini.closure(insert_space + zero), -0.00002), + pynutil.add_weight(cardinal.hundreds + pynini.closure(insert_space + zero), 0.00001), + pynutil.add_weight( + cardinal.tens + + pynini.closure(insert_space + cardinal.tens, 1) + + pynini.closure(insert_space + zero, 0, 1) + + (pynini.closure(insert_space + graph_digit, 0, 1) | pynini.closure(insert_space + zero, 0)), + -0.00002, + ), # Read out as tens and a possible trailing digit or zeroes + zero + + pynini.closure(insert_space + zero) + + pynini.closure(insert_space + graph_digit), # For cases such as "1,010" + ) + + # Need to strip apocope everywhere BUT end of string + reverse_apocope = pynini.string_map([("un", "uno"), ("ún", "uno")]) + apply_reverse_apocope = pynini.cdrewrite(reverse_apocope, "", NEMO_SPACE, NEMO_SIGMA) + graph @= apply_reverse_apocope + + # Technically decimals should be space delineated groups of three, e.g. (1,333 333). This removes any possible spaces + strip_formatting = pynini.cdrewrite(delete_space, "", "", NEMO_SIGMA) + graph = strip_formatting @ graph + + self.graph = graph.optimize() + + graph_separator = pynutil.delete(decimal_separator) + optional_graph_negative = pynini.closure(pynutil.insert("negative: ") + pynini.cross("-", '"true" '), 0, 1) + + self.graph_fractional = pynutil.insert('fractional_part: "') + self.graph + pynutil.insert('"') + + # Integer graph maintains apocope except for ones place + graph_integer = ( + strip_cardinal_apocope(cardinal.graph) + if deterministic + else pynini.union(cardinal.graph, strip_cardinal_apocope(cardinal.graph)) + ) # Gives us forms w/ and w/o apocope + self.graph_integer = pynutil.insert('integer_part: "') + graph_integer + pynutil.insert('"') + final_graph_wo_sign = self.graph_integer + graph_separator + insert_space + self.graph_fractional + + self.final_graph_wo_negative = ( + final_graph_wo_sign | get_quantity(final_graph_wo_sign, cardinal.graph).optimize() + ) + final_graph = optional_graph_negative + self.final_graph_wo_negative + + final_graph += pynutil.insert(" preserve_order: true") + final_graph = self.add_tokens(final_graph) + + self.fst = final_graph.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/taggers/electronic.py b/zonos3/vendor/nemo_text_processing/text_normalization/es/taggers/electronic.py new file mode 100644 index 0000000000000000000000000000000000000000..2b3f36d5ba8fbe2e801f11e0ea69a1404d57eb98 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/taggers/electronic.py @@ -0,0 +1,107 @@ +# Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import ( + NEMO_ALPHA, + NEMO_DIGIT, + NEMO_SPACE, + GraphFst, + at, + colon, + domain_string, + double_quotes, + double_slash, + http, + https, + protocol_string, + username_string, + www, +) +from zonos3.vendor.nemo_text_processing.text_normalization.es.utils import get_abs_path, load_labels + +common_domains = [x[0] for x in load_labels(get_abs_path("data/electronic/domain.tsv"))] + + +class ElectronicFst(GraphFst): + """ + Finite state transducer for classifying electronic: email addresses + e.g. "abc@hotmail.com" -> electronic { username: "abc" domain: "hotmail.com" preserve_order: true } + e.g. "www.abc.com/123" -> electronic { protocol: "www." domain: "abc.com/123" preserve_order: true } + + Args: + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="electronic", kind="classify", deterministic=deterministic) + + full_stop_accep = pynini.accep(".") + full_stop = "." + + symbols = [x[0] for x in load_labels(get_abs_path("data/electronic/symbols.tsv"))] + symbols = pynini.union(*symbols) + symbols_no_full_stop = pynini.difference(symbols, full_stop_accep) + accepted_characters = pynini.closure((NEMO_ALPHA | NEMO_DIGIT | symbols_no_full_stop), 1) + all_characters = pynini.closure((NEMO_ALPHA | NEMO_DIGIT | symbols), 1) + + # domains + domain = full_stop_accep + accepted_characters + domain_graph = ( + pynutil.insert(domain_string + colon + NEMO_SPACE + double_quotes) + + (accepted_characters + pynini.closure(domain, 1)) + + pynutil.insert(double_quotes) + ) + + # email + username = ( + pynutil.insert(username_string + colon + NEMO_SPACE + double_quotes) + + all_characters + + pynutil.insert(double_quotes) + + pynini.cross(at, NEMO_SPACE) + ) + email = username + domain_graph + + # social media tags + tag = ( + pynini.cross(at, "") + + pynutil.insert(username_string + colon + NEMO_SPACE + double_quotes) + + (accepted_characters | (accepted_characters + pynini.closure(domain, 1))) + + pynutil.insert(double_quotes) + ) + + # url + protocol_start = pynini.accep(https + colon + double_slash) | pynini.accep(http + colon + double_slash) + # protocol_end = pynini.accep("www.") + protocol_end = ( + pynini.accep(www + full_stop) + if deterministic + else pynini.accep(www + full_stop) | pynini.cross(www + full_stop, "doble ve doble ve doble ve.") + ) + protocol = protocol_start | protocol_end | (protocol_start + protocol_end) + protocol = ( + pynutil.insert(protocol_string + colon + NEMO_SPACE + double_quotes) + + protocol + + pynutil.insert(double_quotes) + ) + url = protocol + pynutil.insert(NEMO_SPACE) + (domain_graph) + + graph = url | domain_graph | email | tag + self.graph = graph + + final_graph = self.add_tokens(self.graph + pynutil.insert(" preserve_order: true")) + self.fst = final_graph.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/taggers/fraction.py b/zonos3/vendor/nemo_text_processing/text_normalization/es/taggers/fraction.py new file mode 100644 index 0000000000000000000000000000000000000000..a610bb65238317229b9e8583f016180e8d371d27 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/taggers/fraction.py @@ -0,0 +1,164 @@ +# Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import ( + NEMO_CHAR, + NEMO_DIGIT, + NEMO_SIGMA, + NEMO_SPACE, + GraphFst, +) +from zonos3.vendor.nemo_text_processing.text_normalization.es.utils import get_abs_path + +ordinal_exceptions = pynini.string_file(get_abs_path("data/fractions/ordinal_exceptions.tsv")) +higher_powers_of_ten = pynini.string_file(get_abs_path("data/fractions/powers_of_ten.tsv")) +fraction_symbols = pynini.string_file(get_abs_path("data/fractions/fraction_symbols.tsv")) + + +class FractionFst(GraphFst): + """ + Finite state transducer for classifying fraction + "23 4/5" -> + tokens { fraction { integer: "veintitrés" numerator: "cuatro" denominator: "quinto" mophosyntactic_features: "ordinal" } } + + Args: + cardinal: CardinalFst + ordinal: OrdinalFst + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, cardinal: GraphFst, ordinal: GraphFst, deterministic: bool = True): + super().__init__(name="fraction", kind="classify", deterministic=deterministic) + cardinal_graph = cardinal.graph + ordinal_graph = ordinal.graph + + # 2-10 are all ordinals + three_to_ten = pynini.string_map( + [ + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10", + ] + ) + block_three_to_ten = pynutil.delete(three_to_ten) # To block cardinal productions + if not deterministic: # Multiples of tens are sometimes rendered as ordinals + three_to_ten |= pynini.string_map( + [ + "20", + "30", + "40", + "50", + "60", + "70", + "80", + "90", + ] + ) + graph_three_to_ten = three_to_ten @ ordinal_graph + graph_three_to_ten @= pynini.cdrewrite(ordinal_exceptions, "", "", NEMO_SIGMA) + + # Higher powers of tens (and multiples) are converted to ordinals. + hundreds = pynini.string_map( + [ + "100", + "200", + "300", + "400", + "500", + "600", + "700", + "800", + "900", + ] + ) + graph_hundreds = hundreds @ ordinal_graph + + multiples_of_thousand = ordinal.multiples_of_thousand # So we can have X milésimos + + graph_higher_powers_of_ten = ( + pynini.closure(ordinal.one_to_one_thousand + NEMO_SPACE, 0, 1) + + pynini.closure("mil ", 0, 1) + + pynini.closure(ordinal.one_to_one_thousand + NEMO_SPACE, 0, 1) + ) # x millones / x mil millones / x mil z millones + graph_higher_powers_of_ten += higher_powers_of_ten + graph_higher_powers_of_ten = cardinal_graph @ graph_higher_powers_of_ten + graph_higher_powers_of_ten @= pynini.cdrewrite( + pynutil.delete("un "), + pynini.accep("[BOS]"), + pynini.project(higher_powers_of_ten, "output"), + NEMO_SIGMA, + ) # we drop 'un' from these ordinals (millionths, not one-millionths) + + graph_higher_powers_of_ten = multiples_of_thousand | graph_hundreds | graph_higher_powers_of_ten + block_higher_powers_of_ten = pynutil.delete( + pynini.project(graph_higher_powers_of_ten, "input") + ) # For cardinal graph + + graph_fractions_ordinals = graph_higher_powers_of_ten | graph_three_to_ten + graph_fractions_ordinals += pynutil.insert( + '" morphosyntactic_features: "ordinal"' + ) # We note the root for processing later + + # Blocking the digits and hundreds from Cardinal graph + graph_fractions_cardinals = pynini.cdrewrite( + block_three_to_ten | block_higher_powers_of_ten, + pynini.accep("[BOS]"), + pynini.accep("[EOS]"), + NEMO_SIGMA, + ) + graph_fractions_cardinals @= NEMO_CHAR.plus @ pynini.cdrewrite( + pynutil.delete("0"), + pynini.accep("[BOS]"), + pynini.accep("[EOS]"), + NEMO_SIGMA, + ) # Empty characters become '0' for NEMO_CHAR fst, so need to block + graph_fractions_cardinals @= cardinal_graph + graph_fractions_cardinals += pynutil.insert( + '" morphosyntactic_features: "add_root"' + ) # blocking these entries to reduce erroneous possibilities in debugging + + if deterministic: + graph_fractions_cardinals = ( + pynini.closure(NEMO_DIGIT, 1, 2) @ graph_fractions_cardinals + ) # Past hundreds the conventional scheme can be hard to read. For determinism we stop here + + graph_denominator = pynini.union( + graph_fractions_ordinals, + graph_fractions_cardinals, + pynutil.add_weight(cardinal_graph + pynutil.insert('"'), 0.001), + ) # Last form is simply recording the cardinal. Weighting so last resort + + integer = pynutil.insert('integer_part: "') + cardinal_graph + pynutil.insert('"') + NEMO_SPACE + numerator = ( + pynutil.insert('numerator: "') + cardinal_graph + (pynini.cross("/", '" ') | pynini.cross(" / ", '" ')) + ) + denominator = pynutil.insert('denominator: "') + graph_denominator + + fraction = (fraction_symbols @ (numerator + denominator)) | (numerator + denominator) + + optional_minus_graph = pynini.closure(pynutil.insert("negative: ") + pynini.cross("-", '"true" '), 0, 1) + + self.graph = optional_minus_graph + pynini.closure(integer, 0, 1) + fraction + + final_graph = self.add_tokens(self.graph) + self.fst = final_graph.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/taggers/measure.py b/zonos3/vendor/nemo_text_processing/text_normalization/es/taggers/measure.py new file mode 100644 index 0000000000000000000000000000000000000000..9226bc6d6f1e6260445e552615a2f7ee1daec2f0 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/taggers/measure.py @@ -0,0 +1,216 @@ +# Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import ( + NEMO_ALPHA, + NEMO_NON_BREAKING_SPACE, + NEMO_SIGMA, + NEMO_SPACE, + GraphFst, + convert_space, + delete_space, + insert_space, +) +from zonos3.vendor.nemo_text_processing.text_normalization.es.graph_utils import strip_cardinal_apocope +from zonos3.vendor.nemo_text_processing.text_normalization.es.utils import get_abs_path + +unit = pynini.string_file(get_abs_path("data/measures/measurements.tsv")) +unit_complex = pynini.string_file(get_abs_path("data/measures/measurements_complex.tsv")) +unit_plural_fem = pynini.string_file(get_abs_path("data/measures/measurements_plural_fem.tsv")) +unit_plural_masc = pynini.string_file(get_abs_path("data/measures/measurements_plural_masc.tsv")) +math_symbols = pynini.string_file(get_abs_path("data/measures/math_symbols.tsv")) + + +class MeasureFst(GraphFst): + """ + Finite state transducer for classifying measure, e.g. + "2,4 g" -> measure { cardinal { integer_part: "dos" fractional_part: "cuatro" units: "gramos" preserve_order: true } } + "1 g" -> measure { cardinal { integer: "un" units: "gramo" preserve_order: true } } + "1 millón g" -> measure { cardinal { integer: "un quantity: "millón" units: "gramos" preserve_order: true } } + This class also converts words containing numbers and letters + e.g. "a-8" —> "a ocho" + e.g. "1,2-a" —> "uno coma dos a" + + + Args: + cardinal: CardinalFst + decimal: DecimalFst + fraction: FractionFst + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, cardinal: GraphFst, decimal: GraphFst, fraction: GraphFst, deterministic: bool = True): + super().__init__(name="measure", kind="classify", deterministic=deterministic) + cardinal_graph = cardinal.graph + + unit_singular = unit + unit_plural = unit_singular @ (unit_plural_fem | unit_plural_masc) + + graph_unit_singular = convert_space(unit_singular) + graph_unit_plural = convert_space(unit_plural) + + optional_graph_negative = pynini.closure("-", 0, 1) + + unit_plural = pynutil.insert('units: "') + graph_unit_plural + pynutil.insert('"') + + unit_singular_graph = pynutil.insert('units: "') + graph_unit_singular + pynutil.insert('"') + + unit_complex_plural = unit_complex @ (unit_plural_fem | unit_plural_masc) + + graph_unit_complex = convert_space(unit_complex) + graph_unit_complex_plural = convert_space(unit_complex_plural) + + graph_unit_denominator = ( + pynini.cross("/", "por") + pynutil.insert(NEMO_NON_BREAKING_SPACE) + graph_unit_singular + ) + + optional_unit_denominator = pynini.closure( + pynutil.insert(NEMO_NON_BREAKING_SPACE) + graph_unit_denominator, + 0, + 1, + ) + + complex_unit_singular_graph = ( + pynutil.insert('units: "') + + ((graph_unit_singular + optional_unit_denominator) | graph_unit_denominator | graph_unit_complex) + + pynutil.insert('"') + ) + + complex_unit_plural_graph = ( + pynutil.insert('units: "') + + ((graph_unit_plural + optional_unit_denominator) | graph_unit_denominator | graph_unit_complex_plural) + + pynutil.insert('"') + ) + + subgraph_decimal = ( + decimal.fst + insert_space + pynini.closure(NEMO_SPACE, 0, 1) + (unit_plural | complex_unit_plural_graph) + ) + subgraph_cardinal = ( + (optional_graph_negative + (NEMO_SIGMA - "1")) @ cardinal.fst + + insert_space + + pynini.closure(delete_space, 0, 1) + + (unit_plural | complex_unit_plural_graph) + ) + + subgraph_cardinal |= ( + (optional_graph_negative + pynini.accep("1")) @ cardinal.fst + + insert_space + + pynini.closure(delete_space, 0, 1) + + (unit_singular_graph | complex_unit_singular_graph) + ) + + subgraph_fraction = ( + fraction.fst + + insert_space + + pynini.closure(delete_space, 0, 1) + + (unit_plural | complex_unit_singular_graph) + ) + + decimal_times = ( + pynutil.insert("decimal { ") + + decimal.final_graph_wo_negative + + pynutil.insert(' } units: "') + + pynini.union("x", "X") + + pynutil.insert('"') + ) + + cardinal_times = ( + pynutil.insert('cardinal { integer: "') + + strip_cardinal_apocope(cardinal_graph) + + pynutil.insert('" } units: "') + + pynini.union("x", "X") + + pynutil.insert('"') + ) + + cardinal_dash_alpha = ( + pynutil.insert('cardinal { integer: "') + + strip_cardinal_apocope(cardinal_graph) + + pynutil.delete("-") + + pynutil.insert('" } units: "') + + pynini.closure(NEMO_ALPHA, 1) + + pynutil.insert('"') + ) + + decimal_dash_alpha = ( + pynutil.insert("decimal { ") + + decimal.final_graph_wo_negative + + pynutil.delete("-") + + pynutil.insert(' } units: "') + + pynini.closure(NEMO_ALPHA, 1) + + pynutil.insert("\"") + ) + + alpha_dash_cardinal = ( + pynutil.insert('units: "') + + pynini.closure(NEMO_ALPHA, 1) + + pynutil.delete("-") + + pynutil.insert('"') + + pynutil.insert(' cardinal { integer: "') + + cardinal_graph + + pynutil.insert('" } preserve_order: true') + ) + + alpha_dash_decimal = ( + pynutil.insert('units: "') + + pynini.closure(NEMO_ALPHA, 1) + + pynutil.delete("-") + + pynutil.insert('"') + + pynutil.insert(" decimal { ") + + decimal.final_graph_wo_negative + + pynutil.insert(" } preserve_order: true") + ) + + delimiter = pynini.accep(" ") | pynutil.insert(" ") + math_numbers = cardinal_graph | pynutil.add_weight(cardinal_graph @ pynini.cross("un", "uno"), -1) | NEMO_ALPHA + math = ( + math_numbers + + pynini.closure(delimiter + math_symbols + delimiter + math_numbers, 1) + + delimiter + + pynini.cross("=", "es igual a") + + delimiter + + math_numbers + ) + + math |= ( + math_numbers + + delimiter + + pynini.cross("=", "es igual a") + + math_numbers + + pynini.closure(delimiter + math_symbols + delimiter + math_numbers, 1) + ) + + math = ( + pynutil.insert("units: \"math\" cardinal { integer: \"") + + math + + pynutil.insert("\" } preserve_order: true") + ) + + final_graph = ( + subgraph_decimal + | subgraph_cardinal + | cardinal_dash_alpha + | alpha_dash_cardinal + | decimal_dash_alpha + | subgraph_fraction + | decimal_times + | cardinal_times + | alpha_dash_decimal + | math + ) + final_graph = self.add_tokens(final_graph) + + self.fst = final_graph.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/taggers/money.py b/zonos3/vendor/nemo_text_processing/text_normalization/es/taggers/money.py new file mode 100644 index 0000000000000000000000000000000000000000..7823fd8e4a9470516a309242ad6fb0329986c951 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/taggers/money.py @@ -0,0 +1,182 @@ +# Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import ( + NEMO_ALPHA, + NEMO_DIGIT, + NEMO_SIGMA, + NEMO_SPACE, + GraphFst, + delete_space, + insert_space, +) +from zonos3.vendor.nemo_text_processing.text_normalization.es.graph_utils import decimal_separator +from zonos3.vendor.nemo_text_processing.text_normalization.es.utils import get_abs_path, load_labels + +maj_singular_labels = load_labels(get_abs_path("data/money/currency_major.tsv")) +maj_singular = pynini.string_file((get_abs_path("data/money/currency_major.tsv"))) +min_singular = pynini.string_file(get_abs_path("data/money/currency_minor.tsv")) +fem_plural = pynini.string_file((get_abs_path("data/money/currency_plural_fem.tsv"))) +masc_plural = pynini.string_file((get_abs_path("data/money/currency_plural_masc.tsv"))) + + +class MoneyFst(GraphFst): + """ + Finite state transducer for classifying money, e.g. + "€1" -> money { currency_maj: "euro" integer_part: "un"} + "€1,000" -> money { currency_maj: "euro" integer_part: "un" } + "€1,001" -> money { currency_maj: "euro" integer_part: "un" fractional_part: "cero cero un" } + "£1,4" -> money { integer_part: "una" currency_maj: "libra" fractional_part: "cuarenta" preserve_order: true } + -> money { integer_part: "una" currency_maj: "libra" fractional_part: "cuarenta" currency_min: "penique" preserve_order: true } + "0,01 £" -> money { fractional_part: "un" currency_min: "penique" preserve_order: true } + "0,02 £" -> money { fractional_part: "dos" currency_min: "peniques" preserve_order: true } + "£0,01 million" -> money { currency_maj: "libra" integer_part: "cero" fractional_part: "cero un" quantity: "million" } + + Args: + cardinal: CardinalFst + decimal: DecimalFst + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, cardinal: GraphFst, decimal: GraphFst, deterministic: bool = True): + super().__init__(name="money", kind="classify", deterministic=deterministic) + cardinal_graph = cardinal.graph + graph_decimal_final = decimal.final_graph_wo_negative + + maj_singular_graph = maj_singular + min_singular_graph = min_singular + maj_plural_graph = maj_singular @ (fem_plural | masc_plural) + min_plural_graph = min_singular @ (fem_plural | masc_plural) + + graph_maj_singular = pynutil.insert("currency_maj: \"") + maj_singular_graph + pynutil.insert("\"") + graph_maj_plural = pynutil.insert("currency_maj: \"") + maj_plural_graph + pynutil.insert("\"") + + graph_integer_one = pynutil.insert("integer_part: \"") + pynini.cross("1", "un") + pynutil.insert("\"") + + decimal_with_quantity = (NEMO_SIGMA + NEMO_ALPHA) @ graph_decimal_final + + graph_decimal_plural = pynini.union( + graph_maj_plural + pynini.closure(delete_space, 0, 1) + insert_space + graph_decimal_final, # $1,05 + graph_decimal_final + pynini.closure(delete_space, 0, 1) + insert_space + graph_maj_plural, # 1,05 $ + ) + graph_decimal_plural = ( + (NEMO_SIGMA - "1") + decimal_separator + NEMO_SIGMA + ) @ graph_decimal_plural # Can't have "un euros" + + graph_decimal_singular = pynini.union( + graph_maj_singular + pynini.closure(delete_space, 0, 1) + insert_space + graph_decimal_final, # $1,05 + graph_decimal_final + pynini.closure(delete_space, 0, 1) + insert_space + graph_maj_singular, # 1,05 $ + ) + graph_decimal_singular = (pynini.accep("1") + decimal_separator + NEMO_SIGMA) @ graph_decimal_singular + + graph_decimal = pynini.union( + graph_decimal_singular, + graph_decimal_plural, + graph_maj_plural + pynini.closure(delete_space, 0, 1) + insert_space + decimal_with_quantity, + ) + + graph_integer = ( + pynutil.insert("integer_part: \"") + ((NEMO_SIGMA - "1") @ cardinal_graph) + pynutil.insert("\"") + ) + + graph_integer_only = pynini.union( + graph_maj_singular + pynini.closure(delete_space, 0, 1) + insert_space + graph_integer_one, + graph_integer_one + pynini.closure(delete_space, 0, 1) + insert_space + graph_maj_singular, + ) + graph_integer_only |= pynini.union( + graph_maj_plural + pynini.closure(delete_space, 0, 1) + insert_space + graph_integer, + graph_integer + pynini.closure(delete_space, 0, 1) + insert_space + graph_maj_plural, + ) + + graph = graph_integer_only | graph_decimal + + # remove trailing zeros of non zero number in the first 2 digits and fill up to 2 digits + # e.g. 2000 -> 20, 0200->02, 01 -> 01, 10 -> 10 + # not accepted: 002, 00, 0, + two_digits_fractional_part = ( + pynini.closure(NEMO_DIGIT) + (NEMO_DIGIT - "0") + pynini.closure(pynutil.delete("0")) + ) @ ( + (pynutil.delete("0") + (NEMO_DIGIT - "0")) + | ((NEMO_DIGIT - "0") + pynutil.insert("0")) + | ((NEMO_DIGIT - "0") + NEMO_DIGIT) + ) + + graph_min_singular = pynutil.insert("currency_min: \"") + min_singular_graph + pynutil.insert("\"") + graph_min_plural = pynutil.insert("currency_min: \"") + min_plural_graph + pynutil.insert("\"") + + # format ** euro ** cent + decimal_graph_with_minor = None + for curr_symbol, _ in maj_singular_labels: + preserve_order = pynutil.insert(" preserve_order: true") + + integer_plus_maj = pynini.union( + graph_integer + insert_space + pynutil.insert(curr_symbol) @ graph_maj_plural, + graph_integer_one + insert_space + pynutil.insert(curr_symbol) @ graph_maj_singular, + ) + # non zero integer part + integer_plus_maj = (pynini.closure(NEMO_DIGIT) - "0") @ integer_plus_maj + + graph_fractional_one = ( + pynutil.insert("fractional_part: \"") + + two_digits_fractional_part @ pynini.cross("1", "un") + + pynutil.insert("\"") + ) + + graph_fractional = ( + two_digits_fractional_part @ (pynini.closure(NEMO_DIGIT, 1, 2) - "1") @ cardinal.two_digit_non_zero + ) + graph_fractional = pynutil.insert("fractional_part: \"") + graph_fractional + pynutil.insert("\"") + + fractional_plus_min = pynini.union( + graph_fractional + insert_space + pynutil.insert(curr_symbol) @ graph_min_plural, + graph_fractional_one + insert_space + pynutil.insert(curr_symbol) @ graph_min_singular, + ) + + decimal_graph_with_minor_curr = ( + integer_plus_maj + pynini.cross(decimal_separator, NEMO_SPACE) + fractional_plus_min + ) + decimal_graph_with_minor_curr |= pynutil.add_weight( + integer_plus_maj + + pynini.cross(decimal_separator, NEMO_SPACE) + + pynutil.insert("fractional_part: \"") + + two_digits_fractional_part @ cardinal.two_digit_non_zero + + pynutil.insert("\""), + weight=0.0001, + ) + + decimal_graph_with_minor_curr |= pynutil.delete("0,") + fractional_plus_min + decimal_graph_with_minor_curr = pynini.union( + pynutil.delete(curr_symbol) + + pynini.closure(delete_space, 0, 1) + + decimal_graph_with_minor_curr + + preserve_order, + decimal_graph_with_minor_curr + + preserve_order + + pynini.closure(delete_space, 0, 1) + + pynutil.delete(curr_symbol), + ) + + decimal_graph_with_minor = ( + decimal_graph_with_minor_curr + if decimal_graph_with_minor is None + else pynini.union(decimal_graph_with_minor, decimal_graph_with_minor_curr) + ) + + final_graph = graph | pynutil.add_weight(decimal_graph_with_minor, -0.001) + + final_graph = self.add_tokens(final_graph) + self.fst = final_graph.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/taggers/ordinal.py b/zonos3/vendor/nemo_text_processing/text_normalization/es/taggers/ordinal.py new file mode 100644 index 0000000000000000000000000000000000000000..07a41e5aef258bb29329763f31b436a8b39ce717 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/taggers/ordinal.py @@ -0,0 +1,172 @@ +# Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import ( + NEMO_CHAR, + NEMO_SIGMA, + NEMO_SPACE, + GraphFst, + delete_space, +) +from zonos3.vendor.nemo_text_processing.text_normalization.es.graph_utils import roman_to_int, strip_accent +from zonos3.vendor.nemo_text_processing.text_normalization.es.utils import get_abs_path + +digit = pynini.invert(pynini.string_file(get_abs_path("data/ordinals/digit.tsv"))) +teens = pynini.invert(pynini.string_file(get_abs_path("data/ordinals/teen.tsv"))) +twenties = pynini.invert(pynini.string_file(get_abs_path("data/ordinals/twenties.tsv"))) +ties = pynini.invert(pynini.string_file(get_abs_path("data/ordinals/ties.tsv"))) +hundreds = pynini.invert(pynini.string_file(get_abs_path("data/ordinals/hundreds.tsv"))) +gender_suffix = pynini.string_file(get_abs_path("data/ordinals/gender_suffix.tsv")) + + +def get_one_to_one_thousand(cardinal: 'pynini.FstLike') -> 'pynini.FstLike': + """ + Produces an acceptor for verbalizations of all numbers from 1 to 1000. Needed for ordinals and fractions. + + Args: + cardinal: CardinalFst + + Returns: + fst: A pynini.FstLike object + """ + numbers = pynini.string_map([str(_) for _ in range(1, 1000)]) @ cardinal + return pynini.project(numbers, "output").optimize() + + +class OrdinalFst(GraphFst): + """ + Finite state transducer for classifying ordinal + "21.º" -> ordinal { integer: "vigésimo primero" morphosyntactic_features: "gender_masc" } + This class converts ordinal up to the millionth (millonésimo) order (exclusive). + + This FST also records the ending of the ordinal (called "morphosyntactic_features"): + either as gender_masc, gender_fem, or apocope. Also introduces plural feature for non-deterministic graphs. + + Args: + cardinal: CardinalFst + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, cardinal: GraphFst, deterministic: bool = True): + super().__init__(name="ordinal", kind="classify") + cardinal_graph = cardinal.graph + + graph_digit = digit.optimize() + graph_teens = teens.optimize() + graph_ties = ties.optimize() + graph_twenties = twenties.optimize() + graph_hundreds = hundreds.optimize() + + if not deterministic: + # Some alternative derivations + graph_ties = graph_ties | pynini.cross("sesenta", "setuagésimo") + + graph_teens = graph_teens | pynini.cross("once", "decimoprimero") + graph_teens |= pynini.cross("doce", "decimosegundo") + + graph_digit = graph_digit | pynini.cross("nueve", "nono") + graph_digit |= pynini.cross("siete", "sétimo") + + graph_tens_component = ( + graph_teens + | (graph_ties + pynini.closure(pynini.cross(" y ", NEMO_SPACE) + graph_digit, 0, 1)) + | graph_twenties + ) + + graph_hundred_component = pynini.union( + graph_hundreds + pynini.closure(NEMO_SPACE + pynini.union(graph_tens_component, graph_digit), 0, 1), + graph_tens_component, + graph_digit, + ) + + # Need to go up to thousands for fractions + self.one_to_one_thousand = get_one_to_one_thousand(cardinal_graph) + + thousands = pynini.cross("mil", "milésimo") + + graph_thousands = ( + strip_accent(self.one_to_one_thousand) + NEMO_SPACE + thousands + ) # Cardinals become prefix for thousands series. Snce accent on the powers of ten we strip accent from leading words + graph_thousands @= pynini.cdrewrite(delete_space, "", "milésimo", NEMO_SIGMA) # merge as a prefix + graph_thousands |= thousands + + self.multiples_of_thousand = (cardinal_graph @ graph_thousands).optimize() + + if ( + not deterministic + ): # Formally the words preceding the power of ten should be a prefix, but some maintain word boundaries. + graph_thousands |= (self.one_to_one_thousand @ graph_hundred_component) + NEMO_SPACE + thousands + + graph_thousands += pynini.closure(NEMO_SPACE + graph_hundred_component, 0, 1) + + ordinal_graph = graph_thousands | graph_hundred_component + ordinal_graph = cardinal_graph @ ordinal_graph + + if not deterministic: + # The 10's and 20's series can also be two words + split_words = pynini.cross("decimo", "décimo ") | pynini.cross("vigesimo", "vigésimo ") + split_words = pynini.cdrewrite(split_words, "", NEMO_CHAR, NEMO_SIGMA) + ordinal_graph |= ordinal_graph @ split_words + + # If "octavo" is preceeded by the "o" within string, it needs deletion + ordinal_graph @= pynini.cdrewrite(pynutil.delete("o"), "", "octavo", NEMO_SIGMA) + + self.graph = ordinal_graph.optimize() + + delete_period = pynini.closure(pynutil.delete("."), 0, 1) # Sometimes the period is omitted + convert_gender_suffix = delete_period + gender_suffix + + # Managing Romanization, excluding words that may be ambiguous + roman_ordinals = roman_to_int(ordinal_graph) + # exceptions = pynini.accep("vi") | pynini.accep("di") | pynini.accep("mi") + exceptions = pynini.string_file(get_abs_path("data/ordinals/roman_exceptions.tsv")) + graph_exception = pynini.project(exceptions, 'input') + roman_ordinals = (pynini.project(roman_ordinals, "input") - graph_exception.arcsort()) @ roman_ordinals + + graph_roman = pynutil.insert("integer: \"") + roman_ordinals + pynutil.insert("\"") + + if not deterministic: + # Introduce plural + plural = pynini.closure(pynutil.insert("/plural"), 0, 1) + convert_gender_suffix += plural + + # Romanizations have no morphology marker, so in non-deterministic case we provide option for all + insert_morphology = pynutil.insert(convert_gender_suffix) + plural + insert_morphology = ( + pynutil.insert(" morphosyntactic_features: \"") + insert_morphology + pynutil.insert("\"") + ) + + graph_roman += insert_morphology + + else: + # We insert both genders as default + graph_roman += pynutil.insert(" morphosyntactic_features: \"gender_masc\"") | pynutil.insert( + " morphosyntactic_features: \"gender_fem\"" + ) + + graph = ( + pynutil.insert("integer: \"") + + ordinal_graph + + pynutil.insert("\"") + + pynutil.insert(" morphosyntactic_features: \"") + + convert_gender_suffix + + pynutil.insert("\"") + ) + graph = pynini.union(graph, graph_roman) + + final_graph = self.add_tokens(graph) + self.fst = final_graph.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/taggers/telephone.py b/zonos3/vendor/nemo_text_processing/text_normalization/es/taggers/telephone.py new file mode 100644 index 0000000000000000000000000000000000000000..b778a180113ad1d3ee1a17bb0cea21263be1c9d6 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/taggers/telephone.py @@ -0,0 +1,194 @@ +# Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import ( + NEMO_ALPHA, + NEMO_SIGMA, + NEMO_SPACE, + GraphFst, + insert_space, +) +from zonos3.vendor.nemo_text_processing.text_normalization.es.graph_utils import ones +from zonos3.vendor.nemo_text_processing.text_normalization.es.utils import get_abs_path + +graph_digit = pynini.string_file(get_abs_path("data/numbers/digit.tsv")) +graph_ties = pynini.string_file(get_abs_path("data/numbers/ties.tsv")) +graph_teen = pynini.string_file(get_abs_path("data/numbers/teen.tsv")) +graph_twenties = pynini.string_file(get_abs_path("data/numbers/twenties.tsv")) + + +class TelephoneFst(GraphFst): + """ + Finite state transducer for classifying telephone numbers, e.g. + 123-123-5678 -> { number_part: "uno dos tres uno dos tres cinco seis siete ocho" }. + In Spanish, digits are generally read individually, or as 2-digit numbers, + eg. "123" = "uno dos tres", + "1234" = "doce treinta y cuatro". + This will verbalize sequences of 10 (3+3+4 e.g. 123-456-7890). + 9 (3+3+3 e.g. 123-456-789) and 8 (4+4 e.g. 1234-5678) digits. + + (we ignore more complicated cases such as "doscientos y dos" or "tres nueves"). + + Args: + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="telephone", kind="classify") + + # create `single_digits` and `double_digits` graphs as these will be + # the building blocks of possible telephone numbers + single_digits = pynini.invert(graph_digit).optimize() | pynini.cross("0", "cero") + single_digits @= pynini.cdrewrite(pynini.cross(ones, "uno"), "", "", NEMO_SIGMA) + + # Any double digit + teen = pynini.invert(graph_teen) + ties = pynini.invert(graph_ties) + twenties = pynini.invert(graph_twenties) + + double_digits = teen + double_digits |= ties + (pynutil.delete('0') | (pynutil.insert(" y ") + single_digits)) + double_digits |= twenties + + # define separators + separators = pynini.union("-", " ", ".") + delete_separator = pynini.closure(pynutil.delete(separators), 0, 1) + + # process country codes as '+1' -> country_code: "one" + triple_number = pynini.closure(single_digits + insert_space, 2, 2) + single_digits + country_code = pynini.closure(pynini.cross("+", "más "), 0, 1) + ( + single_digits | double_digits | triple_number + ) + + # add ip and telephone prompts to this tag (as is in EN) + ip_prompts = pynini.string_file(get_abs_path("data/telephone/ip_prompt.tsv")) + telephone_prompts = pynini.string_file(get_abs_path("data/telephone/telephone_prompt.tsv")) + tel_prompt_sequence = telephone_prompts + NEMO_SPACE + pynini.closure(country_code, 0, 1) + + country_code_graph = ( + pynutil.insert("country_code: \"") + + (country_code | ip_prompts | tel_prompt_sequence) + + delete_separator + + pynutil.insert("\"") + ) + + # process IP addresses + digit_to_str_graph = single_digits + pynini.closure(pynutil.insert(" ") + single_digits, 0, 2) + ip_graph = digit_to_str_graph + (pynini.cross(".", " punto ") + digit_to_str_graph) ** 3 + + # process area codes with or without parentheses i.e. "212" or (212) + area_code = ( + pynini.closure(pynutil.delete("("), 0, 1) + + pynini.closure(single_digits + insert_space, 3, 3) + + pynini.closure(pynutil.delete(")"), 0, 1) + ) + + # process extensions + delete_ext = pynini.closure(pynutil.delete("ext."), 0, 1) + ext_graph = ( + pynutil.insert("extension: \"") + + delete_separator + + delete_ext + + delete_separator + + pynutil.insert("extensión ") + + pynini.closure(single_digits + insert_space, 1, 3) + + single_digits + + pynutil.insert("\"") + ) + + # define `ten_digit_graph`, `nine_digit_graph`, `eight_digit_graph` + # which produces telephone numbers spoken (1) only with single digits, + # or (2) spoken with double digits (and sometimes single digits) + + # 10-digit option (1): all single digits + ten_digit_graph = ( + area_code + + delete_separator + + pynini.closure(single_digits + insert_space, 3, 3) + + delete_separator + + pynini.closure(single_digits + insert_space, 3, 3) + + single_digits + ) + + # 9-digit option (1): all single digits + nine_digit_graph = ( + area_code + + delete_separator + + pynini.closure(single_digits + insert_space, 3, 3) + + delete_separator + + pynini.closure(single_digits + insert_space, 2, 2) + + single_digits + ) + + # 8-digit option (1): all single digits + eight_digit_graph = ( + pynini.closure(area_code, 0, 1) + + delete_separator + + pynini.closure(single_digits + insert_space, 4, 4) + + delete_separator + + pynini.closure(single_digits + insert_space, 3, 3) + + single_digits + ) + + if not deterministic: + # 10-digit option (2): (1+2) + (1+2) + (2+2) digits + ten_digit_graph |= ( + pynini.closure(single_digits + insert_space + double_digits + insert_space + delete_separator, 2, 2) + + double_digits + + insert_space + + double_digits + ) + + # 9-digit option (2): (1+2) + (1+2) + (1+2) digits + nine_digit_graph |= ( + pynini.closure(single_digits + insert_space + double_digits + insert_space + delete_separator, 2, 2) + + single_digits + + insert_space + + double_digits + ) + + # 8-digit option (2): (2+2) + (2+2) digits + eight_digit_graph |= ( + double_digits + + insert_space + + double_digits + + insert_space + + delete_separator + + double_digits + + insert_space + + double_digits + ) + + # handle numbers with letters like "1-800-go-u-haul" + num_letter_area_code = area_code @ pynini.cross("ocho cero cero ", "ochocientos ") + number_word = pynini.closure(single_digits | NEMO_ALPHA, 1, 8) + number_words = pynini.closure(number_word + pynini.cross(separators, " "), 0, 2) + number_word + + nums_w_letters_graph = pynutil.add_weight(num_letter_area_code + delete_separator + number_words, 0.01) + + number_part = pynini.union( + ten_digit_graph, nine_digit_graph, eight_digit_graph, nums_w_letters_graph, ip_graph + ) + number_part = pynutil.insert("number_part: \"") + number_part + pynutil.insert("\"") + + graph = ( + pynini.closure(country_code_graph + delete_separator + insert_space, 0, 1) + + number_part + + pynini.closure(delete_separator + insert_space + ext_graph, 0, 1) + ) + final_graph = self.add_tokens(graph) + self.fst = final_graph.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/taggers/time.py b/zonos3/vendor/nemo_text_processing/text_normalization/es/taggers/time.py new file mode 100644 index 0000000000000000000000000000000000000000..752c8126398d97fd70d4a59354cd844e487966e0 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/taggers/time.py @@ -0,0 +1,226 @@ +# Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import ( + NEMO_DIGIT, + NEMO_SIGMA, + GraphFst, + delete_space, + insert_space, +) +from zonos3.vendor.nemo_text_processing.text_normalization.es.utils import get_abs_path + +time_zones = pynini.string_file(get_abs_path("data/time/time_zone.tsv")) +suffix = pynini.string_file(get_abs_path("data/time/time_suffix.tsv")) + + +class TimeFst(GraphFst): + """ + Finite state transducer for classifying time, e.g. + "02:15 est" -> time { hours: "dos" minutes: "quince" zone: "e s t"} + "2 h" -> time { hours: "dos" } + "9 h" -> time { hours: "nueve" } + "02:15:10 h" -> time { hours: "dos" minutes: "quince" seconds: "diez"} + + Args: + cardinal: CardinalFst + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, cardinal: GraphFst, deterministic: bool = True): + super().__init__(name="time", kind="classify", deterministic=deterministic) + + delete_time_delimiter = pynutil.delete(pynini.union(".", ":")) + + fem_one = pynini.string_map([("un", "una"), ("ún", "una")]) + change_one = pynini.cdrewrite(fem_one, "", "", NEMO_SIGMA) + cardinal_graph_fem = cardinal.graph @ change_one + cardinal_graph_masc = cardinal.graph + + day_suffix = pynutil.insert("suffix: \"") + suffix + pynutil.insert("\"") + day_suffix = delete_space + insert_space + day_suffix + + delete_hora_suffix = delete_space + insert_space + pynutil.delete("h") + delete_minute_suffix = delete_space + insert_space + (pynutil.delete("min") | pynutil.delete("m")) + delete_second_suffix = delete_space + insert_space + (pynutil.delete("seg") | pynutil.delete("s")) + + labels_hour_24 = [ + str(x) for x in range(0, 25) + ] # Can see both systems. Twelve hour requires am/pm for ambiguity resolution + labels_hour_12 = [str(x) for x in range(1, 13)] + labels_minute_or_second = [str(x) for x in range(1, 60)] + + delete_leading_zero_to_double_digit = ( + pynini.closure(pynutil.delete("0") | (NEMO_DIGIT - "0"), 0, 1) + NEMO_DIGIT + ) + + graph_24 = ( + pynini.closure(NEMO_DIGIT, 1, 2) @ delete_leading_zero_to_double_digit @ pynini.union(*labels_hour_24) + ) + graph_12 = ( + pynini.closure(NEMO_DIGIT, 1, 2) @ delete_leading_zero_to_double_digit @ pynini.union(*labels_hour_12) + ) + graph_minute_or_second = ( + pynini.closure(NEMO_DIGIT, 1, 2) + @ delete_leading_zero_to_double_digit + @ pynini.union(*labels_minute_or_second) + ) + graph_hour_24 = graph_24 @ cardinal_graph_fem + graph_hour_12 = graph_12 @ cardinal_graph_fem + graph_minute_or_second @= cardinal_graph_masc + + final_graph_hour_only_24 = ( + pynutil.insert("hours: \"") + graph_hour_24 + pynutil.insert("\"") + delete_hora_suffix + ) + final_graph_hour_only_12 = pynutil.insert("hours: \"") + graph_hour_12 + pynutil.insert("\"") + day_suffix + + final_graph_hour_24 = pynutil.insert("hours: \"") + graph_hour_24 + pynutil.insert("\"") + final_graph_hour_12 = pynutil.insert("hours: \"") + graph_hour_12 + pynutil.insert("\"") + + final_graph_minute = pynutil.insert("minutes: \"") + graph_minute_or_second + pynutil.insert("\"") + final_graph_second = pynutil.insert("seconds: \"") + graph_minute_or_second + pynutil.insert("\"") + + # handle suffixes like gmt or utc+1 + utc_one = pynini.string_map([("un", "uno"), ("ún", "uno")]) + change_utc_one = pynini.cdrewrite(utc_one, "", "", NEMO_SIGMA) + utc_cardinal_graph = cardinal.graph @ change_utc_one + + utc_or_gmt_numbers = (NEMO_DIGIT @ utc_cardinal_graph) | ( + graph_hour_24 + delete_time_delimiter + pynutil.insert(" ") + graph_minute_or_second + ) + + utc_or_gmt_diff = ( + pynutil.delete(pynini.closure(" ", 0, 1)) + + pynutil.insert(" ") + + pynini.string_map([("+", "más"), ("-", "menos")]) + + pynutil.delete(pynini.closure(" ", 0, 1)) + + pynutil.insert(" ") + + utc_or_gmt_numbers + ) + + time_zone_graph = time_zones + pynini.closure(utc_or_gmt_diff, 0, 1) + + final_time_zone_optional = pynini.closure( + delete_space + insert_space + pynutil.insert("zone: \"") + time_zone_graph + pynutil.insert("\""), + 0, + 1, + ) + + # 02.30 h + graph_hm = ( + final_graph_hour_24 + + delete_time_delimiter + + (pynutil.delete("00") | (insert_space + final_graph_minute)) + + pynini.closure( + (delete_time_delimiter + (pynutil.delete("00") | (insert_space + final_graph_second))), 0, 1 + ) + + pynini.closure(delete_hora_suffix, 0, 1) # 2.30 is valid if unambiguous + + final_time_zone_optional + ) + + # 2 h 30 min + graph_hm |= ( + final_graph_hour_24 + + delete_hora_suffix + + delete_space + + (pynutil.delete("00") | (insert_space + final_graph_minute)) + + delete_minute_suffix + + pynini.closure( + (delete_space + (pynutil.delete("00") | (insert_space + final_graph_second)) + delete_second_suffix), + 0, + 1, + ) + + final_time_zone_optional + ) + + # 2.30 a. m. (Only for 12 hour clock) + graph_hm |= ( + final_graph_hour_12 + + delete_time_delimiter + + (pynutil.delete("00") | (insert_space + final_graph_minute)) + + pynini.closure( + (delete_time_delimiter + (pynutil.delete("00") | (insert_space + final_graph_second))), 0, 1 + ) + + day_suffix + + final_time_zone_optional + ) + + graph_h = ( + pynini.union(final_graph_hour_only_24, final_graph_hour_only_12) + final_time_zone_optional + ) # Should always have a time indicator, else we'll pass to cardinals + + if not deterministic: + # This includes alternate vocalization (hour menos min, min para hour), here we shift the times and indicate a `style` tag + hour_shift_24 = pynini.invert(pynini.string_file(get_abs_path("data/time/hour_to_24.tsv"))) + hour_shift_12 = pynini.invert(pynini.string_file(get_abs_path("data/time/hour_to_12.tsv"))) + minute_shift = pynini.string_file(get_abs_path("data/time/minute_to.tsv")) + + graph_hour_to_24 = graph_24 @ hour_shift_24 @ cardinal_graph_fem + graph_hour_to_12 = graph_12 @ hour_shift_12 @ cardinal_graph_fem + + graph_minute_to = minute_shift @ graph_minute_or_second + + final_graph_hour_to_24 = pynutil.insert("hours: \"") + graph_hour_to_24 + pynutil.insert("\"") + final_graph_hour_to_12 = pynutil.insert("hours: \"") + graph_hour_to_12 + pynutil.insert("\"") + + final_graph_minute_to = pynutil.insert("minutes: \"") + graph_minute_to + pynutil.insert("\"") + + graph_menos = pynutil.insert(" style: \"1\"") + graph_para = pynutil.insert(" style: \"2\"") + + final_graph_style = graph_menos | graph_para + + # 02.30 h (omitting seconds since a bit awkward) + graph_hm |= ( + final_graph_hour_to_24 + + delete_time_delimiter + + insert_space + + final_graph_minute_to + + pynini.closure(delete_hora_suffix, 0, 1) # 2.30 is valid if unambiguous + + final_time_zone_optional + + final_graph_style + ) + + # 2 h 30 min + graph_hm |= ( + final_graph_hour_to_24 + + delete_hora_suffix + + delete_space + + insert_space + + final_graph_minute_to + + delete_minute_suffix + + final_time_zone_optional + + final_graph_style + ) + + # 2.30 a. m. (Only for 12 hour clock) + graph_hm |= ( + final_graph_hour_to_12 + + delete_time_delimiter + + insert_space + + final_graph_minute_to + + day_suffix + + final_time_zone_optional + + final_graph_style + ) + + final_graph = graph_hm | graph_h + if deterministic: + final_graph = final_graph + pynutil.insert(" preserve_order: true") + final_graph = final_graph.optimize() + final_graph = self.add_tokens(final_graph) + self.fst = final_graph.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/taggers/tokenize_and_classify.py b/zonos3/vendor/nemo_text_processing/text_normalization/es/taggers/tokenize_and_classify.py new file mode 100644 index 0000000000000000000000000000000000000000..5e700e784d40ee444748c1cc467a58f7302a5e63 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/taggers/tokenize_and_classify.py @@ -0,0 +1,161 @@ +# Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import os + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import ( + NEMO_WHITE_SPACE, + GraphFst, + delete_extra_space, + delete_space, + generator_main, +) +from zonos3.vendor.nemo_text_processing.text_normalization.en.taggers.punctuation import PunctuationFst +from zonos3.vendor.nemo_text_processing.text_normalization.es.taggers.cardinal import CardinalFst +from zonos3.vendor.nemo_text_processing.text_normalization.es.taggers.date import DateFst +from zonos3.vendor.nemo_text_processing.text_normalization.es.taggers.decimals import DecimalFst +from zonos3.vendor.nemo_text_processing.text_normalization.es.taggers.electronic import ElectronicFst +from zonos3.vendor.nemo_text_processing.text_normalization.es.taggers.fraction import FractionFst +from zonos3.vendor.nemo_text_processing.text_normalization.es.taggers.measure import MeasureFst +from zonos3.vendor.nemo_text_processing.text_normalization.es.taggers.money import MoneyFst +from zonos3.vendor.nemo_text_processing.text_normalization.es.taggers.ordinal import OrdinalFst +from zonos3.vendor.nemo_text_processing.text_normalization.es.taggers.telephone import TelephoneFst +from zonos3.vendor.nemo_text_processing.text_normalization.es.taggers.time import TimeFst +from zonos3.vendor.nemo_text_processing.text_normalization.es.taggers.whitelist import WhiteListFst +from zonos3.vendor.nemo_text_processing.text_normalization.es.taggers.word import WordFst +from zonos3.vendor.nemo_text_processing.utils.logging import logger + + +class ClassifyFst(GraphFst): + """ + Final class that composes all other classification grammars. This class can process an entire sentence, that is lower cased. + For deployment, this grammar will be compiled and exported to OpenFst Finite State aRchive (FAR) File. + More details to deployment at NeMo/tools/text_processing_deployment. + + Args: + input_case: accepting either "lower_cased" or "cased" input. + deterministic: if True will provide a single transduction option, + for False multiple options (used for audio-based normalization) + cache_dir: path to a dir with .far grammar file. Set to None to avoid using cache. + overwrite_cache: set to True to overwrite .far files + whitelist: path to a file with whitelist replacements + """ + + def __init__( + self, + input_case: str, + deterministic: bool = False, + cache_dir: str = None, + overwrite_cache: bool = False, + whitelist: str = None, + ): + super().__init__(name="tokenize_and_classify", kind="classify", deterministic=deterministic) + far_file = None + if cache_dir is not None and cache_dir != "None": + os.makedirs(cache_dir, exist_ok=True) + whitelist_file = os.path.basename(whitelist) if whitelist else "" + far_file = os.path.join( + cache_dir, + f"_{input_case}_es_tn_{deterministic}_deterministic{whitelist_file}.far", + ) + if not overwrite_cache and far_file and os.path.exists(far_file): + self.fst = pynini.Far(far_file, mode="r")["tokenize_and_classify"] + logger.info(f"ClassifyFst.fst was restored from {far_file}.") + else: + logger.info(f"Creating ClassifyFst grammars. This might take some time...") + + self.cardinal = CardinalFst(deterministic=deterministic) + cardinal_graph = self.cardinal.fst + + self.ordinal = OrdinalFst(cardinal=self.cardinal, deterministic=deterministic) + ordinal_graph = self.ordinal.fst + + self.decimal = DecimalFst(cardinal=self.cardinal, deterministic=deterministic) + decimal_graph = self.decimal.fst + + self.fraction = FractionFst( + cardinal=self.cardinal, + ordinal=self.ordinal, + deterministic=deterministic, + ) + fraction_graph = self.fraction.fst + self.measure = MeasureFst( + cardinal=self.cardinal, + decimal=self.decimal, + fraction=self.fraction, + deterministic=deterministic, + ) + measure_graph = self.measure.fst + self.date = DateFst(cardinal=self.cardinal, deterministic=deterministic) + date_graph = self.date.fst + word_graph = WordFst(deterministic=deterministic).fst + self.time = TimeFst(self.cardinal, deterministic=deterministic) + time_graph = self.time.fst + self.telephone = TelephoneFst(deterministic=deterministic) + telephone_graph = self.telephone.fst + self.electronic = ElectronicFst(deterministic=deterministic) + electronic_graph = self.electronic.fst + self.money = MoneyFst( + cardinal=self.cardinal, + decimal=self.decimal, + deterministic=deterministic, + ) + money_graph = self.money.fst + self.whitelist = WhiteListFst(input_case=input_case, deterministic=deterministic, input_file=whitelist) + whitelist_graph = self.whitelist.fst + punct_graph = PunctuationFst(deterministic=deterministic).fst + + classify = ( + pynutil.add_weight(whitelist_graph, 1.01) + | pynutil.add_weight(time_graph, 1.09) + | pynutil.add_weight(measure_graph, 1.08) + | pynutil.add_weight(cardinal_graph, 1.1) + | pynutil.add_weight(fraction_graph, 1.09) + | pynutil.add_weight(date_graph, 1.1) + | pynutil.add_weight(ordinal_graph, 1.1) + | pynutil.add_weight(decimal_graph, 1.1) + | pynutil.add_weight(money_graph, 1.09) + | pynutil.add_weight(telephone_graph, 1.11) + | pynutil.add_weight(electronic_graph, 1.11) + | pynutil.add_weight(word_graph, 200) + ) + punct = pynutil.insert("tokens { ") + pynutil.add_weight(punct_graph, weight=2.1) + pynutil.insert(" }") + punct = pynini.closure( + pynini.compose(pynini.closure(NEMO_WHITE_SPACE, 1), delete_extra_space) + | (pynutil.insert(" ") + punct), + 1, + ) + token = pynutil.insert("tokens { ") + classify + pynutil.insert(" }") + token_plus_punct = ( + pynini.closure(punct + pynutil.insert(" ")) + token + pynini.closure(pynutil.insert(" ") + punct) + ) + + graph = token_plus_punct + pynini.closure( + ( + pynini.compose(pynini.closure(NEMO_WHITE_SPACE, 1), delete_extra_space) + | (pynutil.insert(" ") + punct + pynutil.insert(" ")) + ) + + token_plus_punct + ) + + graph = delete_space + graph + delete_space + graph |= punct + + self.fst = graph.optimize() + + if far_file: + generator_main(far_file, {"tokenize_and_classify": self.fst}) diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/taggers/whitelist.py b/zonos3/vendor/nemo_text_processing/text_normalization/es/taggers/whitelist.py new file mode 100644 index 0000000000000000000000000000000000000000..cc9689a65bc935aea10349f33c896ca6afcb417c --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/taggers/whitelist.py @@ -0,0 +1,63 @@ +# Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import GraphFst, convert_space +from zonos3.vendor.nemo_text_processing.text_normalization.es.utils import get_abs_path, load_labels + + +class WhiteListFst(GraphFst): + """ + Finite state transducer for classifying whitelist, e.g. + "sr." -> tokens { name: "señor" } + This class has highest priority among all classifier grammars. Whitelisted tokens are defined and loaded from "data/whitelist.tsv". + + Args: + input_case: accepting either "lower_cased" or "cased" input. + deterministic: if True will provide a single transduction option, + for False multiple options (used for audio-based normalization) + input_file: path to a file with whitelist replacements + """ + + def __init__(self, input_case: str, deterministic: bool = True, input_file: str = None): + super().__init__(name="whitelist", kind="classify", deterministic=deterministic) + + def _get_whitelist_graph(input_case, file): + whitelist = load_labels(file) + if input_case == "lower_cased": + whitelist = [[x[0].lower()] + x[1:] for x in whitelist] + graph = pynini.string_map(whitelist) + return graph + + graph = _get_whitelist_graph(input_case, get_abs_path("data/whitelist.tsv")) + if not deterministic and input_case != "lower_cased": + graph |= pynutil.add_weight( + _get_whitelist_graph("lower_cased", get_abs_path("data/whitelist.tsv")), weight=0.0001 + ) + + if input_file: + whitelist_provided = _get_whitelist_graph(input_case, input_file) + if not deterministic: + graph |= whitelist_provided + else: + graph = whitelist_provided + + if not deterministic: + units_graph = _get_whitelist_graph(input_case, file=get_abs_path("data/measures/measurements.tsv")) + graph |= units_graph + + self.graph = graph + self.final_graph = convert_space(self.graph).optimize() + self.fst = (pynutil.insert("name: \"") + self.final_graph + pynutil.insert("\"")).optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/taggers/word.py b/zonos3/vendor/nemo_text_processing/text_normalization/es/taggers/word.py new file mode 100644 index 0000000000000000000000000000000000000000..803d4d1907c8f4dce7dd9b070a1ecde0e879a5f1 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/taggers/word.py @@ -0,0 +1,33 @@ +# Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import NEMO_NOT_SPACE, GraphFst + + +class WordFst(GraphFst): + """ + Finite state transducer for classifying word. + e.g. dormir -> tokens { name: "dormir" } + + Args: + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="word", kind="classify") + word = pynutil.insert("name: \"") + pynini.closure(NEMO_NOT_SPACE, 1) + pynutil.insert("\"") + self.fst = word.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/utils.py b/zonos3/vendor/nemo_text_processing/text_normalization/es/utils.py new file mode 100644 index 0000000000000000000000000000000000000000..375bc1fb1f3e7593371e8f56ffa1cb0c543ff5c2 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/utils.py @@ -0,0 +1,42 @@ +# Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import csv +import os + + +def get_abs_path(rel_path): + """ + Get absolute path + + Args: + rel_path: relative path to this file + + Returns absolute path + """ + return os.path.dirname(os.path.abspath(__file__)) + '/' + rel_path + + +def load_labels(abs_path): + """ + loads relative path file as dictionary + + Args: + abs_path: absolute path + + Returns dictionary of mappings + """ + with open(abs_path, encoding="utf-8") as label_tsv: + labels = list(csv.reader(label_tsv, delimiter="\t")) + return labels diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/verbalizers/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/es/verbalizers/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..a1cf281f0908d225f51d921e9ddbdf92f9b14d99 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/verbalizers/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/verbalizers/cardinal.py b/zonos3/vendor/nemo_text_processing/text_normalization/es/verbalizers/cardinal.py new file mode 100644 index 0000000000000000000000000000000000000000..5ddb0b4b3a5a01f0c3d283c45ebf4a0376815e50 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/verbalizers/cardinal.py @@ -0,0 +1,61 @@ +# Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import NEMO_NOT_QUOTE, GraphFst +from zonos3.vendor.nemo_text_processing.text_normalization.es.graph_utils import ( + add_cardinal_apocope_fem, + shift_cardinal_gender, + strip_cardinal_apocope, +) + + +class CardinalFst(GraphFst): + """ + Finite state transducer for verbalizing cardinals + e.g. cardinal { integer: "dos" } -> "dos" + + Args: + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="cardinal", kind="verbalize", deterministic=deterministic) + optional_sign = pynini.closure(pynini.cross("negative: \"true\" ", "menos "), 0, 1) + self.optional_sign = optional_sign + + integer = pynini.closure(NEMO_NOT_QUOTE, 1) + self.integer = pynutil.delete(" \"") + integer + pynutil.delete("\"") + + integer = pynutil.delete("integer:") + self.integer + + graph_masc = optional_sign + integer + graph_fem = shift_cardinal_gender(graph_masc) + + self.graph_masc = pynini.optimize(graph_masc) + self.graph_fem = pynini.optimize(graph_fem) + + # Adding adjustment for fem gender (choice of gender will be random) + graph = graph_masc | graph_fem + + if not deterministic: + # For alternate renderings when apocope is omitted (i.e. cardinal stands alone) + graph |= strip_cardinal_apocope(graph_masc) + # "una" will drop to "un" in unique contexts + graph |= add_cardinal_apocope_fem(graph_fem) + + delete_tokens = self.delete_tokens(graph) + self.fst = delete_tokens.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/verbalizers/date.py b/zonos3/vendor/nemo_text_processing/text_normalization/es/verbalizers/date.py new file mode 100644 index 0000000000000000000000000000000000000000..f80c18ca9e7b608df6521f0df768e2142ab0d7cd --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/verbalizers/date.py @@ -0,0 +1,83 @@ +# Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import ( + NEMO_NOT_QUOTE, + NEMO_SIGMA, + NEMO_SPACE, + GraphFst, + delete_preserve_order, +) +from zonos3.vendor.nemo_text_processing.text_normalization.es.graph_utils import strip_cardinal_apocope +from zonos3.vendor.nemo_text_processing.text_normalization.es.taggers.date import articles + + +class DateFst(GraphFst): + """ + Finite state transducer for verbalizing date, e.g. + date { day: "treinta y uno" month: "marzo" year: "dos mil" } -> "treinta y uno de marzo de dos mil" + date { day: "uno" month: "mayo" year: "del mil novecientos noventa" } -> "primero de mayo del mil novecientos noventa" + + Args: + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="date", kind="verbalize", deterministic=deterministic) + + day_cardinal = pynutil.delete("day: \"") + pynini.closure(NEMO_NOT_QUOTE, 1) + pynutil.delete("\"") + day = strip_cardinal_apocope(day_cardinal) + + primero = pynini.cdrewrite(pynini.cross("uno", "primero"), "[BOS]", "[EOS]", NEMO_SIGMA) + day = ( + (day @ primero) if deterministic else pynini.union(day, day @ primero) + ) # Primero for first day is traditional, but will vary depending on region + + month = pynutil.delete("month: \"") + pynini.closure(NEMO_NOT_QUOTE, 1) + pynutil.delete("\"") + + year = ( + pynutil.delete("year: \"") + + articles + + NEMO_SPACE + + pynini.closure(NEMO_NOT_QUOTE, 1) + + pynutil.delete("\"") + ) + + # Insert preposition if wasn't originally with the year. This would mean a space was present + year = pynutil.add_weight(year, -0.001) + year |= ( + pynutil.delete("year: \"") + + pynutil.insert("de ") + + pynini.closure(NEMO_NOT_QUOTE, 1) + + pynutil.delete("\"") + ) + + # Roman centuries + graph_roman_centuries = pynutil.delete("year: \"") + pynini.closure(NEMO_NOT_QUOTE, 1) + pynutil.delete("\"") + + # day month year + graph_dmy = day + pynini.cross(NEMO_SPACE, " de ") + month + pynini.closure(pynini.accep(" ") + year, 0, 1) + + graph_mdy = month + NEMO_SPACE + day + pynini.closure(NEMO_SPACE + year, 0, 1) + if deterministic: + graph_mdy += pynutil.delete(" preserve_order: true") # Only accepts this if was explicitly passed + + self.graph = graph_dmy | graph_mdy | graph_roman_centuries + final_graph = self.graph + delete_preserve_order + + delete_tokens = self.delete_tokens(final_graph) + self.fst = delete_tokens.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/verbalizers/decimals.py b/zonos3/vendor/nemo_text_processing/text_normalization/es/verbalizers/decimals.py new file mode 100644 index 0000000000000000000000000000000000000000..9f8f71564b102b8d990ad1cc833122e5c56b1d31 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/verbalizers/decimals.py @@ -0,0 +1,89 @@ +# Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import ( + NEMO_NOT_QUOTE, + GraphFst, + delete_preserve_order, + delete_space, + insert_space, +) +from zonos3.vendor.nemo_text_processing.text_normalization.es import LOCALIZATION +from zonos3.vendor.nemo_text_processing.text_normalization.es.graph_utils import ( + add_cardinal_apocope_fem, + shift_cardinal_gender, + shift_number_gender, + strip_cardinal_apocope, +) + + +class DecimalFst(GraphFst): + """ + Finite state transducer for classifying decimal, e.g. + decimal { negative: "true" integer_part: "dos" fractional_part: "cuatro cero" quantity: "billones" } -> menos dos coma quatro cero billones + decimal { integer_part: "un" quantity: "billón" } -> un billón + + Args: + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="decimal", kind="classify", deterministic=deterministic) + + optional_sign = pynini.closure(pynini.cross("negative: \"true\"", "menos ") + delete_space, 0, 1) + integer = pynutil.delete("integer_part: \"") + pynini.closure(NEMO_NOT_QUOTE, 1) + pynutil.delete("\"") + fractional_default = ( + pynutil.delete("fractional_part: \"") + pynini.closure(NEMO_NOT_QUOTE, 1) + pynutil.delete("\"") + ) + + conjunction = pynutil.insert(" punto ") if LOCALIZATION == "am" else pynutil.insert(" coma ") + if not deterministic: + conjunction |= pynutil.insert(pynini.union(" con ", " y ")) + fractional_default |= strip_cardinal_apocope(fractional_default) + fractional = conjunction + fractional_default + + quantity = ( + delete_space + + insert_space + + pynutil.delete("quantity: \"") + + pynini.closure(NEMO_NOT_QUOTE, 1) + + pynutil.delete("\"") + ) + optional_quantity = pynini.closure(quantity, 0, 1) + + graph_masc = optional_sign + pynini.union( + (integer + quantity), (integer + delete_space + fractional + optional_quantity) + ) + + # Allowing permutation for fem gender, don't include quantity since "million","billion", etc.. are masculine + graph_fem = optional_sign + (shift_cardinal_gender(integer) + delete_space + shift_number_gender(fractional)) + if not deterministic: # "una" will drop to "un" in certain cases + graph_fem |= add_cardinal_apocope_fem(graph_fem) + + self.numbers_only_quantity = ( + optional_sign + + pynini.union((integer + quantity), (integer + delete_space + fractional + quantity)).optimize() + ) + + self.graph_masc = (graph_masc + delete_preserve_order).optimize() + self.graph_fem = (graph_fem + delete_preserve_order).optimize() + + graph = graph_masc | graph_fem + + graph += delete_preserve_order + delete_tokens = self.delete_tokens(graph) + self.fst = delete_tokens.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/verbalizers/electronic.py b/zonos3/vendor/nemo_text_processing/text_normalization/es/verbalizers/electronic.py new file mode 100644 index 0000000000000000000000000000000000000000..39cef28db45a1ac259c8995a0197d5926096eb1e --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/verbalizers/electronic.py @@ -0,0 +1,92 @@ +# Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import ( + NEMO_NOT_QUOTE, + NEMO_SIGMA, + NEMO_SPACE, + GraphFst, + colon, + delete_preserve_order, + domain_string, + double_quotes, + protocol_string, + username_string, +) +from zonos3.vendor.nemo_text_processing.text_normalization.es.utils import get_abs_path + +digit_no_zero = pynini.invert(pynini.string_file(get_abs_path("data/numbers/digit.tsv"))) +zero = pynini.invert(pynini.string_file(get_abs_path("data/numbers/zero.tsv"))) + +graph_symbols = pynini.string_file(get_abs_path("data/electronic/symbols.tsv")) +server_common = pynini.string_file(get_abs_path("data/electronic/server_name.tsv")) +domain_common = pynini.string_file(get_abs_path("data/electronic/domain.tsv")) +arroba = "arroba" + + +class ElectronicFst(GraphFst): + """ + Finite state transducer for verbalizing electronic + e.g. electronic { username: "abc" domain: "hotmail.com" } -> "a b c arroba hotmail punto com" + -> "a b c arroba h o t m a i l punto c o m" + -> "a b c arroba hotmail punto c o m" + -> "a b c at h o t m a i l punto com" + Args: + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="electronic", kind="verbalize", deterministic=deterministic) + graph_digit_no_zero = ( + digit_no_zero @ pynini.cdrewrite(pynini.cross("un", "uno"), "", "", NEMO_SIGMA).optimize() + ) + graph_digit = graph_digit_no_zero | zero + + def add_space_after_char(): + return pynini.closure(NEMO_NOT_QUOTE - pynini.accep(NEMO_SPACE) + pynutil.insert(NEMO_SPACE)) + ( + NEMO_NOT_QUOTE - pynini.accep(NEMO_SPACE) + ) + + verbalize_characters = pynini.cdrewrite(graph_symbols | graph_digit, "", "", NEMO_SIGMA) + + user_name = ( + pynutil.delete(username_string + colon + NEMO_SPACE + double_quotes) + + add_space_after_char() + + pynutil.delete(double_quotes) + ) + user_name @= verbalize_characters + + convert_defaults = pynutil.add_weight(NEMO_NOT_QUOTE, weight=0.0001) | domain_common | server_common + domain = convert_defaults + pynini.closure(pynutil.insert(NEMO_SPACE) + convert_defaults) + domain @= verbalize_characters + + domain = ( + pynutil.delete(domain_string + colon + NEMO_SPACE + double_quotes) + domain + pynutil.delete(double_quotes) + ) + protocol = ( + pynutil.delete(protocol_string + colon + NEMO_SPACE + double_quotes) + + add_space_after_char() @ pynini.cdrewrite(graph_symbols, "", "", NEMO_SIGMA) + + pynutil.delete(double_quotes) + ) + + self.graph = (pynini.closure(protocol + NEMO_SPACE, 0, 1) + domain) | ( + user_name + NEMO_SPACE + pynutil.insert(arroba + NEMO_SPACE) + domain + | (pynutil.insert(arroba + NEMO_SPACE) + user_name) + ) + + delete_tokens = self.delete_tokens(self.graph + delete_preserve_order) + self.fst = delete_tokens.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/verbalizers/fraction.py b/zonos3/vendor/nemo_text_processing/text_normalization/es/verbalizers/fraction.py new file mode 100644 index 0000000000000000000000000000000000000000..fbd5857871c84ac0e1bf45a73330273abb81fe83 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/verbalizers/fraction.py @@ -0,0 +1,195 @@ +# Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import ( + NEMO_CHAR, + NEMO_NOT_QUOTE, + NEMO_NOT_SPACE, + NEMO_SIGMA, + NEMO_SPACE, + GraphFst, + delete_space, + insert_space, +) +from zonos3.vendor.nemo_text_processing.text_normalization.es.graph_utils import ( + accents, + shift_cardinal_gender, + strip_cardinal_apocope, +) + + +class FractionFst(GraphFst): + """ + Finite state transducer for verbalizing fraction + e.g. tokens { fraction { integer: "treinta y tres" numerator: "cuatro" denominator: "quinto" } } -> + treinta y tres y cuatro quintos + + + Args: + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="fraction", kind="verbalize", deterministic=deterministic) + optional_sign = pynini.closure(pynini.cross('negative: "true" ', "menos "), 0, 1) + self.optional_sign = optional_sign + + # Derivational strings append 'avo' as a suffix. Adding space for processing aid + fraction_stem = pynutil.insert(" avo") + plural = pynutil.insert("s") + conjunction = pynutil.insert(" y ") + + integer = ( + pynutil.delete('integer_part: "') + + strip_cardinal_apocope(pynini.closure(NEMO_NOT_QUOTE)) + + pynutil.delete('"') + ) + + numerator_one = pynutil.delete('numerator: "') + pynini.accep("un") + pynutil.delete('" ') + numerator = ( + pynutil.delete('numerator: "') + + pynini.difference(pynini.closure(NEMO_NOT_QUOTE), "un") + + pynutil.delete('" ') + ) + + denominator_add_stem = pynutil.delete('denominator: "') + ( + pynini.closure(NEMO_NOT_QUOTE) + fraction_stem + pynutil.delete('" morphosyntactic_features: "add_root"') + ) + denominator_ordinal = pynutil.delete('denominator: "') + ( + pynini.closure(NEMO_NOT_QUOTE) + pynutil.delete('" morphosyntactic_features: "ordinal"') + ) + denominator_cardinal = pynutil.delete('denominator: "') + ( + pynini.closure(NEMO_NOT_QUOTE) + pynutil.delete('"') + ) + + denominator_singular = pynini.union(denominator_add_stem, denominator_ordinal) + if not deterministic: + # Occasional exceptions + denominator_singular |= denominator_add_stem @ pynini.string_map( + [("once avo", "undécimo"), ("doce avo", "duodécimo")] + ) + denominator_plural = denominator_singular + plural + + # Merging operations + merge = pynini.cdrewrite( + pynini.cross(" y ", "i"), "", "", NEMO_SIGMA + ) # The denominator must be a single word, with the conjunction "y" replaced by i + merge @= pynini.cdrewrite(delete_space, "", pynini.difference(NEMO_CHAR, "parte"), NEMO_SIGMA) + + # The merger can produce duplicate vowels. This is not allowed in orthography + delete_duplicates = pynini.string_map([("aa", "a"), ("oo", "o")]) # Removes vowels + delete_duplicates = pynini.cdrewrite(delete_duplicates, "", "", NEMO_SIGMA) + + remove_accents = pynini.cdrewrite( + accents, + pynini.union(NEMO_SPACE, pynini.accep("[BOS]")) + pynini.closure(NEMO_NOT_SPACE), + pynini.closure(NEMO_NOT_SPACE) + pynini.union("avo", "ava", "ésimo", "ésima"), + NEMO_SIGMA, + ) + merge_into_single_word = merge @ remove_accents @ delete_duplicates + + fraction_default = numerator + delete_space + insert_space + (denominator_plural @ merge_into_single_word) + + fraction_with_one = ( + numerator_one + delete_space + insert_space + (denominator_singular @ merge_into_single_word) + ) + + fraction_with_cardinal = strip_cardinal_apocope(numerator | numerator_one) + fraction_with_cardinal += ( + delete_space + pynutil.insert(" sobre ") + strip_cardinal_apocope(denominator_cardinal) + ) + + if not deterministic: + # There is an alternative rendering where ordinals act as adjectives for 'parte'. This requires use of the feminine + # Other rules will manage use of "un" at end, so just worry about endings + exceptions = pynini.string_map([("tercia", "tercera")]) + apply_exceptions = pynini.cdrewrite(exceptions, "", "", NEMO_SIGMA) + vowel_change = pynini.cdrewrite(pynini.cross("o", "a"), "", pynini.accep("[EOS]"), NEMO_SIGMA) + + denominator_singular_fem = shift_cardinal_gender(denominator_singular) @ vowel_change @ apply_exceptions + denominator_plural_fem = denominator_singular_fem + plural + + numerator_one_fem = shift_cardinal_gender(numerator_one) + numerator_fem = shift_cardinal_gender(numerator) + + fraction_with_cardinal |= ( + (numerator_one_fem | numerator_fem) + + delete_space + + pynutil.insert(" sobre ") + + shift_cardinal_gender(denominator_cardinal) + ) + + # Still need to manage stems + merge_stem = pynini.cdrewrite( + delete_space, "", pynini.union("avo", "ava", "avos", "avas"), NEMO_SIGMA + ) # For managing alternative spacing + merge_stem @= remove_accents @ delete_duplicates + + fraction_with_one_fem = numerator_one_fem + delete_space + insert_space + fraction_with_one_fem += pynini.union( + denominator_singular_fem @ merge_stem, + denominator_singular_fem @ merge_into_single_word, + ) # Both forms exists + fraction_with_one_fem += pynutil.insert(" parte") + fraction_with_one_fem @= pynini.cdrewrite( + pynini.cross("una media", "media"), "", "", NEMO_SIGMA + ) # "media" not "una media" + + fraction_default_fem = numerator_fem + delete_space + insert_space + fraction_default_fem += pynini.union( + denominator_plural_fem @ merge_stem, + denominator_plural_fem @ merge_into_single_word, + ) + fraction_default_fem += pynutil.insert(" partes") + + fraction_default |= ( + numerator + delete_space + insert_space + denominator_plural @ merge_stem + ) # Case of no merger + fraction_default |= fraction_default_fem + + fraction_with_one |= numerator_one + delete_space + insert_space + denominator_singular @ merge_stem + fraction_with_one |= fraction_with_one_fem + + fraction_with_one @= pynini.cdrewrite( + pynini.cross("un medio", "medio"), "", "", NEMO_SIGMA + ) # "medio" not "un medio" + + fraction = fraction_with_one | fraction_default | fraction_with_cardinal + graph_masc = optional_sign + pynini.closure(integer + delete_space + conjunction, 0, 1) + fraction + + # Manage cases of fem gender (only shows on integer except for "medio") + integer_fem = shift_cardinal_gender(integer) + fraction_default |= ( + shift_cardinal_gender(numerator) + + delete_space + + insert_space + + (denominator_plural @ pynini.cross("medios", "medias")) + ) + fraction_with_one |= ( + pynutil.delete(numerator_one) + delete_space + (denominator_singular @ pynini.cross("medio", "media")) + ) + + fraction_fem = fraction_with_one | fraction_default | fraction_with_cardinal + graph_fem = optional_sign + pynini.closure(integer_fem + delete_space + conjunction, 0, 1) + fraction_fem + + self.graph_masc = pynini.optimize(graph_masc) + self.graph_fem = pynini.optimize(graph_fem) + + self.graph = graph_masc | graph_fem + + delete_tokens = self.delete_tokens(self.graph) + self.fst = delete_tokens.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/verbalizers/measure.py b/zonos3/vendor/nemo_text_processing/text_normalization/es/verbalizers/measure.py new file mode 100644 index 0000000000000000000000000000000000000000..c7d80e61b3e59f6b0c1f419c65225ff6a64433f8 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/verbalizers/measure.py @@ -0,0 +1,115 @@ +# Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import ( + NEMO_NOT_QUOTE, + NEMO_SIGMA, + NEMO_SPACE, + NEMO_WHITE_SPACE, + GraphFst, + delete_extra_space, + delete_preserve_order, + delete_space, +) +from zonos3.vendor.nemo_text_processing.text_normalization.es.graph_utils import ones +from zonos3.vendor.nemo_text_processing.text_normalization.es.utils import get_abs_path + +unit_plural_fem = pynini.string_file(get_abs_path("data/measures/measurements_plural_fem.tsv")) +unit_plural_masc = pynini.string_file(get_abs_path("data/measures/measurements_plural_masc.tsv")) + +unit_singular_fem = pynini.project(unit_plural_fem, "input") +unit_singular_masc = pynini.project(unit_plural_masc, "input") + +unit_plural_fem = pynini.project(unit_plural_fem, "output") +unit_plural_masc = pynini.project(unit_plural_masc, "output") + + +class MeasureFst(GraphFst): + """ + Finite state transducer for verbalizing measure, e.g. + measure { cardinal { integer: "dos" units: "gramos" } } -> "dos gramos" + measure { decimal { integer_part: "dos" quantity: "millones" units: "gramos" } } -> "dos millones de gramos" + + Args: + decimal: DecimalFst + cardinal: CardinalFst + fraction: FractionFst + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, decimal: GraphFst, cardinal: GraphFst, fraction: GraphFst, deterministic: bool): + super().__init__(name="measure", kind="verbalize", deterministic=deterministic) + + graph_decimal_masc = decimal.delete_tokens(decimal.graph_masc) + graph_decimal_fem = decimal.delete_tokens(decimal.graph_fem) + graph_cardinal_masc = cardinal.delete_tokens(cardinal.graph_masc) + graph_cardinal_fem = cardinal.delete_tokens(cardinal.graph_fem) + graph_fraction_fem = fraction.delete_tokens(fraction.graph_fem) + graph_fraction_masc = fraction.delete_tokens(fraction.graph_masc) + + unit_masc = (unit_plural_masc | unit_singular_masc) + pynini.closure( + NEMO_WHITE_SPACE + "por" + pynini.closure(NEMO_NOT_QUOTE, 1), 0, 1 + ) + unit_masc |= "por" + pynini.closure(NEMO_NOT_QUOTE, 1) + unit_masc = pynutil.delete("units: \"") + (pynini.closure(NEMO_NOT_QUOTE) @ unit_masc) + pynutil.delete("\"") + + unit_fem = (unit_plural_fem | unit_singular_fem) + pynini.closure( + NEMO_WHITE_SPACE + "por" + pynini.closure(NEMO_NOT_QUOTE, 1), 0, 1 + ) + unit_fem = pynutil.delete("units: \"") + (pynini.closure(NEMO_NOT_QUOTE) @ unit_fem) + pynutil.delete("\"") + + graph_masc = (graph_cardinal_masc | graph_decimal_masc) + NEMO_WHITE_SPACE + unit_masc + graph_masc |= graph_fraction_masc + NEMO_WHITE_SPACE + pynutil.insert("de ") + unit_masc + graph_masc |= pynutil.add_weight( + graph_fraction_masc @ (NEMO_SIGMA + pynini.union("medio", "medios")) + NEMO_WHITE_SPACE + unit_masc, -0.001 + ) # "medio litro" not "medio de litro" + + graph_fem = (graph_cardinal_fem | graph_decimal_fem) + NEMO_WHITE_SPACE + unit_fem + graph_fem |= graph_fraction_fem + NEMO_WHITE_SPACE + pynutil.insert("de ") + unit_fem + graph_fem |= pynutil.add_weight( + graph_fraction_fem @ (NEMO_SIGMA + pynini.union("media", "medias")) + NEMO_WHITE_SPACE + unit_fem, -0.001 + ) + + graph = graph_masc | graph_fem + + graph = ( + pynini.cdrewrite( + pynutil.insert(" de"), "quantity: \"" + pynini.closure(NEMO_NOT_QUOTE, 1), "\"", NEMO_SIGMA + ) + @ graph + ) # billones de xyz + + graph @= pynini.cdrewrite(pynini.cross(ones, "uno"), "", NEMO_WHITE_SPACE + "por", NEMO_SIGMA) + + # To manage alphanumeric combonations ("a-8, 5x"), we let them use a weighted default path. + alpha_num_unit = pynutil.delete("units: \"") + pynini.closure(NEMO_NOT_QUOTE) + pynutil.delete("\"") + graph_alpha_num = pynini.union( + (graph_cardinal_masc | graph_decimal_masc) + NEMO_SPACE + alpha_num_unit, + alpha_num_unit + delete_extra_space + (graph_cardinal_masc | graph_decimal_masc), + ) + + math = pynutil.add_weight( + pynutil.delete("units: \"math\"") + delete_space + graph_cardinal_masc + delete_space, -1 + ) + + graph |= pynutil.add_weight(graph_alpha_num, 0.01) + graph |= math + + graph += delete_preserve_order + + delete_tokens = self.delete_tokens(graph) + self.fst = delete_tokens.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/verbalizers/money.py b/zonos3/vendor/nemo_text_processing/text_normalization/es/verbalizers/money.py new file mode 100644 index 0000000000000000000000000000000000000000..3ca61a17d9874e0c7857323c157b49581e5332b7 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/verbalizers/money.py @@ -0,0 +1,167 @@ +# Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import ( + NEMO_NOT_QUOTE, + NEMO_SIGMA, + NEMO_SPACE, + GraphFst, + delete_preserve_order, +) +from zonos3.vendor.nemo_text_processing.text_normalization.es.graph_utils import shift_cardinal_gender, strip_cardinal_apocope +from zonos3.vendor.nemo_text_processing.text_normalization.es.utils import get_abs_path + +fem = pynini.string_file((get_abs_path("data/money/currency_plural_fem.tsv"))) +masc = pynini.string_file((get_abs_path("data/money/currency_plural_masc.tsv"))) + +fem_singular = pynini.project(fem, "input") +masc_singular = pynini.project(masc, "input") + +fem_plural = pynini.project(fem, "output") +masc_plural = pynini.project(masc, "output") + + +class MoneyFst(GraphFst): + """ + Finite state transducer for verbalizing money, e.g. + money { currency_maj: "euro" integer_part: "un"} -> "un euro" + money { currency_maj: "euro" integer_part: "un" fractional_part: "cero cero un"} -> "uno coma cero cero uno euros" + money { integer_part: "un" currency_maj: "libra" fractional_part: "cuarenta" preserve_order: true} -> "una libra cuarenta" + money { integer_part: "un" currency_maj: "libra" fractional_part: "cuarenta" currency_min: "peniques" preserve_order: true} -> "una libra con cuarenta peniques" + money { fractional_part: "un" currency_min: "penique" preserve_order: true} -> "un penique" + + Args: + decimal: GraphFst + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, decimal: GraphFst, deterministic: bool = True): + super().__init__(name="money", kind="verbalize", deterministic=deterministic) + + maj_singular_masc = ( + pynutil.delete("currency_maj: \"") + + (pynini.closure(NEMO_NOT_QUOTE, 1) @ masc_singular) + + pynutil.delete("\"") + ) + maj_singular_fem = ( + pynutil.delete("currency_maj: \"") + + (pynini.closure(NEMO_NOT_QUOTE, 1) @ fem_singular) + + pynutil.delete("\"") + ) + + maj_plural_masc = ( + pynutil.delete("currency_maj: \"") + + (pynini.closure(NEMO_NOT_QUOTE, 1) @ masc_plural) + + pynutil.delete("\"") + ) + maj_plural_fem = ( + pynutil.delete("currency_maj: \"") + + (pynini.closure(NEMO_NOT_QUOTE, 1) @ fem_plural) + + pynutil.delete("\"") + ) + + maj_masc = maj_plural_masc | maj_singular_masc # Tagger kept quantity resolution stable + maj_fem = maj_plural_fem | maj_singular_fem + + min_singular_masc = ( + pynutil.delete("currency_min: \"") + + (pynini.closure(NEMO_NOT_QUOTE, 1) @ masc_singular) + + pynutil.delete("\"") + ) + min_singular_fem = ( + pynutil.delete("currency_min: \"") + + (pynini.closure(NEMO_NOT_QUOTE, 1) @ fem_singular) + + pynutil.delete("\"") + ) + + min_plural_masc = ( + pynutil.delete("currency_min: \"") + + (pynini.closure(NEMO_NOT_QUOTE, 1) @ masc_plural) + + pynutil.delete("\"") + ) + min_plural_fem = ( + pynutil.delete("currency_min: \"") + + (pynini.closure(NEMO_NOT_QUOTE, 1) @ fem_plural) + + pynutil.delete("\"") + ) + + min_masc = min_plural_masc | min_singular_masc + min_fem = min_plural_fem | min_singular_fem + + fractional_part = ( + pynutil.delete("fractional_part: \"") + pynini.closure(NEMO_NOT_QUOTE, 1) + pynutil.delete("\"") + ) + + integer_part = pynutil.delete("integer_part: \"") + pynini.closure(NEMO_NOT_QUOTE, 1) + pynutil.delete("\"") + optional_add_and = pynini.closure(pynutil.insert(pynini.union("con ", "y ")), 0, 1) + + # *** currency_maj + graph_integer_masc = integer_part + NEMO_SPACE + maj_masc + graph_integer_fem = shift_cardinal_gender(integer_part) + NEMO_SPACE + maj_fem + + graph_integer = graph_integer_fem | graph_integer_masc + + # *** currency_maj + (***) | ((con) *** current_min) + graph_integer_with_minor_masc = ( + graph_integer_masc + + NEMO_SPACE + + pynini.union( + optional_add_and + strip_cardinal_apocope(fractional_part), + (optional_add_and + fractional_part + NEMO_SPACE + min_masc), + (optional_add_and + shift_cardinal_gender(fractional_part) + NEMO_SPACE + min_fem), + ) # Could be minor currency that is different gender + + delete_preserve_order + ) + + graph_integer_with_minor_fem = ( + graph_integer_fem + + NEMO_SPACE + + pynini.union( + optional_add_and + shift_cardinal_gender(fractional_part), + (optional_add_and + fractional_part + NEMO_SPACE + min_masc), + (optional_add_and + shift_cardinal_gender(fractional_part) + NEMO_SPACE + min_fem), + ) # Could be minor currency that is different gender + + delete_preserve_order + ) + + graph_integer_with_minor = graph_integer_with_minor_fem | graph_integer_with_minor_masc + + ## *** coma *** currency_maj + graph_decimal_masc = decimal.graph_masc + NEMO_SPACE + maj_masc + + graph_decimal_fem = decimal.graph_fem + graph_decimal_fem |= decimal.numbers_only_quantity # can still have "x billions" with fem currency + graph_decimal_fem += NEMO_SPACE + maj_fem + + graph_decimal = graph_decimal_fem | graph_decimal_masc + graph_decimal = ( + pynini.cdrewrite( + pynutil.insert(" de"), "quantity: \"" + pynini.closure(NEMO_NOT_QUOTE, 1), "\"", NEMO_SIGMA + ) + @ graph_decimal + ) # formally it's millones/billones de *** + + # *** current_min + graph_minor_masc = fractional_part + NEMO_SPACE + min_masc + delete_preserve_order + graph_minor_fem = shift_cardinal_gender(fractional_part) + NEMO_SPACE + min_fem + delete_preserve_order + + graph_minor = graph_minor_fem | graph_minor_masc + + graph = graph_integer | graph_integer_with_minor | graph_decimal | graph_minor + + delete_tokens = self.delete_tokens(graph) + self.fst = delete_tokens.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/verbalizers/ordinal.py b/zonos3/vendor/nemo_text_processing/text_normalization/es/verbalizers/ordinal.py new file mode 100644 index 0000000000000000000000000000000000000000..90b129f3f9cd933ed0e1b543f7fb531ffcf8c298 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/verbalizers/ordinal.py @@ -0,0 +1,70 @@ +# Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import NEMO_NOT_QUOTE, NEMO_SIGMA, NEMO_SPACE, GraphFst +from zonos3.vendor.nemo_text_processing.text_normalization.es.graph_utils import shift_number_gender + + +class OrdinalFst(GraphFst): + """ + Finite state transducer for verbalizing ordinals + e.g. ordinal { integer: "tercer" } } -> "tercero" + -> "tercera" + -> "tercer" + + Args: + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="ordinal", kind="verbalize", deterministic=deterministic) + + graph = pynutil.delete("integer: \"") + pynini.closure(NEMO_NOT_QUOTE, 1) + pynutil.delete("\"") + + # masculne gender we leave as is + graph_masc = graph + pynutil.delete(" morphosyntactic_features: \"gender_masc") + + # shift gender + graph_fem_ending = graph @ pynini.cdrewrite( + pynini.cross("o", "a"), "", NEMO_SPACE | pynini.accep("[EOS]"), NEMO_SIGMA + ) + graph_fem = shift_number_gender(graph_fem_ending) + pynutil.delete(" morphosyntactic_features: \"gender_fem") + + # Apocope just changes tercero and primero. May occur if someone wrote 11.er (uncommon) + graph_apocope = ( + pynini.cross("tercero", "tercer") + | pynini.cross("primero", "primer") + | pynini.cross("undécimo", "decimoprimer") + ) # In case someone wrote 11.er with deterministic + graph_apocope = (graph @ pynini.cdrewrite(graph_apocope, "", "", NEMO_SIGMA)) + pynutil.delete( + " morphosyntactic_features: \"apocope" + ) + + graph = graph_apocope | graph_masc | graph_fem + + if not deterministic: + # Plural graph + graph_plural = pynini.cdrewrite( + pynutil.insert("s"), pynini.union("o", "a"), NEMO_SPACE | pynini.accep("[EOS]"), NEMO_SIGMA + ) + + graph |= (graph @ graph_plural) + pynutil.delete("/plural") + + self.graph = graph + pynutil.delete("\"") + + delete_tokens = self.delete_tokens(self.graph) + self.fst = delete_tokens.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/verbalizers/telephone.py b/zonos3/vendor/nemo_text_processing/text_normalization/es/verbalizers/telephone.py new file mode 100644 index 0000000000000000000000000000000000000000..6912a6bb30605a4c6b2c006b600013f9f84eca79 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/verbalizers/telephone.py @@ -0,0 +1,69 @@ +# Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import NEMO_NOT_QUOTE, GraphFst, delete_space, insert_space + + +class TelephoneFst(GraphFst): + """ + Finite state transducer for verbalizing telephone, e.g. + telephone { number_part: "uno dos tres uno dos tres cinco seis siete ocho" } + -> uno dos tres uno dos tres cinco seis siete ocho + + Args: + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="telephone", kind="verbalize") + + optional_country_code = pynini.closure( + pynutil.delete("country_code: \"") + + pynini.closure(NEMO_NOT_QUOTE, 1) + + pynutil.delete("\"") + + delete_space + + insert_space, + 0, + 1, + ) + + number_part = ( + pynutil.delete("number_part: \"") + + pynini.closure(NEMO_NOT_QUOTE, 1) + + pynini.closure(pynutil.add_weight(pynutil.delete(" "), -0.0001), 0, 1) + + pynutil.delete("\"") + ) + + optional_extension = pynini.closure( + delete_space + + insert_space + + pynutil.delete("extension: \"") + + pynini.closure(NEMO_NOT_QUOTE, 1) + + pynutil.delete("\""), + 0, + 1, + ) + + graph = optional_country_code + number_part + optional_extension + delete_tokens = self.delete_tokens(graph) + self.fst = delete_tokens.optimize() + + +# number_part = pynutil.delete("number_part: \"") + pynini.closure(NEMO_NOT_QUOTE, 1) + pynutil.delete("\"") + +# delete_tokens = self.delete_tokens(number_part) +# self.fst = delete_tokens.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/verbalizers/time.py b/zonos3/vendor/nemo_text_processing/text_normalization/es/verbalizers/time.py new file mode 100644 index 0000000000000000000000000000000000000000..e0f0b15647f72c4f5ba547bfad67ff8e55543a3b --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/verbalizers/time.py @@ -0,0 +1,257 @@ +# Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import ( + NEMO_NOT_QUOTE, + NEMO_SIGMA, + GraphFst, + delete_preserve_order, + delete_space, + insert_space, +) +from zonos3.vendor.nemo_text_processing.text_normalization.es.utils import get_abs_path + +alt_minutes = pynini.string_file(get_abs_path("data/time/alt_minutes.tsv")) + +morning_times = pynini.string_file(get_abs_path("data/time/morning_times.tsv")) +afternoon_times = pynini.string_file(get_abs_path("data/time/afternoon_times.tsv")) +evening_times = pynini.string_file(get_abs_path("data/time/evening_times.tsv")) + + +class TimeFst(GraphFst): + """ + Finite state transducer for verbalizing time, e.g. + time { hours: "doce" minutes: "media" suffix: "a m" } -> doce y media de la noche + time { hours: "doce" } -> twelve o'clock + + Args: + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="time", kind="verbalize", deterministic=deterministic) + + change_minutes = pynini.cdrewrite(alt_minutes, pynini.accep("[BOS]"), pynini.accep("[EOS]"), NEMO_SIGMA) + + morning_phrases = pynini.cross("am", "de la mañana") + afternoon_phrases = pynini.cross("pm", "de la tarde") + evening_phrases = pynini.cross("pm", "de la noche") + + # For the 12's + mid_times = pynini.accep("doce") + mid_phrases = ( + pynini.string_map([("pm", "del mediodía"), ("am", "de la noche")]) + if deterministic + else pynini.string_map( + [ + ("pm", "de la mañana"), + ("pm", "del día"), + ("pm", "del mediodía"), + ("am", "de la noche"), + ("am", "de la medianoche"), + ] + ) + ) + + hour = ( + pynutil.delete("hours:") + + delete_space + + pynutil.delete("\"") + + pynini.closure(NEMO_NOT_QUOTE, 1) + + pynutil.delete("\"") + ) + minute = ( + pynutil.delete("minutes:") + + delete_space + + pynutil.delete("\"") + + pynini.closure(NEMO_NOT_QUOTE, 1) + + pynutil.delete("\"") + ) + minute = (minute @ change_minutes) if deterministic else pynini.union(minute, minute @ change_minutes) + + suffix = ( + pynutil.delete("suffix:") + + delete_space + + pynutil.delete("\"") + + pynini.closure(NEMO_NOT_QUOTE, 1) + + pynutil.delete("\"") + ) + zone = ( + pynutil.delete("zone:") + + delete_space + + pynutil.delete("\"") + + pynini.closure(NEMO_NOT_QUOTE, 1) + + pynutil.delete("\"") + ) + optional_zone = pynini.closure(delete_space + insert_space + zone, 0, 1) + second = ( + pynutil.delete("seconds:") + + delete_space + + pynutil.delete("\"") + + pynini.closure(NEMO_NOT_QUOTE, 1) + + pynutil.delete("\"") + ) + + graph_hms = ( + hour + + pynutil.insert(" horas ") + + delete_space + + minute + + pynutil.insert(" minutos y ") + + delete_space + + second + + pynutil.insert(" segundos") + ) + + graph_hm = hour + delete_space + pynutil.insert(" y ") + minute + graph_hm |= pynini.union( + (hour @ morning_times) + + delete_space + + pynutil.insert(" y ") + + minute + + delete_space + + insert_space + + (suffix @ morning_phrases), + (hour @ afternoon_times) + + delete_space + + pynutil.insert(" y ") + + minute + + delete_space + + insert_space + + (suffix @ afternoon_phrases), + (hour @ evening_times) + + delete_space + + pynutil.insert(" y ") + + minute + + delete_space + + insert_space + + (suffix @ evening_phrases), + (hour @ mid_times) + + delete_space + + pynutil.insert(" y ") + + minute + + delete_space + + insert_space + + (suffix @ mid_phrases), + ) + + graph_h = pynini.union( + hour, + (hour @ morning_times) + delete_space + insert_space + (suffix @ morning_phrases), + (hour @ afternoon_times) + delete_space + insert_space + (suffix @ afternoon_phrases), + (hour @ evening_times) + delete_space + insert_space + (suffix @ evening_phrases), + (hour @ mid_times) + delete_space + insert_space + (suffix @ mid_phrases), + ) + + graph = (graph_hms | graph_hm | graph_h) + optional_zone + + if not deterministic: + graph_style_1 = pynutil.delete(" style: \"1\"") + graph_style_2 = pynutil.delete(" style: \"2\"") + + graph_menos = hour + delete_space + pynutil.insert(" menos ") + minute + graph_style_1 + graph_menos |= ( + (hour @ morning_times) + + delete_space + + pynutil.insert(" menos ") + + minute + + delete_space + + insert_space + + (suffix @ morning_phrases) + + graph_style_1 + ) + graph_menos |= ( + (hour @ afternoon_times) + + delete_space + + pynutil.insert(" menos ") + + minute + + delete_space + + insert_space + + (suffix @ afternoon_phrases) + + graph_style_1 + ) + graph_menos |= ( + (hour @ evening_times) + + delete_space + + pynutil.insert(" menos ") + + minute + + delete_space + + insert_space + + (suffix @ evening_phrases) + + graph_style_1 + ) + graph_menos |= ( + (hour @ mid_times) + + delete_space + + pynutil.insert(" menos ") + + minute + + delete_space + + insert_space + + (suffix @ mid_phrases) + + graph_style_1 + ) + graph_menos += optional_zone + + graph_para = minute + pynutil.insert(" para las ") + delete_space + hour + graph_style_2 + graph_para |= ( + minute + + pynutil.insert(" para las ") + + delete_space + + (hour @ morning_times) + + delete_space + + insert_space + + (suffix @ morning_phrases) + + graph_style_2 + ) + graph_para |= ( + minute + + pynutil.insert(" para las ") + + delete_space + + (hour @ afternoon_times) + + delete_space + + insert_space + + (suffix @ afternoon_phrases) + + graph_style_2 + ) + graph_para |= ( + minute + + pynutil.insert(" para las ") + + delete_space + + (hour @ evening_times) + + delete_space + + insert_space + + (suffix @ evening_phrases) + + graph_style_2 + ) + graph_para |= ( + minute + + pynutil.insert(" para las ") + + delete_space + + (hour @ mid_times) + + delete_space + + insert_space + + (suffix @ mid_phrases) + + graph_style_2 + ) + graph_para += optional_zone + graph_para @= pynini.cdrewrite( + pynini.cross(" las ", " la "), "para", "una", NEMO_SIGMA + ) # Need agreement with one + + graph |= graph_menos | graph_para + delete_tokens = self.delete_tokens(graph + delete_preserve_order) + self.fst = delete_tokens.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/verbalizers/verbalize.py b/zonos3/vendor/nemo_text_processing/text_normalization/es/verbalizers/verbalize.py new file mode 100644 index 0000000000000000000000000000000000000000..cc5e7694f244aabc3c8429e081428b4c7a41946b --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/verbalizers/verbalize.py @@ -0,0 +1,73 @@ +# Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import GraphFst +from zonos3.vendor.nemo_text_processing.text_normalization.en.verbalizers.whitelist import WhiteListFst +from zonos3.vendor.nemo_text_processing.text_normalization.es.verbalizers.cardinal import CardinalFst +from zonos3.vendor.nemo_text_processing.text_normalization.es.verbalizers.date import DateFst +from zonos3.vendor.nemo_text_processing.text_normalization.es.verbalizers.decimals import DecimalFst +from zonos3.vendor.nemo_text_processing.text_normalization.es.verbalizers.electronic import ElectronicFst +from zonos3.vendor.nemo_text_processing.text_normalization.es.verbalizers.fraction import FractionFst +from zonos3.vendor.nemo_text_processing.text_normalization.es.verbalizers.measure import MeasureFst +from zonos3.vendor.nemo_text_processing.text_normalization.es.verbalizers.money import MoneyFst +from zonos3.vendor.nemo_text_processing.text_normalization.es.verbalizers.ordinal import OrdinalFst +from zonos3.vendor.nemo_text_processing.text_normalization.es.verbalizers.telephone import TelephoneFst +from zonos3.vendor.nemo_text_processing.text_normalization.es.verbalizers.time import TimeFst + + +class VerbalizeFst(GraphFst): + """ + Composes other verbalizer grammars. + For deployment, this grammar will be compiled and exported to OpenFst Finite State Archive (FAR) File. + More details to deployment at NeMo/tools/text_processing_deployment. + + Args: + deterministic: if True will provide a single transduction option, + for False multiple options (used for audio-based normalization) + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="verbalize", kind="verbalize", deterministic=deterministic) + cardinal = CardinalFst(deterministic=deterministic) + cardinal_graph = cardinal.fst + ordinal = OrdinalFst(deterministic=deterministic) + ordinal_graph = ordinal.fst + decimal = DecimalFst(deterministic=deterministic) + decimal_graph = decimal.fst + fraction = FractionFst(deterministic=deterministic) + fraction_graph = fraction.fst + date = DateFst(deterministic=deterministic) + date_graph = date.fst + measure = MeasureFst(cardinal=cardinal, decimal=decimal, fraction=fraction, deterministic=deterministic) + measure_graph = measure.fst + electronic = ElectronicFst(deterministic=deterministic) + electronic_graph = electronic.fst + whitelist_graph = WhiteListFst(deterministic=deterministic).fst + money_graph = MoneyFst(decimal=decimal, deterministic=deterministic).fst + telephone_graph = TelephoneFst(deterministic=deterministic).fst + time_graph = TimeFst(deterministic=deterministic).fst + + graph = ( + cardinal_graph + | measure_graph + | decimal_graph + | ordinal_graph + | date_graph + | electronic_graph + | money_graph + | fraction_graph + | whitelist_graph + | telephone_graph + | time_graph + ) + self.fst = graph diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/es/verbalizers/verbalize_final.py b/zonos3/vendor/nemo_text_processing/text_normalization/es/verbalizers/verbalize_final.py new file mode 100644 index 0000000000000000000000000000000000000000..5515c67ce11f7dd7faff932037f7990773d361df --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/es/verbalizers/verbalize_final.py @@ -0,0 +1,70 @@ +# Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import os + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import ( + GraphFst, + delete_extra_space, + delete_space, + generator_main, +) +from zonos3.vendor.nemo_text_processing.text_normalization.en.verbalizers.word import WordFst +from zonos3.vendor.nemo_text_processing.text_normalization.es.verbalizers.verbalize import VerbalizeFst +from zonos3.vendor.nemo_text_processing.utils.logging import logger + + +class VerbalizeFinalFst(GraphFst): + """ + Finite state transducer that verbalizes an entire sentence + + Args: + deterministic: if True will provide a single transduction option, + for False multiple options (used for audio-based normalization) + cache_dir: path to a dir with .far grammar file. Set to None to avoid using cache. + overwrite_cache: set to True to overwrite .far files + """ + + def __init__(self, deterministic: bool = True, cache_dir: str = None, overwrite_cache: bool = False): + super().__init__(name="verbalize_final", kind="verbalize", deterministic=deterministic) + + far_file = None + if cache_dir is not None and cache_dir != "None": + os.makedirs(cache_dir, exist_ok=True) + far_file = os.path.join(cache_dir, f"es_tn_{deterministic}_deterministic_verbalizer.far") + if not overwrite_cache and far_file and os.path.exists(far_file): + self.fst = pynini.Far(far_file, mode="r")["verbalize"] + logger.info(f'VerbalizeFinalFst graph was restored from {far_file}.') + else: + + verbalize = VerbalizeFst(deterministic=deterministic).fst + word = WordFst(deterministic=deterministic).fst + types = verbalize | word + graph = ( + pynutil.delete("tokens") + + delete_space + + pynutil.delete("{") + + delete_space + + types + + delete_space + + pynutil.delete("}") + ) + graph = delete_space + pynini.closure(graph + delete_extra_space) + graph + delete_space + + self.fst = graph.optimize() + if far_file: + generator_main(far_file, {"verbalize": self.fst}) diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/fr/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/fr/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..6ebc808fad7ac87484dbabf02dacacdd7f826c14 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/fr/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/fr/data/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/fr/data/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..6ebc808fad7ac87484dbabf02dacacdd7f826c14 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/fr/data/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/fr/data/dates/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/fr/data/dates/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..341a77c5bc66dee5d2ba0edf888f91e5bf225e3c --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/fr/data/dates/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/fr/data/dates/eras.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/fr/data/dates/eras.tsv new file mode 100644 index 0000000000000000000000000000000000000000..6127bea93f18d3233067a12d4b25580a82dba1b2 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/fr/data/dates/eras.tsv @@ -0,0 +1,8 @@ +20s twenties +30s thirties +40s forties +50s fifties +60s sixties +70s seventies +80s eighties +90s nineties \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/fr/data/dates/months.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/fr/data/dates/months.tsv new file mode 100644 index 0000000000000000000000000000000000000000..98a4e7d5d5b6d6aceee049a7a315abb1e21f88ea --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/fr/data/dates/months.tsv @@ -0,0 +1,12 @@ +1 janvier +2 février +3 mars +4 avril +5 mai +6 juin +7 juillet +8 août +9 septembre +10 octobre +11 novembre +12 décembre \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/fr/data/fractions/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/fr/data/fractions/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..6ebc808fad7ac87484dbabf02dacacdd7f826c14 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/fr/data/fractions/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/fr/data/fractions/irregular_denominators.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/fr/data/fractions/irregular_denominators.tsv new file mode 100644 index 0000000000000000000000000000000000000000..bb199174ca7990b19cf3b532b01367573e3d2a94 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/fr/data/fractions/irregular_denominators.tsv @@ -0,0 +1,7 @@ +premième tout +deuxième demi +deuxièmes demi +troisième tiers +troisièmes tiers +quatrième quart +quatrièmes quarts \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/fr/data/measures/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/fr/data/measures/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..6ebc808fad7ac87484dbabf02dacacdd7f826c14 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/fr/data/measures/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/fr/data/measures/measurements.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/fr/data/measures/measurements.tsv new file mode 100644 index 0000000000000000000000000000000000000000..55f0d46435462504b4a87f87c88c4db4c44ad3da --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/fr/data/measures/measurements.tsv @@ -0,0 +1,17 @@ +m mètres +m² mètres carrés +m³ mètres cubes +s secondes +min minutes +h heures +° degrés +°C degrés celsius +g grammes +l litres +kg kilos +'' pouce +lb livres +% pour cent +‰ pour mille +km/h kilomètres heure +m/h mètres à l’heure \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/fr/data/numbers/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/fr/data/numbers/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..6ebc808fad7ac87484dbabf02dacacdd7f826c14 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/fr/data/numbers/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/fr/data/numbers/digit.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/fr/data/numbers/digit.tsv new file mode 100644 index 0000000000000000000000000000000000000000..4f5375b2940d04557fb2964776581151491930b0 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/fr/data/numbers/digit.tsv @@ -0,0 +1,9 @@ +1 un +2 deux +3 trois +4 quatre +5 cinq +6 six +7 sept +8 huit +9 neuf \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/fr/data/numbers/eighty.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/fr/data/numbers/eighty.tsv new file mode 100644 index 0000000000000000000000000000000000000000..bdb07292f323e72e48339646bfc3271dd18c1a56 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/fr/data/numbers/eighty.tsv @@ -0,0 +1 @@ +8 quatre-vingt \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/fr/data/numbers/ninety.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/fr/data/numbers/ninety.tsv new file mode 100644 index 0000000000000000000000000000000000000000..b00412f6d033c1597ef828ef52e4faa33f2dc08e --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/fr/data/numbers/ninety.tsv @@ -0,0 +1 @@ +9 quatre-vingt \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/fr/data/numbers/quantities.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/fr/data/numbers/quantities.tsv new file mode 100644 index 0000000000000000000000000000000000000000..a17792e406a6f9feb5977fe25981542e64ddf1b4 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/fr/data/numbers/quantities.tsv @@ -0,0 +1,10 @@ +million +millions +milliard +milliards +billion +billions +billiard +billiards +trillion +trillions \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/fr/data/numbers/seventy.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/fr/data/numbers/seventy.tsv new file mode 100644 index 0000000000000000000000000000000000000000..80c4116f7c7f93687b76bf5bb47d6160a565dc75 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/fr/data/numbers/seventy.tsv @@ -0,0 +1 @@ +7 soixante \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/fr/data/numbers/teens.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/fr/data/numbers/teens.tsv new file mode 100644 index 0000000000000000000000000000000000000000..c22d6879ea19c67cde0d44352550844880f728aa --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/fr/data/numbers/teens.tsv @@ -0,0 +1,9 @@ +11 onze +12 douze +13 treize +14 quatorze +15 quinze +16 seize +17 dix-sept +18 dix-huit +19 dix-neuf \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/fr/data/numbers/ten.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/fr/data/numbers/ten.tsv new file mode 100644 index 0000000000000000000000000000000000000000..e7e79c1397e06c478ca09ec165efb337c69e06de --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/fr/data/numbers/ten.tsv @@ -0,0 +1 @@ +10 dix \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/fr/data/numbers/tens_simple.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/fr/data/numbers/tens_simple.tsv new file mode 100644 index 0000000000000000000000000000000000000000..b72cf3dd8e0a7a441148bdf4527c6e08eed4ff0a --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/fr/data/numbers/tens_simple.tsv @@ -0,0 +1,5 @@ +2 vingt +3 trente +4 quarante +5 cinquante +6 soixante \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/fr/data/numbers/zero.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/fr/data/numbers/zero.tsv new file mode 100644 index 0000000000000000000000000000000000000000..2af43a7086f918593571d14ad147de530e9b15af --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/fr/data/numbers/zero.tsv @@ -0,0 +1 @@ +0 zéro \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/fr/data/ordinals/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/fr/data/ordinals/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..6ebc808fad7ac87484dbabf02dacacdd7f826c14 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/fr/data/ordinals/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/fr/data/ordinals/irregular_numbers.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/fr/data/ordinals/irregular_numbers.tsv new file mode 100644 index 0000000000000000000000000000000000000000..2d21198f3ee1e88f8a50bca59705c537b3c02138 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/fr/data/ordinals/irregular_numbers.tsv @@ -0,0 +1,30 @@ +quatre quatrième +cinq cinquième +neuf neuvième +onze onzième +douze douzième +treize treizième +quatorze quatorzième +quinze quinzième +seize seizième +dix-neuf dix neuvième +trente trentième +quarante quarantième +cinquante cinquantième +soixante soixantième +soixante-onze soixante onzième +soixante-douze soixante douzième +soixante-treize soixante treizième +soixante-quatorze soixante quatorzième +soixante-quinze soixante quinzième +soixante-seize soixante seizième +soixante-dix-neuf soixante dix neuvième +quatre-vingt-onze quatre vingt onzième +quatre-vingt-douze quatre vingt douzième +quatre-vingt-treize quatre vingt treizième +quatre-vingt-quatorze quatre vingt quatorzième +quatre-vingt-quinze quatre vingt quinzième +quatre-vingt-seize quatre vingt seizième +quatre-vingt-dix-neuf quatre vingt dix neuvième +cents centième +mille millième \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/fr/data/ordinals/suffixes.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/fr/data/ordinals/suffixes.tsv new file mode 100644 index 0000000000000000000000000000000000000000..73adb8e043daca73a33a791255f8f64063806ace --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/fr/data/ordinals/suffixes.tsv @@ -0,0 +1,6 @@ +e ième +ème ième +° ième +er ier +ère ière +es ièmes \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/fr/data/whitelist.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/fr/data/whitelist.tsv new file mode 100644 index 0000000000000000000000000000000000000000..dc563bdab6a3b86a2a41bc9e24be837a15df13d7 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/fr/data/whitelist.tsv @@ -0,0 +1,13 @@ +Mᵐᵉ madame +Mᵐᵉˢ mesdames +Mˡˡᵉ mademoiselle +Mˡˡᵉˢ mademoiselles +Dʳ docteur +Dʳˢ docteurs +Dʳᵉ docteure +Dʳᵉˢ docteures +apr. J.-C. après jésus-christ +av. J.-C. avant Jésus-Christ +le hon. l’honorable +le très hon. le très hononrable +% pour cent \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/fr/taggers/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/fr/taggers/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..6ebc808fad7ac87484dbabf02dacacdd7f826c14 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/fr/taggers/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/fr/taggers/cardinal.py b/zonos3/vendor/nemo_text_processing/text_normalization/fr/taggers/cardinal.py new file mode 100644 index 0000000000000000000000000000000000000000..a1ba0d55cd188f6fe56968f03b424c92a285a4dd --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/fr/taggers/cardinal.py @@ -0,0 +1,143 @@ +# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import NEMO_DIGIT, NEMO_SIGMA, GraphFst, insert_space +from zonos3.vendor.nemo_text_processing.text_normalization.fr.utils import get_abs_path + + +class CardinalFst(GraphFst): + """ + Finite state transducer for classifying cardinals, e.g. + "1000" -> cardinal { integer: "mille" } + "2,000,000" -> cardinal { integer: "deux millions" } + This grammar covers from single digits to hundreds of billions ("milliards" in French). + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="cardinal", kind="classify", deterministic=deterministic) + + # Single digits + zero = pynini.string_file(get_abs_path("data/numbers/zero.tsv")) + digits = pynini.string_file(get_abs_path("data/numbers/digit.tsv")) # 1 to 9 + digits_no_one = (NEMO_DIGIT - "1") @ digits + one = "1" @ digits + + # Double digits + ten = pynini.string_file(get_abs_path("data/numbers/ten.tsv")) + teens = pynini.string_file(get_abs_path("data/numbers/teens.tsv")) # 11 to 19 + teens_no_one = (pynini.accep("1") + (NEMO_DIGIT - "1")) @ teens + + # Simple tens + tens = pynini.string_file(get_abs_path("data/numbers/tens_simple.tsv")) + ties_simple_unit = pynutil.insert("-") + digits_no_one + ties_simple_one = insert_space + pynini.cross("1", "et un") + ties_simple = tens + (pynutil.delete("0") | (ties_simple_unit | ties_simple_one)) # 20 to 69 + + # Complex tens + seventy = pynini.string_file(get_abs_path("data/numbers/seventy.tsv")) + seventy_unit = pynutil.insert("-") + ((pynutil.insert("1") + NEMO_DIGIT) @ teens_no_one) + seventy_one = insert_space + pynini.cross("1", "et onze") + seventies = seventy + (pynini.cross("0", "-dix") | (seventy_unit | seventy_one)) # 70 to 79 + + eighty = pynini.string_file(get_abs_path("data/numbers/eighty.tsv")) + eighties = eighty + (pynini.cross("0", "s") | (pynutil.insert("-") + digits)) # 80 to 89 + + ninety = pynini.string_file(get_abs_path("data/numbers/ninety.tsv")) + nineties_unit = pynutil.insert("-") + ((pynutil.insert("1") + NEMO_DIGIT) @ teens) + nineties = ninety + (pynini.cross("0", "-dix") | nineties_unit) # 90 to 99 + + all_double_digits = ten | teens | ties_simple | seventies | eighties | nineties + self.all_double_digits = all_double_digits + + one_to_all_tens = digits | all_double_digits + self.one_to_all_tens = one_to_all_tens.optimize() + + # Hundreds + hundreds_parts = (pynutil.delete("0") + insert_space + digits) | (insert_space + all_double_digits) + one_hundreds = pynini.cross("1", "cent") + (pynutil.delete("00") | hundreds_parts) + multiple_hundreds = (digits_no_one + insert_space + pynutil.insert("cent")) + ( + pynini.cross("00", "s") | hundreds_parts + ) + all_hundreds = one_hundreds | multiple_hundreds + self.all_hundreds = all_hundreds + + # Thousands + delete_separator = pynini.closure(pynutil.delete(" "), 0, 1) + one_thousand = pynini.cross("1", "mille") + delete_separator + other_thousands = ( + (digits_no_one | all_double_digits | all_hundreds) + + insert_space + + pynutil.insert("mille") + + delete_separator + ) + all_thousands = ( + ((one_thousand | other_thousands) + pynutil.delete("000")) + | (one_thousand + pynutil.delete("00") + insert_space + (pynini.cross("1", "et un") | digits_no_one)) + | (other_thousands + pynutil.delete("00") + insert_space + digits) + | ((one_thousand | other_thousands) + pynutil.delete("0") + insert_space + all_double_digits) + | ((one_thousand | other_thousands) + insert_space + all_hundreds) + ) + + # Millions + digits_to_hundreds_no_one = digits_no_one | all_double_digits | all_hundreds + digits_to_thousands_no_one = digits_no_one | all_double_digits | all_hundreds | all_thousands + millions_components = pynini.closure(delete_separator + pynini.closure(NEMO_DIGIT, 3), 2) + delete_zeros = pynini.closure(pynutil.delete("0"), 0, 6) + all_millions = ( + one + insert_space + pynutil.insert("million") + | (digits_to_hundreds_no_one + insert_space + pynutil.insert("millions")) + ) + ( + millions_components + @ ( + delete_zeros + + pynini.closure(insert_space + (digits_to_thousands_no_one | pynini.cross("1", "et un")), 0, 1) + ) + ) + + # Billions + digits_to_millions_no_one = digits_to_thousands_no_one | all_millions + billions_components = pynini.closure(delete_separator + pynini.closure(NEMO_DIGIT, 3), 3) + delete_zeros = pynini.closure(pynutil.delete("0"), 0, 9) + all_billions = ( + one + insert_space + pynutil.insert("milliard") + | (digits_to_hundreds_no_one + insert_space + pynutil.insert("milliards")) + ) + ( + billions_components + @ ( + delete_zeros + + pynini.closure(insert_space + (digits_to_millions_no_one | pynini.cross("1", "et un")), 0, 1) + ) + ) + + # All Numbers Union + final_graph_masc = zero | one_to_all_tens | all_hundreds | all_thousands | all_millions | all_billions + + # Adding adjustment for fem gender (choice of gender will be random) + final_graph_fem = final_graph_masc | ( + final_graph_masc @ (pynini.closure(NEMO_SIGMA) + pynini.cross("un", "une")) + ) + final_graph = final_graph_fem | final_graph_masc + + self.all_nums_no_tokens = final_graph + + optional_minus_graph = pynini.closure(pynutil.insert("negative: ") + pynini.cross("-", "\"true\" "), 0, 1) + + final_graph = optional_minus_graph + pynutil.insert("integer: \"") + final_graph + pynutil.insert("\"") + + final_graph = self.add_tokens(final_graph) + self.fst = final_graph.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/fr/taggers/date.py b/zonos3/vendor/nemo_text_processing/text_normalization/fr/taggers/date.py new file mode 100644 index 0000000000000000000000000000000000000000..bee6249d65a84e04b2848f8624652c9db2629774 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/fr/taggers/date.py @@ -0,0 +1,97 @@ +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import NEMO_DIGIT, GraphFst +from zonos3.vendor.nemo_text_processing.text_normalization.fr.utils import get_abs_path + +# TODO: add articles? 'le...' + +month_numbers = pynini.string_file(get_abs_path("data/dates/months.tsv")) +eras = pynini.string_file(get_abs_path("data/dates/eras.tsv")) +delete_leading_zero = ( + pynutil.delete("0") | (NEMO_DIGIT - "0") +) + NEMO_DIGIT # reminder, NEMO_DIGIT = filter on digits + + +class DateFst(GraphFst): + '''Finite state transducer for classyfing dates, e.g.: + '02.03.2003' -> date {day: 'deux' month: 'mai' year: 'deux mille trois' preserve order: true} + ''' + + def __init__(self, cardinal: GraphFst, deterministic: bool = True): + super().__init__(name="dates", kind="classify") + + cardinal_graph = cardinal.all_nums_no_tokens + + # 'le' -> 'le', 'les' -> 'les' + le_determiner = pynini.accep("le ") | pynini.accep("les ") + self.optional_le = pynini.closure(le_determiner, 0, 1) + + # '01' -> 'un' + optional_leading_zero = delete_leading_zero | NEMO_DIGIT + valid_day_number = pynini.union(*[str(x) for x in range(1, 32)]) + premier = pynini.string_map([("1", "premier")]) + day_number_to_word = premier | cardinal_graph + + digit_to_day = self.optional_le + optional_leading_zero @ valid_day_number @ day_number_to_word + self.day_graph = pynutil.insert("day: \"") + digit_to_day + pynutil.insert("\"") + + # '03' -> 'mars' + normalize_month_number = optional_leading_zero @ pynini.union(*[str(x) for x in range(1, 13)]) + number_to_month = month_numbers.optimize() + month_graph = normalize_month_number @ number_to_month + self.month_graph = pynutil.insert("month: \"") + month_graph + pynutil.insert("\"") + + # 2025 -> deux mille vingt cinq + accept_year_digits = (NEMO_DIGIT - "0") + pynini.closure(NEMO_DIGIT, 1, 3) + digits_to_year = accept_year_digits @ cardinal_graph + self.year_graph = pynutil.insert("year: \"") + digits_to_year + pynutil.insert("\"") + + # Putting it all together + self.fst = pynini.accep("") + + for separator in ["/", ".", "-"]: + self.fst |= ( + pynutil.insert("date { ") + + self.day_graph + + pynutil.delete(separator) + + pynutil.insert(" ") + + self.month_graph + + pynini.closure(pynutil.delete(separator) + pynutil.insert(" ") + self.year_graph, 0, 1) + + pynutil.insert(" preserve_order: true }") + ) + + # Accepts "janvier", "février", etc + month_name_graph = pynutil.insert("month: \"") + month_numbers.project("output") + pynutil.insert("\"") + + self.fst |= ( + pynutil.insert("date { ") + + self.day_graph + + pynini.accep(" ") + + month_name_graph + + pynini.closure(pynini.accep(" ") + self.year_graph, 0, 1) + + pynutil.insert(" preserve_order: true}") + ) + + # Accepts "70s", "80s", etc + self.fst |= pynutil.insert("date { year: \"") + eras + pynutil.insert("\" preserve_order: true }") + + # Accepts date ranges, "17-18-19 juin" -> date { day: "17" day: "18": day: "19"} + for separator in ["-", "/"]: + day_range_graph = ( + pynutil.insert("day: \"") + + pynini.closure(digit_to_day + pynutil.delete(separator) + pynutil.insert(" "), 1) + + digit_to_day + + pynutil.insert("\"") + ) + + self.fst |= ( + pynutil.insert("date { ") + + day_range_graph + + pynini.accep(" ") + + month_name_graph + + pynini.closure(pynini.accep(" ") + self.year_graph, 0, 1) + + pynutil.insert(" preserve_order: true }") + ) + + self.fst = self.fst.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/fr/taggers/decimals.py b/zonos3/vendor/nemo_text_processing/text_normalization/fr/taggers/decimals.py new file mode 100644 index 0000000000000000000000000000000000000000..cdec2a41b89eba6118d7f5099af2b28fccc59651 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/fr/taggers/decimals.py @@ -0,0 +1,116 @@ +# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import ( + NEMO_DIGIT, + NEMO_SIGMA, + NEMO_SPACE, + GraphFst, + insert_space, +) +from zonos3.vendor.nemo_text_processing.text_normalization.fr.utils import get_abs_path + +quantities = pynini.string_file(get_abs_path("data/numbers/quantities.tsv")) +digit = pynini.string_file(get_abs_path("data/numbers/digit.tsv")) +zero = pynini.string_file(get_abs_path("data/numbers/zero.tsv")) + + +def get_quantity(decimal_graph: "pynini.FstLike", cardinal_graph: "pynini.FstLike") -> "pynini.FstLike": + """ + Returns FST that transforms either a cardinal or decimal followed by a quantity into a numeral, + e.g. 2 millions -> integer_part: "deux" quantity: "millions" + e.g. 2,4 millions -> integer_part: "deux" fractional_part: "quatre" quantity: "millions" + Args: + decimal_graph: DecimalFST + cardinal_graph: CardinalFST + """ + delete_separator = pynini.closure(pynutil.delete(" "), 0, 1) + numbers = pynini.closure(NEMO_DIGIT, 1, 6) @ cardinal_graph + numbers = pynini.cdrewrite(pynutil.delete(delete_separator), "", "", NEMO_SIGMA) @ numbers + + res = ( + pynutil.insert('integer_part: "') + + numbers + + pynutil.insert('"') + + NEMO_SPACE + + pynutil.insert('quantity: "') + + quantities + + pynutil.insert('"') + ) + res |= decimal_graph + NEMO_SPACE + pynutil.insert('quantity: "') + quantities + pynutil.insert('"') + return res + + +class DecimalFst(GraphFst): + """ + Finite state transducer for classifying decimal, e.g. + -11,406 millions -> decimal { negative: "true" integer_part: "onze" fractional_part: "quatre cent six" quantity: "millions" preserve_order: true } + 114 billions -> decimal { integer_part: "cent quatorze" quantity: "billions" preserve_order: true } + Args: + cardinal: CardinalFst + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, cardinal: GraphFst, deterministic: bool = True): + super().__init__(name="decimal", kind="classify", deterministic=deterministic) + + graph_digit = digit | zero + + if not deterministic: + graph = pynini.union(graph_digit, cardinal.all_hundreds, cardinal.one_to_all_tens) + graph += pynini.closure(insert_space + graph) + + else: + # General pattern is 1-3 digits: map as cardinal, default to tens followed by digits otherwise \ + graph = pynini.union( + pynutil.add_weight(graph_digit + pynini.closure(insert_space + zero), -0.00001), + pynutil.add_weight(cardinal.all_double_digits + pynini.closure(insert_space + zero), -0.00002), + pynutil.add_weight(cardinal.all_hundreds + pynini.closure(insert_space + zero), 0.00001), + pynutil.add_weight( + cardinal.all_double_digits + + pynini.closure(insert_space + cardinal.all_double_digits, 1) + + pynini.closure(insert_space + zero, 0, 1) + + (pynini.closure(insert_space + graph_digit, 0, 1) | pynini.closure(insert_space + zero, 0)), + -0.00002, + ), # Read out as tens and a possible trailing digit or zeroes + zero + + pynini.closure(insert_space + zero) + + pynini.closure(insert_space + graph_digit), # For cases such as "1,001" + ) + + graph = graph.optimize() + + delete_separator = pynutil.delete(",") + optional_graph_negative = pynini.closure(pynutil.insert("negative: ") + pynini.cross("-", '"true" '), 0, 1) + + graph_fractional = pynutil.insert('fractional_part: "') + graph + pynutil.insert('"') + + integers = cardinal.all_nums_no_tokens + graph_integer = pynutil.insert('integer_part: "') + integers + pynutil.insert('"') + final_graph_wo_sign = graph_integer + delete_separator + insert_space + graph_fractional + + final_graph_wo_negative = final_graph_wo_sign | get_quantity(final_graph_wo_sign, integers).optimize() + self.final_graph_wo_negative = final_graph_wo_negative + + final_graph = optional_graph_negative + final_graph_wo_negative + self.final_graph = final_graph + + final_graph += pynutil.insert(" preserve_order: true") + final_graph = self.add_tokens(final_graph) + self.fst = final_graph.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/fr/taggers/fraction.py b/zonos3/vendor/nemo_text_processing/text_normalization/fr/taggers/fraction.py new file mode 100644 index 0000000000000000000000000000000000000000..47c391bf3519840e059236d2a42a567e599bf3e3 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/fr/taggers/fraction.py @@ -0,0 +1,70 @@ +# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import NEMO_DIGIT, NEMO_SIGMA, GraphFst + + +class FractionFst(GraphFst): + """ + Finite state transducer for classifying fraction + "-4 1/3" -> + tokens { fraction { negative: "true" integer_part: "quatre" numerator: "un" denominator: "trois" morphosyntactic_features: "ième" } } + Args: + cardinal: CardinalFst + ordinal: OrdinalFst + deterministic: if True will provide a single transduction option, + for False multiple transduction will be generated (used for audio-based normalization) - TBD + """ + + def __init__(self, cardinal: GraphFst, ordinal: GraphFst, deterministic: bool = True): + super().__init__(name="fraction", kind="classify", deterministic=deterministic) + + cardinals = cardinal.all_nums_no_tokens + sing_numerator = pynini.accep("1") @ cardinals + pl_numerators = (pynini.closure(NEMO_DIGIT) - "1") @ cardinals + + add_denom_suffix = pynini.closure(NEMO_DIGIT) + pynutil.insert("e") + denominators = add_denom_suffix @ ordinal.graph + change_denom_label = pynini.cross("integer", "denominator") + pluralize_denom = pynini.closure(NEMO_SIGMA) + pynini.cross("\"ième\"", "\"ièmes\"") + + sing_fraction_graph = ( + pynutil.insert("numerator: \"") + + sing_numerator + + pynutil.insert("\" ") + + pynutil.delete("/") + + (denominators @ (change_denom_label + pynini.closure(NEMO_SIGMA))) + ) + + pl_fraction_graph = ( + pynutil.insert("numerator: \"") + + pl_numerators + + pynutil.insert("\" ") + + pynutil.delete("/") + + (denominators @ (change_denom_label + pluralize_denom)) + ) + + integer_part = pynutil.insert("integer_part: \"") + cardinals + pynutil.insert("\"") + optional_integer_part = pynini.closure(integer_part + pynini.accep(" "), 0, 1) + + optional_minus_graph = pynini.closure(pynutil.insert("negative: ") + pynini.cross("-", "\"true\" "), 0, 1) + + final_graph = optional_minus_graph + optional_integer_part + (sing_fraction_graph | pl_fraction_graph) + + final_graph = self.add_tokens(final_graph) + self.fst = final_graph.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/fr/taggers/ordinal.py b/zonos3/vendor/nemo_text_processing/text_normalization/fr/taggers/ordinal.py new file mode 100644 index 0000000000000000000000000000000000000000..713c96732f6c9314ab991e8f15f973bf852fb984 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/fr/taggers/ordinal.py @@ -0,0 +1,48 @@ +# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import NEMO_SPACE, GraphFst +from zonos3.vendor.nemo_text_processing.text_normalization.fr.utils import get_abs_path + + +class OrdinalFst(GraphFst): + """ + Finite state transducer for classifying ordinal + "2e" -> ordinal { integer: "deux" morphosyntactic_features: "ième" } + This grammar covers from single digits to hundreds of billions ("milliardième" in French). + This FST also records the ending of the ordinal (called "morphosyntactic_features"). + Args: + cardinal: CardinalFst + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, cardinal: GraphFst, deterministic: bool = True): + super().__init__(name="ordinal", kind="classify") + + numbers = cardinal.all_nums_no_tokens + numbers_graph = pynutil.insert("integer: \"") + numbers + pynutil.insert("\"") + + suffixes = pynini.string_file(get_abs_path("data/ordinals/suffixes.tsv")) + suffixes_graph = pynutil.insert("morphosyntactic_features: \"") + suffixes + pynutil.insert("\"") + + final_graph = numbers_graph + pynutil.insert(NEMO_SPACE) + suffixes_graph + self.graph = final_graph + + final_graph = self.add_tokens(final_graph) + self.fst = final_graph.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/fr/taggers/tokenize_and_classify.py b/zonos3/vendor/nemo_text_processing/text_normalization/fr/taggers/tokenize_and_classify.py new file mode 100644 index 0000000000000000000000000000000000000000..541ee6b43b2aedbf577838818ab1b3e3d113eebf --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/fr/taggers/tokenize_and_classify.py @@ -0,0 +1,126 @@ +# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import os + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import ( + NEMO_WHITE_SPACE, + GraphFst, + delete_extra_space, + delete_space, + generator_main, +) +from zonos3.vendor.nemo_text_processing.text_normalization.en.taggers.punctuation import PunctuationFst +from zonos3.vendor.nemo_text_processing.text_normalization.fr.taggers.cardinal import CardinalFst +from zonos3.vendor.nemo_text_processing.text_normalization.fr.taggers.date import DateFst +from zonos3.vendor.nemo_text_processing.text_normalization.fr.taggers.decimals import DecimalFst +from zonos3.vendor.nemo_text_processing.text_normalization.fr.taggers.fraction import FractionFst +from zonos3.vendor.nemo_text_processing.text_normalization.fr.taggers.ordinal import OrdinalFst +from zonos3.vendor.nemo_text_processing.text_normalization.fr.taggers.whitelist import WhiteListFst +from zonos3.vendor.nemo_text_processing.text_normalization.fr.taggers.word import WordFst +from zonos3.vendor.nemo_text_processing.utils.logging import logger + + +class ClassifyFst(GraphFst): + """ + Final class that composes all other classification grammars. This class can process an entire sentence, that is lower cased. + For deployment, this grammar will be compiled and exported to OpenFst Finate State aRchive (FAR) File. + More details to deployment at NeMo-text-processing/tools/text_processing_deployment. + Args: + input_case: accepting either "lower_cased" or "cased" input. + deterministic: if True will provide a single transduction option, + for False multiple options (used for audio-based normalization) + cache_dir: path to a dir with .far grammar file. Set to None to avoid using cache. + overwrite_cache: set to True to overwrite .far files + whitelist: path to a file with whitelist replacements + """ + + def __init__( + self, + input_case: str, + deterministic: bool = False, + cache_dir: str = None, + overwrite_cache: bool = False, + whitelist: str = None, + ): + super().__init__(name="tokenize_and_classify", kind="classify", deterministic=deterministic) + far_file = None + if cache_dir is not None and cache_dir != "None": + os.makedirs(cache_dir, exist_ok=True) + whitelist_file = os.path.basename(whitelist) if whitelist else "" + far_file = os.path.join( + cache_dir, + f"_{input_case}_fr_tn_{deterministic}_deterministic{whitelist_file}.far", + ) + if not overwrite_cache and far_file and os.path.exists(far_file): + self.fst = pynini.Far(far_file, mode="r")["tokenize_and_classify"] + logger.info(f"ClassifyFst.fst was restored from {far_file}.") + else: + logger.info(f"Creating ClassifyFst grammars. This might take some time...") + + self.cardinal = CardinalFst(deterministic=deterministic) + cardinal_graph = self.cardinal.fst + + self.ordinal = OrdinalFst(cardinal=self.cardinal, deterministic=deterministic) + ordinal_graph = self.ordinal.fst + + self.decimal = DecimalFst(cardinal=self.cardinal, deterministic=deterministic) + decimal_graph = self.decimal.fst + + self.fraction = FractionFst( + cardinal=self.cardinal, + ordinal=self.ordinal, + deterministic=deterministic, + ) + fraction_graph = self.fraction.fst + word_graph = WordFst(deterministic=deterministic).fst + self.whitelist = WhiteListFst(input_case=input_case, deterministic=deterministic, input_file=whitelist) + whitelist_graph = self.whitelist.fst + punct_graph = PunctuationFst(deterministic=deterministic).fst + + self.date = DateFst(self.cardinal, deterministic=deterministic) + date_graph = self.date.fst + + classify = ( + pynutil.add_weight(whitelist_graph, 1.01) + | pynutil.add_weight(date_graph, 1.1) + | pynutil.add_weight(cardinal_graph, 1.1) + | pynutil.add_weight(fraction_graph, 1.09) + | pynutil.add_weight(ordinal_graph, 1.1) + | pynutil.add_weight(decimal_graph, 1.1) + | pynutil.add_weight(word_graph, 200) + ) + punct = pynutil.insert("tokens { ") + pynutil.add_weight(punct_graph, weight=2.1) + pynutil.insert(" }") + punct = pynini.closure( + pynini.compose(pynini.closure(NEMO_WHITE_SPACE, 1), delete_extra_space) + | (pynutil.insert(" ") + punct), + 1, + ) + token = pynutil.insert("tokens { ") + classify + pynutil.insert(" }") + token_plus_punct = ( + pynini.closure(punct + pynutil.insert(" ")) + token + pynini.closure(pynutil.insert(" ") + punct) + ) + + graph = token_plus_punct + pynini.closure((delete_extra_space).ques + token_plus_punct) + graph = delete_space + graph + delete_space + graph |= punct + + self.fst = graph.optimize() + + if far_file: + generator_main(far_file, {"tokenize_and_classify": self.fst}) + logger.info(f"ClassifyFst grammars are saved to {far_file}.") diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/fr/taggers/whitelist.py b/zonos3/vendor/nemo_text_processing/text_normalization/fr/taggers/whitelist.py new file mode 100644 index 0000000000000000000000000000000000000000..2c80e5c06be4ed592f8c68a44b2f885423e8570d --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/fr/taggers/whitelist.py @@ -0,0 +1,63 @@ +# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import GraphFst, convert_space +from zonos3.vendor.nemo_text_processing.text_normalization.fr.utils import get_abs_path, load_labels + + +class WhiteListFst(GraphFst): + """ + Finite state transducer for classifying whitelist, e.g. + "sr." -> tokens { name: "bonjour" } + This class has highest priority among all classifier grammars. Whitelisted tokens are defined and loaded from "data/whitelist.tsv". + Args: + input_case: accepting either "lower_cased" or "cased" input. + deterministic: if True will provide a single transduction option, + for False multiple options (used for audio-based normalization) + input_file: path to a file with whitelist replacements + """ + + def __init__(self, input_case: str, deterministic: bool = True, input_file: str = None): + super().__init__(name="whitelist", kind="classify", deterministic=deterministic) + + def _get_whitelist_graph(input_case, file): + whitelist = load_labels(file) + if input_case == "lower_cased": + whitelist = [[x[0].lower()] + x[1:] for x in whitelist] + graph = pynini.string_map(whitelist) + return graph + + graph = _get_whitelist_graph(input_case, get_abs_path("data/whitelist.tsv")) + if not deterministic and input_case != "lower_cased": + graph |= pynutil.add_weight( + _get_whitelist_graph("lower_cased", get_abs_path("data/whitelist.tsv")), weight=0.0001 + ) + + if input_file: + whitelist_provided = _get_whitelist_graph(input_case, input_file) + if not deterministic: + graph |= whitelist_provided + else: + graph = whitelist_provided + + if not deterministic: + units_graph = _get_whitelist_graph(input_case, file=get_abs_path("data/measures/measurements.tsv")) + graph |= units_graph + + self.graph = graph + self.final_graph = convert_space(self.graph).optimize() + self.fst = (pynutil.insert("name: \"") + self.final_graph + pynutil.insert("\"")).optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/fr/taggers/word.py b/zonos3/vendor/nemo_text_processing/text_normalization/fr/taggers/word.py new file mode 100644 index 0000000000000000000000000000000000000000..67e162dbec7f3e0df3ec49c5b9dff94259513b7c --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/fr/taggers/word.py @@ -0,0 +1,33 @@ +# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import NEMO_NOT_SPACE, GraphFst + + +class WordFst(GraphFst): + """ + Finite state transducer for classifying word. + e.g. bonjour -> tokens { name: "bonjour" } + Args: + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="word", kind="classify") + word = pynutil.insert("name: \"") + pynini.closure(NEMO_NOT_SPACE, 1) + pynutil.insert("\"") + self.fst = word.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/fr/utils.py b/zonos3/vendor/nemo_text_processing/text_normalization/fr/utils.py new file mode 100644 index 0000000000000000000000000000000000000000..7523e576221aa4246c3579a56c8f3094b846f7d7 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/fr/utils.py @@ -0,0 +1,43 @@ +# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import csv +import os + + +def get_abs_path(rel_path): + """ + Get absolute path + + Args: + rel_path: relative path to this file + + Returns absolute path + """ + return os.path.dirname(os.path.abspath(__file__)) + '/' + rel_path + + +def load_labels(abs_path): + """ + loads relative path file as dictionary + + Args: + abs_path: absolute path + + Returns dictionary of mappings + """ + label_tsv = open(abs_path) + labels = list(csv.reader(label_tsv, delimiter="\t")) + label_tsv.close() + return labels diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/fr/verbalizers/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/fr/verbalizers/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..a1cf281f0908d225f51d921e9ddbdf92f9b14d99 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/fr/verbalizers/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/fr/verbalizers/cardinal.py b/zonos3/vendor/nemo_text_processing/text_normalization/fr/verbalizers/cardinal.py new file mode 100644 index 0000000000000000000000000000000000000000..ca85b56ebf55b4a3101f0c83bd7d41e610535f1d --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/fr/verbalizers/cardinal.py @@ -0,0 +1,36 @@ +# Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import NEMO_NOT_QUOTE, GraphFst, insert_space + + +class CardinalFst(GraphFst): + """ + Finite state transducer for verbalizing cardinals + e.g. cardinal { negative: "true" integer: "un milliard et un" } -> "moins un milliard et un" + Args: + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="cardinal", kind="verbalize", deterministic=deterministic) + + optional_sign = pynini.closure(pynini.cross("negative: \"true\" ", "moins") + insert_space, 0, 1) + number = pynutil.delete("integer: \"") + pynini.closure(NEMO_NOT_QUOTE, 1) + pynutil.delete("\"") + final_graph = optional_sign + number + + self.fst = self.delete_tokens(final_graph).optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/fr/verbalizers/date.py b/zonos3/vendor/nemo_text_processing/text_normalization/fr/verbalizers/date.py new file mode 100644 index 0000000000000000000000000000000000000000..a6bf4b27771cdd3de0297a8675bfccbc72f13055 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/fr/verbalizers/date.py @@ -0,0 +1,51 @@ +# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import ( + NEMO_NOT_QUOTE, + NEMO_SPACE, + GraphFst, + delete_preserve_order, +) + + +class DateFst(GraphFst): + """ + Finite state transducer for verbalizing date, e.g. + date {day: "deux" month: "mars" year: "deux mille trois" preserve_order: true} -> deux mars deux mille trois + Args: + ordinal: OrdinalFst + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="date", kind="verbalize", deterministic=deterministic) + + day = pynutil.delete("day: \"") + pynini.closure(NEMO_NOT_QUOTE, 1) + pynutil.delete("\"") + month = pynutil.delete("month: \"") + pynini.closure(NEMO_NOT_QUOTE, 1) + pynutil.delete("\"") + year = pynutil.delete("year: \"") + pynini.closure(NEMO_NOT_QUOTE, 1) + pynutil.delete("\"") + decade = pynutil.delete("year: \"") + pynini.closure(NEMO_NOT_QUOTE, 1) + pynutil.delete("\"") + + graph_dmy = day + NEMO_SPACE + month + pynini.closure(NEMO_SPACE + year, 0, 1) + delete_preserve_order + graph_my = month + NEMO_SPACE + year + delete_preserve_order + graph_decade = decade + delete_preserve_order + + self.graph = graph_dmy | graph_my | graph_decade + + delete_tokens = self.delete_tokens(self.graph) + self.fst = delete_tokens.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/fr/verbalizers/decimals.py b/zonos3/vendor/nemo_text_processing/text_normalization/fr/verbalizers/decimals.py new file mode 100644 index 0000000000000000000000000000000000000000..3c63101352af538dd62a47ce8ef0addb291c6a3f --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/fr/verbalizers/decimals.py @@ -0,0 +1,68 @@ +# Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import ( + NEMO_NOT_QUOTE, + GraphFst, + delete_preserve_order, + delete_space, + insert_space, +) + + +class DecimalFst(GraphFst): + """ + Finite state transducer for classifying decimal, e.g. + decimal { negative: "true" integer_part: "onze" fractional_part: "quatre cent six" quantity: "millions" preserve_order: true } -> moins onze virgule quatre cent six millions + decimal { integer_part: "cent quatorze" quantity: "billions" preserve_order: true } -> cent quatorze billions + Args: + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="decimal", kind="classify", deterministic=deterministic) + + optional_sign = pynini.closure(pynini.cross("negative: \"true\"", "moins ") + delete_space, 0, 1) + integer = pynutil.delete("integer_part: \"") + pynini.closure(NEMO_NOT_QUOTE, 1) + pynutil.delete("\"") + fractional_default = ( + pynutil.delete("fractional_part: \"") + pynini.closure(NEMO_NOT_QUOTE, 1) + pynutil.delete("\"") + ) + + conjunction = pynutil.insert(" virgule ") + fractional = conjunction + fractional_default + + quantity = ( + delete_space + + insert_space + + pynutil.delete("quantity: \"") + + pynini.closure(NEMO_NOT_QUOTE, 1) + + pynutil.delete("\"") + ) + optional_quantity = pynini.closure(quantity, 0, 1) + + graph = optional_sign + pynini.union( + (integer + quantity), (integer + delete_space + fractional + optional_quantity) + ) + + self.numbers_only_quantity = ( + optional_sign + + pynini.union((integer + quantity), (integer + delete_space + fractional + quantity)).optimize() + ) + + graph += delete_preserve_order + delete_tokens = self.delete_tokens(graph) + self.fst = delete_tokens.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/fr/verbalizers/fraction.py b/zonos3/vendor/nemo_text_processing/text_normalization/fr/verbalizers/fraction.py new file mode 100644 index 0000000000000000000000000000000000000000..14d236cefc77099b5071f5fa95315a0a538af43e --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/fr/verbalizers/fraction.py @@ -0,0 +1,58 @@ +# Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import ( + NEMO_NOT_QUOTE, + NEMO_SIGMA, + NEMO_SPACE, + GraphFst, + insert_space, +) +from zonos3.vendor.nemo_text_processing.text_normalization.fr.utils import get_abs_path + + +class FractionFst(GraphFst): + """ + Finite state transducer for verbalizing fraction + e.g. tokens { fraction { integer: "treinta y tres" numerator: "cuatro" denominator: "quinto" } } -> + treinta y tres y cuatro quintos + Args: + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, ordinal: GraphFst, deterministic: bool = True): + super().__init__(name="fraction", kind="verbalize", deterministic=deterministic) + + numerator = pynutil.delete("numerator: \"") + pynini.closure(NEMO_NOT_QUOTE) + pynutil.delete("\"") + + denominator = ordinal.graph + irregular_denominators = pynini.string_file(get_abs_path("data/fractions/irregular_denominators.tsv")) + denominator = pynini.union(pynutil.add_weight(denominator @ irregular_denominators, -0.01), denominator) + denominator = (pynini.cross("denominator:", "integer:") + pynini.closure(NEMO_SIGMA)) @ denominator + + irregular_half = pynini.closure(NEMO_SIGMA) + pynini.cross("et un demi", "et demi") + + optional_integer = pynutil.delete("integer_part: \"") + pynini.closure(NEMO_NOT_QUOTE) + pynutil.delete("\"") + optional_integer = pynini.closure( + optional_integer + pynini.accep(NEMO_SPACE) + pynutil.insert("et") + insert_space, 0, 1 + ) + + optional_sign = pynini.closure(pynini.cross("negative: \"true\" ", "moins") + insert_space, 0, 1) + + final_graph = optional_sign + optional_integer + numerator + pynini.accep(NEMO_SPACE) + denominator + final_graph = pynini.union(pynutil.add_weight(final_graph @ irregular_half, -0.01), final_graph) + self.fst = self.delete_tokens(final_graph).optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/fr/verbalizers/ordinal.py b/zonos3/vendor/nemo_text_processing/text_normalization/fr/verbalizers/ordinal.py new file mode 100644 index 0000000000000000000000000000000000000000..1e970fc279969e1b86927009abf821844410eeee --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/fr/verbalizers/ordinal.py @@ -0,0 +1,69 @@ +# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import NEMO_ALPHA, NEMO_NOT_QUOTE, NEMO_SPACE, GraphFst +from zonos3.vendor.nemo_text_processing.text_normalization.fr.utils import get_abs_path + + +class OrdinalFst(GraphFst): + """ + Finite state transducer for verbalizing ordinals + e.g. ordinal { integer: "deux" morphosyntactic_features: "ième" } -> "deuxième" + Args: + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, deterministic: bool = True, strip_dashes: bool = False): + super().__init__(name="ordinal", kind="verbalize", deterministic=deterministic) + + ones = pynini.cross("un", "prem") + + irregular_numbers = pynini.string_file(get_abs_path("data/ordinals/irregular_numbers.tsv")) + irregular_numbers = pynini.closure(pynini.closure(NEMO_NOT_QUOTE, 1) + NEMO_SPACE) + irregular_numbers + exceptions = pynini.project(irregular_numbers, "input") + exception_suffix = ( + pynutil.delete(" morphosyntactic_features: \"ième") + + pynini.closure(pynini.accep("s"), 0, 1) + + pynutil.delete("\"") + ) + irregular_numbers_graph = ( + pynutil.delete("integer: \"") + irregular_numbers + pynutil.delete("\"") + exception_suffix + ) + + numbers = pynini.closure(NEMO_NOT_QUOTE, 1) + numbers = pynini.difference(numbers, exceptions) + + if strip_dashes: + remove_dashes = pynini.closure(NEMO_ALPHA, 1) + pynini.cross("-", " ") + pynini.closure(NEMO_ALPHA, 1) + remove_dashes = pynini.closure(remove_dashes, 0) + numbers = pynini.union(numbers, pynutil.add_weight(numbers @ remove_dashes, -0.0001)) + + regular_ordinals = pynini.union(numbers, pynutil.add_weight(ones, -0.0001)) + regular_ordinals_graph = ( + pynutil.delete("integer: \"") + + regular_ordinals + + pynutil.delete("\"") + + pynutil.delete(" morphosyntactic_features: \"") + + pynini.closure(NEMO_NOT_QUOTE, 1) + + pynutil.delete("\"") + ) + + final_graph = pynini.union(regular_ordinals_graph, irregular_numbers_graph) + self.graph = final_graph + + self.fst = self.delete_tokens(final_graph).optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/fr/verbalizers/verbalize.py b/zonos3/vendor/nemo_text_processing/text_normalization/fr/verbalizers/verbalize.py new file mode 100644 index 0000000000000000000000000000000000000000..ba1629dd6bea85cb6ab2c172649de7c8f964e2cd --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/fr/verbalizers/verbalize.py @@ -0,0 +1,48 @@ +# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import GraphFst +from zonos3.vendor.nemo_text_processing.text_normalization.en.verbalizers.whitelist import WhiteListFst +from zonos3.vendor.nemo_text_processing.text_normalization.fr.verbalizers.cardinal import CardinalFst +from zonos3.vendor.nemo_text_processing.text_normalization.fr.verbalizers.date import DateFst +from zonos3.vendor.nemo_text_processing.text_normalization.fr.verbalizers.decimals import DecimalFst +from zonos3.vendor.nemo_text_processing.text_normalization.fr.verbalizers.fraction import FractionFst +from zonos3.vendor.nemo_text_processing.text_normalization.fr.verbalizers.ordinal import OrdinalFst + + +class VerbalizeFst(GraphFst): + """ + Composes other verbalizer grammars. + For deployment, this grammar will be compiled and exported to OpenFst Finate State Archiv (FAR) File. + More details to deployment at NeMo-text-processing/tools/text_processing_deployment. + Args: + deterministic: if True will provide a single transduction option, + for False multiple options (used for audio-based normalization) + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="verbalize", kind="verbalize", deterministic=deterministic) + cardinal = CardinalFst(deterministic=deterministic) + cardinal_graph = cardinal.fst + ordinal = OrdinalFst(deterministic=deterministic) + ordinal_graph = ordinal.fst + decimal = DecimalFst(deterministic=deterministic) + decimal_graph = decimal.fst + fraction = FractionFst(ordinal=ordinal, deterministic=deterministic) + fraction_graph = fraction.fst + whitelist_graph = WhiteListFst(deterministic=deterministic).fst + date = DateFst(deterministic=deterministic) + date_graph = date.fst + + graph = cardinal_graph | decimal_graph | ordinal_graph | fraction_graph | whitelist_graph | date_graph + self.fst = graph diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/fr/verbalizers/verbalize_final.py b/zonos3/vendor/nemo_text_processing/text_normalization/fr/verbalizers/verbalize_final.py new file mode 100644 index 0000000000000000000000000000000000000000..7c638c700508f60d7fedb713e33301305e4d3b6a --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/fr/verbalizers/verbalize_final.py @@ -0,0 +1,70 @@ +# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import os + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import ( + GraphFst, + delete_extra_space, + delete_space, + generator_main, +) +from zonos3.vendor.nemo_text_processing.text_normalization.en.verbalizers.word import WordFst +from zonos3.vendor.nemo_text_processing.text_normalization.fr.verbalizers.verbalize import VerbalizeFst +from zonos3.vendor.nemo_text_processing.utils.logging import logger + + +class VerbalizeFinalFst(GraphFst): + """ + Finite state transducer that verbalizes an entire sentence + Args: + deterministic: if True will provide a single transduction option, + for False multiple options (used for audio-based normalization) + cache_dir: path to a dir with .far grammar file. Set to None to avoid using cache. + overwrite_cache: set to True to overwrite .far files + """ + + def __init__(self, deterministic: bool = True, cache_dir: str = None, overwrite_cache: bool = False): + super().__init__(name="verbalize_final", kind="verbalize", deterministic=deterministic) + + far_file = None + if cache_dir is not None and cache_dir != "None": + os.makedirs(cache_dir, exist_ok=True) + far_file = os.path.join(cache_dir, f"fr_tn_{deterministic}_deterministic_verbalizer.far") + if not overwrite_cache and far_file and os.path.exists(far_file): + self.fst = pynini.Far(far_file, mode="r")["verbalize"] + logger.info(f'VerbalizeFinalFst graph was restored from {far_file}.') + else: + + verbalize = VerbalizeFst(deterministic=deterministic).fst + word = WordFst(deterministic=deterministic).fst + types = verbalize | word + graph = ( + pynutil.delete("tokens") + + delete_space + + pynutil.delete("{") + + delete_space + + types + + delete_space + + pynutil.delete("}") + ) + graph = delete_space + pynini.closure(graph + delete_extra_space) + graph + delete_space + + self.fst = graph.optimize() + if far_file: + generator_main(far_file, {"verbalize": self.fst}) + logger.info(f"VerbalizeFinalFst grammars are saved to {far_file}.") diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/it/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/it/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..2a9b2773c588d04f7eec36d300aa5816ccb1640e --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/it/__init__.py @@ -0,0 +1,17 @@ +# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from zonos3.vendor.nemo_text_processing.text_normalization.it.taggers.tokenize_and_classify import ClassifyFst +from zonos3.vendor.nemo_text_processing.text_normalization.it.verbalizers.verbalize import VerbalizeFst +from zonos3.vendor.nemo_text_processing.text_normalization.it.verbalizers.verbalize_final import VerbalizeFinalFst diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/it/data/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/it/data/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..6ebc808fad7ac87484dbabf02dacacdd7f826c14 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/it/data/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/it/data/electronic/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/it/data/electronic/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..6ebc808fad7ac87484dbabf02dacacdd7f826c14 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/it/data/electronic/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/it/data/electronic/domain.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/it/data/electronic/domain.tsv new file mode 100644 index 0000000000000000000000000000000000000000..c5c26d736702cae7cdddbbf7a9d5e5704707e2ce --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/it/data/electronic/domain.tsv @@ -0,0 +1,14 @@ +.com punto com +.org punto org +.gov punto gov +.uk punto UK +.fr punto FR +.net punto net +.html punto html +.py punto python +.ru punto RU +.us punto US +.de punto DE +.it punto IT +.jpg punto jpeg +.edu punto edu \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/it/data/electronic/server_name.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/it/data/electronic/server_name.tsv new file mode 100644 index 0000000000000000000000000000000000000000..9a0c7562948684993372a2c389c9f32297550e5f --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/it/data/electronic/server_name.tsv @@ -0,0 +1,11 @@ +gmail +nvidia +outlook +hotmail +yahoo +live +yandex +orange +wanadoo +web +comcast \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/it/data/electronic/symbols.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/it/data/electronic/symbols.tsv new file mode 100644 index 0000000000000000000000000000000000000000..56c9270c93111a58019ffa5f1141d30623c1fbd1 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/it/data/electronic/symbols.tsv @@ -0,0 +1,22 @@ +. punto +- trattino +_ trattino basso +! punto esclamativo +# cancelletto +$ dollaro +% percento +& e commerciale +' apostrofo +* asterisco ++ più +/ slash += uguale +? punto interrogativo +^ esponente +` accento +{ apri graffa +| barra verticale +} chiudi graffa +~ tilde +, virgola +: due punti diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/it/data/measure/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/it/data/measure/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..6ebc808fad7ac87484dbabf02dacacdd7f826c14 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/it/data/measure/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/it/data/measure/measurements.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/it/data/measure/measurements.tsv new file mode 100644 index 0000000000000000000000000000000000000000..bb359e6a0bd8d46a68708aed1eb0ff782c089ec9 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/it/data/measure/measurements.tsv @@ -0,0 +1,64 @@ +d giorno +f fahrenheit +c celsius +°C grado celsius +°F grado fahrenheit +K kelvin +km chilometro +m metro +cm centimetro +mm millimetro +μm micrometro +nm nanometro +dm decimetro +pm picometro +hm ettometro +ha ettaro +mi miglio +m² metro quadrato -0.0001 +km² chilometro quadrato -0.0001 +m2 metro quadrato +km2 chilometro quadrato +m3 metro cubo +ft foot +g grammo +µg microgrammo +mg milligrammo +kg chilogrammo +lb libbra +h ora +s secondo +min minuto +ms millisecondo +μs microsecondo +hz hertz +kw kilowatt +ghz gigahertz +khz kilohertz +mhz megahertz +v volt +mc megacoulomb +mA milliampere +A ampere +tw terawatt +mv millivolt +mw megawatt +gw gigawatt +ω ohm +db decibel +gb gigabyte +kb kilobit +pb petabit +mb megabyte +kb kilobyte +tb terabyte +kv kilovolt +mv megavolt +kn kilonewton +ml millilitro +l litro +dl decilitro +bar bar +kcal chilocaloria +cal caloria +% percento \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/it/data/measure/suppletive.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/it/data/measure/suppletive.tsv new file mode 100644 index 0000000000000000000000000000000000000000..31d2e1975e93839929cfa9bf09902e88ae5286c2 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/it/data/measure/suppletive.tsv @@ -0,0 +1,13 @@ +grado celsius gradi celsius +metro metri +ora ore +grammo grammi +secondo secondi +minuto minuti +chilometro chilometri +bit bits +byte bytes +caloria calorie +miglio miglia +litro litri +giorno giorni \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/it/data/money/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/it/data/money/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..6ebc808fad7ac87484dbabf02dacacdd7f826c14 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/it/data/money/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/it/data/money/currency_major.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/it/data/money/currency_major.tsv new file mode 100644 index 0000000000000000000000000000000000000000..93a991e4344abe01d81b8c79c7a6397f2f4b2e15 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/it/data/money/currency_major.tsv @@ -0,0 +1,11 @@ +€ euro +$ dollaro +£ sterlina +usd dollaro statunitense +eur euro +cad dollaro canadese +chf franco svizzero +hkd dollaro di hong kong +¥ yen +rs rupia +₽ rublo diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/it/data/money/currency_minor.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/it/data/money/currency_minor.tsv new file mode 100644 index 0000000000000000000000000000000000000000..59c91fff9c2768071367089d643d2ef8597d0557 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/it/data/money/currency_minor.tsv @@ -0,0 +1,11 @@ +€ centesimo +$ centesimo +£ penny +usd centesimo +eur centesimo +cad centesimo +chf centesimo +hkd centesimo +¥ yen +rs paisa +₽ copeca diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/it/data/money/currency_plural_fem.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/it/data/money/currency_plural_fem.tsv new file mode 100644 index 0000000000000000000000000000000000000000..542c49d1dce1a405c630f71cbe45cfa6e0df8721 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/it/data/money/currency_plural_fem.tsv @@ -0,0 +1,2 @@ +sterlina sterline +rupia rupie diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/it/data/money/currency_plural_masc.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/it/data/money/currency_plural_masc.tsv new file mode 100644 index 0000000000000000000000000000000000000000..b3905f693cf01d8949afa4e304f5cd5e36ae08b2 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/it/data/money/currency_plural_masc.tsv @@ -0,0 +1,10 @@ +centesimo centesimi +euro euro +dollaro dollari +penny penny +dollaro canadese dollari canadesi +franco svizzero franchi svizzeri +dollaro statunitense dollari statunitensi +rublo rubli +dollaro di hong hong dollari di hong kong +copeca copeche diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/it/data/numbers/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/it/data/numbers/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..6ebc808fad7ac87484dbabf02dacacdd7f826c14 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/it/data/numbers/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/it/data/numbers/digit.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/it/data/numbers/digit.tsv new file mode 100644 index 0000000000000000000000000000000000000000..4f2bf34e405925de3c2c4d2c29e95068c49a03bf --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/it/data/numbers/digit.tsv @@ -0,0 +1,9 @@ +uno 1 +due 2 +tre 3 +quattro 4 +cinque 5 +sei 6 +sette 7 +otto 8 +nove 9 \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/it/data/numbers/hundreds.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/it/data/numbers/hundreds.tsv new file mode 100644 index 0000000000000000000000000000000000000000..20f4aa2d16907a70b8dad16a8111f27251d1bf12 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/it/data/numbers/hundreds.tsv @@ -0,0 +1,8 @@ +duecento 2 +trecento 3 +quattrocento 4 +cinquecento 5 +seicento 6 +settecento 7 +ottocento 8 +novecento 9 \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/it/data/numbers/quantities.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/it/data/numbers/quantities.tsv new file mode 100644 index 0000000000000000000000000000000000000000..fac386746f3e73498eab9015b0997669f58f2425 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/it/data/numbers/quantities.tsv @@ -0,0 +1,2 @@ +milioni +miliardi \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/it/data/numbers/teen.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/it/data/numbers/teen.tsv new file mode 100644 index 0000000000000000000000000000000000000000..5c256ec6edb33d1002afb2c4796a06b9fb78aeac --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/it/data/numbers/teen.tsv @@ -0,0 +1,10 @@ +dieci 10 +undici 11 +dodici 12 +tredici 13 +quattordici 14 +quindici 15 +sedici 16 +diciassette 17 +diciotto 18 +diciannove 19 \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/it/data/numbers/tens.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/it/data/numbers/tens.tsv new file mode 100644 index 0000000000000000000000000000000000000000..5637114c26793f0b65549322038bdf63c2748884 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/it/data/numbers/tens.tsv @@ -0,0 +1,8 @@ +venti 2 +trenta 3 +quaranta 4 +cinquanta 5 +sessanta 6 +settanta 7 +ottanta 8 +novanta 9 \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/it/data/numbers/tens_eight.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/it/data/numbers/tens_eight.tsv new file mode 100644 index 0000000000000000000000000000000000000000..1cd57016368caeab4f9453ce692c904d9c51747f --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/it/data/numbers/tens_eight.tsv @@ -0,0 +1,8 @@ +ventotto 28 +trentotto 38 +quarantotto 48 +cinquantotto 58 +sessantotto 68 +settantotto 78 +ottantotto 88 +novantotto 98 \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/it/data/numbers/tens_one.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/it/data/numbers/tens_one.tsv new file mode 100644 index 0000000000000000000000000000000000000000..3ffbcec03d076193a169bf8539b1ae9464185840 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/it/data/numbers/tens_one.tsv @@ -0,0 +1,8 @@ +ventuno 21 +trentuno 31 +quarantuno 41 +cinquantuno 51 +sessantuno 61 +settantuno 71 +ottantuno 81 +novantuno 91 \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/it/data/numbers/zero.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/it/data/numbers/zero.tsv new file mode 100644 index 0000000000000000000000000000000000000000..c479272d40391d642dfa768cfa16be064e42ae5c --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/it/data/numbers/zero.tsv @@ -0,0 +1 @@ +zero 0 \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/it/data/whitelist/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/it/data/whitelist/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..6ebc808fad7ac87484dbabf02dacacdd7f826c14 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/it/data/whitelist/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/it/data/whitelist/whitelist.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/it/data/whitelist/whitelist.tsv new file mode 100644 index 0000000000000000000000000000000000000000..15d65d81d2c081612e319f9a370fedf4bbe4bff5 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/it/data/whitelist/whitelist.tsv @@ -0,0 +1,65 @@ +dr dottor +dr. dottor +Dr. dottor +dott. dottor +Dott. dottor +dott.sa dottoressa +Dott.sa dottoressa +prof. professore +Prof. professore +proff. professori +Proff. professori +prof.ssa professoressa +Prof.ssa professoressa +Sig. signore +Sig.na signorina +sig. signore +sig.na signorina +sig signore +Sigg. signori +sigg. signori +Sig.ri signori +sig.ri signori +Sig.re signore +sig.re signore +Sig.ra signora +sig.ra signora +Sig.re signorine +sig.re signorine +Avv. avvocato +avv. avvocato +Arch. architetto +arch. architetto +Rag. ragioniere +rag. ragioniere +Geom. geometra +geom. geometra +Ing. ingegnere +ing. ingegnere +Ingg. ingegneri +ingg. ingegneri +Fam. famiglia +fam. famiglia +f.lli fratelli +F.lli fratelli +Rev. reverendo +On. onorevole +on. onorevole +Onn. onorevoli +onn. onorevoli +Min. ministro +Sen. senatore +c.v.d. come volevasi dimostrare +ecc. eccetera +ecc eccetera +v.le viale +p.za piazza +l.go largo +loc. località +ist. istituto +segr. segreteria +set. settore +uff. ufficio +dip. dipartimento +div. divisione ++ più diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/it/taggers/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/it/taggers/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..6ebc808fad7ac87484dbabf02dacacdd7f826c14 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/it/taggers/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/it/taggers/cardinal.py b/zonos3/vendor/nemo_text_processing/text_normalization/it/taggers/cardinal.py new file mode 100644 index 0000000000000000000000000000000000000000..873afb703fb62f674555fa0af9a238a4d127a650 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/it/taggers/cardinal.py @@ -0,0 +1,183 @@ +# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import ( + NEMO_ALPHA, + NEMO_DIGIT, + NEMO_SIGMA, + NEMO_SPACE, + NEMO_WHITE_SPACE, + GraphFst, + delete_space, + insert_space, +) +from zonos3.vendor.nemo_text_processing.text_normalization.es.graph_utils import cardinal_separator +from zonos3.vendor.nemo_text_processing.text_normalization.it.utils import get_abs_path + +zero = pynini.invert(pynini.string_file(get_abs_path("data/numbers/zero.tsv"))) +digit = pynini.invert(pynini.string_file(get_abs_path("data/numbers/digit.tsv"))) +teen = pynini.invert(pynini.string_file(get_abs_path("data/numbers/teen.tsv"))) +tens = pynini.invert(pynini.string_file(get_abs_path("data/numbers/tens.tsv"))) +tens_one = pynini.invert(pynini.string_file(get_abs_path("data/numbers/tens_one.tsv"))) +tens_eight = pynini.invert(pynini.string_file(get_abs_path("data/numbers/tens_eight.tsv"))) +hundreds = pynini.invert(pynini.string_file(get_abs_path("data/numbers/hundreds.tsv"))) + + +def filter_punctuation(fst: 'pynini.FstLike') -> 'pynini.FstLike': + """ + Helper function for parsing number strings. Converts common cardinal strings (groups of three digits delineated by 'cardinal_separator' - see graph_utils) + and converts to a string of digits: + "1 000" -> "1000" + "1.000.000" -> "1000000" + Args: + fst: Any pynini.FstLike object. Function composes fst onto string parser fst + Returns: + fst: A pynini.FstLike object + """ + exactly_three_digits = NEMO_DIGIT**3 # for blocks of three + up_to_three_digits = pynini.closure(NEMO_DIGIT, 1, 3) # for start of string + + cardinal_string = pynini.closure( + NEMO_DIGIT, 1 + ) # For string w/o punctuation (used for page numbers, thousand series) + + cardinal_string |= ( + up_to_three_digits + + pynutil.delete(cardinal_separator) + + pynini.closure(exactly_three_digits + pynutil.delete(cardinal_separator)) + + exactly_three_digits + ) + + return cardinal_string @ fst + + +class CardinalFst(GraphFst): + ''' + Finite state transducer for classifying cardinals in Italian, e.g. + "1000" -> cardinal { integer: "mille" } + "2.000.000" -> cardinal { integer: "due milioni" } + Args: + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + ''' + + def __init__(self, deterministic: bool = True): + super().__init__(name='cardinal', kind='classify', deterministic=deterministic) + + # single digit + graph_digit = digit + digits_no_one = (NEMO_DIGIT - "1") @ graph_digit + + # double digit + graph_tens = teen + graph_tens |= tens + (pynutil.delete('0') | graph_digit) + graph_tens |= pynutil.add_weight(tens_one, -0.01) + graph_tens |= pynutil.add_weight(tens_eight, -0.01) + + self.tens = graph_tens.optimize() + + self.two_digit_no_zero = pynini.union( + graph_digit, graph_tens, (pynini.cross('0', NEMO_SPACE) + graph_digit) + ).optimize() + + # three digit + graph_hundreds = hundreds + pynini.union( + pynutil.delete('00'), insert_space + graph_tens, (pynini.cross("0", NEMO_SPACE) + graph_digit) + ) + graph_hundreds |= ( + pynini.cross('1', 'cento') + + insert_space + + pynini.union(graph_tens, pynutil.delete("0") + graph_digit, pynutil.delete("00")) + ) + + self.hundreds = graph_hundreds.optimize() + + # three digit leading zeros + graph_hundreds_component = pynini.union(graph_hundreds, pynutil.delete("0") + graph_tens) + + graph_hundreds_component_at_least_one_none_zero_digit = graph_hundreds_component | ( + pynutil.delete("00") + graph_digit + ) + + graph_hundreds_component_at_least_one_none_zero_digit_no_one = graph_hundreds_component | ( + pynutil.delete("00") + digits_no_one + ) + + # thousands + graph_thousands_component_at_least_one_none_zero_digit = pynini.union( + pynutil.delete("000") + graph_hundreds_component_at_least_one_none_zero_digit, + graph_hundreds_component_at_least_one_none_zero_digit_no_one + + pynutil.insert("mila") + + ((insert_space + graph_hundreds_component_at_least_one_none_zero_digit) | pynutil.delete("000")), + pynini.cross("001", "mille") + + ((insert_space + graph_hundreds_component_at_least_one_none_zero_digit) | pynutil.delete("000")), + ) + + graph_thousands_component_at_least_one_none_zero_digit_no_one = pynini.union( + pynutil.delete("000") + graph_hundreds_component_at_least_one_none_zero_digit_no_one, + graph_hundreds_component_at_least_one_none_zero_digit_no_one + + pynutil.insert("mila") + + ((insert_space + graph_hundreds_component_at_least_one_none_zero_digit) | pynutil.delete("000")), + pynini.cross("001", "mille") + + ((insert_space + graph_hundreds_component_at_least_one_none_zero_digit) | pynutil.delete("000")), + ) + + # higher + graph_million = pynutil.add_weight(pynini.cross("000001", "un milione"), -0.001) + graph_million |= graph_thousands_component_at_least_one_none_zero_digit_no_one + pynutil.insert(" milioni") + graph_million |= pynutil.delete("000000") + graph_million += insert_space + + graph_billion = pynutil.add_weight(pynini.cross("000001", "un miliardo"), -0.001) + graph_billion |= graph_thousands_component_at_least_one_none_zero_digit_no_one + pynutil.insert(" miliardi") + graph_billion |= pynutil.delete("000000") + graph_billion += insert_space + + graph_trillion = pynutil.add_weight(pynini.cross("000001", "un trilione"), -0.001) + graph_trillion |= graph_thousands_component_at_least_one_none_zero_digit_no_one + pynutil.insert(" trilioni") + graph_trillion |= pynutil.delete("000000") + graph_trillion += insert_space + + graph = ( + graph_trillion + + graph_billion + + graph_million + + (graph_thousands_component_at_least_one_none_zero_digit | pynutil.delete("000000")) + ) + + self.graph = ( + ((NEMO_DIGIT - "0") + pynini.closure(NEMO_DIGIT, 0)) + @ pynini.cdrewrite(pynini.closure(pynutil.insert("0")), "[BOS]", "", NEMO_SIGMA) + @ NEMO_DIGIT**24 + @ graph + @ pynini.cdrewrite(delete_space, "[BOS]", "", NEMO_SIGMA) + @ pynini.cdrewrite(delete_space, "", "[EOS]", NEMO_SIGMA) + @ pynini.cdrewrite( + pynini.cross(pynini.closure(NEMO_WHITE_SPACE, 2), NEMO_SPACE), NEMO_ALPHA, NEMO_ALPHA, NEMO_SIGMA + ) + ) + + self.graph |= zero + + self.graph = filter_punctuation(self.graph).optimize() + + optional_minus_graph = pynini.closure(pynutil.insert("negative: ") + pynini.cross("-", "\"true\" "), 0, 1) + + final_graph = optional_minus_graph + pynutil.insert("integer: \"") + self.graph + pynutil.insert("\"") + + final_graph = self.add_tokens(final_graph) + self.fst = final_graph.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/it/taggers/decimals.py b/zonos3/vendor/nemo_text_processing/text_normalization/it/taggers/decimals.py new file mode 100644 index 0000000000000000000000000000000000000000..ec45d3820ecb01a5965c39d5522ced118f402f8e --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/it/taggers/decimals.py @@ -0,0 +1,121 @@ +# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import ( + NEMO_DIGIT, + NEMO_SIGMA, + NEMO_SPACE, + GraphFst, + delete_space, + insert_space, +) +from zonos3.vendor.nemo_text_processing.text_normalization.es.graph_utils import ( + cardinal_separator, + decimal_separator, + strip_cardinal_apocope, +) +from zonos3.vendor.nemo_text_processing.text_normalization.it.utils import get_abs_path + +quantities = pynini.string_file(get_abs_path("data/numbers/quantities.tsv")) +digit = pynini.invert(pynini.string_file(get_abs_path("data/numbers/digit.tsv"))) +zero = pynini.invert(pynini.string_file(get_abs_path("data/numbers/zero.tsv"))) + + +def get_quantity(decimal_graph: "pynini.FstLike", cardinal_graph: "pynini.FstLike") -> "pynini.FstLike": + """ """ + numbers = pynini.closure(NEMO_DIGIT, 1, 6) @ cardinal_graph + numbers = pynini.cdrewrite(pynutil.delete(cardinal_separator), "", "", NEMO_SIGMA) @ numbers + + res = ( + pynutil.insert('integer_part: "') + + numbers + + pynutil.insert('"') + + NEMO_SPACE + + pynutil.insert('quantity: "') + + quantities + + pynutil.insert('"') + ) + res |= decimal_graph + NEMO_SPACE + pynutil.insert('quantity: "') + quantities + pynutil.insert('"') + return res + + +class DecimalFst(GraphFst): + """ + Finite state transducer for classifying decimal, e.g. + -2 milioni: decimal { negative: "true" integer_part: "due" quantity: "milioni" preserve_order: true } --> + meno due milioni + Args: + cardinal: CardinalFst + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, cardinal: GraphFst, deterministic: bool = True): + super().__init__(name="decimal", kind="classify", deterministic=deterministic) + graph_digit = digit | zero + + if not deterministic: + graph = pynini.union(graph_digit, cardinal.hundreds, cardinal.tens) + graph += pynini.closure(insert_space + graph) + + else: + + graph = pynini.union( + pynutil.add_weight(graph_digit + pynini.closure(insert_space + zero), -0.00001), + pynutil.add_weight(cardinal.tens + pynini.closure(insert_space + zero), -0.00002), + pynutil.add_weight(cardinal.hundreds + pynini.closure(insert_space + zero), 0.00001), + pynutil.add_weight( + cardinal.tens + + pynini.closure(insert_space + cardinal.tens, 1) + + pynini.closure(insert_space + zero, 0, 1) + + (pynini.closure(insert_space + graph_digit, 0, 1) | pynini.closure(insert_space + zero, 0)), + -0.00002, + ), # Read out as tens and a possible trailing digit or zeroes + zero + + pynini.closure(insert_space + zero) + + pynini.closure(insert_space + graph_digit), # For cases such as "1,010" + ) + + # Technically decimals should be space delineated groups of three, e.g. (1,333 333). This removes any possible spaces + strip_formatting = pynini.cdrewrite(delete_space, "", "", NEMO_SIGMA) + graph = strip_formatting @ graph + + self.graph = graph.optimize() + + graph_separator = pynutil.delete(decimal_separator) + optional_graph_negative = pynini.closure(pynutil.insert("negative: ") + pynini.cross("-", '"true" '), 0, 1) + + self.graph_fractional = pynutil.insert('fractional_part: "') + self.graph + pynutil.insert('"') + + graph_integer = ( + strip_cardinal_apocope(cardinal.graph) + if deterministic + else pynini.union(cardinal.graph, strip_cardinal_apocope(cardinal.graph)) + ) + + self.graph_integer = pynutil.insert('integer_part: "') + graph_integer + pynutil.insert('"') + final_graph_wo_sign = self.graph_integer + graph_separator + insert_space + self.graph_fractional + + self.final_graph_wo_negative = ( + final_graph_wo_sign | get_quantity(final_graph_wo_sign, cardinal.graph).optimize() + ) + final_graph = optional_graph_negative + self.final_graph_wo_negative + + final_graph += pynutil.insert(" preserve_order: true") + final_graph = self.add_tokens(final_graph) + + self.fst = final_graph.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/it/taggers/electronic.py b/zonos3/vendor/nemo_text_processing/text_normalization/it/taggers/electronic.py new file mode 100644 index 0000000000000000000000000000000000000000..48bfdc1486d0d7c58ece3e109f86891a4173d353 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/it/taggers/electronic.py @@ -0,0 +1,107 @@ +# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import ( + NEMO_ALPHA, + NEMO_DIGIT, + NEMO_SPACE, + GraphFst, + at, + colon, + domain_string, + double_quotes, + double_slash, + http, + https, + period, + protocol_string, + username_string, + www, +) +from zonos3.vendor.nemo_text_processing.text_normalization.it.utils import get_abs_path, load_labels + +# common_domains = [x[0] for x in load_labels(get_abs_path("data/electronic/domain.tsv"))] + + +class ElectronicFst(GraphFst): + """ + Finite state transducer for classifying electronic: email addresses + e.g. "abc.def@studente.università.it" -> electronic { username: "abc.def" domain: "studente.università.it" preserve_order: true } + e.g. "www.abc.com/123" -> electronic { protocol: "www." domain: "abc.com/123" preserve_order: true } + e.g. "https://github.com/NVIDIA/electronic.py" -> electronic { protocol: "https://" domain: "github.com/NVIDIA/electronic.py" preserve_order: true } + Args: + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="electronic", kind="classify", deterministic=deterministic) + + dot = pynini.accep(".") + + symbols = [x[0] for x in load_labels(get_abs_path("data/electronic/symbols.tsv"))] + symbols = pynini.union(*symbols) + symbols_no_period = pynini.difference(symbols, dot) + accepted_characters = pynini.closure((NEMO_ALPHA | NEMO_DIGIT | symbols_no_period), 1) + all_characters = pynini.closure((NEMO_ALPHA | NEMO_DIGIT | symbols), 1) + + # domains + domain = dot + accepted_characters + domain_graph = ( + pynutil.insert(domain_string + colon + NEMO_SPACE + double_quotes) + + (accepted_characters + pynini.closure(domain, 1)) + + pynutil.insert(double_quotes) + ) + + # email + username = ( + pynutil.insert(username_string + colon + NEMO_SPACE + double_quotes) + + all_characters + + pynutil.insert(double_quotes) + + pynini.cross(at, NEMO_SPACE) + ) + email = username + domain_graph + + # social media tags + tag = ( + pynutil.delete(at) + + pynutil.insert(username_string + colon + NEMO_SPACE + double_quotes) + + (accepted_characters | (accepted_characters + pynini.closure(domain, 1))) + + pynutil.insert(double_quotes) + ) + + # url + protocol_start = pynini.accep(https + colon + double_slash) | pynini.accep(http + colon + double_slash) + protocol_end = ( + pynini.accep(www + period) + if deterministic + else pynini.accep(www + period) | pynini.cross((www + period), "vu vu vu.") + ) + protocol = protocol_start | protocol_end | (protocol_start + protocol_end) + protocol = ( + pynutil.insert(protocol_string + colon + NEMO_SPACE + double_quotes) + + protocol + + pynutil.insert(double_quotes) + ) + + url = protocol + pynutil.insert(NEMO_SPACE) + (domain_graph) + + graph = url | domain_graph | email | tag + self.graph = graph + + final_graph = self.add_tokens(self.graph + pynutil.insert(" preserve_order: true")) + self.fst = final_graph.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/it/taggers/measure.py b/zonos3/vendor/nemo_text_processing/text_normalization/it/taggers/measure.py new file mode 100644 index 0000000000000000000000000000000000000000..07b96ce39d4ece0e1f9a52ff17b51428285cd7d1 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/it/taggers/measure.py @@ -0,0 +1,173 @@ +# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.examples import plurals +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import ( + NEMO_ALPHA, + NEMO_DIGIT, + NEMO_NON_BREAKING_SPACE, + NEMO_SIGMA, + GraphFst, + convert_space, + insert_space, +) +from zonos3.vendor.nemo_text_processing.text_normalization.it.utils import get_abs_path + +unit_singular = pynini.string_file(get_abs_path("data/measure/measurements.tsv")) +suppletive = pynini.string_file(get_abs_path("data/measure/suppletive.tsv")) + + +def singular_to_plural(): + _o = NEMO_SIGMA + pynini.cross("o", "") + pynutil.insert("i") + _a = NEMO_SIGMA + pynini.cross("a", "") + pynutil.insert("e") + _e = NEMO_SIGMA + pynini.cross("e", "") + pynutil.insert("i") + + graph_plural = plurals._priority_union(suppletive, pynini.union(_o, _a, _e), NEMO_SIGMA).optimize() + + return graph_plural + + +class MeasureFst(GraphFst): + """ + Finite state transducer for classifying measure, e.g. + "2,4 g" -> measure { cardinal { integer_part: "due" fractional_part: "quattro" units: "grammi" preserve_order: true } } + + Args: + cardinal: CardinalFst + decimal: DecimalFst + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, cardinal: GraphFst, decimal: GraphFst, deterministic: bool = True): + super().__init__(name="measure", kind="classify", deterministic=deterministic) + + cardinal_graph = cardinal.graph + + graph_unit_singular = convert_space(unit_singular) + graph_unit_plural = convert_space(suppletive) + graph_unit_plural |= graph_unit_singular @ pynini.cdrewrite(convert_space(suppletive), "", "[EOS]", NEMO_SIGMA) + optional_graph_negative = pynini.closure("-", 0, 1) + + graph_unit_denominator = ( + pynini.cross("/", "per") + pynutil.insert(NEMO_NON_BREAKING_SPACE) + graph_unit_singular + ) + + optional_unit_denominator = pynini.closure( + pynutil.insert(NEMO_NON_BREAKING_SPACE) + graph_unit_denominator, + 0, + 1, + ) + + unit_plural = ( + pynutil.insert("units: \"") + + (graph_unit_plural + (optional_unit_denominator) | graph_unit_denominator) + + pynutil.insert("\"") + ) + + unit_singular_graph = ( + pynutil.insert("units: \"") + + ((graph_unit_singular + optional_unit_denominator) | graph_unit_denominator) + + pynutil.insert("\"") + ) + + subgraph_decimal = decimal.fst + insert_space + pynini.closure(pynutil.delete(" "), 0, 1) + unit_plural + + subgraph_cardinal = ( + (optional_graph_negative + (pynini.closure(NEMO_DIGIT) - "1")) @ cardinal.fst + + insert_space + + pynini.closure(pynutil.delete(" "), 0, 1) + + unit_plural + ) + + subgraph_cardinal |= ( + (optional_graph_negative + pynini.accep("1")) + @ cardinal.fst + @ pynini.cdrewrite(pynini.cross("uno", "un"), "", "", NEMO_SIGMA) + + insert_space + + pynini.closure(pynutil.delete(" "), 0, 1) + + unit_singular_graph + ) + + cardinal_dash_alpha = ( + pynutil.insert("cardinal { integer: \"") + + cardinal_graph + + pynutil.delete('-') + + pynutil.insert("\" } units: \"") + + pynini.closure(NEMO_ALPHA, 1) + + pynutil.insert("\"") + ) + + alpha_dash_cardinal = ( + pynutil.insert("units: \"") + + pynini.closure(NEMO_ALPHA, 1) + + pynutil.delete('-') + + pynutil.insert("\"") + + pynutil.insert(" cardinal { integer: \"") + + cardinal_graph + + pynutil.insert("\" }") + ) + + decimal_dash_alpha = ( + pynutil.insert("decimal { ") + + decimal.final_graph_wo_negative + + pynutil.delete('-') + + pynutil.insert("\" } units: \"") + + pynini.closure(NEMO_ALPHA, 1) + + pynutil.insert("\"") + ) + + decimal_times = ( + pynutil.insert("decimal { ") + + decimal.final_graph_wo_negative + + pynutil.insert("\" } units: \"") + + pynini.union('x', 'X') + + pynutil.insert("\"") + ) + + cardinal_times = ( + pynutil.insert("cardinal { integer: \"") + + cardinal_graph + + pynutil.insert("\" } units: \"") + + pynini.union('x', 'X') + + pynutil.insert("\"") + ) + + alpha_dash_decimal = ( + pynutil.insert("units: \"") + + pynini.closure(NEMO_ALPHA, 1) + + pynutil.delete('-') + + pynutil.insert("\"") + + pynutil.insert(" decimal { ") + + decimal.final_graph_wo_negative + + pynutil.insert(" }") + ) + + final_graph = ( + subgraph_decimal + | subgraph_cardinal + | cardinal_dash_alpha + | alpha_dash_cardinal + | decimal_dash_alpha + | decimal_times + | alpha_dash_decimal + | cardinal_times + ) + # final_graph += pynutil.insert(" preserve_order: true") + final_graph = self.add_tokens(final_graph) + + self.fst = final_graph.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/it/taggers/money.py b/zonos3/vendor/nemo_text_processing/text_normalization/it/taggers/money.py new file mode 100644 index 0000000000000000000000000000000000000000..d04b60458bcc0884253f8e7d1b7662b32a3e2815 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/it/taggers/money.py @@ -0,0 +1,176 @@ +# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import ( + NEMO_ALPHA, + NEMO_DIGIT, + NEMO_SIGMA, + NEMO_SPACE, + GraphFst, + delete_space, + insert_space, +) +from zonos3.vendor.nemo_text_processing.text_normalization.es.graph_utils import decimal_separator +from zonos3.vendor.nemo_text_processing.text_normalization.it.utils import get_abs_path, load_labels + +maj_singular_labels = load_labels(get_abs_path("data/money/currency_major.tsv")) +maj_singular = pynini.string_file((get_abs_path("data/money/currency_major.tsv"))) +min_singular = pynini.string_file(get_abs_path("data/money/currency_minor.tsv")) +fem_plural = pynini.string_file((get_abs_path("data/money/currency_plural_fem.tsv"))) +masc_plural = pynini.string_file((get_abs_path("data/money/currency_plural_masc.tsv"))) + + +class MoneyFst(GraphFst): + """ + Finite state transducer for classifying money, e.g. + "€1" -> money { currency_maj: "euro" integer_part: "un"} + "€1,000" -> money { currency_maj: "euro" integer_part: "un" } + "4,2 £" -> money { integer_part: "quattro" currency_maj: "sterline" fractional_part: "venti" currency_min: "penny" preserve_order: true } + + Args: + cardinal: CardinalFst + decimal: DecimalFst + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, cardinal: GraphFst, decimal: GraphFst, deterministic: bool = True): + super().__init__(name="money", kind="classify", deterministic=deterministic) + cardinal_graph = cardinal.graph + graph_decimal_final = decimal.final_graph_wo_negative + + maj_singular_graph = maj_singular + min_singular_graph = min_singular + maj_plural_graph = maj_singular @ (fem_plural | masc_plural) + min_plural_graph = min_singular @ (fem_plural | masc_plural) + + graph_maj_singular = pynutil.insert("currency_maj: \"") + maj_singular_graph + pynutil.insert("\"") + graph_maj_plural = pynutil.insert("currency_maj: \"") + maj_plural_graph + pynutil.insert("\"") + + graph_integer_one = pynutil.insert("integer_part: \"") + pynini.cross("1", "un") + pynutil.insert("\"") + + decimal_with_quantity = (NEMO_SIGMA + NEMO_ALPHA) @ graph_decimal_final + + graph_decimal_plural = pynini.union( + graph_maj_plural + pynini.closure(delete_space, 0, 1) + insert_space + graph_decimal_final, # $1,05 + graph_decimal_final + pynini.closure(delete_space, 0, 1) + insert_space + graph_maj_plural, # 1,05 $ + ) + graph_decimal_plural = ((NEMO_SIGMA - "1") + decimal_separator + NEMO_SIGMA) @ graph_decimal_plural + + graph_decimal_singular = pynini.union( + graph_maj_singular + pynini.closure(delete_space, 0, 1) + insert_space + graph_decimal_final, # $1,05 + graph_decimal_final + pynini.closure(delete_space, 0, 1) + insert_space + graph_maj_singular, # 1,05 $ + ) + graph_decimal_singular = (pynini.accep("1") + decimal_separator + NEMO_SIGMA) @ graph_decimal_singular + + graph_decimal = pynini.union( + graph_decimal_singular, + graph_decimal_plural, + graph_maj_plural + pynini.closure(delete_space, 0, 1) + insert_space + decimal_with_quantity, + ) + + graph_integer = ( + pynutil.insert("integer_part: \"") + ((NEMO_SIGMA - "1") @ cardinal_graph) + pynutil.insert("\"") + ) + + graph_integer_only = pynini.union( + graph_maj_singular + pynini.closure(delete_space, 0, 1) + insert_space + graph_integer_one, + graph_integer_one + pynini.closure(delete_space, 0, 1) + insert_space + graph_maj_singular, + ) + graph_integer_only |= pynini.union( + graph_maj_plural + pynini.closure(delete_space, 0, 1) + insert_space + graph_integer, + graph_integer + pynini.closure(delete_space, 0, 1) + insert_space + graph_maj_plural, + ) + + graph = graph_integer_only | graph_decimal + + # remove trailing zeros of non zero number in the first 2 digits and fill up to 2 digits + # e.g. 2000 -> 20, 0200->02, 01 -> 01, 10 -> 10 + # not accepted: 002, 00, 0, + two_digits_fractional_part = ( + pynini.closure(NEMO_DIGIT) + (NEMO_DIGIT - "0") + pynini.closure(pynutil.delete("0")) + ) @ ( + (pynutil.delete("0") + (NEMO_DIGIT - "0")) + | ((NEMO_DIGIT - "0") + pynutil.insert("0")) + | ((NEMO_DIGIT - "0") + NEMO_DIGIT) + ) + + graph_min_singular = pynutil.insert("currency_min: \"") + min_singular_graph + pynutil.insert("\"") + graph_min_plural = pynutil.insert("currency_min: \"") + min_plural_graph + pynutil.insert("\"") + + # format ** euro ** centesimo + decimal_graph_with_minor = None + for curr_symbol, _ in maj_singular_labels: + preserve_order = pynutil.insert(" preserve_order: true") + + integer_plus_maj = pynini.union( + graph_integer + insert_space + pynutil.insert(curr_symbol) @ graph_maj_plural, + graph_integer_one + insert_space + pynutil.insert(curr_symbol) @ graph_maj_singular, + ) + # non zero integer part + integer_plus_maj = (pynini.closure(NEMO_DIGIT) - "0") @ integer_plus_maj + + graph_fractional_one = ( + pynutil.insert("fractional_part: \"") + + two_digits_fractional_part @ pynini.cross("1", "un") + + pynutil.insert("\"") + ) + + graph_fractional = ( + two_digits_fractional_part @ (pynini.closure(NEMO_DIGIT, 1, 2) - "1") @ cardinal.two_digit_no_zero + ) + graph_fractional = pynutil.insert("fractional_part: \"") + graph_fractional + pynutil.insert("\"") + + fractional_plus_min = pynini.union( + graph_fractional + insert_space + pynutil.insert(curr_symbol) @ graph_min_plural, + graph_fractional_one + insert_space + pynutil.insert(curr_symbol) @ graph_min_singular, + ) + + decimal_graph_with_minor_curr = ( + integer_plus_maj + pynini.cross(decimal_separator, NEMO_SPACE) + fractional_plus_min + ) + decimal_graph_with_minor_curr |= pynutil.add_weight( + integer_plus_maj + + pynini.cross(decimal_separator, NEMO_SPACE) + + pynutil.insert("fractional_part: \"") + + two_digits_fractional_part @ cardinal.two_digit_no_zero + + pynutil.insert("\""), + weight=0.0001, + ) + + decimal_graph_with_minor_curr |= pynutil.delete("0,") + fractional_plus_min + decimal_graph_with_minor_curr = pynini.union( + pynutil.delete(curr_symbol) + + pynini.closure(delete_space, 0, 1) + + decimal_graph_with_minor_curr + + preserve_order, + decimal_graph_with_minor_curr + + preserve_order + + pynini.closure(delete_space, 0, 1) + + pynutil.delete(curr_symbol), + ) + + decimal_graph_with_minor = ( + decimal_graph_with_minor_curr + if decimal_graph_with_minor is None + else pynini.union(decimal_graph_with_minor, decimal_graph_with_minor_curr) + ) + + final_graph = graph | pynutil.add_weight(decimal_graph_with_minor, -0.001) + + final_graph = self.add_tokens(final_graph) + self.fst = final_graph.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/it/taggers/time.py b/zonos3/vendor/nemo_text_processing/text_normalization/it/taggers/time.py new file mode 100644 index 0000000000000000000000000000000000000000..46d782d6ef1b6b162c9da5c0bbd850a74ec7d286 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/it/taggers/time.py @@ -0,0 +1,80 @@ +# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import NEMO_DIGIT, GraphFst, insert_space + + +class TimeFst(GraphFst): + """ + Finite state transducer for classifying time, e.g. + 15:30:30 tokens { time { hours: "15" minutes: "30" seconds: "30" preserve_order: true } } -> quindici e mezza trenta secondi + 12:15 tokens { time { hours: "12" minutes: "15" } } -> dodici e un quarto + 03:38 tokens { time { hours: "3" minutes: "38" } } -> tre e trentotto minuti + + Args: + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="time", kind="classify", deterministic=deterministic) + + labels_hour = [str(x) for x in range(0, 25)] + labels_minute_single = [str(x) for x in range(1, 10)] + labels_minute_double = [str(x) for x in range(10, 60)] + + delete_leading_zero_to_double_digit = (pynutil.delete("0") | (NEMO_DIGIT - "0")) + NEMO_DIGIT + + graph_hour = pynini.union(*labels_hour) + + graph_minute_single = pynini.union(*labels_minute_single) + graph_minute_double = pynini.union(*labels_minute_double) + + final_graph_hour_only = pynutil.insert("hours: \"") + graph_hour + pynutil.insert("\"") + final_graph_hour = ( + pynutil.insert("hours: \"") + delete_leading_zero_to_double_digit @ graph_hour + pynutil.insert("\"") + ) + final_graph_minute = ( + pynutil.insert("minutes: \"") + + (pynutil.delete("0") + graph_minute_single | graph_minute_double) + + pynutil.insert("\"") + ) + final_graph_second = ( + pynutil.insert("seconds: \"") + + (pynutil.delete("0") + graph_minute_single | graph_minute_double) + + pynutil.insert("\"") + ) + + graph_hm = ( + final_graph_hour + pynutil.delete(":") + (pynutil.delete("00") | (insert_space + final_graph_minute)) + ) + + graph_hms = ( + final_graph_hour + + pynutil.delete(":") + + (pynini.cross("00", " minutes: \"0\"") | (insert_space + final_graph_minute)) + + pynutil.delete(":") + + (pynini.cross("00", " seconds: \"0\"") | (insert_space + final_graph_second)) + + pynutil.insert(" preserve_order: true") + ) + + graph_h = final_graph_hour_only + + final_graph = (graph_hm | graph_h | graph_hms).optimize() + final_graph = self.add_tokens(final_graph) + self.fst = final_graph.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/it/taggers/tokenize_and_classify.py b/zonos3/vendor/nemo_text_processing/text_normalization/it/taggers/tokenize_and_classify.py new file mode 100644 index 0000000000000000000000000000000000000000..a2fe6340ce807a35f70b525edfbd2e4224b74d62 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/it/taggers/tokenize_and_classify.py @@ -0,0 +1,138 @@ +# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import os + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import ( + NEMO_CHAR, + NEMO_DIGIT, + NEMO_WHITE_SPACE, + GraphFst, + delete_extra_space, + delete_space, + generator_main, +) +from zonos3.vendor.nemo_text_processing.text_normalization.en.taggers.punctuation import PunctuationFst +from zonos3.vendor.nemo_text_processing.text_normalization.it.taggers.cardinal import CardinalFst +from zonos3.vendor.nemo_text_processing.text_normalization.it.taggers.decimals import DecimalFst +from zonos3.vendor.nemo_text_processing.text_normalization.it.taggers.electronic import ElectronicFst +from zonos3.vendor.nemo_text_processing.text_normalization.it.taggers.measure import MeasureFst +from zonos3.vendor.nemo_text_processing.text_normalization.it.taggers.money import MoneyFst +from zonos3.vendor.nemo_text_processing.text_normalization.it.taggers.time import TimeFst +from zonos3.vendor.nemo_text_processing.text_normalization.it.taggers.whitelist import WhiteListFst +from zonos3.vendor.nemo_text_processing.text_normalization.it.taggers.word import WordFst +from zonos3.vendor.nemo_text_processing.utils.logging import logger + + +class ClassifyFst(GraphFst): + """ + Final class that composes all other classification grammars. This class can process an entire sentence, that is lower cased. + For deployment, this grammar will be compiled and exported to OpenFst Finite State aRchive (FAR) File. + More details to deployment at NeMo/tools/text_processing_deployment. + Args: + input_case: accepting either "lower_cased" or "cased" input. + deterministic: if True will provide a single transduction option, + for False multiple options (used for audio-based normalization) + cache_dir: path to a dir with .far grammar file. Set to None to avoid using cache. + overwrite_cache: set to True to overwrite .far files + whitelist: path to a file with whitelist replacements + """ + + def __init__( + self, + input_case: str, + deterministic: bool = False, + cache_dir: str = None, + overwrite_cache: bool = False, + whitelist: str = None, + ): + super().__init__(name="tokenize_and_classify", kind="classify", deterministic=deterministic) + far_file = None + if cache_dir is not None and cache_dir != "None": + os.makedirs(cache_dir, exist_ok=True) + whitelist_file = os.path.basename(whitelist) if whitelist else "" + far_file = os.path.join( + cache_dir, + f"_{input_case}_it_tn_{deterministic}_deterministic{whitelist_file}.far", + ) + if not overwrite_cache and far_file and os.path.exists(far_file): + self.fst = pynini.Far(far_file, mode="r")["tokenize_and_classify"] + logger.info(f"ClassifyFst.fst was restored from {far_file}.") + else: + logger.info(f"Creating ClassifyFst grammars. This might take some time...") + + self.cardinal = CardinalFst(deterministic=deterministic) + cardinal_graph = self.cardinal.fst + + self.decimal = DecimalFst(cardinal=self.cardinal, deterministic=deterministic) + decimal_graph = self.decimal.fst + + word_graph = WordFst(deterministic=deterministic).fst + + self.whitelist = WhiteListFst(input_case=input_case, deterministic=deterministic, input_file=whitelist) + whitelist_graph = self.whitelist.fst + + self.electronic = ElectronicFst(deterministic=deterministic) + electronic_graph = self.electronic.fst + + self.measure = MeasureFst( + cardinal=self.cardinal, + decimal=self.decimal, + deterministic=deterministic, + ) + measure_graph = self.measure.fst + + self.money = MoneyFst( + cardinal=self.cardinal, + decimal=self.decimal, + deterministic=deterministic, + ) + money_graph = self.money.fst + + self.time = TimeFst(deterministic=deterministic) + time_graph = self.time.fst + + punct_graph = PunctuationFst(deterministic=deterministic).fst + + classify = ( + pynutil.add_weight(whitelist_graph, 0.0) + | pynutil.add_weight(cardinal_graph, 1.1) + | pynutil.add_weight(decimal_graph, 1.1) + | pynutil.add_weight(electronic_graph, 1.1) + | pynutil.add_weight(measure_graph, 1.1) + | pynutil.add_weight(money_graph, 1.1) + | pynutil.add_weight(time_graph, 1.1) + | pynutil.add_weight(word_graph, 100) + ) + + punct = pynutil.insert("tokens { ") + pynutil.add_weight(punct_graph, weight=1.1) + pynutil.insert(" }") + + token = pynutil.insert("tokens { ") + classify + pynutil.insert(" }") + token_plus_punct = ( + pynini.closure(punct + pynutil.insert(" ")) + token + pynini.closure(pynutil.insert(" ") + punct) + ) + + graph = token_plus_punct + pynini.closure((delete_extra_space).ques + token_plus_punct) + + graph = delete_space + graph + delete_space + + self.fst = graph.optimize() + no_digits = pynini.closure(pynini.difference(NEMO_CHAR, NEMO_DIGIT)) + self.fst_no_digits = pynini.compose(self.fst, no_digits).optimize() + + if far_file: + generator_main(far_file, {"tokenize_and_classify": self.fst}) diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/it/taggers/whitelist.py b/zonos3/vendor/nemo_text_processing/text_normalization/it/taggers/whitelist.py new file mode 100644 index 0000000000000000000000000000000000000000..1104d6ff400d6d43cc79f7db52b2098f6c401b17 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/it/taggers/whitelist.py @@ -0,0 +1,65 @@ +# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import GraphFst, convert_space +from zonos3.vendor.nemo_text_processing.text_normalization.it.utils import get_abs_path, load_labels + + +class WhiteListFst(GraphFst): + """ + Finite state transducer for classifying whitelist, e.g. + "dr." -> tokens { name: "dottor" } + "Avv." -> tokens { name: "avvocato" } + This class has highest priority among all classifier grammars. Whitelisted tokens are defined and loaded from "data/whitelist.tsv". + + Args: + input_case: accepting either "lower_cased" or "cased" input. + deterministic: if True will provide a single transduction option, + for False multiple options (used for audio-based normalization) + input_file: path to a file with whitelist replacements + """ + + def __init__(self, input_case: str, deterministic: bool = True, input_file: str = None): + super().__init__(name="whitelist", kind="classify", deterministic=deterministic) + + def _get_whitelist_graph(input_case, file): + whitelist = load_labels(file) + if input_case == "lower_cased": + whitelist = [[x[0].lower()] + x[1:] for x in whitelist] + graph = pynini.string_map(whitelist) + return graph + + graph = _get_whitelist_graph(input_case, get_abs_path("data/whitelist/whitelist.tsv")) + if not deterministic and input_case != "lower_cased": + graph |= pynutil.add_weight( + _get_whitelist_graph("lower_cased", get_abs_path("data/whitelist/whitelist.tsv")), weight=0.0001 + ) + + if input_file: + whitelist_provided = _get_whitelist_graph(input_case, input_file) + if not deterministic: + graph |= whitelist_provided + else: + graph = whitelist_provided + + if not deterministic: + units_graph = _get_whitelist_graph(input_case, file=get_abs_path("data/measure/measurements.tsv")) + graph |= units_graph + + self.graph = graph + self.final_graph = convert_space(self.graph).optimize() + self.fst = (pynutil.insert("name: \"") + self.final_graph + pynutil.insert("\"")).optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/it/taggers/word.py b/zonos3/vendor/nemo_text_processing/text_normalization/it/taggers/word.py new file mode 100644 index 0000000000000000000000000000000000000000..5f0e019a8ad5746920d52e3c166c5be319a1c16f --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/it/taggers/word.py @@ -0,0 +1,34 @@ +# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import NEMO_NOT_SPACE, GraphFst + + +class WordFst(GraphFst): + """ + Finite state transducer for classifying word. + e.g. mangiare -> tokens { name: "mangiare" } + + Args: + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="word", kind="classify") + word = pynutil.insert("name: \"") + pynini.closure(NEMO_NOT_SPACE, 1) + pynutil.insert("\"") + self.fst = word.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/it/utils.py b/zonos3/vendor/nemo_text_processing/text_normalization/it/utils.py new file mode 100644 index 0000000000000000000000000000000000000000..be8bdb5addc0c542fe49d252e1a4240c5d61037f --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/it/utils.py @@ -0,0 +1,42 @@ +# Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import csv +import os + + +def get_abs_path(rel_path): + """ + Get absolute path + + Args: + rel_path: relative path to this file + + Returns absolute path + """ + return os.path.dirname(os.path.abspath(__file__)) + '/' + rel_path + + +def load_labels(abs_path): + """ + loads relative path file as dictionary + + Args: + abs_path: absolute path + + Returns dictionary of mappings + """ + with open(abs_path, encoding="utf-8") as label_tsv: + labels = list(csv.reader(label_tsv, delimiter="\t")) + return labels diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/it/verbalizers/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/it/verbalizers/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..6ebc808fad7ac87484dbabf02dacacdd7f826c14 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/it/verbalizers/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/it/verbalizers/cardinal.py b/zonos3/vendor/nemo_text_processing/text_normalization/it/verbalizers/cardinal.py new file mode 100644 index 0000000000000000000000000000000000000000..3ef5246753cf3fe5a947cfc4afd711dea7aa8d6e --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/it/verbalizers/cardinal.py @@ -0,0 +1,43 @@ +# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import NEMO_NOT_QUOTE, GraphFst + + +class CardinalFst(GraphFst): + """ + Finite state transducer for verbalizing cardinals + e.g. cardinal { integer: "due" } -> "due" + Args: + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="cardinal", kind="verbalize", deterministic=deterministic) + optional_sign = pynini.closure(pynini.cross("negative: \"true\" ", "meno "), 0, 1) + self.optional_sign = optional_sign + integer = pynini.closure(NEMO_NOT_QUOTE, 1) + + self.integer = pynutil.delete(" \"") + integer + pynutil.delete("\"") + + integer = pynutil.delete("integer:") + self.integer + self.numbers = integer + graph = optional_sign + self.numbers + + delete_tokens = self.delete_tokens(graph) + self.fst = delete_tokens.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/it/verbalizers/decimal.py b/zonos3/vendor/nemo_text_processing/text_normalization/it/verbalizers/decimal.py new file mode 100644 index 0000000000000000000000000000000000000000..e883487196ae68619d7437dc8a7b966a90e337b5 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/it/verbalizers/decimal.py @@ -0,0 +1,76 @@ +# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import ( + NEMO_NOT_QUOTE, + GraphFst, + delete_preserve_order, + delete_space, + insert_space, +) + + +class DecimalFst(GraphFst): + """ + Finite state transducer for classifying decimal, e.g. + decimal { negative: "true" integer_part: "venti" fractional_part: "trentaquattro" quantity: "miliardi" } -> + meno venti virgola trentaquattro + decimal { integer_part: "un milione" fractional_part: "zero zero zero" quantity: "milioni" preserve_order: true } --> + un milione virgola zero zero zero + decimal { integer_part: "due" quantity: "milioni" preserve_order: true } --> + due milioni + + Args: + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="decimal", kind="classify", deterministic=deterministic) + + optional_sign = pynini.closure(pynini.cross("negative: \"true\"", "meno ") + delete_space, 0, 1) + integer = pynutil.delete("integer_part: \"") + pynini.closure(NEMO_NOT_QUOTE, 1) + pynutil.delete("\"") + fractional_default = ( + pynutil.delete("fractional_part: \"") + pynini.closure(NEMO_NOT_QUOTE, 1) + pynutil.delete("\"") + ) + + conjunction = pynutil.insert(" virgola ") + fractional = conjunction + fractional_default + + quantity = ( + delete_space + + insert_space + + pynutil.delete("quantity: \"") + + pynini.closure(NEMO_NOT_QUOTE, 1) + + pynutil.delete("\"") + ) + optional_quantity = pynini.closure(quantity, 0, 1) + + graph = optional_sign + pynini.union( + (integer + quantity), (integer + delete_space + fractional + optional_quantity) + ) + + self.numbers_only_quantity = ( + optional_sign + + pynini.union((integer + quantity), (integer + delete_space + fractional + quantity)).optimize() + ) + + self.graph = (graph + delete_preserve_order).optimize() + + graph += delete_preserve_order + delete_tokens = self.delete_tokens(graph) + self.fst = delete_tokens.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/it/verbalizers/electronic.py b/zonos3/vendor/nemo_text_processing/text_normalization/it/verbalizers/electronic.py new file mode 100644 index 0000000000000000000000000000000000000000..4dc9ab2f6d2359e6cb773e7b03bcfff2f9b447b9 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/it/verbalizers/electronic.py @@ -0,0 +1,88 @@ +# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import ( # Common string literals; expand as you see fit. + NEMO_NOT_QUOTE, + NEMO_SIGMA, + NEMO_SPACE, + GraphFst, + colon, + delete_preserve_order, + domain_string, + double_quotes, + protocol_string, + username_string, +) +from zonos3.vendor.nemo_text_processing.text_normalization.it.utils import get_abs_path + +digit_no_zero = pynini.invert(pynini.string_file(get_abs_path("data/numbers/digit.tsv"))) +zero = pynini.invert(pynini.string_file(get_abs_path("data/numbers/zero.tsv"))) + +graph_symbols = pynini.string_file(get_abs_path("data/electronic/symbols.tsv")) +server_common = pynini.string_file(get_abs_path("data/electronic/server_name.tsv")) +domain_common = pynini.string_file(get_abs_path("data/electronic/domain.tsv")) + + +class ElectronicFst(GraphFst): + """ + Finite state transducer for verbalizing electronic + e.g. electronic { username: "abc.def2" domain: "studenti.università.it" } -> + "a b c punto d e f due chiocciola s t u d e n t i punto u n i v e r s i t à punto IT + Args: + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="electronic", kind="verbalize", deterministic=deterministic) + + graph_digit = digit_no_zero | zero + + def add_space_after_char(): + return pynini.closure(NEMO_NOT_QUOTE - pynini.accep(NEMO_SPACE) + pynutil.insert(NEMO_SPACE)) + ( + NEMO_NOT_QUOTE - pynini.accep(NEMO_SPACE) + ) + + verbalize_characters = pynini.cdrewrite(graph_symbols | graph_digit, "", "", NEMO_SIGMA) + + user_name = ( + pynutil.delete(username_string + colon + NEMO_SPACE + double_quotes) + + add_space_after_char() + + pynutil.delete(double_quotes) + ) + user_name @= verbalize_characters + + convert_defaults = pynutil.add_weight(NEMO_NOT_QUOTE, weight=0.0001) | server_common | domain_common + domain = convert_defaults + pynini.closure(pynutil.insert(NEMO_SPACE) + convert_defaults) + domain @= verbalize_characters + + domain = ( + pynutil.delete(domain_string + colon + NEMO_SPACE + double_quotes) + domain + pynutil.delete(double_quotes) + ) + protocol = ( + pynutil.delete(protocol_string + colon + NEMO_SPACE + double_quotes) + + add_space_after_char() @ pynini.cdrewrite(graph_symbols, "", "", NEMO_SIGMA) + + pynutil.delete(double_quotes) + ) + + self.graph = (pynini.closure(protocol + NEMO_SPACE, 0, 1) + domain) | ( + user_name + NEMO_SPACE + pynutil.insert("chiocciola ") + domain + | (pynutil.insert("chiocciola ") + user_name) + ) + + delete_tokens = self.delete_tokens(self.graph + delete_preserve_order) + self.fst = delete_tokens.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/it/verbalizers/measure.py b/zonos3/vendor/nemo_text_processing/text_normalization/it/verbalizers/measure.py new file mode 100644 index 0000000000000000000000000000000000000000..5fa4ec0ef109bfa7ab8a2f8d2ae447bc04bc5f41 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/it/verbalizers/measure.py @@ -0,0 +1,52 @@ +# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import ( + NEMO_NOT_QUOTE, + GraphFst, + delete_extra_space, + delete_preserve_order, +) + + +class MeasureFst(GraphFst): + """ + Finite state transducer for verbalizing measure, e.g. + measure { cardinal { integer: "due" units: "grammi" } } -> "due grammi" + + Args: + decimal: decimal GraphFst + cardinal: cardinal GraphFst + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, decimal: GraphFst, cardinal: GraphFst, deterministic: bool): + super().__init__(name="measure", kind="verbalize", deterministic=deterministic) + + unit = pynutil.delete("units: \"") + pynini.closure(NEMO_NOT_QUOTE) + pynutil.delete("\"") + + graph_decimal = decimal.fst + graph_cardinal = cardinal.fst + + graph = (graph_cardinal | graph_decimal) + pynini.accep(" ") + unit + + graph |= unit + delete_extra_space + (graph_cardinal | graph_decimal) + graph += delete_preserve_order + + delete_tokens = self.delete_tokens(graph) + self.fst = delete_tokens.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/it/verbalizers/money.py b/zonos3/vendor/nemo_text_processing/text_normalization/it/verbalizers/money.py new file mode 100644 index 0000000000000000000000000000000000000000..ddada7e28604e72043fca15038eb53c29a53ce98 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/it/verbalizers/money.py @@ -0,0 +1,160 @@ +# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import ( + NEMO_NOT_QUOTE, + NEMO_SIGMA, + NEMO_SPACE, + GraphFst, + delete_preserve_order, +) +from zonos3.vendor.nemo_text_processing.text_normalization.es.graph_utils import shift_cardinal_gender, strip_cardinal_apocope +from zonos3.vendor.nemo_text_processing.text_normalization.it.utils import get_abs_path + +fem = pynini.string_file((get_abs_path("data/money/currency_plural_fem.tsv"))) +masc = pynini.string_file((get_abs_path("data/money/currency_plural_masc.tsv"))) + +fem_singular = pynini.project(fem, "input") +masc_singular = pynini.project(masc, "input") + +fem_plural = pynini.project(fem, "output") +masc_plural = pynini.project(masc, "output") + + +class MoneyFst(GraphFst): + """ + Finite state transducer for verbalizing money, e.g. + money { currency_maj: "euro" integer_part: "un"} -> "un euro" + money { integer_part: "quattro" currency_maj: "sterline" fractional_part: "venti" currency_min: "penny" preserve_order: true } -> "quattro sterline venti penny" + + Args: + decimal: GraphFst + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, decimal: GraphFst, deterministic: bool = True): + super().__init__(name="money", kind="verbalize", deterministic=deterministic) + + maj_singular_masc = ( + pynutil.delete("currency_maj: \"") + + (pynini.closure(NEMO_NOT_QUOTE, 1) @ masc_singular) + + pynutil.delete("\"") + ) + maj_singular_fem = ( + pynutil.delete("currency_maj: \"") + + (pynini.closure(NEMO_NOT_QUOTE, 1) @ fem_singular) + + pynutil.delete("\"") + ) + + maj_plural_masc = ( + pynutil.delete("currency_maj: \"") + + (pynini.closure(NEMO_NOT_QUOTE, 1) @ masc_plural) + + pynutil.delete("\"") + ) + maj_plural_fem = ( + pynutil.delete("currency_maj: \"") + + (pynini.closure(NEMO_NOT_QUOTE, 1) @ fem_plural) + + pynutil.delete("\"") + ) + + maj_masc = maj_plural_masc | maj_singular_masc + maj_fem = maj_plural_fem | maj_singular_fem + + min_singular_masc = ( + pynutil.delete("currency_min: \"") + + (pynini.closure(NEMO_NOT_QUOTE, 1) @ masc_singular) + + pynutil.delete("\"") + ) + min_singular_fem = ( + pynutil.delete("currency_min: \"") + + (pynini.closure(NEMO_NOT_QUOTE, 1) @ fem_singular) + + pynutil.delete("\"") + ) + + min_plural_masc = ( + pynutil.delete("currency_min: \"") + + (pynini.closure(NEMO_NOT_QUOTE, 1) @ masc_plural) + + pynutil.delete("\"") + ) + min_plural_fem = ( + pynutil.delete("currency_min: \"") + + (pynini.closure(NEMO_NOT_QUOTE, 1) @ fem_plural) + + pynutil.delete("\"") + ) + + min_masc = min_plural_masc | min_singular_masc + min_fem = min_plural_fem | min_singular_fem + + fractional_part = ( + pynutil.delete("fractional_part: \"") + pynini.closure(NEMO_NOT_QUOTE, 1) + pynutil.delete("\"") + ) + + integer_part = pynutil.delete("integer_part: \"") + pynini.closure(NEMO_NOT_QUOTE, 1) + pynutil.delete("\"") + optional_add_and = pynini.closure(pynutil.insert(pynini.union("con ", "y ")), 0, 1) + + graph_integer_masc = integer_part + NEMO_SPACE + maj_masc + graph_integer_fem = shift_cardinal_gender(integer_part) + NEMO_SPACE + maj_fem + + graph_integer = graph_integer_fem | graph_integer_masc + + graph_integer_with_minor_masc = ( + graph_integer_masc + + NEMO_SPACE + + pynini.union( + optional_add_and + strip_cardinal_apocope(fractional_part), + (optional_add_and + fractional_part + NEMO_SPACE + min_masc), + (optional_add_and + shift_cardinal_gender(fractional_part) + NEMO_SPACE + min_fem), + ) + + delete_preserve_order + ) + + graph_integer_with_minor_fem = ( + graph_integer_fem + + NEMO_SPACE + + pynini.union( + optional_add_and + shift_cardinal_gender(fractional_part), + (optional_add_and + fractional_part + NEMO_SPACE + min_masc), + (optional_add_and + shift_cardinal_gender(fractional_part) + NEMO_SPACE + min_fem), + ) + + delete_preserve_order + ) + + graph_integer_with_minor = graph_integer_with_minor_fem | graph_integer_with_minor_masc + + graph_decimal_masc = decimal.graph + NEMO_SPACE + maj_masc + + graph_decimal_fem = decimal.graph + graph_decimal_fem += NEMO_SPACE + maj_fem + + graph_decimal = graph_decimal_fem | graph_decimal_masc + graph_decimal = ( + pynini.cdrewrite( + pynutil.insert(" di"), "quantity: \"" + pynini.closure(NEMO_NOT_QUOTE, 1), "\"", NEMO_SIGMA + ) + @ graph_decimal + ) + + graph_minor_masc = fractional_part + NEMO_SPACE + min_masc + delete_preserve_order + graph_minor_fem = shift_cardinal_gender(fractional_part) + NEMO_SPACE + min_fem + delete_preserve_order + + graph_minor = graph_minor_fem | graph_minor_masc + + graph = graph_integer | graph_integer_with_minor | graph_decimal | graph_minor + + delete_tokens = self.delete_tokens(graph) + self.fst = delete_tokens.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/it/verbalizers/time.py b/zonos3/vendor/nemo_text_processing/text_normalization/it/verbalizers/time.py new file mode 100644 index 0000000000000000000000000000000000000000..3fe32466be2c984d9f073b8116b738dd5d5adf64 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/it/verbalizers/time.py @@ -0,0 +1,85 @@ +# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import NEMO_DIGIT, GraphFst, delete_preserve_order +from zonos3.vendor.nemo_text_processing.text_normalization.it.utils import get_abs_path + + +class TimeFst(GraphFst): + """ + Finite state transducer for verbalizing time, e.g. + tokens { time { hours: "15" minutes: "30" seconds: "30" preserve_order: true } } -> quindici e mezza trenta secondi + tokens { time { hours: "12" minutes: "15" } } -> dodici e un quarto + tokens { time { hours: "3" minutes: "38" } } -> tre e trentotto minuti + Args: + cardinal_tagger: cardinal_tagger tagger GraphFst + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, cardinal_tagger: GraphFst, deterministic: bool = True): + super().__init__(name="time", kind="verbalize", deterministic=deterministic) + + graph_zero = pynini.invert(pynini.string_file(get_abs_path("data/numbers/zero.tsv"))).optimize() + number_verbalization = graph_zero | cardinal_tagger.two_digit_no_zero + hour = pynutil.delete("hours: \"") + pynini.closure(NEMO_DIGIT, 1) + pynutil.delete("\"") + hour_verbalized = hour @ number_verbalization + minute = pynutil.delete("minutes: \"") + pynini.closure(NEMO_DIGIT, 1) + pynutil.delete("\"") + second = pynutil.delete("seconds: \"") + pynini.closure(NEMO_DIGIT, 1) + pynutil.delete("\"") + + graph_hms_15 = ( + hour_verbalized + + pynini.accep(" ") + + pynutil.insert("e ") + + (minute @ number_verbalization + pynutil.insert(" minuti") | minute @ pynini.cross("15", "un quarto")) + + pynini.accep(" ") + + pynutil.insert("e ") + + second @ number_verbalization + + pynutil.insert(" secondi") + ) + + graph_hms_30 = ( + hour_verbalized + + pynini.accep(" ") + + pynutil.insert("e ") + + (minute @ number_verbalization + pynutil.insert(" minuti") | minute @ pynini.cross("30", " mezza")) + + pynini.accep(" ") + + pynutil.insert("e ") + + second @ number_verbalization + + pynutil.insert(" secondi") + ) + + graph_hm_15 = ( + hour_verbalized + + pynini.accep(" ") + + pynutil.insert("e ") + + (minute @ number_verbalization + pynutil.insert(" minuti") | minute @ pynini.cross("15", "un quarto")) + ) + + graph_hm_30 = ( + hour_verbalized + + pynini.accep(" ") + + pynutil.insert("e ") + + (minute @ number_verbalization + pynutil.insert(" minuti") | minute @ pynini.cross("30", " mezza")) + ) + + graph_h = hour_verbalized + + self.graph = graph_hms_30 | graph_hms_30 | graph_hms_15 | graph_hm_30 | graph_hm_15 | graph_h + + delete_tokens = self.delete_tokens(self.graph + delete_preserve_order) + self.fst = delete_tokens.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/it/verbalizers/verbalize.py b/zonos3/vendor/nemo_text_processing/text_normalization/it/verbalizers/verbalize.py new file mode 100644 index 0000000000000000000000000000000000000000..f37e9a248a78583bc6bf37f99c8b742414fc6e41 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/it/verbalizers/verbalize.py @@ -0,0 +1,63 @@ +# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import GraphFst +from zonos3.vendor.nemo_text_processing.text_normalization.en.verbalizers.whitelist import WhiteListFst +from zonos3.vendor.nemo_text_processing.text_normalization.it.taggers.cardinal import CardinalFst as CardinalTagger +from zonos3.vendor.nemo_text_processing.text_normalization.it.verbalizers.cardinal import CardinalFst +from zonos3.vendor.nemo_text_processing.text_normalization.it.verbalizers.decimal import DecimalFst +from zonos3.vendor.nemo_text_processing.text_normalization.it.verbalizers.electronic import ElectronicFst +from zonos3.vendor.nemo_text_processing.text_normalization.it.verbalizers.measure import MeasureFst +from zonos3.vendor.nemo_text_processing.text_normalization.it.verbalizers.money import MoneyFst +from zonos3.vendor.nemo_text_processing.text_normalization.it.verbalizers.time import TimeFst + + +class VerbalizeFst(GraphFst): + """ + Composes other verbalizer grammars. + For deployment, this grammar will be compiled and exported to OpenFst Finite State Archive (FAR) File. + More details to deployment at NeMo/tools/text_processing_deployment. + Args: + deterministic: if True will provide a single transduction option, + for False multiple options (used for audio-based normalization) + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="verbalize", kind="verbalize", deterministic=deterministic) + cardinal = CardinalFst(deterministic=deterministic) + cardinal_graph = cardinal.fst + decimal = DecimalFst(deterministic=deterministic) + decimal_graph = decimal.fst + electronic = ElectronicFst(deterministic=deterministic) + electronic_graph = electronic.fst + whitelist_graph = WhiteListFst(deterministic=deterministic).fst + measure = MeasureFst(cardinal=cardinal, decimal=decimal, deterministic=deterministic) + measure_graph = measure.fst + money = MoneyFst(decimal=decimal, deterministic=deterministic) + money_graph = money.fst + cardinal_tagger = CardinalTagger(deterministic=deterministic) + time = TimeFst(cardinal_tagger=cardinal_tagger, deterministic=deterministic) + time_graph = time.fst + + graph = ( + cardinal_graph + | decimal_graph + | electronic_graph + | whitelist_graph + | measure_graph + | money_graph + | time_graph + ) + + self.fst = graph diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/it/verbalizers/verbalize_final.py b/zonos3/vendor/nemo_text_processing/text_normalization/it/verbalizers/verbalize_final.py new file mode 100644 index 0000000000000000000000000000000000000000..5ea847a820f0af89fa73a2ce08f2b699ad9cdcd6 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/it/verbalizers/verbalize_final.py @@ -0,0 +1,70 @@ +# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import os + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import ( + GraphFst, + delete_extra_space, + delete_space, + generator_main, +) +from zonos3.vendor.nemo_text_processing.text_normalization.en.verbalizers.word import WordFst +from zonos3.vendor.nemo_text_processing.text_normalization.it.verbalizers.verbalize import VerbalizeFst +from zonos3.vendor.nemo_text_processing.utils.logging import logger + + +class VerbalizeFinalFst(GraphFst): + """ + Finite state transducer that verbalizes an entire sentence + + Args: + deterministic: if True will provide a single transduction option, + for False multiple options (used for audio-based normalization) + cache_dir: path to a dir with .far grammar file. Set to None to avoid using cache. + overwrite_cache: set to True to overwrite .far files + """ + + def __init__(self, deterministic: bool = True, cache_dir: str = None, overwrite_cache: bool = False): + super().__init__(name="verbalize_final", kind="verbalize", deterministic=deterministic) + + far_file = None + if cache_dir is not None and cache_dir != "None": + os.makedirs(cache_dir, exist_ok=True) + far_file = os.path.join(cache_dir, f"it_tn_{deterministic}_deterministic_verbalizer.far") + if not overwrite_cache and far_file and os.path.exists(far_file): + self.fst = pynini.Far(far_file, mode="r")["verbalize"] + logger.info(f'VerbalizeFinalFst graph was restored from {far_file}.') + else: + + verbalize = VerbalizeFst(deterministic=deterministic).fst + word = WordFst(deterministic=deterministic).fst + types = verbalize | word + graph = ( + pynutil.delete("tokens") + + delete_space + + pynutil.delete("{") + + delete_space + + types + + delete_space + + pynutil.delete("}") + ) + graph = delete_space + pynini.closure(graph + delete_extra_space) + graph + delete_space + + self.fst = graph.optimize() + if far_file: + generator_main(far_file, {"verbalize": self.fst}) diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ja/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/ja/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..571e528f9274e0e9012092509a1918c9e4cf5948 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ja/__init__.py @@ -0,0 +1,18 @@ +# Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from zonos3.vendor.nemo_text_processing.text_normalization.ja.taggers.tokenize_and_classify import ClassifyFst +from zonos3.vendor.nemo_text_processing.text_normalization.ja.verbalizers.verbalize import VerbalizeFst +from zonos3.vendor.nemo_text_processing.text_normalization.ja.verbalizers.verbalize_final import VerbalizeFinalFst diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ja/data/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/ja/data/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..d9155f923f186a086a69de138e984e2fab2817ec --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ja/data/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ja/data/date/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/ja/data/date/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..d9155f923f186a086a69de138e984e2fab2817ec --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ja/data/date/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ja/data/date/day.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/ja/data/date/day.tsv new file mode 100644 index 0000000000000000000000000000000000000000..09258cb4c8d742834f6d7994580e16d863fe2783 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ja/data/date/day.tsv @@ -0,0 +1,31 @@ +1 一 +2 二 +3 三 +4 四 +5 五 +6 六 +7 七 +8 八 +9 九 +10 十 +11 十一 +12 十二 +13 十三 +14 十四 +15 十五 +16 十六 +17 十七 +18 十八 +19 十九 +20 二十 +21 二十一 +22 二十二 +23 二十三 +24 二十四 +25 二十五 +26 二十六 +27 二十七 +28 二十八 +29 二十九 +30 三十 +31 三十一 \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ja/data/date/era.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/ja/data/date/era.tsv new file mode 100644 index 0000000000000000000000000000000000000000..b932b7fb3fae11c5ef32e39ed90739d3b136ff86 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ja/data/date/era.tsv @@ -0,0 +1,12 @@ +令和 +平成 +昭和 +大正 +明治 +西暦 +和暦 +西洋暦 +グレゴリオ暦 +紀元前 +紀元 +紀元後 \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ja/data/date/era_abbrev.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/ja/data/date/era_abbrev.tsv new file mode 100644 index 0000000000000000000000000000000000000000..1c95675c27ddf66508601e68834ccf48e463a3f9 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ja/data/date/era_abbrev.tsv @@ -0,0 +1,5 @@ +R. 令和 +H. 平成 +S. 昭和 +T. 大正 +M. 明治 \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ja/data/date/month.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/ja/data/date/month.tsv new file mode 100644 index 0000000000000000000000000000000000000000..f992b4d28d2509cd2b4822ac28690259d64917f8 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ja/data/date/month.tsv @@ -0,0 +1,12 @@ +1 一 +2 二 +3 三 +4 四 +5 五 +6 六 +7 七 +8 八 +9 九 +10 十 +11 十一 +12 十二 \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ja/data/date/week.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/ja/data/date/week.tsv new file mode 100644 index 0000000000000000000000000000000000000000..41556b4db2f74a429f6e571e46450f57dddbb868 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ja/data/date/week.tsv @@ -0,0 +1,15 @@ +月 月曜日 +火 火曜日 +水 水曜日 +木 木曜日 +金 金曜日 +土 土曜日 +日 日曜日 +祝 祝日 +月曜日 +火曜日 +水曜日 +木曜日 +金曜日 +土曜日 +日曜日 \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ja/data/numbers/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/ja/data/numbers/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..d9155f923f186a086a69de138e984e2fab2817ec --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ja/data/numbers/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ja/data/numbers/digit.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/ja/data/numbers/digit.tsv new file mode 100644 index 0000000000000000000000000000000000000000..ede6b97b73ae912917667f3a00a9efb71580bee3 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ja/data/numbers/digit.tsv @@ -0,0 +1,9 @@ +1 一 +2 二 +3 三 +4 四 +5 五 +6 六 +7 七 +8 八 +9 九 \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ja/data/numbers/teen.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/ja/data/numbers/teen.tsv new file mode 100644 index 0000000000000000000000000000000000000000..1585fe836701348ae4543e3001c2a10151d750f2 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ja/data/numbers/teen.tsv @@ -0,0 +1,10 @@ +10 十 +11 十一 +12 十二 +13 十三 +14 十四 +15 十五 +16 十六 +17 十七 +18 十八 +19 十九 \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ja/data/numbers/ties.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/ja/data/numbers/ties.tsv new file mode 100644 index 0000000000000000000000000000000000000000..562e632656a6b6fd752296d2a30e419206052bf5 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ja/data/numbers/ties.tsv @@ -0,0 +1,8 @@ +2 二十 +3 三十 +4 四十 +5 五十 +6 六十 +7 七十 +8 八十 +9 九十 \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ja/data/numbers/zero.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/ja/data/numbers/zero.tsv new file mode 100644 index 0000000000000000000000000000000000000000..7fab21718dad9ed8089512e9d513cab84074dfc2 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ja/data/numbers/zero.tsv @@ -0,0 +1 @@ +0 零 \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ja/data/symbol.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/ja/data/symbol.tsv new file mode 100644 index 0000000000000000000000000000000000000000..67ad785f0e2e9e4eec5c13063a884f10e8904160 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ja/data/symbol.tsv @@ -0,0 +1,23 @@ +& アンド +# ハッシュタグ +@ アット +§ セクション +™ トレードマーク +® 登録商標マーク +© 著作権 +_ アンダースコア +% パーセント +* 星印 ++ プラス +/ スラッシュ += エコール +^ 曲折アクセント記号 +| 縦棒 +~ ティルダ +$ ドール +£ ポンド +€ ユーロ +₩ ウォン +¥ 円 +° 度 +º 度 \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ja/data/time/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/ja/data/time/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..d9155f923f186a086a69de138e984e2fab2817ec --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ja/data/time/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ja/data/time/division.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/ja/data/time/division.tsv new file mode 100644 index 0000000000000000000000000000000000000000..f6beedce80aec13a68e584811154d73bd47609e1 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ja/data/time/division.tsv @@ -0,0 +1,23 @@ +今朝 +今夜 +今晩 +午前 +午後 +夕方 +夜中 +夜 +夜半 +朝 +早朝 +明け方 +昼 +深夜 +毎朝 +毎夜 +毎晩 +毎日 +真夜中 +翌日 +未明 +正午 +真夜中の \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ja/data/time/hour.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/ja/data/time/hour.tsv new file mode 100644 index 0000000000000000000000000000000000000000..1d5c084253396e5d4183fa198f14241fcc175a95 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ja/data/time/hour.tsv @@ -0,0 +1,24 @@ +1 一 +2 二 +3 三 +4 四 +5 五 +6 六 +7 七 +8 八 +9 九 +10 十 +11 十一 +12 十二 +13 十三 +14 十四 +15 十五 +16 十六 +17 十七 +18 十八 +19 十九 +20 二十 +21 二十一 +22 二十二 +23 二十三 +24 二十四 \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ja/data/time/minute.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/ja/data/time/minute.tsv new file mode 100644 index 0000000000000000000000000000000000000000..5e8276a00502b43948252b6a5af495e33d580e2f --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ja/data/time/minute.tsv @@ -0,0 +1,60 @@ +1 一 +2 二 +3 三 +4 四 +5 五 +6 六 +7 七 +8 八 +9 九 +10 十 +11 十一 +12 十二 +13 十三 +14 十四 +15 十五 +16 十六 +17 十七 +18 十八 +19 十九 +20 二十 +21 二十一 +22 二十二 +23 二十三 +24 二十四 +25 二十五 +26 二十六 +27 二十七 +28 二十八 +29 二十九 +30 三十 +31 三十一 +32 三十二 +33 三十三 +34 三十四 +35 三十五 +36 三十六 +37 三十七 +38 三十八 +39 三十九 +40 四十 +41 四十一 +42 四十二 +43 四十三 +44 四十四 +45 四十五 +46 四十六 +47 四十七 +48 四十八 +49 四十九 +50 五十 +51 五十一 +52 五十二 +53 五十三 +54 五十四 +55 五十五 +56 五十六 +57 五十七 +58 五十八 +59 五十九 +60 六十 \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ja/data/time/second.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/ja/data/time/second.tsv new file mode 100644 index 0000000000000000000000000000000000000000..5e8276a00502b43948252b6a5af495e33d580e2f --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ja/data/time/second.tsv @@ -0,0 +1,60 @@ +1 一 +2 二 +3 三 +4 四 +5 五 +6 六 +7 七 +8 八 +9 九 +10 十 +11 十一 +12 十二 +13 十三 +14 十四 +15 十五 +16 十六 +17 十七 +18 十八 +19 十九 +20 二十 +21 二十一 +22 二十二 +23 二十三 +24 二十四 +25 二十五 +26 二十六 +27 二十七 +28 二十八 +29 二十九 +30 三十 +31 三十一 +32 三十二 +33 三十三 +34 三十四 +35 三十五 +36 三十六 +37 三十七 +38 三十八 +39 三十九 +40 四十 +41 四十一 +42 四十二 +43 四十三 +44 四十四 +45 四十五 +46 四十六 +47 四十七 +48 四十八 +49 四十九 +50 五十 +51 五十一 +52 五十二 +53 五十三 +54 五十四 +55 五十五 +56 五十六 +57 五十七 +58 五十八 +59 五十九 +60 六十 \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ja/data/whitelist.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/ja/data/whitelist.tsv new file mode 100644 index 0000000000000000000000000000000000000000..d0d7bef709e55ad4823f9b8b8d9ef9ababbc610d --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ja/data/whitelist.tsv @@ -0,0 +1,40 @@ +Dr. ドクター +dr. ドクター +Mr. ミスター +mr. ミスター +Ms. ミス +ms. ミス +Mrs. ミシーズ +mrs. ミシーず +st. ストリード +St. ストリード +mt. マウント +Mt. マウント +Prof. プロフェッサー +prof. プロフェッサー +sr. シニア +Sr. シニア +jr. ジュニア +Jr. ジュニア +rd. ロード +Rd. ロード +Ave. アベニュー +ave. アベニュー +no. ナンバー +No. ナンバー +( カッコ +) カッコ閉じる ++ プラス +- マイナス +Σ シグマ +η エタ +κ カッパ +ω オメガ +σ シグマ +α アルフ +ν ヌー +δ デルタ +ι イオタ +vs. バーサス +Ph.D. p h d +etc. エトセトラ diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ja/graph_utils.py b/zonos3/vendor/nemo_text_processing/text_normalization/ja/graph_utils.py new file mode 100644 index 0000000000000000000000000000000000000000..7b14ce56150e237cd00a16a8e2b48dbe104f481c --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ja/graph_utils.py @@ -0,0 +1,297 @@ +# Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. +# Copyright 2015 and onwards Google, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import logging +import os +import string +from pathlib import Path +from typing import Dict + +import pynini +from pynini import Far +from pynini.examples import plurals +from pynini.export import export +from pynini.lib import byte, pynutil, utf8 + +from zonos3.vendor.nemo_text_processing.text_normalization.en.utils import get_abs_path, load_labels + +NEMO_CHAR = utf8.VALID_UTF8_CHAR + +NEMO_DIGIT = byte.DIGIT +NEMO_LOWER = pynini.union(*string.ascii_lowercase).optimize() +NEMO_UPPER = pynini.union(*string.ascii_uppercase).optimize() +NEMO_ALPHA = pynini.union(NEMO_LOWER, NEMO_UPPER).optimize() +NEMO_ALNUM = pynini.union(NEMO_DIGIT, NEMO_ALPHA).optimize() +NEMO_HEX = pynini.union(*string.hexdigits).optimize() +NEMO_NON_BREAKING_SPACE = u"\u00a0" +NEMO_NARROW_NON_BREAK_SPACE = u"\u202f" +NEMO_SPACE = " " +NEMO_WHITE_SPACE = pynini.union(" ", "\t", "\n", "\r", u"\u00a0").optimize() +NEMO_NOT_SPACE = pynini.difference(NEMO_CHAR, NEMO_WHITE_SPACE).optimize() +NEMO_NOT_QUOTE = pynini.difference(NEMO_CHAR, r'"').optimize() + +NEMO_PUNCT = pynini.union(*map(pynini.escape, string.punctuation)).optimize() +NEMO_GRAPH = pynini.union(NEMO_ALNUM, NEMO_PUNCT).optimize() + +NEMO_SIGMA = pynini.closure(NEMO_CHAR) +NEMO_LOWER_NOT_A = pynini.union( + "b", + "c", + "d", + "e", + "f", + "g", + "h", + "i", + "j", + "k", + "l", + "m", + "n", + "o", + "p", + "q", + "r", + "s", + "t", + "u", + "v", + "w", + "x", + "y", + "z", +).optimize() +NEMO_SPACES_AND_ALHPANUMERICS = pynini.closure( + NEMO_SIGMA + | pynini.closure(NEMO_SPACE) + | pynini.closure(NEMO_NON_BREAKING_SPACE) + | pynini.closure(NEMO_DIGIT) + | pynini.closure(NEMO_WHITE_SPACE) +).optimize() + +delete_space = pynutil.delete(pynini.closure(NEMO_WHITE_SPACE)) +delete_zero_or_one_space = pynutil.delete(pynini.closure(NEMO_WHITE_SPACE, 0, 1)) +insert_space = pynutil.insert(" ") +delete_extra_space = pynini.cross(pynini.closure(NEMO_WHITE_SPACE, 1), " ") +delete_preserve_order = pynini.closure( + pynutil.delete(" preserve_order: true") + | (pynutil.delete(" field_order: \"") + NEMO_NOT_QUOTE + pynutil.delete("\"")) +) + +suppletive = pynini.string_file(get_abs_path("data/suppletive.tsv")) +# _v = pynini.union("a", "e", "i", "o", "u") +_c = pynini.union( + "b", "c", "d", "f", "g", "h", "j", "k", "l", "m", "n", "p", "q", "r", "s", "t", "v", "w", "x", "y", "z" +) +_ies = NEMO_SIGMA + _c + pynini.cross("y", "ies") +_es = NEMO_SIGMA + pynini.union("s", "sh", "ch", "x", "z") + pynutil.insert("es") +_s = NEMO_SIGMA + pynutil.insert("s") + +graph_plural = plurals._priority_union( + suppletive, plurals._priority_union(_ies, plurals._priority_union(_es, _s, NEMO_SIGMA), NEMO_SIGMA), NEMO_SIGMA +).optimize() + +SINGULAR_TO_PLURAL = graph_plural +PLURAL_TO_SINGULAR = pynini.invert(graph_plural) +TO_LOWER = pynini.union(*[pynini.cross(x, y) for x, y in zip(string.ascii_uppercase, string.ascii_lowercase)]) +TO_UPPER = pynini.invert(TO_LOWER) +MIN_NEG_WEIGHT = -0.0001 +MIN_POS_WEIGHT = 0.0001 +INPUT_CASED = "cased" +INPUT_LOWER_CASED = "lower_cased" +MINUS = pynini.union("minus", "Minus").optimize() + + +def capitalized_input_graph( + graph: 'pynini.FstLike', original_graph_weight: float = None, capitalized_graph_weight: float = None +) -> 'pynini.FstLike': + """ + Allow graph input to be capitalized, e.g. for ITN) + + Args: + graph: FstGraph + original_graph_weight: weight to add to the original `graph` + capitalized_graph_weight: weight to add to the capitalized graph + """ + capitalized_graph = pynini.compose(TO_LOWER + NEMO_SIGMA, graph).optimize() + + if original_graph_weight is not None: + graph = pynutil.add_weight(graph, weight=original_graph_weight) + + if capitalized_graph_weight is not None: + capitalized_graph = pynutil.add_weight(capitalized_graph, weight=capitalized_graph_weight) + + graph |= capitalized_graph + return graph + + +def generator_main(file_name: str, graphs: Dict[str, 'pynini.FstLike']): + """ + Exports graph as OpenFst finite state archive (FAR) file with given file name and rule name. + + Args: + file_name: exported file name + graphs: Mapping of a rule name and Pynini WFST graph to be exported + """ + exporter = export.Exporter(file_name) + for rule, graph in graphs.items(): + exporter[rule] = graph.optimize() + exporter.close() + logging.info(f'Created {file_name}') + + +def get_plurals(fst): + """ + Given singular returns plurals + + Args: + fst: Fst + + Returns plurals to given singular forms + """ + return SINGULAR_TO_PLURAL @ fst + + +def get_singulars(fst): + """ + Given plural returns singulars + + Args: + fst: Fst + + Returns singulars to given plural forms + """ + return PLURAL_TO_SINGULAR @ fst + + +def convert_space(fst) -> 'pynini.FstLike': + """ + Converts space to nonbreaking space. + Used only in tagger grammars for transducing token values within quotes, e.g. name: "hello kitty" + This is making transducer significantly slower, so only use when there could be potential spaces within quotes, otherwise leave it. + + Args: + fst: input fst + + Returns output fst where breaking spaces are converted to non breaking spaces + """ + return fst @ pynini.cdrewrite(pynini.cross(NEMO_SPACE, NEMO_NON_BREAKING_SPACE), "", "", NEMO_SIGMA) + + +def string_map_cased(input_file: str, input_case: str = INPUT_LOWER_CASED): + labels = load_labels(input_file) + + if input_case == INPUT_CASED: + additional_labels = [] + for written, spoken, *weight in labels: + written_capitalized = written[0].upper() + written[1:] + additional_labels.extend( + [ + [written_capitalized, spoken.capitalize()], # first letter capitalized + [ + written_capitalized, + spoken.upper().replace(" AND ", " and "), + ], # # add pairs with the all letters capitalized + ] + ) + + spoken_no_space = spoken.replace(" ", "") + # add abbreviations without spaces (both lower and upper case), i.e. "BMW" not "B M W" + if len(spoken) == (2 * len(spoken_no_space) - 1): + logging.debug(f"This is weight {weight}") + if len(weight) == 0: + additional_labels.extend( + [[written, spoken_no_space], [written_capitalized, spoken_no_space.upper()]] + ) + else: + additional_labels.extend( + [ + [written, spoken_no_space, weight[0]], + [written_capitalized, spoken_no_space.upper(), weight[0]], + ] + ) + labels += additional_labels + + whitelist = pynini.string_map(labels).invert().optimize() + return whitelist + + +class GraphFst: + """ + Base class for all grammar fsts. + + Args: + name: name of grammar class + kind: either 'classify' or 'verbalize' + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, name: str, kind: str, deterministic: bool = True): + self.name = name + self.kind = kind + self._fst = None + self.deterministic = deterministic + + self.far_path = Path(os.path.dirname(__file__) + '/grammars/' + kind + '/' + name + '.far') + if self.far_exist(): + self._fst = Far(self.far_path, mode="r", arc_type="standard", far_type="default").get_fst() + + def far_exist(self) -> bool: + """ + Returns true if FAR can be loaded + """ + return self.far_path.exists() + + @property + def fst(self) -> 'pynini.FstLike': + return self._fst + + @fst.setter + def fst(self, fst): + self._fst = fst + + def add_tokens(self, fst) -> 'pynini.FstLike': + """ + Wraps class name around to given fst + + Args: + fst: input fst + + Returns: + Fst: fst + """ + return pynutil.insert(f"{self.name} {{ ") + fst + pynutil.insert(" }") + + def delete_tokens(self, fst) -> 'pynini.FstLike': + """ + Deletes class name wrap around output of given fst + + Args: + fst: input fst + + Returns: + Fst: fst + """ + res = ( + pynutil.delete(f"{self.name}") + + delete_space + + pynutil.delete("{") + + delete_space + + fst + + delete_space + + pynutil.delete("}") + ) + return res @ pynini.cdrewrite(pynini.cross(u"\u00a0", " "), "", "", NEMO_SIGMA) diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ja/taggers/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/ja/taggers/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..d9155f923f186a086a69de138e984e2fab2817ec --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ja/taggers/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ja/taggers/cardinal.py b/zonos3/vendor/nemo_text_processing/text_normalization/ja/taggers/cardinal.py new file mode 100644 index 0000000000000000000000000000000000000000..b531333b37018266b8723ce854a7930880ec1858 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ja/taggers/cardinal.py @@ -0,0 +1,191 @@ +# Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.ja.graph_utils import NEMO_DIGIT, GraphFst +from zonos3.vendor.nemo_text_processing.text_normalization.ja.utils import get_abs_path + + +class CardinalFst(GraphFst): + """ + Finite state transducer for classifying cardinals + e.g. 23 -> cardinal { integer: "二十三" } + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="cardinal", kind="classify", deterministic=deterministic) + + graph_zero = pynini.string_file(get_abs_path("data/numbers/zero.tsv")) + graph_digit = pynini.string_file(get_abs_path("data/numbers/digit.tsv")) + + no_one = pynini.difference(NEMO_DIGIT, "1") + no_zero_and_one = pynini.difference(no_one, "0") + + graph_digit_alt = no_zero_and_one @ graph_digit + graph_ties = pynini.string_file(get_abs_path("data/numbers/ties.tsv")) + graph_teen = pynini.string_file(get_abs_path("data/numbers/teen.tsv")) + + graph_all = (graph_ties + (graph_digit | pynutil.delete('0'))) | graph_teen | graph_digit + + hundreds = NEMO_DIGIT**3 + graph_hundred_component = (pynini.cross('1', '百') | (graph_digit_alt + pynutil.insert('百'))) + pynini.union( + pynini.closure(pynutil.delete('0')), (pynini.closure(pynutil.delete('0')) + graph_all) + ) + graph_hundred = hundreds @ graph_hundred_component + + thousands = NEMO_DIGIT**4 + graph_thousand_component = (pynini.cross('1', '千') | (graph_digit_alt + pynutil.insert('千'))) + pynini.union( + pynini.closure(pynutil.delete('0')), + graph_hundred_component, + (pynini.closure(pynutil.delete('0')) + graph_all), + ) + graph_thousand_component_alt = (graph_digit + pynutil.insert('千')) + pynini.union( + pynini.closure(pynutil.delete('0')), + graph_hundred_component, + (pynini.closure(pynutil.delete('0')) + graph_all), + ) + # this grammar is for larger number in later gramamr + graph_thousand = thousands @ graph_thousand_component + + ten_thousands = NEMO_DIGIT**5 + graph_ten_thousand_component = (graph_digit + pynutil.insert('万')) + pynini.union( + pynini.closure(pynutil.delete('0')), + graph_thousand_component, + (pynutil.delete('0') + graph_hundred_component), + (pynini.closure(pynutil.delete('0')) + graph_all), + ) + graph_ten_thousand = ten_thousands @ graph_ten_thousand_component + self.man = graph_ten_thousand.optimize() + + hundred_thousands = NEMO_DIGIT**6 + hundred_thousands_position = NEMO_DIGIT**2 + hundred_thousands_position = hundred_thousands_position @ graph_all + graph_hundred_thousand_component = (hundred_thousands_position + pynutil.insert('万')) + pynini.union( + pynini.closure(pynutil.delete('0')), + graph_thousand_component, + (pynutil.delete('0') + graph_hundred_component), + (pynini.closure(pynutil.delete('0')) + graph_all), + ) + graph_hundred_thousand = hundred_thousands @ graph_hundred_thousand_component + + millions = NEMO_DIGIT**7 + million_position = NEMO_DIGIT**3 + million_position = million_position @ graph_hundred_component + graph_million_component = (million_position + pynutil.insert('万')) + pynini.union( + pynini.closure(pynutil.delete('0')), + graph_thousand_component, + (pynutil.delete('0') + graph_hundred_component), + (pynini.closure(pynutil.delete('0')) + graph_all), + ) + graph_million = millions @ graph_million_component + + ten_millions = NEMO_DIGIT**8 + ten_million_position = NEMO_DIGIT**4 + ten_million_position = ten_million_position @ graph_thousand_component_alt + graph_ten_million_component = (ten_million_position + pynutil.insert('万')) + pynini.union( + pynini.closure(pynutil.delete('0')), + graph_thousand_component, + (pynutil.delete('0') + graph_hundred_component), + (pynini.closure(pynutil.delete('0')) + graph_all), + ) + graph_ten_million = ten_millions @ graph_ten_million_component + + hundred_millions = NEMO_DIGIT**9 + graph_hundred_million_component = (graph_digit + pynutil.insert('億')) + pynini.union( + pynini.closure(pynutil.delete('0')), + graph_ten_million_component, + (pynutil.delete('0') + graph_million_component), + (pynutil.delete('00') + graph_hundred_thousand_component), + (pynutil.delete('000') + graph_ten_thousand_component), + (pynutil.delete('0000') + graph_thousand_component), + ((pynutil.delete('00000') + graph_hundred_component)), + (pynini.closure(pynutil.delete('0')) + graph_all), + ) + graph_hundred_million = hundred_millions @ graph_hundred_million_component + + thousand_millions = NEMO_DIGIT**10 + thousand_millions_position = NEMO_DIGIT**2 + thousand_millions_position = thousand_millions_position @ graph_all + graph_thousand_million_component = (thousand_millions_position + pynutil.insert('億')) + pynini.union( + pynini.closure(pynutil.delete('0')), + graph_ten_million_component, + (pynutil.delete('0') + graph_million_component), + (pynutil.delete('00') + graph_hundred_thousand_component), + (pynutil.delete('000') + graph_ten_thousand_component), + (pynutil.delete('0000') + graph_thousand_component), + ((pynutil.delete('00000') + graph_hundred_component)), + (pynini.closure(pynutil.delete('0')) + graph_all), + ) + graph_thousand_million = thousand_millions @ graph_thousand_million_component + + ten_billions = NEMO_DIGIT**11 + ten_billions_position = NEMO_DIGIT**3 + ten_billions_position = ten_billions_position @ graph_hundred_component + graph_ten_billions_component = (ten_billions_position + pynutil.insert('億')) + pynini.union( + pynini.closure(pynutil.delete('0')), + graph_ten_million_component, + (pynutil.delete('0') + graph_million_component), + (pynutil.delete('00') + graph_hundred_thousand_component), + (pynutil.delete('000') + graph_ten_thousand_component), + (pynutil.delete('0000') + graph_thousand_component), + ((pynutil.delete('00000') + graph_hundred_component)), + (pynini.closure(pynutil.delete('0')) + graph_all), + ) + graph_ten_billions = ten_billions @ graph_ten_billions_component + + hundred_billions = NEMO_DIGIT**12 + hundred_billions_position = NEMO_DIGIT**4 + hundred_billions_position = hundred_billions_position @ graph_thousand_component_alt + graph_hundred_billions_component = (hundred_billions_position + pynutil.insert('億')) + pynini.union( + pynini.closure(pynutil.delete('0')), + graph_ten_million_component, + (pynutil.delete('0') + graph_million_component), + (pynutil.delete('00') + graph_hundred_thousand_component), + (pynutil.delete('000') + graph_ten_thousand_component), + (pynutil.delete('0000') + graph_thousand_component), + ((pynutil.delete('00000') + graph_hundred_component)), + (pynini.closure(pynutil.delete('0')) + graph_all), + ) + graph_hundred_billions = hundred_billions @ graph_hundred_billions_component + + graph = pynini.union( + graph_hundred_billions, + graph_ten_billions, + graph_thousand_million, + graph_hundred_million, + graph_ten_million, + graph_million, + graph_hundred_thousand, + graph_ten_thousand, + graph_thousand, + graph_hundred, + graph_all, + graph_zero, + ) + self.just_cardinals = graph.optimize() + + optional_sign = ( + pynutil.insert("negative: \"") + (pynini.accep("-") | pynini.cross("マイナス", "-")) + pynutil.insert("\"") + ) + + final_graph = ( + optional_sign + pynutil.insert(" ") + pynutil.insert("integer: \"") + graph + pynutil.insert("\"") + ) | (pynutil.insert("integer: \"") + graph + pynutil.insert("\"")) + + final_graph = self.add_tokens(final_graph) + + self.fst = final_graph.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ja/taggers/date.py b/zonos3/vendor/nemo_text_processing/text_normalization/ja/taggers/date.py new file mode 100644 index 0000000000000000000000000000000000000000..c01e523ec3b4f13137191d239cf3269c86e3ce05 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ja/taggers/date.py @@ -0,0 +1,227 @@ +# Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.ja.graph_utils import ( + NEMO_NARROW_NON_BREAK_SPACE, + NEMO_NON_BREAKING_SPACE, + GraphFst, +) +from zonos3.vendor.nemo_text_processing.text_normalization.ja.utils import get_abs_path + + +class DateFst(GraphFst): + """ + Finite state transducer for classifying decimal, e.g. + 2024/01/30 -> date { year: "二千二十四" month: "一" day: "三十" } + 2024/1/30 -> date { year: "二千二十四" month: "一" day: "三十" } + 2024-01-30 -> date { year: "二千二十四" month: "一" day: "三十" } + 2024.01.30 -> date { year: "二千二十四" month: "一" day: "三十" } + H.6 -> date { era: "平成" yera: "六年" } + R.1 -> date { era: "令和" "year: "元年" } + S.5 -> date { era: "昭和" "year: "五年" } + T.5 -> date { era: "大正" "year: "五年" } + M.5 -> date { era: "明治" "year: "五年" } + 21日月曜日 -> tokens { date { day: "二十一日" weekday: "月曜日" } } + 70年代 -> date { year: "七十年代" } + 西暦794年 -> tokens { date { era: "西暦" year: "七百九十四年" } } + 1月1日(月)〜3日(水) + -> tokens { date { month: "一月" day: "一日" weekday: "月曜日" } } tokens { name: "から" } tokens { date { day: "三日" weekday: "水曜日" } } + 70〜80年代 + -> tokens { cardinal { integer: "七十" } } tokens { name: "から" } tokens { date { year: "八十年代" } } + 7月5〜9日(月〜金) + -> tokens { date { month: "七月" } } tokens { cardinal { integer: "五" } } tokens { name: "から" } tokens { date { day: "九日" weekday: "月曜日" } } tokens { name: "から" } tokens { date { weekday: "金曜日" } } + 7月初旬〜9月中旬 + -> tokens { date { month: "七月" } } tokens { name: "初" } tokens { name: "旬" } tokens { name: "から" } tokens { date { month: "九月" } } tokens { name: "中" } tokens { name: "旬" } + 3〜4月 + -> tokens { cardinal { integer: "三" } } tokens { name: "から" } tokens { date { month: "四月" } } + 2023年3月1日(水)〜6月12日(火) + -> tokens { date { year: "二千二十三年" month: "三月" day: "一日" weekday: "水曜日" } } tokens { name: "から" } tokens { date { month: "六月" day: "十二日" weekday: "火曜日" } } + 10月中旬〜11月上旬 + -> tokens { date { month: "十月" } } tokens { date { month: "中旬" } } tokens { name: "から" } tokens { date { month: "十一月" } } tokens { date { month: "上旬" } } + 1976年7月17日〜8月1日 + -> tokens { date { year: "千九百七十六年" month: "七月" day: "十七日" } } tokens { name: "から" } tokens { date { month: "八月" day: "一日" } } + + Args: + cardinal: CardinalFst + """ + + def __init__(self, cardinal: GraphFst, deterministic: bool = True): + super().__init__(name="date", kind="classify", deterministic=deterministic) + + graph_cardinal = cardinal.just_cardinals + + month = pynutil.delete("0").ques + pynini.string_file(get_abs_path("data/date/month.tsv")) + day = pynutil.delete("0").ques + pynini.string_file(get_abs_path("data/date/day.tsv")) + week = pynini.string_file(get_abs_path("data/date/week.tsv")) + era = pynini.string_file(get_abs_path("data/date/era.tsv")) + era_abbrev = pynini.string_file(get_abs_path("data/date/era_abbrev.tsv")) + + signs = pynutil.delete("/") | pynutil.delete(".") | pynutil.delete("-") + delete_spaces = pynini.closure( + pynutil.delete(" ") | pynutil.delete(NEMO_NARROW_NON_BREAK_SPACE) | pynutil.delete(NEMO_NON_BREAKING_SPACE) + ) + + era_component = pynutil.insert("era: \"") + era + pynutil.insert("\"") + era_abbrev_component = pynutil.insert("era: \"") + era_abbrev + pynutil.insert("\"") + year_component = pynutil.insert("year: \"") + graph_cardinal + pynutil.insert("年") + pynutil.insert("\"") + month_component = pynutil.insert("month: \"") + month + pynutil.insert("月") + pynutil.insert("\"") + day_component = pynutil.insert("day: \"") + day + pynutil.insert("日") + pynutil.insert("\"") + + front_bracket = ( + ( + pynini.closure(pynutil.delete(delete_spaces)) + + pynutil.delete("(") + + pynini.closure(pynutil.delete(delete_spaces)) + ) + | ( + pynini.closure(pynutil.delete(delete_spaces)) + + pynutil.delete("(") + + pynini.closure(pynutil.delete(delete_spaces)) + ) + | ( + pynini.closure(pynutil.delete(delete_spaces)) + + pynutil.delete("(") + + pynini.closure(pynutil.delete(delete_spaces)) + ) + ) + preceding_bracket = ( + ( + pynini.closure(pynutil.delete(delete_spaces)) + + pynutil.delete(")") + + pynini.closure(pynutil.delete(delete_spaces)) + ) + | ( + pynini.closure(pynutil.delete(delete_spaces)) + + pynutil.delete(")") + + pynini.closure(pynutil.delete(delete_spaces)) + ) + | ( + pynini.closure(pynutil.delete(delete_spaces)) + + pynutil.delete(")") + + pynini.closure(pynutil.delete(delete_spaces)) + ) + ) + # this graph optionally accepts () around weekday to accomodate to inputs like (月〜金), thus being longer + + week_component = ( + (front_bracket + pynutil.insert("weekday: \"") + week + preceding_bracket + pynutil.insert("\"")) + | ( + front_bracket + + pynutil.insert("weekday: \"") + + week + + pynini.cross("〜", "から") + + week + + preceding_bracket + + pynutil.insert("\"") + ) + | ( + front_bracket + + pynutil.insert("weekday: \"") + + week + + pynutil.delete("・") + + week + + preceding_bracket + + pynutil.insert("\"") + ) + ) + + # era, year, month, date + graph_basic_date = ( # (R.|令和)2024/01/01, (R.|令和)2024/01/01/(水), (R.|令和)01/01, (R.|令和)01/01(水) + pynini.closure(era_component + pynutil.insert(" "), 0, 1) + + pynini.closure(year_component + signs + pynutil.insert(" "), 1) + + month_component + + signs + + pynutil.insert(" ") + + day_component + + pynini.closure(pynutil.insert(" ") + week_component, 0, 1) + ) + + # 2024年, 9月, 28日 + individual_year_component = ( + pynini.closure(era_component + pynutil.insert(" "), 0, 1) + + pynutil.insert("year: \"") + + graph_cardinal + + pynini.accep("年") + + pynutil.insert("\"") + ) + # this extra individual year component is to accomodate inputs R. 2024 with out "年" + # the inputs may or maynot include "年", thus below: + individual_year_component_2 = ( + pynini.closure(era_component + pynutil.insert(" "), 0, 1) + + pynutil.insert("year: \"") + + graph_cardinal + + (pynini.accep("世紀") | pynini.accep("")) + + pynutil.insert("\"") + ) | ( + era_abbrev_component + + pynutil.insert(" ") + + pynutil.insert("year: \"") + + graph_cardinal + + pynutil.insert("年") + + pynutil.insert("\"") + ) + + individual_month_component = ( + pynutil.insert("month: \"") + month + pynini.accep("月") + pynutil.insert("\"") + ) | ( + pynutil.insert("month: \"") + + (pynini.accep("中旬") | pynini.accep("下旬") | pynini.accep("上旬")) + + pynutil.insert("\"") + ) + individual_day_component = ( + pynutil.insert("day: \"") + graph_cardinal + pynini.accep("日") + pynutil.insert("\"") + ) + + graph_individual_component = ( + individual_year_component + | individual_month_component + | individual_day_component + | week_component + | individual_year_component_2 + ) + pynini.closure(pynutil.insert(" ") + week_component, 0, 1) + + # combined the above individual date components + graph_individual_component_combined = ( + (individual_year_component + pynutil.insert(" ") + individual_month_component) + | (individual_month_component + pynutil.insert(" ") + individual_day_component) + | ( + individual_year_component + + pynutil.insert(" ") + + individual_month_component + + pynutil.insert(" ") + + individual_day_component + ) + ) + pynini.closure(pynutil.insert(" ") + week_component, 0, 1) + + nendai = pynini.accep("年代") + era_nendai = ( + pynini.closure(era_component + pynutil.insert(" "), 0, 1) + + pynutil.insert("year: \"") + + graph_cardinal + + nendai + + pynutil.insert("\"") + ) + + graph_all_date = ( + graph_basic_date | graph_individual_component | graph_individual_component_combined | era_nendai + ) + + final_graph = graph_all_date + + final_graph = self.add_tokens(final_graph) + self.fst = final_graph.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ja/taggers/decimal.py b/zonos3/vendor/nemo_text_processing/text_normalization/ja/taggers/decimal.py new file mode 100644 index 0000000000000000000000000000000000000000..2986020d08bbc741ff758d6a3938aa0738a8ced5 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ja/taggers/decimal.py @@ -0,0 +1,59 @@ +# Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.ja.graph_utils import GraphFst +from zonos3.vendor.nemo_text_processing.text_normalization.ja.utils import get_abs_path + + +class DecimalFst(GraphFst): + """ + Finite state transducer for classifying decimal, e.g. + 0.5 -> decimal { integer_part: "零" fractional_part: "五" } + -0.5万 -> decimal { negative: "マイナス" integer_part: "零" fractional_part: "五" quantity: "万"} + + Args: + cardinal: CardinalFst + """ + + def __init__(self, cardinal: GraphFst, deterministic: bool = True): + super().__init__(name="decimal", kind="classify", deterministic=deterministic) + + cardinal_before_decimal = cardinal.just_cardinals + cardinal_after_decimal = pynini.string_file(get_abs_path("data/numbers/digit.tsv")) + zero = pynini.string_file(get_abs_path("data/numbers/zero.tsv")) + + graph_integer = pynutil.insert('integer_part: \"') + cardinal_before_decimal + pynutil.insert("\"") + graph_fraction = ( + pynutil.insert("fractional_part: \"") + + pynini.closure((cardinal_after_decimal | zero), 1) + + pynutil.insert("\"") + ) + graph_decimal_no_sign = graph_integer + pynutil.delete('.') + pynutil.insert(" ") + graph_fraction + + graph_optional_sign = ( + pynutil.insert("negative: \"") + + (pynini.cross("-", "マイナス") | pynini.accep("マイナス")) + + pynutil.insert("\"") + ) + + graph_decimal = graph_decimal_no_sign | (graph_optional_sign + pynutil.insert(" ") + graph_decimal_no_sign) + + self.just_decimal = graph_decimal_no_sign.optimize() + + final_graph = self.add_tokens(graph_decimal) + self.fst = final_graph.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ja/taggers/fraction.py b/zonos3/vendor/nemo_text_processing/text_normalization/ja/taggers/fraction.py new file mode 100644 index 0000000000000000000000000000000000000000..eee876ae2daea40af9db13823f43821b2981b96e --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ja/taggers/fraction.py @@ -0,0 +1,125 @@ +# Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.ja.graph_utils import NEMO_SPACE, GraphFst +from zonos3.vendor.nemo_text_processing.text_normalization.ja.utils import get_abs_path + + +class FractionFst(GraphFst): + """ + Finite state transducer for classifying fractions, e.g. + 1/2 -> tokens { fraction { denominator: "二" numerator: "一"} } + 1と3/4 -> fraction { integer: "一" denominator: "四" numerator: "三" } + 一荷四分の三 -> fraction { integer: "1" denominator: "4" numerator: "3" } + ルート三分の一 -> fraction { denominator: "√3" numerator: "1" } + 一点六五分の五十 -> fraction { denominator: "1.65" numerator: "50" } + マイナス1/2 -> tokens { fraction { denominator: "二" numerator: "一"} } + + Args: + cardinal: CardinalFst + """ + + def __init__(self, cardinal: GraphFst, deterministic: bool = True): + super().__init__(name="fraction", kind="classify", deterministic=deterministic) + + cardinal = cardinal.just_cardinals + graph_digit = pynini.string_file(get_abs_path("data/numbers/digit.tsv")) + graph_zero = pynini.string_file(get_abs_path("data/numbers/zero.tsv")) + + slash = pynutil.delete('/') + morphemes = pynini.accep('分の') + root = pynini.accep('√') + + decimal_number = ( + cardinal + + pynini.cross(".", "点") + + pynini.closure(pynini.closure(graph_digit) | pynini.closure(graph_zero)) + ) + + integer_component = ( + pynutil.insert('integer_part: \"') + + (cardinal | (root + cardinal) | decimal_number | (root + decimal_number)) + + pynutil.insert("\"") + ) + integer_component_with_char = ( + pynutil.insert('integer_part: \"') + + ( + (cardinal | (root + cardinal) | decimal_number | (root + decimal_number)) + + (pynini.accep("と") | pynini.accep("荷")) + ) + + pynutil.insert("\"") + + pynutil.insert(NEMO_SPACE) + ) + denominator_component = ( + pynutil.insert("denominator: \"") + + (cardinal | (root + cardinal) | decimal_number | (root + decimal_number)) + + pynutil.insert("\"") + ) + numerator_component = ( + pynutil.insert("numerator: \"") + + (cardinal | (root + cardinal) | decimal_number | (root + decimal_number)) + + pynutil.insert("\"") + ) + + # 3/4, 1 3/4, 1と3/4, -3/4, -1 3/4, 1と3/4, √1と3/4 and any combination of root number, cardinal number and decimal number + graph_fraction_slash = ( + pynini.closure( + (integer_component + pynini.accep(NEMO_SPACE)) + | (integer_component_with_char + pynutil.insert(NEMO_SPACE)), + 0, + 1, + ) + + numerator_component + + slash + + pynutil.insert(NEMO_SPACE) + + denominator_component + ) + + # 4分の3 -4分の3 and any combs + graph_fraction_word = ( + pynini.closure( + ( + integer_component + pynini.accep(NEMO_SPACE) + | integer_component_with_char + pynutil.insert(NEMO_SPACE) + ), + 0, + 1, + ) + + denominator_component + + pynutil.insert(NEMO_SPACE) + + pynutil.insert("morphosyntactic_features: \"") + + morphemes + + pynutil.insert("\"") + + pynutil.insert(NEMO_SPACE) + + numerator_component + ) + + optional_sign = ( + pynutil.insert("negative: \"") + + (pynini.accep("マイナス") | pynini.cross("-", "マイナス")) + + pynutil.insert("\"") + ) + + graph_fraction_slash_sigh = pynini.closure(optional_sign + pynutil.insert(NEMO_SPACE), 0, 1) + ( + graph_fraction_slash | graph_fraction_word + ) + + graph = graph_fraction_slash_sigh # | + + final_graph = self.add_tokens(graph) + self.fst = final_graph.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ja/taggers/ordinal.py b/zonos3/vendor/nemo_text_processing/text_normalization/ja/taggers/ordinal.py new file mode 100644 index 0000000000000000000000000000000000000000..18befb0c5293a6c8bc86d343a0ae7b28f247064d --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ja/taggers/ordinal.py @@ -0,0 +1,42 @@ +# Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.ja.graph_utils import GraphFst + + +class OrdinalFst(GraphFst): + """ + Finite state transducer for classifying ordinal, e.g. + 第100 -> ordinal { integer: "第百" } + + Args: + cardinal: CardinalFst + """ + + def __init__(self, cardinal: GraphFst, deterministic: bool = True): + super().__init__(name="ordinal", kind="classify", deterministic=deterministic) + + graph_cardinal = cardinal.just_cardinals + morpheme_pre = pynini.accep('第') + morpheme_post = pynini.accep('番目') + graph_ordinal = pynini.union(morpheme_pre + graph_cardinal, graph_cardinal + morpheme_post) + + final_graph = pynutil.insert("integer: \"") + graph_ordinal + pynutil.insert("\"") + + graph_ordinal_final = self.add_tokens(final_graph) + self.fst = graph_ordinal_final.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ja/taggers/punctuation.py b/zonos3/vendor/nemo_text_processing/text_normalization/ja/taggers/punctuation.py new file mode 100644 index 0000000000000000000000000000000000000000..c9e831c58a3001c17780b6b51bb001c0136f73f5 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ja/taggers/punctuation.py @@ -0,0 +1,70 @@ +# Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import sys +from unicodedata import category + +import pynini +from pynini.examples import plurals +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.ja.graph_utils import NEMO_NOT_SPACE, NEMO_SIGMA, GraphFst +from zonos3.vendor.nemo_text_processing.text_normalization.ja.utils import get_abs_path, load_labels + + +class PunctuationFst(GraphFst): + """ + Finite state transducer for classifying punctuation + e.g. a, -> tokens { name: "a" } tokens { name: "," } + + Args: + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="punctuation", kind="classify", deterministic=deterministic) + s = "!#$%&'()*+,-./:;<=>?@^_`{|}。,;:《》“”·~【】!?、‘’.<>-——_、。.「」『』‘`/・;’”“”‷・〔〕々〃ゝゞヽ〲〱〳〴〵ヾ〆,~" + + punct_symbols_to_exclude = ["[", "]"] + punct_unicode = [ + chr(i) + for i in range(sys.maxunicode) + if category(chr(i)).startswith("P") and chr(i) not in punct_symbols_to_exclude + ] + + whitelist_symbols = load_labels(get_abs_path("data/symbol.tsv")) + whitelist_symbols = [x[0] for x in whitelist_symbols] + self.punct_marks = [p for p in punct_unicode + list(s) if p not in whitelist_symbols] + + punct = pynini.union(*self.punct_marks) + punct = pynini.closure(punct, 1) + + emphasis = ( + pynini.accep("<") + + ( + (pynini.closure(NEMO_NOT_SPACE - pynini.union("<", ">"), 1) + pynini.closure(pynini.accep("/"), 0, 1)) + | (pynini.accep("/") + pynini.closure(NEMO_NOT_SPACE - pynini.union("<", ">"), 1)) + ) + + pynini.accep(">") + ) + punct = plurals._priority_union(emphasis, punct, NEMO_SIGMA) + range_component = pynini.cross("〜", "から") | pynini.accep( + "から" + ) # forcing this conversion for special tilde + + self.graph = punct | pynutil.add_weight(range_component, -1.0) + self.fst = (pynutil.insert("name: \"") + self.graph + pynutil.insert("\"")).optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ja/taggers/time.py b/zonos3/vendor/nemo_text_processing/text_normalization/ja/taggers/time.py new file mode 100644 index 0000000000000000000000000000000000000000..2d7ef65c4b97b0a22695eac49028b39669d19d4a --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ja/taggers/time.py @@ -0,0 +1,112 @@ +# Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.ja.graph_utils import GraphFst +from zonos3.vendor.nemo_text_processing.text_normalization.ja.utils import get_abs_path + + +class TimeFst(GraphFst): + """ + Finite state transducer for classifying time, e.g. + 1時30分 -> time { hours: "一" minutes: "三十" } + 今夜0時 -> time { suffix: "今夜" hours: "零" } + + Args: + cardinal: CardinalFst + """ + + def __init__(self, cardinal: GraphFst, deterministic: bool = True): + super().__init__(name="time", kind="classify", deterministic=deterministic) + + graph_cardinal = cardinal.just_cardinals + + hour_clock = pynini.string_file(get_abs_path("data/time/hour.tsv")) + minute_clock = pynini.string_file(get_abs_path("data/time/minute.tsv")) + second_clock = pynini.string_file(get_abs_path("data/time/second.tsv")) + division = pynini.string_file(get_abs_path("data/time/division.tsv")) + + division_component = pynutil.insert("suffix: \"") + division + pynutil.insert("\"") + hour_component = ( + pynutil.insert("hours: \"") + + (graph_cardinal | (graph_cardinal + pynini.cross(".", "点") + graph_cardinal)) + + (pynini.accep("時") | pynini.accep("時間") | pynini.accep("時頃")) + + pynutil.insert("\"") + ) + minute_component = pynutil.insert("minutes: \"") + ( + graph_cardinal | (graph_cardinal + pynini.cross(".", "点") + graph_cardinal) + ) + pynini.accep("分") + pynini.closure((pynini.accep("過ぎ") | pynini.accep("頃")), 0, 1) + pynutil.insert( + "\"" + ) | ( + pynutil.insert("minutes: \"") + + pynini.accep("半") + + pynini.closure((pynini.accep("過ぎ") | pynini.accep("頃")), 0, 1) + + pynutil.insert("\"") + ) + second_component = ( + pynutil.insert("seconds: \"") + + (graph_cardinal | (graph_cardinal + pynini.cross(".", "点") + graph_cardinal)) + + pynini.accep("秒") + + pynutil.insert("\"") + ) + + graph_individual_time = pynini.closure(division_component + pynutil.insert(" "), 0, 1) + ( + hour_component + | minute_component + | second_component + | (hour_component + pynutil.insert(" ") + minute_component) + | (hour_component + pynutil.insert(" ") + minute_component + pynutil.insert(" ") + second_component) + | (minute_component + pynutil.insert(" ") + second_component) + ) + + colon = pynutil.delete(":") + hour_clock_component = ( + pynutil.insert("hours: \"") + + pynutil.delete("0").ques + + hour_clock + + pynutil.insert("時") + + pynutil.insert("\"") + ) + minute_clock_component = ( + pynutil.insert("minutes: \"") + + pynutil.delete("0").ques + + minute_clock + + pynutil.insert("分") + + pynutil.insert("\"") + ) + second_clock_component = ( + pynutil.insert("seconds: \"") + + pynutil.delete("0").ques + + second_clock + + pynutil.insert("秒") + + pynutil.insert("\"") + ) + + graph_clock = ( + hour_clock_component + + pynutil.insert(" ") + + colon + + minute_clock_component + + pynutil.insert(" ") + + colon + + second_clock_component + ) | (hour_clock_component + pynutil.insert(" ") + colon + minute_clock_component) + + graph = graph_individual_time | graph_clock + + graph_final = self.add_tokens(graph) + self.fst = graph_final.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ja/taggers/tokenize_and_classify.py b/zonos3/vendor/nemo_text_processing/text_normalization/ja/taggers/tokenize_and_classify.py new file mode 100644 index 0000000000000000000000000000000000000000..a98f37bab9647da64bff3fea61754eaba5377022 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ja/taggers/tokenize_and_classify.py @@ -0,0 +1,94 @@ +# Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import os + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.ja.graph_utils import GraphFst, generator_main +from zonos3.vendor.nemo_text_processing.text_normalization.ja.taggers.cardinal import CardinalFst +from zonos3.vendor.nemo_text_processing.text_normalization.ja.taggers.date import DateFst +from zonos3.vendor.nemo_text_processing.text_normalization.ja.taggers.decimal import DecimalFst +from zonos3.vendor.nemo_text_processing.text_normalization.ja.taggers.fraction import FractionFst +from zonos3.vendor.nemo_text_processing.text_normalization.ja.taggers.ordinal import OrdinalFst +from zonos3.vendor.nemo_text_processing.text_normalization.ja.taggers.punctuation import PunctuationFst +from zonos3.vendor.nemo_text_processing.text_normalization.ja.taggers.time import TimeFst +from zonos3.vendor.nemo_text_processing.text_normalization.ja.taggers.whitelist import WhiteListFst +from zonos3.vendor.nemo_text_processing.text_normalization.ja.taggers.word import WordFst + + +class ClassifyFst(GraphFst): + """ + Final class that composes all other classification grammars. This class can process an entire sentence including punctuation. + For deployment, this grammar will be compiled and exported to OpenFst Finate State Archiv (FAR) File. + More details to deployment at NeMo/tools/text_processing_deployment. + + Args: + input_case: accepting either "lower_cased" or "cased" input. + deterministic: if True will provide a single transduction option, + for False multiple options (used for audio-based normalization) + cache_dir: path to a dir with .far grammar file. Set to None to avoid using cache. + overwrite_cache: set to True to overwrite .far files + whitelist: path to a file with whitelist replacements + """ + + def __init__( + self, + input_case: str, + deterministic: bool = True, + cache_dir: str = None, + overwrite_cache: bool = False, + whitelist: str = None, + ): + super().__init__(name="tokenize_and_classify", kind="classify", deterministic=deterministic) + + far_file = None + if cache_dir is not None and cache_dir != "None": + os.makedirs(cache_dir, exist_ok=True) + whitelist_file = os.path.basename(whitelist) if whitelist else "" + far_file = os.path.join(cache_dir, f"zh_tn_{deterministic}_deterministic_{whitelist_file}_tokenize.far") + if not overwrite_cache and far_file and os.path.exists(far_file): + self.fst = pynini.Far(far_file, mode="r")["tokenize_and_classify"] + else: + cardinal = CardinalFst(deterministic=deterministic) + date = DateFst(cardinal=cardinal, deterministic=deterministic) + decimal = DecimalFst(cardinal=cardinal, deterministic=deterministic) + time = TimeFst(cardinal=cardinal, deterministic=deterministic) + fraction = FractionFst(cardinal=cardinal, deterministic=deterministic) + ordinal = OrdinalFst(cardinal=cardinal, deterministic=deterministic) + whitelist = WhiteListFst(deterministic=deterministic) + word = WordFst(deterministic=deterministic) + punctuation = PunctuationFst(deterministic=deterministic) + + classify = pynini.union( + pynutil.add_weight(date.fst, 1.1), + pynutil.add_weight(fraction.fst, 1.0), + pynutil.add_weight(time.fst, 1.1), + pynutil.add_weight(whitelist.fst, 1.1), + pynutil.add_weight(cardinal.fst, 1.1), + pynutil.add_weight(decimal.fst, 3.05), + pynutil.add_weight(ordinal.fst, 1.1), + pynutil.add_weight(punctuation.fst, 1.0), + pynutil.add_weight(word.fst, 100), + ) + + token = pynutil.insert("tokens { ") + classify + pynutil.insert(" } ") + tagger = pynini.closure(token, 1) + + self.fst = tagger + + if far_file: + generator_main(far_file, {"tokenize_and_classify": self.fst}) diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ja/taggers/whitelist.py b/zonos3/vendor/nemo_text_processing/text_normalization/ja/taggers/whitelist.py new file mode 100644 index 0000000000000000000000000000000000000000..86a1290cdf345af1fd61b280aa40b3137f5b569c --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ja/taggers/whitelist.py @@ -0,0 +1,40 @@ +# Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. +# Copyright 2015 and onwards Google, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.ja.graph_utils import GraphFst +from zonos3.vendor.nemo_text_processing.text_normalization.ja.utils import get_abs_path + + +class WhiteListFst(GraphFst): + """ + Finite state transducer for classifying whitelisted tokens + e.g. Dr. -> tokens { name: "ドクター" } + Ms. -> { name: "ミス" } + jr. -> { name: "ジュニア" } + etc. -> { name: "エトセトラ" } + This class has highest priority among all classifier grammars. Whitelisted tokens are defined and loaded from "data/whitelist.tsv". + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="whitelist", kind="classify", deterministic=deterministic) + + whitelist = pynini.string_file(get_abs_path("data/whitelist.tsv")) + graph = (pynutil.insert('name: "')) + (whitelist) + pynutil.insert('"') + + self.fst = graph.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ja/taggers/word.py b/zonos3/vendor/nemo_text_processing/text_normalization/ja/taggers/word.py new file mode 100644 index 0000000000000000000000000000000000000000..56476f9de18105fac88bb8932e14b7b8f791d188 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ja/taggers/word.py @@ -0,0 +1,30 @@ +# Copyright (c) 2024 NVIDIA CORPORATION. All rights reserved. +# Copyright 2015 and onwards Google, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.ja.graph_utils import NEMO_NOT_SPACE, GraphFst + + +class WordFst(GraphFst): + """ + Finite state transducer for classifying plain tokens, that do not belong to any special class. This can be considered as the default class. + e.g. 文字 -> tokens { name: "文字" } + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="word", kind="classify", deterministic=deterministic) + word = pynutil.insert("name: \"") + NEMO_NOT_SPACE + pynutil.insert("\"") + self.fst = word.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ja/utils.py b/zonos3/vendor/nemo_text_processing/text_normalization/ja/utils.py new file mode 100644 index 0000000000000000000000000000000000000000..65523afed35dba7786d4fdbca6b49e43abfc648e --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ja/utils.py @@ -0,0 +1,56 @@ +# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import csv +import os + + +def get_abs_path(rel_path): + """ + Get absolute path + + Args: + rel_path: relative path to this file + + Returns absolute path + """ + return os.path.dirname(os.path.abspath(__file__)) + '/' + rel_path + + +# def load_labels(abs_path): +# """ +# loads relative path file as dictionary + +# Args: +# abs_path: absolute path + + +# Returns dictionary of mappings +# """ +# #label_tsv = open(abs_path, encoding="utf-8") +# label_tsv = open(abs_path, "r") +# labels = list(csv.reader(label_tsv, delimiter="\t")) +# return labels +def load_labels(abs_path): + """ + loads relative path file as dictionary + + Args: + abs_path: absolute path + + Returns dictionary of mappings + """ + with open(abs_path, encoding="utf-8") as label_tsv: + labels = list(csv.reader(label_tsv, delimiter="\t")) + return labels diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ja/verbalizers/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/ja/verbalizers/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..d9155f923f186a086a69de138e984e2fab2817ec --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ja/verbalizers/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ja/verbalizers/cardinal.py b/zonos3/vendor/nemo_text_processing/text_normalization/ja/verbalizers/cardinal.py new file mode 100644 index 0000000000000000000000000000000000000000..611648995babf3c51c3bf41d4e2f94aae93d8af7 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ja/verbalizers/cardinal.py @@ -0,0 +1,52 @@ +# Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.ja.graph_utils import NEMO_NOT_QUOTE, GraphFst, delete_space + + +class CardinalFst(GraphFst): + """ + Finite state transducer for verbalizing cardinals, e.g. + cardinal { integer: "一" } -> 一 + cardinal { negative: "-" integer: "二十三" } -> マイナス二十三 + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="cardinal", kind="verbalize", deterministic=deterministic) + + optional_sign = ( + pynutil.delete("negative:") + + delete_space + + pynutil.delete("\"") + + pynini.closure(NEMO_NOT_QUOTE) + + pynutil.delete("\"") + + delete_space + ) + + graph = ( + pynutil.delete("integer:") + + delete_space + + pynutil.delete("\"") + + pynini.closure(NEMO_NOT_QUOTE) + + pynutil.delete("\"") + ) + + final_graph = pynini.closure(optional_sign, 0, 1) + graph + + final_graph = self.delete_tokens(final_graph) + self.fst = final_graph.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ja/verbalizers/date.py b/zonos3/vendor/nemo_text_processing/text_normalization/ja/verbalizers/date.py new file mode 100644 index 0000000000000000000000000000000000000000..e892afc5bf3f3954fbf02360eb5e1e62ff1cfbdb --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ja/verbalizers/date.py @@ -0,0 +1,55 @@ +# Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.ja.graph_utils import NEMO_NOT_QUOTE, GraphFst, delete_space + + +class DateFst(GraphFst): + """ + Finite state transducer for verbalizing date e.g. + date { year: "二千二十四" month: "三" day: "四" } -> 二千二十四年三月四日 + + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="date", kind="verbalize", deterministic=deterministic) + + era_component = pynutil.delete("era: \"") + pynini.closure(NEMO_NOT_QUOTE) + pynutil.delete("\"") + year_component = pynutil.delete("year: \"") + pynini.closure(NEMO_NOT_QUOTE) + pynutil.delete("\"") + month_component = pynutil.delete("month: \"") + pynini.closure(NEMO_NOT_QUOTE) + pynutil.delete("\"") + day_component = pynutil.delete("day: \"") + pynini.closure(NEMO_NOT_QUOTE) + pynutil.delete("\"") + week_component = ( + pynutil.delete("weekday: \"") + + pynini.closure(delete_space) + + pynini.closure(NEMO_NOT_QUOTE) + + pynini.closure(delete_space) + + pynutil.delete("\"") + ) + + graph_basic_date = ( + pynini.closure(era_component + delete_space, 0, 1) + + pynini.closure(year_component + delete_space, 0, 1) + + pynini.closure(month_component + delete_space, 0, 1) + + pynini.closure(day_component, 0, 1) + + pynini.closure((delete_space + week_component) | (week_component), 0, 1) + ) | month_component + delete_space + week_component + + final_graph = graph_basic_date + + delete_tokens = self.delete_tokens(final_graph) + self.fst = delete_tokens.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ja/verbalizers/decimal.py b/zonos3/vendor/nemo_text_processing/text_normalization/ja/verbalizers/decimal.py new file mode 100644 index 0000000000000000000000000000000000000000..197a3513c1289fb0c24d6acf43e5221d577e643c --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ja/verbalizers/decimal.py @@ -0,0 +1,52 @@ +# Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.ja.graph_utils import NEMO_NOT_QUOTE, GraphFst, delete_space + + +class DecimalFst(GraphFst): + """ + Finite state transducer for verbalizing decimal, e.g. + decimal { integer_part: "零" fractional_part: "五" } -> 零点五 + decimal { positive: "-" integer_part: "零" fractional_part: "五" } -> マイナス零点五 + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="decimal", kind="verbalize", deterministic=deterministic) + + graph_integer = pynutil.delete("integer_part: \"") + pynini.closure(NEMO_NOT_QUOTE, 1) + pynutil.delete("\"") + graph_fraction = ( + pynutil.delete("fractional_part: \"") + + pynutil.insert("点") + + pynini.closure(NEMO_NOT_QUOTE, 1) + + pynutil.delete("\"") + ) + + graph_optional_sign = pynini.closure( + pynutil.delete("negative:") + + delete_space + + pynutil.delete("\"") + + pynini.closure(NEMO_NOT_QUOTE, 1) + + pynutil.delete("\"") + ) + + graph_decimal_no_sign = graph_integer + pynutil.delete(" ") + graph_fraction + graph_decimal = graph_decimal_no_sign | (graph_optional_sign + pynutil.delete(" ") + graph_decimal_no_sign) + + delete_tokens = self.delete_tokens(graph_decimal) + self.fst = delete_tokens.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ja/verbalizers/fraction.py b/zonos3/vendor/nemo_text_processing/text_normalization/ja/verbalizers/fraction.py new file mode 100644 index 0000000000000000000000000000000000000000..4d57a42f4e297aa586d0b35b479e091a55619cfd --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ja/verbalizers/fraction.py @@ -0,0 +1,123 @@ +# Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.ja.graph_utils import NEMO_NOT_QUOTE, NEMO_SPACE, GraphFst, delete_space + + +class FractionFst(GraphFst): + """ + Finite state transducer for verbalizing fractionss, e.g. + tokens { fraction { denominator: "二" numerator: "一"} } -> 1/2 + tokens { fraction { integer: "一" denominator: "四" numerator: "三" } } -> 1と3/4 + tokens { fraction { integer: "1" denominator: "4" numerator: "3" } } -> 一荷四分の三 + tokens { fraction { denominator: "√3" numerator: "1" } } -> ルート三分の一 + tokens { fraction { denominator: "1.65" numerator: "50" } } -> 一点六五分の五十 + tokens { fraction { denominator: "二" numerator: "一"} } -> マイナス1/2 + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="fraction", kind="verbalize", deterministic=deterministic) + + denominator_component = ( + pynutil.delete('denominator: \"') + pynini.closure(NEMO_NOT_QUOTE - "√") + pynutil.delete("\"") + ) + numerator_component = ( + pynutil.delete('numerator: \"') + pynini.closure(NEMO_NOT_QUOTE - "√") + pynutil.delete("\"") + ) + + # 1/3 + graph_regular_fraction = ( + denominator_component + pynutil.delete(NEMO_SPACE) + pynutil.insert("分の") + numerator_component + ) + + denominator_component_root = ( + pynutil.delete('denominator: \"') + + pynini.cross("√", "ルート") + + pynini.closure(NEMO_NOT_QUOTE - "√") + + pynutil.delete("\"") + ) + numerator_component_root = ( + pynutil.delete('numerator: \"') + + pynini.cross("√", "ルート") + + pynini.closure(NEMO_NOT_QUOTE - "√") + + pynutil.delete("\"") + ) + # √3/1 + graph_regular_fraction_root = ( + (denominator_component_root | denominator_component) + + pynutil.delete(NEMO_SPACE) + + pynutil.insert("分の") + + (numerator_component_root | numerator_component) + ) + + # 3分の1 + graph_regular_fraction_char = ( + (denominator_component | denominator_component_root) + + pynutil.delete(NEMO_SPACE) + + pynutil.delete("morphosyntactic_features: \"") + + pynini.closure(NEMO_NOT_QUOTE) + + pynutil.delete("\"") + + pynutil.delete(NEMO_SPACE) + + (numerator_component | numerator_component_root) + ) + + graph_integer = ( + pynutil.delete("integer_part:") + + delete_space + + pynutil.delete("\"") + + pynini.closure(pynini.cross("√", "ルート"), 0, 1) + + pynini.closure( + NEMO_NOT_QUOTE - pynini.union("荷", "と", "√") + ) # had to remove these 3 items fron nemo_not _quote so the root is properly converted in a deterministic way. + + pynutil.insert("荷") + + pynutil.delete("\"") + ) + + graph_integer_with_char = ( + pynutil.delete("integer_part:") + + delete_space + + pynutil.delete("\"") + + pynini.closure(pynini.cross("√", "ルート"), 0, 1) + + pynini.closure(NEMO_NOT_QUOTE - pynini.union("荷", "と", "√")) + + (pynini.accep("と") | pynini.accep("荷")) + + pynutil.delete("\"") + ) + + graph_regular_integer = ( + (graph_integer | graph_integer_with_char) + + delete_space + + (graph_regular_fraction | graph_regular_fraction_root | graph_regular_fraction_char) + ) + + optional_sign = ( + pynutil.delete("negative:") + + delete_space + + pynutil.delete("\"") + + pynini.closure(NEMO_NOT_QUOTE) + + pynutil.delete("\"") + + delete_space + ) + + graph = pynini.closure(optional_sign, 0, 1) + ( + graph_regular_integer | graph_regular_fraction | graph_regular_fraction_root | graph_regular_fraction_char + ) + + # graph = pynini.closure(graph_optional_sign, 0, 1) + graph_fractions + + final_graph = self.delete_tokens(graph) + self.fst = final_graph.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ja/verbalizers/ordinal.py b/zonos3/vendor/nemo_text_processing/text_normalization/ja/verbalizers/ordinal.py new file mode 100644 index 0000000000000000000000000000000000000000..270fa2f932b3a29884c3f3c9bc0451bd92eb4628 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ja/verbalizers/ordinal.py @@ -0,0 +1,42 @@ +# Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.ja.graph_utils import NEMO_NOT_QUOTE, GraphFst, delete_space + + +class OrdinalFst(GraphFst): + """ + Finite state transducer for verbalizing ordinal e.g. + tokens { ordinal { integer: "第一千万" } } -> 第一千万 + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="ordinal", kind="verbalize", deterministic=deterministic) + + graph_integer = ( + pynutil.delete("integer:") + + delete_space + + pynutil.delete("\"") + + pynini.closure(NEMO_NOT_QUOTE) + + pynutil.delete("\"") + ) + + final_graph = graph_integer + + delete_tokens = self.delete_tokens(final_graph) + self.fst = delete_tokens.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ja/verbalizers/post_processing.py b/zonos3/vendor/nemo_text_processing/text_normalization/ja/verbalizers/post_processing.py new file mode 100644 index 0000000000000000000000000000000000000000..f39ecc845f6c4f264b2de5dc8e4cb7e061c4d1c5 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ja/verbalizers/post_processing.py @@ -0,0 +1,113 @@ +# Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import os + +import pynini + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import ( + NEMO_NOT_SPACE, + NEMO_SIGMA, + delete_space, + generator_main, +) +from zonos3.vendor.nemo_text_processing.utils.logging import logger + + +class PostProcessingFst: + """ + Finite state transducer that post-processing an entire sentence after verbalization is complete, e.g. + removes extra spaces around punctuation marks " ( one hundred and twenty three ) " -> "(one hundred and twenty three)" + + Args: + cache_dir: path to a dir with .far grammar file. Set to None to avoid using cache. + overwrite_cache: set to True to overwrite .far files + """ + + def __init__(self, cache_dir: str = None, overwrite_cache: bool = False): + + far_file = None + if cache_dir is not None and cache_dir != "None": + os.makedirs(cache_dir, exist_ok=True) + far_file = os.path.join(cache_dir, "zh_tn_post_processing.far") + if not overwrite_cache and far_file and os.path.exists(far_file): + self.fst = pynini.Far(far_file, mode="r")["post_process_graph"] + logger.info(f'Post processing graph was restored from {far_file}.') + else: + self.set_punct_dict() + self.fst = self.get_punct_postprocess_graph() + + if far_file: + generator_main(far_file, {"post_process_graph": self.fst}) + + def set_punct_dict(self): + self.punct_marks = { + "'": [ + "'", + '´', + 'ʹ', + 'ʻ', + 'ʼ', + 'ʽ', + 'ʾ', + 'ˈ', + 'ˊ', + 'ˋ', + '˴', + 'ʹ', + '΄', + '՚', + '՝', + 'י', + '׳', + 'ߴ', + 'ߵ', + 'ᑊ', + 'ᛌ', + '᾽', + '᾿', + '`', + '´', + '῾', + '‘', + '’', + '‛', + '′', + '‵', + 'ꞌ', + ''', + '`', + '𖽑', + '𖽒', + ], + } + + def get_punct_postprocess_graph(self): + """ + Returns graph to post process punctuation marks. + + {``} quotes are converted to {"}. Note, if there are spaces around single quote {'}, they will be kept. + By default, a space is added after a punctuation mark, and spaces are removed before punctuation marks. + """ + + remove_space_around_single_quote = pynini.cdrewrite( + delete_space, NEMO_NOT_SPACE, NEMO_NOT_SPACE, pynini.closure(NEMO_SIGMA) + ) + # this works if spaces in between (good) + # delete space between 2 NEMO_NOT_SPACE(left and right to the space) that are with in a content of NEMO_SIGMA + + graph = remove_space_around_single_quote.optimize() + + return graph diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ja/verbalizers/postprocessor.py b/zonos3/vendor/nemo_text_processing/text_normalization/ja/verbalizers/postprocessor.py new file mode 100644 index 0000000000000000000000000000000000000000..6ac168a5ff72e9a3fab003207c737dd803929bcf --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ja/verbalizers/postprocessor.py @@ -0,0 +1,81 @@ +# Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import pynini +from pynini.lib import pynutil, utf8 + +from zonos3.vendor.nemo_text_processing.text_normalization.ja.graph_utils import ( + NEMO_ALPHA, + NEMO_DIGIT, + NEMO_PUNCT, + NEMO_SIGMA, + NEMO_WHITE_SPACE, + GraphFst, +) +from zonos3.vendor.nemo_text_processing.text_normalization.ja.utils import get_abs_path + + +class PostProcessor(GraphFst): + ''' + Postprocessing of TN, now contains: + 1. punctuation removal + 2. letter case conversion + 3. oov tagger + ''' + + def __init__( + self, + remove_puncts: bool = False, + to_upper: bool = False, + to_lower: bool = False, + tag_oov: bool = False, + ): + super().__init__(name="PostProcessor", kind="processor") + + graph = pynini.cdrewrite('', '', '', NEMO_SIGMA) + if remove_puncts: + remove_puncts_graph = pynutil.delete( + pynini.union(NEMO_PUNCT, pynini.string_file(get_abs_path('data/char/punctuations_zh.tsv'))) + ) + graph @= pynini.cdrewrite(remove_puncts_graph, "", "", NEMO_SIGMA).optimize() + + if to_upper or to_lower: + if to_upper: + conv_cases_graph = pynini.inverse(pynini.string_file(get_abs_path('data/char/upper_to_lower.tsv'))) + else: + conv_cases_graph = pynini.string_file(get_abs_path('data/char/upper_to_lower.tsv')) + + graph @= pynini.cdrewrite(conv_cases_graph, "", "", NEMO_SIGMA).optimize() + + if tag_oov: + zh_charset_std = pynini.string_file(get_abs_path("data/char/charset_national_standard_2013_8105.tsv")) + zh_charset_ext = pynini.string_file(get_abs_path("data/char/charset_extension.tsv")) + + zh_charset = ( + zh_charset_std | zh_charset_ext | pynini.string_file(get_abs_path("data/char/punctuations_zh.tsv")) + ) + en_charset = NEMO_DIGIT | NEMO_ALPHA | NEMO_PUNCT | NEMO_WHITE_SPACE + charset = zh_charset | en_charset + + with open(get_abs_path("data/char/oov_tags.tsv"), "r") as f: + tags = f.readline().strip().split('\t') + assert len(tags) == 2 + ltag, rtag = tags + + oov_charset = pynini.difference(utf8.VALID_UTF8_CHAR, charset) + tag_oov_graph = pynutil.insert(ltag) + oov_charset + pynutil.insert(rtag) + graph @= pynini.cdrewrite(tag_oov_graph, "", "", NEMO_SIGMA).optimize() + + self.fst = graph.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ja/verbalizers/time.py b/zonos3/vendor/nemo_text_processing/text_normalization/ja/verbalizers/time.py new file mode 100644 index 0000000000000000000000000000000000000000..5ebd5555d215467de068f3b8cf55afbf992b32b2 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ja/verbalizers/time.py @@ -0,0 +1,48 @@ +# Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.ja.graph_utils import NEMO_NOT_QUOTE, GraphFst + + +class TimeFst(GraphFst): + """ + Finite state transducer for verbalizing time e.g. + + + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="time", kind="verbalize", deterministic=deterministic) + + hour_component = pynutil.delete("hours: \"") + pynini.closure(NEMO_NOT_QUOTE) + pynutil.delete("\"") + minute_component = pynutil.delete("minutes: \"") + pynini.closure(NEMO_NOT_QUOTE) + pynutil.delete("\"") + second_component = pynutil.delete("seconds: \"") + pynini.closure(NEMO_NOT_QUOTE) + pynutil.delete("\"") + division_component = pynutil.delete("suffix: \"") + pynini.closure(NEMO_NOT_QUOTE) + pynutil.delete("\"") + + graph_basic_time = pynini.closure(division_component + pynutil.delete(" "), 0, 1) + ( + (hour_component + pynutil.delete(" ") + minute_component + pynutil.delete(" ") + second_component) + | (hour_component + pynutil.delete(" ") + minute_component) + | hour_component + | minute_component + | second_component + ) + + final_graph = graph_basic_time + + delete_tokens = self.delete_tokens(final_graph) + self.fst = delete_tokens.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ja/verbalizers/verbalize.py b/zonos3/vendor/nemo_text_processing/text_normalization/ja/verbalizers/verbalize.py new file mode 100644 index 0000000000000000000000000000000000000000..e9632e2968147c40e690bfb7bcb23f88593a3240 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ja/verbalizers/verbalize.py @@ -0,0 +1,66 @@ +# Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import pynini + +from zonos3.vendor.nemo_text_processing.text_normalization.ja.graph_utils import GraphFst, delete_space +from zonos3.vendor.nemo_text_processing.text_normalization.ja.verbalizers.cardinal import CardinalFst +from zonos3.vendor.nemo_text_processing.text_normalization.ja.verbalizers.date import DateFst +from zonos3.vendor.nemo_text_processing.text_normalization.ja.verbalizers.decimal import DecimalFst +from zonos3.vendor.nemo_text_processing.text_normalization.ja.verbalizers.fraction import FractionFst +from zonos3.vendor.nemo_text_processing.text_normalization.ja.verbalizers.ordinal import OrdinalFst +from zonos3.vendor.nemo_text_processing.text_normalization.ja.verbalizers.time import TimeFst +from zonos3.vendor.nemo_text_processing.text_normalization.ja.verbalizers.whitelist import WhiteListFst +from zonos3.vendor.nemo_text_processing.text_normalization.ja.verbalizers.word import WordFst + + +class VerbalizeFst(GraphFst): + """ + Composes other verbalizer grammars. + For deployment, this grammar will be compiled and exported to OpenFst Finate State Archiv (FAR) File. + More details to deployment at NeMo/tools/text_processing_deployment. + Args: + deterministic: if True will provide a single transduction option, + for False multiple options (used for audio-based normalization) + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="verbalize", kind="verbalize", deterministic=deterministic) + + date = DateFst(deterministic=deterministic) + cardinal = CardinalFst(deterministic=deterministic) + ordinal = OrdinalFst(deterministic=deterministic) + decimal = DecimalFst(deterministic=deterministic) + word = WordFst(deterministic=deterministic) + fraction = FractionFst(deterministic=deterministic) + + # money = MoneyFst(decimal=decimal, deterministic=deterministic) + # measure = MeasureFst(cardinal=cardinal, decimal=decimal, fraction=fraction, deterministic=deterministic) + time = TimeFst(deterministic=deterministic) + whitelist = WhiteListFst(deterministic=deterministic) + + graph = pynini.union( + date.fst, + cardinal.fst, + ordinal.fst, + decimal.fst, + fraction.fst, + word.fst, + time.fst, + whitelist.fst, + ) + graph = pynini.closure(delete_space) + graph + pynini.closure(delete_space) + + self.fst = graph.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ja/verbalizers/verbalize_final.py b/zonos3/vendor/nemo_text_processing/text_normalization/ja/verbalizers/verbalize_final.py new file mode 100644 index 0000000000000000000000000000000000000000..8f8638bf6d18145e0c1026b447247bd982316d8f --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ja/verbalizers/verbalize_final.py @@ -0,0 +1,54 @@ +# Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import os + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.ja.graph_utils import GraphFst, delete_space +from zonos3.vendor.nemo_text_processing.text_normalization.ja.verbalizers.postprocessor import PostProcessor +from zonos3.vendor.nemo_text_processing.text_normalization.ja.verbalizers.verbalize import VerbalizeFst + +# from nemo.utils import logging + + +class VerbalizeFinalFst(GraphFst): + """ """ + + def __init__(self, deterministic: bool = True, cache_dir: str = None, overwrite_cache: bool = False): + super().__init__(name="verbalize_final", kind="verbalize", deterministic=deterministic) + far_file = None + if cache_dir is not None and cache_dir != "None": + os.makedirs(cache_dir, exist_ok=True) + far_file = os.path.join(cache_dir, f"jp_tn_{deterministic}_deterministic_verbalizer.far") + if not overwrite_cache and far_file and os.path.exists(far_file): + self.fst = pynini.Far(far_file, mode="r")["verbalize"] + else: + token_graph = VerbalizeFst(deterministic=deterministic) + + token_verbalizer = ( + pynutil.delete("tokens {") + delete_space + token_graph.fst + delete_space + pynutil.delete(" }") + ) + verbalizer = pynini.closure(delete_space + token_verbalizer + delete_space) + + postprocessor = PostProcessor( + remove_puncts=False, + to_upper=False, + to_lower=False, + tag_oov=False, + ) + + self.fst = (verbalizer @ postprocessor.fst).optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ja/verbalizers/whitelist.py b/zonos3/vendor/nemo_text_processing/text_normalization/ja/verbalizers/whitelist.py new file mode 100644 index 0000000000000000000000000000000000000000..bf6825983184d3786c660492774128e8cf8587a8 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ja/verbalizers/whitelist.py @@ -0,0 +1,38 @@ +# Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.ja.graph_utils import NEMO_CHAR, NEMO_SIGMA, GraphFst, delete_space + + +class WhiteListFst(GraphFst): + """ + Finite state transducer for verbalizing whitelist + e.g. tokens { name: "ミスター" } } -> ミスター + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="whitelist", kind="verbalize", deterministic=deterministic) + graph = ( + pynutil.delete("name:") + + delete_space + + pynutil.delete("\"") + + pynini.closure(NEMO_CHAR - " ", 1) + + pynutil.delete("\"") + ) + graph = graph @ pynini.cdrewrite(pynini.cross(u"\u00a0", " "), "", "", NEMO_SIGMA) + self.fst = graph.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ja/verbalizers/word.py b/zonos3/vendor/nemo_text_processing/text_normalization/ja/verbalizers/word.py new file mode 100644 index 0000000000000000000000000000000000000000..b4ada19d219b0aa2eeeeb14ff96d38952c36d649 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ja/verbalizers/word.py @@ -0,0 +1,31 @@ +# Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.ja.graph_utils import NEMO_NOT_QUOTE, GraphFst + + +class WordFst(GraphFst): + ''' + tokens { char: "文字" } -> 文字 + ''' + + def __init__(self, deterministic: bool = True): + super().__init__(name="char", kind="verbalize", deterministic=deterministic) + + graph = pynutil.delete("name: \"") + NEMO_NOT_QUOTE + pynutil.delete("\"") + + self.fst = graph.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ko/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/ko/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..db3fb4be8b0204b9def86554d68719f01fc2313f --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ko/__init__.py @@ -0,0 +1,17 @@ +# Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from zonos3.vendor.nemo_text_processing.text_normalization.en.taggers.tokenize_and_classify import ClassifyFst +from zonos3.vendor.nemo_text_processing.text_normalization.en.verbalizers.verbalize import VerbalizeFst +from zonos3.vendor.nemo_text_processing.text_normalization.en.verbalizers.verbalize_final import VerbalizeFinalFst diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ko/data/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/ko/data/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..341a77c5bc66dee5d2ba0edf888f91e5bf225e3c --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ko/data/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ko/data/date/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/ko/data/date/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..341a77c5bc66dee5d2ba0edf888f91e5bf225e3c --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ko/data/date/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ko/data/date/exceptions.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/ko/data/date/exceptions.tsv new file mode 100644 index 0000000000000000000000000000000000000000..2f54cee9202f9560342238f8b3fa87c62c0d40ec --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ko/data/date/exceptions.tsv @@ -0,0 +1,2 @@ +6 유 +10 시 \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ko/data/date/week.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/ko/data/date/week.tsv new file mode 100644 index 0000000000000000000000000000000000000000..bc205bc3fc62050b5456aa2b4452e805c5bf32d9 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ko/data/date/week.tsv @@ -0,0 +1,8 @@ +월 월요일 +화 화요일 +수 수요일 +목 목요일 +금 금요일 +토 토요일 +일 일요일 +공 공휴일 \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ko/data/electronic/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/ko/data/electronic/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..341a77c5bc66dee5d2ba0edf888f91e5bf225e3c --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ko/data/electronic/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ko/data/electronic/cc_cues.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/ko/data/electronic/cc_cues.tsv new file mode 100644 index 0000000000000000000000000000000000000000..f562cfbad85a2b894e34df79a89fdd9f19361f14 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ko/data/electronic/cc_cues.tsv @@ -0,0 +1,11 @@ +카드 끝자리 카드 끝자리 +카드 마지막 네자리 카드 마지막 네자리 +카드 마지막 4자리 카드 마지막 네자리 +신용카드 번호 신용카드 번호 +신용카드 신용카드 +체크카드 번호 체크카드 번호 +체크카드 체크카드 +카드번호 카드번호 +결제 카드 결제 카드 +결제카드 결제카드 +카드 카드 \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ko/data/electronic/domain.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/ko/data/electronic/domain.tsv new file mode 100644 index 0000000000000000000000000000000000000000..3d04ca29838cc4e2839b37fc02b664cdbf03a695 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ko/data/electronic/domain.tsv @@ -0,0 +1,28 @@ +.com 닷컴 +.org 닷 오알지 +.gov 닷 거브 +.edu 닷 에듀 +.net 닷 넷 +.ai 닷 에이아이 +.io 닷 아이오 +.dev 닷 데브 +.app 닷 앱 +.cloud 닷 클라우드 +.shop 닷 샵 +.store 닷 스토어 +.co 닷 씨오 +.me 닷 미 +.kr 닷 케이알 +.co.kr 닷 씨오 닷 케이알 +.ac.kr 닷 에이씨 닷 케이알 +.or.kr 닷 오알 닷 케이알 +.go.kr 닷 지오 닷 케이알 +.re.kr 닷 알이 닷 케이알 +.cn 닷 씨엔 +.fr 닷 에프알 +.de 닷 디이 +.it 닷 아이티 +.uk 닷 유케이 +.br 닷 비알 +.in 닷 아이엔 +.ru 닷 알유 \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ko/data/electronic/extensions.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/ko/data/electronic/extensions.tsv new file mode 100644 index 0000000000000000000000000000000000000000..c80d08a6917ec3e04d228fe1a132f36f63eade9e --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ko/data/electronic/extensions.tsv @@ -0,0 +1,6 @@ +.jpg 닷 제이피지 +.png 닷 피엔지 +.pdf 닷 피디에프 +.JPG 닷 제이피지 +.PNG 닷 피엔지 +.PDF 닷 피디에프 \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ko/data/electronic/symbol.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/ko/data/electronic/symbol.tsv new file mode 100644 index 0000000000000000000000000000000000000000..f551dabf40174eed9e239d55b438b3b8809a931d --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ko/data/electronic/symbol.tsv @@ -0,0 +1,12 @@ +@ 골뱅이 +. 점 +/ 슬래시 +- 대시 +_ 언더바 +: 콜론 +? 물음표 += 이퀄 +& 앰퍼샌드 +% 퍼센트 ++ 플러스 +# 샵 diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ko/data/measure/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/ko/data/measure/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..341a77c5bc66dee5d2ba0edf888f91e5bf225e3c --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ko/data/measure/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ko/data/measure/unit.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/ko/data/measure/unit.tsv new file mode 100644 index 0000000000000000000000000000000000000000..ccec41e7f777a5656684203ff909d1aa469def9a --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ko/data/measure/unit.tsv @@ -0,0 +1,18 @@ +kg 킬로그램 +g 그램 +km 킬로미터 +m 미터 +cm 센티미터 +mm 밀리미터 +L 리터 +l 리터 +mL 밀리리터 +ml 밀리리터 +h 시간 +s 초 +N 뉴턴 +W 와트 +Hz 헤르츠 +° 도 +% 퍼센트 +rpm 분당회전수 \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ko/data/money/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/ko/data/money/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..341a77c5bc66dee5d2ba0edf888f91e5bf225e3c --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ko/data/money/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ko/data/money/currency_major.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/ko/data/money/currency_major.tsv new file mode 100644 index 0000000000000000000000000000000000000000..a5ddfeb45ca77d01a65e64473d4abfc67925a0c8 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ko/data/money/currency_major.tsv @@ -0,0 +1,22 @@ +₩ 원 +KRW 원 +krw 원 +$ 달러 +US$ 달러 +HK$ 홍콩 달러 +hk$ 홍콩 달러 +€ 유로 +EUR 유로 +¥ 엔 +JPY 엔 +CAD 캐나다 달러 +cad 캐나다 달러 +NZD 뉴질랜드 달러 +nzd 뉴질랜드 달러 +CHF 스위스 프랑 +chf 스위스 프랑 +AED 아랍에미리트 디르함 +aed 아랍에미리트 디르함 +Dh 디르함 +DH 디르함 +Dhs. 디르함 \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ko/data/number/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/ko/data/number/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..341a77c5bc66dee5d2ba0edf888f91e5bf225e3c --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ko/data/number/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ko/data/number/counter_suffix.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/ko/data/number/counter_suffix.tsv new file mode 100644 index 0000000000000000000000000000000000000000..6c48f5e7d3418d91eafa51a584558dac4596f356 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ko/data/number/counter_suffix.tsv @@ -0,0 +1,16 @@ +개 +명 +병 +마리 +송이 +포기 +사람 +자루 +채 +켤레 +그루 +벌 +잔 +장 +권 +살 \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ko/data/number/digit.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/ko/data/number/digit.tsv new file mode 100644 index 0000000000000000000000000000000000000000..61a7dddcf7a4d8f0b10a4018ced520f27452061e --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ko/data/number/digit.tsv @@ -0,0 +1,9 @@ +1 일 +2 이 +3 삼 +4 사 +5 오 +6 육 +7 칠 +8 팔 +9 구 \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ko/data/number/native_ones.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/ko/data/number/native_ones.tsv new file mode 100644 index 0000000000000000000000000000000000000000..f9926b64bae62f0694c282f6bda3e9b3cd58a51e --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ko/data/number/native_ones.tsv @@ -0,0 +1,9 @@ +1 한 +2 두 +3 세 +4 네 +5 다섯 +6 여섯 +7 일곱 +8 여덟 +9 아홉 \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ko/data/number/tens.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/ko/data/number/tens.tsv new file mode 100644 index 0000000000000000000000000000000000000000..d8b8e0a2b6a2c22f410818c8b384466a82a41355 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ko/data/number/tens.tsv @@ -0,0 +1,9 @@ +1 십 +2 이십 +3 삼십 +4 사십 +5 오십 +6 육십 +7 칠십 +8 팔십 +9 구십 \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ko/data/number/zero.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/ko/data/number/zero.tsv new file mode 100644 index 0000000000000000000000000000000000000000..7024c053491118d051d72dc10ea82c0d668bbcbb --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ko/data/number/zero.tsv @@ -0,0 +1 @@ +0 영 \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ko/data/ordinal/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/ko/data/ordinal/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..341a77c5bc66dee5d2ba0edf888f91e5bf225e3c --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ko/data/ordinal/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ko/data/ordinal/digit.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/ko/data/ordinal/digit.tsv new file mode 100644 index 0000000000000000000000000000000000000000..b3efc4cef2fd05cb1fdbec0b4deb79b7e1030b9d --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ko/data/ordinal/digit.tsv @@ -0,0 +1,8 @@ +2 두 +3 세 +4 네 +5 다섯 +6 여섯 +7 일곱 +8 여덟 +9 아홉 \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ko/data/ordinal/exceptions.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/ko/data/ordinal/exceptions.tsv new file mode 100644 index 0000000000000000000000000000000000000000..ad796a0e8a665ecafc8c1db1a1af8674b316e101 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ko/data/ordinal/exceptions.tsv @@ -0,0 +1,5 @@ +1 첫 +11 열한 +20 스무 +21 스물한 +31 서른한 diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ko/data/ordinal/tens.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/ko/data/ordinal/tens.tsv new file mode 100644 index 0000000000000000000000000000000000000000..994a21a1d2d100a5c19cc47b37566b2dfed1494e --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ko/data/ordinal/tens.tsv @@ -0,0 +1,2 @@ +10 열 +30 서른 \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ko/data/ordinal/tens_prefix.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/ko/data/ordinal/tens_prefix.tsv new file mode 100644 index 0000000000000000000000000000000000000000..3111a82dc47762414092c0af425476b702d6b26b --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ko/data/ordinal/tens_prefix.tsv @@ -0,0 +1,3 @@ +1 열 +2 스물 +3 서른 \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ko/data/time/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/ko/data/time/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..341a77c5bc66dee5d2ba0edf888f91e5bf225e3c --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ko/data/time/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ko/data/time/division.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/ko/data/time/division.tsv new file mode 100644 index 0000000000000000000000000000000000000000..9250d0a8fba97f883a44552558130c7cabc6ce16 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ko/data/time/division.tsv @@ -0,0 +1,7 @@ +오전 +오후 +새벽 +아침 +낮 +저녁 +밤 \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ko/data/time/hour.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/ko/data/time/hour.tsv new file mode 100644 index 0000000000000000000000000000000000000000..abfccd31040ae46db799513226ad11c70b32bf5b --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ko/data/time/hour.tsv @@ -0,0 +1,12 @@ +1 한 +2 두 +3 세 +4 네 +5 다섯 +6 여섯 +7 일곱 +8 여덟 +9 아홉 +10 열 +11 열한 +12 열두 \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ko/data/whitelist.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/ko/data/whitelist.tsv new file mode 100644 index 0000000000000000000000000000000000000000..82dc1220e09eba1ee8f7b33c76cdd15f7caab094 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ko/data/whitelist.tsv @@ -0,0 +1,38 @@ +Dr. 박사 +dr. 박사 +Mr. 씨 +mr. 씨 +Ms. 양 +ms. 양 +Mrs. 여사 +mrs. 여사 +mt. 산 +Mt. 산 +Prof. 교수 +prof. 교수 +sr. 시니어 +Sr. 시니어 +jr. 주니어 +Jr. 주니어 +rd. 로 +Rd. 로 +Ave. 대로 +ave. 대로 +no. 번호 +No. 번호 +( 왼쪽 괄호 +) 오른쪽 괄호 ++ 더하기 +- 마이너스 +Σ 시그마 +η 에타 +κ 카파 +ω 오메가 +σ 시그마 +α 알파 +ν 뉴 +δ 델타 +ι 이오타 +vs. 대 +Ph.D. 박사학위 +etc. 등 diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ko/graph_utils.py b/zonos3/vendor/nemo_text_processing/text_normalization/ko/graph_utils.py new file mode 100644 index 0000000000000000000000000000000000000000..28178bc15da3c07a0390a40ce9c56b0baa322fe7 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ko/graph_utils.py @@ -0,0 +1,173 @@ +# Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved. +# Copyright 2015 and onwards Google, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import os +import string +from pathlib import Path +from typing import Dict + +import pynini +from pynini import Far +from pynini.export import export +from pynini.lib import byte, pynutil, utf8 + +from zonos3.vendor.nemo_text_processing.text_normalization.en.utils import load_labels +from zonos3.vendor.nemo_text_processing.utils.logging import logger + +NEMO_CHAR = utf8.VALID_UTF8_CHAR + +NEMO_DIGIT = byte.DIGIT +NEMO_ALPHA = pynini.union(*[chr(i) for i in range(ord('가'), ord('힣') + 1)]).optimize() +NEMO_ALNUM = pynini.union(NEMO_DIGIT, NEMO_ALPHA).optimize() +NEMO_HEX = pynini.union(*string.hexdigits).optimize() +NEMO_SPACE = " " +NEMO_WHITE_SPACE = pynini.union(" ", "\t", "\n", "\r", "\u00a0").optimize() +NEMO_NOT_SPACE = pynini.difference(NEMO_CHAR, NEMO_WHITE_SPACE).optimize() +NEMO_NOT_QUOTE = pynini.difference(NEMO_CHAR, r'"').optimize() + +NEMO_PUNCT = pynini.union(*map(pynini.escape, string.punctuation)).optimize() +NEMO_GRAPH = pynini.union(NEMO_ALNUM, NEMO_PUNCT).optimize() + +NEMO_SIGMA = pynini.closure(NEMO_CHAR) + +delete_space = pynutil.delete(pynini.closure(NEMO_WHITE_SPACE)) +delete_zero_or_one_space = pynutil.delete(pynini.closure(NEMO_WHITE_SPACE, 0, 1)) +insert_space = pynutil.insert(" ") +delete_extra_space = pynini.cross(pynini.closure(NEMO_WHITE_SPACE, 1), " ") +delete_preserve_order = pynini.closure( + pynutil.delete(" preserve_order: true") + | (pynutil.delete(' field_order: "') + NEMO_NOT_QUOTE + pynutil.delete('"')) +) + + +# Common string literals; expand as you see fit. +username_string = "username" +double_quotes = '"' +domain_string = "domain" +protocol_string = "protocol" +slash = "/" +double_slash = "//" +triple_slash = "///" +file = "file" +period = "." +at = "@" +colon = ":" +https = "https" +http = "http" +www = "www" + + +def generator_main(file_name: str, graphs: Dict[str, "pynini.FstLike"]): + """ + Exports graph as OpenFst finite state archive (FAR) file with given file name and rule name. + + Args: + file_name: exported file name + graphs: Mapping of a rule name and Pynini WFST graph to be exported + """ + exporter = export.Exporter(file_name) + for rule, graph in graphs.items(): + exporter[rule] = graph.optimize() + exporter.close() + logger.info(f"Created {file_name}") + + +def convert_space(fst) -> "pynini.FstLike": + """ + Converts space to nonbreaking space. + Used only in tagger grammars for transducing token values within quotes, e.g. name: "hello kitty" + This is making transducer significantly slower, so only use when there could be potential spaces within quotes, otherwise leave it. + + Args: + fst: input fst + + Returns output fst where breaking spaces are converted to non breaking spaces + """ + return fst @ pynini.cdrewrite(pynini.cross(NEMO_SPACE, "\u00a0"), "", "", NEMO_SIGMA) + + +def string_map_cased(input_file: str, input_case: str = "lower_cased"): + labels = load_labels(input_file) + whitelist = pynini.string_map(labels).invert().optimize() + return whitelist + + +class GraphFst: + """ + Base class for all grammar fsts. + + Args: + name: name of grammar class + kind: either 'classify' or 'verbalize' + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, name: str, kind: str, deterministic: bool = True): + self.name = name + self.kind = kind + self._fst = None + self.deterministic = deterministic + + self.far_path = Path(os.path.dirname(__file__) + "/grammars/" + kind + "/" + name + ".far") + if self.far_exist(): + self._fst = Far(self.far_path, mode="r", arc_type="standard", far_type="default").get_fst() + + def far_exist(self) -> bool: + """ + Returns true if FAR can be loaded + """ + return self.far_path.exists() + + @property + def fst(self) -> "pynini.FstLike": + return self._fst + + @fst.setter + def fst(self, fst): + self._fst = fst + + def add_tokens(self, fst) -> "pynini.FstLike": + """ + Wraps class name around to given fst + + Args: + fst: input fst + + Returns: + Fst: fst + """ + return pynutil.insert(f"{self.name} {{ ") + fst + pynutil.insert(" }") + + def delete_tokens(self, fst) -> "pynini.FstLike": + """ + Deletes class name wrap around output of given fst + + Args: + fst: input fst + + Returns: + Fst: fst + """ + res = ( + pynutil.delete(f"{self.name}") + + delete_space + + pynutil.delete("{") + + delete_space + + fst + + delete_space + + pynutil.delete("}") + ) + return res @ pynini.cdrewrite(pynini.cross("\u00a0", " "), "", "", NEMO_SIGMA) diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ko/taggers/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/ko/taggers/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..341a77c5bc66dee5d2ba0edf888f91e5bf225e3c --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ko/taggers/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ko/taggers/cardinal.py b/zonos3/vendor/nemo_text_processing/text_normalization/ko/taggers/cardinal.py new file mode 100644 index 0000000000000000000000000000000000000000..c341e2d9824ba5181d50584034a0a0b6a34ff4e7 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ko/taggers/cardinal.py @@ -0,0 +1,327 @@ +# Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.ko.graph_utils import NEMO_DIGIT, NEMO_SPACE, GraphFst +from zonos3.vendor.nemo_text_processing.text_normalization.ko.utils import get_abs_path + + +class CardinalFst(GraphFst): + def __init__(self, deterministic: bool = True): + super().__init__(name="cardinal", kind="classify", deterministic=deterministic) + + # Optional small whitespace inside parentheses or after signs + ws = pynini.closure(NEMO_SPACE, 0, 2) + + # Load base .tsv files + graph_zero = pynini.string_file(get_abs_path("data/number/zero.tsv")) + graph_digit = pynini.string_file(get_abs_path("data/number/digit.tsv")) + + digit_except_one = pynini.difference(NEMO_DIGIT, "1") + digit_except_zero_one = pynini.difference(digit_except_one, "0") + + graph_digit_no_zero_one = digit_except_zero_one @ graph_digit + graph_tens = pynini.string_file(get_abs_path("data/number/tens.tsv")) + + # Compose all basic number forms + graph_1_to_99 = (graph_tens + (graph_digit | pynutil.delete('0'))) | graph_digit + + hundreds = NEMO_DIGIT**3 + graph_hundred_component = ( + pynini.cross('1', '백') | (graph_digit_no_zero_one + pynutil.insert('백')) + ) + pynini.union(pynini.closure(pynutil.delete('0')), (pynini.closure(pynutil.delete('0')) + graph_1_to_99)) + graph_hundred = hundreds @ graph_hundred_component + + thousands = NEMO_DIGIT**4 + graph_thousand_component = pynini.union( + pynini.cross('1', '천'), + graph_digit_no_zero_one + pynutil.insert('천'), + ) + pynini.union( + pynini.closure(pynutil.delete('0')), + graph_hundred_component, + (pynini.closure(pynutil.delete('0')) + graph_1_to_99), + ) + graph_thousand = thousands @ graph_thousand_component + + ten_thousands = NEMO_DIGIT**5 + graph_ten_thousand_component = pynini.union( + pynini.cross('1', '만'), + graph_digit_no_zero_one + pynutil.insert('만'), + ) + pynini.union( + pynini.closure(pynutil.delete('0')), + graph_thousand_component, + (pynutil.delete('0') + graph_hundred_component), + (pynini.closure(pynutil.delete('0')) + graph_1_to_99), + ) + graph_ten_thousand = ten_thousands @ graph_ten_thousand_component + + hundred_thousands = NEMO_DIGIT**6 + graph_hundred_thousand_component = ((NEMO_DIGIT**2 @ graph_1_to_99) + pynutil.insert("만")) + pynini.union( + pynini.closure(pynutil.delete("0")), + graph_thousand_component, + (pynutil.delete("0") + graph_hundred_component), + (pynini.closure(pynutil.delete("0")) + graph_1_to_99), + ) + graph_hundred_thousand = hundred_thousands @ graph_hundred_thousand_component + + millions = NEMO_DIGIT**7 + graph_million_component = ((graph_hundred) + pynutil.insert('만')) + pynini.union( + pynini.closure(pynutil.delete('0')), + graph_thousand_component, + (pynutil.delete('0') + graph_hundred_component), + (pynini.closure(pynutil.delete('0')) + graph_1_to_99), + ) + graph_million = millions @ graph_million_component + + ten_millions = NEMO_DIGIT**8 + graph_ten_million_component = ((graph_thousand) + pynutil.insert('만')) + pynini.union( + pynini.closure(pynutil.delete('0')), + graph_thousand_component, + (pynutil.delete('0') + graph_hundred_component), + (pynini.closure(pynutil.delete('0')) + graph_1_to_99), + ) + graph_ten_million = ten_millions @ graph_ten_million_component + + hundred_millions = NEMO_DIGIT**9 + graph_hundred_million_component = (graph_digit + pynutil.insert('억')) + pynini.union( + pynini.closure(pynutil.delete('0')), + graph_ten_million_component, + (pynutil.delete('0') + graph_million_component), + (pynutil.delete('00') + graph_hundred_thousand_component), + (pynutil.delete('000') + graph_ten_thousand_component), + (pynutil.delete('0000') + graph_thousand_component), + ((pynutil.delete('00000') + graph_hundred_component)), + (pynini.closure(pynutil.delete('0')) + graph_1_to_99), + ) + graph_hundred_million = hundred_millions @ graph_hundred_million_component + + thousand_millions = NEMO_DIGIT**10 + graph_thousand_million_component = ((NEMO_DIGIT**2 @ graph_1_to_99) + pynutil.insert('억')) + pynini.union( + pynini.closure(pynutil.delete('0')), + graph_ten_million_component, + (pynutil.delete('0') + graph_million_component), + (pynutil.delete('00') + graph_hundred_thousand_component), + (pynutil.delete('000') + graph_ten_thousand_component), + (pynutil.delete('0000') + graph_thousand_component), + ((pynutil.delete('00000') + graph_hundred_component)), + (pynini.closure(pynutil.delete('0')) + graph_1_to_99), + ) + graph_thousand_million = thousand_millions @ graph_thousand_million_component + + billions = NEMO_DIGIT**11 + graph_billions_component = ((graph_hundred) + pynutil.insert('억')) + pynini.union( + pynini.closure(pynutil.delete('0')), + graph_ten_million_component, + (pynutil.delete('0') + graph_million_component), + (pynutil.delete('00') + graph_hundred_thousand_component), + (pynutil.delete('000') + graph_ten_thousand_component), + (pynutil.delete('0000') + graph_thousand_component), + ((pynutil.delete('00000') + graph_hundred_component)), + (pynini.closure(pynutil.delete('0')) + graph_1_to_99), + ) + graph_billions = billions @ graph_billions_component + + ten_billions = NEMO_DIGIT**12 + graph_ten_billions_component = ((graph_thousand) + pynutil.insert('억')) + pynini.union( + pynini.closure(pynutil.delete('0')), + graph_ten_million_component, + (pynutil.delete('0') + graph_million_component), + (pynutil.delete('00') + graph_hundred_thousand_component), + (pynutil.delete('000') + graph_ten_thousand_component), + (pynutil.delete('0000') + graph_thousand_component), + ((pynutil.delete('00000') + graph_hundred_component)), + (pynini.closure(pynutil.delete('0')) + graph_1_to_99), + ) + graph_ten_billions = ten_billions @ graph_ten_billions_component + + hundred_billions = NEMO_DIGIT**13 + graph_hundred_billions_component = (graph_digit + pynutil.insert('조')) + pynini.union( + pynini.closure(pynutil.delete('0')), + graph_ten_billions_component, + pynutil.delete('0') + graph_billions_component, + pynutil.delete('00') + graph_thousand_million_component, + pynutil.delete('000') + graph_hundred_million_component, + pynutil.delete('0000') + graph_ten_million_component, + pynutil.delete('00000') + graph_million_component, + pynutil.delete('000000') + graph_hundred_thousand_component, + pynutil.delete('0000000') + graph_ten_thousand_component, + pynutil.delete('00000000') + graph_thousand_component, + pynutil.delete('000000000') + graph_hundred_component, + (pynini.closure(pynutil.delete('0')) + graph_1_to_99), + ) + graph_hundred_billions = hundred_billions @ graph_hundred_billions_component + + trillion = NEMO_DIGIT**14 + graph_trillion_component = ( + (NEMO_DIGIT**2 @ graph_1_to_99) + + pynutil.insert('조') + + pynini.union( + pynini.closure(pynutil.delete('0')), + graph_ten_billions_component, + pynutil.delete('0') + graph_billions_component, + pynutil.delete('00') + graph_thousand_million_component, + pynutil.delete('000') + graph_hundred_million_component, + pynutil.delete('0000') + graph_ten_million_component, + pynutil.delete('00000') + graph_million_component, + pynutil.delete('000000') + graph_hundred_thousand_component, + pynutil.delete('0000000') + graph_ten_thousand_component, + pynutil.delete('00000000') + graph_thousand_component, + pynutil.delete('000000000') + graph_hundred_component, + (pynini.closure(pynutil.delete('0')) + graph_1_to_99), + ) + ) + graph_trillions = trillion @ graph_trillion_component + + ten_trillions = NEMO_DIGIT**15 + graph_ten_trillions_component = ( + (graph_hundred) + + pynutil.insert('조') + + pynini.union( + pynini.closure(pynutil.delete('0')), + graph_ten_billions_component, + pynutil.delete('0') + graph_billions_component, + pynutil.delete('00') + graph_thousand_million_component, + pynutil.delete('000') + graph_hundred_million_component, + pynutil.delete('0000') + graph_ten_million_component, + pynutil.delete('00000') + graph_million_component, + pynutil.delete('000000') + graph_hundred_thousand_component, + pynutil.delete('0000000') + graph_ten_thousand_component, + pynutil.delete('00000000') + graph_thousand_component, + pynutil.delete('000000000') + graph_hundred_component, + (pynini.closure(pynutil.delete('0')) + graph_1_to_99), + ) + ) + graph_ten_trillions = ten_trillions @ graph_ten_trillions_component + + hundred_trillions = NEMO_DIGIT**16 + graph_hundred_trillions_component = ( + (graph_thousand) + + pynutil.insert('조') + + pynini.union( + pynini.closure(pynutil.delete('0')), + graph_ten_billions_component, + pynutil.delete('0') + graph_billions_component, + pynutil.delete('00') + graph_thousand_million_component, + pynutil.delete('000') + graph_hundred_million_component, + pynutil.delete('0000') + graph_ten_million_component, + pynutil.delete('00000') + graph_million_component, + pynutil.delete('000000') + graph_hundred_thousand_component, + pynutil.delete('0000000') + graph_ten_thousand_component, + pynutil.delete('00000000') + graph_thousand_component, + pynutil.delete('000000000') + graph_hundred_component, + (pynini.closure(pynutil.delete('0')) + graph_1_to_99), + ) + ) + graph_hundred_trillions = hundred_trillions @ graph_hundred_trillions_component + + thousand_trillions = NEMO_DIGIT**17 + graph_thousand_trillions_component = ( + graph_digit + + pynutil.insert('경') + + pynini.union( + pynini.closure(pynutil.delete('0')), + graph_hundred_trillions_component, + pynutil.delete('0') + graph_ten_trillions_component, + pynutil.delete('00') + graph_trillion_component, + pynutil.delete('000') + graph_hundred_billions_component, + pynutil.delete('0000') + graph_ten_billions_component, + pynutil.delete('00000') + graph_billions_component, + pynutil.delete('000000') + graph_thousand_million_component, + pynutil.delete('0000000') + graph_hundred_million_component, + pynutil.delete('00000000') + graph_ten_million_component, + pynutil.delete('000000000') + graph_million_component, + pynutil.delete('0000000000') + graph_hundred_thousand_component, + pynutil.delete('00000000000') + graph_ten_thousand_component, + pynutil.delete('000000000000') + graph_thousand_component, + pynutil.delete('0000000000000') + graph_hundred_component, + (pynini.closure(pynutil.delete('0')) + graph_1_to_99), + ) + ) + graph_thousand_trillions = thousand_trillions @ graph_thousand_trillions_component + + # FST + graph_num = pynini.union( + graph_thousand_trillions, + graph_hundred_trillions, + graph_ten_trillions, + graph_trillions, + graph_hundred_billions, + graph_ten_billions, + graph_billions, + graph_thousand_million, + graph_hundred_million, + graph_ten_million, + graph_million, + graph_hundred_thousand, + graph_ten_thousand, + graph_thousand, + graph_hundred, + graph_1_to_99, + graph_zero, + ).optimize() + + # ---------------------------- + # Native counting + counters + # e.g., 3개, 2명, 10살 + # + # In Korean, counters require native numeral forms + # for small numbers (한/두/세…, 열/스무/서른…). + counter_suffix = pynini.string_file(get_abs_path("data/number/counter_suffix.tsv")) + counter_suffix_accep = pynini.project(counter_suffix, "input").optimize() + + native_ones = pynini.string_file(get_abs_path("data/number/native_ones.tsv")) # 1~9: 한/두/세/... + ordinal_tens = pynini.string_file(get_abs_path("data/ordinal/tens.tsv")) # 10=열, 20=스무, 30=서른 + ordinal_tens_prefix = pynini.string_file(get_abs_path("data/ordinal/tens_prefix.tsv")) # 열/스물/서른 + + native_11_to_39 = (ordinal_tens_prefix + native_ones).optimize() + native_1_to_39 = pynini.union(native_ones, ordinal_tens, native_11_to_39).optimize() + + # Compose number + counter as one cardinal token + counter_case = ( + pynutil.insert('integer: "') + + native_1_to_39 + + pynutil.insert('" ') + + pynutil.insert('counter: "') + + counter_suffix_accep + + pynutil.insert('"') + ).optimize() + + # Sign and final formatting + # Build the integer token (integer: "...") + integer_token = pynutil.insert('integer: "') + graph_num + pynutil.insert('"') + + # Sign handling: + # - minus sets negative flag + # - plus is ignored (positive number) + minus_prefix = pynutil.insert('negative: "true" ') + pynutil.delete("-") + plus_prefix = pynutil.delete("+") + + # Accounting negative: "( 1,234 )" -> negative + integer:"1234" + paren_negative = ( + pynutil.insert('negative: "true" ') + pynutil.delete("(") + ws + integer_token + ws + pynutil.delete(")") + ) + + # Signed number: optional (+|-) + integer + signed_integer = (minus_prefix | plus_prefix).ques + integer_token + + # Prefer accounting-form first, then signed form + final_graph = paren_negative | signed_integer | counter_case + + # Wrap with class tokens and finalize + final_graph = self.add_tokens(final_graph) + self.fst = final_graph.optimize() + self.graph = graph_num diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ko/taggers/date.py b/zonos3/vendor/nemo_text_processing/text_normalization/ko/taggers/date.py new file mode 100644 index 0000000000000000000000000000000000000000..fa43aa0581cf7becceea6f42cfcbe89b7be826d9 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ko/taggers/date.py @@ -0,0 +1,310 @@ +# Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.ko.graph_utils import GraphFst, delete_space, insert_space +from zonos3.vendor.nemo_text_processing.text_normalization.ko.utils import get_abs_path + + +class DateFst(GraphFst): + """ + Finite state transducer for classifying dates in Korean, e.g. + 2024/01/30 -> date { year: "이천이십사" month: "일월" day: "삼십" } + 2024/1/30 -> date { year: "이천이십사" month: "일월" day: "삼십" } + 2024-01-30 -> date { year: "이천이십사" month: "일월" day: "삼십" } + 2024.01.30 -> date { year: "이천이십사" month: "일월" day: "삼십" } + + 기원전233년 -> date { era: "기원전" year: "이백삼십삼년" } + 기원후2024년 -> date { era: "기원후" year: "이천이십사년" } + + 21일월요일 -> tokens { date { day: "이십일일" weekday: "월요일" } } + 1970년대 -> date { year: "천구백칠십년대" } + + 1월1일(월)~3일(수) + -> tokens { date { month: "일월" day: "일일" weekday: "월요일" } } + tokens { name: "부터" } + tokens { date { day: "삼일" weekday: "수요일" } } + + 1970~1980년대 + -> tokens { cardinal { integer: "천구백칠십" } } + tokens { name: "부터" } + tokens { date { year: "천구백팔십년대" } } + + 7월5~9일(월~금) + -> tokens { date { month: "칠월" } } + tokens { cardinal { integer: "오" } } + tokens { name: "부터" } + tokens { date { day: "구일" weekday: "월요일" } } + tokens { name: "부터" } + tokens { date { weekday: "금요일" } } + + 2023년3월1일(수)~6월12일(화) + -> tokens { date { year: "이천이십삼년" month: "삼월" day: "일일" weekday: "수요일" } } + tokens { name: "부터" } + tokens { date { month: "유월" day: "십이일" weekday: "화요일" } } + + Args: + cardinal: CardinalFst + """ + + def __init__(self, cardinal: GraphFst, deterministic: bool = True): + super().__init__(name="date", kind="classify", deterministic=deterministic) + + strip0 = pynini.closure(pynutil.delete("0"), 0, 1) + graph_cardinal = cardinal.graph + cardinal_lz = (strip0 + graph_cardinal).optimize() + + # Load base .tsv files + week = pynini.string_file(get_abs_path("data/date/week.tsv")) + month_exceptions = pynini.string_file(get_abs_path("data/date/exceptions.tsv")) + month_exceptions_inputs = pynini.project(month_exceptions, "input").optimize() + + # Non-exception inputs go through the generic cardinal path + graph_cardinal_non_exceptions = pynini.compose( + pynini.difference(pynini.project(graph_cardinal, "input"), month_exceptions_inputs).optimize(), + graph_cardinal, + ).optimize() + + # Month cardinal: prefer exceptions; + month_cardinal = strip0 + (month_exceptions | graph_cardinal_non_exceptions).optimize() + + era = pynini.union("기원전", "기원후").optimize() + signs = pynutil.delete("/") | pynutil.delete(".") | pynutil.delete("-") + + # Strict digit ranges for M/D/Y and Y/M/D + _d = pynini.union(*[pynini.accep(str(i)) for i in range(10)]) + _1to9 = pynini.union(*[pynini.accep(str(i)) for i in range(1, 10)]) + + # For standalone years: + # - No era: 1–4 digits with NO leading zeros + YEAR_NO_ERA_1TO4 = pynini.closure(pynutil.delete("0"), 0, 3) + _1to9 + pynini.closure(_d, 0, 3) + # - With era (기원전/기원후): allow leading zeros but strip them + YEAR_ERA_1TO4 = pynini.closure(pynutil.delete("0"), 0, 3) + _1to9 + pynini.closure(_d, 0, 3) + + # MM: 01-09 | 10-12 + MM = (pynini.accep("0") + _1to9) | (pynini.accep("1") + pynini.union("0", "1", "2")) + + # DD: 01-09 | 10-19 | 20-29 | 30-31 + DD = ( + (pynini.accep("0") + _1to9) + | (pynini.accep("1") + _d) + | (pynini.accep("2") + _d) + | (pynini.accep("3") + pynini.union("0", "1")) + ) + + # YYYY: exactly 4 digits and two-digit year for M/D/YY and D/M/YY + YYYY = pynini.union("1", "2") + _d + _d + _d + YY = _d + _d + + # Map digits -> cardinal words using existing graphs (strip leading zero via month_cardinal/cardinal_lz) + mm_to_text = pynini.compose(MM, month_cardinal).optimize() + dd_to_text = pynini.compose(DD, cardinal_lz).optimize() + yy_to_text = pynini.compose(YY, graph_cardinal).optimize() + + # Components with tags/suffixes (strict) + month_component_md = ( + pynutil.insert("month: \"") + mm_to_text + pynutil.insert("월") + pynutil.insert("\"") + ).optimize() + day_component_md = ( + pynutil.insert("day: \"") + dd_to_text + pynutil.insert("일") + pynutil.insert("\"") + ).optimize() + year_component_y2 = ( + pynutil.insert("year: \"") + yy_to_text + pynutil.insert("년") + pynutil.insert("\"") + ).optimize() + + # Generic components + era_component = pynutil.insert("era: \"") + era + pynutil.insert("\"") + + # Brackets for weekday + front_bracket = ( + pynini.closure(pynutil.delete(delete_space)) + + pynutil.delete("(") + + pynini.closure(pynutil.delete(delete_space)) + ) | ( + pynini.closure(pynutil.delete(delete_space)) + + pynutil.delete("(") + + pynini.closure(pynutil.delete(delete_space)) + ) + preceding_bracket = ( + pynini.closure(pynutil.delete(delete_space)) + + pynutil.delete(")") + + pynini.closure(pynutil.delete(delete_space)) + ) | ( + pynini.closure(pynutil.delete(delete_space)) + + pynutil.delete(")") + + pynini.closure(pynutil.delete(delete_space)) + ) + + week_component_bracketed = ( + (front_bracket + pynutil.insert("weekday: \"") + week + preceding_bracket + pynutil.insert("\"")) + | ( + front_bracket + + pynutil.insert("weekday: \"") + + week + + pynini.cross("〜", "부터") + + week + + preceding_bracket + + pynutil.insert("\"") + ) + | ( + front_bracket + + pynutil.insert("weekday: \"") + + week + + pynutil.delete("・") + + week + + preceding_bracket + + pynutil.insert("\"") + ) + ) + + week_component_plain = pynutil.insert("weekday: \"") + week + pynutil.insert("\"") + week_component = week_component_bracketed | week_component_plain + + # Strict 4-digit year component (1000–2999) + year_component_y4_strict = ( + pynutil.insert("year: \"") + (YYYY @ graph_cardinal) + pynutil.insert("년") + pynutil.insert("\"") + ).optimize() + + # Prefer strict 4-digit; still allow 2-digit with worse weight (for MM/DD/YY etc.) + year_component_md_strict = (year_component_y4_strict | pynutil.add_weight(year_component_y2, 1.0)).optimize() + + # Format: YYYY/MM/DD(weekday) + graph_basic_date = ( + pynini.closure(era_component + insert_space, 0, 1) + + year_component_y4_strict + + signs + + insert_space + + (pynutil.insert("month: \"") + month_cardinal + pynutil.insert("월") + pynutil.insert("\"")) + + signs + + insert_space + + (pynutil.insert("day: \"") + cardinal_lz + pynutil.insert("일") + pynutil.insert("\"")) + + pynini.closure(pynini.closure(insert_space, 0, 1) + week_component, 0, 1) + ) + + # American: MM/DD/YYYY + graph_american_date = ( + month_component_md + + signs + + insert_space + + day_component_md + + signs + + insert_space + + year_component_md_strict + + pynini.closure(pynini.closure(insert_space, 0, 1) + week_component, 0, 1) + ).optimize() + + # European: DD/MM/YYYY + graph_european_date = ( + day_component_md + + signs + + insert_space + + month_component_md + + signs + + insert_space + + year_component_md_strict + + pynini.closure(pynini.closure(insert_space, 0, 1) + week_component, 0, 1) + ).optimize() + + # Single elements (year/month/day) + individual_year_component = ( + # with era: (기원전|기원후) + 1~4 digits (leading zeros allowed → stripped) + ( + era_component + + insert_space + + pynutil.insert("year: \"") + + (YEAR_ERA_1TO4 @ graph_cardinal) + + pynini.accep("년") + + pynutil.insert("\"") + ) + | + # no era: 1~4 digits, no leading zero + ( + pynutil.insert("year: \"") + + (YEAR_NO_ERA_1TO4 @ graph_cardinal) + + pynini.accep("년") + + pynutil.insert("\"") + ) + ).optimize() + + individual_month_component = ( + pynutil.insert("month: \"") + month_cardinal + pynini.accep("월") + pynutil.insert("\"") + ) + + month_josa = pynini.union("에", "은", "는", "에는") + + individual_month_component_with_josa = ( + pynutil.insert('month: "') + + month_cardinal + + pynini.accep("월") + + pynini.closure(month_josa, 0, 1) + + pynutil.insert('"') + ).optimize() + + individual_day_component = pynutil.insert("day: \"") + cardinal_lz + pynini.accep("일") + pynutil.insert("\"") + + week_full_word_acceptor = pynini.project(week, "output") + week_component_full_word = pynutil.insert("weekday: \"") + week_full_word_acceptor + pynutil.insert("\"") + + day_and_weekday_component = ( + individual_day_component + pynini.closure(insert_space, 0, 1) + week_component_full_word + ) + + month_and_weekday_component = ( + individual_month_component + pynini.closure(insert_space, 0, 1) + week_component_full_word + ) + + graph_individual_component = ( + day_and_weekday_component + | month_and_weekday_component + | individual_year_component + | individual_month_component_with_josa + | individual_month_component + | individual_day_component + | week_component + ) + pynini.closure(insert_space + week_component, 0, 1) + + graph_individual_component_combined = ( + (individual_year_component + insert_space + individual_month_component) + | (individual_month_component + insert_space + individual_day_component) + | ( + individual_year_component + + insert_space + + individual_month_component + + insert_space + + individual_day_component + ) + ) + pynini.closure(insert_space + week_component, 0, 1) + + nendai = pynini.accep("년대") + era_nendai = ( + pynini.closure(era_component + insert_space, 0, 1) + + pynutil.insert("year: \"") + + graph_cardinal + + nendai + + pynutil.insert("\"") + ).optimize() + + graph_all_date = ( + graph_basic_date + | graph_american_date + | graph_european_date + | graph_individual_component + | graph_individual_component_combined + | era_nendai + ).optimize() + + final_graph = self.add_tokens(graph_all_date) + self.fst = final_graph.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ko/taggers/decimal.py b/zonos3/vendor/nemo_text_processing/text_normalization/ko/taggers/decimal.py new file mode 100644 index 0000000000000000000000000000000000000000..4e1fdd8e96677017358b7c09c183a7afaa02f176 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ko/taggers/decimal.py @@ -0,0 +1,76 @@ +# Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.ko.graph_utils import NEMO_SPACE, GraphFst +from zonos3.vendor.nemo_text_processing.text_normalization.ko.utils import get_abs_path + + +class DecimalFst(GraphFst): + """ + Finite state transducer for classifying decimal numbers in Korean, e.g. + 1.23 -> decimal { integer_part: "일" fractional_part: "이삼" } + -0.5 -> decimal { negative: "마이너스" integer_part: "영" fractional_part: "오" } + + Args: + cardinal: CardinalFst + """ + + def __init__(self, cardinal: GraphFst, deterministic: bool = True): + super().__init__(name="decimal", kind="classify", deterministic=deterministic) + + # Use the base cardinal graph for the integer part + base_integer_graph = cardinal.graph + # Only special-case 10000 -> 만 for decimal integer part (if needed) + specials_input = pynini.cross("10000", "만") + + # Try the special mapping first, then fall back to normal cardinal + cardinal_before_decimal = (specials_input | base_integer_graph).optimize() + + cardinal_after_decimal = pynini.string_file(get_abs_path("data/number/digit.tsv")) + zero = pynini.string_file(get_abs_path("data/number/zero.tsv")) + + DOUBLE_QUOTE = '"' + + graph_integer = ( + pynutil.insert(f'integer_part: {DOUBLE_QUOTE}') + cardinal_before_decimal + pynutil.insert(DOUBLE_QUOTE) + ) + graph_fractional = ( + pynutil.insert(f'fractional_part: {DOUBLE_QUOTE}') + + pynini.closure(cardinal_after_decimal | zero, 1) + + pynutil.insert(DOUBLE_QUOTE) + ) + + # Decimal without a sign (e.g., 2.5) + graph_decimal_no_sign = graph_integer + pynutil.delete('.') + pynutil.insert(NEMO_SPACE) + graph_fractional + + # Negative sign handling (e.g., -2.5 or 마이너스2.5) + graph_with_negative = ( + pynutil.insert(f'negative: {DOUBLE_QUOTE}') + + (pynini.cross("-", "마이너스") | pynini.accep("마이너스")) + + pynutil.insert(DOUBLE_QUOTE) + ) + + graph_decimal = graph_decimal_no_sign | ( + graph_with_negative + pynutil.insert(NEMO_SPACE) + graph_decimal_no_sign + ) + + # For internal use without tokens + self.just_decimal = graph_decimal_no_sign.optimize() + + # Final graph with tokens + final_graph = self.add_tokens(graph_decimal) + self.fst = final_graph.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ko/taggers/electronic.py b/zonos3/vendor/nemo_text_processing/text_normalization/ko/taggers/electronic.py new file mode 100644 index 0000000000000000000000000000000000000000..b5519b2a4d52bacc4ac83726de01640bc2dc7b12 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ko/taggers/electronic.py @@ -0,0 +1,168 @@ +# Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.ko.graph_utils import ( + NEMO_DIGIT, + NEMO_NOT_SPACE, + NEMO_SIGMA, + NEMO_SPACE, + GraphFst, + delete_space, + insert_space, +) +from zonos3.vendor.nemo_text_processing.text_normalization.ko.utils import get_abs_path + + +class ElectronicFst(GraphFst): + """ + Finite state transducer (FST) for classifying **electronic expressions** such as + email addresses, URLs, and domain names in Korean. + + Example conversions: + - abc@nvidia.co.kr → electronic { username: "abc" domain: "nvidia.co.kr" } + - www.nvidia.com → electronic { domain: "www.nvidia.com" } + - https://nvidia.com → electronic { protocol: "HTTPS colon slash slash" domain: "nvidia.com" } + - 1234-5678-9012-3456 → electronic { protocol: "credit card" domain: "1234567890123456" } + + Args: + cardinal: FST for digit/number verbalization (used for numeric parts if non-deterministic). + deterministic: If True, provides a single transduction path; otherwise allows multiple. + """ + + def __init__(self, cardinal: GraphFst, deterministic: bool = True): + super().__init__(name="electronic", kind="classify", deterministic=deterministic) + + # ---------- Basic character ranges and symbols ---------- + LOWER = pynini.union(*[pynini.accep(c) for c in "abcdefghijklmnopqrstuvwxyz"]) + UPPER = pynini.union(*[pynini.accep(c) for c in "ABCDEFGHIJKLMNOPQRSTUVWXYZ"]) + ASCII_LETTER = (LOWER | UPPER).optimize() + ASCII_ALNUM = (ASCII_LETTER | NEMO_DIGIT).optimize() + + HYPHEN = pynini.accep("-") + DOT = pynini.accep(".") + SLASH = pynini.accep("/") + AT = pynini.accep("@") + + # Handle numeric reading mode (only for non-deterministic mode) + numbers = ( + NEMO_DIGIT + if deterministic + else (pynutil.insert(NEMO_SPACE) + cardinal.long_numbers + pynutil.insert(NEMO_SPACE)) + ) + + # ---------- Load resources ---------- + cc_cues = pynini.string_file(get_abs_path("data/electronic/cc_cues.tsv")) + accepted_symbols = pynini.project(pynini.string_file(get_abs_path("data/electronic/symbol.tsv")), "input") + graph_symbols = pynini.string_file(get_abs_path("data/electronic/symbol.tsv")).optimize() + + # ---------- Username ---------- + # Exclude '@' from username + username_symbols = pynini.difference(accepted_symbols, AT) + # Start with alphanumeric and allow symbols/numbers repeatedly + username_core = ASCII_ALNUM + pynini.closure(ASCII_ALNUM | numbers | username_symbols) + username = pynutil.insert('username: "') + username_core + pynutil.insert('"') + pynini.cross("@", NEMO_SPACE) + + # ---------- Domain ---------- + # Simplified RFC: label = [A-Za-z0-9-]+ , TLD = '.' [A-Za-z0-9]{2,} + label = pynini.closure(ASCII_ALNUM | HYPHEN, 1) + tld = DOT + pynini.closure(ASCII_ALNUM, 2) + # Domain can be (label + TLD) or TLD only (e.g., ".com") + domain_core = (label + pynini.closure(tld, 1)) | tld + + # Optional path after domain (e.g., /path) + path_segment = pynini.closure(NEMO_NOT_SPACE, 1) # at least one non-space character + path = SLASH + path_segment # / + optional_path = pynini.closure(path, 0, 1) # optional path + + domain_with_opt_path = domain_core + optional_path + + domain_graph_with_class_tags = ( + pynutil.insert('domain: "') + domain_with_opt_path.optimize() + pynutil.insert('"') + ) + + # ---------- protocol ---------- + protocol_symbols = pynini.closure((graph_symbols | pynini.cross(":", "colon")) + pynutil.insert(NEMO_SPACE)) + protocol_start = (pynini.cross("https", "HTTPS ") | pynini.cross("http", "HTTP ")) + ( + pynini.accep("://") @ protocol_symbols + ) + protocol_file_start = pynini.accep("file") + insert_space + (pynini.accep(":///") @ protocol_symbols) + protocol_end = pynutil.add_weight(pynini.cross("www", "WWW ") + pynini.accep(".") @ protocol_symbols, -1000) + protocol = protocol_file_start | protocol_start | protocol_end | (protocol_start + protocol_end) + protocol = pynutil.insert('protocol: "') + protocol + pynutil.insert('"') + + # ---------- Combine all graphs ---------- + graph = pynini.Fst() # empty + + # (1) Email pattern + email_guard = NEMO_SIGMA + AT + NEMO_SIGMA + DOT + NEMO_SIGMA + graph |= pynini.compose(email_guard, username + domain_graph_with_class_tags) + + # (2) Domain only (without protocol)) + # Domain core graph + graph_domain = (pynutil.insert('domain: "') + domain_core + pynutil.insert('"')).optimize() + graph |= graph_domain + + known_extensions = pynini.project( + pynini.string_file(get_abs_path("data/electronic/extensions.tsv")), + "input", + ) + + filename_stem = pynini.closure( + pynini.difference(NEMO_NOT_SPACE, pynini.union(SLASH, DOT)), + 1, + ) + + file_with_extension = filename_stem + known_extensions + + graph |= (pynutil.insert('domain: "') + file_with_extension + pynutil.insert('"')).optimize() + + # (3) URL with protocol + graph |= protocol + insert_space + domain_graph_with_class_tags + + # (4) Credit card pattern: cue + 4–16 digits + if deterministic: + cc_digits = pynini.closure(NEMO_DIGIT, 4, 16) + cc_phrases = ( + pynutil.insert('protocol: "') + + cc_cues + + pynutil.insert('" domain: "') + + delete_space + + cc_digits + + pynutil.insert('"') + ) + graph |= cc_phrases + + four = pynini.closure(NEMO_DIGIT, 4, 4) + sep_token = pynini.union(HYPHEN, NEMO_SPACE) + cc16_grouped = (four + pynini.cross(sep_token, " ")) ** 3 + four + cc16_grouped = cc16_grouped + delete_space + + cc16_no_cue = ( + pynutil.insert('protocol: "신용카드 " ') + + pynutil.insert('domain: "') + + cc16_grouped + + pynutil.insert('"') + ) + + # Give it higher priority over Date FST + cc16_no_cue = pynutil.add_weight(cc16_no_cue.optimize(), -1.0) + + graph |= cc16_no_cue + + final_graph = self.add_tokens(graph) + self.fst = final_graph.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ko/taggers/fraction.py b/zonos3/vendor/nemo_text_processing/text_normalization/ko/taggers/fraction.py new file mode 100644 index 0000000000000000000000000000000000000000..aec19dd75ae9d8b4085671c91a6a51fd1ffef3c2 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ko/taggers/fraction.py @@ -0,0 +1,113 @@ +# Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.ko.graph_utils import NEMO_SPACE, GraphFst, delete_space +from zonos3.vendor.nemo_text_processing.text_normalization.ko.utils import get_abs_path + + +class FractionFst(GraphFst): + """ + Finite state transducer for classifying Korean fractions, e.g. + 3/5 → tokens { fraction { numerator: "삼" denominator: "오" } } + 2과7/9 → tokens { fraction { integer_part: "이" numerator: "칠" denominator: "구" } } + 마이너스3/5 → tokens { fraction { negative: "마이너스" numerator: "삼" denominator: "오" } } + """ + + def __init__(self, cardinal: GraphFst, deterministic: bool = True): + super().__init__(name="fraction", kind="classify", deterministic=deterministic) + + cardinal = cardinal.graph + graph_digit = pynini.string_file(get_abs_path("data/number/digit.tsv")) + graph_zero = pynini.string_file(get_abs_path("data/number/zero.tsv")) + + DOUBLE_QUOTE = '"' + slash = pynutil.delete('/') + root = pynini.accep('√') + + # Decimal number (e.g., 1.23 → 일점이삼) + decimal_number = cardinal + pynini.cross(".", "점") + pynini.closure(graph_digit | graph_zero) + + # Accept cardinal / root + cardinal / decimal / root + decimal + numeral = cardinal | (root + cardinal) | decimal_number | (root + decimal_number) + + # Integer part (e.g., 2과, 1와) + integer_component = ( + pynutil.insert(f'integer_part: {DOUBLE_QUOTE}') + + numeral + + (pynini.accep("과") | pynini.accep("와")) + + pynutil.insert(DOUBLE_QUOTE) + ) + + integer_component_with_space = integer_component + delete_space + pynutil.insert(NEMO_SPACE) + + # Denominator and numerator + denominator_component = pynutil.insert(f'denominator: {DOUBLE_QUOTE}') + numeral + pynutil.insert(DOUBLE_QUOTE) + + numerator_component = pynutil.insert(f'numerator: {DOUBLE_QUOTE}') + numeral + pynutil.insert(DOUBLE_QUOTE) + + # Format 1: 3/4 style + graph_fraction_slash = ( + pynini.closure(integer_component_with_space, 0, 1) + + numerator_component + + slash + + pynutil.insert(NEMO_SPACE) + + denominator_component + + pynutil.insert(NEMO_SPACE) + + pynutil.insert('morphosyntactic_features: "분의"') + ) + + # Format 2: Korean native "4분의3" style + graph_fraction_word = ( + pynini.closure(integer_component_with_space, 0, 1) + + denominator_component + + pynutil.delete("분의") + + pynutil.insert(NEMO_SPACE) + + pynutil.insert('morphosyntactic_features: "분의"') + + pynutil.insert(NEMO_SPACE) + + numerator_component + ) + + # Optional particles following the fraction + particle_subject = pynutil.insert('morphosyntactic_features: "분의_subject"') + ( + pynutil.delete("이") | pynutil.delete("가") + ) + particle_topic = pynutil.insert('morphosyntactic_features: "분의_topic"') + ( + pynutil.delete("은") | pynutil.delete("는") + ) + particle_object = pynutil.insert('morphosyntactic_features: "분의_object"') + ( + pynutil.delete("을") | pynutil.delete("를") + ) + + optional_particle = pynini.closure( + pynutil.insert(NEMO_SPACE) + (particle_subject | particle_topic | particle_object), + 0, + 1, + ) + + # Optional minus sign + optional_sign = ( + pynutil.insert(f'negative: {DOUBLE_QUOTE}') + + (pynini.accep("마이너스") | pynini.cross("-", "마이너스")) + + pynutil.insert(DOUBLE_QUOTE) + + pynutil.insert(NEMO_SPACE) + ) + + # Combine full graph + graph = pynini.closure(optional_sign, 0, 1) + (graph_fraction_slash | graph_fraction_word) + optional_particle + self.graph = graph.optimize() + final_graph = self.add_tokens(graph) + self.fst = final_graph.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ko/taggers/measure.py b/zonos3/vendor/nemo_text_processing/text_normalization/ko/taggers/measure.py new file mode 100644 index 0000000000000000000000000000000000000000..d725d345ba329dfe6e850859242176d8af50b010 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ko/taggers/measure.py @@ -0,0 +1,106 @@ +# Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.ko.graph_utils import GraphFst, delete_space, insert_space +from zonos3.vendor.nemo_text_processing.text_normalization.ko.utils import get_abs_path + + +class MeasureFst(GraphFst): + """ + Finite state transducer for classifying Korean measure expressions. + - 1kg → measure { cardinal { integer: "일" } units: "킬로그램" } + - 12.5km → measure { decimal { integer_part: "십이" fractional_part: "오" } units: "킬로미터" } + - 2/3m → measure { fraction { numerator: "이" denominator: "삼" } units: "미터" } + - 60km/h → measure { cardinal { integer: "육십" } units: "킬로미터 퍼 시간" } + + This FST attaches measurement units (e.g., "킬로미터", "그램") to numeric expressions + classified by the `cardinal`, `decimal`, or `fraction` subgraphs. + + Args: + cardinal: FST handling integer (cardinal) numbers. + decimal: FST handling decimal numbers (optional). + fraction: FST handling fractional numbers (optional). + deterministic: If True, provides a single transduction path; otherwise allows multiple. + """ + + def __init__( + self, + cardinal: GraphFst, + decimal: GraphFst = None, + fraction: GraphFst = None, + deterministic: bool = True, + ): + super().__init__(name="measure", kind="classify", deterministic=deterministic) + + # Numeric subgraphs + graph_cardinal = cardinal.graph + + # Unit lexicon + graph_unit = pynini.string_file(get_abs_path("data/measure/unit.tsv")) + + # Per-expression handling (e.g., km/h, m/s) + opt_space = pynini.closure(delete_space, 0, 1) + per = pynini.cross("/", "퍼") + opt_space + insert_space + graph_unit + optional_per = pynini.closure(opt_space + insert_space + per, 0, 1) + + # Final unit FST produces either "" or " 퍼 " + unit = pynutil.insert('units: "') + (graph_unit + optional_per | per) + pynutil.insert('"') + + minus_as_field = pynutil.insert('negative: "마이너스" ') + consume_minus = pynini.cross("-", "") | pynini.cross("마이너스", "") + + # Optional minus field + removal of actual sign symbol or word + optional_minus = pynini.closure(minus_as_field + consume_minus + opt_space, 0, 1) + + # Combine numeric and unit components + pieces = [] + + # 1) Cardinal form: e.g., "12kg" + sub_cardinal = ( + pynutil.insert("cardinal { ") + + pynutil.insert('integer: "') + + graph_cardinal + + delete_space + + pynutil.insert('" } ') + + unit + ) + pieces.append(sub_cardinal) + + # 2) Decimal form: e.g., "12.5km" + if decimal is not None: + sub_decimal = ( + pynutil.insert("decimal { ") + + optional_minus + + decimal.just_decimal + + delete_space + + pynutil.insert(" } ") + + unit + ) + pieces.append(sub_decimal) + + # 3) Fraction form: e.g., "2/3m" or "삼분의 이 미터" + if fraction is not None: + sub_fraction = pynutil.insert("fraction { ") + fraction.graph + delete_space + pynutil.insert(" } ") + unit + pieces.append(sub_fraction) + + # Union all supported numeric forms (cardinal | decimal | fraction) + graph = pieces[0] + for p in pieces[1:]: + graph |= p + + # Final wrapping into tokens { measure { ... } } + self.fst = self.add_tokens(graph).optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ko/taggers/money.py b/zonos3/vendor/nemo_text_processing/text_normalization/ko/taggers/money.py new file mode 100644 index 0000000000000000000000000000000000000000..c2b8ff09b7d75c292a339ecb5f871e523799b7a2 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ko/taggers/money.py @@ -0,0 +1,99 @@ +# Copyright (c) 2025 NVIDIA CORPORATION.  All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +#     http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.ko.graph_utils import NEMO_DIGIT, GraphFst, delete_space +from zonos3.vendor.nemo_text_processing.text_normalization.ko.utils import get_abs_path, load_labels + + +class MoneyFst(GraphFst): + """ + Finite state transducer for classifying Korean money. + + Example inputs and outputs: + ₩350 -> money { currency_maj: "원" integer_part: "삼백오십" } + 350원 -> money { integer_part: "삼백오십" currency_maj: "원" } + KRW 12,050 -> money { currency_maj: "원" integer_part: "일만이천오십" } + 12만 500원 -> money { integer_part: "십이만오백" currency_maj: "원" } + ₩10.25 -> money { currency_maj: "원" integer_part: "십" minor_part: "이십오" } # optional 2-digit minor + 0원 -> money { integer_part: "영" currency_maj: "원" } + + Args: + cardinal: CardinalFst + deterministic: If True, provide a single transduction; + if False, allow multiple transductions. + """ + + def __init__(self, cardinal: GraphFst, deterministic: bool = True): + super().__init__(name="money", kind="classify", deterministic=deterministic) + + graph_cardinal = cardinal.graph + sp = pynini.closure(delete_space) # absorb any amount of spaces in input + + # --- Numbers (integer / optional minor) --- + # Integer part: "0" or a non-zero leading digit; allow commas (e.g., 18,925,000) + integer_part_fst = pynini.union("0", (NEMO_DIGIT - "0") + pynini.closure(NEMO_DIGIT | pynutil.delete(","))) + + # Plain integer → integer_part: "" + graph_integer_plain = ( + pynutil.insert('integer_part: "') + (integer_part_fst @ graph_cardinal) + pynutil.insert('" ') + ) + + # Optional 2-digit decimal (kept as minor_part if ever used downstream) + decimal_part_fst = NEMO_DIGIT**2 + graph_minor = pynutil.insert('minor_part: "') + (decimal_part_fst @ graph_cardinal) + pynutil.insert('" ') + + # Integer with scale suffix (만/억/조) → wrap the whole thing in one integer_part + scale_unit = pynini.union("만", "억", "조") + value_with_scale = (integer_part_fst @ graph_cardinal) + scale_unit + graph_integer_with_suffix = ( + pynutil.insert('integer_part: "') + value_with_scale + pynutil.insert('" ') + ).optimize() + + # Integer (+ optional ".<2-digit>" minor) + number_component_plain = graph_integer_plain + pynini.closure(pynutil.delete(".") + graph_minor, 0, 1) + number_component = (graph_integer_with_suffix | number_component_plain).optimize() + + # --- Currency (prefix or suffix) --- + # currency_major.tsv example: + # ₩ 원 + # KRW 원 + # 원 원 + maj_labels = load_labels(get_abs_path("data/money/currency_major.tsv")) + + # Prefix currency (e.g., ₩, KRW): emit currency_maj then number + currency_major_prepended = pynini.union( + *[pynutil.delete(surface) + pynutil.insert(f'currency_maj: "{unit}" ') for surface, unit in maj_labels] + ).optimize() + + # Suffix currency (e.g., ...원, ...달러): convert unit literal to currency_maj + currency_major_appended = pynini.union( + *[pynutil.delete(unit) + pynutil.insert(f'currency_maj: "{unit}" ') for _, unit in maj_labels] + ).optimize() + + # --- Compose (NO period handling) --- + # NOTE: We deliberately do NOT consume '/월', '/년', '/주', '/일', '/시간' here. + # If present in the raw text, they remain outside the money token and can be handled upstream/elsewhere. + + # [currency] [number] + graph_prepend = (currency_major_prepended + sp + number_component).optimize() + + # [number] [currency] + graph_append = (number_component + currency_major_appended).optimize() + + graph = (graph_prepend | graph_append).optimize() + + self.fst = self.add_tokens(graph).optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ko/taggers/ordinal.py b/zonos3/vendor/nemo_text_processing/text_normalization/ko/taggers/ordinal.py new file mode 100644 index 0000000000000000000000000000000000000000..6e19d869e3735a8f0c0f5b0925ece23c74cbd4ca --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ko/taggers/ordinal.py @@ -0,0 +1,85 @@ +# Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.ko.graph_utils import GraphFst +from zonos3.vendor.nemo_text_processing.text_normalization.ko.utils import get_abs_path + + +class OrdinalFst(GraphFst): + """ + Finite state transducer for classifying Korean ordinal expressions, e.g. + 1번째 -> ordinal { integer: "첫번째" } + + Args: + cardinal: CardinalFst + """ + + def __init__(self, cardinal: GraphFst, deterministic: bool = True): + super().__init__(name="ordinal", kind="classify", deterministic=deterministic) + + # Load base .tsv files + graph_digit = pynini.string_file(get_abs_path("data/ordinal/digit.tsv")) + graph_zero = pynini.string_file(get_abs_path("data/number/zero.tsv")) + graph_exceptions = pynini.string_file(get_abs_path("data/ordinal/exceptions.tsv")) + graph_tens = pynini.string_file(get_abs_path("data/ordinal/tens.tsv")) + graph_tens_prefix = pynini.string_file(get_abs_path("data/ordinal/tens_prefix.tsv")) + + graph_11_to_39 = (graph_tens_prefix + graph_digit).optimize() + + # Combine all ordinal forms from 1 to 39 + graph_ordinal_1to39 = ( + graph_exceptions | graph_digit | graph_zero | graph_tens | graph_11_to_39 + ).optimize() + pynini.accep("번째") + + # Accept tens digit 4–9 + tens_digit_4_to_9_accep = pynini.union(*[pynini.accep(str(i)) for i in range(4, 10)]) + # Accept any single digit + any_single_digit_accep = pynini.union(*[pynini.accep(str(i)) for i in range(0, 10)]) + # Combine two digits + from_40_to_99_inputs = tens_digit_4_to_9_accep + any_single_digit_accep + + # Match numbers with 3 or more digits + input_100_plus = pynini.closure(any_single_digit_accep, 3) + + # Combine both ranges (40–99 and 100+): total range = 40 and above + filter_inputs_from_40 = (from_40_to_99_inputs | input_100_plus).optimize() + + # Only allow cardinal numbers that are 40 or more + graph_cardinal_from40_filtered = pynini.compose(filter_inputs_from_40, cardinal.graph) + + # Add "번째" to the filtered cardinal graph. + graph_ordinal_from40 = graph_cardinal_from40_filtered + pynini.accep("번째") + + graph_ordinal = (graph_ordinal_1to39 | graph_ordinal_from40).optimize() # Handles 1-39 # Handles 40+ + + # Single-character particles (가, 이, 은, 는, 로, 도 ...) + josa_single = pynini.union("가", "이", "은", "는", "를", "을", "로", "도", "다") + + # Multi-character particles (부터, 까지) + josa_multi = pynini.union("부터", "까지") + + # Allow patterns like: + # 번째 + (optional single-josa) + (optional multi-josa) + josa = (josa_single.ques + josa_multi.ques).optimize() + + # Final ordinal graph with optional particles + graph_ordinal_with_josa = (graph_ordinal + josa).optimize() + + # Build the “integer: …” token structure + final_graph = pynutil.insert('integer: "') + graph_ordinal_with_josa + pynutil.insert('"') + + self.fst = self.add_tokens(final_graph).optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ko/taggers/punctuation.py b/zonos3/vendor/nemo_text_processing/text_normalization/ko/taggers/punctuation.py new file mode 100644 index 0000000000000000000000000000000000000000..3dc0092947613034a340abe0dca239d5ed77e82f --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ko/taggers/punctuation.py @@ -0,0 +1,37 @@ +# Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.lib import pynutil +from zonos3.vendor.nemo_text_processing.text_normalization.ko.graph_utils import GraphFst + + +class PunctuationFst(GraphFst): + """ + Finite state transducer for classifying punctuation + e.g. a, -> tokens { name: "a" } tokens { name: "," } + + Args: + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="punctuation", kind="classify", deterministic=deterministic) + + range_component = pynini.cross("〜", "부터") | pynini.accep("부터") + + graph = pynutil.insert('name: "') + range_component + pynutil.insert('"') + self.fst = graph.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ko/taggers/telephone.py b/zonos3/vendor/nemo_text_processing/text_normalization/ko/taggers/telephone.py new file mode 100644 index 0000000000000000000000000000000000000000..88ef2f42f463e2574a093c60b366dfa1769e3203 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ko/taggers/telephone.py @@ -0,0 +1,89 @@ +# Copyright (c) 2025 NVIDIA CORPORATION.  All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +#     http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.ko.graph_utils import GraphFst, delete_space, insert_space +from zonos3.vendor.nemo_text_processing.text_normalization.ko.utils import get_abs_path + + +class TelephoneFst(GraphFst): + """ + Finite state transducer for classifying Korean telephone numbers. + + Example inputs → tokens: + +82 010-3713-7050 -> telephone { country_code: "국가번호 팔이," number_part: "영일영 삼칠일삼 칠영오영" } + +1 (415) 555-0123 -> telephone { country_code: "국가번호 일," number_part: "사일오 오오오 영일이삼" } + (031)371-3700 -> telephone { number_part: "영삼일 삼칠일 삼칠영영" } + 010-3713-7050 -> telephone { number_part: "영일영 삼칠일삼 칠영오영" } + 010.777.8888 -> telephone { number_part: "영일영 칠칠칠 팔팔팔팔" } + + Args: + deterministic (bool, optional): If True, provide a single transduction; + if False, allow multiple transductions. + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="telephone", kind="classify", deterministic=deterministic) + # Separator between digit blocks (e.g., "-" or ".") + delete_sep = pynutil.delete("-") | pynutil.delete(".") + # Optional space inserted between blocks + insert_block_space = insert_space + + # 1) safe digit mapping: force 0 -> "영" (do not rely on zero.tsv invert) + digit = pynini.string_file(get_abs_path("data/number/digit.tsv")).optimize() + zero_map = pynini.cross("0", "영") + digit_ko = (digit | zero_map).optimize() + + three_digits = digit_ko**3 + four_digits = digit_ko**4 + + # country code: "+1", "+82", "+1-" + cc_digits = pynini.closure(digit_ko, 1, 3) + + country_code = ( + pynutil.delete("+") + + pynutil.insert('country_code: "') + + cc_digits + + pynutil.insert('"') + + pynini.closure(pynutil.delete("-") | pynutil.delete(" "), 0, 1) + + delete_space + ) + + # area part: "123-" | "123." | "(123)" [space?] or "(123)-" + area_core = three_digits + area_part = ( + (area_core + delete_sep) + | ( + pynutil.delete("(") + + area_core + + pynutil.delete(")") + + pynini.closure(pynutil.delete(" "), 0, 1) + + pynini.closure(delete_sep, 0, 1) + ) + ) + insert_block_space + + # 2) allow 3 **or 4** digits in the middle block (to support 010-3713-7050) + mid = pynini.union(three_digits, four_digits) + last4 = four_digits + + # consume '-' or '.' between middle and last blocks + number_part_core = area_part + mid + delete_sep + insert_block_space + last4 + number_part = pynutil.insert('number_part: "') + number_part_core + pynutil.insert('"') + + # final graph: with or without country code + graph = pynini.union(country_code + insert_space + number_part, number_part).optimize() + + self.fst = self.add_tokens(graph).optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ko/taggers/time.py b/zonos3/vendor/nemo_text_processing/text_normalization/ko/taggers/time.py new file mode 100644 index 0000000000000000000000000000000000000000..1b7ff4ad873c1cb57548bf823af40d26d636bd41 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ko/taggers/time.py @@ -0,0 +1,192 @@ +# Copyright (c) 2025 NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.ko.graph_utils import GraphFst, delete_space, insert_space +from zonos3.vendor.nemo_text_processing.text_normalization.ko.utils import get_abs_path + + +class TimeFst(GraphFst): + """ + Finite state transducer for classifying time, e.g. + 오전 10시 30분 -> time { suffix: "오전" hours: "열시" minutes: "삼십분" } + 오후 3시 반 -> time { suffix: "오후" hours: "세시" minutes: "삼십분" } + 자정 -> time { hours: "영시" } + 정오 -> time { hours: "열두시" } + + Args: + cardinal: CardinalFst (Korean cardinal graph) + """ + + def __init__(self, cardinal: GraphFst, deterministic: bool = True): + super().__init__(name="time", kind="classify", deterministic=deterministic) + + # Base number-to-words graph from the Cardinal Fst + graph_cardinal = cardinal.graph + strip0 = pynini.closure(pynutil.delete("0"), 0, 1) + + SP = pynini.closure(delete_space) + SEP = SP + insert_space + hour_clock = pynini.string_file(get_abs_path("data/time/hour.tsv")) + division = pynini.string_file(get_abs_path("data/time/division.tsv")) + + division_component = pynutil.insert("suffix: \"") + division + pynutil.insert("\"") + + # --- Special single-word times --- + noon = pynini.accep("정오") + midnight = pynini.accep("자정") + noon_component = pynutil.insert("hours: \"") + pynini.cross(noon, "열두시") + pynutil.insert("\"") + midnight_component = pynutil.insert("hours: \"") + pynini.cross(midnight, "영시") + pynutil.insert("\"") + + # --- Korean Hangul components (H시 [M분|반] [S초]) --- + # "0" or "00" -> 0 + h_zero = strip0 + pynini.accep("0") + # "13".."24" + h_13_24 = pynini.union(*[str(i) for i in range(13, 25)]) + + # "0시" -> "영시" + hour_component_ko_zero = ( + pynutil.insert("hours: \"") + + pynini.cross(h_zero, "영") + + pynutil.delete("시") + + pynutil.insert("시") + + pynutil.insert("\"") + ) + + # "13시..24시" -> Sino-Korean words (십삼/…/이십사) + 시 + hour_component_ko_13_24 = ( + pynutil.insert("hours: \"") + + (h_13_24 @ graph_cardinal) + + pynutil.delete("시") + + pynutil.insert("시") + + pynutil.insert("\"") + ) + + # "1시..12시" -> Native Korean words (한/두/세/네/…/열두) + 시 + hour_component_ko_1_12 = ( + pynutil.insert("hours: \"") + + (strip0 + hour_clock) + + pynutil.delete("시") + + pynutil.insert("시") + + pynutil.insert("\"") + ) + + # Priority: 13-24 > 0 > 1-12 to prevent partial matching errors + hour_component_ko = (hour_component_ko_13_24 | hour_component_ko_zero | hour_component_ko_1_12).optimize() + + # Minutes: number+"분" or "반" (approx. 30분). Allows optional '쯤|경' after minutes/반. + about_word = pynini.union("쯤", "경") + minute_number = ( + pynutil.insert("minutes: \"") + + (strip0 + graph_cardinal) + + pynutil.delete("분") + + pynutil.insert("분") + + pynutil.insert("\"") + ) + minute_half = ( + pynutil.insert("minutes: \"") + + pynutil.delete("반") + + pynutil.insert("반") + + pynini.closure(about_word, 0, 1) + + pynutil.insert("\"") + ) + minute_component_ko = (minute_half | minute_number).optimize() + + second_component_ko = ( + pynutil.insert("seconds: \"") + + (strip0 + graph_cardinal) + + pynutil.delete("초") + + pynutil.insert("초") + + pynutil.insert("\"") + ) + + # Allow suffix before or after + suffix_prefix_opt = pynini.closure(division_component + SEP, 0, 1) + suffix_postfix_opt = pynini.closure(SEP + division_component, 0, 1) + + # Hangul patterns + graph_hangul = ( + suffix_prefix_opt + + ( + hour_component_ko + | (hour_component_ko + SEP + minute_component_ko) + | (hour_component_ko + SEP + minute_component_ko + SEP + second_component_ko) + | minute_component_ko + | (minute_component_ko + SEP + second_component_ko) + | second_component_ko + ) + + suffix_postfix_opt + ).optimize() + + # Special words with optional suffix + graph_special = (suffix_prefix_opt + (noon_component | midnight_component) + suffix_postfix_opt).optimize() + + # --- Clock patterns: HH:MM[:SS] --- + colon = pynutil.delete(":") + + # Map 1-12 hours using native-Korean words, allowing an optional leading zero. + graph_hour_1_12 = ( + pynutil.insert("hours: \"") + (strip0 + hour_clock) + pynutil.insert("시") + pynutil.insert("\"") + ).optimize() + + # 0, 00, and 13-24 -> Sino-Korean words + hour_sino_val = ( + pynini.cross("00", "0") + | pynini.cross("0", "0") + | pynini.union(*[pynini.cross(str(i), str(i)) for i in range(13, 25)]) + ) + hour_sino_read = hour_sino_val @ graph_cardinal + + graph_hour_others = pynutil.insert("hours: \"") + hour_sino_read + pynutil.insert("시") + pynutil.insert("\"") + + hour_clock_component = (graph_hour_1_12 | graph_hour_others).optimize() + + minute_clock_component = ( + pynutil.insert("minutes: \"") + strip0 + graph_cardinal + pynutil.insert("분") + pynutil.insert("\"") + ) + second_clock_component = ( + pynutil.insert("seconds: \"") + strip0 + graph_cardinal + pynutil.insert("초") + pynutil.insert("\"") + ) + + # HH:MM (drop minutes if "00") + graph_hm_clock = ( + suffix_prefix_opt + + hour_clock_component + + delete_space.ques + + colon + + delete_space.ques + + (pynini.cross("00", "") | pynini.closure(insert_space + minute_clock_component, 0, 1)) + + suffix_postfix_opt + ).optimize() + + # HH:MM:SS (drop minutes/seconds if "00") + graph_hms_clock = ( + suffix_prefix_opt + + hour_clock_component + + delete_space.ques + + colon + + delete_space.ques + + (pynini.cross("00", "") | pynini.closure(insert_space + minute_clock_component, 0, 1)) + + delete_space.ques + + colon + + delete_space.ques + + (pynini.cross("00", "") | pynini.closure(insert_space + second_clock_component, 0, 1)) + + suffix_postfix_opt + ).optimize() + + graph = (graph_special | graph_hangul | graph_hm_clock | graph_hms_clock).optimize() + graph_final = self.add_tokens(graph) + self.fst = graph_final.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ko/taggers/tokenize_and_classify.py b/zonos3/vendor/nemo_text_processing/text_normalization/ko/taggers/tokenize_and_classify.py new file mode 100644 index 0000000000000000000000000000000000000000..5e8bb85b0a5517468b0903eb2a8290f8371deff1 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ko/taggers/tokenize_and_classify.py @@ -0,0 +1,114 @@ +# Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import os + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.ko.graph_utils import ( + GraphFst, + delete_extra_space, + delete_space, + generator_main, +) +from zonos3.vendor.nemo_text_processing.text_normalization.ko.taggers.cardinal import CardinalFst +from zonos3.vendor.nemo_text_processing.text_normalization.ko.taggers.date import DateFst +from zonos3.vendor.nemo_text_processing.text_normalization.ko.taggers.decimal import DecimalFst +from zonos3.vendor.nemo_text_processing.text_normalization.ko.taggers.electronic import ElectronicFst +from zonos3.vendor.nemo_text_processing.text_normalization.ko.taggers.fraction import FractionFst +from zonos3.vendor.nemo_text_processing.text_normalization.ko.taggers.measure import MeasureFst +from zonos3.vendor.nemo_text_processing.text_normalization.ko.taggers.money import MoneyFst +from zonos3.vendor.nemo_text_processing.text_normalization.ko.taggers.ordinal import OrdinalFst +from zonos3.vendor.nemo_text_processing.text_normalization.ko.taggers.punctuation import PunctuationFst +from zonos3.vendor.nemo_text_processing.text_normalization.ko.taggers.telephone import TelephoneFst +from zonos3.vendor.nemo_text_processing.text_normalization.ko.taggers.time import TimeFst +from zonos3.vendor.nemo_text_processing.text_normalization.ko.taggers.whitelist import WhiteListFst +from zonos3.vendor.nemo_text_processing.text_normalization.ko.taggers.word import WordFst +from zonos3.vendor.nemo_text_processing.utils.logging import logger + + +class ClassifyFst(GraphFst): + """ + Final class that composes all other classification grammars. This class can process an entire sentence including punctuation. + For deployment, this grammar will be compiled and exported to OpenFst Finite State Archive (FAR) File. + More details to deployment at NeMo/tools/text_processing_deployment. + + Args: + input_case: accepting either "lower_cased" or "cased" input. + deterministic: if True will provide a single transduction option, + for False multiple options (used for audio-based normalization) + cache_dir: path to a dir with .far grammar file. Set to None to avoid using cache. + overwrite_cache: set to True to overwrite .far files + whitelist: path to a file with whitelist replacements + """ + + def __init__( + self, + input_case: str = "cased", + deterministic: bool = True, + cache_dir: str = None, + overwrite_cache: bool = False, + whitelist: str = None, + ): + super().__init__(name="tokenize_and_classify", kind="classify", deterministic=deterministic) + + far_file = None + if cache_dir is not None and cache_dir != "None": + os.makedirs(cache_dir, exist_ok=True) + far_file = os.path.join(cache_dir, f"ko_tn_{deterministic}_tokenize.far") + if not overwrite_cache and far_file and os.path.exists(far_file): + self.fst = pynini.Far(far_file, mode="r")["tokenize_and_classify"] + logger.info(f"ClassifyFst.fst was restored from {far_file}.") + else: + cardinal = CardinalFst(deterministic=deterministic) + date = DateFst(cardinal=cardinal, deterministic=deterministic) + time = TimeFst(cardinal=cardinal, deterministic=deterministic) + ordinal = OrdinalFst(cardinal=cardinal, deterministic=deterministic) + word = WordFst(deterministic=deterministic) + decimal = DecimalFst(cardinal=cardinal, deterministic=deterministic) + fraction = FractionFst(cardinal=cardinal, deterministic=deterministic) + whitelist = WhiteListFst(deterministic=deterministic) + punctuation = PunctuationFst(deterministic=deterministic) + money = MoneyFst(cardinal=cardinal, deterministic=deterministic) + telephone = TelephoneFst(deterministic=deterministic) + measure = MeasureFst(cardinal=cardinal, decimal=decimal, fraction=fraction, deterministic=deterministic) + electronic = ElectronicFst(cardinal=cardinal, deterministic=deterministic) + + classify = pynini.union( + pynutil.add_weight(cardinal.fst, 1.1), + pynutil.add_weight(date.fst, 1.1), + pynutil.add_weight(time.fst, 1.1), + pynutil.add_weight(fraction.fst, 1.0), + pynutil.add_weight(ordinal.fst, 1.1), + pynutil.add_weight(decimal.fst, 1.05), + pynutil.add_weight(word.fst, 100), + pynutil.add_weight(money.fst, 1.1), + pynutil.add_weight(measure.fst, 1.1), + pynutil.add_weight(punctuation.fst, 1.0), + pynutil.add_weight(whitelist.fst, 1.1), + pynutil.add_weight(telephone.fst, 1.1), + pynutil.add_weight(electronic.fst, 1.11), + ) + + token = pynutil.insert("tokens { ") + classify + pynutil.insert(" }") + + graph = ( + delete_space + token + pynini.closure((delete_extra_space | pynini.accep("")) + token) + delete_space + ) + + self.fst = graph.optimize() + + if far_file: + generator_main(far_file, {"tokenize_and_classify": self.fst}) diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ko/taggers/whitelist.py b/zonos3/vendor/nemo_text_processing/text_normalization/ko/taggers/whitelist.py new file mode 100644 index 0000000000000000000000000000000000000000..dba5541efdc7a51128bddeeeb064e6a4e26a4e97 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ko/taggers/whitelist.py @@ -0,0 +1,29 @@ +# Copyright (c) 2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.ko.graph_utils import GraphFst +from zonos3.vendor.nemo_text_processing.text_normalization.ko.utils import get_abs_path + + +class WhiteListFst(GraphFst): + def __init__(self, deterministic: bool = True): + super().__init__(name="whitelist", kind="classify", deterministic=deterministic) + + whitelist = pynini.string_file(get_abs_path("data/whitelist.tsv")) + graph = pynutil.insert('name: "') + whitelist + pynutil.insert('"') + + self.fst = graph.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ko/taggers/word.py b/zonos3/vendor/nemo_text_processing/text_normalization/ko/taggers/word.py new file mode 100644 index 0000000000000000000000000000000000000000..e7ad00cb2b78fd98b9f7042bb31096eb02987535 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ko/taggers/word.py @@ -0,0 +1,36 @@ +# Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.ja.graph_utils import NEMO_DIGIT, NEMO_NOT_SPACE, GraphFst + + +class WordFst(GraphFst): + """ + Finite state transducer for classifying Korean word. + e.g. 이름 -> tokens { name: "이름" } + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="word", kind="classify", deterministic=deterministic) + + word_char = pynini.difference(NEMO_NOT_SPACE, NEMO_DIGIT) + + word = pynutil.insert('name: "') + word += pynini.closure(word_char, 1) + word += pynutil.insert('"') + + self.fst = word.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ko/utils.py b/zonos3/vendor/nemo_text_processing/text_normalization/ko/utils.py new file mode 100644 index 0000000000000000000000000000000000000000..51aaea3e82f550a6535ebab312dc7c8f616c6f6b --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ko/utils.py @@ -0,0 +1,60 @@ +# Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import csv +import os + + +def get_abs_path(rel_path): + """ + Get absolute path + + Args: + rel_path: relative path to this file + + Returns absolute path + """ + return os.path.dirname(os.path.abspath(__file__)) + '/' + rel_path + + +def load_labels(abs_path): + """ + loads relative path file as dictionary + + Args: + abs_path: absolute path + + Returns dictionary of mappings + """ + with open(abs_path, encoding="utf-8") as label_tsv: + labels = list(csv.reader(label_tsv, delimiter="\t")) + return labels + + +def augment_labels_with_punct_at_end(labels): + """ + augments labels: if key ends on a punctuation that value does not have, add a new label + where the value maintains the punctuation + + Args: + labels : input labels + Returns: + additional labels + """ + res = [] + for label in labels: + if len(label) > 1: + if label[0][-1] == "." and label[1][-1] != ".": + res.append([label[0], label[1] + "."] + label[2:]) + return res diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ko/verbalizers/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/ko/verbalizers/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..341a77c5bc66dee5d2ba0edf888f91e5bf225e3c --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ko/verbalizers/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ko/verbalizers/cardinal.py b/zonos3/vendor/nemo_text_processing/text_normalization/ko/verbalizers/cardinal.py new file mode 100644 index 0000000000000000000000000000000000000000..3bcfa056ba1938493b4d60ab2eb944afe0f48210 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ko/verbalizers/cardinal.py @@ -0,0 +1,53 @@ +# Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.ko.graph_utils import NEMO_NOT_QUOTE, GraphFst, delete_space + + +class CardinalFst(GraphFst): + """ + Finite state transducer for verbalizing cardinal, e.g. + cardinal { negative: "true" integer: "23" } -> 마이너스 이십삼 + + Args: + deterministic: if True will provide a single transduction option, + for False multiple options (used for audio-based normalization) + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="cardinal", kind="verbalize", deterministic=deterministic) + + self.optional_sign = pynini.cross("negative: \"true\"", "마이너스 ") + if not deterministic: + self.optional_sign |= pynini.cross("negative: \"true\"", "음수 ") + self.optional_sign |= pynini.cross("negative: \"true\"", "- ") + + self.optional_sign = pynini.closure(self.optional_sign + delete_space, 0, 1) + + # quoted: parses a quoted string value like "십", "명" + quoted = delete_space + pynutil.delete('"') + pynini.closure(NEMO_NOT_QUOTE) + pynutil.delete('"') + + # integer: mandatory field + integer = pynutil.delete("integer:") + quoted + + # counter: optional field (e.g., 명/개/살). + counter = pynutil.delete("counter:") + quoted + counter = pynini.closure(delete_space + counter, 0, 1) + self.numbers = self.optional_sign + integer + counter + + delete_tokens = self.delete_tokens(self.numbers) + self.fst = delete_tokens.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ko/verbalizers/date.py b/zonos3/vendor/nemo_text_processing/text_normalization/ko/verbalizers/date.py new file mode 100644 index 0000000000000000000000000000000000000000..ae41db7707c0a23995367d2312888f6398f0c7b9 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ko/verbalizers/date.py @@ -0,0 +1,55 @@ +# Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.ko.graph_utils import NEMO_NOT_QUOTE, GraphFst, delete_space, insert_space + + +class DateFst(GraphFst): + """ + Korean date verbalizer + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="date", kind="verbalize", deterministic=deterministic) + + era_component = pynutil.delete("era: \"") + pynini.closure(NEMO_NOT_QUOTE) + pynutil.delete("\"") + year_component = pynutil.delete("year: \"") + pynini.closure(NEMO_NOT_QUOTE) + pynutil.delete("\"") + month_component = pynutil.delete("month: \"") + pynini.closure(NEMO_NOT_QUOTE) + pynutil.delete("\"") + day_component = pynutil.delete("day: \"") + pynini.closure(NEMO_NOT_QUOTE) + pynutil.delete("\"") + week_component = ( + pynutil.delete("weekday: \"") + + pynini.closure(delete_space) + + pynini.closure(NEMO_NOT_QUOTE) + + pynini.closure(delete_space) + + pynutil.delete("\"") + ) + + SPACE = pynini.closure(delete_space, 0, 1) + insert_space + + # This graph now correctly uses the 'delete_space' variable defined above. + graph_basic_date = ( + pynini.closure(era_component + SPACE, 0, 1) + + pynini.closure(year_component + SPACE, 0, 1) + + pynini.closure(month_component + SPACE, 0, 1) + + pynini.closure(day_component, 0, 1) + + pynini.closure(SPACE + week_component, 0, 1) + ) | (month_component + SPACE + week_component) + + final_graph = graph_basic_date + + delete_tokens = self.delete_tokens(final_graph) + self.fst = delete_tokens.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ko/verbalizers/decimal.py b/zonos3/vendor/nemo_text_processing/text_normalization/ko/verbalizers/decimal.py new file mode 100644 index 0000000000000000000000000000000000000000..909e467b6a603a3e01c032762a323d8ac95eac9b --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ko/verbalizers/decimal.py @@ -0,0 +1,48 @@ +# Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.ko.graph_utils import NEMO_NOT_QUOTE, GraphFst + + +class DecimalFst(GraphFst): + def __init__(self, deterministic: bool = True): + super().__init__(name="decimal", kind="verbalize", deterministic=deterministic) + + # Extract integer part + integer_part = pynutil.delete('integer_part: "') + pynini.closure(NEMO_NOT_QUOTE, 1) + pynutil.delete('"') + + # Extract fractional part and prepend "점" + fractional_part = ( + pynutil.delete('fractional_part: "') + + pynutil.insert("점") + + pynini.closure(NEMO_NOT_QUOTE, 1) + + pynutil.delete('"') + ) + + # Verbalize decimal number without sign + decimal_positive = integer_part + pynutil.delete(" ") + fractional_part + + # Handle negative sign + negative_sign = ( + pynutil.delete('negative: "') + pynini.accep("마이너스") + pynutil.delete('"') + pynutil.delete(" ") + ) + + # Combine positive and negative cases + decimal = decimal_positive | (negative_sign + pynutil.insert(" ") + decimal_positive) + + delete_tokens = self.delete_tokens(decimal) + self.fst = delete_tokens.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ko/verbalizers/electronic.py b/zonos3/vendor/nemo_text_processing/text_normalization/ko/verbalizers/electronic.py new file mode 100644 index 0000000000000000000000000000000000000000..4e0dae3b92f4b4ab2b17284740a1ca6cbbfbfcaf --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ko/verbalizers/electronic.py @@ -0,0 +1,141 @@ +# Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.ko.graph_utils import ( + NEMO_ALPHA, + NEMO_CHAR, + NEMO_DIGIT, + NEMO_NOT_QUOTE, + NEMO_SIGMA, + GraphFst, + delete_extra_space, + delete_space, + insert_space, +) +from zonos3.vendor.nemo_text_processing.text_normalization.ko.utils import get_abs_path + + +class ElectronicFst(GraphFst): + """ + Finite state transducer (FST) for verbalizing **electronic expressions** (email/URL/domain). + + Input tokens: + tokens { electronic { username: "abc" domain: "abc.com" } } + + Example output (policy-dependent): + abc 골뱅이 abc 닷컴 + + Args: + deterministic: If True, produce a single verbalization. + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="electronic", kind="verbalize", deterministic=deterministic) + + # 1) Handle digits (0–9) + graph_digit_no_zero = pynini.string_file(get_abs_path("data/number/digit.tsv")).optimize() + + graph_zero = pynini.cross("0", "영") + if not deterministic: + graph_zero |= pynini.cross("0", "공") + graph_digit = (graph_digit_no_zero | graph_zero).optimize() + + digit_inline_rewrite = pynini.cdrewrite( + graph_digit, + "", + "", + NEMO_SIGMA, + ) + + # 3) username part (add spaces between characters) + raw_username = pynini.closure(NEMO_NOT_QUOTE, 1) + + user_name = ( + pynutil.delete("username:") + + delete_space + + pynutil.delete('"') + + (raw_username @ digit_inline_rewrite) + + pynutil.delete('"') + ) + + # 4) domain part (handle common endings like .com → 닷컴) + domain_common_pairs = ( + pynini.string_file(get_abs_path("data/electronic/domain.tsv")) + | pynini.string_file(get_abs_path("data/electronic/extensions.tsv")) + ).optimize() + + # Rewrite known domains (.com → 닷컴) + tld_rewrite = pynini.cdrewrite( + domain_common_pairs, + "", + "", + NEMO_SIGMA, + ) + # Add a space before “닷” if needed + add_space_before_dot = pynini.cdrewrite( + pynini.cross("닷", " 닷"), + (NEMO_ALPHA | NEMO_DIGIT | NEMO_CHAR), + "", + NEMO_SIGMA, + ) + + raw_domain = pynini.closure(NEMO_NOT_QUOTE, 1) + + four = pynini.closure(NEMO_DIGIT, 4, 4) + cc16_grouped = four + pynutil.insert(" ") + four + pynutil.insert(" ") + four + pynutil.insert(" ") + four + cc_domain = (cc16_grouped @ digit_inline_rewrite).optimize() + + domain = ( + pynutil.delete("domain:") + + delete_space + + pynutil.delete('"') + + ((raw_domain @ digit_inline_rewrite) @ tld_rewrite @ add_space_before_dot) + + delete_space + + pynutil.delete('"') + ).optimize() + + # 6) protocol (like “https://” or “file:///”) + protocol = ( + pynutil.delete('protocol: "') + pynini.closure(NEMO_NOT_QUOTE, 1) + pynutil.delete('"') + insert_space + ) + + protocol_raw = pynutil.delete('protocol: "') + pynini.closure(NEMO_NOT_QUOTE, 1) + pynutil.delete('"') + cc_protocol_guard = pynini.accep("신용카드") + pynini.closure(NEMO_NOT_QUOTE, 0) + cc_protocol = (protocol_raw @ cc_protocol_guard) + insert_space + + # Credit card case: "신용카드 ..." protocol + 16-digit domain grouped as 4-4-4-4 + cc_graph = ( + cc_protocol + + delete_space + + pynutil.delete("domain:") + + delete_space + + pynutil.delete('"') + + cc_domain + + pynutil.delete('"') + + delete_space + ).optimize() + + # 7) Combine: optional protocol + optional username + domain + default_graph = ( + pynini.closure(protocol + delete_space, 0, 1) + + pynini.closure(user_name + delete_space + pynutil.insert(" 골뱅이 ") + delete_space, 0, 1) + + domain + + delete_space + ).optimize() + + graph = (cc_graph | default_graph) @ pynini.cdrewrite(delete_extra_space, "", "", NEMO_SIGMA) + self.fst = self.delete_tokens(graph).optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ko/verbalizers/fraction.py b/zonos3/vendor/nemo_text_processing/text_normalization/ko/verbalizers/fraction.py new file mode 100644 index 0000000000000000000000000000000000000000..14d6eb1b722989918e29db7345abed484a415350 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ko/verbalizers/fraction.py @@ -0,0 +1,182 @@ +# Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.ko.graph_utils import NEMO_NOT_QUOTE, NEMO_SPACE, GraphFst, delete_space + + +class FractionFst(GraphFst): + """ + Finite state transducer for verbalizing Korean fractions, e.g. + tokens { fraction { numerator: "3" denominator: "5" } } → 5분의3 + tokens { fraction { integer_part: "2" numerator: "7" denominator: "9" } } → 2과 9분의7 + tokens { fraction { denominator: "√8" numerator: "4" } } → 루트8분의4 + tokens { fraction { denominator: "2.75" numerator: "125" } } → 2.75분의125 + tokens { fraction { negative: "마이너스" numerator: "10" denominator: "11" } } → 마이너스11분의10 + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="fraction", kind="verbalize", deterministic=deterministic) + + # Handles square root symbols like "√3" → "루트3" + denominator_root = pynini.cross("√", "루트") + pynutil.insert(NEMO_SPACE) + pynini.closure(NEMO_NOT_QUOTE) + numerator_root = pynini.cross("√", "루트") + pynutil.insert(NEMO_SPACE) + pynini.closure(NEMO_NOT_QUOTE) + + # Matches non-root numeric content + denominator = pynini.closure(NEMO_NOT_QUOTE - "√") + numerator = pynini.closure(NEMO_NOT_QUOTE - "√") + + # Delete FST field: denominator and extract value + denominator_component = ( + pynutil.delete('denominator: "') + (denominator_root | denominator) + pynutil.delete('"') + ) + numerator_component = pynutil.delete('numerator: "') + (numerator_root | numerator) + pynutil.delete('"') + + # Match fraction form: "denominator + 분의 + numerator" + # Also deletes optional morphosyntactic_features: "분의" if present + graph_fraction = ( + denominator_component + + pynutil.delete(NEMO_SPACE) + + pynini.closure( + pynutil.delete('morphosyntactic_features:') + delete_space + pynutil.delete('"분의"') + delete_space, + 0, + 1, + ) + + pynutil.insert("분의") + + pynutil.insert(NEMO_SPACE) + + numerator_component + ) + + # Handle subject particle feature (분의_subject) + # Insert default particle "이" (will be corrected later via rewrite rules) + subject_suffix = ( + pynutil.delete(NEMO_SPACE) + + pynutil.delete('morphosyntactic_features:') + + delete_space + + pynutil.delete('"분의_subject"') + + delete_space + + pynutil.insert("이") # 일단 기본값 + ) + + # Handle topic particle feature (분의_topic) + topic_suffix = ( + pynutil.delete(NEMO_SPACE) + + pynutil.delete('morphosyntactic_features:') + + delete_space + + pynutil.delete('"분의_topic"') + + delete_space + + pynutil.insert("은") + ) + + # Handle object particle feature (분의_object) + object_suffix = ( + pynutil.delete(NEMO_SPACE) + + pynutil.delete('morphosyntactic_features:') + + delete_space + + pynutil.delete('"분의_object"') + + delete_space + + pynutil.insert("을") + ) + + # Combine fraction + optional particle suffix + # Particle is always inserted first in default form and later corrected + graph_fraction_all = graph_fraction + pynini.closure(subject_suffix | topic_suffix | object_suffix, 0, 1) + + # Handle integer + fraction (e.g., "2과 3/4") + # integer_part is removed and replaced with proper spacing + graph_integer = ( + pynutil.delete('integer_part:') + + delete_space + + pynutil.delete('"') + + pynini.closure(pynini.union("√", ".", NEMO_NOT_QUOTE - '"')) + + pynutil.delete('"') + + pynutil.insert(NEMO_SPACE) + ) + # Combine integer part with fraction + graph_integer_fraction = graph_integer + delete_space + graph_fraction_all + + # Handle optional negative prefix (e.g., "마이너스") + optional_sign = ( + pynutil.delete('negative:') + + delete_space + + pynutil.delete('"') + + pynini.closure(NEMO_NOT_QUOTE - '"') + + pynutil.delete('"') + + delete_space + + pynutil.insert(NEMO_SPACE) + ) + + # Final structure: + # [optional negative] + (integer + fraction OR fraction only) + graph = pynini.closure(optional_sign, 0, 1) + (graph_integer_fraction | graph_fraction_all) + + # Remove token wrappers + final_graph = self.delete_tokens(graph) + + # Sigma for rewrite context (entire string) + sigma = pynini.closure(NEMO_NOT_QUOTE | NEMO_SPACE) + + # Fix subject particle agreement (이 → 가 for vowel-ending numerals) + # e.g., 사이 → 사가, 구이 → 구가 + subject_rewrite = pynini.cdrewrite( + pynini.string_map( + [ + ("이이", "이가"), + ("사이", "사가"), + ("오이", "오가"), + ("구이", "구가"), + ] + ), + "", + "", + sigma, + ) + + # Fix topic particle agreement (은 → 는) + # e.g., 이은 → 이는, 사은 → 사는 + topic_rewrite = pynini.cdrewrite( + pynini.string_map( + [ + ("이은", "이는"), + ("사은", "사는"), + ("오은", "오는"), + ("구은", "구는"), + ] + ), + "", + "", + sigma, + ) + + # Fix object particle agreement (을 → 를) + # e.g., 오을 → 오를, 이을 → 이를 + object_rewrite = pynini.cdrewrite( + pynini.string_map( + [ + ("이을", "이를"), + ("사을", "사를"), + ("오을", "오를"), + ("구을", "구를"), + ] + ), + "", + "", + sigma, + ) + + # Apply all rewrite rules sequentially and final optimized FST + final_graph = final_graph @ subject_rewrite @ topic_rewrite @ object_rewrite + self.fst = final_graph.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ko/verbalizers/measure.py b/zonos3/vendor/nemo_text_processing/text_normalization/ko/verbalizers/measure.py new file mode 100644 index 0000000000000000000000000000000000000000..3402920e22a06f37ce024a1451d91d3f098f64ab --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ko/verbalizers/measure.py @@ -0,0 +1,89 @@ +# Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.ko.graph_utils import ( + NEMO_NOT_QUOTE, + NEMO_SIGMA, + GraphFst, + delete_space, + insert_space, +) + + +class MeasureFst(GraphFst): + """ + Finite state transducer for verbalizing Korean measure tokens into surface text. + measure { cardinal { integer: "<...>" } units: "<...>" } + + Converts tokens like: + measure { cardinal { integer: "이" } units: "킬로그램" } + measure { fraction { numerator: "이" denominator: "삼" } units: "킬로미터" } + + into surface text: + "이 킬로그램", "삼분의 이 킬로미터" + + Args: + decimal, cardinal, fraction: Sub-verbalizers handling number types. + deterministic: If True, outputs a single normalized form. + """ + + def __init__( + self, + decimal: GraphFst = None, + cardinal: GraphFst = None, + fraction: GraphFst = None, + deterministic: bool = True, + ): + super().__init__(name="measure", kind="verbalize", deterministic=deterministic) + + # Combine all numeric verbalizers + graph_cardinal = cardinal.fst + graph_decimal = decimal.fst + graph_fraction = fraction.fst + + # Add a space after "마이너스" if it appears within numeric blocks + minus_space_rewrite = pynini.cdrewrite(pynini.cross("마이너스", "마이너스 "), "", "", NEMO_SIGMA).optimize() + + # Apply rewrite to each numeric subgraph to ensure spacing after "마이너스" + cardinal_spaced = graph_cardinal @ minus_space_rewrite + fraction_spaced = graph_fraction @ minus_space_rewrite + decimal_spaced = graph_decimal @ minus_space_rewrite + + # Combine all supported numeric types (cardinal | decimal | fraction) + number_block = decimal_spaced | cardinal_spaced | fraction_spaced + + # Extract and output unit string + units = ( + delete_space + + pynutil.delete("units:") + + delete_space + + pynutil.delete('"') + + pynini.closure(NEMO_NOT_QUOTE, 1) + + pynutil.delete('"') + ) + + # Normal form: + main = number_block + insert_space + units + + # preserve_order form: + preserve_order = delete_space + pynutil.delete("preserve_order:") + delete_space + pynutil.delete("true") + alt = units + insert_space + number_block + pynini.closure(preserve_order) + + graph = main | alt + + # Merge and clean tokens + self.fst = self.delete_tokens(graph).optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ko/verbalizers/money.py b/zonos3/vendor/nemo_text_processing/text_normalization/ko/verbalizers/money.py new file mode 100644 index 0000000000000000000000000000000000000000..ce89d9040e29f658839f04b7b9b4fd40b21978d1 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ko/verbalizers/money.py @@ -0,0 +1,110 @@ +# Copyright (c) 2025, NVIDIA CORPORATION.  All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +#     http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.ko.graph_utils import NEMO_NOT_QUOTE, GraphFst, delete_space, insert_space + +# ===== whitespace & token helpers ===== +sp = pynini.closure(delete_space) # absorb 0+ spaces +FIELD_VAL = pynini.closure(NEMO_NOT_QUOTE, 1) + + +def del_key_val(key: str): + """ + Delete the token field prefix and quotes, keep only the value. + + Input format: [sp] key: "" + Output: + + Example: + input 'integer_part: "삼백오십"' + output '삼백오십' + """ + return (sp + pynutil.delete(f'{key}: "') + FIELD_VAL + pynutil.delete('"')).optimize() + + +def drop_key_val(key: str): + """ + Delete the entire key-value pair (key and its quoted value). + + Input format: [sp] key: "" + Output: (nothing) + + Example: + input 'minor_part: "십"' + output '' + """ + return (sp + pynutil.delete(f'{key}: "') + FIELD_VAL + pynutil.delete('"')).optimize() + + +def drop_key_exact(key: str, val: str): + """ + Delete the exact key-value pair if it matches the given value. + + Input format: [sp] key: "val" + Output: (nothing) + + Example: + input 'currency_maj: "원"' + output '' + """ + return (sp + pynutil.delete(f'{key}: "{val}"')).optimize() + + +class MoneyFst(GraphFst): + """ + Verbalize Korean money. + + Input tokens: + tokens { money { integer_part: "..." currency_maj: "..." [minor_part: "..."] } } + + Period (e.g., /월, /년, …) is intentionally NOT handled here. + Output examples: + integer_part: "십" currency_maj: "원" -> "십원" + integer_part: "삼십억" currency_maj: "원" -> "삼십억원" + integer_part: "이백" currency_maj: "달러" -> "이백 달러" + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="money", kind="verbalize", deterministic=deterministic) + + # --- fields --- + integer_part = del_key_val("integer_part") + minor_part_drop = drop_key_val("minor_part") # ignore minor for KRW + currency_val_any = del_key_val("currency_maj") # ex) "원", "달러", "유로" + won_key_drop = drop_key_exact("currency_maj", "원") # don't print the key for KRW + + # ===== KRW (원) ===== + # (A) [integer] [원] -> "{integer}원" + won_a = integer_part + sp + won_key_drop + pynutil.insert("원") + # (B) [원] [integer] -> "{integer}원" + won_b = won_key_drop + sp + integer_part + pynutil.insert("원") + won_core = won_a | won_b + won_core = (won_core + pynini.closure(minor_part_drop, 0, 1)).optimize() + + # ===== Other currencies ===== + # "{integer} {currency}" (KRW sticks; others are spaced) + other_core = (integer_part + insert_space + currency_val_any).optimize() + other_core = (other_core + pynini.closure(minor_part_drop, 0, 1)).optimize() + + # ===== combine (no period) ===== + graph_core = (pynutil.add_weight(won_core, 0.0) | pynutil.add_weight(other_core, 0.5)).optimize() + + # no trailing period mapping + graph = graph_core + + # strip tokens wrapper + self.fst = self.delete_tokens(graph).optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ko/verbalizers/ordinal.py b/zonos3/vendor/nemo_text_processing/text_normalization/ko/verbalizers/ordinal.py new file mode 100644 index 0000000000000000000000000000000000000000..17741af954fe267bb197d2c5ed9b6f210656ba75 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ko/verbalizers/ordinal.py @@ -0,0 +1,42 @@ +# Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.ko.graph_utils import NEMO_NOT_QUOTE, GraphFst, delete_space + + +class OrdinalFst(GraphFst): + """ + Finite state transducer for verbalizing korean ordinal e.g. + tokens { ordinal { integer: "1번째" } } -> 첫번째 + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="ordinal", kind="verbalize", deterministic=deterministic) + + graph_integer = ( + pynutil.delete("integer:") + + delete_space + + pynutil.delete("\"") + + pynini.closure(NEMO_NOT_QUOTE) + + pynutil.delete("\"") + ) + + final_graph = graph_integer + + delete_tokens = self.delete_tokens(final_graph) + self.fst = delete_tokens.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ko/verbalizers/telephone.py b/zonos3/vendor/nemo_text_processing/text_normalization/ko/verbalizers/telephone.py new file mode 100644 index 0000000000000000000000000000000000000000..989427c587d67cbfd351878e983c77d2f26f634b --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ko/verbalizers/telephone.py @@ -0,0 +1,83 @@ +# Copyright (c) 2025 NVIDIA CORPORATION.  All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +#     http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# -*- coding: utf-8 -*- +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.ko.graph_utils import NEMO_NOT_QUOTE, GraphFst, delete_space, insert_space + + +class TelephoneFst(GraphFst): + """ + Finite state transducer for verbalizing Korean telephone numbers. + + Input: + telephone { [country_code: "...",] number_part: "..." [extension: "..."] } + Output: + [country_code + " "] + number_part [+ ", 내선 " + extension] + + Examples: + telephone { country_code: "국가번호 팔이," number_part: "영일영 삼칠일삼 칠영오영" } + -> 플러스 팔 이, 영일영, 삼칠일삼, 칠영오영 + telephone { number_part: "팔영영 오오오 영영영영" extension: "이삼사" } + -> 팔영영, 오오오, 영영영영, 내선 이삼사 + + Args: + deterministic: if True provides a single transduction; if False allows multiple. + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="telephone", kind="verbalize", deterministic=deterministic) + + # country_code (optional, add trailing space if present) + country = ( + pynini.closure(delete_space, 0, 1) + + pynutil.delete('country_code: "') + + pynutil.insert("국가번호 ") + + pynini.closure(NEMO_NOT_QUOTE, 1) + + pynutil.delete('"') + + insert_space + ) + + # number_part (mandatory) + number = ( + pynini.closure(delete_space, 0, 1) + + pynutil.delete('number_part: "') + + pynini.closure(NEMO_NOT_QUOTE, 1) + + pynutil.delete('"') + ) + + # extension (optional, prepend with ", 내선 ") + ext_field = ( + pynini.closure(delete_space, 0, 1) + + pynutil.delete('extension: "') + + pynini.closure(NEMO_NOT_QUOTE, 1) + + pynutil.delete('"') + ) + extension_opt = pynini.closure(pynutil.insert(", 내선 ") + ext_field, 0, 1) + + # remove wrapper "telephone { ... }" + graph = ( + pynutil.delete("telephone") + + pynini.closure(delete_space, 0, 1) + + pynutil.delete("{") + + pynini.closure(country, 0, 1) + + number + + extension_opt + + pynini.closure(delete_space, 0, 1) + + pynutil.delete("}") + ) + + self.fst = graph.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ko/verbalizers/time.py b/zonos3/vendor/nemo_text_processing/text_normalization/ko/verbalizers/time.py new file mode 100644 index 0000000000000000000000000000000000000000..625dc9fda481533a9f45f9e0f42492c308f3246b --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ko/verbalizers/time.py @@ -0,0 +1,63 @@ +# Copyright (c) 2025 NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.ko.graph_utils import NEMO_NOT_QUOTE, GraphFst, delete_space, insert_space + + +class TimeFst(GraphFst): + """ + Finite state transducer for verbalizing time e.g. + + + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="time", kind="verbalize", deterministic=deterministic) + + hour_component = pynutil.delete("hours: \"") + pynini.closure(NEMO_NOT_QUOTE) + pynutil.delete("\"") + minute_content = pynini.closure(NEMO_NOT_QUOTE) + minute_component = pynutil.delete("minutes: \"") + pynini.cross("영분", "") + pynutil.delete( + "\"" + ) | pynutil.delete("minutes: \"") + (minute_content - "영분") + pynutil.delete("\"") + + second_content = pynini.closure(NEMO_NOT_QUOTE) + second_component = pynutil.delete("seconds: \"") + pynini.cross("영초", "") + pynutil.delete( + "\"" + ) | pynutil.delete("seconds: \"") + (second_content - "영초") + pynutil.delete("\"") + + division_component = pynutil.delete("suffix: \"") + pynini.closure(NEMO_NOT_QUOTE) + pynutil.delete("\"") + + graph_basic_time = pynini.closure(division_component + delete_space + insert_space, 0, 1) + ( + ( + hour_component + + delete_space + + insert_space + + minute_component + + delete_space + + insert_space + + second_component + ) + | (hour_component + delete_space + insert_space + minute_component) + | hour_component + | minute_component + | second_component + ) + + final_graph = graph_basic_time + + delete_tokens = self.delete_tokens(final_graph) + self.fst = delete_tokens.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ko/verbalizers/verbalize.py b/zonos3/vendor/nemo_text_processing/text_normalization/ko/verbalizers/verbalize.py new file mode 100644 index 0000000000000000000000000000000000000000..fb75f7702c989d26f76106c481c6e1674e390f19 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ko/verbalizers/verbalize.py @@ -0,0 +1,74 @@ +# Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini + +from zonos3.vendor.nemo_text_processing.text_normalization.ko.graph_utils import GraphFst +from zonos3.vendor.nemo_text_processing.text_normalization.ko.verbalizers.cardinal import CardinalFst +from zonos3.vendor.nemo_text_processing.text_normalization.ko.verbalizers.date import DateFst +from zonos3.vendor.nemo_text_processing.text_normalization.ko.verbalizers.decimal import DecimalFst +from zonos3.vendor.nemo_text_processing.text_normalization.ko.verbalizers.electronic import ElectronicFst +from zonos3.vendor.nemo_text_processing.text_normalization.ko.verbalizers.fraction import FractionFst +from zonos3.vendor.nemo_text_processing.text_normalization.ko.verbalizers.measure import MeasureFst +from zonos3.vendor.nemo_text_processing.text_normalization.ko.verbalizers.money import MoneyFst +from zonos3.vendor.nemo_text_processing.text_normalization.ko.verbalizers.ordinal import OrdinalFst +from zonos3.vendor.nemo_text_processing.text_normalization.ko.verbalizers.telephone import TelephoneFst +from zonos3.vendor.nemo_text_processing.text_normalization.ko.verbalizers.time import TimeFst +from zonos3.vendor.nemo_text_processing.text_normalization.ko.verbalizers.whitelist import WhiteListFst +from zonos3.vendor.nemo_text_processing.text_normalization.ko.verbalizers.word import WordFst + + +class VerbalizeFst(GraphFst): + """ + Composes other verbalizer grammars. + For deployment, this grammar will be compiled and exported to OpenFst Finite State Archive (FAR) File. + More details to deployment at NeMo/tools/text_processing_deployment. + + Args: + deterministic: if True will provide a single transduction option, + for False multiple options (used for audio-based normalization) + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="verbalize", kind="verbalize", deterministic=deterministic) + + cardinal = CardinalFst(deterministic=deterministic) + date = DateFst(deterministic=deterministic) + ordinal = OrdinalFst(deterministic=deterministic) + decimal = DecimalFst(deterministic=deterministic) + word = WordFst(deterministic=deterministic) + fraction = FractionFst(deterministic=deterministic) + whitelist = WhiteListFst(deterministic=deterministic) + time = TimeFst(deterministic=deterministic) + money = MoneyFst(deterministic=deterministic) + telephone = TelephoneFst(deterministic=deterministic) + measure = MeasureFst(decimal=decimal, cardinal=cardinal, fraction=fraction, deterministic=deterministic) + electronic = ElectronicFst(deterministic=deterministic) + + graph = pynini.union( + cardinal.fst, + ordinal.fst, + word.fst, + decimal.fst, + fraction.fst, + date.fst, + whitelist.fst, + time.fst, + money.fst, + telephone.fst, + measure.fst, + electronic.fst, + ) + + self.fst = graph.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ko/verbalizers/verbalize_final.py b/zonos3/vendor/nemo_text_processing/text_normalization/ko/verbalizers/verbalize_final.py new file mode 100644 index 0000000000000000000000000000000000000000..6cb192e1179938d870d3ac1214be132aba5867e9 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ko/verbalizers/verbalize_final.py @@ -0,0 +1,72 @@ +# Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import os + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.ko.graph_utils import ( + NEMO_WHITE_SPACE, + GraphFst, + delete_space, + generator_main, +) +from zonos3.vendor.nemo_text_processing.text_normalization.ko.verbalizers.verbalize import VerbalizeFst +from zonos3.vendor.nemo_text_processing.utils.logging import logger + + +class VerbalizeFinalFst(GraphFst): + """ + Finite state transducer that verbalizes an entire sentence, e.g. + tokens { name: "its" } tokens { time { hours: "twelve" minutes: "thirty" } } tokens { name: "now" } tokens { name: "." } -> its twelve thirty now . + + Args: + deterministic: if True will provide a single transduction option, + for False multiple options (used for audio-based normalization) + cache_dir: path to a dir with .far grammar file. Set to None to avoid using cache. + overwrite_cache: set to True to overwrite .far files + """ + + def __init__(self, deterministic: bool = True, cache_dir: str = None, overwrite_cache: bool = False): + super().__init__(name="verbalize_final", kind="verbalize", deterministic=deterministic) + + far_file = None + if cache_dir is not None and cache_dir != "None": + os.makedirs(cache_dir, exist_ok=True) + far_file = os.path.join(cache_dir, f"ko_tn_{deterministic}_verbalizer.far") + + if not overwrite_cache and far_file and os.path.exists(far_file): + self.fst = pynini.Far(far_file, mode="r")["verbalize"] + logger.info(f'VerbalizeFinalFst graph was restored from {far_file}.') + else: + token_graph = VerbalizeFst(deterministic=deterministic) + + token_verbalizer = ( + pynutil.delete("tokens {") + delete_space + token_graph.fst + delete_space + pynutil.delete(" }") + ) + + space_between_tokens = pynini.closure(NEMO_WHITE_SPACE, 1) + + verbalizer = ( + delete_space + + token_verbalizer + + pynini.closure(space_between_tokens + token_verbalizer) + + delete_space + ) + + self.fst = verbalizer.optimize() + + if far_file: + generator_main(far_file, {"verbalize": self.fst}) diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ko/verbalizers/whitelist.py b/zonos3/vendor/nemo_text_processing/text_normalization/ko/verbalizers/whitelist.py new file mode 100644 index 0000000000000000000000000000000000000000..8397341cf3d0caf5c7391e621ad946c6925dee12 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ko/verbalizers/whitelist.py @@ -0,0 +1,39 @@ +# Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.ko.graph_utils import NEMO_CHAR, NEMO_SIGMA, GraphFst, delete_space + + +class WhiteListFst(GraphFst): + """ + tokens { name: "부터" } -> 부터 + tokens { name: "~" } -> ~ + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="whitelist", kind="verbalize", deterministic=deterministic) + graph = ( + pynutil.delete("name:") + + delete_space + + pynutil.delete("\"") + + pynini.closure(NEMO_CHAR - " ", 1) + + pynutil.delete("\"") + ) + + graph = graph @ pynini.cdrewrite(pynini.cross(u"\u00a0", " "), "", "", NEMO_SIGMA) + + self.fst = graph.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/ko/verbalizers/word.py b/zonos3/vendor/nemo_text_processing/text_normalization/ko/verbalizers/word.py new file mode 100644 index 0000000000000000000000000000000000000000..24b0c5c6fa6d90c3b9474eb9d68c8a0cf6d6c48e --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/ko/verbalizers/word.py @@ -0,0 +1,31 @@ +# Copyright (c) 2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.ja.graph_utils import NEMO_NOT_QUOTE, GraphFst + + +class WordFst(GraphFst): + """ + Korean verbalizer for word. + tokens { name: "이름" } -> 이름 + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="word", kind="verbalize", deterministic=deterministic) + + graph = pynutil.delete("name: \"") + NEMO_NOT_QUOTE + pynutil.delete("\"") + self.fst = graph.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/normalize.py b/zonos3/vendor/nemo_text_processing/text_normalization/normalize.py new file mode 100644 index 0000000000000000000000000000000000000000..e6746c166176e445994e166553cb7ad19e284cdf --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/normalize.py @@ -0,0 +1,851 @@ +# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import itertools +import json +import os +import re +import shutil +import sys +from argparse import ArgumentParser +from collections import OrderedDict +from glob import glob +from math import factorial +from time import perf_counter +from typing import Dict, List, Optional, Union + +import pynini +import regex +import tqdm +from joblib import Parallel, delayed +from pynini.lib.rewrite import top_rewrite +from sacremoses import MosesDetokenizer +from tqdm import tqdm + +from zonos3.vendor.nemo_text_processing.text_normalization.data_loader_utils import ( + load_file, + post_process_punct, + pre_process, + write_file, +) +from zonos3.vendor.nemo_text_processing.text_normalization.preprocessing_utils import additional_split +from zonos3.vendor.nemo_text_processing.text_normalization.token_parser import PRESERVE_ORDER_KEY, TokenParser +from zonos3.vendor.nemo_text_processing.utils.logging import logger + +# this is to handle long input +sys.setrecursionlimit(3000) + +SPACE_DUP = re.compile(' {2,}') + + +""" +To normalize a single entry: + python normalize.py --text= + +To normalize text in .json manifest: + + python normalize.py \ + --input_file= \ + --output_file= \ + --n_jobs=-1 \ + --batch_size=300 \ + --manifest_text_field="text" \ + --whitelist= + + For a complete list of optional arguments, run: + >>> python normalize.py --help + + +To integrate Normalizer in your script: + >>> from zonos3.vendor.nemo_text_processing.text_normalization.normalize import Normalizer + # see the script for args details + >>> normalizer_en = Normalizer(input_case='cased', lang='en', cache_dir=CACHE_DIR, overwrite_cache=False, post_process=True) + >>> normalizer_en.normalize("") + # normalize list of entries + >>> normalizer_en.normalize_list(["", ""]) + # normalize .json manifest entries + >>> normalizer_en.normalize_manifest(manifest=, n_jobs=-1, batch_size=300, + output_filename=, text_field="text", + punct_pre_process=False, punct_post_process=False) + +""" + + +class Normalizer: + """ + Normalizer class that converts text from written to spoken form. + Useful for TTS preprocessing. + + Args: + input_case: Input text capitalization, set to 'cased' if text contains capital letters. + This flag affects normalization rules applied to the text. Note, `lower_cased` won't lower case input. + lang: language specifying the TN rules, by default: English + cache_dir: path to a dir with .far grammar file. Set to None to avoid using cache. + overwrite_cache: set to True to overwrite .far files + whitelist: path to a file with whitelist replacements + post_process: WFST-based post processing, e.g. to remove extra spaces added during TN. + Note: punct_post_process flag in normalize() supports all languages. + max_number_of_permutations_per_split: a maximum number + of permutations which can be generated from input sequence of tokens. + verbose: whether to print intermediate meta information + """ + + def __init__( + self, + input_case: str, + lang: str = 'en', + deterministic: bool = True, + cache_dir: str = None, + overwrite_cache: bool = False, + whitelist: str = None, + lm: bool = False, + post_process: bool = True, + max_number_of_permutations_per_split: int = 729, + ): + assert input_case in ["lower_cased", "cased"] + + self.post_processor = None + + if lang == "en": + from zonos3.vendor.nemo_text_processing.text_normalization.en.verbalizers.post_processing import PostProcessingFst + from zonos3.vendor.nemo_text_processing.text_normalization.en.verbalizers.verbalize_final import VerbalizeFinalFst + + if post_process: + self.post_processor = PostProcessingFst(cache_dir=cache_dir, overwrite_cache=overwrite_cache) + + if deterministic: + from zonos3.vendor.nemo_text_processing.text_normalization.en.taggers.tokenize_and_classify import ClassifyFst + else: + if lm: + from zonos3.vendor.nemo_text_processing.text_normalization.en.taggers.tokenize_and_classify_lm import ClassifyFst + else: + from zonos3.vendor.nemo_text_processing.text_normalization.en.taggers.tokenize_and_classify_with_audio import ( + ClassifyFst, + ) + elif lang == 'ru': + # Ru TN only support non-deterministic cases and produces multiple normalization options + # use normalize_with_audio.py + from zonos3.vendor.nemo_text_processing.text_normalization.ru.taggers.tokenize_and_classify import ClassifyFst + from zonos3.vendor.nemo_text_processing.text_normalization.ru.verbalizers.verbalize_final import VerbalizeFinalFst + elif lang == 'de': + from zonos3.vendor.nemo_text_processing.text_normalization.de.taggers.tokenize_and_classify import ClassifyFst + from zonos3.vendor.nemo_text_processing.text_normalization.de.verbalizers.verbalize_final import VerbalizeFinalFst + elif lang == 'es': + from zonos3.vendor.nemo_text_processing.text_normalization.es.taggers.tokenize_and_classify import ClassifyFst + from zonos3.vendor.nemo_text_processing.text_normalization.es.verbalizers.verbalize_final import VerbalizeFinalFst + elif lang == 'fr': + from zonos3.vendor.nemo_text_processing.text_normalization.fr.taggers.tokenize_and_classify import ClassifyFst + from zonos3.vendor.nemo_text_processing.text_normalization.fr.verbalizers.verbalize_final import VerbalizeFinalFst + elif lang == 'sv': + from zonos3.vendor.nemo_text_processing.text_normalization.sv.taggers.tokenize_and_classify import ClassifyFst + from zonos3.vendor.nemo_text_processing.text_normalization.sv.verbalizers.verbalize_final import VerbalizeFinalFst + elif lang == 'hu': + from zonos3.vendor.nemo_text_processing.text_normalization.hu.taggers.tokenize_and_classify import ClassifyFst + from zonos3.vendor.nemo_text_processing.text_normalization.hu.verbalizers.verbalize_final import VerbalizeFinalFst + elif lang == 'zh': + from zonos3.vendor.nemo_text_processing.text_normalization.zh.taggers.tokenize_and_classify import ClassifyFst + from zonos3.vendor.nemo_text_processing.text_normalization.zh.verbalizers.verbalize_final import VerbalizeFinalFst + elif lang == 'ar': + from zonos3.vendor.nemo_text_processing.text_normalization.ar.taggers.tokenize_and_classify import ClassifyFst + from zonos3.vendor.nemo_text_processing.text_normalization.ar.verbalizers.verbalize_final import VerbalizeFinalFst + elif lang == 'hi': + from zonos3.vendor.nemo_text_processing.text_normalization.hi.taggers.tokenize_and_classify import ClassifyFst + from zonos3.vendor.nemo_text_processing.text_normalization.hi.verbalizers.post_processing import PostProcessingFst + from zonos3.vendor.nemo_text_processing.text_normalization.hi.verbalizers.verbalize_final import VerbalizeFinalFst + + if post_process: + self.post_processor = PostProcessingFst(cache_dir=cache_dir, overwrite_cache=overwrite_cache) + elif lang == 'it': + from zonos3.vendor.nemo_text_processing.text_normalization.it.taggers.tokenize_and_classify import ClassifyFst + from zonos3.vendor.nemo_text_processing.text_normalization.it.verbalizers.verbalize_final import VerbalizeFinalFst + elif lang == 'hy': + from zonos3.vendor.nemo_text_processing.text_normalization.hy.taggers.tokenize_and_classify import ClassifyFst + from zonos3.vendor.nemo_text_processing.text_normalization.hy.verbalizers.verbalize_final import VerbalizeFinalFst + elif lang == 'rw': + from zonos3.vendor.nemo_text_processing.text_normalization.rw.taggers.tokenize_and_classify import ClassifyFst + from zonos3.vendor.nemo_text_processing.text_normalization.rw.verbalizers.verbalize_final import VerbalizeFinalFst + elif lang == 'ja': + from zonos3.vendor.nemo_text_processing.text_normalization.ja.taggers.tokenize_and_classify import ClassifyFst + from zonos3.vendor.nemo_text_processing.text_normalization.ja.verbalizers.verbalize_final import VerbalizeFinalFst + elif lang == 'vi': + from zonos3.vendor.nemo_text_processing.text_normalization.vi.taggers.tokenize_and_classify import ClassifyFst + from zonos3.vendor.nemo_text_processing.text_normalization.vi.verbalizers.post_processing import PostProcessingFst + from zonos3.vendor.nemo_text_processing.text_normalization.vi.verbalizers.verbalize_final import VerbalizeFinalFst + + if post_process: + self.post_processor = PostProcessingFst(cache_dir=cache_dir, overwrite_cache=overwrite_cache) + elif lang == 'pt': + from zonos3.vendor.nemo_text_processing.text_normalization.pt.taggers.tokenize_and_classify import ClassifyFst + from zonos3.vendor.nemo_text_processing.text_normalization.pt.verbalizers.verbalize_final import VerbalizeFinalFst + elif lang == 'ko': + from zonos3.vendor.nemo_text_processing.text_normalization.ko.taggers.tokenize_and_classify import ClassifyFst + from zonos3.vendor.nemo_text_processing.text_normalization.ko.verbalizers.verbalize_final import VerbalizeFinalFst + else: + raise NotImplementedError(f"Language {lang} has not been supported yet.") + + self.input_case = input_case + self.tagger = ClassifyFst( + input_case=self.input_case, + deterministic=deterministic, + cache_dir=cache_dir, + overwrite_cache=overwrite_cache, + whitelist=whitelist, + ) + + self.verbalizer = VerbalizeFinalFst( + deterministic=deterministic, cache_dir=cache_dir, overwrite_cache=overwrite_cache + ) + self.max_number_of_permutations_per_split = max_number_of_permutations_per_split + self.parser = TokenParser() + self.lang = lang + self.moses_detokenizer = MosesDetokenizer(lang=lang) + + def normalize_list( + self, + texts: List[str], + verbose: bool = False, + punct_pre_process: bool = False, + punct_post_process: bool = False, + batch_size: int = 1, + n_jobs: int = 1, + **kwargs, + ): + """ + NeMo text normalizer + + Args: + texts: list of input strings + verbose: whether to print intermediate meta information + punct_pre_process: whether to do punctuation pre-processing + punct_post_process: whether to do punctuation post-processing + n_jobs: the maximum number of concurrently running jobs. If -1 all CPUs are used. If 1 is given, + no parallel computing code is used at all, which is useful for debugging. For n_jobs below -1, + (n_cpus + 1 + n_jobs) are used. Thus for n_jobs = -2, all CPUs but one are used. + batch_size: Number of examples for each process + + Returns converted list input strings + """ + + def _process_batch(batch, verbose, punct_pre_process, punct_post_process, **kwargs): + """ + Normalizes batch of text sequences + Args: + batch: list of texts + verbose: whether to print intermediate meta information + punct_pre_process: whether to do punctuation pre-processing + punct_post_process: whether to do punctuation post-processing + """ + normalized_lines = [ + self.normalize( + text, + verbose=verbose, + punct_pre_process=punct_pre_process, + punct_post_process=punct_post_process, + **kwargs, + ) + for text in tqdm(batch) + ] + return normalized_lines + + # to save intermediate results to a file + batch = min(len(texts), batch_size) + + try: + normalized_texts = Parallel(n_jobs=n_jobs)( + delayed(_process_batch)(texts[i : i + batch], verbose, punct_pre_process, punct_post_process, **kwargs) + for i in range(0, len(texts), batch) + ) + except BaseException as e: + raise e + + normalized_texts = list(itertools.chain(*normalized_texts)) + return normalized_texts + + def _estimate_number_of_permutations_in_nested_dict( + self, token_group: Dict[str, Union[OrderedDict, str, bool]] + ) -> int: + num_perms = 1 + for k, inner in token_group.items(): + if isinstance(inner, dict): + num_perms *= self._estimate_number_of_permutations_in_nested_dict(inner) + num_perms *= factorial(len(token_group)) + return num_perms + + def _split_tokens_to_reduce_number_of_permutations(self, tokens: List[dict]) -> List[List[dict]]: + """ + Splits a sequence of tokens in a smaller sequences of tokens in a way that maximum number of composite + tokens permutations does not exceed ``max_number_of_permutations_per_split``. + + For example, + + .. code-block:: python + + # setup normalizer with self.max_number_of_permutations_per_split=6 + tokens = [ + {"tokens": {"date": {"year": "twenty eighteen", "month": "december", "day": "thirty one"}}}, + {"tokens": {"date": {"year": "twenty eighteen", "month": "january", "day": "eight"}}}, + ] + split = normalizer._split_tokens_to_reduce_number_of_permutations(tokens) + assert split == [ + [{"tokens": {"date": {"year": "twenty eighteen", "month": "december", "day": "thirty one"}}}], + [{"tokens": {"date": {"year": "twenty eighteen", "month": "january", "day": "eight"}}}], + ] + + Date tokens contain 3 items each which gives 6 permutations for every date. Since there are 2 dates, total + number of permutations would be ``6 * 6 == 36``. Parameter ``self.max_number_of_permutations_per_split`` equals 6, + so input sequence of tokens is split into 2 smaller sequences. + + Args: + tokens: a list of dictionaries, possibly nested. + + Returns: + a list of smaller sequences of tokens resulting from ``tokens`` split. + """ + splits = [] + prev_end_of_split = 0 + current_number_of_permutations = 1 + for i, token_group in enumerate(tokens): + n = self._estimate_number_of_permutations_in_nested_dict(token_group) + if n * current_number_of_permutations > self.max_number_of_permutations_per_split: + splits.append(tokens[prev_end_of_split:i]) + prev_end_of_split = i + current_number_of_permutations = 1 + if n > self.max_number_of_permutations_per_split: + raise ValueError( + f"Could not split token list with respect to condition that every split can generate number of " + f"permutations less or equal to " + f"`self.max_number_of_permutations_per_split={self.max_number_of_permutations_per_split}`. " + f"There is an unsplittable token group that generates more than " + f"{self.max_number_of_permutations_per_split} permutations. Try to increase " + f"`--max_number_of_permutations_per_split` parameter." + ) + current_number_of_permutations *= n + splits.append(tokens[prev_end_of_split:]) + assert sum([len(s) for s in splits]) == len(tokens) + return splits + + def normalize( + self, text: str, verbose: bool = False, punct_pre_process: bool = False, punct_post_process: bool = False + ) -> str: + """ + Main function. Normalizes tokens from written to spoken form + e.g. 12 kg -> twelve kilograms + + Args: + text: string that may include semiotic classes + punct_pre_process: whether to perform punctuation pre-processing, for example, [25] -> [ 25 ] + punct_post_process: whether to normalize punctuation + verbose: whether to print intermediate meta information + + Returns: spoken form + """ + logger.setLevel('DEBUG' if verbose else 'INFO') + if len(text.split()) > 500: + logger.warning( + "Your input is too long and could take a long time to normalize. " + "Use split_text_into_sentences() to make the input shorter and then call normalize_list()." + ) + original_text = text + if punct_pre_process: + text = pre_process(text) + text = text.strip() + if not text: + logger.debug(text) + return text + text = pynini.escape(text) + tagged_lattice = self.find_tags(text) + tagged_text = Normalizer.select_tag(tagged_lattice) + logger.debug(tagged_text) + + self.parser(tagged_text) + tokens = self.parser.parse() + split_tokens = self._split_tokens_to_reduce_number_of_permutations(tokens) + output = "" + for s in split_tokens: + try: + tags_reordered = self.generate_permutations(s) + verbalizer_lattice = None + for tagged_text in tags_reordered: + tagged_text = pynini.escape(tagged_text) + + verbalizer_lattice = self.find_verbalizer(tagged_text) + if verbalizer_lattice.num_states() != 0: + break + if verbalizer_lattice is None: + logger.warning(f"No permutations were generated from tokens {s}") + return text + output += ' ' + Normalizer.select_verbalizer(verbalizer_lattice) + except Exception as e: + logger.warning("Failed text: " + text + str(e)) + return text + output = SPACE_DUP.sub(' ', output[1:]) + + if self.lang in ["en", "hi", "vi"] and hasattr(self, 'post_processor') and self.post_processor is not None: + output = self.post_process(output) + + if punct_post_process: + # do post-processing based on Moses detokenizer + output = self.moses_detokenizer.detokenize([output], unescape=False) + output = post_process_punct(input=original_text, normalized_text=output) + return output + + def normalize_line( + self, + line: str, + verbose: bool = False, + punct_pre_process=False, + punct_post_process=True, + text_field: str = "text", + output_field: str = "normalized", + **kwargs, + ): + """ + Normalizes "text_field" in line from a .json manifest + + Args: + line: line of a .json manifest + verbose: set to True to see intermediate output of normalization + punct_pre_process: set to True to do punctuation pre-processing + punct_post_process: set to True to do punctuation post-processing + text_field: name of the field in the manifest to normalize + output_field: name of the field in the manifest to save normalized text + """ + line = json.loads(line) + + normalized_text = self.normalize( + text=line[text_field], + verbose=verbose, + punct_pre_process=punct_pre_process, + punct_post_process=punct_post_process, + **kwargs, + ) + line[output_field] = normalized_text + return line + + def normalize_manifest( + self, + manifest: str, + n_jobs: int, + punct_pre_process: bool, + punct_post_process: bool, + batch_size: int, + output_filename: Optional[str] = None, + text_field: str = "text", + verbose: bool = False, + **kwargs, + ): + """ + Normalizes "text_field" from .json manifest. + + Args: + manifest: path to .json manifest file + n_jobs: the maximum number of concurrently running jobs. If -1 all CPUs are used. If 1 is given, + no parallel computing code is used at all, which is useful for debugging. For n_jobs below -1, + (n_cpus + 1 + n_jobs) are used. Thus for n_jobs = -2, all CPUs but one are used. + punct_pre_process: set to True to do punctuation pre-processing + punct_post_process: set to True to do punctuation post-processing + batch_size: number of samples to process per iteration (int) + output_filename: path to .json file to save normalized text + text_field: name of the field in the manifest to normalize + **kwargs are need for audio-based normalization that requires extra args + """ + + def _process_batch( + batch_idx: int, + batch: List[str], + dir_name: str, + verbose=verbose, + punct_pre_process=False, + punct_post_process=True, + text_field: str = "text", + output_field: str = "normalized", + **kwargs, + ): + """ + Normalizes batch of text sequences + Args: + batch: list of texts + batch_idx: batch index + dir_name: path to output directory to save results + """ + normalized_lines = [ + self.normalize_line( + line=line, + verbose=verbose, + punct_post_process=punct_post_process, + punct_pre_process=punct_pre_process, + text_field=text_field, + output_field=output_field, + **kwargs, + ) + for line in tqdm(batch) + ] + + with open(f"{dir_name}/{batch_idx:06}.json", "w") as f_out: + for line in normalized_lines: + if isinstance(line[output_field], set): + if len(line[output_field]) > 1: + logger.warning("Len of " + str(line[output_field]) + " > 1 ") + line[output_field] = line[output_field].pop() + + f_out.write(json.dumps(line, ensure_ascii=False) + '\n') + + logger.info(f"Batch -- {batch_idx} -- is complete") + + if output_filename is None: + output_filename = manifest.replace('.json', '_normalized.json') + + with open(manifest, 'r') as f: + lines = f.readlines() + + logger.warning(f'Normalizing {len(lines)} line(s) of {manifest}...') + + # to save intermediate results to a file + batch = min(len(lines), batch_size) + + tmp_dir = "/tmp/parts" + if os.path.exists(tmp_dir): + shutil.rmtree(tmp_dir) + os.makedirs(tmp_dir) + + Parallel(n_jobs=n_jobs)( + delayed(_process_batch)( + idx, + lines[i : i + batch], + tmp_dir, + text_field=text_field, + verbose=verbose, + punct_pre_process=punct_pre_process, + punct_post_process=punct_post_process, + **kwargs, + ) + for idx, i in enumerate(range(0, len(lines), batch)) + ) + + # aggregate all intermediate files + with open(output_filename, "w") as f_out: + for batch_f in sorted(glob(f"{tmp_dir}/*.json")): + with open(batch_f, "r") as f_in: + lines = f_in.read() + f_out.write(lines) + + logger.warning(f'Normalized version saved at {output_filename}') + + def split_text_into_sentences(self, text: str, additional_split_symbols: str = "") -> List[str]: + r""" + Split text into sentences. + + Args: + text: text + additional_split_symbols: Symbols to split sentences if eos sentence split resulted in a long sequence. + Use '|' as a separator between symbols, for example: ';|:'. Use '\s' to split by space. + + Returns list of sentences + """ + lower_case_unicode = "" + upper_case_unicode = "" + + if self.lang == "ru": + lower_case_unicode = '\u0430-\u04ff' + upper_case_unicode = '\u0410-\u042f' + + # end of quoted speech - to be able to split sentences by full stop + text = re.sub(r"([\.\?\!])([\"\'])", r"\g<2>\g<1> ", text) + + # remove extra space + text = re.sub(r" +", " ", text) + + # remove space in the middle of the lower case abbreviation to avoid splitting into separate sentences + matches = re.findall(rf"[a-z{lower_case_unicode}]\.\s[a-z{lower_case_unicode}]\.", text) + for match in matches: + text = text.replace(match, match.replace(". ", ".")) + + # Read and split transcript by utterance (roughly, sentences) + split_pattern = rf"(? List[str]: + """ + Creates reorderings of dictionary elements and serializes as strings + + Args: + d: (nested) dictionary of key value pairs + + Return permutations of different string serializations of key value pairs + """ + l = [] + if PRESERVE_ORDER_KEY in d.keys(): + d_permutations = [d.items()] + else: + d_permutations = itertools.permutations(d.items()) + for perm in d_permutations: + subl = [""] + for k, v in perm: + if isinstance(v, str): + subl = ["".join(x) for x in itertools.product(subl, [f"{k}: \"{v}\" "])] + elif isinstance(v, OrderedDict): + rec = self._permute(v) + subl = ["".join(x) for x in itertools.product(subl, [f" {k} {{ "], rec, [f" }} "])] + elif isinstance(v, bool): + subl = ["".join(x) for x in itertools.product(subl, [f"{k}: true "])] + else: + raise ValueError("Key: " + str(k) + " Value: " + str(v)) + l.extend(subl) + return l + + def generate_permutations(self, tokens: List[dict]): + """ + Generates permutations of string serializations of list of dictionaries + + Args: + tokens: list of dictionaries + + Returns string serialization of list of dictionaries + """ + + def _helper(prefix: str, token_list: List[dict], idx: int): + """ + Generates permutations of string serializations of given dictionary + + Args: + token_list: list of dictionaries + prefix: prefix string + idx: index of next dictionary + + Returns string serialization of dictionary + """ + if idx == len(token_list): + yield prefix + return + token_options = self._permute(token_list[idx]) + for token_option in token_options: + yield from _helper(prefix + token_option, token_list, idx + 1) + + return _helper("", tokens, 0) + + def find_tags(self, text: str) -> 'pynini.FstLike': + """ + Given text use tagger Fst to tag text + + Args: + text: sentence + + Returns: tagged lattice + """ + lattice = text @ self.tagger.fst + return lattice + + @staticmethod + def select_tag(lattice: 'pynini.FstLike') -> str: + """ + Given tagged lattice return shortest path + + Args: + lattice: pynini.FstLike tag lattice + + Returns: shortest path + """ + tagged_text = pynini.shortestpath(lattice, nshortest=1, unique=True).string() + return tagged_text + + def find_verbalizer(self, tagged_text: str) -> 'pynini.FstLike': + """ + Given tagged text creates verbalization lattice + This is context-independent. + + Args: + tagged_text: input text + + Returns: verbalized lattice + """ + lattice = tagged_text @ self.verbalizer.fst + return lattice + + @staticmethod + def select_verbalizer(lattice: 'pynini.FstLike') -> str: + """ + Given verbalized lattice return shortest path + + Args: + lattice: verbalization lattice + text: full text line to raise in case of an exception + + Returns: shortest path + """ + output = pynini.shortestpath(lattice, nshortest=1, unique=True).string() + # lattice = output @ self.verbalizer.punct_graph + # output = pynini.shortestpath(lattice, nshortest=1, unique=True).string() + return output + + def post_process(self, normalized_text: 'pynini.FstLike') -> str: + """ + Runs post-processing graph on normalized text + + Args: + normalized_text: normalized text + + Returns: shortest path + """ + normalized_text = normalized_text.strip() + if not normalized_text: + return normalized_text + normalized_text = pynini.escape(normalized_text) + + if self.post_processor is not None: + normalized_text = top_rewrite(normalized_text, self.post_processor.fst) + return normalized_text + + +def parse_args(): + parser = ArgumentParser() + input = parser.add_mutually_exclusive_group() + input.add_argument("--text", dest="input_string", help="input string", type=str) + input.add_argument( + "--input_file", + dest="input_file", + help="input file path. " + "The input file can be either a .txt file containing one example for normalization per line or " + "a .json manifest file. Field to normalize in .json manifest is specified with `--manifest_text_field` arg.", + type=str, + ) + parser.add_argument( + '--manifest_text_field', + help="The field in a .json manifest to normalize (applicable only when input_file is a .json manifest)", + type=str, + default="text", + ) + parser.add_argument( + "--output_field", + help="Name of the field in a .json manifest in which to save normalized text (applicable only when input_file is a .json manifest)", + type=str, + default="normalized", + ) + parser.add_argument('--output_file', dest="output_file", help="Output file path", type=str) + parser.add_argument( + "--language", + help="language", + choices=["en", "de", "es", "fr", "hu", "sv", "zh", "ar", "it", "hy", "ja", "hi", "ko", "vi", "pt"], + default="en", + type=str, + ) + parser.add_argument( + "--input_case", + help="Input text capitalization, set to 'cased' if text contains capital letters." + "This argument affects normalization rules applied to the text. Note, `lower_cased` won't lower case input.", + choices=["lower_cased", "cased"], + default="cased", + type=str, + ) + parser.add_argument("--verbose", help="print info for debugging", action='store_true') + parser.add_argument( + "--no_post_process", + help="WFST-based post processing, e.g. to remove extra spaces added during TN, normalize punctuation marks [could differ from the input]. Only Eng is supported, not supported in Sparrowhawk", + action="store_true", + ) + parser.add_argument( + "--punct_post_process", + help="Add this flag to enable punctuation post processing to match input.", + action="store_true", + ) + parser.add_argument( + "--punct_pre_process", + help="Add this flag to add spaces around square brackets, otherwise text between square brackets won't be normalized", + action="store_true", + ) + parser.add_argument("--overwrite_cache", help="Add this flag to re-create .far grammar files", action="store_true") + parser.add_argument( + "--whitelist", + help="Path to a file with with whitelist replacement," + "e.g., for English, whitelist files are stored under text_normalization/en/data/whitelist", + default=None, + type=str, + ) + parser.add_argument( + "--cache_dir", + help="path to a dir with .far grammar file. Set to None to avoid using cache", + default=None, + type=str, + ) + parser.add_argument("--n_jobs", default=-2, type=int, help="The maximum number of concurrently running jobs") + parser.add_argument("--batch_size", default=200, type=int, help="Number of examples for each process") + parser.add_argument( + "--max_number_of_permutations_per_split", + default=729, + type=int, + help="a maximum number of permutations which can be generated from input sequence of tokens.", + ) + return parser.parse_args() + + +if __name__ == "__main__": + args = parse_args() + whitelist = os.path.abspath(args.whitelist) if args.whitelist else None + + if not args.input_string and not args.input_file: + raise ValueError("Either `--text` or `--input_file` required") + + normalizer = Normalizer( + input_case=args.input_case, + post_process=not args.no_post_process, + cache_dir=args.cache_dir, + overwrite_cache=args.overwrite_cache, + whitelist=whitelist, + lang=args.language, + max_number_of_permutations_per_split=args.max_number_of_permutations_per_split, + ) + start_time = perf_counter() + if args.input_string: + output = normalizer.normalize( + args.input_string, + verbose=args.verbose, + punct_pre_process=args.punct_pre_process, + punct_post_process=args.punct_post_process, + ) + print("=" * 40) + print(output) + print("=" * 40) + elif args.input_file: + if args.input_file.endswith(".json"): + normalizer.normalize_manifest( + args.input_file, + n_jobs=args.n_jobs, + punct_pre_process=args.punct_pre_process, + punct_post_process=args.punct_post_process, + batch_size=args.batch_size, + text_field=args.manifest_text_field, + output_field=args.output_field, + output_filename=args.output_file, + verbose=args.verbose, + ) + + else: + logger.info("Loading data: " + args.input_file) + data = load_file(args.input_file) + + logger.info("- Data: " + str(len(data)) + " sentences") + normalizer_prediction = normalizer.normalize_list( + data, + verbose=args.verbose, + punct_pre_process=args.punct_pre_process, + punct_post_process=args.punct_post_process, + ) + if args.output_file: + write_file(args.output_file, normalizer_prediction) + logger.info(f"- Normalized. Writing out to {args.output_file}") + else: + logger.info(normalizer_prediction) + + logger.info(f"Execution time: {perf_counter() - start_time:.02f} sec") diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/preprocessing_utils.py b/zonos3/vendor/nemo_text_processing/text_normalization/preprocessing_utils.py new file mode 100644 index 0000000000000000000000000000000000000000..0cd7d04e6371866c0e38925c49cc1191be66de13 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/preprocessing_utils.py @@ -0,0 +1,70 @@ +from typing import List + + +def _split(sentences: List[str], delimiter: str, max_len: int, min_len: int): + """ + Splits sentences based by the specified delimiter. Will attempt to split and combine sentences to get target + min/max length. + + Args: + sentences: Sentences to split into segments. + delimiter: symbol to split by + max_len: the maximum number of symbols in the output sentences (the result will be the closest len match) + min_len: the minimum number of the output sentences (the result will be the closest len match) + """ + result = [] + for sent in sentences: + if len(sent) < max_len: + result.append(sent) + continue + + split_sent = sent.split(delimiter) + # keep the delimiter + split_sent = [(s + delimiter).strip() for s in split_sent[:-1]] + [split_sent[-1]] + + if "," in delimiter: + # split based on comma usually results in too short utterance, combine sentences + # that result in a single word split. It's usually not recommended to do that for other delimiters. + comb = [] + for s in split_sent: + # if the previous sentence is too short, combine it with the current sentence + if len(comb) > 0 and (len(comb[-1].split()) <= min_len or len(s.split()) <= min_len): + comb[-1] = comb[-1] + " " + s + else: + comb.append(s) + result.extend(comb) + else: + result.extend(split_sent) + return result + + +def additional_split(sentences: List[str], split_on_symbols: str, max_len: int = 1000, min_len: int = 2) -> List[str]: + """ + Splits sentences by split_on_symbols. + + Args: + sentences: Sentences to split into segments. + split_on_symbols: Symbols to split sentences if eos sentence split resulted in a long sequence. + Use '|' as a separator between symbols, for example: ';|:| ', will attempt to split each sentence + by semi-colon ";", colon ":", and space " ". + max_len: the maximum number of symbols in the output sentences (the result will be the closest len match) + min_len: the minimum number of the output sentences (the result will be the closest len match) + """ + if len(split_on_symbols) == 0: + return sentences + + split_on_symbols = split_on_symbols.split("|") + + another_sent_split = [] + for sent in sentences: + split_sent = [sent] + for delimiter in split_on_symbols: + if len(delimiter) == 0: + continue + split_sent = _split( + split_sent, delimiter + " " if delimiter != " " else delimiter, max_len=max_len, min_len=min_len + ) + another_sent_split.extend(split_sent) + + sentences = [s.strip() for s in another_sent_split if s.strip()] + return sentences diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/pt/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/pt/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..ffd13e2d6abefaa0bbd5b9395f7fa5fb469ce61e --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/pt/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use it except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9e3fb699d9f6b1df3430f755849be91d63679cdc --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/date/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/date/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9e3fb699d9f6b1df3430f755849be91d63679cdc --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/date/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/date/months.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/date/months.tsv new file mode 100644 index 0000000000000000000000000000000000000000..6713229bd54d3893037a3465874d1dc1a3f265aa --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/date/months.tsv @@ -0,0 +1,21 @@ +1 janeiro +01 janeiro +2 fevereiro +02 fevereiro +3 março +03 março +4 abril +04 abril +5 maio +05 maio +6 junho +06 junho +7 julho +07 julho +8 agosto +08 agosto +9 setembro +09 setembro +10 outubro +11 novembro +12 dezembro diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/date/numeric_separators.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/date/numeric_separators.tsv new file mode 100644 index 0000000000000000000000000000000000000000..ee24567bc538c771135d091a7c335e2fb7103710 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/date/numeric_separators.tsv @@ -0,0 +1,3 @@ +/ +. +- diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/date/verbal_phrases.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/date/verbal_phrases.tsv new file mode 100644 index 0000000000000000000000000000000000000000..d04c0fa503402e93b9f7cdaa46130933cfa6d38f --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/date/verbal_phrases.tsv @@ -0,0 +1 @@ +preposition de diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/electronic/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/electronic/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9e3fb699d9f6b1df3430f755849be91d63679cdc --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/electronic/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/electronic/domain.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/electronic/domain.tsv new file mode 100644 index 0000000000000000000000000000000000000000..b9daa19a5b6fca1118279e4fc229899127725886 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/electronic/domain.tsv @@ -0,0 +1,7 @@ +.com ponto com +.com.br ponto com ponto br +.gov.br ponto gov ponto br +.org ponto org +.net ponto net +.edu ponto edu +.br ponto br diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/electronic/electronic_spoken_unit.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/electronic/electronic_spoken_unit.tsv new file mode 100644 index 0000000000000000000000000000000000000000..698bc277346eeb6c0ec83085e65e5eee41ff6246 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/electronic/electronic_spoken_unit.tsv @@ -0,0 +1,16 @@ +google google +usuario usuario +microsoft microsoft +amazon amazon +facebook facebook +meta meta +netflix netflix +spotify spotify +samsung samsung +apple apple +linkedin linkedin +instagram instagram +whatsapp whatsapp +oracle oracle +adobe adobe +paypal paypal diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/electronic/server_name.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/electronic/server_name.tsv new file mode 100644 index 0000000000000000000000000000000000000000..50b4eeb656e7e04cec72a9fd2dd0920eb2ef531c --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/electronic/server_name.tsv @@ -0,0 +1,6 @@ +gmail +nvidia +outlook +hotmail +yahoo +live diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/electronic/symbols.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/electronic/symbols.tsv new file mode 100644 index 0000000000000000000000000000000000000000..85c8a1b1057a8662dfd7b2cc050a2044a5de21e0 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/electronic/symbols.tsv @@ -0,0 +1,22 @@ +. ponto +- traço +_ underscore +! exclamação +# cerquilha +$ dólar +% por cento +& e comercial +' apóstrofo +* asterisco ++ mais +/ barra += igual +? interrogação +^ acento circunflexo +` crase +{ chave esquerda +| barra vertical +} chave direita +~ til +, vírgula +: dois pontos diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/fractions/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/fractions/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9e3fb699d9f6b1df3430f755849be91d63679cdc --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/fractions/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/fractions/ordinal_exceptions.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/fractions/ordinal_exceptions.tsv new file mode 100644 index 0000000000000000000000000000000000000000..22c9ed16cfa58101b1b1cee97491329b67f04192 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/fractions/ordinal_exceptions.tsv @@ -0,0 +1,2 @@ +segundo meio +terceiro terço diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/fractions/powers_of_ten.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/fractions/powers_of_ten.tsv new file mode 100644 index 0000000000000000000000000000000000000000..b19c443640f1e133b256283b5ffa0233912a05ea --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/fractions/powers_of_ten.tsv @@ -0,0 +1 @@ +mil milésimo diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/fractions/specials.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/fractions/specials.tsv new file mode 100644 index 0000000000000000000000000000000000000000..7efeba5e659225612c1251627faf80ec745df01f --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/fractions/specials.tsv @@ -0,0 +1,5 @@ +connector e +minus menos +plural_suffix s +avos_suffix avos +avos_between diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/measure/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/measure/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9e3fb699d9f6b1df3430f755849be91d63679cdc --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/measure/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/measure/measurements_plural.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/measure/measurements_plural.tsv new file mode 100644 index 0000000000000000000000000000000000000000..d9cbfb87ffa42b452c57f8b04165cf79bbeb7b8d --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/measure/measurements_plural.tsv @@ -0,0 +1,64 @@ +h horas +min minutos +s segundos +ms milissegundos +ns nanossegundos +μs microssegundos +t toneladas +kg quilos +kg quilogramas +g gramas +mg miligramas +μm micrômetros +nm nanômetros +mm milímetros +cm centímetros +cm² centímetros quadrados +cm³ centímetros cúbicos +m metros +m² metros quadrados +m³ metros cúbicos +km quilômetros +km² quilômetros quadrados +ha hectares +kph quilômetros por hora +mph milhas por hora +m/s metros por segundo +l litros +ml mililitros +kgf quilogramas força +% por cento +°F fahrenheit +°F graus fahrenheit +°C graus celsius +Hz hertz +kHz quilo hertz +MHz mega hertz +GHz giga hertz +W watts +kW quilowatts +MW megawatts +GW gigawatts +Wh watts hora +kWh quilowatts hora +MWh megawatts hora +GWh gigawatts hora +kV quilovolts +V volts +mV milivolts +A amperes +mA miliamperes +rpm rotações por minuto +db decibéis +cal calorias +kcal quilocalorias +G gramas +KG quilos +KG quilogramas +KM quilômetros +M metros +L litros +ML mililitros +M2 metros quadrados +M^2 metros quadrados +C graus celsius diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/measure/measurements_singular.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/measure/measurements_singular.tsv new file mode 100644 index 0000000000000000000000000000000000000000..242aba14ef9c943c71eafada2a4795c23d2ef7c8 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/measure/measurements_singular.tsv @@ -0,0 +1,65 @@ +h hora +min minuto +s segundo +ms milissegundo +ns nanossegundo +μs microssegundo +t tonelada +kg quilo +kg quilograma +g grama +mg miligrama +μm micrômetro +nm nanômetro +mm milímetro +cm centímetro +cm² centímetro quadrado +cm³ centímetro cúbico +m metro +m² metro quadrado +m³ metro cúbico +km quilômetro +km² quilômetro quadrado +ha hectare +kph quilômetro por hora +mph milha por hora +m/s metro por segundo +l litro +ml mililitro +kgf quilograma força +% por cento +°F fahrenheit +°C celsius +°F grau fahrenheit +°C grau celsius +Hz hertz +kHz quilo hertz +MHz mega hertz +GHz giga hertz +W watt +kW quilowatt +MW megawatt +GW gigawatt +Wh watt hora +kWh quilowatt hora +MWh megawatt hora +GWh gigawatt hora +kV quilovolt +V volt +mV milivolt +A ampere +mA miliampere +rpm rotação por minuto +db decibel +cal caloria +kcal quilocaloria +G grama +KG quilo +KG quilograma +KM quilômetro +M metro +L litro +ML mililitro +M2 metro quadrado +M^2 metro quadrado +C celsius diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/money/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/money/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9e3fb699d9f6b1df3430f755849be91d63679cdc --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/money/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/money/currency_major.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/money/currency_major.tsv new file mode 100644 index 0000000000000000000000000000000000000000..b23d1bcce2d97fef90002d08caa8a9b4d64616b7 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/money/currency_major.tsv @@ -0,0 +1,5 @@ +US$ dólar americano +R$ real +€ euro +£ libra esterlina +$ dólar diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/money/currency_major_plural.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/money/currency_major_plural.tsv new file mode 100644 index 0000000000000000000000000000000000000000..feca270ff86feeaea6b3b51b64213b11e59a2488 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/money/currency_major_plural.tsv @@ -0,0 +1,5 @@ +dólar americano dólares americanos +real reais +euro euros +libra esterlina libras esterlinas +dólar dólares diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/money/currency_minor.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/money/currency_minor.tsv new file mode 100644 index 0000000000000000000000000000000000000000..4e9a95d660e38795c14d42bfe7b27826fd3ab1ab --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/money/currency_minor.tsv @@ -0,0 +1,5 @@ +US$ centavo +R$ centavo +€ centavo +£ centavo +$ centavo diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/money/currency_minor_plural.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/money/currency_minor_plural.tsv new file mode 100644 index 0000000000000000000000000000000000000000..2ac61dff7b9ad8d6e95565699d210689afc80b42 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/money/currency_minor_plural.tsv @@ -0,0 +1 @@ +centavo centavos diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/numbers/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/numbers/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9e3fb699d9f6b1df3430f755849be91d63679cdc --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/numbers/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/numbers/cardinal_specials.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/numbers/cardinal_specials.tsv new file mode 100644 index 0000000000000000000000000000000000000000..04ea91ee48988240de856e5040eb3723ca4c1f02 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/numbers/cardinal_specials.tsv @@ -0,0 +1,4 @@ +connector e +thousand mil +hundred_100 cem +hundred_1 cento diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/numbers/decimal_fractional_specials.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/numbers/decimal_fractional_specials.tsv new file mode 100644 index 0000000000000000000000000000000000000000..c84a95f5359a8eaff24f9ba7c7351e4757e8d5a6 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/numbers/decimal_fractional_specials.tsv @@ -0,0 +1,3 @@ +001 mil e um +010 mil e dez +100 mil e cem diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/numbers/decimal_specials.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/numbers/decimal_specials.tsv new file mode 100644 index 0000000000000000000000000000000000000000..f6257d9d1458bc9cce5ff4365069a41c288676d4 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/numbers/decimal_specials.tsv @@ -0,0 +1,2 @@ +separator vírgula +minus menos diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/numbers/digit.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/numbers/digit.tsv new file mode 100644 index 0000000000000000000000000000000000000000..1859416c8aa891bfec2a223cec8ce1b71833535a --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/numbers/digit.tsv @@ -0,0 +1,9 @@ +1 um +2 dois +3 três +4 quatro +5 cinco +6 seis +7 sete +8 oito +9 nove diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/numbers/hundreds.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/numbers/hundreds.tsv new file mode 100644 index 0000000000000000000000000000000000000000..620f512b30a74bdbfab6b6b2d5528032c535992c --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/numbers/hundreds.tsv @@ -0,0 +1,8 @@ +2 duzentos +3 trezentos +4 quatrocentos +5 quinhentos +6 seiscentos +7 setecentos +8 oitocentos +9 novecentos diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/numbers/quantity_words.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/numbers/quantity_words.tsv new file mode 100644 index 0000000000000000000000000000000000000000..a94cbd5533e798f094fcc059ed1cf8034a6823f4 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/numbers/quantity_words.tsv @@ -0,0 +1,9 @@ +mil +milhão +milhões +bilhão +bilhões +trilhão +trilhões +quatrilhão +quatrilhões diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/numbers/scales.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/numbers/scales.tsv new file mode 100644 index 0000000000000000000000000000000000000000..a3dffe4e02a17cadca32648cca15da5b772ba210 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/numbers/scales.tsv @@ -0,0 +1,4 @@ +one_label plural_suffix magnitude_zeros +um milhão milhões 0 +um bilhão bilhões 9 +um trilhão trilhões 12 diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/numbers/teens.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/numbers/teens.tsv new file mode 100644 index 0000000000000000000000000000000000000000..50c4e0b8dffcdad174bd096a2be0bf94b38e5917 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/numbers/teens.tsv @@ -0,0 +1,10 @@ +10 dez +11 onze +12 doze +13 treze +14 catorze +15 quinze +16 dezesseis +17 dezessete +18 dezoito +19 dezenove diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/numbers/tens.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/numbers/tens.tsv new file mode 100644 index 0000000000000000000000000000000000000000..43c4a8bc6a6171bb273495444f5de9626fec754d --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/numbers/tens.tsv @@ -0,0 +1,8 @@ +2 vinte +3 trinta +4 quarenta +5 cinquenta +6 sessenta +7 setenta +8 oitenta +9 noventa diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/numbers/zero.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/numbers/zero.tsv new file mode 100644 index 0000000000000000000000000000000000000000..29be0f38bb1b695a302206225694cfdb5980e4c3 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/numbers/zero.tsv @@ -0,0 +1 @@ +0 zero diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/ordinals/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/ordinals/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9e3fb699d9f6b1df3430f755849be91d63679cdc --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/ordinals/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/ordinals/digit.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/ordinals/digit.tsv new file mode 100644 index 0000000000000000000000000000000000000000..5fefbc3b8a485d72ab978226d38c4e58adbf3bcb --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/ordinals/digit.tsv @@ -0,0 +1,10 @@ +primeiro um +segundo dois +terceiro três +quarto quatro +quinto cinco +sexto seis +sétimo sete +oitavo oito +nono nove +décimo dez diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/ordinals/feminine.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/ordinals/feminine.tsv new file mode 100644 index 0000000000000000000000000000000000000000..c75ae5ed053454d25cc51aca449e043586798c14 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/ordinals/feminine.tsv @@ -0,0 +1,11 @@ +primeiro primeira +segundo segunda +terceiro terceira +quarto quarta +quinto quinta +sexto sexta +sétimo sétima +oitavo oitava +nono nona +décimo décima +ésimo ésima diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/ordinals/hundreds.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/ordinals/hundreds.tsv new file mode 100644 index 0000000000000000000000000000000000000000..6d919a86c8f4cbf1225141147c35a0c2c6c1e7ee --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/ordinals/hundreds.tsv @@ -0,0 +1,10 @@ +centésimo cem +centésimo cento +ducentésimo duzentos +trecentésimo trezentos +quadringentésimo quatrocentos +quincentésimo quinhentos +sexcentésimo seiscentos +septingentésimo setecentos +octingentésimo oitocentos +noningentésimo novecentos diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/ordinals/specials.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/ordinals/specials.tsv new file mode 100644 index 0000000000000000000000000000000000000000..bb6933fe65980da5db95883ff9192c75121df8ad --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/ordinals/specials.tsv @@ -0,0 +1,2 @@ +connector_in e +connector_out diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/ordinals/teen.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/ordinals/teen.tsv new file mode 100644 index 0000000000000000000000000000000000000000..1b1e191c9162940a084de3dac378c8995bc91482 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/ordinals/teen.tsv @@ -0,0 +1,9 @@ +décimo primeiro onze +décimo segundo doze +décimo terceiro treze +décimo quarto catorze +décimo quinto quinze +décimo sexto dezesseis +décimo sétimo dezessete +décimo oitavo dezoito +décimo nono dezenove diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/ordinals/ties.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/ordinals/ties.tsv new file mode 100644 index 0000000000000000000000000000000000000000..f40700034097f41f90f4fae52a52aa822991fcc7 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/ordinals/ties.tsv @@ -0,0 +1,8 @@ +vigésimo vinte +trigésimo trinta +quadragésimo quarenta +quinquagésimo cinquenta +sexagésimo sessenta +septuagésimo setenta +octogésimo oitenta +nonagésimo noventa diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/telephone/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/telephone/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9e3fb699d9f6b1df3430f755849be91d63679cdc --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/telephone/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/telephone/ip_prompt.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/telephone/ip_prompt.tsv new file mode 100644 index 0000000000000000000000000000000000000000..7d59e35ebc24fe76607a77e4dc6cc269cb32b052 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/telephone/ip_prompt.tsv @@ -0,0 +1,2 @@ +ip ip +endereço de ip endereço de i p diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/telephone/telephone_prompt.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/telephone/telephone_prompt.tsv new file mode 100644 index 0000000000000000000000000000000000000000..62efeccd5b412d94324e25ded3e938fca79a2f0e --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/telephone/telephone_prompt.tsv @@ -0,0 +1,4 @@ +ligue para +telefone +celular +meu número é diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/time/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/time/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9e3fb699d9f6b1df3430f755849be91d63679cdc --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/time/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/time/day_period_suffix.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/time/day_period_suffix.tsv new file mode 100644 index 0000000000000000000000000000000000000000..a942795f4f24495859696037b42792add0664891 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/time/day_period_suffix.tsv @@ -0,0 +1,4 @@ +manhã da manhã 6 11 +tarde da tarde 12 17 +noite da noite 18 23 +madrugada da madrugada 0 5 diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/whitelist/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/whitelist/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9e3fb699d9f6b1df3430f755849be91d63679cdc --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/whitelist/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/whitelist/ipa_symbols.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/whitelist/ipa_symbols.tsv new file mode 100644 index 0000000000000000000000000000000000000000..f5559c7116309e621659b6b4b1db91d91836abcf --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/whitelist/ipa_symbols.tsv @@ -0,0 +1,521 @@ +a +aoj +aəj +aː +aːʲ +aː͡j +aː͡ɨ̯ +aˤ +aˤː +a̠ +a̠ː +a̰ +a͡e +a͡i +a͡iː +a͡i̯ +a͡j +a͡o +a͡u +a͡uː +a͡u̯ +a͡w +a͡ə +a͡ɨ̯ +a͡ɪ +a͡ʊ +b +bʱ +bʲ +bː +b̥ +c +cʰ +cː +ç +d +dʲ +dː +d̥ +d̪ +d̪ʱ +d͡z +d͡zʷ +d͡zː +d͡ʑ +d͡ʒ +d͡ʒʱ +d͡ʒʲ +d͡ʒː +e +eː +eːʲ +eː͡j +ẽː +ẽ͡j̃ +e̞ +e̞ː +e̯ +e͡i +e͡iː +e͡ɨ̯ +f +fʲ +fː +h +hː +i +iəj +iəw +iʲ +iː +iːʲ +ĩː +i̥ +i̯ +i͡u +i͡ə +i͡ɛ +j +jː +j̃ +k +kʰ +kʰː +kʲ +kʲʼ +kʷ +kʷʼ +kʼ +kː +k̚ +k̚ʲ +k̟̚ +k͈ +k͡p̚ +l +lʲ +lː +l̥ +l̩ +m +mʲ +mʲː +mː +m̥ +m̩ +n +nʲ +nː +n̥ +n̩ +o +oʲ +oː +oːʲ +ò +õ͡j̃ +õ͡w̃ +o̝ +o̞ +o̞ː +o̯ +o̰ +o͡u +o͡uː +p +pʰ +pʰː +pʲ +pʷʼ +pʼ +pː +p̚ +p̚ʲ +p͈ +p͜f +p͡f +q +qʷ +qʼ +r +rʲ +rː +r̂ +r̂ː +r̥ +r̩ +s +sʰ +sʲ +sʼ +sː +s͈ +t +tʰ +tʰː +tʲ +tʷʼ +tʼ +tː +t̚ +t̪ +t̪ʰ +t͈ +t͜s +t͡s +t͡sʰ +t͡sʰː +t͡sʲ +t͡sʷ +t͡sʼ +t͡sː +t͡ɕ +t͡ɕʰ +t͡ɕ͈ +t͡ʂ +t͡ʂʼ +t͡ʃ +t͡ʃʰ +t͡ʃʰː +t͡ʃʲ +t͡ʃʷ +t͡ʃʼ +t͡ʃː +u +uəj +uʲ +uː +uːʲ +ũː +ũ͡j̃ +u̯ +u͡e +u͡i +u͡j +u͡ɔ +u͡ə +v +vʲ +vː +w +w̃ +x +xʷ +xː +y +yː +yːʲ +y̯ +z +zʲ +zː +z̥ +à +àː +á +áː +â +âː +ã +ã̠ +æ +æː +æ̀ +æ̀ː +æ̂ +æ̂ː +æ͡ɪ +æ͡ʉ +ç +è +èː +é +éː +ê +êː +ì +ìː +í +íː +î +îː +ï +ð +ò +òː +ó +óː +ô +ôː +õ +õː +õ̞ +ø +øː +øːʲ +ø̯ +ù +ùː +ú +úː +û +ûː +ā +āː +ē +ēː +ĕ +ĕ͡ə +ě +ěː +ħ +ĩ +ĩː +ī +īː +ŋ +ŋʲ +ŋ̊ +ŋ̍ +ŋ̟ +ŋ̩ +ŋ͡m +ō +ŏ +ŏ͡ə +œ +œː +œ̃ +œ͡i +œ͡iː +œ͡ʏ +ř +řː +ũ +ũː +ū +ūː +ŭ +ŭ͡ə +ǎ +ǎː +ǐ +ǐː +ǒ +ǒː +ǔ +ǔː +ǣ +ǣː +ɐ +ɐː +ɐ̃ +ɐ̃͡j̃ +ɐ̃͡w̃ +ɐ̯ +ɐ̯̯ +ɑ +ɑː +ɑ̃ +ɑ̃ː +ɒ +ɒʲ +ɒː +ɓ +ɔ +ɔː +ɔˤː +ɔ̀ +ɔ̀ː +ɔ́ +ɔ́ː +ɔ̃ +ɔ̃ː +ɔ̰ +ɔ͡i̯ +ɔ͡ə +ɔ͡ɨ̯ +ɔ͡ɪ +ɔ͡ʊ +ɕ +ɕʰ +ɕː +ɕ͈ +ɖ +ɖʱ +ɗ +ɘ +ɘː +ə +əː +əˤ +ə̀ +ə́ +ə̃ +ə̯ +ə͡u̯ +ə͡w +ə͡ɨ +ə͡ɨ̯ +ɚ +ɛ +ɛʲ +ɛː +ɛˤː +ɛ̀ +ɛ̀ː +ɛ́ +ɛ́ː +ɛ̂ +ɛ̂ː +ɛ̃ +ɛ̃ː +ɛ̄ +ɛ̄ː +ɛ̰ +ɛ͡i +ɛ͡i̯ +ɛ͡u +ɛ͡u̯ +ɛ͡ɪ +ɛ͡ʊ +ɜ +ɜː +ɝ +ɝː +ɟ +ɟː +ɟ͡ʝ +ɡ +ɡʱ +ɡʲ +ɡʷ +ɡː +ɡ̊ +ɣ +ɤ +ɥ +ɦ +ɨ +ɨəj +ɨː +ɨ̃ᵝ +ɨ̞ +ɨ̥ᵝ +ɨ̯ +ɨ͡u̯ +ɨ͡w +ɨ͡ə +ɨᵝ +ɨᵝː +ɪ +ɪː +ɪ̀ +ɪ́ +ɪ̃ +ɪ̯ +ɪ̰ +ɪ͡u̯ +ɪ͡ʊ +ɫ +ɫː +ɬ +ɬʼ +ɭ +ɮ +ɯ +ɯː +ɯ̟̃ᵝ +ɯ̟̊ᵝ +ɯ̟ᵝ +ɯ̟ᵝː +ɰ +ɰ̃ +ɰᵝ +ɱ +ɱ̩ +ɲ +ɲː +ɲ̊ +ɲ̟ +ɳ +ɴ +ɸ +ɸʷ +ɹ +ɻ +ɽ +ɽʱ +ɾ +ɾʲ +ɾː +ɾ̝̊ +ʀ +ʁ +ʁʷ +ʁː +ʂ +ʂʷ +ʃ +ʃʰ +ʃʲ +ʃʷ +ʃʷʼ +ʃʼ +ʃː +ʈ +ʈʰ +ʉ +ʉː +ʊ +ʊ̀ +ʊ́ +ʊ̃ +ʊ̯ +ʊ̯͡i +ʊ̯͡ɨ +ʊ̰ +ʋ +ʌ +ʌ̹ +ʍ +ʎ +ʏ +ʏː +ʏ̯ +ʐ +ʐʷ +ʑ +ʒ +ʒʲ +ʒʷ +ʒː +ʔ +ʔʲ +ʔʷ +ʝ +˦ˀ˥ +˦˥ +˦˧˥ +˦˩ +˧ˀ˨ +˧˦ +˧˧ +˧˨ +˧˩ +˨˩ +˨˩˦ +˨˩˨ +β +θ +χ +χʷ +χː +ḛ +ḭ +ṵ +ẽ +ẽː +ẽ̞ +‿ \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/whitelist/symbol.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/whitelist/symbol.tsv new file mode 100644 index 0000000000000000000000000000000000000000..7f7b525e314a55f3542bb139544dc642e882cb6e --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/whitelist/symbol.tsv @@ -0,0 +1,23 @@ +& e comercial +# cerquilha +@ arroba +§ parágrafo +™ marca comercial +® marca registrada +© direitos autorais +_ sublinhado +% por cento +* asterisco ++ mais +/ barra += igual +^ acento circunflexo +| barra vertical +~ til +$ dólar +£ libra esterlina +€ euro +₩ won +¥ ienes +° grau +º ordinal masculino diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/whitelist/tts.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/pt/data/whitelist/tts.tsv new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/pt/graph_utils.py b/zonos3/vendor/nemo_text_processing/text_normalization/pt/graph_utils.py new file mode 100644 index 0000000000000000000000000000000000000000..a832661b0d80c7d495a85d310b7afbe8feb8a22d --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/pt/graph_utils.py @@ -0,0 +1,193 @@ +# Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use it except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +""" +Portuguese (PT) text normalization graph utilities. + +Self-contained module with no dependency on en.graph_utils. Provides character/digit +symbols (NEMO_*), space helpers (delete_space, insert_space, delete_extra_space), +GraphFst base class, generator_main for FAR export, and PT-specific helpers +(filter_cardinal_punctuation, shift_cardinal_gender_pt). +""" + +import os +import string +from pathlib import Path +from typing import Dict + +import pynini +from pynini import Far +from pynini.export import export +from pynini.lib import byte, pynutil, utf8 + +from zonos3.vendor.nemo_text_processing.utils.logging import logger + +# ---- Character/digit symbols (same semantics as EN) ---- +NEMO_CHAR = utf8.VALID_UTF8_CHAR +NEMO_DIGIT = byte.DIGIT +NEMO_LOWER = pynini.union(*string.ascii_lowercase).optimize() +NEMO_UPPER = pynini.union(*string.ascii_uppercase).optimize() +NEMO_ALPHA = pynini.union(NEMO_LOWER, NEMO_UPPER).optimize() +NEMO_SPACE = " " +NEMO_NON_BREAKING_SPACE = "\u00a0" +NEMO_WHITE_SPACE = pynini.union(" ", "\t", "\n", "\r", "\u00a0").optimize() +NEMO_NOT_QUOTE = pynini.difference(NEMO_CHAR, pynini.accep('"')).optimize() +NEMO_SIGMA = pynini.closure(NEMO_CHAR) +NEMO_NOT_SPACE = pynini.difference(NEMO_CHAR, NEMO_WHITE_SPACE).optimize() + +MIN_NEG_WEIGHT = -0.0001 +INPUT_CASED = "cased" +INPUT_LOWER_CASED = "lower_cased" + +delete_space = pynutil.delete(pynini.closure(NEMO_WHITE_SPACE)) +insert_space = pynutil.insert(" ") +delete_extra_space = pynini.cross(pynini.closure(NEMO_WHITE_SPACE, 1), " ").optimize() + +delete_preserve_order = pynini.closure(pynutil.delete(" preserve_order: true")) + + +def generator_main(file_name: str, graphs: Dict[str, "pynini.FstLike"]) -> None: + """ + Export one or more graphs to an OpenFst Finite State Archive (FAR) file. + + Args: + file_name: path to the output .far file. + graphs: mapping of rule names to FST graphs to export. + """ + exporter = export.Exporter(file_name) + for rule, graph in graphs.items(): + exporter[rule] = graph.optimize() + exporter.close() + logger.info(f"Created {file_name}") + + +class GraphFst: + """ + Base class for all Portuguese text normalization grammar FSTs. + + Args: + name: name of the grammar (e.g. "cardinal", "decimal"). + kind: either "classify" or "verbalize". + deterministic: if True will provide a single transduction option, + for False multiple options (used for audio-based normalization). + """ + + def __init__(self, name: str, kind: str, deterministic: bool = True): + self.name = name + self.kind = kind + self._fst = None + self.deterministic = deterministic + + self.far_path = Path(os.path.dirname(os.path.abspath(__file__)) + "/grammars/" + kind + "/" + name + ".far") + if self.far_exist(): + self._fst = Far(self.far_path, mode="r", arc_type="standard", far_type="default").get_fst() + + def far_exist(self) -> bool: + return self.far_path.exists() + + @property + def fst(self) -> "pynini.FstLike": + return self._fst + + @fst.setter + def fst(self, fst): + self._fst = fst + + def add_tokens(self, fst) -> "pynini.FstLike": + return pynutil.insert(f"{self.name} {{ ") + fst + pynutil.insert(" }") + + def delete_tokens(self, fst) -> "pynini.FstLike": + res = ( + pynutil.delete(f"{self.name}") + + delete_space + + pynutil.delete("{") + + delete_space + + fst + + delete_space + + pynutil.delete("}") + ) + return res @ pynini.cdrewrite(pynini.cross("\u00a0", " "), "", "", NEMO_SIGMA) + + +# ---- PT-specific (Brazilian: 1.000.000 or 1 000 000) ---- +cardinal_separator = pynini.string_map([".", " "]) + + +def filter_cardinal_punctuation(fst: "pynini.FstLike") -> "pynini.FstLike": + """ + Parse digit groups separated by cardinal_separator (e.g. 1.000.000) then apply fst. + + Args: + fst: FST that maps digit string to verbalized cardinal. + + Returns: + Composed FST that accepts digit strings with optional thousand separators. + """ + exactly_three = NEMO_DIGIT**3 + up_to_three = pynini.closure(NEMO_DIGIT, 1, 3) + cardinal_string = pynini.closure(NEMO_DIGIT, 1) + cardinal_string |= ( + up_to_three + + pynutil.delete(cardinal_separator) + + pynini.closure(exactly_three + pynutil.delete(cardinal_separator)) + + exactly_three + ) + return cardinal_string @ fst + + +def shift_cardinal_gender_pt(fst: "pynini.FstLike") -> "pynini.FstLike": + """ + Apply Portuguese masculine-to-feminine conversion for cardinal strings, e.g. + "um" -> "uma", "dois" -> "duas", "duzentos" -> "duzentas". + + Args: + fst: FST producing masculine cardinal verbalization. + + Returns: + FST that produces feminine form when composed with the same input. + """ + fem_ones = pynini.cdrewrite( + pynini.cross("um", "uma"), + "", + pynini.union(NEMO_SPACE, pynini.accep("[EOS]"), pynini.accep('"')), + NEMO_SIGMA, + ) + fem_twos = pynini.cdrewrite( + pynini.cross("dois", "duas"), + "", + pynini.union(NEMO_SPACE, pynini.accep("[EOS]"), pynini.accep('"')), + NEMO_SIGMA, + ) + fem_hundreds = pynini.cdrewrite( + pynini.cross("entos", "entas"), + pynini.union("duz", "trez", "quatroc", "quinh", "seisc", "setec", "oitoc", "novec"), + pynini.union(NEMO_SPACE, pynini.accep("[EOS]"), pynini.accep('"')), + NEMO_SIGMA, + ) + return fst @ fem_ones @ fem_twos @ fem_hundreds + + +def convert_space(fst) -> "pynini.FstLike": + """ + Converts space to nonbreaking space. + Used only in tagger grammars for transducing token values within quotes, e.g. name: "hello kitty" + This is making transducer significantly slower, so only use when there could be potential spaces within quotes, otherwise leave it. + + Args: + fst: input fst + + Returns output fst where breaking spaces are converted to non breaking spaces + """ + return fst @ pynini.cdrewrite(pynini.cross(NEMO_SPACE, NEMO_NON_BREAKING_SPACE), "", "", NEMO_SIGMA) diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/pt/taggers/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/pt/taggers/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9e3fb699d9f6b1df3430f755849be91d63679cdc --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/pt/taggers/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/pt/taggers/cardinal.py b/zonos3/vendor/nemo_text_processing/text_normalization/pt/taggers/cardinal.py new file mode 100644 index 0000000000000000000000000000000000000000..33f92b68c83b6f87f83c06223a5bdc0ae3a1d395 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/pt/taggers/cardinal.py @@ -0,0 +1,303 @@ +# Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from functools import reduce + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.pt.graph_utils import ( + NEMO_ALPHA, + NEMO_DIGIT, + NEMO_SIGMA, + NEMO_SPACE, + NEMO_WHITE_SPACE, + GraphFst, + delete_space, + filter_cardinal_punctuation, + insert_space, +) +from zonos3.vendor.nemo_text_processing.text_normalization.pt.utils import get_abs_path, load_labels + + +class CardinalFst(GraphFst): + """ + Finite state transducer for classifying Portuguese cardinals, e.g. + "1000" -> cardinal { integer: "mil" } + "2.000.000" -> cardinal { integer: "dois milhões" } + "-5" -> cardinal { negative: "true" integer: "cinco" } + + Args: + deterministic: if True will provide a single transduction option, + for False multiple options (used for audio-based normalization) + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="cardinal", kind="classify", deterministic=deterministic) + + specials = { + row[0]: row[1] for row in load_labels(get_abs_path("data/numbers/cardinal_specials.tsv")) if len(row) >= 2 + } + connector_e = insert_space + pynutil.insert(specials["connector"]) + insert_space + thousand = specials["thousand"] + hundred_100 = specials["hundred_100"] + hundred_1 = specials["hundred_1"] + + scale_rows = load_labels(get_abs_path("data/numbers/scales.tsv")) + scales = [(row[0], row[1], int(row[2])) for row in scale_rows if len(row) >= 3 and row[2].strip().isdigit()] + + _num = lambda p: pynini.string_file(get_abs_path(f"data/numbers/{p}")) + zero, digit, teens, tens, hundreds = ( + _num("zero.tsv"), + _num("digit.tsv"), + _num("teens.tsv"), + _num("tens.tsv"), + _num("hundreds.tsv"), + ) + digits_no_one = (NEMO_DIGIT - "1") @ digit + + graph_tens = teens | (tens + (pynutil.delete("0") | (connector_e + digit))) + self.tens = graph_tens.optimize() + self.two_digit_non_zero = pynini.union(digit, graph_tens, (pynini.cross("0", NEMO_SPACE) + digit)).optimize() + + # After "X00" hundreds (oitocentos, …), suffix "01"-"09" needs leading zero stripped + # (graph_tens has no path for "09"; connector+digit only consumes one digit). + graph_hundreds = hundreds + pynini.union( + pynutil.delete("00"), + (connector_e + graph_tens), + (connector_e + pynutil.delete("0") + digit), + (connector_e + digit), + ) + # "100" -> cem only (cross("1", cento)+delete("00") would also match "100" but + # yields "cento"; OpenFst vs pynini top_rewrite can disagree on ties — Sparrowhawk). + graph_hundreds |= pynini.cross("100", hundred_100) + graph_hundreds |= pynini.cross("1", hundred_1) + pynini.union( + (connector_e + graph_tens), + (connector_e + pynutil.delete("0") + digit), + ) + self.hundreds = graph_hundreds.optimize() + + h_comp_base = pynini.union(graph_hundreds, pynutil.delete("0") + graph_tens) + h_comp = h_comp_base | (pynutil.delete("00") + digit) + h_comp_no_one = h_comp_base | (pynutil.delete("00") + digits_no_one) + + pure_tens_input = pynini.union(*[pynini.accep(str(d * 10)) for d in range(1, 10)]) + graph_pure_tens_only = pure_tens_input @ graph_tens + graph_compound_tens = (pynini.closure(NEMO_DIGIT, 2, 2) - pure_tens_input) @ graph_tens + + graph_pure_components = pynini.union( + pynutil.delete("0") + graph_pure_tens_only, + pynutil.delete("00") + digit, + hundreds + pynutil.delete("00"), + pynini.cross("100", hundred_100), + ) + graph_compound_hundreds = pynini.union( + pynini.cross("1", hundred_1) + + pynini.union( + (connector_e + graph_tens), + (connector_e + pynutil.delete("0") + digit), + ), + hundreds + + pynini.union( + (connector_e + graph_tens), + (connector_e + pynutil.delete("0") + digit), + (connector_e + digit), + ), + ) + + suffix_after_mil = pynini.union( + pynutil.delete("000"), + (connector_e + graph_pure_components), + (insert_space + graph_compound_hundreds), + # Use connector_e so "2024" -> dois mil e vinte e quatro (not dois mil vinte e quatro). + (connector_e + pynutil.delete("0") + graph_compound_tens), + ) + + t_comp = pynini.union( + pynutil.delete("000") + h_comp, + h_comp_no_one + insert_space + pynutil.insert(thousand) + suffix_after_mil, + pynini.cross("001", thousand) + suffix_after_mil, + ) + t_comp_no_one = pynini.union( + pynutil.delete("000") + h_comp_no_one, + h_comp_no_one + + insert_space + + pynutil.insert(thousand) + + ((insert_space + h_comp) | pynutil.delete("000")), + pynini.cross("001", thousand) + ((insert_space + h_comp) | pynutil.delete("000")), + ) + + graph_large_scales = pynini.accep("") + for one_label, plural_suffix, _ in reversed(scales): + g = pynutil.add_weight(pynini.cross("000001", one_label), -0.001) + g |= t_comp_no_one + pynutil.insert(plural_suffix) + g |= pynutil.delete("000000") + g += insert_space + graph_large_scales += g + + # 9/12-digit: scale block + trailing (million+thousands, billion+9digits) + scale_3_mil = self._scale_block_3(scales[0][0], scales[0][1], h_comp_no_one) + scale_3_bi = self._scale_block_3(scales[1][0], scales[1][1], h_comp_no_one) + graph_9 = self._build_scale_trailing_graph(scale_3_mil, t_comp, 6, 9) + graph_12 = self._build_scale_trailing_graph(scale_3_bi, graph_9, 9, 12) + pure_9, pure_12 = self._pure_inputs(9), self._pure_inputs(12) + trail_9 = (pure_9 @ graph_9, (NEMO_DIGIT**9 - pure_9) @ graph_9) + trail_12 = (pure_12 @ graph_12, (NEMO_DIGIT**12 - pure_12) @ graph_12) + + # Units 6 (u6): pure get "e" after scale; compound no "e" + u6_one = pynini.cross("000001", "1") @ digit + u6_pure = pynini.union( + u6_one, + pynini.cross("001000", thousand), + pynini.cross("000010", "10") @ graph_tens, + pynini.cross("000100", hundred_100), + (pynini.cross("010000", "10") @ graph_tens) + insert_space + pynutil.insert(thousand), + pynini.cross("100000", hundred_100) + insert_space + pynutil.insert(thousand), + ) + u6_compound = (NEMO_DIGIT**6 - self._pure_inputs(6)) @ t_comp + u6 = u6_pure | u6_compound + z18 = pynini.accep("0" * 18) # 18 zeros: branch no "e" + smaller_e = (connector_e + u6_pure) | u6_compound | pynutil.delete("0" * 6) + smaller = u6 | pynutil.delete("0" * 6) + graph_24 = (((NEMO_DIGIT**18 - z18) + NEMO_DIGIT**6) @ (graph_large_scales + smaller_e)) | ( + (z18 + NEMO_DIGIT**6) @ (pynutil.delete(z18) + smaller) + ) + + trail_by_z = {9: trail_9, 12: trail_12} + magnitude_patterns = [ + self._build_magnitude_pattern( + one_label, + plural_suffix, + magnitude_zeros, + trail_by_z.get(magnitude_zeros), + connector_e, + insert_space, + digit, + graph_tens, + graph_hundreds, + ) + for one_label, plural_suffix, magnitude_zeros in scales + if magnitude_zeros > 0 + ] + + pad = (NEMO_DIGIT - "0") + pynini.closure(NEMO_DIGIT, 0) + pad = pad @ pynini.cdrewrite(pynini.closure(pynutil.insert("0")), "[BOS]", "", NEMO_SIGMA) @ NEMO_DIGIT**24 + norm = pynini.cdrewrite(delete_space, "[BOS]", "", NEMO_SIGMA) @ pynini.cdrewrite( + delete_space, "", "[EOS]", NEMO_SIGMA + ) + norm = norm @ pynini.cdrewrite( + pynini.cross(pynini.closure(NEMO_WHITE_SPACE, 2), NEMO_SPACE), NEMO_ALPHA, NEMO_ALPHA, NEMO_SIGMA + ) + self.graph = reduce(lambda a, b: a | b, magnitude_patterns, pad @ graph_24 @ norm) | zero + self.graph = filter_cardinal_punctuation(self.graph).optimize() + + optional_minus_graph = pynini.closure(pynutil.insert("negative: ") + pynini.cross("-", "\"true\" "), 0, 1) + final_graph = optional_minus_graph + pynutil.insert("integer: \"") + self.graph + pynutil.insert("\"") + final_graph = self.add_tokens(final_graph) + self.fst = final_graph.optimize() + + def _scale_block_3(self, one_label, plural_suffix, component_no_one): + """001->one_label, 000->'', else component+plural.""" + return pynini.union( + pynini.cross("001", one_label), + pynini.cross("000", ""), + (NEMO_DIGIT**3 - pynini.accep("001") - pynini.accep("000")) + @ (component_no_one + insert_space + pynutil.insert(plural_suffix)), + ) + + def _build_scale_trailing_graph(self, scale_3, sub_graph, trailing_len, total_len): + """total_len digits = scale_3 + trailing; no trailing space when trailing all zeros.""" + zt, ztotal = "0" * trailing_len, "0" * total_len + scale_nonzero = NEMO_DIGIT**3 - pynini.accep("000") + branches = [ + (pynini.accep("000") + NEMO_DIGIT**trailing_len) @ (pynutil.delete("000") + sub_graph), + (scale_nonzero + (NEMO_DIGIT**trailing_len - pynini.accep(zt))) @ (scale_3 + insert_space + sub_graph), + (scale_nonzero + pynini.accep(zt)) @ (scale_3 + pynutil.delete(zt)), + (pynini.accep("000") + pynini.accep(zt)) @ pynutil.delete(ztotal), + ] + return pynini.union(*branches) + + @staticmethod + def _pure_inputs(num_digits): + """Inputs 1, 10, 100, ... as num_digits-digit strings.""" + return pynini.union(*[pynini.accep(str(10**k).zfill(num_digits)) for k in range(0, num_digits)]) + + def _magnitude_graph( + self, + one_word, + plural_suffix, + zero_count, + graph_digit, + graph_tens, + graph_hundreds, + connector_e, + insert_space, + trailing_pair=None, + ): + """Round (1–3 digit + scale + zeros); optional trailing (e + pure | space + compound).""" + zeros = "0" * zero_count + round_pats = [] + trail_pats = [] if trailing_pair else None + for L in (1, 2, 3): + total = zero_count + L + if L == 1: + lead = pynini.cross("1", one_word) | ((NEMO_DIGIT - "1") @ graph_digit + pynutil.insert(plural_suffix)) + else: + lead = pynini.closure(NEMO_DIGIT, L, L) @ (graph_tens if L == 2 else graph_hundreds) + pynutil.insert( + plural_suffix + ) + lead_fst = NEMO_DIGIT**L @ lead + round_pats.append(pynini.closure(NEMO_DIGIT, total, total) @ (lead_fst + pynutil.delete(zeros))) + if trailing_pair: + pure, compound = trailing_pair + trail_part = NEMO_DIGIT**zero_count @ (connector_e + pure) | NEMO_DIGIT**zero_count @ ( + insert_space + compound + ) + trail_pats.append(pynini.closure(NEMO_DIGIT, total, total) @ (lead_fst + trail_part)) + graph_round = pynini.union(*round_pats) + graph_trail = pynini.union(*trail_pats) if trail_pats else None + return graph_round, graph_trail + + def _build_magnitude_pattern( + self, + one_label, + plural_suffix, + magnitude_zeros, + trailing_pair, + connector_e, + insert_space, + graph_digit, + graph_tens, + graph_hundreds, + ): + """Restrict length; round + optional non-zero trailing.""" + restrict = (NEMO_DIGIT - "0") + pynini.closure(NEMO_DIGIT, magnitude_zeros, magnitude_zeros + 2) + graph_round, graph_trail = self._magnitude_graph( + one_label, + plural_suffix, + magnitude_zeros, + graph_digit, + graph_tens, + graph_hundreds, + connector_e, + insert_space, + trailing_pair, + ) + if graph_trail is None: + return pynutil.add_weight(restrict @ graph_round, -1.0) + non_zero_trail = pynini.union( + *[NEMO_DIGIT**n + (NEMO_DIGIT**magnitude_zeros - pynini.accep("0" * magnitude_zeros)) for n in (1, 2, 3)] + ) + return pynutil.add_weight(restrict @ (graph_round | (non_zero_trail @ graph_trail)), -1.0) diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/pt/taggers/date.py b/zonos3/vendor/nemo_text_processing/text_normalization/pt/taggers/date.py new file mode 100644 index 0000000000000000000000000000000000000000..8e6a11db2391ecd67779704c5f86f770b6da2629 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/pt/taggers/date.py @@ -0,0 +1,151 @@ +# Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.pt.graph_utils import ( + NEMO_DIGIT, + NEMO_SIGMA, + GraphFst, + delete_space, + insert_space, +) +from zonos3.vendor.nemo_text_processing.text_normalization.pt.utils import get_abs_path, load_labels + + +class DateFst(GraphFst): + """ + Finite state transducer for classifying Portuguese (Brazilian) dates, e.g. + 15/03/2024 -> date { day: "quinze" month: "março" year: "dois mil e vinte e quatro" preserve_order: true } + 15 de março de 2024 -> date { day: "quinze" month: "março" year: "dois mil e vinte e quatro" preserve_order: true } + 2024-03-15 -> date { day: "quinze" month: "março" year: "dois mil e vinte e quatro" preserve_order: true } + 03/15/2024 -> date { day: "quinze" month: "março" year: "dois mil e vinte e quatro" preserve_order: true } + """ + + def __init__(self, cardinal: GraphFst, deterministic: bool = True): + super().__init__(name="date", kind="classify", deterministic=deterministic) + numbers = cardinal.graph + + month_rows = load_labels(get_abs_path("data/date/months.tsv")) + month_pairs = [(r[0], r[1]) for r in month_rows if len(r) >= 2] + month_to_word = pynini.string_map(month_pairs).optimize() + + day_10_31 = ((NEMO_DIGIT - "0") + NEMO_DIGIT) @ pynini.union(*[str(x) for x in range(10, 32)]) @ numbers + day_02_09 = pynutil.delete("0") + (pynini.union(*[str(x) for x in range(2, 10)]) @ numbers) + day_2_9 = pynini.union(*[str(x) for x in range(2, 10)]) @ numbers + day_inner = pynini.union( + pynini.cross("01", "primeiro"), + day_10_31, + day_02_09, + day_2_9, + pynini.cross("1", "primeiro"), + ).optimize() + day_part = pynutil.insert('day: "') + day_inner + pynutil.insert('"') + + month_digits = ( + pynini.union("10", "11", "12") + | pynutil.delete("0") + pynini.union(*[str(x) for x in range(1, 10)]) + | pynini.union(*[str(x) for x in range(1, 10)]) + ) + month_num = month_digits @ month_to_word + month_part = pynutil.insert('month: "') + month_num + pynutil.insert('"') + + year_num = ((NEMO_DIGIT - "0") + NEMO_DIGIT**3) @ numbers + year_part = pynutil.insert('year: "') + year_num + pynutil.insert('"') + + preserve = pynutil.insert(" preserve_order: true") + + delete_de = delete_space + pynutil.delete("de") + delete_space + month_names = sorted({r[1] for r in month_rows if len(r) >= 2}, key=len, reverse=True) + text_pairs = [] + for name in month_names: + text_pairs.append((name, name)) + if name and name[0].islower(): + text_pairs.append((name[0].upper() + name[1:], name)) + month_written = pynutil.insert('month: "') + pynini.string_map(text_pairs).optimize() + pynutil.insert('"') + graph_text = day_part + delete_de + month_written + delete_de + year_part + preserve + + sep_path = get_abs_path("data/date/numeric_separators.tsv") + separators = [r[0].strip() for r in load_labels(sep_path) if r and r[0].strip()] + + one_or_two_digits = pynini.closure(NEMO_DIGIT, 1, 2) + year_four = (NEMO_DIGIT - "0") + NEMO_DIGIT**3 + _mdy_weight = 0.05 + + months_spoken = sorted({r[1] for r in month_rows if len(r) >= 2}) + day_spokens = set() + for n in range(1, 32): + for key in (str(n), f"{n:02d}"): + dstr = pynini.shortestpath(pynini.compose(pynini.accep(key), day_inner.optimize())).string() + day_spokens.add(dstr) + + _preserve_tail = " preserve_order: true" + + ymd_to_dmy_graph = None + mdy_to_dmy_graph = None + for month in months_spoken: + for day in day_spokens: + # After year: + sigma (year value + quotes), delete month/day and trailing preserve + # so the input is fully consumed (mdy_to_dmy does not need this: sigma eats the tail). + ymd_curr = ( + pynutil.insert('day: "' + day + '" month: "' + month + '" ') + + pynini.accep("year:") + + NEMO_SIGMA + + pynutil.delete(' month: "' + month + '" day: "' + day + '"' + _preserve_tail) + ) + ymd_to_dmy_graph = ymd_curr if ymd_to_dmy_graph is None else pynini.union(ymd_to_dmy_graph, ymd_curr) + + mdy_curr = ( + pynutil.insert('day: "' + day + '" month: "' + month + '" ') + + pynutil.delete('month: "' + month + '" day: "' + day + '" ') + + pynini.accep("year:") + + NEMO_SIGMA + ) + mdy_to_dmy_graph = mdy_curr if mdy_to_dmy_graph is None else pynini.union(mdy_to_dmy_graph, mdy_curr) + + ymd_to_dmy_graph = ymd_to_dmy_graph.optimize() + mdy_to_dmy_graph = mdy_to_dmy_graph.optimize() + + patterns = [graph_text] + for sep in separators: + sep_accep = pynini.accep(pynini.escape(sep)) + del_sep = pynutil.delete(sep_accep) + + dmy_core = day_part + del_sep + insert_space + month_part + del_sep + insert_space + year_part + preserve + iso_core = year_part + del_sep + insert_space + month_part + del_sep + insert_space + day_part + preserve + mdy_core = month_part + del_sep + insert_space + day_part + del_sep + insert_space + year_part + preserve + + lhs_dmy = one_or_two_digits + sep_accep + one_or_two_digits + sep_accep + year_four + lhs_iso = year_four + sep_accep + one_or_two_digits + sep_accep + one_or_two_digits + lhs_mdy = one_or_two_digits + sep_accep + one_or_two_digits + sep_accep + year_four + + patterns.append(pynini.compose(lhs_dmy, dmy_core)) + patterns.append( + pynutil.add_weight( + pynini.compose( + pynini.compose(lhs_mdy, mdy_core), + mdy_to_dmy_graph, + ), + _mdy_weight, + ) + ) + patterns.append( + pynini.compose( + pynini.compose(lhs_iso, iso_core), + ymd_to_dmy_graph, + ) + ) + + self.fst = self.add_tokens(pynini.union(*patterns).optimize()).optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/pt/taggers/decimal.py b/zonos3/vendor/nemo_text_processing/text_normalization/pt/taggers/decimal.py new file mode 100644 index 0000000000000000000000000000000000000000..b6017d9eafed922efa25da5272b551b098e29e3b --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/pt/taggers/decimal.py @@ -0,0 +1,91 @@ +# Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.pt.graph_utils import NEMO_DIGIT, GraphFst, delete_space, insert_space +from zonos3.vendor.nemo_text_processing.text_normalization.pt.utils import get_abs_path + + +class DecimalFst(GraphFst): + """ + Finite state transducer for classifying Portuguese decimal numbers, e.g. + "1,26" -> decimal { integer_part: "um" fractional_part: "dois seis" } + "0,01" -> decimal { integer_part: "zero" fractional_part: "zero um" } + "-1,26" -> decimal { negative: "true" ... } + "1,33 milhões" / "1 milhão" -> decimal { ... quantity: "milhões" / "milhão" } + + The fractional mantissa (after the comma) is always read digit-by-digit (0–9), + including leading zeros. Integer part and quantities still use cardinals. + + Args: + cardinal: CardinalFst instance for integer verbalization in tags. + deterministic: if True will provide a single transduction option, + for False multiple options (used for audio-based normalization) + """ + + def __init__(self, cardinal: GraphFst, deterministic: bool = True): + super().__init__(name="decimal", kind="classify", deterministic=deterministic) + cardinal_graph = cardinal.graph + _num = lambda name: pynini.string_file(get_abs_path(f"data/numbers/{name}")).optimize() + + comma = pynutil.delete(",") + quantity_words = _num("quantity_words.tsv") + digit = _num("digit.tsv") + zero = _num("zero.tsv") + graph_digit_or_zero = pynini.union(digit, zero) + digit_by_digit = (graph_digit_or_zero + pynini.closure(insert_space + graph_digit_or_zero)).optimize() + + fractional_digits = pynini.closure(NEMO_DIGIT, 1, 15) + graph_fractional = ( + pynutil.insert('fractional_part: "') + (fractional_digits @ digit_by_digit) + pynutil.insert('"') + ) + + non_zero_lead = pynini.difference(NEMO_DIGIT, pynini.accep("0")) + + graph_integer_zero = ( + pynutil.insert('integer_part: "') + pynini.cross("0", "zero") + pynutil.insert('"') + insert_space + ) + decimal_when_zero = graph_integer_zero + comma + insert_space + graph_fractional + + graph_integer_pos = ( + pynutil.insert('integer_part: "') + + (non_zero_lead + pynini.closure(NEMO_DIGIT, 0, 11)) @ cardinal_graph + + pynutil.insert('"') + + insert_space + ) + decimal_when_pos = graph_integer_pos + comma + insert_space + graph_fractional + + decimal_core = pynini.union(decimal_when_zero, decimal_when_pos) + integer_quantity = ( + pynutil.insert('integer_part: "') + + (pynini.closure(NEMO_DIGIT, 1, 12) @ cardinal_graph) + + pynutil.insert('"') + + insert_space + + delete_space + + pynutil.insert('quantity: "') + + quantity_words + + pynutil.insert('"') + ) + decimal_quantity = ( + decimal_core + delete_space + pynutil.insert('quantity: "') + quantity_words + pynutil.insert('"') + ) + final_graph_wo_sign = pynini.union(decimal_core, integer_quantity, decimal_quantity) + self.final_graph_wo_negative = final_graph_wo_sign.optimize() + optional_minus = pynini.closure(pynutil.insert("negative: ") + pynini.cross("-", '"true" '), 0, 1) + final_graph = optional_minus + final_graph_wo_sign + + self.fst = self.add_tokens(final_graph).optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/pt/taggers/electronic.py b/zonos3/vendor/nemo_text_processing/text_normalization/pt/taggers/electronic.py new file mode 100644 index 0000000000000000000000000000000000000000..ebd6fe053af3d800e66f594553dc2957ff1f2357 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/pt/taggers/electronic.py @@ -0,0 +1,82 @@ +# Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.pt.graph_utils import NEMO_ALPHA, NEMO_DIGIT, NEMO_SPACE, GraphFst +from zonos3.vendor.nemo_text_processing.text_normalization.pt.utils import get_abs_path, load_labels + + +class ElectronicFst(GraphFst): + """ + Finite state transducer for classifying electronic strings in pt-BR: + abc@hotmail.com -> electronic { username: "abc" domain: "hotmail.com" preserve_order: true } + https://www.abc.com -> electronic { protocol: "https://www." domain: "abc.com" preserve_order: true } + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="electronic", kind="classify", deterministic=deterministic) + + full_stop = pynini.accep(".") + at_symbol = "@" + protocol_string = "protocol" + domain_string = "domain" + username_string = "username" + http = "http" + https = "https" + www = "www" + + symbols = [x[0] for x in load_labels(get_abs_path("data/electronic/symbols.tsv"))] + symbols = pynini.union(*symbols) + symbols_no_full_stop = pynini.difference(symbols, full_stop) + accepted_characters = pynini.closure((NEMO_ALPHA | NEMO_DIGIT | symbols_no_full_stop), 1) + all_characters = pynini.closure((NEMO_ALPHA | NEMO_DIGIT | symbols), 1) + + domain_component = full_stop + accepted_characters + domain_graph = ( + pynutil.insert(domain_string + ': "') + + (accepted_characters + pynini.closure(domain_component, 1)) + + pynutil.insert('"') + ) + + username = ( + pynutil.insert(username_string + ': "') + + all_characters + + pynutil.insert('"') + + pynini.cross(at_symbol, NEMO_SPACE) + ) + email = username + domain_graph + + social_tag = ( + pynini.cross(at_symbol, "") + + pynutil.insert(username_string + ': "') + + (accepted_characters | (accepted_characters + pynini.closure(domain_component, 1))) + + pynutil.insert('"') + ) + + protocol_start = pynini.accep(https + "://") | pynini.accep(http + "://") + protocol_end = pynini.accep(www + ".") + if not deterministic: + protocol_end |= pynini.cross(www + ".", "dáblio dáblio dáblio.") + + protocol = protocol_start | protocol_end | (protocol_start + protocol_end) + protocol = pynutil.insert(protocol_string + ': "') + protocol + pynutil.insert('"') + url = protocol + pynutil.insert(NEMO_SPACE) + domain_graph + + graph = url | domain_graph | email | social_tag + self.graph = graph + + final_graph = self.add_tokens(self.graph + pynutil.insert(" preserve_order: true")) + self.fst = final_graph.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/pt/taggers/fraction.py b/zonos3/vendor/nemo_text_processing/text_normalization/pt/taggers/fraction.py new file mode 100644 index 0000000000000000000000000000000000000000..5a96f2dbb614e2477d38dda26957f5d9d5083699 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/pt/taggers/fraction.py @@ -0,0 +1,117 @@ +# Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.pt.graph_utils import ( + NEMO_DIGIT, + NEMO_SIGMA, + NEMO_WHITE_SPACE, + GraphFst, + insert_space, +) +from zonos3.vendor.nemo_text_processing.text_normalization.pt.utils import get_abs_path, load_labels + + +class FractionFst(GraphFst): + """ + Finite state transducer for classifying Portuguese fraction numbers, e.g. + "1/2" -> fraction { numerator: "um" denominator: "meio" morphosyntactic_features: "ordinal" } + "2 3/4" -> fraction { integer_part: "dois" numerator: "três" denominator: "quarto" ... } + "2/11" -> fraction { numerator: "dois" denominator: "onze" morphosyntactic_features: "avos" } + + Args: + cardinal: CardinalFst instance for number parts. + ordinal: OrdinalFst instance for denominator 2-10 and exceptions. + deterministic: if True will provide a single transduction option, + for False multiple options (used for audio-based normalization) + """ + + def __init__(self, cardinal: GraphFst, ordinal: GraphFst, deterministic: bool = True): + super().__init__(name="fraction", kind="classify", deterministic=deterministic) + cardinal_graph = cardinal.graph + + # Denominators 2–10 use ordinal form (no data file: fixed set) + two_to_ten = pynini.union(*[pynini.accep(str(d)) for d in range(2, 11)]).optimize() + + ord_digit_rows = load_labels(get_abs_path("data/ordinals/digit.tsv")) + ordinal_digit = pynini.string_map([(r[1], r[0]) for r in ord_digit_rows if len(r) >= 2]).optimize() + + ord_exc_rows = load_labels(get_abs_path("data/fractions/ordinal_exceptions.tsv")) + ordinal_exceptions = pynini.string_map([(r[0], r[1]) for r in ord_exc_rows if len(r) >= 2]).optimize() + + ord_hundreds_rows = load_labels(get_abs_path("data/ordinals/hundreds.tsv")) + ordinal_hundreds = pynini.string_map([(r[1], r[0]) for r in ord_hundreds_rows if len(r) >= 2]).optimize() + + powers_rows = load_labels(get_abs_path("data/fractions/powers_of_ten.tsv")) + powers_of_ten = pynini.string_map([(r[0], r[1]) for r in powers_rows if len(r) >= 2]).optimize() + + denom_ordinal_form = two_to_ten @ cardinal_graph @ ordinal_digit + denom_ordinal_form = denom_ordinal_form @ pynini.cdrewrite(ordinal_exceptions, "", "", NEMO_SIGMA) + denom_ordinal = ( + pynutil.insert('denominator: "') + + denom_ordinal_form + + pynutil.insert('" morphosyntactic_features: "ordinal"') + ) + + denom_100 = ( + pynutil.insert('denominator: "') + + (pynini.accep("100") @ cardinal_graph @ ordinal_hundreds) + + pynutil.insert('" morphosyntactic_features: "ordinal"') + ) + denom_1000 = ( + pynutil.insert('denominator: "') + + (pynini.accep("1000") @ cardinal_graph @ powers_of_ten) + + pynutil.insert('" morphosyntactic_features: "ordinal"') + ) + + denom_ordinal_2_10_100_1000 = pynini.union(denom_ordinal, denom_100, denom_1000) + digit_plus = pynini.closure(NEMO_DIGIT, 1) + denom_avos_input = pynini.difference( + digit_plus, + pynini.union( + two_to_ten, + pynini.accep("100"), + pynini.accep("1000"), + ), + ) + denom_avos = ( + pynutil.insert('denominator: "') + + (denom_avos_input @ cardinal_graph) + + pynutil.insert('" morphosyntactic_features: "avos"') + ) + + denominator = pynini.union(denom_ordinal_2_10_100_1000, denom_avos) + + # Slash variants: ASCII /, Unicode ⁄ (U+2044), ∕ (U+2215); with or without spaces + slash_or_space_slash = pynini.union( + pynini.cross("/", '" '), + pynini.cross(" / ", '" '), + pynini.cross("\u2044", '" '), # fraction slash ⁄ + pynini.cross(" \u2044 ", '" '), + pynini.cross("\u2215", '" '), # division slash ∕ + pynini.cross(" \u2215 ", '" '), + ) + numerator = pynutil.insert('numerator: "') + cardinal_graph + slash_or_space_slash + fraction_core = numerator + denominator + + integer_part = pynutil.insert('integer_part: "') + cardinal_graph + pynutil.insert('"') + insert_space + + optional_minus = pynini.closure(pynutil.insert("negative: ") + pynini.cross("-", '"true" '), 0, 1) + + mixed = integer_part + pynini.closure(NEMO_WHITE_SPACE, 1) + fraction_core + graph = optional_minus + pynini.union(mixed, fraction_core) + + self.fst = self.add_tokens(graph).optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/pt/taggers/measure.py b/zonos3/vendor/nemo_text_processing/text_normalization/pt/taggers/measure.py new file mode 100644 index 0000000000000000000000000000000000000000..9a0af20779110c393b5990de32bd8e4c1bb3022e --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/pt/taggers/measure.py @@ -0,0 +1,78 @@ +# Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.pt.graph_utils import ( + NEMO_SIGMA, + NEMO_SPACE, + GraphFst, + convert_space, + delete_space, + insert_space, +) +from zonos3.vendor.nemo_text_processing.text_normalization.pt.utils import get_abs_path + + +class MeasureFst(GraphFst): + """ + Finite state transducer for classifying measure (pt-BR), e.g. + 200 g -> measure { cardinal { integer: "duzentos" } units: "gramas" } + 1 kg -> measure { cardinal { integer: "um" } units: "quilo" } + 2,4 g -> measure { decimal { ... } units: "gramas" } + 1/2 l -> measure { fraction { ... } units: "litros" } + + Args: + cardinal: CardinalFst + decimal: DecimalFst + fraction: FractionFst + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, cardinal: GraphFst, decimal: GraphFst, fraction: GraphFst, deterministic: bool = True): + super().__init__(name="measure", kind="classify", deterministic=deterministic) + + unit_singular = pynini.string_file(get_abs_path("data/measure/measurements_singular.tsv")) + unit_plural = pynini.string_file(get_abs_path("data/measure/measurements_plural.tsv")) + + graph_unit_singular = convert_space(unit_singular) + graph_unit_plural = convert_space(unit_plural) + + optional_graph_negative = pynini.closure(pynini.accep("-"), 0, 1) + + unit_plural = pynutil.insert('units: "') + graph_unit_plural + pynutil.insert('"') + unit_singular_graph = pynutil.insert('units: "') + graph_unit_singular + pynutil.insert('"') + + subgraph_decimal = decimal.fst + insert_space + pynini.closure(NEMO_SPACE, 0, 1) + unit_plural + + subgraph_cardinal = ( + (optional_graph_negative + (NEMO_SIGMA - "1")) @ cardinal.fst + + insert_space + + pynini.closure(delete_space, 0, 1) + + unit_plural + ) + + subgraph_cardinal |= ( + (optional_graph_negative + pynini.accep("1")) @ cardinal.fst + + insert_space + + pynini.closure(delete_space, 0, 1) + + unit_singular_graph + ) + + subgraph_fraction = fraction.fst + insert_space + pynini.closure(delete_space, 0, 1) + unit_plural + + final_graph = subgraph_decimal | subgraph_cardinal | subgraph_fraction + self.fst = self.add_tokens(final_graph).optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/pt/taggers/money.py b/zonos3/vendor/nemo_text_processing/text_normalization/pt/taggers/money.py new file mode 100644 index 0000000000000000000000000000000000000000..94b18f86485b4f4f00f16b45e1783970cdc1bbed --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/pt/taggers/money.py @@ -0,0 +1,171 @@ +# Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.pt.graph_utils import ( + NEMO_ALPHA, + NEMO_DIGIT, + NEMO_SIGMA, + NEMO_SPACE, + GraphFst, + delete_space, + insert_space, +) +from zonos3.vendor.nemo_text_processing.text_normalization.pt.utils import get_abs_path, load_labels + + +class MoneyFst(GraphFst): + """ + Finite state transducer for classifying money (pt-BR), e.g. + R$ 12 -> money { currency_maj: "reais" integer_part: "doze" } + R$ 12,05 -> money { currency_maj: "reais" integer_part: "doze" fractional_part: "cinco" + currency_min: "centavos" preserve_order: true } + R$ 0,20 -> money { fractional_part: "vinte" currency_min: "centavos" preserve_order: true } + + Args: + cardinal: CardinalFst + decimal: DecimalFst + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, cardinal: GraphFst, decimal: GraphFst, deterministic: bool = True): + super().__init__(name="money", kind="classify", deterministic=deterministic) + + decimal_separator = pynini.accep(",") + maj_singular = pynini.string_file(get_abs_path("data/money/currency_major.tsv")) + maj_plural_map = pynini.string_file(get_abs_path("data/money/currency_major_plural.tsv")) + maj_plural_graph = maj_singular @ maj_plural_map + min_singular = pynini.string_file(get_abs_path("data/money/currency_minor.tsv")) + min_plural_map = pynini.string_file(get_abs_path("data/money/currency_minor_plural.tsv")) + min_plural_graph = min_singular @ min_plural_map + + cardinal_graph = cardinal.graph + graph_decimal_final = decimal.final_graph_wo_negative + + graph_maj_singular = pynutil.insert('currency_maj: "') + maj_singular + pynutil.insert('"') + graph_maj_plural = pynutil.insert('currency_maj: "') + maj_plural_graph + pynutil.insert('"') + + graph_integer_one = ( + pynutil.insert('integer_part: "') + (pynini.accep("1") @ cardinal_graph) + pynutil.insert('"') + ) + + decimal_with_quantity = (NEMO_SIGMA + NEMO_ALPHA) @ graph_decimal_final + + graph_decimal_plural = pynini.union( + graph_maj_plural + pynini.closure(delete_space, 0, 1) + insert_space + graph_decimal_final, + graph_decimal_final + pynini.closure(delete_space, 0, 1) + insert_space + graph_maj_plural, + ) + graph_decimal_plural = ((NEMO_SIGMA - "1") + decimal_separator + NEMO_SIGMA) @ graph_decimal_plural + + graph_decimal_singular = pynini.union( + graph_maj_singular + pynini.closure(delete_space, 0, 1) + insert_space + graph_decimal_final, + graph_decimal_final + pynini.closure(delete_space, 0, 1) + insert_space + graph_maj_singular, + ) + graph_decimal_singular = (pynini.accep("1") + decimal_separator + NEMO_SIGMA) @ graph_decimal_singular + + graph_decimal = pynini.union( + graph_decimal_singular, + graph_decimal_plural, + graph_maj_plural + pynini.closure(delete_space, 0, 1) + insert_space + decimal_with_quantity, + ) + + graph_integer = pynutil.insert('integer_part: "') + ((NEMO_SIGMA - "1") @ cardinal_graph) + pynutil.insert('"') + + graph_integer_only = pynini.union( + graph_maj_singular + pynini.closure(delete_space, 0, 1) + insert_space + graph_integer_one, + graph_integer_one + pynini.closure(delete_space, 0, 1) + insert_space + graph_maj_singular, + ) + graph_integer_only |= pynini.union( + graph_maj_plural + pynini.closure(delete_space, 0, 1) + insert_space + graph_integer, + graph_integer + pynini.closure(delete_space, 0, 1) + insert_space + graph_maj_plural, + ) + + graph = graph_integer_only | graph_decimal + + two_digits_fractional_part = ( + pynini.closure(NEMO_DIGIT) + (NEMO_DIGIT - "0") + pynini.closure(pynutil.delete("0")) + ) @ ( + (pynutil.delete("0") + (NEMO_DIGIT - "0")) + | ((NEMO_DIGIT - "0") + pynutil.insert("0")) + | ((NEMO_DIGIT - "0") + NEMO_DIGIT) + ) + + graph_min_singular = pynutil.insert('currency_min: "') + min_singular + pynutil.insert('"') + graph_min_plural = pynutil.insert('currency_min: "') + min_plural_graph + pynutil.insert('"') + + maj_singular_labels = load_labels(get_abs_path("data/money/currency_major.tsv")) + decimal_graph_with_minor = None + for curr_symbol, _ in maj_singular_labels: + preserve_order = pynutil.insert(" preserve_order: true") + + integer_plus_maj = pynini.union( + graph_integer + insert_space + pynutil.insert(curr_symbol) @ graph_maj_plural, + graph_integer_one + insert_space + pynutil.insert(curr_symbol) @ graph_maj_singular, + ) + integer_plus_maj = (pynini.closure(NEMO_DIGIT) - "0") @ integer_plus_maj + + graph_fractional_one = ( + pynutil.insert('fractional_part: "') + + (two_digits_fractional_part @ pynini.cross("1", "um")) + + pynutil.insert('"') + ) + + graph_fractional = ( + two_digits_fractional_part @ (pynini.closure(NEMO_DIGIT, 1, 2) - "1") @ cardinal.two_digit_non_zero + ) + graph_fractional = pynutil.insert('fractional_part: "') + graph_fractional + pynutil.insert('"') + + fractional_plus_min = pynini.union( + graph_fractional + insert_space + pynutil.insert(curr_symbol) @ graph_min_plural, + graph_fractional_one + insert_space + pynutil.insert(curr_symbol) @ graph_min_singular, + ) + + decimal_graph_with_minor_curr = ( + integer_plus_maj + pynini.cross(decimal_separator, NEMO_SPACE) + fractional_plus_min + ) + if not deterministic: + decimal_graph_with_minor_curr |= pynutil.add_weight( + integer_plus_maj + + pynini.cross(decimal_separator, NEMO_SPACE) + + pynutil.insert('fractional_part: "') + + two_digits_fractional_part @ cardinal.two_digit_non_zero + + pynutil.insert('"'), + weight=0.0001, + ) + + decimal_graph_with_minor_curr |= pynutil.delete("0,") + fractional_plus_min + decimal_graph_with_minor_curr = pynini.union( + pynutil.delete(curr_symbol) + + pynini.closure(delete_space, 0, 1) + + decimal_graph_with_minor_curr + + preserve_order, + decimal_graph_with_minor_curr + + preserve_order + + pynini.closure(delete_space, 0, 1) + + pynutil.delete(curr_symbol), + ) + + decimal_graph_with_minor = ( + decimal_graph_with_minor_curr + if decimal_graph_with_minor is None + else pynini.union(decimal_graph_with_minor, decimal_graph_with_minor_curr) + ) + + final_graph = graph | pynutil.add_weight(decimal_graph_with_minor, -0.001) + + final_graph = self.add_tokens(final_graph) + self.fst = final_graph.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/pt/taggers/ordinal.py b/zonos3/vendor/nemo_text_processing/text_normalization/pt/taggers/ordinal.py new file mode 100644 index 0000000000000000000000000000000000000000..11321975bc953c5fc2a71ee7171d234bc4342b9f --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/pt/taggers/ordinal.py @@ -0,0 +1,83 @@ +# Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.pt.graph_utils import NEMO_DIGIT, NEMO_SPACE, GraphFst +from zonos3.vendor.nemo_text_processing.text_normalization.pt.utils import get_abs_path, load_labels + + +class OrdinalFst(GraphFst): + """ + Finite state transducer for classifying Portuguese ordinals, e.g. + "1º" / "1ª" -> ordinal { integer: "primeiro" / "primeira" morphosyntactic_features: "gender_masc" / "gender_fem" } + "21º" -> ordinal { integer: "vigésimo primeiro" morphosyntactic_features: "gender_masc" } + + Args: + cardinal: CardinalFst instance for composing compound ordinals. + deterministic: if True will provide a single transduction option, + for False multiple options (used for audio-based normalization) + """ + + def __init__(self, cardinal: GraphFst, deterministic: bool = True): + super().__init__(name="ordinal", kind="classify", deterministic=deterministic) + cardinal_graph = cardinal.graph + + spec_rows = load_labels(get_abs_path("data/ordinals/specials.tsv")) + spec = {r[0]: r[1] for r in spec_rows if len(r) >= 2} + conn_in = spec.get("connector_in", " e ") + conn_out = spec.get("connector_out", NEMO_SPACE) + conn = pynini.cross(conn_in, conn_out) + + # Data: ordinal \t cardinal → FST cardinal→ordinal via load_labels + digit_rows = load_labels(get_abs_path("data/ordinals/digit.tsv")) + graph_digit = pynini.string_map([(r[1], r[0]) for r in digit_rows if len(r) >= 2]).optimize() + teen_rows = load_labels(get_abs_path("data/ordinals/teen.tsv")) + graph_teens = pynini.string_map([(r[1], r[0]) for r in teen_rows if len(r) >= 2]).optimize() + ties_rows = load_labels(get_abs_path("data/ordinals/ties.tsv")) + graph_ties = pynini.string_map([(r[1], r[0]) for r in ties_rows if len(r) >= 2]).optimize() + hundreds_rows = load_labels(get_abs_path("data/ordinals/hundreds.tsv")) + graph_hundreds = pynini.string_map([(r[1], r[0]) for r in hundreds_rows if len(r) >= 2]).optimize() + + graph_tens = pynini.union( + graph_teens, + graph_ties + pynini.closure(conn + graph_digit, 0, 1), + ) + graph_hundred_component = pynini.union( + graph_hundreds + pynini.closure(conn + pynini.union(graph_tens, graph_digit), 0, 1), + graph_tens, + graph_digit, + ) + ordinal_rewrite = graph_hundred_component.optimize() + ordinal_inner = cardinal_graph @ ordinal_rewrite + + opt_dot = pynini.closure(pynutil.delete("."), 0, 1) + suffix_masc = opt_dot + pynutil.delete(pynini.union("º", "°")) + suffix_fem = opt_dot + pynutil.delete("ª") + digit_block = pynini.closure(NEMO_DIGIT, 1, 3) + + to_ordinal_masc = (digit_block + suffix_masc) @ ordinal_inner + to_ordinal_fem = (digit_block + suffix_fem) @ ordinal_inner + + graph_masc = ( + pynutil.insert('integer: "') + + to_ordinal_masc + + pynutil.insert('" morphosyntactic_features: "gender_masc"') + ) + graph_fem = ( + pynutil.insert('integer: "') + to_ordinal_fem + pynutil.insert('" morphosyntactic_features: "gender_fem"') + ) + self.fst = self.add_tokens(pynini.union(graph_masc, graph_fem)).optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/pt/taggers/punctuation.py b/zonos3/vendor/nemo_text_processing/text_normalization/pt/taggers/punctuation.py new file mode 100644 index 0000000000000000000000000000000000000000..2535a09bcab0b083269944975141ea738f466268 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/pt/taggers/punctuation.py @@ -0,0 +1,63 @@ +# Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import os +import sys +from unicodedata import category + +import pynini +from pynini.examples import plurals +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.pt.graph_utils import NEMO_NOT_SPACE, NEMO_SIGMA, GraphFst +from zonos3.vendor.nemo_text_processing.text_normalization.pt.utils import get_abs_path, load_labels + + +class PunctuationFst(GraphFst): + """ + Finite state transducer for classifying punctuation (pt-BR pipeline). + Mirrors the English punctuation tagger; whitelist symbols are excluded via data/whitelist/symbol.tsv. + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="punctuation", kind="classify", deterministic=deterministic) + s = "!#%&\'()*+,-./:;<=>?@^_`{|}~\"" + + punct_symbols_to_exclude = ["[", "]"] + punct_unicode = [ + chr(i) + for i in range(sys.maxunicode) + if category(chr(i)).startswith("P") and chr(i) not in punct_symbols_to_exclude + ] + [r"\[", r"\]"] + + symbol_path = get_abs_path("data/whitelist/symbol.tsv") + whitelist_rows = load_labels(symbol_path) if os.path.isfile(symbol_path) else [] + whitelist_symbols = [x[0] for x in whitelist_rows if x] + self.punct_marks = [p for p in punct_unicode + list(s) if p not in whitelist_symbols] + + punct = pynini.union(*self.punct_marks) + punct = pynini.closure(punct, 1) + + emphasis = ( + pynini.accep("<") + + ( + (pynini.closure(NEMO_NOT_SPACE - pynini.union("<", ">"), 1) + pynini.closure(pynini.accep("/"), 0, 1)) + | (pynini.accep("/") + pynini.closure(NEMO_NOT_SPACE - pynini.union("<", ">"), 1)) + ) + + pynini.accep(">") + ) + punct = plurals._priority_union(emphasis, punct, NEMO_SIGMA) + + self.graph = punct + self.fst = (pynutil.insert("name: \"") + self.graph + pynutil.insert("\"")).optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/pt/taggers/telephone.py b/zonos3/vendor/nemo_text_processing/text_normalization/pt/taggers/telephone.py new file mode 100644 index 0000000000000000000000000000000000000000..1420d884f6bbca2b85f78a1b3aceb69f10bcb334 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/pt/taggers/telephone.py @@ -0,0 +1,119 @@ +# Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.pt.graph_utils import NEMO_SPACE, NEMO_WHITE_SPACE, GraphFst, insert_space +from zonos3.vendor.nemo_text_processing.text_normalization.pt.utils import get_abs_path + + +class TelephoneFst(GraphFst): + """ + Finite state transducer for classifying pt-BR telephone and IP formats, e.g. + (11) 99999-8888 -> telephone { number_part: "um um nove nove nove nove nove oito oito oito oito" } + +55 11 3333-4444 -> telephone { country_code: "mais cinco cinco" number_part: "um um três três três três quatro quatro quatro quatro" } + 192.168.1.1 -> telephone { number_part: "um nove dois ponto um seis oito ponto um ponto um" } + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="telephone", kind="classify", deterministic=deterministic) + + digit = pynini.string_file(get_abs_path("data/numbers/digit.tsv")).optimize() + zero = pynini.string_file(get_abs_path("data/numbers/zero.tsv")).optimize() + single_digits = (digit | zero).optimize() + + # Only strip grouping punctuation between digit blocks; do not delete spaces + # (deleting spaces would glue spoken digit words together in the output). + separators = pynini.union("-", ".") + # Optional separator after country / prompt (still allow +55 11 …). + delete_optional_sep = pynini.closure(pynutil.delete(separators), 0, 1) + # Require an explicit separator between local digit blocks so plain long cardinals + # (e.g. 3022110709) are not misclassified as telephone. + delete_required_separator = pynutil.delete(separators) + delete_optional_spaces = pynini.closure(pynutil.delete(NEMO_WHITE_SPACE), 0) + + def n_digits(n: int): + return pynini.closure(single_digits + insert_space, n - 1, n - 1) + single_digits + + country_digits = n_digits(1) | n_digits(2) | n_digits(3) + country_code = pynini.cross("+", "mais ") + country_digits + + ip_prompts = pynini.string_file(get_abs_path("data/telephone/ip_prompt.tsv")) + telephone_prompts = pynini.string_file(get_abs_path("data/telephone/telephone_prompt.tsv")) + tel_prompt_sequence = telephone_prompts + NEMO_SPACE + pynini.closure(country_code, 0, 1) + + country_code_graph = ( + pynutil.insert('country_code: "') + + (country_code | ip_prompts | tel_prompt_sequence) + + delete_optional_sep + + pynutil.insert('"') + ) + + area_code = (pynutil.delete("(") + n_digits(2) + pynutil.delete(")")) | n_digits(2) + + eleven_digit_graph = ( + area_code + + delete_optional_spaces + + insert_space + + n_digits(5) + + delete_required_separator + + insert_space + + n_digits(4) + ) + ten_digit_graph = ( + area_code + + delete_optional_spaces + + insert_space + + n_digits(4) + + delete_required_separator + + insert_space + + n_digits(4) + ) + nine_digit_graph = n_digits(5) + delete_required_separator + insert_space + n_digits(4) + eight_digit_graph = n_digits(4) + delete_required_separator + insert_space + n_digits(4) + seven_digit_graph = n_digits(3) + delete_required_separator + insert_space + n_digits(4) + + digit_to_str_graph = single_digits + pynini.closure(pynutil.insert(" ") + single_digits, 0, 2) + ip_graph = digit_to_str_graph + (pynini.cross(".", " ponto ") + digit_to_str_graph) ** 3 + + number_part = ( + eleven_digit_graph + | ten_digit_graph + | nine_digit_graph + | eight_digit_graph + | seven_digit_graph + | pynutil.add_weight(ip_graph, 0.01) + ) + number_part = pynutil.insert('number_part: "') + number_part + pynutil.insert('"') + + # "ramal" -> spoken "ramal …"; "extensão" / "ext." -> spoken "extensão …" (not "ext." letter-by-letter). + ext_core = n_digits(1) + pynini.closure(insert_space + n_digits(1), 0, 3) + extension_intro = delete_optional_spaces + ( + (pynutil.delete("ramal") + delete_optional_spaces + pynutil.insert("ramal ")) + | ( + (pynutil.delete("extensão") | pynutil.delete("ext.")) + + delete_optional_spaces + + pynutil.insert("extensão ") + ) + ) + ext_graph = pynutil.insert('extension: "') + extension_intro + ext_core + pynutil.insert('"') + + graph = ( + pynini.closure(country_code_graph + delete_optional_spaces + insert_space, 0, 1) + + number_part + + pynini.closure(delete_optional_spaces + insert_space + ext_graph, 0, 1) + ) + + self.fst = self.add_tokens(graph).optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/pt/taggers/time.py b/zonos3/vendor/nemo_text_processing/text_normalization/pt/taggers/time.py new file mode 100644 index 0000000000000000000000000000000000000000..271632c390ab92a76990c1875f0e5dc50e400127 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/pt/taggers/time.py @@ -0,0 +1,180 @@ +# Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.pt.graph_utils import GraphFst, delete_space, insert_space +from zonos3.vendor.nemo_text_processing.text_normalization.pt.utils import get_abs_path, load_labels + + +class TimeFst(GraphFst): + """ + Finite state transducer for classifying Portuguese (Brazilian) time, e.g. + 14:30 -> time { hours: "catorze" minutes: "trinta" preserve_order: true } + 14:30:05 -> time { hours: "catorze" minutes: "trinta" seconds: "cinco" preserve_order: true } + 09:00:31 -> time { hours: "nove" minutes: "zero" seconds: "trinta e um" preserve_order: true } + 12:00 -> time { hours: "doze" preserve_order: true } + 11:00 da manhã -> time { hours: "onze" suffix: "da manhã" preserve_order: true } + 16:00 da tarde -> time { hours: "quatro" suffix: "da tarde" preserve_order: true } + 23:18 da tarde -> time { hours: "vinte e três" ... suffix: "da tarde" preserve_order: true } + + Args: + cardinal: CardinalFst + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, cardinal: GraphFst, deterministic: bool = True): + super().__init__(name="time", kind="classify", deterministic=deterministic) + cardinal_graph = cardinal.graph.optimize() + + hour_words = [] + for h in range(24): + key = str(h) + comp = pynini.compose(pynini.accep(key), cardinal_graph).optimize() + hour_words.append(pynini.shortestpath(comp, nshortest=1, unique=True).string()) + + hour_delete_fsts = [] + for h in range(24): + if h < 10: + hour_delete_fsts.append(pynini.union(pynutil.delete(str(h)), pynutil.delete(f"0{h}")).optimize()) + else: + hour_delete_fsts.append(pynutil.delete(str(h))) + + labels_minute_single = [str(x) for x in range(1, 10)] + labels_minute_double = [str(x) for x in range(10, 60)] + + graph_minute_single = pynini.union(*labels_minute_single) @ cardinal_graph + graph_minute_double = pynini.union(*labels_minute_double) @ cardinal_graph + final_graph_minute = ( + pynutil.insert('minutes: "') + + (pynutil.delete("0") + graph_minute_single | graph_minute_double) + + pynutil.insert('"') + ) + + final_graph_second = ( + pynutil.insert('seconds: "') + + (pynutil.delete("0") + graph_minute_single | graph_minute_double) + + pynutil.insert('"') + ) + + # HMS verbalizer always expects ``minutes`` and ``seconds`` tags; bare ``delete("00")`` omits them. + zero_word = hour_words[0] + minutes_zero = ( + pynutil.delete("00") + pynutil.insert('minutes: "') + pynutil.insert(zero_word) + pynutil.insert('"') + ) + seconds_zero = ( + pynutil.delete("00") + pynutil.insert('seconds: "') + pynutil.insert(zero_word) + pynutil.insert('"') + ) + + delete_h = pynini.union( + pynutil.delete(pynini.accep(pynini.escape("h"))), + pynutil.delete(pynini.accep(pynini.escape("H"))), + ) + + time_delim = pynini.union( + pynini.accep(pynini.escape(":")), + pynini.accep(pynini.escape(".")), + ) + + period_rows = load_labels(get_abs_path("data/time/day_period_suffix.tsv")) + period_meta = [] + for row in period_rows: + if len(row) < 2 or not row[0].strip(): + continue + tail, tag_val = row[0].strip(), row[1].strip() + if len(row) < 4 or not row[2].strip().isdigit() or not row[3].strip().isdigit(): + raise ValueError( + f"day_period_suffix.tsv row must have 4 columns (tail, tag, hour_min, hour_max): {row!r}" + ) + h0, h1 = int(row[2].strip()), int(row[3].strip()) + allowed = frozenset(range(h0, h1 + 1)) + suf_fst = insert_space + delete_space + pynutil.delete("da") + delete_space + pynutil.delete(tail) + period_meta.append((tag_val, allowed, suf_fst, tail)) + + preserve = pynutil.insert(" preserve_order: true") + + mid_hm = pynutil.delete(time_delim) + (pynutil.delete("00") | insert_space + final_graph_minute) + mid_h_minute = delete_h + (pynutil.delete("00") | insert_space + final_graph_minute) + mid_h_only = delete_h + mid_hms = ( + pynutil.delete(time_delim) + + (minutes_zero | insert_space + final_graph_minute) + + pynutil.delete(time_delim) + + (seconds_zero | insert_space + final_graph_second) + ) + + graph_chunks = [] + for mid_after_hour in (mid_hm, mid_h_minute, mid_h_only, mid_hms): + branches = [] + for h in range(24): + hd = hour_delete_fsts[h] + hw24 = hour_words[h] + hour_tok_24 = pynutil.insert('hours: "') + pynutil.insert(hw24) + pynutil.insert('"') + branches.append(hd + hour_tok_24 + mid_after_hour + preserve) + for tag_val, allowed, suf, tail in period_meta: + keep_suffix, hour_idx = TimeFst._resolve_suffix_hour(h, tail, allowed) + hw_suf = hour_words[hour_idx] + hour_tok_suf = pynutil.insert('hours: "') + pynutil.insert(hw_suf) + pynutil.insert('"') + if keep_suffix: + branches.append( + hd + + hour_tok_suf + + mid_after_hour + + suf + + pynutil.insert(f' suffix: "{tag_val}"') + + preserve + ) + else: + # User wrote a period: always emit ``suffix:`` so TN does not drop it from speech + # (hours stay 24h when the period does not match the clock policy). + branches.append( + hd + + hour_tok_24 + + mid_after_hour + + suf + + pynutil.insert(f' suffix: "{tag_val}"') + + preserve + ) + graph_chunks.append(pynini.union(*branches).optimize()) + + final_graph = pynini.union(*graph_chunks).optimize() + self.fst = self.add_tokens(final_graph).optimize() + + @staticmethod + def _resolve_suffix_hour(h: int, period_tail: str, allowed: frozenset) -> tuple[bool, int]: + """Return (keep_suffix, hour_index) for ``hour_words[hour_index]`` when a day-period applies.""" + if period_tail == "manhã": + allowed_m = allowed | frozenset({1, 2, 3, 4, 5}) + if h not in allowed_m: + return False, h + return True, h + if period_tail == "tarde": + if h in allowed: + return True, 12 if h == 12 else h - 12 + if 1 <= h <= 5 and (h + 12) in allowed: + return True, h + return False, h + if period_tail == "noite": + if h in allowed: + return True, h - 12 + if 6 <= h <= 11 and (h + 12) in allowed: + return True, h + return False, h + if period_tail == "madrugada": + if h in allowed: + return True, h + return False, h + return False, h diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/pt/taggers/tokenize_and_classify.py b/zonos3/vendor/nemo_text_processing/text_normalization/pt/taggers/tokenize_and_classify.py new file mode 100644 index 0000000000000000000000000000000000000000..f4ba2bc87983118ce24f02784394706f88d31425 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/pt/taggers/tokenize_and_classify.py @@ -0,0 +1,135 @@ +# Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import os + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.pt.graph_utils import ( + NEMO_WHITE_SPACE, + GraphFst, + delete_extra_space, + delete_space, + generator_main, +) +from zonos3.vendor.nemo_text_processing.text_normalization.pt.taggers.cardinal import CardinalFst +from zonos3.vendor.nemo_text_processing.text_normalization.pt.taggers.date import DateFst +from zonos3.vendor.nemo_text_processing.text_normalization.pt.taggers.decimal import DecimalFst +from zonos3.vendor.nemo_text_processing.text_normalization.pt.taggers.electronic import ElectronicFst +from zonos3.vendor.nemo_text_processing.text_normalization.pt.taggers.fraction import FractionFst +from zonos3.vendor.nemo_text_processing.text_normalization.pt.taggers.measure import MeasureFst +from zonos3.vendor.nemo_text_processing.text_normalization.pt.taggers.money import MoneyFst +from zonos3.vendor.nemo_text_processing.text_normalization.pt.taggers.ordinal import OrdinalFst +from zonos3.vendor.nemo_text_processing.text_normalization.pt.taggers.punctuation import PunctuationFst +from zonos3.vendor.nemo_text_processing.text_normalization.pt.taggers.telephone import TelephoneFst +from zonos3.vendor.nemo_text_processing.text_normalization.pt.taggers.time import TimeFst +from zonos3.vendor.nemo_text_processing.text_normalization.pt.taggers.whitelist import WhiteListFst +from zonos3.vendor.nemo_text_processing.text_normalization.pt.taggers.word import WordFst +from zonos3.vendor.nemo_text_processing.utils.logging import logger + + +class ClassifyFst(GraphFst): + """ + Final class that composes all Portuguese classification grammars. This class can process an entire sentence (lower cased). + For deployment, this grammar will be compiled and exported to OpenFst Finite State Archive (FAR) File. + More details to deployment at NeMo/tools/text_processing_deployment. + + Args: + input_case: accepting either "lower_cased" or "cased" input. + deterministic: if True will provide a single transduction option, + for False multiple options (used for audio-based normalization) + cache_dir: path to a dir with .far grammar file. Set to None to avoid using cache. + overwrite_cache: set to True to overwrite .far files. + whitelist: path to a file with whitelist replacements. + """ + + def __init__( + self, + input_case: str, + deterministic: bool = False, + cache_dir: str = None, + overwrite_cache: bool = False, + whitelist: str = None, + ): + super().__init__(name="tokenize_and_classify", kind="classify", deterministic=deterministic) + far_file = None + if cache_dir is not None and cache_dir != "None": + os.makedirs(cache_dir, exist_ok=True) + whitelist_file = os.path.basename(whitelist) if whitelist else "" + far_file = os.path.join( + cache_dir, + f"_{input_case}_pt_tn_{deterministic}_deterministic{whitelist_file}.far", + ) + if not overwrite_cache and far_file and os.path.exists(far_file): + self.fst = pynini.Far(far_file, mode="r")["tokenize_and_classify"] + logger.info(f"ClassifyFst.fst was restored from {far_file}.") + else: + logger.info(f"Creating ClassifyFst grammars. This might take some time...") + + # Initialize Portuguese taggers + cardinal = CardinalFst(deterministic=deterministic) + ordinal = OrdinalFst(cardinal, deterministic=deterministic) + fraction = FractionFst(cardinal, ordinal, deterministic=deterministic) + decimal = DecimalFst(cardinal, deterministic=deterministic) + measure = MeasureFst(cardinal=cardinal, decimal=decimal, fraction=fraction, deterministic=deterministic) + money = MoneyFst(cardinal=cardinal, decimal=decimal, deterministic=deterministic) + date = DateFst(cardinal, deterministic=deterministic) + time = TimeFst(cardinal, deterministic=deterministic) + telephone = TelephoneFst(deterministic=deterministic) + electronic = ElectronicFst(deterministic=deterministic) + + punctuation = PunctuationFst(deterministic=deterministic) + word_graph = WordFst(punctuation=punctuation, deterministic=deterministic).fst + whitelist = WhiteListFst(input_case=input_case, deterministic=deterministic, input_file=whitelist) + + classify = ( + pynutil.add_weight(whitelist.fst, 1.01) + | pynutil.add_weight(date.fst, 1.1) + | pynutil.add_weight(time.fst, 1.1) + | pynutil.add_weight(measure.fst, 1.1) + | pynutil.add_weight(fraction.fst, 1.1) + | pynutil.add_weight(decimal.fst, 1.1) + | pynutil.add_weight(ordinal.fst, 1.1) + | pynutil.add_weight(cardinal.fst, 1.1) + | pynutil.add_weight(money.fst, 1.1) + | pynutil.add_weight(telephone.fst, 1.11) + | pynutil.add_weight(electronic.fst, 1.11) + | pynutil.add_weight(word_graph, 100) + ) + + # Wrap tokens properly + token = pynutil.insert("tokens { ") + classify + pynutil.insert(" }") + punct_graph = ( + pynutil.insert("tokens { ") + pynutil.add_weight(punctuation.fst, weight=2.1) + pynutil.insert(" }") + ) + + # Simple graph structure + graph = token + pynini.closure( + pynini.compose(pynini.closure(NEMO_WHITE_SPACE, 1), delete_extra_space) + token + ) + + # Allow punctuation + graph |= punct_graph + + self.fst = delete_space + graph + delete_space + + if far_file: + generator_main(far_file, {"tokenize_and_classify": self.fst}) + logger.info(f"ClassifyFst grammars are saved to {far_file}.") + + +if __name__ == "__main__": + ClassifyFst(input_case="cased", deterministic=False) diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/pt/taggers/whitelist.py b/zonos3/vendor/nemo_text_processing/text_normalization/pt/taggers/whitelist.py new file mode 100644 index 0000000000000000000000000000000000000000..01158e3507fd176527196a758c6dc5bbf72c55f1 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/pt/taggers/whitelist.py @@ -0,0 +1,111 @@ +# Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import os + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.utils import augment_labels_with_punct_at_end +from zonos3.vendor.nemo_text_processing.text_normalization.pt.graph_utils import ( + INPUT_CASED, + INPUT_LOWER_CASED, + NEMO_SIGMA, + NEMO_UPPER, + GraphFst, + convert_space, +) +from zonos3.vendor.nemo_text_processing.text_normalization.pt.utils import get_abs_path, load_labels + + +def _empty_fst() -> "pynini.FstLike": + """FST that accepts nothing (no whitelist rows).""" + return pynini.intersect(pynini.accep("a"), pynini.accep("b")).optimize() + + +def get_formats(input_f, input_case=INPUT_CASED, is_default=True): + """Abbreviation format variants (same idea as EN whitelist).""" + multiple_formats = load_labels(input_f) + if not multiple_formats: + return _empty_fst() + additional_options = [] + for x, y in multiple_formats: + if input_case == INPUT_LOWER_CASED: + x = x.lower() + additional_options.append((f"{x}.", y)) + additional_options.append((f"{x[0].upper() + x[1:]}", f"{y[0].upper() + y[1:]}")) + additional_options.append((f"{x[0].upper() + x[1:]}.", f"{y[0].upper() + y[1:]}")) + multiple_formats.extend(additional_options) + + if not is_default: + multiple_formats = [(x, f"|raw_start|{x}|raw_end||norm_start|{y}|norm_end|") for (x, y) in multiple_formats] + + return pynini.string_map(multiple_formats) + + +class WhiteListFst(GraphFst): + """ + Whitelist classifier for pt-BR TN. Data lives under pt/data/whitelist/ (may be empty). + """ + + def __init__(self, input_case: str, deterministic: bool = True, input_file: str = None): + super().__init__(name="whitelist", kind="classify", deterministic=deterministic) + + def _get_whitelist_graph(input_case, file, keep_punct_add_end: bool = False): + whitelist = load_labels(file) if os.path.isfile(file) else [] + if not whitelist: + return _empty_fst() + if input_case == INPUT_LOWER_CASED: + whitelist = [[x.lower(), y] for x, y in whitelist] + else: + whitelist = [[x, y] for x, y in whitelist] + + if keep_punct_add_end: + whitelist.extend(augment_labels_with_punct_at_end(whitelist)) + + return pynini.string_map(whitelist) + + graph = _get_whitelist_graph(input_case, get_abs_path("data/whitelist/tts.tsv")) + + symbol_path = get_abs_path("data/whitelist/symbol.tsv") + if os.path.isfile(symbol_path) and load_labels(symbol_path): + graph |= pynini.compose( + pynini.difference(NEMO_SIGMA, pynini.accep("/")).optimize(), + _get_whitelist_graph(input_case, symbol_path), + ).optimize() + + for x in [".", ". "]: + graph |= ( + NEMO_UPPER + + pynini.closure(pynutil.delete(x) + NEMO_UPPER, 2) + + pynini.closure(pynutil.delete("."), 0, 1) + ) + + if not deterministic: + alt_path = get_abs_path("data/whitelist/alternatives.tsv") + if os.path.isfile(alt_path) and load_labels(alt_path): + graph |= _get_whitelist_graph(input_case, alt_path, keep_punct_add_end=True) + fmt_path = get_abs_path("data/whitelist/alternatives_all_format.tsv") + if os.path.isfile(fmt_path) and load_labels(fmt_path): + graph |= get_formats(fmt_path, input_case=input_case) + + if input_file: + whitelist_provided = _get_whitelist_graph(input_case, input_file) + if not deterministic: + graph |= whitelist_provided + else: + graph = whitelist_provided + + self.graph = convert_space(graph).optimize() + self.fst = (pynutil.insert("name: \"") + self.graph + pynutil.insert("\"")).optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/pt/taggers/word.py b/zonos3/vendor/nemo_text_processing/text_normalization/pt/taggers/word.py new file mode 100644 index 0000000000000000000000000000000000000000..97fb7a8e240931e1c1a617e5d51ab589a6e203db --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/pt/taggers/word.py @@ -0,0 +1,81 @@ +# Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.examples import plurals +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.pt.graph_utils import ( + MIN_NEG_WEIGHT, + NEMO_ALPHA, + NEMO_DIGIT, + NEMO_NOT_SPACE, + NEMO_SIGMA, + GraphFst, + convert_space, +) +from zonos3.vendor.nemo_text_processing.text_normalization.pt.utils import get_abs_path + + +class WordFst(GraphFst): + """ + Finite state transducer for classifying words (pt-BR pipeline). + Same structure as the English word tagger; uses PT data paths and the passed PunctuationFst. + """ + + def __init__(self, punctuation: GraphFst, deterministic: bool = True): + super().__init__(name="word", kind="classify", deterministic=deterministic) + + punct = punctuation.graph + default_graph = pynini.closure(pynini.difference(NEMO_NOT_SPACE, punct.project("input")), 1) + symbols_to_exclude = (pynini.union("$", "€", "₩", "£", "¥", "#", "%") | NEMO_DIGIT).optimize() + graph = pynini.closure(pynini.difference(NEMO_NOT_SPACE, symbols_to_exclude), 1) + graph = pynutil.add_weight(graph, MIN_NEG_WEIGHT) | default_graph + + phoneme_unit = pynini.closure(NEMO_ALPHA, 1) + pynini.closure(NEMO_DIGIT) + phoneme = ( + pynini.accep(pynini.escape("[")) + + pynini.closure(phoneme_unit + pynini.accep(" ")) + + phoneme_unit + + pynini.accep(pynini.escape("]")) + ) + + punct_marks = pynini.union(*punctuation.punct_marks).optimize() + stress = pynini.union("ˈ", "'", "ˌ") + ipa_phoneme_unit = pynini.string_file(get_abs_path("data/whitelist/ipa_symbols.tsv")) + ipa_phonemes = ( + pynini.closure(stress, 0, 1) + + pynini.closure(ipa_phoneme_unit, 1) + + pynini.closure(stress | ipa_phoneme_unit) + ) + delim = (punct_marks | pynini.accep(" ")) ** (1, ...) + ipa_phonemes = ipa_phonemes + pynini.closure(delim + ipa_phonemes) + pynini.closure(delim, 0, 1) + ipa_phonemes = (pynini.accep(pynini.escape("[")) + ipa_phonemes + pynini.accep(pynini.escape("]"))).optimize() + + if not deterministic: + phoneme = ( + pynini.accep(pynini.escape("[")) + + pynini.closure(pynini.accep(" "), 0, 1) + + pynini.closure(phoneme_unit + pynini.accep(" ")) + + phoneme_unit + + pynini.closure(pynini.accep(" "), 0, 1) + + pynini.accep(pynini.escape("]")) + ).optimize() + ipa_phonemes = ( + pynini.accep(pynini.escape("[")) + ipa_phonemes + pynini.accep(pynini.escape("]")) + ).optimize() + + phoneme |= ipa_phonemes + self.graph = plurals._priority_union(convert_space(phoneme.optimize()), graph, NEMO_SIGMA) + self.fst = (pynutil.insert("name: \"") + self.graph + pynutil.insert("\"")).optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/pt/utils.py b/zonos3/vendor/nemo_text_processing/text_normalization/pt/utils.py new file mode 100644 index 0000000000000000000000000000000000000000..da4be3f8918f416fc741903b402ac4ba870a53c9 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/pt/utils.py @@ -0,0 +1,49 @@ +# Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use it except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +""" +Portuguese (PT) text normalization utilities. + +Provides get_abs_path for resolving data paths and load_labels for reading TSV label files. +""" +import csv +import os + + +def get_abs_path(rel_path: str) -> str: + """ + Resolve a path relative to this module to an absolute path. + + Args: + rel_path: path relative to the PT text normalization data directory. + + Returns: + Absolute path string. + """ + return os.path.dirname(os.path.abspath(__file__)) + '/' + rel_path + + +def load_labels(abs_path: str): + """ + Load a TSV file as a list of rows (list of lists). + + Args: + abs_path: absolute path to a UTF-8 TSV file. + + Returns: + List of rows, each row a list of fields (e.g. from csv.reader). + """ + with open(abs_path, encoding="utf-8") as label_tsv: + labels = list(csv.reader(label_tsv, delimiter="\t")) + return labels diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/pt/verbalizers/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/pt/verbalizers/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9e3fb699d9f6b1df3430f755849be91d63679cdc --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/pt/verbalizers/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/pt/verbalizers/cardinal.py b/zonos3/vendor/nemo_text_processing/text_normalization/pt/verbalizers/cardinal.py new file mode 100644 index 0000000000000000000000000000000000000000..d6144c64173ae5e645bef2e28b3a62e9ba82950c --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/pt/verbalizers/cardinal.py @@ -0,0 +1,68 @@ +# Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.pt.graph_utils import ( + NEMO_NOT_QUOTE, + GraphFst, + insert_space, + shift_cardinal_gender_pt, +) + + +class CardinalFst(GraphFst): + """ + Finite state transducer for verbalizing Portuguese cardinal numbers, e.g. + cardinal { integer: "dois" } -> dois + cardinal { integer: "dois" } -> duas (feminine context via shift_cardinal_gender_pt) + cardinal { negative: "true" integer: "cinco" } -> menos cinco + + Args: + deterministic: if True will provide a single transduction option, + for False multiple options (used for audio-based normalization) + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="cardinal", kind="verbalize", deterministic=deterministic) + optional_sign = pynini.closure(pynini.cross("negative: \"true\" ", "menos") + insert_space, 0, 1) + self.optional_sign = optional_sign + + integer = pynini.closure(NEMO_NOT_QUOTE, 1) + self.integer = pynutil.delete(" \"") + integer + pynutil.delete("\"") + + integer = pynutil.delete("integer:") + self.integer + + # Generate masculine form (default) + graph_masc = optional_sign + integer + + # Generate feminine form using Portuguese gender conversion + graph_fem = shift_cardinal_gender_pt(graph_masc) + + self.graph_masc = pynini.optimize(graph_masc) + self.graph_fem = pynini.optimize(graph_fem) + + # Default to masculine for standalone numbers + # Context-aware gender selection will be handled by higher-level components + graph = graph_masc + + if not deterministic: + # For alternate renderings and contractions + # Portuguese doesn't have apocope like Spanish, but may have contractions + pass + + delete_tokens = self.delete_tokens(graph) + self.fst = delete_tokens.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/pt/verbalizers/date.py b/zonos3/vendor/nemo_text_processing/text_normalization/pt/verbalizers/date.py new file mode 100644 index 0000000000000000000000000000000000000000..2ebb3ef6b4e3d8a3a9690c461fc72d3bc0dc9354 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/pt/verbalizers/date.py @@ -0,0 +1,52 @@ +# Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.pt.graph_utils import ( + NEMO_NOT_QUOTE, + GraphFst, + delete_preserve_order, + delete_space, + insert_space, +) +from zonos3.vendor.nemo_text_processing.text_normalization.pt.utils import get_abs_path, load_labels + + +class DateFst(GraphFst): + """ + Finite state transducer for verbalizing Portuguese (Brazilian) dates, e.g. + date { day: "quinze" month: "março" year: "dois mil e vinte e quatro" preserve_order: true } + -> quinze de março de dois mil e vinte e quatro + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="date", kind="verbalize", deterministic=deterministic) + + vrows = load_labels(get_abs_path("data/date/verbal_phrases.tsv")) + vp = {r[0].strip(): r[1].strip() for r in vrows if len(r) >= 2 and r[0].strip()} + prep_word = vp.get("preposition", "de") + + quoted = pynini.closure(NEMO_NOT_QUOTE, 1) + + day_expr = pynutil.delete('day: "') + quoted + pynutil.delete('"') + month_expr = pynutil.delete('month: "') + quoted + pynutil.delete('"') + year_expr = pynutil.delete('year: "') + quoted + pynutil.delete('"') + + ws = delete_space + insert_space + glue = ws + pynutil.insert(prep_word) + insert_space + ws + + graph_dmy = day_expr + glue + month_expr + glue + year_expr + delete_preserve_order + self.fst = self.delete_tokens(graph_dmy).optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/pt/verbalizers/decimal.py b/zonos3/vendor/nemo_text_processing/text_normalization/pt/verbalizers/decimal.py new file mode 100644 index 0000000000000000000000000000000000000000..78537923bce7df3e5a4b06467940d6836909a633 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/pt/verbalizers/decimal.py @@ -0,0 +1,67 @@ +# Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use it except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.pt.graph_utils import NEMO_NOT_QUOTE, GraphFst, delete_space, insert_space +from zonos3.vendor.nemo_text_processing.text_normalization.pt.utils import get_abs_path, load_labels + + +class DecimalFst(GraphFst): + """ + Finite state transducer for verbalizing Portuguese decimal numbers, e.g. + decimal { integer_part: "um" fractional_part: "vinte e seis" } -> um vírgula vinte e seis + decimal { negative: "true" integer_part: "um" ... } -> menos um vírgula ... + decimal { integer_part: "um" quantity: "milhão" } -> um milhão + + Args: + deterministic: if True will provide a single transduction option, + for False multiple options (used for audio-based normalization) + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="decimal", kind="verbalize", deterministic=deterministic) + labels = load_labels(get_abs_path("data/numbers/decimal_specials.tsv")) + spec = {r[0]: r[1] for r in labels if len(r) >= 2} + sep = spec.get("separator", "vírgula") + minus = spec.get("minus", "menos") + + optional_sign = pynini.closure(pynini.cross('negative: "true" ', minus) + insert_space, 0, 1) + + integer = pynutil.delete('integer_part: "') + pynini.closure(NEMO_NOT_QUOTE, 1) + pynutil.delete('"') + fractional = pynutil.delete('fractional_part: "') + pynini.closure(NEMO_NOT_QUOTE, 1) + pynutil.delete('"') + quantity = ( + delete_space + + insert_space + + pynutil.delete('quantity: "') + + pynini.closure(NEMO_NOT_QUOTE, 1) + + pynutil.delete('"') + ) + + integer_quantity = integer + quantity + decimal_part = ( + integer + + delete_space + + insert_space + + pynutil.insert(sep) + + insert_space + + fractional + + pynini.closure(quantity, 0, 1) + ) + + graph = optional_sign + pynini.union(integer_quantity, decimal_part) + + self.numbers = graph.optimize() + self.fst = self.delete_tokens(graph).optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/pt/verbalizers/electronic.py b/zonos3/vendor/nemo_text_processing/text_normalization/pt/verbalizers/electronic.py new file mode 100644 index 0000000000000000000000000000000000000000..bf1651e3ee61b4d5d126538a4a422ecb97e5ac94 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/pt/verbalizers/electronic.py @@ -0,0 +1,79 @@ +# Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.pt.graph_utils import ( + NEMO_NOT_QUOTE, + NEMO_SIGMA, + NEMO_SPACE, + GraphFst, + delete_preserve_order, +) +from zonos3.vendor.nemo_text_processing.text_normalization.pt.utils import get_abs_path + +digit_no_zero = pynini.string_file(get_abs_path("data/numbers/digit.tsv")) +zero = pynini.string_file(get_abs_path("data/numbers/zero.tsv")) +graph_symbols = pynini.string_file(get_abs_path("data/electronic/symbols.tsv")) +server_common = pynini.string_file(get_abs_path("data/electronic/server_name.tsv")) +domain_common = pynini.string_file(get_abs_path("data/electronic/domain.tsv")) +spoken_unit = pynini.string_file(get_abs_path("data/electronic/electronic_spoken_unit.tsv")) + + +class ElectronicFst(GraphFst): + """ + Finite state transducer for verbalizing electronic. + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="electronic", kind="verbalize", deterministic=deterministic) + + graph_digit = digit_no_zero | zero + + def add_space_after_char(): + return pynini.closure(NEMO_NOT_QUOTE - pynini.accep(NEMO_SPACE) + pynutil.insert(NEMO_SPACE)) + ( + NEMO_NOT_QUOTE - pynini.accep(NEMO_SPACE) + ) + + verbalize_characters = pynini.cdrewrite(graph_symbols | graph_digit, "", "", NEMO_SIGMA) + + # Prefer whole tokens (server names, TLDs, company/common words) over letter-by-letter. + user_segment = pynutil.add_weight(NEMO_NOT_QUOTE, weight=0.0001) | server_common | spoken_unit + user_name = ( + pynutil.delete('username: "') + + (user_segment + pynini.closure(pynutil.insert(NEMO_SPACE) + user_segment)) + + pynutil.delete('"') + ) + user_name @= verbalize_characters + + convert_defaults = ( + pynutil.add_weight(NEMO_NOT_QUOTE, weight=0.0001) | domain_common | server_common | spoken_unit + ) + domain = convert_defaults + pynini.closure(pynutil.insert(NEMO_SPACE) + convert_defaults) + domain @= verbalize_characters + domain = pynutil.delete('domain: "') + domain + pynutil.delete('"') + + protocol = ( + pynutil.delete('protocol: "') + + add_space_after_char() @ pynini.cdrewrite(graph_symbols, "", "", NEMO_SIGMA) + + pynutil.delete('"') + ) + + self.graph = (pynini.closure(protocol + NEMO_SPACE, 0, 1) + domain) | ( + user_name + NEMO_SPACE + pynutil.insert("arroba" + NEMO_SPACE) + domain + | (pynutil.insert("arroba" + NEMO_SPACE) + user_name) + ) + + self.fst = self.delete_tokens(self.graph + delete_preserve_order).optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/pt/verbalizers/fraction.py b/zonos3/vendor/nemo_text_processing/text_normalization/pt/verbalizers/fraction.py new file mode 100644 index 0000000000000000000000000000000000000000..ef3f63fb0fef0dfdfc1e5e32dfd9bdd4be5e1b7b --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/pt/verbalizers/fraction.py @@ -0,0 +1,109 @@ +# Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use it except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.pt.graph_utils import NEMO_NOT_QUOTE, GraphFst, insert_space +from zonos3.vendor.nemo_text_processing.text_normalization.pt.utils import get_abs_path, load_labels + + +class FractionFst(GraphFst): + """ + Finite state transducer for verbalizing Portuguese fraction numbers, e.g. + fraction { numerator: "um" denominator: "meio" morphosyntactic_features: "ordinal" } -> um meio + fraction { integer_part: "dois" numerator: "três" denominator: "quarto" } -> dois e três quartos + fraction { numerator: "dois" denominator: "onze" morphosyntactic_features: "avos" } -> dois onze avos + + Denominator routing (set by the tagger, unchanged here): + + * **Ordinal** (``morphosyntactic_features: "ordinal"``): denominators 2–10, 100, 1000 — spoken as + ordinals with plural ``s`` on the denominator when the numerator is not ``um`` (``três quartos``). + * **Avos** (``… "avos"``): all other positive integer denominators — cardinal denominator + the word + ``avos`` (``três onze avos``). Optional ``sobre`` between numerator and denominator is controlled by + ``data/fractions/specials.tsv`` key ``avos_between`` (empty = single space; ``sobre`` = ``… sobre …``). + * **Mixed** numbers use ``connector`` from the same TSV (default `` e ``) after the integer part. + + Args: + deterministic: if True will provide a single transduction option, + for False multiple options (used for audio-based normalization) + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="fraction", kind="verbalize", deterministic=deterministic) + labels = load_labels(get_abs_path("data/fractions/specials.tsv")) + spec = {r[0]: r[1] for r in labels if len(r) >= 2} + connector_raw = spec.get("connector", " e ").strip() + connector = insert_space + pynutil.insert(connector_raw) + insert_space + minus = spec.get("minus", "menos ").rstrip() + plural_suffix = spec.get("plural_suffix", "s") + avos_word = spec.get("avos_suffix", " avos").strip() + avos_between = spec.get("avos_between", "").strip() + numerator_one_val = spec.get("numerator_one", "um") + denominator_half_val = spec.get("denominator_half", "meio") + + optional_sign = pynini.closure(pynini.cross('negative: "true" ', minus) + insert_space, 0, 1) + + integer = pynutil.delete('integer_part: "') + pynini.closure(NEMO_NOT_QUOTE) + pynutil.delete('" ') + + numerator_one = pynutil.delete('numerator: "') + pynini.accep(numerator_one_val) + pynutil.delete('" ') + numerator_rest = ( + pynutil.delete('numerator: "') + + pynini.difference(pynini.closure(NEMO_NOT_QUOTE), pynini.accep(numerator_one_val)) + + pynutil.delete('" ') + ) + + denom_ordinal = ( + pynutil.delete('denominator: "') + + pynini.closure(NEMO_NOT_QUOTE) + + pynutil.delete('" morphosyntactic_features: "ordinal"') + ) + denom_meio = ( + pynutil.delete('denominator: "') + + pynini.accep(denominator_half_val) + + pynutil.delete('" morphosyntactic_features: "ordinal"') + ) + denom_avos = ( + pynutil.delete('denominator: "') + + pynini.closure(NEMO_NOT_QUOTE) + + pynutil.delete('" morphosyntactic_features: "avos"') + ) + + fraction_ordinal_singular = numerator_one + insert_space + denom_ordinal + fraction_ordinal_plural = numerator_rest + insert_space + denom_ordinal + pynutil.insert(plural_suffix) + fraction_ordinal = pynini.union(fraction_ordinal_singular, fraction_ordinal_plural) + + if avos_between: + avos_mid = insert_space + pynutil.insert(avos_between) + insert_space + else: + avos_mid = insert_space + + fraction_avos = ( + pynini.union(numerator_one, numerator_rest) + + avos_mid + + denom_avos + + insert_space + + pynutil.insert(avos_word) + ) + + fraction = pynini.union(fraction_ordinal, fraction_avos) + mixed_um_meio = integer + connector + pynutil.delete('numerator: "' + numerator_one_val + '" " ') + denom_meio + optional_integer = pynini.closure(integer + connector + insert_space, 0, 1) + graph = optional_sign + pynini.union( + pynutil.add_weight(mixed_um_meio, -0.01), + optional_integer + fraction, + ) + + self.inner_graph = graph.optimize() + self.fst = self.delete_tokens(graph).optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/pt/verbalizers/measure.py b/zonos3/vendor/nemo_text_processing/text_normalization/pt/verbalizers/measure.py new file mode 100644 index 0000000000000000000000000000000000000000..b866297e90784c41a188ed89a4d2b7315f97cd75 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/pt/verbalizers/measure.py @@ -0,0 +1,98 @@ +# Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.pt.graph_utils import ( + NEMO_NOT_QUOTE, + NEMO_WHITE_SPACE, + GraphFst, + delete_preserve_order, + delete_space, +) + + +class MeasureFst(GraphFst): + """ + Finite state transducer for verbalizing measure (pt-BR), e.g. + measure { cardinal { integer: "duzentos" } units: "gramas" } -> duzentos gramas + measure { cardinal { integer: "um" } units: "hora" } -> uma hora + + Args: + decimal: DecimalFst verbalizer + cardinal: CardinalFst verbalizer + fraction: FractionFst verbalizer + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, decimal: GraphFst, cardinal: GraphFst, fraction: GraphFst, deterministic: bool = True): + super().__init__(name="measure", kind="verbalize", deterministic=deterministic) + + hours_unit = ( + pynutil.delete('units: "') + + pynini.union(pynini.accep("hora"), pynini.accep("horas")) + + pynutil.delete('"') + ) + non_hours_unit = ( + pynutil.delete('units: "') + + pynini.difference(pynini.closure(NEMO_NOT_QUOTE, 1), pynini.union("hora", "horas")) + + pynutil.delete('"') + ) + + graph_cardinal = ( + pynutil.delete("cardinal {") + + delete_space + + cardinal.graph_fem + + delete_space + + pynutil.delete("}") + + NEMO_WHITE_SPACE + + hours_unit + ) + graph_cardinal |= ( + pynutil.delete("cardinal {") + + delete_space + + cardinal.graph_masc + + delete_space + + pynutil.delete("}") + + NEMO_WHITE_SPACE + + non_hours_unit + ) + + graph_decimal = ( + pynutil.delete("decimal {") + + delete_space + + decimal.numbers + + delete_space + + pynutil.delete("}") + + NEMO_WHITE_SPACE + + (hours_unit | non_hours_unit) + ) + + graph_fraction = ( + pynutil.delete("fraction {") + + delete_space + + fraction.inner_graph + + delete_space + + pynutil.delete("}") + + NEMO_WHITE_SPACE + + (hours_unit | non_hours_unit) + ) + + graph = graph_cardinal | graph_decimal | graph_fraction + graph += delete_preserve_order + + delete_tokens = self.delete_tokens(graph) + self.fst = delete_tokens.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/pt/verbalizers/money.py b/zonos3/vendor/nemo_text_processing/text_normalization/pt/verbalizers/money.py new file mode 100644 index 0000000000000000000000000000000000000000..0dbc6fb5ca0ff0efef68f8abb8dcc09b8b246355 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/pt/verbalizers/money.py @@ -0,0 +1,96 @@ +# Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the "License". +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.pt.graph_utils import ( + NEMO_NOT_QUOTE, + NEMO_SIGMA, + NEMO_SPACE, + GraphFst, + delete_preserve_order, + insert_space, +) +from zonos3.vendor.nemo_text_processing.text_normalization.pt.utils import get_abs_path, load_labels + + +class MoneyFst(GraphFst): + """ + Finite state transducer for verbalizing money (pt-BR), e.g. + money { currency_maj: "reais" integer_part: "doze" } -> doze reais + money { ... fractional_part: "cinco" currency_min: "centavos" ... } -> doze reais e cinco centavos + + Args: + decimal: DecimalFst verbalizer (for decimal amounts embedded in money) + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, decimal: GraphFst, deterministic: bool = True): + super().__init__(name="money", kind="verbalize", deterministic=deterministic) + + scales_data = load_labels(get_abs_path("data/numbers/scales.tsv")) + currency_plural_data = load_labels(get_abs_path("data/money/currency_major_plural.tsv")) + + scale_words = [] + for row in scales_data[1:]: + if len(row) < 2: + continue + one_label = row[0].strip() + plural = row[1].strip() + if not one_label or not plural: + continue + scale_words.extend((one_label.split()[-1], plural)) + + curr_words = [row[1].strip() for row in currency_plural_data if len(row) >= 2 and row[1].strip()] + + scales = pynini.union(*[pynini.accep(w) + NEMO_SPACE for w in scale_words]).optimize() + currencies = pynini.union(*curr_words).optimize() + + maj = pynutil.delete('currency_maj: "') + pynini.closure(NEMO_NOT_QUOTE, 1) + pynutil.delete('"') + min_unit = pynutil.delete('currency_min: "') + pynini.closure(NEMO_NOT_QUOTE, 1) + pynutil.delete('"') + + fractional_part = ( + pynutil.delete('fractional_part: "') + pynini.closure(NEMO_NOT_QUOTE, 1) + pynutil.delete('"') + ) + integer_part = pynutil.delete('integer_part: "') + pynini.closure(NEMO_NOT_QUOTE, 1) + pynutil.delete('"') + + connector_minor = pynutil.insert("e") + insert_space + if not deterministic: + connector_minor |= pynutil.insert("com") + insert_space + + graph_integer = integer_part + NEMO_SPACE + maj + + graph_integer_with_minor = ( + integer_part + + NEMO_SPACE + + maj + + NEMO_SPACE + + connector_minor + + fractional_part + + NEMO_SPACE + + min_unit + + delete_preserve_order + ) + + graph_decimal = decimal.numbers + NEMO_SPACE + maj + + graph_minor = fractional_part + NEMO_SPACE + min_unit + delete_preserve_order + + graph = graph_integer | graph_integer_with_minor | graph_decimal | graph_minor + graph @= pynini.cdrewrite(pynutil.insert("de") + insert_space, scales, currencies, NEMO_SIGMA) + + delete_tokens = self.delete_tokens(graph) + self.fst = delete_tokens.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/pt/verbalizers/ordinal.py b/zonos3/vendor/nemo_text_processing/text_normalization/pt/verbalizers/ordinal.py new file mode 100644 index 0000000000000000000000000000000000000000..2729b4bf1a0d7c99138bdf171defef79c959202a --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/pt/verbalizers/ordinal.py @@ -0,0 +1,47 @@ +# Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use it except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.pt.graph_utils import NEMO_NOT_QUOTE, NEMO_SIGMA, NEMO_SPACE, GraphFst +from zonos3.vendor.nemo_text_processing.text_normalization.pt.utils import get_abs_path + + +class OrdinalFst(GraphFst): + """ + Finite state transducer for verbalizing Portuguese ordinals, e.g. + ordinal { integer: "primeiro" morphosyntactic_features: "gender_masc" } -> primeiro + ordinal { integer: "primeira" morphosyntactic_features: "gender_fem" } -> primeira (feminine rewrite applied) + + Args: + deterministic: if True will provide a single transduction option, + for False multiple options (used for audio-based normalization) + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="ordinal", kind="verbalize", deterministic=deterministic) + integer = pynutil.delete('integer: "') + pynini.closure(NEMO_NOT_QUOTE, 1) + pynutil.delete('"') + + fem_rewrite = pynini.string_file(get_abs_path("data/ordinals/feminine.tsv")) + feminine_rewrite = pynini.cdrewrite( + fem_rewrite, + "", + pynini.union(NEMO_SPACE, pynini.accep("[EOS]")), + NEMO_SIGMA, + ) + + graph_masc = integer + pynutil.delete(' morphosyntactic_features: "gender_masc"') + graph_fem = (integer @ feminine_rewrite) + pynutil.delete(' morphosyntactic_features: "gender_fem"') + self.fst = self.delete_tokens(pynini.union(graph_masc, graph_fem)).optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/pt/verbalizers/telephone.py b/zonos3/vendor/nemo_text_processing/text_normalization/pt/verbalizers/telephone.py new file mode 100644 index 0000000000000000000000000000000000000000..ba4535796ece56ed2b6190efd468cabbf68642f1 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/pt/verbalizers/telephone.py @@ -0,0 +1,57 @@ +# Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.pt.graph_utils import NEMO_NOT_QUOTE, GraphFst, delete_space, insert_space + + +class TelephoneFst(GraphFst): + """ + Finite state transducer for verbalizing telephone. + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="telephone", kind="verbalize", deterministic=deterministic) + + optional_country_code = pynini.closure( + pynutil.delete('country_code: "') + + pynini.closure(NEMO_NOT_QUOTE, 1) + + pynutil.delete('"') + + delete_space + + insert_space, + 0, + 1, + ) + + number_part = ( + pynutil.delete('number_part: "') + + pynini.closure(NEMO_NOT_QUOTE, 1) + + pynini.closure(pynutil.add_weight(pynutil.delete(" "), -0.0001), 0, 1) + + pynutil.delete('"') + ) + + optional_extension = pynini.closure( + delete_space + + insert_space + + pynutil.delete('extension: "') + + pynini.closure(NEMO_NOT_QUOTE, 1) + + pynutil.delete('"'), + 0, + 1, + ) + + graph = optional_country_code + number_part + optional_extension + self.fst = self.delete_tokens(graph).optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/pt/verbalizers/time.py b/zonos3/vendor/nemo_text_processing/text_normalization/pt/verbalizers/time.py new file mode 100644 index 0000000000000000000000000000000000000000..9a10dbec221c9b83f70c126847724c1955885fbd --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/pt/verbalizers/time.py @@ -0,0 +1,125 @@ +# Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.pt.graph_utils import ( + NEMO_NOT_QUOTE, + GraphFst, + delete_preserve_order, + delete_space, + insert_space, +) + + +class TimeFst(GraphFst): + """ + Finite state transducer for verbalizing Portuguese time, e.g. + time { hours: "catorze" minutes: "trinta" preserve_order: true } -> catorze horas e trinta + time { hours: "um" minutes: "trinta" preserve_order: true } -> uma hora e trinta + time { hours: "dois" minutes: "quinze" preserve_order: true } -> duas horas e quinze + time { hours: "onze" suffix: "da manhã" preserve_order: true } -> onze horas da manhã + time { hours: "vinte e um" minutes: "dezoito" suffix: "da tarde" preserve_order: true } + -> vinte e uma horas e dezoito da tarde + + Args: + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="time", kind="verbalize", deterministic=deterministic) + + quoted = pynini.closure(NEMO_NOT_QUOTE, 1) + + minutes_val = pynutil.delete('minutes: "') + quoted + pynutil.delete('"') + seconds_val = pynutil.delete('seconds: "') + quoted + pynutil.delete('"') + suffix_val = pynutil.delete('suffix: "') + quoted + pynutil.delete('"') + + gap = delete_space + insert_space + suffix_out = pynini.closure(gap + suffix_val, 0, 1) + + hours_default = pynutil.delete('hours: "') + quoted + pynutil.delete('"') + gap + pynutil.insert("horas") + # Match whitespace after the closing quote (same as hours_default's gap) so the path composes + # with minutes/suffix fields; otherwise only the generic "… horas" branch accepts the token. + hours_um = ( + pynutil.delete('hours: "') + + pynutil.delete("um") + + pynutil.delete('"') + + delete_space + + pynutil.insert("uma hora") + ) + hours_dois = ( + pynutil.delete('hours: "') + + pynutil.delete("dois") + + pynutil.delete('"') + + delete_space + + pynutil.insert("duas horas") + ) + hours_vinte_um = ( + pynutil.delete('hours: "') + + pynutil.delete("vinte e um") + + pynutil.delete('"') + + delete_space + + pynutil.insert("vinte e uma horas") + ) + hours_vinte_dois = ( + pynutil.delete('hours: "') + + pynutil.delete("vinte e dois") + + pynutil.delete('"') + + delete_space + + pynutil.insert("vinte e duas horas") + ) + # Prefer feminine hour phrases over the generic ``… horas`` path (tie-break by weight). + hour_phrase = ( + pynutil.add_weight(hours_um, -0.01) + | pynutil.add_weight(hours_dois, -0.01) + | pynutil.add_weight(hours_vinte_um, -0.01) + | pynutil.add_weight(hours_vinte_dois, -0.01) + | hours_default + ).optimize() + + graph_hms = ( + hour_phrase + + insert_space + + pynutil.insert("e") + + insert_space + + minutes_val + + gap + + pynutil.insert("minutos") + + insert_space + + pynutil.insert("e") + + insert_space + + seconds_val + + gap + + pynutil.insert("segundos") + + suffix_out + + delete_preserve_order + ) + + with_minutes = ( + hour_phrase + + insert_space + + pynutil.insert("e") + + insert_space + + minutes_val + + suffix_out + + delete_preserve_order + ) + + hours_only = hour_phrase + suffix_out + delete_preserve_order + + graph = pynini.union(graph_hms, with_minutes, hours_only).optimize() + self.fst = self.delete_tokens(graph).optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/pt/verbalizers/verbalize.py b/zonos3/vendor/nemo_text_processing/text_normalization/pt/verbalizers/verbalize.py new file mode 100644 index 0000000000000000000000000000000000000000..2895b6cabd86f3cbb772d0cbe726f00c864438aa --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/pt/verbalizers/verbalize.py @@ -0,0 +1,66 @@ +# Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use it except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from zonos3.vendor.nemo_text_processing.text_normalization.pt.graph_utils import GraphFst +from zonos3.vendor.nemo_text_processing.text_normalization.pt.verbalizers.cardinal import CardinalFst +from zonos3.vendor.nemo_text_processing.text_normalization.pt.verbalizers.date import DateFst +from zonos3.vendor.nemo_text_processing.text_normalization.pt.verbalizers.decimal import DecimalFst +from zonos3.vendor.nemo_text_processing.text_normalization.pt.verbalizers.electronic import ElectronicFst +from zonos3.vendor.nemo_text_processing.text_normalization.pt.verbalizers.fraction import FractionFst +from zonos3.vendor.nemo_text_processing.text_normalization.pt.verbalizers.measure import MeasureFst +from zonos3.vendor.nemo_text_processing.text_normalization.pt.verbalizers.money import MoneyFst +from zonos3.vendor.nemo_text_processing.text_normalization.pt.verbalizers.ordinal import OrdinalFst +from zonos3.vendor.nemo_text_processing.text_normalization.pt.verbalizers.telephone import TelephoneFst +from zonos3.vendor.nemo_text_processing.text_normalization.pt.verbalizers.time import TimeFst + + +class VerbalizeFst(GraphFst): + """ + Composes Portuguese verbalizer grammars (cardinal, ordinal, fraction, decimal). + For deployment, this grammar will be compiled and exported to OpenFst Finite State Archive (FAR) File. + More details to deployment at NeMo/tools/text_processing_deployment. + + Args: + deterministic: if True will provide a single transduction option, + for False multiple options (used for audio-based normalization) + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="verbalize", kind="verbalize", deterministic=deterministic) + + cardinal = CardinalFst(deterministic=deterministic) + ordinal = OrdinalFst(deterministic=deterministic) + fraction = FractionFst(deterministic=deterministic) + decimal = DecimalFst(deterministic=deterministic) + measure = MeasureFst(decimal=decimal, cardinal=cardinal, fraction=fraction, deterministic=deterministic) + money = MoneyFst(decimal=decimal, deterministic=deterministic) + date = DateFst(deterministic=deterministic) + time = TimeFst(deterministic=deterministic) + telephone = TelephoneFst(deterministic=deterministic) + electronic = ElectronicFst(deterministic=deterministic) + graph = ( + fraction.fst + | decimal.fst + | date.fst + | time.fst + | measure.fst + | money.fst + | ordinal.fst + | cardinal.fst + | telephone.fst + | electronic.fst + ) + + self.fst = graph diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/pt/verbalizers/verbalize_final.py b/zonos3/vendor/nemo_text_processing/text_normalization/pt/verbalizers/verbalize_final.py new file mode 100644 index 0000000000000000000000000000000000000000..8b92f8da06625a77559374e2929110f857a850be --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/pt/verbalizers/verbalize_final.py @@ -0,0 +1,71 @@ +# Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use it except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import os + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.pt.graph_utils import ( + GraphFst, + delete_extra_space, + delete_space, + generator_main, +) +from zonos3.vendor.nemo_text_processing.text_normalization.pt.verbalizers.verbalize import VerbalizeFst +from zonos3.vendor.nemo_text_processing.text_normalization.pt.verbalizers.word import WordFst +from zonos3.vendor.nemo_text_processing.utils.logging import logger + + +class VerbalizeFinalFst(GraphFst): + """ + Finite state transducer that verbalizes an entire Portuguese sentence, e.g. + tokens { cardinal { integer: "dois" } } tokens { name: "e" } tokens { cardinal { integer: "três" } } -> dois e três + + Args: + deterministic: if True will provide a single transduction option, + for False multiple options (used for audio-based normalization) + cache_dir: path to a dir with .far grammar file. Set to None to avoid using cache. + overwrite_cache: set to True to overwrite .far files + """ + + def __init__(self, deterministic: bool = True, cache_dir: str = None, overwrite_cache: bool = False): + super().__init__(name="verbalize_final", kind="verbalize", deterministic=deterministic) + + far_file = None + if cache_dir is not None and cache_dir != "None": + os.makedirs(cache_dir, exist_ok=True) + far_file = os.path.join(cache_dir, f"pt_tn_{deterministic}_deterministic_verbalizer.far") + if not overwrite_cache and far_file and os.path.exists(far_file): + self.fst = pynini.Far(far_file, mode="r")["verbalize"] + logger.info(f'VerbalizeFinalFst graph was restored from {far_file}.') + else: + + verbalize = VerbalizeFst(deterministic=deterministic).fst + word = WordFst(deterministic=deterministic).fst + types = verbalize | word + graph = ( + pynutil.delete("tokens") + + delete_space + + pynutil.delete("{") + + delete_space + + types + + delete_space + + pynutil.delete("}") + ) + graph = delete_space + pynini.closure(graph + delete_extra_space) + graph + delete_space + + self.fst = graph.optimize() + if far_file: + generator_main(far_file, {"verbalize": self.fst}) diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/pt/verbalizers/word.py b/zonos3/vendor/nemo_text_processing/text_normalization/pt/verbalizers/word.py new file mode 100644 index 0000000000000000000000000000000000000000..56577aeb30eee33a74e504495859f4585bd858e9 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/pt/verbalizers/word.py @@ -0,0 +1,32 @@ +# Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.pt.graph_utils import NEMO_CHAR, NEMO_SIGMA, GraphFst, delete_space + + +class WordFst(GraphFst): + """ + Verbalizes tokens { name: "..." } for the pt-BR pipeline. + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="word", kind="verbalize", deterministic=deterministic) + chars = pynini.closure(NEMO_CHAR - " ", 1) + char = pynutil.delete("name:") + delete_space + pynutil.delete("\"") + chars + pynutil.delete("\"") + graph = char @ pynini.cdrewrite(pynini.cross("\u00a0", " "), "", "", NEMO_SIGMA) + + self.fst = graph.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/token_parser.py b/zonos3/vendor/nemo_text_processing/text_normalization/token_parser.py new file mode 100644 index 0000000000000000000000000000000000000000..4adcd7d7f048d53288317b97b9cdede908403346 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/token_parser.py @@ -0,0 +1,193 @@ +# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import string +from collections import OrderedDict +from typing import Dict, List, Union + +PRESERVE_ORDER_KEY = "preserve_order" +EOS = "" + + +class TokenParser: + """ + Parses tokenized/classified text, e.g. 'tokens { money { integer: "20" currency: "$" } } tokens { name: "left"}' + + Args + text: tokenized text + """ + + def __call__(self, text): + """ + Setup function + + Args: + text: text to be parsed + + """ + self.text = text + self.len_text = len(text) + self.char = text[0] # cannot handle empty string + self.index = 0 + + def parse(self) -> List[dict]: + """ + Main function. Implements grammar: + A -> space F space F space F ... space + + Returns list of dictionaries + """ + l = list() + while self.parse_ws(): + token = self.parse_token() + if not token: + break + l.append(token) + return l + + def parse_token(self) -> Dict[str, Union[str, dict]]: + """ + Implements grammar: + F-> no_space KG no_space + + Returns: K, G as dictionary values + """ + d = OrderedDict() + key = self.parse_string_key() + if key is None: + return None + self.parse_ws() + if key == PRESERVE_ORDER_KEY: + self.parse_char(":") + self.parse_ws() + value = self.parse_chars("true") + else: + value = self.parse_token_value() + + d[key] = value + return d + + def parse_token_value(self) -> Union[str, dict]: + """ + Implements grammar: + G-> no_space :"VALUE" no_space | no_space {A} no_space + + Returns: string or dictionary + """ + if self.char == ":": + self.parse_char(":") + self.parse_ws() + self.parse_char("\"") + value_string = self.parse_string_value() + self.parse_char("\"") + return value_string + elif self.char == "{": + d = OrderedDict() + self.parse_char("{") + list_token_dicts = self.parse() + # flatten tokens + for tok_dict in list_token_dicts: + for k, v in tok_dict.items(): + d[k] = v + self.parse_char("}") + return d + else: + raise ValueError() + + def parse_char(self, exp) -> bool: + """ + Parses character + + Args: + exp: character to read in + + Returns true if successful + """ + assert self.char == exp + self.read() + return True + + def parse_chars(self, exp) -> bool: + """ + Parses characters + + Args: + exp: characters to read in + + Returns true if successful + """ + ok = False + for x in exp: + ok |= self.parse_char(x) + return ok + + def parse_string_key(self) -> str: + """ + Parses string key, can only contain ascii and '_' characters + + Returns parsed string key + """ + assert self.char not in string.whitespace and self.char != EOS + incl_criterium = string.ascii_letters + "_" + l = [] + while self.char in incl_criterium: + l.append(self.char) + if not self.read(): + raise ValueError() + + if not l: + return None + return "".join(l) + + def parse_string_value(self) -> str: + """ + Parses string value, ends with quote followed by space + + Returns parsed string value + """ + # assert self.char not in string.whitespace and self.char != EOS + assert self.char != EOS + l = [] + while self.char != "\"" or self.text[self.index + 1] != " ": + l.append(self.char) + if not self.read(): + raise ValueError() + + if not l: + return None + return "".join(l) + + def parse_ws(self): + """ + Deletes whitespaces. + + Returns true if not EOS after parsing + """ + not_eos = self.char != EOS + while not_eos and self.char == " ": + not_eos = self.read() + return not_eos + + def read(self): + """ + Reads in next char. + + Returns true if not EOS + """ + if self.index < self.len_text - 1: # should be unique + self.index += 1 + self.char = self.text[self.index] + return True + self.char = EOS + return False diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/zh/README.md b/zonos3/vendor/nemo_text_processing/text_normalization/zh/README.md new file mode 100644 index 0000000000000000000000000000000000000000..0eedd574d8394a674e0ae62f4d0a2ff6ae2add92 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/zh/README.md @@ -0,0 +1,138 @@ +# Chinese Text Normalization + +## 1. How To Use +``` +python normalize.py --language "zh" --text "text to be normalized" +``` + +## 2. TN Pipeline +There are 3 components in TN pipeline: +* pre-processing (before tagger) +* non-standard word normalization +* post-processing (after verbalizer) + +### 2.1 Pre-Processing +#### Char Width Conversion (全角 -> 半角) +``` +苹果CEO宣布发布新IPHONE -> 苹果CEO宣布发布新IPHONE +他说:“我们已经吃过了!”。 -> 他说:"我们已经吃过了!". +``` +* covers English letters, digits, punctuations and some symbols +* the complete mapping table `data/char/fullwidth_to_halfwidth.tsv` + +#### Denylist (Removal) +Sometime you may want to remove certain things like interjections/fillers "啊", "呃" etc +``` +呃这个呃啊我不知道 -> 这个我不知道 +``` +* customizable via `data/denylist/denylist.tsv` + + +### 2.2 Non-Standard-Words(NSW) normalization +#### Numbers +``` +共465篇,约315万字 -> 共四百六十五篇,约三百一十五万字 +共计6.42万人 -> 共计六点四二万人 +同比升高0.6个百分点 -> 同比升高零点六个百分点 +``` + +#### Fraction +``` +总量的1/5以上 -> 总量的五分之一以上 +相当于头发丝的1/16 -> 相当于头发丝的十六分之一 +3/2是一个假分数 -> 二分之三是一个假分数 +``` + +#### Percentage +``` +同比增长6.3% -> 同比增长百分之六点三 +增幅0.4% -> 增幅百分之零点四 +``` + +#### Date +``` +2002/01/28 -> 二零零二年一月二十八日 +2002-01-28 -> 二零零二年一月二十八日 +2002.01.28 -> 二零零二年一月二十八日 +2002/01 -> 二零零二年一月 +``` + +#### Time +``` +8月16号12:00之前 -> 八月十六号十二点之前 +我是5:02开始的 -> 我是五点零二分开始的 +于5:35:36发射 -> 于五点三十五分三十六秒发射 +8:00am准时开会 -> 上午八点准时开会 +``` + +#### Math +``` +比分定格在78:96 -> 比分定格在七十八比九十六 +计算-2的绝对值是2 -> 计算负二的绝对值是二 +±2的平方都是4 -> 正负二的平方都是四 +``` + +#### Money +``` +价格是¥13.5 -> 价格是十三点五元 +价格是$13.5 -> 价格是十三点五美元 +价格是A$13.5 -> 价格是十三点五澳元 +价格是HKD13.5 -> 价格是十三点五港元 +``` + +#### Measure +``` +重达25kg -> 二十五千克 +最高气温38°C -> 最高气温三十八摄氏度 +实际面积120m² -> 实际面积一百二十平方米 +渲染速度10ms一帧 -> 渲染速度十毫秒一帧 +``` + +#### Number series (phone, mobile numbers) +``` +可以打我手机13501234567 -> 可以打我手机一三五零一二三四五六七 +可以拨打12306来咨询 -> 可以拨打一二三零六来咨询 +``` + +#### Erhua(儿化音) Removal +``` +这儿有只鸟儿 -> 这有只鸟 +这事儿好办 -> 这事好办 +我儿子喜欢这地儿 -> 我儿子喜欢这地 +``` +* erhua whitelist is customizable via `data/erhua/whitelist.tsv` + +#### Whitelist(Replacement) +a set of user-defined hard mapping, i.e. exact-string matching & replacement +``` +C E O -> CEO +G P U -> GPU +O2O -> O to O +B2B -> B to B +``` +* customizable via `data/whitelist/default.tsv` + +### 2.3 Post-Processing +#### Punctuation Removal +If enabled, punctuations are removed. + +#### Uppercase or Lowercase Conversion +If enabled, English letters are converted to uppercases / lowercases + +#### Out-Of-Vocabulary(OOV) Tagger +If enabled, OOV chars are tagged with `` and ``, e.g.: +``` +我们안녕 -> 我们안녕 +雪の花 -> 雪の花 +``` +* default charset (national standard) [通用规范汉字表](https://zh.wikipedia.org/wiki/通用规范汉字表) +* you can extend charset via `data/char/charset_extension.tsv` + +## 3. Credits +Author: Zhenxiang MA @ Tsinghua University + +Advisors: [SpeechColab](https://github.com/SpeechColab) organization + +The authors of this work would like to thank: +* The authors of foundational libraries like OpenFst & Pynini +* NeMo team and NeMo open-source community diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/zh/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/zh/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..a1cf281f0908d225f51d921e9ddbdf92f9b14d99 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/zh/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..6ebc808fad7ac87484dbabf02dacacdd7f826c14 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/char/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/char/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..a1cf281f0908d225f51d921e9ddbdf92f9b14d99 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/char/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/char/charset_extension.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/char/charset_extension.tsv new file mode 100644 index 0000000000000000000000000000000000000000..de3ac0a83e7682f70f0a3badef354cf9347919c4 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/char/charset_extension.tsv @@ -0,0 +1,6 @@ +吶 +诶 +屌 +囧 +飚 +屄 diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/char/charset_national_standard_2013_8105.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/char/charset_national_standard_2013_8105.tsv new file mode 100644 index 0000000000000000000000000000000000000000..06b46c630588cb8f7aba060755e65b612cfb4fde --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/char/charset_national_standard_2013_8105.tsv @@ -0,0 +1,8105 @@ +一 +丁 +七 +万 +丈 +三 +上 +下 +不 +与 +丏 +丐 +丑 +专 +且 +丕 +世 +丘 +丙 +业 +丛 +东 +丝 +丞 +丢 +两 +严 +丧 +个 +丫 +中 +丰 +串 +临 +丸 +丹 +为 +主 +丽 +举 +乂 +乃 +久 +么 +义 +之 +乌 +乍 +乎 +乏 +乐 +乒 +乓 +乔 +乖 +乘 +乙 +乜 +九 +乞 +也 +习 +乡 +书 +乩 +买 +乱 +乳 +乸 +乾 +了 +予 +争 +事 +二 +亍 +于 +亏 +云 +互 +亓 +五 +井 +亘 +亚 +些 +亟 +亡 +亢 +交 +亥 +亦 +产 +亨 +亩 +享 +京 +亭 +亮 +亲 +亳 +亵 +亶 +亸 +亹 +人 +亿 +什 +仁 +仂 +仃 +仄 +仅 +仆 +仇 +仉 +今 +介 +仍 +从 +仑 +仓 +仔 +仕 +他 +仗 +付 +仙 +仝 +仞 +仟 +仡 +代 +令 +以 +仨 +仪 +仫 +们 +仰 +仲 +仳 +仵 +件 +价 +任 +份 +仿 +企 +伈 +伉 +伊 +伋 +伍 +伎 +伏 +伐 +休 +众 +优 +伙 +会 +伛 +伞 +伟 +传 +伢 +伣 +伤 +伥 +伦 +伧 +伪 +伫 +伭 +伯 +估 +伲 +伴 +伶 +伸 +伺 +似 +伽 +伾 +佁 +佃 +但 +位 +低 +住 +佐 +佑 +体 +何 +佖 +佗 +佘 +余 +佚 +佛 +作 +佝 +佞 +佟 +你 +佣 +佤 +佥 +佩 +佬 +佯 +佰 +佳 +佴 +佶 +佸 +佺 +佻 +佼 +佽 +佾 +使 +侁 +侂 +侃 +侄 +侈 +侉 +例 +侍 +侏 +侑 +侔 +侗 +侘 +供 +依 +侠 +侣 +侥 +侦 +侧 +侨 +侩 +侪 +侬 +侮 +侯 +侴 +侵 +侹 +便 +促 +俄 +俅 +俊 +俍 +俎 +俏 +俐 +俑 +俗 +俘 +俙 +俚 +俜 +保 +俞 +俟 +信 +俣 +俦 +俨 +俩 +俪 +俫 +俭 +修 +俯 +俱 +俳 +俵 +俶 +俸 +俺 +俾 +倌 +倍 +倏 +倒 +倓 +倔 +倕 +倘 +候 +倚 +倜 +倞 +借 +倡 +倥 +倦 +倧 +倨 +倩 +倪 +倬 +倭 +倮 +倴 +债 +倻 +值 +倾 +偁 +偃 +假 +偈 +偌 +偎 +偏 +偓 +偕 +做 +停 +偡 +健 +偬 +偭 +偰 +偲 +偶 +偷 +偻 +偾 +偿 +傀 +傃 +傅 +傈 +傉 +傍 +傒 +傕 +傣 +傥 +傧 +储 +傩 +催 +傲 +傺 +傻 +僇 +僎 +像 +僔 +僖 +僚 +僦 +僧 +僬 +僭 +僮 +僰 +僳 +僵 +僻 +儆 +儇 +儋 +儒 +儡 +儦 +儳 +儴 +儿 +兀 +允 +元 +兄 +充 +兆 +先 +光 +克 +免 +兑 +兔 +兕 +兖 +党 +兜 +兢 +入 +全 +八 +公 +六 +兮 +兰 +共 +关 +兴 +兵 +其 +具 +典 +兹 +养 +兼 +兽 +冀 +冁 +内 +冈 +冉 +册 +再 +冏 +冒 +冔 +冕 +冗 +写 +军 +农 +冠 +冢 +冤 +冥 +冬 +冮 +冯 +冰 +冱 +冲 +决 +况 +冶 +冷 +冻 +冼 +冽 +净 +凄 +准 +凇 +凉 +凋 +凌 +减 +凑 +凓 +凘 +凛 +凝 +几 +凡 +凤 +凫 +凭 +凯 +凰 +凳 +凶 +凸 +凹 +出 +击 +凼 +函 +凿 +刀 +刁 +刃 +分 +切 +刈 +刊 +刍 +刎 +刑 +划 +刖 +列 +刘 +则 +刚 +创 +初 +删 +判 +刨 +利 +别 +刬 +刭 +刮 +到 +刳 +制 +刷 +券 +刹 +刺 +刻 +刽 +刿 +剀 +剁 +剂 +剃 +剅 +削 +剋 +剌 +前 +剐 +剑 +剔 +剕 +剖 +剜 +剞 +剟 +剡 +剥 +剧 +剩 +剪 +副 +割 +剽 +剿 +劁 +劂 +劄 +劈 +劐 +劓 +力 +劝 +办 +功 +加 +务 +劢 +劣 +动 +助 +努 +劫 +劬 +劭 +励 +劲 +劳 +劼 +劾 +势 +勃 +勇 +勉 +勋 +勍 +勐 +勒 +勔 +勖 +勘 +勚 +募 +勠 +勤 +勰 +勺 +勾 +勿 +匀 +包 +匆 +匈 +匍 +匏 +匐 +匕 +化 +北 +匙 +匜 +匝 +匠 +匡 +匣 +匦 +匪 +匮 +匹 +区 +医 +匼 +匾 +匿 +十 +千 +卅 +升 +午 +卉 +半 +华 +协 +卑 +卒 +卓 +单 +卖 +南 +博 +卜 +卞 +卟 +占 +卡 +卢 +卣 +卤 +卦 +卧 +卫 +卬 +卮 +卯 +印 +危 +即 +却 +卵 +卷 +卸 +卺 +卿 +厂 +厄 +厅 +历 +厉 +压 +厌 +厍 +厕 +厖 +厘 +厚 +厝 +原 +厢 +厣 +厥 +厦 +厨 +厩 +厮 +去 +厾 +县 +叁 +参 +叆 +叇 +又 +叉 +及 +友 +双 +反 +发 +叔 +叕 +取 +受 +变 +叙 +叚 +叛 +叟 +叠 +口 +古 +句 +另 +叨 +叩 +只 +叫 +召 +叭 +叮 +可 +台 +叱 +史 +右 +叵 +叶 +号 +司 +叹 +叻 +叼 +叽 +吁 +吃 +各 +吆 +合 +吉 +吊 +同 +名 +后 +吏 +吐 +向 +吒 +吓 +吕 +吖 +吗 +君 +吝 +吞 +吟 +吠 +吡 +吣 +否 +吧 +吨 +吩 +含 +听 +吭 +吮 +启 +吱 +吲 +吴 +吵 +吸 +吹 +吻 +吼 +吽 +吾 +呀 +呃 +呆 +呇 +呈 +告 +呋 +呐 +呒 +呓 +呔 +呕 +呖 +呗 +员 +呙 +呛 +呜 +呢 +呣 +呤 +呦 +周 +呱 +呲 +味 +呵 +呶 +呷 +呸 +呻 +呼 +命 +咀 +咂 +咄 +咆 +咇 +咉 +咋 +和 +咍 +咎 +咏 +咐 +咒 +咔 +咕 +咖 +咙 +咚 +咛 +咝 +咡 +咣 +咤 +咥 +咦 +咧 +咨 +咩 +咪 +咫 +咬 +咯 +咱 +咳 +咴 +咸 +咺 +咻 +咽 +咿 +哀 +品 +哂 +哃 +哄 +哆 +哇 +哈 +哉 +哌 +响 +哎 +哏 +哐 +哑 +哒 +哓 +哔 +哕 +哗 +哙 +哚 +哝 +哞 +哟 +哢 +哥 +哦 +哧 +哨 +哩 +哪 +哭 +哮 +哱 +哲 +哳 +哺 +哼 +哽 +哿 +唁 +唆 +唇 +唉 +唏 +唐 +唑 +唔 +唛 +唝 +唠 +唢 +唣 +唤 +唧 +唪 +唬 +售 +唯 +唰 +唱 +唳 +唵 +唷 +唼 +唾 +唿 +啁 +啃 +啄 +商 +啉 +啊 +啐 +啕 +啖 +啜 +啡 +啤 +啥 +啦 +啧 +啪 +啫 +啬 +啭 +啮 +啰 +啴 +啵 +啶 +啷 +啸 +啻 +啼 +啾 +喀 +喁 +喂 +喃 +善 +喆 +喇 +喈 +喉 +喊 +喋 +喏 +喑 +喔 +喘 +喙 +喜 +喝 +喟 +喤 +喧 +喱 +喳 +喵 +喷 +喹 +喻 +喽 +喾 +嗄 +嗅 +嗉 +嗌 +嗍 +嗐 +嗑 +嗒 +嗓 +嗔 +嗖 +嗜 +嗝 +嗞 +嗟 +嗡 +嗣 +嗤 +嗥 +嗦 +嗨 +嗪 +嗫 +嗬 +嗯 +嗲 +嗳 +嗵 +嗷 +嗽 +嗾 +嘀 +嘁 +嘈 +嘉 +嘌 +嘎 +嘏 +嘘 +嘚 +嘛 +嘞 +嘟 +嘡 +嘣 +嘤 +嘧 +嘬 +嘭 +嘱 +嘲 +嘴 +嘶 +嘹 +嘻 +嘿 +噀 +噂 +噇 +噌 +噍 +噎 +噔 +噗 +噘 +噙 +噜 +噢 +噤 +器 +噩 +噪 +噫 +噬 +噱 +噶 +噻 +噼 +嚄 +嚅 +嚆 +嚎 +嚏 +嚓 +嚚 +嚣 +嚭 +嚯 +嚷 +嚼 +囊 +囔 +囚 +四 +回 +囟 +因 +囡 +团 +囤 +囫 +园 +困 +囱 +围 +囵 +囷 +囹 +固 +国 +图 +囿 +圃 +圄 +圆 +圈 +圉 +圊 +圌 +圐 +圙 +圜 +土 +圢 +圣 +在 +圩 +圪 +圫 +圬 +圭 +圮 +圯 +地 +圲 +圳 +圹 +场 +圻 +圾 +址 +坂 +均 +坉 +坊 +坋 +坌 +坍 +坎 +坏 +坐 +坑 +坒 +块 +坚 +坛 +坜 +坝 +坞 +坟 +坠 +坡 +坤 +坥 +坦 +坨 +坩 +坪 +坫 +坬 +坭 +坯 +坰 +坳 +坷 +坻 +坼 +坽 +垂 +垃 +垄 +垆 +垈 +型 +垌 +垍 +垎 +垏 +垒 +垓 +垕 +垙 +垚 +垛 +垞 +垟 +垠 +垡 +垢 +垣 +垤 +垦 +垧 +垩 +垫 +垭 +垮 +垯 +垱 +垲 +垴 +垵 +垸 +垺 +垾 +垿 +埂 +埃 +埆 +埇 +埋 +埌 +城 +埏 +埒 +埔 +埕 +埗 +埘 +埙 +埚 +埝 +域 +埠 +埤 +埪 +埫 +埭 +埯 +埴 +埵 +埸 +培 +基 +埼 +埽 +堂 +堃 +堆 +堇 +堉 +堋 +堌 +堍 +堎 +堐 +堑 +堕 +堙 +堞 +堠 +堡 +堤 +堧 +堨 +堪 +堰 +堲 +堵 +堼 +堽 +堾 +塄 +塅 +塆 +塌 +塍 +塑 +塔 +塘 +塝 +塞 +塥 +填 +塬 +塱 +塾 +墀 +墁 +境 +墅 +墈 +墉 +墐 +墒 +墓 +墕 +墘 +墙 +墚 +增 +墟 +墡 +墣 +墦 +墨 +墩 +墼 +壁 +壅 +壑 +壕 +壤 +士 +壬 +壮 +声 +壳 +壶 +壸 +壹 +处 +备 +复 +夏 +夐 +夔 +夕 +外 +夙 +多 +夜 +够 +夤 +夥 +大 +天 +太 +夫 +夬 +夭 +央 +夯 +失 +头 +夷 +夸 +夹 +夺 +夼 +奁 +奂 +奄 +奇 +奈 +奉 +奋 +奎 +奏 +契 +奓 +奔 +奕 +奖 +套 +奘 +奚 +奠 +奡 +奢 +奥 +奭 +女 +奴 +奶 +奸 +她 +好 +妁 +如 +妃 +妄 +妆 +妇 +妈 +妊 +妍 +妒 +妓 +妖 +妗 +妘 +妙 +妞 +妣 +妤 +妥 +妧 +妨 +妩 +妪 +妫 +妭 +妮 +妯 +妲 +妹 +妻 +妾 +姆 +姈 +姊 +始 +姐 +姑 +姒 +姓 +委 +姗 +姘 +姚 +姜 +姝 +姞 +姣 +姤 +姥 +姨 +姬 +姮 +姱 +姶 +姹 +姻 +姽 +姿 +娀 +威 +娃 +娄 +娅 +娆 +娇 +娈 +娉 +娌 +娑 +娓 +娘 +娜 +娟 +娠 +娣 +娥 +娩 +娱 +娲 +娴 +娵 +娶 +娼 +婀 +婆 +婉 +婊 +婌 +婍 +婕 +婘 +婚 +婞 +婠 +婢 +婤 +婧 +婪 +婫 +婳 +婴 +婵 +婶 +婷 +婺 +婻 +婼 +婿 +媂 +媄 +媆 +媒 +媓 +媖 +媚 +媛 +媞 +媪 +媭 +媱 +媲 +媳 +媵 +媸 +媾 +嫁 +嫂 +嫄 +嫉 +嫌 +嫒 +嫔 +嫕 +嫖 +嫘 +嫚 +嫜 +嫠 +嫡 +嫣 +嫦 +嫩 +嫪 +嫫 +嫭 +嫱 +嫽 +嬉 +嬖 +嬗 +嬛 +嬥 +嬬 +嬴 +嬷 +嬿 +孀 +孅 +子 +孑 +孓 +孔 +孕 +孖 +字 +存 +孙 +孚 +孛 +孜 +孝 +孟 +孢 +季 +孤 +孥 +学 +孩 +孪 +孬 +孰 +孱 +孳 +孵 +孺 +孽 +宁 +它 +宄 +宅 +宇 +守 +安 +宋 +完 +宏 +宓 +宕 +宗 +官 +宙 +定 +宛 +宜 +宝 +实 +宠 +审 +客 +宣 +室 +宥 +宦 +宧 +宪 +宫 +宬 +宰 +害 +宴 +宵 +家 +宸 +容 +宽 +宾 +宿 +寁 +寂 +寄 +寅 +密 +寇 +富 +寐 +寒 +寓 +寝 +寞 +察 +寡 +寤 +寥 +寨 +寮 +寰 +寸 +对 +寺 +寻 +导 +寿 +封 +射 +将 +尉 +尊 +小 +少 +尔 +尕 +尖 +尘 +尚 +尜 +尝 +尢 +尤 +尥 +尧 +尨 +尪 +尬 +就 +尴 +尸 +尹 +尺 +尻 +尼 +尽 +尾 +尿 +局 +屁 +层 +屃 +居 +屈 +屉 +届 +屋 +屎 +屏 +屐 +屑 +展 +屙 +属 +屠 +屡 +屣 +履 +屦 +屯 +山 +屹 +屺 +屼 +屾 +屿 +岁 +岂 +岈 +岊 +岌 +岍 +岐 +岑 +岔 +岖 +岗 +岘 +岙 +岚 +岛 +岜 +岞 +岠 +岢 +岣 +岨 +岩 +岫 +岬 +岭 +岱 +岳 +岵 +岷 +岸 +岽 +岿 +峁 +峂 +峃 +峄 +峋 +峒 +峗 +峘 +峙 +峛 +峡 +峣 +峤 +峥 +峦 +峧 +峨 +峪 +峭 +峰 +峱 +峻 +峿 +崀 +崁 +崂 +崃 +崄 +崆 +崇 +崌 +崎 +崒 +崔 +崖 +崚 +崛 +崞 +崟 +崡 +崤 +崦 +崧 +崩 +崭 +崮 +崴 +崶 +崽 +崾 +崿 +嵁 +嵅 +嵇 +嵊 +嵋 +嵌 +嵎 +嵖 +嵘 +嵚 +嵛 +嵝 +嵩 +嵫 +嵬 +嵯 +嵲 +嵴 +嶂 +嶅 +嶍 +嶒 +嶓 +嶙 +嶝 +嶟 +嶦 +嶲 +嶷 +巅 +巇 +巉 +巍 +川 +州 +巡 +巢 +工 +左 +巧 +巨 +巩 +巫 +差 +巯 +己 +已 +巳 +巴 +巷 +巽 +巾 +币 +市 +布 +帅 +帆 +师 +希 +帏 +帐 +帑 +帔 +帕 +帖 +帘 +帙 +帚 +帛 +帜 +帝 +帡 +带 +帧 +帨 +席 +帮 +帱 +帷 +常 +帻 +帼 +帽 +幂 +幄 +幅 +幌 +幔 +幕 +幖 +幛 +幞 +幡 +幢 +幪 +干 +平 +年 +并 +幸 +幺 +幻 +幼 +幽 +广 +庄 +庆 +庇 +床 +庋 +序 +庐 +庑 +库 +应 +底 +庖 +店 +庙 +庚 +府 +庞 +废 +庠 +庤 +庥 +度 +座 +庭 +庱 +庳 +庵 +庶 +康 +庸 +庹 +庼 +庾 +廆 +廉 +廊 +廋 +廑 +廒 +廓 +廖 +廙 +廛 +廨 +廪 +延 +廷 +建 +廿 +开 +弁 +异 +弃 +弄 +弆 +弇 +弈 +弊 +弋 +式 +弑 +弓 +引 +弗 +弘 +弛 +弟 +张 +弢 +弥 +弦 +弧 +弨 +弩 +弭 +弯 +弱 +弶 +弸 +弹 +强 +弼 +彀 +归 +当 +录 +彖 +彗 +彘 +彝 +彟 +形 +彤 +彦 +彧 +彩 +彪 +彬 +彭 +彰 +影 +彳 +彷 +役 +彻 +彼 +往 +征 +徂 +径 +待 +徇 +很 +徉 +徊 +律 +徐 +徒 +徕 +得 +徘 +徙 +徛 +徜 +御 +徨 +循 +徭 +微 +徵 +德 +徼 +徽 +心 +必 +忆 +忉 +忌 +忍 +忏 +忐 +忑 +忒 +忖 +志 +忘 +忙 +忝 +忞 +忠 +忡 +忤 +忧 +忪 +快 +忭 +忮 +忱 +忳 +念 +忸 +忺 +忻 +忽 +忾 +忿 +怀 +态 +怂 +怃 +怄 +怅 +怆 +怊 +怍 +怎 +怏 +怒 +怔 +怕 +怖 +怙 +怛 +怜 +思 +怠 +怡 +急 +怦 +性 +怨 +怩 +怪 +怫 +怯 +怵 +总 +怼 +怿 +恁 +恂 +恃 +恋 +恍 +恐 +恒 +恓 +恔 +恕 +恙 +恚 +恝 +恢 +恣 +恤 +恧 +恨 +恩 +恪 +恫 +恬 +恭 +息 +恰 +恳 +恶 +恸 +恹 +恺 +恻 +恼 +恽 +恿 +悃 +悄 +悆 +悈 +悉 +悌 +悍 +悒 +悔 +悖 +悚 +悛 +悝 +悟 +悠 +悢 +患 +悦 +您 +悫 +悬 +悭 +悯 +悰 +悱 +悲 +悴 +悸 +悻 +悼 +情 +惆 +惇 +惊 +惋 +惎 +惑 +惔 +惕 +惘 +惙 +惚 +惛 +惜 +惝 +惟 +惠 +惦 +惧 +惨 +惩 +惫 +惬 +惭 +惮 +惯 +惰 +想 +惴 +惶 +惹 +惺 +愀 +愁 +愃 +愆 +愈 +愉 +愍 +愎 +意 +愐 +愔 +愕 +愚 +感 +愠 +愣 +愤 +愦 +愧 +愫 +愭 +愿 +慆 +慈 +慊 +慌 +慎 +慑 +慕 +慝 +慢 +慥 +慧 +慨 +慬 +慭 +慰 +慵 +慷 +憋 +憎 +憔 +憕 +憙 +憧 +憨 +憩 +憬 +憭 +憷 +憺 +憾 +懂 +懈 +懊 +懋 +懑 +懒 +懔 +懦 +懵 +懿 +戆 +戈 +戊 +戋 +戌 +戍 +戎 +戏 +成 +我 +戒 +戕 +或 +戗 +战 +戚 +戛 +戟 +戡 +戢 +戣 +戤 +戥 +截 +戬 +戭 +戮 +戳 +戴 +户 +戽 +戾 +房 +所 +扁 +扂 +扃 +扅 +扆 +扇 +扈 +扉 +扊 +手 +才 +扎 +扑 +扒 +打 +扔 +托 +扛 +扞 +扣 +扦 +执 +扩 +扪 +扫 +扬 +扭 +扮 +扯 +扰 +扳 +扶 +批 +扺 +扼 +扽 +找 +承 +技 +抃 +抄 +抉 +把 +抑 +抒 +抓 +抔 +投 +抖 +抗 +折 +抚 +抛 +抟 +抠 +抡 +抢 +护 +报 +抨 +披 +抬 +抱 +抵 +抹 +抻 +押 +抽 +抿 +拂 +拃 +拄 +担 +拆 +拇 +拈 +拉 +拊 +拌 +拍 +拎 +拐 +拒 +拓 +拔 +拖 +拗 +拘 +拙 +招 +拜 +拟 +拢 +拣 +拤 +拥 +拦 +拧 +拨 +择 +括 +拭 +拮 +拯 +拱 +拳 +拴 +拶 +拷 +拼 +拽 +拾 +拿 +持 +挂 +指 +挈 +按 +挎 +挑 +挓 +挖 +挚 +挛 +挝 +挞 +挟 +挠 +挡 +挣 +挤 +挥 +挦 +挨 +挪 +挫 +振 +挲 +挹 +挺 +挽 +捂 +捃 +捅 +捆 +捉 +捋 +捌 +捍 +捎 +捏 +捐 +捕 +捞 +损 +捡 +换 +捣 +捧 +捩 +捭 +据 +捯 +捶 +捷 +捺 +捻 +捽 +掀 +掂 +掇 +授 +掉 +掊 +掌 +掎 +掏 +掐 +排 +掖 +掘 +掞 +掠 +探 +掣 +接 +控 +推 +掩 +措 +掬 +掭 +掮 +掰 +掳 +掴 +掷 +掸 +掺 +掼 +掾 +揄 +揆 +揉 +揍 +描 +提 +插 +揕 +揖 +揠 +握 +揣 +揩 +揪 +揭 +揳 +援 +揶 +揸 +揽 +揿 +搀 +搁 +搂 +搅 +搋 +搌 +搏 +搐 +搒 +搓 +搔 +搛 +搜 +搞 +搠 +搡 +搦 +搪 +搬 +搭 +搴 +携 +搽 +摁 +摄 +摅 +摆 +摇 +摈 +摊 +摏 +摒 +摔 +摘 +摛 +摞 +摧 +摩 +摭 +摴 +摸 +摹 +摽 +撂 +撄 +撅 +撇 +撑 +撒 +撕 +撖 +撙 +撞 +撤 +撩 +撬 +播 +撮 +撰 +撵 +撷 +撸 +撺 +撼 +擀 +擂 +擅 +操 +擎 +擐 +擒 +擘 +擞 +擢 +擤 +擦 +擿 +攀 +攉 +攒 +攘 +攥 +攫 +攮 +支 +收 +攸 +改 +攻 +攽 +放 +政 +故 +效 +敉 +敌 +敏 +救 +敔 +敕 +敖 +教 +敛 +敝 +敞 +敢 +散 +敦 +敩 +敫 +敬 +数 +敲 +整 +敷 +文 +斋 +斌 +斐 +斑 +斓 +斗 +料 +斛 +斜 +斝 +斟 +斠 +斡 +斤 +斥 +斧 +斩 +斫 +断 +斯 +新 +斶 +方 +於 +施 +旁 +旃 +旄 +旅 +旆 +旋 +旌 +旎 +族 +旐 +旒 +旖 +旗 +旞 +无 +既 +日 +旦 +旧 +旨 +早 +旬 +旭 +旮 +旯 +旰 +旱 +旴 +旵 +时 +旷 +旸 +旺 +旻 +旿 +昀 +昂 +昃 +昄 +昆 +昇 +昈 +昉 +昊 +昌 +明 +昏 +昒 +易 +昔 +昕 +昙 +昝 +星 +映 +昡 +昣 +昤 +春 +昧 +昨 +昪 +昫 +昭 +是 +昱 +昳 +昴 +昵 +昶 +昺 +昼 +昽 +显 +晁 +晃 +晅 +晊 +晋 +晌 +晏 +晐 +晒 +晓 +晔 +晕 +晖 +晗 +晙 +晚 +晞 +晟 +晡 +晢 +晤 +晦 +晨 +晪 +晫 +普 +景 +晰 +晱 +晴 +晶 +晷 +智 +晾 +暂 +暄 +暅 +暇 +暌 +暑 +暕 +暖 +暗 +暝 +暧 +暨 +暮 +暲 +暴 +暵 +暶 +暹 +暾 +暿 +曈 +曌 +曙 +曛 +曜 +曝 +曦 +曩 +曰 +曲 +曳 +更 +曷 +曹 +曼 +曾 +替 +最 +月 +有 +朋 +服 +朏 +朐 +朓 +朔 +朕 +朗 +望 +朝 +期 +朦 +木 +未 +末 +本 +札 +术 +朱 +朳 +朴 +朵 +朸 +机 +朽 +杀 +杂 +权 +杄 +杆 +杈 +杉 +杌 +李 +杏 +材 +村 +杓 +杕 +杖 +杙 +杜 +杞 +束 +杠 +条 +来 +杧 +杨 +杩 +杪 +杭 +杯 +杰 +杲 +杳 +杵 +杷 +杻 +杼 +松 +板 +极 +构 +枅 +枇 +枉 +枋 +枍 +析 +枕 +林 +枘 +枚 +果 +枝 +枞 +枢 +枣 +枥 +枧 +枨 +枪 +枫 +枭 +枯 +枰 +枲 +枳 +枵 +架 +枷 +枸 +枹 +柁 +柃 +柄 +柈 +柊 +柏 +某 +柑 +柒 +染 +柔 +柖 +柘 +柙 +柚 +柜 +柝 +柞 +柠 +柢 +查 +柩 +柬 +柯 +柰 +柱 +柳 +柴 +柷 +柽 +柿 +栀 +栅 +标 +栈 +栉 +栊 +栋 +栌 +栎 +栏 +栐 +树 +栒 +栓 +栖 +栗 +栝 +栟 +校 +栩 +株 +栲 +栳 +栴 +样 +核 +根 +栻 +格 +栽 +栾 +桀 +桁 +桂 +桃 +桄 +桅 +框 +案 +桉 +桊 +桌 +桎 +桐 +桑 +桓 +桔 +桕 +桠 +桡 +桢 +档 +桤 +桥 +桦 +桧 +桨 +桩 +桫 +桯 +桲 +桴 +桶 +桷 +桹 +梁 +梃 +梅 +梆 +梌 +梏 +梓 +梗 +梠 +梢 +梣 +梦 +梧 +梨 +梭 +梯 +械 +梳 +梴 +梵 +梼 +梽 +梾 +梿 +检 +棁 +棂 +棉 +棋 +棍 +棐 +棒 +棓 +棕 +棘 +棚 +棠 +棣 +棤 +棨 +棪 +棫 +棬 +森 +棰 +棱 +棵 +棹 +棺 +棻 +棼 +棽 +椀 +椁 +椅 +椆 +椋 +植 +椎 +椐 +椑 +椒 +椓 +椟 +椠 +椤 +椪 +椭 +椰 +椴 +椸 +椹 +椽 +椿 +楂 +楒 +楔 +楗 +楙 +楚 +楝 +楞 +楠 +楣 +楦 +楩 +楪 +楫 +楮 +楯 +楷 +楸 +楹 +楼 +概 +榃 +榄 +榅 +榆 +榇 +榈 +榉 +榍 +榑 +榔 +榕 +榖 +榛 +榜 +榧 +榨 +榫 +榭 +榰 +榱 +榴 +榷 +榻 +槁 +槃 +槊 +槌 +槎 +槐 +槔 +槚 +槛 +槜 +槟 +槠 +槭 +槱 +槲 +槽 +槿 +樊 +樗 +樘 +樟 +模 +樨 +横 +樯 +樱 +樵 +樽 +樾 +橄 +橇 +橐 +橑 +橘 +橙 +橛 +橞 +橡 +橥 +橦 +橱 +橹 +橼 +檀 +檄 +檎 +檐 +檑 +檗 +檞 +檠 +檩 +檫 +檬 +櫆 +欂 +欠 +次 +欢 +欣 +欤 +欧 +欲 +欸 +欹 +欺 +欻 +款 +歃 +歅 +歆 +歇 +歉 +歌 +歙 +止 +正 +此 +步 +武 +歧 +歪 +歹 +死 +歼 +殁 +殂 +殃 +殄 +殆 +殇 +殉 +殊 +残 +殍 +殒 +殓 +殖 +殚 +殛 +殡 +殣 +殪 +殳 +殴 +段 +殷 +殿 +毁 +毂 +毅 +毋 +毌 +母 +每 +毐 +毒 +毓 +比 +毕 +毖 +毗 +毙 +毛 +毡 +毪 +毫 +毯 +毳 +毵 +毹 +毽 +氅 +氆 +氇 +氍 +氏 +氐 +民 +氓 +气 +氕 +氖 +氘 +氙 +氚 +氛 +氟 +氡 +氢 +氤 +氦 +氧 +氨 +氩 +氪 +氮 +氯 +氰 +氲 +水 +永 +氾 +氿 +汀 +汁 +求 +汆 +汇 +汈 +汉 +汊 +汋 +汐 +汔 +汕 +汗 +汛 +汜 +汝 +汞 +江 +池 +污 +汤 +汧 +汨 +汩 +汪 +汫 +汭 +汰 +汲 +汴 +汶 +汹 +汽 +汾 +沁 +沂 +沃 +沄 +沅 +沆 +沇 +沈 +沉 +沌 +沏 +沐 +沓 +沔 +沘 +沙 +沚 +沛 +沟 +没 +沣 +沤 +沥 +沦 +沧 +沨 +沩 +沪 +沫 +沭 +沮 +沱 +河 +沸 +油 +沺 +治 +沼 +沽 +沾 +沿 +泂 +泃 +泄 +泅 +泇 +泉 +泊 +泌 +泐 +泓 +泔 +法 +泖 +泗 +泙 +泚 +泛 +泜 +泞 +泠 +泡 +波 +泣 +泥 +注 +泪 +泫 +泮 +泯 +泰 +泱 +泳 +泵 +泷 +泸 +泺 +泻 +泼 +泽 +泾 +洁 +洄 +洇 +洈 +洋 +洌 +洎 +洑 +洒 +洓 +洗 +洘 +洙 +洚 +洛 +洞 +洢 +洣 +津 +洧 +洨 +洪 +洫 +洭 +洮 +洱 +洲 +洳 +洴 +洵 +洸 +洹 +洺 +活 +洼 +洽 +派 +洿 +流 +浃 +浅 +浆 +浇 +浈 +浉 +浊 +测 +浍 +济 +浏 +浐 +浑 +浒 +浓 +浔 +浕 +浙 +浚 +浛 +浜 +浞 +浟 +浠 +浡 +浣 +浥 +浦 +浩 +浪 +浬 +浭 +浮 +浯 +浰 +浲 +浴 +海 +浸 +浼 +涂 +涄 +涅 +消 +涉 +涌 +涍 +涎 +涐 +涑 +涓 +涔 +涕 +涘 +涛 +涝 +涞 +涟 +涠 +涡 +涢 +涣 +涤 +润 +涧 +涨 +涩 +涪 +涫 +涮 +涯 +液 +涴 +涵 +涸 +涿 +淀 +淄 +淅 +淆 +淇 +淋 +淌 +淏 +淑 +淖 +淘 +淙 +淜 +淝 +淞 +淟 +淠 +淡 +淤 +淦 +淫 +淬 +淮 +淯 +深 +淳 +淴 +混 +淹 +添 +淼 +清 +渊 +渌 +渍 +渎 +渐 +渑 +渔 +渗 +渚 +渝 +渟 +渠 +渡 +渣 +渤 +渥 +温 +渫 +渭 +港 +渰 +渲 +渴 +游 +渺 +渼 +湃 +湄 +湉 +湍 +湎 +湑 +湓 +湔 +湖 +湘 +湛 +湜 +湝 +湟 +湣 +湫 +湮 +湲 +湴 +湾 +湿 +溁 +溃 +溅 +溆 +溇 +溉 +溍 +溏 +源 +溘 +溚 +溜 +溞 +溟 +溠 +溢 +溥 +溦 +溧 +溪 +溯 +溱 +溲 +溴 +溵 +溶 +溷 +溹 +溺 +溻 +溽 +滁 +滂 +滃 +滆 +滇 +滉 +滋 +滍 +滏 +滑 +滓 +滔 +滕 +滗 +滘 +滚 +滞 +滟 +滠 +满 +滢 +滤 +滥 +滦 +滧 +滨 +滩 +滪 +滫 +滴 +滹 +漂 +漆 +漈 +漉 +漋 +漏 +漓 +演 +漕 +漖 +漠 +漤 +漦 +漩 +漪 +漫 +漭 +漯 +漱 +漳 +漴 +漶 +漷 +漹 +漻 +漼 +漾 +潆 +潇 +潋 +潍 +潏 +潖 +潘 +潜 +潞 +潟 +潢 +潦 +潩 +潭 +潮 +潲 +潴 +潵 +潸 +潺 +潼 +潽 +潾 +澂 +澄 +澈 +澉 +澌 +澍 +澎 +澛 +澜 +澡 +澥 +澧 +澪 +澭 +澳 +澴 +澶 +澹 +澼 +澽 +激 +濂 +濉 +濋 +濑 +濒 +濞 +濠 +濡 +濩 +濮 +濯 +瀌 +瀍 +瀑 +瀔 +瀚 +瀛 +瀣 +瀱 +瀵 +瀹 +瀼 +灈 +灌 +灏 +灞 +火 +灭 +灯 +灰 +灵 +灶 +灸 +灼 +灾 +灿 +炀 +炅 +炆 +炉 +炊 +炌 +炎 +炒 +炔 +炕 +炖 +炘 +炙 +炜 +炝 +炟 +炣 +炫 +炬 +炭 +炮 +炯 +炱 +炳 +炷 +炸 +点 +炻 +炼 +炽 +烀 +烁 +烂 +烃 +烈 +烊 +烔 +烘 +烙 +烛 +烜 +烝 +烟 +烠 +烤 +烦 +烧 +烨 +烩 +烫 +烬 +热 +烯 +烶 +烷 +烹 +烺 +烻 +烽 +焆 +焉 +焊 +焌 +焐 +焓 +焕 +焖 +焗 +焘 +焙 +焚 +焜 +焞 +焦 +焯 +焰 +焱 +然 +煁 +煃 +煅 +煊 +煋 +煌 +煎 +煓 +煜 +煞 +煟 +煤 +煦 +照 +煨 +煮 +煲 +煳 +煴 +煸 +煺 +煽 +熄 +熇 +熊 +熏 +熔 +熘 +熙 +熛 +熜 +熟 +熠 +熥 +熨 +熬 +熵 +熹 +熻 +燃 +燊 +燋 +燎 +燏 +燔 +燕 +燚 +燠 +燥 +燧 +燮 +燹 +爆 +爇 +爔 +爚 +爝 +爟 +爨 +爪 +爬 +爰 +爱 +爵 +父 +爷 +爸 +爹 +爻 +爽 +爿 +牁 +牂 +片 +版 +牌 +牍 +牒 +牖 +牙 +牚 +牛 +牝 +牟 +牡 +牢 +牤 +牥 +牦 +牧 +物 +牮 +牯 +牲 +牵 +特 +牺 +牻 +牾 +牿 +犀 +犁 +犄 +犇 +犊 +犋 +犍 +犏 +犒 +犟 +犨 +犬 +犯 +犰 +犴 +状 +犷 +犸 +犹 +狁 +狂 +狃 +狄 +狈 +狉 +狍 +狎 +狐 +狒 +狗 +狙 +狝 +狞 +狠 +狡 +狨 +狩 +独 +狭 +狮 +狯 +狰 +狱 +狲 +狳 +狴 +狷 +狸 +狺 +狻 +狼 +猁 +猃 +猄 +猇 +猊 +猎 +猕 +猖 +猗 +猛 +猜 +猝 +猞 +猡 +猢 +猥 +猩 +猪 +猫 +猬 +献 +猯 +猰 +猱 +猴 +猷 +猹 +猺 +猾 +猿 +獍 +獐 +獒 +獗 +獠 +獬 +獭 +獯 +獴 +獾 +玃 +玄 +率 +玉 +王 +玎 +玑 +玒 +玓 +玕 +玖 +玘 +玙 +玚 +玛 +玞 +玟 +玠 +玡 +玢 +玤 +玥 +玦 +玩 +玫 +玭 +玮 +环 +现 +玱 +玲 +玳 +玶 +玷 +玹 +玺 +玻 +玼 +玿 +珀 +珂 +珅 +珇 +珈 +珉 +珊 +珋 +珌 +珍 +珏 +珐 +珑 +珒 +珕 +珖 +珙 +珛 +珝 +珞 +珠 +珢 +珣 +珥 +珦 +珧 +珩 +珪 +珫 +班 +珰 +珲 +珵 +珷 +珸 +珹 +珺 +珽 +琀 +球 +琄 +琅 +理 +琇 +琈 +琉 +琊 +琎 +琏 +琐 +琔 +琚 +琛 +琟 +琡 +琢 +琤 +琥 +琦 +琨 +琪 +琫 +琬 +琭 +琮 +琯 +琰 +琲 +琳 +琴 +琵 +琶 +琼 +瑀 +瑁 +瑂 +瑃 +瑄 +瑅 +瑆 +瑑 +瑓 +瑔 +瑕 +瑖 +瑗 +瑙 +瑚 +瑛 +瑜 +瑝 +瑞 +瑟 +瑢 +瑧 +瑨 +瑬 +瑭 +瑰 +瑱 +瑳 +瑶 +瑷 +瑾 +璀 +璁 +璃 +璆 +璇 +璈 +璋 +璎 +璐 +璒 +璘 +璜 +璞 +璟 +璠 +璥 +璧 +璨 +璩 +璪 +璬 +璮 +璱 +璲 +璺 +瓀 +瓒 +瓖 +瓘 +瓜 +瓞 +瓠 +瓢 +瓣 +瓤 +瓦 +瓮 +瓯 +瓴 +瓶 +瓷 +瓻 +瓿 +甄 +甍 +甏 +甑 +甓 +甗 +甘 +甚 +甜 +生 +甡 +甥 +甦 +用 +甩 +甪 +甫 +甬 +甭 +甯 +田 +由 +甲 +申 +电 +男 +甸 +町 +画 +甾 +畀 +畅 +畈 +畋 +界 +畎 +畏 +畔 +畖 +留 +畚 +畛 +畜 +畤 +略 +畦 +番 +畬 +畯 +畲 +畴 +畸 +畹 +畿 +疁 +疃 +疆 +疍 +疏 +疐 +疑 +疔 +疖 +疗 +疙 +疚 +疝 +疟 +疠 +疡 +疢 +疣 +疤 +疥 +疫 +疬 +疭 +疮 +疯 +疰 +疱 +疲 +疳 +疴 +疵 +疸 +疹 +疼 +疽 +疾 +痂 +痃 +痄 +病 +症 +痈 +痉 +痊 +痍 +痒 +痓 +痔 +痕 +痘 +痛 +痞 +痢 +痣 +痤 +痦 +痧 +痨 +痪 +痫 +痰 +痱 +痴 +痹 +痼 +痿 +瘀 +瘁 +瘃 +瘅 +瘆 +瘊 +瘌 +瘐 +瘕 +瘗 +瘘 +瘙 +瘛 +瘟 +瘠 +瘢 +瘤 +瘥 +瘦 +瘩 +瘪 +瘫 +瘭 +瘰 +瘳 +瘴 +瘵 +瘸 +瘼 +瘾 +瘿 +癀 +癃 +癌 +癍 +癔 +癖 +癗 +癜 +癞 +癣 +癫 +癯 +癸 +登 +白 +百 +癿 +皂 +的 +皆 +皇 +皈 +皋 +皎 +皑 +皓 +皕 +皖 +皙 +皛 +皞 +皤 +皦 +皭 +皮 +皱 +皲 +皴 +皿 +盂 +盅 +盆 +盈 +盉 +益 +盍 +盎 +盏 +盐 +监 +盒 +盔 +盖 +盗 +盘 +盛 +盟 +盥 +盦 +目 +盯 +盱 +盲 +直 +盷 +相 +盹 +盼 +盾 +省 +眄 +眇 +眈 +眉 +眊 +看 +眍 +眙 +眚 +真 +眠 +眢 +眦 +眨 +眩 +眬 +眭 +眯 +眵 +眶 +眷 +眸 +眺 +眼 +着 +睁 +睃 +睄 +睇 +睎 +睐 +睑 +睚 +睛 +睡 +睢 +督 +睥 +睦 +睨 +睫 +睬 +睹 +睽 +睾 +睿 +瞀 +瞄 +瞅 +瞋 +瞌 +瞍 +瞎 +瞑 +瞒 +瞟 +瞠 +瞢 +瞥 +瞧 +瞩 +瞪 +瞫 +瞬 +瞭 +瞰 +瞳 +瞵 +瞻 +瞽 +瞿 +矍 +矗 +矛 +矜 +矞 +矢 +矣 +知 +矧 +矩 +矫 +矬 +短 +矮 +矰 +石 +矶 +矸 +矻 +矼 +矾 +矿 +砀 +码 +砂 +砄 +砆 +砉 +砌 +砍 +砑 +砒 +研 +砖 +砗 +砘 +砚 +砜 +砝 +砟 +砠 +砣 +砥 +砧 +砫 +砬 +砭 +砮 +砰 +破 +砵 +砷 +砸 +砹 +砺 +砻 +砼 +砾 +础 +硁 +硅 +硇 +硊 +硌 +硍 +硎 +硐 +硒 +硔 +硕 +硖 +硗 +硙 +硚 +硝 +硪 +硫 +硬 +硭 +确 +硼 +硿 +碃 +碇 +碈 +碉 +碌 +碍 +碎 +碏 +碑 +碓 +碗 +碘 +碚 +碛 +碜 +碟 +碡 +碣 +碥 +碧 +碨 +碰 +碱 +碲 +碳 +碴 +碶 +碹 +碾 +磁 +磅 +磉 +磊 +磋 +磏 +磐 +磔 +磕 +磙 +磜 +磡 +磨 +磬 +磲 +磴 +磷 +磹 +磻 +礁 +礅 +礌 +礓 +礞 +礴 +礵 +示 +礼 +社 +祀 +祁 +祃 +祆 +祇 +祈 +祉 +祊 +祋 +祎 +祏 +祐 +祓 +祕 +祖 +祗 +祚 +祛 +祜 +祝 +神 +祟 +祠 +祢 +祥 +祧 +票 +祭 +祯 +祲 +祷 +祸 +祺 +祼 +祾 +禀 +禁 +禄 +禅 +禊 +禋 +福 +禒 +禔 +禘 +禚 +禛 +禤 +禧 +禳 +禹 +禺 +离 +禽 +禾 +秀 +私 +秃 +秆 +秉 +秋 +种 +科 +秒 +秕 +秘 +租 +秣 +秤 +秦 +秧 +秩 +秫 +秬 +秭 +积 +称 +秸 +移 +秽 +秾 +稀 +稂 +稃 +稆 +程 +稌 +稍 +税 +稑 +稔 +稗 +稙 +稚 +稞 +稠 +稣 +稳 +稷 +稹 +稻 +稼 +稽 +稿 +穄 +穆 +穑 +穗 +穙 +穜 +穟 +穰 +穴 +究 +穷 +穸 +穹 +空 +穿 +窀 +突 +窃 +窄 +窅 +窈 +窊 +窍 +窎 +窑 +窒 +窕 +窖 +窗 +窘 +窜 +窝 +窟 +窠 +窣 +窥 +窦 +窨 +窬 +窭 +窳 +窸 +窿 +立 +竑 +竖 +竘 +站 +竞 +竟 +章 +竣 +童 +竦 +竫 +竭 +端 +竹 +竺 +竽 +竿 +笃 +笄 +笆 +笈 +笊 +笋 +笏 +笑 +笔 +笕 +笙 +笛 +笞 +笠 +笤 +笥 +符 +笨 +笪 +笫 +第 +笮 +笯 +笱 +笳 +笸 +笺 +笼 +笾 +筀 +筅 +筇 +等 +筋 +筌 +筏 +筐 +筑 +筒 +答 +策 +筘 +筚 +筛 +筜 +筝 +筠 +筢 +筤 +筥 +筦 +筮 +筱 +筲 +筵 +筶 +筷 +筹 +筻 +筼 +签 +简 +箅 +箍 +箐 +箓 +箔 +箕 +箖 +算 +箜 +管 +箢 +箦 +箧 +箨 +箩 +箪 +箫 +箬 +箭 +箱 +箴 +箸 +篁 +篆 +篇 +篌 +篑 +篓 +篙 +篚 +篝 +篡 +篥 +篦 +篪 +篮 +篯 +篱 +篷 +篼 +篾 +簃 +簇 +簉 +簋 +簌 +簏 +簕 +簖 +簝 +簟 +簠 +簧 +簪 +簰 +簸 +簿 +籀 +籁 +籍 +籥 +米 +籴 +类 +籼 +籽 +粉 +粑 +粒 +粕 +粗 +粘 +粜 +粝 +粞 +粟 +粢 +粤 +粥 +粪 +粮 +粱 +粲 +粳 +粹 +粼 +粽 +精 +粿 +糁 +糅 +糇 +糈 +糊 +糌 +糍 +糒 +糕 +糖 +糗 +糙 +糜 +糟 +糠 +糨 +糯 +糵 +系 +紊 +素 +索 +紧 +紫 +累 +絜 +絮 +絷 +綦 +綮 +縠 +縢 +縻 +繁 +繄 +繇 +纂 +纛 +纠 +纡 +红 +纣 +纤 +纥 +约 +级 +纨 +纩 +纪 +纫 +纬 +纭 +纮 +纯 +纰 +纱 +纲 +纳 +纴 +纵 +纶 +纷 +纸 +纹 +纺 +纻 +纼 +纽 +纾 +线 +绀 +绁 +绂 +练 +组 +绅 +细 +织 +终 +绉 +绊 +绋 +绌 +绍 +绎 +经 +绐 +绑 +绒 +结 +绔 +绕 +绖 +绗 +绘 +给 +绚 +绛 +络 +绝 +绞 +统 +绠 +绡 +绢 +绣 +绤 +绥 +绦 +继 +绨 +绩 +绪 +绫 +续 +绮 +绯 +绰 +绱 +绲 +绳 +维 +绵 +绶 +绷 +绸 +绹 +绺 +绻 +综 +绽 +绾 +绿 +缀 +缁 +缂 +缃 +缄 +缅 +缆 +缇 +缈 +缉 +缊 +缌 +缎 +缐 +缑 +缒 +缓 +缔 +缕 +编 +缗 +缘 +缙 +缚 +缛 +缜 +缝 +缞 +缟 +缠 +缡 +缢 +缣 +缤 +缥 +缦 +缧 +缨 +缩 +缪 +缫 +缬 +缭 +缮 +缯 +缰 +缱 +缲 +缳 +缴 +缵 +缶 +缸 +缺 +罂 +罄 +罅 +罍 +罐 +网 +罔 +罕 +罗 +罘 +罚 +罟 +罡 +罢 +罨 +罩 +罪 +置 +罱 +署 +罴 +罶 +罹 +罽 +罾 +羁 +羊 +羌 +美 +羑 +羓 +羔 +羕 +羖 +羚 +羝 +羞 +羟 +羡 +群 +羧 +羯 +羰 +羱 +羲 +羸 +羹 +羼 +羽 +羿 +翀 +翁 +翂 +翃 +翅 +翈 +翊 +翌 +翎 +翔 +翕 +翘 +翙 +翚 +翛 +翟 +翠 +翡 +翥 +翦 +翩 +翮 +翯 +翰 +翱 +翳 +翷 +翻 +翼 +翾 +耀 +老 +考 +耄 +者 +耆 +耇 +耋 +而 +耍 +耏 +耐 +耑 +耒 +耔 +耕 +耖 +耗 +耘 +耙 +耜 +耠 +耢 +耤 +耥 +耦 +耧 +耨 +耩 +耪 +耰 +耱 +耳 +耵 +耶 +耷 +耸 +耻 +耽 +耿 +聂 +聃 +聆 +聊 +聋 +职 +聍 +聒 +联 +聘 +聚 +聩 +聪 +聱 +聿 +肃 +肄 +肆 +肇 +肉 +肋 +肌 +肓 +肖 +肘 +肚 +肛 +肝 +肟 +肠 +股 +肢 +肤 +肥 +肩 +肪 +肫 +肭 +肮 +肯 +肱 +育 +肴 +肷 +肸 +肺 +肼 +肽 +肾 +肿 +胀 +胁 +胂 +胃 +胄 +胆 +胈 +背 +胍 +胎 +胖 +胗 +胙 +胚 +胛 +胜 +胝 +胞 +胠 +胡 +胣 +胤 +胥 +胧 +胨 +胩 +胪 +胫 +胬 +胭 +胯 +胰 +胱 +胲 +胳 +胴 +胶 +胸 +胺 +胼 +能 +脂 +脆 +脉 +脊 +脍 +脎 +脏 +脐 +脑 +脒 +脓 +脔 +脖 +脘 +脚 +脞 +脟 +脩 +脬 +脯 +脱 +脲 +脶 +脸 +脾 +脿 +腆 +腈 +腊 +腋 +腌 +腐 +腑 +腒 +腓 +腔 +腕 +腘 +腙 +腚 +腠 +腥 +腧 +腨 +腩 +腭 +腮 +腯 +腰 +腱 +腴 +腹 +腺 +腻 +腼 +腽 +腾 +腿 +膀 +膂 +膈 +膊 +膏 +膑 +膘 +膙 +膛 +膜 +膝 +膦 +膨 +膳 +膺 +膻 +臀 +臂 +臃 +臆 +臊 +臌 +臑 +臜 +臣 +臧 +自 +臬 +臭 +至 +致 +臻 +臼 +臾 +舀 +舁 +舂 +舄 +舅 +舆 +舌 +舍 +舐 +舒 +舔 +舛 +舜 +舞 +舟 +舠 +舢 +舣 +舥 +航 +舫 +般 +舭 +舯 +舰 +舱 +舲 +舳 +舴 +舵 +舶 +舷 +舸 +船 +舻 +舾 +艄 +艅 +艇 +艉 +艋 +艎 +艏 +艘 +艚 +艟 +艨 +艮 +良 +艰 +色 +艳 +艴 +艺 +艽 +艾 +艿 +节 +芃 +芄 +芈 +芊 +芋 +芍 +芎 +芏 +芑 +芒 +芗 +芘 +芙 +芜 +芝 +芟 +芠 +芡 +芣 +芤 +芥 +芦 +芨 +芩 +芪 +芫 +芬 +芭 +芮 +芯 +芰 +花 +芳 +芴 +芷 +芸 +芹 +芼 +芽 +芾 +苁 +苄 +苇 +苈 +苉 +苊 +苋 +苌 +苍 +苎 +苏 +苑 +苒 +苓 +苔 +苕 +苗 +苘 +苛 +苜 +苞 +苟 +苠 +苡 +苣 +苤 +若 +苦 +苧 +苫 +苯 +英 +苴 +苷 +苹 +苻 +苾 +茀 +茁 +茂 +范 +茄 +茅 +茆 +茈 +茉 +茋 +茌 +茎 +茏 +茑 +茓 +茔 +茕 +茗 +茚 +茛 +茜 +茝 +茧 +茨 +茫 +茬 +茭 +茯 +茱 +茳 +茴 +茵 +茶 +茸 +茹 +茺 +茼 +茽 +荀 +荁 +荃 +荄 +荆 +荇 +草 +荏 +荐 +荑 +荒 +荓 +荔 +荖 +荙 +荚 +荛 +荜 +荞 +荟 +荠 +荡 +荣 +荤 +荥 +荦 +荧 +荨 +荩 +荪 +荫 +荬 +荭 +荮 +药 +荷 +荸 +荻 +荼 +荽 +莅 +莆 +莉 +莎 +莒 +莓 +莘 +莙 +莛 +莜 +莝 +莞 +莠 +莨 +莩 +莪 +莫 +莰 +莱 +莲 +莳 +莴 +莶 +获 +莸 +莹 +莺 +莼 +莽 +莿 +菀 +菁 +菂 +菅 +菇 +菉 +菊 +菌 +菍 +菏 +菔 +菖 +菘 +菜 +菝 +菟 +菠 +菡 +菥 +菩 +菪 +菰 +菱 +菲 +菹 +菼 +菽 +萁 +萃 +萄 +萆 +萋 +萌 +萍 +萎 +萏 +萑 +萘 +萚 +萜 +萝 +萣 +萤 +营 +萦 +萧 +萨 +萩 +萱 +萳 +萸 +萹 +萼 +落 +葆 +葎 +葑 +葖 +著 +葙 +葚 +葛 +葜 +葡 +董 +葩 +葫 +葬 +葭 +葰 +葱 +葳 +葴 +葵 +葶 +葸 +葺 +蒂 +蒄 +蒇 +蒈 +蒉 +蒋 +蒌 +蒎 +蒐 +蒗 +蒙 +蒜 +蒟 +蒡 +蒨 +蒯 +蒱 +蒲 +蒴 +蒸 +蒹 +蒺 +蒻 +蒽 +蒿 +蓁 +蓂 +蓄 +蓇 +蓉 +蓊 +蓍 +蓏 +蓐 +蓑 +蓓 +蓖 +蓝 +蓟 +蓠 +蓢 +蓣 +蓥 +蓦 +蓬 +蓰 +蓼 +蓿 +蔀 +蔃 +蔈 +蔊 +蔌 +蔑 +蔓 +蔗 +蔚 +蔟 +蔡 +蔫 +蔬 +蔷 +蔸 +蔹 +蔺 +蔻 +蔼 +蔽 +蕃 +蕈 +蕉 +蕊 +蕖 +蕗 +蕙 +蕞 +蕤 +蕨 +蕰 +蕲 +蕴 +蕹 +蕺 +蕻 +蕾 +薁 +薄 +薅 +薇 +薏 +薛 +薜 +薢 +薤 +薨 +薪 +薮 +薯 +薰 +薳 +薷 +薸 +薹 +薿 +藁 +藉 +藏 +藐 +藓 +藕 +藜 +藟 +藠 +藤 +藦 +藨 +藩 +藻 +藿 +蘅 +蘑 +蘖 +蘘 +蘧 +蘩 +蘸 +蘼 +虎 +虏 +虐 +虑 +虒 +虓 +虔 +虚 +虞 +虢 +虤 +虫 +虬 +虮 +虱 +虷 +虸 +虹 +虺 +虻 +虼 +虽 +虾 +虿 +蚀 +蚁 +蚂 +蚄 +蚆 +蚊 +蚋 +蚌 +蚍 +蚓 +蚕 +蚜 +蚝 +蚣 +蚤 +蚧 +蚨 +蚩 +蚪 +蚬 +蚯 +蚰 +蚱 +蚲 +蚴 +蚶 +蚺 +蛀 +蛃 +蛄 +蛆 +蛇 +蛉 +蛊 +蛋 +蛎 +蛏 +蛐 +蛑 +蛔 +蛘 +蛙 +蛛 +蛞 +蛟 +蛤 +蛩 +蛭 +蛮 +蛰 +蛱 +蛲 +蛳 +蛴 +蛸 +蛹 +蛾 +蜀 +蜂 +蜃 +蜇 +蜈 +蜉 +蜊 +蜍 +蜎 +蜐 +蜒 +蜓 +蜕 +蜗 +蜘 +蜚 +蜜 +蜞 +蜡 +蜢 +蜣 +蜥 +蜩 +蜮 +蜱 +蜴 +蜷 +蜻 +蜾 +蜿 +蝇 +蝈 +蝉 +蝌 +蝎 +蝓 +蝗 +蝘 +蝙 +蝠 +蝣 +蝤 +蝥 +蝮 +蝰 +蝲 +蝴 +蝶 +蝻 +蝼 +蝽 +蝾 +螂 +螃 +螅 +螈 +螋 +融 +螗 +螟 +螠 +螣 +螨 +螫 +螬 +螭 +螯 +螱 +螳 +螵 +螺 +螽 +蟀 +蟆 +蟊 +蟋 +蟏 +蟑 +蟒 +蟛 +蟠 +蟥 +蟪 +蟫 +蟮 +蟹 +蟾 +蠃 +蠊 +蠋 +蠓 +蠕 +蠖 +蠡 +蠢 +蠲 +蠹 +蠼 +血 +衃 +衄 +衅 +行 +衍 +衎 +衒 +衔 +街 +衙 +衠 +衡 +衢 +衣 +补 +表 +衩 +衫 +衬 +衮 +衰 +衲 +衷 +衽 +衾 +衿 +袁 +袂 +袄 +袅 +袆 +袈 +袋 +袍 +袒 +袖 +袗 +袜 +袢 +袤 +袪 +被 +袭 +袯 +袱 +袷 +袼 +裁 +裂 +装 +裆 +裈 +裉 +裎 +裒 +裔 +裕 +裘 +裙 +裛 +裟 +裢 +裣 +裤 +裥 +裨 +裰 +裱 +裳 +裴 +裸 +裹 +裼 +裾 +褂 +褊 +褐 +褒 +褓 +褕 +褙 +褚 +褛 +褟 +褡 +褥 +褪 +褫 +褯 +褰 +褴 +褶 +襁 +襄 +襕 +襚 +襜 +襞 +襟 +襦 +襫 +襻 +西 +要 +覃 +覆 +见 +观 +觃 +规 +觅 +视 +觇 +览 +觉 +觊 +觋 +觌 +觎 +觏 +觐 +觑 +角 +觖 +觚 +觜 +觞 +觟 +解 +觥 +触 +觫 +觭 +觯 +觱 +觳 +觿 +言 +訄 +訇 +訚 +訾 +詈 +詟 +詹 +誉 +誊 +誓 +謇 +警 +譬 +计 +订 +讣 +认 +讥 +讦 +讧 +讨 +让 +讪 +讫 +训 +议 +讯 +记 +讱 +讲 +讳 +讴 +讵 +讶 +讷 +许 +讹 +论 +讻 +讼 +讽 +设 +访 +诀 +证 +诂 +诃 +评 +诅 +识 +诇 +诈 +诉 +诊 +诋 +诌 +词 +诎 +诏 +诐 +译 +诒 +诓 +诔 +试 +诖 +诗 +诘 +诙 +诚 +诛 +诜 +话 +诞 +诟 +诠 +诡 +询 +诣 +诤 +该 +详 +诧 +诨 +诩 +诫 +诬 +语 +诮 +误 +诰 +诱 +诲 +诳 +说 +诵 +请 +诸 +诹 +诺 +读 +诼 +诽 +课 +诿 +谀 +谁 +谂 +调 +谄 +谅 +谆 +谇 +谈 +谊 +谋 +谌 +谍 +谎 +谏 +谐 +谑 +谒 +谓 +谔 +谕 +谖 +谗 +谙 +谚 +谛 +谜 +谝 +谞 +谟 +谠 +谡 +谢 +谣 +谤 +谥 +谦 +谧 +谨 +谩 +谪 +谫 +谬 +谭 +谮 +谯 +谰 +谱 +谲 +谳 +谴 +谵 +谶 +谷 +谼 +谿 +豁 +豆 +豇 +豉 +豌 +豕 +豚 +象 +豢 +豨 +豪 +豫 +豮 +豳 +豸 +豹 +豺 +貂 +貅 +貆 +貉 +貊 +貌 +貔 +貘 +贝 +贞 +负 +贡 +财 +责 +贤 +败 +账 +货 +质 +贩 +贪 +贫 +贬 +购 +贮 +贯 +贰 +贱 +贲 +贳 +贴 +贵 +贶 +贷 +贸 +费 +贺 +贻 +贼 +贽 +贾 +贿 +赀 +赁 +赂 +赃 +资 +赅 +赆 +赇 +赈 +赉 +赊 +赋 +赌 +赍 +赎 +赏 +赐 +赑 +赒 +赓 +赔 +赕 +赖 +赗 +赘 +赙 +赚 +赛 +赜 +赝 +赞 +赟 +赠 +赡 +赢 +赣 +赤 +赦 +赧 +赪 +赫 +赭 +走 +赳 +赴 +赵 +赶 +起 +趁 +趄 +超 +越 +趋 +趑 +趔 +趟 +趣 +趯 +趱 +足 +趴 +趵 +趸 +趺 +趼 +趾 +趿 +跂 +跃 +跄 +跆 +跋 +跌 +跎 +跏 +跐 +跑 +跖 +跗 +跚 +跛 +距 +跞 +跟 +跣 +跤 +跨 +跪 +跬 +路 +跱 +跳 +践 +跶 +跷 +跸 +跹 +跺 +跻 +跽 +踅 +踉 +踊 +踌 +踏 +踒 +踔 +踝 +踞 +踟 +踢 +踣 +踦 +踩 +踪 +踬 +踮 +踯 +踱 +踵 +踶 +踹 +踺 +踽 +蹀 +蹁 +蹂 +蹄 +蹅 +蹇 +蹈 +蹉 +蹊 +蹋 +蹐 +蹑 +蹒 +蹙 +蹚 +蹜 +蹢 +蹦 +蹩 +蹬 +蹭 +蹯 +蹰 +蹲 +蹴 +蹶 +蹼 +蹽 +蹾 +蹿 +躁 +躅 +躇 +躏 +躐 +躔 +躜 +躞 +身 +躬 +躯 +躲 +躺 +车 +轧 +轨 +轩 +轪 +轫 +转 +轭 +轮 +软 +轰 +轱 +轲 +轳 +轴 +轵 +轶 +轷 +轸 +轹 +轺 +轻 +轼 +载 +轾 +轿 +辀 +辁 +辂 +较 +辄 +辅 +辆 +辇 +辈 +辉 +辊 +辋 +辌 +辍 +辎 +辏 +辐 +辑 +辒 +输 +辔 +辕 +辖 +辗 +辘 +辙 +辚 +辛 +辜 +辞 +辟 +辣 +辨 +辩 +辫 +辰 +辱 +边 +辽 +达 +辿 +迁 +迂 +迄 +迅 +过 +迈 +迎 +运 +近 +迓 +返 +迕 +还 +这 +进 +远 +违 +连 +迟 +迢 +迤 +迥 +迦 +迨 +迩 +迪 +迫 +迭 +迮 +述 +迳 +迷 +迸 +迹 +迺 +追 +退 +送 +适 +逃 +逄 +逅 +逆 +选 +逊 +逋 +逍 +透 +逐 +逑 +递 +途 +逖 +逗 +通 +逛 +逝 +逞 +速 +造 +逡 +逢 +逦 +逭 +逮 +逯 +逴 +逵 +逶 +逸 +逻 +逼 +逾 +遁 +遂 +遄 +遆 +遇 +遍 +遏 +遐 +遑 +遒 +道 +遗 +遘 +遛 +遢 +遣 +遥 +遨 +遭 +遮 +遴 +遵 +遹 +遽 +避 +邀 +邂 +邃 +邈 +邋 +邑 +邓 +邕 +邗 +邘 +邙 +邛 +邝 +邠 +邡 +邢 +那 +邦 +邨 +邪 +邬 +邮 +邯 +邰 +邱 +邲 +邳 +邴 +邵 +邶 +邸 +邹 +邺 +邻 +邽 +邾 +邿 +郁 +郃 +郄 +郅 +郇 +郈 +郊 +郎 +郏 +郐 +郑 +郓 +郗 +郚 +郛 +郜 +郝 +郡 +郢 +郤 +郦 +郧 +部 +郪 +郫 +郭 +郯 +郴 +郸 +都 +郾 +郿 +鄀 +鄂 +鄃 +鄄 +鄅 +鄌 +鄑 +鄗 +鄘 +鄙 +鄚 +鄜 +鄞 +鄠 +鄢 +鄣 +鄫 +鄯 +鄱 +鄹 +酂 +酃 +酅 +酆 +酉 +酊 +酋 +酌 +配 +酎 +酏 +酐 +酒 +酗 +酚 +酝 +酞 +酡 +酢 +酣 +酤 +酥 +酦 +酩 +酪 +酬 +酮 +酯 +酰 +酱 +酲 +酴 +酵 +酶 +酷 +酸 +酹 +酺 +酽 +酾 +酿 +醅 +醇 +醉 +醋 +醌 +醍 +醐 +醑 +醒 +醚 +醛 +醢 +醨 +醪 +醭 +醮 +醯 +醴 +醵 +醺 +醾 +采 +釉 +释 +里 +重 +野 +量 +釐 +金 +釜 +鉴 +銎 +銮 +鋆 +鋈 +錾 +鍪 +鎏 +鏊 +鏖 +鐾 +鑫 +钆 +钇 +针 +钉 +钊 +钋 +钌 +钍 +钎 +钏 +钐 +钒 +钓 +钔 +钕 +钖 +钗 +钘 +钙 +钚 +钛 +钜 +钝 +钞 +钟 +钠 +钡 +钢 +钣 +钤 +钥 +钦 +钧 +钨 +钩 +钪 +钫 +钬 +钭 +钮 +钯 +钰 +钱 +钲 +钳 +钴 +钵 +钷 +钹 +钺 +钻 +钼 +钽 +钾 +钿 +铀 +铁 +铂 +铃 +铄 +铅 +铆 +铈 +铉 +铊 +铋 +铌 +铍 +铎 +铏 +铐 +铑 +铒 +铕 +铖 +铗 +铘 +铙 +铚 +铛 +铜 +铝 +铞 +铟 +铠 +铡 +铢 +铣 +铤 +铥 +铧 +铨 +铩 +铪 +铫 +铬 +铭 +铮 +铯 +铰 +铱 +铲 +铳 +铴 +铵 +银 +铷 +铸 +铹 +铺 +铻 +铼 +铽 +链 +铿 +销 +锁 +锂 +锃 +锄 +锅 +锆 +锇 +锈 +锉 +锊 +锋 +锌 +锍 +锎 +锏 +锐 +锑 +锒 +锓 +锔 +锕 +锖 +锗 +锘 +错 +锚 +锛 +锜 +锝 +锞 +锟 +锡 +锢 +锣 +锤 +锥 +锦 +锧 +锨 +锩 +锪 +锫 +锬 +锭 +键 +锯 +锰 +锱 +锲 +锳 +锴 +锵 +锶 +锷 +锸 +锹 +锺 +锻 +锼 +锽 +锾 +锿 +镀 +镁 +镂 +镃 +镄 +镅 +镆 +镇 +镈 +镉 +镊 +镋 +镌 +镍 +镎 +镏 +镐 +镑 +镒 +镓 +镔 +镕 +镖 +镗 +镘 +镚 +镛 +镜 +镝 +镞 +镠 +镡 +镢 +镣 +镤 +镥 +镦 +镧 +镨 +镩 +镪 +镫 +镬 +镭 +镮 +镯 +镰 +镱 +镲 +镳 +镴 +镵 +镶 +长 +门 +闩 +闪 +闫 +闭 +问 +闯 +闰 +闱 +闲 +闳 +间 +闵 +闶 +闷 +闸 +闹 +闺 +闻 +闼 +闽 +闾 +闿 +阀 +阁 +阂 +阃 +阄 +阅 +阆 +阇 +阈 +阉 +阊 +阋 +阌 +阍 +阎 +阏 +阐 +阑 +阒 +阔 +阕 +阖 +阗 +阘 +阙 +阚 +阜 +队 +阡 +阪 +阮 +阱 +防 +阳 +阴 +阵 +阶 +阻 +阼 +阽 +阿 +陀 +陂 +附 +际 +陆 +陇 +陈 +陉 +陋 +陌 +降 +陎 +限 +陑 +陔 +陕 +陛 +陞 +陟 +陡 +院 +除 +陧 +陨 +险 +陪 +陬 +陲 +陴 +陵 +陶 +陷 +隃 +隅 +隆 +隈 +隋 +隍 +随 +隐 +隔 +隗 +隘 +隙 +障 +隧 +隩 +隰 +隳 +隶 +隹 +隺 +隼 +隽 +难 +雀 +雁 +雄 +雅 +集 +雇 +雉 +雊 +雌 +雍 +雎 +雏 +雒 +雕 +雠 +雨 +雩 +雪 +雯 +雱 +雳 +零 +雷 +雹 +雾 +需 +霁 +霄 +霅 +霆 +震 +霈 +霉 +霍 +霎 +霏 +霓 +霖 +霜 +霞 +霨 +霪 +霭 +霰 +露 +霸 +霹 +霾 +青 +靓 +靖 +静 +靛 +非 +靠 +靡 +面 +靥 +革 +靬 +靰 +靳 +靴 +靶 +靸 +靺 +靼 +靽 +靿 +鞁 +鞅 +鞋 +鞍 +鞑 +鞒 +鞔 +鞘 +鞠 +鞡 +鞣 +鞧 +鞨 +鞫 +鞬 +鞭 +鞮 +鞯 +鞲 +鞳 +鞴 +韂 +韦 +韧 +韨 +韩 +韪 +韫 +韬 +韭 +音 +韵 +韶 +页 +顶 +顷 +顸 +项 +顺 +须 +顼 +顽 +顾 +顿 +颀 +颁 +颂 +颃 +预 +颅 +领 +颇 +颈 +颉 +颊 +颋 +颌 +颍 +颎 +颏 +颐 +频 +颓 +颔 +颖 +颗 +题 +颙 +颚 +颛 +颜 +额 +颞 +颟 +颠 +颡 +颢 +颤 +颥 +颦 +颧 +风 +飏 +飐 +飑 +飒 +飓 +飔 +飕 +飗 +飘 +飙 +飞 +食 +飧 +飨 +餍 +餐 +餮 +饔 +饕 +饥 +饧 +饨 +饩 +饪 +饫 +饬 +饭 +饮 +饯 +饰 +饱 +饲 +饳 +饴 +饵 +饶 +饷 +饸 +饹 +饺 +饻 +饼 +饽 +饿 +馁 +馃 +馄 +馅 +馆 +馇 +馈 +馉 +馊 +馋 +馌 +馍 +馏 +馐 +馑 +馒 +馓 +馔 +馕 +首 +馗 +馘 +香 +馝 +馞 +馥 +馧 +馨 +马 +驭 +驮 +驯 +驰 +驱 +驲 +驳 +驴 +驵 +驶 +驷 +驸 +驹 +驺 +驻 +驼 +驽 +驾 +驿 +骀 +骁 +骂 +骃 +骄 +骅 +骆 +骇 +骈 +骉 +骊 +骋 +验 +骍 +骎 +骏 +骐 +骑 +骒 +骓 +骕 +骖 +骗 +骘 +骙 +骚 +骛 +骜 +骝 +骞 +骟 +骠 +骡 +骢 +骣 +骤 +骥 +骦 +骧 +骨 +骰 +骱 +骶 +骷 +骸 +骺 +骼 +髀 +髁 +髂 +髃 +髅 +髋 +髌 +髎 +髑 +髓 +高 +髡 +髢 +髦 +髫 +髭 +髯 +髹 +髻 +髽 +鬃 +鬈 +鬏 +鬒 +鬓 +鬘 +鬟 +鬣 +鬯 +鬲 +鬶 +鬷 +鬻 +鬼 +魁 +魂 +魃 +魄 +魅 +魆 +魇 +魈 +魉 +魋 +魍 +魏 +魑 +魔 +鱼 +鱽 +鱾 +鱿 +鲀 +鲁 +鲂 +鲃 +鲅 +鲆 +鲇 +鲈 +鲉 +鲊 +鲋 +鲌 +鲍 +鲎 +鲏 +鲐 +鲑 +鲒 +鲔 +鲕 +鲖 +鲗 +鲘 +鲙 +鲚 +鲛 +鲜 +鲝 +鲞 +鲟 +鲠 +鲡 +鲢 +鲣 +鲤 +鲥 +鲦 +鲧 +鲨 +鲩 +鲪 +鲫 +鲬 +鲭 +鲮 +鲯 +鲰 +鲱 +鲲 +鲳 +鲴 +鲵 +鲷 +鲸 +鲹 +鲺 +鲻 +鲼 +鲽 +鲾 +鲿 +鳀 +鳁 +鳂 +鳃 +鳄 +鳅 +鳇 +鳈 +鳉 +鳊 +鳌 +鳍 +鳎 +鳏 +鳐 +鳑 +鳒 +鳓 +鳔 +鳕 +鳖 +鳗 +鳘 +鳙 +鳚 +鳛 +鳜 +鳝 +鳞 +鳟 +鳠 +鳡 +鳢 +鳣 +鳤 +鸟 +鸠 +鸡 +鸢 +鸣 +鸤 +鸥 +鸦 +鸧 +鸨 +鸩 +鸪 +鸫 +鸬 +鸭 +鸮 +鸯 +鸰 +鸱 +鸲 +鸳 +鸵 +鸶 +鸷 +鸸 +鸹 +鸺 +鸻 +鸼 +鸽 +鸾 +鸿 +鹀 +鹁 +鹂 +鹃 +鹄 +鹅 +鹆 +鹇 +鹈 +鹉 +鹊 +鹋 +鹌 +鹍 +鹎 +鹏 +鹐 +鹑 +鹒 +鹔 +鹕 +鹖 +鹗 +鹘 +鹙 +鹚 +鹛 +鹜 +鹝 +鹞 +鹟 +鹠 +鹡 +鹢 +鹣 +鹤 +鹦 +鹧 +鹨 +鹩 +鹪 +鹫 +鹬 +鹭 +鹮 +鹯 +鹰 +鹱 +鹲 +鹳 +鹴 +鹾 +鹿 +麀 +麂 +麇 +麈 +麋 +麑 +麒 +麓 +麖 +麝 +麟 +麦 +麸 +麹 +麻 +麽 +麾 +黄 +黇 +黉 +黍 +黎 +黏 +黑 +黔 +默 +黛 +黜 +黝 +黟 +黠 +黡 +黢 +黥 +黧 +黩 +黪 +黯 +黹 +黻 +黼 +黾 +鼋 +鼍 +鼎 +鼐 +鼒 +鼓 +鼗 +鼙 +鼠 +鼢 +鼩 +鼫 +鼬 +鼯 +鼱 +鼷 +鼹 +鼻 +鼽 +鼾 +齁 +齇 +齉 +齐 +齑 +齿 +龀 +龁 +龂 +龃 +龄 +龅 +龆 +龇 +龈 +龉 +龊 +龋 +龌 +龙 +龚 +龛 +龟 +龠 +龢 +鿍 +鿎 +鿏 +㑇 +㑊 +㕮 +㘎 +㙍 +㙘 +㙦 +㛃 +㛚 +㛹 +㟃 +㠇 +㠓 +㤘 +㥄 +㧐 +㧑 +㧟 +㫰 +㬊 +㬎 +㬚 +㭎 +㭕 +㮾 +㰀 +㳇 +㳘 +㳚 +㴔 +㵐 +㶲 +㸆 +㸌 +㺄 +㻬 +㽏 +㿠 +䁖 +䂮 +䃅 +䃎 +䅟 +䌹 +䎃 +䎖 +䏝 +䏡 +䏲 +䐃 +䓖 +䓛 +䓨 +䓫 +䓬 +䗖 +䗛 +䗪 +䗴 +䜣 +䝙 +䢺 +䢼 +䣘 +䥽 +䦃 +䲟 +䲠 +䲢 +䴓 +䴔 +䴕 +䴖 +䴗 +䴘 +䴙 +䶮 +𠅤 +𠙶 +𠳐 +𡎚 +𡐓 +𣗋 +𣲗 +𣲘 +𣸣 +𤧛 +𤩽 +𤫉 +𥔲 +𥕢 +𥖨 +𥻗 +𦈡 +𦒍 +𦙶 +𦝼 +𦭜 +𦰡 +𧿹 +𨐈 +𨙸 +𨚕 +𨟠 +𨭉 +𨱇 +𨱏 +𨱑 +𨱔 +𨺙 +𩽾 +𩾃 +𩾌 +𪟝 +𪣻 +𪤗 +𪨰 +𪨶 +𪩘 +𪾢 +𫄧 +𫄨 +𫄷 +𫄸 +𫇭 +𫌀 +𫍣 +𫍯 +𫍲 +𫍽 +𫐄 +𫐐 +𫐓 +𫑡 +𫓧 +𫓯 +𫓶 +𫓹 +𫔍 +𫔎 +𫔶 +𫖮 +𫖯 +𫖳 +𫗧 +𫗴 +𫘜 +𫘝 +𫘦 +𫘧 +𫘨 +𫘪 +𫘬 +𫚕 +𫚖 +𫚭 +𫛭 +𫞩 +𫟅 +𫟦 +𫟹 +𫟼 +𫠆 +𫠊 +𫠜 +𫢸 +𫫇 +𫭟 +𫭢 +𫭼 +𫮃 +𫰛 +𫵷 +𫶇 +𫷷 +𫸩 +𬀩 +𬀪 +𬂩 +𬃊 +𬇕 +𬇙 +𬇹 +𬉼 +𬊈 +𬊤 +𬌗 +𬍛 +𬍡 +𬍤 +𬒈 +𬒔 +𬒗 +𬕂 +𬘓 +𬘘 +𬘡 +𬘩 +𬘫 +𬘬 +𬘭 +𬘯 +𬙂 +𬙊 +𬙋 +𬜬 +𬜯 +𬞟 +𬟁 +𬟽 +𬣙 +𬣞 +𬣡 +𬣳 +𬤇 +𬤊 +𬤝 +𬨂 +𬨎 +𬩽 +𬪩 +𬬩 +𬬭 +𬬮 +𬬱 +𬬸 +𬬹 +𬬻 +𬬿 +𬭁 +𬭊 +𬭎 +𬭚 +𬭛 +𬭤 +𬭩 +𬭬 +𬭯 +𬭳 +𬭶 +𬭸 +𬭼 +𬮱 +𬮿 +𬯀 +𬯎 +𬱖 +𬱟 +𬳵 +𬳶 +𬳽 +𬳿 +𬴂 +𬴃 +𬴊 +𬶋 +𬶍 +𬶏 +𬶐 +𬶟 +𬶠 +𬶨 +𬶭 +𬶮 +𬷕 +𬸘 +𬸚 +𬸣 +𬸦 +𬸪 +𬹼 +𬺈 +𬺓 diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/char/fullwidth_to_halfwidth.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/char/fullwidth_to_halfwidth.tsv new file mode 100644 index 0000000000000000000000000000000000000000..7b3fd042c8d626a1e8699bd6f28f90fc60831012 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/char/fullwidth_to_halfwidth.tsv @@ -0,0 +1,92 @@ +! ! +" " +# # +$ $ +% % +& & +' ' +( ( +) ) +* * ++ + +, , +- - +. . +/ / +0 0 +1 1 +2 2 +3 3 +4 4 +5 5 +6 6 +7 7 +8 8 +9 9 +; ; +< < += = +> > +? ? +@ @ +A A +B B +C C +D D +E E +F F +G G +H H +I I +J J +K K +L L +M M +N N +O O +P P +Q Q +R R +S S +T T +U U +V V +W W +X X +Y Y +Z Z +\ \ +^ ^ +_ _ +` ` +a a +b b +c c +d d +e e +f f +g g +h h +i i +j j +k k +l l +m m +n n +o o +p p +q q +r r +s s +t t +u u +v v +w w +x x +y y +z z +{ { +| | +: : +} } +~ ~ diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/char/oov_tags.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/char/oov_tags.tsv new file mode 100644 index 0000000000000000000000000000000000000000..cd6c56f5370054ed4a59a4dba43bcb34cd773faa --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/char/oov_tags.tsv @@ -0,0 +1 @@ + diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/char/punctuations_zh.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/char/punctuations_zh.tsv new file mode 100644 index 0000000000000000000000000000000000000000..3848d54f9fba3ed4c2dc32f94cdff31a58912994 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/char/punctuations_zh.tsv @@ -0,0 +1,74 @@ +! +? +。 +。 +" +# +$ +% +& +' +( +) +* ++ +, +- +/ +: +; +< += +> +@ +[ +\ +] +^ +_ +` +{ +| +} +~ +⦅ +⦆ +「 +」 +、 +、 +〃 +》 +「 +」 +『 +』 +【 +】 +〔 +〕 +〖 +〗 +〘 +〙 +〚 +〛 +〜 +〝 +〞 +〟 +〰 +– +— +‘ +’ +‛ +“ +” +„ +‟ +… +‧ +﹏ +< +> \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/char/upper_to_lower.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/char/upper_to_lower.tsv new file mode 100644 index 0000000000000000000000000000000000000000..1b603c530f08b36c8a19a1110378491e3f22520e --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/char/upper_to_lower.tsv @@ -0,0 +1,9 @@ +壹 一 +贰 二 +叁 三 +肆 四 +伍 五 +陆 六 +柒 七 +捌 八 +玖 九 diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/date/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/date/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..6ebc808fad7ac87484dbabf02dacacdd7f826c14 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/date/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/date/day.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/date/day.tsv new file mode 100644 index 0000000000000000000000000000000000000000..febc5762d6a778d5f023c0badba87a3f8a671f3f --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/date/day.tsv @@ -0,0 +1,40 @@ +1 一 +2 二 +3 三 +4 四 +5 五 +6 六 +7 七 +8 八 +9 九 +01 一 +02 二 +03 三 +04 四 +05 五 +06 六 +07 七 +08 八 +09 九 +10 十 +11 十一 +12 十二 +13 十三 +14 十四 +15 十五 +16 十六 +17 十七 +18 十八 +19 十九 +20 二十 +21 二十一 +22 二十二 +23 二十三 +24 二十四 +25 二十五 +26 二十六 +27 二十七 +28 二十八 +29 二十九 +30 三十 +31 三十一 \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/date/months.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/date/months.tsv new file mode 100644 index 0000000000000000000000000000000000000000..d156409242c2a2ca8d670d53c3ee98717fb3a96f --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/date/months.tsv @@ -0,0 +1,21 @@ +1 一 +2 二 +3 三 +4 四 +5 五 +6 六 +7 七 +8 八 +9 九 +10 十 +11 十一 +12 十二 +01 一 +02 二 +03 三 +04 四 +05 五 +06 六 +07 七 +08 八 +09 九 diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/date/suffix.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/date/suffix.tsv new file mode 100644 index 0000000000000000000000000000000000000000..b620aa18107da918bd36342786d17a9a03b5a4e2 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/date/suffix.tsv @@ -0,0 +1,16 @@ +ad 公元 +AD 公元 +a.d. 公元 +A.D. 公元 +ce 公元 +CE 公元 +c.e. 公元 +C.E. 公元 +bc 公元前 +BC 公元前 +b.c. 公元前 +B.C. 公元前 +bce 公元前 +BCE 公元前 +b.c.e. 公元前 +B.C.E. 公元前 diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/date/suffixes.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/date/suffixes.tsv new file mode 100644 index 0000000000000000000000000000000000000000..1370744b9147a76a39395cf7ea6634d41bc3c17a --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/date/suffixes.tsv @@ -0,0 +1,16 @@ +ad 公元 +AD 公元 +a.d. 公元 +A.D. 公元 +ce 公元 +CE 公元 +c.e. 公元 +C.E. 公元 +bc 公元前 +BC 公元前 +b.c. 公元前 +B.C. 公元前 +bce 公元前 +BCE 公元前 +b.c.e. 公元前 +B.C.E. 公元前 diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/denylist/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/denylist/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..a1cf281f0908d225f51d921e9ddbdf92f9b14d99 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/denylist/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/denylist/denylist.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/denylist/denylist.tsv new file mode 100644 index 0000000000000000000000000000000000000000..b419181407b9712f2e0ae41577957825486ca412 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/denylist/denylist.tsv @@ -0,0 +1,2 @@ +啊 +呃 \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/erhua/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/erhua/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..a1cf281f0908d225f51d921e9ddbdf92f9b14d99 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/erhua/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/erhua/whitelist.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/erhua/whitelist.tsv new file mode 100644 index 0000000000000000000000000000000000000000..f00ae31a5bff5f9bf0ec59fde67f7cdb067850b9 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/erhua/whitelist.tsv @@ -0,0 +1,35 @@ +儿女 +儿子 +儿孙 +女儿 +儿媳 +妻儿 +胎儿 +婴儿 +新生儿 +婴幼儿 +幼儿 +少儿 +小儿 +儿歌 +儿童 +儿科 +托儿所 +孤儿 +儿戏 +儿化 +台儿庄 +鹿儿岛 +正儿八经 +吊儿郎当 +生儿育女 +托儿带女 +养儿防老 +痴儿呆女 +佳儿佳妇 +儿怜兽扰 +儿无常父 +儿不嫌母丑 +儿行千里母担忧 +儿大不由爷 +苏乞儿 diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/math/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/math/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..a1cf281f0908d225f51d921e9ddbdf92f9b14d99 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/math/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/math/score.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/math/score.tsv new file mode 100644 index 0000000000000000000000000000000000000000..0647248d5c49095e7f2be2773b84f457677fab71 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/math/score.tsv @@ -0,0 +1,2 @@ +: 比 +: 比 diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/math/symbol.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/math/symbol.tsv new file mode 100644 index 0000000000000000000000000000000000000000..4eff86d48b0f021427923724d2d7ddd8df592e15 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/math/symbol.tsv @@ -0,0 +1,8 @@ ++ 加 +~ 到 +± 正负 += 等于 +× 乘 +÷ 除 +° 度 +- 减 \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/measure/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/measure/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..a1cf281f0908d225f51d921e9ddbdf92f9b14d99 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/measure/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/measure/units_en.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/measure/units_en.tsv new file mode 100644 index 0000000000000000000000000000000000000000..b1a8a832a67745b342ea8d43a29071c7d723c80f --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/measure/units_en.tsv @@ -0,0 +1,67 @@ +amu 原子质量 +bar 巴 +°c 摄氏度 +°C 摄氏度 +ºc 摄氏度 +ºC 摄氏度 +℃ 摄氏度 +cm2 平方厘米 +cm² 平方厘米 +cm3 立方厘米 +cm³ 立方厘米 +cm 厘米 +cwt 美担 +db 分贝 +dm3 立方分米 +dm³ 立方分米 +dm 分米 +ds 毫秒 +°f 华氏度 +°F 华氏度 +℉ 华氏度 +ft 英尺 +ghz 吉赫兹 +gw 吉瓦 +gwh 吉瓦时 +hz 赫兹 +kbps 千比特每秒 +kcal 千卡 +kgf 千克力 +kg 千克 +khz 千赫兹 +km2 平方千米 +km² 平方千米 +km 千米 +kpa 千帕 +kwh 千瓦时 +kw 千瓦 +kW 千瓦 +lb 磅 +lbs 磅 +ng 纳克 +nm 纳米 +ns 纳秒 +oz 盎司 +pa 帕斯卡 +rad 弧度 +rpm 转每分 +sq ft 平方英尺 +sq mi 平方英里 +sv 系沃特 +tb 太字节 +tj 万亿焦耳 +tl 台两 +v 伏特 +yd 码 +μg 微克 +μm 微米 +μs 微秒 +ω 欧米茄 +gb 吉字节 +gpa 吉帕斯卡 +gy 戈瑞 +ha 公顷 +pg 皮克 +ps 皮秒 +s 秒 +g 克 diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/money/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/money/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..6ebc808fad7ac87484dbabf02dacacdd7f826c14 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/money/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/money/currency_major.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/money/currency_major.tsv new file mode 100644 index 0000000000000000000000000000000000000000..b8083350771c9bd85145181cd92bb8c2f01f2b8e --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/money/currency_major.tsv @@ -0,0 +1,200 @@ +ALL 阿尔巴尼亚列克 +AFN 阿富汗 阿富汗尼 +ARS 阿根廷比索 +AWG 阿鲁巴盾 +AUD 澳元 +AZN 阿塞拜疆马纳特 +BSD 巴哈马元 +BBD 巴巴多斯元 +BYN 白俄罗斯卢布 +BZD 伯利兹元 +BMD 百慕大元 +BOB 玻利维亚玻利维亚诺 +BAM 波斯尼亚和黑塞哥维那可兑换马克 +BWP 博茨瓦纳普拉 +BGN 保加利亚列弗 +BRL 巴西雷亚尔 +BND 文莱达鲁萨兰国元 +KHR 柬埔寨瑞尔 +CAD 加元 +KYD 开曼群岛元 +CLP 智利比索 +CNY 人民币 +COP 哥伦比亚比索 +CRC 哥斯达黎加科隆 +HRK 克罗地亚库纳 +CUP 古巴比索 +CZK 捷克克朗 +DKK 丹麦克朗 +DOP 多米尼加共和国比索 +XCD 东加勒比元 +EGP 埃及镑 +SVC 萨尔瓦多科隆 +EUR 欧元成员国 +FKP 福克兰群岛(马尔维纳斯)镑 +FJD 斐济元 +GHS 加纳塞地 +GIP 直布罗陀镑 +GTQ 危地马拉格查尔 +GGP 根西岛镑 +GYD 圭亚那元 +HNL 洪都拉斯伦皮拉 +HKD 港元 +HUF 匈牙利福林 +ISK 冰岛克朗 +INR 印度卢比 +IDR 印尼盾 +IRR 伊朗里亚尔 +IMP 马恩岛英镑 +ILS 以色列谢克尔 +JMD 牙买加元 +JPY 日元 +JEP 泽西镑 +KZT 哈萨克斯坦腾格 +KPW 朝鲜园 +KRW 韩元 +KGS 吉尔吉斯斯坦索姆 +LAK 老挝基普 +LBP 黎巴嫩镑 +LRD 利比里亚元 +MKD 马其顿代纳尔 +MYR 马来西亚令吉 +MUR 毛里求斯卢比 +MXN 墨西哥比索 +MNT 蒙古图格里克 +MNT 摩洛哥迪拉姆 +MZN 莫桑比克梅蒂卡尔 +NAD 纳米比亚元 +NPR 尼泊尔卢比 +ANG 荷属安的列斯盾 +NZD 新西兰元 +NIO 尼加拉瓜科尔多瓦 +NGN 尼日利亚奈拉 +NOK 挪威克朗 +OMR 阿曼里亚尔 +PKR 巴基斯坦卢比 +PAB 巴拿马巴尔博亚 +PYG 巴拉圭瓜拉尼 +PEN 秘鲁索尔 +PHP 菲律宾比索 +PLN 波兰兹罗提 +QAR 卡塔尔里亚尔 +RON 罗马尼亚列伊 +RUB 俄罗斯卢布 +SHP 圣赫勒拿镑 +SAR 沙特阿拉伯里亚尔 +RSD 塞尔维亚第纳尔 +SCR 塞舌尔卢比 +SGD 新加坡元 +SBD 所罗门群岛元 +SOS 索马里先令 +ZAR 南非兰特 +LKR 斯里兰卡卢比 +SEK 瑞典克朗 +SRD 苏里南元 +SYP 叙利亚镑 +TWD 新台币 +THB 泰铢 +TTD 特立尼达和多巴哥元 +TRY 土耳其里拉 +TVD 图瓦卢元 +UAH 乌克兰格里夫纳 +AED 阿联酋迪拉姆 +GBP 英镑 +USD 美元 +UYU 乌拉圭比索 +UZS 乌兹别克斯坦索姆 +VEF 委内瑞拉玻利瓦尔 +VND 越南东 +YER 也门里亚尔 +ZWD 津巴布韦元 +J¥ 日元 +JPY¥ 日元 +HK$ 港元 +A$ 澳元 +CAD$ 加元 +US$ 美元 +€ 欧元 +£ 英镑 +Fr 瑞士法郎 +₣ 法郎 +¥ 圆 +Kr 韩元 +NXN$ 墨西哥比索 +NZD$ 新西兰元 +SGD$ 新加坡元 +HKD$ 港元 +NOKKr 挪威克朗 +₩ 韩元 +TRY₺ 土耳其里拉 +₽ 俄罗斯卢布 +BRLR$ 巴西雷亚尔 +DKKKr 丹麦克朗 +TWDNT$ 新台币 +฿ 泰铢 +RM 马来西亚林吉特 +Rp 印尼盾 +Kč 捷克克朗 +₪ 以色列新谢克尔 +CLP$ 智利披索 +₱ 菲律宾披索 +د.إ 阿联酋迪拉姆 +COL$ 哥伦比亚披索 +L 罗马尼亚列伊 +JPY¥ 日元 +¥ 人民币 +Lek 阿尔巴尼亚列克 +ƒ 阿鲁巴盾 +Br 白俄罗斯卢布 +BZ$ 伯利兹元 +$b 玻利维亚玻利维亚诺 +KM 波斯尼亚和黑塞哥维那可兑换马克 +P 博茨瓦纳普拉 +лв 保加利亚列弗 +R$ 巴西雷亚尔 +៛ 柬埔寨瑞尔 +¥ 人民币 +₡ 哥斯达黎加科隆 +kn 克罗地亚库纳 +₱ 古巴比索 +kr 丹麦克朗 +RD$ 多米尼加共和国比索 +¢ 加纳塞地 +Q 危地马拉格查尔 +L 洪都拉斯伦皮拉 +Ft 匈牙利福林 +₹ 印度卢比 +£ 英镑 +₪ 以色列谢克尔 +J$ 牙买加元 +лв 哈萨克斯坦腾格 +лв 吉尔吉斯斯坦索姆 +₭ 老挝基普 +ден 马其顿代纳尔 +₨ 毛里求斯卢比 +₮ 蒙古图格里克 +MT 莫桑比克梅蒂卡尔 +C$ 尼加拉瓜科尔多瓦 +₦ 尼日利亚奈拉 +₨ 巴基斯坦卢比 +B/. 巴拿马巴尔博亚 +Gs 巴拉圭瓜拉尼 +S/. 秘鲁索尔 +₱ 菲律宾比索 +zł 波兰兹罗提 +lei 罗马尼亚列伊 +₽ 卢布 +Дин. 塞尔维亚第纳尔 +S 索马里先令 +R 南非兰特 +CHF 瑞士法郎 +NT$ 新台币 +TT$ 特立尼达和多巴哥元 +₺ 土耳其里拉 +₴ 乌克兰格里夫纳 +$ 美元 +$U 乌拉圭比索 +лв 乌兹别克斯坦索姆 +Bs 委内瑞拉玻利瓦尔 +₫ 越南东 +Z$ 津巴布韦元 \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/money/currency_mandarin.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/money/currency_mandarin.tsv new file mode 100644 index 0000000000000000000000000000000000000000..de1ccc7112245887075d796c9ae7c852b79066a4 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/money/currency_mandarin.tsv @@ -0,0 +1,52 @@ +美元 +美金 +欧元 +英镑 +加元 +瑞士法郎 +法郎 +加拿大元 +元 +圆 +韩元 +墨西哥比索 +比索 +新西兰元 +新加坡元 +港元 +港币 +人民币 +挪威克朗 +克朗 +韩元 +土耳其里拉 +里拉 +印度卢比 +卢比 +俄罗斯卢布 +卢布 +巴西雷亚尔 +雷亚尔 +南非兰特 +兰特 +丹麦克朗 +波兰兹罗提 +罗提 +新台币 +台币 +泰铢 +马来西亚林吉特 +印尼盾 +盾 +匈牙利福林 +福林 +捷克克朗 +以色列新谢克尔 +新谢克尔 +智利比索 +菲律宾披索 +阿联酋迪拉姆 +迪拉姆 +哥伦比亚披索 +马来西亚令吉 +日元 diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/number/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/number/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..6ebc808fad7ac87484dbabf02dacacdd7f826c14 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/number/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/number/digit.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/number/digit.tsv new file mode 100644 index 0000000000000000000000000000000000000000..3a578d35897c0a09304357594a18a9ffa6e88b91 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/number/digit.tsv @@ -0,0 +1,9 @@ +1 一 +2 二 +3 三 +4 四 +5 五 +6 六 +7 七 +8 八 +9 九 diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/number/digit_alt.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/number/digit_alt.tsv new file mode 100644 index 0000000000000000000000000000000000000000..b949b95088a41bd4eef0cd97ac1dee6fb9b84ead --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/number/digit_alt.tsv @@ -0,0 +1,9 @@ +1 一 +2 两 +3 三 +4 四 +5 五 +6 六 +7 七 +8 八 +9 九 diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/number/digit_tens.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/number/digit_tens.tsv new file mode 100644 index 0000000000000000000000000000000000000000..884a8ba5fe724007ab175c9c97b184bb1bd116f9 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/number/digit_tens.tsv @@ -0,0 +1,8 @@ +2 二 +3 三 +4 四 +5 五 +6 六 +7 七 +8 八 +9 九 \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/number/sign.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/number/sign.tsv new file mode 100644 index 0000000000000000000000000000000000000000..645adbdf19969bbf6b8a64d916de5a4d7674e0a6 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/number/sign.tsv @@ -0,0 +1,2 @@ +- 负 ++ 正 diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/number/suffix.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/number/suffix.tsv new file mode 100644 index 0000000000000000000000000000000000000000..f44c0e151382c3066d4c15f487ab3e6168668082 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/number/suffix.tsv @@ -0,0 +1,23 @@ +万 +十万 +百万 +千万 +亿 +十亿 +百亿 +千亿 +萬 +十萬 +百萬 +千萬 +億 +十億 +百億 +千億 +拾萬 +佰萬 +仟萬 +拾億 +佰億 +仟億 + diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/number/teen.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/number/teen.tsv new file mode 100644 index 0000000000000000000000000000000000000000..52dc01917bd4f329f0f49d48f0a2d7017354475f --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/number/teen.tsv @@ -0,0 +1,10 @@ +10 十 +11 十一 +12 十二 +13 十三 +14 十四 +15 十五 +16 十六 +17 十七 +18 十八 +19 十九 diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/number/teen_alt.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/number/teen_alt.tsv new file mode 100644 index 0000000000000000000000000000000000000000..a48662621d42110aaec1fcf09cb1a01761981883 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/number/teen_alt.tsv @@ -0,0 +1,10 @@ +10 一十 +11 一十一 +12 一十二 +13 一十三 +14 一十四 +15 一十五 +16 一十六 +17 一十七 +18 一十八 +19 一十九 diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/number/ties.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/number/ties.tsv new file mode 100644 index 0000000000000000000000000000000000000000..2a73c039923ba4d315378a3c91b19b14e9c120e6 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/number/ties.tsv @@ -0,0 +1,8 @@ +2 二十 +3 三十 +4 四十 +5 五十 +6 六十 +7 七十 +8 八十 +9 九十 diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/number/zero.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/number/zero.tsv new file mode 100644 index 0000000000000000000000000000000000000000..d6b9cece55a48a250d810fb13daa1917943ef90e --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/number/zero.tsv @@ -0,0 +1 @@ +0 零 diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/time/AM.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/time/AM.tsv new file mode 100644 index 0000000000000000000000000000000000000000..b39eb5125c57212e430537e20f1f6573819a993e --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/time/AM.tsv @@ -0,0 +1,8 @@ +am +AM +a.m. +A.M. + am + AM + a.m. + A.M. \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/time/PM.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/time/PM.tsv new file mode 100644 index 0000000000000000000000000000000000000000..197fd1b3ab50c3c3e7aecad8013a781c49ddc576 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/time/PM.tsv @@ -0,0 +1,8 @@ +pm +p.m. +PM +P.M. + pm + p.m. + PM + P.M. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/time/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/time/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..6ebc808fad7ac87484dbabf02dacacdd7f826c14 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/time/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/time/hour.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/time/hour.tsv new file mode 100644 index 0000000000000000000000000000000000000000..17791c796d6ac3de0593200562ab01484c4a752a --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/time/hour.tsv @@ -0,0 +1,35 @@ +1 一 +01 一 +2 两 +02 两 +3 三 +03 三 +4 四 +04 四 +5 五 +05 五 +6 六 +06 六 +7 七 +07 七 +8 八 +08 八 +9 九 +09 九 +10 十 +11 十一 +12 十二 +13 十三 +14 十四 +15 十五 +16 十六 +17 十七 +18 十八 +19 十九 +20 二十 +21 二十一 +22 二十二 +23 二十三 +24 二十四 +0 零 +00 零 \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/time/minute.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/time/minute.tsv new file mode 100644 index 0000000000000000000000000000000000000000..68f849f4305b499ac53a96dc3df784d260295362 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/time/minute.tsv @@ -0,0 +1,71 @@ +1 一 +01 一 +2 二 +02 二 +3 三 +03 三 +4 四 +04 四 +5 五 +05 五 +6 六 +06 六 +7 七 +07 七 +8 八 +08 八 +9 九 +09 九 +10 十 +11 十一 +12 十二 +13 十三 +14 十四 +15 十五 +16 十六 +17 十七 +18 十八 +19 十九 +20 二十 +21 二十一 +22 二十二 +23 二十三 +24 二十四 +25 二十五 +26 二十六 +27 二十七 +28 二十八 +29 二十九 +30 三十 +31 三十一 +32 三十三 +33 三十三 +34 三十四 +35 三十五 +36 三十六 +37 三十七 +38 三十八 +39 三十九 +40 四十 +41 四十一 +42 四十二 +43 四十三 +44 四十四 +45 四十五 +46 四十六 +47 四十七 +48 四十八 +49 四十九 +50 五十 +51 五十一 +52 五十二 +53 五十三 +54 五十四 +55 五十五 +56 五十六 +57 五十七 +58 五十八 +59 五十九 +60 六十 +0 零 +00 零 \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/time/second.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/time/second.tsv new file mode 100644 index 0000000000000000000000000000000000000000..68f849f4305b499ac53a96dc3df784d260295362 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/time/second.tsv @@ -0,0 +1,71 @@ +1 一 +01 一 +2 二 +02 二 +3 三 +03 三 +4 四 +04 四 +5 五 +05 五 +6 六 +06 六 +7 七 +07 七 +8 八 +08 八 +9 九 +09 九 +10 十 +11 十一 +12 十二 +13 十三 +14 十四 +15 十五 +16 十六 +17 十七 +18 十八 +19 十九 +20 二十 +21 二十一 +22 二十二 +23 二十三 +24 二十四 +25 二十五 +26 二十六 +27 二十七 +28 二十八 +29 二十九 +30 三十 +31 三十一 +32 三十三 +33 三十三 +34 三十四 +35 三十五 +36 三十六 +37 三十七 +38 三十八 +39 三十九 +40 四十 +41 四十一 +42 四十二 +43 四十三 +44 四十四 +45 四十五 +46 四十六 +47 四十七 +48 四十八 +49 四十九 +50 五十 +51 五十一 +52 五十二 +53 五十三 +54 五十四 +55 五十五 +56 五十六 +57 五十七 +58 五十八 +59 五十九 +60 六十 +0 零 +00 零 \ No newline at end of file diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/time/zero.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/time/zero.tsv new file mode 100644 index 0000000000000000000000000000000000000000..573541ac9702dd3969c9bc859d2b91ec1f7e6e56 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/time/zero.tsv @@ -0,0 +1 @@ +0 diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/whitelist.tsv b/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/whitelist.tsv new file mode 100644 index 0000000000000000000000000000000000000000..e8810f42ae838755e366cb2bee25c80c86543be4 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/zh/data/whitelist.tsv @@ -0,0 +1,157 @@ +O 2 O O to O +O2O O to O +P 2 P P to P +P2P P to P +CD C D +a.m. AM +am. AM +A M AM +Am AM + am AM +p.m. PM +pm. PM +Pm PM + pm PM +atm ATM +A T M ATM +Atm ATM +ufo UFO +Ufo UFO +U F O UFO +u f o UFO +m v MV +mv MV +MV MV +F I F A fifa +f i f a fifa +FIFA fifa +nba NBA +Nba NBA +NBA NBA +n b a NBA +x L XL +X L XL +x x L XXL +X X L XXL +x x x L XXXL +X X X L XXXL +Q Q QQ +qq QQ +Qq QQ +gpu GPU +GPU GPU +cpu CPU +C P U CPU +WIFI wifi +ms MS +ceo CEO +c e o CEO +C E O CEO +dv DV +d v DV +D V DV +wto WTO +w t o WTO +W T O WTO +pc PC +p c PC +P C PC +gps GPS +G P S GPS +M.V.P MVP +mvp MVP +M V P MVP +vip VIP +V I P VIP +cba CBA +c b a CBA +CBA CBA +mba MBA +m b a MBA +M B A MBA +iq IQ +IQ IQ +EQ EQ +cctv CCTV +C C t v CCTV +kfc KFC +K F C KFC +Steam steam +O 2 O O to O +O2O O to O +P 2 P P to P +P2P P to P +CD C D +a.m. AM +am. AM +A M AM +Am AM + am AM +p.m. PM +pm. PM +Pm PM + pm PM +atm ATM +A T M ATM +Atm ATM +ufo UFO +Ufo UFO +U F O UFO +u f o UFO +m v MV +mv MV +MV MV +F I F A fifa +f i f a fifa +FIFA fifa +nba NBA +Nba NBA +NBA NBA +n b a NBA +x L XL +X L XL +x x L XXL +X X L XXL +x x x L XXXL +X X X L XXXL +Q Q QQ +qq QQ +Qq QQ +gpu GPU +GPU GPU +cpu CPU +C P U CPU +WIFI wifi +ms MS +ceo CEO +c e o CEO +C E O CEO +dv DV +d v DV +D V DV +wto WTO +w t o WTO +W T O WTO +pc PC +p c PC +P C PC +gps GPS +G P S GPS +M.V.P MVP +mvp MVP +M V P MVP +vip VIP +V I P VIP +cba CBA +c b a CBA +CBA CBA +mba MBA +m b a MBA +M B A MBA +iq IQ +IQ IQ +EQ EQ +cctv CCTV +C C t v CCTV +kfc KFC +K F C KFC diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/zh/graph_utils.py b/zonos3/vendor/nemo_text_processing/text_normalization/zh/graph_utils.py new file mode 100644 index 0000000000000000000000000000000000000000..a05802663ed5210ddb029ec618cad607c1d5c982 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/zh/graph_utils.py @@ -0,0 +1,153 @@ +# Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import os +import string +from pathlib import Path +from typing import Dict + +import pynini +from pynini import Far +from pynini.export import export +from pynini.lib import byte, pynutil, utf8 + +from zonos3.vendor.nemo_text_processing.utils.logging import logger + +# ghaph_utils is here since importing from en folders will cause import errors +# that the data file names have to be the same with what are in the en folder + +NEMO_CHAR = utf8.VALID_UTF8_CHAR + +NEMO_DIGIT = byte.DIGIT +NEMO_LOWER = pynini.union(*string.ascii_lowercase).optimize() +NEMO_UPPER = pynini.union(*string.ascii_uppercase).optimize() +NEMO_ALPHA = pynini.union(NEMO_LOWER, NEMO_UPPER).optimize() +NEMO_NON_BREAKING_SPACE = "\u00a0" +NEMO_SPACE = " " +NEMO_WHITE_SPACE = pynini.union(" ", "\t", "\n", "\r", "\u00a0").optimize() +NEMO_NOT_SPACE = pynini.difference(NEMO_CHAR, NEMO_WHITE_SPACE).optimize() +NEMO_NOT_QUOTE = pynini.difference(NEMO_CHAR, r'"').optimize() + +NEMO_PUNCT = pynini.union(*map(pynini.escape, string.punctuation)).optimize() + +NEMO_SIGMA = pynini.closure(NEMO_CHAR) +NEMO_NOT_ALPHA = pynini.difference(NEMO_SIGMA, NEMO_ALPHA).optimize() +NEMO_SPACE_CHAR = pynini.union(NEMO_CHAR, NEMO_SPACE) + +delete_space = pynutil.delete(pynini.closure(NEMO_WHITE_SPACE)) +delete_zero_or_one_space = pynutil.delete(pynini.closure(NEMO_WHITE_SPACE, 0, 1)) +insert_space = pynutil.insert(" ") +delete_extra_space = pynini.cross(pynini.closure(NEMO_WHITE_SPACE, 1), " ") +delete_preserve_order = pynini.closure( + pynutil.delete(" preserve_order: true") + | (pynutil.delete(" field_order: \"") + NEMO_NOT_QUOTE + pynutil.delete("\"")) +) + + +def generator_main(file_name: str, graphs: Dict[str, "pynini.FstLike"]): + """ + Exports graph as OpenFst finite state archive (FAR) file with given file name and rule name. + + Args: + file_name: exported file name + graphs: Mapping of a rule name and Pynini WFST graph to be exported + """ + exporter = export.Exporter(file_name) + for rule, graph in graphs.items(): + exporter[rule] = graph.optimize() + exporter.close() + logger.info(f"Created {file_name}") + + +class GraphFst: + """ + Base class for all grammar fsts. + + Args: + name: name of grammar class + kind: either 'classify' or 'verbalize' + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, name: str, kind: str, deterministic: bool = True): + self.name = name + self.kind = kind + self._fst = None + self.deterministic = deterministic + + self.far_path = Path(os.path.dirname(__file__) + "/grammars/" + kind + "/" + name + ".far") + if self.far_exist(): + self._fst = Far(self.far_path, mode="r", arc_type="standard", far_type="default").get_fst() + + def far_exist(self) -> bool: + """ + Returns true if FAR can be loaded + """ + return self.far_path.exists() + + @property + def fst(self) -> "pynini.FstLike": + return self._fst + + @fst.setter + def fst(self, fst): + self._fst = fst + + def add_tokens(self, fst) -> "pynini.FstLike": + """ + Wraps class name around to given fst + + Args: + fst: input fst + + Returns: + Fst: fst + """ + return pynutil.insert(f"{self.name} {{ ") + fst + pynutil.insert(" }") + + def delete_tokens(self, fst) -> "pynini.FstLike": + """ + Deletes class name wrap around output of given fst + + Args: + fst: input fst + + Returns: + Fst: fst + """ + res = ( + pynutil.delete(f"{self.name}") + + delete_space + + pynutil.delete("{") + + delete_space + + fst + + delete_space + + pynutil.delete("}") + ) + return res @ pynini.cdrewrite(pynini.cross("\u00a0", " "), "", "", NEMO_SIGMA) + + +def convert_space(fst) -> "pynini.FstLike": + """ + Converts space to nonbreaking space. + Used only in tagger grammars for transducing token values within quotes, e.g. name: "hello kitty" + This is making transducer significantly slower, so only use when there could be potential spaces within quotes, otherwise leave it. + + Args: + fst: input fst + + Returns output fst where breaking spaces are converted to non breaking spaces + """ + return fst @ pynini.cdrewrite(pynini.cross(NEMO_SPACE, NEMO_NON_BREAKING_SPACE), "", "", NEMO_SIGMA) diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/zh/taggers/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/zh/taggers/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..6ebc808fad7ac87484dbabf02dacacdd7f826c14 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/zh/taggers/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/zh/taggers/cardinal.py b/zonos3/vendor/nemo_text_processing/text_normalization/zh/taggers/cardinal.py new file mode 100644 index 0000000000000000000000000000000000000000..b70141cf3814ee3441f5cba740dc4d9e51bc8f53 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/zh/taggers/cardinal.py @@ -0,0 +1,192 @@ +# Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.zh.graph_utils import NEMO_DIGIT, GraphFst +from zonos3.vendor.nemo_text_processing.text_normalization.zh.utils import get_abs_path + + +class CardinalFst(GraphFst): + """ + Finite state transducer for classifying cardinals + e.g. 23 -> cardinal { integer: "二十三" } + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="cardinal", kind="classify", deterministic=deterministic) + graph_zero = pynini.string_file(get_abs_path("data/number/zero.tsv")) + graph_digit = pynini.string_file(get_abs_path("data/number/digit.tsv")) + graph_digit_alt = pynini.string_file(get_abs_path("data/number/digit_alt.tsv")) + graph_ties = pynini.string_file(get_abs_path("data/number/ties.tsv")) + graph_teen = pynini.string_file(get_abs_path("data/number/teen.tsv")) + graph_teen_alt = pynini.string_file(get_abs_path("data/number/teen_alt.tsv")) + + alls = NEMO_DIGIT**2 | NEMO_DIGIT**1 + graph_all = ( + (graph_ties + (graph_digit | pynutil.delete('0'))) | graph_teen_alt | graph_digit + ) # graph_all when within a larger number e.g., 316-> 三百一十六 instead of 三百十六 + + graph_all = alls @ graph_all + graph_all_alt = ( + (graph_ties + (graph_digit | pynutil.delete('0'))) | graph_teen | graph_digit + ) # graph_all when at the head of the larger numbere.g., 13万 -> 十三万 instead of 一十三万 + graph_all_alt = alls @ graph_all_alt + + hundreds = NEMO_DIGIT**3 + graph_hundred_component = (graph_digit + pynutil.insert('百')) + pynini.union( + pynini.closure(pynutil.delete('0')), + (pynini.closure(pynutil.delete('0') + pynutil.insert('零')) + graph_all), + ) + graph_hundred = hundreds @ graph_hundred_component + + self.digit = graph_digit.optimize() + self.all = graph_all.optimize() + + thousands = NEMO_DIGIT**4 + graph_thousand_component = (graph_digit_alt + pynutil.insert('千')) + pynini.union( + pynini.closure(pynutil.delete('0')), + graph_hundred_component, + (pynini.closure(pynutil.delete('0')) + pynutil.insert('零') + graph_all), + ) + graph_thousand = thousands @ graph_thousand_component + + ten_thousands = NEMO_DIGIT**5 + graph_ten_thousand_component = (graph_digit_alt + pynutil.insert('万')) + pynini.union( + pynini.closure(pynutil.delete('0')), + graph_thousand_component, + (pynutil.delete('0') + pynutil.insert('零') + graph_hundred_component), + (pynini.closure(pynutil.delete('0')) + pynutil.insert('零') + graph_all), + ) + graph_ten_thousand = ten_thousands @ graph_ten_thousand_component + + hundred_thousands = NEMO_DIGIT**6 + hundred_thousands_position = NEMO_DIGIT**2 + hundred_thousands_position = hundred_thousands_position @ graph_all_alt + graph_hundred_thousand_component = (hundred_thousands_position + pynutil.insert('万')) + pynini.union( + pynini.closure(pynutil.delete('0')), + graph_thousand_component, + (pynutil.delete('0') + pynutil.insert('零') + graph_hundred_component), + (pynini.closure(pynutil.delete('0')) + pynutil.insert('零') + graph_all), + ) + graph_hundred_thousand = hundred_thousands @ graph_hundred_thousand_component + + millions = NEMO_DIGIT**7 + million_position = NEMO_DIGIT**3 + million_position = million_position @ graph_hundred_component + graph_million_component = (million_position + pynutil.insert('万')) + pynini.union( + pynini.closure(pynutil.delete('0')), + graph_thousand_component, + (pynutil.delete('0') + pynutil.insert('零') + graph_hundred_component), + (pynini.closure(pynutil.delete('0')) + pynutil.insert('零') + graph_all), + ) + graph_million = millions @ graph_million_component + + ten_millions = NEMO_DIGIT**8 + ten_million_position = NEMO_DIGIT**4 + ten_million_position = ten_million_position @ graph_thousand_component + graph_ten_million_component = (ten_million_position + pynutil.insert('万')) + pynini.union( + pynini.closure(pynutil.delete('0')), + graph_thousand_component, + (pynutil.delete('0') + pynutil.insert('零') + graph_hundred_component), + (pynini.closure(pynutil.delete('0')) + pynutil.insert('零') + graph_all), + ) + graph_ten_million = ten_millions @ graph_ten_million_component + + hundred_millions = NEMO_DIGIT**9 + graph_hundred_million_component = (graph_digit_alt + pynutil.insert('亿')) + pynini.union( + pynini.closure(pynutil.delete('0')), + graph_ten_million_component, + (pynutil.delete('0') + pynutil.insert('零') + graph_million_component), + (pynutil.delete('00') + pynutil.insert('零') + graph_hundred_thousand_component), + (pynutil.delete('000') + pynutil.insert('零') + graph_ten_thousand_component), + (pynutil.delete('0000') + pynutil.insert('零') + graph_thousand_component), + (pynutil.delete('00000') + pynutil.insert('零') + graph_hundred_component), + (pynini.closure(pynutil.delete('0')) + pynutil.insert('零') + graph_all), + ) + graph_hundred_million = hundred_millions @ graph_hundred_million_component + + thousand_millions = NEMO_DIGIT**10 + thousand_millions_position = NEMO_DIGIT**2 + thousand_millions_position = thousand_millions_position @ graph_all_alt + graph_thousand_million_component = (thousand_millions_position + pynutil.insert('亿')) + pynini.union( + pynini.closure(pynutil.delete('0')), + graph_ten_million_component, + (pynutil.delete('0') + pynutil.insert('零') + graph_million_component), + (pynutil.delete('00') + pynutil.insert('零') + graph_hundred_thousand_component), + (pynutil.delete('000') + pynutil.insert('零') + graph_ten_thousand_component), + (pynutil.delete('0000') + pynutil.insert('零') + graph_thousand_component), + ((pynutil.delete('00000') + pynutil.insert('零') + graph_hundred_component)), + (pynini.closure(pynutil.delete('0')) + pynutil.insert('零') + graph_all), + ) + graph_thousand_million = thousand_millions @ graph_thousand_million_component + + ten_billions = NEMO_DIGIT**11 + ten_billions_position = NEMO_DIGIT**3 + ten_billions_position = ten_billions_position @ graph_hundred_component + graph_ten_billions_component = (ten_billions_position + pynutil.insert('亿')) + pynini.union( + pynini.closure(pynutil.delete('0')), + graph_ten_million_component, + (pynutil.delete('0') + pynutil.insert('零') + graph_million_component), + (pynutil.delete('00') + pynutil.insert('零') + graph_hundred_thousand_component), + (pynutil.delete('000') + pynutil.insert('零') + graph_ten_thousand_component), + (pynutil.delete('0000') + pynutil.insert('零') + graph_thousand_component), + ((pynutil.delete('00000') + pynutil.insert('零') + graph_hundred_component)), + (pynini.closure(pynutil.delete('0')) + pynutil.insert('零') + graph_all), + ) + graph_ten_billions = ten_billions @ graph_ten_billions_component + + hundred_billions = NEMO_DIGIT**12 + hundred_billions_position = NEMO_DIGIT**4 + hundred_billions_position = hundred_billions_position @ graph_thousand_component + graph_hundred_billions_component = (hundred_billions_position + pynutil.insert('亿')) + pynini.union( + pynini.closure(pynutil.delete('0')), + graph_ten_million_component, + (pynutil.delete('0') + pynutil.insert('零') + graph_million_component), + (pynutil.delete('00') + pynutil.insert('零') + graph_hundred_thousand_component), + (pynutil.delete('000') + pynutil.insert('零') + graph_ten_thousand_component), + (pynutil.delete('0000') + pynutil.insert('零') + graph_thousand_component), + ((pynutil.delete('00000') + pynutil.insert('零') + graph_hundred_component)), + (pynini.closure(pynutil.delete('0')) + pynutil.insert('零') + graph_all), + ) + graph_hundred_billions = hundred_billions @ graph_hundred_billions_component + + graph = pynini.union( + graph_hundred_billions, + graph_ten_billions, + graph_thousand_million, + graph_hundred_million, + graph_ten_million, + graph_million, + graph_hundred_thousand, + graph_ten_thousand, + graph_thousand, + graph_hundred, + graph_all_alt, + graph_zero, + ) + self.just_cardinals = graph.optimize() + optional_sign = ( + pynutil.insert("negative: \"") + (pynini.accep("-") | pynini.cross("负", "-")) + pynutil.insert("\"") + ) + final_graph = ( + optional_sign + pynutil.insert(" ") + pynutil.insert("integer: \"") + graph + pynutil.insert("\"") + ) | (pynutil.insert("integer: \"") + graph + pynutil.insert("\"")) + + self.with_sign = final_graph.optimize() + + final_graph = self.add_tokens(final_graph) + self.fst = final_graph.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/zh/taggers/date.py b/zonos3/vendor/nemo_text_processing/text_normalization/zh/taggers/date.py new file mode 100644 index 0000000000000000000000000000000000000000..08c9d9adfab1fe2b0d8cb5dbf2379d1cbaaa7d18 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/zh/taggers/date.py @@ -0,0 +1,128 @@ +# Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.zh.graph_utils import GraphFst +from zonos3.vendor.nemo_text_processing.text_normalization.zh.utils import get_abs_path + + +class DateFst(GraphFst): + """ + Finite state transducer for classfying dates, e.g. + 2002年 -> tokens { date { year: "二零零二" } } + 2002-01-28 -> tokens { date { year: "二零零二" month: "一" day: "二十八"} } + 2002/01/28 -> tokens { date { year: "二零零二" month: "一" day: "二十八"} } + 2002.01.28 -> tokens { date { year: "二零零二" month: "一" day: "二十八"} } + 2002年2月 -> tokens { date { year: "二零零二" month: "二" } } + 2月11日 -> tokens { date { month: "二" day: "十一" } } + 2002/02 -> is an error format according to the national standard + 02/11 -> is an error format according to the national standard + According to national standard, only when the year, month, and day are all exist, it is allowed to use symbols to separate them + + """ + + def __init__(self, deterministic: bool = True, lm: bool = False): + super().__init__(name="date", kind="classify", deterministic=deterministic) + + graph_digit = pynini.string_file(get_abs_path("data/number/digit.tsv")) + graph_zero = pynini.string_file(get_abs_path("data/number/zero.tsv")) + month = pynini.string_file(get_abs_path("data/date/months.tsv")) + day = pynini.string_file(get_abs_path("data/date/day.tsv")) + suffix = pynini.string_file(get_abs_path("data/date/suffixes.tsv")) + + delete_sign = pynutil.delete('/') | pynutil.delete('-') | pynutil.delete('.') | pynutil.delete('·') + delete_day = pynutil.delete('号') | pynutil.delete('號') | pynutil.delete('日') + + # grammar for only year, month, or day + # atleast accep two digit to distinguish from year used for time + # don't accept 日 to distinguish from day used fro time + only_year = ( + pynutil.insert("year: \"") + + pynini.closure(graph_digit | graph_zero, 2) + + pynutil.delete('年') + + pynutil.insert("\"") + ) + only_month = pynutil.insert("month: \"") + month + pynutil.delete('月') + pynutil.insert("\"") + only_day = pynutil.insert("day: \"") + day + delete_day + pynutil.insert("\"") + # gh_1 + graph_only_date = only_year | only_month | only_day + + year_month = only_year + pynutil.insert(' ') + only_month + month_day = only_month + pynutil.insert(' ') + only_day + graph_ymd = only_year + pynutil.insert(' ') + only_month + pynutil.insert(' ') + only_day + # gh_2 + graph_combination = year_month | month_day | graph_ymd + + year_component = ( + pynutil.insert("year: \"") + + pynini.closure(graph_digit | graph_zero, 2, 4) + + delete_sign + + pynutil.insert("\"") + ) + month_component = pynutil.insert("month: \"") + month + delete_sign + pynutil.insert("\"") + day_component = pynutil.insert("day: \"") + day + pynutil.insert("\"") + # gp_3 + graph_sign = year_component + pynutil.insert(' ') + month_component + pynutil.insert(' ') + day_component + # gp_1+2+3 + graph_all = graph_only_date | graph_sign | graph_combination + + prefix = ( + pynini.accep('公元') + | pynini.accep('西元') + | pynini.accep('公元前') + | pynini.accep('西元前') + | pynini.accep('纪元') + | pynini.accep('纪元前') + ) + prefix_component = pynutil.insert("era: \"") + prefix + pynutil.insert("\"") + # gp_prefix+(1,2,3) + graph_prefix = prefix_component + pynutil.insert(' ') + (graph_ymd | year_month | only_year) + + suffix_component = pynutil.insert("era: \"") + suffix + pynutil.insert("\"") + # gp_suffix +(1,2,3) + graph_suffix = (graph_ymd | year_month | only_year) + pynutil.insert(' ') + suffix_component + # gp_4 + graph_affix = graph_prefix | graph_suffix + + graph_suffix_year = ( + pynutil.insert("year: \"") + pynini.closure((graph_digit | graph_zero), 1) + pynutil.insert("\"") + ) + graph_suffix_year = graph_suffix_year + pynutil.insert(' ') + suffix_component + + graph_with_era = graph_suffix_year | graph_affix + + graph = graph_only_date | graph_combination | graph_sign | graph_with_era + + # range + symbol = pynini.accep("-") | pynini.accep("~") | pynini.accep("——") | pynini.accep("—") + range_source = pynutil.insert("range: \"") + pynini.closure("从", 0, 1) + pynutil.insert("\"") + range_goal = ( + pynutil.insert("range: \"") + + (pynini.closure("到", 0, 1) | pynini.closure("至", 0, 1) | symbol) + + pynutil.insert("\"") + ) + graph_source = ( + range_source + pynutil.insert(' ') + graph + pynutil.insert(' ') + range_goal + pynutil.insert(' ') + graph + ) + graph_goal = graph + pynutil.insert(' ') + range_goal + pynutil.insert(' ') + graph + + graph_range_final = graph_source | graph_goal + + final_graph = pynutil.add_weight(graph, -2.0) | graph_range_final + + self.final_graph = final_graph.optimize() + self.fst = self.add_tokens(self.final_graph).optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/zh/taggers/decimal.py b/zonos3/vendor/nemo_text_processing/text_normalization/zh/taggers/decimal.py new file mode 100644 index 0000000000000000000000000000000000000000..f9ec6ce7ffdaa9c7038482f4406509c170a47843 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/zh/taggers/decimal.py @@ -0,0 +1,115 @@ +# Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.zh.graph_utils import GraphFst +from zonos3.vendor.nemo_text_processing.text_normalization.zh.utils import get_abs_path + + +def get_quantity(decimal): + suffix = pynini.union( + "万", + "十万", + "百万", + "千万", + "亿", + "十亿", + "百亿", + "千亿", + "萬", + "十萬", + "百萬", + "千萬", + "億", + "十億", + "百億", + "千億", + "拾萬", + "佰萬", + "仟萬", + "拾億", + "佰億", + "仟億", + "拾万", + "佰万", + "仟万", + "仟亿", + "佰亿", + "仟亿", + "万亿", + "萬億", + ) + res = decimal + pynutil.insert(" quantity: \"") + suffix + pynutil.insert("\"") + + return res + + +class DecimalFst(GraphFst): + """ + Finite state transducer for classifying decimal, e.g. + 0.5 -> decimal { integer_part: "零" fractional_part: "五" } + 0.5万 -> decimal { integer_part: "零" fractional_part: "五" quantity: "万" } + -0.5万 -> decimal { negative: "负" integer_part: "零" fractional_part: "五" quantity: "万"} + + Args: + cardinal: CardinalFst + """ + + def __init__(self, cardinal: GraphFst, deterministic: bool = True, lm: bool = False): + super().__init__(name="decimal", kind="classify", deterministic=deterministic) + + cardinal_before_decimal = cardinal.just_cardinals + cardinal_after_decimal = pynini.string_file(get_abs_path("data/number/digit.tsv")) + zero = pynini.string_file(get_abs_path("data/number/zero.tsv")) + + graph_integer = pynutil.insert('integer_part: \"') + cardinal_before_decimal + pynutil.insert("\"") + + graph_fraction = ( + pynutil.insert("fractional_part: \"") + + pynini.closure((pynini.closure(cardinal_after_decimal, 1) | (pynini.closure(zero, 1))), 1) + + pynutil.insert("\"") + ) + graph_decimal = graph_integer + pynutil.delete('.') + pynutil.insert(" ") + graph_fraction + self.regular_decimal = graph_decimal.optimize() + + graph_sign = ( + ( + pynini.closure(pynutil.insert("negative: \"") + pynini.cross("-", "负")) + + pynutil.insert("\"") + + pynutil.insert(" ") + ) + ) | ( + ( + pynutil.insert('negative: ') + + pynutil.insert("\"") + + (pynini.accep('负') | pynini.cross('負', '负')) + + pynutil.insert("\"") + + pynutil.insert(' ') + ) + ) + graph_with_sign = graph_sign + graph_decimal + graph_regular = graph_with_sign | graph_decimal + + graph_decimal_quantity = get_quantity(graph_decimal) + graph_sign_quantity = graph_sign + graph_decimal_quantity + graph_quantity = graph_decimal_quantity | graph_sign_quantity + + final_graph = graph_regular | graph_quantity + self.decimal = final_graph.optimize() + + final_graph = self.add_tokens(final_graph) + self.fst = final_graph.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/zh/taggers/fraction.py b/zonos3/vendor/nemo_text_processing/text_normalization/zh/taggers/fraction.py new file mode 100644 index 0000000000000000000000000000000000000000..71743de664dca83a5f8dd3466953c63404abdd16 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/zh/taggers/fraction.py @@ -0,0 +1,167 @@ +# Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.zh.graph_utils import GraphFst +from zonos3.vendor.nemo_text_processing.text_normalization.zh.utils import get_abs_path + + +class FractionFst(GraphFst): + """ + Finite state transducer for classifying fraction, e.g., + 1/2 -> tokens { fraction { denominator: "二" numerator: "一"} } + 5又1/2 -> tokens { fraction { integer_part: "五" denominator: "二" numerator: "一" } } + 5又2分之1 -> tokens { {} } + 2分之1 -> tokens { fraction { denominator: "二" numerator: "一"} } + 100分之1 -> tokens { fraction { denominator: "一百" numerator: "一"} } + 百分之1 -> tokens { fraction { denominator: "百" numerator: "一"} } + 98% -> tokens { fraction { denominator: "百" numerator: "九十八"} } + + Args: + cardinal: CardinalFst, decimal: DecimalFst + """ + + def __init__(self, cardinal: GraphFst, deterministic: bool = True, lm: bool = False): + super().__init__(name="fraction", kind="classify", deterministic=deterministic) + + graph_cardinals = cardinal.just_cardinals + graph_digit = pynini.string_file(get_abs_path("data/number/digit.tsv")) + graph_zero = pynini.string_file(get_abs_path("data/number/zero.tsv")) + + slash = pynutil.delete('/') + morpheme = pynutil.delete('分之') + suffix = pynini.union( + "百", + "千", + "万", + "十万", + "百万", + "千万", + "亿", + "十亿", + "百亿", + "千亿", + "萬", + "十萬", + "百萬", + "千萬", + "億", + "十億", + "百億", + "千億", + "拾萬", + "佰萬", + "仟萬", + "拾億", + "佰億", + "仟億", + "拾万", + "佰万", + "仟万", + "仟亿", + "佰亿", + "仟亿", + ) + + integer_component = pynutil.insert('integer_part: \"') + graph_cardinals + pynutil.insert("\"") + denominator_component = pynutil.insert("denominator: \"") + graph_cardinals + pynutil.insert("\"") + numerator_component = pynutil.insert("numerator: \"") + graph_cardinals + pynutil.insert("\"") + + graph_with_integer = ( + pynini.closure(integer_component + pynutil.delete('又'), 0, 1) + + pynutil.insert(' ') + + numerator_component + + slash + + pynutil.insert(' ') + + denominator_component + ) # 5又1/3 + + graph_only_slash = numerator_component + slash + pynutil.insert(' ') + denominator_component + + graph_morpheme = (denominator_component + morpheme + pynutil.insert(' ') + numerator_component) | ( + integer_component + + pynutil.delete('又') + + pynutil.insert(' ') + + denominator_component + + morpheme + + pynutil.insert(' ') + + numerator_component + ) # 5又3分之1 + + graph_with_suffix = ( + pynini.closure(pynutil.insert("denominator: \"") + suffix + pynutil.insert("\""), 0, 1) + + morpheme + + pynutil.insert(' ') + + numerator_component + ) # 万分之1 + + percentage = pynutil.delete('%') + + graph_decimal = ( + pynutil.insert('integer_part: \"') + + pynini.closure( + graph_cardinals + + pynutil.delete('.') + + pynutil.insert('点') + + pynini.closure((graph_digit | graph_zero), 1) + ) + + pynutil.insert("\"") + ) + graph_decimal_percentage = pynini.closure( + graph_decimal + percentage + pynutil.insert(' denominator: \"百"'), 1 + ) # 5.6% + + graph_integer_percentage = pynini.closure( + (numerator_component) + percentage + pynutil.insert(' denominator: \"百"'), 1 + ) # 5% + + graph_hundred = pynutil.delete('100%') + pynutil.insert('numerator: \"百\" denominator: \"百"') + # 100% + + graph_optional_sign = (pynini.closure(pynutil.insert("negative: ") + pynini.cross("-", "\"负\""))) | ( + pynutil.insert('negative: ') + + pynutil.insert("\"") + + (pynini.accep('负') | pynini.cross('負', '负')) + + pynutil.insert("\"") + ) + + graph = pynini.union( + graph_with_integer, + graph_only_slash, + graph_morpheme, + graph_with_suffix, + graph_decimal_percentage, + graph_integer_percentage, + graph_hundred, + ) + graph_with_sign = ( + (graph_optional_sign + pynutil.insert(" ") + graph_with_integer) + | (graph_optional_sign + pynutil.insert(" ") + graph_only_slash) + | (graph_optional_sign + pynutil.insert(" ") + graph_morpheme) + | (graph_optional_sign + pynutil.insert(" ") + graph_with_suffix) + | (graph_optional_sign + pynutil.insert(" ") + graph_integer_percentage) + | (graph_optional_sign + pynutil.insert(" ") + graph_decimal_percentage) + | (graph_optional_sign + pynutil.insert(" ") + graph_hundred) + ) + + final_graph = graph | pynutil.add_weight(graph_with_sign, -3.0) + + self.just_fractions = graph.optimize() + self.fractions = final_graph.optimize() + + final_graph = self.add_tokens(final_graph) + self.fst = final_graph.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/zh/taggers/measure.py b/zonos3/vendor/nemo_text_processing/text_normalization/zh/taggers/measure.py new file mode 100644 index 0000000000000000000000000000000000000000..4b3e60c4d8f228233d01a30e409355fbafcba819 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/zh/taggers/measure.py @@ -0,0 +1,76 @@ +# Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.zh.graph_utils import GraphFst, insert_space +from zonos3.vendor.nemo_text_processing.text_normalization.zh.utils import get_abs_path + + +class MeasureFst(GraphFst): + ''' + 1kg -> tokens { measure { cardinal { integer: "一" } units: "千克" } } + ''' + + def __init__( + self, cardinal: GraphFst, decimal: GraphFst, fraction: GraphFst, deterministic: bool = True, lm: bool = False + ): + super().__init__(name="measure", kind="classify", deterministic=deterministic) + + units_en = pynini.string_file(get_abs_path("data/measure/units_en.tsv")) + + graph_cardinal = cardinal.with_sign + graph_decimal = decimal.decimal + + # these units ared added due to falures when running Sparrow Hawk tests that "ms" would be processed as "m" and "s" left outside of the tagegr + units = ( + pynini.cross("ms", "毫秒") + | pynini.cross("m²", "平方米") + | pynini.cross("m2", "平方米") + | pynini.cross("m²", "平方米") + | pynini.cross("m³", "立方米") + | pynini.cross("mbps", "兆比特每秒") + | pynini.cross("mg", "毫克") + | pynini.cross("mhz", "兆赫兹") + | pynini.cross("mi2", "平方英里") + | pynini.cross("mi²", "平方英里") + | pynini.cross("mi", "英里") + | pynini.cross("min", "分钟") + | pynini.cross("ml", "毫升") + | pynini.cross("mm2", "平方毫米") + | pynini.cross("mm²", "平方毫米") + | pynini.cross("mol", "摩尔") + | pynini.cross("mpa", "兆帕") + | pynini.cross("mph", "英里每小时") + | pynini.cross("mm", "毫米") + | pynini.cross("mv", "毫伏") + | pynini.cross("mw", "毫瓦") + ) + + unit_component = pynutil.insert("units: \"") + (units_en | units) + pynutil.insert("\"") + + graph_cardinal_measure = pynini.closure( + (pynutil.insert("cardinal { ") + graph_cardinal + pynutil.insert(" } ") + insert_space + unit_component), 1 + ) + + graph_decimal_measure = pynini.closure( + (pynutil.insert("decimal { ") + graph_decimal + pynutil.insert(" } ") + unit_component), 1 + ) + + graph_measures = graph_decimal_measure | graph_cardinal_measure + + final_graph = self.add_tokens(graph_measures) + self.fst = final_graph.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/zh/taggers/money.py b/zonos3/vendor/nemo_text_processing/text_normalization/zh/taggers/money.py new file mode 100644 index 0000000000000000000000000000000000000000..a6108e9a46d13ab0dac00cbd7bad7f0616092567 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/zh/taggers/money.py @@ -0,0 +1,139 @@ +# Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.zh.graph_utils import GraphFst +from zonos3.vendor.nemo_text_processing.text_normalization.zh.utils import get_abs_path + +suffix = pynini.union( + "万", + "十万", + "百万", + "千万", + "亿", + "十亿", + "百亿", + "千亿", + "萬", + "十萬", + "百萬", + "千萬", + "億", + "十億", + "百億", + "千億", + "拾萬", + "佰萬", + "仟萬", + "拾億", + "佰億", + "仟億", + "拾万", + "佰万", + "仟万", + "仟亿", + "佰亿", + "仟亿", + "万亿", + "萬億", +) + + +class MoneyFst(GraphFst): + """ + Finite state transducer for classifying moneys, e.g. + '$23' -> money { integer: "二十三" currency: "美元" } + '23美元' -> money { integer: "二十三" currency: "美元" } + """ + + def __init__(self, cardinal: GraphFst, deterministic: bool = True, lm: bool = False): + super().__init__(name="money", kind="classify", deterministic=deterministic) + + cardinal = cardinal.just_cardinals + + currency = pynini.string_file(get_abs_path("data/money/currency_major.tsv")) + currency_mandarin = pynini.string_file(get_abs_path("data/money/currency_mandarin.tsv")) + graph_digit = pynini.string_file(get_abs_path("data/number/digit.tsv")) + graph_zero = pynini.string_file(get_abs_path("data/number/zero.tsv")) + + # regular money gramamr with currency symbols $1000 + currency_component = pynutil.insert("currency: \"") + currency + pynutil.insert("\"") + number_component = pynutil.insert("integer_part: \"") + (cardinal | (cardinal + suffix)) + pynutil.insert("\"") + graph_regular_money = currency_component + pynutil.insert(" ") + number_component + + # 块 元 毛 with optional symbols + unit_major = ( + pynini.accep("块") + | pynini.accep("元") + | pynini.closure(pynini.cross("塊", "块"), 1) + | pynini.closure(pynini.cross("塊錢", "块钱"), 1) + | pynini.accep("块钱") + ) + unit_minor = pynini.accep("角") | pynini.accep("毛") + unit_minor_alt = pynini.accep("分") + currency_mandarin_component = pynutil.insert("currency: \"") + currency_mandarin + pynutil.insert("\"") + unit_components = ( + (pynutil.insert("currency: \"") + unit_major + pynutil.insert("\"")) + | (pynutil.insert("currency_maj: \"") + unit_minor + pynutil.insert("\"")) + | (pynutil.insert("currency_min: \"") + unit_minor_alt + pynutil.insert("\"")) + ) + + graph_unit_only = ( + number_component + + pynutil.insert(" ") + + unit_components + + pynini.closure(pynutil.insert(" ") + currency_mandarin_component, 0, 1) + ) + graph_units = pynini.closure(graph_unit_only, 1, 3) + + # only currency part as mandarins + graph_mandarin_money = number_component + pynutil.insert(" ") + currency_mandarin_component + + # larger money as decimals + graph_decimal = ( + pynutil.insert('integer_part: \"') + + ( + pynini.closure(cardinal, 1) + + pynutil.delete('.') + + pynutil.insert('点') + + pynini.closure((graph_digit | graph_zero), 1) + ) + + pynutil.insert("\"") + ) + graph_decimal_money = ( + pynini.closure(graph_decimal, 1) + + pynini.closure((pynutil.insert(' quantity: \"') + suffix + pynutil.insert('\"')), 0, 1) + + pynutil.insert(" ") + + pynini.closure(currency_mandarin_component, 1) + ) | ( + pynini.closure(currency_component, 1) + + pynutil.insert(" ") + + pynini.closure(graph_decimal, 1) + + pynini.closure( + (pynutil.insert(" ") + pynutil.insert('quantity: \"') + suffix + pynutil.insert('\"')), 0, 1 + ) + ) + + graph = ( + graph_regular_money + | graph_units + | pynutil.add_weight(graph_mandarin_money, -3.0) + | pynutil.add_weight(graph_decimal_money, -1.0) + ) + + final_graph = self.add_tokens(graph) + self.fst = final_graph.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/zh/taggers/ordinal.py b/zonos3/vendor/nemo_text_processing/text_normalization/zh/taggers/ordinal.py new file mode 100644 index 0000000000000000000000000000000000000000..4e18793259f07bfda488265eb821492581c76c6e --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/zh/taggers/ordinal.py @@ -0,0 +1,77 @@ +# Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.zh.graph_utils import GraphFst + + +class OrdinalFst(GraphFst): + """ + Finite state transducer for classifying ordinal, e.g. + 第100 -> ordinal { integer: "第一百" } + + Args: + cardinal: CardinalFst + """ + + def __init__(self, cardinal: GraphFst, deterministic: bool = True, lm: bool = False): + super().__init__(name="ordinal", kind="verbalize", deterministic=deterministic) + + graph_cardinal = cardinal.just_cardinals + morpheme = pynini.accep('第') + graph_ordinal = morpheme + graph_cardinal + graph_ordinal_final = pynutil.insert("integer: \"") + graph_ordinal + pynutil.insert("\"") + + # range + range_source = pynini.accep("从") + range_goal = ( + pynini.accep("-") + | pynini.accep("~") + | pynini.accep("——") + | pynini.accep("—") + | pynini.accep("到") + | pynini.accep("至") + ) + graph_range_source = ( + pynini.closure((pynutil.insert("range: \"") + range_source + pynutil.insert("\" ")), 0, 1) + + pynutil.insert("integer: \"") + + graph_ordinal + + pynutil.insert("\"") + + pynutil.insert(" range: \"") + + range_goal + + pynutil.insert("\" ") + + pynutil.insert("integer: \"") + + (graph_ordinal | graph_cardinal) + + pynutil.insert("\"") + ) + graph_range_goal = ( + pynutil.insert("integer: \"") + + graph_ordinal + + pynutil.insert("\"") + + pynutil.insert(" range: \"") + + range_goal + + pynutil.insert("\" ") + + pynutil.insert("integer: \"") + + (graph_ordinal | graph_cardinal) + + pynutil.insert("\"") + ) + graph_range_final = graph_range_source | graph_range_goal + + final_graph = graph_ordinal_final | graph_range_final + + graph_ordinal_final = self.add_tokens(final_graph) + self.fst = graph_ordinal_final.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/zh/taggers/preprocessor.py b/zonos3/vendor/nemo_text_processing/text_normalization/zh/taggers/preprocessor.py new file mode 100644 index 0000000000000000000000000000000000000000..a84ed042227bca93dc860d8f7cec173e64cd7a17 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/zh/taggers/preprocessor.py @@ -0,0 +1,51 @@ +# Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.zh.graph_utils import NEMO_SIGMA, GraphFst +from zonos3.vendor.nemo_text_processing.text_normalization.zh.utils import get_abs_path + + +class PreProcessorFst(GraphFst): + ''' + Preprocessing of TN: + 1. interjections removal such as '啊, 呃' + 2. fullwidth -> halfwidth char conversion + 好啊 -> 好 + 呃对 -> 对 + : -> : + ; -> ; + ''' + + def __init__( + self, + remove_interjections: bool = True, + fullwidth_to_halfwidth: bool = True, + ): + super().__init__(name="PreProcessor", kind="processor") + + graph = pynini.cdrewrite('', '', '', NEMO_SIGMA) + + if remove_interjections: + remove_interjections_graph = pynutil.delete(pynini.string_file(get_abs_path('data/denylist/denylist.tsv'))) + graph @= pynini.cdrewrite(remove_interjections_graph, '', '', NEMO_SIGMA) + + if fullwidth_to_halfwidth: + fullwidth_to_halfwidth_graph = pynini.string_file(get_abs_path('data/char/fullwidth_to_halfwidth.tsv')) + graph @= pynini.cdrewrite(fullwidth_to_halfwidth_graph, '', '', NEMO_SIGMA) + + self.fst = graph.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/zh/taggers/punctuation.py b/zonos3/vendor/nemo_text_processing/text_normalization/zh/taggers/punctuation.py new file mode 100644 index 0000000000000000000000000000000000000000..4cc82b21a5fca9b98f9408f9b8989b0a9f5c5d5d --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/zh/taggers/punctuation.py @@ -0,0 +1,67 @@ +# Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import sys +from unicodedata import category + +import pynini +from pynini.examples import plurals +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import NEMO_NOT_SPACE, NEMO_SIGMA, GraphFst +from zonos3.vendor.nemo_text_processing.text_normalization.en.utils import get_abs_path, load_labels + + +class PunctuationFst(GraphFst): + """ + Finite state transducer for classifying punctuation + e.g. a, -> tokens { name: "a" } tokens { name: "," } + + Args: + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="punctuation", kind="classify", deterministic=deterministic) + s = "!#%&\'()*+,-/:;<=>?@^_`{|}~\"。,;-《》“”" + + punct_symbols_to_exclude = ["[", "]"] + punct_unicode = [ + chr(i) + for i in range(sys.maxunicode) + if category(chr(i)).startswith("P") and chr(i) not in punct_symbols_to_exclude + ] + + whitelist_symbols = load_labels(get_abs_path("data/whitelist/symbol.tsv")) + whitelist_symbols = [x[0] for x in whitelist_symbols] + self.punct_marks = [p for p in punct_unicode + list(s) if p not in whitelist_symbols] + + punct = pynini.union(*self.punct_marks) + punct = pynini.closure(punct, 1) + + emphasis = ( + pynini.accep("<") + + ( + (pynini.closure(NEMO_NOT_SPACE - pynini.union("<", ">"), 1) + pynini.closure(pynini.accep("/"), 0, 1)) + | (pynini.accep("/") + pynini.closure(NEMO_NOT_SPACE - pynini.union("<", ">"), 1)) + ) + + pynini.accep(">") + ) + punct = plurals._priority_union(emphasis, punct, NEMO_SIGMA) + + self.graph = punct + self.fst = (pynutil.insert("name: \"") + self.graph + pynutil.insert("\"")).optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/zh/taggers/time.py b/zonos3/vendor/nemo_text_processing/text_normalization/zh/taggers/time.py new file mode 100644 index 0000000000000000000000000000000000000000..8dd9aa0065d081f7170e7b2ed12c7acd28e9f367 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/zh/taggers/time.py @@ -0,0 +1,149 @@ +# Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.zh.graph_utils import GraphFst +from zonos3.vendor.nemo_text_processing.text_normalization.zh.utils import get_abs_path + + +class TimeFst(GraphFst): + """ + Finite state transducer for clasifying time, e.g. + 01:02 -> tokens { time { hours: "一" minutes: "二" } } + 1:02:03 -> tokens { time { hours: "一" minutes: "二" second: "三" } } + 1点5分19秒 -> tokens { time { hours: "一" minutes: "五" second: "秒" } } + 1点1刻 -> tokens { time { hours: "一" minutes: "一刻" } } + """ + + def __init__(self, deterministic: bool = True, lm: bool = False): + super().__init__(name="time", kind="classify", deterministic=deterministic) + + # mappings imported + hour = pynini.string_file(get_abs_path("data/time/hour.tsv")) + minute = pynini.string_file(get_abs_path("data/time/minute.tsv")) + second = pynini.string_file(get_abs_path("data/time/second.tsv")) + alphabet_am = pynini.string_file(get_abs_path("data/time/AM.tsv")) + alphabet_pm = pynini.string_file(get_abs_path("data/time/PM.tsv")) + + # gramamr for time, separated by colons 05:03:13 + symbol = pynutil.delete(":") | pynutil.delete(":") + hour_component = pynutil.insert("hours: \"") + hour + pynutil.insert('点') + pynutil.insert("\"") + minute_component = pynutil.insert("minutes: \"") + minute + pynutil.insert('分') + pynutil.insert("\"") + second_component = pynutil.insert("seconds: \"") + second + pynutil.insert('秒') + pynutil.insert("\"") + # combining 3 components + hour_minute_second = ( + hour_component + + symbol + + pynutil.insert(' ') + + minute_component + + symbol + + pynutil.insert(' ') + + second_component + ) + hour_minute = hour_component + symbol + pynutil.insert(' ') + minute_component + graph_colon = hour_minute_second | hour_minute + + # gramamr for time as clock, with morphems, 点, 分, 秒 + hour_clock = pynini.accep("点") | pynini.cross("點", "点") + minute_clock = pynini.accep("分") | pynini.accep('刻') + second_clock = pynini.accep('秒') + # grammar for time, as period of time 小时,分钟,秒 + hour_duration = ( + pynini.accep('个点') + | pynini.cross("個點", "個点") + | pynini.accep('小时') + | pynini.cross('小時', '小时') + | pynini.accep('个小时') + | pynini.cross('個小時', '个小时') + | pynini.accep('个钟头') + | pynini.cross('個鐘頭', '个钟头') + ) + minute_duration = pynini.accep("分钟") | pynini.accep('刻') | pynini.accep('刻钟') + second_duration = pynini.accep("秒钟") | pynini.cross('秒鐘', '秒钟') | pynini.accep('秒') + # combining two above + hour_component = pynutil.insert("hours: \"") + hour + (hour_clock | hour_duration) + pynutil.insert("\"") + minute_component = ( + pynutil.insert("minutes: \"") + minute + (minute_clock | minute_duration) + pynutil.insert("\"") + ) + second_component = ( + pynutil.insert("seconds: \"") + second + (second_clock | second_duration) + pynutil.insert("\"") + ) + hour_minute = hour_component + pynutil.insert(' ') + minute_component + hour_second = hour_component + pynutil.insert(' ') + second_component + minute_second = minute_component + pynutil.insert(' ') + second_component + clock_all = hour_component + pynutil.insert(' ') + minute_component + pynutil.insert(' ') + second_component + graph_clock_period = ( + hour_component + | minute_component + | second_component + | hour_minute + | hour_second + | minute_second + | clock_all + ) + + # gramamr for time, back count; 五点差n分n秒 + backcount = pynutil.insert("morphosyntactic_features: \"") + pynini.accep('差') + pynutil.insert("\"") + graph_hour = ( + ( + pynini.closure(backcount) + + pynutil.insert(' ') + + hour_component + + pynutil.insert(' ') + + pynini.closure(backcount) + + pynutil.insert(' ') + + minute_component + ) + | ( + pynini.closure(backcount) + + pynutil.insert(' ') + + hour_component + + pynutil.insert(' ') + + pynini.closure(backcount) + + pynutil.insert(' ') + + second_component + ) + | ( + pynini.closure(backcount) + + pynutil.insert(' ') + + hour_component + + pynutil.insert(' ') + + pynini.closure(backcount) + + pynutil.insert(' ') + + minute_component + + pynutil.insert(' ') + + second_component + ) + ) + graph_minute = minute_component + pynutil.insert(' ') + backcount + pynutil.insert(' ') + second_component + graph_backcount = graph_hour | graph_minute + + # grammar for time, with am, pr, or Mandarin words as prefiex/suffix 早上5点 05:04:04am + suffix_am = pynini.closure(alphabet_am, 0, 1) + suffix_pm = pynini.closure(alphabet_pm, 0, 1) + + am_component = pynutil.insert("suffix: \"") + suffix_am + pynutil.insert("\"") + pm_component = pynutil.insert("suffix: \"") + suffix_pm + pynutil.insert("\"") + + graph_suffix = ( + (graph_clock_period | graph_colon | graph_backcount) + pynutil.insert(' ') + (am_component | pm_component) + ) + + graph = graph_colon | graph_clock_period | graph_backcount | graph_suffix + + final_graph = self.add_tokens(graph) + self.fst = final_graph.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/zh/taggers/tokenize_and_classify.py b/zonos3/vendor/nemo_text_processing/text_normalization/zh/taggers/tokenize_and_classify.py new file mode 100644 index 0000000000000000000000000000000000000000..db7c7ac048d9add314ac581555f314aabdd4c28b --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/zh/taggers/tokenize_and_classify.py @@ -0,0 +1,100 @@ +# Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import os + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.zh.graph_utils import GraphFst, generator_main +from zonos3.vendor.nemo_text_processing.text_normalization.zh.taggers.cardinal import CardinalFst +from zonos3.vendor.nemo_text_processing.text_normalization.zh.taggers.date import DateFst +from zonos3.vendor.nemo_text_processing.text_normalization.zh.taggers.decimal import DecimalFst +from zonos3.vendor.nemo_text_processing.text_normalization.zh.taggers.fraction import FractionFst +from zonos3.vendor.nemo_text_processing.text_normalization.zh.taggers.measure import MeasureFst +from zonos3.vendor.nemo_text_processing.text_normalization.zh.taggers.money import MoneyFst +from zonos3.vendor.nemo_text_processing.text_normalization.zh.taggers.ordinal import OrdinalFst +from zonos3.vendor.nemo_text_processing.text_normalization.zh.taggers.punctuation import PunctuationFst +from zonos3.vendor.nemo_text_processing.text_normalization.zh.taggers.time import TimeFst +from zonos3.vendor.nemo_text_processing.text_normalization.zh.taggers.whitelist import WhiteListFst +from zonos3.vendor.nemo_text_processing.text_normalization.zh.taggers.word import WordFst + + +class ClassifyFst(GraphFst): + """ + Final class that composes all other classification grammars. This class can process an entire sentence including punctuation. + For deployment, this grammar will be compiled and exported to OpenFst Finate State Archiv (FAR) File. + More details to deployment at NeMo/tools/text_processing_deployment. + + Args: + input_case: accepting either "lower_cased" or "cased" input. + deterministic: if True will provide a single transduction option, + for False multiple options (used for audio-based normalization) + cache_dir: path to a dir with .far grammar file. Set to None to avoid using cache. + overwrite_cache: set to True to overwrite .far files + whitelist: path to a file with whitelist replacements + """ + + def __init__( + self, + input_case: str, + deterministic: bool = True, + cache_dir: str = None, + overwrite_cache: bool = False, + whitelist: str = None, + ): + super().__init__(name="tokenize_and_classify", kind="classify", deterministic=deterministic) + + far_file = None + if cache_dir is not None and cache_dir != "None": + os.makedirs(cache_dir, exist_ok=True) + whitelist_file = os.path.basename(whitelist) if whitelist else "" + far_file = os.path.join(cache_dir, f"zh_tn_{deterministic}_deterministic_{whitelist_file}_tokenize.far") + if not overwrite_cache and far_file and os.path.exists(far_file): + self.fst = pynini.Far(far_file, mode="r")["tokenize_and_classify"] + else: + cardinal = CardinalFst(deterministic=deterministic) + date = DateFst(deterministic=deterministic) + decimal = DecimalFst(cardinal=cardinal, deterministic=deterministic) + time = TimeFst(deterministic=deterministic) + fraction = FractionFst(cardinal=cardinal, deterministic=deterministic) + money = MoneyFst(cardinal=cardinal, deterministic=deterministic) + measure = MeasureFst(cardinal=cardinal, decimal=decimal, fraction=fraction, deterministic=deterministic) + ordinal = OrdinalFst(cardinal=cardinal, deterministic=deterministic) + whitelist = WhiteListFst(deterministic=deterministic) + word = WordFst(deterministic=deterministic) + punctuation = PunctuationFst(deterministic=deterministic) + + classify = pynini.union( + pynutil.add_weight(date.fst, 1.1), + pynutil.add_weight(fraction.fst, 1.0), + pynutil.add_weight(money.fst, 1.1), + pynutil.add_weight(measure.fst, 1.05), + pynutil.add_weight(time.fst, 1.1), + pynutil.add_weight(whitelist.fst, 1.1), + pynutil.add_weight(cardinal.fst, 1.1), + pynutil.add_weight(decimal.fst, 3.05), + pynutil.add_weight(ordinal.fst, 1.1), + pynutil.add_weight(punctuation.fst, 1.0), + pynutil.add_weight(word.fst, 100), + ) + + token = pynutil.insert("tokens { ") + classify + pynutil.insert(" } ") + tagger = pynini.closure(token, 1) + + self.fst = tagger + + if far_file: + generator_main(far_file, {"tokenize_and_classify": self.fst}) diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/zh/taggers/whitelist.py b/zonos3/vendor/nemo_text_processing/text_normalization/zh/taggers/whitelist.py new file mode 100644 index 0000000000000000000000000000000000000000..fd6bfebbcd5a057d066c9115c59af708e596cd44 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/zh/taggers/whitelist.py @@ -0,0 +1,57 @@ +# Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.zh.graph_utils import GraphFst, convert_space +from zonos3.vendor.nemo_text_processing.text_normalization.zh.utils import get_abs_path, load_labels + + +class WhiteListFst(GraphFst): + """ + Finite state transducer for classifying whitelist, e.g. + "Mr." -> tokens { name: "mister" } + This class has highest priority among all classifier grammars. Whitelisted tokens are defined and loaded from "data/whitelist.tsv". + + Args: + input_case: accepting either "lower_cased" or "cased" input. + deterministic: if True will provide a single transduction option, + for False multiple options (used for audio-based normalization) + input_file: path to a file with whitelist replacements + """ + + def __init__(self, deterministic: bool = True, input_file: str = None): + super().__init__(name="whitelist", kind="classify", deterministic=deterministic) + + def _get_whitelist_graph(file): + whitelist = load_labels(file) + graph = pynini.string_map(whitelist) + return graph + + graph = _get_whitelist_graph(get_abs_path("data/whitelist.tsv")) + + graph |= pynutil.add_weight(_get_whitelist_graph(get_abs_path("data/whitelist.tsv")), weight=0.0001) + + if input_file: + whitelist_provided = _get_whitelist_graph(input_file) + if not deterministic: + graph |= whitelist_provided + else: + graph = whitelist_provided + + self.graph = graph + self.final_graph = convert_space(self.graph).optimize() + self.fst = (pynutil.insert("name: \"") + self.final_graph + pynutil.insert("\"")).optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/zh/taggers/word.py b/zonos3/vendor/nemo_text_processing/text_normalization/zh/taggers/word.py new file mode 100644 index 0000000000000000000000000000000000000000..537fa440a3416057cd5b93a4b0e82a75e871e445 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/zh/taggers/word.py @@ -0,0 +1,34 @@ +# Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.zh.graph_utils import NEMO_NOT_QUOTE, GraphFst + + +class WordFst(GraphFst): + """ + Finite state transducer for classifying word. + e.g. dormir -> tokens { name: "dormir" } + + Args: + deterministic: if True will provide a single transduction option, + for False multiple transduction are generated (used for audio-based normalization) + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="word", kind="classify") + word = pynutil.insert("name: \"") + NEMO_NOT_QUOTE + pynutil.insert("\"") + self.fst = word.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/zh/utils.py b/zonos3/vendor/nemo_text_processing/text_normalization/zh/utils.py new file mode 100644 index 0000000000000000000000000000000000000000..175aba20613e6a63c715114c1b37ffcd202082eb --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/zh/utils.py @@ -0,0 +1,66 @@ +# Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# gaph_utils is kept due to the fatc that importing from en folders will cause import errors that the data file names have to be the same with what are in the en folder +import csv +import os + +UNIT_1e01 = '十' +UNIT_1e02 = '百' +UNIT_1e03 = '千' +UNIT_1e04 = '万' + + +def get_abs_path(rel_path): + """ + Get absolute path + + Args: + rel_path: relative path to this file + + Returns absolute path + """ + return os.path.dirname(os.path.abspath(__file__)) + '/' + rel_path + + +def load_labels(abs_path): + """ + loads relative path file as dictionary + + Args: + abs_path: absolute path + + Returns dictionary of mappings + """ + with open(abs_path, encoding="utf-8") as label_tsv: + labels = list(csv.reader(label_tsv, delimiter="\t")) + return labels + + +def augment_labels_with_punct_at_end(labels): + """ + augments labels: if key ends on a punctuation that value does not have, add a new label + where the value maintains the punctuation + + Args: + labels : input labels + Returns: + additional labels + """ + res = [] + for label in labels: + if len(label) > 1: + if label[0][-1] == "." and label[1][-1] != ".": + res.append([label[0], label[1] + "."] + label[2:]) + return res diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/zh/verbalizers/__init__.py b/zonos3/vendor/nemo_text_processing/text_normalization/zh/verbalizers/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..6ebc808fad7ac87484dbabf02dacacdd7f826c14 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/zh/verbalizers/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/zh/verbalizers/cardinal.py b/zonos3/vendor/nemo_text_processing/text_normalization/zh/verbalizers/cardinal.py new file mode 100644 index 0000000000000000000000000000000000000000..a1af3931f78558301c40130dde631858ef6294e9 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/zh/verbalizers/cardinal.py @@ -0,0 +1,50 @@ +# Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.zh.graph_utils import NEMO_NOT_QUOTE, GraphFst, delete_space + + +class CardinalFst(GraphFst): + """ + Finite state transducer for verbalizing cardinal, e.g. + cardinal { negative: "负" integer: "23" } -> 负二十三 + cardinal { integer: "23" } -> 二十三 + cardinal { positive: "正" integer: "23" } -> 正二十三 + """ + + def __init__(self, deterministic: bool = True, lm: bool = False): + super().__init__(name="cardinal", kind="verbalize", deterministic=deterministic) + + delete_sign = pynini.cross("negative: \"-\"", "负") + delete_integer = ( + pynutil.delete("integer: ") + + pynutil.delete("\"") + + pynini.closure(NEMO_NOT_QUOTE) + + pynutil.delete("\"") + + delete_space + ) + delete_mandarin = pynutil.delete("quantity: \"") + pynini.closure(NEMO_NOT_QUOTE) + pynutil.delete("\"") + graph_mandarin = (delete_integer + delete_mandarin) | ( + delete_sign + delete_space + delete_integer + delete_mandarin + ) + graph_sign = delete_sign + delete_space + delete_integer + final_graph = delete_integer | graph_sign | graph_mandarin + self.numbers = final_graph + + delete_tokens = self.delete_tokens(final_graph) + self.fst = delete_tokens.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/zh/verbalizers/date.py b/zonos3/vendor/nemo_text_processing/text_normalization/zh/verbalizers/date.py new file mode 100644 index 0000000000000000000000000000000000000000..84fc3fe5dd1f20bb1a584325ae170c95e3046d75 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/zh/verbalizers/date.py @@ -0,0 +1,105 @@ +# Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.zh.graph_utils import NEMO_NOT_QUOTE, GraphFst, delete_space + + +class DateFst(GraphFst): + """ + Finite state transducer classifiying dates, e.g. + { date { year: "二零零二" } } -> 二零零二年 + { date { year: "二零零二" month: "一" day: "二十八"} } -> 二零零二年一月二十八日 + { date { year: "二零零二" month: "二" } } -> 二零零二年二月 + { date { month: "二" day: "十一" } } -> 二月十一日 + """ + + def __init__(self, deterministic: bool = True, lm: bool = False): + super().__init__(name="date", kind="verbalize", deterministic=deterministic) + + year_component = ( + pynutil.delete("year: ") + + pynutil.delete("\"") + + pynini.closure(NEMO_NOT_QUOTE) + + pynutil.delete("\"") + + pynutil.insert("年") + ) + month_component = ( + pynutil.delete("month: ") + + pynutil.delete("\"") + + pynini.closure(NEMO_NOT_QUOTE) + + pynutil.delete("\"") + + pynutil.insert("月") + ) + day_component = ( + pynutil.delete("day: ") + + pynutil.delete("\"") + + pynini.closure(NEMO_NOT_QUOTE) + + pynutil.delete("\"") + + pynutil.insert("日") + ) + + optional_era = ( + pynutil.delete("era: ") + pynutil.delete("\"") + pynini.closure(NEMO_NOT_QUOTE) + pynutil.delete("\"") + ) + + graph_date = ( + pynini.closure(year_component) + + pynini.closure(delete_space) + + pynini.closure(month_component) + + pynini.closure(delete_space) + + pynini.closure(day_component) + ) + + graph_date_era = pynini.union( + (optional_era + delete_space + year_component), + (optional_era + delete_space + year_component + delete_space + month_component), + ( + optional_era + + delete_space + + year_component + + delete_space + + month_component + + delete_space + + day_component + ), + ) + + graph_date_all = graph_date | graph_date_era + + # range + symbol = pynini.accep("-") | pynini.accep("~") | pynini.accep("——") | pynini.accep("—") + ranges = ( + pynutil.delete("range: \"") + + delete_space + + (pynini.closure(NEMO_NOT_QUOTE) | pynini.cross(symbol, "到")) + + pynutil.delete("\"") + ) + graph_range = ( + pynini.closure((ranges + delete_space), 0, 1) + + graph_date + + delete_space + + ranges + + delete_space + + graph_date + ) + + final_graph = graph_date_all | graph_range + # final_graph = optional_era + delete_space + year_component + + delete_tokens = self.delete_tokens(final_graph) + self.fst = delete_tokens.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/zh/verbalizers/decimal.py b/zonos3/vendor/nemo_text_processing/text_normalization/zh/verbalizers/decimal.py new file mode 100644 index 0000000000000000000000000000000000000000..0bbf9bc5111dfa6f8d4173db174649b03dbbde1a --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/zh/verbalizers/decimal.py @@ -0,0 +1,64 @@ +# Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.zh.graph_utils import NEMO_NOT_QUOTE, GraphFst, delete_space + + +class DecimalFst(GraphFst): + """ + Finite state transducer for verbalizing decimal, e.g. + decimal { integer_part: "零" fractional_part: "五" } -> 零点五 + decimal { integer_part: "零" fractional_part: "五" quantity: "万" } -> 零点五万 + decimal { positive: "正" integer_part: "零" fractional_part: "五" quantity: "万" } -> 正零点五万 + """ + + def __init__(self, deterministic: bool = True, lm: bool = False): + super().__init__(name="decimal", kind="verbalize", deterministic=deterministic) + + integer = pynutil.delete("integer_part: \"") + pynini.closure(NEMO_NOT_QUOTE, 1) + pynutil.delete("\"") + + fractional = pynutil.delete("fractional_part: \"") + pynini.closure(NEMO_NOT_QUOTE, 1) + pynutil.delete("\"") + + quantity = ( + pynutil.delete("quantity:") + + delete_space + + pynutil.delete("\"") + + pynini.closure(NEMO_NOT_QUOTE, 1) + + pynutil.delete("\"") + ) + + sign = pynini.closure( + pynutil.delete("negative:") + + delete_space + + pynutil.delete("\"") + + pynini.accep("负") + + pynutil.delete("\"") + ) + + graph = integer + delete_space + pynutil.insert("点") + fractional + self.decimal_regular = graph + graph_quantity = graph + delete_space + quantity + graph_regular = graph | graph_quantity + + graph_sign = sign + delete_space + graph_regular + + final_graph = graph_regular | graph_sign + self.decimal_component = final_graph + + delete_tokens = self.delete_tokens(final_graph) + self.fst = delete_tokens.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/zh/verbalizers/fraction.py b/zonos3/vendor/nemo_text_processing/text_normalization/zh/verbalizers/fraction.py new file mode 100644 index 0000000000000000000000000000000000000000..56fd1abecd430b30ed9b0ff38e2704cef37a0423 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/zh/verbalizers/fraction.py @@ -0,0 +1,90 @@ +# Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.zh.graph_utils import NEMO_NOT_QUOTE, GraphFst, delete_space + + +class FractionFst(GraphFst): + """ + Finite state transducer for verbalizing fraction e.g. + tokens { fraction { denominator: "二" numerator: "一"} } -> 二分之一 + tokens { fraction { integer_part: "一" denominator: "二" numerator: "一" } } -> 一又二分之一 + """ + + def __init__(self, decimal: GraphFst, deterministic: bool = True, lm: bool = False): + super().__init__(name="fraction", kind="verbalize", deterministic=deterministic) + + graph_decimal = decimal.decimal_component + + integer_part = ( + pynutil.delete("integer_part:") + + delete_space + + pynutil.delete("\"") + + pynini.closure(NEMO_NOT_QUOTE) + + pynutil.insert("又") + + pynutil.delete("\"") + ) + denominator_part = ( + pynutil.delete("denominator:") + + delete_space + + pynutil.delete("\"") + + pynini.closure(NEMO_NOT_QUOTE) + + pynutil.delete("\"") + ) + numerator_part = ( + pynutil.delete("numerator:") + + delete_space + + pynutil.delete("\"") + + pynini.closure(NEMO_NOT_QUOTE) + + pynutil.delete("\"") + ) + sign_part = ( + pynutil.delete("positive:") + + delete_space + + pynutil.delete("\"") + + pynini.closure(NEMO_NOT_QUOTE) + + pynutil.delete("\"") + ) | ( + pynutil.delete("negative:") + + delete_space + + pynutil.delete("\"") + + pynini.closure(NEMO_NOT_QUOTE) + + pynutil.delete("\"") + ) + + graph_with_integer = ( + integer_part + delete_space + denominator_part + delete_space + pynutil.insert('分之') + numerator_part + ) + graph_no_integer = denominator_part + delete_space + pynutil.insert('分之') + numerator_part + graph = graph_with_integer | graph_no_integer + + graph_with_decimal = ( + denominator_part + + delete_space + + pynutil.insert('分之') + + pynutil.delete("integer_part: \"") + + pynini.closure(NEMO_NOT_QUOTE) + + pynutil.delete("\"") + ) + graph_with_sign = sign_part + delete_space + (graph | graph_with_decimal) + + final_graph = graph_with_sign | graph | graph_with_decimal + self.fraction = final_graph + + delete_tokens = self.delete_tokens(final_graph) + self.fst = delete_tokens.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/zh/verbalizers/measure.py b/zonos3/vendor/nemo_text_processing/text_normalization/zh/verbalizers/measure.py new file mode 100644 index 0000000000000000000000000000000000000000..9b7de780c388cb5ed1829bd5e3a08053a33cffe2 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/zh/verbalizers/measure.py @@ -0,0 +1,71 @@ +# Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.zh.graph_utils import NEMO_NOT_QUOTE, NEMO_SPACE, GraphFst, delete_space + + +class MeasureFst(GraphFst): + ''' + tokens { measure { cardinal: "一" } units: "千克" } } -> 一千克 + ''' + + def __init__( + self, cardinal: GraphFst, decimal: GraphFst, fraction: GraphFst, deterministic: bool = True, lm: bool = False + ): + super().__init__(name="measure", kind="verbalize", deterministic=deterministic) + + cardinal = cardinal.numbers + decimal = decimal.decimal_component + sign_component = pynutil.delete("negative: \"") + pynini.closure(NEMO_NOT_QUOTE) + pynutil.delete("\"") + unit_component = pynutil.delete("units: \"") + pynini.closure(NEMO_NOT_QUOTE) + pynutil.delete("\"") + + graph_cardinal = ( + pynutil.delete("cardinal { ") + cardinal + pynutil.delete(" } ") + delete_space + unit_component + ) + + graph_decimal = ( + pynutil.delete("decimal {") + + pynini.closure(pynutil.delete(NEMO_SPACE)) + + decimal + + pynini.closure(pynutil.delete(NEMO_SPACE)) + + pynutil.delete("}") + + pynini.closure(pynutil.delete(NEMO_SPACE)) + + delete_space + + unit_component + ) + + graph_fraction = ( + pynutil.delete("fraction {") + + pynini.closure(pynutil.delete(NEMO_SPACE)) + + fraction.fraction + + pynini.closure(pynutil.delete(NEMO_SPACE)) + + pynutil.delete("}") + + pynini.closure(pynutil.delete(NEMO_SPACE)) + + delete_space + + unit_component + ) + + graph_math_cardinal = pynutil.delete("cardinal { ") + cardinal + pynutil.delete(" } ") + + graph_measures = graph_decimal | graph_cardinal | graph_fraction + graph_maths = graph_math_cardinal + + final_graph = graph_maths | graph_measures + + delete_tokens = self.delete_tokens(final_graph) + self.fst = delete_tokens.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/zh/verbalizers/money.py b/zonos3/vendor/nemo_text_processing/text_normalization/zh/verbalizers/money.py new file mode 100644 index 0000000000000000000000000000000000000000..bda283b42777d0dc677ad0440d6f41dc7d6177f1 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/zh/verbalizers/money.py @@ -0,0 +1,65 @@ +# Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.zh.graph_utils import NEMO_NOT_QUOTE, GraphFst, delete_space + + +class MoneyFst(GraphFst): + """ + Finite state transducer for verbalizing fraction e.g. + tokens { money { integer: "二" currency: "$"} } -> 二美元 + tokens { money { integer: "三" major_unit: "块"} } -> 三块 + tokens { money { currency: "$" integer: "二" } } -> 二美元 + """ + + def __init__(self, decimal: GraphFst, deterministic: bool = True, lm: bool = False): + super().__init__(name="money", kind="verbalize", deterministic=deterministic) + + # components to combine to make graphs + number_component = pynutil.delete("integer_part: \"") + pynini.closure(NEMO_NOT_QUOTE) + pynutil.delete("\"") + currency_component = pynutil.delete("currency: \"") + pynini.closure(NEMO_NOT_QUOTE) + pynutil.delete("\"") + decimal_component = decimal.decimal_component + unit_only_component = ( + (pynutil.delete("currency: \"") + pynini.closure(NEMO_NOT_QUOTE) + pynutil.delete("\"")) + | (pynutil.delete("currency_maj: \"") + pynini.closure(NEMO_NOT_QUOTE) + pynutil.delete("\"")) + | (pynutil.delete("currency_min: \"") + pynini.closure(NEMO_NOT_QUOTE) + pynutil.delete("\"")) + ) + + # graphs + graph_regular_money = number_component + delete_space + currency_component + graph_unit_money = pynini.closure( + (number_component + delete_space + unit_only_component + pynini.closure(delete_space)) + ) + graph_decimal_money = decimal_component + delete_space + currency_component + + graph_suffix = ( + number_component + + delete_space + + pynutil.delete("quantity: \"") + + pynini.closure(NEMO_NOT_QUOTE) + + pynutil.delete("\"") + + delete_space + + currency_component + ) + + graph = graph_unit_money | graph_regular_money | graph_decimal_money | graph_suffix + + final_graph = graph + + delete_tokens = self.delete_tokens(final_graph) + self.fst = delete_tokens.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/zh/verbalizers/ordinal.py b/zonos3/vendor/nemo_text_processing/text_normalization/zh/verbalizers/ordinal.py new file mode 100644 index 0000000000000000000000000000000000000000..c4bef5ded6f76a2edee6eca56334f871fa4a75e4 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/zh/verbalizers/ordinal.py @@ -0,0 +1,58 @@ +# Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.zh.graph_utils import NEMO_NOT_QUOTE, GraphFst, delete_space + + +class OrdinalFst(GraphFst): + """ + Finite state transducer for verbalizing ordinal e.g. + tokens { ordinal { integer: "第一千万" } } -> 第一千万 + """ + + def __init__(self, deterministic: bool = True, lm: bool = False): + super().__init__(name="ordinal", kind="verbalize", deterministic=deterministic) + + symbol = pynini.union("-", "~", "——", "—") + dash = pynini.cross(symbol, "到") + + delete_morpheme = ( + pynutil.delete("range: \"") + (pynini.closure('从') | (pynini.closure('到') | dash)) + pynutil.delete("\"") + ) + graph_integer = ( + pynutil.delete("integer:") + + delete_space + + pynutil.delete("\"") + + pynini.closure("第", 0, 1) + + pynini.closure(NEMO_NOT_QUOTE) + + pynutil.delete("\"") + ) + graph_range = ( + pynini.closure(delete_morpheme, 0, 1) + + pynini.closure(delete_space, 0, 1) + + graph_integer + + delete_space + + delete_morpheme + + delete_space + + graph_integer + ) + + final_graph = pynutil.add_weight(graph_integer, -2.0) | graph_range + + delete_tokens = self.delete_tokens(final_graph) + self.fst = delete_tokens.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/zh/verbalizers/post_processing.py b/zonos3/vendor/nemo_text_processing/text_normalization/zh/verbalizers/post_processing.py new file mode 100644 index 0000000000000000000000000000000000000000..f39ecc845f6c4f264b2de5dc8e4cb7e061c4d1c5 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/zh/verbalizers/post_processing.py @@ -0,0 +1,113 @@ +# Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import os + +import pynini + +from zonos3.vendor.nemo_text_processing.text_normalization.en.graph_utils import ( + NEMO_NOT_SPACE, + NEMO_SIGMA, + delete_space, + generator_main, +) +from zonos3.vendor.nemo_text_processing.utils.logging import logger + + +class PostProcessingFst: + """ + Finite state transducer that post-processing an entire sentence after verbalization is complete, e.g. + removes extra spaces around punctuation marks " ( one hundred and twenty three ) " -> "(one hundred and twenty three)" + + Args: + cache_dir: path to a dir with .far grammar file. Set to None to avoid using cache. + overwrite_cache: set to True to overwrite .far files + """ + + def __init__(self, cache_dir: str = None, overwrite_cache: bool = False): + + far_file = None + if cache_dir is not None and cache_dir != "None": + os.makedirs(cache_dir, exist_ok=True) + far_file = os.path.join(cache_dir, "zh_tn_post_processing.far") + if not overwrite_cache and far_file and os.path.exists(far_file): + self.fst = pynini.Far(far_file, mode="r")["post_process_graph"] + logger.info(f'Post processing graph was restored from {far_file}.') + else: + self.set_punct_dict() + self.fst = self.get_punct_postprocess_graph() + + if far_file: + generator_main(far_file, {"post_process_graph": self.fst}) + + def set_punct_dict(self): + self.punct_marks = { + "'": [ + "'", + '´', + 'ʹ', + 'ʻ', + 'ʼ', + 'ʽ', + 'ʾ', + 'ˈ', + 'ˊ', + 'ˋ', + '˴', + 'ʹ', + '΄', + '՚', + '՝', + 'י', + '׳', + 'ߴ', + 'ߵ', + 'ᑊ', + 'ᛌ', + '᾽', + '᾿', + '`', + '´', + '῾', + '‘', + '’', + '‛', + '′', + '‵', + 'ꞌ', + ''', + '`', + '𖽑', + '𖽒', + ], + } + + def get_punct_postprocess_graph(self): + """ + Returns graph to post process punctuation marks. + + {``} quotes are converted to {"}. Note, if there are spaces around single quote {'}, they will be kept. + By default, a space is added after a punctuation mark, and spaces are removed before punctuation marks. + """ + + remove_space_around_single_quote = pynini.cdrewrite( + delete_space, NEMO_NOT_SPACE, NEMO_NOT_SPACE, pynini.closure(NEMO_SIGMA) + ) + # this works if spaces in between (good) + # delete space between 2 NEMO_NOT_SPACE(left and right to the space) that are with in a content of NEMO_SIGMA + + graph = remove_space_around_single_quote.optimize() + + return graph diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/zh/verbalizers/postprocessor.py b/zonos3/vendor/nemo_text_processing/text_normalization/zh/verbalizers/postprocessor.py new file mode 100644 index 0000000000000000000000000000000000000000..bf1bbfe1a76a52e90713064353aeb2c0a5e409d2 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/zh/verbalizers/postprocessor.py @@ -0,0 +1,81 @@ +# Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import pynini +from pynini.lib import pynutil, utf8 + +from zonos3.vendor.nemo_text_processing.text_normalization.zh.graph_utils import ( + NEMO_ALPHA, + NEMO_DIGIT, + NEMO_PUNCT, + NEMO_SIGMA, + NEMO_WHITE_SPACE, + GraphFst, +) +from zonos3.vendor.nemo_text_processing.text_normalization.zh.utils import get_abs_path + + +class PostProcessor(GraphFst): + ''' + Postprocessing of TN, now contains: + 1. punctuation removal + 2. letter case conversion + 3. oov tagger + ''' + + def __init__( + self, + remove_puncts: bool = False, + to_upper: bool = False, + to_lower: bool = False, + tag_oov: bool = False, + ): + super().__init__(name="PostProcessor", kind="processor") + + graph = pynini.cdrewrite('', '', '', NEMO_SIGMA) + if remove_puncts: + remove_puncts_graph = pynutil.delete( + pynini.union(NEMO_PUNCT, pynini.string_file(get_abs_path('data/char/punctuations_zh.tsv'))) + ) + graph @= pynini.cdrewrite(remove_puncts_graph, "", "", NEMO_SIGMA).optimize() + + if to_upper or to_lower: + if to_upper: + conv_cases_graph = pynini.inverse(pynini.string_file(get_abs_path('data/char/upper_to_lower.tsv'))) + else: + conv_cases_graph = pynini.string_file(get_abs_path('data/char/upper_to_lower.tsv')) + + graph @= pynini.cdrewrite(conv_cases_graph, "", "", NEMO_SIGMA).optimize() + + if tag_oov: + zh_charset_std = pynini.string_file(get_abs_path("data/char/charset_national_standard_2013_8105.tsv")) + zh_charset_ext = pynini.string_file(get_abs_path("data/char/charset_extension.tsv")) + + zh_charset = ( + zh_charset_std | zh_charset_ext | pynini.string_file(get_abs_path("data/char/punctuations_zh.tsv")) + ) + en_charset = NEMO_DIGIT | NEMO_ALPHA | NEMO_PUNCT | NEMO_WHITE_SPACE + charset = zh_charset | en_charset + + with open(get_abs_path("data/char/oov_tags.tsv"), "r") as f: + tags = f.readline().strip().split('\t') + assert len(tags) == 2 + ltag, rtag = tags + + oov_charset = pynini.difference(utf8.VALID_UTF8_CHAR, charset) + tag_oov_graph = pynutil.insert(ltag) + oov_charset + pynutil.insert(rtag) + graph @= pynini.cdrewrite(tag_oov_graph, "", "", NEMO_SIGMA).optimize() + + self.fst = graph.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/zh/verbalizers/time.py b/zonos3/vendor/nemo_text_processing/text_normalization/zh/verbalizers/time.py new file mode 100644 index 0000000000000000000000000000000000000000..021436b1e56afbf4327324a0c81e922af143c181 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/zh/verbalizers/time.py @@ -0,0 +1,93 @@ +# Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.zh.graph_utils import NEMO_NOT_QUOTE, GraphFst, delete_space +from zonos3.vendor.nemo_text_processing.text_normalization.zh.utils import get_abs_path + + +class TimeFst(GraphFst): + """ + Finite state transducer for verbalizing time e.g. + tokens { time { hour: "五点" } } -> 五点 + tokens { time { minute: "三分" }' } -> 三分 + tokens { time { hour: "五点" minute: "三分" } } -> 五点三分 + tokens { time { affix: "am" hour: "五点" verb: "差" minute: "三分" }' } -> 早上五点差三分 + tokens { time { affix: "am" hour: "一点" minute: "三分" } } -> 深夜一点三分 + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="time", kind="verbalize", deterministic=deterministic) + + # data imported to process am/pm into mandarin + alphabet_am = pynini.string_file(get_abs_path("data/time/AM.tsv")) + alphabet_pm = pynini.string_file(get_abs_path("data/time/PM.tsv")) + + # fundamental components + hour_component = pynutil.delete("hours: \"") + pynini.closure(NEMO_NOT_QUOTE) + pynutil.delete("\"") + minute_component = pynutil.delete("minutes: \"") + pynini.closure(NEMO_NOT_QUOTE) + pynutil.delete("\"") + second_component = pynutil.delete("seconds: \"") + pynini.closure(NEMO_NOT_QUOTE) + pynutil.delete("\"") + graph_regular = ( + hour_component + | minute_component + | second_component + | (hour_component + delete_space + minute_component + delete_space + second_component) + | (hour_component + delete_space + minute_component) + | (hour_component + delete_space + second_component) + | (minute_component + delete_space + second_component) + ) + + # back count 三点差五分 + delete_verb = pynutil.delete("morphosyntactic_features: \"") + pynini.accep("差") + pynutil.delete("\"") + graph_back_count = ( + ( + pynini.closure(delete_verb + pynutil.insert(' ')) + + hour_component + + delete_space + + pynini.closure(delete_verb) + + delete_space + + minute_component + ) + | ( + pynini.closure(delete_verb + pynutil.insert(' ')) + + hour_component + + delete_space + + pynini.closure(delete_verb) + + delete_space + + second_component + ) + | ( + pynini.closure(delete_verb + pynutil.insert(' ')) + + hour_component + + delete_space + + pynini.closure(delete_verb) + + delete_space + + minute_component + + delete_space + + second_component + ) + ) + + graph = graph_regular | graph_back_count + + delete_suffix = pynutil.delete("suffix: \"") + pynini.closure(alphabet_am | alphabet_pm) + pynutil.delete("\"") + graph = graph | (graph + delete_space + delete_suffix) + + final_graph = graph + + delete_tokens = self.delete_tokens(final_graph) + self.fst = delete_tokens.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/zh/verbalizers/verbalize.py b/zonos3/vendor/nemo_text_processing/text_normalization/zh/verbalizers/verbalize.py new file mode 100644 index 0000000000000000000000000000000000000000..fda56585a1a37341d071852ba7dbe71df1dd5e9b --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/zh/verbalizers/verbalize.py @@ -0,0 +1,69 @@ +# Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import pynini + +from zonos3.vendor.nemo_text_processing.text_normalization.zh.graph_utils import GraphFst, delete_space +from zonos3.vendor.nemo_text_processing.text_normalization.zh.verbalizers.cardinal import CardinalFst +from zonos3.vendor.nemo_text_processing.text_normalization.zh.verbalizers.date import DateFst +from zonos3.vendor.nemo_text_processing.text_normalization.zh.verbalizers.decimal import DecimalFst +from zonos3.vendor.nemo_text_processing.text_normalization.zh.verbalizers.fraction import FractionFst +from zonos3.vendor.nemo_text_processing.text_normalization.zh.verbalizers.measure import MeasureFst +from zonos3.vendor.nemo_text_processing.text_normalization.zh.verbalizers.money import MoneyFst +from zonos3.vendor.nemo_text_processing.text_normalization.zh.verbalizers.ordinal import OrdinalFst +from zonos3.vendor.nemo_text_processing.text_normalization.zh.verbalizers.time import TimeFst +from zonos3.vendor.nemo_text_processing.text_normalization.zh.verbalizers.whitelist import Whitelist +from zonos3.vendor.nemo_text_processing.text_normalization.zh.verbalizers.word import WordFst + + +class VerbalizeFst(GraphFst): + """ + Composes other verbalizer grammars. + For deployment, this grammar will be compiled and exported to OpenFst Finate State Archiv (FAR) File. + More details to deployment at NeMo/tools/text_processing_deployment. + Args: + deterministic: if True will provide a single transduction option, + for False multiple options (used for audio-based normalization) + """ + + def __init__(self, deterministic: bool = True): + super().__init__(name="verbalize", kind="verbalize", deterministic=deterministic) + + date = DateFst(deterministic=deterministic) + cardinal = CardinalFst(deterministic=deterministic) + ordinal = OrdinalFst(deterministic=deterministic) + decimal = DecimalFst(deterministic=deterministic) + word = WordFst(deterministic=deterministic) + fraction = FractionFst(decimal=decimal, deterministic=deterministic) + money = MoneyFst(decimal=decimal, deterministic=deterministic) + measure = MeasureFst(cardinal=cardinal, decimal=decimal, fraction=fraction, deterministic=deterministic) + time = TimeFst(deterministic=deterministic) + whitelist = Whitelist(deterministic=deterministic) + + graph = pynini.union( + date.fst, + cardinal.fst, + ordinal.fst, + decimal.fst, + fraction.fst, + word.fst, + money.fst, + measure.fst, + time.fst, + whitelist.fst, + ) + graph = pynini.closure(delete_space) + graph + pynini.closure(delete_space) + + self.fst = graph.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/zh/verbalizers/verbalize_final.py b/zonos3/vendor/nemo_text_processing/text_normalization/zh/verbalizers/verbalize_final.py new file mode 100644 index 0000000000000000000000000000000000000000..f5aa89614e6d9d20dcc87b618b3c6cfa04a2502c --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/zh/verbalizers/verbalize_final.py @@ -0,0 +1,52 @@ +# Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +import os + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.zh.graph_utils import GraphFst, delete_space, generator_main +from zonos3.vendor.nemo_text_processing.text_normalization.zh.verbalizers.postprocessor import PostProcessor +from zonos3.vendor.nemo_text_processing.text_normalization.zh.verbalizers.verbalize import VerbalizeFst + +# from nemo.utils import logging + + +class VerbalizeFinalFst(GraphFst): + """ """ + + def __init__(self, deterministic: bool = True, cache_dir: str = None, overwrite_cache: bool = False): + super().__init__(name="verbalize_final", kind="verbalize", deterministic=deterministic) + far_file = None + if cache_dir is not None and cache_dir != "None": + os.makedirs(cache_dir, exist_ok=True) + far_file = os.path.join(cache_dir, f"zh_tn_{deterministic}_deterministic_verbalizer.far") + if not overwrite_cache and far_file and os.path.exists(far_file): + self.fst = pynini.Far(far_file, mode="r")["verbalize"] + else: + token_graph = VerbalizeFst(deterministic=deterministic) + + token_verbalizer = ( + pynutil.delete("tokens {") + delete_space + token_graph.fst + delete_space + pynutil.delete(" }") + ) + verbalizer = pynini.closure(delete_space + token_verbalizer + delete_space) + + postprocessor = PostProcessor( + remove_puncts=False, + to_upper=False, + to_lower=False, + tag_oov=False, + ) + + self.fst = (verbalizer @ postprocessor.fst).optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/zh/verbalizers/whitelist.py b/zonos3/vendor/nemo_text_processing/text_normalization/zh/verbalizers/whitelist.py new file mode 100644 index 0000000000000000000000000000000000000000..2bbb577796588cdbbd21fc3dbecceba28a7c7916 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/zh/verbalizers/whitelist.py @@ -0,0 +1,32 @@ +# Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import pynini +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.zh.graph_utils import NEMO_NOT_QUOTE, GraphFst + + +class Whitelist(GraphFst): + ''' + tokens { whitelist: "ATM" } -> A T M + ''' + + def __init__(self, deterministic: bool = True, lm: bool = False): + super().__init__(name="whitelist", kind="verbalize", deterministic=deterministic) + remove_erhua = pynutil.delete("erhua: \"") + pynutil.delete("儿") + pynutil.delete("\"") + whitelist = pynutil.delete("name: \"") + pynini.closure(NEMO_NOT_QUOTE) + pynutil.delete("\"") + graph = remove_erhua | whitelist + self.fst = graph.optimize() diff --git a/zonos3/vendor/nemo_text_processing/text_normalization/zh/verbalizers/word.py b/zonos3/vendor/nemo_text_processing/text_normalization/zh/verbalizers/word.py new file mode 100644 index 0000000000000000000000000000000000000000..9b0a802df906a76758a8b42398dc264cbc7eff40 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/text_normalization/zh/verbalizers/word.py @@ -0,0 +1,30 @@ +# Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from pynini.lib import pynutil + +from zonos3.vendor.nemo_text_processing.text_normalization.zh.graph_utils import NEMO_NOT_QUOTE, GraphFst + + +class WordFst(GraphFst): + ''' + tokens { char: "你" } -> 你 + ''' + + def __init__(self, deterministic: bool = True, lm: bool = False): + super().__init__(name="char", kind="verbalize", deterministic=deterministic) + + graph = pynutil.delete("name: \"") + NEMO_NOT_QUOTE + pynutil.delete("\"") + self.fst = graph.optimize() diff --git a/zonos3/vendor/nemo_text_processing/utils/__init__.py b/zonos3/vendor/nemo_text_processing/utils/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..ff57e8c8333e3fb7212f80b2020a4d3ae71f0e90 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/utils/__init__.py @@ -0,0 +1,15 @@ +# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATE. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from zonos3.vendor.nemo_text_processing.utils.logging import logger diff --git a/zonos3/vendor/nemo_text_processing/utils/logging.py b/zonos3/vendor/nemo_text_processing/utils/logging.py new file mode 100644 index 0000000000000000000000000000000000000000..96187bfdf81804e5ab86ddd3f64fb3bb7e6e37e6 --- /dev/null +++ b/zonos3/vendor/nemo_text_processing/utils/logging.py @@ -0,0 +1,23 @@ +# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +import logging + +# overriding with the library specific logger, so that it's possible to +# customize in any downstream applications +logger = logging.getLogger("NeMo-text-processing") +c_handler = logging.StreamHandler() +logger.addHandler(c_handler) +logger.setLevel(logging.INFO) +logFormatter = logging.Formatter(fmt=' %(name)s :: %(levelname)-8s :: %(message)s') +c_handler.setFormatter(logFormatter) diff --git a/zonos3/workers/__init__.py b/zonos3/workers/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/zonos3/workers/asr.py b/zonos3/workers/asr.py new file mode 100644 index 0000000000000000000000000000000000000000..91671996627ba9de35635607e079df8a2d145f0e --- /dev/null +++ b/zonos3/workers/asr.py @@ -0,0 +1,131 @@ +#!/usr/bin/env python3 +"""Qwen3-ASR speech recognition (speech editing and dubbing) in a persistent process. + +Runs in .venv-asr (tools/setup_asr_env.sh; qwen-asr pins its own transformers) with ``PYTHONPATH=``. Reads +one JSON request per stdin line (``{"id", "op", ...}``) and answers each with one JSON line on stdout, in order, until +stdin closes: ``{"id", "status": "ok", ...}`` or ``{"id", "status": "error", "error", "message", "invalid"}`` +("invalid": a ValueError, i.e. the input is at fault). The model loads on the first ``transcribe``, so ``ping`` answers +at once. + +Ops: + ping -> {"model": the ASR model id, "languages": [Qwen3-ASR language names]} + transcribe {items: [{audio, start?, end?, -> {"results": [{"text", "language"}]} (one per item, in order) + language}]} + +``audio`` is the path of any sound file soundfile reads (channels are averaged); ``start`` / ``end`` (seconds, default +the file's start / end, clipped to it) select the part to transcribe; ``language`` is a Qwen3-ASR language name of +``ping``'s list (``"English"``, ``"Japanese"``, ...) or null to detect it. ``text`` is the stripped transcript and +``language`` the language Qwen3-ASR reports (the forced one, or the detected ones joined with ","; "" for an empty +selection). The items of one request share batched forwards. +""" +import argparse +import json +import os +import sys +from typing import Callable, Iterable, TextIO + +MODEL = "Qwen/Qwen3-ASR-1.7B" + + +def read_part(path: str, start, end): + """Mono float32 samples of ``[start, end)`` seconds of a sound file, and its sample rate.""" + import soundfile as sf + + with sf.SoundFile(path) as f: + sr, frames = int(f.samplerate), f.frames + first = 0 if start is None else min(frames, max(0, round(float(start) * sr))) + last = frames if end is None else min(frames, max(first, round(float(end) * sr))) + f.seek(first) + data = f.read(last - first, dtype="float32", always_2d=True) + return data.mean(axis=1), sr + + +def transcribe(model, languages: list[str], items: list) -> list[dict]: + """Per item ``{"text", "language"}``; ``model.transcribe`` is qwen_asr's ``Qwen3ASRModel.transcribe``.""" + if not isinstance(items, list): + raise ValueError("transcribe: items must be a list") + parts, langs = [], [] + for k, item in enumerate(items): + if not isinstance(item, dict) or not isinstance(item.get("audio"), str): + raise ValueError(f"transcribe: items[{k}] needs an audio path") + unknown = set(item) - {"audio", "start", "end", "language"} + if unknown: + raise ValueError(f"transcribe: items[{k}] has unknown fields {sorted(unknown)}") + for key in ("start", "end"): + if item.get(key) is not None and (isinstance(item[key], bool) or not isinstance(item[key], (int, float))): + raise ValueError(f"transcribe: items[{k}].{key} must be a number of seconds or null") + language = item.get("language") + if language is not None and language not in languages: + raise ValueError(f"transcribe: items[{k}].language {language!r} is not a Qwen3-ASR language " + f"(supported: {', '.join(languages)})") + parts.append(read_part(item["audio"], item.get("start"), item.get("end"))) + langs.append(language) + results = [{"text": "", "language": ""} for _ in items] + voiced = [k for k, (wav, _) in enumerate(parts) if wav.size] + if voiced: + out = model.transcribe(audio=[parts[k] for k in voiced], language=[langs[k] for k in voiced]) + for k, r in zip(voiced, out, strict=True): + results[k] = {"text": (r.text or "").strip(), "language": r.language or ""} + return results + + +def serve(lines: Iterable[str], out: TextIO, model_id: str, languages: list[str], load: Callable[[], object]) -> None: + """Answer the requests of ``lines`` on ``out``; ``load()`` builds the model on the first ``transcribe``.""" + model = None + for line in lines: + if not line.strip(): + continue + rid = None + try: + request = json.loads(line) + rid = request.get("id") + op = request.get("op") + if op == "ping": + response = {"model": model_id, "languages": list(languages)} + elif op == "transcribe": + if model is None: + model = load() + response = {"results": transcribe(model, languages, request.get("items"))} + else: + raise ValueError(f"unknown op {op!r}") + response.update(id=rid, status="ok") + except Exception as exc: # noqa: BLE001 - one bad request must not kill the worker + response = {"id": rid, "status": "error", "error": repr(exc), "message": str(exc), + "invalid": isinstance(exc, ValueError)} + out.write(json.dumps(response, ensure_ascii=False) + "\n") + out.flush() + + +def main() -> None: + parser = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter) + parser.add_argument("--device", default=os.environ.get("ZONOS3_ASR_DEVICE"), + help="torch device (default: $ZONOS3_ASR_DEVICE, else cuda:0 when available, else cpu)") + parser.add_argument("--model", default=MODEL, help=f"Qwen3-ASR checkpoint (default: {MODEL})") + args = parser.parse_args() + # Keep stdout for responses only: library prints go to stderr. + protocol = os.fdopen(os.dup(1), "w", buffering=1, encoding="utf-8") + os.dup2(2, 1) + sys.stdout = sys.stderr + + import torch + from qwen_asr.inference.utils import SUPPORTED_LANGUAGES + + device = args.device or ("cuda:0" if torch.cuda.is_available() else "cpu") + + def load(): + from qwen_asr import Qwen3ASRModel + + return Qwen3ASRModel.from_pretrained( + args.model, + dtype=torch.float32 if device == "cpu" else torch.bfloat16, + device_map=device, + max_inference_batch_size=32, + max_new_tokens=1024, + ) + + with torch.no_grad(): + serve(sys.stdin, protocol, args.model, SUPPORTED_LANGUAGES, load) + + +if __name__ == "__main__": + main() diff --git a/zonos3/workers/dub_align.py b/zonos3/workers/dub_align.py new file mode 100644 index 0000000000000000000000000000000000000000..232e49a22d3456e7e200828603a583bf04d55450 --- /dev/null +++ b/zonos3/workers/dub_align.py @@ -0,0 +1,116 @@ +#!/usr/bin/env python3 +"""Word alignment and lip-sync worker of the dubbing server (runs in .venv-asr; see tools/setup_asr_env.sh). + +Reads one JSON request per stdin line ({"id", "op", ...}) and answers each with one JSON line on stdout, in order, until +stdin closes: {"id", "status": "ok", ...} or {"id", "status": "error", "error", "message", "invalid"} ("invalid": a +ValueError, i.e. the input is at fault). The word aligner loads once, before the first read; AV-sync on its first use. +Speech recognition is zonos3/workers/asr.py's and forced alignment FuseAlign's (zonos3/workers/fusealign.py, in the +server's interpreter). + +Ops: + ping -> {"avsync": bool} + word_align {src: [str], tgt: [str]} -> {"links": [[i, j]]} (SimAlign mBERT, BPE level, itermax; windowed) + lips_prepare {video, out} -> {"start", "end", "track_frames", "video_frames", "tracks"} (AV-sync) + lips_sync {lips, audio, out, -> {"start", "end", "rate", "src_frames", "dp_cost", + max_rate?, max_shift_s?} "sync_distance_before", "sync_distance_after"} (AV-sync; + the optional bounds of the warp: plan.guard_lip_frames) +""" +import argparse +import json +import os +import sys + +import numpy as np +import torch + +import dub_avsync +from zonos3.dub import plan + + +def side_embeddings(emb, words): + """Wordpiece embeddings of one side, stitched from overlapping windows; returns (X [wp, d], wordpiece -> word).""" + counts = [len(emb.tokenizer.tokenize(w)) for w in words] + windows = plan.word_windows(counts) + owner = plan.window_of_words(windows, len(words)) + window_vecs = [] + for s, e in windows: + window_vecs.append(emb.get_embed_list([words[s:e]])[0].float().cpu().numpy()) + rows, b2w = [], [] + for w, c in enumerate(counts): + if c == 0: + continue + s, _ = windows[owner[w]] + off = sum(counts[s:w]) + rows.append(window_vecs[owner[w]][off : off + c]) + b2w.extend([w] * c) + if not rows: + return None, [] + return np.concatenate(rows, axis=0), b2w + + +def word_align(emb, SentenceAligner, src, tgt): + X, b2w_src = side_embeddings(emb, src) + Y, b2w_tgt = side_embeddings(emb, tgt) + if X is None or Y is None: + return {"links": []} + sim = SentenceAligner.get_similarity(X, Y) * plan.band_mask(len(X), len(Y)) + inter = SentenceAligner.iter_max(sim) + links = sorted({(b2w_src[p], b2w_tgt[q]) for p, q in zip(*np.nonzero(inter))}) + return {"links": [[int(i), int(j)] for i, j in links]} + + +def main(): + parser = argparse.ArgumentParser() + parser.add_argument("--device", default="cuda:0") + parser.add_argument("--word-aligner-model", default="google-bert/bert-base-multilingual-cased") + parser.add_argument("--avsync-home", default=None, help="AV-sync checkout with its models in data/") + args = parser.parse_args() + + # Keep stdout for responses only: library prints go to stderr. + protocol = os.fdopen(os.dup(1), "w", buffering=1) + os.dup2(2, 1) + sys.stdout = sys.stderr + + import simalign.simalign + + SentenceAligner = simalign.simalign.SentenceAligner + emb = simalign.simalign.EmbeddingLoader(model=args.word_aligner_model, device=torch.device(args.device), layer=8) + avsync = [] # the AV-sync models, loaded on first use + + def lips(): + if not avsync: + if not args.avsync_home: + raise RuntimeError("lip-sync is not set up (no --avsync-home)") + avsync.append(dub_avsync.AvSync(args.avsync_home, args.device)) + return avsync[0] + + def handle(req): + op = req["op"] + if op == "ping": + return {"avsync": bool(args.avsync_home) and dub_avsync.models_present(args.avsync_home)} + if op == "word_align": + return word_align(emb, SentenceAligner, req["src"], req["tgt"]) + if op == "lips_prepare": + return lips().prepare(req["video"], req["out"]) + if op == "lips_sync": + return lips().sync(req["lips"], req["audio"], req["out"], req.get("max_rate"), req.get("max_shift_s")) + raise ValueError(f"unknown op {op!r}") + + for line in sys.stdin: + if not line.strip(): + continue + rid = None + try: + req = json.loads(line) + rid = req.get("id") + with torch.no_grad(): + resp = handle(req) + resp.update(id=rid, status="ok") + except Exception as exc: # noqa: BLE001 - one bad request must not kill the worker + resp = {"id": rid, "status": "error", "error": repr(exc), "message": str(exc), + "invalid": isinstance(exc, ValueError)} + protocol.write(json.dumps(resp) + "\n") + + +if __name__ == "__main__": + main() diff --git a/zonos3/workers/dub_avsync.py b/zonos3/workers/dub_avsync.py new file mode 100644 index 0000000000000000000000000000000000000000..2426792caa516b9ad1e5756a2352530f1162d435 --- /dev/null +++ b/zonos3/workers/dub_avsync.py @@ -0,0 +1,250 @@ +"""AV-sync lip-sync step of the alignment worker (dub_align.py; runs in .venv-asr). + +AV-sync (https://github.com/Ryu1845/AV-sync, "Dynamic Temporal Alignment of Speech to Lips", Halperin et al.) is +imported from its checkout (--avsync-home, cloned at a pinned commit by tools/setup_asr_env.sh): the S3FD face +detector, SyncNet, the lip / audio embeddings, the banded dynamic programming and its smoothing filters. Its two entry +points are scripts that run on import, so the glue between those pieces is ported here, kept to +their constants: the face tracking and crop of run_pipeline.py (prepare) and the path post-processing of +align_audio.py main() / smooth_flow() (warp_frames). Alignment uses modality "va": the lips of the source video +against the dub's audio. + +Differences from the scripts: face crops go straight from the decoder into SyncNet (the scripts re-encode them to +cropped.avi first), and the warp is applied with WSOLA (plan.wsola) to the full-rate 44.1 kHz dub, where align_audio.py +runs a phase vocoder (+ Griffin-Lim) on a 16 kHz, peak-normalized copy. WSOLA copies waveform segments, so it needs no +phase reconstruction: the phase vocoder alone lost 1.5-3 dB on warped dub speech and needed 10 Griffin-Lim iterations +to keep the level. Outside the face track the offset at its nearer end holds (plan.LipMap), so the whole dub stays +continuous. +""" + +from __future__ import annotations + +import itertools +import subprocess +import sys +import tempfile +from pathlib import Path + +import numpy as np +import soundfile as sf +import torch +import torch.nn.functional as F + +from zonos3.dub import plan + +# run_pipeline.py defaults +CROP_SCALE, MIN_TRACK, FACEDET_SCALE, MIN_CONF = 0.5, 30, 0.25, 0.9 +IOU_THRES, NUM_FAIL, MIN_SIZE = 0.5, 3, 0.05 +# align_audio.py defaults +MAX_DIFF_SMOOTH, GAUSSIAN_SIGMA = 0.05, 10 + + +def models_present(home: str) -> bool: + data = Path(home) / "data" + return (data / "syncnet_v2.model").is_file() and (data / "sfd_face.pth").is_file() + + +def _ffmpeg(args: list[str], what: str) -> None: + proc = subprocess.run(["ffmpeg", "-hide_banner", "-loglevel", "error", "-y", *args], capture_output=True, text=True) + if proc.returncode: + raise ValueError(f"ffmpeg could not {what}: {proc.stderr[-400:]}") + + +class AvSync: + def __init__(self, home: str, device: str): + if not models_present(home): + raise RuntimeError(f"AV-sync models missing under {home}/data (run tools/setup_asr_env.sh)") + sys.path.insert(0, str(home)) + import avsnap_utils + import s3fd + import SyncNetInstance + + dev = torch.device(device) + avsnap_utils.device = SyncNetInstance.device = dev + avsnap_utils.amp = True # align_audio.py default (--amp) + self.utils = utils = avsnap_utils + self.model = SyncNetInstance.SyncNetInstance() + self.model.loadParameters(str(Path(home) / "data" / "syncnet_v2.model")) + self.model.__S__.eval() + self.detector = s3fd.S3FD(str(Path(home) / "data" / "sfd_face.pth"), dev) + self.det_batch = 16 if dev.type == "cuda" else 1 # run_pipeline.py det_batch_size + self.fps = utils.FPS + + # ---- face track + lip embeddings (run_pipeline.py) --------------------------------------------------------- + + def prepare(self, video: str, out: str) -> dict: + """Face track of ``video`` (the first one, as run_pipeline.py) and its SyncNet lip embeddings, saved to ``out``.""" + utils = self.utils + with tempfile.TemporaryDirectory(prefix="avsync-", dir=str(Path(out).parent)) as tmp: + video25 = str(Path(tmp) / "video.avi") + _ffmpeg(["-i", video, "-qscale:v", "4", "-r", str(self.fps), "-vf", "yadif=deint=interlaced", "-an", video25], + "read this video") + fw, fh, _ = utils.probe_vid(video25) + faces = self._detect(video25) + n_frames = len(faces) + tracks = self._track(faces) + if not tracks: + raise ValueError(f"no face track found (AV-sync needs one face visible for more than {MIN_TRACK} frames)") + frames, boxes = tracks[0] + emb = utils.vid2emb(self._crops(video25, frames, boxes, fw, fh), self.model, every_frame=True) + first, last = int(frames[0]), int(frames[-1]) + torch.save({"emb": emb, "first_frame": first, "last_frame": last, "fps": self.fps}, out) + return {"start": first / self.fps, "end": (last + 1) / self.fps, "track_frames": last - first + 1, + "video_frames": n_frames, "tracks": len(tracks)} + + def _detect(self, video25: str) -> list[list]: + dets, batch = [], [] + + def flush(): + boxes = self.detector.detect_batch([im for _, im in batch], conf_th=MIN_CONF, scale=FACEDET_SCALE) + for (num, _), frame_boxes in zip(batch, boxes): + dets.append([[num, box[:4], box[4]] for box in frame_boxes.tolist()]) + batch.clear() + + for num, image in enumerate(self.utils.iter_frames(video25)): + batch.append((num, image)) + if len(batch) == self.det_batch: + flush() + if batch: + flush() + return dets + + def _track(self, scenefaces: list[list]) -> list: + """run_pipeline.py track_shot (its in-place list surgery included, so the same tracks come out).""" + tracks = [] + while True: + track = [] + for faces in scenefaces: + for face in faces: + if track == []: + track.append(face) + faces.remove(face) + elif face[0] - track[-1][0] <= NUM_FAIL: + if _iou(face[1], track[-1][1]) > IOU_THRES: + track.append(face) + faces.remove(face) + continue + else: + break + if track == []: + break + if len(track) > MIN_TRACK: + framenum = torch.tensor([f[0] for f in track], dtype=torch.float64) + bboxes = torch.tensor([f[1] for f in track], dtype=torch.float64) + frame_i = torch.arange(track[0][0], track[-1][0] + 1) + bboxes_i = self.utils.interp(frame_i.double(), framenum, bboxes) + if torch.mean(bboxes_i[:, 3] - bboxes_i[:, 1]) > MIN_SIZE: + tracks.append([frame_i, bboxes_i]) + return tracks + + def _crops(self, video25: str, frames, boxes, fw: int, fh: int): + """run_pipeline.py crop_video's 224 x 224 face crops, streamed.""" + utils = self.utils + size, cx, cy = [], [], [] + for det in boxes.tolist(): + size.append(((det[3] - det[1]) * fw + (det[2] - det[0]) * fh) / 4) + cx.append((det[1] + det[3]) * fw / 2) + cy.append((det[0] + det[2]) * fh / 2) + size = utils.medfilt(torch.tensor(size, dtype=torch.float64), kernel_size=5).tolist() + cx = utils.medfilt(torch.tensor(cx, dtype=torch.float64), kernel_size=5).tolist() + cy = utils.medfilt(torch.tensor(cy, dtype=torch.float64), kernel_size=7).tolist() + cs = CROP_SCALE + video = itertools.islice(utils.iter_frames(video25), int(frames[0]), None) + for bs, mx0, my0, frame in zip(size, cx, cy, video): + bsi = int(bs * (1 + 2 * cs)) + my, mx = my0 + bsi, mx0 + bsi + ya, ystart, ystop, yb = _pad_span(int(my - bs), int(my + bs * (1 + 2 * cs)), fh, bsi) + xa, xstart, xstop, xb = _pad_span(int(mx - bs * (1 + cs)), int(mx + bs * (1 + cs)), fw, bsi) + face = F.pad(frame[ystart:ystop, xstart:xstop].permute(2, 0, 1), (xa, xb, ya, yb)) + resized = F.interpolate(face[None].float(), size=(224, 224), mode="bilinear", antialias=True)[0] + yield resized.round().clamp(0, 255).to(torch.uint8).permute(1, 2, 0) + + # ---- alignment + warp (align_audio.py) --------------------------------------------------------------------- + + def sync(self, lips: str, audio: str, out: str, max_rate: float | None = None, max_shift_s: float | None = None) -> dict: + """Warp the dub ``audio`` onto the lips of ``lips`` (prepare's file); writes the warped dub to ``out``. With + ``max_rate`` and ``max_shift_s`` the warp is bounded first (plan.guard_lip_frames).""" + utils = self.utils + track = torch.load(lips, weights_only=True) + start, end = track["first_frame"] / track["fps"], (track["last_frame"] + 1) / track["fps"] + wav, sr = sf.read(audio, dtype="float64", always_2d=True) + wav = wav.mean(axis=1) + vid_emb = track["emb"] + aud_emb = self._span_embedding(audio, start, end) + dp = utils.dynamic_programming(vid_emb, aud_emb) # modality "va": lips of the video, audio of the dub + path, cost = utils.find_path(dp) + src = self.warp_frames(path) + if max_rate is not None and max_shift_s is not None: + src = torch.from_numpy(plan.guard_lip_frames(src.numpy(), utils.WINDOWS_PER_SECOND, max_rate, max_shift_s)) + lip_map = plan.LipMap.from_frames(start, utils.WINDOWS_PER_SECOND, src.tolist()) + + # output sample t plays the dub at lip_map.src_time(t / sr) + n_out = int(round(lip_map.out_time(len(wav) / sr) * sr)) + y = plan.wsola(wav, lambda t: lip_map.src_time(t / sr) * sr, n_out) + sf.write(out, y.astype(np.float32), sr, subtype="FLOAT") + + synced_emb = self._span_embedding(out, start, end) + return { + "start": start, + "end": end, + "rate": utils.WINDOWS_PER_SECOND, + "src_frames": src.tolist(), + "dp_cost": float(cost), + "sync_distance_before": self._diag_distance(vid_emb, aud_emb), + "sync_distance_after": self._diag_distance(vid_emb, synced_emb), + } + + def _span_embedding(self, audio: str, start: float, end: float) -> torch.Tensor: + """SyncNet audio embeddings (100 / s) of [start, end) of ``audio``: run_pipeline.py's 16 kHz pcm_s16le crop.""" + with tempfile.TemporaryDirectory(prefix="avsync-") as tmp: + wav16 = str(Path(tmp) / "audio.wav") + _ffmpeg(["-i", audio, "-ac", "1", "-vn", "-acodec", "pcm_s16le", "-ar", str(self.utils.SR), + "-af", "apad", "-ss", "%.3f" % start, "-to", "%.3f" % end, wav16], "crop the dub") + aud = self.utils.read_aud(wav16, verbose=False) + return self.utils.aud2emb(aud, self.model, True)[1] + + @staticmethod + def _diag_distance(vid_emb: torch.Tensor, aud_emb: torch.Tensor) -> float: + """Mean SyncNet distance of the lips and the audio at equal times (the dp's data cost, unwarped).""" + n = min(len(vid_emb), len(aud_emb)) + return float(((vid_emb[:n].double() - aud_emb[:n].double()) ** 2).mean()) + + def warp_frames(self, path: torch.Tensor) -> torch.Tensor: + """align_audio.py main() + smooth_flow(): dp path (video row, audio column) -> for every output STFT frame of + the track span (16 kHz, hop 256) the source frame of the dub, smoothed.""" + utils = self.utils + path = path.tolist() + # every audio frame should be associated with a single video frame + dp_path = [path[0][1]] + for i in range(1, len(path)): + if path[i][0] > path[i - 1][0]: + dp_path.append(path[i][1]) + dp_path = [0, 1] + [p + 2 for p in dp_path] # embeddings refer to the middle frame + dp_path = torch.tensor(dp_path, dtype=torch.float64) + new_size = utils.WINDOWS_PER_FRAME / 4 * dp_path.numel() + flow = utils.resize_vec(dp_path - torch.arange(dp_path.numel()), new_size) + + factor, max_diff, sigma, smoothed = utils.WINDOWS_PER_SECOND, 0, 1, flow + while max_diff < MAX_DIFF_SMOOTH and sigma < 10000: + sigma *= 1.5 + smoothed = utils.stabilizeSequence(flow, sigma) + max_diff = (smoothed / factor - flow / factor).abs().max().item() + smoothed = utils.gaussian_filter(smoothed, GAUSSIAN_SIGMA) + return smoothed + torch.arange(smoothed.numel()) + + +def _iou(box_a, box_b) -> float: + """run_pipeline.py bb_intersection_over_union.""" + x_a, y_a = max(box_a[0], box_b[0]), max(box_a[1], box_b[1]) + x_b, y_b = min(box_a[2], box_b[2]), min(box_a[3], box_b[3]) + inter = max(0, x_b - x_a) * max(0, y_b - y_a) + area_a = (box_a[2] - box_a[0]) * (box_a[3] - box_a[1]) + area_b = (box_b[2] - box_b[0]) * (box_b[3] - box_b[1]) + return inter / float(area_a + area_b - inter) + + +def _pad_span(start, stop, size, pad): + """run_pipeline.py pad_span: slice [start, stop) of an axis of length size zero padded by pad on both sides, in + padded coordinates -> (zeros before, frame start, frame stop, zeros after).""" + start, stop = (min(max(c, 0), size + 2 * pad) - pad for c in (start, stop)) + lo, hi = min(max(start, 0), size), min(max(stop, 0), size) + return max(0, min(stop, 0) - start), lo, max(lo, hi), max(0, stop - max(start, size)) diff --git a/zonos3/workers/edit_dub.py b/zonos3/workers/edit_dub.py new file mode 100644 index 0000000000000000000000000000000000000000..39257422277bf1925b33fff7c9bd65bf65ffa119 --- /dev/null +++ b/zonos3/workers/edit_dub.py @@ -0,0 +1,387 @@ +#!/usr/bin/env python3 +"""Speech editing and dubbing of the ggml server: ``zonos3.tts.edit_runtime.EditRuntime`` and +``zonos3.dub.runtime.DubRuntime`` in a persistent process whose model is the server, reached over the same pipe. + +Runs with the workspace interpreter and ``PYTHONPATH=``. stdin and stdout carry one JSON object per line +(UTF-8) in both directions, multiplexed: every request runs as its own asyncio task, so many are in flight and answer +in any order. Stray output of the libraries goes to stderr (fd 1 points there; the protocol writes on a dup of the +real stdout). The worker exits when stdin closes, after closing its ASR, FuseAlign and dubbing workers. + +Requests ``{"id", "op", ...}`` are answered ``{"id", "status": "ok", "result"}`` or ``{"id", "status": "error", +"code", "message"}``: the HTTP status and detail of ``zonos3.server.edit.call``; a body the schema +(``zonos3.server.schemas``) rejects is 422 with FastAPI's detail list as ``message``; any other failure is 500 with +``str(exc)`` (traceback on stderr). + +Ops: + init {edit: EditModel fields | null, dub: {name, rate_edges, n_buckets, laci_languages, studio_voices, source_voice, + raw_controls, phoneme_groups, rate_extension: {direction, row_edges, below, above, + doses: {tts_lang: {"": dose}}, reference_sides} | null} | null} -> {} + edit_transcribe {request: EditTranscribeRequest} -> the /v2/edit/transcribe body + edit_align {request: EditAlignRequest} -> the /v2/edit/align body + edit {request: EditRequest} -> the /v2/edit body + dub_capabilities -> DubRuntime.capabilities() + dub_ref {path} -> DubRuntime.add_ref + dub_lips {ref_id, video} -> DubRuntime.prepare_lips + dub_transcribe {ref_id, ref_lang} -> DubRuntime.transcribe + dub_analyze {request: DubAnalyzeRequest} -> DubRuntime.analyze + dub_generate {request: DubGenerateRequest, session} -> DubRuntime.generate + dub_regenerate {request: DubRegenerateRequest, session} -> DubRuntime.regenerate + dub_mux {dub_id, video, out} -> {} (the MP4 written to out) + +``init`` comes first after every start; it builds the runtimes over this process's own ``AsrWorker`` and +``FuseAlignWorker`` (ZONOS3_ASR_PYTHON, ZONOS3_ASR_DEVICE, ZONOS3_FUSEALIGN_DEVICE) and ``WorkerSettings.from_env()``. + +While a request runs, the model's work goes back to the server as engine calls ``{"call": N, "op", ...}`` (N unique per +process), answered ``{"call": N, "status": "ok", ...}`` or ``{"call": N, "status": "error", "code", "message"}`` +(code 400: ValueError, else RuntimeError, with the message): + + decode_audio {audio, out} -> {sample_rate}; float32 mono WAV at out + embed {audio, max_seconds} -> {embedding: [float]} + encode {audio, max_seconds} -> {codes: [[int] * K] * T} + check {target_text, doses, condition_buckets, condition_values} -> {raw: [id]} + fill {every FillJob field} -> {rows: [[int] * K] * n, eos_frame (-1: none)} + decode {codes, out} -> {}; float32 44.1 kHz WAV at out + synthesize {jobs: [{text, language, seed, max_tokens, bucket, target_frames, adjust_rate, voice, controls, ref_codes, + rate_scale: {edges, first, doses: {"": dose}} | null, out}], session} + -> {takes: [{audio: bool, record: LACI record}]}; WAV at out if audio + +Audio crosses as file paths (same host): ``audio`` is a file of the upload's bytes (``encode`` of a dub voice prompt: +a float WAV of the clip); the worker creates and removes the temp dirs of its engine calls. +""" +from __future__ import annotations + +import asyncio +import dataclasses +import json +import os +import sys +import tempfile +import threading +import traceback +from typing import TextIO + +import numpy as np +import soundfile as sf + + +class InvalidBody(Exception): + """A request body the schema rejects (HTTP 422); ``errors`` is FastAPI's detail list.""" + + def __init__(self, errors: list[dict]): + super().__init__("invalid request body") + self.errors = errors + + +def validate(schema, body): + """``body`` as a ``zonos3.server.schemas`` model (InvalidBody, never ValueError, when it does not fit).""" + from pydantic import ValidationError + + try: + return schema.model_validate(body) + except ValidationError as exc: + errors = json.loads(exc.json(include_url=False)) + raise InvalidBody([{**e, "loc": ["body", *e["loc"]]} for e in errors]) from None + + +class Pipe: + """The protocol side of stdout (writes serialized) and the engine calls awaiting their answers.""" + + def __init__(self, out: TextIO): + self._out = out + self._lock = threading.Lock() + self._calls: dict[int, asyncio.Future] = {} + self._next_call = 0 + self._closed = False + + def send(self, message: dict) -> None: + line = json.dumps(message, ensure_ascii=False) + "\n" + with self._lock: + self._out.write(line) + self._out.flush() + + async def call(self, op: str, **payload) -> dict: + """One engine call; ValueError (code 400) or RuntimeError with the server's message when it fails.""" + if self._closed: + raise RuntimeError("the server closed the edit/dub worker's pipe") + self._next_call += 1 + call = self._next_call + future = asyncio.get_running_loop().create_future() + self._calls[call] = future + try: + self.send({"call": call, "op": op, **payload}) + reply = await future + finally: + self._calls.pop(call, None) + if reply.get("status") != "ok": + message = reply.get("message") or f"engine call {op} failed" + raise (ValueError if reply.get("code") == 400 else RuntimeError)(message) + return reply + + def answer(self, reply: dict) -> None: + future = self._calls.get(reply.get("call")) + if future is None or future.done(): + print(f"edit/dub worker: answer to no pending engine call: {reply.get('call')!r}", file=sys.stderr) + return + future.set_result(reply) + + def close(self) -> None: + """Fail every pending engine call (stdin closed: no answer can come).""" + self._closed = True + for future in self._calls.values(): + if not future.done(): + future.set_exception(RuntimeError("the server closed the edit/dub worker's pipe")) + + +def read_wav(path: str) -> np.ndarray: + return sf.read(path, dtype="float32")[0] + + +def write_upload(directory: str, audio: bytes) -> str: + path = os.path.join(directory, "upload.bin") + with open(path, "wb") as fh: + fh.write(audio) + return path + + +class RpcEditEngine: + """``zonos3.tts.edit_runtime.EditEngine`` over the server's engine calls.""" + + def __init__(self, pipe: Pipe, model): + self.pipe = pipe + self.model = model + + async def decode_audio(self, audio: bytes) -> tuple[np.ndarray, int]: + with tempfile.TemporaryDirectory(prefix="zonos3-edit-dub-") as tmp: + out = os.path.join(tmp, "decoded.wav") + reply = await self.pipe.call("decode_audio", audio=write_upload(tmp, audio), out=out) + return read_wav(out), int(reply["sample_rate"]) + + async def embed(self, audio: bytes) -> list[float]: + from zonos3.generation import EDIT_MAX_SECONDS + + with tempfile.TemporaryDirectory(prefix="zonos3-edit-dub-") as tmp: + reply = await self.pipe.call("embed", audio=write_upload(tmp, audio), max_seconds=EDIT_MAX_SECONDS) + return [float(x) for x in reply["embedding"]] + + async def encode(self, audio: bytes, max_seconds: float) -> np.ndarray: + with tempfile.TemporaryDirectory(prefix="zonos3-edit-dub-") as tmp: + reply = await self.pipe.call("encode", audio=write_upload(tmp, audio), max_seconds=max_seconds) + return np.asarray(reply["codes"], dtype=np.int64).reshape(-1, self.model.n_codebooks) + + async def check(self, target_text: str, doses, condition_buckets, condition_values) -> set[str]: + reply = await self.pipe.call("check", target_text=target_text, doses=doses, + condition_buckets=condition_buckets, condition_values=condition_values) + return set(reply["raw"]) + + async def fill(self, job) -> tuple[np.ndarray, int]: + payload = {f.name: getattr(job, f.name) for f in dataclasses.fields(job)} + payload["window_codes"] = np.asarray(job.window_codes).tolist() + payload["fills"] = [np.asarray(fill).tolist() for fill in job.fills] + reply = await self.pipe.call("fill", **payload) + return np.asarray(reply["rows"], dtype=np.int64).reshape(-1, self.model.n_codebooks), int(reply["eos_frame"]) + + async def decode(self, codes: np.ndarray) -> np.ndarray: + with tempfile.TemporaryDirectory(prefix="zonos3-edit-dub-") as tmp: + out = os.path.join(tmp, "decoded.wav") + await self.pipe.call("decode", codes=np.asarray(codes).tolist(), out=out) + return read_wav(out) + + +def take_job(job: dict) -> dict: + """A DubRuntime take job as the ``synthesize`` call sends it (the rate scale as ``{edges, first, doses}``).""" + scale = job["rate_scale"] + if scale is not None: + scale = {"edges": [float(e) for e in scale.edges], "first": int(scale.first), + "doses": {str(b): float(d) for b, d in scale.doses.items()}} + return {**job, "rate_scale": scale} + + +def dub_model(dub: dict): + """The ``zonos3.dub.runtime.DubModel`` of the ``init`` payload's ``dub``.""" + from zonos3.dub.runtime import DubModel, rate_scales + from zonos3.tts.steering import RateExtension + + ext = dub.get("rate_extension") + if ext is not None: + ext = RateExtension(direction=ext["direction"], row_edges=tuple(float(e) for e in ext["row_edges"]), + below=tuple(float(e) for e in ext["below"]), above=tuple(float(e) for e in ext["above"]), + doses={lang: {int(b): float(d) for b, d in doses.items()} + for lang, doses in ext["doses"].items()}, + reference_sides=tuple(ext["reference_sides"])) + rate_edges = tuple(float(e) for e in dub["rate_edges"]) + return DubModel(name=dub["name"], rate_edges=rate_edges, n_buckets=int(dub["n_buckets"]), + laci_languages=frozenset(dub["laci_languages"]), studio_voices=bool(dub["studio_voices"]), + source_voice=bool(dub["source_voice"]), raw_controls=frozenset(dub["raw_controls"]), + phoneme_groups=bool(dub["phoneme_groups"]), rate_scales=rate_scales(ext, rate_edges)) + + +class Worker: + def __init__(self, pipe: Pipe): + self.pipe = pipe + self.asr = self.aligner = None + self.edit = self.dub = None + + # ---- runtimes --------------------------------------------------------------------------------------------- + + async def init(self, edit: dict | None, dub: dict | None) -> dict: + from zonos3.dub.plan import VOICE_PROMPT_MAX_S + from zonos3.dub.runtime import DubRuntime, WorkerSettings + from zonos3.tts.edit_align import AsrWorker, FuseAlignWorker + from zonos3.tts.edit_runtime import EditModel, EditRuntime + + if self.asr is None: + self.asr, self.aligner = AsrWorker(), FuseAlignWorker() + engine = None + if edit is not None: + engine = RpcEditEngine(self.pipe, EditModel(**{**edit, "codebook_sizes": tuple(edit["codebook_sizes"])})) + self.edit = None if engine is None else EditRuntime(engine, self.asr, self.aligner) + if self.dub is not None: + await asyncio.to_thread(self.dub.close) + self.dub = None + if dub is not None: + pipe = self.pipe + + async def synthesize(jobs: list[dict], session_id: str | None) -> list[tuple[np.ndarray | None, dict]]: + with tempfile.TemporaryDirectory(prefix="zonos3-edit-dub-") as tmp: + outs = [os.path.join(tmp, f"take{k}.wav") for k in range(len(jobs))] + reply = await pipe.call("synthesize", session=session_id, + jobs=[{**take_job(job), "out": out} for job, out in zip(jobs, outs)]) + return [(read_wav(out) if take["audio"] else None, take["record"]) + for take, out in zip(reply["takes"], outs, strict=True)] + + async def encode_voice(clip: np.ndarray, sample_rate: int) -> list[list[int]]: + with tempfile.TemporaryDirectory(prefix="zonos3-edit-dub-") as tmp: + path = os.path.join(tmp, "voice.wav") + sf.write(path, clip, sample_rate, subtype="FLOAT") + return (await pipe.call("encode", audio=path, max_seconds=VOICE_PROMPT_MAX_S))["codes"] + + self.dub = DubRuntime(dub_model(dub), synthesize, encode_voice, self.asr, self.aligner, + WorkerSettings.from_env()) + return {} + + def edit_runtime(self): + if self.edit is None: + raise RuntimeError("speech editing is not initialized") + return self.edit + + def dub_runtime(self): + if self.dub is None: + raise RuntimeError("dubbing is not initialized") + return self.dub + + def close(self) -> None: + for worker in (self.dub, self.asr, self.aligner): + if worker is not None: + worker.close() + + # ---- requests --------------------------------------------------------------------------------------------- + + async def run(self, request: dict): + from zonos3.server import schemas as S + + op = request.get("op") + if op == "init": + return await self.init(request.get("edit"), request.get("dub")) + if op == "edit_transcribe": + return await self.edit_runtime().transcribe(validate(S.EditTranscribeRequest, request.get("request"))) + if op == "edit_align": + return await self.edit_runtime().align(validate(S.EditAlignRequest, request.get("request"))) + if op == "edit": + return await self.edit_runtime().edit(validate(S.EditRequest, request.get("request"))) + if op == "dub_capabilities": + return await asyncio.to_thread(self.dub_runtime().capabilities) + if op == "dub_ref": + return await asyncio.to_thread(self.dub_runtime().add_ref, request["path"]) + if op == "dub_lips": + rt = self.dub_runtime() + rt.refs.get(request["ref_id"]) + return await asyncio.to_thread(rt.prepare_lips, request["ref_id"], request["video"]) + if op == "dub_transcribe": + body = validate(S.DubTranscribeRequest, {"ref_id": request.get("ref_id"), + "ref_lang": request.get("ref_lang")}) + return await self.dub_runtime().transcribe(body.ref_id, body.ref_lang) + if op == "dub_analyze": + return await self.dub_runtime().analyze(validate(S.DubAnalyzeRequest, request.get("request")).model_dump()) + if op == "dub_generate": + body = validate(S.DubGenerateRequest, request.get("request")) + return await self.dub_runtime().generate(body.model_dump(), request.get("session")) + if op == "dub_regenerate": + body = validate(S.DubRegenerateRequest, request.get("request")) + return await self.dub_runtime().regenerate(body.model_dump(), request.get("session")) + if op == "dub_mux": + await asyncio.to_thread(self.dub_runtime().mux, request["dub_id"], request["video"], request["out"]) + return {} + raise ValueError(f"unknown op {op!r}") + + async def respond(self, request: dict) -> None: + """Run one request and send its answer (errors as ``zonos3.server.edit.call`` maps them).""" + from fastapi import HTTPException + + from zonos3.server.edit import call + + rid = request.get("id") + try: + result = await call(self.run(request)) + reply = {"id": rid, "status": "ok", "result": result} + except HTTPException as exc: + reply = {"id": rid, "status": "error", "code": exc.status_code, "message": exc.detail} + except InvalidBody as exc: + reply = {"id": rid, "status": "error", "code": 422, "message": exc.errors} + except Exception as exc: # noqa: BLE001 - one failed request must not kill the worker + traceback.print_exc() + reply = {"id": rid, "status": "error", "code": 500, "message": str(exc)} + try: + self.pipe.send(reply) + except (TypeError, ValueError) as exc: # an unserializable result fails this request, not the pipe + traceback.print_exc() + self.pipe.send({"id": rid, "status": "error", "code": 500, "message": str(exc)}) + + +async def serve(lines: TextIO, out: TextIO) -> None: + """Answer the requests of ``lines`` on ``out`` until ``lines`` ends; engine answers come on ``lines`` too.""" + loop = asyncio.get_running_loop() + inbox: asyncio.Queue[str | None] = asyncio.Queue() + + def read() -> None: # blocking reads off the event loop + for line in lines: + loop.call_soon_threadsafe(inbox.put_nowait, line) + loop.call_soon_threadsafe(inbox.put_nowait, None) + + threading.Thread(target=read, name="edit-dub-stdin", daemon=True).start() + pipe = Pipe(out) + worker = Worker(pipe) + tasks: set[asyncio.Task] = set() + while (line := await inbox.get()) is not None: + if not line.strip(): + continue + try: + message = json.loads(line) + if not isinstance(message, dict): + raise ValueError("a message must be a JSON object") + except ValueError as exc: + pipe.send({"id": None, "status": "error", "code": 400, "message": f"invalid message: {exc}"}) + continue + if "call" in message: + pipe.answer(message) + continue + task = asyncio.create_task(worker.respond(message)) + tasks.add(task) + task.add_done_callback(tasks.discard) + pipe.close() + for task in tasks: + task.cancel() + await asyncio.gather(*tasks, return_exceptions=True) + await asyncio.to_thread(worker.close) + + +def main() -> None: + # Keep stdout for the protocol only: library prints go to stderr. + protocol = os.fdopen(os.dup(1), "w", buffering=1, encoding="utf-8") + os.dup2(2, 1) + sys.stdout = sys.stderr + sys.stdin.reconfigure(encoding="utf-8") + asyncio.run(serve(sys.stdin, protocol)) + + +if __name__ == "__main__": + main() diff --git a/zonos3/workers/fusealign.py b/zonos3/workers/fusealign.py new file mode 100644 index 0000000000000000000000000000000000000000..71d5be82c142df7d41e2b57a830cb43ff13060cb --- /dev/null +++ b/zonos3/workers/fusealign.py @@ -0,0 +1,197 @@ +#!/usr/bin/env python3 +"""FuseAlign forced alignment (third_party/fusealign-multilingual, package ``fusealign_hub``) in a persistent process. + +Runs with the workspace interpreter and ``PYTHONPATH=``. Reads one JSON request per stdin line and answers +each with one JSON line on stdout, in order, until stdin closes: ``{"id", "status": "ok", ...}`` or ``{"id", "status": +"error", "error", "message", "invalid"}`` ("invalid": a ValueError, i.e. the input is at fault). The model loads on +the first ``align``, so ``ping``, ``speech`` and ``segments`` (which need only Silero VAD) answer without it. + +Ops: + ping -> {"model": checkpoint id (Zyphra/fusealign/, or the local path)} + speech {items: [{audio}]} -> {"results": [{"regions": [[start, end], ...]}]} + segments {items: [{audio}]} -> {"results": [{"chunks": [[start, end], ...]}]} + align {items: [{audio, tokens, utterances?}]} -> {"results": [{"words": [{word, start, end, presence, placed}]}]} + +``audio`` is the path of any sound file soundfile reads (channels are averaged). + +``speech`` is where speech is in a recording: the Silero VAD speech regions (``fusealign_hub.vad.speech_regions`` of +the 16 kHz mono audio, in seconds, in time order). No speech gives no regions. + +``segments`` cuts a recording into the pieces speech recognition transcribes for long-form anchors: its ``speech`` +regions packed greedily, in order, into +chunks spanning (first region start .. last region end) at most ``CHUNK_SECONDS``; a region longer than that is split +into the fewest equal parts of at most ``CHUNK_SECONDS``, each a chunk of its own. No speech gives no chunks. + +``align`` places ``tokens`` (the words, zonos3.tts.align_text.align_tokens; the worker never segments): one word per +token, in order, with times in seconds; an unplaced word keeps FuseAlign's fallback times. ``utterances`` +(``[{text, start, end}]``, speech recognition of the recording's ``segments`` chunks) are the approximate word times a +recording over 30 s or a transcript over ``fusealign_hub`` MAX_TEXT_BYTES is routed by (``guide_words``); without +them such an item falls back to FuseAlign's VAD character-time map. FuseAlign's built-in Whisper anchoring never runs. +""" +import argparse +import json +import math +import os +import sys +from typing import Callable, Iterable, TextIO + +CHUNK_SECONDS = 25.0 +SAMPLE_RATE = 16000 + + +def read_mono(path: str): + import soundfile as sf + + data, sr = sf.read(path, dtype="float32", always_2d=True) + return data.mean(axis=1), int(sr) + + +def pack_regions(regions: list[tuple[float, float]], limit: float = CHUNK_SECONDS) -> list[list[float]]: + """Speech regions ``(start, end)`` in time order -> chunks ``[start, end]`` (see ``segments`` above).""" + chunks: list[list[float]] = [] + current: list[float] | None = None + for start, end in regions: + start, end = float(start), float(end) + if end - start > limit: + if current is not None: + chunks.append(current) + current = None + n = math.ceil((end - start) / limit) + step = (end - start) / n + chunks.extend([start + i * step, end if i == n - 1 else start + (i + 1) * step] for i in range(n)) + elif current is not None and end - current[0] <= limit: + current[1] = end + else: + if current is not None: + chunks.append(current) + current = [start, end] + if current is not None: + chunks.append(current) + return chunks + + +def _items(op: str, items, fields: set[str]) -> list[dict]: + if not isinstance(items, list): + raise ValueError(f"{op}: items must be a list") + for k, item in enumerate(items): + if not isinstance(item, dict) or not isinstance(item.get("audio"), str): + raise ValueError(f"{op}: items[{k}] needs an audio path") + unknown = set(item) - fields + if unknown: + raise ValueError(f"{op}: items[{k}] has unknown fields {sorted(unknown)}") + return items + + +def speech(items, speech_regions: Callable, op: str = "speech") -> list[dict]: + """Per item ``{"regions": [[start, end], ...]}``; ``speech_regions(wav16k)`` is ``fusealign_hub.vad.speech_regions`` + (``[{start, end}]`` seconds).""" + import torch + import torchaudio + + results = [] + for item in _items(op, items, {"audio"}): + data, sr = read_mono(item["audio"]) + wav = torch.from_numpy(data) + if sr != SAMPLE_RATE: + wav = torchaudio.functional.resample(wav, sr, SAMPLE_RATE) + results.append({"regions": [[float(r["start"]), float(r["end"])] for r in speech_regions(wav)]}) + return results + + +def segments(items, speech_regions: Callable) -> list[dict]: + """Per item ``{"chunks": [[start, end], ...]}``: its ``speech`` regions packed (``pack_regions``).""" + return [{"chunks": pack_regions(r["regions"])} for r in speech(items, speech_regions, op="segments")] + + +def align(aligner, items, guide_words: Callable) -> list[dict]: + """Per item ``{"words": [...]}``; items sharing a sample rate share batched forwards. ``guide_words`` is + ``fusealign_hub.longform.guide_words``.""" + clips = [] + for k, item in enumerate(_items("align", items, {"audio", "tokens", "utterances"})): + tokens, utterances = item.get("tokens"), item.get("utterances") + if not isinstance(tokens, list) or not all(isinstance(t, str) for t in tokens): + raise ValueError(f"align: items[{k}].tokens must be a list of strings") + if utterances is not None and not (isinstance(utterances, list) and all( + isinstance(u, dict) and isinstance(u.get("text"), str) + and all(isinstance(u.get(key), (int, float)) and not isinstance(u.get(key), bool) + for key in ("start", "end")) for u in utterances)): + raise ValueError(f"align: items[{k}].utterances must be a list of {{text, start, end}}") + # Never None: FuseAlign runs Whisper for a long-form item without approximate word times. + anchors = guide_words(utterances) if utterances is not None else [] + clips.append((*read_mono(item["audio"]), tokens, anchors)) + groups: dict[int, list[int]] = {} + for k, (_, sr, _, _) in enumerate(clips): + groups.setdefault(sr, []).append(k) + results: list[dict] = [{"words": []} for _ in clips] + for sr, ks in groups.items(): + out = aligner.align_batch([clips[k][0] for k in ks], sr, [clips[k][2] for k in ks], + asr_words=[clips[k][3] for k in ks], language=None) + for k, words in zip(ks, out): + results[k] = {"words": [{"word": w.word, "start": float(w.start), "end": float(w.end), + "presence": float(w.presence), "placed": bool(w.placed)} for w in words]} + return results + + +def no_whisper(*_args, **_kwargs): + raise RuntimeError("FuseAlign's Whisper anchoring is disabled: long-form anchors come from Qwen3-ASR utterances") + + +def serve(lines: Iterable[str], out: TextIO, model_id: str, load: Callable[[], object], + speech_regions: Callable, guide_words: Callable) -> None: + """Answer the requests of ``lines`` on ``out``; ``load()`` builds the aligner on the first ``align``.""" + aligner = None + for line in lines: + if not line.strip(): + continue + rid = None + try: + request = json.loads(line) + rid = request.get("id") + op = request.get("op") + if op == "ping": + response = {"model": model_id} + elif op == "speech": + response = {"results": speech(request.get("items"), speech_regions)} + elif op == "segments": + response = {"results": segments(request.get("items"), speech_regions)} + elif op == "align": + if aligner is None: + aligner = load() + aligner.whisper_words = no_whisper # a guard: anchors are always supplied + response = {"results": align(aligner, request.get("items"), guide_words)} + else: + raise ValueError(f"unknown op {op!r}") + response.update(id=rid, status="ok") + except Exception as exc: # noqa: BLE001 - one bad request must not kill the worker + response = {"id": rid, "status": "error", "error": repr(exc), "message": str(exc), + "invalid": isinstance(exc, ValueError)} + out.write(json.dumps(response, ensure_ascii=False) + "\n") + out.flush() + + +def main() -> None: + parser = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter) + parser.add_argument("--device", default=os.environ.get("ZONOS3_FUSEALIGN_DEVICE"), + help="torch device (default: $ZONOS3_FUSEALIGN_DEVICE, else cuda:0 when available, else cpu)") + parser.add_argument("--checkpoint", default=None, + help="a local fusealign-hub/1 safetensors file (default: the Zyphra/fusealign checkpoint)") + args = parser.parse_args() + # Keep stdout for responses only: library prints go to stderr. + protocol = os.fdopen(os.dup(1), "w", buffering=1, encoding="utf-8") + os.dup2(2, 1) + sys.stdout = sys.stderr + + import torch + from fusealign_hub import load_aligner + from fusealign_hub.aligner import CHECKPOINT_FILE, HF_REPO + from fusealign_hub.longform import guide_words + from fusealign_hub.vad import speech_regions + + device = args.device or ("cuda:0" if torch.cuda.is_available() else "cpu") + model_id = args.checkpoint or f"{HF_REPO}/{CHECKPOINT_FILE}" + serve(sys.stdin, protocol, model_id, lambda: load_aligner(args.checkpoint, device=device), + speech_regions, guide_words) + + +if __name__ == "__main__": + main() diff --git a/zonos3/workers/textnorm.py b/zonos3/workers/textnorm.py new file mode 100644 index 0000000000000000000000000000000000000000..85185de7a80aa845c1ccda3f380f222a422d925e --- /dev/null +++ b/zonos3/workers/textnorm.py @@ -0,0 +1,33 @@ +#!/usr/bin/env python3 +"""TTS text normalization for the ggml server (zonos3.tokenizer.textnorm in a persistent process). + +Reads one JSON request per stdin line, ``{"id": int, "text": str, "language": str}`` (a server language code), and +answers each with one JSON line on stdout, in order, until stdin closes: ``{"id": int, "text": str}`` or +``{"id": int, "error": str}``. The NeMo grammars load once per language and stay loaded. +""" +import json +import os +import sys + + +def main() -> None: + # Keep stdout for responses only: grammar compilation and library prints go to stderr. + protocol = os.fdopen(os.dup(1), "w", buffering=1, encoding="utf-8") + os.dup2(2, 1) + sys.stdout = sys.stderr + from zonos3.tokenizer.textnorm import TTSTextNormalizer + + normalizer = TTSTextNormalizer() + for line in sys.stdin: + if not line.strip(): + continue + request = json.loads(line) + try: + response = {"id": request["id"], "text": normalizer.normalize(request["text"], request["language"])} + except Exception as exc: # noqa: BLE001 - reported to the server, which answers 400 + response = {"id": request.get("id"), "error": f"{type(exc).__name__}: {exc}"} + protocol.write(json.dumps(response, ensure_ascii=False) + "\n") + + +if __name__ == "__main__": + main()