@@ -98,45 +98,3 @@ def forward(self, example, pred, trace=None):
9898 score = f1_score (groundedness .groundedness , completeness .completeness )
9999
100100 return score if trace is None else score >= self .threshold
101-
102-
103-
104- # """
105- # Soon-to-be deprecated Signatures & Modules Below.
106- # """
107-
108-
109- # class AnswerCorrectnessSignature(dspy.Signature):
110- # """Verify that the predicted answer matches the gold answer."""
111-
112- # question = dspy.InputField()
113- # gold_answer = dspy.InputField(desc="correct answer for question")
114- # predicted_answer = dspy.InputField(desc="predicted answer for question")
115- # is_correct = dspy.OutputField(desc="True or False")
116-
117-
118- # class AnswerCorrectness(dspy.Module):
119- # def __init__(self):
120- # super().__init__()
121- # self.evaluate_correctness = dspy.ChainOfThought(AnswerCorrectnessSignature)
122-
123- # def forward(self, question, gold_answer, predicted_answer):
124- # return self.evaluate_correctness(question=question, gold_answer=gold_answer, predicted_answer=predicted_answer)
125-
126-
127- # class AnswerFaithfulnessSignature(dspy.Signature):
128- # """Verify that the predicted answer is based on the provided context."""
129-
130- # context = dspy.InputField(desc="relevant facts for producing answer")
131- # question = dspy.InputField()
132- # answer = dspy.InputField(desc="often between 1 and 5 words")
133- # is_faithful = dspy.OutputField(desc="True or False")
134-
135-
136- # class AnswerFaithfulness(dspy.Module):
137- # def __init__(self):
138- # super().__init__()
139- # self.evaluate_faithfulness = dspy.ChainOfThought(AnswerFaithfulnessSignature)
140-
141- # def forward(self, context, question, answer):
142- # return self.evaluate_faithfulness(context=context, question=question, answer=answer)
0 commit comments