mltk.utils.audio_dataset_generator.Keyword

class Keyword[source]

Keyword to generate

Properties

aliases

Additional aliases for the base keyword

max_count

The maximum number of samples to generate for this keyword This is only used if the truncate argument of list_configurations() is true`

value

The base keyword

Methods

__init__

as_list

Return the base keyword and all its aliases as a list of strings

count

Return number of occurrences of value.

index

Return first index of value.

value: str

The base keyword

Note

If the base keyword starts with an underscore, then it is NOT included in the list of keywords to generate (see as_list()). In this case, the aliases must be provided.

aliases: List[str]

Additional aliases for the base keyword

max_count: int

The maximum number of samples to generate for this keyword This is only used if the truncate argument of list_configurations() is true`

as_list()[source]

Return the base keyword and all its aliases as a list of strings

Note

If the base keyword (e.g. value) starts with an underscore, then it is omitted from the list

Return type:

List[str]

count(value, /)

Return number of occurrences of value.

index(value, start=0, stop=sys.maxsize, /)

Return first index of value.

Raises ValueError if the value is not present.