Skip to main content

post_processing

Postprocessing for Hugging Face models.

Classes

HuggingFaceApplyIdToLabelsPostProcessor

class HuggingFaceApplyIdToLabelsPostProcessor(    model_id: str,    filepath: str,    key: Optional[str] = None,    access_token: Optional[str] = None,):

Apply ID to labels for Hugging Face models.

Initialize the Hugging Face apply ID to labels processor.

Arguments

  • model_id: The model ID to use for the Hugging Face model
  • filepath: The filepath to the ID to labels mapping file
  • key: The key to use for the ID to labels mapping
  • access_token: Optional Hugging Face access token. If not provided, defaults to BITFOUNT_HUGGINGFACE_USER_ACCESS_TOKEN env var.

Ancestors

Methods


process

def process(self, predictions: Any)> Any:

Process predictions by applying ID to labels.

NERDeidentificationPostProcessor

class NERDeidentificationPostProcessor():

De-identify text by replacing named entities with placeholders.

Ancestors

Methods


process

def process(self, predictions: Any)> Any:

Process predictions by redacting entities from original text.