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

Before Change


                //if not gold.ner[i].endswith("ANIMAL"):
                //    gold.ner[i] = "-"
            doc = nlp.make_doc(raw_text)
            nlp.tagger(doc)
            // As of 1.9, spaCy"s parser now lets you supply a dropout probability
            // This might help the model generalize better from only a few
            // examples.
            loss += nlp.entity.update(doc, gold, drop=0.9)

After Change


    optimizer = nlp.begin_training(lambda: [])
    nlp.meta["name"] = "en_ent_animal"
    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)
    if not output_dir:
        return
    elif not output_dir.exists():
        output_dir.mkdir()
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: estnltk/estnltk
Commit Name: f44cb644187ca69159fd79fb917077520c3ea031
Time: 2014-11-28
Author: brainscauseminds@gmail.com
File Name: estnltk/examples/ex01.py
Class Name:
Method Name:


Project Name: estnltk/estnltk
Commit Name: d02455a981e07a6fbf56e0e128b0aa085d112aed
Time: 2014-12-12
Author: brainscauseminds@gmail.com
File Name: estnltk/examples/ex10.py
Class Name:
Method Name: