Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #2996
Hello!
Pull request overview
bool
field from VerbNet, and store the data as anegated
field in the semantics.The issue
See the following snippet for a segment of
murder-42.1.xml
, a Verbnet file:Note the
bool="!"
on the last predicate. This means that the result of the event is that the Patient is not alive, while the patient starts as alive, as shown in the predicate before. However, this bool field is never read by the NLTKVerbnetCorpusReader
.Consequently, printing the frames of
murder-42.1
gives:Note that both the start and result is just
alive
, which is in conflict with the official semantics of murder-42.1, which clearly shows¬alive(result(E), Patient)
.Changes
The
_get_semantics_within_frame
method, responsible for reading this data, now also outputs a"negated"
field in its dictionary, set toTrue
if there is abool="!"
on that predicate, andFalse
otherwise. This"negated"
field is then used in_pprint_semantics_within_frame
, where a¬
is prepended to the predicate value.Results
This
negated
value is also returned byverbnet.frames
now:I'm open to changing the
"negated"
dictionary key to something else, but I figured it was more descriptive than"bool"
.Thank you @TMPxyz for raising #2996. As you seem familiar with Verbnet, perhaps you could review these changes briefly, and/or give your thoughts?