• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java XmiReader类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中de.tudarmstadt.ukp.dkpro.core.io.xmi.XmiReader的典型用法代码示例。如果您正苦于以下问题:Java XmiReader类的具体用法?Java XmiReader怎么用?Java XmiReader使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



XmiReader类属于de.tudarmstadt.ukp.dkpro.core.io.xmi包,在下文中一共展示了XmiReader类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: main

import de.tudarmstadt.ukp.dkpro.core.io.xmi.XmiReader; //导入依赖的package包/类
public static void main(String[] args)
        throws Exception
{
    String in = "/tmp/temp-in";
    String out = "/tmp/out2.tar.gz";
    // test it
    SimplePipeline.runPipeline(CollectionReaderFactory.createReaderDescription(
            XmiReader.class,
            XmiReader.PARAM_SOURCE_LOCATION, in,
            XmiReader.PARAM_PATTERNS, XmiReader.INCLUDE_PREFIX + "*.xmi"
            ),
            AnalysisEngineFactory.createEngineDescription(
                    NoOpAnnotator.class
            ),
            AnalysisEngineFactory.createEngineDescription(
                    CompressedXmiWriter.class,
                    CompressedXmiWriter.PARAM_OUTPUT_FILE, out
            )
    );

}
 
开发者ID:UKPLab,项目名称:argument-reasoning-comprehension-task,代码行数:22,代码来源:CompressedXmiWriter.java


示例2: main

import de.tudarmstadt.ukp.dkpro.core.io.xmi.XmiReader; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
	CollectionReaderDescription reader = CollectionReaderFactory.createReaderDescription(XmiReader.class,
			XmiReader.PARAM_SOURCE_LOCATION, "src/main/resources/gender/*/*.xmi", XmiReader.PARAM_LENIENT, true);

	String tmpView = "DP";

	AggregateBuilder b = new AggregateBuilder();

	b.add(AnalysisEngineFactory.createEngineDescription(PrepareClearTk.class, PrepareClearTk.PARAM_VIEW_NAME,
			tmpView, PrepareClearTk.PARAM_ANNOTATION_TYPE, DramatisPersonae.class,
			PrepareClearTk.PARAM_SUBANNOTATIONS, Arrays.asList(Figure.class)));
	b.add(AnalysisEngineFactory.createEngineDescription(BreakIteratorSegmenter.class), CAS.NAME_DEFAULT_SOFA,
			tmpView);
	b.add(AnalysisEngineFactory.createEngineDescription(ClearTkGenderAnnotator.class,
			DefaultDataWriterFactory.PARAM_DATA_WRITER_CLASS_NAME, LibSvmStringOutcomeDataWriter.class,
			DirectoryDataWriterFactory.PARAM_OUTPUT_DIRECTORY, "target/models"), CAS.NAME_DEFAULT_SOFA, tmpView);
	b.add(AnalysisEngineFactory.createEngineDescription(XmiWriter.class, XmiWriter.PARAM_TARGET_LOCATION,
			"target/xmi"));
	SimplePipeline.runPipeline(reader, b.createAggregateDescription());

	Train.main(new File("target/models"), new String[] { "-t", "0" });
}
 
开发者ID:quadrama,项目名称:DramaNLP,代码行数:23,代码来源:Training.java


示例3: testRules1

import de.tudarmstadt.ukp.dkpro.core.io.xmi.XmiReader; //导入依赖的package包/类
@Test
public void testRules1() throws Exception {
	org.apache.uima.fit.pipeline.JCasIterator iter = SimplePipeline.iteratePipeline(
			CollectionReaderFactory.createReaderDescription(XmiReader.class, XmiReader.PARAM_SOURCE_LOCATION,
					"src/test/resources/SpeakerAssignmentRules/tx4z.0.xmi", XmiReader.PARAM_LENIENT, true),
			AnalysisEngineFactory.createEngineDescription(FigureReferenceAnnotator.class),
			AnalysisEngineFactory.createEngineDescription(SpeakerAssignmentRules.class,
					SpeakerAssignmentRules.PARAM_RULE_FILE_URL,
					new File("src/test/resources/SpeakerAssignmentRules/speaker-assignment-mapping.tsv").toURI()
							.toURL()))
			.iterator();
	if (iter.hasNext()) {
		JCas jcas = iter.next();
		for (Speaker speaker : JCasUtil.select(jcas, Speaker.class)) {
			if (speaker.getCoveredText().equalsIgnoreCase("carlos"))
				assertNotNull(speaker.getCoveredText(), speaker.getFigure());
		}
	}
}
 
开发者ID:quadrama,项目名称:DramaNLP,代码行数:20,代码来源:TestSpeakerAssignmentRules.java


示例4: testRules2

import de.tudarmstadt.ukp.dkpro.core.io.xmi.XmiReader; //导入依赖的package包/类
@Test
public void testRules2() throws Exception {
	org.apache.uima.fit.pipeline.JCasIterator iter = SimplePipeline.iteratePipeline(
			CollectionReaderFactory.createReaderDescription(XmiReader.class, XmiReader.PARAM_SOURCE_LOCATION,
					"src/test/resources/SpeakerAssignmentRules/w3zd.0.xmi", XmiReader.PARAM_LENIENT, true),
			AnalysisEngineFactory.createEngineDescription(FigureReferenceAnnotator.class),
			AnalysisEngineFactory.createEngineDescription(SpeakerAssignmentRules.class,
					SpeakerAssignmentRules.PARAM_RULE_FILE_URL,
					new File("src/test/resources/SpeakerAssignmentRules/speaker-assignment-mapping.tsv").toURI()
							.toURL()))
			.iterator();
	assertTrue(iter.hasNext());
	JCas jcas = iter.next();
	assertNotNull(jcas);
	for (Speaker speaker : JCasUtil.select(jcas, Speaker.class)) {
		if (speaker.getCoveredText().equalsIgnoreCase("der capitain"))
			assertNotNull(speaker.getCoveredText(), speaker.getFigure());
	}
}
 
开发者ID:quadrama,项目名称:DramaNLP,代码行数:20,代码来源:TestSpeakerAssignmentRules.java


示例5: testRules3

import de.tudarmstadt.ukp.dkpro.core.io.xmi.XmiReader; //导入依赖的package包/类
public void testRules3() throws Exception {
	org.apache.uima.fit.pipeline.JCasIterator iter = SimplePipeline.iteratePipeline(
			CollectionReaderFactory.createReaderDescription(XmiReader.class, XmiReader.PARAM_SOURCE_LOCATION,
					"src/test/resources/SpeakerAssignmentRules/w3zd.0.xmi", XmiReader.PARAM_LENIENT, true),
			AnalysisEngineFactory.createEngineDescription(FigureReferenceAnnotator.class),
			AnalysisEngineFactory.createEngineDescription(SpeakerAssignmentRules.class,
					SpeakerAssignmentRules.PARAM_RULE_FILE_URL,
					"https://raw.githubusercontent.com/quadrama/metadata/780d8dce562e8df39b91c485955d91fdc7af44ca/speaker-assignment-mapping.csv"))
			.iterator();
	assertTrue(iter.hasNext());
	JCas jcas = iter.next();
	assertNotNull(jcas);
	for (Speaker speaker : JCasUtil.select(jcas, Speaker.class)) {
		if (speaker.getCoveredText().equalsIgnoreCase("der capitain"))
			assertNotNull(speaker.getCoveredText(), speaker.getFigure());
	}
}
 
开发者ID:quadrama,项目名称:DramaNLP,代码行数:18,代码来源:TestSpeakerAssignmentRules.java


示例6: testFigureReferenceAnnotator1

