-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lattice-to-sequence #547
Lattice-to-sequence #547
Conversation
Conflicts: xnmt/sent.py
Conflicts: xnmt/sent.py
Conflicts: xnmt/modelparts/attenders.py xnmt/modelparts/embedders.py
Hi, this basically looks good! I just had a quick clarification that I couldn't tell immediately by looking at the code, which is how the fact that you have a lattice annotated interacts with batching, etc. Previously we had a somewhat sub-optimal implementation that basically assumed a sentence was a list of word IDs, and downstream operations such as batching were predicated on this. Has this been fixed in this commit or previously? I'm mostly asking because @armatthews @cindyxinyiwang and I were also discussing implementing the Eriguchi et al. tree-to-sequence model, and would run in to the same problem. |
I think this issue should be solved by the introduction of the |
OK maybe it does, thanks! Anyway, I browsed this briefly and think it's OK to merge, although I haven't checked carefully. |
Ok, thanks for taking a look! |
This is a port of the code of my lattice-to-sequence paper ( https://arxiv.org/abs/1704.00559 ). It includes the following components:
preproc.LatticeFromPlfExtractor
: creates node-labeled lattices with properly normalized lattice scores from given lattices in .plf format.sent.Lattice
/sent.LatticeNode
: data structureinput_readers.LatticeReader
: can read lattices from the output of the extractorLatticeLSTMTransducer
/LatticeLSTMTransducer
: lattice LSTMattenders.LatticeBiasedMlpAttender
: attention that is biased via the lattice confidence scoresThere is also a bit of refactoring to make preproc.py more YAML-like, which will not need a review.