data_juicer.ops.mapper.clean_ip_mapper module

class data_juicer.ops.mapper.clean_ip_mapper.CleanIpMapper(pattern: str | None = None, repl: str = '', *args, **kwargs)[源代码]

基类:Mapper

Mapper to clean ipv4 and ipv6 address in text samples.

__init__(pattern: str | None = None, repl: str = '', *args, **kwargs)[源代码]

Initialization method.

参数:
  • pattern -- regular expression pattern to search for within text.

  • repl -- replacement string, default is empty string.

  • args -- extra args

  • kwargs -- extra args

process_batched(samples)[源代码]