Upload processors.py with huggingface_hub
Browse files- processors.py +5 -3
processors.py
CHANGED
@@ -10,6 +10,11 @@ class ToString(BaseFieldOperator):
|
|
10 |
return str(instance)
|
11 |
|
12 |
|
|
|
|
|
|
|
|
|
|
|
13 |
class ToListByComma(BaseFieldOperator):
|
14 |
def process(self, instance):
|
15 |
output = [x.strip() for x in instance.split(",")]
|
@@ -61,6 +66,3 @@ class DictOfListsToPairs(BaseFieldOperator):
|
|
61 |
return result
|
62 |
except:
|
63 |
return []
|
64 |
-
|
65 |
-
|
66 |
-
# add_to_catalog(ToString('prediction'), 'processors', 'to_string')
|
|
|
10 |
return str(instance)
|
11 |
|
12 |
|
13 |
+
class ToStringStripped(BaseFieldOperator):
|
14 |
+
def process(self, instance):
|
15 |
+
return str(instance).strip()
|
16 |
+
|
17 |
+
|
18 |
class ToListByComma(BaseFieldOperator):
|
19 |
def process(self, instance):
|
20 |
output = [x.strip() for x in instance.split(",")]
|
|
|
66 |
return result
|
67 |
except:
|
68 |
return []
|
|
|
|
|
|