@SuppressWarnings("unchecked") public List<CoreMap> getAnnotatedChunks(List<CoreLabel> tokens, int totalTokensOffset, Class textKey, Class labelKey, Predicate<Pair<CoreLabel, CoreLabel>> checkTokensCompatible) { return getAnnotatedChunks(tokens, totalTokensOffset, textKey, labelKey, null, null, checkTokensCompatible); }
@SuppressWarnings("unchecked") public List<CoreMap> getAnnotatedChunks(List<CoreLabel> tokens, int totalTokensOffset, Class textKey, Class labelKey, Class tokenChunkKey, Class tokenLabelKey) { return getAnnotatedChunks(tokens, totalTokensOffset, textKey, labelKey, tokenChunkKey, tokenLabelKey, null); }
/** * Find and annotate chunks. Returns list of CoreMap (Annotation) objects. * * @param tokens - List of tokens to look for chunks * @param totalTokensOffset - Index of tokens to offset by * @param textKey - Key to use to find the token text * @param labelKey - Key to use to find the token label (to determine if inside chunk or not) * @return List of annotations (each as a CoreMap) representing the chunks of tokens */ @SuppressWarnings("unchecked") public List<CoreMap> getAnnotatedChunks(List<CoreLabel> tokens, int totalTokensOffset, Class textKey, Class labelKey) { return getAnnotatedChunks(tokens, totalTokensOffset, textKey, labelKey, null, null); }
annoTokenBegin = 0; List<CoreMap> chunks = chunkIdentifier.getAnnotatedChunks(tokens, annoTokenBegin, CoreAnnotations.TextAnnotation.class, nerCoreAnnotationClass, IS_TOKENS_COMPATIBLE); sentence.set(mentionsCoreAnnotationClass, chunks);
/** * Find and annotate chunks. Returns list of CoreMap (Annotation) objects. * * @param tokens - List of tokens to look for chunks * @param totalTokensOffset - Index of tokens to offset by * @param textKey - Key to use to find the token text * @param labelKey - Key to use to find the token label (to determine if inside chunk or not) * @return List of annotations (each as a CoreMap) representing the chunks of tokens */ @SuppressWarnings("unchecked") public List<CoreMap> getAnnotatedChunks(List<CoreLabel> tokens, int totalTokensOffset, Class textKey, Class labelKey) { return getAnnotatedChunks(tokens, totalTokensOffset, textKey, labelKey, null, null); }
@SuppressWarnings("unchecked") public List<CoreMap> getAnnotatedChunks(List<CoreLabel> tokens, int totalTokensOffset, Class textKey, Class labelKey, Predicate<Pair<CoreLabel, CoreLabel>> checkTokensCompatible) { return getAnnotatedChunks(tokens, totalTokensOffset, textKey, labelKey, null, null, checkTokensCompatible); }
@SuppressWarnings("unchecked") public List<CoreMap> getAnnotatedChunks(List<CoreLabel> tokens, int totalTokensOffset, Class textKey, Class labelKey, Class tokenChunkKey, Class tokenLabelKey) { return getAnnotatedChunks(tokens, totalTokensOffset, textKey, labelKey, tokenChunkKey, tokenLabelKey, null); }
/** * Find and annotate chunks. Returns list of CoreMap (Annotation) objects. * @param tokens - List of tokens to look for chunks * @param totalTokensOffset - Index of tokens to offset by * @param textKey - Key to use to find the token text * @param labelKey - Key to use to find the token label (to determine if inside chunk or not) * @return List of annotations (each as a CoreMap) representing the chunks of tokens */ @SuppressWarnings("unchecked") public List<CoreMap> getAnnotatedChunks(List<CoreLabel> tokens, int totalTokensOffset, Class textKey, Class labelKey) { return getAnnotatedChunks(tokens, totalTokensOffset, textKey, labelKey, null, null); }
/** * Find and annotate chunks. Returns list of CoreMap (Annotation) objects. * @param tokens - List of tokens to look for chunks * @param totalTokensOffset - Index of tokens to offset by * @param textKey - Key to use to find the token text * @param labelKey - Key to use to find the token label (to determine if inside chunk or not) * @return List of annotations (each as a CoreMap) representing the chunks of tokens */ @SuppressWarnings("unchecked") public List<CoreMap> getAnnotatedChunks(List<CoreLabel> tokens, int totalTokensOffset, Class textKey, Class labelKey) { return getAnnotatedChunks(tokens, totalTokensOffset, textKey, labelKey, null, null); }
annoTokenBegin = 0; List<CoreMap> chunks = chunkIdentifier.getAnnotatedChunks(tokens, annoTokenBegin, CoreAnnotations.TextAnnotation.class, nerCoreAnnotationClass, IS_TOKENS_COMPATIBLE); sentence.set(mentionsCoreAnnotationClass, chunks);