QData / TextAttack

TextAttack 🐙 is a Python framework for adversarial attacks, data augmentation, and model training in NLP https://textattack.readthedocs.io/en/master/
https://textattack.readthedocs.io/en/master/
MIT License
2.98k stars 397 forks source link

I want to find where I can jump to this #806

Open zl-comment opened 5 days ago

zl-comment commented 5 days ago

def get_indices_to_order(self, current_text, **kwargs): """Applies pre_transformation_constraints to text to get all the indices that can be used to search and order.

    Args:
        current_text: The current ``AttackedText`` for which we need to find indices are eligible to be ordered.
    Returns:
        The length and the filtered list of indices which search methods can use to search/order.
    """

    indices_to_order = self.transformation(
        current_text,
        pre_transformation_constraints=self.pre_transformation_constraints,
        return_indices=True,
        **kwargs,
    )

    len_text = len(indices_to_order)

    # Convert indices_to_order to list for easier shuffling later
    return len_text, list(indices_to_order)

I want to know where this self.transformation will jump to this method, I use bertattack I looked for it in the transformation parent class, but it doesn’t seem to match