Summary
Add optional LLM-based sentiment classification as a post-processing step for social mentions.
Details
After social mentions are ingested, optionally classify each mention's sentiment as positive, neutral, or negative using a cheap LLM (Haiku or GPT-4o-mini).
Implementation
- Reuse existing provider infrastructure (
ProviderAdapter.generateText()) — no new LLM integration needed
- Process new mentions in batch after each social monitoring run
- Store result in
social_mentions.sentiment column (already in schema)
- Configurable via
socialConfig.sentimentAnalysis: true in canonry.yaml
- Include confidence threshold — only store classification above threshold
Prompt design
Simple zero-shot classification prompt:
Classify the sentiment of this social media post about [brand] as positive, neutral, or negative. Respond with only the sentiment label.
Post: [content_text]
Depends on
- Social contracts, DB migration, at least one adapter
Acceptance Criteria
Summary
Add optional LLM-based sentiment classification as a post-processing step for social mentions.
Details
After social mentions are ingested, optionally classify each mention's sentiment as
positive,neutral, ornegativeusing a cheap LLM (Haiku or GPT-4o-mini).Implementation
ProviderAdapter.generateText()) — no new LLM integration neededsocial_mentions.sentimentcolumn (already in schema)socialConfig.sentimentAnalysis: trueincanonry.yamlPrompt design
Simple zero-shot classification prompt:
Depends on
Acceptance Criteria
socialConfig.sentimentAnalysis