MCPcopy Create free account
hub / github.com/OpenBitSys/BitDistiller / doc_to_text

Method doc_to_text

test/general/lm_eval/tasks/xnli.py:70–80  ·  view source on GitHub ↗
(self, doc)

Source from the content-addressed store, hash-verified

68 return self.dataset["test"]
69
70 def doc_to_text(self, doc):
71 # Example:
72 # The girl that can help me is all the way across town, right? Yes, The girl I need help from lives a ways away.
73 # [MASK] is replaced with ENTAILMENT_LABEL, NEUTRAL_LABEL, or CONTRADICTION_LABEL
74 return (
75 doc["premise"]
76 + ", "
77 + self.QUESTION_WORD
78 + "? [MASK], "
79 + doc["hypothesis"]
80 )
81
82 def doc_to_target(self, doc):
83 # True = entailment

Callers 2

doc_to_fewshot_promptMethod · 0.95
fewshot_contextMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected