gpt4 book ai didi

java - 斯坦福 CoreNLP - 加载带注释的文件而不是注释方法

转载 作者:行者123 更新时间:2023-11-30 06:13:20 25 4
gpt4 key购买 nike

我使用“prettyprint”方法获得了一个文件,我将加载它而不是使用“annotate”方法。但我找不到使用的方法。我使用 stanford-corenlp-3.9.0 和 api。谢谢。

最佳答案

如果您想在文件上运行一次管道,然后保存结果并稍后从文件中加载它们,则需要使用我们提供的 protobuf 序列化功能。我们没有任何方法可以加载 jsontext 并从中构建注释。

ProtobufAnnotationSerializer serializer = new ProtobufAnnotationSerializer();
File inputFile = ...;
Annotation ann = serializer.readUndelimited(inputFile);

如果运行管道,则可以使用 -outputFormat serialized-serializer edu.stanford.nlp.pipeline.ProtobufAnnotationSerializer 输出序列化文件

它处理的每个文件都将是一个代表该文件注释的 Protocol Buffer 。

关于java - 斯坦福 CoreNLP - 加载带注释的文件而不是注释方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49799065/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com