import de.tudarmstadt.ukp.dkpro.core.io.xmi.XmiReader; //导入依赖的package包/类
@Test
public void testFigureReferenceAnnotator1() throws ResourceInitializationException {
	CollectionReaderDescription reader = CollectionReaderFactory.createReaderDescription(XmiReader.class,
			XmiReader.PARAM_SOURCE_LOCATION, "src/test/resources/FigureReferenceAnnotator/rfxf.0.xmi",
			XmiReader.PARAM_LENIENT, true);
	AnalysisEngineDescription engine = AnalysisEngineFactory
			.createEngineDescription(FigureReferenceAnnotator.class);
	JCasIterator iterator = SimplePipeline.iteratePipeline(reader, engine).iterator();
	while (iterator.hasNext()) {
		JCas jcas = iterator.next();
		assertTrue(JCasUtil.exists(jcas, Figure.class));
		for (Figure figure : JCasUtil.select(jcas, Figure.class)) {
			assertNotNull(figure.getReference());
			assertFalse(figure.getReference().contains(","));
		}
	}
}
 
开发者ID:quadrama,项目名称:DramaNLP,代码行数:18,代码来源:TestFigureReferenceAnnotator.java


示例7: testFigureReferenceAnnotator2

import de.tudarmstadt.ukp.dkpro.core.io.xmi.XmiReader; //导入依赖的package包/类
@Test
public void testFigureReferenceAnnotator2() throws ResourceInitializationException {
	CollectionReaderDescription reader = CollectionReaderFactory.createReaderDescription(XmiReader.class,
			XmiReader.PARAM_SOURCE_LOCATION, "src/test/resources/FigureReferenceAnnotator/w3zd.0.xmi",
			XmiReader.PARAM_LENIENT, true);
	AnalysisEngineDescription engine = AnalysisEngineFactory
			.createEngineDescription(FigureReferenceAnnotator.class);
	JCasIterator iterator = SimplePipeline.iteratePipeline(reader, engine).iterator();
	while (iterator.hasNext()) {
		JCas jcas = iterator.next();
		assertTrue(JCasUtil.exists(jcas, Figure.class));
		for (Figure figure : JCasUtil.select(jcas, Figure.class)) {
			assertNotNull(figure.getReference());
			// assertFalse(figure.getReference().contains(","));
		}
	}
}
 
开发者ID:quadrama,项目名称:DramaNLP,代码行数:18,代码来源:TestFigureReferenceAnnotator.java


示例8: testReadDlinaMetadata

import de.tudarmstadt.ukp.dkpro.core.io.xmi.XmiReader; //导入依赖的package包/类
public void testReadDlinaMetadata() throws Exception {
	Iterator<JCas> iter = SimplePipeline.iteratePipeline(
			CollectionReaderFactory.createReaderDescription(XmiReader.class, XmiReader.PARAM_SOURCE_LOCATION,
					"src/test/resources/ReadDlinaMetadata/xmi/*.xmi"),
			AnalysisEngineFactory.createEngineDescription(ReadDlinaMetadata.class,
					ReadDlinaMetadata.PARAM_DLINA_DIRECTORY, "src/test/resources/ReadDlinaMetadata/zwischenformat"))
			.iterator();
	JCas jcas;
	Drama d;
	jcas = iter.next();
	assertNotNull(jcas);
	d = JCasUtil.selectSingle(jcas, Drama.class);
	assertNotNull(d);

	assertEquals(1802, JCasUtil.selectSingle(jcas, DatePrint.class).getYear());
	assertEquals(0, JCasUtil.selectSingle(jcas, DatePremiere.class).getYear());
	assertEquals(0, JCasUtil.selectSingle(jcas, DateWritten.class).getYear());

	jcas = iter.next();
	assertNotNull(jcas);
	d = JCasUtil.selectSingle(jcas, Drama.class);
	assertNotNull(d);
	assertEquals(1801, JCasUtil.selectSingle(jcas, DatePrint.class).getYear());
	assertEquals(1801, JCasUtil.selectSingle(jcas, DatePremiere.class).getYear());
	assertEquals(1801, JCasUtil.selectSingle(jcas, DateWritten.class).getYear());
}
 
