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

Common date format not recognised by NerManager #113

Closed
ollyfg opened this issue Nov 7, 2018 · 1 comment
Closed

Common date format not recognised by NerManager #113

ollyfg opened this issue Nov 7, 2018 · 1 comment

Comments

@ollyfg
Copy link

ollyfg commented Nov 7, 2018

Describe the bug
The string "Thu, Nov 1, 2018 at 5:06 PM" is not recognised as a date/datetime, despite being a very common way to describe a date. Ideally I would like to be able to recognise the whole datetime, but even getting the date from "Thu, Nov 1, 2018" would be helpful.
As a subset of this problem, I have notices that dates in the format "7 Nov 2018" are not recognised either.

To Reproduce
Steps to reproduce the behavior:

import { NerManager } from "node-nlp";
const manager = new NerManager();
const results = await manager.findEntities("This message was sent: Thu, Nov 1, 2018 at 5:06 PM, and I expect a reply before 7 Nov 2018");
const dates = results.filter(entity => {
  return entity.entity === "date";
});
console.log(dates);
// []

Expected behavior
Output something like:

[
  {
    "start": 0,
    "end": 9,
    "len": 10,
    "accuracy": 0.95,
    "sourceText": "Thu, Nov 1, 2018 at 5:06 PM",
    "utteranceText": "Thu, Nov 1, 2018 at 5:06 PM",
    "entity": "date",
    "resolution": {
      "type": "date",
      "timex": "2018-11-01",
      "strValue": "2018-11-01",
      "date": "2018-11-01T17:06:00.000Z"
    }
  },
  {
    "start": 0,
    "end": 9,
    "len": 10,
    "accuracy": 0.95,
    "sourceText": "7 Nov 2018",
    "utteranceText": "7 Nov 2018",
    "entity": "date",
    "resolution": {
      "type": "date",
      "timex": "2018-11-07",
      "strValue": "2018-11-07",
      "date": "2018-11-07T00:00:00.000Z"
    }
  }
]

Screenshots
NA

Desktop (please complete the following information):

  • OS: OSX
  • NodeJS v9.8.0
  • Version 2.1.7

Additional context
The rest of the entity extraction works like a charm (numbers, emails, etc.).

I would be happy to help out on this if somebody could point me in the right direction 😀

@ollyfg ollyfg closed this as completed Nov 7, 2018
@ollyfg
Copy link
Author

ollyfg commented Nov 7, 2018

My bad, they come out as "datetimes"! Silly me!

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