Skip to content
Showcase/Coreference Chains
advancedtext

Coreference Chains

Group coreferring text mentions into chains with visual highlighting. Combines span annotation for mention detection with coreference grouping.

Coreference Chains annotation interface preview

Configuration Fileconfig.yaml

yaml
# Coreference Annotation Configuration
# Demonstrates grouping coreferring mentions into chains

annotation_task_name: "Coreference Annotation Demo"
task_dir: .

data_files:
  - data.json

item_properties:
  id_key: id
  text_key: text

user_config:
  allow_all_users: true

instance_display:
  fields:
    - key: text
      type: text
      label: "Text"

annotation_schemes:
  # First, a span schema for identifying mentions
  - annotation_type: span
    name: mentions
    description: "Highlight entity mentions in the text"
    labels:
      - name: PERSON
        tooltip: "Person names and pronouns"
      - name: ORG
        tooltip: "Organization names"
      - name: LOC
        tooltip: "Location names"
      - name: OTHER
        tooltip: "Other referring expressions"

  # Then, the coreference schema for grouping mentions into chains
  - annotation_type: coreference
    name: coref_chains
    description: "Group mentions that refer to the same entity into coreference chains"
    span_schema: mentions
    entity_types: [PERSON, ORG, LOC, OTHER]
    allow_singletons: true
    visual_display:
      highlight_mode: background

output_annotation_dir: annotation_output
output_annotation_format: json

Sample Datasample-data.json

json
[
  {
    "id": "coref_1",
    "text": "John Smith works at Google. He joined the company in 2020 after graduating from MIT. The tech giant offered him a position in their AI research division."
  },
  {
    "id": "coref_2",
    "text": "The European Union announced new trade policies today. Brussels said the regulations would take effect next quarter. EU officials expect the measures to boost economic growth across the bloc."
  }
]

// ... and 1 more items

Get This Design

This design is available in our showcase. Copy the configuration below to get started.

Quick start:

# Create your project folder
mkdir coreference
cd coreference
# Copy config.yaml from above
potato start config.yaml

Details

Annotation Types

spancoreference

Domain

NLPDiscourse

Use Cases

Coreference ResolutionEntity TrackingDiscourse Analysis

Tags

coreferenceentity mentionschainsdiscoursespan annotation