コード例 #1
0
ファイル: searchcluster.py プロジェクト: hideki/clustsrch
def main(argv):
    query = reduce(lambda x, y: x + " " + y ,argv[1:])
    results = bossapiv2.search(query, 20)
    if len(results) == 0:
        print "0 results"
    else:
        wordlist,wordvectors = bosstextproc.textprocess(results) 
        clusts = cluster.hcluster(rows=wordvectors, distance=distance.pearson, threshold=1.15)
        clusts = cluster.sortBySmallestId(clusts)
        cluster.printclusters(clusts, results, wordlist)
コード例 #2
0
def main(argv):
    query = reduce(lambda x, y: x + " " + y ,argv[1:])
    results = bossapiv2.search(query, 20)
    if len(results) == 0:
        print "0 results"
    else:
        wordlist,wordvectors = bosstextproc.textprocess(results) 
        clusts = cluster.hcluster(rows=wordvectors)
        clusts = cluster.divide(clusts[0], threshold=1.15)
        cluster.printclusters_eval(clusts, results, wordlist)