Skip to content

Commit

Permalink
Merge pull request #678 from watson-developer-cloud/version-3.2
Browse files Browse the repository at this point in the history
Release v3.2.0
  • Loading branch information
ehdsouza authored Jul 24, 2019
2 parents 0892fd7 + 6d6b0c0 commit 563200b
Show file tree
Hide file tree
Showing 9 changed files with 1,539 additions and 352 deletions.
37 changes: 37 additions & 0 deletions examples/compare_comply_v1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# coding: utf-8
from __future__ import print_function
import json
import os
from ibm_watson import CompareComplyV1

# If service instance provides API key authentication
compare_comply = CompareComplyV1(
version='2018-03-23',
## url is optional, and defaults to the URL below. Use the correct URL for your region.
url='https://gateway.watsonplatform.net/compare-comply/api',
iam_apikey='YOUR APIKEY')

# compare_comply = CompareComplyV1(
# version='2018-03-23',
# ## url is optional, and defaults to the URL below. Use the correct URL for your region.
# # url='https://gateway.watsonplatform.net/compare-comply/api',
# username='YOUR SERVICE USERNAME',
# password='YOUR SERVICE PASSWORD')

print('Convert to HTML')
contract = os.path.abspath('resources/contract_A.pdf')
with open(contract, 'rb') as file:
result = compare_comply.convert_to_html(file).get_result()
print(json.dumps(result, indent=2))

print('Classify elements')
contract = os.path.abspath('resources/contract_A.pdf')
with open(contract, 'rb') as file:
result = compare_comply.classify_elements(file, 'application/pdf').get_result()
print(json.dumps(result, indent=2))

print('Extract tables')
table = os.path.abspath('resources/contract_A.pdf')
with open(table, 'rb') as file:
result = compare_comply.extract_tables(file).get_result()
print(json.dumps(result, indent=2))
13 changes: 8 additions & 5 deletions ibm_watson/assistant_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ def message(self,
Get response to user input.
Send user input to a workspace and receive a response.
**Note:** For most applications, there are significant advantages to using the v2
runtime API instead. These advantages include ease of deployment, automatic state
management, versioning, and search capabilities. For more information, see the
[documentation](https://cloud.ibm.com/docs/services/assistant?topic=assistant-api-overview).
There is no rate limit for this operation.
:param str workspace_id: Unique identifier of the workspace.
Expand Down Expand Up @@ -6773,9 +6777,9 @@ class RuntimeEntity(object):
:attr str entity: An entity detected in the input.
:attr list[int] location: An array of zero-based character offsets that indicate where
the detected entity values begin and end in the input text.
:attr str value: The term in the input text that was recognized as an entity value.
:attr str value: The entity value that was recognized in the user input.
:attr float confidence: (optional) A decimal percentage that represents Watson's
confidence in the entity.
confidence in the recognized entity.
:attr dict metadata: (optional) Any metadata for the entity.
:attr list[CaptureGroup] groups: (optional) The recognized capture groups for the
entity, as defined by the entity pattern.
Expand All @@ -6795,10 +6799,9 @@ def __init__(self,
:param str entity: An entity detected in the input.
:param list[int] location: An array of zero-based character offsets that indicate
where the detected entity values begin and end in the input text.
:param str value: The term in the input text that was recognized as an entity
value.
:param str value: The entity value that was recognized in the user input.
:param float confidence: (optional) A decimal percentage that represents Watson's
confidence in the entity.
confidence in the recognized entity.
:param dict metadata: (optional) Any metadata for the entity.
:param list[CaptureGroup] groups: (optional) The recognized capture groups for the
entity, as defined by the entity pattern.
Expand Down
Loading

0 comments on commit 563200b

Please sign in to comment.