| column |
Required |
Specifies the column of the teradataml DataFrame. |
string |
N/A |
N/A |
| data |
Required |
Specifies the teradataml DataFrame containing the column specified in "column". |
teradataml DataFrame |
N/A |
N/A |
| persist |
Optional |
Specifies whether to persist the output or not. When set to True, results are stored in permanent tables, otherwise in volatile tables. |
boolean |
False |
True, False |
| returns |
Optional |
- Specifies the returns clause for the apply query in a user-defined script for inferencing. It contains a dict which specifies the column name as key and datatype as the value.
- For example, the script returns two columns ‘text’ and ‘sentiment of VARCHAR datatype, then the "returns" argument looks like this: {"text": VARCHAR(10000), "sentiment": VARCHAR(10000)}
|
dictionary |
N/A |
N/A |
| script |
Optional |
Specifies the user defined script for inferencing. Use this argument to configure the model to process the input and output. The sample script uses the following mechanism to load and use the model: - It uses 'AutoTokenizer.from_pretrained()' function from the transformers library that automatically detects the correct tokenizer class based on the model's configuration.
- The "transformer_class" provided in the "model_args" argument of TeradataAI class is used to load the given pre-trained model.
Example: 'AutoModelForSequenceClassification',
'AutoModelForTokenClassification' etc.
- It then uses the 'pipeline' module for using the model. Pipeline makes use of "task" argument which defines which pipeline to be used for processing.
Example: 'token-classification', 'summarization' etc.
- The following command line arguments should be handled by the user-defined script:
- 0th argument: script_name.
- 1st argument: string containing extra parameters in dict format. Using json.loads() will convert this to dict format.
- The following arguments are passed if supplied by the respective function:
- classify_labels = "labels" argument for classify_text()
- target_lang = "target_lang" argument for translate()
- entity_groups = "entity_groups" argument for recognize_entities()
- pipeline_kwargs = "pipeline_kwargs" for all functions
- delimiter = "delimiter" for all functions
- func_name = "func_name" for all functions
|
string |
N/A |
N/A |
| delimiter |
Optional |
Specifies a delimiter to use when reading columns from a row and writing result columns. Delimiter must be a valid Unicode code point. - "quotechar" cannot be the same as "delimiter".
- The value of "delimiter" cannot be an empty string, newline, and carriage return.
|
string |
comma (,) |
N/A |
| quotechar |
Optional |
Specifies the character used to quote all input and output values for the script. "quotechar" value cannot be the same as "delimiter".
|
string |
double quote (") |
N/A |
| libs |
Optional |
Specifies the add-on Python library names to be installed. |
string or list of strings |
N/A |
N/A |