Update README.md
Browse files
README.md
CHANGED
@@ -30,4 +30,39 @@ dataset_info:
|
|
30 |
---
|
31 |
# Dataset Card for "SemEval_traindata_emotions"
|
32 |
|
33 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
---
|
31 |
# Dataset Card for "SemEval_traindata_emotions"
|
32 |
|
33 |
+
Как был получен
|
34 |
+
|
35 |
+
```python
|
36 |
+
from datasets import load_dataset
|
37 |
+
import datasets
|
38 |
+
from torchvision.io import read_video
|
39 |
+
import json
|
40 |
+
import torch
|
41 |
+
import os
|
42 |
+
from torch.utils.data import Dataset, DataLoader
|
43 |
+
import tqdm
|
44 |
+
|
45 |
+
dataset_path = "./SemEval-2024_Task3/training_data/Subtask_2_train.json"
|
46 |
+
|
47 |
+
|
48 |
+
dataset = json.loads(open(dataset_path).read())
|
49 |
+
print(len(dataset))
|
50 |
+
|
51 |
+
all_conversations = []
|
52 |
+
|
53 |
+
|
54 |
+
for item in dataset:
|
55 |
+
all_conversations.extend(item["conversation"])
|
56 |
+
print(len(all_conversations))
|
57 |
+
|
58 |
+
all_data = datasets.Dataset.from_list(all_conversations)
|
59 |
+
all_data = all_data.train_test_split(
|
60 |
+
test_size=0.08,
|
61 |
+
seed=42,
|
62 |
+
)
|
63 |
+
|
64 |
+
all_data.push_to_hub(
|
65 |
+
"dim/SemEval_training_data_emotions",
|
66 |
+
token=open("./hf_token").read(),
|
67 |
+
)
|
68 |
+
```
|