# aannalysis
Code and data for the paper: "Language Models Learn Rare Phenomena from Less Rare Phenomena: The Case of the Missing AANNs"

## Requirements
All these are on pip

```
minicons
transformers
spacy
inflect
```

## Detailed Instructions
TBD

### Data generation

Run `bash scripts/generate_corpora.sh` to generate counterfactual corpora which involves settings like using NAANs and ANANs to replace AANNs.

Currently cleaning up to generate data to hold out precise hypotheses, since this currently requires huggingface uploads, which would violate anonymity policy.

### Training code

Once you have all the data generated (and uploaded to HF), run `bash scripts/train_lms.sh` (this only shows a subset of the 90 LMs we trained, but will be cleaned up and made streamlined once the huggingface dependency is sorted into a separate argument)

### Reproduce Plots

To reproduce plots in the paper, run code in `analysis/counterfactual_model_results.R`

