Merge pull request #158 from SDSRV-IDP/dev/semi_correct
Update: Imei with maximum 14 characters
This commit is contained in:
commit
01a3411d5f
@ -307,4 +307,6 @@ REASON_SOLUTION_MAP = {"Invalid image": "Remove this image from the evaluation r
|
|||||||
"Handwritten": "Remove this image from the evaluation report",
|
"Handwritten": "Remove this image from the evaluation report",
|
||||||
"Wrong feedback": "Update revised resutl and re-calculate accuracy",
|
"Wrong feedback": "Update revised resutl and re-calculate accuracy",
|
||||||
"Ocr cannot extract": "Improve OCR",
|
"Ocr cannot extract": "Improve OCR",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
IMEI_MAX_LENGHT = 14
|
@ -5,6 +5,7 @@ import time
|
|||||||
import json
|
import json
|
||||||
import glob
|
import glob
|
||||||
import shutil
|
import shutil
|
||||||
|
from django.conf import settings
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
from tqdm import tqdm
|
from tqdm import tqdm
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
@ -64,6 +65,9 @@ def post_processing_str(class_name: str, s: str, is_gt: bool, sub: str) -> str:
|
|||||||
s = convert_datetime_format(s)
|
s = convert_datetime_format(s)
|
||||||
if class_name == "retailername":
|
if class_name == "retailername":
|
||||||
s = normalise_retailer_name(s, sub)
|
s = normalise_retailer_name(s, sub)
|
||||||
|
if class_name == "imei_number" and isinstance(s, str):
|
||||||
|
if len(s) > settings.IMEI_MAX_LENGHT:
|
||||||
|
s = s[:settings.IMEI_MAX_LENGHT]
|
||||||
return s
|
return s
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user