开发者ID:quadrama,项目名称:DramaNLP,代码行数:27,代码来源:TestReadDlinaMetadata.java


示例9: main

import de.tudarmstadt.ukp.dkpro.core.io.xmi.XmiReader; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
	Options options = CliFactory.parseArguments(Options.class, args);

	// a reader that loads the URIs of the training files
	CollectionReaderDescription reader = CollectionReaderFactory.createReaderDescription(XmiReader.class,
			XmiReader.PARAM_SOURCE_LOCATION, options.getTrainDirectory() + "/*.xmi", XmiReader.PARAM_LENIENT, true);

	// run the pipeline over the training corpus
	SimplePipeline.runPipeline(reader,
			createEngineDescription(ContextWindowAnnotator.class, ContextWindowAnnotator.PARAM_BASE_ANNOTATION,
					FigureMention.class, ContextWindowAnnotator.PARAM_CONTEXT_CLASS, Speech.class,
					ContextWindowAnnotator.PARAM_TARGET_ANNOTATION, TrainingArea.class),
			createEngineDescription(ClearTkMentionAnnotator.class, CleartkSequenceAnnotator.PARAM_IS_TRAINING, true,
					DirectoryDataWriterFactory.PARAM_OUTPUT_DIRECTORY, options.getModelDirectory(),
					DefaultSequenceDataWriterFactory.PARAM_DATA_WRITER_CLASS_NAME,
					MalletCrfStringOutcomeDataWriter.class),
			createEngineDescription(XmiWriter.class, XmiWriter.PARAM_TARGET_LOCATION, "target/"));

	// train a Mallet CRF model on the training data
	Train.main(options.getModelDirectory());
}
 
开发者ID:quadrama,项目名称:DramaNLP,代码行数:22,代码来源:MentionDetectionTraining.java


示例10: main

import de.tudarmstadt.ukp.dkpro.core.io.xmi.XmiReader; //导入依赖的package包/类
public static void main(String[] args)
    {
        // TODO set this properly to "gold.data.toulmin" directory
//        final String annotatedCorpusDir = "data/gold.data.toulmin/";
        final String annotatedCorpusDir = args[0];

        try {
            SimplePipeline.runPipeline(CollectionReaderFactory.createReaderDescription(
                            XmiReader.class,
                            XmiReader.PARAM_SOURCE_LOCATION, annotatedCorpusDir,
                            XmiReader.PARAM_PATTERNS, "[+]*.xmi",
                            XmiReader.PARAM_LENIENT, true
                    ),
                    AnalysisEngineFactory.createEngineDescription(
                            ArgumentDumpWriter.class
                    )
            );
        }
        catch (Exception e) {
            e.printStackTrace();
        }
    }
 
开发者ID:dkpro,项目名称:dkpro-argumentation,代码行数:23,代码来源:ArgumentationCorpusDebugger.java


示例11: main

import de.tudarmstadt.ukp.dkpro.core.io.xmi.XmiReader; //导入依赖的package包/类
public static void main(String[] args)
{
    // TODO set this properly to "gold.data.persuasive" directory
    final String annotatedCorpusDir = "/home/user-ukp/research/data/argumentation/habernal.gurevych.2015.argumentation.mining.CL.data/data/gold.data.persuasive/";

    try {
        SimplePipeline.runPipeline(CollectionReaderFactory.createReaderDescription(
                        XmiReader.class,
                        XmiReader.PARAM_SOURCE_LOCATION, annotatedCorpusDir,
                        XmiReader.PARAM_PATTERNS, "[+]*.xmi"
                ),
                AnalysisEngineFactory.createEngineDescription(
                        PersuasiveDocumentDump.class
                )
        );
    }
    catch (Exception e) {
        e.printStackTrace();
    }
}
 
