Download src/evaluation/visualizations.py from pratik-250620/MultiModal-Coherence-AI: direct link, hf CLI and curl.
- Browser
- Download file 825 Bytes
-
https://huggingface.co/spaces/pratik-250620/MultiModal-Coherence-AI/resolve/main/src/evaluation/visualizations.py
- Command line
-
hf download hf://spaces/pratik-250620/MultiModal-Coherence-AI/src/evaluation/visualizations.py
-
curl -L -o visualizations.py https://huggingface.co/spaces/pratik-250620/MultiModal-Coherence-AI/resolve/main/src/evaluation/visualizations.py
825 Bytes
| from __future__ import annotations | |
| from typing import Dict, List | |
| import matplotlib.pyplot as plt | |
| def plot_distribution(values: List[float], title: str, xlabel: str) -> None: | |
| plt.figure(figsize=(6, 4)) | |
| plt.hist(values, bins=20) | |
| plt.title(title) | |
| plt.xlabel(xlabel) | |
| plt.ylabel("Count") | |
| plt.tight_layout() | |
| plt.show() | |
| def plot_msci_distributions(results: List[Dict]) -> None: | |
| plot_distribution( | |
| [result["msci"] for result in results], | |
| "MSCI Distribution (Gold v0)", | |
| "MSCI score", | |
| ) | |
| plot_distribution( | |
| [result["st_i"] for result in results], | |
| "Text–Image Similarity", | |
| "Cosine similarity", | |
| ) | |
| plot_distribution( | |
| [result["st_a"] for result in results], | |
| "Text–Audio Similarity", | |
| "Cosine similarity", | |
| ) | |