tock / ai.tock.bot.engine.nlp / NlpController

NlpController

interface NlpController (source)

Sends NLP requests.

Functions

getIntentsByNamespaceAndName

Exports list of IntentDefinition

abstract fun getIntentsByNamespaceAndName(namespace: String, name: String): List<IntentDefinition>?

importNlpDump

Imports a NLP dump (configuration and sentences of NLP model).

abstract fun importNlpDump(stream: InputStream): Boolean

importNlpPlainDump

Imports a NLP dump (configuration and sentences of NLP model).

abstract fun importNlpPlainDump(dump: ApplicationDump): Boolean

importNlpPlainSentencesDump

Imports a NLP sentences dump (only validated sentences) - format is simpler than ApplicationDump.

abstract fun importNlpPlainSentencesDump(dump: SentencesDump): Boolean

importNlpSentencesDump

Imports a NLP sentences dump (only validated sentences) - format is simpler than ApplicationDump.

abstract fun importNlpSentencesDump(stream: InputStream): Boolean

markAsUnknown

Marks the sentence as not understood in the nlp model.

abstract fun markAsUnknown(sentence: SendSentence, userTimeline: UserTimeline, botDefinition: BotDefinition): Unit

parseSentence

Parses a sentence and set intent and entities in context.

abstract fun parseSentence(sentence: SendSentence, userTimeline: UserTimeline, dialog: Dialog, connector: ConnectorController, botDefinition: BotDefinition): Unit

waitAvailability

Tries to check nlp server, waiting 200 response or timeToWaitInMs before returning.

abstract fun waitAvailability(timeToWaitInMs: Long = longProperty("tock_bot_wait_nlp_availability_in_ms", 5000L)): Unit