Skip to navigation

nemo_curator.stages.audio.text_filtering.abbreviation_concat

View as Markdown

Module Contents

Classes

NameDescription
AbbreviationConcatStageConcatenate spaced single-letter abbreviations in a transcript.

Functions

NameDescription
_is_mixed_case_pair-
_join_match-
_pattern-
_set_note-
_strip_particles-
concat_abbreviationsJoin ASR-spelled letter sequences and return the changed abbreviations.

Data

_APOSTROPHES

_CONTRACTION_SUFFIXES

_LANG_CHAR_CLASS

_LANG_PARTICLES

_MIN_PARTS

_MULTI_CHAR_LEN

_PLURAL_SUFFIX_LEN

_TAIL_SLICE

_VOWELS

API

class nemo_curator.stages.audio.text_filtering.AbbreviationConcatStage(
text_key: str = 'text',
output_text_key: str = 'text',
skip_me_key: str = '_skipme',
notes_key: str = 'additional_notes',
source_lang_key: str = 'source_lang',
default_language: str = 'en',
name: str = 'AbbreviationConcat',
resources: nemo_curator.stages.resources.Resources = (lambda: Resources(cpus=1.0...
)
Dataclass

Bases: ProcessingStage[AudioTask, AudioTask]

Concatenate spaced single-letter abbreviations in a transcript.

default_language
str = 'en'
name
str = 'AbbreviationConcat'
notes_key
str = 'additional_notes'
output_text_key
str = 'text'
resources
Resources
skip_me_key
str = '_skipme'
source_lang_key
str = 'source_lang'
text_key
str = 'text'
nemo_curator.stages.audio.text_filtering.AbbreviationConcatStage.inputs() -> tuple[list[str], list[str]]
nemo_curator.stages.audio.text_filtering.AbbreviationConcatStage.outputs() -> tuple[list[str], list[str]]
nemo_curator.stages.audio.text_filtering.AbbreviationConcatStage.process(
nemo_curator.stages.audio.text_filtering.abbreviation_concat._is_mixed_case_pair(
letters: str
) -> bool
nemo_curator.stages.audio.text_filtering.abbreviation_concat._join_match(
match: re.Match[str],
particles: frozenset[str]
) -> str
nemo_curator.stages.audio.text_filtering.abbreviation_concat._pattern(
language: str
) -> re.Pattern[str]
nemo_curator.stages.audio.text_filtering.abbreviation_concat._set_note(
data: dict[str, typing.Any],
stage: str,
value: str,
notes_key: str
) -> None
nemo_curator.stages.audio.text_filtering.abbreviation_concat._strip_particles(
raw: str,
particles: frozenset[str]
) -> str
nemo_curator.stages.audio.text_filtering.abbreviation_concat.concat_abbreviations(
text: str,
language: str = 'en'
) -> tuple[str, list[str]]

Join ASR-spelled letter sequences and return the changed abbreviations.

nemo_curator.stages.audio.text_filtering.abbreviation_concat._APOSTROPHES = "'’‘ʼ"
nemo_curator.stages.audio.text_filtering.abbreviation_concat._CONTRACTION_SUFFIXES = ('m', 'll', 've', 'd', 're', 'ma')
nemo_curator.stages.audio.text_filtering.abbreviation_concat._LANG_CHAR_CLASS: dict[str, str] = {'en': '[A-Za-z]', 'nl': '[A-Za-z]', 'de': '[A-Za-zÄÖÜäöüß]', 'fr': '[A-Za-zÀ-ÖØ...
nemo_curator.stages.audio.text_filtering.abbreviation_concat._LANG_PARTICLES: dict[str, frozenset[str]] = {'en': frozenset({'a'}), 'it': frozenset({'a', 'e'}), 'pt': frozenset({'a', 'e'}...
nemo_curator.stages.audio.text_filtering.abbreviation_concat._MIN_PARTS = 2
nemo_curator.stages.audio.text_filtering.abbreviation_concat._MULTI_CHAR_LEN = 3
nemo_curator.stages.audio.text_filtering.abbreviation_concat._PLURAL_SUFFIX_LEN = 2
nemo_curator.stages.audio.text_filtering.abbreviation_concat._TAIL_SLICE = 2
nemo_curator.stages.audio.text_filtering.abbreviation_concat._VOWELS = frozenset('AEIOUaeiou')