private void addNamedEntity(JCas jcas, int begin, int end, Map<String, OntologyConcept> concepts, boolean bMedication, Set<NegSpan> negSet) { if (concepts.isEmpty()) return; IdentifiedAnnotation neLast = bMedication ? new MedicationEventMention( jcas) : new EntityMention(jcas); neLast.setPolarity(negSet.contains(new NegSpan(begin, end)) ? CONST.NE_POLARITY_NEGATION_PRESENT : CONST.NE_POLARITY_NEGATION_ABSENT); neLast.setBegin(begin); neLast.setEnd(end); FSArray ocArr = new FSArray(jcas, concepts.size()); int ocArrIdx = 0; for (OntologyConcept oc : concepts.values()) { // set the cui field if this is in fact a cui ocArr.set(ocArrIdx, oc); ocArrIdx++; } neLast.setOntologyConceptArr(ocArr); concepts.clear(); neLast.addToIndexes(); }
private void addNamedEntity(JCas jcas, int begin, int end, Map<String, OntologyConcept> concepts, boolean bMedication, Set<NegSpan> negSet) { if (concepts.isEmpty()) return; IdentifiedAnnotation neLast = bMedication ? new MedicationEventMention( jcas) : new EntityMention(jcas); neLast.setPolarity(negSet.contains(new NegSpan(begin, end)) ? CONST.NE_POLARITY_NEGATION_PRESENT : CONST.NE_POLARITY_NEGATION_ABSENT); neLast.setBegin(begin); neLast.setEnd(end); FSArray ocArr = new FSArray(jcas, concepts.size()); int ocArrIdx = 0; for (OntologyConcept oc : concepts.values()) { // set the cui field if this is in fact a cui ocArr.set(ocArrIdx, oc); ocArrIdx++; } neLast.setOntologyConceptArr(ocArr); concepts.clear(); neLast.addToIndexes(); }
neAnnot.setDiscoveryTechnique( CONST.NE_DISCOVERY_TECH_DICT_LOOKUP ); neAnnot.setOntologyConceptArr( ocArr ); neAnnot.addToIndexes(); } else { iv_logger.warn( "Filtered out: " + text );
neAnnot.setDiscoveryTechnique( CONST.NE_DISCOVERY_TECH_DICT_LOOKUP ); neAnnot.setOntologyConceptArr( ocArr ); neAnnot.addToIndexes(); } else { iv_logger.warn( "Filtered out: " + text );
annotation.setDiscoveryTechnique( CONST.NE_DISCOVERY_TECH_DICT_LOOKUP ); annotation.setOntologyConceptArr( conceptArr ); annotation.addToIndexes();
eMention.addToIndexes();
annotation.setDiscoveryTechnique( CONST.NE_DISCOVERY_TECH_DICT_LOOKUP ); annotation.setOntologyConceptArr( conceptArr ); annotation.addToIndexes();
@Override public void process(JCas jcas) throws AnalysisEngineProcessException { // Create a dummy IdentifiedAnnotation in the type system // If the BaseToken Part Of Speech is a Noun Collection<BaseToken> tokens = JCasUtil.select(jcas, BaseToken.class); for (BaseToken token : tokens) { if (saveAnnotation && token.getPartOfSpeech() != null && token.getPartOfSpeech().startsWith("N")) { IdentifiedAnnotation ann = new IdentifiedAnnotation(jcas); ann.setBegin(token.getBegin()); ann.setEnd(token.getEnd()); ann.addToIndexes(); if (printAnnotation) { LOG.info("Token:" + token.getCoveredText() + " POS:" + token.getPartOfSpeech()); } } } }
mention.addToIndexes(); idAnnotationMap.put(annotation.id, mention);
neAnnot.setDiscoveryTechnique( CONST.NE_DISCOVERY_TECH_DICT_LOOKUP ); neAnnot.setOntologyConceptArr( conceptArr ); neAnnot.addToIndexes();
mention.addToIndexes(); idAnnotationMap.put(annotation.id, mention);
mention.addToIndexes(); idAnnotationMap.put(annotation.id, mention);
mention.addToIndexes(); idAnnotationMap.put(annotation.id, mention);
neAnnot.setOntologyConceptArr( ocArr ); neAnnot.setTypeID( typeId ); neAnnot.addToIndexes();
neAnnot.setOntologyConceptArr( ocArr ); neAnnot.setTypeID( typeId ); neAnnot.addToIndexes();
m.addToIndexes(jCas);
entityOrEventMention.addToIndexes(); logger.info(" end assertion");
annotation.addToIndexes(); return annotation;