4cd9ec0f00788d08c053b885b5591fe134666a65,examples/training/train_new_entity_type.py,,main,#Any#Any#Any#Any#,76

Before Change


        for itn in range(n_iter):
            random.shuffle(TRAIN_DATA)
            losses = {}
            for text, annotations in TRAIN_DATA:
                nlp.update([text], [annotations], sgd=optimizer, drop=0.35,
                           losses=losses)
            print(losses)

    // test the trained model
    test_text = "Do you like horses?"

After Change


            random.shuffle(TRAIN_DATA)
            losses = {}
            // batch up the examples using spaCy"s minibatch
            batches = minibatch(TRAIN_DATA, size=compounding(4., 32., 1.001))
            for batch in batches:
                texts, annotations = zip(*batch)
                nlp.update(texts, annotations, sgd=optimizer, drop=0.35,
                           losses=losses)
            print("Losses", losses)

    // test the trained model
    test_text = "Do you like horses?"
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 10

Instances


Project Name: explosion/spaCy
Commit Name: 4cd9ec0f00788d08c053b885b5591fe134666a65
Time: 2018-10-09
Author: ines@ines.io
File Name: examples/training/train_new_entity_type.py
Class Name:
Method Name: main


Project Name: explosion/spaCy
Commit Name: 683d81bb49096867f5ad8d3dde23217ea54d6790
Time: 2017-09-14
Author: honnibal+gh@gmail.com
File Name: examples/training/train_new_entity_type.py
Class Name:
Method Name: train_ner


Project Name: explosion/spaCy
Commit Name: 4cd9ec0f00788d08c053b885b5591fe134666a65
Time: 2018-10-09
Author: ines@ines.io
File Name: examples/training/train_ner.py
Class Name:
Method Name: main


Project Name: explosion/spaCy
Commit Name: 4cd9ec0f00788d08c053b885b5591fe134666a65
Time: 2018-10-09
Author: ines@ines.io
File Name: examples/training/train_new_entity_type.py
Class Name:
Method Name: main