def get_quest_vectorizers()

in tseval/evaluation/quest.py [0:0]


def get_quest_vectorizers():
    if not os.path.exists(QUEST_DIR):
        # Extract the quest archive file to QUEST_DIR:
        url = 'https://www.quest.dcs.shef.ac.uk/quest_files/questplusplus-vanilla.tar.gz'
        print(f'In order to use QuEst please install it to {QUEST_DIR} from {url}')
        return []

    def get_scoring_method(i):
        """Necessary to wrap the scoring_method() in get_scoring_method(), in order to set the external variable to
        its current value."""
        def scoring_method(complex_sentence, simple_sentence):
            return get_quest_features_on_qats_pair(complex_sentence, simple_sentence)[i]
        return scoring_method

    vectorizers = []
    for i, quest_feature in enumerate(quest_features):
        vectorizer = get_scoring_method(i)
        vectorizer.__name__ = f'QuEst_{quest_feature}'
        vectorizers.append(vectorizer)
    return vectorizers