joelniklaus commited on
Commit
4b0df17
1 Parent(s): ae4a907

added aggregate column for all events

Browse files
Files changed (5) hide show
  1. README.md +2 -2
  2. convert_to_hf_dataset.py +13 -0
  3. test.jsonl +2 -2
  4. train.jsonl +2 -2
  5. validation.jsonl +2 -2
README.md CHANGED
@@ -88,7 +88,7 @@ The jsonl files have the following basic columns:
88
  - `country`: The country of the sentence
89
  - `text`: Sentence that has been annotated
90
 
91
- The documents have been annotated with 8 labels, each label representing a specific measurement against COVID-19. Each label is represented by one field in the jsonl file. The labels, i.e. the specific measure classes, are:
92
  - `event1`: State of Emergency
93
  - `event2`: Restrictions of fundamental rights and civil liberties
94
  - `event3`: Restrictions of daily liberties
@@ -97,7 +97,7 @@ The documents have been annotated with 8 labels, each label representing a speci
97
  - `event6`: Police mobilization
98
  - `event7`: Army mobilization
99
  - `event8`: Government oversight
100
-
101
 
102
  ### Data Splits
103
 
 
88
  - `country`: The country of the sentence
89
  - `text`: Sentence that has been annotated
90
 
91
+ The documents have been annotated with 8 labels, each label representing a specific measurement against COVID-19. Each label is represented by one boolean field in the jsonl file. The labels, i.e. the specific measure classes, are:
92
  - `event1`: State of Emergency
93
  - `event2`: Restrictions of fundamental rights and civil liberties
94
  - `event3`: Restrictions of daily liberties
 
97
  - `event6`: Police mobilization
98
  - `event7`: Army mobilization
99
  - `event8`: Government oversight
100
+ - `all_events`: an aggregate column containing all applicable events combined
101
 
102
  ### Data Splits
103
 
convert_to_hf_dataset.py CHANGED
@@ -48,6 +48,19 @@ validation = validation[column_list]
48
  test = test[column_list]
49
 
50
 
 
 
 
 
 
 
 
 
 
 
 
 
 
51
  # save splits
52
  def save_splits_to_jsonl(config_name):
53
  # save to jsonl files for huggingface
 
48
  test = test[column_list]
49
 
50
 
51
+ def aggregate_events(row):
52
+ all_events = []
53
+ for label_col in label_cols:
54
+ if row[label_col]:
55
+ all_events.append(label_col)
56
+ return all_events
57
+
58
+
59
+ train["all_events"] = train.apply(aggregate_events, axis=1)
60
+ validation["all_events"] = validation.apply(aggregate_events, axis=1)
61
+ test["all_events"] = test.apply(aggregate_events, axis=1)
62
+
63
+
64
  # save splits
65
  def save_splits_to_jsonl(config_name):
66
  # save to jsonl files for huggingface
test.jsonl CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:a50a8aee1ad24f474e57f2667a7bcc115e6ffd63f6395fb4f8371910b6e21e2e
3
- size 167898
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1792a5b0103cbdd2a1d973cdb5ca5a881ec6505c2a9d7a8625b412bfb67ad69a
3
+ size 176847
train.jsonl CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:3829bd41ac704cc79e6f29ff2f97928a8b685a0f589c99fd185849e307002276
3
- size 1361375
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:521b6027d21a332af2b60e30055aba69e0dff9e6dc740f4c89e81801fa89e77b
3
+ size 1430137
validation.jsonl CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:3a56adafeb5f0c39f8ca1f09c8fdfbebfe5df5e87a1969e81d0325316cb09f07
3
- size 171036
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b1fbfcfb77ba513edc42dd48b64ec6a42741e38fc99130da3179127e2bd7f394
3
+ size 179940