Update app.py
Browse files
app.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
# -*- coding: utf-8 -*-
|
| 2 |
"""
|
| 3 |
-
AI λ΄μ€ & νκΉ
νμ΄μ€ νΈλ λ© LLM λΆμ μΉμ± (μμ ν v3.
|
| 4 |
νμΌλͺ
: app_advanced.py
|
| 5 |
|
| 6 |
μ£Όμ κΈ°λ₯:
|
|
@@ -8,7 +8,7 @@ AI λ΄μ€ & νκΉ
νμ΄μ€ νΈλ λ© LLM λΆμ μΉμ± (μμ ν v3.2)
|
|
| 8 |
2. AI Times μ€μκ° λ΄μ€ ν¬λ‘€λ§ (2κ° μΉμ
)
|
| 9 |
3. μ€μ Hugging Face Trending API μ°λ (λͺ¨λΈ/μ€νμ΄μ€ 30μ)
|
| 10 |
4. Fireworks AI (Qwen3-235B) μ€μκ° LLM λΆμ
|
| 11 |
-
- λ΄μ€
|
| 12 |
- λͺ¨λΈ μΉ΄λ μλ λΆμ (README.md)
|
| 13 |
- μ€νμ΄μ€ μ½λ μλ λΆμ (app.py)
|
| 14 |
5. ν UI (λ΄μ€/λͺ¨λΈ/μ€νμ΄μ€)
|
|
@@ -545,7 +545,7 @@ HTML_TEMPLATE = """
|
|
| 545 |
<body>
|
| 546 |
<div class="container">
|
| 547 |
<h1>π€ AI λ΄μ€ & νκΉ
νμ΄μ€ LLM λΆμ</h1>
|
| 548 |
-
<p class="subtitle"
|
| 549 |
|
| 550 |
<!-- ν΅κ³ μΉ΄λ -->
|
| 551 |
<div class="stats">
|
|
@@ -676,7 +676,7 @@ HTML_TEMPLATE = """
|
|
| 676 |
</div>
|
| 677 |
|
| 678 |
<div class="space-analysis">
|
| 679 |
-
<strong>π
|
| 680 |
{{ space.simple_explanation }}
|
| 681 |
</div>
|
| 682 |
|
|
@@ -722,12 +722,12 @@ HTML_TEMPLATE = """
|
|
| 722 |
|
| 723 |
<!-- νΈν° -->
|
| 724 |
<div class="footer">
|
| 725 |
-
<p>π€ AI λ΄μ€ LLM λΆμ μμ€ν
v3.
|
| 726 |
<p style="margin-top: 10px; font-size: 0.9em;">
|
| 727 |
πΎ SQLite DB μꡬ μ μ₯ | π AI Times μ€μκ° ν¬λ‘€λ§ | π€ Hugging Face Trending API | π§ Powered by Fireworks AI (Qwen3-235B)
|
| 728 |
</p>
|
| 729 |
<p style="margin-top: 10px; font-size: 0.85em; color: #999;">
|
| 730 |
-
λ°μ΄ν° μΆμ²: AI Times (μ€μκ° ν¬λ‘€λ§), Hugging Face | μ€μκ° λΆμ: Fireworks AI
|
| 731 |
</p>
|
| 732 |
</div>
|
| 733 |
</div>
|
|
@@ -1096,32 +1096,32 @@ class LLMAnalyzer:
|
|
| 1096 |
return None
|
| 1097 |
|
| 1098 |
def analyze_news_simple(self, title: str, content: str = "") -> Dict:
|
| 1099 |
-
"""λ΄μ€ κΈ°μ¬λ₯Ό
|
| 1100 |
|
| 1101 |
analysis_templates = {
|
| 1102 |
"μ±GPT": {
|
| 1103 |
-
"summary": "λ§μ΄ν¬λ‘μννΈ(MS)
|
| 1104 |
-
"significance": "
|
| 1105 |
"impact_level": "high",
|
| 1106 |
"impact_text": "λμ",
|
| 1107 |
-
"impact_description": "AI
|
| 1108 |
-
"action": "μ±GPT κ°μ AI λꡬλ₯Ό
|
| 1109 |
},
|
| 1110 |
"GPU": {
|
| 1111 |
-
"summary": "
|
| 1112 |
-
"significance": "
|
| 1113 |
"impact_level": "medium",
|
| 1114 |
"impact_text": "μ€κ°",
|
| 1115 |
-
"impact_description": "AI
|
| 1116 |
-
"action": "
|
| 1117 |
},
|
| 1118 |
"μλΌ": {
|
| 1119 |
-
"summary": "μ€νAI
|
| 1120 |
-
"significance": "
|
| 1121 |
"impact_level": "high",
|
| 1122 |
"impact_text": "λμ",
|
| 1123 |
-
"impact_description": "
|
| 1124 |
-
"action": "
|
| 1125 |
}
|
| 1126 |
}
|
| 1127 |
|
|
@@ -1130,18 +1130,18 @@ class LLMAnalyzer:
|
|
| 1130 |
if keyword.lower() in title.lower():
|
| 1131 |
return template
|
| 1132 |
|
| 1133 |
-
# κΈ°λ³Έ λΆμ
|
| 1134 |
return {
|
| 1135 |
-
"summary": f"'{title}'
|
| 1136 |
-
"significance": "AI
|
| 1137 |
"impact_level": "medium",
|
| 1138 |
"impact_text": "μ€κ°",
|
| 1139 |
-
"impact_description": "AI κΈ°μ μ λ°μ μ
|
| 1140 |
-
"action": "AI
|
| 1141 |
}
|
| 1142 |
|
| 1143 |
def analyze_model(self, model_name: str, task: str, downloads: int) -> str:
|
| 1144 |
-
"""νκΉ
νμ΄μ€ λͺ¨λΈ λΆμ - λͺ¨λΈ μΉ΄λλ₯Ό LLMμΌλ‘ λΆμ"""
|
| 1145 |
|
| 1146 |
# 1. λͺ¨λΈ μΉ΄λ κ°μ Έμ€κΈ°
|
| 1147 |
model_card = self.fetch_model_card(model_name)
|
|
@@ -1152,7 +1152,7 @@ class LLMAnalyzer:
|
|
| 1152 |
messages = [
|
| 1153 |
{
|
| 1154 |
"role": "system",
|
| 1155 |
-
"content": "λΉμ μ
|
| 1156 |
},
|
| 1157 |
{
|
| 1158 |
"role": "user",
|
|
@@ -1160,12 +1160,12 @@ class LLMAnalyzer:
|
|
| 1160 |
|
| 1161 |
{model_card}
|
| 1162 |
|
| 1163 |
-
μ΄ λͺ¨λΈμ
|
| 1164 |
-
1. μ΄ λͺ¨λΈμ΄ 무μμ νλμ§
|
| 1165 |
-
2. μ΄λ€
|
| 1166 |
-
3.
|
| 1167 |
|
| 1168 |
-
|
| 1169 |
}
|
| 1170 |
]
|
| 1171 |
|
|
@@ -1177,31 +1177,31 @@ class LLMAnalyzer:
|
|
| 1177 |
except Exception as e:
|
| 1178 |
print(f" β οΈ λͺ¨λΈ λΆμ LLM μ€λ₯: {e}")
|
| 1179 |
|
| 1180 |
-
# 3. Fallback: ν
νλ¦Ώ κΈ°λ° μ€λͺ
|
| 1181 |
task_explanations = {
|
| 1182 |
-
"text-generation": "
|
| 1183 |
-
"image-to-text": "
|
| 1184 |
-
"text-to-image": "
|
| 1185 |
-
"translation": "
|
| 1186 |
-
"question-answering": "
|
| 1187 |
-
"summarization": "κΈ΄
|
| 1188 |
-
"text-classification": "
|
| 1189 |
-
"token-classification": "
|
| 1190 |
-
"fill-mask": "
|
| 1191 |
}
|
| 1192 |
|
| 1193 |
-
task_desc = task_explanations.get(task, "
|
| 1194 |
|
| 1195 |
if downloads > 10000000:
|
| 1196 |
-
popularity = "
|
| 1197 |
elif downloads > 1000000:
|
| 1198 |
-
popularity = "
|
| 1199 |
elif downloads > 100000:
|
| 1200 |
-
popularity = "
|
| 1201 |
else:
|
| 1202 |
-
popularity = "
|
| 1203 |
|
| 1204 |
-
return f"μ΄ λͺ¨λΈμ {task_desc}
|
| 1205 |
|
| 1206 |
def analyze_space(self, space_name: str, space_id: str, description: str) -> Dict:
|
| 1207 |
"""νκΉ
νμ΄μ€ μ€νμ΄μ€ λΆμ - app.pyλ₯Ό LLMμΌλ‘ λΆμ"""
|
|
@@ -1215,7 +1215,7 @@ class LLMAnalyzer:
|
|
| 1215 |
messages = [
|
| 1216 |
{
|
| 1217 |
"role": "system",
|
| 1218 |
-
"content": "λΉμ μ
|
| 1219 |
},
|
| 1220 |
{
|
| 1221 |
"role": "user",
|
|
@@ -1223,12 +1223,12 @@ class LLMAnalyzer:
|
|
| 1223 |
|
| 1224 |
{app_code}
|
| 1225 |
|
| 1226 |
-
μ΄ μ±μ
|
| 1227 |
-
1. μ΄ μ±μ΄
|
| 1228 |
-
2. μ΄λ€
|
| 1229 |
-
3.
|
| 1230 |
|
| 1231 |
-
|
| 1232 |
}
|
| 1233 |
]
|
| 1234 |
|
|
@@ -1261,9 +1261,9 @@ class LLMAnalyzer:
|
|
| 1261 |
except Exception as e:
|
| 1262 |
print(f" β οΈ μ€νμ΄μ€ λΆμ LLM μ€λ₯: {e}")
|
| 1263 |
|
| 1264 |
-
# 3. Fallback: ν
νλ¦Ώ κΈ°λ° μ€λͺ
|
| 1265 |
return {
|
| 1266 |
-
"simple_explanation": f"{space_name}λ
|
| 1267 |
"tech_stack": ["Python", "Gradio", "Transformers", "PyTorch"]
|
| 1268 |
}
|
| 1269 |
|
|
@@ -1305,54 +1305,37 @@ class AdvancedAIAnalyzer:
|
|
| 1305 |
response.raise_for_status()
|
| 1306 |
response.encoding = 'utf-8'
|
| 1307 |
|
| 1308 |
-
|
| 1309 |
|
| 1310 |
-
#
|
| 1311 |
-
|
|
|
|
|
|
|
| 1312 |
|
| 1313 |
-
|
|
|
|
|
|
|
|
|
|
| 1314 |
|
| 1315 |
articles_found = 0
|
| 1316 |
-
for
|
| 1317 |
try:
|
| 1318 |
-
|
| 1319 |
-
|
| 1320 |
-
link = article_tag.get('href', '')
|
| 1321 |
-
|
| 1322 |
-
# λ§ν¬ μ κ·ν
|
| 1323 |
-
if link and not link.startswith('http'):
|
| 1324 |
-
if link.startswith('/'):
|
| 1325 |
-
link = 'https://www.aitimes.com' + link
|
| 1326 |
-
else:
|
| 1327 |
-
link = 'https://www.aitimes.com/' + link
|
| 1328 |
|
| 1329 |
# μ λͺ©μ΄ λ무 μ§§μΌλ©΄ μ€ν΅
|
| 1330 |
-
if
|
| 1331 |
continue
|
| 1332 |
|
| 1333 |
-
#
|
| 1334 |
-
|
| 1335 |
-
|
| 1336 |
-
|
| 1337 |
-
# λΆλͺ¨μ λͺ¨λ ν
μ€νΈμμ λ μ§ ν¨ν΄ μ°ΎκΈ°
|
| 1338 |
-
if parent:
|
| 1339 |
-
parent_text = parent.get_text()
|
| 1340 |
-
date_match = re.search(r'(\d{2}-\d{2}\s+\d{2}:\d{2})', parent_text)
|
| 1341 |
-
if date_match:
|
| 1342 |
-
date_text = date_match.group(1)
|
| 1343 |
|
| 1344 |
-
#
|
| 1345 |
-
|
| 1346 |
-
|
| 1347 |
-
sibling_text = sibling.get_text()
|
| 1348 |
-
date_match = re.search(r'(\d{2}-\d{2}\s+\d{2}:\d{2})', sibling_text)
|
| 1349 |
-
if date_match:
|
| 1350 |
-
date_text = date_match.group(1)
|
| 1351 |
-
break
|
| 1352 |
|
| 1353 |
-
|
| 1354 |
-
if not date_text:
|
| 1355 |
-
date_text = today
|
| 1356 |
|
| 1357 |
# μ€λ λ μ§λ§ νν°λ§
|
| 1358 |
if today not in date_text:
|
|
@@ -1374,7 +1357,7 @@ class AdvancedAIAnalyzer:
|
|
| 1374 |
except Exception as e:
|
| 1375 |
continue
|
| 1376 |
|
| 1377 |
-
print(f" β {articles_found}κ° μ€λμ κΈ°μ¬
|
| 1378 |
time.sleep(1) # μλ² λΆν λ°©μ§
|
| 1379 |
|
| 1380 |
except Exception as e:
|
|
@@ -1741,7 +1724,7 @@ def health():
|
|
| 1741 |
return jsonify({
|
| 1742 |
"status": "healthy",
|
| 1743 |
"service": "AI News LLM Analyzer",
|
| 1744 |
-
"version": "3.
|
| 1745 |
"database": {
|
| 1746 |
"connected": True,
|
| 1747 |
"news_count": news_count,
|
|
@@ -1770,14 +1753,14 @@ if __name__ == '__main__':
|
|
| 1770 |
print(f"""
|
| 1771 |
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 1772 |
β β
|
| 1773 |
-
β π€ AI λ΄μ€ & νκΉ
νμ΄μ€ LLM λΆμ μΉμ± v3.
|
| 1774 |
β β
|
| 1775 |
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 1776 |
|
| 1777 |
β¨ μ£Όμ κΈ°λ₯:
|
| 1778 |
β’ πΎ SQLite DB μꡬ μ€ν 리μ§
|
| 1779 |
β’ π AI Times μ€μκ° λ΄μ€ ν¬λ‘€λ§ (2κ° μΉμ
)
|
| 1780 |
-
β’ π° λ΄μ€
|
| 1781 |
β’ π€ νκΉ
νμ΄μ€ νΈλ λ© λͺ¨λΈ TOP 30 (λͺ¨λΈ μΉ΄λ λΆμ)
|
| 1782 |
β’ π νκΉ
νμ΄μ€ νΈλ λ© μ€νμ΄μ€ TOP 30 (app.py λΆμ)
|
| 1783 |
β’ π§ Fireworks AI (Qwen3-235B) μ€μκ° LLM λΆμ
|
|
|
|
| 1 |
# -*- coding: utf-8 -*-
|
| 2 |
"""
|
| 3 |
+
AI λ΄μ€ & νκΉ
νμ΄μ€ νΈλ λ© LLM λΆμ μΉμ± (μμ ν v3.3)
|
| 4 |
νμΌλͺ
: app_advanced.py
|
| 5 |
|
| 6 |
μ£Όμ κΈ°λ₯:
|
|
|
|
| 8 |
2. AI Times μ€μκ° λ΄μ€ ν¬λ‘€λ§ (2κ° μΉμ
)
|
| 9 |
3. μ€μ Hugging Face Trending API μ°λ (λͺ¨λΈ/μ€νμ΄μ€ 30μ)
|
| 10 |
4. Fireworks AI (Qwen3-235B) μ€μκ° LLM λΆμ
|
| 11 |
+
- λ΄μ€ μ€κ³ κ΅μ μμ€ λΆμ (3-5μ€ μμΈ μμ½)
|
| 12 |
- λͺ¨λΈ μΉ΄λ μλ λΆμ (README.md)
|
| 13 |
- μ€νμ΄μ€ μ½λ μλ λΆμ (app.py)
|
| 14 |
5. ν UI (λ΄μ€/λͺ¨λΈ/μ€νμ΄μ€)
|
|
|
|
| 545 |
<body>
|
| 546 |
<div class="container">
|
| 547 |
<h1>π€ AI λ΄μ€ & νκΉ
νμ΄μ€ LLM λΆμ</h1>
|
| 548 |
+
<p class="subtitle">μ€κ³ κ΅μμ μν AI νΈλ λ λΆμ μμ€ν
π</p>
|
| 549 |
|
| 550 |
<!-- ν΅κ³ μΉ΄λ -->
|
| 551 |
<div class="stats">
|
|
|
|
| 676 |
</div>
|
| 677 |
|
| 678 |
<div class="space-analysis">
|
| 679 |
+
<strong>π μμΈ μ€λͺ
:</strong><br>
|
| 680 |
{{ space.simple_explanation }}
|
| 681 |
</div>
|
| 682 |
|
|
|
|
| 722 |
|
| 723 |
<!-- νΈν° -->
|
| 724 |
<div class="footer">
|
| 725 |
+
<p>π€ AI λ΄μ€ LLM λΆμ μμ€ν
v3.3</p>
|
| 726 |
<p style="margin-top: 10px; font-size: 0.9em;">
|
| 727 |
πΎ SQLite DB μꡬ μ μ₯ | π AI Times μ€μκ° ν¬λ‘€λ§ | π€ Hugging Face Trending API | π§ Powered by Fireworks AI (Qwen3-235B)
|
| 728 |
</p>
|
| 729 |
<p style="margin-top: 10px; font-size: 0.85em; color: #999;">
|
| 730 |
+
λ°μ΄ν° μΆμ²: AI Times (μ€μκ° ν¬λ‘€λ§), Hugging Face | μ€μκ° λΆμ: Fireworks AI | μ€κ³ κ΅μ μμ€ λΆμ
|
| 731 |
</p>
|
| 732 |
</div>
|
| 733 |
</div>
|
|
|
|
| 1096 |
return None
|
| 1097 |
|
| 1098 |
def analyze_news_simple(self, title: str, content: str = "") -> Dict:
|
| 1099 |
+
"""λ΄μ€ κΈ°μ¬λ₯Ό μ€κ³ κ΅μ μμ€μΌλ‘ λΆμ"""
|
| 1100 |
|
| 1101 |
analysis_templates = {
|
| 1102 |
"μ±GPT": {
|
| 1103 |
+
"summary": "λ§μ΄ν¬λ‘μννΈ(MS)λ μ±GPTμ νλ°μ μΈ μ¬μ©λ μ¦κ°λ‘ μΈν΄ λ°μ΄ν°μΌν° μ©λμ΄ λΆμ‘±ν μν©μ μ§λ©΄νμ΅λλ€. νμ¬ λ―Έκ΅ λ΄ μ¬λ¬ μ§μμμ 물리μ 곡κ°κ³Ό μλ²κ° λͺ¨λ λΆμ‘±ν μνμ΄λ©°, μ΄λ‘ μΈν΄ λ²μ§λμμ ν
μ¬μ€ λ± ν΅μ¬ μ§μμμλ 2026λ
μλ°κΈ°κΉμ§ μ κ· Azure ν΄λΌμ°λ ꡬλ
μ΄ μ νλ κ²μΌλ‘ μμλ©λλ€. μ΄λ μμ±ν AI μλΉμ€μ κΈκ²©ν μ±μ₯μ΄ κ°μ Έμ¨ μΈνλΌ κ³΅κΈ λ¬Έμ λ₯Ό μ¬μ€ν 보μ¬μ£Όλ μ¬λ‘μ
λλ€.",
|
| 1104 |
+
"significance": "μ΄ λ΄μ€λ AI κΈ°μ μ λμ€ν μλκ° κΈ°μ
λ€μ μμμ ν¨μ¬ λ°μ΄λκ³ μμμ 보μ¬μ€λλ€. MS κ°μ κΈλ‘λ² IT κΈ°μ
λ AI μμλ₯Ό λ°λΌμ‘κΈ° μν΄ κ³ κ΅°λΆν¬νκ³ μμΌλ©°, μ΄λ AIκ° λ¨μν μ νμ΄ μλ μ°μ
μ λ°μ λ³νμν€λ ν΅μ¬ κΈ°μ μμ μ¦λͺ
ν©λλ€.",
|
| 1105 |
"impact_level": "high",
|
| 1106 |
"impact_text": "λμ",
|
| 1107 |
+
"impact_description": "ν΄λΌμ°λ μΈνλΌ λΆμ‘±μ AI μλΉμ€ νμ₯μ μ§μ μ μΈ μν₯μ λ―ΈμΉλ©°, ν₯ν AI κΈ°μ μ κ·Όμ±κ³Ό λΉμ© ꡬ쑰λ₯Ό λ³νμν¬ μ μμ΅λλ€.",
|
| 1108 |
+
"action": "μ±GPTλ Claude κ°μ AI λꡬλ₯Ό νμ©ν νμ΅ λ°©λ²μ μ΅νμΈμ. λ³΄κ³ μ μμ±, μ½λ© νμ΅, μΈκ΅μ΄ κ³΅λΆ λ± λ€μν λΆμΌμμ AIλ₯Ό νμ΅ λ³΄μ‘° λκ΅¬λ‘ μ¬μ©ν μ μμ΅λλ€."
|
| 1109 |
},
|
| 1110 |
"GPU": {
|
| 1111 |
+
"summary": "λ―Έκ΅ μ λΆκ° μλμ미리νΈ(UAE)μ μ΅μ²¨λ¨ AI μΉ©(GPU) μμΆμ μΉμΈνμ΅λλ€. μ΄λ² μΉμΈμ UAE λ΄ λ―Έκ΅ κΈ°μ
μ΄ μ΄μνλ λ°μ΄ν°μΌν°μ νμ λλ©°, μ€νAI μ μ© 5GW κ·λͺ¨ λ°μ΄ν°μΌν° ꡬμΆμ μ¬μ©λ μμ μ
λλ€. GPUλ AI λͺ¨λΈ νμ΅μ νμμ μΈ νλμ¨μ΄λ‘, μλΉλμκ° μμ₯μ μ£Όλνκ³ μμΌλ©° μ΄λ² κ²°μ μΌλ‘ μλΉλμμ μκ°μ΄μ‘μ΄ 5μ‘° λ¬λ¬μ κ·Όμ ν κ²μΌλ‘ μ λ§λ©λλ€.",
|
| 1112 |
+
"significance": "μ΄λ λ―Έκ΅μ AI κΈ°μ μμΆ μ μ±
λ³νλ₯Ό 보μ¬μ£Όλ μ€μν μ νΈμ
λλ€. κΈ°μ ν¨κΆ κ²½μ μμμλ μ λ΅μ λλ§Ήκ΅κ³Όμ νλ ₯μ ν΅ν΄ AI μνκ³λ₯Ό νμ₯νλ €λ λ―Έκ΅μ μλλ₯Ό μΏλ³Ό μ μμ΅λλ€.",
|
| 1113 |
"impact_level": "medium",
|
| 1114 |
"impact_text": "μ€κ°",
|
| 1115 |
+
"impact_description": "AI νλμ¨μ΄ 곡κΈλ§μ μ§μ νμ λ³νλ κΈλ‘λ² AI μ°μ
μ§νλμ μν₯μ λ―ΈμΉ μ μμΌλ©°, νΉν λ°λ체 μ°μ
κ³Ό κ΅μ κ΄κ³μ μ€μν μλ―Έλ₯Ό κ°μ§λλ€.",
|
| 1116 |
+
"action": "μ»΄ν¨ν° νλμ¨μ΄, νΉν GPUμ μλ μ리μ AI νμ΅μμμ μν μ 곡λΆν΄λ³΄μΈμ. λ³λ ¬ μ²λ¦¬, νλ ¬ μ°μ° λ±μ κ°λ
μ μ΄ν΄νλ©΄ AI κΈ°μ μ κ·Όκ°μ νμ
ν μ μμ΅λλ€."
|
| 1117 |
},
|
| 1118 |
"μλΌ": {
|
| 1119 |
+
"summary": "μ€νAIμ AI λμμ μμ± μ± 'μλΌ(Sora)'κ° μΆμ 5μΌ λ§μ 100λ§ λ€μ΄λ‘λλ₯Ό λννμ΅λλ€. μ΄λ μ±GPTλ³΄λ€ λΉ λ₯Έ μ±μ₯ μλμ΄λ©°, μ΄λ μ μ©(invite-only) μ±μμ κ³ λ €νλ©΄ λμ± λλΌμ΄ κΈ°λ‘μ
λλ€. μλΌλ ν
μ€νΈ ν둬ννΈλ§μΌλ‘ κ³ νμ§ λμμμ μμ±ν μ μλ μμ±ν AI λꡬλ‘, λ―Έκ΅κ³Ό μΊλλ€μμ iOS μ μ©μΌλ‘ μΆμλμμ΅λλ€.",
|
| 1120 |
+
"significance": "ν
μ€νΈλ₯Ό μ΄λ―Έμ§λ‘ λ³ννλ κΈ°μ μμ λ λμκ° λμμ μμ±κΉμ§ κ°λ₯ν΄μ§ κ²μ AI κΈ°μ μ μ§νλ₯Ό 보μ¬μ€λλ€. μ½ν
μΈ μ μμ λ―Όμ£Όνκ° κ°μνλκ³ μμΌλ©°, λꡬλ μ½κ² κ³ νμ§ μμμ λ§λ€ μ μλ μλκ° μ΄λ¦¬κ³ μμ΅λλ€.",
|
| 1121 |
"impact_level": "high",
|
| 1122 |
"impact_text": "λμ",
|
| 1123 |
+
"impact_description": "μμ μ μ μ°μ
μ ν¨λ¬λ€μμ΄ λ³ννκ³ μμΌλ©°, κ΅μ‘, λ§μΌν
, μν°ν
μΈλ¨ΌνΈ λ± λ€μν λΆμΌμμ AI λμμ μμ± κΈ°μ μ νμ©μ΄ μ¦κ°ν κ²μΌλ‘ μμλ©λλ€.",
|
| 1124 |
+
"action": "AI λμμ μμ± λꡬμ κ°λ₯μ±κ³Ό νκ³λ₯Ό νꡬν΄λ³΄μΈμ. μ°½μμ μΈ μμ΄λμ΄λ₯Ό μκ°ννλ λ°©λ²μ λ°°μ°κ³ , λμμ λ₯νμ΄ν¬ κ°μ μ
μ© μ¬λ‘μ λν λΉνμ μ¬κ³ λ ν¨μνμΈμ."
|
| 1125 |
}
|
| 1126 |
}
|
| 1127 |
|
|
|
|
| 1130 |
if keyword.lower() in title.lower():
|
| 1131 |
return template
|
| 1132 |
|
| 1133 |
+
# κΈ°λ³Έ λΆμ (μ€κ³ κ΅μ μμ€)
|
| 1134 |
return {
|
| 1135 |
+
"summary": f"'{title}'μ κ΄λ ¨λ μ΅μ AI κΈ°μ λν₯μ
λλ€. μΈκ³΅μ§λ₯ λΆμΌλ λΉ λ₯΄κ² λ°μ νκ³ μμΌλ©°, μ΄λ¬ν κΈ°μ λ³νλ μ°λ¦¬μ μΌμμνκ³Ό λ―Έλ μ§μ
μΈκ³μ ν° μν₯μ λ―ΈμΉ κ²μΌλ‘ μμλ©λλ€. κ΄λ ¨ κΈ°μ μ μ리μ μ¬νμ νκΈν¨κ³Όλ₯Ό ν¨κ» μ΄ν΄νλ κ²μ΄ μ€μν©λλ€.",
|
| 1136 |
+
"significance": "AI κΈ°μ μ λ°μ μ λ¨μν κΈ°μ νμ μ λμ΄ μ¬ν, κ²½μ , μ€λ¦¬μ μΈ‘λ©΄μμ λ€μν λ
Όμλ₯Ό λΆλ¬μΌμΌν€κ³ μμ΅λλ€. μ΄λ¬ν λ³νλ₯Ό μ΄ν΄νκ³ λλΉνλ κ²μ΄ λ―Έλ μΈλμκ² μ€μν μλμ
λλ€.",
|
| 1137 |
"impact_level": "medium",
|
| 1138 |
"impact_text": "μ€κ°",
|
| 1139 |
+
"impact_description": "AI κΈ°μ μ λ°μ μ κ΅μ‘, μ·¨μ
, μ°μ
μ λ°μ κ±Έμ³ κ΅¬μ‘°μ λ³νλ₯Ό κ°μ Έμ¬ κ²μ΄λ©°, μ΄μ λν μ΄ν΄μ μ€λΉκ° νμν©λλ€.",
|
| 1140 |
+
"action": "AI κΈ°μ μ κΈ°λ³Έ μ리λ₯Ό νμ΅νκ³ , κ΄λ ¨ νλ‘κ·Έλλ°(Python λ±)μ΄λ λ°μ΄ν° κ³Όν κΈ°μ΄λ₯Ό 곡λΆν΄λ³΄μΈμ. λν AI μ€λ¦¬μ μ¬νμ μν₯μ λν΄μλ λΉνμ μΌλ‘ μ¬κ³ νλ μ΅κ΄μ κΈ°λ₯΄μΈμ."
|
| 1141 |
}
|
| 1142 |
|
| 1143 |
def analyze_model(self, model_name: str, task: str, downloads: int) -> str:
|
| 1144 |
+
"""νκΉ
νμ΄μ€ λͺ¨λΈ λΆμ - λͺ¨λΈ μΉ΄λλ₯Ό LLMμΌλ‘ μ€κ³ κ΅μ μμ€ λΆμ"""
|
| 1145 |
|
| 1146 |
# 1. λͺ¨λΈ μΉ΄λ κ°μ Έμ€κΈ°
|
| 1147 |
model_card = self.fetch_model_card(model_name)
|
|
|
|
| 1152 |
messages = [
|
| 1153 |
{
|
| 1154 |
"role": "system",
|
| 1155 |
+
"content": "λΉμ μ μ€κ³ κ΅μμ΄ μ΄ν΄ν μ μκ² AI λͺ¨λΈμ μ λ¬Έμ μ΄λ©΄μλ λͺ
ννκ² μ€λͺ
νλ μ λ¬Έκ°μ
λλ€. νκ΅μ΄λ‘ λ΅λ³νμΈμ."
|
| 1156 |
},
|
| 1157 |
{
|
| 1158 |
"role": "user",
|
|
|
|
| 1160 |
|
| 1161 |
{model_card}
|
| 1162 |
|
| 1163 |
+
μ΄ λͺ¨λΈμ μ€κ³ κ΅μμ΄ μ΄ν΄ν μ μλλ‘ 3-5λ¬Έμ₯μΌλ‘ μ€λͺ
ν΄μ£ΌμΈμ. λ€μ λ΄μ©μ ν¬ν¨νμΈμ:
|
| 1164 |
+
1. μ΄ λͺ¨λΈμ΄ 무μμ νλμ§ (ꡬ체μ μΈ κΈ°λ₯)
|
| 1165 |
+
2. μ΄λ€ κΈ°μ μ νΉμ§μ΄λ κ°μ μ΄ μλμ§
|
| 1166 |
+
3. μ€μ λ‘ μ΄λ€ λΆμΌμμ νμ©λ μ μλμ§
|
| 1167 |
|
| 1168 |
+
μ λ¬Έ μ©μ΄λ κ°λ¨ν μ€λͺ
νλ©΄μ μ¬μ©νκ³ , 3-5λ¬Έμ₯μ νκ΅μ΄λ‘ μμ±νμΈμ."""
|
| 1169 |
}
|
| 1170 |
]
|
| 1171 |
|
|
|
|
| 1177 |
except Exception as e:
|
| 1178 |
print(f" β οΈ λͺ¨λΈ λΆμ LLM μ€λ₯: {e}")
|
| 1179 |
|
| 1180 |
+
# 3. Fallback: ν
νλ¦Ώ κΈ°λ° μ€λͺ
(μ€κ³ κ΅μ μμ€)
|
| 1181 |
task_explanations = {
|
| 1182 |
+
"text-generation": "μμ°μ΄λ₯Ό μμ±νλ μΈμ΄ λͺ¨λΈλ‘, μ£Όμ΄μ§ λ§₯λ½μ μ΄ν΄νκ³ μ΄μ΄μ§λ ν
μ€νΈλ₯Ό μμ±",
|
| 1183 |
+
"image-to-text": "μ΄λ―Έμ§λ₯Ό λΆμνμ¬ μκ°μ λ΄μ©μ μμ°μ΄λ‘ μ€λͺ
νλ λΉμ -μΈμ΄ λͺ¨λΈ",
|
| 1184 |
+
"text-to-image": "ν
μ€νΈ ν둬ννΈλ₯Ό ν΄μνμ¬ μ΄λ―Έμ§λ₯Ό μμ±νλ νμ° λͺ¨λΈ",
|
| 1185 |
+
"translation": "λ€κ΅μ΄ λ²μμ μννλ μνμ€-ν¬-μνμ€ λͺ¨λΈ",
|
| 1186 |
+
"question-answering": "μ§λ¬Έμ λ§₯λ½μ μ΄ν΄νκ³ μ νν λ΅λ³μ μΆμΆνλ λͺ¨λΈ",
|
| 1187 |
+
"summarization": "κΈ΄ ν
μ€νΈμ ν΅μ¬ λ΄μ©μ μΆμΆνμ¬ μμ½νλ λͺ¨λΈ",
|
| 1188 |
+
"text-classification": "ν
μ€νΈμ κ°μ , μ£Όμ , μΉ΄ν
κ³ λ¦¬ λ±μ λΆλ₯νλ λͺ¨λΈ",
|
| 1189 |
+
"token-classification": "κ°μ²΄λͺ
μΈμ(NER) λ± ν ν° λ¨μ λΆλ₯λ₯Ό μννλ λͺ¨λΈ",
|
| 1190 |
+
"fill-mask": "λ¬Έλ§₯μ λΆμνμ¬ λ§μ€νΉλ λ¨μ΄λ₯Ό μμΈ‘νλ μΈμ΄ λͺ¨λΈ"
|
| 1191 |
}
|
| 1192 |
|
| 1193 |
+
task_desc = task_explanations.get(task, "νΉμ AI μμ
μ μννλ μ λ¬Ένλ λͺ¨λΈ")
|
| 1194 |
|
| 1195 |
if downloads > 10000000:
|
| 1196 |
+
popularity = "λ§€μ° λμ λ€μ΄λ‘λ μλ₯Ό κΈ°λ‘νλ©° μ
κ³μμ κ΄λ²μνκ² νμ©λκ³ μλ"
|
| 1197 |
elif downloads > 1000000:
|
| 1198 |
+
popularity = "μλΉν λ€μ΄λ‘λ μλ₯Ό κΈ°λ‘νλ©° νλ°ν μ¬μ©λκ³ μλ"
|
| 1199 |
elif downloads > 100000:
|
| 1200 |
+
popularity = "λ€μμ κ°λ°μμ μ°κ΅¬μλ€μ΄ νμ©νκ³ μλ"
|
| 1201 |
else:
|
| 1202 |
+
popularity = "μλ‘κ² μ£Όλͺ©λ°κ³ μλ"
|
| 1203 |
|
| 1204 |
+
return f"μ΄ λͺ¨λΈμ {task_desc}μ
λλ€. {popularity} λͺ¨λΈλ‘, νκΉ
νμ΄μ€ μνκ³μμ '{model_name.split('/')[-1]}'λΌλ μ΄λ¦μΌλ‘ μλ €μ Έ μμ΅λλ€. κ΄λ ¨ λΆμΌμ νλ‘μ νΈλ μ°κ΅¬μ νμ©ν μ μμ΅λλ€."
|
| 1205 |
|
| 1206 |
def analyze_space(self, space_name: str, space_id: str, description: str) -> Dict:
|
| 1207 |
"""νκΉ
νμ΄μ€ μ€νμ΄μ€ λΆμ - app.pyλ₯Ό LLMμΌλ‘ λΆμ"""
|
|
|
|
| 1215 |
messages = [
|
| 1216 |
{
|
| 1217 |
"role": "system",
|
| 1218 |
+
"content": "λΉμ μ μ€κ³ κ΅μμ΄ μ΄ν΄ν μ μκ² AI μ ν리μΌμ΄μ
μ μ λ¬Έμ μ΄λ©΄μλ λͺ
ννκ² μ€λͺ
νλ μ λ¬Έκ°μ
λλ€. νκ΅μ΄λ‘ λ΅λ³νμΈμ."
|
| 1219 |
},
|
| 1220 |
{
|
| 1221 |
"role": "user",
|
|
|
|
| 1223 |
|
| 1224 |
{app_code}
|
| 1225 |
|
| 1226 |
+
μ΄ μ±μ μ€κ³ κ΅μμ΄ μ΄ν΄ν μ μλλ‘ 3-5λ¬Έμ₯μΌλ‘ μ€λͺ
ν΄μ£ΌμΈμ. λ€μ λ΄μ©μ ν¬ν¨νμΈμ:
|
| 1227 |
+
1. μ΄ μ±μ΄ ꡬ체μ μΌλ‘ μ΄λ€ κΈ°λ₯μ μ 곡νλμ§
|
| 1228 |
+
2. μ΄λ€ AI κΈ°μ μ΄λ λΌμ΄λΈλ¬λ¦¬λ₯Ό μ¬μ©νλμ§
|
| 1229 |
+
3. μ΄λ€ λΆμΌμμ νμ© κ°λ₯νμ§ λλ μ΄λ€ λ¬Έμ λ₯Ό ν΄κ²°νλμ§
|
| 1230 |
|
| 1231 |
+
μ λ¬Έ μ©μ΄λ κ°λ¨ν μ€λͺ
νλ©΄μ μ¬μ©νκ³ , 3-5λ¬Έμ₯μ νκ΅μ΄λ‘ μμ±νμΈμ."""
|
| 1232 |
}
|
| 1233 |
]
|
| 1234 |
|
|
|
|
| 1261 |
except Exception as e:
|
| 1262 |
print(f" β οΈ μ€νμ΄μ€ λΆμ LLM μ€λ₯: {e}")
|
| 1263 |
|
| 1264 |
+
# 3. Fallback: ν
νλ¦Ώ κΈ°λ° μ€λͺ
(μ€κ³ κ΅μ μμ€)
|
| 1265 |
return {
|
| 1266 |
+
"simple_explanation": f"{space_name}λ μΉ κΈ°λ° AI λ°λͺ¨ νλ«νΌμΌλ‘, λΈλΌμ°μ μμ μ§μ μ€ν κ°λ₯ν μΈν°λν°λΈ μ ν리μΌμ΄μ
μ
λλ€. λ³λμ μ€μΉλ νκ²½ μ€μ μμ΄λ μ΅μ AI λͺ¨λΈμ κΈ°λ₯μ ν
μ€νΈνκ³ μ²΄νν μ μμΌλ©°, μ€μκ°μΌλ‘ κ²°κ³Όλ₯Ό νμΈν μ μμ΅λλ€.",
|
| 1267 |
"tech_stack": ["Python", "Gradio", "Transformers", "PyTorch"]
|
| 1268 |
}
|
| 1269 |
|
|
|
|
| 1305 |
response.raise_for_status()
|
| 1306 |
response.encoding = 'utf-8'
|
| 1307 |
|
| 1308 |
+
text = response.text
|
| 1309 |
|
| 1310 |
+
# ν¨ν΄: [μ λͺ©](λ§ν¬)...λ μ§
|
| 1311 |
+
# μ: [MS "κΈμ¦νλ 'μ±GPT' μμλ‘ λ°μ΄ν°μΌν° λΆμ‘±...2026λ
κΉμ§ μ§μλ λ―"](https://www.aitimes.com/news/articleView.html?idxno=203055)
|
| 1312 |
+
# ...
|
| 1313 |
+
# μ°μ
μΌλ°λ°μ°¬ κΈ°μ10-10 15:10
|
| 1314 |
|
| 1315 |
+
# μ λͺ©κ³Ό λ§ν¬ λ§€μΉ ν¨ν΄
|
| 1316 |
+
pattern = r'\[([^\]]+)\]\((https://www\.aitimes\.com/news/articleView\.html\?idxno=\d+)\)'
|
| 1317 |
+
|
| 1318 |
+
matches = re.finditer(pattern, text)
|
| 1319 |
|
| 1320 |
articles_found = 0
|
| 1321 |
+
for match in matches:
|
| 1322 |
try:
|
| 1323 |
+
title = match.group(1).strip()
|
| 1324 |
+
link = match.group(2).strip()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1325 |
|
| 1326 |
# μ λͺ©μ΄ λ무 μ§§μΌλ©΄ μ€ν΅
|
| 1327 |
+
if len(title) < 10:
|
| 1328 |
continue
|
| 1329 |
|
| 1330 |
+
# ν΄λΉ κΈ°μ¬μ λ μ§ μ°ΎκΈ° (λ§ν¬ λ€μμ 100μ μ΄λ΄)
|
| 1331 |
+
pos = match.end()
|
| 1332 |
+
nearby_text = text[pos:pos+200]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1333 |
|
| 1334 |
+
# λ μ§ ν¨ν΄: 10-10 15:10 νμ
|
| 1335 |
+
date_pattern = r'(\d{2}-\d{2}\s+\d{2}:\d{2})'
|
| 1336 |
+
date_match = re.search(date_pattern, nearby_text)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1337 |
|
| 1338 |
+
date_text = date_match.group(1) if date_match else today
|
|
|
|
|
|
|
| 1339 |
|
| 1340 |
# μ€λ λ μ§λ§ νν°λ§
|
| 1341 |
if today not in date_text:
|
|
|
|
| 1357 |
except Exception as e:
|
| 1358 |
continue
|
| 1359 |
|
| 1360 |
+
print(f" β {articles_found}κ° μ€λμ κΈ°μ¬ λ°κ²¬\n")
|
| 1361 |
time.sleep(1) # μλ² λΆν λ°©μ§
|
| 1362 |
|
| 1363 |
except Exception as e:
|
|
|
|
| 1724 |
return jsonify({
|
| 1725 |
"status": "healthy",
|
| 1726 |
"service": "AI News LLM Analyzer",
|
| 1727 |
+
"version": "3.3.0",
|
| 1728 |
"database": {
|
| 1729 |
"connected": True,
|
| 1730 |
"news_count": news_count,
|
|
|
|
| 1753 |
print(f"""
|
| 1754 |
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 1755 |
β β
|
| 1756 |
+
β π€ AI λ΄μ€ & νκΉ
νμ΄μ€ LLM λΆμ μΉμ± v3.3 β
|
| 1757 |
β β
|
| 1758 |
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 1759 |
|
| 1760 |
β¨ μ£Όμ κΈ°λ₯:
|
| 1761 |
β’ πΎ SQLite DB μꡬ μ€ν 리μ§
|
| 1762 |
β’ π AI Times μ€μκ° λ΄μ€ ν¬λ‘€λ§ (2κ° μΉμ
)
|
| 1763 |
+
β’ π° λ΄μ€ μ€κ³ κ΅μ μμ€ λΆμ (3-5μ€ μμΈ μμ½)
|
| 1764 |
β’ π€ νκΉ
νμ΄μ€ νΈλ λ© λͺ¨λΈ TOP 30 (λͺ¨λΈ μΉ΄λ λΆμ)
|
| 1765 |
β’ π νκΉ
νμ΄μ€ νΈλ λ© μ€νμ΄μ€ TOP 30 (app.py λΆμ)
|
| 1766 |
β’ π§ Fireworks AI (Qwen3-235B) μ€μκ° LLM λΆμ
|