Skip to content

Commit 563200b

Browse files
authored
Merge pull request #678 from watson-developer-cloud/version-3.2
Release v3.2.0
2 parents 0892fd7 + 6d6b0c0 commit 563200b

File tree

9 files changed

+1539
-352
lines changed

9 files changed

+1539
-352
lines changed

examples/compare_comply_v1.py

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# coding: utf-8
2+
from __future__ import print_function
3+
import json
4+
import os
5+
from ibm_watson import CompareComplyV1
6+
7+
# If service instance provides API key authentication
8+
compare_comply = CompareComplyV1(
9+
version='2018-03-23',
10+
## url is optional, and defaults to the URL below. Use the correct URL for your region.
11+
url='https://gateway.watsonplatform.net/compare-comply/api',
12+
iam_apikey='YOUR APIKEY')
13+
14+
# compare_comply = CompareComplyV1(
15+
# version='2018-03-23',
16+
# ## url is optional, and defaults to the URL below. Use the correct URL for your region.
17+
# # url='https://gateway.watsonplatform.net/compare-comply/api',
18+
# username='YOUR SERVICE USERNAME',
19+
# password='YOUR SERVICE PASSWORD')
20+
21+
print('Convert to HTML')
22+
contract = os.path.abspath('resources/contract_A.pdf')
23+
with open(contract, 'rb') as file:
24+
result = compare_comply.convert_to_html(file).get_result()
25+
print(json.dumps(result, indent=2))
26+
27+
print('Classify elements')
28+
contract = os.path.abspath('resources/contract_A.pdf')
29+
with open(contract, 'rb') as file:
30+
result = compare_comply.classify_elements(file, 'application/pdf').get_result()
31+
print(json.dumps(result, indent=2))
32+
33+
print('Extract tables')
34+
table = os.path.abspath('resources/contract_A.pdf')
35+
with open(table, 'rb') as file:
36+
result = compare_comply.extract_tables(file).get_result()
37+
print(json.dumps(result, indent=2))

ibm_watson/assistant_v1.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,10 @@ def message(self,
145145
Get response to user input.
146146
147147
Send user input to a workspace and receive a response.
148+
**Note:** For most applications, there are significant advantages to using the v2
149+
runtime API instead. These advantages include ease of deployment, automatic state
150+
management, versioning, and search capabilities. For more information, see the
151+
[documentation](https://cloud.ibm.com/docs/services/assistant?topic=assistant-api-overview).
148152
There is no rate limit for this operation.
149153
150154
:param str workspace_id: Unique identifier of the workspace.
@@ -6773,9 +6777,9 @@ class RuntimeEntity(object):
67736777
:attr str entity: An entity detected in the input.
67746778
:attr list[int] location: An array of zero-based character offsets that indicate where
67756779
the detected entity values begin and end in the input text.
6776-
:attr str value: The term in the input text that was recognized as an entity value.
6780+
:attr str value: The entity value that was recognized in the user input.
67776781
:attr float confidence: (optional) A decimal percentage that represents Watson's
6778-
confidence in the entity.
6782+
confidence in the recognized entity.
67796783
:attr dict metadata: (optional) Any metadata for the entity.
67806784
:attr list[CaptureGroup] groups: (optional) The recognized capture groups for the
67816785
entity, as defined by the entity pattern.
@@ -6795,10 +6799,9 @@ def __init__(self,
67956799
:param str entity: An entity detected in the input.
67966800
:param list[int] location: An array of zero-based character offsets that indicate
67976801
where the detected entity values begin and end in the input text.
6798-
:param str value: The term in the input text that was recognized as an entity
6799-
value.
6802+
:param str value: The entity value that was recognized in the user input.
68006803
:param float confidence: (optional) A decimal percentage that represents Watson's
6801-
confidence in the entity.
6804+
confidence in the recognized entity.
68026805
:param dict metadata: (optional) Any metadata for the entity.
68036806
:param list[CaptureGroup] groups: (optional) The recognized capture groups for the
68046807
entity, as defined by the entity pattern.

0 commit comments

Comments
 (0)