Title: Legal Citation Text Classification Challenge

Problem statement
Build a model that predicts the citation treatment outcome for Australian Federal Court case excerpts. Given the case title (with formal citations) and a textual excerpt from the judgment, your task is to assign the correct citation treatment class. This is a multi-class single-label text classification problem reflecting nuanced, expert legal language and long-form text.

Data description
- train.csv: Training set with columns
  - id: An anonymized identifier (e.g., LCC000123)
  - case_title: Case title and formal citation string
  - case_text: Extracted legal text excerpt
  - case_outcome: Target label (citation treatment class)
- test.csv: Test set with the same columns as train.csv except without case_outcome
- sample_submission.csv: A valid example submission with randomized labels drawn from the test label set

Notes on labels
- The label space consists of citation treatment classes (e.g., cited, applied, followed, distinguished, overruled, considered, reversed, etc.).
- Labels are case-sensitive strings. Predict exactly one label per id.
- All labels that appear in the test set also appear at least once in the training set.

Split policy
- The data are split approximately 80/20 (train/test) with stratification by class to maintain label distribution and ensure that every test label appears in training.
- Ids are anonymized to avoid any unintended leakage. Do not rely on filenames or external paths; only use the provided CSV content.

Evaluation
- Metric: Macro-averaged F1 across the ground-truth classes present in the test set.
  - For each class c in the test set, compute precision_c and recall_c from the confusion counts.
  - F1_c = 2 * precision_c * recall_c / (precision_c + recall_c), with F1_c = 0 when (precision_c + recall_c) = 0.
  - The final score is the unweighted mean of F1_c across all classes present in the test ground truth.
- This macro F1 emphasizes balanced performance across both frequent and rare legal outcomes.

Submission format
- A single CSV file with exactly two columns and a header row:
  - id
  - case_outcome
- Requirements:
  - Include exactly the ids from the test set, each appearing once.
  - The header must be: id,case_outcome
  - No missing values.
  - All predicted labels must be valid class strings from the training label space (case-sensitive).

Modeling guidance (non-exhaustive)
- Text preprocessing: lowercasing vs. cased models, punctuation/number handling, tokenization, optional lemmatization or subword tokenization; strategies for very long texts (chunking, truncation, summarization).
- Feature engineering: word and character n-grams with TF-IDF; domain-adapted stopword handling; features from case_title; pretrained word vectors (e.g., GloVe/fastText);
  transformer encoders (e.g., BERT/LegalBERT) with long-sequence handling.
- Modeling: strong linear baselines (logistic regression/SGD) on TF-IDF; tree-based models; BiLSTM/CNN; fine-tuned transformers with appropriate max sequence length; ensembling and calibration.
- Evaluation: stratified cross-validation; per-class error analysis; confusion-pair inspection (e.g., followed vs. applied).

Files provided
- train.csv
- test.csv
- sample_submission.csv

Additional guidance
- The class distribution is imbalanced; macro F1 will reward improvements on minority classes.
- Pay attention to formal citation patterns and discourse cues in the text (e.g., phrases like "applied", "distinguished", "followed"). Combining title and excerpt features helps.
- There is no runtime constraint in this competition; large models and thorough experimentation are welcome.
