コード例 #1
0
ファイル: main.py プロジェクト: Zissi/nlpexample
def classify_with_expert_knowledge(paths):
    sentences, labels, class_names = load_test_data(paths)
    features, vocabulary, unused = extract_features_and_vocabulary(sentences)
    stemmed_target_features = [stem_words(target_feature) for target_feature in TARGET_FEATURES]
    predicted = classify(stemmed_target_features, features.toarray(), vocabulary)
    print('EXPERT KNOWLEDGE:')
    evaluate_classification(predicted, labels, sentences, class_names)
コード例 #2
0
ファイル: test_preprocesser.py プロジェクト: Zissi/nlpexample
def test_stem_words(words, stemmed_words):
    assert stem_words(words) == stemmed_words