Skip to content
vsahasiPublic

About

Multimodal credibility analysis for video: transcript vs vocal vs facial sentiment divergence on a queryable timeline, with FAISS RAG search and PDF export. FastAPI + Whisper + SpeechBrain + FER + React.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

VeriTone

VeriTone is a multimodal AI system for analyzing public communication videos. It ingests recordings such as earnings calls, testimony, press conferences, and pitch videos, then builds a timestamped view of where transcript sentiment, vocal emotion, and facial emotion diverge.

The core output is a queryable sentiment divergence timeline: an analyst can jump to high-signal moments, inspect each modality, and search the transcript with natural language.

What It Shows

  • End-to-end video ingestion from file upload or URL.
  • FFmpeg extraction plus faster-whisper transcription into timestamped utterances.
  • Semantic sentiment classification with an optional OpenAI path and a keyword fallback.
  • Vocal emotion analysis with SpeechBrain/Wav2Vec2.
  • Facial emotion analysis with FER and MediaPipe-facing processing hooks.
  • Rule-based divergence scoring across semantic, vocal, and facial labels.
  • FAISS-backed RAG search over utterance embeddings using sentence-transformers.
  • React dashboard with upload, video analysis, timeline, transcript, RAG chat, compare view, and PDF export.
  • Optional Redis/ARQ background jobs for long-running pipeline steps.
  • Pluggable storage: local filesystem by default, with MinIO/S3 support.

Why This Project Matters

Most video analysis tools stop at transcription or single-channel sentiment. VeriTone treats communication as multimodal. The interesting moments are often mismatches: a confident statement with stressed vocal affect, a neutral answer with facial tension, or hedging language delivered with unusually upbeat tone.

The project turns those mismatches into structured data that can be searched, compared, exported, and inspected in context.

Architecture

Video upload / URL
        |
        v
FastAPI ingestion service
        |
        v
FFmpeg extraction + faster-whisper transcription
        |
        v
Utterance-level processing
  - semantic sentiment
  - vocal emotion
  - facial emotion
        |
        v
Divergence engine
        |
        v
SQLite metadata + FAISS vector index + local/MinIO/S3 assets
        |
        v
React dashboard + RAG query interface + PDF export

Tech Stack

Backend

  • Python, FastAPI, SQLAlchemy async, SQLite
  • faster-whisper for transcription
  • SpeechBrain/Wav2Vec2 for vocal emotion
  • FER and MediaPipe for facial processing
  • sentence-transformers and FAISS for local vector search
  • ARQ + Redis for optional background processing
  • Docker Compose with optional MinIO object storage

Frontend

  • React, TypeScript, Vite
  • Tailwind CSS
  • TanStack Query
  • Recharts
  • Framer Motion

Pipeline

The processing flow is explicit and debuggable:

ingest -> transcribe -> process-semantic -> process-vocal -> process-facial -> compute-divergence

Each utterance stores:

  • transcript text,
  • start and end timestamps,
  • speaker id,
  • semantic label and confidence,
  • vocal label and confidence,
  • facial label and confidence,
  • divergence score,
  • divergence flags.

The divergence engine currently uses interpretable rules instead of a black-box classifier. For example, positive transcript sentiment paired with stressed vocal affect receives a high divergence score and an explanatory flag. If facial analysis is unavailable, the system still returns semantic + vocal analysis instead of failing the full pipeline.

RAG Search

VeriTone indexes utterances into a FAISS vector store using sentence-transformers. The query endpoint supports natural-language questions such as:

  • "Where does the speaker sound less confident?"
  • "Find moments where positive statements conflict with vocal stress."
  • "Show the highest divergence moments about revenue guidance."

Search results return matching utterances with timestamps, video ids, and similarity scores so the frontend can cite the exact moment in the video.

API Overview

GET  /health
POST /api/v1/ingest
POST /api/v1/ingest/url
GET  /api/v1/videos
GET  /api/v1/videos/compare?video_ids=id1,id2&speaker_id=optional

POST /api/v1/videos/{video_id}/process
POST /api/v1/videos/{video_id}/transcribe
POST /api/v1/videos/{video_id}/process-semantic
POST /api/v1/videos/{video_id}/process-vocal
POST /api/v1/videos/{video_id}/process-facial
POST /api/v1/videos/{video_id}/compute-divergence

GET  /api/v1/analysis/{video_id}
GET  /api/v1/analysis/{video_id}/export.pdf
GET  /api/v1/timeline/{video_id}
POST /api/v1/query
GET  /api/v1/jobs/{job_id}

Interactive OpenAPI docs are available at http://localhost:8000/docs when the backend is running.

Run Locally

Backend

cd backend
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
uvicorn app.main:app --reload

Backend API: http://localhost:8000

Frontend

cd frontend
npm install
npm run dev

Dashboard: http://localhost:3000

The frontend proxies API requests to the backend on port 8000.

Docker

docker compose up --build

By default, Docker uses local storage. To run optional services:

docker compose --profile redis up --build
docker compose --profile minio up --build

Environment

Copy the example file before running the backend:

cp .env.example .env

Important settings:

STORAGE_TYPE=local
UPLOAD_DIR=./uploads
SQLITE_PATH=./data/veritone.db
WHISPER_MODEL=base
WORK_DIR=./tmp
EMBEDDING_MODEL=all-MiniLM-L6-v2

Optional settings:

OPENAI_API_KEY=your_openai_api_key_here
OPENAI_MODEL=gpt-4o-mini
USE_BACKGROUND_JOBS=true
REDIS_URL=redis://localhost:6379

For frontend-only demos, create frontend/.env and enable mock mode:

VITE_USE_MOCK=true

Example Workflow

  1. Start the backend and frontend.
  2. Upload an .mp4 or .webm, or ingest a public video URL.
  3. Run the full pipeline with POST /api/v1/videos/{video_id}/process.
  4. Open the analysis page in the dashboard.
  5. Inspect divergence spikes on the timeline.
  6. Ask a natural-language question in the RAG chat.
  7. Export a PDF report for the analyzed video.

Repository Structure

backend/app/api/          FastAPI route handlers
backend/app/services/     Ingestion, transcription, modality processing, RAG, export
backend/app/models/       SQLAlchemy video and utterance models
backend/app/db/           Async SQLite setup and sessions
frontend/src/components/  Dashboard, upload, analysis, compare, chat UI
frontend/src/hooks/       React Query data hooks
frontend/src/lib/         API client, mock data, utilities
docs/                     Post-MVP notes and implementation plan

Ethics & Limitations

VeriTone does not claim to detect lying. Emotion and expression models are noisy, context-dependent, and can vary across speakers, cultures, lighting, camera angle, disability, and recording quality. The divergence score is designed as an investigative signal for human review, not a final judgment.

For private or interview-style recordings, the system should be used only with explicit consent and clear disclosure.

Status

This is a portfolio prototype. The implemented system demonstrates the full product loop: ingest video, process modalities, compute divergence, search the resulting timeline, compare videos, and export analysis.

See VERITONE_OUTLINE.md for the original product and technical outline.

About

Multimodal credibility analysis for video: transcript vs vocal vs facial sentiment divergence on a queryable timeline, with FAISS RAG search and PDF export. FastAPI + Whisper + SpeechBrain + FER + React.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages