mirror of
https://github.com/explosion/spaCy.git
synced 2025-08-05 12:50:20 +03:00
fixes
This commit is contained in:
parent
dbaf68a439
commit
1cc0d05812
6
setup.py
6
setup.py
|
@ -201,7 +201,11 @@ def setup_package():
|
||||||
for name in MOD_NAMES:
|
for name in MOD_NAMES:
|
||||||
mod_path = name.replace(".", "/") + ".pyx"
|
mod_path = name.replace(".", "/") + ".pyx"
|
||||||
ext = Extension(
|
ext = Extension(
|
||||||
name, [mod_path], language="c++", extra_compile_args=["-std=c++11"]
|
name,
|
||||||
|
[mod_path],
|
||||||
|
language="c++",
|
||||||
|
include_dirs=include_dirs,
|
||||||
|
extra_compile_args=["-std=c++11"],
|
||||||
)
|
)
|
||||||
ext_modules.append(ext)
|
ext_modules.append(ext)
|
||||||
print("Cythonizing sources")
|
print("Cythonizing sources")
|
||||||
|
|
|
@ -47,7 +47,7 @@ class Parser(TrainablePipe):
|
||||||
beam_density=0.0,
|
beam_density=0.0,
|
||||||
beam_update_prob=0.0,
|
beam_update_prob=0.0,
|
||||||
multitasks=tuple(),
|
multitasks=tuple(),
|
||||||
incorrect_spans_key=None
|
incorrect_spans_key=None,
|
||||||
):
|
):
|
||||||
"""Create a Parser.
|
"""Create a Parser.
|
||||||
|
|
||||||
|
|
|
@ -123,6 +123,7 @@ def test_ner_labels_added_implicitly_on_predict():
|
||||||
assert "D" in ner.labels
|
assert "D" in ner.labels
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.skip(reason="Not yet supported")
|
||||||
def test_ner_labels_added_implicitly_on_beam_parse():
|
def test_ner_labels_added_implicitly_on_beam_parse():
|
||||||
nlp = Language()
|
nlp = Language()
|
||||||
ner = nlp.add_pipe("beam_ner")
|
ner = nlp.add_pipe("beam_ner")
|
||||||
|
|
|
@ -255,7 +255,7 @@ cfg_string_multi = """
|
||||||
factory = "ner"
|
factory = "ner"
|
||||||
|
|
||||||
[components.ner.model]
|
[components.ner.model]
|
||||||
@architectures = "spacy.TransitionBasedParser.v2"
|
@architectures = "spacy.TransitionBasedParser.v3"
|
||||||
|
|
||||||
[components.ner.model.tok2vec]
|
[components.ner.model.tok2vec]
|
||||||
@architectures = "spacy.Tok2VecListener.v1"
|
@architectures = "spacy.Tok2VecListener.v1"
|
||||||
|
|
|
@ -5,7 +5,7 @@ from pathlib import Path
|
||||||
from spacy.about import __version__ as spacy_version
|
from spacy.about import __version__ as spacy_version
|
||||||
from spacy import util
|
from spacy import util
|
||||||
from spacy import prefer_gpu, require_gpu, require_cpu
|
from spacy import prefer_gpu, require_gpu, require_cpu
|
||||||
from spacy.util import dot_to_object, SimpleFrozenList
|
from spacy.util import dot_to_object, SimpleFrozenList, import_file, to_ternary_int
|
||||||
from thinc.api import Config, Optimizer, ConfigValidationError
|
from thinc.api import Config, Optimizer, ConfigValidationError
|
||||||
from thinc.api import set_current_ops
|
from thinc.api import set_current_ops
|
||||||
from spacy.training.batchers import minibatch_by_words
|
from spacy.training.batchers import minibatch_by_words
|
||||||
|
|
|
@ -40,9 +40,6 @@ class SpanGroups(UserDict):
|
||||||
doc = self._ensure_doc()
|
doc = self._ensure_doc()
|
||||||
return SpanGroups(doc).from_bytes(self.to_bytes())
|
return SpanGroups(doc).from_bytes(self.to_bytes())
|
||||||
|
|
||||||
def copy(self) -> "SpanGroups":
|
|
||||||
return SpanGroups(self.doc_ref()).from_bytes(self.to_bytes())
|
|
||||||
|
|
||||||
def to_bytes(self) -> bytes:
|
def to_bytes(self) -> bytes:
|
||||||
# We don't need to serialize this as a dict, because the groups
|
# We don't need to serialize this as a dict, because the groups
|
||||||
# know their names.
|
# know their names.
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
from collections.abc import Iterable as IterableInstance
|
from collections.abc import Iterable as IterableInstance
|
||||||
import warnings
|
|
||||||
import numpy
|
import numpy
|
||||||
from murmurhash.mrmr cimport hash64
|
from murmurhash.mrmr cimport hash64
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user