Powered by Zoomin Software. For more details please contactZoomin

The Semaphore Fact Extraction Framework (FACTS)

Near Contexts

  • Last Updated: May 29, 2026
  • 3 minute read
    • Semaphore
    • Documentation

This is an abstract Concept Class (no concept can be made an instance of it in the model).

It represents all Near Context extractors. Near Contexts are extractors that look for facts (and anchors) that are close to each other in some context. How close they are can be specified using the count metadata.

There are two types of near Context extractors: unordered and ordered.

It should be noted that the count metadata that specifies how far apart (or near) the facts and anchors can be is always counting in word tokens (this is unlike the sequenced extractors, which use skip rules, and those skips share the sequence’s token type, be it words, sentences, or paragraphs).

Use the “near count” metadata to model the word count on the near extractors

To define this extractor’s elements a combination of anchors and facts can be used.

Near Contexts’ Elements

Metadata

  • near count: The count of tokens to that may be skipped between grammatical units. This is mandatory metadata for all Near Contexts
  • Context Position - Only one may be used
    • context position from document start: If there is more than one context found in the document, select the nth one from the document’s start.
    • context position from document end: If there is more than one context found in the document, select the nth one from the document’s end.
  • Fact Position - Only one may be used
    • fact position from context start: If there is more than one fact found in the context, select the nth one from the context’s start.
    • fact position from context end: If there is more than one fact found in the context, select the nth one from the context’s end.
  • Widths - Only one may be used
    • greedy width for context: The “same grammatical unit” (sentence, paragraph) constraint can be relaxed by using the “width” property. A greedy width will look in the maximum number of units that match the parameters.
    • non-greedy width for context: The “same grammatical unit” (sentence, paragraph) constraint can be relaxed by using the “width” property. A greedy width will look in the minimum number of units that match the parameters.
  • field: Filter the field(s) we want facts or anchors to all appear in.
  • return raw text also: As well as the fact found, return the entire context the fact was found in.
  • return value using regex: Return the fact after processing it with a regular expression to clean it up or transform it somehow.
  • return group fact ID: Return the GUID for the fact that groups the context.

Associative relationships

  • depended on by context: This Context is depended on to fire (find a fact) for another context to return its fact(s).
  • depends on context: This Context depends on another context to fire (find a fact) for it to return its fact(s).
  • extract fact as: Return the entire Context the fact(s) is found as a named fact.
  • group fact as: Group the fact that the Context extracts its facts in (as well as any other groups) into this group.
  • precluded by context: This Context is precluded from returning its facts (if any fire,) if the other Context finds a fact(s).
  • precludes_context: This Context precludes another Context from returning its facts (if any are found.) if this one finds any fact(s).
  • punctuation rule: Change the punctuation rule for the sequence from the defaults used in the templates. This is not to be recommended typically.
  • location: Set the location for the fact as being found at the start / end of a sentence, paragraph, document or field.
TitleResults for “How to create a CRG?”Also Available inAlert