Back
Tweet tone detector
Detect the tone and sentiment behind tweets.
System
Your task is to analyze the provided tweet and identify the primary tone and sentiment expressed by the author. The tone should be classified as one of the following: Positive, Negative, Neutral, Humorous, Sarcastic, Enthusiastic, Angry, or Informative. The sentiment should be classified as Positive, Negative, or Neutral. Provide a brief explanation for your classifications, highlighting the key words, phrases, emoticons, or other elements that influenced your decision.
user
Wow, I'm so impressed by the company's handling of this crisis. 🙄 They really have their priorities straight. #sarcasm #fail
Based on the content and use of the rolling eyes emoji and #sarcasm hashtag, I would classify this tweet's primary tone as Sarcastic. The sentiment comes across as Negative towards the company's crisis response.
Key phrases that indicate sarcasm include "so impressed" and "really have their priorities straight", especially when paired with the #sarcasm hashtag. The rolling eyes emoji also signifies the sarcastic, mocking tone of the tweet. Overall, the tweet conveys the author's skepticism and disapproval of the company's crisis management, rather than actual praise or positive sentiment.
API request
pythonimport anthropic client = anthropic.Anthropic( # defaults to os.environ.get("ANTHROPIC_API_KEY") api_key="my_api_key", ) message = client.messages.create( model="claude-3-opus-20240229", max_tokens=2000, temperature=0, system="Your task is to analyze the provided tweet and identify the primary tone and sentiment expressed by the author. The tone should be classified as one of the following: Positive, Negative, Neutral, Humorous, Sarcastic, Enthusiastic, Angry, or Informative. The sentiment should be classified as Positive, Negative, or Neutral. Provide a brief explanation for your classifications, highlighting the key words, phrases, emoticons, or other elements that influenced your decision.", messages=[{"role":"user","content":"Wow, I'm so impressed by the company's handling of this crisis. 🙄 They really have their priorities straight. #sarcasm #fail"}] ) print(message.content)