What is a Secret Masking model
A Secret Masking model removes secrets and other sensitive information from code, while preserving its overall functioning. This is done by replacing secrets with placeholder values, ensuring that the code remains coherent and usable without compromising privacy. This can be thought of as a special case of a Text Anonymization model.
What needs to be done
Implement a Secret Masking model that exposes the following public methods:
.train() method:
.train(output_path: Optional[str] = None, num_samples: int = config.DEFAULT_SYNTHEX_DATAPOINT_NUM, num_epochs: int = 3)
The method should train the model to swap sensitive information in code with placeholder values.
.__call__(code: str)
Given an input code, this method will replace all sensitive information, if any, with placeholder values
For instance, given the input:
__call__("artifex = Artifex(api_key='abc123456789')")
The model might return:
"artifex = Artifex(api_key='[MASKED]')"
What is a Secret Masking model
A Secret Masking model removes secrets and other sensitive information from code, while preserving its overall functioning. This is done by replacing secrets with placeholder values, ensuring that the code remains coherent and usable without compromising privacy. This can be thought of as a special case of a Text Anonymization model.
What needs to be done
Implement a Secret Masking model that exposes the following public methods:
.train()method:The method should train the model to swap sensitive information in code with placeholder values.
.__call__(code: str)Given an input code, this method will replace all sensitive information, if any, with placeholder values
For instance, given the input:
The model might return:
"artifex = Artifex(api_key='[MASKED]')"Important
The new Secret Masking model should have the same structure as the Text Anonymization model.