Update app.py
Browse files
app.py
CHANGED
|
@@ -54,19 +54,24 @@ def extract_info_block(article_text):
|
|
| 54 |
else:
|
| 55 |
return None
|
| 56 |
|
| 57 |
-
# ๋ธ๋๋/๋ชจ๋ธ๋ช
์ฌ๋ฌ ๊ฐ ์ถ์ถ
|
| 58 |
def extract_product_info(article_text):
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 64 |
|
| 65 |
result = []
|
| 66 |
|
| 67 |
if brand and models:
|
| 68 |
brand_words = re.findall(r'[A-Za-z]+', brand)
|
| 69 |
-
selected_brand = ' '.join(brand_words[:2])
|
| 70 |
|
| 71 |
for model in models:
|
| 72 |
search_query = f"{selected_brand} {model}"
|
|
|
|
| 54 |
else:
|
| 55 |
return None
|
| 56 |
|
|
|
|
| 57 |
def extract_product_info(article_text):
|
| 58 |
+
brand = None
|
| 59 |
+
models = []
|
| 60 |
+
|
| 61 |
+
lines = article_text.splitlines()
|
| 62 |
+
for line in lines:
|
| 63 |
+
line = line.strip()
|
| 64 |
+
if line.startswith('<๋ธ๋๋>'):
|
| 65 |
+
brand = line.replace('<๋ธ๋๋>', '').strip()
|
| 66 |
+
elif line.startswith('<๋ชจ๋ธ๋ช
>'):
|
| 67 |
+
model = line.replace('<๋ชจ๋ธ๋ช
>', '').strip()
|
| 68 |
+
models.append(model)
|
| 69 |
|
| 70 |
result = []
|
| 71 |
|
| 72 |
if brand and models:
|
| 73 |
brand_words = re.findall(r'[A-Za-z]+', brand)
|
| 74 |
+
selected_brand = ' '.join(brand_words[:2])
|
| 75 |
|
| 76 |
for model in models:
|
| 77 |
search_query = f"{selected_brand} {model}"
|