-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgenerate_dataset_py.py
More file actions
40 lines (30 loc) · 960 Bytes
/
Copy pathgenerate_dataset_py.py
File metadata and controls
40 lines (30 loc) · 960 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# -*- coding: utf-8 -*-
"""generate_dataset.py
Automatically generated by Colab.
Original file is located at
https://colab.research.google.com/drive/187uCtjVLcShRe2Z_O2XejltDUBkWztd0
"""
import pandas as pd
import random
random.seed(42)
items = ['wallet','water bottle','ID card','keys','notebook','umbrella']
colors = ['red','blue','black','white','green']
locations = ['Library','Cafeteria','Lab','Hostel']
rows = []
for i in range(500):
item = random.choice(items)
color = random.choice(colors)
loc = random.choice(locations)
rows.append({
"lost_desc": f"{color} {item} lost near {loc}",
"found_desc": f"found {color} {item} at {loc}",
"label": 1
})
rows.append({
"lost_desc": f"{color} {item} lost near {loc}",
"found_desc": f"found keys at Cafeteria",
"label": 0
})
df = pd.DataFrame(rows)
df.to_csv("lost_found_dataset.csv", index=False)
print("Dataset generated")