Muhammad Saqib
commited on
Commit
•
df18fd9
1
Parent(s):
ea609ff
Delete modules/dataset.py
Browse files- modules/dataset.py +0 -19
modules/dataset.py
DELETED
@@ -1,19 +0,0 @@
|
|
1 |
-
from datasets import load_dataset
|
2 |
-
|
3 |
-
dataset = load_dataset("emotion", split="train")
|
4 |
-
|
5 |
-
emotions = dataset.info.features["label"].names
|
6 |
-
|
7 |
-
def query_emotion(start, end):
|
8 |
-
rows = dataset[start:end]
|
9 |
-
texts, labels = [rows[k] for k in rows.keys()]
|
10 |
-
|
11 |
-
observations = []
|
12 |
-
|
13 |
-
for i, text in enumerate(texts):
|
14 |
-
observations.append({
|
15 |
-
"text": text,
|
16 |
-
"emotion": emotions[labels[i]],
|
17 |
-
})
|
18 |
-
|
19 |
-
return observations
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|