Java 未序列化CoreNLPServer TimeAnnotator的键

Java 未序列化CoreNLPServer TimeAnnotator的键,java,stanford-nlp,Java,Stanford Nlp,如上所述,我使用以下属性文件为CoreNLP TimeAnnotator创建了一个自定义注释器 customAnnotatorClass.time = edu.stanford.nlp.time.TimeAnnotator annotators = tokenize,ssplit,pos,lemma, ner, time ner.useSUTime = true 但是我在尝试使用服务器上的time注释器时收到一个错误键没有被序列化:class edu.stanford.nlp.time.T

如上所述,我使用以下属性文件为CoreNLP TimeAnnotator创建了一个自定义注释器

customAnnotatorClass.time = edu.stanford.nlp.time.TimeAnnotator

annotators = tokenize,ssplit,pos,lemma, ner, time

ner.useSUTime = true
但是我在尝试使用服务器上的
time
注释器时收到一个错误
键没有被序列化:class edu.stanford.nlp.time.TimeAnnotations$TimexAnnotations
,下面是完整的错误

edu.stanford.nlp.pipeline.ProtobufAnnotationSerializer$LossySerializationException: Keys are not being serialized: class edu.stanford.nlp.time.TimeAnnotations$TimexAnnotations
at edu.stanford.nlp.pipeline.ProtobufAnnotationSerializer.toProto(ProtobufAnnotationSerializer.java:424)
at edu.stanford.nlp.pipeline.ProtobufAnnotationSerializer.toProtoBuilder(ProtobufAnnotationSerializer.java:636)
at edu.stanford.nlp.pipeline.ProtobufAnnotationSerializer.toProto(ProtobufAnnotationSerializer.java:592)
at edu.stanford.nlp.pipeline.ProtobufAnnotationSerializer.write(ProtobufAnnotationSerializer.java:184)
at edu.stanford.nlp.pipeline.StanfordCoreNLP.outputAnnotation(StanfordCoreNLP.java:1016)
at edu.stanford.nlp.pipeline.StanfordCoreNLP.lambda$createOutputter$35(StanfordCoreNLP.java:980)
at edu.stanford.nlp.pipeline.StanfordCoreNLPServer$CoreNLPHandler.handle(StanfordCoreNLPServer.java:876)
at jdk.httpserver/com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:77)
at jdk.httpserver/sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:82)
at jdk.httpserver/com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:80)
at jdk.httpserver/sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:692)
at jdk.httpserver/com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:77)
at jdk.httpserver/sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:664)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:830)

很可能,您的类的字段不可序列化。@minhazur它实际上不是我的类,它是stanford CoreNLP中的Timex注释对象!对不起,我不太清楚。检查,这是否最有帮助,您的类的字段不可序列化。@minhazur它实际上不是我的类,它是stanford CoreNLP中的Timex注释对象!对不起,我不太清楚。检查,这是否有帮助