Tweet tone detector
Detect the tone and sentiment behind tweets.
Based on the tweet, the primary tone expressed by the author is sarcastic, and the sentiment is negative.
Key indicators:
-
The use of "🙄" emoticon, which represents an eye-roll, typically expresses sarcasm or dismissiveness.
-
The phrase "They really have their priorities straight." is likely meant sarcastically, implying the opposite - that the company's priorities are misguided or mishandled.
-
The hashtags #sarcasm and #fail explicitly indicate sarcasm and a perceived failure or negative situation.
The combination of the eye-roll emoticon, the sarcastic remark about priorities, and the relevant hashtags strongly suggests that the author is expressing a sarcastic and negative sentiment towards the company's handling of the crisis mentioned.
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)