Skip to content

Commit

Permalink
fix(nlu): remove summarization param
Browse files Browse the repository at this point in the history
  • Loading branch information
apaparazzi0329 committed Dec 5, 2024
1 parent 5ca34b2 commit 3fa8b85
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 60 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,6 @@
* with Watson Knowledge Studio to detect custom entities and relations in Natural Language
* Understanding.
*
* <p>IBM is sunsetting Watson Natural Language Understanding Custom Sentiment (BETA). From **June
* 3, 2023** onward, you will no longer be able to use the Custom Sentiment feature.&lt;br
* /&gt;&lt;br /&gt;To ensure we continue providing our clients with robust and powerful text
* classification capabilities, IBM recently announced the general availability of a new
* [single-label text classification
* capability](https://cloud.ibm.com/docs/natural-language-understanding?topic=natural-language-understanding-classifications).
* This new feature includes extended language support and training data customizations suited for
* building a custom sentiment classifier.&lt;br /&gt;&lt;br /&gt;If you would like more information
* or further guidance, please contact IBM Cloud Support.{: deprecated}.
*
* <p>API Version: 1.0 See: https://cloud.ibm.com/docs/natural-language-understanding
*/
public class NaturalLanguageUnderstanding extends BaseService {
Expand Down Expand Up @@ -168,7 +158,7 @@ public void setVersion(final String version) {
*
* <p>Analyzes text, HTML, or a public webpage for the following features: - Categories -
* Classifications - Concepts - Emotion - Entities - Keywords - Metadata - Relations - Semantic
* roles - Sentiment - Syntax - Summarization (Experimental)
* roles - Sentiment - Syntax
*
* <p>If a language for the input text is not specified with the `language` parameter, the service
* [automatically detects the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ public class Features extends GenericModel {
protected SemanticRolesOptions semanticRoles;

protected SentimentOptions sentiment;
protected SummarizationOptions summarization;
protected CategoriesOptions categories;
protected SyntaxOptions syntax;

Expand All @@ -46,7 +45,6 @@ public static class Builder {
private RelationsOptions relations;
private SemanticRolesOptions semanticRoles;
private SentimentOptions sentiment;
private SummarizationOptions summarization;
private CategoriesOptions categories;
private SyntaxOptions syntax;

Expand All @@ -65,7 +63,6 @@ private Builder(Features features) {
this.relations = features.relations;
this.semanticRoles = features.semanticRoles;
this.sentiment = features.sentiment;
this.summarization = features.summarization;
this.categories = features.categories;
this.syntax = features.syntax;
}
Expand Down Expand Up @@ -181,17 +178,6 @@ public Builder sentiment(SentimentOptions sentiment) {
return this;
}

/**
* Set the summarization.
*
* @param summarization the summarization
* @return the Features builder
*/
public Builder summarization(SummarizationOptions summarization) {
this.summarization = summarization;
return this;
}

/**
* Set the categories.
*
Expand Down Expand Up @@ -227,7 +213,6 @@ protected Features(Builder builder) {
relations = builder.relations;
semanticRoles = builder.semanticRoles;
sentiment = builder.sentiment;
summarization = builder.summarization;
categories = builder.categories;
syntax = builder.syntax;
}
Expand Down Expand Up @@ -371,21 +356,6 @@ public SentimentOptions sentiment() {
return sentiment;
}

/**
* Gets the summarization.
*
* <p>(Experimental) Returns a summary of content.
*
* <p>Supported languages: English only.
*
* <p>Supported regions: Dallas region only.
*
* @return the summarization
*/
public SummarizationOptions summarization() {
return summarization;
}

/**
* Gets the categories.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
import com.ibm.watson.natural_language_understanding.v1.model.RelationsOptions;
import com.ibm.watson.natural_language_understanding.v1.model.SemanticRolesOptions;
import com.ibm.watson.natural_language_understanding.v1.model.SentimentOptions;
import com.ibm.watson.natural_language_understanding.v1.model.SummarizationOptions;
import com.ibm.watson.natural_language_understanding.v1.model.SyntaxOptions;
import com.ibm.watson.natural_language_understanding.v1.model.SyntaxOptionsTokens;
import com.ibm.watson.natural_language_understanding.v1.model.UpdateCategoriesModelOptions;
Expand Down Expand Up @@ -155,10 +154,6 @@ public void testAnalyzeWOptions() throws Throwable {
.targets(java.util.Arrays.asList("testString"))
.build();

// Construct an instance of the SummarizationOptions model
SummarizationOptions summarizationOptionsModel =
new SummarizationOptions.Builder().limit(Long.valueOf("3")).build();

// Construct an instance of the CategoriesOptions model
CategoriesOptions categoriesOptionsModel =
new CategoriesOptions.Builder()
Expand Down Expand Up @@ -187,7 +182,6 @@ public void testAnalyzeWOptions() throws Throwable {
.relations(relationsOptionsModel)
.semanticRoles(semanticRolesOptionsModel)
.sentiment(sentimentOptionsModel)
.summarization(summarizationOptionsModel)
.categories(categoriesOptionsModel)
.syntax(syntaxOptionsModel)
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,6 @@ public void testAnalyzeOptions() throws Throwable {
assertEquals(sentimentOptionsModel.document(), Boolean.valueOf(true));
assertEquals(sentimentOptionsModel.targets(), java.util.Arrays.asList("testString"));

SummarizationOptions summarizationOptionsModel =
new SummarizationOptions.Builder().limit(Long.valueOf("3")).build();
assertEquals(summarizationOptionsModel.limit(), Long.valueOf("3"));

CategoriesOptions categoriesOptionsModel =
new CategoriesOptions.Builder()
.explanation(false)
Expand Down Expand Up @@ -127,7 +123,6 @@ public void testAnalyzeOptions() throws Throwable {
.relations(relationsOptionsModel)
.semanticRoles(semanticRolesOptionsModel)
.sentiment(sentimentOptionsModel)
.summarization(summarizationOptionsModel)
.categories(categoriesOptionsModel)
.syntax(syntaxOptionsModel)
.build();
Expand All @@ -141,7 +136,6 @@ public void testAnalyzeOptions() throws Throwable {
assertEquals(featuresModel.relations(), relationsOptionsModel);
assertEquals(featuresModel.semanticRoles(), semanticRolesOptionsModel);
assertEquals(featuresModel.sentiment(), sentimentOptionsModel);
assertEquals(featuresModel.summarization(), summarizationOptionsModel);
assertEquals(featuresModel.categories(), categoriesOptionsModel);
assertEquals(featuresModel.syntax(), syntaxOptionsModel);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,6 @@ public void testFeatures() throws Throwable {
assertEquals(sentimentOptionsModel.document(), Boolean.valueOf(true));
assertEquals(sentimentOptionsModel.targets(), java.util.Arrays.asList("testString"));

SummarizationOptions summarizationOptionsModel =
new SummarizationOptions.Builder().limit(Long.valueOf("3")).build();
assertEquals(summarizationOptionsModel.limit(), Long.valueOf("3"));

CategoriesOptions categoriesOptionsModel =
new CategoriesOptions.Builder()
.explanation(false)
Expand Down Expand Up @@ -127,7 +123,6 @@ public void testFeatures() throws Throwable {
.relations(relationsOptionsModel)
.semanticRoles(semanticRolesOptionsModel)
.sentiment(sentimentOptionsModel)
.summarization(summarizationOptionsModel)
.categories(categoriesOptionsModel)
.syntax(syntaxOptionsModel)
.build();
Expand All @@ -141,7 +136,6 @@ public void testFeatures() throws Throwable {
assertEquals(featuresModel.relations(), relationsOptionsModel);
assertEquals(featuresModel.semanticRoles(), semanticRolesOptionsModel);
assertEquals(featuresModel.sentiment(), sentimentOptionsModel);
assertEquals(featuresModel.summarization(), summarizationOptionsModel);
assertEquals(featuresModel.categories(), categoriesOptionsModel);
assertEquals(featuresModel.syntax(), syntaxOptionsModel);

Expand All @@ -161,7 +155,6 @@ public void testFeatures() throws Throwable {
assertEquals(featuresModelNew.relations().toString(), relationsOptionsModel.toString());
assertEquals(featuresModelNew.semanticRoles().toString(), semanticRolesOptionsModel.toString());
assertEquals(featuresModelNew.sentiment().toString(), sentimentOptionsModel.toString());
assertEquals(featuresModelNew.summarization().toString(), summarizationOptionsModel.toString());
assertEquals(featuresModelNew.categories().toString(), categoriesOptionsModel.toString());
assertEquals(featuresModelNew.syntax().toString(), syntaxOptionsModel.toString());
}
Expand Down

0 comments on commit 3fa8b85

Please sign in to comment.