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
- User1: Positive
-
Reason: Appreciates the clear explanation and helpful diagrams.
-
User2: Neutral with Negative undertone
-
Reason: Finds the content good for beginners but too basic for experienced devs and wishes for more edge cases.
-
User3: Positive
-
Reason: Enjoys the examples and clear explanations, and expresses desire for more advanced topics.
-
User4: Neutral with Negative undertone
-
Reason: Criticizes the audio quality but acknowledges solid content.
-
User5: Negative
-
Reason: Finds the tutorial unoriginal and uninteresting.
-
User6: Positive
- Reason: Values the step-by-step breakdown of promises and decides to subscribe.
Overall Sentiment: LIKED
Top 5 Positives
- Clear explanation of async/await with helpful diagrams.
- Great examples and clear explanations for better understanding.
- Step-by-step breakdown of promises meets specific needs.
- Content is solid and valuable despite minor audio issues.
- Expressed desire for more advanced topics in future videos.
Top 5 Negatives
- Audio quality needs improvement for better listening experience.
- Content deemed too basic for experienced developers.
- Lack of coverage on more complex edge cases.
- Tutorial perceived as unoriginal and repetitive.
- 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
}
}