Skip to content

Commit

Permalink
Merge pull request #21 from epinzur/update_build
Browse files Browse the repository at this point in the history
updated build and analysis
  • Loading branch information
epinzur authored Jun 21, 2024
2 parents 8be1644 + fc46f88 commit 9a5c826
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 8 deletions.
1 change: 1 addition & 0 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ jobs:
run: |
echo "pyroject.toml:"
cat pyproject.toml
poetry self add poetry-plugin-export
poetry install
poetry build
poetry export -f requirements.txt --output requirements.txt
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

A tool for evaluating RAG pipelines

![ragulate_logo](images/logo_smaller.png)
![ragulate_logo](https://raw.githubusercontent.com/epinzur/ragulate/main/images/logo_smaller.png)

## The Metrics

The RAGulate currently reports 4 relevancy metrics: Answer Correctness, Answer Relevance, Context Relevance, and Groundedness.


![metrics_diagram](images/metrics.png)
![metrics_diagram](https://raw.githubusercontent.com/epinzur/ragulate/main/images/metrics.png)

* Answer Correctness
* How well does the generated answer match the ground-truth answer?
Expand All @@ -28,7 +28,7 @@ The RAGulate currently reports 4 relevancy metrics: Answer Correctness, Answer R

The tool outputs results as images like this:

![example_output](images/example.png)
![example_output](https://raw.githubusercontent.com/epinzur/ragulate/main/images/example.png)

These images show distribution box plots of the metrics for different test runs.

Expand Down
2 changes: 1 addition & 1 deletion colbert_chunk_size_and_k.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@
keyspace = "colbert"

import logging

logging.basicConfig(level=logging.INFO)
logging.getLogger("unstructured").setLevel(logging.ERROR)
logging.getLogger("cassandra").setLevel(logging.ERROR)
logging.getLogger("http").setLevel(logging.ERROR)
logging.getLogger("httpx").setLevel(logging.ERROR)



def get_embedding_model(chunk_size: int) -> ColbertEmbeddingModel:
return ColbertEmbeddingModel(doc_maxlen=chunk_size, batch_size=batch_size)

Expand Down
19 changes: 17 additions & 2 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ tqdm = ">=4.66.1"
pyyaml = "^6.0.1"
cerberus = "^1.3.5"
pydantic = "^2.7.3"
setuptools = "^70.0.0"

[tool.poetry.group.dev.dependencies]
black = "^24.4.2"
Expand Down
2 changes: 2 additions & 0 deletions ragulate/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ def get_all_data(self, recipes: List[str]) -> DataFrame:
def output_plots_by_dataset(self, df: DataFrame, metrics: List[str]):
recipes = sorted(df["recipe"].unique(), key=lambda x: x.lower())
datasets = sorted(df["dataset"].unique(), key=lambda x: x.lower())
metrics = sorted(metrics)
metrics.reverse()

# generate an array of rainbow colors by fixing the saturation and lightness of the HSL
# representation of color and marching around the hue.
Expand Down
4 changes: 3 additions & 1 deletion scripts/test_integration_runner.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import pytest
import sys

import pytest


def main():
sys.exit(pytest.main(["tests/integration_tests"]))
4 changes: 3 additions & 1 deletion scripts/test_unit_runner.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import pytest
import sys

import pytest


def main():
sys.exit(pytest.main(["tests/unit_tests"]))

0 comments on commit 9a5c826

Please sign in to comment.