watson_developer_cloud.discovery_v1 module

The IBM Watson™ Discovery Service is a cognitive search and content analytics engine that you can add to applications to identify patterns, trends and actionable insights to drive better decision-making. Securely unify structured and unstructured data with pre-enriched content, and use a simplified query language to eliminate the need for manual filtering of results.

class AggregationResult(key=None, matching_results=None, aggregations=None)[source]

Bases: object

AggregationResult.

Attr str key

(optional) Key that matched the aggregation type.

Attr int matching_results

(optional) Number of matching results.

Attr list[QueryAggregation] aggregations

(optional) Aggregations returned in the

case of chained aggregations.

class Collection(collection_id=None, name=None, description=None, created=None, updated=None, status=None, configuration_id=None, language=None, document_counts=None, disk_usage=None, training_status=None, source_crawl=None)[source]

Bases: object

A collection for storing documents.

Attr str collection_id

(optional) The unique identifier of the collection.

Attr str name

(optional) The name of the collection.

Attr str description

(optional) The description of the collection.

Attr datetime created

(optional) The creation date of the collection in the format

yyyy-MM-dd’T’HH:mmcon:ss.SSS’Z’. :attr datetime updated: (optional) The timestamp of when the collection was last updated in the format yyyy-MM-dd’T’HH:mm:ss.SSS’Z’. :attr str status: (optional) The status of the collection. :attr str configuration_id: (optional) The unique identifier of the collection’s configuration. :attr str language: (optional) The language of the documents stored in the collection. Permitted values include en (English), de (German), and es (Spanish). :attr DocumentCounts document_counts: (optional) The object providing information about the documents in the collection. Present only when retrieving details of a collection. :attr CollectionDiskUsage disk_usage: (optional) Summary of the disk usage statistics for this collection. :attr TrainingStatus training_status: (optional) Provides information about the status of relevance training for collection. :attr SourceStatus source_crawl: (optional) Object containing source crawl status information.

class CollectionDiskUsage(used_bytes=None)[source]

Bases: object

Summary of the disk usage statistics for this collection.

Attr int used_bytes

(optional) Number of bytes used by the collection.

class CollectionUsage(available=None, maximum_allowed=None)[source]

Bases: object

Summary of the collection usage in the environment.

Attr int available

(optional) Number of active collections in the environment.

Attr int maximum_allowed

(optional) Total number of collections allowed in the

environment.

class Configuration(name, configuration_id=None, created=None, updated=None, description=None, conversions=None, enrichments=None, normalizations=None, source=None)[source]

Bases: object

A custom configuration for the environment.

Attr str configuration_id

(optional) The unique identifier of the configuration.

Attr str name

The name of the configuration.

Attr datetime created

(optional) The creation date of the configuration in the

format yyyy-MM-dd’T’HH:mm:ss.SSS’Z’. :attr datetime updated: (optional) The timestamp of when the configuration was last updated in the format yyyy-MM-dd’T’HH:mm:ss.SSS’Z’. :attr str description: (optional) The description of the configuration, if available. :attr Conversions conversions: (optional) Document conversion settings. :attr list[Enrichment] enrichments: (optional) An array of document enrichment settings for the configuration. :attr list[NormalizationOperation] normalizations: (optional) Defines operations that can be used to transform the final output JSON into a normalized form. Operations are executed in the order that they appear in the array. :attr Source source: (optional) Object containing source parameters for the configuration.

class Conversions(pdf=None, word=None, html=None, segment=None, json_normalizations=None)[source]

Bases: object

Document conversion settings.

Attr PdfSettings pdf

(optional) A list of PDF conversion settings.

Attr WordSettings word

(optional) A list of Word conversion settings.

Attr HtmlSettings html

(optional) A list of HTML conversion settings.

Attr SegmentSettings segment

(optional) A list of Document Segmentation settings.

Attr list[NormalizationOperation] json_normalizations

(optional) Defines operations

that can be used to transform the final output JSON into a normalized form. Operations are executed in the order that they appear in the array.

class CreateEventResponse(type=None, data=None)[source]

Bases: object

An object defining the event being created.

Attr str type

(optional) The event type that was created.

Attr EventData data

(optional) Query event data object.

class CredentialDetails(credential_type=None, client_id=None, enterprise_id=None, url=None, username=None, organization_url=None, site_collection_path=None, client_secret=None, public_key_id=None, private_key=None, passphrase=None, password=None, gateway_id=None, source_version=None, web_application_url=None, domain=None)[source]

Bases: object

Object containing details of the stored credentials. Obtain credentials for your source from the administrator of the source.

Attr str credential_type

(optional) The authentication method for this credentials

definition. The credential_type specified must be supported by the source_type. The following combinations are possible: - “source_type”: “box” - valid credential_type`s: `oauth2 - “source_type”: “salesforce” - valid credential_type`s: `username_password - “source_type”: “sharepoint” - valid credential_type`s: `saml with source_version of online, or ntml_v1 with source_version of 2016 - “source_type”: “web_crawl” - valid credential_type`s: `noauth or basic. :attr str client_id: (optional) The client_id of the source that these credentials connect to. Only valid, and required, with a credential_type of oauth2. :attr str enterprise_id: (optional) The enterprise_id of the Box site that these credentials connect to. Only valid, and required, with a source_type of box. :attr str url: (optional) The url of the source that these credentials connect to. Only valid, and required, with a credential_type of username_password, noauth, and basic. :attr str username: (optional) The username of the source that these credentials connect to. Only valid, and required, with a credential_type of saml, username_password, basic, or ntml_v1. :attr str organization_url: (optional) The organization_url of the source that these credentials connect to. Only valid, and required, with a credential_type of saml. :attr str site_collection_path: (optional) The site_collection.path of the source that these credentials connect to. Only valid, and required, with a source_type of sharepoint. :attr str client_secret: (optional) The client_secret of the source that these credentials connect to. Only valid, and required, with a credential_type of oauth2. This value is never returned and is only used when creating or modifying credentials. :attr str public_key_id: (optional) The public_key_id of the source that these credentials connect to. Only valid, and required, with a credential_type of oauth2. This value is never returned and is only used when creating or modifying credentials. :attr str private_key: (optional) The private_key of the source that these credentials connect to. Only valid, and required, with a credential_type of oauth2. This value is never returned and is only used when creating or modifying credentials. :attr str passphrase: (optional) The passphrase of the source that these credentials connect to. Only valid, and required, with a credential_type of oauth2. This value is never returned and is only used when creating or modifying credentials. :attr str password: (optional) The password of the source that these credentials connect to. Only valid, and required, with credential_type**s of `saml`, `username_password`, `basic`, or `ntml_v1`. **Note: When used with a source_type of salesforce, the password consists of the Salesforce password and a valid Salesforce security token concatenated. This value is never returned and is only used when creating or modifying credentials. :attr str gateway_id: (optional) The ID of the gateway to be connected through (when connecting to intranet sites). Only valid with a credential_type of noauth, basic, or ntml_v1. Gateways are created using the /v1/environments/{environment_id}/gateways methods. :attr str source_version: (optional) The type of Sharepoint repository to connect to. Only valid, and required, with a source_type of sharepoint. :attr str web_application_url: (optional) SharePoint OnPrem WebApplication URL. Only valid, and required, with a source_version of 2016. :attr str domain: (optional) The domain used to log in to your OnPrem SharePoint account. Only valid, and required, with a source_version of 2016.

