Download string_operators.py from unitxt/data: direct link, hf CLI and curl.
- Browser
- Download file 326 Bytes
-
https://huggingface.co/datasets/unitxt/data/resolve/da86385bad20545fd66ffee3bd3aa44896c36e2d/string_operators.py
- Command line
-
hf download hf://datasets/unitxt/data@da86385bad20545fd66ffee3bd3aa44896c36e2d/string_operators.py
-
curl -L -o string_operators.py https://huggingface.co/datasets/unitxt/data/resolve/da86385bad20545fd66ffee3bd3aa44896c36e2d/string_operators.py
326 Bytes
| from typing import List | |
| from .operators import FieldOperator | |
| class Split(FieldOperator): | |
| by: str | |
| def process_value(self, value: str) -> List[str]: | |
| return value.split(self.by) | |
| class Join(FieldOperator): | |
| by: str | |
| def process_value(self, value: List[str]) -> str: | |
| return self.by.join(value) | |