Examples of NerTag


Examples of org.apache.stanbol.enhancer.nlp.ner.NerTag

        //create a chunk
        Chunk stanbolEnhancer = analysedTextWithData.addChunk(stanbol.getStart(), enhancer.getEnd());
        expectedChunks.put(stanbolEnhancer, "Stanbol enhancer");
        stanbolEnhancer.addAnnotation(NlpAnnotations.NER_ANNOTATION, Value.value(
            new NerTag("organization", DBPEDIA_ORGANISATION)));
        stanbolEnhancer.addAnnotation(NlpAnnotations.PHRASE_ANNOTATION, Value.value(
            new PhraseTag("NP", LexicalCategory.Noun),0.98));

    }
View Full Code Here

Examples of org.apache.stanbol.enhancer.nlp.ner.NerTag

            throw new IllegalStateException("Unable to parse NerTag. The value of the "
                +"'tag' field MUST have a textual value (json: "+jValue+")");
        }
        JsonNode uri = jValue.path("uri");
        if(uri.isTextual()){
            return new NerTag(tag.getTextValue(), new UriRef(uri.getTextValue()));
        } else {
            return new NerTag(tag.getTextValue());
        }
    }
View Full Code Here

Examples of org.apache.stanbol.enhancer.nlp.ner.NerTag

                    sentStartOffset = -1;
                }
                //POS
                token.addAnnotation(POS_ANNOTATION, Value.value(posTag));
                //NER
                NerTag nerTag = NER_TAG_SET.getTag(posAttr.getPartOfSpeech());
                if(ner != null && (nerTag == null || !ner.tag.getType().equals(nerTag.getType()))){
                    //write NER annotation
                    Chunk chunk = at.addChunk(ner.start, ner.end);
                    chunk.addAnnotation(NlpAnnotations.NER_ANNOTATION, Value.value(ner.tag));
                    //NOTE that the fise:TextAnnotation are written later based on the nerList
                    //clean up
View Full Code Here

Examples of org.apache.stanbol.enhancer.nlp.ner.NerTag

            throw new IllegalStateException("Unable to parse NerTag. The value of the "
                +"'tag' field MUST have a textual value (json: "+jValue+")");
        }
        JsonNode uri = jValue.path("uri");
        if(uri.isTextual()){
            return new NerTag(tag.getTextValue(), new UriRef(uri.getTextValue()));
        } else {
            return new NerTag(tag.getTextValue());
        }
    }
View Full Code Here

Examples of org.apache.stanbol.enhancer.nlp.ner.NerTag

        //create a chunk
        Chunk stanbolEnhancer = analysedTextWithData.addChunk(stanbol.getStart(), enhancer.getEnd());
        expectedChunks.put(stanbolEnhancer, "Stanbol enhancer");
        stanbolEnhancer.addAnnotation(NlpAnnotations.NER_ANNOTATION, Value.value(
            new NerTag("organization", DBPEDIA_ORGANISATION)));
        stanbolEnhancer.addAnnotation(NlpAnnotations.PHRASE_ANNOTATION, Value.value(
            new PhraseTag("NP", LexicalCategory.Noun),0.98));

    }
View Full Code Here

Examples of org.apache.stanbol.enhancer.nlp.ner.NerTag

                for (int k = nameSpans[j].getStart(); k < nameSpans[j].getEnd(); k++) {
                    confidence *= probs[k];
                }
                int start = tokens.get(nameSpans[j].getStart()).getStart();
                int end = start + name.length();
                NerTag nerTag = config.getNerTag(nameSpans[j].getType());
                //create the occurrence for writing fise:TextAnnotations
                NameOccurrence occurrence = new NameOccurrence(name, start, end, nerTag.getType(),
                    context, confidence);
                List<NameOccurrence> occurrences = nameOccurrences.get(name);
                if (occurrences == null) {
                    occurrences = new ArrayList<NameOccurrence>();
                }
View Full Code Here

Examples of org.apache.stanbol.enhancer.nlp.ner.NerTag

                    confidence *= probs[k];
                }
                int start = tokenSpans[nameSpans[j].getStart()].getStart();
                int absoluteStart = sentenceSpans[i].getStart() + start;
                int absoluteEnd = absoluteStart + name.length();
                NerTag nerTag = config.getNerTag(nameSpans[j].getType());
                NameOccurrence occurrence = new NameOccurrence(name, absoluteStart, absoluteEnd,
                    nerTag.getType(),context, confidence);

                List<NameOccurrence> occurrences = nameOccurrences.get(name);
                if (occurrences == null) {
                    occurrences = new ArrayList<NameOccurrence>();
                }
View Full Code Here

Examples of org.apache.stanbol.enhancer.nlp.ner.NerTag

   
    private String defaultLanguage;
   
    public NEREngineConfig(){
        for(Entry<String,UriRef> mapping : DEFAULT_ENTITY_TYPE_MAPPINGS.entrySet()){
            nerTagSet.addTag(new NerTag(mapping.getKey(), mapping.getValue()));
        }
    }
View Full Code Here

Examples of org.apache.stanbol.enhancer.nlp.ner.NerTag

     */
    public NerTag getNerTag(String namedEntityType){
        if(namedEntityType == null || namedEntityType.isEmpty()){
            throw new IllegalArgumentException("The parsed NamedEntity string MUST NOT be NULL nor empty!");
        }
        NerTag tag = nerTagSet.getTag(namedEntityType);
        if(tag == null){
            tag = new NerTag(namedEntityType);
            nerTagSet.addTag(tag);
        }
        return tag;
    }
View Full Code Here

Examples of org.apache.stanbol.enhancer.nlp.ner.NerTag

     * @throws IllegalArgumentException if the parsed NamedEntity
     * type is <code>null</code> or an empty String.
     */
    public void setMappedType(String namedEntityType,UriRef dcType){
        if(namedEntityType != null && !namedEntityType.isEmpty()){
            nerTagSet.addTag(new NerTag(namedEntityType, dcType));
        } else {
            throw new IllegalArgumentException("The parsed NamedEntity type MUST NOT be NULL nor empty!");
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.