24
24
models](https://cloud.ibm.com/docs/natural-language-understanding?topic=natural-language-understanding-customizing)
25
25
with Watson Knowledge Studio to detect custom entities and relations in Natural Language
26
26
Understanding.
27
- IBM is sunsetting Watson Natural Language Understanding Custom Sentiment (BETA). From
28
- **June 3, 2023** onward, you will no longer be able to use the Custom Sentiment
29
- feature.<br /><br />To ensure we continue providing our clients with robust and powerful
30
- text classification capabilities, IBM recently announced the general availability of a new
31
- [single-label text classification
32
- capability](https://cloud.ibm.com/docs/natural-language-understanding?topic=natural-language-understanding-classifications).
33
- This new feature includes extended language support and training data customizations
34
- suited for building a custom sentiment classifier.<br /><br />If you would like more
35
- information or further guidance, please contact IBM Cloud Support.{: deprecated}
36
27
37
28
API Version: 1.0
38
29
See: https://cloud.ibm.com/docs/natural-language-understanding
@@ -122,7 +113,6 @@ def analyze(
122
113
- Semantic roles
123
114
- Sentiment
124
115
- Syntax
125
- - Summarization (Experimental)
126
116
If a language for the input text is not specified with the `language` parameter,
127
117
the service [automatically detects the
128
118
language](https://cloud.ibm.com/docs/natural-language-understanding?topic=natural-language-understanding-detectable-languages).
@@ -312,7 +302,7 @@ def create_categories_model(
312
302
language : str ,
313
303
training_data : BinaryIO ,
314
304
* ,
315
- training_data_content_type : Optional [str ] = 'application/json' ,
305
+ training_data_content_type : Optional [str ] = None ,
316
306
name : Optional [str ] = None ,
317
307
user_metadata : Optional [dict ] = None ,
318
308
description : Optional [str ] = None ,
@@ -499,7 +489,7 @@ def update_categories_model(
499
489
language : str ,
500
490
training_data : BinaryIO ,
501
491
* ,
502
- training_data_content_type : Optional [str ] = 'application/json' ,
492
+ training_data_content_type : Optional [str ] = None ,
503
493
name : Optional [str ] = None ,
504
494
user_metadata : Optional [dict ] = None ,
505
495
description : Optional [str ] = None ,
@@ -653,7 +643,7 @@ def create_classifications_model(
653
643
language : str ,
654
644
training_data : BinaryIO ,
655
645
* ,
656
- training_data_content_type : Optional [str ] = 'application/json' ,
646
+ training_data_content_type : Optional [str ] = None ,
657
647
name : Optional [str ] = None ,
658
648
user_metadata : Optional [dict ] = None ,
659
649
description : Optional [str ] = None ,
@@ -849,7 +839,7 @@ def update_classifications_model(
849
839
language : str ,
850
840
training_data : BinaryIO ,
851
841
* ,
852
- training_data_content_type : Optional [str ] = 'application/json' ,
842
+ training_data_content_type : Optional [str ] = None ,
853
843
name : Optional [str ] = None ,
854
844
user_metadata : Optional [dict ] = None ,
855
845
description : Optional [str ] = None ,
@@ -3632,10 +3622,6 @@ class Features:
3632
3622
`keywords.sentiment`.
3633
3623
Supported languages: Arabic, English, French, German, Italian, Japanese,
3634
3624
Korean, Portuguese, Russian, Spanish.
3635
- :param SummarizationOptions summarization: (optional) (Experimental) Returns a
3636
- summary of content.
3637
- Supported languages: English only.
3638
- Supported regions: Dallas region only.
3639
3625
:param CategoriesOptions categories: (optional) Returns a hierarchical taxonomy
3640
3626
of the content. The top three categories are returned by default.
3641
3627
Supported languages: Arabic, English, French, German, Italian, Japanese, Korean,
@@ -3656,7 +3642,6 @@ def __init__(
3656
3642
relations : Optional ['RelationsOptions' ] = None ,
3657
3643
semantic_roles : Optional ['SemanticRolesOptions' ] = None ,
3658
3644
sentiment : Optional ['SentimentOptions' ] = None ,
3659
- summarization : Optional ['SummarizationOptions' ] = None ,
3660
3645
categories : Optional ['CategoriesOptions' ] = None ,
3661
3646
syntax : Optional ['SyntaxOptions' ] = None ,
3662
3647
) -> None :
@@ -3707,10 +3692,6 @@ def __init__(
3707
3692
and for keywords with `keywords.sentiment`.
3708
3693
Supported languages: Arabic, English, French, German, Italian, Japanese,
3709
3694
Korean, Portuguese, Russian, Spanish.
3710
- :param SummarizationOptions summarization: (optional) (Experimental)
3711
- Returns a summary of content.
3712
- Supported languages: English only.
3713
- Supported regions: Dallas region only.
3714
3695
:param CategoriesOptions categories: (optional) Returns a hierarchical
3715
3696
taxonomy of the content. The top three categories are returned by default.
3716
3697
Supported languages: Arabic, English, French, German, Italian, Japanese,
@@ -3727,7 +3708,6 @@ def __init__(
3727
3708
self .relations = relations
3728
3709
self .semantic_roles = semantic_roles
3729
3710
self .sentiment = sentiment
3730
- self .summarization = summarization
3731
3711
self .categories = categories
3732
3712
self .syntax = syntax
3733
3713
@@ -3755,9 +3735,6 @@ def from_dict(cls, _dict: Dict) -> 'Features':
3755
3735
semantic_roles )
3756
3736
if (sentiment := _dict .get ('sentiment' )) is not None :
3757
3737
args ['sentiment' ] = SentimentOptions .from_dict (sentiment )
3758
- if (summarization := _dict .get ('summarization' )) is not None :
3759
- args ['summarization' ] = SummarizationOptions .from_dict (
3760
- summarization )
3761
3738
if (categories := _dict .get ('categories' )) is not None :
3762
3739
args ['categories' ] = CategoriesOptions .from_dict (categories )
3763
3740
if (syntax := _dict .get ('syntax' )) is not None :
@@ -3815,11 +3792,6 @@ def to_dict(self) -> Dict:
3815
3792
_dict ['sentiment' ] = self .sentiment
3816
3793
else :
3817
3794
_dict ['sentiment' ] = self .sentiment .to_dict ()
3818
- if hasattr (self , 'summarization' ) and self .summarization is not None :
3819
- if isinstance (self .summarization , dict ):
3820
- _dict ['summarization' ] = self .summarization
3821
- else :
3822
- _dict ['summarization' ] = self .summarization .to_dict ()
3823
3795
if hasattr (self , 'categories' ) and self .categories is not None :
3824
3796
if isinstance (self .categories , dict ):
3825
3797
_dict ['categories' ] = self .categories
@@ -5619,66 +5591,6 @@ def __ne__(self, other: 'SentimentResult') -> bool:
5619
5591
return not self == other
5620
5592
5621
5593
5622
- class SummarizationOptions :
5623
- """
5624
- (Experimental) Returns a summary of content.
5625
- Supported languages: English only.
5626
- Supported regions: Dallas region only.
5627
-
5628
- :param int limit: (optional) Maximum number of summary sentences to return.
5629
- """
5630
-
5631
- def __init__ (
5632
- self ,
5633
- * ,
5634
- limit : Optional [int ] = None ,
5635
- ) -> None :
5636
- """
5637
- Initialize a SummarizationOptions object.
5638
-
5639
- :param int limit: (optional) Maximum number of summary sentences to return.
5640
- """
5641
- self .limit = limit
5642
-
5643
- @classmethod
5644
- def from_dict (cls , _dict : Dict ) -> 'SummarizationOptions' :
5645
- """Initialize a SummarizationOptions object from a json dictionary."""
5646
- args = {}
5647
- if (limit := _dict .get ('limit' )) is not None :
5648
- args ['limit' ] = limit
5649
- return cls (** args )
5650
-
5651
- @classmethod
5652
- def _from_dict (cls , _dict ):
5653
- """Initialize a SummarizationOptions object from a json dictionary."""
5654
- return cls .from_dict (_dict )
5655
-
5656
- def to_dict (self ) -> Dict :
5657
- """Return a json dictionary representing this model."""
5658
- _dict = {}
5659
- if hasattr (self , 'limit' ) and self .limit is not None :
5660
- _dict ['limit' ] = self .limit
5661
- return _dict
5662
-
5663
- def _to_dict (self ):
5664
- """Return a json dictionary representing this model."""
5665
- return self .to_dict ()
5666
-
5667
- def __str__ (self ) -> str :
5668
- """Return a `str` version of this SummarizationOptions object."""
5669
- return json .dumps (self .to_dict (), indent = 2 )
5670
-
5671
- def __eq__ (self , other : 'SummarizationOptions' ) -> bool :
5672
- """Return `true` when self and other are equal, false otherwise."""
5673
- if not isinstance (other , self .__class__ ):
5674
- return False
5675
- return self .__dict__ == other .__dict__
5676
-
5677
- def __ne__ (self , other : 'SummarizationOptions' ) -> bool :
5678
- """Return `true` when self and other are not equal, false otherwise."""
5679
- return not self == other
5680
-
5681
-
5682
5594
class SyntaxOptions :
5683
5595
"""
5684
5596
Returns tokens and sentences from the input text.
0 commit comments