% ============================================================
%  ASR Results Table — ACL Template Compatible
%  Drop this into your ACL .tex file.
%
%  Add these to your preamble (acl.sty already loads many,
%  but add any that are missing):
%
%    \usepackage{booktabs}
%    \usepackage{multirow}
%    \usepackage{colortbl}
%    \usepackage{xcolor}
%    \usepackage{adjustbox}
%    \usepackage{array}
%    \usepackage{makecell}
%    \usepackage{fontawesome5}
%
%  NOTE: Use \begin{table*} so it spans both ACL columns.
%  NOTE: Do NOT include \documentclass, \geometry, or
%        \pagestyle — those are already in the ACL template.
% ============================================================

% ── Paste these colour/macro definitions in your PREAMBLE ───

% ── Error-level cell colours (commented out — uncomment to re-enable) ────────
%\definecolor{cellgreen1}{HTML}{D6F5D6}
%\definecolor{cellgreen2}{HTML}{A8E6A8}
%\definecolor{cellyellow}{HTML}{FFF3CD}
%\definecolor{cellorange1}{HTML}{FFDAB9}
%\definecolor{cellred1}  {HTML}{FFBDBD}
%\definecolor{cellred2}  {HTML}{FF8C8C}

% ── Metric label colours ─────────────────────────────────────
\definecolor{wercol}{HTML}{D64045}
\definecolor{cercol}{HTML}{1A73E8}

% ── Continent row-tint colours (very desaturated pastels) ────
\definecolor{tintAfrica}  {HTML}{FFF5E6}   % warm sand
\definecolor{tintAmericas}{HTML}{F0FFF0}   % pale mint
\definecolor{tintAsia}    {HTML}{F0F4FF}   % cool lavender-blue
\definecolor{tintEurope}  {HTML}{FDF0FF}   % soft lilac

% ── Error-level macros ───────────────────────────────────────
%  Currently no-ops — cell colours disabled.
%  To re-enable: uncomment the \cellcolor lines and comment out the plain ones.
%\newcommand{\gc}[1]{\cellcolor{cellgreen1}#1}
%\newcommand{\gmc}[1]{\cellcolor{cellgreen2}#1}
%\newcommand{\yc}[1]{\cellcolor{cellyellow}#1}
%\newcommand{\oc}[1]{\cellcolor{cellorange1}#1}
%\newcommand{\rc}[1]{\cellcolor{cellred1}#1}
%\newcommand{\rrc}[1]{\cellcolor{cellred2}#1}
\newcommand{\gc}[1]{#1}
\newcommand{\gmc}[1]{#1}
\newcommand{\yc}[1]{#1}
\newcommand{\oc}[1]{#1}
\newcommand{\rc}[1]{#1}
\newcommand{\rrc}[1]{#1}

% ── Metric labels ─────────────────────────────────────────────
\newcommand{\wer}{{\color{wercol}\textbf{W}}}
\newcommand{\cer}{{\color{cercol}\textbf{C}}}

\newcommand{\bestW}[1]{{\textbf{#1}}}   % red underline bold
\newcommand{\bestC}[1]{{\underline{#1}}}   % blue underline bold

% ── Continent section-header macro ───────────────────────────
% Pre-mix darker continent label colours
\colorlet{africaLabel}  {tintAfrica!70!black}
\colorlet{americasLabel}{tintAmericas!70!black}
\colorlet{asiaLabel}    {tintAsia!70!black}
\colorlet{europeLabel}  {tintEurope!70!black}

% Hardcoded continent label macros — no argument colour-passing needed
\newcommand{\clabelAfrica}[2]{%
  \rowcolor{tintAfrica!60}%
  \multicolumn{12}{l}{ \normalsize\textit\textbf{{\color[HTML]{8B5E00}#1\;#2}}}\\[2pt]
}
\newcommand{\clabelAmericas}[2]{%
  \rowcolor{tintAmericas!60}%
  \multicolumn{12}{l}{ \normalsize\textit\textbf{{\color[HTML]{1A6B1A}#1\;#2}}}\\[2pt]
}
\newcommand{\clabelAsia}[2]{%
  \rowcolor{tintAsia!60}%
  \multicolumn{12}{l}{ \normalsize\textit\textbf{{\color[HTML]{1A3D8B}#1\;#2}}}\\[2pt]
}
\newcommand{\clabelEurope}[2]{%
  \rowcolor{tintEurope!60}%
  \multicolumn{12}{l}{ \normalsize\textbf\textit{{\color[HTML]{6B1A8B}#1\;#2}}}\\[2pt]
}
% ── End of preamble definitions ─────────────────────────────


% ── Table (place in your document body) ─────────────────────

\begin{table*}[h]
\centering
\setlength{\tabcolsep}{4.5pt}       % slightly more breathing room between columns
\renewcommand{\arraystretch}{1.22}  % a touch more vertical padding per row

% Colour legend above the table
\noindent
{\footnotesize
% Error-level legend (commented out — uncomment to re-enable alongside cell colours):
%\textbf{Error level:}\;
%\fcolorbox{gray}{cellgreen2}{\rule{0pt}{5pt}\rule{6pt}{0pt}}~$<$20\%\;
%\fcolorbox{gray}{cellgreen1}{\rule{0pt}{5pt}\rule{6pt}{0pt}}~20--40\%\;
%\fcolorbox{gray}{cellyellow}{\rule{0pt}{5pt}\rule{6pt}{0pt}}~40--60\%\;
%\fcolorbox{gray}{cellorange1}{\rule{0pt}{5pt}\rule{6pt}{0pt}}~60--80\%\;
%\fcolorbox{gray}{cellred1}{\rule{0pt}{5pt}\rule{6pt}{0pt}}~80--100\%\;
%\fcolorbox{gray}{cellred2}{\rule{0pt}{5pt}\rule{6pt}{0pt}}~$>$100\%\quad
\textbf{Region:}\;
\fcolorbox{gray}{tintAfrica}{\rule{0pt}{5pt}\rule{6pt}{0pt}}~Africa\;
\fcolorbox{gray}{tintAmericas}{\rule{0pt}{5pt}\rule{6pt}{0pt}}~Americas\;
\fcolorbox{gray}{tintAsia}{\rule{0pt}{5pt}\rule{6pt}{0pt}}~Asia/Pacific\;
\fcolorbox{gray}{tintEurope}{\rule{0pt}{5pt}\rule{6pt}{0pt}}~Europe
}\\[4pt]

\adjustbox{max width=\textwidth}{%
\begin{tabular}{
  p{2.2cm}c
  |
  >{\small$}c<{$} >{\small$}c<{$}   % MMS  w/o LM
  >{\small$}c<{$} >{\small$}c<{$}   % MMS  w/  LM
  |
  >{\small$}c<{$} >{\small$}c<{$}   % XLSR w/o LM
  >{\small$}c<{$} >{\small$}c<{$}   % XLSR w/  LM
  |
  >{\small$}c<{$} >{\small$}c<{$}   % Whisper
}
\toprule

% ── Row 1: Model super-headers ───────────────────────────────
\multicolumn{2}{c|}{\faLanguage\ \small\textbf{Languages}} &
\multicolumn{4}{c|}{\small\faMicrophone\ \textbf{MMS-1B-All}} &
\multicolumn{4}{c|} {\small\faWaveSquare\ \textbf{XLS-R-1B}} &
\multicolumn{2}{c}{\small\faLayerGroup\ \textbf{Whisper Large-v3}}\\

% ── Row 2: Decoding condition bands (framed with hlines) ─────
\hline
& &
\multicolumn{2}{c}{\small\textbf{w/o LM}} &
\multicolumn{2}{c|}{\small\textbf{w/ LM}} &
\multicolumn{2}{c}{\small\textbf{w/o LM}} &
\multicolumn{2}{c} {\small\textbf{w/ LM}} &
\multicolumn{2}{c}{\small\textbf{Full fine-tuning}}\\
\hline

% ── Row 3: WER / CER metric labels ───────────────────────────
{\small\textbf{Language}} & {\small \textbf{\makecell[c]{ISO 639\\[-2pt]Code}}} &
{\small\wer} & {\small\cer} & {\small\wer} & {\small\cer} &
{\small\wer} & {\small\cer} & {\small\wer} & {\small\cer} & {\small\wer} & {\small\cer} \\

\midrule

% ════════════════════════════════════════════════════════════
%  DATA ROWS — grouped by continent, sorted alphabetically within.
%  Column order per model:
%    w/o LM WER | w/o LM CER | w/ LM WER | w/ LM CER
% ════════════════════════════════════════════════════════════

% ── Africa (11 languages) ────────────────────────────────────
\clabelAfrica  {\faGlobeAfrica}  {Africa}
\rowcolor{tintAfrica}
Bukusu           & \texttt{bxk} &
  \rc{0.520} & \oc{0.148} & \rc{\bestW{0.512}} & \oc{\bestC{0.147}} &
  \rc{0.688}      & \oc{0.191}      & \rc{0.684} & \oc{0.198}      & \rc{0.544} & \oc{0.179} \\
\rowcolor{tintAfrica}
Chiga            & \texttt{cgg} &
  \rc{\bestW{0.473}} & \oc{\bestC{0.118}} & \rc{0.475} & \oc{0.122} &
  \rc{0.759}      & \oc{0.230}      & \rc{0.749} & \oc{0.222}    & \rc{0.544} & \oc{0.168}  \\
\rowcolor{tintAfrica}
Nubi             & \texttt{kcn} &
  \rc{0.625} & \oc{0.292} & \rc{0.622} & \oc{0.288} &
  \rc{0.588}      & \oc{\bestC{0.285}}      & \rc{\bestW{0.570}} & \oc{0.325}    & \rc{1.057} & \oc{0.725}  \\
\rowcolor{tintAfrica}
Konzo            & \texttt{koo} &
  \rc{0.682} & \oc{\bestC{0.175}} & \rc{0.686} & \oc{0.185} &
  \rc{0.844}      & \oc{0.237}      & \rc{0.840} & \oc{0.302}    & \rc{\bestW{0.642}} & \oc{0.194}  \\
\rowcolor{tintAfrica}
Lendu            & \texttt{led} &
  \rc{0.358} & \oc{0.130} & \rc{0.348} & \oc{0.127} &
  \rc{0.322}      & \oc{0.120}      & \rc{0.318} & \oc{\bestC{0.120}}    & \rc{\bestW{0.312}} & \oc{0.133}  \\
\rowcolor{tintAfrica}
Kenyi            & \texttt{lke} &
  \rc{\bestW{0.553}} & \oc{0.140} & \rc{0.556} & \oc{\bestC{0.139}} &
  \rc{0.815}      & \oc{0.256}      & \rc{0.783} & \oc{0.254}    & \rc{0.586} & \oc{0.172}  \\
\rowcolor{tintAfrica}
Thur             & \texttt{lth} &
  \rc{1.001} & \oc{0.771} & \rc{0.999} & \oc{ 0.780} &
  \rc{0.364}      & \oc{\bestC{0.156}}      & \rc{0.362} & \oc{0.159}    & \rc{\bestW{0.344}} & \oc{0.167}  \\
\rowcolor{tintAfrica}
Ruuli            & \texttt{ruc} &
  \rc{0.589} & \oc{0.137} & \rc{\bestW{0.583}} & \oc{\bestC{0.136}} &
  \rc{0.697}      & \oc{0.187}      & \rc{0.689} & \oc{0.218}    & \rc{0.634} & \oc{0.212}  \\
\rowcolor{tintAfrica}
Amba             & \texttt{rwm} &
  \rc{0.603} & \oc{0.197} & \rc{0.594} & \oc{\bestC{0.195}} &
  \rc{0.561}      & \oc{0.195}      & \rc{\bestW{0.557}} & \oc{0.205}    & \rc{0.572} & \oc{0.243}  \\
\rowcolor{tintAfrica}
Rutoro           & \texttt{ttj} &
  \rc{0.242} & \oc{0.043} & \rc{\bestW{0.241}} & \oc{\bestC{0.043}} &
  \rc{0.349}      & \oc{0.063}      & \rc{0.347} & \oc{0.064}    & \rc{0.287} & \oc{0.092}  \\
\rowcolor{tintAfrica}
Kuku             & \texttt{ukv} &
  \rc{0.422} & \oc{0.133} & \rc{0.415} & \oc{0.131} &
  \rc{0.394}      & \oc{0.127}      & \rc{\bestW{0.381}} & \oc{\bestC{0.124}}    & \rc{0.438} & \oc{0.161}  \\
\addlinespace[2pt]
\midrule

% ── Americas (5 languages) ───────────────────────────────────
\clabelAmericas{\faGlobeAmericas}{Americas}
\rowcolor{tintAmericas}
Wix\'{a}rika     & \texttt{hch} &
  \rrc{0.677}& \rc{0.161} & \rrc{0.673}& \rc{0.160} &
  \rrc{0.560}     & \rrc{0.130}     & \rrc{0.551}& \rrc{\bestC{0.130}}  & \rrc{\bestW{0.520}}& \rrc{0.155}\\
\rowcolor{tintAmericas}
{\makecell[tl]{\small Southwestern\\[-4pt]\small Tlaxiaco Mixtec}} & \texttt{meh} &
  \rrc{0.423}& \rc{0.170} & \rrc{\bestW{0.420}}& \rc{\bestC{0.169}} &
  \rrc{0.445}     & \rrc{0.183}     & \rrc{0.436}& \rrc{0.178}  & \rrc{0.631}& \rrc{0.476}\\
\rowcolor{tintAmericas}
{\makecell[tl]{\small Michoacán\\[-4pt]\small Mazahua}}   & \texttt{mmc} &
  \rrc{0.764}& \rc{0.332} & \rrc{0.765}& \rc{1.121} &
  \rrc{0.715}     & \rrc{\bestC{0.297}}     & \rrc{\bestW{0.715}}& \rrc{0.946}  & \rrc{0.847}& \rrc{0.625}\\
\rowcolor{tintAmericas}
Toba Qom         & \texttt{tob} &
  \rrc{0.595}& \rc{\bestC{0.194}} & \rrc{\bestW{0.595}}& \rc{0.413} &
  \rrc{0.657}     & \rrc{0.203}     & \rrc{0.653}& \rrc{0.338}  & \rrc{0.631}& \rrc{0.286}\\
\rowcolor{tintAmericas}
\small Papantla Totonac & \texttt{top} &
  \rrc{0.639}& \rc{0.157} & \rrc{\bestW{0.638}}& \rc{\bestC{0.155}} &
  \rrc{1.000}     & \rrc{0.969}     & \rrc{1.623}& \rrc{0.998}  & \rrc{0.974}& \rrc{0.611}\\
\addlinespace[2pt]
\midrule

% ── Asia / Pacific (2 languages) ─────────────────────────────
\clabelAsia    {\faGlobeAsia}    {Asia \& Pacific}
\rowcolor{tintAsia}
Betawi           & \texttt{bew} &
  \rc{0.499} & \oc{0.171} & \rc{\bestW{0.494}} & \oc{\bestC{0.170}} &
  \rc{0.778}      & \rc{0.305}      & \rc{0.763} & \rc{0.297}    & \rc{0.515} & \rc{0.304} \\
\rowcolor{tintAsia}
{\makecell[tl]{\small Western \small Penan}}    & \texttt{pne} &
  \rc{0.348} & \oc{0.127} & \rc{0.342} & \oc{0.125} &
  \rc{0.380}      & \rc{0.151}      & \rc{0.366} & \rc{0.146}  & \rc{\bestW{0.280}} & \rc{\bestC{0.123}}  \\
\addlinespace[2pt]
\midrule

% ── Europe (3 languages) ƒ─────────────────────────────────────
\clabelEurope  {\faGlobeEurope}  {Europe}
\rowcolor{tintEurope}
\small Gheg Albanian    & \texttt{aln} &
  \rc{0.616} & \oc{0.275} & \rc{0.607} & \oc{0.273} &
  \rrc{0.813}     & \rc{0.371}      & \rrc{0.762}& \rc{0.343}     & \rrc{\bestW{0.474}}& \rc{\bestC{0.253}} \\
\rowcolor{tintEurope}
Cypriot Greek    & \texttt{el-CY} &
  \rc{0.464} & \oc{0.144} & \rc{0.458} & \oc{\bestC{0.141}} &
  \rrc{0.922}     & \rc{0.392}      & \rrc{0.924}& \rc{0.480}  & \rrc{\bestW{0.456}}& \rc{0.260}  \\
\rowcolor{tintEurope}
Scots            & \texttt{sco} &
  \rc{0.306} & \oc{0.113} & \rc{0.300} & \oc{\bestC{0.111}} &
  \rrc{0.302}     & \rc{0.115}      & \rrc{\bestW{0.297}}& \rc{0.113}  & \rrc{0.460}& \rc{0.339}  \\
\addlinespace[2pt]
\midrule

% ── Average row ─────────────────────────────────────────────
\addlinespace[2pt]
\rowcolor{white}
\multicolumn{2}{l|}{\textbf{\faChartBar\ Average}} &
  \textbf{\oc{}} & \textbf{\oc{}} & \textbf{\oc{}} & \textbf{\oc{}} &
  \textbf{\rc{}} & \textbf{\rc{}} & \textbf{\rc{}} & \textbf{\rc{}} & \textbf{\rc{0.559}} & \textbf{\rc{0.280}} \\

\bottomrule
\end{tabular}
}% end adjustbox

\caption{%
  Word Error Rate (\wer) and Character Error Rate (\cer) of
  \textbf{MMS-1B-All}, \textbf{XLS-R-1B}, and \textbf{Whisper-large-v3} fine-tuned on 21 low-resource
  languages from the Mozilla Common Voice Spontaneous Speech Shared Task, rounded to three decimal places.
  Results are reported without (\textbf{w/o}) and with (\textbf{w/}) language model decoding for \textbf{MMS-1B-All} and \textbf{XLS-R-1B}.
  Lowest \texttt{WER} is \textbf{emboldened} and lowest \texttt{CER} is \underline{underlined} for each language. Ties are broken by fourth decimal place comparison.
  Row tints indicate geographic region:
  {\protect\colorbox{tintAfrica}{\strut\,Africa\,}},
  {\protect\colorbox{tintAmericas}{\strut\,Americas\,}},
  {\protect\colorbox{tintAsia}{\strut\,Asia/Pacific\,}},
  {\protect\colorbox{tintEurope}{\strut\,Europe\,}}. lr = 1e-3, epochs = 15, batch size = 2, grad accumulation steps = 8.
}
\label{tab:asr-results}
\end{table*}