Sentiment-Analyse auf X
Auf dieser Seite
Verstehen Sie, was Ihre Zielgruppe wirklich denkt
Die Sentiment-Analyse verwandelt Tausende von Posts in eine klare Übersicht darüber, wie Ihre Marke, Wettbewerber oder die Branche wahrgenommen werden. Mit X Search und den Schlussfolgerungsfähigkeiten von Grok können Sie über eine einfache positive/negative Klassifizierung hinausgehen und emotionale Nuancen, latente Frustrationen und Warnsignale verstehen.
Sentiment-Dimensionen im Marketing
Die Sentiment-Analyse im Marketing geht über das positive/negative Binärmodell hinaus. Hier sind die relevanten Dimensionen:
5-Ebenen-Sentiment-Skala
- Sehr positiv: Begeisterung, aktive Empfehlung, Markenliebe
- Positiv: Zufriedenheit, Zustimmung, Interesse
- Neutral: Faktische Erwähnung, Informationsweitergabe
- Negativ: Enttäuschung, Kritik, Frustration
- Sehr negativ: Wut, Aufruf zum Boykott, Krise
Zusätzliche Dimensionen
- Kaufabsicht: Zeigt der Post eine Absicht zum Kauf oder zum Abbestellen an?
- Einfluss: Stammt der Post von einem einflussreichen Konto oder einem durchschnittlichen Verbraucher?
- Viralität: Hat der Post Potenzial zur Verbreitung?
- Dringlichkeit: Erfordert das Signal eine schnelle Reaktion?
Sentiment-Analyse mit X Search und Grok
Sentiment-Analyse für Ihre Marke
def analyser_sentiment_marque(marque, periode_jours=7):
from datetime import datetime, timedelta
today = datetime.now().strftime("%Y-%m-%d")
start = (datetime.now() - timedelta(days=periode_jours)).strftime("%Y-%m-%d")
response = client.responses.create(
model="grok-4.20-0309-reasoning",
input=f"""Analyze the sentiment of conversations on X
about {marque} between {start} and {today}.
For each conversation theme identified, provide:
1. The theme (e.g., "customer service", "product quality")
2. The dominant sentiment (1-5 scale)
3. The estimated conversation volume
4. The most representative verbatims
5. The most influential accounts in the discussion
6. Sentiment evolution over the period
Final summary:
- Global sentiment score (1-5)
- Top 3 positive points
- Top 3 negative points
- Any alerts""",
tools=[{
"type": "x_search",
"from_date": start,
"to_date": today
}]
)
return response.output_text
Vergleichende Sentiment-Analyse
Vergleichen Sie die Wahrnehmung Ihrer Marke mit der Ihrer Wettbewerber:
def sentiment_comparatif(marques, periode_jours=30):
from datetime import datetime, timedelta
today = datetime.now().strftime("%Y-%m-%d")
start = (datetime.now() - timedelta(days=periode_jours)).strftime("%Y-%m-%d")
response = client.responses.create(
model="grok-4.20-0309-reasoning",
input=f"""Compare sentiment on X for these brands:
{', '.join(marques)}
Period: {start} to {today}
For each brand, evaluate:
- Global sentiment score (1-5, with decimal)
- Dominant positive themes
- Dominant negative themes
- Strengths perceived by the public
- Weaknesses perceived by the public
Final comparison table ranked by sentiment.
Identify positioning opportunities for the
first brand in the list.""",
tools=[{"type": "x_search", "from_date": start, "to_date": today}]
)
return response.output_text
Strukturierte Ergebnisse in JSON erhalten
Um die Sentiment-Analyse in eine Datenpipeline zu integrieren, fordern Sie eine JSON-Ausgabe an:
def sentiment_structure(marque, periode_jours=7):
from datetime import datetime, timedelta
today = datetime.now().strftime("%Y-%m-%d")
start = (datetime.now() - timedelta(days=periode_jours)).strftime("%Y-%m-%d")
response = client.responses.create(
model="grok-4.20-0309-reasoning",
input=f"""Analyze sentiment on X about {marque}.
Period: {start} to {today}.
Respond ONLY in valid JSON with this structure:
{{
"brand": "{marque}",
"period": "{start} - {today}",
"global_score": 3.7,
"distribution": {{
"very_positive": 15,
"positive": 35,
"neutral": 30,
"negative": 15,
"very_negative": 5
}},
"themes": [
{{
"name": "customer service",
"score": 2.1,
"volume": "high",
"trend": "stable"
}}
],
"alerts": ["alert description if applicable"],
"recommendations": ["recommended action"]
}}""",
tools=[{"type": "x_search", "from_date": start, "to_date": today}]
)
return response.output_text
Sentiment-Entwicklung über die Zeit verfolgen
Einmalige Analysen sind nützlich, aber die Verfolgung über die Zeit offenbart Trends. Vergleichen Sie die Ergebnisse Woche für Woche:
def evolution_sentiment(marque, nb_semaines=4):
from datetime import datetime, timedelta
import json
historique = []
for i in range(nb_semaines, 0, -1):
end = (datetime.now() - timedelta(weeks=i-1)).strftime("%Y-%m-%d")
start = (datetime.now() - timedelta(weeks=i)).strftime("%Y-%m-%d")
response = client.responses.create(
model="grok-4.20-0309-reasoning",
input=f"""Sentiment score on X for {marque}
from {start} to {end}.
Respond with a JSON: {{"week": "{start}",
"score": X.X, "volume": N, "dominant_theme": "..."}}""",
tools=[{
"type": "x_search",
"from_date": start,
"to_date": end
}]
)
historique.append(response.output_text)
return historique
Reputationskrisen erkennen
Die Sentiment-Analyse ist Ihr erstes Warnsystem im Falle einer Krise:
def detecter_crise(marque, seuil_negatif=40):
resultat = sentiment_structure(marque, periode_jours=1)
# Parse the JSON
import json
data = json.loads(resultat)
pct_negatif = (data["distribution"]["negative"] +
data["distribution"]["very_negative"])
if pct_negatif > seuil_negatif:
return {
"alert": True,
"level": "CRITICAL" if pct_negatif > 60 else "IMPORTANT",
"score": data["global_score"],
"negative_themes": [t for t in data["themes"] if t["score"] < 2.5],
"recommendation": "Crisis meeting recommended"
}
return {"alert": False, "score": data["global_score"]}
Kernaussagen
- Die Sentiment-Analyse geht über positiv/negativ hinaus: Bewerten Sie Absicht, Einfluss und Dringlichkeit.
- Nutzen Sie eine 5-Ebenen-Skala, um Nuancen zu erfassen.
- Fordern Sie strukturierte JSON-Ausgaben an, um Ihre Dashboards zu versorgen.
- Verfolgen Sie die Sentiment-Entwicklung über die Zeit, nicht nur einmalige Schnappschüsse.
- Vergleichen Sie systematisch Ihr Sentiment mit dem Ihrer Wettbewerber.
- Konfigurieren Sie Warnschwellen, um Reputationskrisen in ihrem Entstehen zu erkennen.