AIを活用したコンテンツ生成:製品説明のためのDeepSeek
この記事では、DeepSeek AIを使用して製品説明を生成し、コンテンツを翻訳し、マーケティングコピーを大規模に作成する方法を説明します。
課題:コンテンツ作成のスケーリング
5,000以上の製品構成があり、以下が必要です:
-
製品説明:製品ごとに200〜300語
-
メタディスクリプション:SEO用に150〜160文字
-
機能ハイライト:主要機能の箇条書き
-
マーケティングコピー:説得力のあるセールス言語
手動で書く場合:
-
5,000製品 × 製品あたり30分 = 2,500時間(104日)
-
一貫性:すべての説明がブランドボイスに従うことを確保
-
更新:製品が変更されたときに書き直し
-
翻訳:10言語を掛けると = 25,000時間
手動での作成はスケールしないため、AIを使用してこのコンテンツを生成します。
ソリューション:DeepSeek AI
DeepSeek AIモデルを使用してコンテンツを生成します:
-
モデル:DeepSeek-V3(671Bパラメータ)
-
API:deepseek.com、Together.aiフォールバック付き
-
コスト:100万入力トークンあたり$0.27、100万出力トークンあたり$1.10
-
速度:約50トークン/秒(説明あたり10秒)
この速度では、5,000件の説明に約14時間かかり、コストは約$50です。
統合AI生成インターフェース
複数のプロバイダーをサポートする統合インターフェースを構築しました:
from app.shared.ai_generation import generate_content
description = generate_content(
prompt="Write a product description for Treo N100 Mini PC",
provider="deepseek",
max_tokens=800,
temperature=0.7,
system_prompt="You are a technical writer..."
)
サポートされているプロバイダー:
-
DeepSeek:主要プロバイダー(deepseek.com)
-
Gemini:フォールバックプロバイダー(Google)
-
Together.ai:DeepSeekフォールバック(deepseek.comが失敗した場合)
DeepSeek API統合
直接API呼び出し
deepseek.com APIを直接呼び出します:
response = requests.post(
"https://api.deepseek.com/v1/chat/completions",
headers={
# ... (implementation details omitted)
Together.aiへのフォールバック
deepseek.comが失敗した場合、Together.aiにフォールバックします:
response = requests.post(
"https://api.together.xyz/v1/chat/completions",
headers={
# ... (implementation details omitted)
フォールバックにより、1つのプロバイダーがダウンしている場合でもコンテンツ生成が利用可能になります。
キャッシングのためのシステムプロンプト設計
DeepSeekはコストを削減するためにプロンプトキャッシングをサポートしています:
-
システムプロンプト:キャッシュされる(リクエスト間で再利用)
-
ユーザープロンプト:キャッシュされない(リクエストごとに一意)
システムプロンプトを再利用可能に設計しています:
system_prompt = """You are a technical writer for Thinvent, a manufacturer of mini PCs, thin clients, and industrial computers.
Write product descriptions that:
# ... (implementation details omitted)
このシステムプロンプトはキャッシュされ、5,000製品すべてで再利用され、実行ごとに約$40を節約します。
キャッシュヒットのログ記録
節約を監視するためにキャッシュヒットを記録します:
usage = result.get("usage", {})
cache_hits = usage.get("prompt_cache_hit_tokens", 0)
cache_misses = usage.get("prompt_cache_miss_tokens", 0)
if cache_hits > 0:
logging.info(f"DeepSeek cache HIT: {cache_hits} tokens (miss: {cache_misses})")
出力例:
DeepSeek cache HIT: 1,200 tokens (miss: 50)
DeepSeek cache HIT: 1,200 tokens (miss: 48)
DeepSeek cache HIT: 1,200 tokens (miss: 52)
これは、システムプロンプト(1,200トークン)がキャッシュされ、ユーザープロンプト(50トークン)はキャッシュされていないことを示しています。
Temperature設定
用途に応じて異なるtemperatureを使用します:
製品説明(0.7)
目的:創造性と一貫性のバランス
description = generate_content(
prompt=f"Write a description for {product_name}",
temperature=0.7
)
結果:自然な響きの説明で、ある程度のバリエーションがある
翻訳(1.3)
目的:より創造的で自然な翻訳
translation = generate_content(
prompt=f"Translate to {lang}: {text}",
temperature=1.3
)
結果:より慣用的で自然な響きの翻訳
技術仕様(0.3)
目的:事実に基づく一貫した出力
specs = generate_content(
prompt=f"List specifications for {product_name}",
temperature=0.3
)
結果:一貫した仕様リスト
マーケティングコピー(1.0)
目的:創造的で魅力的なコンテンツ
copy = generate_content(
prompt=f"Write marketing copy for {product_name}",
temperature=1.0
)
結果:説得力のある多様なマーケティング言語
ユースケース
1. 製品説明
-
入力:製品SKUと機能
-
プロンプト:
Write a product description for:
- Name: Treo N100 Mini PC
- Processor: Intel N100 (4 cores, 3.4GHz)
- RAM: 8GB DDR4
- Storage: 256GB SSD
- Ports: 2× HDMI, 4× USB 3.0, Gigabit Ethernet
- OS: Windows 11 Pro
出力:
The Thinvent Treo N100 Mini PC is a compact powerhouse designed for business and industrial applications. Powered by the Intel N100 processor with 4 cores running at 3.4GHz, it delivers reliable performance for everyday computing tasks.
With 8GB DDR4 RAM and a 256GB SSD, the Treo provides smooth multitasking and fast boot times. The dual HDMI ports support multi-monitor setups, while 4 USB 3.0 ports and Gigabit Ethernet ensure seamless connectivity.
Pre-installed with Windows 11 Pro, the Treo is ready for business use out of the box. Its fanless design ensures silent operation, making it ideal for office environments, digital signage, and industrial automation.
Backed by Thinvent's 3-year warranty and certified to BIS, RoHS, and ISO standards, the Treo N100 Mini PC is built to last.
2. コンテンツ翻訳
-
入力:英語テキストと対象言語
-
プロンプト:
Translate to Hindi:
"The Thinvent Treo N100 Mini PC is a compact powerhouse designed for business and industrial applications."
出力:
Thinvent Treo N100 मिनी पीसी एक कॉम्पैक्ट पावरहाउस है जो व्यावसायिक और औद्योगिक अनुप्रयोगों के लिए डिज़ाइन किया गया है।
3. メタディスクリプション
-
入力:製品名と主要機能
-
プロンプト:
Write a 150-character meta description for:
Treo N100 Mini PC with Intel N100, 8GB RAM, 256GB SSD, Windows 11 Pro
出力:
Compact Treo N100 Mini PC with Intel N100, 8GB RAM, 256GB SSD, Windows 11 Pro. Perfect for business and industrial use. 3-year warranty.
4. 機能ハイライト
-
入力:製品機能
-
プロンプト:
Write 5 bullet points highlighting key features of:
Treo N100 Mini PC
出力:
• Intel N100 processor (4 cores, 3.4GHz) for reliable performance
• 8GB DDR4 RAM and 256GB SSD for smooth multitasking
• Dual HDMI ports for multi-monitor setups
• Fanless design for silent operation
• Windows 11 Pro pre-installed, ready for business use
バッチ処理
効率化のためにコンテンツをバッチで処理します:
from app.web.models_product_description import ProductDescription
# Queue descriptions for generation
# ... (implementation details omitted)
これにより、数千の説明をバックグラウンドで処理できます。
エラー処理
API障害を適切に処理します:
try:
content = generate_content(prompt, provider="deepseek")
if content:
# ... (implementation details omitted)
生成が失敗した場合: 1. エラーをログに記録 2. Noneを返す(呼び出し元がフォールバックを処理) 3. 後で再試行(キューに入れたアイテムの場合)
コスト最適化
以下を通じてコストを最適化します:
1. プロンプトキャッシング
-
システムプロンプト:1,200トークン × 5,000製品 = 6Mトークン
-
キャッシングなし:$0.27 × 6 = $1.62
-
キャッシングあり:$0.27 × 0.006 = $0.0016(99.9%の節約)
2. バッチ処理
1回のAPI呼び出しで複数のアイテムを処理:
prompt = "Write descriptions for:\n"
for sku in batch_skus:
prompt += f"- {sku}\n"
これにより、APIオーバーヘッドが削減され、スループットが向上します。
3. Temperature調整
低いtemperature = 生成されるトークンが少ない:
-
Temperature 0.3:説明あたり約200トークン
-
Temperature 0.7:説明あたり約250トークン
-
Temperature 1.3:説明あたり約300トークン
可能な場合は低いtemperatureを使用してください。
パフォーマンス特性
生成速度:
-
単一の説明:約10秒
-
10件のバッチ:約30秒(説明あたり3秒)
-
5,000件の説明:約14時間(バッチ処理)
コスト:
-
入力トークン:1,200(システム)+ 50(ユーザー)= 1,250トークン
-
出力トークン:250トークン
-
説明あたりのコスト:$0.27 × 0.00125 + $1.10 × 0.00025 = $0.00061
-
5,000件の説明:$3.05
キャッシングあり:
-
入力トークン:6(キャッシュ)+ 50(ユーザー)= 56トークン
-
説明あたりのコスト:$0.27 × 0.000056 + $1.10 × 0.00025 = $0.00029
-
5,000件の説明:$1.45(52%の節約)
SEOパイプラインとの統合
AI生成コンテンツはSEOパイプラインと統合されます:
ステップ9:説明の移行
SEOパイプラインはすべての製品の説明を生成します:
for sku in product_skus:
description = generate_content(
prompt=f"Write description for {sku}",
# ... (implementation details omitted)
詳細はSEOパイプライン概要をご覧ください。
翻訳キュー
不足している翻訳はキューに入れられ、AIで処理されます:
for item in translation_queue:
translation = generate_content(
prompt=f"Translate to {item['lang']}: {item['text']}",
provider="deepseek",
temperature=1.3
)
translation_manager.set(item['text'], item['lang'], translation)
詳細は翻訳システムをご覧ください。
参考文献
AIサービス
-
DeepSeek - 公式ウェブサイト
-
DeepSeek APIドキュメント - APIドキュメント
-
Together.ai - フォールバックプロバイダー
技術的概念
-
プロンプトキャッシング - DeepSeekドキュメント
-
Temperatureサンプリング - Wikipedia
関連記事
-
翻訳システム - コンテンツの翻訳方法
-
SEOパイプライン概要 - 完全なパイプラインアーキテクチャ
-
システムプロンプト設計 - 再利用可能なプロンプトの設計
まとめ
DeepSeek AIを使用して大規模にコンテンツを生成します:
-
モデル:DeepSeek-V3(671Bパラメータ)
-
API:deepseek.com、Together.aiフォールバック付き
-
ユースケース:
-
製品説明(Temperature 0.7)
-
翻訳(Temperature 1.3)
-
技術仕様(Temperature 0.3)
-
マーケティングコピー(Temperature 1.0)
最適化:
-
プロンプトキャッシング(システムプロンプトで99.9%の節約)
-
バッチ処理(3倍高速)
-
Temperature調整(トークン20%削減)
パフォーマンス:
-
5,000件の説明を約14時間で
-
コスト:キャッシングありで$1.45(52%の節約)
-
速度:説明あたり約3秒(バッチ処理時)
統合:
-
SEOパイプライン(ステップ9)
-
翻訳キュー(バックグラウンドワーカー)
-
製品説明テーブル(DynamoDB)
このアプローチにより、手動で作成することなく、複数言語で数千の製品説明を生成・維持しています。