Sentic APIs

Sentic APIs are a suite of application programming interfaces that perform various sentiment analysis tasks in different languages. All the APIs are based on the sentic computing framework and, hence, leverage an ensemble of symbolic AI (SenticNet) and subsymbolic AI (deep learning). Unfortunately, we had to restrict API access for cybersecurity reasons but no worries: you can get the full set of API keys by filling in the Sentic API Suite Request Form, which only takes one minute to complete. Some of the code these APIs are based on is available on our GitHub and some of the resources they use are available on our downloads page. Below you can find a short video introducing the APIs and their peculiarities. After that, we provide a description (inclusive of links to relevant papers) for each of the 12 functionalities offered by our Sentic API Suite. If you encounter any issue with any of the APIs, please do not hesitate to contact us.

concept parsing
subjectivity detection
polarity classification
intensity ranking
emotion recognition
aspect extraction
personality prediction
sarcasm identification
depression categorization
toxicity spotting
engagement measurement
well-being assessment




CONCEPT PARSING

Before polarity detection can be performed, affective words and multiword expressions need to be extracted from text. This API provides access to sentic parser, a tool for quickly identifying affective concepts from free text without requiring time-consuming phrase structure analysis. The parser employs a graph-based approach to extract 'semantic atoms' like go_bananas, pain_killer, or get_along_with, which would carry different meaning and polarity if broken down into singular words. Sentic parser also removes inflections (such as -ing, -ful, and -able) and neutral prefixes (such as en-, re-, and co-) so that words like ‘entrusted’, ‘entrusts’, ‘entrusting’, ‘entrustment’, ‘trustable’, ‘trustful’, ‘trustfully’, ‘trustfulness’, ‘trustingly’, ‘trustworthy’, ‘trustworthiness’, and more, can be normalized as TRUST. The parses also handles negative prefixes (such as mis-, dis-, and un-) so that words like ‘distrusted’, ‘distrustfully’, ‘distrusting’, ‘mistrustable’, ‘mistrusting’, ‘mistrustful’, ‘trustless’, ‘trustlessly’, ‘untrustworthy’, ‘untrusting’, and more, are normalized as NOT TRUST. The input of this API is a piece of text (a sentence or a paragraph) and the output is a list of words and multiword expressions that are either polar concepts (positive or negative) or opinion targets (aspect terms).

sentic parser



SUBJECTIVITY DETECTION

Subjectivity detection is an important NLP task that aims to filter out ‘factual’ content from data, i.e., objective text that does not contain any opinion. Such a pre-processing step is crucial to increase the accuracy of sentiment analysis systems, as these are usually optimized for the binary classification task of distinguishing between positive and negative content. This API leverages a framework that exploits the features of both Bayesian networks and fuzzy recurrent neural networks to detect subjectivity, i.e., label text as either subjective (opinionated) or objective (unopinionated). The API also handles ambivalence or neutrality, that is, text that is opinionated but neither positive nor negative (ambivalent stance towards the opinion target). The API receives a piece of text (a sentence or a paragraph) as input and outputs one of these labels: OBJECTIVE (neutral), SUBJECTIVE (positive or negative), or AMBIVALENT (neither positive nor negative).

neutrality detection



POLARITY CLASSIFICATION

Polarity classification is the most basic task of sentiment analysis and consists in the categorization of text as either positive, negative, or neutral. This API leverages neurosymbolic AI to assign contextual polarity to concepts in text using SenticNet and to flux such polarity through dependency arcs in order to assign a final polarity label to each sentence via sentic patterns. Analyzing how sentiment flows from concept to concept through dependency relations allows for a better understanding of the contextual role of each concept in text and, hence, to achieve a dynamic polarity inference that outperforms state-of-the-art statistical methods in terms of both accuracy and training time. The expected input of this API is a piece of text (a sentence or a paragraph) and the output is one of the following labels: POSITIVE, NEGATIVE, or NEUTRAL.

polarity detection



INTENSITY RANKING

Emotions and sentiments are subjective in nature. They differ on a case-to-case basis. However, predicting only the emotion and sentiment does not always convey complete information. The degree or level of emotions and sentiments often plays a crucial role in understanding the exact feeling within a single class (e.g., ‘good’ versus ‘awesome’). This API leverages a stacked ensemble method for ranking intensity of both emotion and sentiment by combining the outputs obtained from SenticNet and three deep learning models based on convolutional neural networks, long short-term memory networks and gated recurrent units. Given a piece of text (a sentence or a paragraph) as input, the API outputs a number between -100 (highest negative intensity) and 100 (highest positive intensity) passing through 0 (null intensity).

