    def get_metric(self, reset: bool = False) -> float:
        """
        # Returns

        The accumulated accuracy.
        """
        if self.total_count > 1e-12:
            accuracy = float(self.correct_count) / float(self.total_count)
        else:
            accuracy = 0.0

        if reset:
            self.reset()

        return accuracy
# Returns

The accumulated accuracy.
allennlp/training/metrics/categorical_accuracy.py