23c3ec4df2b394e82c0fe333bdbd3b2d9b278f4e,tests/test_model.py,,model,#Any#,66

Before Change


    for counts in instances:
        model.updater.time += 1
        for clas, feats in counts.items():
            for key, value in feats.items():
                model.updater.update_weight(key, clas, value)
    return model

def get_score(model, feats, clas):
    eg = Example.from_feats(model.nr_class, feats, gold=clas)

After Change


@pytest.fixture
def model(instances):
    templates = []
    for batch in instances:
        for _, feats in batch:
            for key in feats:
                templates.append((key,))
    templates = tuple(set(templates))
    model = AveragedPerceptron(templates)
    for batch in instances:
        model.time += 1
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: explosion/thinc
Commit Name: 23c3ec4df2b394e82c0fe333bdbd3b2d9b278f4e
Time: 2016-01-28
Author: honnibal@gmail.com
File Name: tests/test_model.py
Class Name:
Method Name: model


Project Name: explosion/thinc
Commit Name: 2fb4f0fcad82ebf931f6f83f220679b1e02066a4
Time: 2015-11-06
Author: honnibal@gmail.com
File Name: tests/test_model.py
Class Name:
Method Name: model


Project Name: explosion/thinc
Commit Name: 2fb4f0fcad82ebf931f6f83f220679b1e02066a4
Time: 2015-11-06
Author: honnibal@gmail.com
File Name: tests/test_model.py
Class Name:
Method Name: test_basic