Пример #1
0
def test_estimate_morals(example_texts):
    result = estimate_morals(example_texts, process=True)
    assert isinstance(result, pd.DataFrame)
    check_estimation_matrix(result,
                            (len(example_texts), len(lexicon_morals())))
    for doc in result[lexicon_morals()].values:
        for doc_pred in doc:
            check_moral_value(doc_pred)
Пример #2
0
def test_texts_moral(example_texts):
    for moral_trait in lexicon_morals():
        result = texts_moral(example_texts, moral_trait, process=True)
        assert len(result) is not 0
        assert len(result) == len(example_texts)
        for moral_trait_estimation in result:
            check_moral_value(moral_trait_estimation)
Пример #3
0
def test_texts_morals(example_texts):
    result = texts_morals(example_texts, process=True)
    assert isinstance(result, np.ndarray)
    check_estimation_matrix(result,
                            (len(example_texts), len(lexicon_morals())))
    for doc in result:
        for doc_pred in doc:
            check_moral_value(doc_pred)
Пример #4
0
def test_lexicon_morals():
    result = lexicon_morals()
    check_trait_list(result)