data_juicer.ops.mapper.replace_content_mapper module#
- class data_juicer.ops.mapper.replace_content_mapper.ReplaceContentMapper(pattern: str | List[str] | None = None, repl: str | List[str] = '', *args, **kwargs)[source]#
Bases:
MapperMapper to replace all content in the text that matches a specific regular expression pattern with a designated replacement string.
- __init__(pattern: str | List[str] | None = None, repl: str | List[str] = '', *args, **kwargs)[source]#
Initialization method.
- Parameters:
pattern â regular expression pattern(s) to search for within text
repl â replacement string(s), default is empty string
args â extra args
kwargs â extra args