Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

提取语义式的时间会出错,貌似是与arrows兼容性的问题 #40

Open
linzepore opened this issue Jun 3, 2023 · 1 comment

Comments

@linzepore
Copy link

时间只有在明确的时间不会出错,类似于“上周”这种表达就会触发错误

我调试了位于“cocoNLP\Lib\site-packages\cocoNLP\config\basic\time_nlp”下的TimeUnit.py,先是把arrows降级到0.15.0,然后把.replace替换成.replace``.shift,之后给getTime方法修改(分别加上s)
image

最后还是有错误
image
不知用的是哪一版本的arrows呢

@linzepore
Copy link
Author

arrow==0.14.3会有以下警告:

times = ex.extract_time(text)
xxx: ArrowParseWarning: The .get() parsing method without a format string will parse more strictly in version 0.15.0.See https://github.com/crsmithdev/arrow/issues/612 for more details.
  ArrowParseWarning,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant