Datasets:
Tasks:
Text Classification
Modalities:
Text
Formats:
parquet
Languages:
English
Size:
10K - 100K
Tags:
long context
update
Browse files- README.md +4 -3
- arxiv-classification.py +12 -2
- test_data.txt +2 -2
- train_data.txt +2 -2
- 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 (
|
20 |
|
21 |
-
|
22 |
-
|
|
|
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="
|
|
|
|
|
|
|
|
|
|
|
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 = "
|
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:
|
3 |
-
size
|
|
|
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:
|
3 |
-
size
|
|
|
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:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:c62ab835835d9fe07a20ea2d3cfaa194167e76b0b961162836b08639eefbf11f
|
3 |
+
size 149548650
|