Content Analysis Skill
Analyze text content using advanced NLP techniques and LLM-powered insights to extract sentiment, topics, and actionable intelligence from various content sources.
Quick Start
This skill helps you:
- Analyze sentiment using both traditional NLP and LLM methods
- Extract topics and keywords from large text datasets
- Classify and cluster content automatically
- Identify viral content patterns and characteristics
- Generate content insights and recommendations
- Support multiple languages and content formats
When to Use
- Social Media Analysis: Facebook, Twitter, Instagram, Weibo posts
- Content Marketing: Blog posts, articles, marketing copy analysis
- Video Content: YouTube titles, descriptions, comments analysis
- Product Reviews: Amazon, e-commerce customer feedback
- News Analysis: Article categorization, sentiment tracking
- Customer Feedback: Support tickets, surveys, reviews analysis
Key Requirements
Traditional NLP Analysis
pip install pandas numpy matplotlib seaborn nltk scikit-learn wordcloud
LLM-Enhanced Analysis (Optional)
pip install openai dashscope # For OpenAI and Qwen API access
Setup NLTK Data
import nltk
nltk.download('vader_lexicon')
nltk.download('punkt')
nltk.download('stopwords')
Core Workflow
1. Data Preparation
Your data should include:
- Text Content: Main text to analyze (titles, descriptions, comments, etc.)
- Metadata: Optional (author, date, category, engagement metrics)
- Multiple Languages: Support for English, Chinese, and other languages
2. Analysis Process
- Text Preprocessing: Clean, tokenize, and normalize text
- Sentiment Analysis: Traditional VADER + LLM-enhanced analysis
- Topic Extraction: TF-IDF keywords + LLM semantic topics
- Content Classification: Automated categorization and clustering
- Pattern Recognition: Identify viral content characteristics
- Insight Generation: Actionable recommendations
3. Output Deliverables
- Sentiment analysis reports with confidence scores
- Topic models and keyword extractions
- Content classification results
- Viral content pattern analysis
- Optimization recommendations
Example Usage Scenarios
Social Media Content Analysis
# Analyze Twitter posts for brand sentiment
# Identify trending topics and hashtags
# Measure engagement patterns
YouTube Video Analysis
# Analyze video titles and descriptions
# Extract topics from comments
# Identify viral content patterns
Product Review Analysis
# Analyze customer feedback sentiment
# Extract product feature mentions
# Identify improvement opportunities
Key Analysis Methods
Traditional NLP Techniques
- VADER Sentiment Analysis: Rule-based sentiment scoring
- TF-IDF Keyword Extraction: Statistical term importance
- Text Clustering: K-means and hierarchical clustering
- Word Frequency Analysis: Term frequency and co-occurrence
- Language Detection: Automatic language identification
LLM-Enhanced Analysis
- Context-Aware Sentiment: Nuanced emotion understanding
- Semantic Topic Extraction: Meaning-based topic identification
- Content Summarization: Automatic text summarization
- Multi-Language Support: Cross-lingual analysis
- Zero-Shot Classification: Categorization without training data
Advanced Analytics
- Time Series Analysis: Content trends over time
- Engagement Prediction: Predict viral potential
- Competitive Analysis: Compare content performance
- Audience Insights: Demographic and preference analysis
Common Business Questions Answered
- What is the overall sentiment toward our brand?
- Which topics are trending in our industry?
- What makes content go viral?
- How does sentiment vary by demographic or region?
- What are customers saying about our products?
- Which content formats perform best?
Integration Examples
See examples/ directory for:
basic_content_analysis.py - Traditional NLP analysis
llm_enhanced_analysis.py - LLM-powered analysis
social_media_analysis.py - Social media specific analysis
- Sample datasets for testing
LLM Configuration
Supported LLM Providers
- OpenAI: GPT-3.5, GPT-4 models
- Qwen (通义千问): Chinese-optimized models
- Open Source: Local models via HuggingFace
API Setup Examples
# OpenAI Configuration
import openai
openai.api_key = 'your-api-key'
# Qwen Configuration
import dashscope
dashscope.api_key = 'your-api-key'
Best Practices
- Data Quality: Ensure clean, consistent text data
- Sampling Strategy: Use representative samples for LLM analysis
- Cost Management: Balance traditional NLP with LLM calls
- Language Handling: Configure appropriate language models
- Validation: Cross-validate sentiment analysis results
- Privacy: Ensure compliance with data protection regulations
Performance Optimization
For Large Datasets
- Use data sampling for LLM analysis
- Implement batch processing
- Cache LLM responses when possible
- Use traditional NLP for initial filtering
Cost Management
- Prioritize important content for LLM analysis
- Use traditional NLP for bulk processing
- Implement smart sampling strategies
- Monitor API usage and costs
Advanced Features
- Real-time Analysis: Stream processing for live content
- Multi-modal Analysis: Text + image + video content
- Custom Models: Fine-tune models for specific domains
- Integration APIs: Connect with content management systems
- Automated Reporting: Scheduled analysis and reporting
Troubleshooting
Common Issues
- Low Sentiment Accuracy: Check language settings and text preprocessing
- High API Costs: Optimize sampling and caching strategies
- Slow Processing: Implement parallel processing and batching
- Language Support: Ensure appropriate models for non-English content
Performance Tips
- Pre-process text data effectively
- Use appropriate model sizes for tasks
- Implement result caching
- Monitor resource usage and optimize
1---2name: content-analysis3description: Analyze text content using both traditional NLP and LLM-enhanced methods. Extract sentiment, topics, keywords, and insights from various content types including social media posts, articles, reviews, and video content. Use when working with text analysis, sentiment detection, topic modeling, or content optimization.4---5
6# Content Analysis Skill
7
8Analyze text content using advanced NLP techniques and LLM-powered insights to extract sentiment, topics, and actionable intelligence from various content sources.
9
10## Quick Start
11
12This skill helps you:
131. **Analyze sentiment** using both traditional NLP and LLM methods
142. **Extract topics and keywords** from large text datasets
153. **Classify and cluster content** automatically
164. **Identify viral content** patterns and characteristics
175. **Generate content insights** and recommendations
186. **Support multiple languages** and content formats
19
20## When to Use
21
22- **Social Media Analysis**: Facebook, Twitter, Instagram, Weibo posts
23- **Content Marketing**: Blog posts, articles, marketing copy analysis
24- **Video Content**: YouTube titles, descriptions, comments analysis
25- **Product Reviews**: Amazon, e-commerce customer feedback
26- **News Analysis**: Article categorization, sentiment tracking
27- **Customer Feedback**: Support tickets, surveys, reviews analysis
28
29## Key Requirements
30
31### Traditional NLP Analysis
32```bash
33pip install pandas numpy matplotlib seaborn nltk scikit-learn wordcloud
34```
35
36### LLM-Enhanced Analysis (Optional)
37```bash
38pip install openai dashscope # For OpenAI and Qwen API access
39```
40
41### Setup NLTK Data
42```python
43import nltk
44nltk.download('vader_lexicon')
45nltk.download('punkt')
46nltk.download('stopwords')
47```
48
49## Core Workflow
50
51### 1. Data Preparation
52Your data should include:
53- **Text Content**: Main text to analyze (titles, descriptions, comments, etc.)
54- **Metadata**: Optional (author, date, category, engagement metrics)
55- **Multiple Languages**: Support for English, Chinese, and other languages
56
57### 2. Analysis Process
581. **Text Preprocessing**: Clean, tokenize, and normalize text
592. **Sentiment Analysis**: Traditional VADER + LLM-enhanced analysis
603. **Topic Extraction**: TF-IDF keywords + LLM semantic topics
614. **Content Classification**: Automated categorization and clustering
625. **Pattern Recognition**: Identify viral content characteristics
636. **Insight Generation**: Actionable recommendations
64
65### 3. Output Deliverables
66- Sentiment analysis reports with confidence scores
67- Topic models and keyword extractions
68- Content classification results
69- Viral content pattern analysis
70- Optimization recommendations
71
72## Example Usage Scenarios
73
74### Social Media Content Analysis
75```python
76# Analyze Twitter posts for brand sentiment
77# Identify trending topics and hashtags
78# Measure engagement patterns
79```
80
81### YouTube Video Analysis
82```python
83# Analyze video titles and descriptions
84# Extract topics from comments
85# Identify viral content patterns
86```
87
88### Product Review Analysis
89```python
90# Analyze customer feedback sentiment
91# Extract product feature mentions
92# Identify improvement opportunities
93```
94
95## Key Analysis Methods
96
97### Traditional NLP Techniques
98- **VADER Sentiment Analysis**: Rule-based sentiment scoring
99- **TF-IDF Keyword Extraction**: Statistical term importance
100- **Text Clustering**: K-means and hierarchical clustering
101- **Word Frequency Analysis**: Term frequency and co-occurrence
102- **Language Detection**: Automatic language identification
103
104### LLM-Enhanced Analysis
105- **Context-Aware Sentiment**: Nuanced emotion understanding
106- **Semantic Topic Extraction**: Meaning-based topic identification
107- **Content Summarization**: Automatic text summarization
108- **Multi-Language Support**: Cross-lingual analysis
109- **Zero-Shot Classification**: Categorization without training data
110
111### Advanced Analytics
112- **Time Series Analysis**: Content trends over time
113- **Engagement Prediction**: Predict viral potential
114- **Competitive Analysis**: Compare content performance
115- **Audience Insights**: Demographic and preference analysis
116
117## Common Business Questions Answered
118
1191. **What is the overall sentiment toward our brand?**
1202. **Which topics are trending in our industry?**
1213. **What makes content go viral?**
1224. **How does sentiment vary by demographic or region?**
1235. **What are customers saying about our products?**
1246. **Which content formats perform best?**
125
126## Integration Examples
127
128See [examples/](examples/) directory for:
129- `basic_content_analysis.py` - Traditional NLP analysis
130- `llm_enhanced_analysis.py` - LLM-powered analysis
131- `social_media_analysis.py` - Social media specific analysis
132- Sample datasets for testing
133
134## LLM Configuration
135
136### Supported LLM Providers
137- **OpenAI**: GPT-3.5, GPT-4 models
138- **Qwen (通义千问)**: Chinese-optimized models
139- **Open Source**: Local models via HuggingFace
140
141### API Setup Examples
142```python
143# OpenAI Configuration
144import openai
145openai.api_key = 'your-api-key'
146
147# Qwen Configuration
148import dashscope
149dashscope.api_key = 'your-api-key'
150```
151
152## Best Practices
153
1541. **Data Quality**: Ensure clean, consistent text data
1552. **Sampling Strategy**: Use representative samples for LLM analysis
1563. **Cost Management**: Balance traditional NLP with LLM calls
1574. **Language Handling**: Configure appropriate language models
1585. **Validation**: Cross-validate sentiment analysis results
1596. **Privacy**: Ensure compliance with data protection regulations
160
161## Performance Optimization
162
163### For Large Datasets
164- Use data sampling for LLM analysis
165- Implement batch processing
166- Cache LLM responses when possible
167- Use traditional NLP for initial filtering
168
169### Cost Management
170- Prioritize important content for LLM analysis
171- Use traditional NLP for bulk processing
172- Implement smart sampling strategies
173- Monitor API usage and costs
174
175## Advanced Features
176
177- **Real-time Analysis**: Stream processing for live content
178- **Multi-modal Analysis**: Text + image + video content
179- **Custom Models**: Fine-tune models for specific domains
180- **Integration APIs**: Connect with content management systems
181- **Automated Reporting**: Scheduled analysis and reporting
182
183## Troubleshooting
184
185### Common Issues
1861. **Low Sentiment Accuracy**: Check language settings and text preprocessing
1872. **High API Costs**: Optimize sampling and caching strategies
1883. **Slow Processing**: Implement parallel processing and batching
1894. **Language Support**: Ensure appropriate models for non-English content
190
191### Performance Tips
192- Pre-process text data effectively
193- Use appropriate model sizes for tasks
194- Implement result caching
195- Monitor resource usage and optimize