| | |
| | | |
| | | |
| | | import csv |
| | | import os |
| | | from typing import Union |
| | | import inflect |
| | | |
| | | UNIT_1e01 = '十' |
| | | UNIT_1e02 = '百' |
| | | UNIT_1e03 = '千' |
| | | UNIT_1e04 = '万' |
| | | UNIT_1e01 = "十" |
| | | UNIT_1e02 = "百" |
| | | UNIT_1e03 = "千" |
| | | UNIT_1e04 = "万" |
| | | |
| | | _inflect = inflect.engine() |
| | | |
| | |
| | | x = _inflect.number_to_words(str(x)).replace("-", " ").replace(",", "") |
| | | return x |
| | | |
| | | |
| | | def get_abs_path(rel_path): |
| | | """ |
| | | Get absolute path |
| | |
| | | |
| | | Returns absolute path |
| | | """ |
| | | return os.path.dirname(os.path.abspath(__file__)) + '/' + rel_path |
| | | return os.path.dirname(os.path.abspath(__file__)) + "/" + rel_path |
| | | |
| | | |
| | | def load_labels(abs_path): |