public TockNlpClient(@NotNull
java.lang.String baseUrl)
Wraps calls to the NLP stack.
public TockNlpClient()
Wraps calls to the NLP stack.
@Nullable public NlpResult parse(@NotNull NlpQuery query)
Analyses a sentence and returns the result.
@Nullable public EntityEvaluationResult evaluateEntities(@NotNull EntityEvaluationQuery query)
Evaluates entities.
@Nullable public ValuesMergeResult mergeValues(@NotNull ValuesMergeQuery query)
Merges values and returns the result if found.
public void markAsUnknown(@NotNull
MarkAsUnknownQuery query)
Informs the nlp model that a sentence has not been understood.
@Nullable public ApplicationDefinition createApplication(@NotNull java.lang.String namespace, @NotNull java.lang.String name, @NotNull java.util.Locale locale)
Creates an application if it does not exists.
@Nullable
public java.util.List<ai.tock.nlp.api.client.model.dump.IntentDefinition> getIntentsByNamespaceAndName(@NotNull
java.lang.String namespace,
@NotNull
java.lang.String name)
Returns the list of intents of a model.
@Nullable public ApplicationDefinition getApplicationByNamespaceAndName(@NotNull java.lang.String namespace, @NotNull java.lang.String name)
Returns an application for the specified namespace and name.
public boolean importNlpDump(@NotNull
java.io.InputStream stream)
Imports a NLP dump (configuration and sentences of the NLP model).
public boolean importNlpPlainDump(@NotNull
ApplicationDump dump)
Imports a NLP dump (configuration and sentences of the NLP model).
dump - the dump to importpublic boolean importNlpSentencesDump(@NotNull
java.io.InputStream stream)
Imports a NLP sentences dump (only validated sentences) - format is simpler than class ApplicationDump.
class ApplicationDumppublic boolean importNlpPlainSentencesDump(@NotNull
SentencesDump dump)
Imports a NLP sentences dump (only validated sentences) - format is simpler than class ApplicationDump.
dump - the dump to importclass ApplicationDumppublic boolean healthcheck()
Checks the server is up.