Upload processors.py with huggingface_hub
Browse files123452 unmodified lines891011121314151617181920212223import re
from .operator import BaseFieldOperator
2 unmodified lines return str(instance)
class RegexParser(BaseFieldOperator): """ A processor that uses regex in order to parse a string. """
regex: str
def process(self, text): matches = re.findall(self.regex, text) return matches
# add_to_catalog(ToString('prediction'), 'processors', 'to_string')processors.py+14