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

Answer relevancy metric is worse in languages other than English #1829

Open
icejean opened this issue Jan 10, 2025 · 2 comments
Open

Answer relevancy metric is worse in languages other than English #1829

icejean opened this issue Jan 10, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@icejean
Copy link

icejean commented Jan 10, 2025

I just try ragas to evaluate my GraphRAG app in Chinese, and find that the metric answer relevancy is worse for every question. And I find out that the cause is the question generated is in English, so the embedding of the original question and the generated question is quite different. To address this issue, I modify the function in ~/ragas/prompt/pydantic_prompt.py to demand LLM to output the generated question in Chinese, and it does work.

    def _generate_output_signature(self, indent: int = 4) -> str:
        return (
            f"Please return the output in a JSON format that complies with the "
            f"following schema as specified in JSON Schema and the generated question in Chinese:\n"
            f"{self.output_model.model_json_schema()}"
        )

But I know the function is called not only for this metric, and a solution is needed to support all languages, so I write down the issue here.
Best regards
Jean from China

@icejean icejean added the bug Something isn't working label Jan 10, 2025
@jjmachan
Copy link
Member

hey there Jean 👋🏽

Have you tried adapting the metrics into chineese? is it still doing down for that?
https://docs.ragas.io/en/stable/howtos/customizations/metrics/_metrics_language_adaptation/

@icejean
Copy link
Author

icejean commented Jan 11, 2025

hey there Jean 👋🏽

Have you tried adapting the metrics into chineese? is it still doing down for that? https://docs.ragas.io/en/stable/howtos/customizations/metrics/_metrics_language_adaptation/

Not yet, I'm new to ragas and don't know about the feature, I'll have a try soon, thanks for your reply. 8-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants