Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions examples/assistant_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,8 @@
}
}).get_result()
print(json.dumps(message, indent=2))

# logs = assistant.list_logs(
# "<YOUR ASSISTANT ID>"
# )
# print(json.dumps(logs, indent=2))
141 changes: 11 additions & 130 deletions ibm_watson/assistant_v1.py

Large diffs are not rendered by default.

588 changes: 563 additions & 25 deletions ibm_watson/assistant_v2.py

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion ibm_watson/compare_comply_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
class CompareComplyV1(BaseService):
"""The Compare Comply V1 service."""

DEFAULT_SERVICE_URL = 'https://gateway.watsonplatform.net/compare-comply/api'
DEFAULT_SERVICE_URL = 'https://api.us-south.compare-comply.watson.cloud.ibm.com'
DEFAULT_SERVICE_NAME = 'compare_comply'

def __init__(
Expand Down
2 changes: 1 addition & 1 deletion ibm_watson/discovery_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
class DiscoveryV1(BaseService):
"""The Discovery V1 service."""

DEFAULT_SERVICE_URL = 'https://gateway.watsonplatform.net/discovery/api'
DEFAULT_SERVICE_URL = 'https://api.us-south.discovery.watson.cloud.ibm.com'
DEFAULT_SERVICE_NAME = 'discovery'

def __init__(
Expand Down
3,757 changes: 3,083 additions & 674 deletions ibm_watson/discovery_v2.py

Large diffs are not rendered by default.

429 changes: 376 additions & 53 deletions ibm_watson/language_translator_v3.py

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion ibm_watson/natural_language_classifier_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
class NaturalLanguageClassifierV1(BaseService):
"""The Natural Language Classifier V1 service."""

DEFAULT_SERVICE_URL = 'https://gateway.watsonplatform.net/natural-language-classifier/api'
DEFAULT_SERVICE_URL = 'https://api.us-south.natural-language-classifier.watson.cloud.ibm.com'
DEFAULT_SERVICE_NAME = 'natural_language_classifier'

def __init__(
Expand Down
71 changes: 40 additions & 31 deletions ibm_watson/natural_language_understanding_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
class NaturalLanguageUnderstandingV1(BaseService):
"""The Natural Language Understanding V1 service."""

DEFAULT_SERVICE_URL = 'https://gateway.watsonplatform.net/natural-language-understanding/api'
DEFAULT_SERVICE_URL = 'https://api.us-south.natural-language-understanding.watson.cloud.ibm.com'
DEFAULT_SERVICE_NAME = 'natural-language-understanding'

def __init__(
Expand Down Expand Up @@ -110,7 +110,7 @@ def analyze(self,
- Relations
- Semantic roles
- Sentiment
- Syntax (Experimental).
- Syntax.
If a language for the input text is not specified with the `language` parameter,
the service [automatically detects the
language](https://cloud.ibm.com/docs/natural-language-understanding?topic=natural-language-understanding-detectable-languages).
Expand All @@ -123,9 +123,8 @@ def analyze(self,
:param str url: (optional) The webpage to analyze. One of the `text`,
`html`, or `url` parameters is required.
:param bool clean: (optional) Set this to `false` to disable webpage
cleaning. To learn more about webpage cleaning, see the [Analyzing
webpages](https://cloud.ibm.com/docs/natural-language-understanding?topic=natural-language-understanding-analyzing-webpages)
documentation.
cleaning. For more information about webpage cleaning, see [Analyzing
webpages](https://cloud.ibm.com/docs/natural-language-understanding?topic=natural-language-understanding-analyzing-webpages).
:param str xpath: (optional) An [XPath
query](https://cloud.ibm.com/docs/natural-language-understanding?topic=natural-language-understanding-analyzing-webpages#xpath)
to perform on `html` or `url` input. Results of the query will be appended
Expand All @@ -137,10 +136,9 @@ def analyze(self,
analyzed text.
:param str language: (optional) ISO 639-1 code that specifies the language
of your text. This overrides automatic language detection. Language support
differs depending on the features you include in your analysis. See
[Language
support](https://cloud.ibm.com/docs/natural-language-understanding?topic=natural-language-understanding-language-support)
for more information.
differs depending on the features you include in your analysis. For more
information, see [Language
support](https://cloud.ibm.com/docs/natural-language-understanding?topic=natural-language-understanding-language-support).
:param int limit_text_characters: (optional) Sets the maximum number of
characters that are processed by the service.
:param dict headers: A `dict` containing the request headers
Expand Down Expand Up @@ -872,9 +870,8 @@ class CategoriesResult():
A categorization of the analyzed text.

:attr str label: (optional) The path to the category through the 5-level
taxonomy hierarchy. For the complete list of categories, see the [Categories
hierarchy](https://cloud.ibm.com/docs/natural-language-understanding?topic=natural-language-understanding-categories#categories-hierarchy)
documentation.
taxonomy hierarchy. For more information about the categories, see [Categories
hierarchy](https://cloud.ibm.com/docs/natural-language-understanding?topic=natural-language-understanding-categories#categories-hierarchy).
:attr float score: (optional) Confidence score for the category classification.
Higher values indicate greater confidence.
:attr CategoriesResultExplanation explanation: (optional) Information that helps
Expand All @@ -890,10 +887,9 @@ def __init__(self,
Initialize a CategoriesResult object.

:param str label: (optional) The path to the category through the 5-level
taxonomy hierarchy. For the complete list of categories, see the
taxonomy hierarchy. For more information about the categories, see
[Categories
hierarchy](https://cloud.ibm.com/docs/natural-language-understanding?topic=natural-language-understanding-categories#categories-hierarchy)
documentation.
hierarchy](https://cloud.ibm.com/docs/natural-language-understanding?topic=natural-language-understanding-categories#categories-hierarchy).
:param float score: (optional) Confidence score for the category
classification. Higher values indicate greater confidence.
:param CategoriesResultExplanation explanation: (optional) Information that
Expand Down Expand Up @@ -1713,8 +1709,8 @@ def __ne__(self, other: 'EmotionScores') -> bool:

class EntitiesOptions():
"""
Identifies people, cities, organizations, and other entities in the content. See
[Entity types and
Identifies people, cities, organizations, and other entities in the content. For more
information, see [Entity types and
subtypes](https://cloud.ibm.com/docs/natural-language-understanding?topic=natural-language-understanding-entity-types).
Supported languages: English, French, German, Italian, Japanese, Korean, Portuguese,
Russian, Spanish, Swedish. Arabic, Chinese, and Dutch are supported only through
Expand Down Expand Up @@ -2133,7 +2129,8 @@ class Features():
entities with `entities.emotion` and for keywords with `keywords.emotion`.
Supported languages: English.
:attr EntitiesOptions entities: (optional) Identifies people, cities,
organizations, and other entities in the content. See [Entity types and
organizations, and other entities in the content. For more information, see
[Entity types and
subtypes](https://cloud.ibm.com/docs/natural-language-understanding?topic=natural-language-understanding-entity-types).
Supported languages: English, French, German, Italian, Japanese, Korean,
Portuguese, Russian, Spanish, Swedish. Arabic, Chinese, and Dutch are supported
Expand All @@ -2147,8 +2144,8 @@ class Features():
and publication date. Supports URL and HTML input types only.
:attr RelationsOptions relations: (optional) Recognizes when two entities are
related and identifies the type of relation. For example, an `awardedTo`
relation might connect the entities "Nobel Prize" and "Albert Einstein". See
[Relation
relation might connect the entities "Nobel Prize" and "Albert Einstein". For
more information, see [Relation
types](https://cloud.ibm.com/docs/natural-language-understanding?topic=natural-language-understanding-relations).
Supported languages: Arabic, English, German, Japanese, Korean, Spanish.
Chinese, Dutch, French, Italian, and Portuguese custom models are also
Expand Down Expand Up @@ -2197,7 +2194,8 @@ def __init__(self,
`keywords.emotion`.
Supported languages: English.
:param EntitiesOptions entities: (optional) Identifies people, cities,
organizations, and other entities in the content. See [Entity types and
organizations, and other entities in the content. For more information, see
[Entity types and
subtypes](https://cloud.ibm.com/docs/natural-language-understanding?topic=natural-language-understanding-entity-types).
Supported languages: English, French, German, Italian, Japanese, Korean,
Portuguese, Russian, Spanish, Swedish. Arabic, Chinese, and Dutch are
Expand All @@ -2212,7 +2210,7 @@ def __init__(self,
:param RelationsOptions relations: (optional) Recognizes when two entities
are related and identifies the type of relation. For example, an
`awardedTo` relation might connect the entities "Nobel Prize" and "Albert
Einstein". See [Relation
Einstein". For more information, see [Relation
types](https://cloud.ibm.com/docs/natural-language-understanding?topic=natural-language-understanding-relations).
Supported languages: Arabic, English, German, Japanese, Korean, Spanish.
Chinese, Dutch, French, Italian, and Portuguese custom models are also
Expand Down Expand Up @@ -2696,7 +2694,7 @@ class Model():
:attr str status: (optional) When the status is `available`, the model is ready
to use.
:attr str model_id: (optional) Unique model ID.
:attr str language: (optional) ISO 639-1 code indicating the language of the
:attr str language: (optional) ISO 639-1 code that indicates the language of the
model.
:attr str description: (optional) Model description.
:attr str workspace_id: (optional) ID of the Watson Knowledge Studio workspace
Expand Down Expand Up @@ -2728,8 +2726,8 @@ def __init__(self,
:param str status: (optional) When the status is `available`, the model is
ready to use.
:param str model_id: (optional) Unique model ID.
:param str language: (optional) ISO 639-1 code indicating the language of
the model.
:param str language: (optional) ISO 639-1 code that indicates the language
of the model.
:param str description: (optional) Model description.
:param str workspace_id: (optional) ID of the Watson Knowledge Studio
workspace that deployed this model to Natural Language Understanding.
Expand Down Expand Up @@ -2833,6 +2831,17 @@ def __ne__(self, other: 'Model') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other

class StatusEnum(Enum):
"""
When the status is `available`, the model is ready to use.
"""
STARTING = "starting"
TRAINING = "training"
DEPLOYING = "deploying"
AVAILABLE = "available"
ERROR = "error"
DELETED = "deleted"


class RelationArgument():
"""
Expand Down Expand Up @@ -2988,7 +2997,7 @@ class RelationsOptions():
"""
Recognizes when two entities are related and identifies the type of relation. For
example, an `awardedTo` relation might connect the entities "Nobel Prize" and "Albert
Einstein". See [Relation
Einstein". For more information, see [Relation
types](https://cloud.ibm.com/docs/natural-language-understanding?topic=natural-language-understanding-relations).
Supported languages: Arabic, English, German, Japanese, Korean, Spanish. Chinese,
Dutch, French, Italian, and Portuguese custom models are also supported.
Expand Down Expand Up @@ -4351,8 +4360,8 @@ class TokenResult():
TokenResult.

:attr str text: (optional) The token as it appears in the analyzed text.
:attr str part_of_speech: (optional) The part of speech of the token. For
descriptions of the values, see [Universal Dependencies POS
:attr str part_of_speech: (optional) The part of speech of the token. For more
information about the values, see [Universal Dependencies POS
tags](https://universaldependencies.org/u/pos/).
:attr List[int] location: (optional) Character offsets indicating the beginning
and end of the token in the analyzed text.
Expand All @@ -4371,7 +4380,7 @@ def __init__(self,

:param str text: (optional) The token as it appears in the analyzed text.
:param str part_of_speech: (optional) The part of speech of the token. For
descriptions of the values, see [Universal Dependencies POS
more information about the values, see [Universal Dependencies POS
tags](https://universaldependencies.org/u/pos/).
:param List[int] location: (optional) Character offsets indicating the
beginning and end of the token in the analyzed text.
Expand Down Expand Up @@ -4441,8 +4450,8 @@ def __ne__(self, other: 'TokenResult') -> bool:

class PartOfSpeechEnum(Enum):
"""
The part of speech of the token. For descriptions of the values, see [Universal
Dependencies POS tags](https://universaldependencies.org/u/pos/).
The part of speech of the token. For more information about the values, see
[Universal Dependencies POS tags](https://universaldependencies.org/u/pos/).
"""
ADJ = "ADJ"
ADP = "ADP"
Expand Down
2 changes: 1 addition & 1 deletion ibm_watson/personality_insights_v3.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
class PersonalityInsightsV3(BaseService):
"""The Personality Insights V3 service."""

DEFAULT_SERVICE_URL = 'https://gateway.watsonplatform.net/personality-insights/api'
DEFAULT_SERVICE_URL = 'https://api.us-south.personality-insights.watson.cloud.ibm.com'
DEFAULT_SERVICE_NAME = 'personality_insights'

def __init__(
Expand Down
Loading