spaCy/spacy/ml/models/coref.py
Sofie Van Landeghem e0c45c669a
Native coref component (#7243)
* initial coref_er pipe

* matcher more flexible

* base coref component without actual model

* initial setup of coref_er.score

* rename to include_label

* preliminary score_clusters method

* apply scoring in coref component

* IO fix

* return None loss for now

* rename to CoreferenceResolver

* some preliminary unit tests

* use registry as callable
2021-03-03 13:50:14 +01:00

19 lines
467 B
Python

from typing import List
from thinc.api import Model
from thinc.types import Floats2d
from ...util import registry
from ...tokens import Doc
@registry.architectures("spacy.Coref.v0")
def build_coref_model(
tok2vec: Model[List[Doc], List[Floats2d]]
) -> Model:
"""Build a coref resolution model, using a provided token-to-vector component.
TODO.
tok2vec (Model[List[Doc], List[Floats2d]]): The token-to-vector subnetwork.
"""
return tok2vec