def _extract_tokens(lemmas, scores, ratio, words):
    """Extracts tokens from provided lemmas. Most scored lemmas are used if `words` not provided.

    Parameters
    ----------
    lemmas : list of str
        Given lemmas.
    scores : dict
        Dictionary with lemmas and its scores.
    ratio : float
        Proportion of lemmas used for final result.
    words : int
        Number of used words. If no "words" option is selected, the number of
        sentences is reduced by the provided ratio, else, the ratio is ignored.

    Returns
    -------
    list of (float, str)
        Scores and corresponded lemmas.

    """
    lemmas.sort(key=lambda s: scores[s], reverse=True)
    length = len(lemmas) * ratio if words is None else words
    return [(scores[lemmas[i]], lemmas[i],) for i in range(int(length))]