Toloka documentation


crowdkit.aggregation.texts.rover.ROVER | Source code

    tokenizer: Callable[[str], List[str]],
    detokenizer: Callable[[List[str]], str],
    silent: bool = True

Recognizer Output Voting Error Reduction (ROVER).

This method uses dynamic programming to align sequences. Next, aligned sequences are used to construct the Word Transition Network (WTN): ROVER WTN scheme Finally, the aggregated sequence is the result of majority voting on each edge of the WTN.

J. G. Fiscus, "A post-processing system to yield reduced word error rates: Recognizer Output Voting Error Reduction (ROVER)," 1997 IEEE Workshop on Automatic Speech Recognition and Understanding Proceedings, 1997, pp. 347-354.

Parameters Description

Parameters Type Description
tokenizer Callable[[str], List[str]]

A callable that takes a string and returns a list of tokens.

detokenizer Callable[[List[str]], str]

A callable that takes a list of tokens and returns a string.

silent bool

If false, show a progress bar.

texts_ Series

Tasks' texts. A pandas.Series indexed by task such that result.loc[task, text] is the task's text.


from crowdkit.aggregation import load_dataset
from crowdkit.aggregation import ROVER
df, gt = load_dataset('crowdspeech-test-clean')
df['text'] = df['text'].apply(lambda s: s.lower())
tokenizer = lambda s: s.split(' ')
detokenizer = lambda tokens: ' '.join(tokens)
result = ROVER(tokenizer, detokenizer).fit_predict(df)

Methods Summary

Method Description
fit Fits the model. The aggregated results are saved to the texts_ attribute.
fit_predict Fit the model and return the aggregated texts.