class Credentials(credential_id=None, source_type=None, credential_details=None)[source]

Bases: object

Object containing credential information.

Attr str credential_id

(optional) Unique identifier for this set of credentials.

Attr str source_type

(optional) The source that this credentials object connects to.

  • box indicates the credentials are used to connect an instance of Enterprise Box.

  • salesforce indicates the credentials are used to connect to Salesforce.

  • sharepoint indicates the credentials are used to connect to Microsoft SharePoint

Online. - web_crawl indicates the credentials are used to perform a web crawl. :attr CredentialDetails credential_details: (optional) Object containing details of the stored credentials. Obtain credentials for your source from the administrator of the source.

class CredentialsList(credentials=None)[source]

Bases: object

CredentialsList.

Attr list[Credentials] credentials

(optional) An array of credential definitions

that were created for this instance.

class DeleteCollectionResponse(collection_id, status)[source]

Bases: object

DeleteCollectionResponse.

Attr str collection_id

The unique identifier of the collection that is being

deleted. :attr str status: The status of the collection. The status of a successful deletion operation is deleted.

class DeleteConfigurationResponse(configuration_id, status, notices=None)[source]

Bases: object

DeleteConfigurationResponse.

Attr str configuration_id

The unique identifier for the configuration.

Attr str status

Status of the configuration. A deleted configuration has the status

deleted. :attr list[Notice] notices: (optional) An array of notice messages, if any.

class DeleteCredentials(credential_id=None, status=None)[source]

Bases: object

Object returned after credentials are deleted.

Attr str credential_id

(optional) The unique identifier of the credentials that have

been deleted. :attr str status: (optional) The status of the deletion request.

class DeleteDocumentResponse(document_id=None, status=None)[source]

Bases: object

DeleteDocumentResponse.

Attr str document_id

(optional) The unique identifier of the document.

Attr str status

(optional) Status of the document. A deleted document has the status

deleted.

class DeleteEnvironmentResponse(environment_id, status)[source]

Bases: object

DeleteEnvironmentResponse.

Attr str environment_id

The unique identifier for the environment.

Attr str status

Status of the environment.

class DiskUsage(used_bytes=None, maximum_allowed_bytes=None, total_bytes=None, used=None, total=None, percent_used=None)[source]

Bases: object

Summary of the disk usage statistics for the environment.

Attr int used_bytes

(optional) Number of bytes within the environment’s disk

capacity that are currently used to store data. :attr int maximum_allowed_bytes: (optional) Total number of bytes available in the environment’s disk capacity. :attr int total_bytes: (optional) Deprecated: Total number of bytes available in the environment’s disk capacity. :attr str used: (optional) Deprecated: Amount of disk capacity used, in KB or GB format. :attr str total: (optional) Deprecated: Total amount of the environment’s disk capacity, in KB or GB format. :attr float percent_used: (optional) Deprecated: Percentage of the environment’s disk capacity that is being used.

class DocumentAccepted(document_id=None, status=None, notices=None)[source]

Bases: object

DocumentAccepted.

Attr str document_id

(optional) The unique identifier of the ingested document.

Attr str status

(optional) Status of the document in the ingestion process. A status

of processing is returned for documents that are ingested with a version date before 2019-01-01. The pending status is returned for all others. :attr list[Notice] notices: (optional) Array of notices produced by the document-ingestion process.

class DocumentCounts(available=None, processing=None, failed=None, pending=None)[source]

Bases: object

DocumentCounts.

Attr int available

(optional) The total number of available documents in the

collection. :attr int processing: (optional) The number of documents in the collection that are currently being processed. :attr int failed: (optional) The number of documents in the collection that failed to be ingested. :attr int pending: (optional) The number of documents that have been uploaded to the collection, but have not yet started processing.

class DocumentSnapshot(step=None, snapshot=None)[source]

Bases: object

DocumentSnapshot.

Attr str step

(optional)

Attr object snapshot

(optional)

class DocumentStatus(document_id, status, status_description, notices, configuration_id=None, created=None, updated=None, filename=None, file_type=None, sha1=None)[source]

Bases: object

Status information about a submitted document.

Attr str document_id

The unique identifier of the document.

Attr str configuration_id

(optional) The unique identifier for the configuration.

Attr datetime created

(optional) The creation date of the document in the format

yyyy-MM-dd’T’HH:mm:ss.SSS’Z’. :attr datetime updated: (optional) Date of the most recent document update, in the format yyyy-MM-dd’T’HH:mm:ss.SSS’Z’. :attr str status: Status of the document in the ingestion process. :attr str status_description: Description of the document status. :attr str filename: (optional) Name of the original source file (if available). :attr str file_type: (optional) The type of the original source file. :attr str sha1: (optional) The SHA-1 hash of the original source file (formatted as a hexadecimal string). :attr list[Notice] notices: Array of notices produced by the document-ingestion process.

class Enrichment(destination_field, source_field, enrichment_name, description=None, overwrite=None, ignore_downstream_errors=None, options=None)[source]

Bases: object

Enrichment.

Attr str description

(optional) Describes what the enrichment step does.

Attr str destination_field

Field where enrichments will be stored. This field must

already exist or be at most 1 level deeper than an existing field. For example, if text is a top-level field with no sub-fields, text.foo is a valid destination but text.foo.bar is not. :attr str source_field: Field to be enriched. :attr bool overwrite: (optional) Indicates that the enrichments will overwrite the destination_field field if it already exists. :attr str enrichment_name: Name of the enrichment service to call. Current options are natural_language_understanding and elements.

When using natual_language_understanding, the options object must contain

Natural Language Understanding options.

When using elements the options object must contain Element Classification

options. Additionally, when using the elements enrichment the configuration specified and files ingested must meet all the criteria specified in [the documentation](https://console.bluemix.net/docs/services/discovery/element-classification.html)

Previous API versions also supported alchemy_language.

Attr bool ignore_downstream_errors

(optional) If true, then most errors generated

during the enrichment process will be treated as warnings and will not cause the document to fail processing. :attr EnrichmentOptions options: (optional) Options which are specific to a particular enrichment.

class EnrichmentOptions(features=None, language=None, model=None)[source]

Bases: object

Options which are specific to a particular enrichment.

Attr NluEnrichmentFeatures features

(optional) An object representing the enrichment

features that will be applied to the specified field. :attr str language: (optional) ISO 639-1 code indicating the language to use for the analysis. This code overrides the automatic language detection performed by the service. Valid codes are ar (Arabic), en (English), fr (French), de (German), it (Italian), pt (Portuguese), ru (Russian), es (Spanish), and sv (Swedish). Note: Not all features support all languages, automatic detection is recommended. :attr str model: (optional) For use with `elements` enrichments only. The element extraction model to use. Models available are: contract.

class Environment(environment_id=None, name=None, description=None, created=None, updated=None, status=None, read_only=None, size=None, requested_size=None, index_capacity=None, search_status=None)[source]

Bases: object

Details about an environment.

Attr str environment_id

(optional) Unique identifier for the environment.

Attr str name

(optional) Name that identifies the environment.

Attr str description

(optional) Description of the environment.

Attr datetime created

(optional) Creation date of the environment, in the format

yyyy-MM-dd’T’HH:mm:ss.SSS’Z’. :attr datetime updated: (optional) Date of most recent environment update, in the format yyyy-MM-dd’T’HH:mm:ss.SSS’Z’. :attr str status: (optional) Current status of the environment. resizing is displayed when a request to increase the environment size has been made, but is still in the process of being completed. :attr bool read_only: (optional) If true, the environment contains read-only collections that are maintained by IBM. :attr str size: (optional) Current size of the environment. :attr str requested_size: (optional) The new size requested for this environment. Only returned when the environment status is resizing. Note: Querying and indexing can still be performed during an environment upsize. :attr IndexCapacity index_capacity: (optional) Details about the resource usage and capacity of the environment. :attr SearchStatus search_status: (optional) Information about the Continuous Relevancy Training for this environment.

class EnvironmentDocuments(indexed=None, maximum_allowed=None)[source]

Bases: object

Summary of the document usage statistics for the environment.

Attr int indexed

(optional) Number of documents indexed for the environment.

Attr int maximum_allowed

(optional) Total number of documents allowed in the

environment’s capacity.

class EventData(environment_id, session_token, collection_id, document_id, client_timestamp=None, display_rank=None, query_id=None)[source]

Bases: object

Query event data object.

Attr str environment_id

The environment_id associated with the query that the

event is associated with. :attr str session_token: The session token that was returned as part of the query results that this event is associated with. :attr datetime client_timestamp: (optional) The optional timestamp for the event that was created. If not provided, the time that the event was created in the log was used. :attr int display_rank: (optional) The rank of the result item which the event is associated with. :attr str collection_id: The collection_id of the document that this event is associated with. :attr str document_id: The document_id of the document that this event is associated with. :attr str query_id: (optional) The query identifier stored in the log. The query and any events associated with that query are stored with the same query_id.

class Expansion(expanded_terms, input_terms=None)[source]

Bases: object

An expansion definition. Each object respresents one set of expandable strings. For example, you could have expansions for the word hot in one object, and expansions for the word cold in another.

Attr list[str] input_terms

(optional) A list of terms that will be expanded for this

expansion. If specified, only the items in this list are expanded. :attr list[str] expanded_terms: A list of terms that this expansion will be expanded to. If specified without input_terms, it also functions as the input term list.

class Expansions(expansions)[source]

Bases: object

The query expansion definitions for the specified collection.

Attr list[Expansion] expansions

An array of query expansion definitions. Each object in the expansions array represents a term or set of terms that will

be expanded into other terms. Each expansion object can be configured as bidirectional or unidirectional. Bidirectional means that all terms are expanded to all other terms in the object. Unidirectional means that a set list of terms can be expanded into a second list of terms.

To create a bi-directional expansion specify an expanded_terms array. When found

in a query, all items in the expanded_terms array are then expanded to the other items in the same array.

To create a uni-directional expansion, specify both an array of input_terms and

an array of expanded_terms. When items in the input_terms array are present in a query, they are expanded using the items listed in the expanded_terms array.

class Field(field_name=None, field_type=None)[source]

Bases: object

Field.

Attr str field_name

(optional) The name of the field.

Attr str field_type

(optional) The type of the field.

class FontSetting(level=None, min_size=None, max_size=None, bold=None, italic=None, name=None)[source]

Bases: object

FontSetting.

Attr int level

(optional)

Attr int min_size

(optional)

Attr int max_size

(optional)

Attr bool bold

(optional)

Attr bool italic

(optional)

Attr str name

(optional)

class Gateway(gateway_id=None, name=None, status=None, token=None, token_id=None)[source]

Bases: object

Object describing a specific gateway.

Attr str gateway_id

(optional) The gateway ID of the gateway.

Attr str name

(optional) The user defined name of the gateway.

Attr str status

(optional) The current status of the gateway. connected means the

gateway is connected to the remotly installed gateway. idle means this gateway is not currently in use. :attr str token: (optional) The generated token for this gateway. The value of this field is used when configuring the remotly installed gateway. :attr str token_id: (optional) The generated token_id for this gateway. The value of this field is used when configuring the remotly installed gateway.

class GatewayDelete(gateway_id=None, status=None)[source]

Bases: object

Gatway deletion confirmation.

Attr str gateway_id

(optional) The gateway ID of the deleted gateway.

Attr str status

(optional) The status of the request.

class GatewayList(gateways=None)[source]

Bases: object

Object containing gateways array.

Attr list[Gateway] gateways

(optional) Array of configured gateway connections.

class HtmlSettings(exclude_tags_completely=None, exclude_tags_keep_content=None, keep_content=None, exclude_content=None, keep_tag_attributes=None, exclude_tag_attributes=None)[source]

Bases: object

A list of HTML conversion settings.

Attr list[str] exclude_tags_completely

(optional)

Attr list[str] exclude_tags_keep_content

(optional)

Attr XPathPatterns keep_content

(optional)

Attr XPathPatterns exclude_content

(optional)

Attr list[str] keep_tag_attributes

(optional)

Attr list[str] exclude_tag_attributes

(optional)

class IndexCapacity(documents=None, disk_usage=None, collections=None, memory_usage=None)[source]

Bases: object

Details about the resource usage and capacity of the environment.

Attr EnvironmentDocuments documents

(optional) Summary of the document usage

statistics for the environment. :attr DiskUsage disk_usage: (optional) Summary of the disk usage statistics for the environment. :attr CollectionUsage collections: (optional) Summary of the collection usage in the environment. :attr MemoryUsage memory_usage: (optional) Deprecated: Summary of the memory usage statistics for this environment.

class ListCollectionFieldsResponse(fields=None)[source]

Bases: object

The list of fetched fields. The fields are returned using a fully qualified name format, however, the format differs slightly from that used by the query operations.

  • Fields which contain nested JSON objects are assigned a type of “nested”.

  • Fields which belong to a nested object are prefixed with .properties (for

example, warnings.properties.severity means that the warnings object has a property called severity).

  • Fields returned from the News collection are prefixed with

v{N}-fullnews-t3-{YEAR}.mappings (for example, v5-fullnews-t3-2016.mappings.text.properties.author).

Attr list[Field] fields

(optional) An array containing information about each field

in the collections.

class ListCollectionsResponse(collections=None)[source]

Bases: object

ListCollectionsResponse.

Attr list[Collection] collections

(optional) An array containing information about

each collection in the environment.

class ListConfigurationsResponse(configurations=None)[source]

Bases: object

ListConfigurationsResponse.

Attr list[Configuration] configurations

(optional) An array of Configurations that

are available for the service instance.

class ListEnvironmentsResponse(environments=None)[source]

Bases: object

ListEnvironmentsResponse.

Attr list[Environment] environments

(optional) An array of [environments] that are

available for the service instance.

class LogQueryResponse(matching_results=None, results=None)[source]

Bases: object

Object containing results that match the requested logs query.

Attr int matching_results

(optional) Number of matching results.

Attr list[LogQueryResponseResult] results

(optional)

class LogQueryResponseResult(environment_id=None, customer_id=None, document_type=None, natural_language_query=None, document_results=None, created_timestamp=None, client_timestamp=None, query_id=None, session_token=None, collection_id=None, display_rank=None, document_id=None, event_type=None, result_type=None)[source]

Bases: object

Individual result object for a logs query. Each object represents either a query to a Discovery collection or an event that is associated with a query.

Attr str environment_id

(optional) The environment ID that is associated with this

log entry. :attr str customer_id: (optional) The customer_id label that was specified in the header of the query or event API call that corresponds to this log entry. :attr str document_type: (optional) The type of log entry returned.

query indicates that the log represents the results of a call to the single

collection query method.

event indicates that the log represents a call to the events API.

Attr str natural_language_query

(optional) The value of the

natural_language_query query parameter that was used to create these results. Only returned with logs of type query. Note: Other query parameters (such as filter or deduplicate) might have been used with this query, but are not recorded. :attr LogQueryResponseResultDocuments document_results: (optional) Object containing result information that was returned by the query used to create this log entry. Only returned with logs of type query. :attr datetime created_timestamp: (optional) Date that the log result was created. Returned in YYYY-MM-DDThh:mm:ssZ format. :attr datetime client_timestamp: (optional) Date specified by the user when recording an event. Returned in YYYY-MM-DDThh:mm:ssZ format. Only returned with logs of type event. :attr str query_id: (optional) Identifier that corresponds to the natural_language_query string used in the original or associated query. All event and query log entries that have the same original natural_language_query string also have them same query_id. This field can be used to recall all event and query log results that have the same original query (event logs do not contain the original natural_language_query field). :attr str session_token: (optional) Unique identifier (within a 24-hour period) that identifies a single query log and any event logs that were created for it. Note: If the exact same query is run at the exact same time on different days, the session_token for those queries might be identical. However, the created_timestamp differs. Note: Session tokens are case sensitive. To avoid matching on session tokens that are identical except for case, use the exact match operator (::) when you query for a specific session token. :attr str collection_id: (optional) The collection ID of the document associated with this event. Only returned with logs of type event. :attr int display_rank: (optional) The original display rank of the document associated with this event. Only returned with logs of type event. :attr str document_id: (optional) The document ID of the document associated with this event. Only returned with logs of type event. :attr str event_type: (optional) The type of event that this object respresents. Possible values are

  • query the log of a query to a collection

  • click the result of a call to the events endpoint.

Attr str result_type

(optional) The type of result that this event is associated

with. Only returned with logs of type event.

class LogQueryResponseResultDocuments(results=None, count=None)[source]

Bases: object

Object containing result information that was returned by the query used to create this log entry. Only returned with logs of type query.

Attr list[LogQueryResponseResultDocumentsResult] results

(optional)

Attr int count

(optional) The number of results returned in the query associate with

this log.

class LogQueryResponseResultDocumentsResult(position=None, document_id=None, score=None, confidence=None, collection_id=None)[source]

Bases: object

Each object in the results array corresponds to an individual document returned by the original query.

Attr int position

(optional) The result rank of this document. A position of 1

indicates that it was the first returned result. :attr str document_id: (optional) The document_id of the document that this result represents. :attr float score: (optional) The raw score of this result. A higher score indicates a greater match to the query parameters. :attr float confidence: (optional) The confidence score of the result’s analysis. A higher score indicating greater confidence. :attr str collection_id: (optional) The collection_id of the document represented by this result.

class MemoryUsage(used_bytes=None, total_bytes=None, used=None, total=None, percent_used=None)[source]

Bases: object

Deprecated: Summary of the memory usage statistics for this environment.

Attr int used_bytes

(optional) Deprecated: Number of bytes used in the

environment’s memory capacity. :attr int total_bytes: (optional) Deprecated: Total number of bytes available in the environment’s memory capacity. :attr str used: (optional) Deprecated: Amount of memory capacity used, in KB or GB format. :attr str total: (optional) Deprecated: Total amount of the environment’s memory capacity, in KB or GB format. :attr float percent_used: (optional) Deprecated: Percentage of the environment’s memory capacity that is being used.

class MetricAggregation(interval=None, event_type=None, results=None)[source]

Bases: object

An aggregation analyzing log information for queries and events.

Attr str interval

(optional) The measurement interval for this metric. Metric

intervals are always 1 day (1d). :attr str event_type: (optional) The event type associated with this metric result. This field, when present, will always be click. :attr list[MetricAggregationResult] results: (optional)

class MetricAggregationResult(key_as_string=None, key=None, matching_results=None, event_rate=None)[source]

Bases: object

Aggregation result data for the requested metric.

Attr datetime key_as_string

(optional) Date in string form representing the start of

this interval. :attr int key: (optional) Unix epoch time equivalent of the key_as_string, that represents the start of this interval. :attr int matching_results: (optional) Number of matching results. :attr float event_rate: (optional) The number of queries with associated events divided by the total number of queries for the interval. Only returned with event_rate metrics.

class MetricResponse(aggregations=None)[source]

Bases: object

The response generated from a call to a metrics method.

Attr list[MetricAggregation] aggregations

(optional)

class MetricTokenAggregation(event_type=None, results=None)[source]

Bases: object

An aggregation analyzing log information for queries and events.

Attr str event_type

(optional) The event type associated with this metric result.

This field, when present, will always be click. :attr list[MetricTokenAggregationResult] results: (optional)

class MetricTokenAggregationResult(key=None, matching_results=None, event_rate=None)[source]

Bases: object

Aggregation result data for the requested metric.

Attr str key

(optional) The content of the natural_language_query parameter used

in the query that this result represents. :attr int matching_results: (optional) Number of matching results. :attr float event_rate: (optional) The number of queries with associated events divided by the total number of queries currently stored (queries and events are stored in the log for 30 days).

class MetricTokenResponse(aggregations=None)[source]

Bases: object

The response generated from a call to a metrics method that evaluates tokens.

Attr list[MetricTokenAggregation] aggregations

(optional)

class NluEnrichmentCategories(**kwargs)[source]

Bases: object

An object that indicates the Categories enrichment will be applied to the specified field.

class NluEnrichmentConcepts(limit=None)[source]

Bases: object

An object specifiying the concepts enrichment and related parameters.

Attr int limit

(optional) The maximum number of concepts enrichments to extact from

each instance of the specified field.

class NluEnrichmentEmotion(document=None, targets=None)[source]

Bases: object

An object specifying the emotion detection enrichment and related parameters.

Attr bool document

(optional) When true, emotion detection is performed on the

entire field. :attr list[str] targets: (optional) A comma-separated list of target strings that will have any associated emotions detected.

class NluEnrichmentEntities(sentiment=None, emotion=None, limit=None, mentions=None, mention_types=None, sentence_locations=None, model=None)[source]

Bases: object

An object speficying the Entities enrichment and related parameters.

Attr bool sentiment

(optional) When true, sentiment analysis of entities will be

performed on the specified field. :attr bool emotion: (optional) When true, emotion detection of entities will be performed on the specified field. :attr int limit: (optional) The maximum number of entities to extract for each instance of the specified field. :attr bool mentions: (optional) When true, the number of mentions of each identified entity is recorded. The default is false. :attr bool mention_types: (optional) When true, the types of mentions for each idetifieid entity is recorded. The default is false. :attr bool sentence_locations: (optional) When true, a list of sentence locations for each instance of each identified entity is recorded. The default is false. :attr str model: (optional) The enrichement model to use with entity extraction. May be a custom model provided by Watson Knowledge Studio, the public model for use with Knowledge Graph en-news, or the default public model alchemy.

class NluEnrichmentFeatures(keywords=None, entities=None, sentiment=None, emotion=None, categories=None, semantic_roles=None, relations=None, concepts=None)[source]

Bases: object

NluEnrichmentFeatures.

Attr NluEnrichmentKeywords keywords

(optional) An object specifying the Keyword

enrichment and related parameters. :attr NluEnrichmentEntities entities: (optional) An object speficying the Entities enrichment and related parameters. :attr NluEnrichmentSentiment sentiment: (optional) An object specifying the sentiment extraction enrichment and related parameters. :attr NluEnrichmentEmotion emotion: (optional) An object specifying the emotion detection enrichment and related parameters. :attr NluEnrichmentCategories categories: (optional) An object that indicates the Categories enrichment will be applied to the specified field. :attr NluEnrichmentSemanticRoles semantic_roles: (optional) An object specifiying the semantic roles enrichment and related parameters. :attr NluEnrichmentRelations relations: (optional) An object specifying the relations enrichment and related parameters. :attr NluEnrichmentConcepts concepts: (optional) An object specifiying the concepts enrichment and related parameters.

class NluEnrichmentKeywords(sentiment=None, emotion=None, limit=None)[source]

Bases: object

An object specifying the Keyword enrichment and related parameters.

Attr bool sentiment

(optional) When true, sentiment analysis of keywords will be

performed on the specified field. :attr bool emotion: (optional) When true, emotion detection of keywords will be performed on the specified field. :attr int limit: (optional) The maximum number of keywords to extract for each instance of the specified field.

class NluEnrichmentRelations(model=None)[source]

Bases: object

An object specifying the relations enrichment and related parameters.

Attr str model

(optional) *For use with natural_language_understanding enrichments

only.* The enrichement model to use with relationship extraction. May be a custom model provided by Watson Knowledge Studio, the public model for use with Knowledge Graph en-news, the default is`en-news`.

class NluEnrichmentSemanticRoles(entities=None, keywords=None, limit=None)[source]

Bases: object

An object specifiying the semantic roles enrichment and related parameters.

Attr bool entities

(optional) When true, entities are extracted from the

identified sentence parts. :attr bool keywords: (optional) When true, keywords are extracted from the identified sentence parts. :attr int limit: (optional) The maximum number of semantic roles enrichments to extact from each instance of the specified field.

class NluEnrichmentSentiment(document=None, targets=None)[source]

Bases: object

An object specifying the sentiment extraction enrichment and related parameters.

Attr bool document

(optional) When true, sentiment analysis is performed on the

entire field. :attr list[str] targets: (optional) A comma-separated list of target strings that will have any associated sentiment analyzed.

class NormalizationOperation(operation=None, source_field=None, destination_field=None)[source]

Bases: object

NormalizationOperation.

Attr str operation

(optional) Identifies what type of operation to perform.

copy - Copies the value of the source_field to the destination_field field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field. move - Renames (moves) the source_field to the destination_field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field. Rename is identical to copy, except that the source_field is removed after the value has been copied to the destination_field (it is the same as a _copy_ followed by a _remove_). merge - Merges the value of the source_field with the value of the destination_field. The destination_field is converted into an array if it is not already an array, and the value of the source_field is appended to the array. This operation removes the source_field after the merge. If the source_field does not exist in the current document, then the destination_field is still converted into an array (if it is not an array already). This conversion ensures the type for destination_field is consistent across all documents. remove - Deletes the source_field field. The destination_field is ignored for this operation. remove_nulls - Removes all nested null (blank) field values from the JSON tree. source_field and destination_field are ignored by this operation because _remove_nulls_ operates on the entire JSON tree. Typically, remove_nulls is invoked as the last normalization operation (if it is invoked at all, it can be time-expensive). :attr str source_field: (optional) The source field for the operation. :attr str destination_field: (optional) The destination field for the operation.

class Notice(notice_id=None, created=None, document_id=None, query_id=None, severity=None, step=None, description=None)[source]

Bases: object

A notice produced for the collection.

Attr str notice_id

(optional) Identifies the notice. Many notices might have the

same ID. This field exists so that user applications can programmatically identify a notice and take automatic corrective action. :attr datetime created: (optional) The creation date of the collection in the format yyyy-MM-dd’T’HH:mm:ss.SSS’Z’. :attr str document_id: (optional) Unique identifier of the document. :attr str query_id: (optional) Unique identifier of the query used for relevance training. :attr str severity: (optional) Severity level of the notice. :attr str step: (optional) Ingestion or training step in which the notice occurred. :attr str description: (optional) The description of the notice.

class PdfHeadingDetection(fonts=None)[source]

Bases: object

PdfHeadingDetection.

Attr list[FontSetting] fonts

(optional)

class PdfSettings(heading=None)[source]

Bases: object

A list of PDF conversion settings.

Attr PdfHeadingDetection heading

(optional)

class QueryAggregation(type=None, results=None, matching_results=None, aggregations=None)[source]

Bases: object

An aggregation produced by the Discovery service to analyze the input provided.

Attr str type

(optional) The type of aggregation command used. For example: term,

filter, max, min, etc. :attr list[AggregationResult] results: (optional) :attr int matching_results: (optional) Number of matching results. :attr list[QueryAggregation] aggregations: (optional) Aggregations returned by the Discovery service.

class QueryEntitiesContext(text=None)[source]

Bases: object

Entity text to provide context for the queried entity and rank based on that association. For example, if you wanted to query the city of London in England your query would look for London with the context of England.

Attr str text

(optional) Entity text to provide context for the queried entity and

rank based on that association. For example, if you wanted to query the city of London in England your query would look for London with the context of England.

class QueryEntitiesEntity(text=None, type=None)[source]

Bases: object

A text string that appears within the entity text field.

Attr str text

(optional) Entity text content.

Attr str type

(optional) The type of the specified entity.

class QueryEntitiesResponse(entities=None)[source]

Bases: object

An array of entities resulting from the query.

Attr list[QueryEntitiesResponseItem] entities

(optional)

class QueryEntitiesResponseItem(text=None, type=None, evidence=None)[source]

Bases: object

Object containing Entity query response information.

Attr str text

(optional) Entity text content.

Attr str type

(optional) The type of the result entity.

Attr list[QueryEvidence] evidence

(optional) List of different evidentiary items to

support the result.

class QueryEvidence(document_id=None, field=None, start_offset=None, end_offset=None, entities=None)[source]

Bases: object

Description of evidence location supporting Knoweldge Graph query result.

Attr str document_id

(optional) The docuemnt ID (as indexed in Discovery) of the

evidence location. :attr str field: (optional) The field of the document where the supporting evidence was identified. :attr int start_offset: (optional) The start location of the evidence in the identified field. This value is inclusive. :attr int end_offset: (optional) The end location of the evidence in the identified field. This value is inclusive. :attr list[QueryEvidenceEntity] entities: (optional) An array of entity objects that show evidence of the result.

class QueryEvidenceEntity(type=None, text=None, start_offset=None, end_offset=None)[source]

Bases: object

Entity description and location within evidence field.

Attr str type

(optional) The entity type for this entity. Possible types vary based

on model used. :attr str text: (optional) The original text of this entity as found in the evidence field. :attr int start_offset: (optional) The start location of the entity text in the identified field. This value is inclusive. :attr int end_offset: (optional) The end location of the entity text in the identified field. This value is exclusive.

class QueryFilterType(exclude=None, include=None)[source]

Bases: object

QueryFilterType.

Attr list[str] exclude

(optional) A comma-separated list of types to exclude.

Attr list[str] include

(optional) A comma-separated list of types to include. All

other types are excluded.

class QueryNoticesResponse(matching_results=None, results=None, aggregations=None, passages=None, duplicates_removed=None)[source]

Bases: object

QueryNoticesResponse.

Attr int matching_results

(optional)

Attr list[QueryNoticesResult] results

(optional)

Attr list[QueryAggregation] aggregations

(optional)

Attr list[QueryPassages] passages

(optional)

Attr int duplicates_removed

(optional)

class QueryNoticesResult(id=None, score=None, metadata=None, collection_id=None, result_metadata=None, code=None, filename=None, file_type=None, sha1=None, notices=None, **kwargs)[source]

Bases: object

QueryNoticesResult.

Attr str id

(optional) The unique identifier of the document.

Attr float score

(optional) Deprecated This field is now part of the

result_metadata object. :attr object metadata: (optional) Metadata of the document. :attr str collection_id: (optional) The collection ID of the collection containing the document for this result. :attr QueryResultMetadata result_metadata: (optional) Metadata of a query result. :attr int code: (optional) The internal status code returned by the ingestion subsystem indicating the overall result of ingesting the source document. :attr str filename: (optional) Name of the original source file (if available). :attr str file_type: (optional) The type of the original source file. :attr str sha1: (optional) The SHA-1 hash of the original source file (formatted as a hexadecimal string). :attr list[Notice] notices: (optional) Array of notices for the document.

class QueryPassages(document_id=None, passage_score=None, passage_text=None, start_offset=None, end_offset=None, field=None)[source]

Bases: object

QueryPassages.

Attr str document_id

(optional) The unique identifier of the document from which the

passage has been extracted. :attr float passage_score: (optional) The confidence score of the passages’s analysis. A higher score indicates greater confidence. :attr str passage_text: (optional) The content of the extracted passage. :attr int start_offset: (optional) The position of the first character of the extracted passage in the originating field. :attr int end_offset: (optional) The position of the last character of the extracted passage in the originating field. :attr str field: (optional) The label of the field from which the passage has been extracted.

class QueryRelationsArgument(entities=None)[source]

Bases: object

QueryRelationsArgument.

Attr list[QueryEntitiesEntity] entities

(optional)

class QueryRelationsEntity(text=None, type=None, exact=None)[source]

Bases: object

QueryRelationsEntity.

Attr str text

(optional) Entity text content.

Attr str type

(optional) The type of the specified entity.

Attr bool exact

(optional) If false, implicit querying is performed. The default is

false.

class QueryRelationsFilter(relation_types=None, entity_types=None, document_ids=None)[source]

Bases: object

QueryRelationsFilter.

Attr QueryFilterType relation_types

(optional) A list of relation types to include

or exclude from the query. :attr QueryFilterType entity_types: (optional) A list of entity types to include or exclude from the query. :attr list[str] document_ids: (optional) A comma-separated list of document IDs to include in the query.

class QueryRelationsRelationship(type=None, frequency=None, arguments=None, evidence=None)[source]

Bases: object

QueryRelationsRelationship.

Attr str type

(optional) The identified relationship type.

Attr int frequency

(optional) The number of times the relationship is mentioned.

Attr list[QueryRelationsArgument] arguments

(optional) Information about the

relationship. :attr list[QueryEvidence] evidence: (optional) List of different evidentiary items to support the result.

class QueryRelationsResponse(relations=None)[source]

Bases: object

QueryRelationsResponse.

Attr list[QueryRelationsRelationship] relations

(optional)

class QueryResponse(matching_results=None, results=None, aggregations=None, passages=None, duplicates_removed=None, session_token=None, retrieval_details=None)[source]

Bases: object

A response containing the documents and aggregations for the query.

Attr int matching_results

(optional)

Attr list[QueryResult] results

(optional)

Attr list[QueryAggregation] aggregations

(optional)

Attr list[QueryPassages] passages

(optional)

Attr int duplicates_removed

(optional)

Attr str session_token

(optional) The session token for this query. The session

token can be used to add events associated with this query to the query and event log. Important: Session tokens are case sensitive. :attr RetrievalDetails retrieval_details: (optional) An object contain retrieval type information.

class QueryResult(id=None, score=None, metadata=None, collection_id=None, result_metadata=None, **kwargs)[source]

Bases: object

QueryResult.

Attr str id

(optional) The unique identifier of the document.

Attr float score

(optional) Deprecated This field is now part of the

result_metadata object. :attr object metadata: (optional) Metadata of the document. :attr str collection_id: (optional) The collection ID of the collection containing the document for this result. :attr QueryResultMetadata result_metadata: (optional) Metadata of a query result.

class QueryResultMetadata(score, confidence)[source]

Bases: object

Metadata of a query result.

Attr float score

An unbounded measure of the relevance of a particular result,

dependent on the query and matching document. A higher score indicates a greater match to the query parameters. :attr float confidence: The confidence score for the given result. Calculated based on how relevant the result is estimated to be. confidence can range from 0.0 to 1.0. The higher the number, the more relevant the document. The confidence value for a result was calculated using the model specified in the document_retrieval_strategy field of the result set.

class RetrievalDetails(document_retrieval_strategy=None)[source]

Bases: object

An object contain retrieval type information.

Attr str document_retrieval_strategy

(optional) Indentifies the document retrieval

strategy used for this query. relevancy_training indicates that the results were returned using a relevancy trained model. continuous_relevancy_training indicates that the results were returned using the continuous relevancy training model created by result feedback analysis. untrained means the results were returned using the standard untrained model.

Note: In the event of trained collections being queried, but the trained model is

not used to return results, the document_retrieval_strategy will be listed as untrained.

class SearchStatus(scope=None, status=None, status_description=None, last_trained=None)[source]

Bases: object

Information about the Continuous Relevancy Training for this environment.

Attr str scope

(optional) Current scope of the training. Always returned as

environment. :attr str status: (optional) The current status of Continuous Relevancy Training for this environment. :attr str status_description: (optional) Long description of the current Continuous Relevancy Training status. :attr date last_trained: (optional) The date stamp of the most recent completed training for this environment.

class SegmentSettings(enabled=None, selector_tags=None)[source]

Bases: object

A list of Document Segmentation settings.

Attr bool enabled

(optional) Enables/disables the Document Segmentation feature.

Attr list[str] selector_tags

(optional) Defines the heading level that splits into

document segments. Valid values are h1, h2, h3, h4, h5, h6.

class Source(type=None, credential_id=None, schedule=None, options=None)[source]

Bases: object

Object containing source parameters for the configuration.

Attr str type

(optional) The type of source to connect to.

  • box indicates the configuration is to connect an instance of Enterprise Box.

  • salesforce indicates the configuration is to connect to Salesforce.

  • sharepoint indicates the configuration is to connect to Microsoft SharePoint

Online. - web_crawl indicates the configuration is to perform a web page crawl. :attr str credential_id: (optional) The credential_id of the credentials to use to connect to the source. Credentials are defined using the credentials method. The source_type of the credentials used must match the type field specified in this object. :attr SourceSchedule schedule: (optional) Object containing the schedule information for the source. :attr SourceOptions options: (optional) The options object defines which items to crawl from the source system.

class SourceOptions(folders=None, objects=None, site_collections=None, urls=None)[source]

Bases: object

The options object defines which items to crawl from the source system.

Attr list[SourceOptionsFolder] folders

(optional) Array of folders to crawl from the

Box source. Only valid, and required, when the type field of the source object is set to box. :attr list[SourceOptionsObject] objects: (optional) Array of Salesforce document object types to crawl from the Salesforce source. Only valid, and required, when the type field of the source object is set to salesforce. :attr list[SourceOptionsSiteColl] site_collections: (optional) Array of Microsoft SharePointoint Online site collections to crawl from the SharePoint source. Only valid and required when the type field of the source object is set to sharepoint. :attr list[SourceOptionsWebCrawl] urls: (optional) Array of Web page URLs to begin crawling the web from. Only valid and required when the type field of the source object is set to web_crawl.

class SourceOptionsFolder(owner_user_id, folder_id, limit=None)[source]

Bases: object

Object that defines a box folder to crawl with this configuration.

Attr str owner_user_id

The Box user ID of the user who owns the folder to crawl.

Attr str folder_id

The Box folder ID of the folder to crawl.

Attr int limit

(optional) The maximum number of documents to crawl for this folder.

By default, all documents in the folder are crawled.

class SourceOptionsObject(name, limit=None)[source]

Bases: object

Object that defines a Salesforce document object type crawl with this configuration.

Attr str name

The name of the Salesforce document object to crawl. For example,

case. :attr int limit: (optional) The maximum number of documents to crawl for this document object. By default, all documents in the document object are crawled.

class SourceOptionsSiteColl(site_collection_path, limit=None)[source]

Bases: object

Object that defines a Microsoft SharePoint site collection to crawl with this configuration.

Attr str site_collection_path

The Microsoft SharePoint Online site collection path

to crawl. The path must be be relative to the organization_url that was specified in the credentials associated with this source configuration. :attr int limit: (optional) The maximum number of documents to crawl for this site collection. By default, all documents in the site collection are crawled.

class SourceOptionsWebCrawl(url, limit_to_starting_hosts=None, crawl_speed=None, allow_untrusted_certificate=None, maximum_hops=None, request_timeout=None, override_robots_txt=None)[source]

Bases: object

Object defining which URL to crawl and how to crawl it.

Attr str url

The starting URL to crawl.

Attr bool limit_to_starting_hosts

(optional) When true, crawls of the specified

URL are limited to the host part of the url field. :attr str crawl_speed: (optional) The number of concurrent URLs to fetch. gentle means one URL is fetched at a time with a delay between each call. normal means as many as two URLs are fectched concurrently with a short delay between fetch calls. aggressive means that up to ten URLs are fetched concurrently with a short delay between fetch calls. :attr bool allow_untrusted_certificate: (optional) When true, allows the crawl to interact with HTTPS sites with SSL certificates with untrusted signers. :attr int maximum_hops: (optional) The maximum number of hops to make from the initial URL. When a page is crawled each link on that page will also be crawled if it is within the maximum_hops from the initial URL. The first page crawled is 0 hops, each link crawled from the first page is 1 hop, each link crawled from those pages is 2 hops, and so on. :attr int request_timeout: (optional) The maximum milliseconds to wait for a response from the web server. :attr bool override_robots_txt: (optional) When true, the crawler will ignore any robots.txt encountered by the crawler. This should only ever be done when crawling a web site the user owns. This must be be set to true when a gateway_id is specied in the credentials.

class SourceSchedule(enabled=None, time_zone=None, frequency=None)[source]

Bases: object

Object containing the schedule information for the source.

Attr bool enabled

(optional) When true, the source is re-crawled based on the

frequency field in this object. When false the source is not re-crawled; When false and connecting to Salesforce the source is crawled annually. :attr str time_zone: (optional) The time zone to base source crawl times on. Possible values correspond to the IANA (Internet Assigned Numbers Authority) time zones list. :attr str frequency: (optional) The crawl schedule in the specified time_zone. - daily: Runs every day between 00:00 and 06:00. - weekly: Runs every week on Sunday between 00:00 and 06:00. - monthly: Runs the on the first Sunday of every month between 00:00 and 06:00.

class SourceStatus(status=None, last_updated=None)[source]

Bases: object

Object containing source crawl status information.

Attr str status

(optional) The current status of the source crawl for this

collection. This field returns not_configured if the default configuration for this source does not have a source object defined. - running indicates that a crawl to fetch more documents is in progress. - complete indicates that the crawl has completed with no errors. - complete_with_notices indicates that some notices were generated during the crawl. Notices can be checked by using the notices query method. - stopped indicates that the crawl has stopped but is not complete. :attr datetime last_updated: (optional) Date in UTC format indicating when the last crawl was attempted. If null, no crawl was completed.

class TestDocument(configuration_id=None, status=None, enriched_field_units=None, original_media_type=None, snapshots=None, notices=None)[source]

Bases: object

TestDocument.

Attr str configuration_id

(optional) The unique identifier for the configuration.

Attr str status

(optional) Status of the preview operation.

Attr int enriched_field_units

(optional) The number of 10-kB chunks of field data

that were enriched. This can be used to estimate the cost of running a real ingestion. :attr str original_media_type: (optional) Format of the test document. :attr list[DocumentSnapshot] snapshots: (optional) An array of objects that describe each step in the preview process. :attr list[Notice] notices: (optional) An array of notice messages about the preview operation.

class TokenDictRule(text, tokens, part_of_speech, readings=None)[source]

Bases: object

An object defining a single tokenizaion rule.

Attr str text

The string to tokenize.

Attr list[str] tokens

Array of tokens that the text field is split into when

found. :attr list[str] readings: (optional) Array of tokens that represent the content of the text field in an alternate character set. :attr str part_of_speech: The part of speech that the text string belongs to. For example noun. Custom parts of speech can be specified.

class TokenDictStatusResponse(status=None, type=None)[source]

Bases: object

Object describing the current status of the wordlist.

Attr str status

(optional) Current wordlist status for the specified collection.

Attr str type

(optional) The type for this wordlist. Can be

tokenization_dictionary or stopwords.

class TopHitsResults(matching_results=None, hits=None)[source]

Bases: object

TopHitsResults.

Attr int matching_results

(optional) Number of matching results.

Attr list[QueryResult] hits

(optional) Top results returned by the aggregation.

class TrainingDataSet(environment_id=None, collection_id=None, queries=None)[source]

Bases: object

TrainingDataSet.

Attr str environment_id

(optional)

Attr str collection_id

(optional)

Attr list[TrainingQuery] queries

(optional)

class TrainingExample(document_id=None, cross_reference=None, relevance=None)[source]

Bases: object

TrainingExample.

Attr str document_id

(optional)

Attr str cross_reference

(optional)

Attr int relevance

(optional)

class TrainingExampleList(examples=None)[source]

Bases: object

TrainingExampleList.

Attr list[TrainingExample] examples

(optional)

class TrainingQuery(query_id=None, natural_language_query=None, filter=None, examples=None)[source]

Bases: object

TrainingQuery.

Attr str query_id

(optional)

Attr str natural_language_query

(optional)

Attr str filter

(optional)

Attr list[TrainingExample] examples

(optional)

class TrainingStatus(total_examples=None, available=None, processing=None, minimum_queries_added=None, minimum_examples_added=None, sufficient_label_diversity=None, notices=None, successfully_trained=None, data_updated=None)[source]

Bases: object

TrainingStatus.

Attr int total_examples

(optional)

Attr bool available

(optional)

Attr bool processing

(optional)

Attr bool minimum_queries_added

(optional)

Attr bool minimum_examples_added

(optional)

Attr bool sufficient_label_diversity

(optional)

Attr int notices

(optional)

Attr datetime successfully_trained

(optional)

Attr datetime data_updated

(optional)

class WordHeadingDetection(fonts=None, styles=None)[source]

Bases: object

WordHeadingDetection.

Attr list[FontSetting] fonts

(optional)

Attr list[WordStyle] styles

(optional)

class WordSettings(heading=None)[source]

Bases: object

A list of Word conversion settings.

Attr WordHeadingDetection heading

(optional)

class WordStyle(level=None, names=None)[source]

Bases: object

WordStyle.

Attr int level

(optional)

Attr list[str] names

(optional)

class XPathPatterns(xpaths=None)[source]

Bases: object

XPathPatterns.

Attr list[str] xpaths

(optional)

class Calculation(type=None, results=None, matching_results=None, aggregations=None, field=None, value=None)[source]

Bases: object

Calculation.

Attr str field

(optional) The field where the aggregation is located in the

document. :attr float value: (optional) Value of the aggregation.

class Filter(type=None, results=None, matching_results=None, aggregations=None, match=None)[source]

Bases: object

Filter.

Attr str match

(optional) The match the aggregated results queried for.

class Histogram(type=None, results=None, matching_results=None, aggregations=None, field=None, interval=None)[source]

Bases: object

Histogram.

Attr str field

(optional) The field where the aggregation is located in the

document. :attr int interval: (optional) Interval of the aggregation. (For ‘histogram’ type).

class Nested(type=None, results=None, matching_results=None, aggregations=None, path=None)[source]

Bases: object

Nested.

Attr str path

(optional) The area of the results the aggregation was restricted to.

class Term(type=None, results=None, matching_results=None, aggregations=None, field=None, count=None)[source]

Bases: object

Term.

Attr str field

(optional) The field where the aggregation is located in the

document. :attr int count: (optional)

class Timeslice(type=None, results=None, matching_results=None, aggregations=None, field=None, interval=None, anomaly=None)[source]

Bases: object

Timeslice.

Attr str field

(optional) The field where the aggregation is located in the

document. :attr str interval: (optional) Interval of the aggregation. Valid date interval values are second/seconds minute/minutes, hour/hours, day/days, week/weeks, month/months, and year/years. :attr bool anomaly: (optional) Used to indicate that anomaly detection should be performed. Anomaly detection is used to locate unusual datapoints within a time series.

class TopHits(type=None, results=None, matching_results=None, aggregations=None, size=None, hits=None)[source]

Bases: object

TopHits.

Attr int size

(optional) Number of top hits returned by the aggregation.

Attr TopHitsResults hits

(optional)