当前位置: 首页>>代码示例>>Java>>正文


Java SerialAnalyserController.add方法代码示例

本文整理汇总了Java中gate.creole.SerialAnalyserController.add方法的典型用法代码示例。如果您正苦于以下问题:Java SerialAnalyserController.add方法的具体用法?Java SerialAnalyserController.add怎么用?Java SerialAnalyserController.add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在gate.creole.SerialAnalyserController的用法示例。


在下文中一共展示了SerialAnalyserController.add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: init

import gate.creole.SerialAnalyserController; //导入方法依赖的package包/类
/** Initialise this resource, and return it. */
public Resource init() throws ResourceInstantiationException {
  f.setMaximumFractionDigits(2); // format used for all decimal values
  f.setMinimumFractionDigits(2);

  // using QualityAssurancePR internally to calculate QA stats
  // but hiding this PR just in case
  FeatureMap hideParams = Factory.newFeatureMap();
  Gate.setHiddenAttribute(hideParams, true);
  assurancePR = (QualityAssurancePR)Factory.createResource(
          "gate.qa.QualityAssurancePR", Factory.newFeatureMap(), hideParams);

  // we use controller to execute assurance PR
  controller = (SerialAnalyserController)Factory.createResource(
          SerialAnalyserController.class.getName(), Factory.newFeatureMap(),
          hideParams);
  controller.add(assurancePR);
  return this;
}
 
开发者ID:Network-of-BioThings,项目名称:GettinCRAFTy,代码行数:20,代码来源:QAForTeamwarePR.java

示例2: assambleEntityExtractionPipelineEN

import gate.creole.SerialAnalyserController; //导入方法依赖的package包/类
private void assambleEntityExtractionPipelineEN() {
    
    try {
        URL url = THDController.getInstance().getClass().getResource(Settings.EN_ENTITY_EXTRACTION_GRAMMAR);
        File japeOrigFile = new File(url.getFile());
        java.net.URI japeURI = japeOrigFile.toURI();
        FeatureMap transducerFeatureMap = Factory.newFeatureMap();

        try {
            transducerFeatureMap.put("grammarURL", japeURI.toURL());
            transducerFeatureMap.put("encoding", "UTF-8");
        } catch (MalformedURLException e) {
        }

        FeatureMap tokenizerFeatureMap = Factory.newFeatureMap();        
        ProcessingResource tokenizerPR = (ProcessingResource) Factory.createResource("gate.creole.tokeniser.DefaultTokeniser", tokenizerFeatureMap);

        FeatureMap sentenceSplitterFeatureMap = Factory.newFeatureMap();
        ProcessingResource sentenceSplitterPR = (ProcessingResource) Factory.createResource("gate.creole.splitter.SentenceSplitter", sentenceSplitterFeatureMap);

        FeatureMap posTaggerFeatureMap = Factory.newFeatureMap();
        ProcessingResource posTaggerPR = (ProcessingResource) Factory.createResource("gate.creole.POSTagger", posTaggerFeatureMap);

        ProcessingResource japeCandidatesPR = (ProcessingResource) Factory.createResource("gate.creole.Transducer", transducerFeatureMap);

        enEntityExtractionPipeline = (SerialAnalyserController) Factory.createResource("gate.creole.SerialAnalyserController");

        enEntityExtractionPipeline.add(tokenizerPR);
        enEntityExtractionPipeline.add(sentenceSplitterPR);
        enEntityExtractionPipeline.add(posTaggerPR);
        enEntityExtractionPipeline.add(japeCandidatesPR);
    } catch (ResourceInstantiationException ex) {;
        Logger.getLogger(THDInstance.class.getName()).log(Level.SEVERE, null, ex);
    }
}
 
开发者ID:entityclassifier-eu,项目名称:entityclassifier-core,代码行数:36,代码来源:THDWorker.java

示例3: assambleEntityExtractionPipelineEN

import gate.creole.SerialAnalyserController; //导入方法依赖的package包/类
private static void assambleEntityExtractionPipelineEN(){
    try {
        URL url = thdInstance.getClass().getResource(enEntityExtractionGrammar);
        File japeOrigFile = new File(url.getFile());
        java.net.URI japeURI = japeOrigFile.toURI();
        FeatureMap transducerFeatureMap = Factory.newFeatureMap();

        try {
            transducerFeatureMap.put("grammarURL", japeURI.toURL());
            transducerFeatureMap.put("encoding", "UTF-8");
        } catch (MalformedURLException e) {
        }

        FeatureMap tokenizerFeatureMap = Factory.newFeatureMap();        
        ProcessingResource tokenizerPR = (ProcessingResource) Factory.createResource("gate.creole.tokeniser.DefaultTokeniser", tokenizerFeatureMap);

        FeatureMap sentenceSplitterFeatureMap = Factory.newFeatureMap();
        ProcessingResource sentenceSplitterPR = (ProcessingResource) Factory.createResource("gate.creole.splitter.SentenceSplitter", sentenceSplitterFeatureMap);

        FeatureMap posTaggerFeatureMap = Factory.newFeatureMap();
        ProcessingResource posTaggerPR = (ProcessingResource) Factory.createResource("gate.creole.POSTagger", posTaggerFeatureMap);

        ProcessingResource japeCandidatesPR = (ProcessingResource) Factory.createResource("gate.creole.Transducer", transducerFeatureMap);

        enEntityExtractionPipeline = (SerialAnalyserController) Factory.createResource("gate.creole.SerialAnalyserController");

        enEntityExtractionPipeline.add(tokenizerPR);
        enEntityExtractionPipeline.add(sentenceSplitterPR);
        enEntityExtractionPipeline.add(posTaggerPR);
        enEntityExtractionPipeline.add(japeCandidatesPR);
    } catch (ResourceInstantiationException ex) {;
        Logger.getLogger(THDInstance.class.getName()).log(Level.SEVERE, null, ex);
    }    
}
 
