Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1110,6 +1110,63 @@ def evaluate_component_from_country_files_only(country, material, component, tar
|
|
| 1110 |
return result
|
| 1111 |
|
| 1112 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1113 |
def process_single_ingredient(
|
| 1114 |
countries,
|
| 1115 |
single_query,
|
|
|
|
| 1110 |
return result
|
| 1111 |
|
| 1112 |
|
| 1113 |
+
|
| 1114 |
+
def make_single_display_result(final_result, country_col="", component=None):
|
| 1115 |
+
"""
|
| 1116 |
+
๋จ์ผ ์ฑ๋ถ ๊ฒ์ ๊ฒฐ๊ณผ ํ์ '๋ฐฐํฉํ๋/๊ธ์ง' ์นธ์ ๋ค์ด๊ฐ ์งง์ ํ์๋ฌธ๊ตฌ๋ฅผ ๋ง๋ ๋ค.
|
| 1117 |
+
"""
|
| 1118 |
+
component = component or {}
|
| 1119 |
+
|
| 1120 |
+
result_text = safe_str(final_result.get("๊ฒฐ๊ณผ", ""))
|
| 1121 |
+
display_text = safe_str(final_result.get("ํ์๋ฌธ๊ตฌ", ""))
|
| 1122 |
+
inci_name = safe_str(component.get("INCI Name", ""))
|
| 1123 |
+
|
| 1124 |
+
if display_text:
|
| 1125 |
+
cleaned_display = normalize_formula_country_text(
|
| 1126 |
+
display_text,
|
| 1127 |
+
country_col=country_col,
|
| 1128 |
+
inci_name=inci_name,
|
| 1129 |
+
amount_text=safe_str(component.get("In formula(w/w %)", "")),
|
| 1130 |
+
)
|
| 1131 |
+
|
| 1132 |
+
if cleaned_display:
|
| 1133 |
+
return cleaned_display
|
| 1134 |
+
|
| 1135 |
+
cleaned_result = normalize_formula_country_text(
|
| 1136 |
+
result_text,
|
| 1137 |
+
country_col=country_col,
|
| 1138 |
+
inci_name=inci_name,
|
| 1139 |
+
amount_text=safe_str(component.get("In formula(w/w %)", "")),
|
| 1140 |
+
)
|
| 1141 |
+
|
| 1142 |
+
if cleaned_result:
|
| 1143 |
+
return cleaned_result
|
| 1144 |
+
|
| 1145 |
+
return NEED_CHECK_TEXT
|
| 1146 |
+
|
| 1147 |
+
|
| 1148 |
+
def simplify_single_note(note):
|
| 1149 |
+
"""
|
| 1150 |
+
๋จ์ผ ์ฑ๋ถ ๊ฒ์ ๊ฒฐ๊ณผ์ ๋น๊ณ ๋ฅผ ๋๋ฌด ๊ธธ์ง ์๊ฒ ์ ๋ฆฌํ๋ค.
|
| 1151 |
+
"""
|
| 1152 |
+
note = safe_str(note)
|
| 1153 |
+
|
| 1154 |
+
if not note or note == "-":
|
| 1155 |
+
return ""
|
| 1156 |
+
|
| 1157 |
+
replace_map = {
|
| 1158 |
+
"๋ก์ปฌ ์ ํ์ฑ๋ถ ๋ชฉ๋ก์๋ ์์ผ๋ ํด๋น ๊ตญ๊ฐ ํ๋๊ฐ ๋ฏธ๋ฑ๋ก. Pass ์ฒ๋ฆฌ ๊ธ์ง.": "ํด๋น ๊ตญ๊ฐ ํ๋๊ฐ ๋ฏธ๋ฑ๋ก",
|
| 1159 |
+
"๊ณ ์ํ๊ตฐ ํ๋ณด ์ฑ๋ถ์ด๋ฏ๋ก ๊ทผ๊ฑฐ ๋ฏธ๊ฒ์ถ๋ง์ผ๋ก Pass ์ฒ๋ฆฌํ์ง ์์": "๊ทผ๊ฑฐ ๋ฏธ๊ฒ์ถ, ํ์ธ ํ์",
|
| 1160 |
+
"๊ณ ์ํ๊ตฐ ํ๋ณด์ด๋ ๊ตญ๊ฐ๋ณ ๊ท์ ํ์ผ์์ ์ง์ ๊ทผ๊ฑฐ ๋ฏธ๊ฒ์ถ. Pass ์ฒ๋ฆฌํ์ง ์์.": "๊ตญ๊ฐ๋ณ ๊ท์ ํ์ผ ๋ด ์ง์ ๊ทผ๊ฑฐ ๋ฏธ๊ฒ์ถ",
|
| 1161 |
+
"ํด๋น ๊ตญ๊ฐ/์ฑ๋ ๊ท์ DB ์์. ๊ณ ์ํ๊ตฐ ํ๋ณด์ด๋ฏ๋ก Pass ์ฒ๋ฆฌํ์ง ์์.": "ํด๋น ๊ตญ๊ฐ ๊ท์ DB ์์",
|
| 1162 |
+
"ํฅ๋ฃ๋ ์ธ๋ถ ๊ตฌ์ฑ์ฑ๋ถ ๋ฐ ์๋ ๋ฅด๊ฒ ํ์๋์ ์ฌ๋ถ ํ์ธ ํ์. ์๋ Pass ์ฒ๋ฆฌ ๊ธ์ง.": "ํฅ๋ฃ ์ธ๋ถ ์กฐ์ฑ ๋ฐ ์๋ ๋ฅด๊ฒ ํ์ธ ํ์",
|
| 1163 |
+
"์ ์ ์/Water/Aqua ๊ธฐ๋ณธ Pass ์ฒ๋ฆฌ": "์ ์ ์/Water/Aqua ๊ธฐ๋ณธ Pass ์ฒ๋ฆฌ",
|
| 1164 |
+
"์ผ๋ณธ ์์ถ์ฉ ์ ํ ์ฌ์ฉ ๋ถ๊ฐ ์ฌ๋ถ ํ์ธ ํ์": "์ผ๋ณธ ์์ถ์ฉ ์ ํ ์ฌ์ฉ ๋ถ๊ฐ ์ฌ๋ถ ํ์ธ ํ์",
|
| 1165 |
+
}
|
| 1166 |
+
|
| 1167 |
+
return replace_map.get(note, note)
|
| 1168 |
+
|
| 1169 |
+
|
| 1170 |
def process_single_ingredient(
|
| 1171 |
countries,
|
| 1172 |
single_query,
|