How to use the revscoring.datasources.meta.dicts.values function in revscoring

To help you get started, we’ve selected a few revscoring examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github wikimedia / revscoring / revscoring / features / wikitext / features / tokenized.py View on Github external
"`int` : The sum of delta changes in the markup frequency table"

        self.markup_delta_increase = aggregators.sum(
            filters.positive(dicts.values(self.datasources.markup_delta)),
            name=self._name + ".markup_delta_increase"
        )
        "`int` : The sum of delta increases in the markup frequency table"

        self.markup_delta_decrease = aggregators.sum(
            filters.negative(dicts.values(self.datasources.markup_delta)),
            name=self._name + ".markup_delta_decrease"
        )
        "`int` : The sum of delta decreases in the markup frequency table"

        self.markup_prop_delta_sum = aggregators.sum(
            dicts.values(self.datasources.markup_prop_delta),
            name=self._name + ".markup_prop_delta_sum"
        )
        """
        `int` : The sum of proportional delta changes in the markup
        frequency table
        """

        self.markup_prop_delta_increase = aggregators.sum(
            filters.positive(dicts.values(self.datasources.markup_prop_delta)),
            name=self._name + ".markup_prop_delta_increase"
        )
        """
        `int` : The sum of proportional delta increases in the markup
        frequency table
        """
github wikimedia / revscoring / revscoring / features / wikitext / features / tokenized.py View on Github external
`int` : The sum of proportional delta increases in the entity
        frequency table
        """

        self.entity_prop_delta_decrease = aggregators.sum(
            filters.negative(dicts.values(self.datasources.entity_prop_delta)),
            name=self._name + ".entity_prop_delta_decrease"
        )
        """
        `int` : The sum of proportional delta decreases in the entity
        frequency table
        """

        # url
        self.url_delta_sum = aggregators.sum(
            dicts.values(self.datasources.url_delta),
            name=self._name + ".url_delta_sum"
        )
        "`int` : The sum of delta changes in the url frequency table"

        self.url_delta_increase = aggregators.sum(
            filters.positive(dicts.values(self.datasources.url_delta)),
            name=self._name + ".url_delta_increase"
        )
        "`int` : The sum of delta increases in the url frequency table"

        self.url_delta_decrease = aggregators.sum(
            filters.negative(dicts.values(self.datasources.url_delta)),
            name=self._name + ".url_delta_decrease"
        )
        "`int` : The sum of delta decreases in the url frequency table"
github wikimedia / revscoring / revscoring / features / wikitext / features / tokenized.py View on Github external
name=self._name + ".whitespace_prop_delta_decrease"
        )
        """
        `int` : The sum of proportional delta decreases in the whitespace
        frequency table
        """

        # markup
        self.markup_delta_sum = aggregators.sum(
            dicts.values(self.datasources.markup_delta),
            name=self._name + ".markup_delta_sum"
        )
        "`int` : The sum of delta changes in the markup frequency table"

        self.markup_delta_increase = aggregators.sum(
            filters.positive(dicts.values(self.datasources.markup_delta)),
            name=self._name + ".markup_delta_increase"
        )
        "`int` : The sum of delta increases in the markup frequency table"

        self.markup_delta_decrease = aggregators.sum(
            filters.negative(dicts.values(self.datasources.markup_delta)),
            name=self._name + ".markup_delta_decrease"
        )
        "`int` : The sum of delta decreases in the markup frequency table"

        self.markup_prop_delta_sum = aggregators.sum(
            dicts.values(self.datasources.markup_prop_delta),
            name=self._name + ".markup_prop_delta_sum"
        )
        """
        `int` : The sum of proportional delta changes in the markup
