File size: 586 Bytes
372555a
63d5b2a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
372555a
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import os
import pandas as pd
import random

bad_words = ["stupid", "idiot", "hate you", "shut up", "worst", "trash", "dumb"]
good_words = ["hello", "thank you", "nice", "amazing", "respect", "kind", "helpful"]

data=[]
for _ in range(500):
    data.append({"text": random.choice(bad_words), "label": 1}) #bad

for _ in range(500):
    data.append({"text": random.choice(good_words), "label": 0}) #good

random.shuffle(data)
df = pd.DataFrame(data)


# ✅ Create 'data' directory if it doesn't exist
os.makedirs("./../data", exist_ok=True)

df.to_csv("./../data/text.csv", index=False)