Options
All
  • Public
  • Public/Protected
  • All
Menu

Class CompareComplyV1

IBM Watson™ Compare and Comply is discontinued. Existing instances are supported until 30 November 2021, but as of 1 December 2020, you can't create instances. Any instance that exists on 30 November 2021 will be deleted. Consider migrating to Watson Discovery Premium on IBM Cloud for your Compare and Comply use cases. To start the migration process, visit https://ibm.biz/contact-wdc-premium. {: deprecated} interfaces

Compare and Comply analyzes governing documents to provide details about critical aspects of the documents.

API Version: 1.0 See: https://cloud.ibm.com/docs/compare-comply?topic=compare-comply-about

Hierarchy

  • BaseService
    • CompareComplyV1

Index

Constructors

constructor

  • Construct a CompareComplyV1 object.

    Parameters

    Name Type Attribute Description
    options UserOptions

    Options for the service.

    Returns CompareComplyV1

Properties

version

version: string

Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is 2018-10-15.

Static DEFAULT_SERVICE_NAME

DEFAULT_SERVICE_NAME: string = "compare-comply"

Static DEFAULT_SERVICE_URL

DEFAULT_SERVICE_URL: string = "https://api.us-south.compare-comply.watson.cloud.ibm.com"

Methods

addFeedback

  • Add feedback.

    Adds feedback in the form of labels from a subject-matter expert (SME) to a governing document. Important: Feedback is not immediately incorporated into the training model, nor is it guaranteed to be incorporated at a later date. Instead, submitted feedback is used to suggest future updates to the training model.

    Parameters

    Name Type Attribute Description
    params AddFeedbackParams

    The parameters to send to the service.

    Properties

    Name Type Attributes Description
    feedbackData FeedbackDataInput Feedback data for submission.
    comment string Optional An optional comment on or description of the feedback.
    headers OutgoingHttpHeaders Optional
    userId string Optional An optional string identifying the user.

    Returns Promise<Response<FeedbackReturn>>

classifyElements

  • Classify the elements of a document.

    Analyzes the structural and semantic elements of a document.

    Parameters

    Name Type Attribute Description
    params ClassifyElementsParams

    The parameters to send to the service.

    Properties

    Name Type Attributes Description
    file ReadableStream | Buffer The document to classify.
    fileContentType FileContentType | string Optional The content type of file.
    headers OutgoingHttpHeaders Optional
    model Model | string Optional The analysis model to be used by the service. For the **Element classification** and **Compare two documents** methods, the default is `contracts`. For the **Extract tables** method, the default is `tables`. These defaults apply to the standalone methods as well as to the methods' use in batch-processing requests.

    Returns Promise<Response<ClassifyReturn>>

compareDocuments

  • Compare two documents.

    Compares two input documents. Documents must be in the same format.

    Parameters

    Name Type Attribute Description
    params CompareDocumentsParams

    The parameters to send to the service.

    Properties

    Name Type Attributes Description
    file1 ReadableStream | Buffer The first document to compare.
    file2 ReadableStream | Buffer The second document to compare.
    file1ContentType File1ContentType | string Optional The content type of file1.
    file1Label string Optional A text label for the first document.
    file2ContentType File2ContentType | string Optional The content type of file2.
    file2Label string Optional A text label for the second document.
    headers OutgoingHttpHeaders Optional
    model Model | string Optional The analysis model to be used by the service. For the **Element classification** and **Compare two documents** methods, the default is `contracts`. For the **Extract tables** method, the default is `tables`. These defaults apply to the standalone methods as well as to the methods' use in batch-processing requests.

    Returns Promise<Response<CompareReturn>>

convertToHtml

  • Convert document to HTML.

    Converts a document to HTML.

    Parameters

    Name Type Attribute Description
    params ConvertToHtmlParams

    The parameters to send to the service.

    Properties

    Name Type Attributes Description
    file ReadableStream | Buffer The document to convert.
    fileContentType FileContentType | string Optional The content type of file.
    headers OutgoingHttpHeaders Optional
    model Model | string Optional The analysis model to be used by the service. For the **Element classification** and **Compare two documents** methods, the default is `contracts`. For the **Extract tables** method, the default is `tables`. These defaults apply to the standalone methods as well as to the methods' use in batch-processing requests.

    Returns Promise<Response<HTMLReturn>>

