@Override public List<Feature> extract(JCas jCas, Annotation ann) throws CleartkExtractorException { IdentifiedAnnotation idAnn = (IdentifiedAnnotation)ann; return Arrays.asList(new Feature("TypeID", String.valueOf(idAnn.getTypeID()))); } };
public static List getAnnotationsInSpan(JCas jcas, int type, int beginSpan, int endSpan, int[] validNeTypes) { List<IdentifiedAnnotation> list = new ArrayList<IdentifiedAnnotation>(); Iterator<?> itr = getAnnotationsIteratorInSpan(jcas, type, beginSpan, endSpan); while(itr.hasNext()) { IdentifiedAnnotation ne = (IdentifiedAnnotation)itr.next(); // might be an EventMention or an EntityMention if(isValidNE(ne.getTypeID(), validNeTypes)) list.add(ne); } return list; }
public static List getAnnotationsInSpan(JCas jcas, int type, int beginSpan, int endSpan, int[] validNeTypes) { List<IdentifiedAnnotation> list = new ArrayList<IdentifiedAnnotation>(); Iterator<?> itr = getAnnotationsIteratorInSpan(jcas, type, beginSpan, endSpan); while(itr.hasNext()) { IdentifiedAnnotation ne = (IdentifiedAnnotation)itr.next(); // might be an EventMention or an EntityMention if(isValidNE(ne.getTypeID(), validNeTypes)) list.add(ne); } return list; }
public String calcmWnClass () { if (m.getContent() instanceof IdentifiedAnnotation) { IdentifiedAnnotation ne = (IdentifiedAnnotation) m.getContent(); return String.valueOf(ne.getTypeID()); } else return "0"; }
public String calcmWnClass () { if (m.getContent() instanceof IdentifiedAnnotation) { IdentifiedAnnotation ne = (IdentifiedAnnotation) m.getContent(); return String.valueOf(ne.getTypeID()); } else return "0"; }
public boolean calcWnClass () { if (m1.getContent() instanceof IdentifiedAnnotation && m2.getContent() instanceof IdentifiedAnnotation) { IdentifiedAnnotation ne1 = (IdentifiedAnnotation) m1.getContent(); IdentifiedAnnotation ne2 = (IdentifiedAnnotation) m2.getContent(); if (ne1.getTypeID() == ne2.getTypeID()){ return true; } } return false; }
public boolean calcIsAnatomicalSite () { if (m1.getContent() instanceof IdentifiedAnnotation && ((IdentifiedAnnotation)m1.getContent()).getTypeID() == CONST.NE_TYPE_ID_ANATOMICAL_SITE){ return true; } return false; }
public String calcmIsProcedure () { if (m.getContent() instanceof IdentifiedAnnotation && ((IdentifiedAnnotation)m.getContent()).getTypeID() == CONST.NE_TYPE_ID_PROCEDURE) return "Y"; else return "N"; }
public boolean calcWnClassI () { if (m1.getContent() instanceof IdentifiedAnnotation && m2.getContent() instanceof IdentifiedAnnotation) { IdentifiedAnnotation ne1 = (IdentifiedAnnotation) m1.getContent(); IdentifiedAnnotation ne2 = (IdentifiedAnnotation) m2.getContent(); if (ne1.getTypeID() != ne2.getTypeID()){ return true; } return false; } return false; }
public boolean calcWnClassC () { if (m1.getContent() instanceof IdentifiedAnnotation && m2.getContent() instanceof IdentifiedAnnotation) { IdentifiedAnnotation ne1 = (IdentifiedAnnotation) m1.getContent(); IdentifiedAnnotation ne2 = (IdentifiedAnnotation) m2.getContent(); if (ne1.getTypeID() == ne2.getTypeID()){ return true; } return false; } return false; }
public String calcmIsDisorder () { if (m.getContent() instanceof IdentifiedAnnotation && ((IdentifiedAnnotation)m.getContent()).getTypeID() == CONST.NE_TYPE_ID_DISORDER) return "Y"; else return "N"; }
public boolean calcIsFinding () { if (m1.getContent() instanceof IdentifiedAnnotation && ((IdentifiedAnnotation)m1.getContent()).getTypeID() == CONST.NE_TYPE_ID_FINDING){ return true; } return false; }
public boolean calcIsProcedure () { if (m1.getContent() instanceof IdentifiedAnnotation && ((IdentifiedAnnotation)m1.getContent()).getTypeID() == CONST.NE_TYPE_ID_PROCEDURE){ return true; } return false; }
public boolean calcWnClassI () { if (m1.getContent() instanceof IdentifiedAnnotation && m2.getContent() instanceof IdentifiedAnnotation) { IdentifiedAnnotation ne1 = (IdentifiedAnnotation) m1.getContent(); IdentifiedAnnotation ne2 = (IdentifiedAnnotation) m2.getContent(); if (ne1.getTypeID() != ne2.getTypeID()){ return true; } return false; } return false; }
public boolean calcIsDrug () { if (m1.getContent() instanceof IdentifiedAnnotation && ((IdentifiedAnnotation)m1.getContent()).getTypeID() == CONST.NE_TYPE_ID_DRUG){ return true; } return false; }
public boolean calcIsProcedure () { if (m1.getContent() instanceof IdentifiedAnnotation && ((IdentifiedAnnotation)m1.getContent()).getTypeID() == CONST.NE_TYPE_ID_PROCEDURE){ return true; } return false; }
public String calcmIsDisorder () { if (m.getContent() instanceof IdentifiedAnnotation && ((IdentifiedAnnotation)m.getContent()).getTypeID() == CONST.NE_TYPE_ID_DISORDER) return "Y"; else return "N"; }
public String calcmIsProcedure () { if (m.getContent() instanceof IdentifiedAnnotation && ((IdentifiedAnnotation)m.getContent()).getTypeID() == CONST.NE_TYPE_ID_PROCEDURE) return "Y"; else return "N"; }
public static SimpleTree getUncertaintyTree(JCas jcas, IdentifiedAnnotation mention, SemanticClasses sems) { SimpleTree tree = null; tree = extractAboveLeftConceptTree(jcas, mention, sems); String treeStr = tree.toString(); treeStr = treeStr.replace("CONCEPT", "CONCEPT" + mention.getTypeID()); return SimpleTree.fromString(treeStr); }
public static SimpleTree getUncertaintyTree(JCas jcas, IdentifiedAnnotation mention, SemanticClasses sems) { SimpleTree tree = null; tree = extractAboveLeftConceptTree(jcas, mention, sems); String treeStr = tree.toString(); treeStr = treeStr.replace("CONCEPT", "CONCEPT" + mention.getTypeID()); return SimpleTree.fromString(treeStr); }