Analisi sentiment

È possibile utilizzare l'analisi del sentimento per valutare il modo o il tono del testo.

L'analisi del sentimento analizza le informazioni soggettive in un'espressione. Ad esempio, opinioni, valutazioni, emozioni o atteggiamenti verso un argomento, una persona o un'entità. Le espressioni sono classificate, con un punteggio di affidabilità, come positive, negative o neutre.

L'analisi delle opinioni dei servizi linguistici utilizza l'elaborazione del linguaggio naturale (NLP, natural language processing). Il servizio comprende il testo, restituisce sentimenti positivi, neutri, misti e negativi e un punteggio di affidabilità. Supporta sia l'analisi del sentiment basata su frasi che su aspetti.

Analisi del sentiment basata sugli aspetti

Aspect-Based Sentiment Analysis (ABSA) estrae i singoli aspetti nel documento di input e classifica ciascuno degli aspetti in una delle classi di polarità: positiva, negativa, mista e neutra. Con il sentiment previsto per ogni aspetto, l'API del linguaggio fornisce anche un punteggio di affidabilità per ciascuna classe e i relativi offset corrispondenti nell'input.

I punteggi di affidabilità più vicini a 1 indicano una maggiore fiducia nella classificazione dell'etichetta, mentre i punteggi più bassi indicano un punteggio di affidabilità più basso. L'intervallo del punteggio di affidabilità per ogni classe è compreso tra 0 e 1 e la somma dei punteggi cumulativi di tutte e quattro le classi è pari a 1.

Ad esempio, una recensione del ristorante che dice "Il cibo è marginale, ma il servizio è così cattivo." contiene un sentimento positivo verso l'aspetto alimentare. Inoltre, ha un forte sentimento negativo verso l'aspetto del servizio. Classificare il sentimento generale come negativo trascurerebbe il fatto che il cibo era buono. ABSA risolve questo problema facendo riferimento a un aspetto come attributo (o componente) di un'entità. Inoltre, lo schermo di un telefono o la qualità dell'immagine di una fotocamera.

Se i dati di input sono "Ho avuto una buona giornata di lavoro oggi", allora un singolo giorno dell'aspetto viene identificato con sentimenti positivi al 100%, neutri allo 0%, misti allo 0% e negativi allo 0%.

Analisi sentiment a livello di frase

Il servizio Lingua fornisce inoltre un sentiment a livello di frase con punteggi di affidabilità per ogni frase nel testo. In base al caso d'uso, è possibile selezionare il sentiment della frase o del documento, l'ABSA o entrambi. Ad esempio, in uno scenario di analisi del feedback dei clienti, potrebbe essere necessario identificare le frasi che richiedono una revisione umana per ulteriori azioni.

Casi d'uso

Alcuni casi d'uso aziendali sono:

  • Monitoraggio del marchio

  • Monitoraggio delle ricerche di mercato

  • Analisi feedback dipendente

  • Analisi e-mail e recensioni dei clienti

  • Sondaggi sul prodotto

Ad esempio, le risposte di sondaggi grezzi per clienti e dipendenti possono essere elaborate utilizzando il modello di analisi del sentiment. I risultati possono quindi essere aggregati per l'analisi e il follow-up e per facilitare gli impegni.

Il monitoraggio dei social media può essere utilizzato con l'analisi del sentiment per estrarre l'andamento generale dell'umore del cliente. Ad esempio, quando viene lanciato un nuovo prodotto o vengono condotte ricerche di mercato competitive.

Funzioni supportate

  • Livello di analisi: frase e aspetto

  • Lingua inglese

  • Le richieste supportano batch a record singolo e a più record.

Lingue supportate per testo di input

  • Inglese
  • spagnolo

Esempio di analisi sentiment basata su aspetti

Testo di input Stato d'animo Punteggio polarità
OCI recently added new services to the 
existing compliance program including SOC, HIPAA, and ISO, to 
enable our customers to solve their use cases. We also released 
new technical papers and guidance documents related to Object 
Storage, the Australian Prudential Regulation Authority (APRA), 
and the Central Bank of Brazil. These resources help regulated 
customers better understand how OCI supports their 
regional and industry-specific compliance requirements. Not 
only are we expanding our number of compliance offerings and 
regulatory alignments, we continue to add regions and services 
at a faster rate.
services 
[Positive]
OCI 
[Positive]
resources 
[Positive]
regions 
[Positive]
1. OCI recently added new services to the existing compliance program including SOC, HIPAA, and ISO, to enable 
our customers to solve their use cases. NEUTRAL 0.5512
2. We also released new white papers and guidance documents related to Object Storage, the Australian Prudential 
Regulation Authority (APRA), and the Central Bank of Brazil. NEUTRAL 0.5512
3. These resources help regulated customers better understand how OCI supports their regional and industry-
specific compliance requirements. POSITIVE 0.6763
4. Not only are we expanding our number of compliance offerings and regulatory alignments, we continue to add 
regions and services at a faster rate. POSITIVE 0.4658

Richiesta campione:

Formato richiesta API:
POST https://<region-url>/20210101/actions/batchDetectLanguageSentiments?level=ASPECT 
JSON di input
{
"documents": [
    {
        "key" : "doc1",
        "text" : "OCI recently added new services to existing compliance 
program including SOC, HIPAA, and ISO to enable our customers to solve their 
use cases. We also released new white papers and guidance documents related to 
Object Storage, the Australian Prudential Regulation Authority (APRA), and the 
Central Bank of Brazil. These resources help regulated customers better 
understand how OCI supports their regional and industry-specific compliance 
requirements. Not only are we expanding our number of compliance offerings and 
regulatory alignments, we continue to add regions and services at a faster clip."
    }
]
}
JSON risposta:
{
    "documents": [
        {
            "key": "1",
            "documentSentiment": "Positive",
            "documentScores": {
                "Neutral": 0.44763687,
                "Positive": 0.46578798,
                "Mixed": 0.064058214,
                "Negative": 0.022516921
            },
            "sentences": [
                {
                    "offset": 0,
                    "length": 147,
                    "text": "OCI recently added new services to the existing compliance program including SOC, HIPAA, and ISO, to enable our customers to solve their use cases.",
                    "sentiment": "Neutral",
                    "scores": {
                        "Negative": 0.0154264,
                        "Mixed": 0,
                        "Neutral": 0.98231775,
                        "Positive": 0.0022558598
                    }
                },
                {
                    "offset": 148,
                    "length": 170,
                    "text": "We also released new white papers and guidance documents related to Object Storage, the Australian Prudential Regulation Authority (APRA), and the Central Bank of Brazil.",
                    "sentiment": "Neutral",
                    "scores": {
                        "Mixed": 0,
                        "Neutral": 0.97296304,
                        "Negative": 0.007886417,
                        "Positive": 0.019150572
                    }
                },
                {
                    "offset": 319,
                    "length": 137,
                    "text": "These resources help regulated customers better understand how OCI supports their regional and industry-specific compliance requirements.",
                    "sentiment": "Neutral",
                    "scores": {
                        "Neutral": 0.5864549,
                        "Positive": 0.35583654,
                        "Mixed": 0.02932497,
                        "Negative": 0.028383587
                    }
                },
                {
                    "offset": 457,
                    "length": 145,
                    "text": "Not only are we expanding our number of compliance offerings and regulatory alignments, we continue to add regions and services at a faster rate.",
                    "sentiment": "Positive",
                    "scores": {
                        "Negative": 0.022516921,
                        "Positive": 0.46578798,
                        "Mixed": 0.064058214,
                        "Neutral": 0.44763687
                    }
                }
            ],
            "aspects": [
                {
                    "offset": 325,
                    "length": 9,
                    "text": "resources",
                    "sentiment": "Positive",
                    "scores": {
                        "Positive": 0.9841423768960832,
                        "Negative": 0.01398839404953044,
                        "Neutral": 0,
                        "Mixed": 0.0018692290543864747
                    }
                }
            ],
            "languageCode": "en"
        }
    ],
    "errors": []
}

Esempio di analisi sentiment a livello di frase

Testo di input Stato d'animo Punteggio polarità

Sono rimasto colpito dalla piastra in quanto ha mantenuto un calore uniforme in tutta la superficie. La mia unica preoccupazione è che il cavo sia troppo corto, vorrei davvero che fosse lungo almeno 16 pollici in modo da non dover acquistare un cavo di estensione. Nel complesso, penso che sia OK per il prezzo.

Sentenza 1 [Positiva]

Sentenza 2 [Negativa]

Sentenza 3 [Neutro]

Positive: 0.9997686743736267,
Negative: 0.00023133518698159605,
Neutral: 0
Positive: 0.0043107867240906,
Negative: 
0.9956892132759094,
Neutral": 0
Positive: 0.9908866882324219,
Negative: 0,
Neutral: 0.009113257750868797
Positive: 0.0933981895446777,
Negative: 0,
Neutral: 0.906601857487112284

Richiesta campione:

Formato richiesta API:
POST https://<region-url>/20210101/actions/batchDetectLanguageSentiments?level=SENTENCE
JSON di input

{
    "documents": [
        {
            "key": "doc1",
            "text": "OCI recently added new services to existing compliance program including SOC, HIPAA, and ISO to enable our customers to solve their use cases. We also released new white papers and guidance documents related to Object Storage, the Australian Prudential Regulation Authority (APRA), and the Central Bank of Brazil. These resources help regulated customers better understand how OCI supports their regional and industry-specific compliance requirements. Not only are we expanding our number of compliance offerings and regulatory alignments, we continue to add regions and services at a faster clip."
        }
    ]
}
JSON risposta:
{
    "documents": [
        {
            "key": "doc1",
            "documentSentiment": "positive",
            "documentScores": {
                "positive": 0.6763582,
                "mixed": 0.08708387,
                "neutral": 0.12376911,
                "negative": 0.11278882
            },
            "sentences": [
                {
                    "text": "OCI recently added new services to existing compliance program including SOC, HIPAA, and ISO to enable our customers to solve their use cases.",
                    "sentiment": "neutral",
                    "scores": {
                        "positive": 0.15475821,
                        "neutral": 0.5567636,
                        "mixed": 0.09907853,
                        "negative": 0.18939966
                    }
                },
                {
                    "text": "We also released new white papers and guidance documents related to Object Storage, the Australian Prudential Regulation Authority (APRA), and the Central Bank of Brazil.",
                    "sentiment": "neutral",
                    "scores": {
                        "mixed": 0.07148028,
                        "negative": 0.12318015,
                        "positive": 0.11138679,
                        "neutral": 0.6939528
                    }
                },
                {
                    "text": "These resources help regulated customers better understand how OCI supports their regional and industry-specific compliance requirements.",
                    "sentiment": "positive",
                    "scores": {
                        "negative": 0.11278882,
                        "neutral": 0.12376911,
                        "mixed": 0.08708387,
                        "positive": 0.6763582
                    }
                },
                {
                    "text": "Not only are we expanding our number of compliance offerings and regulatory alignments, we continue to add regions and services at a faster clip.",
                    "sentiment": "neutral",
                    "scores": {
                        "mixed": 0.0973028,
                        "positive": 0.18745653,
                        "negative": 0.1592837,
                        "neutral": 0.55595696
                    }
                }
            ],
            "aspects": [],
            "languageCode": "en"
        }
    ],
    "errors": []
}

I valori effettivi e la struttura di input e output possono variare in base alla versione del modello. Vedere la documentazione SDK.

Limitazioni

  • Gli aspetti identificati potrebbero essere corrispondenze parziali o aspetti di divisione.

  • Quando le frasi sono semanticamente o strutturalmente errate, gli aspetti potrebbero differire dalle tue aspettative.

  • I pronomi non sono considerati aspetti.

  • Il sarcasmo non è riconosciuto.