createBatch

  • Submit a batch-processing request.

    Run Compare and Comply methods over a collection of input documents.

    Important: Batch processing requires the use of the IBM Cloud Object Storage service. The use of IBM Cloud Object Storage with Compare and Comply is discussed at Using batch processing.

    Parameters

    Name Type Attribute Description
    params CreateBatchParams

    The parameters to send to the service.

    Properties

    Name Type Attributes Description
    _function Function | string The Compare and Comply method to run across the submitted input documents.
    inputBucketLocation string The geographical location of the Cloud Object Storage input bucket as listed on the **Endpoint** tab of your Cloud Object Storage instance; for example, `us-geo`, `eu-geo`, or `ap-geo`.
    inputBucketName string The name of the Cloud Object Storage input bucket.
    inputCredentialsFile ReadableStream | Buffer A JSON file containing the input Cloud Object Storage credentials. At a minimum, the credentials must enable `READ` permissions on the bucket defined by the `input_bucket_name` parameter.
    outputBucketLocation string The geographical location of the Cloud Object Storage output bucket as listed on the **Endpoint** tab of your Cloud Object Storage instance; for example, `us-geo`, `eu-geo`, or `ap-geo`.
    outputBucketName string The name of the Cloud Object Storage output bucket.
    outputCredentialsFile ReadableStream | Buffer A JSON file that lists the Cloud Object Storage output credentials. At a minimum, the credentials must enable `READ` and `WRITE` permissions on the bucket defined by the `output_bucket_name` parameter.
    headers OutgoingHttpHeaders Optional
    model Model | string Optional The analysis model to be used by the service. For the **Element classification** and **Compare two documents** methods, the default is `contracts`. For the **Extract tables** method, the default is `tables`. These defaults apply to the standalone methods as well as to the methods' use in batch-processing requests.

    Returns Promise<Response<BatchStatus>>

deleteFeedback

  • Delete a specified feedback entry.

    Deletes a feedback entry with a specified feedback_id.

    Parameters

    Name Type Attribute Description
    params DeleteFeedbackParams

    The parameters to send to the service.

    Properties

    Name Type Attributes Description
    feedbackId string A string that specifies the feedback entry to be deleted from the document.
    headers OutgoingHttpHeaders Optional
    model Model | string Optional The analysis model to be used by the service. For the **Element classification** and **Compare two documents** methods, the default is `contracts`. For the **Extract tables** method, the default is `tables`. These defaults apply to the standalone methods as well as to the methods' use in batch-processing requests.

    Returns Promise<Response<FeedbackDeleted>>

disableRetries

  • disableRetries(): void
  • Disables retries.

    Returns void

enableRetries

  • enableRetries(retryOptions?: RetryOptions): void
  • Enable retries for unfulfilled requests.

    Parameters

    Name Type Attribute Description
    retryOptions RetryOptions Optional

    configuration for retries

    Returns void

extractTables

  • Extract a document's tables.

    Analyzes the tables in a document.

    Parameters

    Name Type Attribute Description
    params ExtractTablesParams

    The parameters to send to the service.

    Properties

    Name Type Attributes Description
    file ReadableStream | Buffer The document on which to run table extraction.
    fileContentType FileContentType | string Optional The content type of file.
    headers OutgoingHttpHeaders Optional
    model Model | string Optional The analysis model to be used by the service. For the **Element classification** and **Compare two documents** methods, the default is `contracts`. For the **Extract tables** method, the default is `tables`. These defaults apply to the standalone methods as well as to the methods' use in batch-processing requests.

    Returns Promise<Response<TableReturn>>

getAuthenticator

  • getAuthenticator(): any
  • Get the instance of the authenticator set on the service.

    Returns any

getBatch

  • Get information about a specific batch-processing job.

    Gets information about a batch-processing job with a specified ID.

    Parameters

    Name Type Attribute Description
    params GetBatchParams

    The parameters to send to the service.

    Properties

    Name Type Attributes Description
    batchId string The ID of the batch-processing job whose information you want to retrieve.
    headers OutgoingHttpHeaders Optional

    Returns Promise<Response<BatchStatus>>

getFeedback

  • Get a specified feedback entry.

    Gets a feedback entry with a specified feedback_id.

    Parameters

    Name Type Attribute Description
    params GetFeedbackParams

    The parameters to send to the service.

    Properties

    Name Type Attributes Description
    feedbackId string A string that specifies the feedback entry to be included in the output.
    headers OutgoingHttpHeaders Optional
    model Model | string Optional The analysis model to be used by the service. For the **Element classification** and **Compare two documents** methods, the default is `contracts`. For the **Extract tables** method, the default is `tables`. These defaults apply to the standalone methods as well as to the methods' use in batch-processing requests.

    Returns Promise<Response<GetFeedback>>

