Sentiment analysis
Rocket Scraper provides powerful sentiment analysis capabilities powered by advanced AI models. Automatically analyze the emotional tone and sentiment of text content from any webpage, whether it's product reviews, social media posts, or article comments.
Key Benefits
- Clear Categories: Get straightforward sentiment classifications: Negative, Neutral, or Positive
- Multilingual Support: Analyze sentiment across multiple languages automatically.
- Aspect-Based Analysis: Break down sentiment by specific aspects or topics within the text.
How It Works
- Select Content: Specify which text elements you want to analyze.
- Configure Analysis: Choose between overall sentiment or aspect-based analysis.
- AI Processing: Our models evaluate the emotional tone and context.
- Detailed Results: Receive comprehensive sentiment scores and analysis.
Example: Product Reviews
Here's how to analyze sentiment from product reviews:
- Python
- Node.js
- Curl
from rocketscraper import RocketClient
try:
client = RocketClient('YOUR_API_KEY')
schema = {
"reviewText": "string",
"sentiment": {
"label": "string",
"justification": "string",
"aspects": [{
"aspect": "string",
"label": "string",
"justification": "string"
}]
}
}
# Add specific aspects to analyze
task_description = """
Analyze overall review sentiment and break down sentiment for specific aspects:
- Product quality
- Customer service
- Value for money
"""
result = client.scrape(
'https://example.com/products/wireless-headphones/reviews',
schema,
task_description=task_description
)
print(result)
except Exception as e:
print(f"Error: {e}")
import { createRocketClient } from 'rocketscraper';
try {
const client = createRocketClient({
apiKey: 'YOUR_API_KEY'
});
const schema = {
reviewText: "string",
sentiment: {
label: "string",
justification: "string",
aspects: [{
aspect: "string",
label: "string",
justification: "string"
}]
}
};
// Add specific aspects to analyze
const taskDescription = `
Analyze overall review sentiment and break down sentiment for specific aspects:
- Product quality
- Customer service
- Value for money
`;
const result = await client.scrape({
url: 'https://example.com/products/wireless-headphones/reviews',
schema,
taskDescription
});
console.log(result);
} catch (error) {
console.error('Error:', error.message);
}
curl -X POST \
https://api.rocketscraper.com/scrape \
-H 'x-api-key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"url": "https://example.com/products/wireless-headphones/reviews",
"schema": {
"reviewText": "string",
"sentiment": {
"label": "string",
"justification": "string",
"aspects": [{
"aspect": "string",
"label": "string",
"justification": "string"
}]
}
},
"taskDescription": "Analyze overall review sentiment and break down sentiment for specific aspects: product quality, customer service, value for money"
}'
Example Output
{
"reviewText": "Great sound quality but expensive. The customer service team was very helpful when I had questions about the features. Battery life could be better for the price.",
"sentiment": {
"label": "Positive",
"justification": "Overall positive due to praise for sound quality and customer service, despite price concerns",
"aspects": [
{
"aspect": "Product quality",
"label": "Positive",
"justification": "Specifically mentions 'great sound quality'"
},
{
"aspect": "Customer service",
"label": "Positive",
"justification": "Customer service team described as 'very helpful'"
},
{
"aspect": "Value for money",
"label": "Negative",
"justification": "Mentions 'expensive' and criticizes battery life relative to price"
}
]
}
}
Best Practices
-
Define Clear Aspects: Specify important aspects you want to analyze separately for more detailed insights.
-
Consider Context: Provide relevant context in the task description for more accurate sentiment analysis.
-
Monitor Trends: Track sentiment scores over time to identify patterns and changes in customer feedback.
Common Use Cases
- Product Reviews: Analyze customer satisfaction and specific product aspects
- Social Media: Monitor brand sentiment and customer feedback
- Customer Support: Evaluate support interaction satisfaction
- News & Media: Assess article tone and public reaction
- Market Research: Gauge public opinion and brand perception
By leveraging our AI-powered sentiment analysis, you can gain deep insights into customer opinions and emotions, helping you make data-driven decisions to improve your products and services.
Try It Now
Experience Rocket Scraper's sentiment analysis capabilities in our interactive playground.