开发者ID:entityclassifier-eu,项目名称:entityclassifier-core,代码行数:35,代码来源:THDInstance.java

示例4: assambleEntityExtractionPipelineDE

import gate.creole.SerialAnalyserController; //导入方法依赖的package包/类
private void assambleEntityExtractionPipelineDE(){
    try {
                
        FeatureMap resetFeatureMap = Factory.newFeatureMap();
        ProcessingResource resetPR = (ProcessingResource) Factory.createResource("gate.creole.annotdelete.AnnotationDeletePR", resetFeatureMap);
                
        FeatureMap tokenizerFeatureMap = Factory.newFeatureMap();
        ProcessingResource tokenizerPR = (ProcessingResource) Factory.createResource("gate.creole.tokeniser.DefaultTokeniser", tokenizerFeatureMap);
                
        FeatureMap taggerFeatureMap = Factory.newFeatureMap();
        taggerFeatureMap.put("debug", "false");
        taggerFeatureMap.put("encoding", "UTF-8");
        taggerFeatureMap.put("failOnUnmappableCharacter", false);
        taggerFeatureMap.put("featureMapping", "lemma=3;category=2;string=1");
        taggerFeatureMap.put("inputAnnotationType", "Token");
        taggerFeatureMap.put("inputTemplate", "${string}");
        taggerFeatureMap.put("outputAnnotationType", "Token");
        taggerFeatureMap.put("regex", "(.+)	(.+)	(.+)");
        taggerFeatureMap.put("taggerBinary", Settings.DE_TAGGER_BINARY);
        taggerFeatureMap.put("updateAnnotations", true);
                
        ProcessingResource genTag = (ProcessingResource) Factory.createResource("gate.taggerframework.GenericTagger",taggerFeatureMap);
                
        //JAPE Entity Extraction grammar
        URL url =  THDController.getInstance().getClass().getResource(Settings.DE_ENTITY_EXTRACTION_GRAMMAR);
        
        File japeOrigFile = new File(url.getFile());
        java.net.URI japeURI = japeOrigFile.toURI();
        FeatureMap transducerFeatureMap = Factory.newFeatureMap();

        try {
            transducerFeatureMap.put("grammarURL", japeURI.toURL());
            transducerFeatureMap.put("encoding", "UTF-8");
        } catch (MalformedURLException e) {
        }
                
        ProcessingResource japeCandidatesPR = (ProcessingResource) Factory.createResource("gate.creole.Transducer", transducerFeatureMap);

        deEntityExtractionPipeline = (SerialAnalyserController) Factory.createResource("gate.creole.RealtimeCorpusController");
        deEntityExtractionPipeline.add(resetPR);
        deEntityExtractionPipeline.add(tokenizerPR);
        deEntityExtractionPipeline.add(genTag);                    
        deEntityExtractionPipeline.add(japeCandidatesPR);
    } catch (ResourceInstantiationException ex) {
        Logger.getLogger(THDInstance.class.getName()).log(Level.SEVERE, null, ex);
    }    
}
 
开发者ID:entityclassifier-eu,项目名称:entityclassifier-core,代码行数:48,代码来源:THDWorker.java

示例5: assambleEntityExtractionPipelineNL

import gate.creole.SerialAnalyserController; //导入方法依赖的package包/类
private void assambleEntityExtractionPipelineNL(){        
        try {        
            FeatureMap resetFeatureMap = Factory.newFeatureMap();
            ProcessingResource resetPR = (ProcessingResource) Factory.createResource("gate.creole.annotdelete.AnnotationDeletePR", resetFeatureMap);
                    
            FeatureMap tokenizerFeatureMap = Factory.newFeatureMap();
            ProcessingResource tokenizerPR = (ProcessingResource) Factory.createResource("gate.creole.tokeniser.DefaultTokeniser", tokenizerFeatureMap);
                    
            FeatureMap taggerFeatureMap = Factory.newFeatureMap();
            taggerFeatureMap.put("debug", "false");
            taggerFeatureMap.put("encoding", "UTF-8");
            taggerFeatureMap.put("failOnUnmappableCharacter", false);
//            taggerFeatureMap.put("failOnMissingInputAnnotations", false);
            taggerFeatureMap.put("featureMapping", "lemma=3;category=2;string=1");
            taggerFeatureMap.put("inputAnnotationType", "Token");
            taggerFeatureMap.put("inputTemplate", "${string}");
            taggerFeatureMap.put("outputAnnotationType", "Token");
            taggerFeatureMap.put("regex", "(.+)	(.+)	(.+)");
            taggerFeatureMap.put("taggerBinary", Settings.NL_TAGGER_BINARY);
            taggerFeatureMap.put("updateAnnotations", true);
                    
            ProcessingResource genTag = (ProcessingResource) Factory.createResource("gate.taggerframework.GenericTagger",taggerFeatureMap);
                    
            //JAPE Entity Extraction grammar
            URL url =  THDController.getInstance().getClass().getResource(Settings.NL_ENTITY_EXTRACTION_GRAMMAR);
            File japeOrigFile = new File(url.getFile());
            java.net.URI japeURI = japeOrigFile.toURI();
            FeatureMap transducerFeatureMap = Factory.newFeatureMap();

            try {
                transducerFeatureMap.put("grammarURL", japeURI.toURL());
                transducerFeatureMap.put("encoding", "UTF-8");
            } catch (MalformedURLException e) {
            }
                    
            ProcessingResource japeCandidatesPR = (ProcessingResource) Factory.createResource("gate.creole.Transducer", transducerFeatureMap);

            nlEntityExtractionPipeline = (SerialAnalyserController) Factory.createResource("gate.creole.RealtimeCorpusController");
            nlEntityExtractionPipeline.add(resetPR);
            nlEntityExtractionPipeline.add(tokenizerPR);
            nlEntityExtractionPipeline.add(genTag);                    
            nlEntityExtractionPipeline.add(japeCandidatesPR);
            
        } catch (ResourceInstantiationException ex) {
            Logger.getLogger(THDInstance.class.getName()).log(Level.SEVERE, null, ex);
        }        
    }
 
开发者ID:entityclassifier-eu,项目名称:entityclassifier-core,代码行数:48,代码来源:THDWorker.java

示例6: assambleHypernymExtractionPipelineEN

import gate.creole.SerialAnalyserController; //导入方法依赖的package包/类
private void assambleHypernymExtractionPipelineEN(){
    
    try {
        
        hypernymExtractionPipelineEN = (SerialAnalyserController) Factory.createResource("gate.creole.RealtimeCorpusController");
        
        FeatureMap resetFeatureMap = Factory.newFeatureMap();
        ProcessingResource resetPR = (ProcessingResource) Factory.createResource("gate.creole.annotdelete.AnnotationDeletePR", resetFeatureMap);
        hypernymExtractionPipelineEN.add(resetPR);
    
        FeatureMap tokenizerFeatureMap = Factory.newFeatureMap();
        ProcessingResource tokenizerPR = (ProcessingResource) Factory.createResource("gate.creole.tokeniser.DefaultTokeniser", tokenizerFeatureMap);
        hypernymExtractionPipelineEN.add(tokenizerPR);
            
        FeatureMap sentenceSplitterFeatureMap = Factory.newFeatureMap();
        ProcessingResource sentenceSplitterPR = (ProcessingResource) Factory.createResource("gate.creole.splitter.SentenceSplitter", sentenceSplitterFeatureMap);
        //ProcessingResource sentenceSplitterPR = (ProcessingResource) Factory.createResource("gate.creole.splitter.RegexSentenceSplitter", sentenceSplitterFeatureMap);
        hypernymExtractionPipelineEN.add(sentenceSplitterPR);

        FeatureMap posTaggerFeatureMap = Factory.newFeatureMap();
        ProcessingResource posTaggerPR = (ProcessingResource) Factory.createResource("gate.creole.POSTagger", posTaggerFeatureMap);                
        hypernymExtractionPipelineEN.add(posTaggerPR);

        URL url = THDController.getInstance().getClass().getResource(Settings.EN_HYPERNYM_EXTRACTION_GRAMMAR);
        File japeOrigFile = new File(url.getFile());            
        java.net.URI japeURI = japeOrigFile.toURI();
        
        FeatureMap transducerFeatureMap = Factory.newFeatureMap();
        try {
            transducerFeatureMap.put("grammarURL", japeURI.toURL());
            transducerFeatureMap.put("encoding", "UTF-8");
        } catch (MalformedURLException e) {
            // TODO
        }
        ProcessingResource japeCandidatesPR = (ProcessingResource) Factory.createResource("gate.creole.Transducer", transducerFeatureMap);

        hypernymExtractionPipelineEN.add(japeCandidatesPR);
        
    } catch (ResourceInstantiationException ex) {
        Logger.getLogger(THDInstance.class.getName()).log(Level.SEVERE, null, ex);
    }
}
 
开发者ID:entityclassifier-eu,项目名称:entityclassifier-core,代码行数:43,代码来源:THDWorker.java

示例7: assambleHypernymExtractionPipelineDE

import gate.creole.SerialAnalyserController; //导入方法依赖的package包/类
private void assambleHypernymExtractionPipelineDE(){
    
    try {
        
        hypernymExtractionPipelineDE = (SerialAnalyserController) Factory.createResource("gate.creole.RealtimeCorpusController");
        
        FeatureMap resetFeatureMap = Factory.newFeatureMap();
        ProcessingResource resetPR = (ProcessingResource) Factory.createResource("gate.creole.annotdelete.AnnotationDeletePR", resetFeatureMap);
        hypernymExtractionPipelineDE.add(resetPR);
    
        FeatureMap tokenizerFeatureMap = Factory.newFeatureMap();
        ProcessingResource tokenizerPR = (ProcessingResource) Factory.createResource("gate.creole.tokeniser.DefaultTokeniser", tokenizerFeatureMap);
        hypernymExtractionPipelineDE.add(tokenizerPR);
            
        FeatureMap sentenceSplitterFeatureMap = Factory.newFeatureMap();
        ProcessingResource sentenceSplitterPR = (ProcessingResource) Factory.createResource("gate.creole.splitter.SentenceSplitter", sentenceSplitterFeatureMap);
        //ProcessingResource sentenceSplitterPR = (ProcessingResource) Factory.createResource("gate.creole.splitter.RegexSentenceSplitter", sentenceSplitterFeatureMap);
        hypernymExtractionPipelineDE.add(sentenceSplitterPR);

        FeatureMap taggerFeatureMap = Factory.newFeatureMap();
        taggerFeatureMap.put("debug", "false");
        taggerFeatureMap.put("encoding", "UTF-8");
        taggerFeatureMap.put("failOnUnmappableCharacter", "false");
        taggerFeatureMap.put("featureMapping", "lemma=3;category=2;string=1");
        taggerFeatureMap.put("inputAnnotationType", "Token");
        taggerFeatureMap.put("inputTemplate", "${string}");
        taggerFeatureMap.put("outputAnnotationType", "Token");
        taggerFeatureMap.put("regex", "(.+)	(.+)	(.+)");
        taggerFeatureMap.put("taggerBinary", Settings.DE_TAGGER_BINARY);
        taggerFeatureMap.put("updateAnnotations", false);
                
        ProcessingResource genTag = (ProcessingResource) Factory.createResource("gate.taggerframework.GenericTagger",taggerFeatureMap);
        hypernymExtractionPipelineDE.add(genTag);

        URL url = THDController.getInstance().getClass().getResource(Settings.DE_HYPERNYM_EXTRACTION_GRAMMAR);
        File japeOrigFile = new File(url.getFile());            
        java.net.URI japeURI = japeOrigFile.toURI();
        
        FeatureMap transducerFeatureMap = Factory.newFeatureMap();
        try {
            transducerFeatureMap.put("grammarURL", japeURI.toURL());
            transducerFeatureMap.put("encoding", "UTF-8");
        } catch (MalformedURLException e) {
        }
        
        ProcessingResource japeCandidatesPR = (ProcessingResource) Factory.createResource("gate.creole.Transducer", transducerFeatureMap);
        hypernymExtractionPipelineDE.add(japeCandidatesPR);
        
    } catch (ResourceInstantiationException ex) {
        Logger.getLogger(THDInstance.class.getName()).log(Level.SEVERE, null, ex);
    }
    
}
 
开发者ID:entityclassifier-eu,项目名称:entityclassifier-core,代码行数:54,代码来源:THDWorker.java

示例8: assambleHypernymExtractionPipelineNL

import gate.creole.SerialAnalyserController; //导入方法依赖的package包/类
private void assambleHypernymExtractionPipelineNL(){
    
    try {
        
        hypernymExtractionPipelineNL = (SerialAnalyserController) Factory.createResource("gate.creole.RealtimeCorpusController");
        
        FeatureMap resetFeatureMap = Factory.newFeatureMap();
        ProcessingResource resetPR = (ProcessingResource) Factory.createResource("gate.creole.annotdelete.AnnotationDeletePR", resetFeatureMap);
        hypernymExtractionPipelineNL.add(resetPR);
    
        FeatureMap tokenizerFeatureMap = Factory.newFeatureMap();
        ProcessingResource tokenizerPR = (ProcessingResource) Factory.createResource("gate.creole.tokeniser.DefaultTokeniser", tokenizerFeatureMap);
        hypernymExtractionPipelineNL.add(tokenizerPR);
            
        FeatureMap sentenceSplitterFeatureMap = Factory.newFeatureMap();
        ProcessingResource sentenceSplitterPR = (ProcessingResource) Factory.createResource("gate.creole.splitter.SentenceSplitter", sentenceSplitterFeatureMap);
        //ProcessingResource sentenceSplitterPR = (ProcessingResource) Factory.createResource("gate.creole.splitter.RegexSentenceSplitter", sentenceSplitterFeatureMap);
        hypernymExtractionPipelineNL.add(sentenceSplitterPR);

        FeatureMap taggerFeatureMap = Factory.newFeatureMap();
        taggerFeatureMap.put("debug", "false");
        taggerFeatureMap.put("encoding", "UTF-8");
        taggerFeatureMap.put("failOnUnmappableCharacter", "false");
        taggerFeatureMap.put("featureMapping", "lemma=3;category=2;string=1");
        taggerFeatureMap.put("inputAnnotationType", "Token");
        taggerFeatureMap.put("inputTemplate", "${string}");
        taggerFeatureMap.put("outputAnnotationType", "Token");
        taggerFeatureMap.put("regex", "(.+)	(.+)	(.+)");
        taggerFeatureMap.put("taggerBinary", Settings.NL_TAGGER_BINARY);
        taggerFeatureMap.put("updateAnnotations", false);
                
        ProcessingResource genTag = (ProcessingResource) Factory.createResource("gate.taggerframework.GenericTagger",taggerFeatureMap);
        hypernymExtractionPipelineNL.add(genTag);            

        URL url = THDController.getInstance().getClass().getResource(Settings.NL_HYPERNYM_EXTRACTION_GRAMMAR);
        File japeOrigFile = new File(url.getFile());            
        java.net.URI japeURI = japeOrigFile.toURI();
        
        FeatureMap transducerFeatureMap = Factory.newFeatureMap();
        try {
            transducerFeatureMap.put("grammarURL", japeURI.toURL());
            transducerFeatureMap.put("encoding", "UTF-8");
        } catch (MalformedURLException e) {
        }
        ProcessingResource japeCandidatesPR = (ProcessingResource) Factory.createResource("gate.creole.Transducer", transducerFeatureMap);

        hypernymExtractionPipelineNL.add(japeCandidatesPR);
        
    } catch (Exception ex) {
        Logger.getLogger(THDInstance.class.getName()).log(Level.SEVERE, null, ex);
    }
}
 
开发者ID:entityclassifier-eu,项目名称:entityclassifier-core,代码行数:53,代码来源:THDWorker.java

示例9: assambleHypernymExtractionPipelineEN

import gate.creole.SerialAnalyserController; //导入方法依赖的package包/类
private static void assambleHypernymExtractionPipelineEN(){
    
    try {
        
        hypernymExtractionPipelineEN = (SerialAnalyserController) Factory.createResource("gate.creole.RealtimeCorpusController");
        
        FeatureMap resetFeatureMap = Factory.newFeatureMap();
        ProcessingResource resetPR = (ProcessingResource) Factory.createResource("gate.creole.annotdelete.AnnotationDeletePR", resetFeatureMap);
        hypernymExtractionPipelineEN.add(resetPR);
    
        FeatureMap tokenizerFeatureMap = Factory.newFeatureMap();
        ProcessingResource tokenizerPR = (ProcessingResource) Factory.createResource("gate.creole.tokeniser.DefaultTokeniser", tokenizerFeatureMap);
        hypernymExtractionPipelineEN.add(tokenizerPR);
            
        FeatureMap sentenceSplitterFeatureMap = Factory.newFeatureMap();
        ProcessingResource sentenceSplitterPR = (ProcessingResource) Factory.createResource("gate.creole.splitter.SentenceSplitter", sentenceSplitterFeatureMap);
        //ProcessingResource sentenceSplitterPR = (ProcessingResource) Factory.createResource("gate.creole.splitter.RegexSentenceSplitter", sentenceSplitterFeatureMap);
        hypernymExtractionPipelineEN.add(sentenceSplitterPR);

        FeatureMap posTaggerFeatureMap = Factory.newFeatureMap();
        ProcessingResource posTaggerPR = (ProcessingResource) Factory.createResource("gate.creole.POSTagger", posTaggerFeatureMap);                
        hypernymExtractionPipelineEN.add(posTaggerPR);

        URL url = thdInstance.getClass().getResource(enHypernymExtractionGrammar);
        File japeOrigFile = new File(url.getFile());            
        java.net.URI japeURI = japeOrigFile.toURI();
        
        FeatureMap transducerFeatureMap = Factory.newFeatureMap();
        try {
            transducerFeatureMap.put("grammarURL", japeURI.toURL());
            transducerFeatureMap.put("encoding", "UTF-8");
        } catch (MalformedURLException e) {

        }
        ProcessingResource japeCandidatesPR = (ProcessingResource) Factory.createResource("gate.creole.Transducer", transducerFeatureMap);

        hypernymExtractionPipelineEN.add(japeCandidatesPR);
        
    } catch (ResourceInstantiationException ex) {
        Logger.getLogger(THDInstance.class.getName()).log(Level.SEVERE, null, ex);
    }
}
 
开发者ID:entityclassifier-eu,项目名称:entityclassifier-core,代码行数:43,代码来源:THDInstance.java

示例10: assambleHypernymExtractionPipelineDE

import gate.creole.SerialAnalyserController; //导入方法依赖的package包/类
private static void assambleHypernymExtractionPipelineDE(){
    
    try {
        
        hypernymExtractionPipelineDE = (SerialAnalyserController) Factory.createResource("gate.creole.RealtimeCorpusController");
        
        FeatureMap resetFeatureMap = Factory.newFeatureMap();
        ProcessingResource resetPR = (ProcessingResource) Factory.createResource("gate.creole.annotdelete.AnnotationDeletePR", resetFeatureMap);
        hypernymExtractionPipelineDE.add(resetPR);
    
        FeatureMap tokenizerFeatureMap = Factory.newFeatureMap();
        ProcessingResource tokenizerPR = (ProcessingResource) Factory.createResource("gate.creole.tokeniser.DefaultTokeniser", tokenizerFeatureMap);
        hypernymExtractionPipelineDE.add(tokenizerPR);
            
        FeatureMap sentenceSplitterFeatureMap = Factory.newFeatureMap();
        ProcessingResource sentenceSplitterPR = (ProcessingResource) Factory.createResource("gate.creole.splitter.SentenceSplitter", sentenceSplitterFeatureMap);
        //ProcessingResource sentenceSplitterPR = (ProcessingResource) Factory.createResource("gate.creole.splitter.RegexSentenceSplitter", sentenceSplitterFeatureMap);
        hypernymExtractionPipelineDE.add(sentenceSplitterPR);

        FeatureMap taggerFeatureMap = Factory.newFeatureMap();
        taggerFeatureMap.put("debug", "false");
        taggerFeatureMap.put("encoding", "ISO-8859-1");
        taggerFeatureMap.put("failOnUnmappableCharacter", "false");
        taggerFeatureMap.put("featureMapping", "lemma=3;category=2;string=1");
        taggerFeatureMap.put("inputAnnotationType", "Token");
        taggerFeatureMap.put("inputTemplate", "${string}");
        taggerFeatureMap.put("outputAnnotationType", "Token");
        taggerFeatureMap.put("regex", "(.+)	(.+)	(.+)");
        taggerFeatureMap.put("taggerBinary", deTaggerBinary);
        taggerFeatureMap.put("updateAnnotations", false);
                
        ProcessingResource genTag = (ProcessingResource) Factory.createResource("gate.taggerframework.GenericTagger",taggerFeatureMap);
        hypernymExtractionPipelineDE.add(genTag);

        URL url = thdInstance.getClass().getResource(deHypernymExtractionGrammar);
        File japeOrigFile = new File(url.getFile());            
        java.net.URI japeURI = japeOrigFile.toURI();
        
        FeatureMap transducerFeatureMap = Factory.newFeatureMap();
        try {
            transducerFeatureMap.put("grammarURL", japeURI.toURL());
            transducerFeatureMap.put("encoding", "UTF-8");
        } catch (MalformedURLException e) {
        }
        
        ProcessingResource japeCandidatesPR = (ProcessingResource) Factory.createResource("gate.creole.Transducer", transducerFeatureMap);
        hypernymExtractionPipelineDE.add(japeCandidatesPR);
        
    } catch (ResourceInstantiationException ex) {
        Logger.getLogger(THDInstance.class.getName()).log(Level.SEVERE, null, ex);
    }
    
}
 
