Update README.md
Browse files
README.md
CHANGED
@@ -11,7 +11,7 @@ configs:
|
|
11 |
- config_name: default
|
12 |
data_files:
|
13 |
- split: train
|
14 |
-
path: "*.parquet"
|
15 |
---
|
16 |
|
17 |
# Elliquiy roleplaying forum data
|
@@ -40,7 +40,7 @@ The files need PyArrow installed from `pip` to be loaded with `pandas`. FastParq
|
|
40 |
```python
|
41 |
import pandas
|
42 |
|
43 |
-
# Load one
|
44 |
df = pandas.read_parquet('elliquiy-rp_2023-04_train-00000-of-00005.parquet')
|
45 |
|
46 |
# Load the shareGPT-like message group from one specific row into a standard Python list
|
@@ -48,6 +48,23 @@ messages = list(df.iloc[2350].messages)
|
|
48 |
|
49 |
```
|
50 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
Showing thread metadata from one specific row after loading the data:
|
52 |
|
53 |
```text
|
|
|
11 |
- config_name: default
|
12 |
data_files:
|
13 |
- split: train
|
14 |
+
path: "elliquiy-rp_2023-04*.parquet"
|
15 |
---
|
16 |
|
17 |
# Elliquiy roleplaying forum data
|
|
|
40 |
```python
|
41 |
import pandas
|
42 |
|
43 |
+
# Load a parquet file into one DataFrame
|
44 |
df = pandas.read_parquet('elliquiy-rp_2023-04_train-00000-of-00005.parquet')
|
45 |
|
46 |
# Load the shareGPT-like message group from one specific row into a standard Python list
|
|
|
48 |
|
49 |
```
|
50 |
|
51 |
+
Consolidate the parquet files into one large DataFrame (requires large amounts of memory):
|
52 |
+
|
53 |
+
```python
|
54 |
+
import glob
|
55 |
+
import pandas
|
56 |
+
|
57 |
+
filenames = sorted(glob.glob('*.parquet'))
|
58 |
+
parquets = []
|
59 |
+
|
60 |
+
# Read the parquet files one by one
|
61 |
+
for file in files:
|
62 |
+
parquets.append(pandas.read_parquet(file))
|
63 |
+
|
64 |
+
# Concatenate the parquet files into one DataFrame
|
65 |
+
full_df = pandas.concat(parquets)
|
66 |
+
```
|
67 |
+
|
68 |
Showing thread metadata from one specific row after loading the data:
|
69 |
|
70 |
```text
|