コード例 #1
0
 def get_value(args):
     _log.debug("run build with args={}".format(args))
     if isinstance(args.dbpath , list):
         args.dbpath=args.dbpath[0]
     wdb = wiki_knowledge.load_db_wrapper_from_wdb(args.dbpath)
     v = wdb.get_text_centroid(args.text)
     
     _log.info("vector = {0}".format(v.data))
コード例 #2
0
 def get_top_topics(args):
     _log.debug("run build with args={}".format(args))
     if isinstance(args.dbpath , list):
         args.dbpath=args.dbpath[0]
     if isinstance(args.text_path , list):
         args.text_path=args.text_path[0]
     d = wiki_knowledge.get_value_from_file(args.dbpath, args.text_path)
     top = get_top(d,5)
     print "closests topics:"
     for t,v in top:
         print "{}:{:2.4f}".format(t,v)
コード例 #3
0
 def compare(args):
     _log.debug("run build with args={}".format(args))
     correlation = wiki_knowledge.compare(args.dbpath, args.text1, args.text2)
     _log.info("correlation = {0}".format(correlation))
コード例 #4
0
 def build(args):
     _log.debug("run build with args={}".format(args))
     wiki_knowledge.build_database_wrapper_to_file(args.src, args.dst)
コード例 #5
0
 def parse(args):
     _log.debug("run parse with args={}".format(args))
     wiki_knowledge.parse_dump(args.dump, args.output)
コード例 #6
0
 def makedump(args):
     _log.debug("run makedump with args={}".format(args))
     wiki_knowledge.make_dump(args.dumpfile, args.article)