snorkelflow.client.applications.add_block_to_application
- snorkelflow.client.applications.add_block_to_application(application, template_id, input_node, block_config, from_block_uid=None, label_schema_uid=None)
Add a block to an existing application.
Parameters
Parameters
”extraction_field”: str # For information extraction tasks only, in which case str value should be name of column from which to perform extraction
”hocr_field”: str # For hOCR Extraction tasks only, in which case str value should be {name of hOCR data column}
”label_col”: str # For single-label classification tasks only, in which case str should be name of column with GT labels
”label_map”: Dict[str, int]
”pdf_field”: str # For PDF classification tasks and native PDF extraction tasks only, in which case str value should be name of column containing rich doc pdf url’s”
”seq_field”: str # For sequence-tagging tasks only, in which case str value should be name of column on which to perform sequence tagging.
Returns
Returns
Information on the created block
Return type
Return type
Dict[str, Any]
Name Type Default Info application Union[str, int]
The name or UID of the new application. template_id str
The string identifier for the type of block. input_node int
The UID of the input node. block_config Dict[str, Any]
A dictionary representation of the configuration for the block, with below key-value pairs defined:
from_block_uid Optional[int]
None
An optional identifier for a block to copy from. label_schema_uid Optional[int]
None
An optional identifier for a label schema to use. Examples
>>> sf.add_block_to_application(
>>> application=APP_NAME,
>>> template_id="clf",
>>> input_node=INPUT_NODE_ID,
>>> block_config=dict(
>>> label_map=dict(UNKNOWN=-1, NEGATIVE=0, POSITIVE=1),
>>> ),
>>> )
{'block_uid': <block_uid>, 'node_uids': [node_uid,...], 'job_ids': [job_id,...]}