tieval api#

class tieval.base.Dataset(name: str, train: List[Document], test: List[Document] | None = None)#

Bases: object

A compilation of documents that have temporal annotations.

Parameters:
  • name (str) – The name of the dataset.

  • train (list[Document]) – A list containing the documents of the training set.

  • test (list[Document]) – A list containing the documents of the test set.

class tieval.base.Document(name: str, text: str, dct: Timex, entities: Set[Timex | Event], tlinks: Set[TLink], language: str = 'english', **kwargs)#

Bases: object

A document with temporal annotation.

Parameters:
  • name (str) – The name of the document

  • text (str) – The raw test of the document

  • entities (Set[Event, Timex]) – The events annotated

  • tlinks (Set[TLink]) – The temporal links annotated

property temporal_closure: Set[TLink]#

Compute temporal closure of the document. Temporal closure is the process of inferring new TLinks from the annotated TLinks.

It will call the function tieval.closure.temporal_closure() on the set of temporal links of the current document.

tieval.closure.temporal_closure(tlinks: Set[TLink]) Set[TLink]#

Compute temporal closure from a set of temporal links.

This function infers all possible TLinks form the set of tlinks that is fed as input.

param Set[TLink] tlinks:

A set of temporal links (typically from a document)

ep1&type=pdf

class tieval.entities.Event(id: str | None = None, text: str | None = None, endpoints: Tuple[int, int] | None = None, family: str | None = None, stem: str | None = None, lemma: str | None = None, aspect: str | None = None, tense: str | None = None, polarity: str | None = None, pos: str | None = None, class_: str | None = None, start_time: str | None = None, end_time: str | None = None, sent_idx: int | None = None, **kwargs)#

Bases: object

Object that represents an event.

class tieval.entities.Timex(id: str | None = None, text: str | None = None, value: str | None = None, endpoints: Tuple[int, int] | None = None, type_: str | None = None, function_in_document: str | None = None, anchor_time_id: str | None = None, sent_idx: int | None = None, **kwargs)#

Bases: object

Object that represents a time expression.

Bases: object

Object that represents a temporal link.

Parameters:
  • id (str) – Link id

  • source (Union[str, Timex, Event]) – Source event/timex id that the link refers to

  • target (Union[str, Timex, Event]) – Target event/timex id that the link refers to

  • relation (Union[str, list, dict, TemporalRelation]) – The temporal relation between source and target

exception tieval.temporal_relation.IncompleteRelationError#

Bases: Exception

Raised when the point relation is incomplete.