Skip to content

Commit

Permalink
Test CI
Browse files Browse the repository at this point in the history
  • Loading branch information
carlesonielfa committed Jul 19, 2024
1 parent 6332703 commit c62fa17
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 3 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,8 @@ jobs:
coverageFile: coverage.xml
token: ${{ secrets.GITHUB_TOKEN }}
thresholdAll: 0.9


- name: Update Coverage Badge
# GitHub actions: default branch variable
# Disable as of now to test the action
# if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch)
uses: we-cli/coverage-badge-action@main
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ htmlcov/
.cache
nosetests.xml
coverage.xml
coverage.json
*.cover
*.py,cover
.hypothesis/
Expand Down
48 changes: 48 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,50 @@
<!--- BADGES: START --->
[![HF Nuclia](https://img.shields.io/badge/%F0%9F%A4%97-models-yellow)](https://huggingface.co/nuclia)
[![GitHub - License](https://img.shields.io/github/license/nuclia/nuclia-eval?logo=github&style=flat&color=green)][#github-license]
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/nuclia-eval?logo=pypi&style=flat&color=blue)][#pypi-package]
[![PyPI - Package Version](https://img.shields.io/pypi/v/nuclia-eval?logo=pypi&style=flat&color=orange)][#pypi-package]
[![Code coverage](https://nuclia.github.io/nuclia-eval/badges/coverage.svg)](https://github.com/nuclia/nuclia-eval/actions)


[#github-license]: https://github.com/nuclia/nuclia-eval/blob/master/LICENSE
[#pypi-package]: https://pypi.org/project/nuclia-eval/
<!--- BADGES: END --->

# nuclia-eval
<p align="center">
<img src="assets/Nuclia_vertical.png" width="350" title="nuclia logo" alt="nuclia, the all-in-one RAG as a service platform.">
</p>

Library for evaluating RAG using Nuclia's models

Its evaluation follows the RAG triad as proposed by [TruLens](https://www.trulens.org/trulens_eval/getting_started/core_concepts/rag_triad/):

![rag triad](assets/RAG_Triad.jpg)

In summary, the metrics **nuclia-eval** provides for a RAG Experience involving a **question** an **answer** and N pieces of **context** are:

* **Answer Relevance**: Answer relevance refers to the directness and appropriateness of the response in addressing the specific question asked, providing accurate, complete, and contextually suitable information.
* **score**: A score between 0 and 5 indicating the relevance of the answer to the question.
* **reason**: A string explaining the reason for the score.
* For each of the N pieces of context:
* **Context Relevance Score**: The context relevance is the relevance of the **context** to the **question**, on a scale of 0 to 5.
* **Groudedness Score**: Groundedness is defined as the degree of information overlap to which the **answer** contains information that is substantially similar or identical to that in the **context** piece. The score is between 0 and 5.

## Available Models

### REMi-v0

[REMi-v0](https://huggingface.co/nuclia/REMi-v0) (RAG Evaluation MetrIcs) is a LoRa adapter for the
[Mistral-7B-Instruct-v0.3](https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.3) model.

It has been finetuned by the team at [**nuclia**](nuclia.com) to evaluate the quality of the overall RAG experience.

## Usage

```python
from nuclia_eval import REMi

evaluator = REMiEvaluator()

...
```
Binary file added assets/Nuclia_vertical.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/RAG_Triad.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ source = "src"

[tool.pytest.ini_options]
testpaths = ["./tests"]
addopts = "--cov=nuclia_eval --cov-report=xml --cov-report term"
addopts = "--cov=nuclia_eval --cov-report=xml --cov-report term --cov-report json"

[tool.mypy]
ignore_missing_imports = true
Expand Down
3 changes: 3 additions & 0 deletions src/nuclia_eval/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
"""This module contains the ML models used to evaluate the quality of the RAG experience."""
from nuclia_eval.models.remi import REMiEvaluator

__all__ = ["REMiEvaluator"]

0 comments on commit c62fa17

Please sign in to comment.