-
Notifications
You must be signed in to change notification settings - Fork 24
Grounding flow
There are two primary places where mentions get grounded: during initial extraction and during regrounding of previously read mentions. Here is the flow for each, and hopefully it will help you know where to start looking if you need to modify/fix/extend something.
Note, for more information about the extraction flow, please see the Extraction flow wiki page.
During extraction, grounding happens after the Odin Mentions have been mapped to EidosMentions. This is through application of an EidosRefiner, specifically the OntologyHandler refiner. This refiner has an instance of an OntologyHandler. The key method that is applied during grounding is OntologyHandler.ground(), which has the EidosMention make its canonicalForm (i.e., stripping out stop words and certain POS tags, etc.) using a Canonicalizer (more or less called here.). Then, the mention is grounded to each of the enabled ontologies (which are internally represented as OntologyGrounder instances. (In practice, I think that all current ontologies are actually instances of the abstract subclass EidosOntologyGrounder. For more on the different grounders, please see the Grounders wiki page.
Regrounding can happen either through an app (see the reground/ground format for exporting, or it can be called through the REST api available through the webapp. The route for this calls this backend method, which in turn calls is OntologyHandler.reground(). During this call, please note that the api receives the text of a previously found mention, meaning that the text will be reprocessed and may result in a different grounding that it was originally given. This api, however, also allows us to reground mentions from other readers, a nice feature.