コード例 #1
0
def test_batch_score():
    model = Numila(PARSE='batch', CHUNK_THRESHOLD=2)
    for _ in range(5):
        model.parse('the dog ate the steak')
    

    assert model.score('the dog ate the steak') > model.score('the ate dog steak the')
コード例 #2
0
ファイル: main.py プロジェクト: fredcallaway/graphs-in-space
def foo():
    model = Numila(GRAPH='vector')
    model = Numila(GRAPH='graph', CHUNK_THRESHOLD=0.05)
    corp = get_corpora('English', 'syl', 5000)
    model.fit(corp['train'])
    test = iter(corp['bleu_test'])
    print(model.parse(next(test)))
    print(model.speak(next(test)))
    print(model.speak(next(test)))
    print(model.speak(next(test)))

    print(model._debug['speak_chunks'])