Understanding the emotional content of text can provide valuable insights about users or the content, especially in areas such as customer feedback, reviews, customer support, and product branding. This experiment classifies text by emotions such as joy, amusement, gratitude, surprise, disapproval, sadness, anger, and confusion.
Apply for access | Private documentation |
Intended use
Problem types:
The NL Emotion API is valuable for understanding granular-level sentiment beyond just positive or negative. Potential applications are listed below.
Industries and functions:
This API could be useful across diverse set of industries & functions, including:
- User Feedback & Reviews: to understand user emotions through text expressed in forms, surveys, reviews, or other means.
- Social listening: to understand audience’s emotions about products or services by evaluating a stream of web data from sources such as Twitter, Reddit, YouTube, or more.
- Customer service: to evaluate user experience from customer service channels such as chat support.
- Marketing & branding: to understand how the target audience perceives a particular brand campaign, website, and other branding content.
- Expressive content: to surface expressive content to the user (e.g., GIFs, stickers, and emojis for chat apps)
Inputs and outputs:
- Input: text input (ideally <30 words; if text is longer, it should be broken into shorter segments).
- Output: prediction scores corresponding to each of the emotions (joy, amusement, gratitude, surprise, disapproval, sadness, anger, and confusion)
Technical challenges:
Customers may have to evaluate the prediction scores for emotions and adjust thresholds for their use cases. For instance, they may choose a higher threshold for applications where precision is important, and lower threshold for cases that need higher recall.
What data do I need?
Data and label types:
The experiment has been designed to work for texts with <= 30 words. The best prediction results are seen at a sentence level, but the models can predict emotions over a few sentences as well, as long as the total number of words is <= 30. In the case of long paragraphs we recommend: (1) break the paragraphs at sentence level and query the model for each sentence, and (2) for long sentences, break the sentence at 30 words and average the prediction results. Once onboarded, customers will receive more instructions on how to prepare data appropriately.
Specifications:
- Maximum input length: 30 words
- Language: English (US/UK)
- Input format: Input data will be submitted as a CSV file to the API.
- Output format: The output result from the API will include predicted scores for each emotion concept, in float vector format.
What skills do I need?
As with all AI Workshop experiments, successful users are likely to be savvy with core AI concepts and skills in order to both deploy the experiment technology and interact with our AI researchers and engineers.
In particular, users of this experiment should:
- Be familiar with accessing Google APIs
- Have preliminary understanding of Natural Language Processing in order to interpret results and choose thresholds for the particular use case.