JioNLP icon indicating copy to clipboard operation
JioNLP copied to clipboard

时间周期性问题

Open 1615070057 opened this issue 3 years ago • 1 comments

描述(Description)

描述你遇到了什么问题(Please description your issue here)

  1. 版本(Version):
  • python 版本: 3.7
  • jionlp 版本: 1.3.41
  1. jionlp的调用代码与输入文本(Code & Text):
每周四三点和张三在徐家汇开会

3. 调用报错日志如下(Log):

无法解析,返回'time': [None, None]


**期望行为(Expectation)**

> 期望:返回准确的 'delta': {'day': 7}, 'point': {'time': [时间点]}


1615070057 avatar Dec 01 '21 02:12 1615070057

我用的 1.3.44 版本你看看结果是否合适?

text = '每周四三点'
res = jio.parse_time(text)
# {'type': 'time_period', 'definition': 'accurate', 'time': {'delta': {'day': 7}, 'point': {'time': ['2021-12-02 03:00:00', '2021-12-02 03:59:59'], 'string': '周四三点'}}}

text = '每周四三点和张三在徐家汇开会'
res = jio.ner.extract_time(text, with_parsing=False)
[{'text': '每周四三点', 'offset': [0, 5], 'type': 'time_period'}]

dongrixinyu avatar Dec 01 '21 06:12 dongrixinyu