Skip to content

Instantly share code, notes, and snippets.

@brendano
Created January 8, 2025 21:29
Show Gist options
  • Save brendano/02091efe3aaf1fc8e776aeb92c4e9453 to your computer and use it in GitHub Desktop.
Save brendano/02091efe3aaf1fc8e776aeb92c4e9453 to your computer and use it in GitHub Desktop.
% booktabs example for hierarchical columns
% for Table 2 of
% https://aclanthology.org/2021.findings-acl.371.pdf
% halterman, keith, sarwar, o'connor, 2021
% leaving out some stuff
% just the 'tabular' environ
% the minipage stuff is irrelevant it was just for a two column thing
\setlength{\tabcolsep}{5pt} %% BTO: i think this controls spacing between columns. https://www.overleaf.com/learn/latex/Questions/How_do_I_change_column_or_row_separation_in_LaTeX_tables%3F
% \newcommand{\ap}{AP ($\uparrow$)}
% \newcommand{\pr}{PR ($\downarrow$)}
\newcommand{\fscore}{{\footnotesize F1 $\uparrow$}}
\newcommand{\ap}{{\footnotesize AP $\uparrow$}}
\newcommand{\pr}{{\footnotesize PR $\downarrow$}}
\newcommand{\mae}{{\footnotesize MAE $\downarrow$}}
\newcommand{\myrho}{{\footnotesize $\rho\uparrow$}}
\begin{figure*}[h!] %https://tex.stackexchange.com/questions/271347/minipage-across-two-columns
\noindent\begin{minipage}{\linewidth}
\centering
\begin{tabular}{l cc cccccc cc}
% \toprule
& \multicolumn{2}{c}{\textit{Task 1: Sent.\ Cls.}}
& \multicolumn{6}{c}{\textit{Task 2: Document Ranking}}
& \multicolumn{2}{c}{\textit{Task 3: Temp. Aggs.}}\\
\cmidrule(lr){2-3} \cmidrule(lr){4-9} \cmidrule(lr) {10-11}
& \multirow{1}{*}{Keyw.}
& \multirow{1}{*}{\shortstack[l]{R+MNLI}}
& \multicolumn{2}{c}{
\multirow{1}{*}{BM25}}
& \multicolumn{2}{c}{
\multirow{1}{*}{\shortstack[l]{E+MSM}} }
& \multicolumn{2}{c}{
\multirow{1}{*}{\shortstack[l]{R+MNLI}}}
& Keyw.
& R+MNLI
\\
% &&&&&&& \\
Event Class & \fscore & \fscore & \ap& \pr & \ap & \pr & \ap& \pr & \myrho & \myrho \\
\cmidrule(r){1-1}
\cmidrule(lr){2-2}
\cmidrule(lr){3-3}
\cmidrule(lr){4-5}
\cmidrule(lr){6-7}
\cmidrule(lr){8-9}
\cmidrule(lr){10-10}
\cmidrule(lr){11-11}
%\cmidrule(lr){12-13}
{\small \killLabel} &0.50&\textbf{0.74}&0.30&0.29&0.65&0.27&\textbf{0.96}&\textbf{0.05}& 0.70 & \textbf{0.78}\\
{\small \arrestLabel} &0.48&\textbf{0.62}&0.68&0.36&0.72&0.67&\textbf{0.91}&\textbf{0.17} & 0.71 & \textbf{0.85}\\
{\small \failLabel} &0.05&\textbf{0.48}&0.27&0.77&0.36&0.87&\textbf{0.63}&\textbf{0.76} & 0.42 & \textbf{0.60}\\
{\small \forceLabel} &\textbf{0.65}&0.62&0.24&0.43&0.64&0.45&\textbf{0.90}&\textbf{0.20}& \textbf{0.89} & 0.86\\
{\small \allLabel} &\textbf{0.67}&0.57&0.53&0.85&0.83&0.88&\textbf{0.89}&\textbf{0.62}& 0.86 & \textbf{0.90}\\
\bottomrule
\end{tabular}
%%%%%%%%%%%%%%%
\captionof{table}{ Evaluation of two classification methods (Keyw., R+MNLI) and three ranking models (BM25, E+MSM, R+MNLI) for \textsc{IndiaPoliceEvents}'s three tasks. Bolded numbers indicate the model that performs best on each metric and event class. \textbf{Task 1} evaluates sentence-level F1 for sentence-level keyword matching (Keyw.) and RoBERTa fine-tuned on MNLI (R+MNLI) \cite{liu2019roberta}. \textbf{Task 2} evaluates average precision (AP) and proportion of the corpus needed to be read in order to achieve 95\% recall (PR, or PropRead@Recall95) for ranking models BM25 \cite{anserini}, off-the-shelf ELECTRA language model fine-tuned on MS MARCO (E+MSM; \cite{reimers2019sentence}), as well as R+MNLI's probabilistic output. \textbf{Task 3} evaluates Spearman's rank correlation coefficient ($\rho$) between predicted versus gold-standard counts of documents with the relevant event, for each day in March 2002.
For each metric, we indicate whether a higher ($\uparrow$) or lower ($\downarrow$) score is better. \label{t:results-big-table}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment