mirror of
https://github.com/explosion/spaCy.git
synced 2025-09-19 02:22:43 +03:00
removing unused imports
This commit is contained in:
parent
910026582d
commit
04b55bf054
|
@ -6,15 +6,7 @@ from typing import List, Callable, Tuple, Any
|
|||
from ...tokens import Doc
|
||||
from ...util import registry
|
||||
|
||||
from .coref_util import (
|
||||
get_predicted_clusters,
|
||||
get_candidate_mentions,
|
||||
select_non_crossing_spans,
|
||||
make_clean_doc,
|
||||
create_gold_scores,
|
||||
logsumexp,
|
||||
topk,
|
||||
)
|
||||
from .coref_util import get_candidate_mentions, select_non_crossing_spans, topk
|
||||
|
||||
|
||||
@registry.architectures("spacy.Coref.v1")
|
||||
|
|
|
@ -44,6 +44,7 @@ def topk(xp, arr, k, axis=None):
|
|||
def logsumexp(xp, arr, axis=None):
|
||||
"""Emulate torch.logsumexp by returning the log of summed exponentials
|
||||
along each row in the given dimension.
|
||||
TODO: currently not used?
|
||||
|
||||
Reduces a 2d array to 1d."""
|
||||
# from slide 5 here:
|
||||
|
@ -217,6 +218,7 @@ def get_clusters_from_doc(doc) -> List[List[Tuple[int, int]]]:
|
|||
def make_clean_doc(nlp, doc):
|
||||
"""Return a doc with raw data but not span annotations."""
|
||||
# Surely there is a better way to do this?
|
||||
# TODO: currently not used?
|
||||
|
||||
sents = [tok.is_sent_start for tok in doc]
|
||||
words = [tok.text for tok in doc]
|
||||
|
|
|
@ -17,7 +17,6 @@ from ..ml.models.coref_util import (
|
|||
create_gold_scores,
|
||||
MentionClusters,
|
||||
get_clusters_from_doc,
|
||||
logsumexp,
|
||||
get_predicted_clusters,
|
||||
DEFAULT_CLUSTER_PREFIX,
|
||||
doc2clusters,
|
||||
|
|
Loading…
Reference in New Issue
Block a user