Examples of EntityLinkerConfig


Examples of org.apache.stanbol.enhancer.engines.entitylinking.config.EntityLinkerConfig

    @Test
    public void testEntityLinkerWithNouns() throws Exception {
        LanguageProcessingConfig tpc = new LanguageProcessingConfig();
        tpc.setLinkedLexicalCategories(LanguageProcessingConfig.DEFAULT_LINKED_LEXICAL_CATEGORIES);
        tpc.setLinkedPos(Collections.EMPTY_SET);
        EntityLinkerConfig config = new EntityLinkerConfig();
        config.setMinFoundTokens(2);//this is assumed by this test
        config.setRedirectProcessingMode(RedirectProcessingMode.FOLLOW);
        EntityLinker linker = new EntityLinker(TEST_ANALYSED_TEXT,"en",
            tpc, searcher, config, labelTokenizer);
        linker.process();
        Map<String,List<String>> expectedResults = new HashMap<String,List<String>>();
        expectedResults.put("Patrick Marshall", new ArrayList<String>(
View Full Code Here

Examples of org.apache.stanbol.enhancer.engines.entitylinking.config.EntityLinkerConfig

    @Test
    public void testEntityLinkerWithProperNouns() throws Exception {
        LanguageProcessingConfig tpc = new LanguageProcessingConfig();
        tpc.setLinkedLexicalCategories(Collections.EMPTY_SET);
        tpc.setLinkedPos(LanguageProcessingConfig.DEFAULT_LINKED_POS);
        EntityLinkerConfig config = new EntityLinkerConfig();
        config.setMinFoundTokens(2);//this is assumed by this test
        config.setRedirectProcessingMode(RedirectProcessingMode.FOLLOW);
        EntityLinker linker = new EntityLinker(TEST_ANALYSED_TEXT,"en",
            tpc, searcher, config, labelTokenizer);
        linker.process();
        Map<String,List<String>> expectedResults = new HashMap<String,List<String>>();
        expectedResults.put("Patrick Marshall", new ArrayList<String>(
View Full Code Here

Examples of org.apache.stanbol.enhancer.engines.entitylinking.config.EntityLinkerConfig

     * @throws IOException
     * @throws EngineException
     */
    @Test
    public void testEngine() throws IOException, EngineException {
        EntityLinkerConfig linkerConfig = new EntityLinkerConfig();
        linkerConfig.setRedirectProcessingMode(RedirectProcessingMode.FOLLOW);
        linkerConfig.setMinFoundTokens(2);//this is assumed by this test
        EntityLinkingEngine engine = new EntityLinkingEngine("dummy",
            searcher, new TextProcessingConfig(),
            linkerConfig, labelTokenizer);
        ContentItem ci = ciFactory.createContentItem(new StringSource(TEST_TEXT));
        //tells the engine that this is an English text
View Full Code Here

Examples of org.apache.stanbol.enhancer.engines.keywordextraction.impl.EntityLinkerConfig

     * @param config
     */
    protected KeywordLinkingEngine(OpenNLP openNLP,EntitySearcher entitySearcher,
                                   TextAnalyzerConfig nlpConfig,EntityLinkerConfig linkingConfig){
        this.openNLP = openNLP;
        this.linkerConfig = linkingConfig != null ? linkingConfig : new EntityLinkerConfig();
        this.nlpConfig = nlpConfig != null ? nlpConfig : new TextAnalyzerConfig();
        this.analysedContentFactory = OpenNlpAnalysedContentFactory.getInstance(openNLP,nlpConfig);
        this.entitySearcher = entitySearcher;
    }
View Full Code Here

Examples of org.apache.stanbol.enhancer.engines.keywordextraction.impl.EntityLinkerConfig

     * Note that all configuration are assumed as optional, therefore missing values will not
     * case a ConfigurationException.
     */
    protected void activateEntityLinkerConfig(Dictionary<String,Object> configuration) throws ConfigurationException {
        if(linkerConfig == null){
            this.linkerConfig = new EntityLinkerConfig();
        }
        Object value;
        value = configuration.get(NAME_FIELD);
        if(value != null){
            if(value.toString().isEmpty()){
View Full Code Here

Examples of org.apache.stanbol.enhancer.engines.keywordextraction.impl.EntityLinkerConfig

     */
    @Test
    public void testTaxonomyLinker() throws Exception {
        OpenNlpAnalysedContentFactory acf = OpenNlpAnalysedContentFactory.getInstance(openNLP,
            new TextAnalyzerConfig());
        EntityLinkerConfig config = new EntityLinkerConfig();
        config.setRedirectProcessingMode(RedirectProcessingMode.FOLLOW);
        EntityLinker linker = new EntityLinker(
            acf.create(TEST_TEXT,"en"), searcher, config);
        linker.process();
        Map<String,List<String>> expectedResults = new HashMap<String,List<String>>();
        expectedResults.put("Patrick Marshall", new ArrayList<String>(
View Full Code Here

Examples of org.apache.stanbol.enhancer.engines.keywordextraction.impl.EntityLinkerConfig

     * @throws IOException
     * @throws EngineException
     */
    @Test
    public void testEngine() throws IOException, EngineException {
        EntityLinkerConfig linkerConfig = new EntityLinkerConfig();
        linkerConfig.setRedirectProcessingMode(RedirectProcessingMode.FOLLOW);
        KeywordLinkingEngine engine = KeywordLinkingEngine.createInstance(openNLP, searcher, new TextAnalyzerConfig(),
            linkerConfig);
        engine.referencedSiteName = TEST_REFERENCED_SITE_NAME;
        ContentItem ci = ciFactory.createContentItem(new StringSource(TEST_TEXT));
        //tells the engine that this is an English text
View Full Code Here

Examples of org.apache.stanbol.enhancer.engines.keywordextraction.impl.EntityLinkerConfig

     * @param config
     */
    protected KeywordLinkingEngine(OpenNLP openNLP,EntitySearcher entitySearcher,
                                   TextAnalyzerConfig nlpConfig,EntityLinkerConfig linkingConfig){
        this.openNLP = openNLP;
        this.linkerConfig = linkingConfig != null ? linkingConfig : new EntityLinkerConfig();
        this.nlpConfig = nlpConfig != null ? nlpConfig : new TextAnalyzerConfig();
        this.analysedContentFactory = OpenNlpAnalysedContentFactory.getInstance(openNLP,nlpConfig);
        this.entitySearcher = entitySearcher;
    }
View Full Code Here

Examples of org.apache.stanbol.enhancer.engines.keywordextraction.impl.EntityLinkerConfig

     * Note that all configuration are assumed as optional, therefore missing values will not
     * case a ConfigurationException.
     */
    protected void activateEntityLinkerConfig(Dictionary<String,Object> configuration) throws ConfigurationException {
        if(linkerConfig == null){
            this.linkerConfig = new EntityLinkerConfig();
        }
        Object value;
        value = configuration.get(NAME_FIELD);
        if(value != null){
            if(value.toString().isEmpty()){
View Full Code Here

Examples of org.apache.stanbol.enhancer.engines.keywordextraction.linking.EntityLinkerConfig

     * @param config
     */
    protected KeywordLinkingEngine(OpenNLP openNLP,EntitySearcher entitySearcher,
                                   TextAnalyzerConfig nlpConfig,EntityLinkerConfig linkingConfig){
        this.openNLP = openNLP;
        this.linkerConfig = linkingConfig != null ? linkingConfig : new EntityLinkerConfig();
        this.nlpConfig = nlpConfig != null ? nlpConfig : new TextAnalyzerConfig();
        this.analysedContentFactory = OpenNlpAnalysedContentFactory.getInstance(openNLP,nlpConfig);
        this.entitySearcher = entitySearcher;
    }
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.