changed data type for empty values
Browse files- prepare_data.py +1 -3
- test.jsonl.xz +2 -2
- train.jsonl.xz +2 -2
prepare_data.py
CHANGED
@@ -7,7 +7,6 @@ import datasets
|
|
7 |
from datasets import load_dataset
|
8 |
|
9 |
|
10 |
-
|
11 |
def save_and_compress(dataset: Union[datasets.Dataset, pd.DataFrame], name: str, idx=None):
|
12 |
if idx:
|
13 |
path = f"{name}_{idx}.jsonl"
|
@@ -21,8 +20,6 @@ def save_and_compress(dataset: Union[datasets.Dataset, pd.DataFrame], name: str,
|
|
21 |
os.system(f'xz -zkf -T0 {path}') # -TO to use multithreading
|
22 |
|
23 |
|
24 |
-
|
25 |
-
|
26 |
def get_dataset_column_from_text_folder(folder_path):
|
27 |
return load_dataset("text", data_dir=folder_path, sample_by="document", split='train').to_pandas()['text']
|
28 |
|
@@ -56,4 +53,5 @@ for split in ["train", "test"]:
|
|
56 |
df['summary/full'] = get_dataset_column_from_text_folder(summary_full_path)
|
57 |
dfs.append(df)
|
58 |
df = pd.concat(dfs)
|
|
|
59 |
save_and_compress(df, f"data/{split}")
|
|
|
7 |
from datasets import load_dataset
|
8 |
|
9 |
|
|
|
10 |
def save_and_compress(dataset: Union[datasets.Dataset, pd.DataFrame], name: str, idx=None):
|
11 |
if idx:
|
12 |
path = f"{name}_{idx}.jsonl"
|
|
|
20 |
os.system(f'xz -zkf -T0 {path}') # -TO to use multithreading
|
21 |
|
22 |
|
|
|
|
|
23 |
def get_dataset_column_from_text_folder(folder_path):
|
24 |
return load_dataset("text", data_dir=folder_path, sample_by="document", split='train').to_pandas()['text']
|
25 |
|
|
|
53 |
df['summary/full'] = get_dataset_column_from_text_folder(summary_full_path)
|
54 |
dfs.append(df)
|
55 |
df = pd.concat(dfs)
|
56 |
+
df = df.fillna("") # NaNs can lead to huggingface not recognizing the feature type of the column
|
57 |
save_and_compress(df, f"data/{split}")
|
test.jsonl.xz
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:e56dd68c9d505c9c7850f32f9cd883a8e6737585f481c5aff35eb98623449098
|
3 |
+
size 2323792
|
train.jsonl.xz
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:058ff61ae9c1c8f25c9bcaf3a33b3f472c74fde69b4aab7039121304e51f8ba5
|
3 |
+
size 50582572
|