watson_developer_cloud.compare_comply_v1 module¶
IBM Watson™ Compare and Comply analyzes governing documents to provide details about critical aspects of the documents.
-
class
Address
(text=None, location=None)[source]¶ Bases:
object
A party’s address.
- Attr str text
(optional) A string listing the address.
- Attr Location location
(optional) The numeric location of the identified element in
the document, represented with two integers labeled begin and end.
-
class
AlignedElement
(element_pair=None, identical_text=None, significant_elements=None, provenance_ids=None)[source]¶ Bases:
object
AlignedElement.
- Attr list[ElementPair] element_pair
(optional) Identifies two elements that
semantically align between the compared documents. :attr bool identical_text: (optional) Specifies whether the text is identical. :attr bool significant_elements: (optional) Indicates that the elements aligned are contractual clauses of significance. :attr list[str] provenance_ids: (optional) One or more hashed values that you can send to IBM to provide feedback or receive support.
-
class
Attribute
(type=None, text=None, location=None)[source]¶ Bases:
object
List of document attributes.
- Attr str type
(optional) The type of attribute.
- Attr str text
(optional) The text associated with the attribute.
- Attr Location location
(optional) The numeric location of the identified element in
the document, represented with two integers labeled begin and end.
-
class
BatchStatus
(function=None, input_bucket_location=None, input_bucket_name=None, output_bucket_location=None, output_bucket_name=None, batch_id=None, document_counts=None, status=None, created=None, updated=None)[source]¶ Bases:
object
The batch-request status.
- Attr str function
(optional) The method to be run against the documents. Possible
values are html_conversion, element_classification, and tables. :attr str input_bucket_location: (optional) The geographical location of the Cloud Object Storage input bucket as listed on the Endpoint tab of your COS instance; for example, us-geo, eu-geo, or ap-geo. :attr str input_bucket_name: (optional) The name of the Cloud Object Storage input bucket. :attr str output_bucket_location: (optional) The geographical location of the Cloud Object Storage output bucket as listed on the Endpoint tab of your COS instance; for example, us-geo, eu-geo, or ap-geo. :attr str output_bucket_name: (optional) The name of the Cloud Object Storage output bucket. :attr str batch_id: (optional) The unique identifier for the batch request. :attr DocCounts document_counts: (optional) Document counts. :attr str status: (optional) The status of the batch request. :attr datetime created: (optional) The creation time of the batch request. :attr datetime updated: (optional) The time of the most recent update to the batch request.
-
class
Batches
(batches=None)[source]¶ Bases:
object
The results of a successful GET /v1/batches request.
- Attr list[BatchStatus] batches
(optional) A list of the status of all batch
requests.
-
class
BodyCells
(cell_id=None, location=None, text=None, row_index_begin=None, row_index_end=None, column_index_begin=None, column_index_end=None, row_header_ids=None, row_header_texts=None, row_header_texts_normalized=None, column_header_ids=None, column_header_texts=None, column_header_texts_normalized=None, attributes=None)[source]¶ Bases:
object
Cells that are not table header, column header, or row header cells.
- Attr str cell_id
(optional) A string value in the format columnHeader-x-y, where
x and y are the begin and end offsets of this column header cell in the input document. :attr Location location: (optional) The numeric location of the identified element in the document, represented with two integers labeled begin and end. :attr str text: (optional) The textual contents of this cell from the input document without associated markup content. :attr int row_index_begin: (optional) The begin index of this cell’s row location in the current table. :attr int row_index_end: (optional) The end index of this cell’s row location in the current table. :attr int column_index_begin: (optional) The begin index of this cell’s column location in the current table. :attr int column_index_end: (optional) The end index of this cell’s column location in the current table. :attr list[str] row_header_ids: (optional) An array of values, each being the id value of a row header that is applicable to this body cell. :attr list[str] row_header_texts: (optional) An array of values, each being the text value of a row header that is applicable to this body cell. :attr list[str] row_header_texts_normalized: (optional) If you provide customization input, the normalized version of the row header texts according to the customization; otherwise, the same value as row_header_texts. :attr list[str] column_header_ids: (optional) An array of values, each being the id value of a column header that is applicable to the current cell. :attr list[str] column_header_texts: (optional) An array of values, each being the text value of a column header that is applicable to the current cell. :attr list[str] column_header_texts_normalized: (optional) If you provide customization input, the normalized version of the column header texts according to the customization; otherwise, the same value as column_header_texts. :attr list[Attribute] attributes: (optional)
-
class
Category
(label=None, provenance_ids=None)[source]¶ Bases:
object
Information defining an element’s subject matter.
- Attr str label
(optional) The category of the associated element.
- Attr list[str] provenance_ids
(optional) One or more hashed values that you can send
to IBM to provide feedback or receive support.
-
class
ClassifyReturn
(document=None, model_id=None, model_version=None, elements=None, tables=None, document_structure=None, parties=None, effective_dates=None, contract_amounts=None, termination_dates=None)[source]¶ Bases:
object
The analysis of objects returned by the /v1/element_classification method.
- Attr Document document
(optional) Basic information about the input document.
- Attr str model_id
(optional) The analysis model used to classify the input document.
For the /v1/element_classification method, the only valid value is contracts. :attr str model_version: (optional) The version of the analysis model identified by the value of the model_id key. :attr list[Element] elements: (optional) Document elements identified by the service. :attr list[Tables] tables: (optional) Definition of tables identified in the input document. :attr DocStructure document_structure: (optional) The structure of the input document. :attr list[Parties] parties: (optional) Definitions of the parties identified in the input document. :attr list[EffectiveDates] effective_dates: (optional) The effective dates of the input document. :attr list[ContractAmts] contract_amounts: (optional) The monetary amounts identified in the input document. :attr list[TerminationDates] termination_dates: (optional) The input document’s termination dates.
-
class
ColumnHeaders
(cell_id=None, location=None, text=None, text_normalized=None, row_index_begin=None, row_index_end=None, column_index_begin=None, column_index_end=None)[source]¶ Bases:
object
Column-level cells, each applicable as a header to other cells in the same column as itself, of the current table.
- Attr str cell_id
(optional) A string value in the format columnHeader-x-y, where
x and y are the begin and end offsets of this column header cell in the input document. :attr object location: (optional) The location of the column header cell in the current table as defined by its begin and end offsets, respectfully, in the input document. :attr str text: (optional) The textual contents of this cell from the input document without associated markup content. :attr str text_normalized: (optional) If you provide customization input, the normalized version of the cell text according to the customization; otherwise, the same value as text. :attr int row_index_begin: (optional) The begin index of this cell’s row location in the current table. :attr int row_index_end: (optional) The end index of this cell’s row location in the current table. :attr int column_index_begin: (optional) The begin index of this cell’s column location in the current table. :attr int column_index_end: (optional) The end index of this cell’s column location in the current table.
-
class
CompareReturn
(documents=None, aligned_elements=None, unaligned_elements=None, model_id=None, model_version=None)[source]¶ Bases:
object
The comparison of the two submitted documents.
- Attr list[Document] documents
(optional) Information about the documents being
compared. :attr list[AlignedElement] aligned_elements: (optional) A list of pairs of elements that semantically align between the compared documents. :attr list[UnalignedElement] unaligned_elements: (optional) A list of elements that do not semantically align between the compared documents. :attr str model_id: (optional) The analysis model used to classify the input document. For the /v1/element_classification method, the only valid value is contracts. :attr str model_version: (optional) The version of the analysis model identified by the value of the model_id key.
-
class
Contact
(name=None, role=None)[source]¶ Bases:
object
A contact.
- Attr str name
(optional) A string listing the name of the contact.
- Attr str role
(optional) A string listing the role of the contact.
-
class
ContractAmts
(text=None, confidence_level=None, location=None)[source]¶ Bases:
object
A monetary amount identified in the input document.
- Attr str text
(optional) The monetary amount.
- Attr str confidence_level
(optional) The confidence level in the identification of
the contract amount. :attr Location location: (optional) The numeric location of the identified element in the document, represented with two integers labeled begin and end.
-
class
DocCounts
(total=None, pending=None, successful=None, failed=None)[source]¶ Bases:
object
Document counts.
- Attr int total
(optional) Total number of documents.
- Attr int pending
(optional) Number of pending documents.
- Attr int successful
(optional) Number of documents successfully processed.
- Attr int failed
(optional) Number of documents not successfully processed.
-
class
DocInfo
(html=None, title=None, hash=None)[source]¶ Bases:
object
Information about the parsed input document.
- Attr str html
(optional) The full text of the parsed document in HTML format.
- Attr str title
(optional) The title of the parsed document. If the service did not
detect a title, the value of this element is null. :attr str hash: (optional) The MD5 hash of the input document.
-
class
DocStructure
(section_titles=None, leading_sentences=None)[source]¶ Bases:
object
The structure of the input document.
- Attr list[SectionTitles] section_titles
(optional) An array containing one object
per section or subsection identified in the input document. :attr list[LeadingSentence] leading_sentences: (optional) An array containing one object per section or subsection, in parallel with the section_titles array, that details the leading sentences in the corresponding section or subsection.
-
class
Document
(title=None, html=None, hash=None, label=None)[source]¶ Bases:
object
Basic information about the input document.
- Attr str title
(optional) Document title, if detected.
- Attr str html
(optional) The input document converted into HTML format.
- Attr str hash
(optional) The MD5 hash value of the input document.
- Attr str label
(optional) The label applied to the input document with the calling
method’s file_1_label or file_2_label value. This field is specified only in the output of the Comparing two documents method.
-
class
EffectiveDates
(text=None, confidence_level=None, location=None)[source]¶ Bases:
object
An effective date.
- Attr str text
(optional) The effective date, listed as a string.
- Attr str confidence_level
(optional) The confidence level in the identification of
the effective date. :attr Location location: (optional) The numeric location of the identified element in the document, represented with two integers labeled begin and end.
-
class
Element
(location=None, text=None, types=None, categories=None, attributes=None)[source]¶ Bases:
object
A component part of the document.
- Attr Location location
(optional) The numeric location of the identified element in
the document, represented with two integers labeled begin and end. :attr str text: (optional) The text of the element. :attr list[TypeLabel] types: (optional) Description of the action specified by the element and whom it affects. :attr list[Category] categories: (optional) List of functional categories into which the element falls; in other words, the subject matter of the element. :attr list[Attribute] attributes: (optional) List of document attributes.
-
class
ElementLocations
(begin=None, end=None)[source]¶ Bases:
object
A list of begin and end indexes that indicate the locations of the elements in the input document.
- Attr int begin
(optional) An integer that indicates the starting position of the
element in the input document. :attr int end: (optional) An integer that indicates the ending position of the element in the input document.
-
class
ElementPair
(document_label=None, text=None, location=None, types=None, categories=None, attributes=None)[source]¶ Bases:
object
Details of semantically aligned elements.
- Attr str document_label
(optional) The label of the document (that is, the value of
either the file_1_label or file_2_label parameters) in which the element occurs. :attr str text: (optional) The text of the element. :attr Location location: (optional) The numeric location of the identified element in the document, represented with two integers labeled begin and end. :attr list[TypeLabel] types: (optional) Description of the action specified by the element and whom it affects. :attr list[Category] categories: (optional) List of functional categories into which the element falls; in other words, the subject matter of the element. :attr list[Attribute] attributes: (optional) List of document attributes.
-
class
FeedbackDataInput
(feedback_type, location, text, original_labels, updated_labels, document=None, model_id=None, model_version=None)[source]¶ Bases:
object
Feedback data for submission.
- Attr str feedback_type
The type of feedback. The only permitted value is
element_classification. :attr ShortDoc document: (optional) Brief information about the input document. :attr str model_id: (optional) An optional string identifying the model ID. The only permitted value is contracts. :attr str model_version: (optional) An optional string identifying the version of the model used. :attr Location location: The numeric location of the identified element in the document, represented with two integers labeled begin and end. :attr str text: The text on which to submit feedback. :attr OriginalLabelsIn original_labels: The original labeling from the input document, without the submitted feedback. :attr UpdatedLabelsIn updated_labels: The updated labeling from the input document, accounting for the submitted feedback.
-
class
FeedbackDataOutput
(feedback_type=None, document=None, model_id=None, model_version=None, location=None, text=None, original_labels=None, updated_labels=None, pagination=None)[source]¶ Bases:
object
Information returned from the POST /v1/feedback method.
- Attr str feedback_type
(optional) A string identifying the user adding the feedback.
The only permitted value is element_classification. :attr ShortDoc document: (optional) Brief information about the input document. :attr str model_id: (optional) An optional string identifying the model ID. The only permitted value is contracts. :attr str model_version: (optional) An optional string identifying the version of the model used. :attr Location location: (optional) The numeric location of the identified element in the document, represented with two integers labeled begin and end. :attr str text: (optional) The text to which the feedback applies. :attr OriginalLabelsOut original_labels: (optional) The original labeling from the input document, without the submitted feedback. :attr UpdatedLabelsOut updated_labels: (optional) The updated labeling from the input document, accounting for the submitted feedback. :attr Pagination pagination: (optional) Pagination details, if required by the length of the output.
-
class
FeedbackDeleted
(status=None, message=None)[source]¶ Bases:
object
The status and message of the deletion request.
- Attr int status
(optional) HTTP return code.
- Attr str message
(optional) Status message returned from the service.
-
class
FeedbackList
(feedback=None)[source]¶ Bases:
object
The results of a successful GET /v1/feedback request.
- Attr list[GetFeedback] feedback
(optional) A list of all feedback for the document.
-
class
FeedbackReturn
(feedback_id=None, user_id=None, comment=None, created=None, feedback_data=None)[source]¶ Bases:
object
Information about the document and the submitted feedback.
- Attr str feedback_id
(optional) The unique ID of the feedback object.
- Attr str user_id
(optional) An optional string identifying the person submitting
feedback. :attr str comment: (optional) An optional comment from the person submitting the feedback. :attr datetime created: (optional) Timestamp listing the creation time of the feedback submission. :attr FeedbackDataOutput feedback_data: (optional) Information returned from the POST /v1/feedback method.
-
class
GetFeedback
(feedback_id=None, created=None, comment=None, feedback_data=None)[source]¶ Bases:
object
The results of a single feedback query.
- Attr str feedback_id
(optional) A string uniquely identifying the feedback entry.
- Attr datetime created
(optional) A timestamp identifying the creation time of the
feedback entry. :attr str comment: (optional) A string containing the user’s comment about the feedback entry. :attr FeedbackDataOutput feedback_data: (optional) Information returned from the POST /v1/feedback method.
-
class
HTMLReturn
(num_pages=None, author=None, publication_date=None, title=None, html=None)[source]¶ Bases:
object
The HTML converted from an input document.
- Attr str num_pages
(optional) The number of pages in the input document.
- Attr str author
(optional) The author of the input document, if identified.
- Attr str publication_date
(optional) The publication date of the input document, if
identified. :attr str title: (optional) The title of the input document, if identified. :attr str html: (optional) The HTML version of the input document.
-
class
Label
(nature, party)[source]¶ Bases:
object
A pair of nature and party objects. The nature object identifies the effect of the element on the identified party, and the party object identifies the affected party.
- Attr str nature
The identified nature of the element.
- Attr str party
The identified party of the element.
-
class
LeadingSentence
(text=None, location=None, element_locations=None)[source]¶ Bases:
object
The leading sentences in a section or subsection of the input document.
- Attr str text
(optional) The text of the leading sentence.
- Attr Location location
(optional) The numeric location of the identified element in
the document, represented with two integers labeled begin and end. :attr list[ElementLocations] element_locations: (optional) An array of location objects that lists the locations of detected leading sentences.
-
class
Location
(begin, end)[source]¶ Bases:
object
The numeric location of the identified element in the document, represented with two integers labeled begin and end.
- Attr int begin
The element’s begin index.
- Attr int end
The element’s end index.
-
class
OriginalLabelsIn
(types, categories)[source]¶ Bases:
object
The original labeling from the input document, without the submitted feedback.
- Attr list[TypeLabel] types
Description of the action specified by the element and
whom it affects. :attr list[Category] categories: List of functional categories into which the element falls; in other words, the subject matter of the element.
-
class
OriginalLabelsOut
(types=None, categories=None, modification=None)[source]¶ Bases:
object
The original labeling from the input document, without the submitted feedback.
- Attr list[TypeLabel] types
(optional) Description of the action specified by the
element and whom it affects. :attr list[Category] categories: (optional) List of functional categories into which the element falls; in other words, the subject matter of the element. :attr str modification: (optional) A string identifying the type of modification the feedback entry in the updated_labels array. Possible values are added, not_changed, and removed.
-
class
Pagination
(refresh_cursor=None, next_cursor=None, refresh_url=None, next_url=None, total=None)[source]¶ Bases:
object
Pagination details, if required by the length of the output.
- Attr str refresh_cursor
(optional) A token identifying the current page of results.
- Attr str next_cursor
(optional) A token identifying the next page of results.
- Attr str refresh_url
(optional) The URL that returns the current page of results.
- Attr str next_url
(optional) The URL that returns the next page of results.
- Attr int total
(optional) Reserved for future use.
-
class
Parties
(party=None, importance=None, role=None, addresses=None, contacts=None)[source]¶ Bases:
object
A party and its corresponding role, including address and contact information if identified.
- Attr str party
(optional) A string identifying the party.
- Attr str importance
(optional) A string that identifies the importance of the party.
- Attr str role
(optional) A string identifying the party’s role.
- Attr list[Address] addresses
(optional) List of the party’s address or addresses.
- Attr list[Contact] contacts
(optional) List of the names and roles of contacts
identified in the input document.
-
class
RowHeaders
(cell_id=None, location=None, text=None, text_normalized=None, row_index_begin=None, row_index_end=None, column_index_begin=None, column_index_end=None)[source]¶ Bases:
object
Row-level cells, each applicable as a header to other cells in the same row as itself, of the current table.
- Attr str cell_id
(optional) A string value in the format rowHeader-x-y, where x
and y are the begin and end offsets of this row header cell in the input document. :attr Location location: (optional) The numeric location of the identified element in the document, represented with two integers labeled begin and end. :attr str text: (optional) The textual contents of this cell from the input document without associated markup content. :attr str text_normalized: (optional) If you provide customization input, the normalized version of the cell text according to the customization; otherwise, the same value as text. :attr int row_index_begin: (optional) The begin index of this cell’s row location in the current table. :attr int row_index_end: (optional) The end index of this cell’s row location in the current table. :attr int column_index_begin: (optional) The begin index of this cell’s column location in the current table. :attr int column_index_end: (optional) The end index of this cell’s column location in the current table.
-
class
SectionTitle
(text=None, location=None)[source]¶ Bases:
object
The table’s section title, if identified.
- Attr str text
(optional) The text of the section title, if identified.
- Attr Location location
(optional) The numeric location of the identified element in
the document, represented with two integers labeled begin and end.
-
class
SectionTitles
(text=None, location=None, level=None, element_locations=None)[source]¶ Bases:
object
An array containing one object per section or subsection detected in the input document. Sections and subsections are not nested; instead, they are flattened out and can be placed back in order by using the begin and end values of the element and the level value of the section.
- Attr str text
(optional) The text of the section title, if identified.
- Attr Location location
(optional) The numeric location of the identified element in
the document, represented with two integers labeled begin and end. :attr int level: (optional) An integer indicating the level at which the section is located in the input document. For example, 1 represents a top-level section, 2 represents a subsection within the level 1 section, and so forth. :attr list[ElementLocations] element_locations: (optional) An array of location objects that lists the locations of detected section titles.
-
class
ShortDoc
(title=None, hash=None)[source]¶ Bases:
object
Brief information about the input document.
- Attr str title
(optional) The title of the input document, if identified.
- Attr str hash
(optional) The MD5 hash of the input document.
-
class
TableHeaders
(cell_id=None, location=None, text=None, row_index_begin=None, row_index_end=None, column_index_begin=None, column_index_end=None)[source]¶ Bases:
object
The contents of the current table’s header.
- Attr str cell_id
(optional) String value in the format tableHeader-x-y where x
and y are the begin and end offsets, respectfully, of the cell value in the input document. :attr object location: (optional) The location of the table header cell in the current table as defined by its begin and end offsets, respectfully, in the input document. :attr str text: (optional) The textual contents of the cell from the input document without associated markup content. :attr int row_index_begin: (optional) The begin index of this cell’s row location in the current table. :attr int row_index_end: (optional) The end index of this cell’s row location in the current table. :attr int column_index_begin: (optional) The begin index of this cell’s column location in the current table. :attr int column_index_end: (optional) The end index of this cell’s column location in the current table.
-
class
TableReturn
(document=None, model_id=None, model_version=None, tables=None)[source]¶ Bases:
object
The analysis of the document’s tables.
- Attr DocInfo document
(optional) Information about the parsed input document.
- Attr str model_id
(optional) The ID of the model used to extract the table contents.
The value for table extraction is tables. :attr str model_version: (optional) The version of the tables model ID. :attr list[Tables] tables: (optional) Definitions of the tables identified in the input document.
-
class
Tables
(location=None, text=None, section_title=None, table_headers=None, row_headers=None, column_headers=None, body_cells=None)[source]¶ Bases:
object
The contents of the tables extracted from a document.
- Attr Location location
(optional) The numeric location of the identified element in
the document, represented with two integers labeled begin and end. :attr str text: (optional) The textual contents of the current table from the input document without associated markup content. :attr SectionTitle section_title: (optional) The table’s section title, if identified. :attr list[TableHeaders] table_headers: (optional) An array of table-level cells that apply as headers to all the other cells in the current table. :attr list[RowHeaders] row_headers: (optional) An array of row-level cells, each applicable as a header to other cells in the same row as itself, of the current table. :attr list[ColumnHeaders] column_headers: (optional) An array of column-level cells, each applicable as a header to other cells in the same column as itself, of the current table. :attr list[BodyCells] body_cells: (optional) An array of cells that are neither table header nor column header nor row header cells, of the current table with corresponding row and column header associations.
-
class
TerminationDates
(text=None, confidence_level=None, location=None)[source]¶ Bases:
object
Termination dates identified in the input document.
- Attr str text
(optional) The termination date.
- Attr str confidence_level
(optional) The confidence level in the identification of
the termination date. :attr Location location: (optional) The numeric location of the identified element in the document, represented with two integers labeled begin and end.
-
class
TypeLabel
(label=None, provenance_ids=None)[source]¶ Bases:
object
Identification of a specific type.
- Attr Label label
(optional) A pair of nature and party objects. The nature
object identifies the effect of the element on the identified party, and the party object identifies the affected party. :attr list[str] provenance_ids: (optional) One or more hash values that you can send to IBM to provide feedback or receive support.
-
class
UnalignedElement
(document_label=None, location=None, text=None, types=None, categories=None, attributes=None)[source]¶ Bases:
object
Element that does not align semantically between two compared documents.
- Attr str document_label
(optional) The label assigned to the document by the value
of the file_1_label or file_2_label parameters on the /v1/compare method. :attr Location location: (optional) The numeric location of the identified element in the document, represented with two integers labeled begin and end. :attr str text: (optional) The text of the element. :attr list[TypeLabel] types: (optional) Description of the action specified by the element and whom it affects. :attr list[Category] categories: (optional) List of functional categories into which the element falls; in other words, the subject matter of the element. :attr list[Attribute] attributes: (optional) List of document attributes.
-
class
UpdatedLabelsIn
(types, categories)[source]¶ Bases:
object
The updated labeling from the input document, accounting for the submitted feedback.
- Attr list[TypeLabel] types
Description of the action specified by the element and
whom it affects. :attr list[Category] categories: List of functional categories into which the element falls; in other words, the subject matter of the element.
-
class
UpdatedLabelsOut
(types=None, categories=None, modification=None)[source]¶ Bases:
object
The updated labeling from the input document, accounting for the submitted feedback.
- Attr list[TypeLabel] types
(optional) Description of the action specified by the
element and whom it affects. :attr list[Category] categories: (optional) List of functional categories into which the element falls; in other words, the subject matter of the element. :attr str modification: (optional) The type of modification the feedback entry in the updated_labels array. Possible values are added, not_changed, and removed.