Download model-3/scripts/null_check.py from Jyo-K/PoPTard5: direct link, hf CLI and curl.
- Browser
- Download file 760 Bytes
-
https://huggingface.co/Jyo-K/PoPTard5/resolve/main/model-3/scripts/null_check.py
- Command line
-
hf download hf://Jyo-K/PoPTard5/model-3/scripts/null_check.py
-
curl -L -o null_check.py https://huggingface.co/Jyo-K/PoPTard5/resolve/main/model-3/scripts/null_check.py
760 Bytes
| import sys | |
| sys.path.insert(0, "src") | |
| import numpy as np | |
| import data as D | |
| from config import PATHS | |
| from cross_encoder import pair_text | |
| s1, s23, _ = D.load_data(PATHS["test"], with_gt=False) | |
| ad = s23["business_address"].values | |
| empty = np.where(ad == "")[0] | |
| print(f"records with empty address after load : {len(empty):,} / {len(ad):,}") | |
| print(f"literal 'None' strings : {(ad == 'None').sum()}") | |
| print(f"NaN remaining : {s23['business_address'].isna().sum()}") | |
| print(f"dtype : {s23['business_address'].dtype}") | |
| print() | |
| for i in empty[:3]: | |
| print(" pair_text ->", repr(pair_text(s23["business_name"].values[i], ad[i], | |
| s23["country"].values[i]))) | |