Package org.apache.stanbol.enhancer.engines.entitylinking.config

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


    public void testFstLinkingWithProperNouns() throws Exception {
        Dictionary<String,Object> dict = new Hashtable<String,Object>();
        dict.put(PROCESSED_LANGUAGES, Arrays.asList("en;lmmtip;uc=LINK;prob=0.75;pprob=0.75"));
        dict.put(PROCESS_ONLY_PROPER_NOUNS_STATE, true);
        TextProcessingConfig tpc = TextProcessingConfig.createInstance(dict);
        EntityLinkerConfig elc = new EntityLinkerConfig();
        elc.setMinFoundTokens(2);//this is assumed by this test
        elc.setRedirectProcessingMode(RedirectProcessingMode.FOLLOW);
        FstLinkingEngine engine = new FstLinkingEngine("proper-noun-linking",
            fstConfig, tpc, elc);
        processConentItem(engine);
        validateEnhancements(
            Arrays.asList(
View Full Code Here


    public void testFstLinkingWithNouns() throws Exception {
        Dictionary<String,Object> dict = new Hashtable<String,Object>();
        dict.put(PROCESSED_LANGUAGES, Arrays.asList("en;lmmtip;uc=LINK;prob=0.75;pprob=0.75"));
        dict.put(PROCESS_ONLY_PROPER_NOUNS_STATE, false);
        TextProcessingConfig tpc = TextProcessingConfig.createInstance(dict);
        EntityLinkerConfig elc = new EntityLinkerConfig();
        elc.setMinFoundTokens(2);//this is assumed by this test
        elc.setRedirectProcessingMode(RedirectProcessingMode.FOLLOW);
        FstLinkingEngine engine = new FstLinkingEngine("proper-noun-linking",
            fstConfig, tpc, elc);
        processConentItem(engine);
        validateEnhancements(
            Arrays.asList(
View Full Code Here

    @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

    public void testEntityLinkerWithWrongOrder() throws Exception {
        LanguageProcessingConfig tpc = new LanguageProcessingConfig();
        tpc.setLinkedLexicalCategories(LanguageProcessingConfig.DEFAULT_LINKED_LEXICAL_CATEGORIES);
        tpc.setLinkedPos(Collections.EMPTY_SET);
        tpc.setIgnoreChunksState(true); //to emulate pre STANBOL-1211
        EntityLinkerConfig config = new EntityLinkerConfig();
        config.setMinFoundTokens(2);//this is assumed by this test
        config.setRedirectProcessingMode(RedirectProcessingMode.FOLLOW);
        EntityLinker linker = new EntityLinker(TEST_ANALYSED_TEXT_WO,"en",
            tpc, searcher, config, labelTokenizer);
        linker.process();
        Map<String,List<String>> expectedResults = new HashMap<String,List<String>>();
        expectedResults.put("Marshall Patrick", new ArrayList<String>(
View Full Code Here

    @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

     * @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

                                   EntityLinkerConfig linkingConfig, LabelTokenizer labelTokenizer){
        if(name == null || name.isEmpty()){
            throw new IllegalArgumentException("The parsed EnhancementEngine name MUST NOT be NULL!");
        }
        this.name = name;
        this.linkerConfig = linkingConfig != null ? linkingConfig : new EntityLinkerConfig();
        this.textProcessingConfig = textProcessingConfig;
        this.entitySearcher = entitySearcher;
        this.labelTokenizer = labelTokenizer;
    }
View Full Code Here

    @Activate
    @SuppressWarnings("unchecked")
    protected void activate(ComponentContext ctx) throws ConfigurationException {
        Dictionary<String,Object> properties = ctx.getProperties();
        bundleContext = ctx.getBundleContext();
        EntityLinkerConfig linkerConfig = EntityLinkerConfig.createInstance(properties,prefixService);
        TextProcessingConfig textProcessingConfig = TextProcessingConfig.createInstance(properties);
        Object value = properties.get(SITE_ID);
        //init the EntitySource
        if (value == null) {
            throw new ConfigurationException(SITE_ID,
View Full Code Here

    @Activate
    @SuppressWarnings("unchecked")
    protected void activate(ComponentContext ctx) throws ConfigurationException {
        Dictionary<String,Object> properties = ctx.getProperties();
        bundleContext = ctx.getBundleContext();
        EntityLinkerConfig linkerConfig = EntityLinkerConfig.createInstance(properties,prefixService);
        TextProcessingConfig textProcessingConfig = TextProcessingConfig.createInstance(properties);
        Object value = properties.get(SITE_ID);
        //init the EntitySource
        if (value == null) {
            throw new ConfigurationException(SITE_ID,
View Full Code Here

                                   EntityLinkerConfig linkingConfig, LabelTokenizer labelTokenizer){
        if(name == null || name.isEmpty()){
            throw new IllegalArgumentException("The parsed EnhancementEngine name MUST NOT be NULL!");
        }
        this.name = name;
        this.linkerConfig = linkingConfig != null ? linkingConfig : new EntityLinkerConfig();
        this.textProcessingConfig = textProcessingConfig;
        this.entitySearcher = entitySearcher;
        this.labelTokenizer = labelTokenizer;
    }
View Full Code Here

TOP

Related Classes of org.apache.stanbol.enhancer.engines.entitylinking.config.EntityLinkerConfig

Copyright © 2018 www.massapicom. 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.