mordecai3 icon indicating copy to clipboard operation
mordecai3 copied to clipboard

Uncouple geoparsing and event location picking?

Open andybega opened this issue 7 months ago • 0 comments

The Geoparser right now has somewhat interleaved code to do two things:

  1. Geoparsing---identifying location entities in a text and resolving them to GeoNames entries
  2. Event location---in conjunction with an extracted event location span and the geoparsing from step 1, pick an event location (via Geoparser.pick_event_loc).

Is event locationing still needed as a feature in mordecai3 at all? Seems otherwise Andy H., you have been writing wrappers that just exploit the geoparsing feature of mordecai3 but then do their own event location resolution.

Regardless of that, maybe it's possible to separate the two things a bit so that the Geoparser class only does geoparsing, and then there is a separate class or function that handles event location picking.

To uncouple:

We've got the pick_event_loc() method in the geoparser, but this should be easy to split out. It only needs the ES conn from self, and uses another function/method or two that are external or methods in the Geoparsers() class.

In the core geoparse_doc() method: Geoparser() has a event_geoparse flag, and Geoparser.geoparse_doc() has a plover_cat argument. The main impact is to add an additional span based on the QA model answer, with a non-standard EVENT_LOC entity tag.

https://github.com/ahalterman/mordecai3/blob/735e01b789869dd03d27c275e74b8d07a6af574f/mordecai3/geoparse.py#L403-L410

andybega avatar Sep 19 '25 12:09 andybega