-
Notifications
You must be signed in to change notification settings - Fork 0
/
getRecommendation.py
46 lines (42 loc) · 1.17 KB
/
getRecommendation.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
from goodreadsRecommender import goodreads_recommender
from tastediveRecommender import tastedive_recommender
#type = book, movie, show, game
#for book start all words capital
def get_recommendation(type, name):
recommendations = []
if type == "book":
from goodreadsContentBasedBookRecommendation import corpus_recommendations
try:
recommendations.extend(goodreads_recommender(name))
except Exception:
pass
try:
recommendations.extend(tastedive_recommender("books", name))
except Exception:
pass
try:
recommendations.extend(corpus_recommendations(name))
except Exception:
pass
elif type == "movie":
from movieRecommenderSystems import hybrid_recommender
try:
recommendations.extend(tastedive_recommender("movies", name))
except Exception:
pass
try:
recommendations.extend(hybrid_recommender(name))
except Exception:
pass
elif type == "show":
try:
recommendations.extend(tastedive_recommender("shows", name))
except Exception:
pass
elif type == "game":
try:
recommendations.extend(tastedive_recommender("games", name))
except Exception:
pass
return recommendations
#print(get_recommendation("movie", "Taken"))