paddlenlp/metrics/glue.py
def accumulate(self):
        """
        Calculates and returns the accumulated metric.

        Returns:
            tuple: The accumulated metric. A tuple of shape (acc, precision,
            recall, f1, average_of_acc_and_f1)

            With the fields:

            - `acc` (numpy.float64):
                The accumulated accuracy.
            - `precision` (numpy.float64):
                The accumulated precision.
            - `recall` (numpy.float64):
                The accumulated recall.
            - `f1` (numpy.float64):
                The accumulated f1.
            - `average_of_acc_and_f1` (numpy.float64):
                The average of accumulated accuracy and f1.

        """
        acc = self.acc.accumulate()
        precision = self.precision.accumulate()
        recall = self.recall.accumulate()
        if precision == 0.0 or recall == 0.0:
            f1 = 0.0
        else:
            # 1/f1 = 1/2 * (1/precision + 1/recall)
            f1 = (2 * precision * recall) / (precision + recall)
        return (
            acc,
            precision,
            recall,
            f1,
            (acc + f1) / 2, )

        Calculates and returns the accumulated metric.

        Returns:
            tuple: The accumulated metric. A tuple of shape (acc, precision,
            recall, f1, average_of_acc_and_f1)

            With the fields:

            - `acc` (numpy.float64):
                The accumulated accuracy.
            - `precision` (numpy.float64):
                The accumulated precision.
            - `recall` (numpy.float64):
                The accumulated recall.
            - `f1` (numpy.float64):
                The accumulated f1.
            - `average_of_acc_and_f1` (numpy.float64):
                The average of accumulated accuracy and f1.

        
Calculates and returns the accumulated metric.
Calculates and returns the accumulated metric .
def accumulate(self):
        acc = self.acc.accumulate()
        precision = self.precision.accumulate()
        recall = self.recall.accumulate()
        if precision == 0.0 or recall == 0.0:
            f1 = 0.0
        else:
            f1 = (2 * precision * recall) / (precision + recall)
        return (
            acc,
            precision,
            recall,
            f1,
            (acc + f1) / 2, )
def accumulate ( self ) : acc = self . acc . accumulate ( ) precision = self . precision . accumulate ( ) recall = self . recall . accumulate ( ) if precision == 0.0 or recall == 0.0 : f1 = 0.0 else : f1 = ( 2 * precision * recall ) / ( precision + recall ) return ( acc , precision , recall , f1 , ( acc + f1 ) / 2 , )
Calculates and returns the accumulated metric.
Calculates and returns the accumulated metric .
"""
        Calculates and returns the accumulated metric.

        Returns:
            tuple: The accumulated metric. A tuple of shape (acc, precision,
            recall, f1, average_of_acc_and_f1)

            With the fields:

            - `acc` (numpy.float64):
                The accumulated accuracy.
            - `precision` (numpy.float64):
                The accumulated precision.
            - `recall` (numpy.float64):
                The accumulated recall.
            - `f1` (numpy.float64):
                The accumulated f1.
            - `average_of_acc_and_f1` (numpy.float64):
                The average of accumulated accuracy and f1.

        """ # 1/f1 = 1/2 * (1/precision + 1/recall)
The accumulated metric. A tuple of shape (acc, precision,
recall, f1, average_of_acc_and_f1)

With the fields.

`acc` (numpy.float64):
The accumulated accuracy.
`precision` (numpy.float64):
The accumulated precision.
`recall` (numpy.float64):
The accumulated recall.
`f1` (numpy.float64):
The accumulated f1.
`average_of_acc_and_f1` (numpy.float64):
The average of accumulated accuracy and f1.
The accumulated metric . A tuple of shape ( acc precision recall f1 average_of_acc_and_f1 ) With the fields . ` acc ` ( numpy . float64 ) : The accumulated accuracy . ` precision ` ( numpy . float64 ) : The accumulated precision . ` recall ` ( numpy . float64 ) : The accumulated recall . ` f1 ` ( numpy . float64 ) : The accumulated f1 . ` average_of_acc_and_f1 ` ( numpy . float64 ) : The average of accumulated accuracy and f1 .
tuple
self