This is an automated email from the ASF dual-hosted git repository.
paulk pushed a commit to branch asf-site
in repository https://gitbox.apache.org/repos/asf/groovy-website.git
The following commit(s) were added to refs/heads/asf-site by this push:
new bb26a8e minor tweaks
bb26a8e is described below
commit bb26a8e656f33b9e01c805d9f4c9c38252046b46
Author: Paul King <[email protected]>
AuthorDate: Sat Mar 11 14:56:59 2023 +1000
minor tweaks
---
site/src/site/blog/apache-nlpcraft-with-groovy.adoc | 14 ++++++++------
.../blog/natural-language-processing-with-groovy.adoc | 16 ++++++++--------
2 files changed, 16 insertions(+), 14 deletions(-)
diff --git a/site/src/site/blog/apache-nlpcraft-with-groovy.adoc
b/site/src/site/blog/apache-nlpcraft-with-groovy.adoc
index 5399ed5..c371668 100644
--- a/site/src/site/blog/apache-nlpcraft-with-groovy.adoc
+++ b/site/src/site/blog/apache-nlpcraft-with-groovy.adoc
@@ -36,21 +36,23 @@ We'll show using Groovy as the client language.
First, a bit of background about the example.
We are trying to determine the intent behind English language
commands to turn lights on and off in a house.
-We define a model using a combination of
+We are going to use the project's pre-defined model which is part of their
examples.
+It is defined using a combination of
https://nlpcraft.apache.org/examples/light_switch.html#model[YAML]
and
https://nlpcraft.apache.org/examples/light_switch.html#code[Scala3 code].
-The key thing to note is that the model is made up of a number of action
-keywords and locations. If these are matched, the lightswitch (`ls`) intent
-is triggered.
+The key thing to note is that the model is made up of a number of keywords
+comprising _actions_ and _locations_.
+If these are matched, the lightswitch (`ls`) intent is triggered.
Actions and locations will become more obvious soon in our example.
-Our example uses an English language model but NLPCraft can support any
language.
+Our example uses an English language model but NLPCraft can support
+any natural language.
They provide the lightswitch model also in
https://nlpcraft.apache.org/examples/light_switch_fr.html[French] and other
languages.
We also need to add NLPCraft dependencies: `org.apache.nlpcraft:nlpcraft:1.0.0`
-and `org.apache.nlpcraft:nlpcraft-example-lightswitch:1.0.0` (for a
pre-compiled model). You can use `@Grab` statements in your script or add the
dependencies to your build file.
+and `org.apache.nlpcraft:nlpcraft-example-lightswitch:1.0.0` (for the
pre-compiled model). You can use `@Grab` statements in your script or add the
dependencies to your build file.
NOTE: Depending on the Groovy version and modules you are using, if you see
exceptions
complaining about Jackson databind versions, simply exclude the Jackson
versions
diff --git a/site/src/site/blog/natural-language-processing-with-groovy.adoc
b/site/src/site/blog/natural-language-processing-with-groovy.adoc
index 20c8b5b..0039148 100644
--- a/site/src/site/blog/natural-language-processing-with-groovy.adoc
+++ b/site/src/site/blog/natural-language-processing-with-groovy.adoc
@@ -975,7 +975,7 @@ variants.each { key, params ->
def result = categorizer.categorize(it.split('[ !]'))
def category = categorizer.getBestCategory(result)
def prob = sprintf '%4.2f', result[categorizer.getIndex(category)]
- println "${it.padRight(w)} $category ($prob)}"
+ println "${it.padRight(w)} $category ($prob)"
}
}
----
@@ -990,14 +990,14 @@ Training using NaiveBayes …done.
…
Analyzing using Maxent
-OpenNLP is fantastic! positive (0.64)}
-Groovy is great fun! positive (0.74)}
-Math can be hard! negative (0.61)}
+OpenNLP is fantastic! positive (0.64)
+Groovy is great fun! positive (0.74)
+Math can be hard! negative (0.61)
Analyzing using NaiveBayes
-OpenNLP is fantastic! positive (0.72)}
-Groovy is great fun! positive (0.81)}
-Math can be hard! negative (0.72)}
+OpenNLP is fantastic! positive (0.72)
+Groovy is great fun! positive (0.81)
+Math can be hard! negative (0.72)
----
The models here appear to have lower probability levels compared to the model
we
@@ -1013,7 +1013,7 @@ It looks at using the universal sentence encoder model
from
https://github.com/paulk-asert/groovy-data-science/tree/master/subprojects[TensorFlow
Hub]
via the https://djl.ai/[DeepJavaLibrary] (DJL) api.
-First we define a translator. The `Translator` interface allow us to specify
pre
+First we define a translator. The `Translator` interface allow us to specify
pre-
and post-processing functionality.
[source,groovy]