chrisjcc's picture
Update readme
f30d422
|
Raw
History Blame Contribute Delete
2.22 kB
# Evaluation Suite
This directory contains a modular evaluation framework for the Fraud Model Explainability Assistant, built using the Strands Evaluation SDK while maintaining Langfuse + OpenTelemetry integration.
## Structure
```
evals/
β”œβ”€β”€ __init__.py # Package initialization
β”œβ”€β”€ config.py # Shared evaluator configurations
β”œβ”€β”€ task_functions.py # Agent wrapper functions
β”œβ”€β”€ langfuse_reporter.py # Langfuse integration
β”œβ”€β”€ dataset_loader.py # JSON to Case conversion
β”œβ”€β”€ generate_experiment.py # SDK Experiment Generator
β”œβ”€β”€ run_helpfulness.py # Helpfulness evaluation
β”œβ”€β”€ run_trajectory.py # Trajectory evaluation
└── run_full_suite.py # Full evaluation suite
```
## Usage
### Run Individual Evaluations
```bash
# Helpfulness only
python -m evals.run_helpfulness
# Trajectory only
python -m evals.run_trajectory
```
### Run Full Suite
```bash
# All evaluators (Helpfulness, Faithfulness, Trajectory, Goal Success)
python -m evals.run_full_suite
```
### Generate Synthetic Data
```bash
# Generate new test cases using SDK ExperimentGenerator
python -m evals.generate_experiment
```
## Features
- **SDK-Aligned**: Uses `Experiment.run_evaluations()` framework
- **Modular**: Each evaluation type in separate file
- **Langfuse Integration**: Automatic score logging with trace correlation
- **OpenTelemetry**: Full observability stack integration
- **Extensible**: Easy to add new evaluators or metrics
## Evaluators
1. **Helpfulness** (`OutputEvaluator`): Rates answer quality (accuracy, completeness, clarity)
2. **Faithfulness** (`OutputEvaluator`): Verifies answer is grounded in retrieved context
3. **Trajectory** (`TrajectoryEvaluator`): Checks tool usage sequence
4. **Goal Success** (Heuristic): Matches expected key points in answer
## Comparison with `evaluate.py`
The modular suite provides the same functionality as the monolithic `evaluate.py` but with:
- βœ… Better code organization
- βœ… SDK-standard patterns
- βœ… Easier to extend with new evaluators
- βœ… Built-in reporting (`report.run_display()`, `get_summary()`)
- βœ… Maintains Langfuse + OTel integration