prompting.validators.penalty.keyword_match#

Module Contents#

Classes#

KeywordMatchPenaltyModel

class prompting.validators.penalty.keyword_match.KeywordMatchPenaltyModel#

Bases: prompting.validators.penalty.penalty.BasePenaltyModel

property name: str#
Return type:

str

check_exploits_keywords(completion, name)#
Parameters:
  • completion (str) –

  • name (str) –

Return type:

float

calculate_penalties(task, completions)#
Parameters:
Return type:

torch.FloatTensor