/py-crf

A naive implementation of simple linear chain CRF using NumPy

Primary LanguagePython

Conditional Random Field

This is an implementation of a simple CRF using NumPy. The model was trained and tested on OCR, a dataset for handwritten words.

Dataset

http://ai.stanford.edu/~btaskar/ocr/letter.data.gz

Usage

./download.sh
python3 main.py

Configurations

Train/Val/Test split: 5502/688/687
Learning rate: 0.001
Num epochs: 200

Result

Validation accuracy: 83.81%
Test accuracy: 83.29%