Upload processors.py with huggingface_hub
Browse files- processors.py +6 -0
processors.py
CHANGED
|
@@ -10,6 +10,12 @@ class ToString(BaseFieldOperator):
|
|
| 10 |
return str(instance)
|
| 11 |
|
| 12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
class RegexParser(BaseFieldOperator):
|
| 14 |
"""
|
| 15 |
A processor that uses regex in order to parse a string.
|
|
|
|
| 10 |
return str(instance)
|
| 11 |
|
| 12 |
|
| 13 |
+
class ToListByComma(BaseFieldOperator):
|
| 14 |
+
def process(self, instance):
|
| 15 |
+
output = [x.strip() for x in instance.split(",")]
|
| 16 |
+
return output
|
| 17 |
+
|
| 18 |
+
|
| 19 |
class RegexParser(BaseFieldOperator):
|
| 20 |
"""
|
| 21 |
A processor that uses regex in order to parse a string.
|