4 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 10y 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 10y agoMaybe they want to show us the limitations? This makes it seem like they are not doing any fancy grammar parsing.
- userbinator 10y 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 10y agoApril = 4 2nd = 2
- hueving 10y agoApril 2nd.
- themartorana 10y 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 10y agoI write dates that way too, but because mm/dd/yyy is ambiguous in an international context. Sorting correctly is great as well!
- guptaneil 10y 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 10y agoDoes anyone know if there's an equivalent library in Python?
- glibgil 10y agoNo, no one knows
- earleybird 10y agoI believe that is: nlp.text('No one knows.').people()[0].text 'No one'
- hurricaneSlider 10y agoWas that sarcasm necessary?
- eloisius 10y agonltk, maybe: http://www.nltk.org/ http://www.nltk.org/