News for hackers. Stuff that matters.
Re:A cool way to use natural language in JavaScript by hegivor on Saturday May 14, 2016 @10:05AM (#11696176)
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...
Re:A cool way to use natural language in JavaScript by thomasahle on Saturday May 14, 2016 @10:24AM (#11696249)
Maybe they want to show us the limitations? This makes it seem like they are not doing any fancy grammar parsing.
Re:A cool way to use natural language in JavaScript by guptaneil on Saturday May 14, 2016 @01:35PM (#11697178)
If you're looking for a library that could handle that sentence, check out https://github.com/neilgupta/sherlock :)

nlp-compromise definitely does way more, but in NLP, it helps to be domain-specific.

Re:A cool way to use natural language in JavaScript by btown on Saturday May 14, 2016 @04:01PM (#11697801)
Does anyone know if there's an equivalent library in Python?
Re:A cool way to use natural language in JavaScript by eloisius on Saturday May 14, 2016 @06:49PM (#11698416)
Re:A cool way to use natural language in JavaScript by glibgil on Saturday May 14, 2016 @05:14PM (#11698062)
No, no one knows
Re:A cool way to use natural language in JavaScript by earleybird on Saturday May 14, 2016 @06:15PM (#11698299)
I believe that is:

  nlp.text('No one knows.').people()[0].text
  'No one'
Re:A cool way to use natural language in JavaScript by hurricaneSlider on Sunday May 15, 2016 @06:05AM (#11700241)
Was that sarcasm necessary?
Re:A cool way to use natural language in JavaScript by userbinator on Saturday May 14, 2016 @12:20PM (#11696762)
No 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.
Re:A cool way to use natural language in JavaScript by themartorana on Saturday May 14, 2016 @01:40PM (#11697209)
Everyone 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.
Re:A cool way to use natural language in JavaScript by gengkev on Sunday May 15, 2016 @02:08PM (#11701988)
I write dates that way too, but because mm/dd/yyy is ambiguous in an international context. Sorting correctly is great as well!
Re:A cool way to use natural language in JavaScript by hueving on Saturday May 14, 2016 @12:52PM (#11696955)
April 2nd.
Re:A cool way to use natural language in JavaScript by usmannk on Saturday May 14, 2016 @01:28PM (#11697141)
That's the wrong date though. The person's name is April.
Re:A cool way to use natural language in JavaScript by kuzmin on Saturday May 14, 2016 @02:52PM (#11697523)
Yes, but you can still see how the model (mistakenly) arrives at this date
Re:A cool way to use natural language in JavaScript by petemill on Saturday May 14, 2016 @12:44PM (#11696908)
April = 4

2nd = 2