MCPcopy Create free account
hub / github.com/hankcs/HanLP / predict

Method predict

hanlp/common/component.py:13–23  ·  view source on GitHub ↗

Predict on data. This is the base class for all components, including rule based and statistical ones. Args: *args: Any type of data subject to sub-classes **kwargs: Additional arguments Returns: Any predicted annotations.

(self, *args, **kwargs)

Source from the content-addressed store, hash-verified

11class Component(Configurable, ABC):
12 @abstractmethod
13 def predict(self, *args, **kwargs):
14 """Predict on data. This is the base class for all components, including rule based and statistical ones.
15
16 Args:
17 *args: Any type of data subject to sub-classes
18 **kwargs: Additional arguments
19
20 Returns: Any predicted annotations.
21
22 """
23 raise NotImplementedError('%s.%s()' % (self.__class__.__name__, inspect.stack()[0][3]))
24
25 def __call__(self, *args, **kwargs):
26 """

Callers 1

__call__Method · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected