MCPcopy
hub / github.com/HIT-SCIR/ltp / _check

Method _check

python/interface/ltp/nerual.py:67–80  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

65 self.hook.add_word(word, freq)
66
67 def _check(self):
68 self.eval()
69 for vocab, task in (
70 (self.cws_vocab, "cws"),
71 (self.pos_vocab, "pos"),
72 (self.ner_vocab, "ner"),
73 (self.srl_vocab, "srl"),
74 (self.dep_vocab, "dep"),
75 (self.sdp_vocab, "sdp"),
76 (self.sdp_vocab, "sdpg"),
77 ):
78 if vocab is not None and len(vocab) > 0:
79 self.supported_tasks.add(task)
80 self.post[task] = getattr(self, f"_{task}_post")
81
82 def load_state_dict(self, state_dict: Mapping[str, Any], strict: bool = True):
83 self.model.load_state_dict(state_dict, strict=strict)

Callers 1

__init__Method · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected