Skip to content

ExtractedReport Class

Simon Bedford edited this page Apr 26, 2017 · 1 revision

Introduction

The ExtractedReport class is used as a wrapper around reports found during article processing, and is implemented in extracted_report.py.

ExtractedReport initialization:

def __init__(self, locations, event_term, subject_term, quantity, story, tag_spans=[])

Arguments & Attributes

locations

The argument locations is a list of Facts with type=loc.

self.locations is a list of location names (i.e. Fact string representation)

event_term

The argument event_term is a Fact with type=term.

self.event_term is the string representation of the Fact.

subject_term

The argument subject_term is a Fact with type=unit.

self.subject_term is the string representation of the Fact.

quantity

The argument quantity is a Fact with type=quantity.

self.quantity is an integer (the underlying text converted to int).

story

The article that has been processed.

tag_spans (default [])

An array containing the location in the article and type of each element found; stored as dictionaries. For example:

[{"type": "term", "start": 20, "end": 28}, {"type": "unit", "start": 47, "end": 56}]