#!/usr/bin/env python3 from typing import Any, Dict SYSTEM_MESSAGE = ( "You are an e-commerce product annotator. " "Continue the provided assistant Markdown table prefix. " "Do not repeat or modify the prefix, and do not add explanations outside the table." ) SHARED_ANALYSIS_INSTRUCTION = """Analyze each input product text and fill these columns: 1. Product title: a natural, localized product name based on the input text 2. Category path: a concise category hierarchy from broad to specific, separated by ">" 3. Fine-grained tags: concise tags for style, features, design details, function, or standout selling points 4. Target audience: gender, age group, body type, or suitable users when clearly implied 5. Usage scene: likely occasions, settings, or use cases 6. Applicable season: relevant season(s) based on the product text 7. Key attributes: core product attributes and specifications. Depending on the item type, this may include fit, silhouette, length, sleeve type, neckline, waistline, closure, pattern, design details, structure, or other relevant attribute dimensions 8. Material description: material, fabric, texture, or construction description 9. Functional features: practical or performance-related functions such as stretch, breathability, warmth, support, storage, protection, or ease of wear 10. Anchor text: a search-oriented keyword string covering product type, category intent, attributes, design cues, usage scenarios, and strong shopping phrases Rules: - Keep the input order and row count exactly the same. - Infer only from the provided input product text; if uncertain, prefer concise and broadly correct ecommerce wording. - Keep category paths concise and use ">" as the separator. - For columns with multiple values, the localized output requirement will define the delimiter. Input product list: """ USER_INSTRUCTION_TEMPLATE = """Please strictly return a Markdown table following the given columns in the specified language. For any column containing multiple values, separate them with commas. Do not add any other explanation. Language: {language}""" TAXONOMY_SHARED_ANALYSIS_INSTRUCTION = """Analyze each input product text and fill the columns below using an apparel attribute taxonomy. Output columns: 1. Product Type: concise ecommerce apparel category label, not a full marketing title 2. Target Gender: intended gender only if clearly implied 3. Age Group: only if clearly implied, e.g. adults, kids, teens, toddlers, babies 4. Season: season(s) or all-season suitability only if supported 5. Fit: body closeness, e.g. slim, regular, relaxed, oversized, fitted 6. Silhouette: overall garment shape, e.g. straight, A-line, boxy, tapered, bodycon, wide-leg 7. Neckline: neckline type when applicable, e.g. crew neck, V-neck, hooded, collared, square neck 8. Sleeve Length Type: sleeve length only, e.g. sleeveless, short sleeve, long sleeve, three-quarter sleeve 9. Sleeve Style: sleeve design only, e.g. puff sleeve, raglan sleeve, batwing sleeve, bell sleeve 10. Strap Type: strap design when applicable, e.g. spaghetti strap, wide strap, halter strap, adjustable strap 11. Rise / Waistline: waist placement when applicable, e.g. high rise, mid rise, low rise, empire waist 12. Leg Shape: for bottoms only, e.g. straight leg, wide leg, flare leg, tapered leg, skinny leg 13. Skirt Shape: for skirts only, e.g. A-line, pleated, pencil, mermaid 14. Length Type: design length only, not size, e.g. cropped, regular, longline, mini, midi, maxi, ankle length, full length 15. Closure Type: fastening method when applicable, e.g. zipper, button, drawstring, elastic waist, hook-and-loop 16. Design Details: construction or visual details, e.g. ruched, ruffled, pleated, cut-out, layered, distressed, split hem 17. Fabric: fabric type only, e.g. denim, knit, chiffon, jersey, fleece, cotton twill 18. Material Composition: fiber content or blend only if stated, e.g. cotton, polyester, spandex, linen blend, 95% cotton 5% elastane 19. Fabric Properties: inherent fabric traits, e.g. stretch, breathable, lightweight, soft-touch, water-resistant 20. Clothing Features: product features, e.g. lined, reversible, hooded, packable, padded, pocketed 21. Functional Benefits: wearer benefits, e.g. moisture-wicking, thermal insulation, UV protection, easy care, supportive compression 22. Color: specific color name when available 23. Color Family: normalized broad retail color group, e.g. black, white, blue, green, red, pink, beige, brown, gray 24. Print / Pattern: surface pattern when applicable, e.g. solid, striped, plaid, floral, graphic, animal print 25. Occasion / End Use: likely use occasion only if supported, e.g. office, casual wear, streetwear, lounge, workout, outdoor 26. Style Aesthetic: overall style only if supported, e.g. minimalist, streetwear, athleisure, smart casual, romantic, playful Rules: - Keep the same row order and row count as input. - Infer only from the provided product text. - Leave blank if not applicable or not reasonably supported. - Use concise, standardized ecommerce wording. - Do not combine different attribute dimensions in one field. - If multiple values are needed, use the delimiter required by the localization setting. Input product list: """ TAXONOMY_MARKDOWN_TABLE_HEADERS_EN = [ "No.", "Product Type", "Target Gender", "Age Group", "Season", "Fit", "Silhouette", "Neckline", "Sleeve Length Type", "Sleeve Style", "Strap Type", "Rise / Waistline", "Leg Shape", "Skirt Shape", "Length Type", "Closure Type", "Design Details", "Fabric", "Material Composition", "Fabric Properties", "Clothing Features", "Functional Benefits", "Color", "Color Family", "Print / Pattern", "Occasion / End Use", "Style Aesthetic", ] TAXONOMY_LANGUAGE_MARKDOWN_TABLE_HEADERS: Dict[str, Dict[str, Any]] = { "en": TAXONOMY_MARKDOWN_TABLE_HEADERS_EN, "zh": [ "序号", "品类", "目标性别", "年龄段", "适用季节", "版型", "廓形", "领型", "袖长类型", "袖型", "肩带设计", "腰型", "裤型", "裙型", "长度类型", "闭合方式", "设计细节", "面料", "成分", "面料特性", "服装特征", "功能", "主颜色", "色系", "印花 / 图案", "适用场景", "风格", ], } LANGUAGE_MARKDOWN_TABLE_HEADERS: Dict[str, Dict[str, Any]] = { "en": [ "No.", "Product title", "Category path", "Fine-grained tags", "Target audience", "Usage scene", "Season", "Key attributes", "Material", "Features", "Anchor text" ], "zh": [ "序号", "商品标题", "品类路径", "细分标签", "适用人群", "使用场景", "适用季节", "关键属性", "材质说明", "功能特点", "锚文本" ], "zh_tw": [ "序號", "商品標題", "品類路徑", "細分標籤", "適用人群", "使用場景", "適用季節", "關鍵屬性", "材質說明", "功能特點", "錨文本" ], "ru": [ "№", "Название товара", "Путь категории", "Детализированные теги", "Целевая аудитория", "Сценарий использования", "Сезон", "Ключевые атрибуты", "Материал", "Особенности", "Анкорный текст" ], "ja": [ "番号", "商品タイトル", "カテゴリパス", "詳細タグ", "対象ユーザー", "利用シーン", "季節", "主要属性", "素材", "機能特徴", "アンカーテキスト" ], "ko": [ "번호", "상품 제목", "카테고리 경로", "세부 태그", "대상 고객", "사용 장면", "계절", "핵심 속성", "소재", "기능 특징", "앵커 텍스트" ], "es": [ "N.º", "Titulo del producto", "Ruta de categoria", "Etiquetas detalladas", "Publico objetivo", "Escenario de uso", "Temporada", "Atributos clave", "Material", "Caracteristicas", "Texto ancla" ], "fr": [ "N°", "Titre du produit", "Chemin de categorie", "Etiquettes detaillees", "Public cible", "Scenario d'utilisation", "Saison", "Attributs cles", "Matiere", "Caracteristiques", "Texte d'ancrage" ], "pt": [ "Nº", "Titulo do produto", "Caminho da categoria", "Tags detalhadas", "Publico-alvo", "Cenario de uso", "Estacao", "Atributos principais", "Material", "Caracteristicas", "Texto ancora" ], "de": [ "Nr.", "Produkttitel", "Kategoriepfad", "Detaillierte Tags", "Zielgruppe", "Nutzungsszenario", "Saison", "Wichtige Attribute", "Material", "Funktionen", "Ankertext" ], "it": [ "N.", "Titolo del prodotto", "Percorso categoria", "Tag dettagliati", "Pubblico target", "Scenario d'uso", "Stagione", "Attributi chiave", "Materiale", "Caratteristiche", "Testo ancora" ], "th": [ "ลำดับ", "ชื่อสินค้า", "เส้นทางหมวดหมู่", "แท็กย่อย", "กลุ่มเป้าหมาย", "สถานการณ์การใช้งาน", "ฤดูกาล", "คุณสมบัติสำคัญ", "วัสดุ", "คุณสมบัติการใช้งาน", "แองเคอร์เท็กซ์" ], "vi": [ "STT", "Tieu de san pham", "Duong dan danh muc", "The chi tiet", "Doi tuong phu hop", "Boi canh su dung", "Mua phu hop", "Thuoc tinh chinh", "Chat lieu", "Tinh nang", "Van ban neo" ], "id": [ "No.", "Judul produk", "Jalur kategori", "Tag terperinci", "Target pengguna", "Skenario penggunaan", "Musim", "Atribut utama", "Bahan", "Fitur", "Teks jangkar" ], "ms": [ "No.", "Tajuk produk", "Laluan kategori", "Tag terperinci", "Sasaran pengguna", "Senario penggunaan", "Musim", "Atribut utama", "Bahan", "Ciri-ciri", "Teks sauh" ], "ar": [ "الرقم", "عنوان المنتج", "مسار الفئة", "الوسوم التفصيلية", "الفئة المستهدفة", "سيناريو الاستخدام", "الموسم", "السمات الرئيسية", "المادة", "الميزات", "نص الربط" ], "hi": [ "क्रमांक", "उत्पाद शीर्षक", "श्रेणी पथ", "विस्तृत टैग", "लक्षित उपभोक्ता", "उपयोग परिदृश्य", "मौसम", "मुख्य गुण", "सामग्री", "विशेषताएं", "एंकर टेक्स्ट" ], "he": [ "מס׳", "כותרת המוצר", "נתיב קטגוריה", "תגיות מפורטות", "קהל יעד", "תרחיש שימוש", "עונה", "מאפיינים מרכזיים", "חומר", "תכונות", "טקסט עוגן" ], "my": [ "အမှတ်စဉ်", "ကုန်ပစ္စည်းခေါင်းစဉ်", "အမျိုးအစားလမ်းကြောင်း", "အသေးစိတ်တဂ်များ", "ပစ်မှတ်အသုံးပြုသူ", "အသုံးပြုမှုအခြေအနေ", "ရာသီ", "အဓိကဂုဏ်သတ္တိများ", "ပစ္စည်း", "လုပ်ဆောင်ချက်များ", "အန်ကာစာသား" ], "ta": [ "எண்", "தயாரிப்பு தலைப்பு", "வகை பாதை", "விரிவான குறிச்சொற்கள்", "இலக்கு பயனர்கள்", "பயன்பாட்டு நிலை", "பருவம்", "முக்கிய பண்புகள்", "பொருள்", "அம்சங்கள்", "ஆங்கர் உரை" ], "ur": [ "نمبر", "پروڈکٹ عنوان", "زمرہ راستہ", "تفصیلی ٹیگز", "ہدف صارفین", "استعمال کا منظر", "موسم", "کلیدی خصوصیات", "مواد", "فیچرز", "اینکر ٹیکسٹ" ], "bn": [ "ক্রম", "পণ্যের শিরোনাম", "শ্রেণি পথ", "বিস্তারিত ট্যাগ", "লক্ষ্য ব্যবহারকারী", "ব্যবহারের দৃশ্য", "মৌসুম", "মূল বৈশিষ্ট্য", "উপাদান", "ফিচার", "অ্যাঙ্কর টেক্সট" ], "pl": [ "Nr", "Tytul produktu", "Sciezka kategorii", "Szczegolowe tagi", "Grupa docelowa", "Scenariusz uzycia", "Sezon", "Kluczowe atrybuty", "Material", "Cechy", "Tekst kotwicy" ], "nl": [ "Nr.", "Producttitel", "Categoriepad", "Gedetailleerde tags", "Doelgroep", "Gebruikscontext", "Seizoen", "Belangrijke kenmerken", "Materiaal", "Functies", "Ankertekst" ], "ro": [ "Nr.", "Titlul produsului", "Calea categoriei", "Etichete detaliate", "Public tinta", "Scenariu de utilizare", "Sezon", "Atribute cheie", "Material", "Caracteristici", "Text ancora" ], "tr": [ "No.", "Urun basligi", "Kategori yolu", "Ayrintili etiketler", "Hedef kitle", "Kullanim senaryosu", "Sezon", "Temel ozellikler", "Malzeme", "Ozellikler", "Capa metni" ], "km": [ "ល.រ", "ចំណងជើងផលិតផល", "ផ្លូវប្រភេទ", "ស្លាកលម្អិត", "ក្រុមអ្នកប្រើគោលដៅ", "សេណារីយ៉ូប្រើប្រាស់", "រដូវកាល", "លក្ខណៈសម្បត្តិសំខាន់", "សម្ភារៈ", "មុខងារ", "អត្ថបទអង់ក័រ" ], "lo": [ "ລຳດັບ", "ຊື່ສິນຄ້າ", "ເສັ້ນທາງໝວດໝູ່", "ແທັກລະອຽດ", "ກຸ່ມເປົ້າໝາຍ", "ສະຖານະການໃຊ້ງານ", "ລະດູການ", "ຄຸນລັກສະນະສຳຄັນ", "ວັດສະດຸ", "ຄຸນສົມບັດ", "ຂໍ້ຄວາມອັງເຄີ" ], "yue": [ "序號", "商品標題", "品類路徑", "細分類標籤", "適用人群", "使用場景", "適用季節", "關鍵屬性", "材質說明", "功能特點", "錨文本" ], "cs": [ "C.", "Nazev produktu", "Cesta kategorie", "Podrobne stitky", "Cilova skupina", "Scenar pouziti", "Sezona", "Klicove atributy", "Material", "Vlastnosti", "Kotvici text" ], "el": [ "Α/Α", "Τίτλος προϊόντος", "Διαδρομή κατηγορίας", "Αναλυτικές ετικέτες", "Κοινό-στόχος", "Σενάριο χρήσης", "Εποχή", "Βασικά χαρακτηριστικά", "Υλικό", "Λειτουργίες", "Κείμενο άγκυρας" ], "sv": [ "Nr", "Produkttitel", "Kategorisokvag", "Detaljerade taggar", "Malgrupp", "Anvandningsscenario", "Sasong", "Viktiga attribut", "Material", "Funktioner", "Ankartext" ], "hu": [ "Sorszam", "Termekcim", "Kategoriavonal", "Reszletes cimkek", "Celcsoport", "Hasznalati helyzet", "Evszak", "Fo jellemzok", "Anyag", "Funkciok", "Horgonyszoveg" ], "da": [ "Nr.", "Produkttitel", "Kategoristi", "Detaljerede tags", "Malgruppe", "Brugsscenarie", "Saeson", "Nogleattributter", "Materiale", "Funktioner", "Ankertekst" ], "fi": [ "Nro", "Tuotteen nimi", "Kategoriapolku", "Yksityiskohtaiset tunnisteet", "Kohdeyleiso", "Kayttotilanne", "Kausi", "Keskeiset ominaisuudet", "Materiaali", "Ominaisuudet", "Ankkuriteksti" ], "uk": [ "№", "Назва товару", "Шлях категорії", "Детальні теги", "Цільова аудиторія", "Сценарій використання", "Сезон", "Ключові атрибути", "Матеріал", "Особливості", "Анкорний текст" ], "bg": [ "№", "Заглавие на продукта", "Път на категорията", "Подробни тагове", "Целева аудитория", "Сценарий на употреба", "Сезон", "Ключови атрибути", "Материал", "Характеристики", "Анкор текст" ] }