王子睿
restructure + add files
8c10cf2
|
Raw
History Blame Contribute Delete
3.32 kB

SQLAssistant-A2A Evaluation Scripts

This directory contains evaluation scripts for analyzing the SQLAssistant-A2A project results across different language models.

Scripts

1. analyze_retry_patterns.py

Analyzes RETRY patterns in execution paths, including:

  • Orchestrator RETRY: Framework-level retries (e.g., crew_execution (retry N))
  • Business RETRY: Application-level retries (e.g., generate_sql (business_retry N))

Output Files:

  • retry_analysis.json - Detailed retry statistics
  • retry_summary.csv - Summary statistics by model
  • error_by_agent.csv - Error location statistics by agent
  • business_retry_chapters.csv - Business retry location statistics

Usage:

python3 analyze_retry_patterns.py

2. evaluate_scores.py

Collects and analyzes score statistics from execution logs.

Output Files:

  • score_analysis.json - Detailed score data
  • score_summary.csv - Summary statistics by model

Usage:

python3 evaluate_scores.py

3. evaluate_success.py

Calculates success rates based on whether required tools were executed.

Success Criteria: Execution of get_database_schema tool (required to understand database structure)

Output Files:

  • success_detailed_results.json - Detailed results by session
  • success_rate.csv - Success rate summary by model

Usage:

python3 evaluate_success.py

4. evaluate_trajectory-Filter_Tools.py

Evaluates execution trajectories using 6 metrics:

  1. Exact match - Complete trajectory match
  2. In-order match - Required steps appear in order
  3. Any-order match - All required steps present
  4. Precision - Correctness of predicted steps
  5. Recall - Coverage of required steps
  6. Single-tool use - Individual tool usage rates

Configuration:

  • Uses reference_trajectory.yaml for ground truth trajectory definition

Output Files:

  • evaluation_results.csv - Evaluation metrics by model
  • evaluation_results.md - Formatted results report
  • any_order_match_failures.csv - Failure analysis (with --diagnose-failures)

Usage:

python3 evaluate_trajectory-Filter_Tools.py --config reference_trajectory.yaml
python3 evaluate_trajectory-Filter_Tools.py --diagnose-failures  # With failure analysis

Configuration

reference_trajectory.yaml

Defines the ground truth execution trajectory for the SQLAssistant-A2A project, including:

  • Reference trajectory steps
  • Target tools for evaluation
  • Model list
  • Extract types (SPAN, Chain, Agent, LLM, Tool)

Models Evaluated

  • DeepSeek-R1
  • DeepSeek-V3-1
  • GPT-4o-mini
  • GPT-5
  • Gemini-2.5-flash
  • Gemini-2.5-flash-nothinking
  • Qwen3-235b

Data Structure

Scripts expect the following directory structure:

/Users/wzr/TOSEM-2025/RESULTS/
├── <model_name>/
│   └── SQLAssistant-A2A/
│       └── test_results/
│           ├── session_1/
│           │   ├── execution_path.md
│           │   └── execution_log.json
│           ├── session_2/
│           └── ...

Requirements

  • Python 3.x
  • pandas
  • PyYAML

Notes

  • All scripts automatically process all configured models
  • Results are saved in the same directory as the scripts
  • Scripts handle missing data gracefully and report warnings