Download split_dataset.py from chris1tava/position_names: direct link, hf CLI and curl.
- Browser
- Download file 425 Bytes
-
https://huggingface.co/datasets/chris1tava/position_names/resolve/main/split_dataset.py
- Command line
-
hf download hf://datasets/chris1tava/position_names/split_dataset.py
-
curl -L -o split_dataset.py https://huggingface.co/datasets/chris1tava/position_names/resolve/main/split_dataset.py
425 Bytes
| import traceback | |
| try: | |
| train_max=400 | |
| t = open("./2024-01/position_names_tags.txt",'r') | |
| train = open("./2024-01/train.txt","w") | |
| test = open("./2024-01/test.txt","w") | |
| for i,l in enumerate(t): | |
| if i <= train_max: | |
| train.write(l) | |
| else: | |
| test.write(l) | |
| t.close() | |
| train.close() | |
| test.close() | |
| except Exception as e: | |
| print(e) | |
| print(traceback.format_exc()) | |