-
Notifications
You must be signed in to change notification settings - Fork 1
/
app.py
73 lines (58 loc) · 1.53 KB
/
app.py
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
from reco import Reco
from common import db_manager
from common import mongo_manager
from common.util import utils
import json
import logging
logging.getLogger('sqlalchemy.engine').setLevel(logging.INFO)
with open('./jsonData.json') as conf_json:
jsonData = json.load(conf_json)
"""
추천모듈 사용방법!!!
#추천 모듈 객체 생성!
recoModule = Reco(jsonData, None) #첫번째 인자는 일정보강 모듈에서 받은 json데이터, 두번째 인자는 유저성향인데 현재 사용하지 않으니 None으로
#추천 데이터 가져오기!
recoModule.getRecoList()
끗!
"""
recoModule = Reco(jsonData, '2')
"""
print("=====================")
print("filtered list")
print("=====================")
for category in filteredList:
print("category : " + str(category))
i=0
for listItem in filteredList[category]:
print(
"[%2d] %5s %s"
%
(
i,
listItem['region'],
listItem['title']
)
)
i+=1
print("\n\n\n")
"""
print("=====================")
print("sorted list")
print("=====================")
sortedList = recoModule.getRecoList()
for category in sortedList:
print("category : " + str(category))
i=0
for listItem in sortedList[category]:
print(
"[%2d] %5s %5d %s"
%
(
i,
listItem['region'],
listItem['score'],
listItem['title']
)
)
i+=1
print(sortedList)