Skip to main content
Version: 0.91

snorkelflow.client.applications.create_text_extraction_application

snorkelflow.client.applications.create_text_extraction_application(application_name, dataset, input_schema, extraction_field, labels, label_col=None)

Create an application with a text extraction block.

Parameters

NameTypeDefaultInfo
application_namestrThe name of the new application.
datasetUnion[str, int]The name or UID of the dataset which the application will use.
input_schemaList[str]A list of columns (from the dataset).
extraction_fieldstrThe field to extract from.
labelsList[str]A string list of labels for the task.
label_colOptional[str]NoneAn optional string name of a dataset column that contains labels.

Returns

The created pplication object

Return type

Dict[str, Any]

Examples

>>> sf.create_text_extraction_application(
>>> APP_NAME,
>>> dataset=DATASET_NAME,
>>> input_schema=["text"],
>>> extraction_field="text",
>>> labels=["label1", "label2"],
>>> label_col="label",
>>> )
{
'application_uid': <application_uid>,
'name': <name>,
'dataset_uid': <dataset_uid>,
'description': <description>,
'application_config': <application_config_dict>, # Contains input schema
'created_at': <timetamp>,
'node_dag': <node_dag>, # contains list of nodes and it's input node
'access_config': <access_config>,
'hydrated_node_dag': <hydrated_node_dag> # Contains list of it's node and it's config
}