Package org.apache.nlpcraft.model
Class NCModelAdapter
- java.lang.Object
-
- org.apache.nlpcraft.model.NCModelAdapter
-
- All Implemented Interfaces:
NCLifecycle
,NCMetadata
,NCModel
,NCModelView
- Direct Known Subclasses:
NCModelFileAdapter
public abstract class NCModelAdapter extends Object implements NCModel
Adapter for data models. In most cases new data models should extend either this adapter orNCModelFileAdapter
.Read full documentation in Data Model section and review examples.
- See Also:
NCModelFileAdapter
-
-
Field Summary
-
Fields inherited from interface org.apache.nlpcraft.model.NCModelView
DFLT_CONV_DEPTH, DFLT_CONV_TIMEOUT_MS, DFLT_ENABLED_BUILTIN_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_ELEMENT_SYNONYMS, DFLT_MAX_FREE_WORDS, DFLT_MAX_SUSPICIOUS_WORDS, DFLT_MAX_SYNONYMS_THRESHOLD_ERROR, 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 Summary
Constructors Constructor Description NCModelAdapter(String id, String name, String ver)
Creates new model with the given mandatory parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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.-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.nlpcraft.model.NCLifecycle
onDiscard, onInit
-
Methods inherited from interface org.apache.nlpcraft.model.NCMetadata
meta, meta, metaOpt, metax
-
Methods inherited from interface org.apache.nlpcraft.model.NCModel
onContext, onError, onMatchedIntent, onParsedVariant, onRejection, onResult
-
Methods inherited from interface org.apache.nlpcraft.model.NCModelView
getAdditionalStopWords, getConversationDepth, getConversationTimeout, getDescription, getElements, getEnabledBuiltInTokens, getExcludedStopWords, getJiggleFactor, getMacros, getMaxElementSynonyms, getMaxFreeWords, getMaxSuspiciousWords, getMaxTokens, getMaxTotalSynonyms, getMaxUnknownWords, getMaxWords, getMetadata, getMinNonStopwords, getMinTokens, getMinWords, getParsers, getSuspiciousWords, isDupSynonymsAllowed, isMaxSynonymsThresholdError, isNonEnglishAllowed, isNoNounsAllowed, isNotLatinCharsetAllowed, isNoUserTokensAllowed, isPermutateSynonyms, isSwearWordsAllowed
-
-
-
-
Method Detail
-
getId
public String getId()
Description copied from interface:NCModelView
Gets unique, immutable ID of this model.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 byid
property:{ "id": "my.model.id" }
- Specified by:
getId
in interfaceNCModelView
- Returns:
- Unique, immutable ID of this model.
-
getName
public String getName()
Description copied from interface:NCModelView
Gets descriptive name of this model. Name's max length is 64 characters.JSON
If using JSON/YAML model presentation this is set byname
property:{ "name": "My Model" }
- Specified by:
getName
in interfaceNCModelView
- Returns:
- Descriptive name for this model.
-
getVersion
public String getVersion()
Description copied from interface:NCModelView
Gets the version of this model using semantic versioning. Version's max length is 16 characters.JSON
If using JSON/YAML model presentation this is set byversion
property:{ "version": "1.0.0" }
- Specified by:
getVersion
in interfaceNCModelView
- Returns:
- A version compatible with (www.semver.org) specification.
-
-