@Test public void testChunkAsSpan() throws Exception { Span[] preds = chunker.chunkAsSpans(toks1, tags1); System.out.println(Arrays.toString(preds)); Assert.assertEquals(10, preds.length); Assert.assertEquals(new Span(0, 1, "NP"), preds[0]); Assert.assertEquals(new Span(1, 2, "VP"), preds[1]); Assert.assertEquals(new Span(2, 4, "NP"), preds[2]); Assert.assertEquals(new Span(4, 5, "VP"), preds[3]); Assert.assertEquals(new Span(5, 6, "SBAR"), preds[4]); Assert.assertEquals(new Span(6, 7, "NP"), preds[5]); Assert.assertEquals(new Span(7, 9, "VP"), preds[6]); Assert.assertEquals(new Span(9, 13, "NP"), preds[7]); Assert.assertEquals(new Span(13, 14, "PP"), preds[8]); Assert.assertEquals(new Span(14, 16, "NP"), preds[9]); }
public Span[] chunkAsSpans(String[] toks, String[] tags) { String[] preds = chunk(toks, tags); return ChunkSample.phrasesAsSpanList(toks, tags, preds); }
ChunkerME implements Chunker { public Span[] chunkAsSpans(String[] toks, String[] tags) { String[] preds = chunk(toks, tags); return ChunkSample.phrasesAsSpanList(toks, tags, preds); } }
ChunkerME implements Chunker { public Span[] chunkAsSpans(String[] toks, String[] tags) { String[] preds = chunk(toks, tags); return ChunkSample.phrasesAsSpanList(toks, tags, preds); } @Deprecated private  ChunkerME(ChunkerModel model, int beamSize, SequenceValidator<TokenTag> sequenceValidator,
      ChunkerContextGenerator contextGenerator); @Deprecated private  ChunkerME(ChunkerModel model, int beamSize);  ChunkerME(ChunkerModel model); }
ChunkerME implements Chunker { public Span[] chunkAsSpans(String[] toks, String[] tags) { String[] preds = chunk(toks, tags); return ChunkSample.phrasesAsSpanList(toks, tags, preds); } @Deprecated private  ChunkerME(ChunkerModel model, int beamSize, SequenceValidator<TokenTag> sequenceValidator,
      ChunkerContextGenerator contextGenerator); @Deprecated private  ChunkerME(ChunkerModel model, int beamSize);  ChunkerME(ChunkerModel model); String[] chunk(String[] toks, String[] tags); Span[] chunkAsSpans(String[] toks, String[] tags); Sequence[] topKSequences(String[] sentence, String[] tags); Sequence[] topKSequences(String[] sentence, String[] tags, double minSequenceScore); void probs(double[] probs); double[] probs(); static ChunkerModel train(String lang, ObjectStream<ChunkSample> in,
      TrainingParameters mlParams, ChunkerFactory factory); }
ChunkerME implements Chunker { public Span[] chunkAsSpans(String[] toks, String[] tags) { String[] preds = chunk(toks, tags); return ChunkSample.phrasesAsSpanList(toks, tags, preds); } @Deprecated private  ChunkerME(ChunkerModel model, int beamSize, SequenceValidator<TokenTag> sequenceValidator,
      ChunkerContextGenerator contextGenerator); @Deprecated private  ChunkerME(ChunkerModel model, int beamSize);  ChunkerME(ChunkerModel model); String[] chunk(String[] toks, String[] tags); Span[] chunkAsSpans(String[] toks, String[] tags); Sequence[] topKSequences(String[] sentence, String[] tags); Sequence[] topKSequences(String[] sentence, String[] tags, double minSequenceScore); void probs(double[] probs); double[] probs(); static ChunkerModel train(String lang, ObjectStream<ChunkSample> in,
      TrainingParameters mlParams, ChunkerFactory factory); static final int DEFAULT_BEAM_SIZE; }