| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
| <!-- NewPage --> |
| <html lang="en"> |
| <head> |
| <!-- Generated by javadoc (1.8.0_161) on Thu Apr 30 21:50:54 PDT 2020 --> |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| <title>NCModel (Apache NLPCraft 0.5.0)</title> |
| <meta name="date" content="2020-04-30"> |
| <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style"> |
| <script type="text/javascript" src="../../../../script.js"></script> |
| </head> |
| <body> |
| <script type="text/javascript"><!-- |
| try { |
| if (location.href.indexOf('is-external=true') == -1) { |
| parent.document.title="NCModel (Apache NLPCraft 0.5.0)"; |
| } |
| } |
| catch(err) { |
| } |
| //--> |
| var methods = {"i0":18,"i1":18,"i2":18,"i3":18,"i4":18,"i5":18}; |
| var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],16:["t5","Default Methods"]}; |
| var altColor = "altColor"; |
| var rowColor = "rowColor"; |
| var tableTab = "tableTab"; |
| var activeTableTab = "activeTableTab"; |
| </script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| <link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"> <script src="../../../../resources/sh/scripts/XRegExp.js" type="text/javascript"></script> <script src="../../../../resources/sh/scripts/shCore.js" type="text/javascript"></script> <script src="../../../../resources/sh/scripts/shAutoloader.js" type="text/javascript"></script> <link href="../../../../resources/sh/styles/shCoreNLPCraft.css" rel="stylesheet" type="text/css" title="Style"> <link href="../../../../resources/sh/styles/shThemeNLPCraft.css" rel="stylesheet" type="text/css" title="Style"> <link href="https://fonts.googleapis.com/css?family=Roboto+Mono" rel="stylesheet"> <script async defer src="https://buttons.github.io/buttons.js"></script> |
| <!-- ========= START OF TOP NAVBAR ======= --> |
| <div class="topNav"><a name="navbar.top"> |
| <!-- --> |
| </a> |
| <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> |
| <a name="navbar.top.firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../overview-summary.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="class-use/NCModel.html">Use</a></li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../../../index-all.html">Index</a></li> |
| <li><a href="../../../../help-doc.html">Help</a></li> |
| </ul> |
| <div class="aboutLanguage">Apache NLPCraft <span style="font-size: 80%">0.5.0</span></div> |
| </div> |
| <div class="subNav"> |
| <ul class="navList"> |
| <li><a href="../../../../org/apache/nlpcraft/model/NCMetadata.html" title="interface in org.apache.nlpcraft.model"><span class="typeNameLink">Prev Class</span></a></li> |
| <li><a href="../../../../org/apache/nlpcraft/model/NCModelAdapter.html" title="class in org.apache.nlpcraft.model"><span class="typeNameLink">Next Class</span></a></li> |
| </ul> |
| <ul class="navList"> |
| <li><a href="../../../../index.html?org/apache/nlpcraft/model/NCModel.html" target="_top">Frames</a></li> |
| <li><a href="NCModel.html" target="_top">No Frames</a></li> |
| </ul> |
| <ul class="navList" id="allclasses_navbar_top"> |
| <li><a href="../../../../allclasses-noframe.html">All Classes</a></li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_top"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li>Nested | </li> |
| <li>Field | </li> |
| <li>Constr | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li>Constr | </li> |
| <li><a href="#method.detail">Method</a></li> |
| </ul> |
| </div> |
| <a name="skip.navbar.top"> |
| <!-- --> |
| </a></div> |
| <!-- ========= END OF TOP NAVBAR ========= --> |
| <!-- ======== START OF CLASS DATA ======== --> |
| <div class="header"> |
| <div class="subTitle">org.apache.nlpcraft.model</div> |
| <h2 title="Interface NCModel" class="title">Interface NCModel</h2> |
| </div> |
| <div class="contentContainer"> |
| <div class="description"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <dl> |
| <dt>All Superinterfaces:</dt> |
| <dd><a href="../../../../org/apache/nlpcraft/model/NCLifecycle.html" title="interface in org.apache.nlpcraft.model">NCLifecycle</a>, <a href="../../../../org/apache/nlpcraft/model/NCMetadata.html" title="interface in org.apache.nlpcraft.model">NCMetadata</a>, <a href="../../../../org/apache/nlpcraft/model/NCModelView.html" title="interface in org.apache.nlpcraft.model">NCModelView</a></dd> |
| </dl> |
| <dl> |
| <dt>All Known Implementing Classes:</dt> |
| <dd><a href="../../../../org/apache/nlpcraft/model/NCModelAdapter.html" title="class in org.apache.nlpcraft.model">NCModelAdapter</a>, <a href="../../../../org/apache/nlpcraft/model/NCModelFileAdapter.html" title="class in org.apache.nlpcraft.model">NCModelFileAdapter</a></dd> |
| </dl> |
| <hr> |
| <br> |
| <pre>public interface <span class="typeNameLabel">NCModel</span> |
| extends <a href="../../../../org/apache/nlpcraft/model/NCModelView.html" title="interface in org.apache.nlpcraft.model">NCModelView</a>, <a href="../../../../org/apache/nlpcraft/model/NCLifecycle.html" title="interface in org.apache.nlpcraft.model">NCLifecycle</a></pre> |
| <div class="block">User-defined semantic data model. |
| <p> |
| Data model is a central concept in NLPCraft defining an interface to your data sources |
| like a database or a SaaS application. NLPCraft employs model-as-a-code approach where entire data model |
| is an implementation of this interface which can be developed using any JVM programming language |
| like Java, Scala, Kotlin, or Groovy. Data model definition is split into two interfaces: <a href="../../../../org/apache/nlpcraft/model/NCModelView.html" title="interface in org.apache.nlpcraft.model"><code>NCModelView</code></a> |
| that defines the declarative, configuration, part of the model that is usually defined in an external |
| JSON or YAML file, and this interface that provides various life-cycle callbacks. |
| <p> |
| Generally, a data model defines: |
| <ul> |
| <li>Set of model <a href="../../../../org/apache/nlpcraft/model/NCElement.html" title="interface in org.apache.nlpcraft.model"><code>elements</code></a> (a.k.a. named entities) to be detected in the user input.</li> |
| <li>Zero or more <a target=_ href="https://nlpcraft.apache.org/intent-matching.html">intent</a> callbacks.</li> |
| <li>Common model configuration and life-cycle callbacks.</li> |
| </ul> |
| Note that model-as-a-code approach natively supports any software life cycle tools and frameworks like various |
| build tools, CI/SCM tools, IDEs, etc. You don't have to resort to additional web-based tools to manage some aspects of |
| your data models - your entire model and all of its components are part of your project's source code. |
| <p> |
| Read full documentation in <a target=_ href="https://nlpcraft.apache.org/data-model.html">Data Model</a> section and review |
| <a target=_ href="https://github.com/apache/incubator-nlpcraft/tree/master/src/main/scala/org/apache/nlpcraft/examples/">examples</a>.</div> |
| <dl> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="../../../../org/apache/nlpcraft/model/NCModelAdapter.html" title="class in org.apache.nlpcraft.model"><code>NCModelAdapter</code></a>, |
| <a href="../../../../org/apache/nlpcraft/model/NCModelFileAdapter.html" title="class in org.apache.nlpcraft.model"><code>NCModelFileAdapter</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| </div> |
| <div class="summary"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- =========== FIELD SUMMARY =========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="field.summary"> |
| <!-- --> |
| </a> |
| <h3>Field Summary</h3> |
| <ul class="blockList"> |
| <li class="blockList"><a name="fields.inherited.from.class.org.apache.nlpcraft.model.NCModelView"> |
| <!-- --> |
| </a> |
| <h3>Fields inherited from interface org.apache.nlpcraft.model.<a href="../../../../org/apache/nlpcraft/model/NCModelView.html" title="interface in org.apache.nlpcraft.model">NCModelView</a></h3> |
| <code><a href="../../../../org/apache/nlpcraft/model/NCModelView.html#DFLT_ENABLED_BUILTIN_TOKENS">DFLT_ENABLED_BUILTIN_TOKENS</a>, <a href="../../../../org/apache/nlpcraft/model/NCModelView.html#DFLT_IS_DUP_SYNONYMS_ALLOWED">DFLT_IS_DUP_SYNONYMS_ALLOWED</a>, <a href="../../../../org/apache/nlpcraft/model/NCModelView.html#DFLT_IS_NO_NOUNS_ALLOWED">DFLT_IS_NO_NOUNS_ALLOWED</a>, <a href="../../../../org/apache/nlpcraft/model/NCModelView.html#DFLT_IS_NO_USER_TOKENS_ALLOWED">DFLT_IS_NO_USER_TOKENS_ALLOWED</a>, <a href="../../../../org/apache/nlpcraft/model/NCModelView.html#DFLT_IS_NON_ENGLISH_ALLOWED">DFLT_IS_NON_ENGLISH_ALLOWED</a>, <a href="../../../../org/apache/nlpcraft/model/NCModelView.html#DFLT_IS_NOT_LATIN_CHARSET_ALLOWED">DFLT_IS_NOT_LATIN_CHARSET_ALLOWED</a>, <a href="../../../../org/apache/nlpcraft/model/NCModelView.html#DFLT_IS_PERMUTATE_SYNONYMS">DFLT_IS_PERMUTATE_SYNONYMS</a>, <a href="../../../../org/apache/nlpcraft/model/NCModelView.html#DFLT_IS_SWEAR_WORDS_ALLOWED">DFLT_IS_SWEAR_WORDS_ALLOWED</a>, <a href="../../../../org/apache/nlpcraft/model/NCModelView.html#DFLT_JIGGLE_FACTOR">DFLT_JIGGLE_FACTOR</a>, <a href="../../../../org/apache/nlpcraft/model/NCModelView.html#DFLT_MAX_FREE_WORDS">DFLT_MAX_FREE_WORDS</a>, <a href="../../../../org/apache/nlpcraft/model/NCModelView.html#DFLT_MAX_SUSPICIOUS_WORDS">DFLT_MAX_SUSPICIOUS_WORDS</a>, <a href="../../../../org/apache/nlpcraft/model/NCModelView.html#DFLT_MAX_TOKENS">DFLT_MAX_TOKENS</a>, <a href="../../../../org/apache/nlpcraft/model/NCModelView.html#DFLT_MAX_TOTAL_SYNONYMS">DFLT_MAX_TOTAL_SYNONYMS</a>, <a href="../../../../org/apache/nlpcraft/model/NCModelView.html#DFLT_MAX_UNKNOWN_WORDS">DFLT_MAX_UNKNOWN_WORDS</a>, <a href="../../../../org/apache/nlpcraft/model/NCModelView.html#DFLT_MAX_WORDS">DFLT_MAX_WORDS</a>, <a href="../../../../org/apache/nlpcraft/model/NCModelView.html#DFLT_METADATA">DFLT_METADATA</a>, <a href="../../../../org/apache/nlpcraft/model/NCModelView.html#DFLT_MIN_NON_STOPWORDS">DFLT_MIN_NON_STOPWORDS</a>, <a href="../../../../org/apache/nlpcraft/model/NCModelView.html#DFLT_MIN_TOKENS">DFLT_MIN_TOKENS</a>, <a href="../../../../org/apache/nlpcraft/model/NCModelView.html#DFLT_MIN_WORDS">DFLT_MIN_WORDS</a></code></li> |
| </ul> |
| </li> |
| </ul> |
| <!-- ========== METHOD SUMMARY =========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="method.summary"> |
| <!-- --> |
| </a> |
| <h3>Method Summary</h3> |
| <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> |
| <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t5" class="tableTab"><span><a href="javascript:show(16);">Default Methods</a></span><span class="tabEnd"> </span></span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colLast" scope="col">Method and Description</th> |
| </tr> |
| <tr id="i0" class="altColor"> |
| <td class="colFirst"><code>default <a href="../../../../org/apache/nlpcraft/model/NCResult.html" title="class in org.apache.nlpcraft.model">NCResult</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/nlpcraft/model/NCModel.html#onContext-org.apache.nlpcraft.model.NCContext-">onContext</a></span>(<a href="../../../../org/apache/nlpcraft/model/NCContext.html" title="interface in org.apache.nlpcraft.model">NCContext</a> ctx)</code> |
| <div class="block">A callback that is called when a fully assembled query context is ready.</div> |
| </td> |
| </tr> |
| <tr id="i1" class="rowColor"> |
| <td class="colFirst"><code>default <a href="../../../../org/apache/nlpcraft/model/NCResult.html" title="class in org.apache.nlpcraft.model">NCResult</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/nlpcraft/model/NCModel.html#onError-org.apache.nlpcraft.model.NCContext-java.lang.Throwable-">onError</a></span>(<a href="../../../../org/apache/nlpcraft/model/NCContext.html" title="interface in org.apache.nlpcraft.model">NCContext</a> ctx, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html?is-external=true" title="class or interface in java.lang">Throwable</a> e)</code> |
| <div class="block">A callback that is called when intent callback failed with unexpected exception.</div> |
| </td> |
| </tr> |
| <tr id="i2" class="altColor"> |
| <td class="colFirst"><code>default boolean</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/nlpcraft/model/NCModel.html#onMatchedIntent-org.apache.nlpcraft.model.NCIntentMatch-">onMatchedIntent</a></span>(<a href="../../../../org/apache/nlpcraft/model/NCIntentMatch.html" title="interface in org.apache.nlpcraft.model">NCIntentMatch</a> ctx)</code> |
| <div class="block">A callback that is called when intent was successfully matched but right before its callback is called.</div> |
| </td> |
| </tr> |
| <tr id="i3" class="rowColor"> |
| <td class="colFirst"><code>default boolean</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/nlpcraft/model/NCModel.html#onParsedVariant-org.apache.nlpcraft.model.NCVariant-">onParsedVariant</a></span>(<a href="../../../../org/apache/nlpcraft/model/NCVariant.html" title="interface in org.apache.nlpcraft.model">NCVariant</a> var)</code> |
| <div class="block">A callback to accept or reject a parsed variant.</div> |
| </td> |
| </tr> |
| <tr id="i4" class="altColor"> |
| <td class="colFirst"><code>default <a href="../../../../org/apache/nlpcraft/model/NCResult.html" title="class in org.apache.nlpcraft.model">NCResult</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/nlpcraft/model/NCModel.html#onRejection-org.apache.nlpcraft.model.NCIntentMatch-org.apache.nlpcraft.model.NCRejection-">onRejection</a></span>(<a href="../../../../org/apache/nlpcraft/model/NCIntentMatch.html" title="interface in org.apache.nlpcraft.model">NCIntentMatch</a> ctx, |
| <a href="../../../../org/apache/nlpcraft/model/NCRejection.html" title="class in org.apache.nlpcraft.model">NCRejection</a> e)</code> |
| <div class="block">A callback that is called when intent callback threw <a href="../../../../org/apache/nlpcraft/model/NCRejection.html" title="class in org.apache.nlpcraft.model"><code>NCRejection</code></a> exception.</div> |
| </td> |
| </tr> |
| <tr id="i5" class="rowColor"> |
| <td class="colFirst"><code>default <a href="../../../../org/apache/nlpcraft/model/NCResult.html" title="class in org.apache.nlpcraft.model">NCResult</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/nlpcraft/model/NCModel.html#onResult-org.apache.nlpcraft.model.NCIntentMatch-org.apache.nlpcraft.model.NCResult-">onResult</a></span>(<a href="../../../../org/apache/nlpcraft/model/NCIntentMatch.html" title="interface in org.apache.nlpcraft.model">NCIntentMatch</a> ctx, |
| <a href="../../../../org/apache/nlpcraft/model/NCResult.html" title="class in org.apache.nlpcraft.model">NCResult</a> res)</code> |
| <div class="block">A callback that is called when successful result is obtained from the intent callback and right before sending it |
| back to the caller.</div> |
| </td> |
| </tr> |
| </table> |
| <ul class="blockList"> |
| <li class="blockList"><a name="methods.inherited.from.class.org.apache.nlpcraft.model.NCModelView"> |
| <!-- --> |
| </a> |
| <h3>Methods inherited from interface org.apache.nlpcraft.model.<a href="../../../../org/apache/nlpcraft/model/NCModelView.html" title="interface in org.apache.nlpcraft.model">NCModelView</a></h3> |
| <code><a href="../../../../org/apache/nlpcraft/model/NCModelView.html#getAdditionalStopWords--">getAdditionalStopWords</a>, <a href="../../../../org/apache/nlpcraft/model/NCModelView.html#getDescription--">getDescription</a>, <a href="../../../../org/apache/nlpcraft/model/NCModelView.html#getElements--">getElements</a>, <a href="../../../../org/apache/nlpcraft/model/NCModelView.html#getEnabledBuiltInTokens--">getEnabledBuiltInTokens</a>, <a href="../../../../org/apache/nlpcraft/model/NCModelView.html#getExamples--">getExamples</a>, <a href="../../../../org/apache/nlpcraft/model/NCModelView.html#getExcludedStopWords--">getExcludedStopWords</a>, <a href="../../../../org/apache/nlpcraft/model/NCModelView.html#getId--">getId</a>, <a href="../../../../org/apache/nlpcraft/model/NCModelView.html#getJiggleFactor--">getJiggleFactor</a>, <a href="../../../../org/apache/nlpcraft/model/NCModelView.html#getMacros--">getMacros</a>, <a href="../../../../org/apache/nlpcraft/model/NCModelView.html#getMaxFreeWords--">getMaxFreeWords</a>, <a href="../../../../org/apache/nlpcraft/model/NCModelView.html#getMaxSuspiciousWords--">getMaxSuspiciousWords</a>, <a href="../../../../org/apache/nlpcraft/model/NCModelView.html#getMaxTokens--">getMaxTokens</a>, <a href="../../../../org/apache/nlpcraft/model/NCModelView.html#getMaxTotalSynonyms--">getMaxTotalSynonyms</a>, <a href="../../../../org/apache/nlpcraft/model/NCModelView.html#getMaxUnknownWords--">getMaxUnknownWords</a>, <a href="../../../../org/apache/nlpcraft/model/NCModelView.html#getMaxWords--">getMaxWords</a>, <a href="../../../../org/apache/nlpcraft/model/NCModelView.html#getMetadata--">getMetadata</a>, <a href="../../../../org/apache/nlpcraft/model/NCModelView.html#getMinNonStopwords--">getMinNonStopwords</a>, <a href="../../../../org/apache/nlpcraft/model/NCModelView.html#getMinTokens--">getMinTokens</a>, <a href="../../../../org/apache/nlpcraft/model/NCModelView.html#getMinWords--">getMinWords</a>, <a href="../../../../org/apache/nlpcraft/model/NCModelView.html#getName--">getName</a>, <a href="../../../../org/apache/nlpcraft/model/NCModelView.html#getParsers--">getParsers</a>, <a href="../../../../org/apache/nlpcraft/model/NCModelView.html#getSuspiciousWords--">getSuspiciousWords</a>, <a href="../../../../org/apache/nlpcraft/model/NCModelView.html#getVersion--">getVersion</a>, <a href="../../../../org/apache/nlpcraft/model/NCModelView.html#isDupSynonymsAllowed--">isDupSynonymsAllowed</a>, <a href="../../../../org/apache/nlpcraft/model/NCModelView.html#isNonEnglishAllowed--">isNonEnglishAllowed</a>, <a href="../../../../org/apache/nlpcraft/model/NCModelView.html#isNoNounsAllowed--">isNoNounsAllowed</a>, <a href="../../../../org/apache/nlpcraft/model/NCModelView.html#isNotLatinCharsetAllowed--">isNotLatinCharsetAllowed</a>, <a href="../../../../org/apache/nlpcraft/model/NCModelView.html#isNoUserTokensAllowed--">isNoUserTokensAllowed</a>, <a href="../../../../org/apache/nlpcraft/model/NCModelView.html#isPermutateSynonyms--">isPermutateSynonyms</a>, <a href="../../../../org/apache/nlpcraft/model/NCModelView.html#isSwearWordsAllowed--">isSwearWordsAllowed</a></code></li> |
| </ul> |
| <ul class="blockList"> |
| <li class="blockList"><a name="methods.inherited.from.class.org.apache.nlpcraft.model.NCMetadata"> |
| <!-- --> |
| </a> |
| <h3>Methods inherited from interface org.apache.nlpcraft.model.<a href="../../../../org/apache/nlpcraft/model/NCMetadata.html" title="interface in org.apache.nlpcraft.model">NCMetadata</a></h3> |
| <code><a href="../../../../org/apache/nlpcraft/model/NCMetadata.html#meta-java.lang.String-">meta</a>, <a href="../../../../org/apache/nlpcraft/model/NCMetadata.html#meta-java.lang.String-T-">meta</a>, <a href="../../../../org/apache/nlpcraft/model/NCMetadata.html#metaOpt-java.lang.String-">metaOpt</a>, <a href="../../../../org/apache/nlpcraft/model/NCMetadata.html#metax-java.lang.String-">metax</a></code></li> |
| </ul> |
| <ul class="blockList"> |
| <li class="blockList"><a name="methods.inherited.from.class.org.apache.nlpcraft.model.NCLifecycle"> |
| <!-- --> |
| </a> |
| <h3>Methods inherited from interface org.apache.nlpcraft.model.<a href="../../../../org/apache/nlpcraft/model/NCLifecycle.html" title="interface in org.apache.nlpcraft.model">NCLifecycle</a></h3> |
| <code><a href="../../../../org/apache/nlpcraft/model/NCLifecycle.html#onDiscard--">onDiscard</a>, <a href="../../../../org/apache/nlpcraft/model/NCLifecycle.html#onInit--">onInit</a></code></li> |
| </ul> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </div> |
| <div class="details"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ============ METHOD DETAIL ========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="method.detail"> |
| <!-- --> |
| </a> |
| <h3>Method Detail</h3> |
| <a name="onParsedVariant-org.apache.nlpcraft.model.NCVariant-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>onParsedVariant</h4> |
| <pre>default boolean onParsedVariant(<a href="../../../../org/apache/nlpcraft/model/NCVariant.html" title="interface in org.apache.nlpcraft.model">NCVariant</a> var)</pre> |
| <div class="block">A callback to accept or reject a parsed variant. This callback is called before any other |
| callbacks at the beginning of the processing pipeline and it is called for each parsed variant. |
| <p> |
| Note that a given user input can have one or more possible different parsing variants. Depending on model |
| configuration a user input can produce hundreds or even thousands of parsing variants that can significantly slow |
| down the overall processing. This method allows to filter out unnecessary parsing variants based on variety of |
| user-defined factors like number of tokens, presence of a particular token in the variant, etc. |
| <p> |
| By default, this method accepts all variants (returns <code>true</code>).</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>var</code> - A variant (list of tokens) to accept or reject.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd><code>True</code> to accept variant for further processing, <code>false</code> otherwise.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="onContext-org.apache.nlpcraft.model.NCContext-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>onContext</h4> |
| <pre>default <a href="../../../../org/apache/nlpcraft/model/NCResult.html" title="class in org.apache.nlpcraft.model">NCResult</a> onContext(<a href="../../../../org/apache/nlpcraft/model/NCContext.html" title="interface in org.apache.nlpcraft.model">NCContext</a> ctx) |
| throws <a href="../../../../org/apache/nlpcraft/model/NCRejection.html" title="class in org.apache.nlpcraft.model">NCRejection</a></pre> |
| <div class="block">A callback that is called when a fully assembled query context is ready. This callback is called after |
| all <a href="../../../../org/apache/nlpcraft/model/NCModel.html#onParsedVariant-org.apache.nlpcraft.model.NCVariant-"><code>onParsedVariant(NCVariant)</code></a> callbacks are called but before any <a href="../../../../org/apache/nlpcraft/model/NCModel.html#onMatchedIntent-org.apache.nlpcraft.model.NCIntentMatch-"><code>onMatchedIntent(NCIntentMatch)</code></a> |
| are called, i.e. right before the intent matching is performed. It's called always once per user request processing. |
| Typical use case for this callback is to perform logging, debugging, statistic or usage collection, |
| explicit update or initialization of conversation context, security audit or validation, etc. |
| <p> |
| Default implementation returns <code>null</code>.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>ctx</code> - Query context.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>Optional query result to return interrupting the default workflow. Specifically, if this method returns |
| a non-<code>null</code> result, it will be returned to the caller immediately overriding default behavior. If |
| the method returns <code>null</code> - the default processing flow will continue.</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="../../../../org/apache/nlpcraft/model/NCRejection.html" title="class in org.apache.nlpcraft.model">NCRejection</a></code> - This callback can throw this rejection exception to abort user request processing.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="onMatchedIntent-org.apache.nlpcraft.model.NCIntentMatch-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>onMatchedIntent</h4> |
| <pre>default boolean onMatchedIntent(<a href="../../../../org/apache/nlpcraft/model/NCIntentMatch.html" title="interface in org.apache.nlpcraft.model">NCIntentMatch</a> ctx) |
| throws <a href="../../../../org/apache/nlpcraft/model/NCRejection.html" title="class in org.apache.nlpcraft.model">NCRejection</a></pre> |
| <div class="block">A callback that is called when intent was successfully matched but right before its callback is called. |
| This callback is called after <a href="../../../../org/apache/nlpcraft/model/NCModel.html#onContext-org.apache.nlpcraft.model.NCContext-"><code>onContext(NCContext)</code></a> is called and may be called multiple times |
| depending on its return value. If <code>true</code> is returned than the default workflow will continue and |
| the matched intent's callback will be called. However, if <code>false</code> is returned than the entire |
| existing set of parsing variants will be matched against all declared intents again. Returning <code>false</code> |
| allows this method to alter the state of the model (like soft-reset conversation or change metadata) and |
| force the full re-evaluation of the parsing variants against all declared intents. Note that user logic should |
| be careful not to induce infinite loop in this behavior. |
| <p> |
| Note that this callback may not be called at all based on the return value |
| of <a href="../../../../org/apache/nlpcraft/model/NCModel.html#onContext-org.apache.nlpcraft.model.NCContext-"><code>onContext(NCContext)</code></a> callback. Typical use case for this callback is to perform logging, debugging, |
| statistic or usage collection, explicit update or initialization of conversation context, security audit |
| or validation, etc. |
| <p> |
| By default, this method returns <code>true</code>.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>ctx</code> - Intent match context - the same instance that's passed to the matched intent callback.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>If <code>true</code> is returned than the default workflow will continue and the matched intent's callback |
| will be called. However, if <code>false</code> is returned than the entire existing set of parsing variants will |
| be matched against all declared intents again. Returning <code>false</code> allows this method to alter the state of |
| the model (like soft-reset conversation or change metadata) and force the re-evaluation of the parsing |
| variants against all declared intents. Note that user logic should be careful not to induce infinite loop in |
| this behavior.</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="../../../../org/apache/nlpcraft/model/NCRejection.html" title="class in org.apache.nlpcraft.model">NCRejection</a></code> - This callback can throw the rejection exception to abort user request processing. In this |
| case the <a href="../../../../org/apache/nlpcraft/model/NCModel.html#onRejection-org.apache.nlpcraft.model.NCIntentMatch-org.apache.nlpcraft.model.NCRejection-"><code>onRejection(NCIntentMatch, NCRejection)</code></a> callback will be called next.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="onResult-org.apache.nlpcraft.model.NCIntentMatch-org.apache.nlpcraft.model.NCResult-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>onResult</h4> |
| <pre>default <a href="../../../../org/apache/nlpcraft/model/NCResult.html" title="class in org.apache.nlpcraft.model">NCResult</a> onResult(<a href="../../../../org/apache/nlpcraft/model/NCIntentMatch.html" title="interface in org.apache.nlpcraft.model">NCIntentMatch</a> ctx, |
| <a href="../../../../org/apache/nlpcraft/model/NCResult.html" title="class in org.apache.nlpcraft.model">NCResult</a> res)</pre> |
| <div class="block">A callback that is called when successful result is obtained from the intent callback and right before sending it |
| back to the caller. This callback is called after <a href="../../../../org/apache/nlpcraft/model/NCModel.html#onMatchedIntent-org.apache.nlpcraft.model.NCIntentMatch-"><code>onMatchedIntent(NCIntentMatch)</code></a> is called. |
| Note that this callback may not be called at all, and if called - it's called only once. |
| Typical use case for this callback is to perform logging, debugging, statistic or usage collection, |
| explicit update or initialization of conversation context, security audit or validation, etc. |
| <p> |
| Default implementation is a no-op returning <code>null</code>.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>ctx</code> - Intent match context - the same instance that's passed to the matched intent callback that |
| produced this result.</dd> |
| <dd><code>res</code> - Existing result.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>Optional query result to return interrupting the default workflow. Specifically, if this method returns |
| a non-<code>null</code> result, it will be returned to the caller immediately overriding default behavior and |
| existing query result or error processing, if any. If the method returns <code>null</code> - the default |
| processing flow will continue.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="onRejection-org.apache.nlpcraft.model.NCIntentMatch-org.apache.nlpcraft.model.NCRejection-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>onRejection</h4> |
| <pre>default <a href="../../../../org/apache/nlpcraft/model/NCResult.html" title="class in org.apache.nlpcraft.model">NCResult</a> onRejection(<a href="../../../../org/apache/nlpcraft/model/NCIntentMatch.html" title="interface in org.apache.nlpcraft.model">NCIntentMatch</a> ctx, |
| <a href="../../../../org/apache/nlpcraft/model/NCRejection.html" title="class in org.apache.nlpcraft.model">NCRejection</a> e)</pre> |
| <div class="block">A callback that is called when intent callback threw <a href="../../../../org/apache/nlpcraft/model/NCRejection.html" title="class in org.apache.nlpcraft.model"><code>NCRejection</code></a> exception. |
| This callback is called after <a href="../../../../org/apache/nlpcraft/model/NCModel.html#onMatchedIntent-org.apache.nlpcraft.model.NCIntentMatch-"><code>onMatchedIntent(NCIntentMatch)</code></a> is called. |
| Note that this callback may not be called at all, and if called - it's called only once. |
| Typical use case for this callback is to perform logging, debugging, statistic or usage collection, |
| explicit update or initialization of conversation context, security audit or validation, etc. |
| <p> |
| Default implementation is a no-op returning <code>null</code>.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>ctx</code> - Optional intent match context - the same instance that's passed to the matched intent callback that |
| produced this rejection. It is <code>null</code> if rejection was triggered outside of the intent callback.</dd> |
| <dd><code>e</code> - Rejection exception.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>Optional query result to return interrupting the default workflow. Specifically, if this method returns |
| a non-<code>null</code> result, it will be returned to the caller immediately overriding default behavior and |
| existing query result or error processing, if any. If the method returns <code>null</code> - the default |
| processing flow will continue.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="onError-org.apache.nlpcraft.model.NCContext-java.lang.Throwable-"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>onError</h4> |
| <pre>default <a href="../../../../org/apache/nlpcraft/model/NCResult.html" title="class in org.apache.nlpcraft.model">NCResult</a> onError(<a href="../../../../org/apache/nlpcraft/model/NCContext.html" title="interface in org.apache.nlpcraft.model">NCContext</a> ctx, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html?is-external=true" title="class or interface in java.lang">Throwable</a> e)</pre> |
| <div class="block">A callback that is called when intent callback failed with unexpected exception. |
| Note that this callback may not be called at all, and if called - it's called only once. |
| Typical use case for this callback is to perform logging, debugging, statistic or usage collection, |
| explicit update or initialization of conversation context, security audit or validation, etc. |
| <p> |
| Default implementation is a no-op returning <code>null</code>.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>ctx</code> - Intent match context - the same instance that's passed to the matched intent that |
| produced this error.</dd> |
| <dd><code>e</code> - Failure exception.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>Optional query result to return interrupting the default workflow. Specifically, if this method returns |
| a non-<code>null</code> result, it will be returned to the caller immediately overriding default behavior and |
| existing query result or error processing, if any. If the method returns <code>null</code> - the default |
| processing flow will continue.</dd> |
| </dl> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </div> |
| </div> |
| <!-- ========= END OF CLASS DATA ========= --> |
| <!-- ======= START OF BOTTOM NAVBAR ====== --> |
| <div class="bottomNav"><a name="navbar.bottom"> |
| <!-- --> |
| </a> |
| <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> |
| <a name="navbar.bottom.firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../overview-summary.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="class-use/NCModel.html">Use</a></li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../../../index-all.html">Index</a></li> |
| <li><a href="../../../../help-doc.html">Help</a></li> |
| </ul> |
| <div class="aboutLanguage"><span style="vertical-align: super">Apache NLPCraft <span style="font-size: 80%">0.5.0</span></span> <a style="vertical-align: super; margin-right: 10px" href="https://github.com/apache/incubator-nlpcraft" target="github"><i class="fa fa-github github-logo"></i></a> <a class="github-button" href="https://github.com/apache/incubator-nlpcraft/tree/master/src/main/scala/org/apache/nlpcraft/examples" data-icon="octicon-eye" aria-label="NLPCraft Examples">Examples</a> <a class="github-button" href="https://github.com/apache/incubator-nlpcraft" data-icon="octicon-star" aria-label="Star on GitHub">Star</a> <a class="github-button" href="https://github.com/apache/incubator-nlpcraft/fork" data-icon="octicon-repo-forked" aria-label="Fork on GitHub">Fork</a> <script type="text/javascript"> SyntaxHighlighter.defaults["auto-links"] = false; SyntaxHighlighter.defaults["tab-size"] = 2; SyntaxHighlighter.autoloader( 'java ../../../../resources/sh/scripts/shBrushJava.js', 'js jscript javascript ../../../../resources/sh/scripts/shBrushJScript.js', 'text plain ../../../../resources/sh/scripts/shBrushPlain.js', 'py python ../../../../resources/sh/scripts/shBrushPython.js', 'ruby rails ror rb ../../../../resources/sh/scripts/shBrushRuby.js', 'scala ../../../../resources/sh/scripts/shBrushScala.js', 'sql ../../../../resources/sh/scripts/shBrushSql.js', 'xml xhtml xslt html ../../../../resources/sh/scripts/shBrushXml.js' ); SyntaxHighlighter.all(); </script></div> |
| </div> |
| <div class="subNav"> |
| <ul class="navList"> |
| <li><a href="../../../../org/apache/nlpcraft/model/NCMetadata.html" title="interface in org.apache.nlpcraft.model"><span class="typeNameLink">Prev Class</span></a></li> |
| <li><a href="../../../../org/apache/nlpcraft/model/NCModelAdapter.html" title="class in org.apache.nlpcraft.model"><span class="typeNameLink">Next Class</span></a></li> |
| </ul> |
| <ul class="navList"> |
| <li><a href="../../../../index.html?org/apache/nlpcraft/model/NCModel.html" target="_top">Frames</a></li> |
| <li><a href="NCModel.html" target="_top">No Frames</a></li> |
| </ul> |
| <ul class="navList" id="allclasses_navbar_bottom"> |
| <li><a href="../../../../allclasses-noframe.html">All Classes</a></li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_bottom"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li>Nested | </li> |
| <li>Field | </li> |
| <li>Constr | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li>Constr | </li> |
| <li><a href="#method.detail">Method</a></li> |
| </ul> |
| </div> |
| <a name="skip.navbar.bottom"> |
| <!-- --> |
| </a></div> |
| <!-- ======== END OF BOTTOM NAVBAR ======= --> |
| <p class="legalCopy"><small><center> <br/> <span style="font-size: larger">Copyright © 2020 Apache Software Foundation</span> <br/> <br/> <img src="https://www.apache.org/img/ASF20thAnniversary.jpg" height="64px"> </center></small></p> |
| </body> |
| </html> |