Implemented listScores command
This commit is contained in:
parent
23cc62ac01
commit
153aa434d5
18
caliGraph.py
18
caliGraph.py
@ -673,6 +673,15 @@ def recommendNBooks(G, mu, std, n, removeTopListsB=True, removeUselessRecommende
|
|||||||
addScoreToLabels(G)
|
addScoreToLabels(G)
|
||||||
|
|
||||||
|
|
||||||
|
def listScores(G, mu, std, n):
|
||||||
|
removeRestOfSeries(G)
|
||||||
|
removeKeepBest(G, n, maxDistForRead=10)
|
||||||
|
|
||||||
|
scaleBooksByRating(G)
|
||||||
|
scaleOpinionsByRating(G)
|
||||||
|
addScoreToLabels(G)
|
||||||
|
|
||||||
|
|
||||||
def fullGraph(G, removeTopListsB=True):
|
def fullGraph(G, removeTopListsB=True):
|
||||||
removeEdge(G)
|
removeEdge(G)
|
||||||
removeHighSpanTags(G, 7)
|
removeHighSpanTags(G, 7)
|
||||||
@ -897,10 +906,13 @@ def cliInterface():
|
|||||||
cmds = parser.add_subparsers(required=True, dest='cmd')
|
cmds = parser.add_subparsers(required=True, dest='cmd')
|
||||||
|
|
||||||
p_rec = cmds.add_parser('recommend', description="TODO", aliases=['rec'])
|
p_rec = cmds.add_parser('recommend', description="TODO", aliases=['rec'])
|
||||||
p_rec.add_argument('-n', type=int, default=25, help='number of books to recommend')
|
p_rec.add_argument('-n', type=int, default=20, help='number of books to recommend')
|
||||||
p_rec.add_argument('--tag-based', action="store_true")
|
p_rec.add_argument('--tag-based', action="store_true")
|
||||||
p_rec.add_argument('--recommender-based', action="store_true")
|
p_rec.add_argument('--recommender-based', action="store_true")
|
||||||
|
|
||||||
|
p_rec = cmds.add_parser('listScores', description="TODO", aliases=['ls'])
|
||||||
|
p_rec.add_argument('-n', type=int, default=50, help='number of books to recommend')
|
||||||
|
|
||||||
p_read = cmds.add_parser('read', description="TODO", aliases=[])
|
p_read = cmds.add_parser('read', description="TODO", aliases=[])
|
||||||
p_read.add_argument('--min-rating', type=int, default=0)
|
p_read.add_argument('--min-rating', type=int, default=0)
|
||||||
p_read.add_argument('--all-tags', action="store_true")
|
p_read.add_argument('--all-tags', action="store_true")
|
||||||
@ -935,6 +947,8 @@ def cliInterface():
|
|||||||
recommendNBooksRecommenderBased(G, mu, std, args.n, not args.keep_top_lists, not args.keep_useless_recommenders)
|
recommendNBooksRecommenderBased(G, mu, std, args.n, not args.keep_top_lists, not args.keep_useless_recommenders)
|
||||||
else:
|
else:
|
||||||
recommendNBooks(G, mu, std, args.n, not args.keep_top_lists, not args.keep_useless_recommenders)
|
recommendNBooks(G, mu, std, args.n, not args.keep_top_lists, not args.keep_useless_recommenders)
|
||||||
|
elif args.cmd=="listScores":
|
||||||
|
listScores(G, mu, std, args.n)
|
||||||
elif args.cmd=="read":
|
elif args.cmd=="read":
|
||||||
readBooksAnalysis(G, args.min_rating, args.all_tags, args.only_connected, not args.keep_top_lists)
|
readBooksAnalysis(G, args.min_rating, args.all_tags, args.only_connected, not args.keep_top_lists)
|
||||||
elif args.cmd=="analyze":
|
elif args.cmd=="analyze":
|
||||||
@ -958,7 +972,7 @@ def cliInterface():
|
|||||||
|
|
||||||
if not args.no_list:
|
if not args.no_list:
|
||||||
printBestList(G)
|
printBestList(G)
|
||||||
if not args.no_web:
|
if not args.no_web and not args.cmd in ['listScores']:
|
||||||
genAndShowHTML(G, darkMode=args.dark_mode)
|
genAndShowHTML(G, darkMode=args.dark_mode)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user