How to use the revscoring.features.meta.aggregators.sum 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
filters.negative(dicts.values(self.datasources.token_prop_delta)),
            name=self._name + ".token_prop_delta_decrease"
        )
        """
        `int` : The sum of proportional delta decreases in the token
        frequency table
        """

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

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

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

        self.number_prop_delta_sum = aggregators.sum(
            dicts.values(self.datasources.number_prop_delta),
            name=self._name + ".number_prop_delta_sum"
        )
        """
github wikimedia / revscoring / revscoring / languages / features / dictionary / features.py View on Github external
)
        """
        `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(
            filters.negative(non_dict_word_delta_values),
github wikimedia / revscoring / revscoring / features / wikitext / features / tokenized.py View on Github external
)
        """
        `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
        """

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

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

        self.cjk_delta_increase = aggregators.sum(
github wikimedia / revscoring / revscoring / languages / features / dictionary / features.py View on Github external
non_dict_word_prop_delta_values,
            name=name + ".non_dict_word_prop_delta_sum"
        )
        """
        `float` : The sum of word frequency proportional delta for
        non-dictionary words
        """
        self.non_dict_word_prop_delta_increase = aggregators.sum(
            filters.positive(non_dict_word_prop_delta_values),
            name=name + ".non_dict_word_prop_delta_increase"
        )
        """
        `float` : The sum of word frequency proportional delta increase for
        non-dictionary words
        """
        self.non_dict_word_prop_delta_decrease = aggregators.sum(
            filters.negative(non_dict_word_prop_delta_values),
            name=name + ".non_dict_word_prop_delta_decrease"
        )
        """
        `float` : The sum of word frequency proportional delta decrease for
github wikimedia / revscoring / revscoring / features / wikitext / features / tokenized.py View on Github external
)
        "`int` : The sum of delta changes in the cjk frequency table"

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

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

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

        self.cjk_prop_delta_increase = aggregators.sum(
            filters.positive(dicts.values(self.datasources.cjk_prop_delta)),
            name=self._name + ".cjk_prop_delta_increase"
        )
        """
        `int` : The sum of proportional delta increases in the cjk
        frequency table
        """
github wikimedia / revscoring / revscoring / languages / features / stopwords / features.py View on Github external
"`int` : The sum of word frequency delta increases for stopwords"
        self.stopword_delta_decrease = aggregators.sum(
            filters.negative(stopword_delta_values),
            name=name + ".stopword_delta_decrease",
            returns=int
        )
        "`int` : The sum of word frequency delta decreases for stopwords"
        non_stopword_delta_values = \
            dicts.values(self.datasources.non_stopword_delta)
        self.non_stopword_delta_sum = aggregators.sum(
            non_stopword_delta_values,
            name=name + ".non_stopword_delta_sum",
            returns=int
        )
        "`int` : The sum of word frequency deltas for non-stopwords"
        self.non_stopword_delta_increase = aggregators.sum(
            filters.positive(non_stopword_delta_values),
            name=name + ".non_stopword_delta_increase",
            returns=int
        )
        "`int` : The sum of word frequency delta increases for non-stopwords"
        self.non_stopword_delta_decrease = aggregators.sum(
            filters.negative(non_stopword_delta_values),
            name=name + ".non_stopword_delta_decrease",
            returns=int
        )
        "`int` : The sum of word frequency delta decreases for non-stopwords"

        # Proportional word frequency deltas
        stopword_prop_delta_values = \
            dicts.values(self.datasources.stopword_prop_delta)
        self.stopword_prop_delta_sum = aggregators.sum(
github wikimedia / revscoring / revscoring / features / wikitext / edit / diff / chars.py View on Github external
mappers.map(len, datasources.punctuations_added),
    name=prefix + ".punctuation_chars_added", returns=int
)
"""
A count of the number of punctuation characters added in this edit.
"""

punctuation_chars_removed = aggregators.sum(
    mappers.map(len, datasources.punctuations_removed),
    name=prefix + ".punctuation_chars_removed", returns=int
)
"""
A count of the number of punctuation characters removed in this edit.
"""

break_chars_added = aggregators.sum(
    mappers.map(len, datasources.breaks_added),
    name=prefix + ".break_chars_added", returns=int
)
"""
A count of the number of break characters added in this edit.
"""

break_chars_removed = aggregators.sum(
    mappers.map(len, datasources.breaks_removed),
    name=prefix + ".break_chars_removed", returns=int
)
"""
A count of the number of break characters removed in this edit.
"""
github wikimedia / revscoring / revscoring / features / wikitext / features / tokenized.py View on Github external
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
        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
        """
github wikimedia / revscoring / revscoring / features / wikitext / features / tokenized.py View on Github external
)
        "`int` : The sum of delta changes in the punctuation frequency table"

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

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

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

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