sasctl.services.text_categorization#

class sasctl._services.text_categorization.TextCategorization[source]#

Bases: Service

Categorizes natural language text documents according to a prebuilt or user-defined model.

Methods

categorize(documents, model[, caslib, ...])

Parameters:

delete(*args, **kwargs)

Send a DELETE request.

get(*args, **kwargs)

Send a GET request.

get_link(obj, rel)

Get link information from a resource.

head(*args, **kwargs)

Send a HEAD request.

info()

Version and build information for the service.

is_available()

Check if the service is currently available.

post(*args, **kwargs)

Send a POST request.

put(*args, **kwargs)

Send a PUT request.

request(verb, path[, session, format_])

Send an HTTP request with a session.

request_link(obj, rel, **kwargs)

Request a link from a resource.

is_uuid

classmethod categorize(documents, model, caslib=None, id_column=None, text_column=None, description=None, output_postfix=None)[source]#
Parameters:
documentsstr or dict or list_like:

Documents to parse. May be either the URI to a CAS table where the documents are currently stored, or an iterable of strings containing the documents’ text.

modelstr or dict

URI of a CAS table that contains one or more category model binaries.

caslibstr or dict, optional

URI of a caslib in which the documents will be stored. Required if documents is a list of strings.

id_columnstr, optional

The column in documents that contains a unique id for each document. Required if documents is a CAS table URI.

text_columnstr, optional

The column in documents that contains the document text to categorize. Required if documents is a CAS table URI.

descriptionstr, optional

Description to add to the text categorization job.

output_postfixstr, optional

Text to be added to the end of all output table names.

Returns:
RestObj

The submitted job

See also

cas_management.get_caslib
cas_management.get_table