Spaces:
Sleeping
Sleeping
| import matplotlib.pyplot as plt | |
| # Evaluation Results | |
| evaluation_results = { | |
| "faithfulness": 0.0900, | |
| "answer_relevancy": 0.9609, | |
| "context_recall": 1.0000, | |
| "answer_correctness": 0.2689, | |
| "semantic_similarity": 0.7756 | |
| } | |
| # Convert dictionary to lists | |
| metrics = list(evaluation_results.keys()) | |
| values = list(evaluation_results.values()) | |
| # Generate Bar Chart | |
| plt.figure(figsize=(10, 5)) | |
| plt.bar(metrics, values, color='skyblue') | |
| plt.xlabel("Metrics") | |
| plt.ylabel("Scores") | |
| plt.ylim(0, 1) | |
| plt.title("Evaluation Metrics Bar Chart") | |
| plt.xticks(rotation=45) | |
| plt.grid(axis="y", linestyle="--", alpha=0.7) | |
| # Show the plot | |
| plt.show() | |