Skip to content

Commit 1469190

Browse files
feat(nlu): remove beta model param from Sentiment
1 parent b1b3744 commit 1469190

File tree

2 files changed

+1
-21
lines changed

2 files changed

+1
-21
lines changed

ibm_watson/natural_language_understanding_v1.py

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5252,34 +5252,22 @@ class SentimentOptions():
52525252
sentiment results.
52535253
:attr List[str] targets: (optional) Sentiment results will be returned for each
52545254
target string that is found in the document.
5255-
:attr str model: (optional) (Beta) Enter a [custom
5256-
model](https://cloud.ibm.com/docs/natural-language-understanding?topic=natural-language-understanding-customizing)
5257-
ID to override the standard sentiment model for all sentiment analysis
5258-
operations in the request, including targeted sentiment for entities and
5259-
keywords.
52605255
"""
52615256

52625257
def __init__(self,
52635258
*,
52645259
document: bool = None,
5265-
targets: List[str] = None,
5266-
model: str = None) -> None:
5260+
targets: List[str] = None) -> None:
52675261
"""
52685262
Initialize a SentimentOptions object.
52695263
52705264
:param bool document: (optional) Set this to `false` to hide document-level
52715265
sentiment results.
52725266
:param List[str] targets: (optional) Sentiment results will be returned for
52735267
each target string that is found in the document.
5274-
:param str model: (optional) (Beta) Enter a [custom
5275-
model](https://cloud.ibm.com/docs/natural-language-understanding?topic=natural-language-understanding-customizing)
5276-
ID to override the standard sentiment model for all sentiment analysis
5277-
operations in the request, including targeted sentiment for entities and
5278-
keywords.
52795268
"""
52805269
self.document = document
52815270
self.targets = targets
5282-
self.model = model
52835271

52845272
@classmethod
52855273
def from_dict(cls, _dict: Dict) -> 'SentimentOptions':
@@ -5289,8 +5277,6 @@ def from_dict(cls, _dict: Dict) -> 'SentimentOptions':
52895277
args['document'] = _dict.get('document')
52905278
if 'targets' in _dict:
52915279
args['targets'] = _dict.get('targets')
5292-
if 'model' in _dict:
5293-
args['model'] = _dict.get('model')
52945280
return cls(**args)
52955281

52965282
@classmethod
@@ -5305,8 +5291,6 @@ def to_dict(self) -> Dict:
53055291
_dict['document'] = self.document
53065292
if hasattr(self, 'targets') and self.targets is not None:
53075293
_dict['targets'] = self.targets
5308-
if hasattr(self, 'model') and self.model is not None:
5309-
_dict['model'] = self.model
53105294
return _dict
53115295

53125296
def _to_dict(self):

test/unit/test_natural_language_understanding_v1.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,6 @@ def test_analyze_all_params(self):
133133
sentiment_options_model = {}
134134
sentiment_options_model['document'] = True
135135
sentiment_options_model['targets'] = ['testString']
136-
sentiment_options_model['model'] = 'testString'
137136

138137
# Construct a dict representation of a SummarizationOptions model
139138
summarization_options_model = {}
@@ -277,7 +276,6 @@ def test_analyze_value_error(self):
277276
sentiment_options_model = {}
278277
sentiment_options_model['document'] = True
279278
sentiment_options_model['targets'] = ['testString']
280-
sentiment_options_model['model'] = 'testString'
281279

282280
# Construct a dict representation of a SummarizationOptions model
283281
summarization_options_model = {}
@@ -2678,7 +2676,6 @@ def test_features_serialization(self):
26782676
sentiment_options_model = {} # SentimentOptions
26792677
sentiment_options_model['document'] = True
26802678
sentiment_options_model['targets'] = ['testString']
2681-
sentiment_options_model['model'] = 'testString'
26822679

26832680
summarization_options_model = {} # SummarizationOptions
26842681
summarization_options_model['limit'] = 10
@@ -3453,7 +3450,6 @@ def test_sentiment_options_serialization(self):
34533450
sentiment_options_model_json = {}
34543451
sentiment_options_model_json['document'] = True
34553452
sentiment_options_model_json['targets'] = ['testString']
3456-
sentiment_options_model_json['model'] = 'testString'
34573453

34583454
# Construct a model instance of SentimentOptions by calling from_dict on the json representation
34593455
sentiment_options_model = SentimentOptions.from_dict(sentiment_options_model_json)

0 commit comments

Comments
 (0)