File size: 2,703 Bytes
8c10cf2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# RecruitmentAssistant-MCP Evaluation Scripts

This directory contains evaluation scripts for analyzing the RecruitmentAssistant-MCP project results.

## Scripts

### 1. analyze_retry_patterns.py
Analyzes RETRY patterns in execution paths.

**Features:**
- Counts error occurrences by location and type
- Calculates RETRY rates per model
- Identifies maximum RETRY attempts
- Tracks errors by agent and node type

**Output:**
- `retry_analysis.json` - Detailed JSON results
- `retry_summary.csv` - Summary statistics
- `error_by_agent.csv` - Error breakdown by agent

**Usage:**
```bash
python3 analyze_retry_patterns.py
```

### 2. evaluate_success.py
Calculates success rates for each model.

**Success Criteria:**
- Reports folder exists
- Contains at least 2 markdown files

**Output:**
- `success_detailed_results.json` - Detailed results per session
- `success_rate.csv` - Success rate summary

**Usage:**
```bash
python3 evaluate_success.py
```

### 3. evaluate_trajectory.py
Evaluates trajectory metrics against reference trajectories.

**Metrics:**
- Exact match
- In-order match
- Any-order match
- Precision
- Recall
- Single-tool use
- Path diversity (unique path ratio, path entropy)

**Output:**
- `evaluation_results.csv` - Trajectory evaluation results

**Usage:**
```bash
python3 evaluate_trajectory.py --config reference_trajectory.yaml
```

### 4. reference_trajectory.yaml
Configuration file defining reference trajectories and evaluation parameters.

**Key Sections:**
- `reference_trajectory_3x` - Reference for 3 web searches
- `reference_trajectory_4x` - Reference for 4 web searches
- `target_tools` - Required tools for evaluation
- `models` - List of models to evaluate
- `permutable_tool_groups` - Tool groups that can appear in any order

## Configuration

Edit `reference_trajectory.yaml` to:
- Modify reference trajectories
- Add/remove models
- Adjust tool evaluation criteria
- Configure dynamic matching patterns

## Requirements

- Python 3.7+
- pandas
- pyyaml

Install dependencies:
```bash
pip install pandas pyyaml
```

## Data Structure

Expected directory structure:
```
/Users/wzr/TOSEM-2025/RESULTS/
├── ModelName/
│   └── RecruitmentAssistant-MCP/
│       └── test_results/
│           ├── session_1/
│           │   ├── execution_path.md
│           │   └── reports/
│           │       ├── file1.md
│           │       └── file2.md
│           └── session_2/
│               └── ...
```

## Notes

- All scripts output CSV files for easy analysis
- JSON files contain detailed per-session information
- Modify `BASE_DIR` in scripts if using a different results directory