Class NameFinderEventStream

    • Constructor Detail

      • NameFinderEventStream

        public NameFinderEventStream​(ObjectStream<NameSample> dataStream,
                                     String type,
                                     NameContextGenerator contextGenerator,
                                     SequenceCodec<String> codec)
        Creates a new name finder event stream using the specified data stream and context generator.
        dataStream - The data stream of events.
        type - null or overrides the type parameter in the provided samples
        contextGenerator - The context generator used to generate features for the event stream.
    • Method Detail

      • generateOutcomes

        public static String[] generateOutcomes​(Span[] names,
                                                String type,
                                                int length)
        use the BioCodec implementation of the SequenceValidator instead!
        Generates the name tag outcomes (start, continue, other) for each token in a sentence with the specified length using the specified name spans.
        names - Token spans for each of the names.
        type - null or overrides the type parameter in the provided samples
        length - The length of the sentence.
        An array of start, continue, other outcomes based on the specified names and sentence length.
      • additionalContext

        public static String[][] additionalContext​(String[] tokens,
                                                   Map<String,​String> prevMap)
        Generated previous decision features for each token based on contents of the specified map.
        tokens - The token for which the context is generated.
        prevMap - A mapping of tokens to their previous decisions.
        An additional context array with features for each token.