Skip to content

[M1][Epic 1.3] Build FastAPI ML service with sentiment analysis endpoint #59

@POWDER-RANGER

Description

@POWDER-RANGER

Problem

Implement production FastAPI application with sentiment analysis capability. Start with lightweight models for speed.

Tasks

  • Create FastAPI app in ml/main.py or ml/src/app.py
  • Implement GET /health endpoint
  • Implement POST /analyze/sentiment accepting {text: string}
  • Return {score: float(-1..1), confidence: float(0..1)}
  • Choose sentiment model (recommend transformers pipeline or TextBlob for MVP)
  • Store analysis results in Postgres via backend API call
  • Add latency measurement (target <1s locally)
  • Write unit tests for sentiment scoring

Acceptance Criteria

  • ✅ FastAPI responds to health checks
  • ✅ Sentiment endpoint returns scores within 1 second locally
  • ✅ Results visible through backend /api/analytics/overview
  • ✅ Confidence scores correlate with text certainty

Priority: P0 - Blocker
Labels: ml, fastapi, M1, P0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions