Note
The negation
option is only available for English models.
The base event algorithm extracts events when a key phrase and any required role mentions are detected in the document. It does not recognize whether the event happened or didn't happen, also known as the polarity of the event. For example, in a travel event, the following two sentences will both be extracted by the key phrase "travel":
In the example above, "didn't" is an example of a negation cue. The existence of the cue signifies the event is negated.
You can choose to include or ignore negation when you call the events endpoint. The negation
option has 4 values:
-
Ignore
: (default) Returns all events and the negation cue (didn't in the above example) isn't included in the response.
-
Both
: Returns all events, positive and negative, with the negation cue included in the response.
-
Only_positive
: Returns only positive events. An empty negation clue may be included in the response.
-
Only_negative
: Returns only negative events; a negation cue will be returned.
By default, if you do not pass in a negation
parameter, the sentences above return the same event values.
When both
, only_positive
, or only_negative
options are selected, the polarity is included in the response, with the negation clue, if it exists.
The following example had negation set to both in the request.
{
"events": [
{
"eventType": "flight_booking_schema_new_schema.TRAVEL",
"mentions": [
{
"startOffset": 0,
"endOffset": 23,
"roles": [
{
"startOffset": 0,
"endOffset": 4,
"name": "TRAVELER",
"id": "T0",
"dataSpan": "John",
"confidence": 0.90569645,
"extractorName": "flight_booking_schema_new_schema.per_title",
"roleType": "flight_booking_schema_new_schema.PER_TITLE"
},
{
"startOffset": 5,
"endOffset": 13,
"name": "key",
"id": "E1",
"dataSpan": "traveled"
},
{
"startOffset": 17,
"endOffset": 23,
"name": "DESTINATION",
"id": "Q84",
"dataSpan": "London",
"confidence": 0.6654963,
"extractorName": "flight_booking_schema_new_schema.location-entity",
"roleType": "flight_booking_schema_new_schema.location"
}
],
"polarity": "Positive",
"negationCues": []
}
],
"confidence": 1,
"workspaceId": "650c4c891c39afa1b071dae3"
},
{
"eventType": "flight_booking_schema_new_schema.TRAVEL",
"mentions": [
{
"startOffset": 25,
"endOffset": 55,
"roles": [
{
"startOffset": 25,
"endOffset": 32,
"name": "TRAVELER",
"id": "T2",
"dataSpan": "Charles",
"confidence": 0.72164702,
"extractorName": "flight_booking_schema_new_schema.per_title",
"roleType": "flight_booking_schema_new_schema.PER_TITLE"
},
{
"startOffset": 40,
"endOffset": 46,
"name": "key",
"id": "E2",
"dataSpan": "travel"
},
{
"startOffset": 50,
"endOffset": 55,
"name": "DESTINATION",
"id": "E3",
"dataSpan": "Paris",
"extractorName": "flight_booking_schema_new_schema.location-entity",
"roleType": "flight_booking_schema_new_schema.location"
}
],
"polarity": "Negative",
"negationCues": [
{
"startOffset": 33,
"endOffset": 39,
"dataSpan": "didn't"
}
]
}
],
"confidence": 0.89116663,
"workspaceId": "650c4c891c39afa1b071dae3"
}
]
}