开发者ID:habernal,项目名称:dkpro-argumentation-tutorial,代码行数:21,代码来源:PersuasiveDocumentsCorpusDebugger.java


示例12: main

import de.tudarmstadt.ukp.dkpro.core.io.xmi.XmiReader; //导入依赖的package包/类
public static void main(String[] args)
{
    // TODO set this properly to "gold.data.toulmin" directory
    final String annotatedCorpusDir = "/home/user-ukp/research/data/argumentation/habernal.gurevych.2015.argumentation.mining.CL.data/data/gold.data.toulmin/";

    try {
        SimplePipeline.runPipeline(CollectionReaderFactory.createReaderDescription(
                        XmiReader.class,
                        XmiReader.PARAM_SOURCE_LOCATION, annotatedCorpusDir,
                        XmiReader.PARAM_PATTERNS, "[+]*.xmi"
                ),
                AnalysisEngineFactory.createEngineDescription(
                        ArgumentDumpWriter.class
                )
        );
    }
    catch (Exception e) {
        e.printStackTrace();
    }
}
 
开发者ID:habernal,项目名称:dkpro-argumentation-tutorial,代码行数:21,代码来源:ArgumentationCorpusDebugger.java


示例13: readXMI

import de.tudarmstadt.ukp.dkpro.core.io.xmi.XmiReader; //导入依赖的package包/类
public static JCas readXMI(String aPath, TypeSystemDescription aType)
    throws UIMAException, IOException
{
    CollectionReader reader = createReader(XmiReader.class, XmiReader.PARAM_SOURCE_LOCATION,
            "src/test/resources/" + aPath);
    JCas jcas;
    if (aType != null) {
        TypeSystemDescription builtInTypes = TypeSystemDescriptionFactory
                .createTypeSystemDescription();
        List<TypeSystemDescription> allTypes = new ArrayList<>();
        allTypes.add(builtInTypes);
        allTypes.add(aType);
        jcas = JCasFactory.createJCas(CasCreationUtils.mergeTypeSystems(allTypes));
    }
    else {
        jcas = JCasFactory.createJCas();
    }

    reader.getNext(jcas.getCas());

    return jcas;
}
 
开发者ID:webanno,项目名称:webanno,代码行数:23,代码来源:DiffUtils.java


示例14: testExtractSpeechByType

import de.tudarmstadt.ukp.dkpro.core.io.xmi.XmiReader; //导入依赖的package包/类
@Test
public void testExtractSpeechByType() throws Exception {
	File tdir = new File("target/ExtractSpeechByType/texts/");
	FileUtils.deleteDirectory(tdir);
	SimplePipeline.runPipeline(
			CollectionReaderFactory.createReaderDescription(XmiReader.class, XmiReader.PARAM_SOURCE_LOCATION,
					"src/test/resources/ExtractSpeechByType/*.xmi", XmiReader.PARAM_LENIENT, true),
			AnalysisEngineFactory.createEngineDescription(ExtractSpeechByType.class,
					ExtractSpeechByType.PARAM_OUTPUT_DIRECTORY, tdir.getAbsolutePath(),
					ExtractSpeechByType.PARAM_TYPE, "Gender"));
	assertTrue(tdir.exists());
	assertTrue(tdir.isDirectory());
	assertEquals(2, tdir.listFiles().length);
}
 
开发者ID:quadrama,项目名称:DramaNLP,代码行数:15,代码来源:TestExtractSpeechByType.java


示例15: testExtractSpeechByTypeUnmerged

