ccdv commited on
Commit
ba43144
·
1 Parent(s): 63ace99
Files changed (5) hide show
  1. README.md +4 -3
  2. arxiv-classification.py +12 -2
  3. test_data.txt +2 -2
  4. train_data.txt +2 -2
  5. val_data.txt +2 -2
README.md CHANGED
@@ -16,10 +16,11 @@ Copied from "Long Document Classification From Local Word Glimpses via Recurrent
16
  * See: https://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=8675939
17
  * See: https://github.com/LiqunW/Long-document-dataset
18
 
19
- It contains 11 slightly unbalanced classes, 33k Arxiv Papers divided into 3 splits: train (23k), val (5k) and test (5k).
20
 
21
- **Removed all "\n", each document is a single line document** \
22
- **Removed also references to the class inside the document (eg: [cs.LG] -> [])**
 
23
 
24
  Compatible with [run_glue.py](https://github.com/huggingface/transformers/tree/master/examples/pytorch/text-classification) script:
25
  ```
 
16
  * See: https://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=8675939
17
  * See: https://github.com/LiqunW/Long-document-dataset
18
 
19
+ It contains 11 slightly unbalanced classes, 33k Arxiv Papers divided into 3 splits: train (28k), val (2.5k) and test (2.5k).
20
 
21
+ 2 configs:
22
+ * default
23
+ * no_ref, removes references to the class inside the document (eg: [cs.LG] -> [])
24
 
25
  Compatible with [run_glue.py](https://github.com/huggingface/transformers/tree/master/examples/pytorch/text-classification) script:
26
  ```
arxiv-classification.py CHANGED
@@ -52,13 +52,18 @@ class ArxivClassificationDataset(datasets.GeneratorBasedBuilder):
52
 
53
  BUILDER_CONFIGS = [
54
  ArxivClassificationConfig(
55
- name="arxiv",
 
 
 
 
 
56
  version=datasets.Version("1.0.0"),
57
  description="Arxiv Classification Dataset: A classification task of Arxiv Papers (11 classes)",
58
  ),
59
  ]
60
 
61
- DEFAULT_CONFIG_NAME = "arxiv"
62
 
63
  def _info(self):
64
  return datasets.DatasetInfo(
@@ -99,4 +104,9 @@ class ArxivClassificationDataset(datasets.GeneratorBasedBuilder):
99
  data = json.loads(row)
100
  label = self._LABELS_DICT[data["label"]]
101
  text = data["text"]
 
 
 
 
 
102
  yield id_, {"text": text, "label": label}
 
52
 
53
  BUILDER_CONFIGS = [
54
  ArxivClassificationConfig(
55
+ name="default",
56
+ version=datasets.Version("1.0.0"),
57
+ description="Arxiv Classification Dataset: A classification task of Arxiv Papers (11 classes)",
58
+ ),
59
+ ArxivClassificationConfig(
60
+ name="no_ref",
61
  version=datasets.Version("1.0.0"),
62
  description="Arxiv Classification Dataset: A classification task of Arxiv Papers (11 classes)",
63
  ),
64
  ]
65
 
66
+ DEFAULT_CONFIG_NAME = "default"
67
 
68
  def _info(self):
69
  return datasets.DatasetInfo(
 
104
  data = json.loads(row)
105
  label = self._LABELS_DICT[data["label"]]
106
  text = data["text"]
107
+
108
+ if self.config.name == "no_ref":
109
+ for _ in _LABELS:
110
+ text = text.replace(_, "")
111
+
112
  yield id_, {"text": text, "label": label}
test_data.txt CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:73100a1f6440bcb81cee80c0875e6f7d22d2fa07c640a2740780e5f208b64c41
3
- size 285513105
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ec296dd7d9dd9f7b1450c6754792bc0eaae0bb1dec61100d6c2b0930529902e1
3
+ size 146035962
train_data.txt CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:ad859c5102032f05bcaeab697c35413a05bb21c436ca71b1acb0e5a604b79ed9
3
- size 1363220828
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a5f3cdb7519898e5d076524baea3496cb262856cc3abaab1e1504fbf06e40ede
3
+ size 1708905012
val_data.txt CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:5630063bcc53d1b62c53d42ec0dea8997c099554f96fef68e36cb23759c8b97e
3
- size 286587448
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c62ab835835d9fe07a20ea2d3cfaa194167e76b0b961162836b08639eefbf11f
3
+ size 149548650