fhamborg / Giveme5W1H

Extraction of the journalistic five W and one H questions (5W1H) from news articles: who did what, when, where, why, and how?
Apache License 2.0
505 stars 87 forks source link

Displays HTTPError: 500 Server Error: Internal Server Error for url #82

Open xrq682 opened 1 year ago

xrq682 commented 1 year ago

Describe the bug

Following installation, recieved the following while executing the parse_single_from_code.py.

No extractors passed: initializing default configuration. No combinedScorers passed: initializing default configuration.

Traceback (most recent call last): File "D:\anaconda\lib\site-packages\stanza\server\client.py", line 466, in _request r.raise_for_status() File "D:\anaconda\lib\site-packages\requests\models.py", line 943, in raise_for_status raise HTTPError(http_error_msg, response=self) HTTPError: 500 Server Error: Internal Server Error for url: http://localhost:9000/?properties=%7B%27outputFormat%27%3A+%27json%27%2C+%27timeout%27%3A+500000%2C+%27annotators%27%3A+%27tokenize%2Cssplit%2Cpos%2Clemma%2Cparse%2Cner%2Cdepparse%2Cmention%2Ccoref%27%2C+%27tokenize.language%27%3A+%27English%27%2C+%27date%27%3A+%272016-11-10+07%3A44%3A00%27%7D&resetDefault=false During handling of the above exception, another exception occurred: Traceback (most recent call last): File "D:\anaconda\Lib\site-packages\Giveme5W1H\examples\extracting\parse_single_from_code.py", line 80, in doc = extractor.parse(doc) File "D:\anaconda\lib\site-packages\Giveme5W1H\extractor\extractor.py", line 104, in parse self.preprocess(doc) File "D:\anaconda\lib\site-packages\Giveme5W1H\extractor\extractor.py", line 87, in preprocess self.preprocessor.preprocess(doc) File "D:\anaconda\lib\site-packages\Giveme5W1H\extractor\preprocessors\preprocessor_core_nlp.py", line 111, in preprocess annotation = self.cnlp.annotate(text=document.get_full_text(), File "D:\anaconda\lib\site-packages\stanza\server\client.py", line 533, in annotate r = self._request(text.encode('utf-8'), request_properties, reset_default, **kwargs) File "D:\anaconda\lib\site-packages\stanza\server\client.py", line 471, in _request raise AnnotationException(e) AnnotationException: 500 Server Error: Internal Server Error for url: http://localhost:9000/?properties=%7B%27outputFormat%27%3A+%27json%27%2C+%27timeout%27%3A+500000%2C+%27annotators%27%3A+%27tokenize%2Cssplit%2Cpos%2Clemma%2Cparse%2Cner%2Cdepparse%2Cmention%2Ccoref%27%2C+%27tokenize.language%27%3A+%27English%27%2C+%27date%27%3A+%272016-11-10+07%3A44%3A00%27%7D&resetDefault=false

To Reproduce after connected to the server, run parse_single_from_code.py(or other example codes)

Expected behavior all possible answers of the 5w1h in the example text should be printed

Log No extractors passed: initializing default configuration. No combinedScorers passed: initializing default configuration.

This issue is similar to #69,but I have the error:”HTTPError: 500 Server Error: Internal Server Error for url:http://localhost:9000/?properties=%7B%27outputFormat%27%3A+%27json%27%2C+%27timeout%27%3A+500000%2C+%27annotators%27%3A+%27tokenize%2Cssplit%2Cpos%2Clemma%2Cparse%2Cner%2Cdepparse%2Cmention%2Ccoref%27%2C+%27tokenize.language%27%3A+%27English%27%2C+%27date%27%3A+%272016-11-10+07%3A44%3A00%27%7D&resetDefault=false

Versions (please complete the following information):

xrq682 commented 1 year ago

INFO edu.stanford.nlp.time.JollyDayHolidays - Initializing JollyDayHoliday for SUTime from classpath edu/stanford/nlp/models/sutime/jollyday/Holidays_sutime.xml as sutime.binder.1. 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.(NumberSequenceClassifier.java:86) at edu.stanford.nlp.ie.NERClassifierCombiner.(NERClassifierCombiner.java:136) at edu.stanford.nlp.pipeline.NERCombinerAnnotator.(NERCombinerAnnotator.java:91) at edu.stanford.nlp.pipeline.AnnotatorImplementations.ner(AnnotatorImplementations.java:70) at edu.stanford.nlp.pipeline.StanfordCoreNLP.lambda$getNamedAnnotators$44(StanfordCoreNLP.java:498) at edu.stanford.nlp.pipeline.StanfordCoreNLP.lambda$getDefaultAnnotatorPool$65(StanfordCoreNLP.java:533) at edu.stanford.nlp.util.Lazy$3.compute(Lazy.java:118) at edu.stanford.nlp.util.Lazy.get(Lazy.java:31) at edu.stanford.nlp.pipeline.AnnotatorPool.get(AnnotatorPool.java:146) at edu.stanford.nlp.pipeline.StanfordCoreNLP.construct(StanfordCoreNLP.java:447) at edu.stanford.nlp.pipeline.StanfordCoreNLP.(StanfordCoreNLP.java:150) at edu.stanford.nlp.pipeline.StanfordCoreNLP.(StanfordCoreNLP.java:146) at edu.stanford.nlp.pipeline.StanfordCoreNLP.(StanfordCoreNLP.java:133) at edu.stanford.nlp.pipeline.StanfordCoreNLPServer.mkStanfordCoreNLP(StanfordCoreNLPServer.java:319) at edu.stanford.nlp.pipeline.StanfordCoreNLPServer.access$500(StanfordCoreNLPServer.java:50) at edu.stanford.nlp.pipeline.StanfordCoreNLPServer$CoreNLPHandler.handle(StanfordCoreNLPServer.java:642) at jdk.httpserver/com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:95) at jdk.httpserver/sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:82) at jdk.httpserver/com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:98) at jdk.httpserver/sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:733) at jdk.httpserver/com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:95) at jdk.httpserver/sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:700) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at java.base/java.lang.Thread.run(Thread.java:833) 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) ... 27 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:77) at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499) at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480) at edu.stanford.nlp.util.MetaClass$ClassFactory.createInstance(MetaClass.java:233) ... 29 more Caused by: java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException at de.jollyday.util.CalendarUtil.(CalendarUtil.java:42) at de.jollyday.HolidayManager.(HolidayManager.java:66) at de.jollyday.impl.DefaultHolidayManager.(DefaultHolidayManager.java:46) at edu.stanford.nlp.time.JollyDayHolidays$MyXMLManager.(JollyDayHolidays.java:148) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499) at java.base/java.lang.reflect.ReflectAccess.newInstance(ReflectAccess.java:128) at java.base/jdk.internal.reflect.ReflectionFactory.newInstance(ReflectionFactory.java:347) at java.base/java.lang.Class.newInstance(Class.java:645) 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.(Options.java:90) at edu.stanford.nlp.time.TimeExpressionExtractorImpl.init(TimeExpressionExtractorImpl.java:44) at edu.stanford.nlp.time.TimeExpressionExtractorImpl.(TimeExpressionExtractorImpl.java:39) ... 35 more Caused by: java.lang.ClassNotFoundException: javax.xml.bind.JAXBException at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520) ... 56 more ^C[Thread-0] INFO CoreNLP - CoreNLP Server is shutting down.

xrq682 commented 1 year ago

The problem has been solved,the Stanfordcorenlp version is not compatible with java9 or higher, just drop the java version to 8 or below