Relation Extraction
Identify and classify relationships between entities in text (e.g., works-for, located-in, married-to).
text annotation
Configuration Fileconfig.yaml
# Relation Extraction Configuration
# Identify relationships between entities in text
annotation_task_name: "Relation Extraction"
data_files:
- "data/sentences.json"
item_properties:
id_key: "id"
text_display_key: "display"
user_config:
allow_all_users: true
annotation_schemes:
- annotation_type: "radio"
name: "relation_type"
description: "What is the relationship between the highlighted entities?"
labels:
- name: "works_for"
tooltip: "Subject works for/is employed by object"
key_value: "w"
- name: "located_in"
tooltip: "Subject is located in object (place)"
key_value: "l"
- name: "founded_by"
tooltip: "Subject was founded by object"
key_value: "f"
- name: "ceo_of"
tooltip: "Subject is CEO/leader of object"
key_value: "c"
- name: "born_in"
tooltip: "Subject was born in object (place)"
key_value: "b"
- name: "married_to"
tooltip: "Subject is married to object"
key_value: "m"
- name: "subsidiary_of"
tooltip: "Subject is a subsidiary of object"
key_value: "s"
- name: "part_of"
tooltip: "Subject is part of object"
key_value: "p"
- name: "no_relation"
tooltip: "No clear relationship between entities"
key_value: "n"
- name: "other"
tooltip: "Relationship exists but not in list"
key_value: "o"
- annotation_type: "text"
name: "other_relation"
description: "If 'other', describe the relationship"
show_if:
field: "relation_type"
value: "other"
- annotation_type: "radio"
name: "direction"
description: "What is the direction of the relation?"
labels:
- name: "Subject → Object"
tooltip: "Relation goes from Subject to Object"
- name: "Object → Subject"
tooltip: "Relation goes from Object to Subject"
- name: "Bidirectional"
tooltip: "Relation works both ways"
- annotation_type: "likert"
name: "confidence"
description: "How confident are you in this relation?"
size: 5
min_label: "Not confident"
max_label: "Very confident"
output: "annotation_output/"
Sample Datasample-data.json
[
{
"id": "rel_001",
"text": "Tim Cook has been the CEO of Apple since 2011.",
"subject": "Tim Cook",
"object": "Apple",
"subject_type": "PERSON",
"object_type": "ORGANIZATION",
"display": "**Text:** Tim Cook has been the CEO of Apple since 2011.\n\n**Subject:** [Tim Cook] (PERSON)\n**Object:** [Apple] (ORGANIZATION)"
},
{
"id": "rel_002",
"text": "The Eiffel Tower is located in Paris, France.",
"subject": "Eiffel Tower",
"object": "Paris",
"subject_type": "LOCATION",
"object_type": "LOCATION",
"display": "**Text:** The Eiffel Tower is located in Paris, France.\n\n**Subject:** [Eiffel Tower] (LOCATION)\n**Object:** [Paris] (LOCATION)"
}
]
// ... and 2 more itemsGet This Design
Clone or download from the repository
Quick start:
git clone https://github.com/davidjurgens/potato-showcase.git cd potato-showcase/relation-extraction potato start config.yaml
Details
Annotation Types
Domain
Use Cases
Tags
Found an issue or want to improve this design?
Open an IssueRelated Designs
Reading Comprehension QA
Evaluate question-answer pairs for reading comprehension by verifying answers and rating quality.
Adverse Drug Event Extraction (CADEC)
Named entity recognition for adverse drug events from patient-reported experiences, based on the CADEC corpus (Karimi et al., 2015). Annotates drugs, adverse effects, symptoms, diseases, and findings from colloquial health forum posts with mapping to medical vocabularies (SNOMED-CT, MedDRA).
Chemical-Disease Relation Extraction (BC5CDR)
Extract chemical-disease relations from biomedical literature. Based on BioCreative V CDR task. Identify chemical and disease entities, then annotate causal relationships between them (chemical induces disease).