isi-nlp / DiplomacyAMR

AMR-related aspects of Diplomacy ALLAN project
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Problem with disappearing variables #24

Closed saramosher888 closed 2 years ago

saramosher888 commented 2 years ago

Previously I mentioned an issue in AMR Editor where the variables assigned to country names can get scrambled if the first mention of the country name is deleted and re-added. This is coming up repeatedly whenever we need to make corrections.

In this example, England used to be c2. The first mention of England was in :arg0 of move-01. When I deleted :arg0, that removed the first mention of England where the country name was spelled out. When I re-added it as u :mod ENG, England was assigned a new variable (c5). But all the other mentions of c2 stayed the same. So the different mentions of England are no longer connected to one another. Every time I remove :arg0, that leads to a cascade of manual changes throughout the rest of the AMR in order to make sure that the variables are still consistent. In this process it's very easy to miss something or make a mistake.

Is there a better way to do this?

image

This example is dip_train_0004.188.

uhermjakob commented 2 years ago

Make sure to move a country, not delete and re-add it. Example:

(m / move-01
      :ARG0 (c / country :name (n / name :op1 "Germany"))
      :ARG1 (a / army
            :location (p2 / province :name (n3 / name :op1 "Berlin")))
      :ARG2 (p / province :name (n2 / name :op1 "Prussia")))

Move command: a :mod c- (The - indicates that the sub-unit c is to be moved from the original place (as opposed to be co-referenced. Think of the - as remove from original location.) Delete any superfluous reentrancy-marking variables separately. Hope this helps.

uhermjakob commented 2 years ago

And to add a name to a country that was ¨lost¨, do the following: (c2 / country) Command: c2 :name ENG

saramosher888 commented 2 years ago

Ah, that's helpful. Thank you.

uhermjakob commented 2 years ago

Based on your report that you have been losing country names when deleting countries, I added a new AMR Checker rule ::slot-restriction country :name name ::slot-required true that requires countries to be named (for Diplomacy). This should help you find cases where country names are missing. Of course, there might be a few cases of legitimately unnamed countries, causing a false alarm, but I don't expect many.

saramosher888 commented 2 years ago

Thank you. That should help me identify the ones that need to be fixed.