{"id":29675905,"url":"https://github.com/shaadclt/evalrag","last_synced_at":"2025-07-22T23:39:03.747Z","repository":{"id":288740754,"uuid":"969009401","full_name":"shaadclt/EvalRAG","owner":"shaadclt","description":"A comprehensive evaluation toolkit for assessing Retrieval-Augmented Generation (RAG) outputs using linguistic, semantic, and fairness metrics","archived":false,"fork":false,"pushed_at":"2025-04-19T10:07:53.000Z","size":33,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-23T09:56:21.280Z","etag":null,"topics":["rag","rag-evaluation"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/eval-rag/0.0.2/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shaadclt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-04-19T07:11:16.000Z","updated_at":"2025-04-25T17:22:48.000Z","dependencies_parsed_at":"2025-04-19T15:27:04.972Z","dependency_job_id":"42f51c31-32b4-422a-8192-ab64f70055bb","html_url":"https://github.com/shaadclt/EvalRAG","commit_stats":null,"previous_names":["shaadclt/evalrag","shaadclt/eval-rag"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/shaadclt/EvalRAG","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shaadclt%2FEvalRAG","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shaadclt%2FEvalRAG/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shaadclt%2FEvalRAG/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shaadclt%2FEvalRAG/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shaadclt","download_url":"https://codeload.github.com/shaadclt/EvalRAG/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shaadclt%2FEvalRAG/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266591238,"owners_count":23953082,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["rag","rag-evaluation"],"created_at":"2025-07-22T23:39:02.921Z","updated_at":"2025-07-22T23:39:03.719Z","avatar_url":"https://github.com/shaadclt.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# EvalRAG\n\n## Overview\n\nEvalRAG is a comprehensive evaluation toolkit for assessing Retrieval-Augmented Generation (RAG) outputs using linguistic, semantic, and fairness metrics.\n\n## Installation\n\nYou can install the library using pip:\n\n```bash\npip install eval-rag\n```\n\n## Usage\n\nHere's how to use the Eval RAG library:\n\n```python\nfrom eval_rag import EvalRAG\n\n# Initialize the evaluator\nevaluator = EvalRAG()\n\n# Input data\nquestion = \"What are the causes of climate change?\"\nresponse = \"Climate change is caused by human activities.\"\nreference = \"Human activities such as burning fossil fuels cause climate change.\"\n\n# Evaluate the response\nmetrics = evaluator.evaluate_all(question, response, reference)\n\n# Print the results\nprint(metrics)\n```\n\n## Metrics\n\nThe RAG Evaluator provides the following metrics:\n\n1. **BLEU** (0-100): Measures the overlap between the generated output and reference text based on n-grams.\n   - 0-20: Low similarity, 20-40: Medium-low, 40-60: Medium, 60-80: High, 80-100: Very high\n\n2. **ROUGE-1** (0-1): Measures the overlap of unigrams between the generated output and reference text.\n   - 0.0-0.2: Poor overlap, 0.2-0.4: Fair, 0.4-0.6: Good, 0.6-0.8: Very good, 0.8-1.0: Excellent\n\n3. **BERT Score** (0-1): Evaluates the semantic similarity using BERT embeddings (Precision, Recall, F1).\n   - 0.0-0.5: Low similarity, 0.5-0.7: Moderate, 0.7-0.8: Good, 0.8-0.9: High, 0.9-1.0: Very high\n\n4. **Perplexity** (1 to ∞, lower is better): Measures how well a language model predicts the text.\n   - 1-10: Excellent, 10-50: Good, 50-100: Moderate, 100+: High (potentially nonsensical)\n\n5. **Diversity** (0-1): Measures the uniqueness of bigrams in the generated output.\n   - 0.0-0.2: Very low, 0.2-0.4: Low, 0.4-0.6: Moderate, 0.6-0.8: High, 0.8-1.0: Very high\n\n6. **Racial Bias** (0-1): Detects the presence of biased language in the generated output.\n   - 0.0-0.2: Low probability, 0.2-0.4: Moderate, 0.4-0.6: High, 0.6-0.8: Very high, 0.8-1.0: Extreme\n\n7. **MAUVE** (0-1): MAUVE captures contextual meaning, coherence, and fluency while measuring both semantic similarity and stylistic alignment .\n   -  0.0-0.2 (Poor), 0.2-0.4 (Fair), 0.4-0.6 (Good), 0.6-0.8 (Very good), 0.8-1.0 (Excellent).\n     \n8. **METEOR** (0-1): Calculates semantic similarity considering synonyms and paraphrases.\n   - 0.0-0.2: Poor, 0.2-0.4: Fair, 0.4-0.6: Good, 0.6-0.8: Very good, 0.8-1.0: Excellent\n\n9. **CHRF** (0-1): Computes Character n-gram F-score for fine-grained text similarity.\n   - 0.0-0.2: Low, 0.2-0.4: Moderate, 0.4-0.6: Good, 0.6-0.8: High, 0.8-1.0: Very high\n\n10. **Flesch Reading Ease** (0-100): Assesses text readability.\n   - 0-30: Very difficult, 30-50: Difficult, 50-60: Fairly difficult, 60-70: Standard, 70-80: Fairly easy, 80-90: Easy, 90-100: Very easy\n\n11. **Flesch-Kincaid Grade** (0-18+): Indicates the U.S. school grade level needed to understand the text.\n    - 1-6: Elementary, 7-8: Middle school, 9-12: High school, 13+: College level\n\n## Testing\n\nTo run the tests, use the following command:\n\n```\npython -m unittest discover -s eval_rag -p \"test_*.py\"\n```\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE.txt) file for details.\n\n## Contributing\n\nContributions are welcome! If you have any improvements, suggestions, or bug fixes, feel free to create a pull request (PR) or open an issue on GitHub. Please ensure your contributions adhere to the project's coding standards and include appropriate tests.\n\n### How to Contribute\n\n1. Fork the repository.\n2. Create a new branch for your feature or bug fix.\n3. Make your changes.\n4. Run tests to ensure everything is working.\n5. Commit your changes and push to your fork.\n6. Create a pull request (PR) with a detailed description of your changes.\n\n## Contact\n\nIf you have any questions or need further assistance, feel free to reach out via [email](mailto:shaadclt@gmail.com).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshaadclt%2Fevalrag","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshaadclt%2Fevalrag","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshaadclt%2Fevalrag/lists"}