Closed meghasoni closed 7 years ago
A great approach is adding plugin in ss-message. I have the the requirement for Chinese Parsing. So, you may take a look at this example
{
factSystem: {
clean: true
},
importFile: './data.json',
mongoURI: 'mongodb://localhost/SuperScriptSPA',
pluginsPath: `${process.cwd()}/plugins`,
messagePluginsPath: `${process.cwd()}/plugins_message`,
historyCheckpoints: 100,
conversationTimeout: 1000 * 60 * 30 // half an hour, conversation memory timeout
},
Such as
const addWords = function addWords(cb) {
this.message.words = this.message.clean.split(' ');
cb();
};
You can find more examples in https://github.com/superscriptjs/ss-message
In a superscript plugin,
exports.checkMessageFeatures = async function (cb) {
debug('checkMessageFeatures', this.message)
cb(null, {
lang_code: this.message.lang_code # note this lang_code is attached by the message plugin.
})
}
Thanks for the answer @Samurais!
I believe there are also POS tags already generated on this.message.nlp
, and this.message.isQuestion
will tell you whether the message is a question or not.
Alternatively, you can always add your own like above, using other libraries or web services!
i think @Samurais is mainly doing POS tagging for Chinese so needed to insert his own NLP tagger calls. chinese also requires segmentation.
How do we add extra features to bot engine such as NLP tagging and question classification in super script js.