getHttpClient

  • getHttpClient(): AxiosInstance
  • Get the Axios instance set on the service. All requests will be made using this instance.

    Returns AxiosInstance

listBatches

  • List submitted batch-processing jobs.

    Lists batch-processing jobs submitted by users.

    Parameters

    Name Type Attribute Description
    params ListBatchesParams Optional

    Properties

    Name Type Attributes Description
    headers OutgoingHttpHeaders Optional

    Returns Promise<Response<Batches>>

listFeedback

  • List the feedback in a document.

    Lists the feedback in a document.

    Parameters

    Name Type Attribute Description
    params ListFeedbackParams Optional

    Properties

    Name Type Attributes Description
    categoryAdded string Optional An optional string in the form of a comma-separated list of categories. If this is specified, the service filters the output to include only feedback that has at least one category from the list added.
    categoryNotChanged string Optional An optional string in the form of a comma-separated list of categories. If this is specified, the service filters the output to include only feedback that has at least one category from the list unchanged.
    categoryRemoved string Optional An optional string in the form of a comma-separated list of categories. If it is specified, the service filters the output to include only feedback that has at least one category from the list removed.
    cursor string Optional An optional string that returns the set of documents after the previous set. Use this parameter with the `page_limit` parameter.
    documentTitle string Optional An optional string that filters the output to include only feedback from the document with the specified `document_title`.
    feedbackType string Optional An optional string that filters the output to include only feedback with the specified feedback type. The only permitted value is `element_classification`.
    headers OutgoingHttpHeaders Optional
    includeTotal boolean Optional An optional boolean value. If specified as `true`, the `pagination` object in the output includes a value called `total` that gives the total count of feedback created.
    modelId string Optional An optional string that filters the output to include only feedback with the specified `model_id`. The only permitted value is `contracts`.
    modelVersion string Optional An optional string that filters the output to include only feedback with the specified `model_version`.
    pageLimit number Optional An optional integer specifying the number of documents that you want the service to return.
    sort string Optional An optional comma-separated list of fields in the document to sort on. You can optionally specify the sort direction by prefixing the value of the field with `-` for descending order or `+` for ascending order (the default). Currently permitted sorting fields are `created`, `user_id`, and `document_title`.
    typeAdded string Optional An optional string of comma-separated `nature`:`party` pairs. If this is specified, the service filters the output to include only feedback that has at least one `nature`:`party` pair from the list removed.
    typeNotChanged string Optional An optional string of comma-separated `nature`:`party` pairs. If this is specified, the service filters the output to include only feedback that has at least one `nature`:`party` pair from the list unchanged.
    typeRemoved string Optional An optional string of comma-separated `nature`:`party` pairs. If this is specified, the service filters the output to include only feedback that has at least one `nature`:`party` pair from the list removed.

    Returns Promise<Response<FeedbackList>>

setEnableGzipCompression

  • setEnableGzipCompression(setting: boolean): void
  • Turn request body compression on or off.

    Parameters

    Name Type Attribute Description
    setting boolean

    Will turn it on if 'true', off if 'false'.

    Returns void

setServiceUrl

  • setServiceUrl(url: string): void
  • Set the service URL to send requests to.

    Parameters

    Name Type Attribute Description
    url string

    The base URL for the service.

    Returns void

updateBatch

  • Update a pending or active batch-processing job.

    Updates a pending or active batch-processing job. You can rescan the input bucket to check for new documents or cancel a job.

    Parameters

    Name Type Attribute Description
    params UpdateBatchParams

    The parameters to send to the service.

    Properties

    Name Type Attributes Description
    action Action | string The action you want to perform on the specified batch-processing job.
    batchId string The ID of the batch-processing job you want to update.
    headers OutgoingHttpHeaders Optional
    model Model | string Optional The analysis model to be used by the service. For the **Element classification** and **Compare two documents** methods, the default is `contracts`. For the **Extract tables** method, the default is `tables`. These defaults apply to the standalone methods as well as to the methods' use in batch-processing requests.

    Returns Promise<Response<BatchStatus>>

Generated using TypeDoc