Giter Site home page Giter Site logo

Comments (2)

wkyhit avatar wkyhit commented on June 7, 2024

此外我还发现,使用jio.ner.extract_time()无法解析带“未来”的时间,但是可以解析带“过去”关键词的时间。
例如:

jio.ner.extract_time("过去7天", time_base="2023-11-13 00:00:00")
[{'text': '过去7天', 'offset': [0, 4], 'type': 'time_span', 'detail': {'type': 'time_span', 'definition': 'blur', 'time': ['2023-11-06 00:00:00', '2023-11-13 00:00:00']}}]

jio.ner.extract_time("未来7天", time_base="2023-11-13 00:00:00")
[{'text': '7天', 'offset': [2, 4], 'type': 'time_delta', 'detail': {'type': 'time_delta', 'definition': 'accurate', 'time': {'day': 7.0}}}]

我阅读代码后发现,parse_time是支持解析“过去”和“未来”时间的,因此ner的时间提取是否需要加上“未来”关键词?
https://github.com/dongrixinyu/JioNLP/blob/master/jionlp/rule/rule_pattern.py 的 TIME_CHAR_STRING中是否能加上“未来”,以保持parse_time和ner.extract_time的功能一致?

from jionlp.

dongrixinyu avatar dongrixinyu commented on June 7, 2024

可以的,可以提一个 pr给我

from jionlp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.