File size: 549 Bytes
1da285f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import json
import pandas as pd

split = 'genre'

with open(f"./results-{split}/app_list.txt", "r") as f:
    APP_LIST = [line.strip() for line in f.readlines()]

with open("./cat_apps-full.json", "r") as f:
    CAT_APPS = json.load(f)

for cat, apps in CAT_APPS.items():
    CAT_APPS[cat] = [app for app in apps if str(app) in APP_LIST]

CAT_APPS = {k:v for k,v in CAT_APPS.items() if k != 'VR' and len(v) > 0}

CAT_APPS['All'] = [int(app) for app in APP_LIST]

with open(f"./cat_apps-{split}.json", "w") as f:
    json.dump(CAT_APPS, f, indent=4)