Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Implementation:ALwrity ALwrity ContentQualityAnalyzer

From Leeroopedia
Knowledge Sources
Domains LinkedIn, Content_Quality, Content_Generation
Last Updated 2026-10-24 00:00 GMT

Overview

Concrete tool for multi-dimensional content quality scoring (factual accuracy, professional tone, industry relevance, citation coverage) with recommendations, provided by the ALwrity quality subsystem.

Description

The ContentQualityAnalyzer.analyze_content_quality method evaluates generated content across five dimensions: (1) factual accuracy — checks whether claims in the content are supported by the provided sources; (2) source verification — verifies that cited sources are real and relevant; (3) professional tone — scores the content against professional and unprofessional indicator word lists; (4) industry relevance — checks for industry-specific terminology (Technology, Healthcare, Finance, Marketing, Education); (5) citation coverage — measures how well sources are cited. An overall weighted score is computed and actionable recommendations are generated from the per-dimension scores.

Usage

Import this service when:

  • The LinkedIn pipeline needs quality metrics to accompany a generated post.
  • Factual accuracy must be checked against research sources.
  • Professional tone and industry relevance must be scored.
  • Recommendations for improvement must be generated from the scores.

Code Reference

Source Location

  • Repository: ALwrity
  • File: backend/services/quality/content_analyzer.py (L28-80+)

Signature

class ContentQualityAnalyzer:
    """Service for analyzing and scoring content quality."""

    def __init__(self):
        self.professional_indicators = ["research", "analysis", "insights", ...]
        self.unprofessional_indicators = ["awesome", "amazing", "incredible", ...]
        self.industry_terminology = {
            "Technology": ["ai", "machine learning", ...],
            "Healthcare": ["patient care", "medical", ...],
            "Finance": ["investment", "market", ...],
            "Marketing": ["brand", "campaign", ...],
            "Education": ["learning", "curriculum", ...],
        }

    def analyze_content_quality(
        self,
        content: str,
        sources: List[Dict[str, Any]],
        industry: str = "general",
    ) -> Dict[str, Any]:
        """
        Analyze content quality across multiple dimensions.

        Args:
            content: The content to analyze.
            sources: List of research sources used.
            industry: The target industry for relevance assessment.

        Returns:
            Comprehensive quality analysis with factual_accuracy,
            source_verification, professional_tone, industry_relevance,
            citation_coverage, overall_score, and recommendations.
        """

Import

from services.quality.content_analyzer import ContentQualityAnalyzer

I/O Contract

Inputs

Name Type Required Description
content str Yes The content to analyse
sources List[Dict[str, Any]] Yes Research sources used for grounding
industry str No Target industry (default 'general')

Outputs

Name Type Description
return Dict[str, Any] factual_accuracy, source_verification, professional_tone, industry_relevance, citation_coverage, overall_score, recommendations

Usage Examples

Analysing a LinkedIn post

from services.quality.content_analyzer import ContentQualityAnalyzer

analyzer = ContentQualityAnalyzer()
result = analyzer.analyze_content_quality(
    content=linkedin_post_text,
    sources=research_sources,
    industry="Marketing",
)

print(f"Overall score: {result['overall_score']}")
print(f"Factual accuracy: {result['factual_accuracy']}")
print(f"Professional tone: {result['professional_tone']}")
print(f"Industry relevance: {result['industry_relevance']}")
for rec in result["recommendations"]:
    print(f"  - {rec}")

Related Pages

Implements Principle

Requires Environment

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment