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))
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)
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))
def build(args): _log.debug("run build with args={}".format(args)) wiki_knowledge.build_database_wrapper_to_file(args.src, args.dst)
def parse(args): _log.debug("run parse with args={}".format(args)) wiki_knowledge.parse_dump(args.dump, args.output)
def makedump(args): _log.debug("run makedump with args={}".format(args)) wiki_knowledge.make_dump(args.dumpfile, args.article)