Package com.gengoai.hermes.ml
Class HStringDataSetGenerator
- java.lang.Object
-
- com.gengoai.apollo.ml.DataSetGenerator<HString>
-
- com.gengoai.hermes.ml.HStringDataSetGenerator
-
- All Implemented Interfaces:
SerializableFunction<HString,Datum>
,Serializable
,Function<HString,Datum>
public class HStringDataSetGenerator extends DataSetGenerator<HString>
An extension to a DataSetGenerator that allows for the incoming documents to be broken up into multiple Datum based on a given
AnnotationType
.- Author:
- David B. Bracewell
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
HStringDataSetGenerator.Builder
Builder Class for HStringDataSetGenerator-
Nested classes/interfaces inherited from class com.gengoai.apollo.ml.DataSetGenerator
DataSetGenerator.GeneratorInfo<T extends Object>
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static HStringDataSetGenerator.Builder
builder()
Creates a builder which will build an HStringDataSetGenerator where there the generated datum represents the entireDocument
.static HStringDataSetGenerator.Builder
builder(@NonNull AnnotationType datumAnnotationType)
Creates a builder which will build an HStringDataSetGenerator where the givenAnnotationType
will be the basis for the Observation signals.DataSet
generate(@NonNull MStream<? extends HString> data)
DataSet
generate(@NonNull Collection<? extends HString> data)
-
Methods inherited from class com.gengoai.apollo.ml.DataSetGenerator
apply
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.gengoai.function.SerializableFunction
andThen, asConsumer, compose
-
-
-
-
Method Detail
-
builder
public static HStringDataSetGenerator.Builder builder(@NonNull @NonNull AnnotationType datumAnnotationType)
Creates a builder which will build an HStringDataSetGenerator where the givenAnnotationType
will be the basis for the Observation signals. For example, specifying aSENTENCE
annotation would create a Datum per sentence in the document.- Parameters:
datumAnnotationType
- the annotation type to use for generating Datum.- Returns:
- the builder
-
builder
public static HStringDataSetGenerator.Builder builder()
Creates a builder which will build an HStringDataSetGenerator where there the generated datum represents the entireDocument
.- Returns:
- the builder
-
generate
public DataSet generate(@NonNull @NonNull Collection<? extends HString> data)
- Overrides:
generate
in classDataSetGenerator<HString>
-
-