harvardnlp/pytorch-struct

log_potentials argument shape of PCFG

Liang-Qiu opened this issue · 2 comments

In the API document, it said class torch_struct.SentCFG has parameter

log_potentials (tuple) – event tuple with event shapes terms (N x T) rules (NT x (NT+T) x (NT+T)) root

I wonder why the rule is not of the shape NT x (NT+T)?
Thanks!

srush commented

PCFG rules are of the form A -> B C . B and C might be terminals, so N x (NT + T) x (NT + T) seemed natural.

That makes sense. Thank you!