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

Feat: prompt adaptation for test data generation #530

Merged
merged 49 commits into from Feb 3, 2024

Conversation

shahules786
Copy link
Member

@shahules786 shahules786 commented Jan 30, 2024

  • prompt adaptation for languages
  • Minor bug fixes and assertions
  • JSON safe loading

@shahules786 shahules786 marked this pull request as ready for review January 31, 2024 03:05
@gonznm
Copy link

gonznm commented Feb 1, 2024

Hi @shahules786, thank you for your nice work!
Does prompt adaptation also include being able to change the language? As in metrics

@shahules786
Copy link
Member Author

@gonznm Hey there, Yes. I have been working hard on this feature. It's working now, would love to hear your feedback and if you have any suggested improvements feel free to raise a PR :)

@gonznm
Copy link

gonznm commented Feb 2, 2024

Awesome! I will def give it a try on monday!

Copy link
Member

@jjmachan jjmachan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we finally have this thanks to @shahules786

feel free to install from the latest and take it for a spin @gonznm 😉

@jjmachan jjmachan merged commit f81af72 into explodinggradients:main Feb 3, 2024
15 checks passed
@gonznm
Copy link

gonznm commented Feb 5, 2024

Hey there @jjmachan and @shahules786 :)
Adaptation seems to work well in my generation experiments with spanish and OpenAI API! Congrats and thank you!!

Note: I have other issues when trying to use open-source models, but they are not related to adaptation, I'll open an issue for that

@shahules786
Copy link
Member Author

Great @gonznm , thanks. Please report the issues so that we can help :)

@jjmachan
Copy link
Member

jjmachan commented Feb 6, 2024

thanks a lot for sharing your feedback - really happy to hear its working for you :)

we'll get you sorted on the other issue as well but welcome to the community brother - we are happy to have you here 🙂 ❤️

@dketterer-enbw
Copy link

I had an issue with adapting a generator to german.

I got an AssertionError: Adapted output keys do not match with the original output keys on this line.

The problem was that one output_key was "verdit" instead of "verdict".

I ended up fixing the typo https://github.com/explodinggradients/ragas/blob/deded7096486f1b7616e8d11f7e9d6eac731bdd0/src/ragas/testset/prompts.py#L181 and now it works!

filter_question_prompt = Prompt(
    name="filter_question",
    instruction="""Given a question, classify it based on clarity and specificity. Use only 'Clear' (1) and 'Unclear' (0) as verdict.""",
    examples=[
        {
            "question": "What is the discovery about space?",
            "output": {
                "reason": "The question is too vague and does not specify which discovery about space it is referring to.",
                "verdit": "0",
            },
        },

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants