Pāriet uz galveno saturu
Latviešu— Izvēlēties valodu
Izvēlne

Analīze par noskaņojumu platformā X

Nodarbība 9 no 12 Atjaunota 2026. gada 30. jūlijs Vidējs
Šajā lapā
  1. Saproti, ko patiesībā domā tava auditorija
  2. Noskaņojuma dimensijas mārketingā
  3. Analizē noskaņojumu, izmantojot X Search un Grok
  4. Iegūsti strukturētus rezultātus formātā JSON
  5. Izseko noskaņojuma izmaiņas laika gaitā
  6. Atklāj reputācijas krīzes
  7. Galvenās atziņas

Saproti, ko patiesībā domā tava auditorija

Noskaņojuma analīze pārvērš tūkstošiem ierakstu skaidrā priekšstatā par to, kā tiek uztverts tavs zīmols, konkurenti vai nozare kopumā. Izmantojot X meklēšanu un Grok spriešanas spējas, tu vari iet tālāk par vienkāršu pozitīva/negatīva klasifikāciju, lai izprastu emocionālās nianses, slēptās neapmierinātības izpausmes un brīdinājuma signālus.

5
noskaņojuma līmeņi
API
reāllaiks
JSON
strukturēta izvade
Multi
analizētas dimensijas

Noskaņojuma dimensijas mārketingā

Noskaņojuma analīze mārketingā sniedzas tālāk par bināro pozitīvs/negatīvs dalījumu. Lūk, būtiskākās dimensijas:

5 līmeņu noskaņojuma skala

  1. Ļoti pozitīvs: entuziasms, aktīva ieteikšana, mīlestība pret zīmolu
  2. Pozitīvs: apmierinātība, apstiprinājums, interese
  3. Neitrāls: faktisks pieminējums, informācijas kopīgošana
  4. Negatīvs: vilšanās, kritika, neapmierinātība
  5. Ļoti negatīvs: dusmas, aicinājums uz boikotu, krīze

Papildu dimensijas

  • Pirkuma nodoms: vai ieraksts liecina par nodomu pirkt vai atteikties no pakalpojuma?
  • Ietekme: vai ieraksts nāk no ietekmīga konta vai vidusmēra patērētāja?
  • Viralitāte: vai ierakstam ir izplatīšanās potenciāls?
  • Steidzamība: vai signāls prasa ātru reakciju?

Analizē noskaņojumu, izmantojot X Search un Grok

Tava zīmola noskaņojuma analīze

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

Salīdzinošā noskaņojuma analīze

Salīdzini sava zīmola uztveri ar konkurentu uztveri:

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

Iegūsti strukturētus rezultātus formātā JSON

Lai integrētu noskaņojuma analīzi datu plūsmā, pieprasi izvadi formātā JSON:

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

Izseko noskaņojuma izmaiņas laika gaitā

Vienreizēja analīze ir noderīga, taču izsekošana laika gaitā atklāj tendences. Salīdzini rezultātus nedēļu pēc nedēļas:

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

Atklāj reputācijas krīzes

Noskaņojuma analīze ir tava pirmā brīdinājuma sistēma krīzes gadījumā:

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"]}

Galvenās atziņas

  • Noskaņojuma analīze sniedzas tālāk par pozitīvs/negatīvs: vērtē nodomus, ietekmi un steidzamību
  • Izmanto 5 līmeņu skalu, lai uztvertu nianses
  • Pieprasi strukturētu izvadi formātā JSON, lai barotu savus informācijas paneļus
  • Izseko noskaņojuma izmaiņas laika gaitā, nevis paļaujies tikai uz vienreizējiem momentuzņēmumiem
  • Sistemātiski salīdzini savu noskaņojumu ar konkurentu noskaņojumu
  • Konfigurē brīdinājuma sliekšņus, lai atklātu reputācijas krīzes to rašanās brīdī