mirror of
https://github.com/explosion/spaCy.git
synced 2024-11-10 19:57:17 +03:00
Merge pull request #5441 from svlandeg/fix/updating
This commit is contained in:
commit
3100c97e69
|
@ -6,7 +6,7 @@ requires = [
|
|||
"cymem>=2.0.2,<2.1.0",
|
||||
"preshed>=3.0.2,<3.1.0",
|
||||
"murmurhash>=0.28.0,<1.1.0",
|
||||
"thinc==8.0.0a3",
|
||||
"thinc==8.0.0a8",
|
||||
"blis>=0.4.0,<0.5.0"
|
||||
]
|
||||
build-backend = "setuptools.build_meta"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# Our libraries
|
||||
cymem>=2.0.2,<2.1.0
|
||||
preshed>=3.0.2,<3.1.0
|
||||
thinc==8.0.0a3
|
||||
thinc==8.0.0a8
|
||||
blis>=0.4.0,<0.5.0
|
||||
ml_datasets>=0.1.1
|
||||
murmurhash>=0.28.0,<1.1.0
|
||||
|
|
|
@ -36,13 +36,13 @@ setup_requires =
|
|||
cymem>=2.0.2,<2.1.0
|
||||
preshed>=3.0.2,<3.1.0
|
||||
murmurhash>=0.28.0,<1.1.0
|
||||
thinc==8.0.0a3
|
||||
thinc==8.0.0a8
|
||||
install_requires =
|
||||
# Our libraries
|
||||
murmurhash>=0.28.0,<1.1.0
|
||||
cymem>=2.0.2,<2.1.0
|
||||
preshed>=3.0.2,<3.1.0
|
||||
thinc==8.0.0a3
|
||||
thinc==8.0.0a8
|
||||
blis>=0.4.0,<0.5.0
|
||||
wasabi>=0.4.0,<1.1.0
|
||||
srsly>=2.0.0,<3.0.0
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# fmt: off
|
||||
__title__ = "spacy"
|
||||
__version__ = "3.0.0.dev6"
|
||||
__version__ = "3.0.0.dev7"
|
||||
__release__ = True
|
||||
__download_url__ = "https://github.com/explosion/spacy-models/releases/download"
|
||||
__compatibility__ = "https://raw.githubusercontent.com/explosion/spacy-models/master/compatibility.json"
|
||||
|
|
|
@ -104,6 +104,8 @@ class Warnings(object):
|
|||
"string \"Field1=Value1,Value2|Field2=Value3\".")
|
||||
|
||||
# TODO: fix numbering after merging develop into master
|
||||
W097 = ("No Model config was provided to create the '{name}' component, "
|
||||
"and no default configuration could be found either.")
|
||||
W098 = ("No Model config was provided to create the '{name}' component, "
|
||||
"so a default configuration was used.")
|
||||
W099 = ("Expected 'dict' type for the 'model' argument of pipe '{pipe}', "
|
||||
|
|
|
@ -184,6 +184,7 @@ class Language(object):
|
|||
self.max_length = max_length
|
||||
self._optimizer = None
|
||||
|
||||
# TODO: de-uglify (incorporating into component decorator didn't work because of circular imports)
|
||||
from .ml.models.defaults import (
|
||||
default_tagger_config,
|
||||
default_parser_config,
|
||||
|
@ -349,6 +350,8 @@ class Language(object):
|
|||
if model_cfg is None and default_config is not None:
|
||||
warnings.warn(Warnings.W098.format(name=name))
|
||||
model_cfg = default_config["model"]
|
||||
if model_cfg is None:
|
||||
warnings.warn(Warnings.W097.format(name=name))
|
||||
model = None
|
||||
if model_cfg is not None:
|
||||
self.config[name] = {"model": model_cfg}
|
||||
|
|
|
@ -110,7 +110,8 @@ def init(model, X=None, Y=None):
|
|||
pad = model.ops.alloc4f(1, nF, nO, nP)
|
||||
|
||||
ops = model.ops
|
||||
W = normal_init(ops, W.shape, fan_in=nF * nI)
|
||||
scale = float(ops.xp.sqrt(1.0 / (nF * nI)))
|
||||
W = normal_init(ops, W.shape, mean=scale)
|
||||
model.set_param("W", W)
|
||||
model.set_param("b", b)
|
||||
model.set_param("pad", pad)
|
||||
|
|
|
@ -29,7 +29,7 @@ def _train_parser(parser):
|
|||
fix_random_seed(1)
|
||||
parser.add_label("left")
|
||||
parser.begin_training([], **parser.cfg)
|
||||
sgd = Adam(0.001, ops=NumpyOps())
|
||||
sgd = Adam(0.001)
|
||||
|
||||
for i in range(5):
|
||||
losses = {}
|
||||
|
@ -42,7 +42,7 @@ def _train_parser(parser):
|
|||
def test_add_label(parser):
|
||||
parser = _train_parser(parser)
|
||||
parser.add_label("right")
|
||||
sgd = Adam(0.001, ops=NumpyOps())
|
||||
sgd = Adam(0.001)
|
||||
for i in range(100):
|
||||
losses = {}
|
||||
doc = Doc(parser.vocab, words=["a", "b", "c", "d"])
|
||||
|
|
Loading…
Reference in New Issue
Block a user