class ClassifierBasedTransformation implements TransformationInterface
Classify whatever is passed in the transform and pass it a different set of transformations based on the class.
Can be used to create, for instance, language based transformations.
Methods
__construct(ClassifierInterface $cls)
In order to classify anything with NlpTools we need something that implements the ClassifierInterface. |
||
mixed |
transform($w)
Classify the passed in variable w and then apply each transformation to the output of the previous one. |
|
register(string $class, array|TransformationInterface $transforms)
Register a set of transformations for a given class. |
Details
at line 29
public
__construct(ClassifierInterface $cls)
In order to classify anything with NlpTools we need something that implements the ClassifierInterface.
We also need the set
of classes but that will be calculated by the classes for which
we register a transformation.
at line 38
public mixed
transform($w)
Classify the passed in variable w and then apply each transformation to the output of the previous one.
at line 58
public
register(string $class, array|TransformationInterface $transforms)
Register a set of transformations for a given class.