public abstract class NCModelAdapter extends Object implements NCModel
NCModelFileAdapter
.
Read full documentation in Data Model section and review examples.
NCModelFileAdapter
DFLT_ENABLED_TOKENS, DFLT_IS_DUP_SYNONYMS_ALLOWED, DFLT_IS_NO_NOUNS_ALLOWED, DFLT_IS_NO_USER_TOKENS_ALLOWED, DFLT_IS_NON_ENGLISH_ALLOWED, DFLT_IS_NOT_LATIN_CHARSET_ALLOWED, DFLT_IS_PERMUTATE_SYNONYMS, DFLT_IS_SWEAR_WORDS_ALLOWED, DFLT_JIGGLE_FACTOR, DFLT_MAX_FREE_WORDS, DFLT_MAX_SUSPICIOUS_WORDS, DFLT_MAX_TOKENS, DFLT_MAX_TOTAL_SYNONYMS, DFLT_MAX_UNKNOWN_WORDS, DFLT_MAX_WORDS, DFLT_METADATA, DFLT_MIN_NON_STOPWORDS, DFLT_MIN_TOKENS, DFLT_MIN_WORDS
Constructor and Description |
---|
NCModelAdapter(String id,
String name,
String ver)
Creates new model with the given mandatory parameters.
|
Modifier and Type | Method and Description |
---|---|
String |
getId()
Gets unique, immutable ID of this model.
|
String |
getName()
Gets descriptive name of this model.
|
String |
getVersion()
Gets the version of this model using semantic versioning.
|
NCQueryResult |
query(NCQueryContext ctx)
Default implementation throws
NCRejection exception. |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
acceptVariant, onQueryState
getAdditionalStopWords, getDescription, getElements, getEnabledTokens, getExamples, getExcludedStopWords, getJiggleFactor, getMacros, getMaxFreeWords, getMaxSuspiciousWords, getMaxTokens, getMaxTotalSynonyms, getMaxUnknownWords, getMaxWords, getMetadata, getMinNonStopwords, getMinTokens, getMinWords, getParsers, getSuspiciousWords, isDupSynonymsAllowed, isNonEnglishAllowed, isNoNounsAllowed, isNotLatinCharsetAllowed, isNoUserTokensAllowed, isPermutateSynonyms, isSwearWordsAllowed
onDiscard, onInit
public NCQueryResult query(NCQueryContext ctx) throws NCRejection
NCRejection
exception. Subclasses must override this
method either manually or automatically through intent-based matching.query
in interface NCModel
ctx
- Query context containing parsed user input and all associated data.NCRejection
exception.NCRejection
NCModel.onQueryState(NCQueryState, NCQueryContext, NCQueryResult, Throwable)
public String getId()
NCModelView
Note that model IDs are immutable while name and version can be changed freely. Changing model ID is equal to creating a completely new model. Model IDs (unlike name and version) are not exposed to the end user and only serve a technical purpose. ID's max length is 32 characters.
JSON
If using JSON/YAML model presentation this is set by id
property:
{ "id": "my.model.id" }
getId
in interface NCModelView
public String getName()
NCModelView
JSON
If using JSON/YAML model presentation this is set by name
property:
{ "name": "My Model" }
getName
in interface NCModelView
public String getVersion()
NCModelView
JSON
If using JSON/YAML model presentation this is set by version
property:
{ "version": "1.0.0" }
getVersion
in interface NCModelView
Copyright © 2020 NLPCraft. All rights reserved.