hisham-cmd commited on
Commit
19b093d
·
verified ·
1 Parent(s): dfb584c

Delete check_dupes.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. check_dupes.py +0 -24
check_dupes.py DELETED
@@ -1,24 +0,0 @@
1
- import json
2
-
3
- with open(r'c:\react_projects\VortexCommerce\kaggle\extra_products_vortex.json', 'r', encoding='utf-8') as f:
4
- data = json.load(f)
5
- if isinstance(data, dict):
6
- products = data.get('products', [])
7
- else:
8
- products = data
9
-
10
- seen_ar = set()
11
- seen_en = set()
12
- dupes = 0
13
- for p in products:
14
- ar = p.get('name_ar', '').strip()
15
- en = p.get('name_en', '').strip()
16
- if ar in seen_ar or en in seen_en:
17
- dupes += 1
18
- else:
19
- seen_ar.add(ar)
20
- seen_en.add(en)
21
-
22
- print(f"Total Products in JSON: {len(products)}")
23
- print(f"Duplicates found: {dupes}")
24
- print(f"Expected unique: {len(products) - dupes}")