Spaces:
Sleeping
Sleeping
rafaldembski
commited on
Commit
•
e384056
1
Parent(s):
d091b10
Update pages/Analysis.py
Browse files- pages/Analysis.py +12 -14
pages/Analysis.py
CHANGED
@@ -83,17 +83,15 @@ def analyze_sms(message, phone_number, additional_info, language):
|
|
83 |
country, operator = get_phone_info(phone_number)
|
84 |
if country and operator:
|
85 |
st.write(get_translation('phone_info', language))
|
86 |
-
st.write(f"- {get_translation('country_label', language)}
|
87 |
-
st.write(f"- {get_translation('operator_label', language)}
|
88 |
else:
|
89 |
st.write(get_translation('unable_to_retrieve', language))
|
90 |
|
91 |
# Sprawdzenie, czy numer jest w bazie fałszywych numerów
|
92 |
-
|
|
|
93 |
st.warning(get_translation('number_reported_warning', language))
|
94 |
-
fraud_detected = True
|
95 |
-
else:
|
96 |
-
fraud_detected = False
|
97 |
|
98 |
# Przeprowadź proste sprawdzenia heurystyczne
|
99 |
warnings = simple_checks(message, language)
|
@@ -187,9 +185,9 @@ def analyze_email(email_content, sender_email, language):
|
|
187 |
domain_info = get_email_info(sender_email)
|
188 |
if domain_info:
|
189 |
st.write(get_translation('email_sender_info', language))
|
190 |
-
st.write(f"- {get_translation('domain_label', language)}
|
191 |
-
st.write(f"- {get_translation('organization_label', language)}
|
192 |
-
st.write(f"- {get_translation('country_label', language)}
|
193 |
else:
|
194 |
st.write(get_translation('unable_to_retrieve_email', language))
|
195 |
|
@@ -298,8 +296,8 @@ def analyze_phone_number(phone_number, language):
|
|
298 |
country, operator = get_phone_info(phone_number)
|
299 |
if country and operator:
|
300 |
st.write(get_translation('phone_info', language))
|
301 |
-
st.write(f"- {get_translation('country_label', language)}
|
302 |
-
st.write(f"- {get_translation('operator_label', language)}
|
303 |
else:
|
304 |
st.write(get_translation('unable_to_retrieve', language))
|
305 |
|
@@ -343,9 +341,9 @@ def show_statistics(language):
|
|
343 |
st.subheader(get_translation('statistics_header', language))
|
344 |
# Zakładamy, że funkcja `get_statistics` zwraca słownik ze statystykami
|
345 |
stats = get_statistics()
|
346 |
-
st.write(f"{get_translation('total_analyses', language)}: {stats['total']}")
|
347 |
-
st.write(f"{get_translation('fraud_detected', language)}: {stats['fraud']}")
|
348 |
-
st.write(f"{get_translation('safe_detected', language)}: {stats['safe']}")
|
349 |
|
350 |
def get_translation(key, language):
|
351 |
translations = {
|
|
|
83 |
country, operator = get_phone_info(phone_number)
|
84 |
if country and operator:
|
85 |
st.write(get_translation('phone_info', language))
|
86 |
+
st.write(f"- **{get_translation('country_label', language)}:** {country}")
|
87 |
+
st.write(f"- **{get_translation('operator_label', language)}:** {operator}")
|
88 |
else:
|
89 |
st.write(get_translation('unable_to_retrieve', language))
|
90 |
|
91 |
# Sprawdzenie, czy numer jest w bazie fałszywych numerów
|
92 |
+
fraud_detected = is_fake_number(phone_number)
|
93 |
+
if fraud_detected:
|
94 |
st.warning(get_translation('number_reported_warning', language))
|
|
|
|
|
|
|
95 |
|
96 |
# Przeprowadź proste sprawdzenia heurystyczne
|
97 |
warnings = simple_checks(message, language)
|
|
|
185 |
domain_info = get_email_info(sender_email)
|
186 |
if domain_info:
|
187 |
st.write(get_translation('email_sender_info', language))
|
188 |
+
st.write(f"- **{get_translation('domain_label', language)}:** {domain_info['domain']}")
|
189 |
+
st.write(f"- **{get_translation('organization_label', language)}:** {domain_info['organization']}")
|
190 |
+
st.write(f"- **{get_translation('country_label', language)}:** {domain_info['country']}")
|
191 |
else:
|
192 |
st.write(get_translation('unable_to_retrieve_email', language))
|
193 |
|
|
|
296 |
country, operator = get_phone_info(phone_number)
|
297 |
if country and operator:
|
298 |
st.write(get_translation('phone_info', language))
|
299 |
+
st.write(f"- **{get_translation('country_label', language)}:** {country}")
|
300 |
+
st.write(f"- **{get_translation('operator_label', language)}:** {operator}")
|
301 |
else:
|
302 |
st.write(get_translation('unable_to_retrieve', language))
|
303 |
|
|
|
341 |
st.subheader(get_translation('statistics_header', language))
|
342 |
# Zakładamy, że funkcja `get_statistics` zwraca słownik ze statystykami
|
343 |
stats = get_statistics()
|
344 |
+
st.write(f"{get_translation('total_analyses', language)}: **{stats['total']}**")
|
345 |
+
st.write(f"{get_translation('fraud_detected', language)}: **{stats['fraud']}**")
|
346 |
+
st.write(f"{get_translation('safe_detected', language)}: **{stats['safe']}**")
|
347 |
|
348 |
def get_translation(key, language):
|
349 |
translations = {
|