-
Notifications
You must be signed in to change notification settings - Fork 59
docs: update README #298
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
docs: update README #298
Conversation
Summary of ChangesHello @e06084, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the project's documentation by revamping the Highlights
Ignored Files
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request significantly overhauls the README files, making them more structured, informative, and user-friendly. The changes introduce key concepts, detailed feature highlights, and clearer usage examples, which will greatly benefit the project's documentation. I've identified a couple of high-severity issues in the new code examples within the English README that would cause them to fail. Additionally, there are some minor issues with documentation links that could be improved for non-Chinese speakers. Overall, these are excellent improvements.
| @Model.rule_register('QUALITY_BAD_CUSTOM', ['default']) | ||
| class MyCustomRule(BaseRule): | ||
| @classmethod | ||
| def eval(cls, input_data: Data) -> EvalDetail: | ||
| # Your logic here | ||
| return EvalDetail(status=False, label=['QUALITY_GOOD']) | ||
| ``` |
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.
The code example for a custom rule is not functional and can be misleading.
- It will raise a
pydantic.ValidationErrorbecause theEvalDetailconstructor is missing the requiredmetricargument. - The example always returns a "good" result (
status=False), which doesn't effectively demonstrate how a rule identifies issues.
A more illustrative and correct example would be helpful for users. Here is a suggestion that fixes the crash and provides a more meaningful implementation:
| @Model.rule_register('QUALITY_BAD_CUSTOM', ['default']) | |
| class MyCustomRule(BaseRule): | |
| @classmethod | |
| def eval(cls, input_data: Data) -> EvalDetail: | |
| # Your logic here | |
| return EvalDetail(status=False, label=['QUALITY_GOOD']) | |
| ``` | |
| @Model.rule_register('QUALITY_BAD_CUSTOM', ['default']) | |
| class MyCustomRule(BaseRule): | |
| @classmethod | |
| def eval(cls, input_data: Data) -> EvalDetail: | |
| # Example: check if content is empty | |
| if not input_data.content: | |
| return EvalDetail( | |
| metric=cls.__name__, | |
| status=True, # Found an issue | |
| label=[f'{cls.metric_type}.{cls.__name__}'], | |
| reason=["Content is empty."] | |
| ) | |
| return EvalDetail(metric=cls.__name__, status=False, label=['QUALITY_GOOD']) |
| return EvalDetail( | ||
| status=not is_valid, # False = good, True = bad | ||
| label=['QUALITY_GOOD' if is_valid else 'QUALITY_BAD_CUSTOM'], | ||
| reason=["Validation details..."] | ||
| ) |
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.
The code example for DomainSpecificRule is not correct as it will raise a pydantic.ValidationError. The EvalDetail constructor is missing the required metric argument.
| return EvalDetail( | |
| status=not is_valid, # False = good, True = bad | |
| label=['QUALITY_GOOD' if is_valid else 'QUALITY_BAD_CUSTOM'], | |
| reason=["Validation details..."] | |
| ) | |
| return EvalDetail( | |
| metric=cls.__name__, | |
| status=not is_valid, # False = good, True = bad | |
| label=['QUALITY_GOOD' if is_valid else 'QUALITY_BAD_CUSTOM'], | |
| reason=["Validation details..."] | |
| ) |
| | **Security** | PII detection, Perspective API toxicity | Privacy and safety | | ||
|
|
||
| 📊 **[View Complete Metrics Documentation →](docs/metrics.md)** | ||
| 📖 **[RAG Evaluation Guide →](docs/rag_evaluation_metrics_zh.md)** |
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.
The "RAG Evaluation Guide" link points to a Chinese document (docs/rag_evaluation_metrics_zh.md). For better accessibility for English-speaking users, it would be ideal to link to an English version of this guide. If an English version doesn't exist yet, consider creating one. This also applies to the link on line 359.
| | **セキュリティ** | PII 検出、Perspective API 毒性 | プライバシーと安全性 | | ||
|
|
||
| 📊 **[完全なメトリクス文書を表示 →](docs/metrics.md)** | ||
| 📖 **[RAG 評価ガイド →](docs/rag_evaluation_metrics_zh.md)** |
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.
No description provided.