Skip to content

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

@zl-comment

Description

@zl-comment

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions