本文整理汇总了Java中de.tudarmstadt.ukp.dkpro.core.languagetool.LanguageToolSegmenter类的典型用法代码示例。如果您正苦于以下问题:Java LanguageToolSegmenter类的具体用法?Java LanguageToolSegmenter怎么用?Java LanguageToolSegmenter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
LanguageToolSegmenter类属于de.tudarmstadt.ukp.dkpro.core.languagetool包,在下文中一共展示了LanguageToolSegmenter类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setupPipeline
import de.tudarmstadt.ukp.dkpro.core.languagetool.LanguageToolSegmenter; //导入依赖的package包/类
private void setupPipeline() throws ResourceInitializationException {
AnalysisEngineDescription segmenter = createEngineDescription(LanguageToolSegmenter.class);
AnalysisEngineDescription dbpedia = createEngineDescription(SpotlightAnnotator.class,
//SpotlightAnnotator.PARAM_ENDPOINT, "http://localhost:2222/rest",
SpotlightAnnotator.PARAM_ENDPOINT, this.dbpediaService,
SpotlightAnnotator.PARAM_CONFIDENCE, 0.35f,
SpotlightAnnotator.PARAM_ALL_CANDIDATES, false);
AnalysisEngineDescription ner = createEngineDescription(StanfordNamedEntityRecognizer.class);
AnalysisEngineDescription pos = createEngineDescription(OpenNlpPosTagger.class,
OpenNlpPosTagger.PARAM_LANGUAGE,"en");
AnalysisEngineDescription chunk = createEngineDescription(OpenNlpChunker.class,
OpenNlpChunker.PARAM_LANGUAGE,"en");
AnalysisEngineDescription key = createEngineDescription(KeyPhraseAnnotator.class,
KeyPhraseAnnotator.PARAM_LANGUAGE, "en");
this.ae = createEngine(createEngineDescription(segmenter, dbpedia, ner, pos, chunk, key));
}
示例2: setUp
import de.tudarmstadt.ukp.dkpro.core.languagetool.LanguageToolSegmenter; //导入依赖的package包/类
@Before
public void setUp() throws UIMAException, SAXException, IOException {
TypeSystemDescription tsd = TypeSystemDescriptionFactory.createTypeSystemDescription();
jcas = JCasFactory.createJCas(tsd);
XmiCasDeserializer.deserialize(getClass().getResourceAsStream("/rfxf.0.xmi"), jcas.getCas(), true);
jcas.setDocumentLanguage("de");
desc = D.getWrappedSegmenterDescription(LanguageToolSegmenter.class);
}
示例3: setUp
import de.tudarmstadt.ukp.dkpro.core.languagetool.LanguageToolSegmenter; //导入依赖的package包/类
@Before
public void setUp() throws UIMAException, SAXException, IOException {
TypeSystemDescription tsd = TypeSystemDescriptionFactory.createTypeSystemDescription();
jcas = JCasFactory.createJCas(tsd);
XmiCasDeserializer.deserialize(getClass().getResourceAsStream("/rfxf.0.xmi"), jcas.getCas(), true);
jcas.setDocumentLanguage("de");
desc = D.getWrappedSegmenterDescription(LanguageToolSegmenter.class);
}
示例4: main
import de.tudarmstadt.ukp.dkpro.core.languagetool.LanguageToolSegmenter; //导入依赖的package包/类
public static void main(String[] args) throws ResourceInitializationException, UIMAException, IOException {
System.setProperty("java.util.logging.config.file", "src/main/resources/logging.properties");
CollectionReaderDescription crd = CollectionReaderFactory.createReaderDescription(TextgridTEIUrlReader.class,
TextgridTEIUrlReader.PARAM_INPUT, "src/main/resources");
SimplePipeline.runPipeline(crd,
/*
* Do segmentation.
*/
D.getWrappedSegmenterDescription(LanguageToolSegmenter.class),
createEngineDescription(FigureReferenceAnnotator.class),
createEngineDescription(SpeakerIdentifier.class, SpeakerIdentifier.PARAM_CREATE_SPEAKER_FIGURE, true),
/*
* standard NLP components. This works because dkpro only sees
* tokens and sentences. The segmenter creates those only for
* the figure speech (and not for stage directions)
*/
createEngineDescription(StanfordPosTagger.class),
createEngineDescription(StanfordNamedEntityRecognizer.class),
createEngineDescription(FigureMentionDetection.class),
/*
* Extract copresence network
*/
createEngineDescription(NetworkExtractor.class),
/*
* extract mention network
*/
createEngineDescription(NetworkExtractor.class, NetworkExtractor.PARAM_VIEW_NAME, "MentionNetwork",
NetworkExtractor.PARAM_NETWORK_TYPE, "MentionNetwork"),
/*
* print xmi
*/
createEngineDescription(XmiWriter.class, XmiWriter.PARAM_TARGET_LOCATION, "target/xmi/"));
}