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.
- classmethod categorize(documents, model, caslib=None, id_column=None, text_column=None, description=None, output_postfix=None)[source]#
- Parameters:
documents (str or dict or Iterable) – 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.
model (str or dict) – URI of a CAS table that contains one or more category model binaries.
caslib (str or dict, optional) – URI of a caslib in which the documents will be stored. Required if documents is a list of strings.
id_column (str, optional) – The column in documents that contains a unique id for each document. Required if documents is a CAS table URI.
text_column (str, optional) – The column in documents that contains the document text to categorize. Required if documents is a CAS table URI.
description (str, optional) – Description to add to the text categorization job.
output_postfix (str, optional) – Text to be added to the end of all output table names.
- Returns:
RestObj – The submitted job