harvardnlp / pytorch-struct

Fast, general, and tested differentiable structured prediction in PyTorch
http://harvardnlp.github.io/pytorch-struct
MIT License
1.1k stars 92 forks source link

[Question] How to apply pytorch-struct for 2 dimensional data? #126

Open YuriyPryyma opened 2 years ago

YuriyPryyma commented 2 years ago

I could find examples of pytorch struct usage for 1d sequence data like text or video frame. But I'm trying to parse tables structure in pdf documents.

Could you provide some hints where to start?

srush commented 2 years ago

Do you have a paper reference? I don't know much about 2d parsing, but we could add something.

YuriyPryyma commented 2 years ago

Hi Here is an example of 2D-CFG https://hal.archives-ouvertes.fr/hal-00861080/document image

YuriyPryyma commented 2 years ago

Here is example of table structure recognition using CRF https://people.cs.umass.edu/~mccallum/papers/crftable-sigir2003.pdf

srush commented 2 years ago

neat, I'll take a look. I think the bottom paper is just a standard 1d CRF, but the top paper looks like it has special 2d grammars.