CoreNLP TimeExpressionExtractorFactory.isDefaultExtractorPresent() 检查类但不检查资源,

kzmpq1sx  于 2个月前  发布在  其他
关注(0)|答案(5)|浏览(51)

TimeExpressionExtractorFactory.isDefaultExtractorPresent() check if the class for the default time expression extractor is present (i.e. edu.stanford.nlp.time.TimeExpressionExtractorImpl which is in the CoreNLP jar and thus likely always present). It doesn't check though if the resources required by this extractor are present (in the "models" jar which may actually not be present).
When not having the models jar on the classpath and using alternative means of providing the NERClassifierCombiner with models then causes the auto-detection to fail with this exception:

Caused by: 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:81)
    at edu.stanford.nlp.ie.regexp.NumberSequenceClassifier.<init>(NumberSequenceClassifier.java:73)
    at edu.stanford.nlp.ie.NERClassifierCombiner.<init>(NERClassifierCombiner.java:103)
       <snip>
    ... 32 more
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:235)
    at edu.stanford.nlp.util.MetaClass.createInstance(MetaClass.java:380)
    at edu.stanford.nlp.util.ReflectionLoading.loadByReflection(ReflectionLoading.java:38)
    ... 46 more
Caused by: java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
    at edu.stanford.nlp.util.MetaClass$ClassFactory.createInstance(MetaClass.java:231)
    ... 48 more
Caused by: java.lang.RuntimeException: Error initializing binder 1
    at edu.stanford.nlp.time.Options.<init>(Options.java:92)
    at edu.stanford.nlp.time.TimeExpressionExtractorImpl.init(TimeExpressionExtractorImpl.java:45)
    at edu.stanford.nlp.time.TimeExpressionExtractorImpl.<init>(TimeExpressionExtractorImpl.java:39)
    ... 53 more
Caused by: java.lang.NullPointerException: Missing URL.
    at de.jollyday.HolidayManager.getInstance(HolidayManager.java:190)
    at edu.stanford.nlp.time.JollyDayHolidays.init(JollyDayHolidays.java:51)
    at edu.stanford.nlp.time.Options.<init>(Options.java:90)
    ... 55 more
fv2wmkja

fv2wmkja1#

Just FYI something is happening to your "." periods which are making them
not come through on email.
On Wed, Jan 6, 2016 at 12:26 PM, Richard Eckart de Castilho <
notifications@github.com > wrote:
TimeExpressionExtractorFactoryisDefaultExtractorPresent() check if the
class for the default time expression extractor is present (ie
edustanfordnlptimeTimeExpressionExtractorImpl which is in the CoreNLP jar
and thus likely always present) It doesn't check though if the resources
required by this extractor are present (in the "models" jar which may
actually not be present)
When not having the models jar on the classpath and using alternative
means of providing the NERClassifierCombiner with models then causes the
auto-detection to fail with this exception:
Caused by: edustanfordnlputilReflectionLoading$ReflectionLoadingException: Error creating edustanfordnlptimeTimeExpressionExtractorImpl
at edustanfordnlputilReflectionLoadingloadByReflection(ReflectionLoadingjava:40)
at edustanfordnlptimeTimeExpressionExtractorFactorycreate(TimeExpressionExtractorFactoryjava:57)
at edustanfordnlptimeTimeExpressionExtractorFactorycreateExtractor(TimeExpressionExtractorFactoryjava:38)
at edustanfordnlpieregexpNumberSequenceClassifier(NumberSequenceClassifierjava:81)
at edustanfordnlpieregexpNumberSequenceClassifier(NumberSequenceClassifierjava:73)
at edustanfordnlpieNERClassifierCombiner(NERClassifierCombinerjava:103)
32 more
Caused by: edustanfordnlputilMetaClass$ClassCreationException: MetaClass couldn't create public edustanfordnlptimeTimeExpressionExtractorImpl(javalangString,javautilProperties) with args [sutime, {}]
at edustanfordnlputilMetaClass$ClassFactorycreateInstance(MetaClassjava:235)
at edustanfordnlputilMetaClasscreateInstance(MetaClassjava:380)
at edustanfordnlputilReflectionLoadingloadByReflection(ReflectionLoadingjava:38)
46 more
Caused by: javalangreflectInvocationTargetException
at sunreflectNativeConstructorAccessorImplnewInstance0(Native Method)
at sunreflectNativeConstructorAccessorImplnewInstance(NativeConstructorAccessorImpljava:62)
at sunreflectDelegatingConstructorAccessorImplnewInstance(DelegatingConstructorAccessorImpljava:45)
at javalangreflectConstructornewInstance(Constructorjava:422)
at edustanfordnlputilMetaClass$ClassFactorycreateInstance(MetaClassjava:231)
48 more
Caused by: javalangRuntimeException: Error initializing binder 1
at edustanfordnlptimeOptions(Optionsjava:92)
at edustanfordnlptimeTimeExpressionExtractorImplinit(TimeExpressionExtractorImpljava:45)
at edustanfordnlptimeTimeExpressionExtractorImpl(TimeExpressionExtractorImpljava:39)
53 more
Caused by: javalangNullPointerException: Missing URL
at dejollydayHolidayManagergetInstance(HolidayManagerjava:190)
at edustanfordnlptimeJollyDayHolidaysinit(JollyDayHolidaysjava:51)
at edustanfordnlptimeOptions(Optionsjava:90)
55 more

Reply to this email directly or view it on GitHub

122.

luaexgnf

luaexgnf2#

嗯,那就是GitHub的问题了——在评论中,它们是存在的。

8wigbo56

8wigbo563#

如果相关的话,你最近的邮件看起来像这样:
嗯,那就是Github的问题了
在“that's”中有一个',但在“Githubs”中没有
2016年1月6日星期三,Richard Eckart de Castilho < notifications@github.com >写道:
嗯,那就是Github的问题了 - 在上面的评论中,它们是存在的。

直接回复此电子邮件或在GitHub上查看它

122(评论)

j2qf4p5b

j2qf4p5b4#

嗯,那就是Github的问题了。
这是因为我在第一次发布时犯了一个拼写错误,然后编辑评论来纠正它。

odopli94

odopli945#

粗略的"修复"?
dickmao@5a0b269?diff=split#diff-197bc6bb30fbb74a02668c3f9beed8be

相关问题