Package com.gengoai.hermes.ml.feature
Class PredefinedFeatures
- java.lang.Object
-
- com.gengoai.hermes.ml.feature.PredefinedFeatures
-
public final class PredefinedFeatures extends Object
The type Predefined features.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PredefinedFeatures.PredefinedFeaturizer
The type Predefined featurizer.
-
Constructor Summary
Constructors Constructor Description PredefinedFeatures()
Instantiates a new Predefined features.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Featurizer<HString>
get(String name)
Get featurizer.static String
lenientContext(@NonNull Object... objects)
Lenient context string.static PredefinedFeatures.PredefinedFeaturizer
predefinedFeature(String name, @NonNull Featurizer<HString> featurizer)
Predefined feature predefined featurizer.static PredefinedFeatures.PredefinedFeaturizer
predefinedPredicateFeature(String name, @NonNull SerializablePredicate<? super HString> featurizer)
Predefined predicate feature predefined featurizer.static PredefinedFeatures.PredefinedFeaturizer
predefinedValueFeature(String name, @NonNull SerializableFunction<? super HString,String> featurizer)
Predefined value feature predefined featurizer.static String
strictContext(boolean mustMatch, @NonNull Object... objects)
Strict context string.static String
strictContext(@NonNull Object... objects)
Strict context string.
-
-
-
Method Detail
-
get
public static Featurizer<HString> get(String name)
Get featurizer.- Parameters:
name
- the name- Returns:
- the featurizer
-
lenientContext
public static String lenientContext(@NonNull @NonNull Object... objects)
Lenient context string.- Parameters:
objects
- the objects- Returns:
- the string
-
predefinedFeature
public static PredefinedFeatures.PredefinedFeaturizer predefinedFeature(String name, @NonNull @NonNull Featurizer<HString> featurizer)
Predefined feature predefined featurizer.- Parameters:
name
- the namefeaturizer
- the featurizer- Returns:
- the predefined featurizer
-
predefinedPredicateFeature
public static PredefinedFeatures.PredefinedFeaturizer predefinedPredicateFeature(String name, @NonNull @NonNull SerializablePredicate<? super HString> featurizer)
Predefined predicate feature predefined featurizer.- Parameters:
name
- the namefeaturizer
- the featurizer- Returns:
- the predefined featurizer
-
predefinedValueFeature
public static PredefinedFeatures.PredefinedFeaturizer predefinedValueFeature(String name, @NonNull @NonNull SerializableFunction<? super HString,String> featurizer)
Predefined value feature predefined featurizer.- Parameters:
name
- the namefeaturizer
- the featurizer- Returns:
- the predefined featurizer
-
strictContext
public static String strictContext(@NonNull @NonNull Object... objects)
Strict context string.- Parameters:
objects
- the objects- Returns:
- the string
-
-