From 2cab4d651732bad2520ab8aa566a6a91cb3c7bda Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Sun, 11 Mar 2018 00:59:39 +0100 Subject: [PATCH] Remove use of attr module in ud_train --- spacy/cli/ud_train.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/spacy/cli/ud_train.py b/spacy/cli/ud_train.py index bc106fb6b..aa9d731c1 100644 --- a/spacy/cli/ud_train.py +++ b/spacy/cli/ud_train.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals import plac import tqdm -import attr from pathlib import Path import re import sys @@ -308,15 +307,11 @@ def initialize_pipeline(nlp, docs, golds, config): # Command line helpers # ######################## -@attr.s class Config(object): - vectors = attr.ib(default=None) - max_doc_length = attr.ib(default=10) - multitask_tag = attr.ib(default=True) - multitask_sent = attr.ib(default=True) - nr_epoch = attr.ib(default=30) - batch_size = attr.ib(default=1000) - dropout = attr.ib(default=0.2) + def __init__(self, vectors=None, max_doc_length=10, multitask_tag=True, + multitask_sent=True, nr_epoch=30, batch_size=1000, dropout=0.2): + for key, value in locals(): + setattr(self, key, value) @classmethod def load(cls, loc):