Powered by Zoomin Software. For more details please contactZoomin

The Semaphore Fact Extraction Framework (FACTS)

Unsequenced In Document

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

Summary of usage

The Unsequenced In Document Context looks for a fact and / or anchor in the same document. If they are, then the extractor fires and will return the fact or facts.

This is a very simple extractor as it applies practically no constraint on the child elements - apart from the fact of occurring in the same document - which, given how content is sent to CS, is always a given.

Exemplification

The TTL format of an example model can be found here: UnsequencedInDocument.excludeResultsOverlappedBy

This model has an anchor (a disease) and a fact (a person entity) that should appear in the same document, and where the person entity should not be returned if they are a doctor (an person entity with the phrase “Dr” before them).

Testing this model with:

this content:

          Dr Foster said Peter Smith had Paget Disease.

gives this response:

      <?xml version="1.0" encoding="UTF-8"?>
      <response>
       <STRUCTUREDDOCUMENT>
        <META name="Type" value="TEXT (4003)"/>
        <SYSTEM name="DeterminedLanguage" value="english"/>
        <SYSTEM name="LanguageGuessed" value="no"/>
        <META name="DocumentType" value="Doc" score="1.00"/>
        <META name="Mentioned patient" value="Peter Smith" score="1.00"/>
       </STRUCTUREDDOCUMENT>
      </response>

this content:

          Dr Foster examined Peter Smith.
          He concluded the patient had Paget Disease.

gives this response:

      <?xml version="1.0" encoding="UTF-8"?>
      <response>
       <STRUCTUREDDOCUMENT>
        <META name="Type" value="TEXT (4003)"/>
        <SYSTEM name="DeterminedLanguage" value="english"/>
        <SYSTEM name="LanguageGuessed" value="no"/>
        <META name="DocumentType" value="Doc" score="1.00"/>
        <META name="Mentioned patient" value="Peter Smith" score="1.00"/>
       </STRUCTUREDDOCUMENT>
      </response>

this content:

          Dr Foster said Peter Smith was sick.
          He had Paget Disease.

gives this response:

      <?xml version="1.0" encoding="UTF-8"?>
      <response>
       <STRUCTUREDDOCUMENT>
        <META name="Type" value="TEXT (4003)"/>
        <SYSTEM name="DeterminedLanguage" value="english"/>
        <SYSTEM name="LanguageGuessed" value="no"/>
        <META name="DocumentType" value="Doc" score="1.00"/>
        <META name="Mentioned patient" value="Peter Smith" score="1.00"/>
       </STRUCTUREDDOCUMENT>
      </response>

this content:

          Peter Smith had Paget Disease.

gives this response:

      <?xml version="1.0" encoding="UTF-8"?>
      <response>
       <STRUCTUREDDOCUMENT>
        <META name="Type" value="TEXT (4003)"/>
        <SYSTEM name="DeterminedLanguage" value="english"/>
        <SYSTEM name="LanguageGuessed" value="no"/>
        <META name="DocumentType" value="Doc" score="1.00"/>
        <META name="Mentioned patient" value="Peter Smith" score="1.00"/>
       </STRUCTUREDDOCUMENT>
      </response>

this content:

          Dr Peter Smith had Paget Disease.

gives this response:

      <?xml version="1.0" encoding="UTF-8"?>
      <response>
       <STRUCTUREDDOCUMENT>
        <META name="Type" value="TEXT (4003)"/>
        <SYSTEM name="DeterminedLanguage" value="english"/>
        <SYSTEM name="LanguageGuessed" value="no"/>
        <META name="DocumentType" value="Doc" score="1.00"/>
       </STRUCTUREDDOCUMENT>
      </response>

Full unit tests (models and content) for Unsequenced in Document

Find all models for Unsequenced in Document here: Unsequenced in Document unit test models

and the associated tests here:

If you wish to test, you will need to:

  1. create a new model and then import the test TTL model file into it
  2. copy and paste the content text from the model’s associated test into DA and classify

Unsequenced In Document Contexts Properties


Mandatory hierarchical relationships

Label Range Constraints
fact Context Elements one or more allowed
or
not anchor Context Elements one or more allowed
or
anchor Context Elements one or more allowed
or
not fact Context Elements one or more allowed

Optional hierarchical relationships

Label Range Constraints
anchor Context Elements one or more allowed
not anchor Context Elements one or more allowed
not fact Context Elements one or more allowed
optional anchor Context Elements one or more allowed
optional fact Context Elements one or more allowed

Mandatory associative relationships

Label Range Constraints
(none)

Optional associative relationships

Label Range Constraints
depended on by context Contexts only one allowed
depends on context Contexts only one allowed
extract fact as Fact Name only one allowed
group fact as Fact Name only one allowed
location Locations only one allowed
precluded by context Contexts only one allowed
precludes_context Contexts only one allowed
punctuation Punctuation rules only one allowed

Mandatory alternative labels

Label Range Constraints
(none)

Optional alternative labels

Label Range Constraints
(none)

Mandatory metadata

Label Range Constraints
(none)

Optional metadata

Label Range Constraints
context position from document end Integer only one allowed
context position from document start Integer only one allowed
fact position from context end Integer only one allowed
fact position from context start Integer only one allowed
field String only one allowed
loose Boolean only one allowed
return group fact ID Boolean only one allowed
return raw text also Boolean only one allowed
return value using regex String only one allowed
{1-10} greedy repeat Integer one or more allowed
{1-10} non-greedy repeat Integer one or more allowed
debug Boolean only one allowed
TitleResults for “How to create a CRG?”Also Available inAlert