Back to Top

 

Sentiment: Keyword Extraction

Keyword-level Sentiment Analysis Support

AlchemyAPI provides the ability to extract keyword-level sentiment (positive/negative statements), in addition to performing document-level, user-targeted sentiment, directional sentiment, and entity-level sentiment analysis.

What is Sentiment Analysis?

Sentiment analysis is the process of identifying positive or negative statements, feelings, and opinions within text.

How Do I Use It?

Keyword-level sentiment output is disabled by default. Enabling this feature results in counting of one additional transaction against your daily API limit. To enable keyword-level sentiment analysis, you may utilize the following HTTP parameter with your API calls:

    sentiment=1

NOTE: Sentiment analysis is currently available for English and German-language content only. Support for outputting sentiment data for entities in other languages is currently in development.

What Does AlchemyAPI Keyword-level Sentiment Look Like?

When keyword-level sentiment analysis is enabled, sentiment data is included for every detected keyword within AlchemyAPI responses. The following is an example XML-formatted response (for "Moammar Gadhafi"):

    <keyword>
        <text>Moammar Gadhafi</text>
        <relevance>0.813554</relevance>
        <sentiment>
            <type>negative</type>
            <score>-0.120216</score>
        </sentiment>
    </keyword>

NOTE: Keyword-level sentiment analysis is supported within all AlchemyAPI response formats, including XML, JSON, and RDF.