MCPcopy Index your code
hub / github.com/QData/TextAttack / get_result

Method get_result

textattack/goal_functions/goal_function.py:77–82  ·  view source on GitHub ↗

A helper method that queries ``self.get_results`` with a single ``AttackedText`` object.

(self, attacked_text, **kwargs)

Source from the content-addressed store, hash-verified

75 return self._get_displayed_output(self._call_model([attacked_text])[0])
76
77 def get_result(self, attacked_text, **kwargs):
78 """A helper method that queries ``self.get_results`` with a single
79 ``AttackedText`` object."""
80 results, search_over = self.get_results([attacked_text], **kwargs)
81 result = results[0] if len(results) else None
82 return result, search_over
83
84 def get_results(self, attacked_text_list, check_skip=False):
85 """For each attacked_text object in attacked_text_list, returns a

Callers 1

init_attack_exampleMethod · 0.95

Calls 1

get_resultsMethod · 0.95

Tested by

no test coverage detected