github wikimedia / revscoring / revscoring / features / wikitext / features / tokenized.py View on Github external
"""
        `int` : The sum of proportional delta changes in the entity
        frequency table
        """

        self.entity_prop_delta_increase = aggregators.sum(
            filters.positive(dicts.values(self.datasources.entity_prop_delta)),
            name=self._name + ".entity_prop_delta_increase"
        )
        """
        `int` : The sum of proportional delta increases in the entity
        frequency table
        """

        self.entity_prop_delta_decrease = aggregators.sum(
            filters.negative(dicts.values(self.datasources.entity_prop_delta)),
            name=self._name + ".entity_prop_delta_decrease"
        )
        """
        `int` : The sum of proportional delta decreases in the entity
        frequency table
        """

        # url
        self.url_delta_sum = aggregators.sum(
            dicts.values(self.datasources.url_delta),
            name=self._name + ".url_delta_sum"
        )
        "`int` : The sum of delta changes in the url frequency table"

        self.url_delta_increase = aggregators.sum(
            filters.positive(dicts.values(self.datasources.url_delta)),
github wikimedia / revscoring / revscoring / features / wikitext / features / tokenized.py View on Github external
"`int` : The sum of delta changes in the whitespace frequency table"

        self.whitespace_delta_increase = aggregators.sum(
            filters.positive(dicts.values(self.datasources.whitespace_delta)),
            name=self._name + ".whitespace_delta_increase"
        )
        "`int` : The sum of delta increases in the whitespace frequency table"

        self.whitespace_delta_decrease = aggregators.sum(
            filters.negative(dicts.values(self.datasources.whitespace_delta)),
            name=self._name + ".whitespace_delta_decrease"
        )
        "`int` : The sum of delta decreases in the whitespace frequency table"

        self.whitespace_prop_delta_sum = aggregators.sum(
            dicts.values(self.datasources.whitespace_prop_delta),
            name=self._name + ".whitespace_prop_delta_sum"
        )
        """
        `int` : The sum of proportional delta changes in the whitespace
        frequency table
        """

        self.whitespace_prop_delta_increase = aggregators.sum(
            filters.positive(dicts.values(
                self.datasources.whitespace_prop_delta)),
            name=self._name + ".whitespace_prop_delta_increase"
        )
        """
        `int` : The sum of proportional delta increases in the whitespace
        frequency table
        """
github wikimedia / revscoring / revscoring / languages / features / stemmed / features.py View on Github external
def __init__(self, name, diff_datasources):
        super().__init__(name)
        self.datasources = diff_datasources

        self.stem_delta_sum = aggregators.sum(
            dicts.values(self.datasources.stem_delta),
            name=name + ".stem_delta_sum"
        )
        "`int` : The sum of frequency deltas for stemmed words"
        self.stem_delta_increase = aggregators.sum(
            filters.positive(dicts.values(self.datasources.stem_delta)),
            name=name + ".stem_delta_increase"
        )
        "`int` : The sum of frequency delta increases for stemmed words"
        self.stem_delta_decrease = aggregators.sum(
            filters.negative(dicts.values(self.datasources.stem_delta)),
            name=name + ".stem_delta_decrease"
        )
        "`int` : The sum of frequency delta decreases for stemmed words"

        self.stem_prop_delta_sum = aggregators.sum(
            dicts.values(self.datasources.stem_prop_delta),
github wikimedia / revscoring / revscoring / features / wikitext / features / tokenized.py View on Github external
# url
        self.url_delta_sum = aggregators.sum(
            dicts.values(self.datasources.url_delta),
            name=self._name + ".url_delta_sum"
        )
        "`int` : The sum of delta changes in the url frequency table"

        self.url_delta_increase = aggregators.sum(
            filters.positive(dicts.values(self.datasources.url_delta)),
            name=self._name + ".url_delta_increase"
        )
        "`int` : The sum of delta increases in the url frequency table"

        self.url_delta_decrease = aggregators.sum(
            filters.negative(dicts.values(self.datasources.url_delta)),
            name=self._name + ".url_delta_decrease"
        )
        "`int` : The sum of delta decreases in the url frequency table"

        self.url_prop_delta_sum = aggregators.sum(
            dicts.values(self.datasources.url_prop_delta),
            name=self._name + ".url_prop_delta_sum"
        )
        """
        `int` : The sum of proportional delta changes in the url
        frequency table
        """

        self.url_prop_delta_increase = aggregators.sum(
            filters.positive(dicts.values(self.datasources.url_prop_delta)),
            name=self._name + ".url_prop_delta_increase"
github wikimedia / revscoring / revscoring / languages / features / dictionary / features.py View on Github external
# Simple counts (based on wikitext.edit.diff)
        self.dict_words_added = \
            aggregators.len(self.datasources.dict_words_added)
        "`int` : A count of the number of dictionary words added"
        self.dict_words_removed = \
            aggregators.len(self.datasources.dict_words_removed)
        "`int` : A count of the number of dictionary words removed"
        self.non_dict_words_added = \
            aggregators.len(self.datasources.non_dict_words_added)
        "`int` : A count of the number of non-dictionary words added"
        self.non_dict_words_removed = \
            aggregators.len(self.datasources.non_dict_words_removed)
        "`int` : A count of the number of non-dictionary words removed"

        # Word frequency deltas
        dict_word_delta_values = dicts.values(self.datasources.dict_word_delta)
        self.dict_word_delta_sum = aggregators.sum(
            dict_word_delta_values,
            name=name + ".dict_word_delta_sum",
            returns=int
        )
        "`int` : The sum of word frequency deltas for dictionary words"
        self.dict_word_delta_increase = aggregators.sum(
            filters.positive(dict_word_delta_values),
            name=name + ".dict_word_delta_increase",
            returns=int
        )
        """
        `int` : The sum of word frequency delta increases for dictionary words
        """
        self.dict_word_delta_decrease = aggregators.sum(
            filters.negative(dict_word_delta_values),
github wikimedia / revscoring / revscoring / features / wikitext / features / tokenized.py View on Github external
name=self._name + ".cjk_prop_delta_decrease"
        )
        """
        `int` : The sum of proportional delta decreases in the cjk
        frequency table
        """

        # entity
        self.entity_delta_sum = aggregators.sum(
            dicts.values(self.datasources.entity_delta),
            name=self._name + ".entity_delta_sum"
        )
        "`int` : The sum of delta changes in the entity frequency table"

        self.entity_delta_increase = aggregators.sum(
            filters.positive(dicts.values(self.datasources.entity_delta)),
            name=self._name + ".entity_delta_increase"
        )
        "`int` : The sum of delta increases in the entity frequency table"

        self.entity_delta_decrease = aggregators.sum(
            filters.negative(dicts.values(self.datasources.entity_delta)),
            name=self._name + ".entity_delta_decrease"
        )
        "`int` : The sum of delta decreases in the entity frequency table"

        self.entity_prop_delta_sum = aggregators.sum(
            dicts.values(self.datasources.entity_prop_delta),
            name=self._name + ".entity_prop_delta_sum"
        )
        """
        `int` : The sum of proportional delta changes in the entity
github wikimedia / revscoring / revscoring / languages / features / dictionary / features.py View on Github external
returns=int
        )
        """
        `int` : The sum of word frequency delta increases for dictionary words
        """
        self.dict_word_delta_decrease = aggregators.sum(
            filters.negative(dict_word_delta_values),
            name=name + ".dict_word_delta_decrease",
            returns=int
        )
        """
        `int` : The sum of word frequency delta decreases for dictionary
        words
        """
        non_dict_word_delta_values = \
            dicts.values(self.datasources.non_dict_word_delta)
        self.non_dict_word_delta_sum = aggregators.sum(
            non_dict_word_delta_values,
            name=name + ".non_dict_word_delta_sum",
            returns=int
        )
        "`int` : The sum of word frequency deltas for non-dictionary words"
        self.non_dict_word_delta_increase = aggregators.sum(
            filters.positive(non_dict_word_delta_values),
            name=name + ".non_dict_word_delta_increase",
            returns=int
        )
        """
        `int` : The sum of word frequency delta increases for non-dictionary
        words
        """
        self.non_dict_word_delta_decrease = aggregators.sum(