gpt4 book ai didi

python - 创建 edu.stanford.nlp.time.TimeExpressionExtractorImpl 时出错

转载 作者:行者123 更新时间:2023-12-01 03:19:09 25 4
gpt4 key购买 nike

我正在运行 this 的 cort 共指解析github 仓库。使用语法在原始输入文本上运行系统,如下所示:

cort-predict-raw -in *.txt \ 
-model model.obj \
-extractor cort.coreference.approaches.mention_ranking.extract_substructures \
-perceptron cort.coreference.approaches.mention_ranking.RankingPerceptron \
-clusterer cort.coreference.clusterer.all_ante \
-corenlp /home/kenden/deeshacodes/corenlp \

我收到以下错误:-

Exception in thread "main" edu.stanford.nlp.util.ReflectionLoading$ReflectionLoadingException: Error creating edu.stanford.nlp.time.TimeExpressionExtractorImpl
at edu.stanford.nlp.util.ReflectionLoading.loadByReflection(ReflectionLoading.java:40)
at edu.stanford.nlp.time.TimeExpressionExtractorFactory.create(TimeExpressionExtractorFactory.java:57)
at edu.stanford.nlp.time.TimeExpressionExtractorFactory.createExtractor(TimeExpressionExtractorFactory.java:38)
at edu.stanford.nlp.ie.regexp.NumberSequenceClassifier.<init>(NumberSequenceClassifier.java:86)
at edu.stanford.nlp.ie.NERClassifierCombiner.<init>(NERClassifierCombiner.java:132)
at edu.stanford.nlp.pipeline.AnnotatorImplementations.ner(AnnotatorImplementations.java:121)
at edu.stanford.nlp.pipeline.AnnotatorFactories$6.create(AnnotatorFactories.java:273)
at edu.stanford.nlp.pipeline.AnnotatorPool.get(AnnotatorPool.java:152)
at edu.stanford.nlp.pipeline.StanfordCoreNLP.construct(StanfordCoreNLP.java:451)
at edu.stanford.nlp.pipeline.StanfordCoreNLP.<init>(StanfordCoreNLP.java:154)
at edu.stanford.nlp.pipeline.StanfordCoreNLP.<init>(StanfordCoreNLP.java:150)
at edu.stanford.nlp.pipeline.StanfordCoreNLP.<init>(StanfordCoreNLP.java:137)
at corenlp.JsonPipeline.initializeCorenlpPipeline(JsonPipeline.java:206)
at corenlp.SocketServer.main(SocketServer.java:102)
Caused by: edu.stanford.nlp.util.MetaClass$ClassCreationException: MetaClass couldn't create public edu.stanford.nlp.time.TimeExpressionExtractorImpl(java.lang.String,java.util.Properties) with args [sutime, {}]
at edu.stanford.nlp.util.MetaClass$ClassFactory.createInstance(MetaClass.java:237)
at edu.stanford.nlp.util.MetaClass.createInstance(MetaClass.java:382)
at edu.stanford.nlp.util.ReflectionLoading.loadByReflection(ReflectionLoading.java:38)
... 13 more
Caused by: java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:466)
at edu.stanford.nlp.util.MetaClass$ClassFactory.createInstance(MetaClass.java:233)
... 15 more
Caused by: java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException
at de.jollyday.util.CalendarUtil.<init>(CalendarUtil.java:42)
at de.jollyday.HolidayManager.<init>(HolidayManager.java:66)
at de.jollyday.impl.DefaultHolidayManager.<init>(DefaultHolidayManager.java:46)
at edu.stanford.nlp.time.JollyDayHolidays$MyXMLManager.<init>(JollyDayHolidays.java:148)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:466)
at java.base/java.lang.Class.newInstance(Class.java:556)
at de.jollyday.caching.HolidayManagerValueHandler.instantiateManagerImpl(HolidayManagerValueHandler.java:60)
at de.jollyday.caching.HolidayManagerValueHandler.createValue(HolidayManagerValueHandler.java:41)
at de.jollyday.caching.HolidayManagerValueHandler.createValue(HolidayManagerValueHandler.java:13)
at de.jollyday.util.Cache.get(Cache.java:51)
at de.jollyday.HolidayManager.createManager(HolidayManager.java:168)
at de.jollyday.HolidayManager.getInstance(HolidayManager.java:148)
at edu.stanford.nlp.time.JollyDayHolidays.init(JollyDayHolidays.java:57)
at edu.stanford.nlp.time.Options.<init>(Options.java:90)
at edu.stanford.nlp.time.TimeExpressionExtractorImpl.init(TimeExpressionExtractorImpl.java:44)
at edu.stanford.nlp.time.TimeExpressionExtractorImpl.<init>(TimeExpressionExtractorImpl.java:39)
... 20 more
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.JAXBException
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:532)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:186)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:473)
... 39 more

我尝试过 corenlp 版本 3.5.2、3.6.0 以及 3.7.0,但没有任何效果。我哪里会出错?

最佳答案

您需要确保使用正确版本的正确依赖项。

如果您使用斯坦福 CoreNLP 3.7.0,请确保您还拥有最新的 lib 和 liblocal 文件夹。

我相信此错误是因为您在某处有不兼容的依赖项 jar。

更新:这是 Java 9 导致的错误。添加此标志

--add-modules java.se.ee

它应该消失。

关于python - 创建 edu.stanford.nlp.time.TimeExpressionExtractorImpl 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42120594/

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