Skip to content
svgtext-metric-scores

Generated-text scores per row

How do overlap scores spread across rows, metric by metric (and system by system)?

Demo data · seed 20261101 · 400 rows · default settings · 640 × 360SVG, lightSVG, darkDemo CSV

How to read it

  1. Read each column as one metric: dots are rows, the box spans the middle half and the thick line is the median.
  2. Compare systems side by side within a metric; the spread shows how uneven the outputs are.
  3. Look for rows scoring near zero: they often hold a correct answer worded differently, or a real failure worth reading.
  1. Callout 1: A box: the middle half of the rows for one metric and system.
  2. Callout 2: Low-scoring rows worth reading.
  3. Callout 3: Systems side by side within a metric.

Watch out

  • Corpus BLEU pools counts across rows, so it is not the median or mean of these dots.
  • Overlap metrics reward wording, not meaning; read a sample of the outputs before deciding.

Defaults

No settings: the chart draws one way.

Pinned in the code

  • Draws what the Python or R engine computed; the chart computes nothing statistical.
  • Row-level BLEU uses the effective n-gram order and exponential smoothing (sacreBLEU's sentence_bleu); corpus BLEU pools n-gram counts and is not the mean of these dots.
  • Boxes show the type-7 quartiles and the median; horizontal jitter is a fixed hash of the row, so the picture is the same every time.
  • Overlap metrics reward shared wording: a correct paraphrase can score low, so read the spread beside a human or LLM-as-judge review.
# Generated-text scores per row — Codesplash Chart Lab (recipe "text-metric-scores")
# controls: defaults
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt

try:
    import codesplash as cs  # optional: the app's chart theme
except ImportError:
    cs = None
if cs:
    cs.use_codesplash(dark=False)
PALETTE = cs.palette(dark=False)["categorical"] if cs else plt.rcParams["axes.prop_cycle"].by_key()["color"]

df = pd.read_csv("text-metric-scores-demo.csv", keep_default_na=False, na_values=[""])  # demo data (only empty cells are missing): Chart Lab → Code → Download demo CSV
df["metric"] = pd.Categorical(df["metric"].astype("string"), categories=["BLEU", "chrF", "ROUGE-1", "ROUGE-2", "ROUGE-L"])
df["system"] = pd.Categorical(df["system"].astype("string"), categories=["baseline", "fine-tuned"])

_tokens = cs.palette(dark=False) if cs else {}
SEQ = _tokens.get("sequential", ["#eff6fd", "#1a469d"])  # sequential ramp (low → high)
DIV = _tokens.get("diverging", ["#c13e2e", "#f3f5f8", "#0859ac"])  # negative, midpoint, positive
REF = _tokens.get("reference", "#4e5661")
GREY = _tokens.get("dim", "#ced1d6")
def levels_of(s):
    """Declared level order (categoricals), else order of first appearance."""
    if isinstance(s.dtype, pd.CategoricalDtype):
        return [v for v in s.cat.categories if (s == v).any()]
    return list(dict.fromkeys(s.dropna().astype(str)))
M = "metric"
SCORE = "score"
SYS = "system"
d = df.dropna(subset=[M, SCORE])
metrics = levels_of(d[M])
systems = levels_of(d[SYS]) if SYS else [None]
rng = np.random.default_rng(1)  # the app uses a fixed hash; any fixed jitter shows the same spread
fig, ax = plt.subplots(figsize=(8, 4.5))
slot = 0.8 / len(systems)
for j, s in enumerate(systems):
    for i, m in enumerate(metrics):
        v = d.loc[(d[M].astype(str) == m) & ((d[SYS].astype(str) == str(s)) if SYS else True), SCORE].to_numpy()
        if not len(v):
            continue
        x = i - 0.4 + slot * (j + 0.5)
        ax.scatter(x + (rng.random(len(v)) - 0.5) * slot * 0.7, v, s=8, alpha=0.35, color=PALETTE[j % len(PALETTE)], label=s if i == 0 else None)
        ax.boxplot([v], positions=[x], widths=slot * 0.5, showfliers=False, whis=0, medianprops=dict(color="black"))
ax.set_xticks(range(len(metrics)), metrics)
ax.set_ylim(0, 100)
ax.set_ylabel("score (0–100)")
if SYS:
    ax.legend(title=SYS, fontsize=8)
ax.set_title("Score of each row, by metric")
plt.show()

Needs pandas, numpy, matplotlib · reads text-metric-scores-demo.csv · app theme from the optional codesplash helper