-
- All Implemented Interfaces:
-
ai.tock.nlp.api.client.NlpClient
public final class TockNlpClient implements NlpClient
Wraps calls to the NLP stack.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classTockNlpClient.Companion
-
Constructor Summary
Constructors Constructor Description TockNlpClient(String baseUrl)
-
Method Summary
Modifier and Type Method Description NlpResultparse(NlpQuery query)Analyses a sentence and returns the result. EntityEvaluationResultevaluateEntities(EntityEvaluationQuery query)Evaluates entities. ValuesMergeResultmergeValues(ValuesMergeQuery query)Merges values and returns the result if found. UnitmarkAsUnknown(MarkAsUnknownQuery query)Informs the nlp model that a sentence has not been understood. ApplicationDefinitioncreateApplication(String namespace, String name, Locale locale)Creates an application if it does not exists. List<IntentDefinition>getIntentsByNamespaceAndName(String namespace, String name)Returns the list of intents of a model. ApplicationDefinitiongetApplicationByNamespaceAndName(String namespace, String name)Returns an application for the specified namespace and name. BooleanimportNlpDump(InputStream stream)Imports a NLP dump (configuration and sentences of the NLP model). BooleanimportNlpPlainDump(ApplicationDump dump)Imports a NLP dump (configuration and sentences of the NLP model). BooleanimportNlpSentencesDump(InputStream stream)Imports a NLP sentences dump (only validated sentences) - format is simpler than ApplicationDump. BooleanimportNlpPlainSentencesDump(SentencesDump dump)Imports a NLP sentences dump (only validated sentences) - format is simpler than ApplicationDump. Booleanhealthcheck()Checks the server is up. -
-
Constructor Detail
-
TockNlpClient
TockNlpClient(String baseUrl)
-
-
Method Detail
-
evaluateEntities
EntityEvaluationResult evaluateEntities(EntityEvaluationQuery query)
Evaluates entities.
-
mergeValues
ValuesMergeResult mergeValues(ValuesMergeQuery query)
Merges values and returns the result if found.
-
markAsUnknown
Unit markAsUnknown(MarkAsUnknownQuery query)
Informs the nlp model that a sentence has not been understood.
-
createApplication
ApplicationDefinition createApplication(String namespace, String name, Locale locale)
Creates an application if it does not exists.
-
getIntentsByNamespaceAndName
List<IntentDefinition> getIntentsByNamespaceAndName(String namespace, String name)
Returns the list of intents of a model.
-
getApplicationByNamespaceAndName
ApplicationDefinition getApplicationByNamespaceAndName(String namespace, String name)
Returns an application for the specified namespace and name.
-
importNlpDump
Boolean importNlpDump(InputStream stream)
Imports a NLP dump (configuration and sentences of the NLP model).
-
importNlpPlainDump
Boolean importNlpPlainDump(ApplicationDump dump)
Imports a NLP dump (configuration and sentences of the NLP model).
- Parameters:
dump- the dump to import
-
importNlpSentencesDump
Boolean importNlpSentencesDump(InputStream stream)
Imports a NLP sentences dump (only validated sentences) - format is simpler than ApplicationDump.
-
importNlpPlainSentencesDump
Boolean importNlpPlainSentencesDump(SentencesDump dump)
Imports a NLP sentences dump (only validated sentences) - format is simpler than ApplicationDump.
- Parameters:
dump- the dump to import
-
healthcheck
Boolean healthcheck()
Checks the server is up.
-
-
-
-