diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..b61b481 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,29 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Install uv + uses: astral-sh/setup-uv@v5 + with: + enable-cache: true + + - name: Set up Python + run: uv python install 3.11 + + - name: Install dependencies + run: uv sync + + - name: Lint (ruff) + run: uv run ruff check . + + - name: Tests (pytest) + run: uv run pytest -q diff --git a/README.md b/README.md index 95e25c9..6930ff0 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # RAG Article Query Filter +[![CI](https://github.com/filippopellizzari/RAG-ArticleQueryFilter/actions/workflows/ci.yml/badge.svg)](https://github.com/filippopellizzari/RAG-ArticleQueryFilter/actions/workflows/ci.yml) + A hybrid retrieval system for news articles that combines dense vector search and BM25 keyword matching, with a BERT-based toxicity gate on incoming queries. Built as a self-contained ML engineering project to demonstrate systematic retrieval experimentation, modular Python packaging, and production-ready API design. diff --git a/tests/test_retrieval.py b/tests/test_retrieval.py index 098eb3b..e47ab38 100644 --- a/tests/test_retrieval.py +++ b/tests/test_retrieval.py @@ -2,7 +2,6 @@ from unittest.mock import MagicMock -import pytest from llama_index.core.schema import NodeWithScore, TextNode from src.retrieval import make_hybrid_retrieval_fn, reciprocal_rank_fusion