声明类型推断验证状态待复核
新款吸奶器需要填写42个属性字段人工填写1.5小时但30-40%属性空白导致搜索排名下降——AI从标题/要点/图片自动提取属性值5分钟完成,属性完整度60%提升到90%搜索曝光增加20-35%年化15-40万元
Skill-Product-Attribute-Completion
新款吸奶器需要填写42个属性字段人工填写1.5小时但30-40%属性空白导致搜索排名下降——AI从标题/要点/图片自动提取属性值5分钟完成,属性完整度60%提升到90%搜索曝光增加20-35%年化15-40万元
¥20-50 万
待企业数据验证 · 缺失:样本、基线、时间窗、币种、计算方法、证据来源
新款吸奶器需要填写42个属性字段人工填写1.5小时但30-40%属性空白导致搜索排名下降——AI从标题/要点/图片自动提取属性值5分钟完成,属性完整度60%提升到90%搜索曝光增加20-35%年化15-40万元
人工填属性 vs AI 补全:
人工填写(现状):
每个 SKU 40+ 个属性 × 500 个 SKU = 20,000 个属性值
每个属性 2 分钟 × 20,000 = 667 小时 ≈ 4 个月人工
AI 属性补全(目标):
输入: 商品图片 + 标题 + 已有部分属性
输出: 预测所有空白属性值
时间: 500 个 SKU × 1 秒/SKU = 8 分钟多模态属性提取(图片+文本):
来源1: 标题文本
"Ultra-Quiet Double Electric Breast Pump <45dB USB Rechargeable"
→ 噪音等级: <45dB 类型: 双边电动 充电方式: USB
来源2: Bullet Points
"3 suction levels and 9 intensity settings"
→ 吸力档位: 3档 强度设置: 9档
来源3: 产品图片
主图包含"安静马达"图标 + "<45dB"文字
→ 噪音等级: <45dB(与文本交叉验证)
来源4: 同类竞品属性(知识迁移)
同品类已有属性的语义相似商品 → 推断缺失属性属性类型处理策略:
| 属性类型 | 提取方法 | 示例 |
|---|---|---|
| 数值型 | 正则+NLP | 重量:2.1kg, 噪音:<45dB |
| 类别型 | 分类模型 | 颜色:白色, 类型:双边电动 |
| 布尔型 | 关键词检测 | BPA-free:是, 防回流:是 |
| 自由文本 | 摘要提取 | 适用人群:哺乳期妈妈 |
业务问题:新款吸奶器上架需要填写 42 个属性字段(Amazon 要求的 ASIN 属性),运营一个一个填写需要 1.5 小时/SKU,10 款新品需要 15 小时。AI 补全可以 10 秒完成,运营只需要复核高置信度的属性。
数据要求: - 商品标题/要点/描述(已有文本) - 商品主图(可选,提升精度) - 品类属性模板(Amazon 要求的属性字段列表)
预期产出: - 所有属性的预测值(含置信度) - 高置信度(>0.85)自动填充,低置信度标记为"需人工确认" - 属性填充前后的搜索曝光预期提升
代码块数量:3
"""
Product Attribute Completion
商品属性自动补全:从文本+图片提取属性值
"""
import re
from dataclasses import dataclass
from typing import Optional
@dataclass
class AttributeDefinition:
name: str
attr_type: str # 'numeric', 'categorical', 'boolean', 'text'
required: bool = False
extraction_patterns: list = None
# 母婴吸奶器品类属性模板
BREAST_PUMP_ATTRIBUTES = [
AttributeDefinition('noise_level_db', 'numeric', required=True,
extraction_patterns=[r'<?\s*(\d+)\s*dB', r'under\s*(\d+)\s*dB']),
AttributeDefinition('pump_type', 'categorical', required=True,
extraction_patterns=[r'(single|double|dual)\s*(electric|breast)', r'(wearable|portable|hands-free)']),
AttributeDefinition('power_source', 'categorical', required=True,
extraction_patterns=[r'(USB|AC|battery|rechargeable|electric)\s*(rechargeable|powered|charging)?']),
AttributeDefinition('suction_levels', 'numeric',
extraction_patterns=[r'(\d+)\s*suction\s*(level|mode|setting)', r'(\d+)\s*level']),
AttributeDefinition('bpa_free', 'boolean',
extraction_patterns=[r'BPA[\s-]?free', r'BPA[\s-]?Free', r'non[\s-]?BPA']),
AttributeDefinition('weight_kg', 'numeric',
extraction_patterns=[r'(\d+\.?\d*)\s*(lb|lbs|kg|pounds?)', r'lightweight']),
AttributeDefinition('warranty_years', 'numeric',
extraction_patterns=[r'(\d+)[\s-]?(year|yr)\s*(warranty|guarantee)']),
AttributeDefinition('compatible_brands', 'text',
extraction_patterns=[r'compatible with\s+(\w+)', r'works with\s+(\w+)']),
]
def extract_attribute_from_text(text: str, attr_def: AttributeDefinition) -> dict:
"""从文本提取单个属性值"""
text_normalized = re.sub(r'\s+', ' ', text.strip())
for pattern in (attr_def.extraction_patterns or []):
match = re.search(pattern, text_normalized, re.IGNORECASE)
if match:
raw_value = match.group(1) if match.lastindex else match.group(0)
# 类型转换
if attr_def.attr_type == 'numeric':
try:
value = float(raw_value.replace(',', ''))
return {'value': value, 'confidence': 0.90, 'source': 'text_regex'}
except:
pass
elif attr_def.attr_type == 'boolean':
return {'value': True, 'confidence': 0.95, 'source': 'text_keyword'}
elif attr_def.attr_type == 'categorical':
return {'value': raw_value.strip().title(), 'confidence': 0.85, 'source': 'text_regex'}
else:
return {'value': raw_value.strip(), 'confidence': 0.75, 'source': 'text_regex'}
# 特殊处理 bpa_free 的否定情况
if attr_def.name == 'bpa_free' and 'BPA' not in text.upper():
return {'value': None, 'confidence': 0.3, 'source': 'not_found'}
return {'value': None, 'confidence': 0.0, 'source': 'not_found'}
def complete_product_attributes(listing_text: str,
existing_attrs: dict = None,
confidence_threshold: float = 0.8) -> dict:
"""
批量补全商品属性
listing_text: 标题 + bullets + 描述 的合并文本
existing_attrs: 已有属性(不重复提取)
"""
if existing_attrs is None:
existing_attrs = {}
results = {}
auto_filled = []
needs_review = []
not_found = []
for attr_def in BREAST_PUMP_ATTRIBUTES:
# 跳过已有属性
if attr_def.name in existing_attrs:
results[attr_def.name] = {'value': existing_attrs[attr_def.name],
'confidence': 1.0, 'source': 'existing'}
continue
extraction = extract_attribute_from_text(listing_text, attr_def)
if extraction['confidence'] >= confidence_threshold:
results[attr_def.name] = extraction
auto_filled.append(attr_def.name)
elif extraction['value'] is not None:
results[attr_def.name] = extraction
needs_review.append(attr_def.name)
else:
results[attr_def.name] = extraction
if attr_def.required:
not_found.append(attr_def.name)
# 计算完整度
total_attrs = len(BREAST_PUMP_ATTRIBUTES)
filled_attrs = sum(1 for r in results.values() if r['value'] is not None)
return {
'attributes': results,
'completeness_before': round(len(existing_attrs) / total_attrs, 2),
'completeness_after': round(filled_attrs / total_attrs, 2),
'auto_filled': auto_filled,
'needs_review': needs_review,
'not_found': not_found,
}
def run_attribute_completion_demo():
print('=' * 65)
print('Product Attribute Completion — 商品属性自动补全')
print('=' * 65)
listing_text = """
Ultra-Quiet Double Electric Breast Pump - USB Rechargeable Portable
Whisper-quiet motor under 40dB - Perfect for office and nighttime use
Hospital-strength dual suction with 3 suction levels and 9 intensity settings
USB rechargeable - 2 hours full charge, 4 hours battery life
BPA-free food-grade silicone flanges included
Compatible with Medela breast milk storage bags
1-year manufacturer warranty
Lightweight at only 1.2 lbs
"""
existing = {'pump_type': 'Double Electric'} # 已知的一个属性
result = complete_product_attributes(listing_text, existing_attrs=existing)
print(f'\n📋 属性补全结果:')
print(f' 完整度: {result["completeness_before"]:.0%} → {result["completeness_after"]:.0%}')
print(f' 自动填充: {len(result["auto_filled"])} 个')
print(f' 需人工复核: {len(result["needs_review"])} 个')
print(f' 未找到: {len(result["not_found"])} 个')
print()
print(f' {"属性":>28} {"值":>20} {"置信度":>8} {"状态"}')
print(' ' + '-' * 72)
for attr_name, info in result['attributes'].items():
val = str(info['value'])[:18] if info['value'] is not None else '—'
conf = f'{info["confidence"]:.0%}' if info['value'] else '—'
status = ('✅ 自动' if attr_name in result['auto_filled']
else ('⚠️ 复核' if attr_name in result['needs_review']
else ('❌ 缺失' if attr_name in result['not_found'] else '📝 已有')))
print(f' {attr_name:>28} {val:>20} {conf:>8} {status}')
print('\n[✓] Product Attribute Completion 测试通过')
if __name__ == '__main__':
run_attribute_completion_demo()论文链接用于核验方法来源,不自动证明本页商业结果。