import de.tudarmstadt.ukp.dkpro.core.io.xmi.XmiReader; //导入依赖的package包/类
@Test
public void testExtractSpeechByTypeUnmerged() throws Exception {
	File tdir = new File("target/ExtractSpeechByType/texts/");
	FileUtils.deleteDirectory(tdir);
	SimplePipeline.runPipeline(
			CollectionReaderFactory.createReaderDescription(XmiReader.class, XmiReader.PARAM_SOURCE_LOCATION,
					"src/test/resources/ExtractSpeechByType/*.xmi", XmiReader.PARAM_LENIENT, true),
			AnalysisEngineFactory.createEngineDescription(ExtractSpeechByType.class,
					ExtractSpeechByType.PARAM_OUTPUT_DIRECTORY, tdir.getAbsolutePath(),
					ExtractSpeechByType.PARAM_TYPE, "Gender", ExtractSpeechByType.PARAM_MERGED, false));
	assertTrue(tdir.exists());
	assertTrue(tdir.isDirectory());
	assertEquals(2, tdir.listFiles().length);
}
 
开发者ID:quadrama,项目名称:DramaNLP,代码行数:15,代码来源:TestExtractSpeechByType.java


示例16: testExtractFigureSpeech

import de.tudarmstadt.ukp.dkpro.core.io.xmi.XmiReader; //导入依赖的package包/类
@Test
public void testExtractFigureSpeech() throws ResourceInitializationException, UIMAException, IOException {
	File tdir = new File("target/texts/");
	FileUtils.deleteDirectory(tdir);
	SimplePipeline.runPipeline(
			CollectionReaderFactory.createReaderDescription(XmiReader.class, XmiReader.PARAM_SOURCE_LOCATION,
					"src/test/resources/*.xmi", XmiReader.PARAM_LENIENT, true),
			AnalysisEngineFactory.createEngineDescription(ExtractSpeechByFigure.class,
					ExtractSpeechByFigure.PARAM_OUTPUT_DIRECTORY, tdir.getAbsolutePath()));
	File rdir = new File(tdir, "SW_RuJ_vndf.0");
	assertTrue(rdir.exists());
	assertTrue(rdir.isDirectory());
	assertEquals(42, rdir.listFiles().length);
}
 
开发者ID:quadrama,项目名称:DramaNLP,代码行数:15,代码来源:TestExtractSpeechByFigure.java


示例17: testPrepareClearTk

import de.tudarmstadt.ukp.dkpro.core.io.xmi.XmiReader; //导入依赖的package包/类
@Test
public void testPrepareClearTk() throws ResourceInitializationException, UIMAException, IOException {
	SimplePipeline.runPipeline(
			CollectionReaderFactory.createReaderDescription(XmiReader.class, XmiReader.PARAM_SOURCE_LOCATION,
					"src/main/resources/gender/training/11d2m.0.xmi", XmiReader.PARAM_LENIENT, true),
			AnalysisEngineFactory.createEngineDescription(PrepareClearTk.class,
					PrepareClearTk.PARAM_ANNOTATION_TYPE, DramatisPersonae.class,
					PrepareClearTk.PARAM_SUBANNOTATIONS, Arrays.asList(Figure.class.getName()),
					PrepareClearTk.PARAM_VIEW_NAME, "DP"),
			AnalysisEngineFactory.createEngineDescription(XmiWriter.class, XmiWriter.PARAM_TARGET_LOCATION,
					"target/"));
}
 
开发者ID:quadrama,项目名称:DramaNLP,代码行数:13,代码来源:TestPrepareClearTk.java


示例18: testExport

import de.tudarmstadt.ukp.dkpro.core.io.xmi.XmiReader; //导入依赖的package包/类
public void testExport() throws ResourceInitializationException, UIMAException, IOException {
	SimplePipeline.runPipeline(
			CollectionReaderFactory.createReaderDescription(XmiReader.class, XmiReader.PARAM_SOURCE_LOCATION,
					"src/test/resources/*.xmi", XmiReader.PARAM_LENIENT, true),
			AnalysisEngineFactory.createEngineDescription(FigureReferenceAnnotator.class),
			MetaDataExport.getDescription(new File("target/ontology.owl"), true, false));
}
 
