bjascob / amrlib

A python library that makes AMR parsing, generation and visualization simple.
MIT License
219 stars 34 forks source link

Question for RBW Aligner #44

Closed hunter-lee1 closed 2 years ago

hunter-lee1 commented 2 years ago

would you mind describing the format of the alignments more specifically?

::alignments 0-1.1.1 1-1.1.2 3-1.1.2.1.2.1 4-1.1.2.1.1.1 5-1.1

bjascob commented 2 years ago

It's the standard AMR alignment format from the docs, which is {token number}-{Gorn Address} The AMR3 docs have a full description of it here.

hunter-lee1 commented 2 years ago

Thank u for your relply! It really helps!

But, is there a good way to get the alignment from the penman_graph (after aligned) ?

bjascob commented 2 years ago

I'm not sure what you're asking. After you align the graph it will have the alignment string in the metadata (as you show above) and the surface alignments (ie... node~e.2) in the graph.

The penman_graph object comes from the penman library so you might look in that lib if you need to manipulate that object or extract other information. If you just want access to the string do something like align_string = penman_graph.metadata['alignments']. See Penman docs.

hunter-lee1 commented 2 years ago

I find it in the Penman Docs. Thank u for ur kind suggestions! It really helps!

alignment = surface.alignments(penman_graph)