Examples of PhraseTag


Examples of org.apache.stanbol.enhancer.nlp.phrase.PhraseTag

        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.phrase.PhraseTag

            lc = LexicalCategory.values()[jCat.getIntValue()];
        } else if(!jCat.isMissingNode()){
            log.warn("Unable to parse category for PhraseTag from "+jCat
                +"(will create with tag only)");
        }
        return new PhraseTag(tag.getTextValue(),lc);
    }
View Full Code Here

Examples of org.apache.stanbol.enhancer.nlp.phrase.PhraseTag

        if(phraseType == null){
            throw new IllegalArgumentException("The parsed PhraseTypeDefinition MUST NOT be NULL!");
        }
        this.phraseType = phraseType;
        log.debug("Create {} for {}",getClass().getSimpleName(),phraseType);
        this.phraseTag = new PhraseTag(phraseType.getPhraseType().name(),
            phraseType.getPhraseType());
        if(chunkFactory == null){
            throw new IllegalArgumentException("The parsed ChunkFactory MUST NOT be NULL");
        }
        this.chunkFactory = chunkFactory;
View Full Code Here

Examples of org.apache.stanbol.enhancer.nlp.phrase.PhraseTag

                tokenPos = null; //free memory
               
                // (3) Process the results and write the Annotations
                double chunkProps = 0;
                int chunkTokenCount = 0;
                PhraseTag tag = null;
                int i;
                /*
                 * This assumes:
                 *  - 'B-{tag}' ... for start of a new chunk
                 *  - '???' ... anything other for continuing the current chunk
View Full Code Here

Examples of org.apache.stanbol.enhancer.nlp.phrase.PhraseTag

            }
        }
    }

    private PhraseTag getPhraseTag(TagSet<PhraseTag> model, Map<String,PhraseTag> adhocTags, String tag, String language) {
        PhraseTag phraseTag = model.getTag(tag);
        if(phraseTag != null){
            return phraseTag;
        }
        phraseTag = adhocTags.get(tag);
        if(phraseTag != null){
            return phraseTag;
        }
        phraseTag = new PhraseTag(tag);
        adhocTags.put(tag, phraseTag);
        log.info("Encountered unknown POS tag '{}' for langauge '{}'",tag,language);
        return phraseTag;
    }
View Full Code Here

Examples of org.apache.stanbol.enhancer.nlp.phrase.PhraseTag

            lc = LexicalCategory.values()[jCat.getIntValue()];
        } else if(!jCat.isMissingNode()){
            log.warn("Unable to parse category for PhraseTag from "+jCat
                +"(will create with tag only)");
        }
        return new PhraseTag(tag.getTextValue(),lc);
    }
View Full Code Here

Examples of org.apache.stanbol.enhancer.nlp.phrase.PhraseTag

        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.phrase.PhraseTag

                tokenPos = null; //free memory
               
                // (3) Process the results and write the Annotations
                double chunkProps = 0;
                int chunkTokenCount = 0;
                PhraseTag tag = null;
                int i;
                /*
                 * This assumes:
                 *  - 'B-{tag}' ... for start of a new chunk
                 *  - '???' ... anything other for continuing the current chunk
View Full Code Here

Examples of org.apache.stanbol.enhancer.nlp.phrase.PhraseTag

            }
        }
    }

    private PhraseTag getPhraseTag(TagSet<PhraseTag> model, Map<String,PhraseTag> adhocTags, String tag, String language) {
        PhraseTag phraseTag = model.getTag(tag);
        if(phraseTag != null){
            return phraseTag;
        }
        phraseTag = adhocTags.get(tag);
        if(phraseTag != null){
            return phraseTag;
        }
        phraseTag = new PhraseTag(tag);
        adhocTags.put(tag, phraseTag);
        log.info("Encountered unknown POS tag '{}' for langauge '{}'",tag,language);
        return phraseTag;
    }
View Full Code Here

Examples of org.apache.stanbol.enhancer.nlp.phrase.PhraseTag

        uri = new UriRef("urn:test:UniversityOfOtago_Texas");
        graph.add(new TripleImpl(uri, NAME, new PlainLiteralImpl("University of Otago (Texas)")));
        graph.add(new TripleImpl(uri, TYPE, OntologicalClasses.DBPEDIA_ORGANISATION));
        searcher.addEntity(new Entity(uri, graph));
       
        Value<PhraseTag> nounPhrase = Value.value(new PhraseTag("NP",LexicalCategory.Noun),1d);
        TEST_ANALYSED_TEXT = AnalysedTextFactory.getDefaultInstance().createAnalysedText(
                ciFactory.createBlob(new StringSource(TEST_TEXT)));
        TEST_ANALYSED_TEXT.addSentence(0, TEST_ANALYSED_TEXT.getEnd());
        //add some noun phrases
        TEST_ANALYSED_TEXT.addChunk(0, "Dr. Patrick Marshall".length()).addAnnotation(PHRASE_ANNOTATION, nounPhrase);
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.