Datasets:
Commit
·
2c0bf29
1
Parent(s):
1341e14
feather format
Browse files- .gitattributes +1 -0
- dev.feather +3 -0
- dev.json +0 -0
- political_advertising_loader.py +4 -10
- test.feather +3 -0
- test.json +0 -0
- train.feather +3 -0
- train.json +0 -0
.gitattributes
CHANGED
@@ -36,3 +36,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
36 |
*.ogg filter=lfs diff=lfs merge=lfs -text
|
37 |
*.wav filter=lfs diff=lfs merge=lfs -text
|
38 |
*.jsonl filter=lfs diff=lfs merge=lfs -text
|
|
|
|
36 |
*.ogg filter=lfs diff=lfs merge=lfs -text
|
37 |
*.wav filter=lfs diff=lfs merge=lfs -text
|
38 |
*.jsonl filter=lfs diff=lfs merge=lfs -text
|
39 |
+
*.feather filter=lfs diff=lfs merge=lfs -text
|
dev.feather
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:ee2468af88d72003e2c78e9ebdb95cbcd398f636067297577dd482c9fd26917a
|
3 |
+
size 142410
|
dev.json
DELETED
The diff for this file is too large to render.
See raw diff
|
|
political_advertising_loader.py
CHANGED
@@ -37,9 +37,9 @@ class PoliticalAdvertisingConfig(datasets.BuilderConfig):
|
|
37 |
class PoliticalAdvertisingDataset(datasets.GeneratorBasedBuilder):
|
38 |
VERSION = datasets.Version("1.0.0")
|
39 |
|
40 |
-
TRAIN_FILE = DATA_PATH / "train.
|
41 |
-
VAL_FILE = DATA_PATH / "dev.
|
42 |
-
TEST_FILE = DATA_PATH / "test.
|
43 |
|
44 |
BUILDER_CONFIGS = [
|
45 |
datasets.BuilderConfig(name="political-advertising-pl", version=VERSION)
|
@@ -102,13 +102,7 @@ class PoliticalAdvertisingDataset(datasets.GeneratorBasedBuilder):
|
|
102 |
|
103 |
def _generate_examples(self, filepath: str):
|
104 |
logger.info("⏳ Generating examples from = %s", filepath)
|
105 |
-
|
106 |
-
df = pd.read_json(
|
107 |
-
filepath,
|
108 |
-
orient="records",
|
109 |
-
dtype={"tokens": list, "tags": list, "url": str, "tweet_id": str},
|
110 |
-
)
|
111 |
-
print(f"Shape: {df.shape}")
|
112 |
|
113 |
for row_id, row in df.iterrows():
|
114 |
yield row_id, {
|
|
|
37 |
class PoliticalAdvertisingDataset(datasets.GeneratorBasedBuilder):
|
38 |
VERSION = datasets.Version("1.0.0")
|
39 |
|
40 |
+
TRAIN_FILE = DATA_PATH / "train.feather"
|
41 |
+
VAL_FILE = DATA_PATH / "dev.feather"
|
42 |
+
TEST_FILE = DATA_PATH / "test.feather"
|
43 |
|
44 |
BUILDER_CONFIGS = [
|
45 |
datasets.BuilderConfig(name="political-advertising-pl", version=VERSION)
|
|
|
102 |
|
103 |
def _generate_examples(self, filepath: str):
|
104 |
logger.info("⏳ Generating examples from = %s", filepath)
|
105 |
+
df = pd.read_feather(filepath)
|
|
|
|
|
|
|
|
|
|
|
|
|
106 |
|
107 |
for row_id, row in df.iterrows():
|
108 |
yield row_id, {
|
test.feather
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:b82d236034b97450fbc74cc94f3c997f52cfa87399b8c6179cf33fdb9efabcaf
|
3 |
+
size 139258
|
test.json
DELETED
The diff for this file is too large to render.
See raw diff
|
|
train.feather
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:37a241b6324c241a1ec3758f449f67e332d78db014a325c30639161dec889f91
|
3 |
+
size 444042
|
train.json
DELETED
The diff for this file is too large to render.
See raw diff
|
|