5 ms·
nlp.statement('She sells seashells').negate().text() // She doesn't sell seashells nlp.sentence('I fed the dog').replace('the [Noun]', 'the cat').text()
by oori 10y ago
nlp.statement('She sells seashells').negate().text()
// She doesn't sell seashells
nlp.sentence('I fed the dog').replace('the [Noun]', 'the cat').text()
// I fed the cat
nlp.text("Tony Hawk did a kickflip").people();
// [ Person { text: 'Tony Hawk' ..} ]
- stephenr 10y agoDoes the same thing work if the name is lowercase? Stanford nlp won't recognise "I want to go to sydney" with a location because it expects proper nouns to be capitalised for places (and other similar named entities I believe). I tried to make their case less models work but a lack of time and patience resulted in a more specific fix for what we needed.
- atomwaffel 10y ago> nlp.text('i want to go to sydney.').places()[0].city 'Sydney' > nlp.text('tony hawk did a kickflip.').people()[0].text 'tony' So in the first case, it clearly does recognise that Sydney is a city independent of capitalisation. In the second case, it does recognise the first name but not the last, instead tagging "hawk" as a noun. The same happens with "john smith", however "john thomas" is recognised as a full name.
- mpjme 10y agoTo be fair, I think that my grandmother, not familiar with gaming/skating celebs, would tag it the same way.
- gcr 10y agoThanks for writing this comment. I can't think of a better way to describe what this library does than reading these super simple examples.
- deleted 10y ago[deleted]
- geon 10y agoCheck out the docs. It is chock full of them. https://github.com/nlp-compromise/nlp_compromise/blob/master/docs/api.md https://github.com/nlp-compromise/nlp_compromise/blob/master...
- lilgreenland 10y agoI added this to an example chatbot lesson I made for a high school intro CS class. http://codepen.io/lilgreenland/pen/zqXLeJ?editors=0010 http://codepen.io/lilgreenland/pen/zqXLeJ?editors=0010
- lilgreenland 10y agocan anyone think of some other cool tricks I can do with this to show my class on Monday?
- huj123 10y agoLook up example questions for the Loebner Prize, and see if you can tweak your bot to answer some of them.
- PantaloonFlames 10y agoThanks. Why don't more people write docs like this, leading with examples?
- WhoIsSatoshi 10y agoIt's called README file. It would blink if it could.