You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nlpcraft.apache.org by ar...@apache.org on 2022/04/03 04:05:32 UTC
[incubator-nlpcraft] branch master updated: WIP Javadoc.
This is an automated email from the ASF dual-hosted git repository.
aradzinski pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nlpcraft.git
The following commit(s) were added to refs/heads/master by this push:
new 2f7f336 WIP Javadoc.
2f7f336 is described below
commit 2f7f33678f772637d0a9acda7d686536c9eaf3f3
Author: Aaron Radzinski <ar...@datalingvo.com>
AuthorDate: Sat Apr 2 21:05:25 2022 -0700
WIP Javadoc.
---
.../org/apache/nlpcraft/NCEntityEnricher.java | 3 ++-
.../scala/org/apache/nlpcraft/NCEntityParser.java | 23 +++++++++++++++++-----
.../org/apache/nlpcraft/NCEntityValidator.java | 20 +++++++++++++++----
.../main/scala/org/apache/nlpcraft/NCPipeline.java | 8 ++++----
4 files changed, 40 insertions(+), 14 deletions(-)
diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/NCEntityEnricher.java b/nlpcraft/src/main/scala/org/apache/nlpcraft/NCEntityEnricher.java
index 5574ce2..e4bfee6 100644
--- a/nlpcraft/src/main/scala/org/apache/nlpcraft/NCEntityEnricher.java
+++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/NCEntityEnricher.java
@@ -20,10 +20,11 @@ package org.apache.nlpcraft;
import java.util.List;
/**
- * A pipeline components that enrichers entities by settings their properties.
+ * A pipeline component that enrichers entities by settings their properties.
* See {@link NCPipeline} for documentation on the overall processing pipeline. Note that this is
* an optional component in the pipeline.
*
+ * @see NCPipeline#getEntityEnrichers()
* @see NCEntity
* @see NCToken
* @see NCTokenParser
diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/NCEntityParser.java b/nlpcraft/src/main/scala/org/apache/nlpcraft/NCEntityParser.java
index ce4d7e7..c4e432d 100644
--- a/nlpcraft/src/main/scala/org/apache/nlpcraft/NCEntityParser.java
+++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/NCEntityParser.java
@@ -20,16 +20,29 @@ package org.apache.nlpcraft;
import java.util.List;
/**
+ * A pipeline component that converts list of tokens into the list of entities.
+ * See {@link NCPipeline} for documentation on the overall processing pipeline. Note that pipeline
+ * must have at least one entity parser.
*
+ * @see NCPipeline#getEntityParsers()
+ * @see NCEntity
+ * @see NCToken
+ * @see NCTokenParser
+ * @see NCTokenEnricher
+ * @see NCTokenValidator
+ * @see NCEntityParser
+ * @see NCEntityEnricher
+ * @see NCEntityValidator
*/
public interface NCEntityParser extends NCLifecycle {
/**
+ * Converts, parses, given list of tokens into the list of entities.
*
- * @param req
- * @param cfg
- * @param toks
- * @return
- * @throws NCException
+ * @param req Input request descriptor.
+ * @param cfg Configuration of the model this components is associated with.
+ * @param toks List of tokens to convert.
+ * @return List of parsed entities, potentially empty but never {@code null}.
+ * @@throws NCException Thrown in case of any errors.
*/
List<NCEntity> parse(NCRequest req, NCModelConfig cfg, List<NCToken> toks);
}
diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/NCEntityValidator.java b/nlpcraft/src/main/scala/org/apache/nlpcraft/NCEntityValidator.java
index 46c42c4..e8e4a33 100644
--- a/nlpcraft/src/main/scala/org/apache/nlpcraft/NCEntityValidator.java
+++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/NCEntityValidator.java
@@ -20,15 +20,27 @@ package org.apache.nlpcraft;
import java.util.List;
/**
+ * A pipeline components that validates the final list of parsed and enriched entities.
+ * See {@link NCPipeline} for documentation on the overall processing pipeline. Note that this is an
+ * optional component.
*
+ * @see NCPipeline#getEntityValidators()
+ * @see NCEntity
+ * @see NCToken
+ * @see NCTokenParser
+ * @see NCTokenEnricher
+ * @see NCTokenValidator
+ * @see NCEntityParser
+ * @see NCEntityEnricher
+ * @see NCEntityValidator
*/
public interface NCEntityValidator extends NCLifecycle {
/**
*
- * @param req
- * @param cfg
- * @param ents
- * @throws NCException
+ * @param req Input request descriptor.
+ * @param cfg Configuration of the model this components is associated with.
+ * @param ents List of entities to validate.
+ * @@throws NCException Thrown in case of any validation violations.
*/
void validate(NCRequest req, NCModelConfig cfg, List<NCEntity> ents);
}
diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/NCPipeline.java b/nlpcraft/src/main/scala/org/apache/nlpcraft/NCPipeline.java
index f25dd95..1161c29 100644
--- a/nlpcraft/src/main/scala/org/apache/nlpcraft/NCPipeline.java
+++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/NCPipeline.java
@@ -27,19 +27,19 @@ import java.util.Optional;
* An NLP pipeline is a container for various processing components that take the input text at the beginning of the
* pipeline and produce the list of {@link NCEntity entities} at the end of the pipeline.
* Schematically the pipeline looks like this:
- * <pre>
+ * <pre>
* ,---------. ,----------. ,-------.
* o/ *=========* ,---------. ,---'-------. | ,---'--------. | ,---'-----. |
- * /| -> : Text : -> | Token | -> | Token | | -> | Token | | -> | Entity | |
+ * /| -> : Text : -> | Token | -> | Token | | -> | Token | | -> | Entity | |
* / \ : Input : | Parser | | Enrichers |-' | Validators |-' | Parsers |-'
* *=========* `---------' `-----------' `------------' `---------'
* |
* ,----------. ,---------. |
* *============* ,---------. ,---'--------. | ,---'-------. | |
- * Intent <- : Entity : <- | Variant | <- | Entity | | <- | Entity | | <-----'
+ * Intent <- : Entity : <- | Variant | <- | Entity | | <- | Entity | | <-----'
* Matching : Variants : | Filter | | Validators |-' | Enrichers |-'
* *============* `---------' `------------' `-----------'
- * </pre>
+ * </pre>
* <p>
* Pipeline has the following components:
* <ul>