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

多个时间描述提取不全 #6

Open
lovingers opened this issue Nov 16, 2018 · 1 comment
Open

多个时间描述提取不全 #6

lovingers opened this issue Nov 16, 2018 · 1 comment

Comments

@lovingers
Copy link

res = tn.parse(target="晚上八点到九点,明天中午给我")

运行结果:

temp ['晚上8点', '9点', '明天中午']
{"type": "timespan", "timespan": ["2018-11-17 20:00:00", "2018-11-17 21:00:00"]}
@jacmule
Copy link

jacmule commented Sep 2, 2019

默认只给出两个 如果需要都提取出来 把TimeNormalizer.py 第125行dic['timespan'] = [res[0].time.format("YYYY-MM-DD HH:mm:ss"), res[1].time.format("YYYY-MM-DD HH:mm:ss")]
改为dic['timespan']=[re.time.format("YYYY-MM-DD HH:mm:ss") for re in res]即可
不过因为有时间上下文的处理 不建议输入多个事件描述

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

2 participants