开发者ID:entityclassifier-eu,项目名称:entityclassifier-core,代码行数:54,代码来源:THDInstance.java

示例11: assambleHypernymExtractionPipelineNL

import gate.creole.SerialAnalyserController; //导入方法依赖的package包/类
private static void assambleHypernymExtractionPipelineNL(){
    
    try {
        
        hypernymExtractionPipelineNL = (SerialAnalyserController) Factory.createResource("gate.creole.RealtimeCorpusController");
        
        FeatureMap resetFeatureMap = Factory.newFeatureMap();
        ProcessingResource resetPR = (ProcessingResource) Factory.createResource("gate.creole.annotdelete.AnnotationDeletePR", resetFeatureMap);
        hypernymExtractionPipelineNL.add(resetPR);
    
        FeatureMap tokenizerFeatureMap = Factory.newFeatureMap();
        ProcessingResource tokenizerPR = (ProcessingResource) Factory.createResource("gate.creole.tokeniser.DefaultTokeniser", tokenizerFeatureMap);
        hypernymExtractionPipelineNL.add(tokenizerPR);
            
        FeatureMap sentenceSplitterFeatureMap = Factory.newFeatureMap();
        ProcessingResource sentenceSplitterPR = (ProcessingResource) Factory.createResource("gate.creole.splitter.SentenceSplitter", sentenceSplitterFeatureMap);
        //ProcessingResource sentenceSplitterPR = (ProcessingResource) Factory.createResource("gate.creole.splitter.RegexSentenceSplitter", sentenceSplitterFeatureMap);
        hypernymExtractionPipelineNL.add(sentenceSplitterPR);

        FeatureMap taggerFeatureMap = Factory.newFeatureMap();
        taggerFeatureMap.put("debug", "false");
        taggerFeatureMap.put("encoding", "ISO-8859-1");
        taggerFeatureMap.put("failOnUnmappableCharacter", "false");
        taggerFeatureMap.put("featureMapping", "lemma=3;category=2;string=1");
        taggerFeatureMap.put("inputAnnotationType", "Token");
        taggerFeatureMap.put("inputTemplate", "${string}");
        taggerFeatureMap.put("outputAnnotationType", "Token");
        taggerFeatureMap.put("regex", "(.+)	(.+)	(.+)");
        taggerFeatureMap.put("taggerBinary", nlTaggerBinary);
        taggerFeatureMap.put("updateAnnotations", false);
                
        ProcessingResource genTag = (ProcessingResource) Factory.createResource("gate.taggerframework.GenericTagger",taggerFeatureMap);
        hypernymExtractionPipelineNL.add(genTag);            

        URL url = thdInstance.getClass().getResource(nlHypernymExtractionGrammar);
        File japeOrigFile = new File(url.getFile());            
        java.net.URI japeURI = japeOrigFile.toURI();
        
        FeatureMap transducerFeatureMap = Factory.newFeatureMap();
        try {
            transducerFeatureMap.put("grammarURL", japeURI.toURL());
            transducerFeatureMap.put("encoding", "UTF-8");
        } catch (MalformedURLException e) {
        }
        ProcessingResource japeCandidatesPR = (ProcessingResource) Factory.createResource("gate.creole.Transducer", transducerFeatureMap);

        hypernymExtractionPipelineNL.add(japeCandidatesPR);
        
    } catch (ResourceInstantiationException ex) {
        Logger.getLogger(THDInstance.class.getName()).log(Level.SEVERE, null, ex);
    }
    
}
 
开发者ID:entityclassifier-eu,项目名称:entityclassifier-core,代码行数:54,代码来源:THDInstance.java

示例12: assambleEntityExtractionPipelineDE

import gate.creole.SerialAnalyserController; //导入方法依赖的package包/类
private static void assambleEntityExtractionPipelineDE(){
    try {                    
        FeatureMap resetFeatureMap = Factory.newFeatureMap();
        ProcessingResource resetPR = (ProcessingResource) Factory.createResource("gate.creole.annotdelete.AnnotationDeletePR", resetFeatureMap);
                
        FeatureMap tokenizerFeatureMap = Factory.newFeatureMap();
        ProcessingResource tokenizerPR = (ProcessingResource) Factory.createResource("gate.creole.tokeniser.DefaultTokeniser", tokenizerFeatureMap);
                
        FeatureMap taggerFeatureMap = Factory.newFeatureMap();
        taggerFeatureMap.put("debug", "false");
        taggerFeatureMap.put("encoding", "ISO-8859-1");
        taggerFeatureMap.put("failOnUnmappableCharacter", "false");
        taggerFeatureMap.put("featureMapping", "lemma=3;category=2;string=1");
        taggerFeatureMap.put("inputAnnotationType", "Token");
        taggerFeatureMap.put("inputTemplate", "${string}");
        taggerFeatureMap.put("outputAnnotationType", "Token");
        taggerFeatureMap.put("regex", "(.+)	(.+)	(.+)");
        taggerFeatureMap.put("taggerBinary", deTaggerBinary);
        taggerFeatureMap.put("updateAnnotations", false);
                
        ProcessingResource genTag = (ProcessingResource) Factory.createResource("gate.taggerframework.GenericTagger",taggerFeatureMap);
                
        //JAPE Entity Extraction grammar
        URL url =  thdInstance.getClass().getResource(deEntityExtractionGrammar);
        
        File japeOrigFile = new File(url.getFile());
        java.net.URI japeURI = japeOrigFile.toURI();
        FeatureMap transducerFeatureMap = Factory.newFeatureMap();

        try {
            transducerFeatureMap.put("grammarURL", japeURI.toURL());
            transducerFeatureMap.put("encoding", "UTF-8");
        } catch (MalformedURLException e) {
        }
                
        ProcessingResource japeCandidatesPR = (ProcessingResource) Factory.createResource("gate.creole.Transducer", transducerFeatureMap);

        deEntityExtractionPipeline = (SerialAnalyserController) Factory.createResource("gate.creole.RealtimeCorpusController");
        deEntityExtractionPipeline.add(resetPR);
        deEntityExtractionPipeline.add(tokenizerPR);
        deEntityExtractionPipeline.add(genTag);                    
        deEntityExtractionPipeline.add(japeCandidatesPR);
    } catch (ResourceInstantiationException ex) {
        Logger.getLogger(THDInstance.class.getName()).log(Level.SEVERE, null, ex);
    }    
}
 
开发者ID:entityclassifier-eu,项目名称:entityclassifier-core,代码行数:47,代码来源:THDInstance.java

示例13: assambleEntityExtractionPipelineNL

import gate.creole.SerialAnalyserController; //导入方法依赖的package包/类
private static void assambleEntityExtractionPipelineNL(){
    
    try {
    
        FeatureMap resetFeatureMap = Factory.newFeatureMap();
        ProcessingResource resetPR = (ProcessingResource) Factory.createResource("gate.creole.annotdelete.AnnotationDeletePR", resetFeatureMap);
                
        FeatureMap tokenizerFeatureMap = Factory.newFeatureMap();
        ProcessingResource tokenizerPR = (ProcessingResource) Factory.createResource("gate.creole.tokeniser.DefaultTokeniser", tokenizerFeatureMap);
                
        FeatureMap taggerFeatureMap = Factory.newFeatureMap();
        taggerFeatureMap.put("debug", "false");
        taggerFeatureMap.put("encoding", "ISO-8859-1");
        taggerFeatureMap.put("failOnUnmappableCharacter", "false");
        taggerFeatureMap.put("featureMapping", "lemma=3;category=2;string=1");
        taggerFeatureMap.put("inputAnnotationType", "Token");
        taggerFeatureMap.put("inputTemplate", "${string}");
        taggerFeatureMap.put("outputAnnotationType", "Token");
        taggerFeatureMap.put("regex", "(.+)	(.+)	(.+)");
        taggerFeatureMap.put("taggerBinary", nlTaggerBinary);
        taggerFeatureMap.put("updateAnnotations", false);
                
        ProcessingResource genTag = (ProcessingResource) Factory.createResource("gate.taggerframework.GenericTagger",taggerFeatureMap);
                
        //JAPE Entity Extraction grammar
        URL url =  thdInstance.getClass().getResource(nlEntityExtractionGrammar);
        File japeOrigFile = new File(url.getFile());
        java.net.URI japeURI = japeOrigFile.toURI();
        FeatureMap transducerFeatureMap = Factory.newFeatureMap();

        try {
            transducerFeatureMap.put("grammarURL", japeURI.toURL());
            transducerFeatureMap.put("encoding", "UTF-8");
        } catch (MalformedURLException e) {
        }
                
        ProcessingResource japeCandidatesPR = (ProcessingResource) Factory.createResource("gate.creole.Transducer", transducerFeatureMap);

        nlEntityExtractionPipeline = (SerialAnalyserController) Factory.createResource("gate.creole.RealtimeCorpusController");
        nlEntityExtractionPipeline.add(resetPR);
        nlEntityExtractionPipeline.add(tokenizerPR);
        nlEntityExtractionPipeline.add(genTag);                    
        nlEntityExtractionPipeline.add(japeCandidatesPR);
    } catch (ResourceInstantiationException ex) {
        Logger.getLogger(THDInstance.class.getName()).log(Level.SEVERE, null, ex);
    }        
}
 
开发者ID:entityclassifier-eu,项目名称:entityclassifier-core,代码行数:48,代码来源:THDInstance.java

示例14: iniActions

import gate.creole.SerialAnalyserController; //导入方法依赖的package包/类
/**
     * Initialise the ANNIE system by default. This creates a "corpus pipeline"
     * application that can be used to run sets of documents through
     * the extraction system.
     * @throws Exception
     */
    public void iniActions() throws Exception
    {
        iniMutex.acquire();
        LOG.info("Load SerialAnalyserController (default) (" + Gate.genSym() + ").");
        try
        {
            // create a serial analyser controller to run ANNIE with
            annieController =
              (SerialAnalyserController) Factory.createResource(
                "gate.creole.SerialAnalyserController", Factory.newFeatureMap(),
                Factory.newFeatureMap(), "ANNIE_" + Gate.genSym()
              );

            FeatureMap params = null;
            ProcessingResource pr = null;

            params = Factory.newFeatureMap();
            pr = (ProcessingResource) Factory.createResource("gate.creole.annotdelete.AnnotationDeletePR", params);
            annieController.add(pr);

            params = Factory.newFeatureMap();
            //params.put("caseSensitive", false);
            pr = (ProcessingResource) Factory.createResource("gate.creole.tokeniser.DefaultTokeniser", params);
            annieController.add(pr);

            params = Factory.newFeatureMap();
            //params.put("caseSensitive", false);
            pr = (ProcessingResource) Factory.createResource("gate.creole.gazetteer.DefaultGazetteer", params);
            annieController.add(pr);

            params = Factory.newFeatureMap();
            pr = (ProcessingResource) Factory.createResource("gate.creole.splitter.RegexSentenceSplitter", params);
            annieController.add(pr);

            params = Factory.newFeatureMap();
            pr = (ProcessingResource) Factory.createResource("gate.creole.POSTagger", params);
            annieController.add(pr);

            params = Factory.newFeatureMap();
            pr = (ProcessingResource) Factory.createResource("gate.creole.morph.Morph", params);
            annieController.add(pr);

            params = Factory.newFeatureMap();
            pr = (ProcessingResource) Factory.createResource("gate.creole.ANNIETransducer", params);
            annieController.add(pr);

//        }
//        catch (GateException ex)
//        {
//            annieController = null;
//            throw new Exception(ex.getMessage());
        }
        finally
        {
            LOG.info("Load SerialAnalyserController done.");
            iniMutex.release();
        }
    }
 
开发者ID:eduardoguzman,项目名称:sisob-data-extractor,代码行数:65,代码来源:TextMiningParserGate.java

示例15: iniActions

import gate.creole.SerialAnalyserController; //导入方法依赖的package包/类
/**
     * Initialise the ANNIE system by default. This creates a "corpus pipeline"
     * application that can be used to run sets of documents through
     * the extraction system.
     * Especific for extract info from CV and personal web page of researchers
     * @throws Exception
     */
    @Override
    public void iniActions() throws Exception
    {
        TextMiningParserGate.iniMutex.acquire();
        LOG.info("Load SerialAnalyserController Pipe (Researchers) (" + Gate.genSym() + ").");
        try
        {
            // create a serial analyser controller to run ANNIE with
            annieController =
              (SerialAnalyserController) Factory.createResource(
                "gate.creole.SerialAnalyserController", Factory.newFeatureMap(),
                Factory.newFeatureMap(), "ANNIE_" + Gate.genSym()
              );

            FeatureMap params = null;
            ProcessingResource pr = null;

            params = Factory.newFeatureMap();
            pr = (ProcessingResource) Factory.createResource("gate.creole.annotdelete.AnnotationDeletePR", params);
            annieController.add(pr);

            params = Factory.newFeatureMap();
            //params.put("caseSensitive", false);
            pr = (ProcessingResource) Factory.createResource("gate.creole.tokeniser.DefaultTokeniser", params);
            annieController.add(pr);

            params = Factory.newFeatureMap();
            //file:/C:/Users/dlopez/Documents/NetBeansProjects/TextExtractionPrototypes/extractionsWorksGate/resources/GATE-6.0/plugins/ANNIE/resources/gazetteer/lists.def
            //String sListDefFilePath = (new java.io.File("resources\\GATE-6.0\\plugins\\ANNIE\\resources\\gazetteer\\lists_researchers.def")).toURI().toString();
            //params.put("listsURL", sListDefFilePath);
            pr = (ProcessingResource) Factory.createResource("gate.creole.gazetteer.DefaultGazetteer", params);
            annieController.add(pr);

            params = Factory.newFeatureMap();
            pr = (ProcessingResource) Factory.createResource("gate.creole.splitter.RegexSentenceSplitter", params);
            annieController.add(pr);

            params = Factory.newFeatureMap();
            pr = (ProcessingResource) Factory.createResource("gate.creole.POSTagger", params);
            annieController.add(pr);

            params = Factory.newFeatureMap();
            pr = (ProcessingResource) Factory.createResource("gate.creole.morph.Morph", params);
            annieController.add(pr);

            params = Factory.newFeatureMap();
            //file:/C:/Users/dlopez/Documents/NetBeansProjects/TextExtractionPrototypes/extractionsWorksGate/resources/GATE-6.0/plugins/ANNIE/resources/gazetteer/lists.def
            String sListDefFilePath = (new java.io.File("resources\\GATE-6.0\\plugins\\ANNIE\\resources\\NE\\main_detector.jape")).toURI().toString();
            params.put("grammarURL", sListDefFilePath);
            pr = (ProcessingResource) Factory.createResource("gate.creole.ANNIETransducer", params);

            annieController.add(pr);

        }
//        catch (GateException ex)
//        {
//            annieController = null;
//            throw new Exception(ex.getMessage());
//        }
        finally
        {
            LOG.info("Load SerialAnalyserController done.");
            TextMiningParserGate.iniMutex.release();
        }

    }
 
开发者ID:eduardoguzman,项目名称:sisob-data-extractor,代码行数:74,代码来源:TextMiningParserGateDetector.java


注:本文中的gate.creole.SerialAnalyserController.add方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。