683d81bb49096867f5ad8d3dde23217ea54d6790,examples/training/train_new_entity_type.py,,train_ner,#Any#Any#Any#,41

Before Change


def train_ner(nlp, train_data, output_dir):
    // Add new words to vocab
    for raw_text, _ in train_data:
        doc = nlp.make_doc(raw_text)
        for word in doc:
            _ = nlp.vocab[word.orth]
    random.seed(0)
    // You may need to change the learning rate. It"s generally difficult to

After Change


    for itn in range(50):
        losses = {}
        for batch in minibatch(get_gold_parses(nlp.make_doc, train_data), size=3):
            docs, golds = zip(*batch)
            nlp.update(docs, golds, losses=losses, sgd=optimizer, update_shared=True,
                       drop=0.35)
        print(losses)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


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: b408b5b29e60463ddf0dc16016d8d786e4827c35
Time: 2019-09-27
Author: tamuhey@gmail.com
File Name: spacy/language.py
Class Name: Language
Method Name: update


Project Name: explosion/spaCy
Commit Name: 8e7414daceed0a4f9d58dd12ad2f22be7f0097be
Time: 2019-10-27
Author: svlandeg@users.noreply.github.com
File Name: examples/training/ner_multitask_objective.py
Class Name:
Method Name: main