textattack.metrics package

metrics package: to calculate advanced metrics for evaluting attacks and augmented text

Metric Class

class textattack.metrics.metric.Metric(**kwargs)[source]

Bases: ABC

A metric for evaluating results and data quality.

abstract calculate(results)[source]

Abstract function for computing any values which are to be calculated as a whole during initialization :param results: Attack results for each instance in dataset :type results: AttackResult objects