Spaces:
Sleeping
Sleeping
Download classifier.py from mlbench123/mortgage_OCR: direct link, hf CLI and curl.
- Browser
- Download file 668 Bytes
-
https://huggingface.co/spaces/mlbench123/mortgage_OCR/resolve/main/classifier.py
- Command line
-
hf download hf://spaces/mlbench123/mortgage_OCR/classifier.py
-
curl -L -o classifier.py https://huggingface.co/spaces/mlbench123/mortgage_OCR/resolve/main/classifier.py
668 Bytes
| def classify_loan(text): | |
| t = text.lower() | |
| if "ืืชืืื ืื ืง ืืฉืจืื" in t or "ืจืืืืช 0" in t: | |
| return "SPECIAL_FIXED_0", "fixed", False, 0.99 | |
| if "ืคืจืืื" in t: | |
| return "PRIME", "variable", False, 0.95 | |
| if "ืงืืืขื" in t and "ืื ืฆืืื" in t: | |
| return "FLAC", "fixed", False, 0.93 | |
| if "ืืฉืชื ื" in t and "ืื ืฆืืื" in t: | |
| return "VNL", "variable", False, 0.92 | |
| if "ืงืืืขื" in t and "ืืื" in t: | |
| return "CI_FIXED", "fixed", True, 0.93 | |
| if "ืืฉืชื ื" in t and "ืืื" in t: | |
| return "CI_VARIABLE", "variable", True, 0.92 | |
| return "UNKNOWN", None, None, 0.50 | |