How to use the node-nlp.ConversationContext function in node-nlp

To help you get started, we’ve selected a few node-nlp examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github brian-ai / core / src / brain / reactions / queue-channels / conversation.js View on Github external
const conversationHandler = async ({ content }, LanguageProcessor) => {
	const context = new ConversationContext()
	const { data: sentence } = JSON.parse(content)
	logger.info(`Conversation control: received ${content}`)
	// Local NLP analysis
	logger.info(`NLP Analysis locally for ${content}`)
	const localProcessedSentence = await LanguageProcessor.process(
		'en',
		sentence,
		context
	)
	const { answer, classifications } = localProcessedSentence
	const suggestedClassification = extractClassification(classifications)
	// Trigger intents
	if (suggestedClassification && suggestedClassification !== 'None') {
		processIntentType(suggestedClassification, sentence)

		if (answer) {

node-nlp

Library for NLU (Natural Language Understanding) done in Node.js

MIT
Latest version published 11 months ago

Package Health Score

66 / 100
Full package analysis