mirror of
https://github.com/QData/TextAttack.git
synced 2021-10-13 00:05:06 +03:00
merge in goal-function-attack-result changes
This commit is contained in:
@@ -29,6 +29,12 @@ class GoalFunction:
|
||||
|
||||
def get_output(self, tokenized_text):
|
||||
return self._get_displayed_output(self._call_model([tokenized_text])[0])
|
||||
|
||||
def get_result(self, tokenized_text, correct_output):
|
||||
""" A helper method that queries `self.get_results` with a single
|
||||
`TokenizedText` object.
|
||||
"""
|
||||
return self.get_results([tokenized_text], correct_output)[0]
|
||||
|
||||
def get_results(self, tokenized_text_list, correct_output):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user