superscriptjs / superscript

A dialogue engine for creating chat bots
http://superscriptjs.com
MIT License
1.65k stars 209 forks source link

Regarding nlp in bot engine #358

Closed meghasoni closed 7 years ago

meghasoni commented 7 years ago

Hi, I would like to know, how do we add NLP to the bot engine. I see that super script uses natural module for it. But how do we use it in super script.

Currently the conversation defined in main.ss file looks like static and some kind of regular expression are used.

In order to add natural language processing, what should be done and where can I found documents related to the same.

Help is much appreciated.

silentrob commented 7 years ago

This might be easier to answer if you had a specific problem in mind. All Gambits picked are regular expressions, even the ones that look static, however you can filter in topics, gambits, replies with javascript that could make use of extra NLP.

Under the hood, (specifically in ss-message https://github.com/superscriptjs/ss-message ) we break the utterance down and expose extra properties. The sentence type, number of nouns, and verbs etc. This is made available in all plugin functions.

Within the static script however we do expose some NLP. https://github.com/superscriptjs/superscript/wiki/Triggers#parts-of-speech