Skip to content

ATEResults

Every extractor returns an ATEResults object.

ATEResults(corpus, terms, offsets=None)

Class to represent the results of term extraction.

All extractors return results in the same format:

  • terms has one entry per document, {"doc_id": ..., "terms": [{"term": ..., "score": ...}, ...]}, with the terms ranked from highest to lowest score.
  • offsets is None for plain-text input. For Teanga input, extractors that score the n-grams of each document give one entry per document, {"doc_id": ..., "offsets": [{"term": ..., "offset": (start, end)}, ...]}, listing every occurrence of each extracted term.

Initialize the ATEResults object.

Parameters:

Name Type Description Default
corpus Union[Corpus, List[str], List[Dict[str, str]]]

The corpus: a Teanga corpus, the input list of strings, or a list of dictionaries with doc_id and text.

required
terms List[Dict[str, Any]]

The extracted terms and their scores for each document.

required
offsets Optional[List[Dict[str, Any]]]

The character offsets of each extracted term in each document, for Teanga corpora.

None