Open milamarcheva opened 1 month ago
Hello,
TN-PCFG doesn't support Viterbi decoding, because it needs reconstructing the whole grammar probability tensor, which is expensive. Only MBR decoding is supported for TN-PCFG
Thank you for the fast response!
Without the viterbi decoding, how do you perform the constituency analysis presented in section 8.3 of your PCFGs can do better paper? As in how do you gain insight into what the different groups of non-terminals are?
With MBR you can obtain posterior distribution (i.e., marginal probability) of constituent labels for each constituent spans.
Thanks! Is the code for that part of this repository or available somewhere freely?
https://github.com/sustcsonglin/TN-PCFG/blob/main/parser/pcfgs/tdpcfg.py#L179C1-L187C1. You can modify the shape to BxLxLxN where B: batch size, L: seq len, N: num nonterminals. By autograd you can obtain span nonterminal marginals
I am trying to get the PCFG parses (as opposed to unlabelled constituency parses which I can successfully get using the mbr decoding).
If I try to use Viterbi decoding I get the following error (see below). In what way can I get the PCFG parses?