Skip to content

Comments Analyzer

Ask Nova to analyze internet comments and characterize their sentiments and feedback.

System Prompt Template

You are an {role name signaling expertise} and {single sentence task definition}.
Follow these instructions:
{enumerated instruction list}

Example

Amazon Nova Pro System Prompt

You are an expert at reading internet comments and characterizing their sentiments, praise, and criticisms.

Follow these instructions:
1. Read and analyze all comments
2. Determine sentiment (positive/negative/neutral) for each
3. Record reasons for each sentiment
4. Rate overall sentiment (HATED to LOVED)
5. List top 5 positives (15 words each)
6. List top 5 negatives (15 words each)
7. Provide 15-word summary through commenters' eyes

Amazon Nova Pro User Prompt

Comments on a new programming tutorial video:

User1: "Finally, a clear explanation of async/await! The diagrams really helped visualize the concepts."

User2: "Too basic for experienced devs, but good for beginners I guess. Wish it covered more edge cases."

User3: "Great examples and clear explanations. Would love to see more advanced topics in future videos!"

User4: "Audio quality could be better - had to turn up volume. Content is solid though."

User5: "Meh, another JavaScript tutorial. Nothing we haven't seen before."

User6: "The step-by-step breakdown of promises was exactly what I needed. Subscribed!"

Amazon Nova Pro Sample Response

Response

Sentiment Analysis

  1. User1: Positive
  2. Reason: Appreciates the clear explanation and helpful diagrams.

  3. User2: Neutral with Negative undertone

  4. Reason: Finds the content good for beginners but too basic for experienced devs and wishes for more edge cases.

  5. User3: Positive

  6. Reason: Enjoys the examples and clear explanations, and expresses desire for more advanced topics.

  7. User4: Neutral with Negative undertone

  8. Reason: Criticizes the audio quality but acknowledges solid content.

  9. User5: Negative

  10. Reason: Finds the tutorial unoriginal and uninteresting.

  11. User6: Positive

  12. Reason: Values the step-by-step breakdown of promises and decides to subscribe.

Overall Sentiment: LIKED

Top 5 Positives

  1. Clear explanation of async/await with helpful diagrams.
  2. Great examples and clear explanations for better understanding.
  3. Step-by-step breakdown of promises meets specific needs.
  4. Content is solid and valuable despite minor audio issues.
  5. Expressed desire for more advanced topics in future videos.

Top 5 Negatives

  1. Audio quality needs improvement for better listening experience.
  2. Content deemed too basic for experienced developers.
  3. Lack of coverage on more complex edge cases.
  4. Tutorial perceived as unoriginal and repetitive.
  5. Basic level not challenging enough for seasoned programmers.

15-Word Summary Through Commenters' Eyes

Mixed reactions: clear explanations praised, audio and depth criticized.

API Request

import boto3
import json

bedrock_runtime = boto3.client(
            service_name="bedrock-runtime",
            region_name="us-west-2"
        )

response = bedrock_runtime.converse(
                modelId='us.amazon.nova-pro-v1:0',
                system = [
                    {
                        "text": """You are an expert at reading internet comments and characterizing their sentiments, praise, and criticisms.

                            Follow these instructions:
                            1. Read and analyze all comments
                            2. Determine sentiment (positive/negative/neutral) for each
                            3. Record reasons for each sentiment
                            4. Rate overall sentiment (HATED to LOVED)
                            5. List top 5 positives (15 words each)
                            6. List top 5 negatives (15 words each)
                            7. Provide 15-word summary through commenters' eyes"""
                    }
                ],
                messages = [
                {
                    "role": "user",
                    "content": [
                        {
                            "text": """Comments on a new programming tutorial video:

                                User1: "Finally, a clear explanation of async/await! The diagrams really helped visualize the concepts."

                                User2: "Too basic for experienced devs, but good for beginners I guess. Wish it covered more edge cases."

                                User3: "Great examples and clear explanations. Would love to see more advanced topics in future videos!"

                                User4: "Audio quality could be better - had to turn up volume. Content is solid though."

                                User5: "Meh, another JavaScript tutorial. Nothing we haven't seen before."

                                User6: "The step-by-step breakdown of promises was exactly what I needed. Subscribed!\""""
                        }
                    ]
                }
            ],
            inferenceConfig={
                "temperature": 0.1,
                "topP": .99,
                "maxTokens": 1024
            }
            )

print(json.dumps(response, indent=2))
aws bedrock-runtime converse \
  --model-id "us.amazon.nova-pro-v1:0" \
  --system '[
    {
      "text": "You are an expert at reading internet comments and characterizing their sentiments, praise, and criticisms.\n\nFollow these instructions:\n1. Read and analyze all comments\n2. Determine sentiment (positive/negative/neutral) for each\n3. Record reasons for each sentiment\n4. Rate overall sentiment (HATED to LOVED)\n5. List top 5 positives (15 words each)\n6. List top 5 negatives (15 words each)\n7. Provide 15-word summary through commenters'\'' eyes"
    }
  ]' \
  --messages '[
    {
      "role": "user",
      "content": [
        {
          "text": "Comments on a new programming tutorial video:\n\nUser1: \"Finally, a clear explanation of async/await! The diagrams really helped visualize the concepts.\"\n\nUser2: \"Too basic for experienced devs, but good for beginners I guess. Wish it covered more edge cases.\"\n\nUser3: \"Great examples and clear explanations. Would love to see more advanced topics in future videos!\"\n\nUser4: \"Audio quality could be better - had to turn up volume. Content is solid though.\"\n\nUser5: \"Meh, another JavaScript tutorial. Nothing we haven'\''t seen before.\"\n\nUser6: \"The step-by-step breakdown of promises was exactly what I needed. Subscribed!\""
        }
      ]
    }
  ]' \
  --inference-config '{
    "temperature": 0.1,
    "topP": 0.99,
    "maxTokens": 1024
  }' \
  --region us-west-2
{
  "modelId": "us.amazon.nova-pro-v1:0",
  "system": [
    {
      "text": "You are an expert at reading internet comments and characterizing their sentiments, praise, and criticisms.\n\nFollow these instructions:\n1. Read and analyze all comments\n2. Determine sentiment (positive/negative/neutral) for each\n3. Record reasons for each sentiment\n4. Rate overall sentiment (HATED to LOVED)\n5. List top 5 positives (15 words each)\n6. List top 5 negatives (15 words each)\n7. Provide 15-word summary through commenters' eyes"
    }
  ],
  "messages": [
    {
      "role": "user",
      "content": [
        {
          "text": "Comments on a new programming tutorial video:\n\nUser1: \"Finally, a clear explanation of async/await! The diagrams really helped visualize the concepts.\"\n\nUser2: \"Too basic for experienced devs, but good for beginners I guess. Wish it covered more edge cases.\"\n\nUser3: \"Great examples and clear explanations. Would love to see more advanced topics in future videos!\"\n\nUser4: \"Audio quality could be better - had to turn up volume. Content is solid though.\"\n\nUser5: \"Meh, another JavaScript tutorial. Nothing we haven't seen before.\"\n\nUser6: \"The step-by-step breakdown of promises was exactly what I needed. Subscribed!\""
        }
      ]
    }
  ],
  "inferenceConfig": {
    "temperature": 0.1,
    "topP": 0.99,
    "maxTokens": 1024
  }
}