开发者ID:quadrama,项目名称:DramaNLP,代码行数:8,代码来源:TestMetaDataExport.java


示例19: evaluateSpeakerAssignments

import de.tudarmstadt.ukp.dkpro.core.io.xmi.XmiReader; //导入依赖的package包/类
@Test
public void evaluateSpeakerAssignments() throws Exception {
	JCasIterator iter = SimplePipeline
			.iteratePipeline(
					CollectionReaderFactory.createReaderDescription(XmiReader.class,
							XmiReader.PARAM_SOURCE_LOCATION, "src/test/resources/SpeakerIdentifier/tx4z.0.xmi",
							XmiReader.PARAM_LENIENT, true),
					createEngineDescription(FigureReferenceAnnotator.class),
					createEngineDescription(SpeakerIdentifier.class, SpeakerIdentifier.PARAM_CREATE_SPEAKER_FIGURE,
							false),
					createEngineDescription(XmiWriter.class, XmiWriter.PARAM_TARGET_LOCATION, "target/doc"))
			.iterator();
	StringBuilder b = new StringBuilder();
	CSVPrinter writer = new CSVPrinter(b, CSVFormat.TDF);
	SummaryStatistics types = new SummaryStatistics();
	SummaryStatistics tokens = new SummaryStatistics();
	while (iter.hasNext()) {
		JCas jcas = iter.next();
		int s = 0;
		int all = 0;
		Counter<String> unassigned = new Counter<String>();
		for (Speaker speaker : JCasUtil.select(jcas, Speaker.class)) {
			if (speaker.getFigure() == null) {
				unassigned.add(speaker.getCoveredText());
				s++;
			}
			all++;
		}
		types.addValue(unassigned.size());
		tokens.addValue(s);
		writer.printRecord(JCasUtil.selectSingle(jcas, Drama.class).getDocumentId(), s, unassigned.size(), all);
	}
	writer.printRecord("mean", tokens.getMean(), types.getMean());
	writer.printRecord("min", tokens.getMin(), types.getMin());
	writer.printRecord("max", tokens.getMax(), types.getMax());
	writer.close();
	System.out.println(b.toString());
}
 
开发者ID:quadrama,项目名称:DramaNLP,代码行数:39,代码来源:TestSpeakerIdentifier.java


示例20: main

import de.tudarmstadt.ukp.dkpro.core.io.xmi.XmiReader; //导入依赖的package包/类
public static void main(String[] args)
{
    // TODO set this properly to "gold.data.toulmin" directory
    final String annotatedCorpusDir = args[0];

    // TODO set this to output directory
    final String outputDir = args[1];

    try {
        SimplePipeline.runPipeline(CollectionReaderFactory.createReaderDescription(
                XmiReader.class,
                XmiReader.PARAM_SOURCE_LOCATION, annotatedCorpusDir,
                XmiReader.PARAM_PATTERNS, "[+]*.xmi",
                XmiReader.PARAM_LENIENT, true
                ),
                // annotate with BIO tags
                AnalysisEngineFactory.createEngineDescription(
                        ArgumentTokenBIOAnnotator.class,
                        ArgumentTokenBIOAnnotator.PARAM_LABEL_GRANULARITY,
                        ArgumentTokenBIOAnnotator.BIO
                ),
                // export to TXT files
                AnalysisEngineFactory.createEngineDescription(
                        TokenTabBIOArgumentWriter.class,
                        TokenTabBIOArgumentWriter.PARAM_TARGET_LOCATION,
                        outputDir
                )
        );
    }
    catch (Exception e) {
        e.printStackTrace();
    }
}
 
开发者ID:dkpro,项目名称:dkpro-argumentation,代码行数:34,代码来源:ArgumentationCorpusBIOTokenExporter.java



注:本文中的de.tudarmstadt.ukp.dkpro.core.io.xmi.XmiReader类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java LimitHelper类代码示例发布时间:2022-05-23
下一篇:
Java HttpStatusClass类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap