This repository contains source code for NAACL2022 main conference Dynamic Programming in Rank Space: Scaling Structured Inference with Low-Rank HMMs and PCFGs
- Code for scaling low-rank structured inference with HMMs in rank-hmms.
- Code for scaling low-rank structured inference with PCFGs in rank-pcfgs, which has been merged into TN-PCFG. More details can be seen in it.
pip install -r requirement.txt
If your running environment supports internet connection, you can just run the train. Then corresponding dataset will be downloaded automatically.
Otherwise, download dataset here. And then change the name of directory data
to .data
.
python train.py --conf path/to/config.yaml --d cuda device number --version "any name you like"
e.g.
python train.py --conf ./config/projrank_m32768_r4096.yaml -d 0 --version rank-hmms
We have merged the rank-pcfgs into TN-PCFG. Please see more details there.
The code is based on low-rank-models, hmmlm. And most baselines for HMMs can be found there.