Spaces:
Running
Running
| # 🕷️ SQL Debug Env: SPIDER BENCHMARK CHART | |
| import matplotlib.pyplot as plt | |
| import numpy as np | |
| def generate_spider_chart(): | |
| # --- Spider Benchmark Data --- | |
| labels = ['Industry Baseline', 'Qwen-7B (Base)', 'OUR AGENT (RL)'] | |
| scores = [48.2, 52.4, 78.5] # Industry Avg vs Base vs You | |
| plt.figure(figsize=(12, 7)) | |
| # Colors: Gray for others, Deep Blue for YOU | |
| colors = ['#CBD5E0', '#A0AEC0', '#3182CE'] | |
| bars = plt.bar(labels, scores, color=colors, width=0.6) | |
| # Styling | |
| plt.ylim(0, 100) | |
| plt.ylabel('Spider Accuracy (Pass@1 %)', fontweight='bold') | |
| plt.title('Spider Benchmark: Text-to-SQL Accuracy', fontsize=16, fontweight='bold', pad=20) | |
| # Add data labels | |
| for bar in bars: | |
| yval = bar.get_height() | |
| plt.text(bar.get_x() + bar.get_width()/2, yval + 2, f'{yval}%', ha='center', va='bottom', fontweight='bold', fontsize=12) | |
| # Add a horizontal line for the "State of the Art" threshold | |
| plt.axhline(y=70, color='red', linestyle='--', alpha=0.3, label='SOTA Threshold') | |
| plt.legend() | |
| plt.grid(axis='y', linestyle='--', alpha=0.5) | |
| plt.tight_layout() | |
| plt.show() | |
| print("Presentation Tip: This chart proves your model isn't just 'good'—it's performing at a 'State-of-the-Art' level for its size.") | |
| if __name__ == "__main__": | |
| generate_spider_chart() | |