File size: 1,049 Bytes
9681056
b91b0a5
9681056
 
 
 
 
 
 
 
92c9b4d
 
c429a2d
b91b0a5
92c9b4d
9681056
 
c429a2d
9681056
c429a2d
92c9b4d
c429a2d
92c9b4d
c429a2d
 
 
9681056
c429a2d
9681056
 
 
 
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
import sys
import argparse
from pathlib import Path

REPO_ROOT = Path(__file__).resolve().parents[1]
if str(REPO_ROOT) not in sys.path:
    sys.path.insert(0, str(REPO_ROOT))


def main():
    parser = argparse.ArgumentParser(description="Evaluate RAG with RAGAS")
    parser.add_argument("--samples", type=int, default=10, help="Number of samples (0 = all)")
    parser.add_argument("--mode", type=str, default="hybrid_rerank",
                        choices=["vector_only", "bm25_only", "hybrid", "hybrid_rerank", "all"],
                        help="Retrieval mode")
    args = parser.parse_args()
    
    from evaluation.ragas_eval import run_evaluation
    
    if args.mode == "all":
        # Run all retrieval modes
        print("\n" + "=" * 60)
        print("RUNNING ALL RETRIEVAL MODES")
        print("=" * 60)
        for mode in ["vector_only", "bm25_only", "hybrid", "hybrid_rerank"]:
            run_evaluation(args.samples, mode)
    else:
        run_evaluation(args.samples, args.mode)


if __name__ == "__main__":
    main()