def bestWordCohOnTestcro(subsample=None):
    topics = subsampleList(croelectTopics,
                           subsample) if subsample else croelectTopics
    experiment(palmettoBestCrowiki(),
               action='run',
               topics=topics,
               posClass=['theme', 'theme_noise'])
    experiment(palmettoBestCrowiki(),
               action='signif',
               topics=topics,
               posClass=['theme', 'theme_noise'])
def bestDocCohOnTestcro(subsample=None):
    topics = subsampleList(croelectTopics,
                           subsample) if subsample else croelectTopics
    experiment(bestParamsDocCroelect(),
               action='run',
               topics=topics,
               posClass=['theme', 'theme_noise'])
    experiment(bestParamsDocCroelect(),
               action='signif',
               topics=topics,
               posClass=['theme', 'theme_noise'])
Exemple #3
0
def evaluateParamsOnDev(action='run', subsample=None, type=None):
    '''
    Evaluate measure parameters on the development set, ie
    construct the measures from parameter sets and evaluate measures.
    :param action: 'run' to evaluate, 'print' to print results
    :param subsample: if not None, size of dev subsample to run measures on, for testing
    :return:
    '''
    if subsample:
        from doc_topic_coh.coherence.measure_evaluation.utils import subsampleList
        evalTopics = subsampleList(dev, subsample)
    else:
        evalTopics = dev
    if not type or type.startswith('graph'):
        runGridGraphCorpus(action, evalTopics)
        runGridGraphWorld(action, evalTopics)
    if not type or type.startswith('distance'):
        runGridDistance('corpus', action, evalTopics)
        runGridDistance('world', action, evalTopics)
    if not type or type.startswith('density'):
        runGridDensity('corpus', action, evalTopics)
        runGridDensity('world', action, evalTopics)
Exemple #4
0
def bestDocCohOnTest(subsample=None):
    topics = subsampleList(test, subsample) if subsample else test
    experiment(bestParamsDoc(), topics=topics, action='run')
    experiment(bestParamsDoc(), topics=topics, action='signif')
Exemple #5
0
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')