feat(marketing-matrix): Optimiere Intro-Texte für bessere Relevanz [2ff88f42]
Überarbeite den Prompt für die Generierung von Intro-Texten in der Marketing Matrix. Das Intro beginnt nun direkt mit der branchenspezifischen Produktkategorie und dem zentralen Nutzen, anstatt die Herausforderung zu wiederholen. Dies verbessert die Prägnanz und Relevanz der E-Mails.
This commit is contained in:
64
company-explorer/backend/scripts/debug_check_matrix_texts.py
Normal file
64
company-explorer/backend/scripts/debug_check_matrix_texts.py
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
|
||||||
|
import sys
|
||||||
|
import os
|
||||||
|
import argparse
|
||||||
|
|
||||||
|
# Adjust the path to include the 'company-explorer' directory
|
||||||
|
# This allows the script to find the 'backend' module
|
||||||
|
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..')))
|
||||||
|
|
||||||
|
from backend.database import SessionLocal, Industry, Persona, MarketingMatrix
|
||||||
|
|
||||||
|
def check_texts_for_industry(industry_name: str):
|
||||||
|
"""
|
||||||
|
Fetches and prints the marketing matrix texts for all personas
|
||||||
|
within a specific industry.
|
||||||
|
"""
|
||||||
|
db = SessionLocal()
|
||||||
|
try:
|
||||||
|
industry = db.query(Industry).filter(Industry.name == industry_name).first()
|
||||||
|
|
||||||
|
if not industry:
|
||||||
|
print(f"Error: Industry '{industry_name}' not found.")
|
||||||
|
# Suggest similar names
|
||||||
|
all_industries = db.query(Industry.name).all()
|
||||||
|
print("\nAvailable Industries:")
|
||||||
|
for (name,) in all_industries:
|
||||||
|
print(f"- {name}")
|
||||||
|
return
|
||||||
|
|
||||||
|
entries = (
|
||||||
|
db.query(MarketingMatrix)
|
||||||
|
.join(Persona)
|
||||||
|
.filter(MarketingMatrix.industry_id == industry.id)
|
||||||
|
.order_by(Persona.id)
|
||||||
|
.all()
|
||||||
|
)
|
||||||
|
|
||||||
|
if not entries:
|
||||||
|
print(f"No marketing texts found for industry: {industry_name}")
|
||||||
|
return
|
||||||
|
|
||||||
|
print(f"--- NEW TEXTS FOR {industry_name} ---")
|
||||||
|
for entry in entries:
|
||||||
|
print(f"\nPERSONA: {entry.persona.name}")
|
||||||
|
print(f"Subject: {entry.subject}")
|
||||||
|
print(f"Intro: {entry.intro.replace(chr(10), ' ')}") # Replace newlines for cleaner one-line output
|
||||||
|
|
||||||
|
except Exception as e:
|
||||||
|
print(f"An error occurred: {e}")
|
||||||
|
finally:
|
||||||
|
db.close()
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
parser = argparse.ArgumentParser(description="Debug and check marketing matrix texts for a given industry.")
|
||||||
|
parser.add_argument(
|
||||||
|
"industry",
|
||||||
|
type=str,
|
||||||
|
nargs='?',
|
||||||
|
default="Healthcare - Hospital",
|
||||||
|
help="The name of the industry to check (e.g., 'Healthcare - Hospital'). Defaults to 'Healthcare - Hospital'."
|
||||||
|
)
|
||||||
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
check_texts_for_industry(args.industry)
|
||||||
@@ -112,9 +112,10 @@ PERSÖNLICHE HERAUSFORDERUNGEN DES ANSPRECHPARTNERS (PAIN POINTS):
|
|||||||
--- DEINE AUFGABE ---
|
--- DEINE AUFGABE ---
|
||||||
1. **Subject:** Formuliere eine kurze Betreffzeile (max. 6 Wörter). Richte sie **direkt an einem der persönlichen Pain Points** des Ansprechpartners oder dem zentralen Branchen-Pain. Sei scharfsinnig, nicht werblich.
|
1. **Subject:** Formuliere eine kurze Betreffzeile (max. 6 Wörter). Richte sie **direkt an einem der persönlichen Pain Points** des Ansprechpartners oder dem zentralen Branchen-Pain. Sei scharfsinnig, nicht werblich.
|
||||||
|
|
||||||
2. **Introduction_Textonly:** Formuliere einen Einleitungstext (2-3 Sätze).
|
2. **Introduction_Textonly:** Formuliere einen prägnanten Einleitungstext (max. 2 Sätze).
|
||||||
- **Satz 1 (Die Brücke):** Knüpfe an die (uns unbekannte) operative Herausforderung an. Beschreibe subtil den Nutzen einer Lösung, ohne das Produkt (Roboter) plump zu nennen.
|
- **WICHTIG:** Gehe davon aus, dass die spezifische Herausforderung des Kunden bereits im Satz davor [Opener] genannt wurde. **Wiederhole die Herausforderung NICHT.**
|
||||||
- **Satz 2 (Die Relevanz):** Schaffe die Relevanz für die Zielperson, indem du das Thema mit einem ihrer persönlichen Pain Points verknüpfst (z.B. "Für Sie als {persona.name} ist dabei entscheidend...").
|
- **Satz 1 (Die Lösung & der Gain):** Beginne direkt mit der Lösung. Nenne die im Kontext `FOKUS-PRODUKT` definierte **Produktkategorie** (z.B. "automatisierte Reinigungsroboter") und verbinde sie mit dem zentralen Nutzen (Gain) aus den `BRANCHEN-HERAUSFORDERUNGEN`. Beispiel: "Genau hier setzen unsere automatisierten Reinigungsroboter an, indem sie eine lückenlose und auditsichere Hygiene gewährleisten."
|
||||||
|
- **Satz 2 (Die Relevanz):** Stelle die Relevanz für die Zielperson her, indem du einen ihrer `PERSÖNLICHE HERAUSFORDERUNGEN` adressierst. Beispiel: "Für Sie als Infrastruktur-Verantwortlicher bedeutet dies vor allem eine reibungslose Integration in bestehende Abläufe, ohne den Betrieb zu stören."
|
||||||
|
|
||||||
3. **Industry_References_Textonly:** Formuliere einen **strategischen Referenz-Block (ca. 2-3 Sätze)** nach folgendem Muster:
|
3. **Industry_References_Textonly:** Formuliere einen **strategischen Referenz-Block (ca. 2-3 Sätze)** nach folgendem Muster:
|
||||||
- **Satz 1 (Social Proof):** Beginne direkt mit dem Nutzen, den vergleichbare Unternehmen in der Branche {industry.name} bereits erzielen. (Erfinde keine Firmennamen, sprich von "Führenden Einrichtungen" oder "Vergleichbaren Häusern").
|
- **Satz 1 (Social Proof):** Beginne direkt mit dem Nutzen, den vergleichbare Unternehmen in der Branche {industry.name} bereits erzielen. (Erfinde keine Firmennamen, sprich von "Führenden Einrichtungen" oder "Vergleichbaren Häusern").
|
||||||
|
|||||||
18
list_industries.py
Normal file
18
list_industries.py
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
|
||||||
|
import sys
|
||||||
|
import os
|
||||||
|
sys.path.append(os.path.join(os.path.dirname(__file__), "company-explorer"))
|
||||||
|
from backend.database import SessionLocal, Industry
|
||||||
|
|
||||||
|
def list_industries():
|
||||||
|
db = SessionLocal()
|
||||||
|
try:
|
||||||
|
industries = db.query(Industry.name).all()
|
||||||
|
print("Available Industries:")
|
||||||
|
for (name,) in industries:
|
||||||
|
print(f"- {name}")
|
||||||
|
finally:
|
||||||
|
db.close()
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
list_industries()
|
||||||
37
read_matrix_entry.py
Normal file
37
read_matrix_entry.py
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
|
||||||
|
import sys
|
||||||
|
import os
|
||||||
|
sys.path.append(os.path.join(os.path.dirname(__file__), "company-explorer"))
|
||||||
|
from backend.database import SessionLocal, Industry, Persona, MarketingMatrix
|
||||||
|
|
||||||
|
def read_specific_entry(industry_name: str, persona_name: str):
|
||||||
|
db = SessionLocal()
|
||||||
|
try:
|
||||||
|
entry = (
|
||||||
|
db.query(MarketingMatrix)
|
||||||
|
.join(Industry)
|
||||||
|
.join(Persona)
|
||||||
|
.filter(Industry.name == industry_name, Persona.name == persona_name)
|
||||||
|
.first()
|
||||||
|
)
|
||||||
|
|
||||||
|
if not entry:
|
||||||
|
print(f"No entry found for {industry_name} and {persona_name}")
|
||||||
|
return
|
||||||
|
|
||||||
|
print("--- Generated Text ---")
|
||||||
|
print(f"Industry: {industry_name}")
|
||||||
|
print(f"Persona: {persona_name}")
|
||||||
|
print("\n[Intro]")
|
||||||
|
print(entry.intro)
|
||||||
|
print("\n[Social Proof]")
|
||||||
|
print(entry.social_proof)
|
||||||
|
print("----------------------")
|
||||||
|
|
||||||
|
finally:
|
||||||
|
db.close()
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
read_specific_entry("Healthcare - Hospital", "Infrastruktur-Verantwortlicher")
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user