Skip to content
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

Add context to guide the generate sentence pair task if informed #706

Merged
merged 3 commits into from
Jun 10, 2024

Conversation

plaguss
Copy link
Contributor

@plaguss plaguss commented Jun 7, 2024

Description

This PR adds a new optional context to the GenerateSentencePair task to help guiding the prompts:

from distilabel.steps import GenerateSentencePair

task = GenerateSentencePair(
    llm=llm,
    action="query",
    triplet=True,
    context="The generated sentence has to be related with Argilla, a data annotation tool for AI engineers and domain experts.",
)

Context

The original prompt, given a "hard" instruction (or possibly quite meaningless without context) could generate unexpected queries, for reference:
image

With context, it can generate more meaningful queries:

image

@plaguss plaguss self-assigned this Jun 7, 2024
@plaguss plaguss added this to the 1.2.0 milestone Jun 7, 2024
Copy link

codspeed-hq bot commented Jun 7, 2024

CodSpeed Performance Report

Merging #706 will not alter performance

Comparing generate-sentence-pair-context (3b7c221) with develop (34ac772)

Summary

✅ 1 untouched benchmarks

@plaguss plaguss marked this pull request as ready for review June 7, 2024 12:13
@plaguss plaguss requested a review from gabrielmbmb June 7, 2024 12:13
@gabrielmbmb gabrielmbmb merged commit 23b3b41 into develop Jun 10, 2024
7 checks passed
@gabrielmbmb gabrielmbmb deleted the generate-sentence-pair-context branch June 10, 2024 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants