interactive-cookbook / recipe-generation

Apache License 2.0
0 stars 0 forks source link

Add / update imperative information #12

Closed kastein closed 1 year ago

kastein commented 1 year ago

AMR parser does not always correctly identify verbs in imperative mode but sometimes :mode imperative and :ARG0 you are missing. Adding them where missed could improve generation, e.g. T5 model from amrlib generates "Cooking with a hot waffle iron" from the AMR for "Cook on hot waffle iron" if both are missing, but generates "Cook with a hot waffle iron" if mode and ARG0 information is included.

Additionally, node 'you' gets aligned to the same token as the predicate it belongs to and if more predicates in imperative mode occur in a sentence 'you' can only be aligned to one them. -> might happen that the predicate node for the token to which the node 'you' is aligned is no longer part of the action-level AMR after splitting.

Consider

kastein commented 1 year ago

Probably need the :ARG0 and imperative information for generation.

single AMR to sentence generation does often not generate sentences in imperative mode otherwise:

Adding sentence context might help here but definitely worth to consider adding information manually

kastein commented 1 year ago

Addressed in commit: 7396b05581538c38a2f42ad1507a42f685fc8324 :ARG0 'you' gets added to a node if all of the following applies

If it is additionally the case that the node has not :mode 'imperative' attribute then the attribute gets added as well. Added 'you' and added 'imperative' get aligned to the same token as the predicate.