首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >部署为web服务的Python中的SUTime在每次命中时都会重新启动

部署为web服务的Python中的SUTime在每次命中时都会重新启动
EN

Stack Overflow用户
提问于 2018-08-08 22:39:33
回答 1查看 314关注 0票数 0

我已经在REDHAT ENTERPRISE Limited7操作系统中部署了python SUTime作为web服务。(安装是根据链接https://github.com/FraBle/python-sutime完成的,并为此创建了一个服务器代码)使用的python版本是2.7.5。在每次api调用时,服务都会重新启动。错误显示引号如下:

代码语言:javascript
复制
> * Running on http://0.0.0.0:9001/ (Press CTRL+C to quit)
bash: line 1: 11488 Aborted                 python sutime_server.py
[main] INFO edu.stanford.nlp.pipeline.StanfordCoreNLP - Registering annotator sutime with class edu.stanford.nlp.time.TimeAnnotator
[main] INFO edu.stanford.nlp.pipeline.StanfordCoreNLP - Adding annotator tokenize
[main] INFO edu.stanford.nlp.pipeline.TokenizerAnnotator - TokenizerAnnotator: No tokenizer type provided. Defaulting to PTBTokenizer.
[main] INFO edu.stanford.nlp.pipeline.StanfordCoreNLP - Adding annotator ssplit
[main] INFO edu.stanford.nlp.pipeline.StanfordCoreNLP - Adding annotator pos
Reading POS tagger model from edu/stanford/nlp/models/pos-tagger/english-left3words/english-left3words-distsim.tagger ... done [3.2 sec].
[main] INFO edu.stanford.nlp.pipeline.StanfordCoreNLP - Adding annotator lemma
[main] INFO edu.stanford.nlp.pipeline.StanfordCoreNLP - Adding annotator ner
sutime.includeRange=true
Unknown property: |sutime.includeRange|
sutime.markTimeRanges=true
Unknown property: |sutime.markTimeRanges|
Loading classifier from edu/stanford/nlp/models/ner/english.all.3class.distsim.crf.ser.gz ... Unknown property: |sutime.includeRange|
Unknown property: |sutime.markTimeRanges|
done [3.7 sec].
Loading classifier from edu/stanford/nlp/models/ner/english.muc.7class.distsim.crf.ser.gz ... Unknown property: |sutime.includeRange|
Unknown property: |sutime.markTimeRanges|
done [2.4 sec].
Loading classifier from edu/stanford/nlp/models/ner/english.conll.4class.distsim.crf.ser.gz ... Unknown property: |sutime.includeRange|
Unknown property: |sutime.markTimeRanges|
done [1.1 sec].
[main] 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.
Reading TokensRegex rules from edu/stanford/nlp/models/sutime/defs.sutime.txt
Aug 08, 2018 1:38:03 PM edu.stanford.nlp.ling.tokensregex.CoreMapExpressionExtractor appendRules
INFO: Read 83 rules
Reading TokensRegex rules from edu/stanford/nlp/models/sutime/english.sutime.txt
Aug 08, 2018 1:38:04 PM edu.stanford.nlp.ling.tokensregex.CoreMapExpressionExtractor appendRules
INFO: Read 267 rules
Reading TokensRegex rules from edu/stanford/nlp/models/sutime/english.holidays.sutime.txt
Aug 08, 2018 1:38:04 PM edu.stanford.nlp.ling.tokensregex.CoreMapExpressionExtractor appendRules
INFO: Read 25 rules
[main] INFO edu.stanford.nlp.pipeline.StanfordCoreNLP - Adding annotator sutime
[main] 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.
Reading TokensRegex rules from edu/stanford/nlp/models/sutime/defs.sutime.txt
Aug 08, 2018 1:38:04 PM edu.stanford.nlp.ling.tokensregex.CoreMapExpressionExtractor appendRules
INFO: Read 83 rules
Reading TokensRegex rules from edu/stanford/nlp/models/sutime/english.sutime.txt
Aug 08, 2018 1:38:04 PM edu.stanford.nlp.ling.tokensregex.CoreMapExpressionExtractor appendRules
INFO: Read 267 rules
Reading TokensRegex rules from edu/stanford/nlp/models/sutime/english.holidays.sutime.txt
Aug 08, 2018 1:38:04 PM edu.stanford.nlp.ling.tokensregex.CoreMapExpressionExtractor appendRules
INFO: Read 25 rules

如何解决此问题?

EN

回答 1

Stack Overflow用户

发布于 2019-02-27 13:16:05

您可以使用全局sutime变量,您将使用sutime对其进行初始化,并在api调用的代码中使用该变量

代码语言:javascript
复制
sutime = ''

if sutime == 'None':
            sutime = SUTime(
                jars='path to jar folder')
        else:
            print('JVM Already Started')
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/51749435

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档