-
Notifications
You must be signed in to change notification settings - Fork 24
Attachment handling
In Eidos, Attachments are used to contain additional mention meta-data that is relevant to the use case. A list of the supported Attachments is given here.
Attachments get attached in various ways, from declaratively in rules to imperatively in methods that apply post-extraction. Further, sometimes Attachments are actually attached to mentions which are substrings of the final mention to be saved (e.g., in a span like The rain in Spain..., the location attachment may only be attached to Spain). To make sure that the final output mentions have all the appropriate attachments we have a series of complicated attachment handling methods, spread in several places (read: code that grew, mutated, adapted, became sentient, and likely needs to be told who is boss). This is Becky's least favorite part of Eidos (as of 2021-08-12).
Here are some places where attachments are created and attached:
- Document Creation Time (DCT): if no time expression was found, the DCT is added as an attachment to the mention.
- During extraction as an action: Any rule with the action
applyAttachment
, e.g., here will pass through theapplyAttachment
method and will receive appropriate attachments.
Here are some places where attachments are "handled":
- During argument expansion: the new (expanded) argument mentions are given the attachments that the original, subsumed mentions had. (See this for info on expansion).
- After expansion, attachments for overlapping mentions are merged: this happens with methods owned by the
AttachmentHandler
So -- if you need to debug weird or missing or extra attachments, this will hopefully get you started, though YMMV. Note that these are entry points for your search/digging. These pointers are by no means a full roadmap. However, if you are motivated to consolidate/improve this stuff, then yay! :)