6 ms·
Perhaps I am misunderstanding the example but isn't the date parsing result from the API documentation incorrect. nlp.value("I married April for the 2nd time
by hegivor 11y ago
Perhaps I am misunderstanding the example but isn't the date parsing result from the API documentation incorrect.
nlp.value("I married April for the 2nd time on June 5th 1998 ").date()
// [Date object] d.toLocaleString() -> "04/2/1998"
https://github.com/nlp-compromise/nlp_compromise/blob/master/docs/api.md#date-parsing https://github.com/nlp-compromise/nlp_compromise/blob/master...
- thomasahle 11y agoMaybe they want to show us the limitations? This makes it seem like they are not doing any fancy grammar parsing.
- userbinator 11y agoNo 4th or February in the string either... yet another example of how unambiguous date parsing in natural languages is very, very difficult. Also an example of why ISO-8601 is awesome.
- petemill 11y agoApril = 4 2nd = 2
- hueving 11y agoApril 2nd.
- themartorana 11y agoEveryone always looks at me funny when I write my dates as `yyyy-mm-dd` - until, that is, I explain that it sorts alphabetically perfectly. That's the moment I can convert people to ISO-8601 converts.
- gengkev 11y agoI write dates that way too, but because mm/dd/yyy is ambiguous in an international context. Sorting correctly is great as well!
- guptaneil 11y agoIf you're looking for a library that could handle that sentence, check out https://github.com/neilgupta/sherlock https://github.com/neilgupta/sherlock :) nlp-compromise definitely does way more, but in NLP, it helps to be domain-specific.
- btown 11y agoDoes anyone know if there's an equivalent library in Python?
- glibgil 11y agoNo, no one knows
- earleybird 11y agoI believe that is: nlp.text('No one knows.').people()[0].text 'No one'
- hurricaneSlider 11y agoWas that sarcasm necessary?
- eloisius 11y agonltk, maybe: http://www.nltk.org/ http://www.nltk.org/