This is an automated email from the ASF dual-hosted git repository.
sergeykamov pushed a commit to branch NLPCRAFT-520
in repository https://gitbox.apache.org/repos/asf/incubator-nlpcraft.git
The following commit(s) were added to refs/heads/NLPCRAFT-520 by this push:
new 7bbae29a WIP.
7bbae29a is described below
commit 7bbae29a284810f9cff176c8feebce6425ec7572
Author: Sergey Kamov <[email protected]>
AuthorDate: Thu Jan 5 17:29:58 2023 +0400
WIP.
---
.../org/apache/nlpcraft/nlp/parsers/NCSemanticElement.scala | 10 ++++++++--
.../apache/nlpcraft/nlp/parsers/NCSemanticEntityParser.scala | 9 ++++++++-
2 files changed, 16 insertions(+), 3 deletions(-)
diff --git
a/nlpcraft/src/main/scala/org/apache/nlpcraft/nlp/parsers/NCSemanticElement.scala
b/nlpcraft/src/main/scala/org/apache/nlpcraft/nlp/parsers/NCSemanticElement.scala
index 5646c4f6..24ab4195 100644
---
a/nlpcraft/src/main/scala/org/apache/nlpcraft/nlp/parsers/NCSemanticElement.scala
+++
b/nlpcraft/src/main/scala/org/apache/nlpcraft/nlp/parsers/NCSemanticElement.scala
@@ -20,9 +20,15 @@ package org.apache.nlpcraft.nlp.parsers
import org.apache.nlpcraft.nlp.stemmer.NCStemmer
import org.apache.nlpcraft.*
/**
- *
- * Configuration element which helps to detect [[org.apache.nlpcraft.NCEntity
NCEntity]] for
+ * This trait defines configuration which helps to detect [[NCEntity]] of
* **Semantic** entity parser [[NCSemanticEntityParser]].
+ * It denotes a **named entity** [[NCEntity]] which is created by
[[NCSemanticEntityParser]].
+ *
+ * Each trait contains a set of synonyms to match on named entity.
+ * A synonym can have one or more individual words.
+ * Note that element's type is its implicit synonym so that even if no
additional synonyms are defined at least one synonym always exists.
+ * Note also that synonym matching is performed on normalized and stemmatized
forms of both a synonym and user input on first phase and if first attempt is
not successful, it tries to match stemmatized forms of synonyms with
stemmatized forms of user input which were lemmatized preliminarily.
+ * This approach allows to provide more accurate matching and doesn't force
users to prepare synonyms in initial words form.
*
* See detailed description on the website
[[https://nlpcraft.apache.org/built-in-entity-parser.html#parser-semantic
Semantic Parser]].
*
diff --git
a/nlpcraft/src/main/scala/org/apache/nlpcraft/nlp/parsers/NCSemanticEntityParser.scala
b/nlpcraft/src/main/scala/org/apache/nlpcraft/nlp/parsers/NCSemanticEntityParser.scala
index ed3ac06e..283bcab3 100644
---
a/nlpcraft/src/main/scala/org/apache/nlpcraft/nlp/parsers/NCSemanticEntityParser.scala
+++
b/nlpcraft/src/main/scala/org/apache/nlpcraft/nlp/parsers/NCSemanticEntityParser.scala
@@ -123,7 +123,14 @@ private object NCSemanticEntityParser:
import NCSemanticEntityParser.*
/**
- * **Semantic** [[NCEntityParser entity parser]] implementation.
+ * **Semantic** [[NCEntityParser entity parser]] synonyms based
implementation.
+ *
+ * This parser provides simple but very powerful way to find domain specific
data in the input text.
+ * It configured by list of [[NCSemanticElement]] which are represent
[[NCEntity name entities]] and
+ * can be produced by this parser.
+ *
+ * [[NCSemanticElement]] elements can be configured via YAML or JSON files in
special format or created and passed
+ * programmatically.
*
* See detailed description on the website
[[https://nlpcraft.apache.org/built-in-entity-parser.html#parser-semantic
Semantic Parser]].
*