mirror of
https://github.com/explosion/spaCy.git
synced 2025-01-31 03:34:07 +03:00
rm component function
This commit is contained in:
parent
5c3337b81b
commit
73bedaa9ec
|
@ -1007,21 +1007,6 @@ def _get_labels_from_spancat(nlp: Language) -> Dict[str, Set[str]]:
|
||||||
return labels
|
return labels
|
||||||
|
|
||||||
|
|
||||||
def _get_labels_from_trainable_lemmatizer(nlp: Language) -> Set[str]:
|
|
||||||
pipe_names = [
|
|
||||||
pipe_name
|
|
||||||
for pipe_name in nlp.pipe_names
|
|
||||||
if nlp.get_pipe_meta(pipe_name).factory == "trainable_lemmatizer"
|
|
||||||
]
|
|
||||||
labels: Set[str] = set()
|
|
||||||
for pipe_name in pipe_names:
|
|
||||||
pipe = nlp.get_pipe(pipe_name)
|
|
||||||
# This gets lemmatization trees and no partial subtrees
|
|
||||||
for tree_id in pipe.tree2label.keys():
|
|
||||||
labels.add(pipe.trees.tree_to_str(tree_id))
|
|
||||||
return labels
|
|
||||||
|
|
||||||
|
|
||||||
def _gmean(l: List) -> float:
|
def _gmean(l: List) -> float:
|
||||||
"""Compute geometric mean of a list"""
|
"""Compute geometric mean of a list"""
|
||||||
return math.exp(math.fsum(math.log(i) for i in l) / len(l))
|
return math.exp(math.fsum(math.log(i) for i in l) / len(l))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user