Remove use of attr module in ud_train

This commit is contained in:
Matthew Honnibal 2018-03-11 00:59:39 +01:00
parent fa9fd21620
commit 2cab4d6517

View File

@ -4,7 +4,6 @@
from __future__ import unicode_literals from __future__ import unicode_literals
import plac import plac
import tqdm import tqdm
import attr
from pathlib import Path from pathlib import Path
import re import re
import sys import sys
@ -308,15 +307,11 @@ def initialize_pipeline(nlp, docs, golds, config):
# Command line helpers # # Command line helpers #
######################## ########################
@attr.s
class Config(object): class Config(object):
vectors = attr.ib(default=None) def __init__(self, vectors=None, max_doc_length=10, multitask_tag=True,
max_doc_length = attr.ib(default=10) multitask_sent=True, nr_epoch=30, batch_size=1000, dropout=0.2):
multitask_tag = attr.ib(default=True) for key, value in locals():
multitask_sent = attr.ib(default=True) setattr(self, key, value)
nr_epoch = attr.ib(default=30)
batch_size = attr.ib(default=1000)
dropout = attr.ib(default=0.2)
@classmethod @classmethod
def load(cls, loc): def load(cls, loc):