emotion intensity



EMOTION RECOGNITION

Affective neuroscience and twin disciplines have clearly demonstrated how emotions and intelligence are strictly connected. Some prominent researchers have also questioned the possibility of emulating intelligence without taking emotions into account. Emotions, however, are rather elusive entities and, hence, are difficult to categorize. This API uses the Hourglass of Emotions, a biologically inspired and psychologically motivated emotion categorization model for sentiment analysis, in concomitance with SenticNet and deep learning, to extract emotion labels from text. The input of this API is a piece of text (a sentence or a paragraph) and the output is a list of emotion labels.

emojis



ASPECT EXTRACTION

Aspect extraction is a fundamental pre-processing step to enable aspect-based sentiment analysis, i.e., the detection of polarity with respect to different product or service features (aspects) in stead of the overall polarity of the opinion. This is key for correctly calculating the polarity of text in which antithetic opinions about different aspects (opinion targets) of the same product are expressed. From a sentence like “the touchscreen is great but the battery lasts very little”, for example, this API extracts touchscreen as positive and battery as negative. The API takes a piece of text (a sentence or a paragraph) as input and outputs a list of aspects with corresponding polarity values.sentic gcn



PERSONALITY PREDICTION

Personality can be an important factor for polarity detection. For example, a concept like go_out_party could be positive for extroverts but negative for introverts. State-of-the-art personality prediction with text data mostly relies on bottom up, automated feature generation as part of the deep learning process. More traditional models rely on hand-crafted, theory-based text-feature categories. This API leverages a novel hard negative sampling strategy that predicts personality traits from text using both OCEAN and MBTI models. The input of this API is a piece of text (a sentence or a paragraph) and the output is a personality type. The larger the input, the more accurate the personality prediction.

personality prediction


SARCASM IDENTIFICATION

Polarity classification and sarcasm identification are both important natural language processing tasks. Sentiment is always coupled with sarcasm where intensive emotion is expressed. Nevertheless, most literature considers them as two separate tasks. This API leverages a deep learning framework that models this correlation to improve the performance of both tasks in a multitask learning setting. The API receives a piece of text (a sentence or a paragraph) as input and outputs a sarcasm score between zero (no sarcasm detected) and 100 (high sarcasm detected).

sarcasm identification


DEPRESSION CATEGORIZATION

Depression is a critical issue in modern society, which can sometimes turn to suicidal ideation without effective treatment. Early detection of depression from social content provides a potential way for effective social intervention. This API provides an explainable AI model based on hierarchical attention networks to categorize depression with a related risk indicator. The API receives a piece of text (a sentence or a paragraph) as input and outputs a depression score between zero (no depression detected) and 100 (high depression detected).

depression categorization


TOXICITY SPOTTING

Toxicity spotting has become a serious problem in online communities and social networking sites. This API leverages a multichannel convolutional bidirectional gated recurrent unit for toxicity spotting in a multilabel environment. The proposed model extracts local features with many filters and different kernel sizes to model input words with long term dependency. It then integrates multiple channels with a fully connected layer, normalization layer, and an output layer with a sigmoid activation function for predicting multilabel categories. The API takes a piece of text (a sentence or a paragraph) as input and outputs a toxicity score between zero (no toxicity detected) and 100 (high toxicity detected).

toxicity spotting


ENGAGEMENT MEASUREMENT

User engagement is important because it can predict profitability and measure the effectiveness of specific marketing campaigns. Measuring engagement can provide actionable insights into how users view and use a specific service or product. This API leverages different AI techniques for polarity classification, intensity ranking, and emotion recognition in order to assess how engaging a target product is to users. The API takes a piece of text (a sentence or a paragraph) as input and outputs an engagement score between -100 (high disengagement) and 100 (high engagement).

engagement measurement


WELL-BEING ASSESSMENT

Subjective well-being is a broad concept related to mental health that refers to individuals' cognitive and affective evaluation of their lives. Cognitive evaluation, or self-actualization, is a self-assessment of one's own life from both positive and negative perspectives, e.g., stress. Affective evaluation is what we usually refer to as 'happiness' or the aggregation of emotions within a period of time. The API takes a piece of text (a sentence or a paragraph) as input and outputs a well-being score between -100 (high stress) and 100 (high well-being).

well-being assessment