## Storyline

Ian has a problem.  

He's a hardworking student. But perhaps *too* hardworking. Every waking moment, he's either filling forms, writing essays, or drafting proposals.  

That means no time for rest. On the go, or even during meals, Ian types away on his tiny phone screen, thumbs mashing away imprecisely at the keyboard. Obviously, that won't do.

So Ian asks you for help. As an AI specialist, surely you can do something for him?  

---

## Problem Statement

Your task is to build an **autocorrect model**, to correct misspellings in text. Please note the **Architecture Restrictions** below.

---

## Input Format
- `train.csv`: This file contains your training data. We provide two columns:
  - `text`: The 'correct' text.
  - `misspell`: The text with errors.
- `test.csv`: This file contains the data to be inferenced during evaluation. Only the `misspell` column is provided.

## Output Format

Please submit a `.csv` file with **no header**, and items in the same order as in `test.csv`. Sample code is given below.

---

## Scoring Method

The performance of your model will be determined by **Character Error Rate (CER)**.  

CER is defined as `(S + D + I) / N`, where S is the number of substitutions, D is the number of deletions, I is the number of insertions, C is the number of correct characters, N is the number of characters in the reference. Thus, **a lower CER is better**, with 0 being the ideal.

The baseline solution in this notebook scores **0.0944**, rounded to four decimal places.

---

## Allowed Models / Architecture Restrictions

1. You **may not** use any pre-trained models. This includes direct use of API, fine-tuning open-source models, or any other AI model that is not trained from scratch within this notebook.
2. You **may not** train your model on the test samples in any way. This includes any unsupervised learning technique, calculating statistics over them etc.
3. Your model must run **CPU-only**, and evaluate all 2643 samples in `test.csv` within the time limit of 250s, according to the code in the evaluation section. (After all, Ian's mistyping on a phone, not a server with a T4!)

---

## Postscript by Ian

> *Psst, yo! Thanksf or helpung me witj fhis... if it hrlps i alywas **make errors in a somewhat predictable way, so try to run some statistics on my misspelled sentences!***  
> *also, sometim esmy boss makrs me dp **really really long documents**, sotry ofr rhat.*