0x22almostEvil commited on
Commit
312eaed
1 Parent(s): 62df3ff
Files changed (1) hide show
  1. source/merge_datasets.py +12 -10
source/merge_datasets.py CHANGED
@@ -2,16 +2,17 @@ import pandas as pd
2
 
3
  n = 2
4
  total_n = 16
 
5
  # list of all the csv files
6
  csv_files = [
7
- "en-wikihow-qa-dataset-2k.csv",
8
- "ru-wikihow-qa-dataset-2k.csv",
9
- "pt-wikihow-qa-dataset-2k.csv",
10
- "nl-wikihow-qa-dataset-2k.csv",
11
- "it-wikihow-qa-dataset-2k.csv",
12
- "fr-wikihow-qa-dataset-2k.csv",
13
- "es-wikihow-qa-dataset-2k.csv",
14
- "de-wikihow-qa-dataset-2k.csv"
15
  ]
16
 
17
  # create an empty dataframe to hold the merged data
@@ -22,5 +23,6 @@ for file in csv_files:
22
  data = pd.read_csv(file)
23
  merged_data = pd.concat([merged_data, data], ignore_index=True)
24
 
25
- # write the merged data to a new csv file
26
- merged_data.to_csv("multilingial-wikihow-qa-dataset-16k.csv", index=False)
 
 
2
 
3
  n = 2
4
  total_n = 16
5
+
6
  # list of all the csv files
7
  csv_files = [
8
+ f"en-wikihow-qa-dataset-{n}k.csv",
9
+ f"ru-wikihow-qa-dataset-{n}k.csv",
10
+ f"pt-wikihow-qa-dataset-{n}k.csv",
11
+ f"nl-wikihow-qa-dataset-{n}k.csv",
12
+ f"it-wikihow-qa-dataset-{n}k.csv",
13
+ f"fr-wikihow-qa-dataset-{n}k.csv",
14
+ f"es-wikihow-qa-dataset-{n}k.csv",
15
+ f"de-wikihow-qa-dataset-{n}k.csv"
16
  ]
17
 
18
  # create an empty dataframe to hold the merged data
 
23
  data = pd.read_csv(file)
24
  merged_data = pd.concat([merged_data, data], ignore_index=True)
25
 
26
+ # write the merged data to new csv and parquet files
27
+ merged_data.to_csv(f"multilingial-wikihow-qa-dataset-{total_n}k.csv", index=False)
28
+ merged_data.to_parquet(f"multilingial-wikihow-qa-dataset-{total_n}k.parquet", row_group_size=100, engine="pyarrow", index=False)