def evalTopValues(algo, vectors, plot=False): if algo == 'distance': experiment(distanceParams(vectors), action='eval', evalTopics=test, evalPerc=0.95, plotEval=plot) elif algo == 'graph': if vectors == 'corpus': experiment(graphParams('tf-idf', cosine), action='eval', evalTopics=test, evalPerc=0.95, plotEval=plot) elif vectors == 'world': experiment(graphParams('word2vec', cosine), action='eval', evalTopics=test, evalPerc=0.95, plotEval=plot) elif algo == 'gauss': experiment(densityParams(vectors), action='eval', evalTopics=test, evalPerc=0.95, plotEval=plot)
def printTopSelected(algo, vectors): if algo == 'distance': if vectors == 'corpus': experiment(distanceParams(vectors), action='printTop', evalTopics=test, evalPerc=0.95, evalThresh=0.744) elif vectors == 'world': experiment(distanceParams(vectors), action='printTop', evalTopics=test, evalPerc=0.95, evalThresh=0.7316) elif algo == 'graph': if vectors == 'corpus': experiment(graphParams('tf-idf', cosine), action='printTop', evalTopics=test, evalPerc=0.95, evalThresh='median', th2per=thres2perc) elif vectors == 'world': experiment(graphParams('word2vec', cosine), action='printTop', evalTopics=test, evalPerc=0.95, evalThresh='median', th2per=thres2perc) elif algo == 'gauss': if vectors == 'corpus': experiment(densityParams(vectors), action='printTop', evalTopics=test, evalPerc=0.95, evalThresh='median') elif vectors == 'world': experiment(densityParams(vectors), action='printTop', evalTopics=test, evalPerc=0.95, evalThresh=0.715)
def runGridDensity(vectors, action='run', topics=dev): experiment(densityParams(vectors), action=action, topics=topics)
def runGridDistance(vectors, action='run', topics=dev): experiment(distanceParams(vectors), topics=topics, action=action)
def runGridGraphWorld(action='run', topics=dev): if action == 'print': experiment(graphParams('word2vec', cosine), action='print', topics=topics) else: experiment(graphParams('word2vec', cosine), topics=topics) experiment(graphParams('word2vec', l1), topics=topics) experiment(graphParams('word2vec-avg', l1), topics=topics) experiment(graphParams('word2vec', l2), topics=topics) experiment(graphParams('word2vec-avg', l2), topics=topics) experiment(graphParams('glove', cosine), topics=topics) experiment(graphParams('glove', l1), topics=topics) experiment(graphParams('glove-avg', l1), topics=topics) experiment(graphParams('glove', l2), topics=topics) experiment(graphParams('glove-avg', l2), topics=topics)
def runGridGraphCorpus(action='run', topics=dev): if action == 'print': experiment(graphParams('tf-idf', cosine), action=action, topics=topics) else: experiment(graphParams('tf-idf', cosine), topics=topics) experiment(graphParams('tf-idf', l1), topics=topics) experiment(graphParams('tf-idf', l2), topics=topics) experiment(graphParams('probability', cosine), topics=topics) experiment(graphParams('probability', l1), topics=topics) experiment(graphParams('probability', l2), topics=topics)
def bestDocCohOnTest(subsample=None): topics = subsampleList(test, subsample) if subsample else test experiment(bestParamsDoc(), topics=topics, action='run') experiment(bestParamsDoc(), topics=topics, action='signif')
def wordCohOnTest(subsample=None): topics = subsampleList(test, subsample) if subsample else test experiment(palmettoWordCoherence(True), topics=topics, action='run') experiment(palmettoWordCoherence(True), topics=topics, action='signif')