fe498b3d5e1e29fb756c203d50e217e8f258e561,examples/training/train_textcat.py,,main,#Any#Any#Any#Any#,31

Before Change


    print("Loading IMDB data...")
    (train_texts, train_cats), (dev_texts, dev_cats) = load_data(limit=n_texts)
    print("Using %d training examples" % n_texts)
    train_docs = [nlp.tokenizer(text) for text in train_texts]
    train_gold = [GoldParse(doc, cats=cats) for doc, cats in
                  zip(train_docs, train_cats)]
    train_data = list(zip(train_docs, train_gold))

After Change


    print("Loading IMDB data...")
    (train_texts, train_cats), (dev_texts, dev_cats) = load_data(limit=n_texts)
    print("Using %d training examples" % n_texts)
    train_data = list(zip(train_texts,
                          [{"cats": cats} for cats in train_cats]))

    // get names of other pipes to disable them during training
    other_pipes = [pipe for pipe in nlp.pipe_names if pipe != "textcat"]
    with nlp.disable_pipes(*other_pipes):  // only train textcat
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: explosion/spaCy
Commit Name: fe498b3d5e1e29fb756c203d50e217e8f258e561
Time: 2017-11-06
Author: ines@ines.io
File Name: examples/training/train_textcat.py
Class Name:
Method Name: main


Project Name: WZBSocialScienceCenter/tmtoolkit
Commit Name: 1ef5c7cff51c3f9d0f5dd2e3bad5f74405bf7b3b
Time: 2020-01-15
Author: markus.konrad@wzb.eu
File Name: tmtoolkit/preprocess/_preprocworker.py
Class Name: PreprocWorker
Method Name: _task_init


Project Name: allenai/allennlp
Commit Name: 22c97f0da03fd7e3d4649c267c0d2d9e8ac303ae
Time: 2017-09-01
Author: michael@schmitztech.com
File Name: allennlp/service/predictors/semantic_role_labeler.py
Class Name: SemanticRoleLabelerPredictor
Method Name: predict_json