blueradiance commited on
Commit
5e481dc
·
verified ·
1 Parent(s): 0fa176d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -58,10 +58,11 @@ def to_chosung(text):
58
  return result
59
 
60
  def postprocess_sensitive_patterns(text):
 
 
61
  text = re.sub(r"\b(\d{4})[- ]?(\d{4})[- ]?(\d{4})[- ]?(\d{4})\b", r"\1-****-****-\4", text) # 카드번호
62
  text = re.sub(r"\b(\d{3})[-]?(\d{2,4})[-]?(\d{4,6})\b", r"\1-***-\3", text) # 계좌번호
63
  text = re.sub(r"\b(\d{2,4})-(\d{3,4})-(\d{4})\b", r"\1-***-\3", text) # 전화번호
64
- text = re.sub(r"\b(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\b", r"\1.\2.*.*", text) # IP 주소
65
  text = re.sub(r"(\d{1,3})동", r"***동", text) # 동 정보
66
  text = re.sub(r"(\d{1,4})호", r"****호", text) # 호수 정보
67
  return text
 
58
  return result
59
 
60
  def postprocess_sensitive_patterns(text):
61
+ text = re.sub(r"\b[\w\.-]+@[\w\.-]+\.[a-zA-Z]{2,}\b", r"******@****", text) # 이메일
62
+ text = re.sub(r"\b(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\b", r"\1.\2.*.*", text) # IP 주소
63
  text = re.sub(r"\b(\d{4})[- ]?(\d{4})[- ]?(\d{4})[- ]?(\d{4})\b", r"\1-****-****-\4", text) # 카드번호
64
  text = re.sub(r"\b(\d{3})[-]?(\d{2,4})[-]?(\d{4,6})\b", r"\1-***-\3", text) # 계좌번호
65
  text = re.sub(r"\b(\d{2,4})-(\d{3,4})-(\d{4})\b", r"\1-***-\3", text) # 전화번호
 
66
  text = re.sub(r"(\d{1,3})동", r"***동", text) # 동 정보
67
  text = re.sub(r"(\d{1,4})호", r"****호", text) # 호수 정보
68
  return text