44
44
class NaturalLanguageUnderstandingV1 (BaseService ):
45
45
"""The Natural Language Understanding V1 service."""
46
46
47
- DEFAULT_SERVICE_URL = 'https://gateway.watsonplatform.net/ natural-language-understanding/api '
47
+ DEFAULT_SERVICE_URL = 'https://api.us-south. natural-language-understanding.watson.cloud.ibm.com '
48
48
DEFAULT_SERVICE_NAME = 'natural-language-understanding'
49
49
50
50
def __init__ (
@@ -110,7 +110,7 @@ def analyze(self,
110
110
- Relations
111
111
- Semantic roles
112
112
- Sentiment
113
- - Syntax (Experimental) .
113
+ - Syntax.
114
114
If a language for the input text is not specified with the `language` parameter,
115
115
the service [automatically detects the
116
116
language](https://cloud.ibm.com/docs/natural-language-understanding?topic=natural-language-understanding-detectable-languages).
@@ -123,9 +123,8 @@ def analyze(self,
123
123
:param str url: (optional) The webpage to analyze. One of the `text`,
124
124
`html`, or `url` parameters is required.
125
125
:param bool clean: (optional) Set this to `false` to disable webpage
126
- cleaning. To learn more about webpage cleaning, see the [Analyzing
127
- webpages](https://cloud.ibm.com/docs/natural-language-understanding?topic=natural-language-understanding-analyzing-webpages)
128
- documentation.
126
+ cleaning. For more information about webpage cleaning, see [Analyzing
127
+ webpages](https://cloud.ibm.com/docs/natural-language-understanding?topic=natural-language-understanding-analyzing-webpages).
129
128
:param str xpath: (optional) An [XPath
130
129
query](https://cloud.ibm.com/docs/natural-language-understanding?topic=natural-language-understanding-analyzing-webpages#xpath)
131
130
to perform on `html` or `url` input. Results of the query will be appended
@@ -137,10 +136,9 @@ def analyze(self,
137
136
analyzed text.
138
137
:param str language: (optional) ISO 639-1 code that specifies the language
139
138
of your text. This overrides automatic language detection. Language support
140
- differs depending on the features you include in your analysis. See
141
- [Language
142
- support](https://cloud.ibm.com/docs/natural-language-understanding?topic=natural-language-understanding-language-support)
143
- for more information.
139
+ differs depending on the features you include in your analysis. For more
140
+ information, see [Language
141
+ support](https://cloud.ibm.com/docs/natural-language-understanding?topic=natural-language-understanding-language-support).
144
142
:param int limit_text_characters: (optional) Sets the maximum number of
145
143
characters that are processed by the service.
146
144
:param dict headers: A `dict` containing the request headers
@@ -872,9 +870,8 @@ class CategoriesResult():
872
870
A categorization of the analyzed text.
873
871
874
872
:attr str label: (optional) The path to the category through the 5-level
875
- taxonomy hierarchy. For the complete list of categories, see the [Categories
876
- hierarchy](https://cloud.ibm.com/docs/natural-language-understanding?topic=natural-language-understanding-categories#categories-hierarchy)
877
- documentation.
873
+ taxonomy hierarchy. For more information about the categories, see [Categories
874
+ hierarchy](https://cloud.ibm.com/docs/natural-language-understanding?topic=natural-language-understanding-categories#categories-hierarchy).
878
875
:attr float score: (optional) Confidence score for the category classification.
879
876
Higher values indicate greater confidence.
880
877
:attr CategoriesResultExplanation explanation: (optional) Information that helps
@@ -890,10 +887,9 @@ def __init__(self,
890
887
Initialize a CategoriesResult object.
891
888
892
889
:param str label: (optional) The path to the category through the 5-level
893
- taxonomy hierarchy. For the complete list of categories, see the
890
+ taxonomy hierarchy. For more information about the categories, see
894
891
[Categories
895
- hierarchy](https://cloud.ibm.com/docs/natural-language-understanding?topic=natural-language-understanding-categories#categories-hierarchy)
896
- documentation.
892
+ hierarchy](https://cloud.ibm.com/docs/natural-language-understanding?topic=natural-language-understanding-categories#categories-hierarchy).
897
893
:param float score: (optional) Confidence score for the category
898
894
classification. Higher values indicate greater confidence.
899
895
:param CategoriesResultExplanation explanation: (optional) Information that
@@ -1713,8 +1709,8 @@ def __ne__(self, other: 'EmotionScores') -> bool:
1713
1709
1714
1710
class EntitiesOptions ():
1715
1711
"""
1716
- Identifies people, cities, organizations, and other entities in the content. See
1717
- [Entity types and
1712
+ Identifies people, cities, organizations, and other entities in the content. For more
1713
+ information, see [Entity types and
1718
1714
subtypes](https://cloud.ibm.com/docs/natural-language-understanding?topic=natural-language-understanding-entity-types).
1719
1715
Supported languages: English, French, German, Italian, Japanese, Korean, Portuguese,
1720
1716
Russian, Spanish, Swedish. Arabic, Chinese, and Dutch are supported only through
@@ -2133,7 +2129,8 @@ class Features():
2133
2129
entities with `entities.emotion` and for keywords with `keywords.emotion`.
2134
2130
Supported languages: English.
2135
2131
:attr EntitiesOptions entities: (optional) Identifies people, cities,
2136
- organizations, and other entities in the content. See [Entity types and
2132
+ organizations, and other entities in the content. For more information, see
2133
+ [Entity types and
2137
2134
subtypes](https://cloud.ibm.com/docs/natural-language-understanding?topic=natural-language-understanding-entity-types).
2138
2135
Supported languages: English, French, German, Italian, Japanese, Korean,
2139
2136
Portuguese, Russian, Spanish, Swedish. Arabic, Chinese, and Dutch are supported
@@ -2147,8 +2144,8 @@ class Features():
2147
2144
and publication date. Supports URL and HTML input types only.
2148
2145
:attr RelationsOptions relations: (optional) Recognizes when two entities are
2149
2146
related and identifies the type of relation. For example, an `awardedTo`
2150
- relation might connect the entities "Nobel Prize" and "Albert Einstein". See
2151
- [Relation
2147
+ relation might connect the entities "Nobel Prize" and "Albert Einstein". For
2148
+ more information, see [Relation
2152
2149
types](https://cloud.ibm.com/docs/natural-language-understanding?topic=natural-language-understanding-relations).
2153
2150
Supported languages: Arabic, English, German, Japanese, Korean, Spanish.
2154
2151
Chinese, Dutch, French, Italian, and Portuguese custom models are also
@@ -2197,7 +2194,8 @@ def __init__(self,
2197
2194
`keywords.emotion`.
2198
2195
Supported languages: English.
2199
2196
:param EntitiesOptions entities: (optional) Identifies people, cities,
2200
- organizations, and other entities in the content. See [Entity types and
2197
+ organizations, and other entities in the content. For more information, see
2198
+ [Entity types and
2201
2199
subtypes](https://cloud.ibm.com/docs/natural-language-understanding?topic=natural-language-understanding-entity-types).
2202
2200
Supported languages: English, French, German, Italian, Japanese, Korean,
2203
2201
Portuguese, Russian, Spanish, Swedish. Arabic, Chinese, and Dutch are
@@ -2212,7 +2210,7 @@ def __init__(self,
2212
2210
:param RelationsOptions relations: (optional) Recognizes when two entities
2213
2211
are related and identifies the type of relation. For example, an
2214
2212
`awardedTo` relation might connect the entities "Nobel Prize" and "Albert
2215
- Einstein". See [Relation
2213
+ Einstein". For more information, see [Relation
2216
2214
types](https://cloud.ibm.com/docs/natural-language-understanding?topic=natural-language-understanding-relations).
2217
2215
Supported languages: Arabic, English, German, Japanese, Korean, Spanish.
2218
2216
Chinese, Dutch, French, Italian, and Portuguese custom models are also
@@ -2696,7 +2694,7 @@ class Model():
2696
2694
:attr str status: (optional) When the status is `available`, the model is ready
2697
2695
to use.
2698
2696
:attr str model_id: (optional) Unique model ID.
2699
- :attr str language: (optional) ISO 639-1 code indicating the language of the
2697
+ :attr str language: (optional) ISO 639-1 code that indicates the language of the
2700
2698
model.
2701
2699
:attr str description: (optional) Model description.
2702
2700
:attr str workspace_id: (optional) ID of the Watson Knowledge Studio workspace
@@ -2728,8 +2726,8 @@ def __init__(self,
2728
2726
:param str status: (optional) When the status is `available`, the model is
2729
2727
ready to use.
2730
2728
:param str model_id: (optional) Unique model ID.
2731
- :param str language: (optional) ISO 639-1 code indicating the language of
2732
- the model.
2729
+ :param str language: (optional) ISO 639-1 code that indicates the language
2730
+ of the model.
2733
2731
:param str description: (optional) Model description.
2734
2732
:param str workspace_id: (optional) ID of the Watson Knowledge Studio
2735
2733
workspace that deployed this model to Natural Language Understanding.
@@ -2833,6 +2831,17 @@ def __ne__(self, other: 'Model') -> bool:
2833
2831
"""Return `true` when self and other are not equal, false otherwise."""
2834
2832
return not self == other
2835
2833
2834
+ class StatusEnum (Enum ):
2835
+ """
2836
+ When the status is `available`, the model is ready to use.
2837
+ """
2838
+ STARTING = "starting"
2839
+ TRAINING = "training"
2840
+ DEPLOYING = "deploying"
2841
+ AVAILABLE = "available"
2842
+ ERROR = "error"
2843
+ DELETED = "deleted"
2844
+
2836
2845
2837
2846
class RelationArgument ():
2838
2847
"""
@@ -2988,7 +2997,7 @@ class RelationsOptions():
2988
2997
"""
2989
2998
Recognizes when two entities are related and identifies the type of relation. For
2990
2999
example, an `awardedTo` relation might connect the entities "Nobel Prize" and "Albert
2991
- Einstein". See [Relation
3000
+ Einstein". For more information, see [Relation
2992
3001
types](https://cloud.ibm.com/docs/natural-language-understanding?topic=natural-language-understanding-relations).
2993
3002
Supported languages: Arabic, English, German, Japanese, Korean, Spanish. Chinese,
2994
3003
Dutch, French, Italian, and Portuguese custom models are also supported.
@@ -4351,8 +4360,8 @@ class TokenResult():
4351
4360
TokenResult.
4352
4361
4353
4362
:attr str text: (optional) The token as it appears in the analyzed text.
4354
- :attr str part_of_speech: (optional) The part of speech of the token. For
4355
- descriptions of the values, see [Universal Dependencies POS
4363
+ :attr str part_of_speech: (optional) The part of speech of the token. For more
4364
+ information about the values, see [Universal Dependencies POS
4356
4365
tags](https://universaldependencies.org/u/pos/).
4357
4366
:attr List[int] location: (optional) Character offsets indicating the beginning
4358
4367
and end of the token in the analyzed text.
@@ -4371,7 +4380,7 @@ def __init__(self,
4371
4380
4372
4381
:param str text: (optional) The token as it appears in the analyzed text.
4373
4382
:param str part_of_speech: (optional) The part of speech of the token. For
4374
- descriptions of the values, see [Universal Dependencies POS
4383
+ more information about the values, see [Universal Dependencies POS
4375
4384
tags](https://universaldependencies.org/u/pos/).
4376
4385
:param List[int] location: (optional) Character offsets indicating the
4377
4386
beginning and end of the token in the analyzed text.
@@ -4441,8 +4450,8 @@ def __ne__(self, other: 'TokenResult') -> bool:
4441
4450
4442
4451
class PartOfSpeechEnum (Enum ):
4443
4452
"""
4444
- The part of speech of the token. For descriptions of the values, see [Universal
4445
- Dependencies POS tags](https://universaldependencies.org/u/pos/).
4453
+ The part of speech of the token. For more information about the values, see
4454
+ [Universal Dependencies POS tags](https://universaldependencies.org/u/pos/).
4446
4455
"""
4447
4456
ADJ = "ADJ"
4448
4457
ADP = "ADP"
0 commit comments