public static String printView(View view) throws IOException { StringBuilder bldr = new StringBuilder(); bldr.append( "View '" ); bldr.append( view.getViewName() ); bldr.append( "':\n" ); for ( Constituent c: view.getConstituents() ) { bldr.append( printConstituent( c ) ); } bldr.append( OUTPUT_SEPARATOR ); return bldr.toString(); }
public static String printView(View view) throws IOException { StringBuilder bldr = new StringBuilder(); bldr.append( "View '" ); bldr.append( view.getViewName() ); bldr.append( "':\n" ); for ( Constituent c: view.getConstituents() ) { bldr.append( printConstituent( c ) ); } bldr.append( OUTPUT_SEPARATOR ); return bldr.toString(); }
new Constituent(fillerType, view.getViewName(), view.getTextAnnotation(), offsets.getFirst(), offsets.getSecond() + 1); fillerConstituent.addAttribute(EntityMentionIdAttribute, fillerId);
new Constituent(entityType, view.getViewName(), view.getTextAnnotation(), offsets.getFirst(), offsets.getSecond() + 1); mentionConstituent.addAttribute(EntityMentionTypeAttribute, noun_type);
if(view.getViewName().contains("PARSE")) view.addConstituent(c,true); else
new Constituent(entityType, view.getViewName(), view.getTextAnnotation(), offsets.getFirst(), offsets.getSecond() + 1); mentionConstituent.addAttribute(EntityMentionTypeAttribute, noun_type);
new Constituent(fillerType, view.getViewName(), view.getTextAnnotation(), offsets.getFirst(), offsets.getSecond() + 1); fillerConstituent.addAttribute(EntityMentionIdAttribute, fillerId);
private static void writeView(View view, JsonObject json) { writeString("viewType", view.getClass().getCanonicalName(), json); writeString("viewName", view.getViewName(), json); writeString("generator", view.getViewGenerator(), json); if (view.getScore() != 0) logger.error("There are "+(constituents.size()-consSet.size())+" duplicates constituents in the '" + view.getViewName() + "' view. " + "You have to fix this otherwise things will be messed up, upon deserialization : "+view.getTextAnnotation().getId());
private static void writeView(View view, JsonObject json) { writeString("viewType", view.getClass().getCanonicalName(), json); writeString("viewName", view.getViewName(), json); writeString("generator", view.getViewGenerator(), json); if (view.getScore() != 0) logger.error("There are "+(constituents.size()-consSet.size())+" duplicates constituents in the '" + view.getViewName() + "' view. " + "You have to fix this otherwise things will be messed up, upon deserialization : "+view.getTextAnnotation().getId());
entityCounts.put(neLabel, 1); Constituent neCon = new Constituent(neLabel, nerView.getViewName(), ta, cleanTextNeTokStart, cleanTextNeTokEnd + 1); //constituent token indexing uses one-past-the-end nerView.addConstituent(neCon);
entityCounts.put(neLabel, 1); Constituent neCon = new Constituent(neLabel, nerView.getViewName(), ta, cleanTextNeTokStart, cleanTextNeTokEnd + 1); //constituent token indexing uses one-past-the-end nerView.addConstituent(neCon);
int cleanTextNeTokStart = ta.getTokenIdFromCharacterOffset(cleanTextCharStart); int cleanTextNeTokEnd = ta.getTokenIdFromCharacterOffset(cleanTextCharEnd - 1); // StringTransformation returns one-past-the-end index; TextAnnotation maps at-the-end index Constituent neCon = new Constituent(neLabel, nerView.getViewName(), ta, cleanTextNeTokStart, cleanTextNeTokEnd + 1); //constituent token indexing uses one-past-the-end nerView.addConstituent(neCon);
viewDataBuilder.setViewName(view.getViewName()); viewDataBuilder.setGenerator(view.getViewGenerator()); viewDataBuilder.setScore(view.getScore());
viewDataBuilder.setViewName(view.getViewName()); viewDataBuilder.setGenerator(view.getViewGenerator()); viewDataBuilder.setScore(view.getScore());
int cleanTextNeTokStart = ta.getTokenIdFromCharacterOffset(cleanTextCharStart); int cleanTextNeTokEnd = ta.getTokenIdFromCharacterOffset(cleanTextCharEnd - 1); // StringTransformation returns one-past-the-end index; TextAnnotation maps at-the-end index Constituent neCon = new Constituent(neLabel, nerView.getViewName(), ta, cleanTextNeTokStart, cleanTextNeTokEnd + 1); //constituent token indexing uses one-past-the-end nerView.addConstituent(neCon);