Etc

Metrics

class kospeech.metrics.CharacterErrorRate(vocab)[source]

Computes the Character Error Rate, defined as the edit distance between the two provided sentences after tokenizing to characters.

metric(s1: str, s2: str)[source]

Computes the Character Error Rate, defined as the edit distance between the two provided sentences after tokenizing to characters.

Parameters
  • s1 (string) – space-separated sentence

  • s2 (string) – space-separated sentence

class kospeech.metrics.ErrorRate(vocab)[source]

Provides inteface of error rate calcuation.

Note

Do not use this class directly, use one of the sub classes.

class kospeech.metrics.WordErrorRate(vocab)[source]

Computes the Word Error Rate, defined as the edit distance between the two provided sentences after tokenizing to words.

metric(s1, s2)[source]

Computes the Word Error Rate, defined as the edit distance between the two provided sentences after tokenizing to words.

Parameters
  • s1 (string) – space-separated sentence

  • s2 (string) – space-separated sentence

ModelBuilder

kospeech.model_builder.build_model(config: omegaconf.dictconfig.DictConfig, vocab: kospeech.vocabs.Vocabulary, device: torch.device) → torch.nn.parallel.data_parallel.DataParallel[source]

Various model dispatcher function.

Utils

kospeech.utils.check_envirionment(use_cuda: bool) → torch.device[source]

Check execution envirionment. OS, Processor, CUDA version, Pytorch version, … etc.