-
Notifications
You must be signed in to change notification settings - Fork 831
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Context Relevancy v2 #59
Conversation
questions, contexts = dataset["question"], dataset["contexts"] | ||
for q, c in zip(questions, contexts): | ||
prompt = CONTEXT_RELEVANCE.format(q, "\n".join(c)) | ||
prompts.append(prompt) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wouldn't this need batching. If there are more than 20 (questions, contexts) pairs openAI will return an error?
|
||
return score_ds | ||
return dataset.add_column(f"{self.name}", scores) # type: ignore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are we type ignoring here? just curious
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A warning for not passing the dataset fingerprint argument, The same is done in the Faithfulness class.
model_name: str = "t5-base" | ||
batch_size: int = 15 | ||
agreement_metric: str = "bert_score" | ||
strictness: int = 2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what does the strictness param do? would be great to have doc string at this point I guess
@jjmachan Added the required changes. |
What
Added support for new context relevancy metrics
Why
The earlier used context_relevancy metric was found to have a poor correlation with actual results.
How
New paradigm leverages candidate sentence extraction with self-consistency checks to ensure far better results even with larger context lengths.
Screenshots