sign_language_translator.languages.vocab module

load word datasets to create word maps etc.

class sign_language_translator.languages.vocab.MappingDataset[source]

Bases: TypedDict

country: str
description: str
mapping: List[Mapping]
organization: str
url: str
class sign_language_translator.languages.vocab.Vocab(language: str = '.^', country: str = '.^', organization: str = '.^', part_number: str = '.^', data_root_dir: str = '/home/docs/checkouts/readthedocs.org/user_builds/sign-language-translator/checkouts/latest/sign_language_translator/assets', arg_is_regex: bool = True, word_sense_regex: str = '\\([^\\(\\)]*\\)')[source]

Bases: object

Loads text datasets for a specific language, country and organization.

Note

Our mapping datasets will only be downloaded automatically if the data_root_dir arg is the same as Assets.ROOT_DIR.

remove_word_sense(text: str) str[source]

Remove the word sense or disambiguation information from given text.

Parameters:

text (str) – The text from which the word sense needs to be removed.

Returns:

The word without the word sense or disambiguation information.

Return type:

str

Example:

word = "this is a spring(metal-coil). those are glasses(water-containers)."
without_word_sense = remove_word_sense(word)
print(without_word_sense)  # Output: "this is a spring. those are glasses."