This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push:
new 66d00a5f6ab1 CAMEL-22518: camel-djl - Remove dead nlp/word_embedding
zoo path (#23436)
66d00a5f6ab1 is described below
commit 66d00a5f6ab17c32fd19dc8855bf6f7c65313b6b
Author: Devendra Reddy Pennabadi <[email protected]>
AuthorDate: Fri May 22 02:03:47 2026 +0530
CAMEL-22518: camel-djl - Remove dead nlp/word_embedding zoo path (#23436)
Only zoo model was ai.djl.mxnet:glove (MXNet discontinued); dropped the
@Disabled test, ZooWordEmbeddingPredictor, its Producer dispatch and docs
entry. Custom path is unaffected.
---
.../camel-djl/src/main/docs/djl-component.adoc | 12 -----
.../djl/model/ModelPredictorProducer.java | 3 --
.../djl/model/nlp/ZooWordEmbeddingPredictor.java | 56 ----------------------
.../camel/component/djl/NlpWordEmbeddingTest.java | 55 ---------------------
.../djl/model/ModelPredictorProducerTest.java | 4 +-
.../ROOT/pages/camel-4x-upgrade-guide-4_21.adoc | 14 ++++++
6 files changed, 15 insertions(+), 129 deletions(-)
diff --git a/components/camel-ai/camel-djl/src/main/docs/djl-component.adoc
b/components/camel-ai/camel-djl/src/main/docs/djl-component.adoc
index 9a5b39ad048a..c4a38adbcd67 100644
--- a/components/camel-ai/camel-djl/src/main/docs/djl-component.adoc
+++ b/components/camel-ai/camel-djl/src/main/docs/djl-component.adoc
@@ -396,18 +396,6 @@ Application: `nlp/sentiment_analysis`
|===
-==== NLP - Word Embedding
-
-Application: `nlp/word_embedding`
-
-[width="100%",cols="2,5,5",options="header"]
-|===
-| Model family | Artifact ID | Options
-
-| GloVe | `ai.djl.mxnet:glove:0.0.2` | {dimensions=50}
-
-|===
-
==== Time Series - Forecasting
Application: `timeseries/forecasting`
diff --git
a/components/camel-ai/camel-djl/src/main/java/org/apache/camel/component/djl/model/ModelPredictorProducer.java
b/components/camel-ai/camel-djl/src/main/java/org/apache/camel/component/djl/model/ModelPredictorProducer.java
index 3cf86bbcf719..0e61056b8d83 100644
---
a/components/camel-ai/camel-djl/src/main/java/org/apache/camel/component/djl/model/ModelPredictorProducer.java
+++
b/components/camel-ai/camel-djl/src/main/java/org/apache/camel/component/djl/model/ModelPredictorProducer.java
@@ -54,7 +54,6 @@ import
org.apache.camel.component.djl.model.nlp.ZooTextClassificationPredictor;
import org.apache.camel.component.djl.model.nlp.ZooTextEmbeddingPredictor;
import org.apache.camel.component.djl.model.nlp.ZooTextGenerationPredictor;
import
org.apache.camel.component.djl.model.nlp.ZooTokenClassificationPredictor;
-import org.apache.camel.component.djl.model.nlp.ZooWordEmbeddingPredictor;
import org.apache.camel.component.djl.model.tabular.CustomTabularPredictor;
import
org.apache.camel.component.djl.model.tabular.ZooLinearRegressionPredictor;
import
org.apache.camel.component.djl.model.tabular.ZooSoftmaxRegressionPredictor;
@@ -126,8 +125,6 @@ public final class ModelPredictorProducer {
return new ZooSentimentAnalysisPredictor(endpoint);
} else if (TOKEN_CLASSIFICATION.getPath().equals(applicationPath)) {
return new ZooTokenClassificationPredictor(endpoint);
- } else if (WORD_EMBEDDING.getPath().equals(applicationPath)) {
- return new ZooWordEmbeddingPredictor(endpoint);
} else if (TEXT_GENERATION.getPath().equals(applicationPath)) {
return new ZooTextGenerationPredictor(endpoint);
} else if (MACHINE_TRANSLATION.getPath().equals(applicationPath)) {
diff --git
a/components/camel-ai/camel-djl/src/main/java/org/apache/camel/component/djl/model/nlp/ZooWordEmbeddingPredictor.java
b/components/camel-ai/camel-djl/src/main/java/org/apache/camel/component/djl/model/nlp/ZooWordEmbeddingPredictor.java
deleted file mode 100644
index 01bd1c038861..000000000000
---
a/components/camel-ai/camel-djl/src/main/java/org/apache/camel/component/djl/model/nlp/ZooWordEmbeddingPredictor.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.component.djl.model.nlp;
-
-import java.io.IOException;
-
-import ai.djl.Application;
-import ai.djl.MalformedModelException;
-import ai.djl.ndarray.NDList;
-import ai.djl.repository.zoo.Criteria;
-import ai.djl.repository.zoo.ModelNotFoundException;
-import ai.djl.repository.zoo.ModelZoo;
-import ai.djl.training.util.ProgressBar;
-import org.apache.camel.Exchange;
-import org.apache.camel.component.djl.DJLEndpoint;
-
-public class ZooWordEmbeddingPredictor extends AbstractNlpZooPredictor<NDList>
{
-
- public ZooWordEmbeddingPredictor(DJLEndpoint endpoint) throws
ModelNotFoundException, MalformedModelException,
- IOException {
- super(endpoint);
-
- Criteria.Builder<String, NDList> builder = Criteria.builder()
- .optApplication(Application.NLP.WORD_EMBEDDING)
- .setTypes(String.class, NDList.class)
- .optArtifactId(endpoint.getArtifactId());
- if (endpoint.isShowProgress()) {
- builder.optProgress(new ProgressBar());
- }
-
- Criteria<String, NDList> criteria = builder.build();
- this.model = ModelZoo.loadModel(criteria);
- }
-
- @Override
- public void process(Exchange exchange) {
- super.process(exchange);
- // DJL NDList should not be exposed outside the endpoint
- NDList result = exchange.getIn().getBody(NDList.class);
- exchange.getIn().setBody(result.encode());
- }
-}
diff --git
a/components/camel-ai/camel-djl/src/test/java/org/apache/camel/component/djl/NlpWordEmbeddingTest.java
b/components/camel-ai/camel-djl/src/test/java/org/apache/camel/component/djl/NlpWordEmbeddingTest.java
deleted file mode 100644
index dba7b49bc553..000000000000
---
a/components/camel-ai/camel-djl/src/test/java/org/apache/camel/component/djl/NlpWordEmbeddingTest.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.component.djl;
-
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.test.junit6.CamelTestSupport;
-import org.junit.jupiter.api.BeforeAll;
-import org.junit.jupiter.api.Disabled;
-import org.junit.jupiter.api.Test;
-
-@Disabled("There is an issue with the DJL model used")
-public class NlpWordEmbeddingTest extends CamelTestSupport {
-
- @BeforeAll
- public static void setupDefaultEngine() {
- // Since Apache MXNet is discontinued, prefer PyTorch as the default
engine
- System.setProperty("ai.djl.default_engine", "PyTorch");
- }
-
- @Test
- void testDJL() throws Exception {
- var mock = getMockEndpoint("mock:result");
- mock.expectedMinimumMessageCount(4);
- mock.await();
- }
-
- @Override
- protected RouteBuilder createRouteBuilder() {
- return new RouteBuilder() {
- public void configure() {
- from("timer:testDJL?repeatCount=1")
- .setBody(constant("Camel AI is awesome"))
- .split(body().tokenize(" "))
-
.to("djl:nlp/word_embedding?artifactId=ai.djl.mxnet:glove:0.0.2")
- .log("\"${header.CamelDjlInput}\" => ${body}")
- .to("mock:result");
- }
- };
- }
-
-}
diff --git
a/components/camel-ai/camel-djl/src/test/java/org/apache/camel/component/djl/model/ModelPredictorProducerTest.java
b/components/camel-ai/camel-djl/src/test/java/org/apache/camel/component/djl/model/ModelPredictorProducerTest.java
index 05f40e04f9e9..a4ab4000ceb9 100644
---
a/components/camel-ai/camel-djl/src/test/java/org/apache/camel/component/djl/model/ModelPredictorProducerTest.java
+++
b/components/camel-ai/camel-djl/src/test/java/org/apache/camel/component/djl/model/ModelPredictorProducerTest.java
@@ -36,7 +36,6 @@ import
org.apache.camel.component.djl.model.nlp.CustomQuestionAnswerPredictor;
import org.apache.camel.component.djl.model.nlp.CustomWordEmbeddingPredictor;
import org.apache.camel.component.djl.model.nlp.ZooQuestionAnswerPredictor;
import org.apache.camel.component.djl.model.nlp.ZooSentimentAnalysisPredictor;
-import org.apache.camel.component.djl.model.nlp.ZooWordEmbeddingPredictor;
import org.apache.camel.component.djl.model.tabular.CustomTabularPredictor;
import
org.apache.camel.component.djl.model.timeseries.CustomForecastingPredictor;
import org.apache.camel.component.djl.model.timeseries.ZooForecastingPredictor;
@@ -83,8 +82,7 @@ class ModelPredictorProducerTest {
assertInstanceOf(ZooSentimentAnalysisPredictor.class,
getZooPredictor(zooEndpoint("nlp/sentiment_analysis",
"ai.djl.pytorch:distilbert:0.0.1")));
// No builtin zoo model available for "nlp/token_classification"
- assertInstanceOf(ZooWordEmbeddingPredictor.class,
- getZooPredictor(zooEndpoint("nlp/word_embedding",
"ai.djl.mxnet:glove:0.0.2")));
+ // No builtin zoo model available for "nlp/word_embedding"
// No builtin zoo model available for "nlp/text_generation"
// No builtin zoo model available for "nlp/machine_translation"
// No builtin zoo model available for "nlp/multiple_choice"
diff --git
a/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_21.adoc
b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_21.adoc
index 878f9c966d54..10ce38de8899 100644
--- a/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_21.adoc
+++ b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_21.adoc
@@ -367,6 +367,20 @@ What it means is that, from now on, the final user or any
third party dependency
This is just an informative note, there is not action expected by the final
user.
+=== camel-djl
+
+The `nlp/word_embedding` application no longer ships a built-in zoo predictor.
+The only zoo model previously listed for this application —
`ai.djl.mxnet:glove:0.0.2` —
+relied on the discontinued Apache MXNet engine and never loaded successfully
(the
+corresponding integration test had been permanently `@Disabled`). The
+`ZooWordEmbeddingPredictor` class has been removed and the `nlp/word_embedding`
+branch of `ModelPredictorProducer.getZooPredictor` now reports `Application not
+supported` for that path.
+
+Routes that use a custom word-embedding model (no `artifactId`, with explicit
+`model` and `translator` parameters) are unaffected —
`CustomWordEmbeddingPredictor`
+and the `nlp/word_embedding` branch of `getCustomPredictor` remain in place.
+
=== camel-aws-bedrock
The `applyGuardrail` producer operation now reads the guardrail identifier
from a new dedicated header