1
0
mirror of https://github.com/QData/TextAttack.git synced 2021-10-13 00:05:06 +03:00

add iga docs + update tests

This commit is contained in:
Jack Morris
2020-07-09 10:06:09 -04:00
parent afd4a8f425
commit d36c80b114
26 changed files with 178 additions and 35 deletions

View File

@@ -106,6 +106,7 @@ Attacks on classification tasks, like sentiment classification and entailment:
- **faster-alzantot**: modified, faster version of the Alzantot et al. genetic algorithm, from (["Certified Robustness to Adversarial Word Substitutions" (Jia et al., 2019)](https://arxiv.org/abs/1909.00986)).
- **deepwordbug**: Greedy replace-1 scoring and multi-transformation character-swap attack (["Black-box Generation of Adversarial Text Sequences to Evade Deep Learning Classifiers" (Gao et al., 2018)](https://arxiv.org/abs/1801.04354)).
- **hotflip**: Beam search and gradient-based word swap (["HotFlip: White-Box Adversarial Examples for Text Classification" (Ebrahimi et al., 2017)](https://arxiv.org/abs/1712.06751)).
- **iga**: Improved genetic algorithm attack from (["Natural Language Adversarial Attacks and Defenses in Word Level (Wang et al., 2019)"](https://arxiv.org/abs/1909.06723)
- **input-reduction**: Reducing the input while maintaining the prediction through word importance ranking (["Pathologies of Neural Models Make Interpretation Difficult" (Feng et al., 2018)](https://arxiv.org/pdf/1804.07781.pdf)).
- **kuleshov**: Greedy search and counterfitted embedding swap (["Adversarial Examples for Natural Language Classification Problems" (Kuleshov et al., 2018)](https://openreview.net/pdf?id=r1QZ3zbAZ)).
- **pso**: Particle swarm optimization and HowNet synonym swap (["Word-level Textual Adversarial Attacking as Combinatorial Optimization" (Zang et al., 2020)](https://www.aclweb.org/anthology/2020.acl-main.540/)).

1
augment_test.csv Normal file
View File

@@ -0,0 +1 @@

View File

@@ -41,8 +41,15 @@ HotFlip (HotFlip: White-Box Adversarial Examples for Text Classification)
.. automodule:: textattack.attack_recipes.hotflip_ebrahimi_2017
:members:
Input Reduction
################
Improved Genetic Algorithm (Natural Language Adversarial Attacks and Defenses in Word Level)
#################################################################################################
.. automodule:: textattack.attack_recipes.iga_wang_2019
:members:
Input Reduction (Pathologies of Neural Models Make Interpretations Difficult)
####################################################################################
.. automodule:: textattack.attack_recipes.input_reduction_feng_2018
:members:

View File

@@ -1,4 +1,4 @@
Attack(
/.*/Attack(
(search_method): GreedyWordSwapWIR(
(wir_method): unk
)
@@ -41,6 +41,9 @@ Running in interactive mode
----------------------------
Enter a sentence to attack or "q" to quit:
Attacking...
t1 / <AttackedText "All that glitters is not gold">
t2 / <AttackedText "Any that shinning is not gold">
t1.num_words / 6 t2.num_words / 6
1 (96%) --> 0 (66%)
All that glitters is not gold

View File

@@ -26,8 +26,11 @@
(4): StopwordModification
(is_black_box): True
)
/.*/
--------------------------------------------- Result 1 ---------------------------------------------
t1 / <AttackedText "it 's a charming and often affecting journey . ">
t2 / <AttackedText "it 's a loveable and ordinarily affecting journey . ">
t1.num_words / 8 t2.num_words / 8
Positive (100%) --> Negative (69%)
it 's a charming and often affecting journey .
@@ -36,6 +39,9 @@ it 's a loveable and ordinarily affecting journey .
--------------------------------------------- Result 2 ---------------------------------------------
t1 / <AttackedText "unflinchingly bleak and desperate ">
t2 / <AttackedText "unflinchingly bleak and desperation ">
t1.num_words / 4 t2.num_words / 4
Negative (83%) --> Positive (90%)
unflinchingly bleak and desperate

View File

@@ -3,7 +3,20 @@
(wir_method): unk
)
(goal_function): UntargetedClassification
(transformation): CompositeTransformation
(transformation): CompositeTransformation(
(0): WordSwapNeighboringCharacterSwap(
(random_one): True
)
(1): WordSwapRandomCharacterSubstitution(
(random_one): True
)
(2): WordSwapRandomCharacterDeletion(
(random_one): True
)
(3): WordSwapRandomCharacterInsertion(
(random_one): True
)
)
(constraints):
(0): LevenshteinEditDistance(
(max_edit_distance): 30
@@ -13,8 +26,11 @@
(2): StopwordModification
(is_black_box): True
)
/.*/
--------------------------------------------- Result 1 ---------------------------------------------
t1 / <AttackedText "lovingly photographed in the manner of a golden book sprung to life , stuart little 2 manages sweetness largely without stickiness .">
t2 / <AttackedText "lovingly photographed in the manner of a golden book sprung to ife , stuart little 2 manager seetness largely without stickiness .">
t1.num_words / 20 t2.num_words / 20
Positive (91%) --> Negative (69%)
lovingly photographed in the manner of a golden book sprung to life , stuart little 2 manages sweetness largely without stickiness .
@@ -23,6 +39,9 @@ lovingly photographed in the manner of a golden book sprung to ife , st
--------------------------------------------- Result 2 ---------------------------------------------
t1 / <AttackedText "consistently clever and suspenseful .">
t2 / <AttackedText "conisstently celver and Huspenseful .">
t1.num_words / 4 t2.num_words / 4
Positive (99%) --> Negative (82%)
consistently clever and suspenseful .

View File

@@ -30,8 +30,11 @@
(4): StopwordModification
(is_black_box): True
)
/.*/
--------------------------------------------- Result 1 ---------------------------------------------
t1 / <AttackedText "this kind of hands-on storytelling is ultimately what makes shanghai ghetto move beyond a good , dry , reliable textbook and what allows it to rank with its worthy predecessors .">
t2 / <AttackedText "this kind of hands-on storytelling is ultimately what makes shanghai ghetto move beyond a good , dry , reliable manuals and what allows it to rank with its creditable predecessors .">
t1.num_words / 28 t2.num_words / 28
Positive (73%) --> Negative (68%)
this kind of hands-on storytelling is ultimately what makes shanghai ghetto move beyond a good , dry , reliable textbook and what allows it to rank with its worthy predecessors .

View File

@@ -1,4 +1,5 @@
/.*/Attack(
/.*/2020-07-09 09:51:14,589 loading file /u/jm8wx/.flair/models/en-pos-ontonotes-fast-v0.4.pt
Attack(
(search_method): GreedyWordSwapWIR(
(wir_method): unk
)
@@ -24,8 +25,11 @@
(3): StopwordModification
(is_black_box): True
)
/.*/
--------------------------------------------- Result 1 ---------------------------------------------
t1 / <AttackedText "exposing the ways we fool ourselves is one hour photo's real strength .">
t2 / <AttackedText "exposing the ways we fool ourselves is one stopwatch photo's real kraft .">
t1.num_words / 12 t2.num_words / 12
Positive (100%) --> Negative (98%)
exposing the ways we fool ourselves is one hour photo's real strength .
@@ -34,6 +38,9 @@ exposing the ways we fool ourselves is one stopwatch photo's real 
--------------------------------------------- Result 2 ---------------------------------------------
t1 / <AttackedText "it's up to you to decide whether to admire these people's dedication to their cause or be repelled by their dogmatism , manipulativeness and narrow , fearful view of american life .">
t2 / <AttackedText "it's up to you to decide whether to admire these people's dedication to their cause or be rescheduled by their dogmatism , manipulativeness and narrow , shitless view of american life .">
t1.num_words / 29 t2.num_words / 29
Positive (96%) --> Negative (99%)
it's up to you to decide whether to admire these people's dedication to their cause or be repelled by their dogmatism , manipulativeness and narrow , fearful view of american life .
@@ -42,6 +49,9 @@ it's up to you to decide whether to admire these people's dedication to their ca
--------------------------------------------- Result 3 ---------------------------------------------
t1 / <AttackedText "mostly , [goldbacher] just lets her complicated characters be unruly , confusing and , through it all , human .">
t2 / <AttackedText "mostly , [goldbacher] just lets her complicated characters be haphazard , confusing and , through it all , humanistic .">
t1.num_words / 15 t2.num_words / 15
Positive (100%) --> Negative (96%)
mostly , [goldbacher] just lets her complicated characters be unruly , confusing and , through it all , human .
@@ -50,6 +60,9 @@ mostly , [goldbacher] just lets her complicated characters be haphazard
--------------------------------------------- Result 4 ---------------------------------------------
t1 / <AttackedText ". . . quite good at providing some good old fashioned spooks .">
t2 / <AttackedText ". . . rather good at provision some good old fashioned bugging .">
t1.num_words / 9 t2.num_words / 9
Positive (99%) --> Negative (90%)
. . . quite good at providing some good old fashioned spooks .

View File

@@ -3,12 +3,17 @@
(wir_method): unk
)
(goal_function): UntargetedClassification
(transformation): WordSwapRandomCharacterSubstitution
(transformation): WordSwapRandomCharacterSubstitution(
(random_one): True
)
(constraints): None
(is_black_box): True
)
/.*/
--------------------------------------------- Result 1 ---------------------------------------------
t1 / <AttackedText "I was surprised how much I enjoyed this. Sure it is a bit slow moving in parts, but what else would one expect from Rollin? Also there is plenty of nudity, nothing wrong with that, particularly as it includes lots of the gorgeous, Brigitte Lahaie. There are also some spectacularly eroticised female dead, bit more dodgey, perhaps, but most effective. There is also a sci-fi like storyline with a brief explanation at the end, but I wouldn't bother too much with that. No, here we have a most interesting exploration of memory and the effect of memory loss and to just what extent one is still 'alive' without memory. My DVD sleeve mentions David Cronenberg and whilst this is perhaps not quite as good as his best films, there is some similarity here, particularly with the great use of seemingly menacing architecture and the effective and creepy use of inside space. As I have tried to indicate this is by no means a rip roaring thriller, it is a captivating, nightmare like movie that makes the very most of its locations, including a stunning railway setting at the end.">
t2 / <AttackedText "I was surprised how much I enjoyed this. Sure it is a bct slow moving in parts, but what else would one expect from Rollin? Also there is plenty of nudity, nothing wrong with that, particularly as it includes lots of the gorgeous, Brigitte Lahaie. There are also some spectacularly eroticised female dead, bit more dodgey, perhaps, but most effective. There is also a sci-fi like storyline with a brief explanation at the end, but I wouldn't bother too much with that. No, here we have a most interesting exploration of memory and the effect of memory loss and to just what extent one is still 'alive' without memory. My DVD sleeve mentions David Cronenberg and whilst this is perhaps not quite as good as his best films, there is some similarity here, particularly with the great use of seemingly menacing architecture and the effective and creepy use of inside space. As I have tried to indicate this is by no means a rip roaring thriller, it is a captivating, nightmare like movie that makes the very most of its locations, including a stunning railway setting at the end.">
t1.num_words / 189 t2.num_words / 189
Positive (75%) --> Negative (71%)
I was surprised how much I enjoyed this. Sure it is a bit slow moving in parts, but what else would one expect from Rollin? Also there is plenty of nudity, nothing wrong with that, particularly as it includes lots of the gorgeous, Brigitte Lahaie. There are also some spectacularly eroticised female dead, bit more dodgey, perhaps, but most effective. There is also a sci-fi like storyline with a brief explanation at the end, but I wouldn't bother too much with that. No, here we have a most interesting exploration of memory and the effect of memory loss and to just what extent one is still 'alive' without memory. My DVD sleeve mentions David Cronenberg and whilst this is perhaps not quite as good as his best films, there is some similarity here, particularly with the great use of seemingly menacing architecture and the effective and creepy use of inside space. As I have tried to indicate this is by no means a rip roaring thriller, it is a captivating, nightmare like movie that makes the very most of its locations, including a stunning railway setting at the end.
@@ -17,6 +22,9 @@ I was surprised how much I enjoyed this. Sure it is a bct slow moving i
--------------------------------------------- Result 2 ---------------------------------------------
t1 / <AttackedText "I went into "Night of the Hunted" not knowing what to expect at all. I was really impressed.<br /><br />It is essentially a mystery/thriller where this girl who can't remember anything gets 'rescued' by a guy who happens to be driving past. The two become fast friends and lovers and together, they try to figure out what is going on with her. Through some vague flashbacks and grim memories, they eventually get to the bottom of it and the ending is pretty cool.<br /><br />I really liked the setting of this one: a desolate, post-modern Paris is the backdrop with lots of gray skies and tall buildings. Very metropolitan. Groovy soundtrack and lots of nudity.<br /><br />Surprising it was made in 1980; seems somewhat ahead of it's time.<br /><br />8 out of 10, kids.">
t2 / <AttackedText "I went into "Night of the Hunted" not knowing what to expect at all. I was really impressed.<br /><br />It is essentially a mystery/thriller where this girl who can't remember anything gets 'rescued' by a guy who happens to be driving past. The two become fast friends and lovers and together, they try to figure out what is going on with her. Through some vague flashbacks and grEm memories, they eventually get to the bottom of it and the ending is pretty cool.<br /><br />I really liked the setting of this one: a desolate, post-modern Paris is the backdrop with lots of gray skies and tall buildings. Very metropolitan. Groovy soundtrack and lots of nudity.<br /><br />Surprising it was made in 1980; seems somewhat ahead of it's time.<br /><br />8 out of 10, kids.">
t1.num_words / 139 t2.num_words / 139
Positive (69%) --> Negative (53%)
I went into "Night of the Hunted" not knowing what to expect at all. I was really impressed.<br /><br />It is essentially a mystery/thriller where this girl who can't remember anything gets 'rescued' by a guy who happens to be driving past. The two become fast friends and lovers and together, they try to figure out what is going on with her. Through some vague flashbacks and grim memories, they eventually get to the bottom of it and the ending is pretty cool.<br /><br />I really liked the setting of this one: a desolate, post-modern Paris is the backdrop with lots of gray skies and tall buildings. Very metropolitan. Groovy soundtrack and lots of nudity.<br /><br />Surprising it was made in 1980; seems somewhat ahead of it's time.<br /><br />8 out of 10, kids.

View File

@@ -28,8 +28,11 @@
(4): StopwordModification
(is_black_box): False
)
/.*/
--------------------------------------------- Result 1 ---------------------------------------------
t1 / <AttackedText "the story gives ample opportunity for large-scale action and suspense , which director shekhar kapur supplies with tremendous skill .">
t2 / <AttackedText "the story gives ample opportunity for large-scale action and suspense , which director shekhar kapur stagnated with tremendous skill .">
t1.num_words / 18 t2.num_words / 18
Positive (96%) --> Negative (77%)
the story gives ample opportunity for large-scale action and suspense , which director shekhar kapur supplies with tremendous skill .

View File

@@ -15,7 +15,12 @@
(2): StopwordModification
(is_black_box): True
)
/.*/
t1 / <AttackedText "The new rights are nice enough
Everyone really likes the newest benefits ">
t2 / <AttackedText "The new rights are nice enough
Everyone really likes the newest benefits ">
t1.num_words / 12 t2.num_words / 12
--------------------------------------------- Result 1 ---------------------------------------------
Entailment (99%) --> [SKIPPED]
@@ -23,7 +28,17 @@
Hypothesis: Everyone really likes the newest benefits
t1 / <AttackedText "This site includes a list of all award winners and a searchable database of Government Executive articles.
The Government Executive articles housed on the website are not able to be searched.">
t2 / <AttackedText "This site includes a list of all award winners and a searchable database of Government Executive articles.
The Government Executive articles housed on the website are not able-bodied to be searched.">
t1.num_words / 31 t2.num_words / 31
--------------------------------------------- Result 2 ---------------------------------------------
t1 / <AttackedText "This site includes a list of all award winners and a searchable database of Government Executive articles.
The Government Executive articles housed on the website are not able to be searched.">
t2 / <AttackedText "This site includes a list of all award winners and a searchable database of Government Executive articles.
The Government Executive articles housed on the website are not able-bodied to be searched.">
t1.num_words / 31 t2.num_words / 31
Neutral (100%) --> Entailment (56%)
Premise: This site includes a list of all award winners and a searchable database of Government Executive articles.
@@ -33,7 +48,17 @@
Hypothesis: The Government Executive articles housed on the website are not able-bodied to be searched.
t1 / <AttackedText "uh i don't know i i have mixed emotions about him uh sometimes i like him but at the same times i love to see somebody beat him
I like him for the most part, but would still enjoy seeing someone beat him.">
t2 / <AttackedText "uh i don't know i i have mixed emotions about him uh sometimes i like him but at the same times i love to see somebody beat him
I like him for the most office, but would still enjoy seeing someone beat him.">
t1.num_words / 43 t2.num_words / 43
--------------------------------------------- Result 3 ---------------------------------------------
t1 / <AttackedText "uh i don't know i i have mixed emotions about him uh sometimes i like him but at the same times i love to see somebody beat him
I like him for the most part, but would still enjoy seeing someone beat him.">
t2 / <AttackedText "uh i don't know i i have mixed emotions about him uh sometimes i like him but at the same times i love to see somebody beat him
I like him for the most office, but would still enjoy seeing someone beat him.">
t1.num_words / 43 t2.num_words / 43
Contradiction (99%) --> Entailment (100%)
Premise: uh i don't know i i have mixed emotions about him uh sometimes i like him but at the same times i love to see somebody beat him

View File

@@ -3,7 +3,20 @@
(wir_method): unk
)
(goal_function): UntargetedClassification
(transformation): CompositeTransformation
(transformation): CompositeTransformation(
(0): WordSwapNeighboringCharacterSwap(
(random_one): True
)
(1): WordSwapRandomCharacterSubstitution(
(random_one): True
)
(2): WordSwapRandomCharacterDeletion(
(random_one): True
)
(3): WordSwapRandomCharacterInsertion(
(random_one): True
)
)
(constraints):
(0): LevenshteinEditDistance(
(max_edit_distance): 30
@@ -13,8 +26,11 @@
(2): StopwordModification
(is_black_box): True
)
/.*/
--------------------------------------------- Result 1 ---------------------------------------------
t1 / <AttackedText "hide new secretions from the parental units ">
t2 / <AttackedText "Ehide enw secretions from the parental units ">
t1.num_words / 7 t2.num_words / 7
Negative (100%) --> Positive (71%)
hide new secretions from the parental units
@@ -29,6 +45,9 @@ contains no wit , only labored gags
--------------------------------------------- Result 3 ---------------------------------------------
t1 / <AttackedText "that loves its characters and communicates something rather beautiful about human nature ">
t2 / <AttackedText "that lodes its characters and communicates somethNng rathrer beautifdul about human nature ">
t1.num_words / 12 t2.num_words / 12
Positive (100%) --> Negative (96%)
that loves its characters and communicates something rather beautiful about human nature

View File

@@ -11,4 +11,4 @@ from .textbugger_li_2018 import TextBuggerLi2018
from .textfooler_jin_2019 import TextFoolerJin2019
from .pwws_ren_2019 import PWWSRen2019
from .pruthi_2019 import Pruthi2019
from .PSO_zang_2020 import PSOZang2020
from .pso_zang_2020 import PSOZang2020

View File

@@ -4,7 +4,7 @@ from textattack.constraints.pre_transformation import (
StopwordModification,
)
from textattack.goal_functions import UntargetedClassification
from textattack.search_methods import PSOAlgorithm
from textattack.search_methods import ParticleSwarmOptimization
from textattack.shared.attack import Attack
from textattack.transformations import WordSwapEmbedding, WordSwapHowNet
@@ -51,6 +51,6 @@ def PSOZang2020(model):
#
# Perform word substitution with a Particle Swarm Optimization (PSO) algorithm.
#
search_method = PSOAlgorithm(pop_size=60, max_iters=20)
search_method = ParticleSwarmOptimization(pop_size=60, max_iters=20)
return Attack(goal_function, constraints, transformation, search_method)

View File

@@ -1,8 +1,10 @@
from abc import ABC
from textattack.goal_function_results import GoalFunctionResult
from textattack.shared import utils
class AttackResult:
class AttackResult(ABC):
"""
Result of an Attack run on a single (output, text_input) pair.
@@ -88,7 +90,10 @@ class AttackResult:
i1 = 0
i2 = 0
print("t1 /", t1)
print("t2 /", t2)
print("t1.num_words /", t1.num_words, "t2.num_words /", t2.num_words)
sp = None
while i1 < t1.num_words or i2 < t2.num_words:
# show deletions
while (

View File

@@ -1,21 +1,16 @@
from abc import ABC, abstractmethod
import pickle
import random
from textattack.shared import utils
class TextAttackDataset:
class TextAttackDataset(ABC):
"""
Any iterable of (label, text_input) pairs qualifies as
a ``TextAttackDataset``.
"""
def __init__(self):
"""
Loads a full dataset from disk.
"""
raise NotImplementedError()
def __iter__(self):
return self

View File

@@ -1,3 +1,5 @@
from abc import ABC, abstractmethod
import torch
@@ -8,7 +10,7 @@ class GoalFunctionResultStatus:
SKIPPED = 3
class GoalFunctionResult:
class GoalFunctionResult(ABC):
"""
Represents the result of a goal function evaluating a AttackedText object.
@@ -45,18 +47,21 @@ class GoalFunctionResult:
if isinstance(self.score, torch.Tensor):
self.score = self.score.item()
@abstractmethod
def get_text_color_input(self):
""" A string representing the color this result's changed
portion should be if it represents the original input.
"""
raise NotImplementedError()
@abstractmethod
def get_text_color_perturbed(self):
""" A string representing the color this result's changed
portion should be if it represents the perturbed input.
"""
raise NotImplementedError()
@abstractmethod
def get_colored_output(self, color_method=None):
""" Returns a string representation of this result's output, colored
according to `color_method`.

View File

@@ -41,4 +41,7 @@ class InputReduction(ClassificationGoalFunction):
return min(num_words_score + model_score / initial_num_words, 1)
def extra_repr_keys(self):
return ["target_num_words"]
if self.maximizable:
return ["maximizable"]
else:
return ["maximizable", "target_num_words"]

View File

@@ -25,4 +25,7 @@ class TargetedClassification(ClassificationGoalFunction):
return model_output[self.target_class]
def extra_repr_keys(self):
return ["target_class"]
if self.maximizable:
return ["maximizable", "target_class"]
else:
return ["target_class"]

View File

@@ -202,8 +202,11 @@ class GoalFunction(ABC):
return all_outputs
def extra_repr_keys(self):
attrs = []
if self.query_budget < float("inf"):
return ["query_budget"]
return []
attrs.append("query_budget")
if self.maximizable:
attrs.append("maximizable")
return attrs
__repr__ = __str__ = default_class_repr

View File

@@ -1,4 +1,7 @@
class Logger:
from abc import ABC
class Logger(ABC):
""" An abstract class for different methods of logging attack results.
"""

View File

@@ -3,4 +3,4 @@ from .beam_search import BeamSearch
from .greedy_search import GreedySearch
from .greedy_word_swap_wir import GreedyWordSwapWIR
from .genetic_algorithm import GeneticAlgorithm
from .PSO_algorithm import PSOAlgorithm
from .particle_swarm_optimization import ParticleSwarmOptimization

View File

@@ -13,7 +13,7 @@ from textattack.goal_function_results import GoalFunctionResultStatus
from textattack.search_methods import SearchMethod
class PSOAlgorithm(SearchMethod):
class ParticleSwarmOptimization(SearchMethod):
"""
Attacks a model with word substiutitions using a Particle Swarm Optimization (PSO) algorithm.
Some key hyper-parameters are setup according to the original paper:

View File

@@ -1,5 +1,6 @@
import numpy as np
from textattack.shared import utils
from textattack.transformations.transformation import Transformation
@@ -34,3 +35,14 @@ class CompositeTransformation(Transformation):
for transformation in self.transformations:
new_attacked_texts.update(transformation(*args, **kwargs))
return list(new_attacked_texts)
def __repr__(self):
main_str = "CompositeTransformation" + "("
transformation_lines = []
for i, transformation in enumerate(self.transformations):
transformation_lines.append(utils.add_indent(f"({i}): {transformation}", 2))
transformation_lines.append(")")
main_str += utils.add_indent("\n" + "\n".join(transformation_lines), 2)
return main_str
__str__ = __repr__

View File

@@ -48,3 +48,6 @@ class WordSwapRandomCharacterInsertion(WordSwap):
candidate_words.append(candidate_word)
return candidate_words
def extra_repr_keys(self):
return super().extra_repr_keys() + ["random_one"]

View File

@@ -36,3 +36,6 @@ class WordSwapRandomCharacterSubstitution(WordSwap):
candidate_words.append(candidate_word)
return candidate_words
def extra_repr_keys(self):
return super().extra_repr_keys() + ["random_one"]