| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_BEAM_SIZE |
| Constructor and Description |
|---|
ChunkerME(ChunkerModel model)
Initializes the current instance with the specified model.
|
ChunkerME(ChunkerModel model,
int beamSize)
Deprecated.
beam size is now stored inside the model
|
ChunkerME(ChunkerModel model,
int beamSize,
SequenceValidator<java.lang.String> sequenceValidator)
Deprecated.
Use
ChunkerME(ChunkerModel, int) instead
and use the ChunkerFactory to configure the SequenceValidator. |
ChunkerME(ChunkerModel model,
int beamSize,
SequenceValidator<java.lang.String> sequenceValidator,
ChunkerContextGenerator contextGenerator)
Deprecated.
Use
ChunkerME(ChunkerModel, int) instead
and use the ChunkerFactory to configure the SequenceValidator and ChunkerContextGenerator. |
| Modifier and Type | Method and Description |
|---|---|
java.util.List<java.lang.String> |
chunk(java.util.List<java.lang.String> toks,
java.util.List<java.lang.String> tags)
Deprecated.
|
java.lang.String[] |
chunk(java.lang.String[] toks,
java.lang.String[] tags)
Generates chunk tags for the given sequence returning the result in an array.
|
Span[] |
chunkAsSpans(java.lang.String[] toks,
java.lang.String[] tags)
Generates tagged chunk spans for the given sequence returning the result in a span array.
|
double[] |
probs()
Returns an array with the probabilities of the last decoded sequence.
|
void |
probs(double[] probs)
Populates the specified array with the probabilities of the last decoded sequence.
|
Sequence[] |
topKSequences(java.util.List<java.lang.String> sentence,
java.util.List<java.lang.String> tags)
Deprecated.
|
Sequence[] |
topKSequences(java.lang.String[] sentence,
java.lang.String[] tags)
Returns the top k chunk sequences for the specified sentence with the specified pos-tags
|
Sequence[] |
topKSequences(java.lang.String[] sentence,
java.lang.String[] tags,
double minSequenceScore)
Returns the top k chunk sequences for the specified sentence with the specified pos-tags
|
static ChunkerModel |
train(java.lang.String lang,
ObjectStream<ChunkSample> in,
ChunkerContextGenerator contextGenerator,
TrainingParameters mlParams)
Deprecated.
|
static ChunkerModel |
train(java.lang.String lang,
ObjectStream<ChunkSample> in,
TrainingParameters mlParams,
ChunkerFactory factory) |
public static final int DEFAULT_BEAM_SIZE
@Deprecated public ChunkerME(ChunkerModel model, int beamSize, SequenceValidator<java.lang.String> sequenceValidator, ChunkerContextGenerator contextGenerator)
ChunkerME(ChunkerModel, int) instead
and use the ChunkerFactory to configure the SequenceValidator and ChunkerContextGenerator.model - The model for this chunker.beamSize - The size of the beam that should be used when decoding sequences.sequenceValidator - The SequenceValidator to determines whether the outcome
is valid for the preceding sequence. This can be used to implement constraints
on what sequences are valid.@Deprecated public ChunkerME(ChunkerModel model, int beamSize, SequenceValidator<java.lang.String> sequenceValidator)
ChunkerME(ChunkerModel, int) instead
and use the ChunkerFactory to configure the SequenceValidator.model - The model for this chunker.beamSize - The size of the beam that should be used when decoding sequences.sequenceValidator - The SequenceValidator to determines whether the outcome
is valid for the preceding sequence. This can be used to implement constraints
on what sequences are valid.@Deprecated public ChunkerME(ChunkerModel model, int beamSize)
model - The model for this chunker.beamSize - The size of the beam that should be used when decoding sequences.public ChunkerME(ChunkerModel model)
model - @Deprecated
public java.util.List<java.lang.String> chunk(java.util.List<java.lang.String> toks,
java.util.List<java.lang.String> tags)
Chunkerpublic java.lang.String[] chunk(java.lang.String[] toks,
java.lang.String[] tags)
Chunkerpublic Span[] chunkAsSpans(java.lang.String[] toks, java.lang.String[] tags)
ChunkerchunkAsSpans in interface Chunkertoks - an array of the tokens or words of the sequence.tags - an array of the pos tags of the sequence.@Deprecated public Sequence[] topKSequences(java.util.List<java.lang.String> sentence, java.util.List<java.lang.String> tags)
ChunkertopKSequences in interface Chunkersentence - The tokens of the sentence.tags - The pos-tags for the specified sentence.public Sequence[] topKSequences(java.lang.String[] sentence, java.lang.String[] tags)
ChunkertopKSequences in interface Chunkersentence - The tokens of the sentence.tags - The pos-tags for the specified sentence.public Sequence[] topKSequences(java.lang.String[] sentence, java.lang.String[] tags, double minSequenceScore)
ChunkertopKSequences in interface Chunkersentence - The tokens of the sentence.tags - The pos-tags for the specified sentence.minSequenceScore - A lower bound on the score of a returned sequence.public void probs(double[] probs)
chunk. The
specified array should be at least as large as the numbe of tokens in the previous call to chunk.probs - An array used to hold the probabilities of the last decoded sequence.public double[] probs()
chunk.chunk
when it was last called.public static ChunkerModel train(java.lang.String lang, ObjectStream<ChunkSample> in, TrainingParameters mlParams, ChunkerFactory factory) throws java.io.IOException
java.io.IOExceptionpublic static ChunkerModel train(java.lang.String lang, ObjectStream<ChunkSample> in, ChunkerContextGenerator contextGenerator, TrainingParameters mlParams) throws java.io.IOException
train(String, ObjectStream, TrainingParameters, ChunkerFactory)
instead.java.io.IOExceptionCopyright © 2010 - 2020 Adobe. All Rights Reserved