File size: 7,418 Bytes
26f6d47
 
 
 
 
 
 
49606a6
26f6d47
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
d1ca02d
 
 
 
 
 
 
 
 
 
 
26f6d47
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
---
language:
- en
license: cc-by-4.0
task_categories:
- text-classification
task_ids:
- multi-class-classification
pretty_name: Complex Word Identification
size_categories:
- 1K<n<10K
tags:
- text-simplification
- lexical-complexity
- cwi
- nlp-course
configs:
  - config_name: default
    data_files:
      - split: train
        path: train.csv
      - split: validation
        path: validation.csv
      - split: test
        path: test.csv
  - config_name: biomedical
    data_files:
      - split: test
        path: biomedical_test.csv
  - config_name: news
    data_files:
      - split: test
        path: news_test.csv
dataset_info:
  - config_name: default
    features:
      - name: word
        dtype: string
      - name: label
        dtype:
          class_label:
            names:
              '0': simple
              '1': complex
      - name: annotators
        dtype: int64
      - name: sentence
        dtype: string
      - name: sentence_index
        dtype: int64
    splits:
      - name: train
        num_examples: 4000
      - name: validation
        num_examples: 1000
      - name: test
        num_examples: 922
  - config_name: biomedical
    features:
      - name: word
        dtype: string
      - name: complexity_score
        dtype: float64
      - name: label
        dtype:
          class_label:
            names:
              '0': simple
              '1': complex
    splits:
      - name: test
        num_examples: 289
  - config_name: news
    features:
      - name: word
        dtype: string
      - name: complexity_score
        dtype: float64
      - name: label
        dtype:
          class_label:
            names:
              '0': simple
              '1': complex
    splits:
      - name: test
        num_examples: 1813
---

# Complex Word Identification (CIS 5300)

## Dataset Description

This dataset supports the **Complex Word Identification (CWI)** task: given a word in context, predict whether it is *complex* (likely to be difficult for non-native speakers, children, or people with reading disabilities) or *simple*.

CWI is the first step in **lexical simplification** — the task of rewriting text to make it more accessible. Before you can simplify a word, you need to identify which words need simplification.

### Task

- **Input**: A word and the sentence it appears in
- **Output**: Binary label — `0` (simple) or `1` (complex)
- **Example**: In the sentence *"The beleaguered director resigned Wednesday"*, the word *beleaguered* is complex (label=1) while *director* is simple (label=0).

## Dataset Structure

### Default Configuration (Main Task)

```python
from datasets import load_dataset

dataset = load_dataset("CCB/cis5300-text-classification")

# Splits: train (4,000), validation (1,000), test (922)
print(dataset["train"][0])
# {'word': 'string', 'label': 0, 'annotators': 0, 'sentence': 'WASHINGTON -- The beleaguered...', 'sentence_index': 27}
```

| Split | Examples | Labels |
|-------|----------|--------|
| train | 4,000 | Yes |
| validation | 1,000 | Yes |
| test | 922 | No (held out for evaluation) |

**Fields:**

| Field | Type | Description |
|-------|------|-------------|
| `word` | string | The target word to classify |
| `label` | ClassLabel (simple/complex) | 0 = simple, 1 = complex |
| `annotators` | int | Number of annotators who labeled the word as complex |
| `sentence` | string | The full sentence containing the target word |
| `sentence_index` | int | Token position of the target word in the sentence |

### Domain Generalization Configs

Two additional test sets from different domains for evaluating how well models generalize:

```python
# Biomedical domain (PubMed abstracts)
bio = load_dataset("CCB/cis5300-text-classification", "biomedical")

# News domain (from CWI 2018 shared task)
news = load_dataset("CCB/cis5300-text-classification", "news")
```

| Config | Domain | Examples | Source |
|--------|--------|----------|--------|
| `biomedical` | PubMed abstracts | 289 | CompLex (Shardlow et al., 2020) |
| `news` | News articles | 1,813 | CWI 2018 Shared Task (Yimam et al., 2018) |

### Supplementary Data

The file `ngram_counts.txt.gz` contains word frequency counts from Google Books N-grams (~8.7M entries). This is useful as a feature for classification but is not a structured dataset. Download it separately:

```python
from huggingface_hub import hf_hub_download
path = hf_hub_download("CCB/cis5300-text-classification", "ngram_counts.txt.gz", repo_type="dataset")

import gzip
ngram_counts = {}
with gzip.open(path, 'rt', encoding='utf-8') as f:
    for line in f:
        parts = line.strip().split('\t')
        if len(parts) == 2:
            ngram_counts[parts[0]] = int(parts[1])
```

## Source

The core dataset was introduced in:

> **Simplification Using Paraphrases and Context-Based Lexical Substitution**
> Reno Kriz, Eleni Miltsakaki, Marianna Apidianaki, Chris Callison-Burch
> *Proceedings of NAACL-HLT 2018*, pages 207–217
> [https://aclanthology.org/N18-1019/](https://aclanthology.org/N18-1019/)

The words are drawn from news articles and annotated by both native and non-native English speakers who indicated which words could be difficult for non-native speakers, children, or people with reading disabilities.

### Annotation scheme and binarization

Each word was independently labeled by approximately 10 annotators. The `annotators` column records how many annotators marked the word as complex. Binary labels were derived using a threshold:

- **Simple (0)**: No annotator marked the word as complex (`annotators = 0`)
- **Complex (1)**: Three or more annotators marked it as complex (`annotators >= 3`)
- **Excluded**: Words in the ambiguous zone (1–2 annotators) were removed from the dataset

This means the dataset contains only clear cases — words that are unambiguously simple or where a meaningful fraction of annotators agreed on complexity.

### Domain generalization sources

- **Biomedical**: From the CompLex dataset (Shardlow et al., 2020) — words from biomedical abstracts with continuous complexity scores binarized at threshold 0.5.
- **News**: From the CWI 2018 Shared Task (Yimam et al., 2018) — words from news articles annotated for complexity.

## Intended Use

This dataset is used for **Homework 1** in [CIS 5300: Natural Language Processing](https://www.seas.upenn.edu/~cis5300/) at the University of Pennsylvania. Students build progressively more sophisticated classifiers:

1. **Baselines**: Word length and word frequency thresholds
2. **Machine learning**: Naive Bayes and Logistic Regression with engineered features
3. **Custom models**: Additional features with error analysis
4. **Domain generalization**: Evaluate on biomedical and news text

## Citation

```bibtex
@inproceedings{kriz-etal-2018-simplification,
    title = "Simplification Using Paraphrases and Context-Based Lexical Substitution",
    author = "Kriz, Reno and Miltsakaki, Eleni and Apidianaki, Marianna and Callison-Burch, Chris",
    booktitle = "Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies",
    year = "2018",
    address = "New Orleans, Louisiana",
    publisher = "Association for Computational Linguistics",
    url = "https://aclanthology.org/N18-1019",
    doi = "10.18653/v1/N18-1019",
    pages = "207--217",
}
```