public String[] getwindowtagskfrom(View TOKENS, View POS, int startspan, int endspan, int k) { String tags[] = new String[2 * k + 1]; int startwin = startspan - k; int endwin = endspan + k; if (endwin > TOKENS.getEndSpan()) { endwin = TOKENS.getEndSpan(); } if (startwin < 0) { startwin = 0; } for (int i = startwin; i < endwin; i++) { tags[i] = POS.getLabelsCoveringSpan(i, i + 1).get(0); } return tags; }
/** * Get the labels of the constituents covered by the input constituent {@code c} * * @param c A constituent, not necessarily of this text annotation. * @return A list of labels of constituents, which cover the same tokens as the input */ public List<String> getLabelsCovering(Constituent c) { return this.getLabelsCoveringSpan(c.getStartSpan(), c.getEndSpan()); }
public String[] getwindowtagskfrom(View TOKENS, View POS, int startspan, int endspan, int k) { String tags[] = new String[2 * k + 1]; int startwin = startspan - k; int endwin = endspan + k; if (endwin > TOKENS.getEndSpan()) { endwin = TOKENS.getEndSpan(); } if (startwin < 0) { startwin = 0; } for (int i = startwin; i < endwin; i++) { tags[i] = POS.getLabelsCoveringSpan(i, i + 1).get(0); } return tags; }
/** * Get the labels of the constituents covered by the input constituent {@code c} * * @param c A constituent, not necessarily of this text annotation. * @return A list of labels of constituents, which cover the same tokens as the input */ public List<String> getLabelsCovering(Constituent c) { return this.getLabelsCoveringSpan(c.getStartSpan(), c.getEndSpan()); }
/** * Extracts an array of POS-tags from a uniform window of size k * * @param POS The part-of-speech {@link View} of the {@link TextAnnotation} object * @param startspan The span at the beginning of the {@link Constituent} object * @param endspan The span at the end of the {@link Constituent} object * @param k The number of tokens to the left and right of the current {@link Constituent} object * to get * @return The window of k POS-tags to the left and k tokens to the right of the current * {@link Constituent} object */ private String[] getWindowKTags(View POS, int startspan, int endspan, int k) { String tags[] = new String[2 * k + 1]; int startwin = startspan - k; int endwin = endspan + k; if (endwin > POS.getEndSpan()) { endwin = POS.getEndSpan(); } if (startwin < 0) { startwin = 0; } int index = 0; for (int i = startwin; i < endwin; i++) { tags[index] = POS.getLabelsCoveringSpan(i, i + 1).get(0); index++; } return tags; }
/** * Extracts an array of POS-tags from a uniform window of size k * * @param POS The part-of-speech {@link View} of the {@link TextAnnotation} object * @param startspan The span at the beginning of the {@link Constituent} object * @param endspan The span at the end of the {@link Constituent} object * @param k The number of tokens to the left and right of the current {@link Constituent} object * to get * @return The window of k POS-tags to the left and k tokens to the right of the current * {@link Constituent} object */ private String[] getWindowKTags(View POS, int startspan, int endspan, int k) { String tags[] = new String[2 * k + 1]; int startwin = startspan - k; int endwin = endspan + k; if (endwin > POS.getEndSpan()) { endwin = POS.getEndSpan(); } if (startwin < 0) { startwin = 0; } int index = 0; for (int i = startwin; i < endwin; i++) { tags[index] = POS.getLabelsCoveringSpan(i, i + 1).get(0); index++; } return tags; }
POS.getLabelsCoveringSpan(token.getStartSpan(), token.getEndSpan()); List<String> Chunk_label = SHALLOW_PARSE.getLabelsCoveringSpan(token.getStartSpan(), token.getEndSpan()); i++; tags[i] = POS.getLabelsCoveringSpan(startspan, endspan).get(0);
POS.getLabelsCoveringSpan(token.getStartSpan(), token.getEndSpan()); tags[i] = POS.getLabelsCoveringSpan(c.getStartSpan(), c.getEndSpan()).get(0); i++; POS.getLabelsCoveringSpan(token.getStartSpan(), token.getEndSpan());
POS.getLabelsCoveringSpan(token.getStartSpan(), token.getEndSpan()); tags[i] = POS.getLabelsCoveringSpan(c.getStartSpan(), c.getEndSpan()).get(0); i++; POS.getLabelsCoveringSpan(token.getStartSpan(), token.getEndSpan());
POS.getLabelsCoveringSpan(token.getStartSpan(), token.getEndSpan()); List<String> Chunk_label = SHALLOW_PARSE.getLabelsCoveringSpan(token.getStartSpan(), token.getEndSpan()); i++; tags[i] = POS.getLabelsCoveringSpan(startspan, endspan).get(0);
SHALLOW_PARSE.getLabelsCoveringSpan(token.getStartSpan(), token.getEndSpan());
SHALLOW_PARSE.getLabelsCoveringSpan(token.getStartSpan(), token.getEndSpan());
List<String> betweenHeads = spView.getLabelsCoveringSpan(front_head.getEndSpan(), back_head.getStartSpan() - 1); for (int i = 0; i < betweenHeads.size(); i++){ ret.add(new Pair("chunker_between_heads_" + i, betweenHeads.get(i))); List<String> betweenExtents = spView.getLabelsCoveringSpan(front.getEndSpan(), back.getStartSpan() - 1); for (int i = 0; i < betweenExtents.size(); i++) { ret.add(new Pair("chunker_between_extents_" + i, betweenExtents.get(i))); List<String> betweenExtents = spView.getLabelsCoveringSpan(front.getStartSpan(), back.getStartSpan()); for (int i = 0; i < betweenExtents.size(); i++) { ret.add(new Pair("chunker_between_extents_inclusive_" + i, betweenExtents.get(i)));