MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / process_reviews

Function process_reviews

modelzoo/din/data/script/process_data.py:15–26  ·  view source on GitHub ↗
(file)

Source from the content-addressed store, hash-verified

13
14
15def process_reviews(file):
16 fi = open(file, "r")
17 user_map = {}
18 fo = open("reviews-info", "w")
19 for line in fi:
20 obj = eval(line)
21 userID = obj["reviewerID"]
22 itemID = obj["asin"]
23 rating = obj["overall"]
24 time = obj["unixReviewTime"]
25 print(userID + "\t" + itemID + "\t" + str(rating) + "\t" + str(time),
26 file=fo)
27
28
29def manual_join():

Callers 1

process_data.pyFile · 0.70

Calls 1

evalFunction · 0.50

Tested by

no test coverage detected