Skip to content
intermediatetext

Counterfactual Detection and Reasoning

Detect counterfactual statements and annotate their antecedent and consequent spans, based on SemEval-2020 Task 5 (Yang et al.). Annotators identify whether a statement describes a hypothetical situation counter to known facts.

Get This Design

View on GitHub(opens in a new tab)

Clone or download from the repository

Quick start:

bash
git clone https://github.com/davidjurgens/potato-showcase.git
cd potato-showcase/semeval/2020/task05-counterfactual
potato start config.yaml

Configuration File

This Potato config reproduces the annotation task. Save it as config.yaml and run potato start config.yaml to try it.

yaml
# Counterfactual Detection and Reasoning
# Based on Yang et al., SemEval 2020
# Paper: https://aclanthology.org/2020.semeval-1.40/
# Dataset: https://github.com/arielsho/SemEval-2020-Task-5
#
# Annotators classify whether a statement is counterfactual (describing a
# hypothetical scenario contrary to known facts) and mark the antecedent
# (the hypothetical condition) and consequent (the hypothetical result).

annotation_task_name: "Counterfactual Detection and Reasoning"
task_dir: "."

data_files:
  - sample-data.json

item_properties:
  id_key: "id"
  text_key: "text"

output_annotation_dir: "annotation_output/"
output_annotation_format: "json"

port: 8000
server_name: localhost

annotation_schemes:
  - annotation_type: radio
    name: counterfactual_label
    description: "Is this statement counterfactual?"
    labels:
      - "Counterfactual"
      - "Not Counterfactual"
    keyboard_shortcuts:
      "Counterfactual": "1"
      "Not Counterfactual": "2"
    tooltips:
      "Counterfactual": "The statement describes a hypothetical situation that is contrary to known facts"
      "Not Counterfactual": "The statement does not describe a counterfactual scenario"

  - annotation_type: span
    name: counterfactual_spans
    description: "If counterfactual, highlight the antecedent (condition) and consequent (result)."
    labels:
      - "Antecedent"
      - "Consequent"

annotation_instructions: |
  You will see a statement that may or may not be counterfactual. Your task is to:
  1. Read the statement carefully.
  2. Determine if it is counterfactual (describes a hypothetical situation contrary to fact).
  3. If counterfactual, highlight the antecedent (the "if" condition) and the consequent
     (the "then" result).

  Examples of counterfactual: "If I had studied harder, I would have passed the exam."
  Examples of non-counterfactual: "If it rains tomorrow, I will bring an umbrella."

html_layout: |
  <div style="padding: 15px; max-width: 800px; margin: auto;">
    <div style="background: #f0f9ff; border: 1px solid #bae6fd; border-radius: 8px; padding: 16px; margin-bottom: 16px;">
      <strong style="color: #0369a1;">Statement:</strong>
      <p style="font-size: 16px; line-height: 1.7; margin: 8px 0 0 0;">{{text}}</p>
    </div>
  </div>

allow_all_users: true
instances_per_annotator: 50
annotation_per_instance: 2
allow_skip: true
skip_reason_required: false

Sample Data

json
[
  {
    "id": "cf_001",
    "text": "If the Titanic had carried enough lifeboats, hundreds more passengers would have survived the disaster."
  },
  {
    "id": "cf_002",
    "text": "The company announced that quarterly earnings exceeded analyst expectations by a significant margin."
  }
]

// ... and 8 more items

Dataset & paper

Yang et al., SemEval 2020

Citation (BibTeX)

bibtex
@inproceedings{yang-etal-2020-semeval,
    title = "{S}em{E}val-2020 Task 5: Counterfactual Recognition",
    author = "Yang, Xiaoyu  and Obadinma, Stephen  and Zhao, Huasha  and Zhang, Qiong  and Matwin, Stan  and Zhu, Xiaodan",
    booktitle = "Proceedings of the Fourteenth Workshop on Semantic Evaluation",
    month = dec,
    year = "2020",
    address = "Barcelona (online)",
    publisher = "International Committee for Computational Linguistics",
    url = "https://aclanthology.org/2020.semeval-1.40/",
    doi = "10.18653/v1/2020.semeval-1.40",
    pages = "322--335"
}

Details

Annotation Types

radiospan

Domain

NLPSemEval

Use Cases

Counterfactual DetectionCausal ReasoningDiscourse Analysis

Tags

semevalsemeval-2020shared-taskcounterfactualcausal-reasoningdiscourse

Found an issue or want to improve this design?

Open an Issue(opens in a new tab)