Skip to content

About

In modern international business, conversations often shift between languages. Transcript AI bridges this gap by utilizing Large Language Models (LLMs) and Retrieval-Augmented Generation (RAG) to ensure no context is lost in translation. It doesn't just transcribe; it understands business intent.

Topics

Resources

Contributing

Stars

3 stars

Watchers

0 watching

Forks

Repository files navigation

title TranscriptAI
emoji 🎙️
colorFrom purple
colorTo blue
sdk docker
app_port 7860
pinned false

TranscriptAI 🎙️

Most meeting tools treat every language like English and every silence like nothing. Enterprise meetings — especially in Japanese — don't work that way.

TranscriptAI analyzes meetings across Japanese, English, Hindi, and code-switched dialogues. It extracts action items with owners and deadlines, tracks per-speaker sentiment, detects indirect refusals and escalation signals, and delivers a deal outcome verdict — with privacy-first handling of transcript content before any cloud call.

  • 🇯🇵 Japanese business intelligence — Keigo register (Sonkeigo / Kenjōgo / Teineigo), consensus-building patterns, soft rejection vs. escalation detection
  • 🌐 Multilingual — Japanese · English · Hindi · Hinglish · code-switched dialogs
  • 🔒 Privacy-first (text pipeline) — PII masked locally before any cloud call; audio input uses Groq Whisper for transcription, then PII-masked before analysis
  • 📊 Actionable output — Action items with deadlines, per-speaker sentiment arcs, 8-state deal verdict, PPTX / Markdown / JSON export
  • ⚡ Fast — 0.1 ms soft rejection latency; semantic vector cache for repeat queries
  • 🔄 Resilient — NVIDIA NIM → Groq → Ollama → rule-based fallback, automatic

Demo

📸 Screenshot / GIF goes here — paste a Japanese or mixed-language transcript, click Analyze, capture the results panel showing deal verdict + action items + sentiment arc.

🔗 Live demo on Hugging Face Spaces


Quick Start

Docker (recommended)

git clone <repo-url>
cd transcriptai
cp .env.example .env
# Add NIM_API_KEY or GROQ_API_KEY to .env

# Start with API key
docker compose up

# Start with local Ollama (no API key required)
docker compose --profile ollama up
# Then pull a model:
docker compose exec ollama ollama pull qwen2.5:7b

Open http://localhost:7860.

Local development

# Requirements: Python 3.12, MeCab + ipadic-utf8
# macOS:  brew install mecab mecab-ipadic
# Ubuntu: sudo apt-get install mecab mecab-ipadic-utf8 libmecab-dev

pip install -r requirements.txt
cp .env.example .env   # fill in at least one LLM API key
uvicorn main:app --reload --port 7860

Environment Variables

Variable Required Description
NIM_API_KEY one of these NVIDIA NIM API key
GROQ_API_KEY one of these Groq API key
GROQ_API_KEY_2 no Second Groq key for quota rotation
TRANSCRIPT_AI_PROVIDER no auto | groq | ollama (default: auto)
OLLAMA_URL no Ollama endpoint (default: http://localhost:11434/api/generate)
SESSION_SECRET if AUTH=1 32+ char random string for session signing
AUTH_ENABLED no 1 to enable Google OAuth (default: 0)
PORT no Server port (default: 7860)
ENVIRONMENT no production | development — controls log level

Full documentation in .env.example.


What it does

Sentiment & Communication Dynamics

25-label fine-grained taxonomy across 4 clusters (positive, negative, neutral, complex) paired with per-speaker trajectory detection (improving / declining / volatile / stable).

Japanese Business Communication Intelligence

Honorific register classification across 尊敬語 (Sonkeigo), 謙譲語 (Kenjōgo I/II), and 丁寧語 (Teineigo); consensus-building pattern detection; alignment query tracking; and code-switching metrics.

Privacy-First Local PII Masking

Text input: Personal identifiers (Japanese surnames, phone, email, My Number マイナンバー, postal codes 〒) are sanitized locally before the text is sent to any external LLM. The canonical identities are restored locally in a transient presentation session.

Audio input: Audio is transcribed via Groq Whisper (cloud), then PII masking applies to the returned text before the analysis LLM receives it. For fully offline operation including transcription, use docker compose --profile ollama up and provide a pre-transcribed text file or configure a local Whisper endpoint.

Resilient Provider Cascade

High-availability LLM routing across NVIDIA NIM, Groq, and local Ollama (qwen2.5:7b), backed by a deterministic, zero-network rule-based fallback engine.


Architecture

Input: Transcript (JP · HI · EN · Mixed) or Audio (Groq Whisper)
  │
  ▼
┌────────────────────────────────────────────────────────────────────────┐
│ Phase 1: Ingestion & Privacy Layer                                     │
│   • Timestamp & speaker turn extraction (raw text preservation)        │
│   • 7-pass text normalization (full-width CJK punctuation unification) │
│   • Local PII redaction (surnames, My Number, phone, email)            │
├────────────────────────────────────────────────────────────────────────┤
│ Phase 2: High-Performance Caching & Router                             │
│   • O(1) MD5 exact-match cache (<1ms return)                           │
│   • ChromaDB semantic vector cache (cosine similarity lookup)          │
│   • Multi-provider routing (NVIDIA NIM → Groq → Ollama → Rule Fallback)│
├────────────────────────────────────────────────────────────────────────┤
│ Phase 3: Post-Inference Linguistic & Cultural Intelligence             │
│   • Local PII restoration (re-bind canonical names in isolated memory) │
│   • MeCab morphological Keigo analysis (Sonkeigo / Kenjogo / Teineigo) │
│   • 3-Tier soft rejection & escalation detector                        │
│   • Sentiment backstop (honorific register cross-overlay)              │
│   • Consensus alignment & approval gate detection (稟議 signals)       │
│   • Token-overlap hallucination guard (source-grounding check)         │
│   • 8-state deal outcome verdict (Approved / Conditional / Rejected)   │
├────────────────────────────────────────────────────────────────────────┤
│ Phase 4: Output Synthesis & Persistence                                │
│   • Talk-time distribution & conversation dynamics                     │
│   • Export rendering (議事録 minutes, PPTX slide deck, JSON, Markdown) │
└────────────────────────────────────────────────────────────────────────┘

Hallucination Guard

Deterministic, rule-based output verification. To avoid circular bias, LLM outputs are never self-validated by another LLM prompt. Every extracted action item and summary statement is verified against the original transcript using content-token overlap:

                 |Claim Tokens ∩ Transcript Tokens|
Overlap Score =  ─────────────────────────────────
                        |Claim Tokens|
  • Token Normalization — Evaluates content lemmas and named entities while filtering high-frequency Japanese particles (は, が, の, です) and English stopwords.
  • Audit Flagging — Items falling below the calibrated threshold (0.20 content overlap) are flagged as ungrounded for manual review, rather than silently deleted.

Provider Cascade

NIM_API_KEY set?      ──yes──► NVIDIA NIM (Nemotron, LLaMA 3.3)
      │ no
      ▼
GROQ_API_KEY set?     ──yes──► Groq (llama-3.3-70b-versatile)
      │ no / exhausted
      ▼
OLLAMA_URL reachable? ──yes──► Local Ollama (qwen2.5:7b default)
      │ no
      ▼
Rule-Based Fallback (Zero-network heuristic extraction, Keigo, SR detection)

Evaluation & Benchmarks

Pipeline Performance

Evaluated against bilingual and Japanese ground-truth enterprise scenarios:

Test Scenario Overall Score Summary ROUGE-1 Action Item F1 Sentiment Accuracy
Enterprise Sales Call (JA / EN mixed) 94.5 / 100 0.694 1.00 1.00
Internal Strategy Review (Japanese) 93.8 / 100 0.703 1.00 1.00
Vendor SLA Conflict (EN / JA) 93.8 / 100 0.703 1.00 1.00

Soft Rejection Detection Benchmark

Evaluated on 30 curated bilingual enterprise edge cases (scripts/eval_soft_rejection.py):

Evaluation Metric Score Note
Binary F1 (Risk vs. No-Risk) 0.98 High sensitivity to subtle non-commitment
Japanese Refusal Accuracy 100% Zero false negatives on indirect refusal phrases
English & Hindi Accuracy 100% Catches SLA breach threats and cultural deferrals
Classification Latency 0.1ms Pre-compiled regex state machine

Token Optimization

Prompt Component Baseline Tokens Optimized Tokens Reduction
Grounding Rules & Schema 995 tokens 259 tokens −74%
Total Per-Request Overhead 2,728 tokens 1,521 tokens −44% (−1,207 tokens)

Running Tests

pytest tests/test_pipeline.py -v

Comprehensive test suite: 81 unit and behavioral tests, runs in under 1 second with zero network dependencies.

Test Class Coverage
TestPIIMasker APPI-style masking round-trip, My Number, postal codes, CJK token boundary
TestSpeakerDetector PII-masked labels, full-width CJK colons (:), deduplication, blocklists
TestSentimentEngine Full-width colon parsing, empty turn guards, speaker arc trend stability
TestAnalysisPrompt Parameter injection, schema validation, dual-language output specifications
TestAnalyzerWireUps Pipeline execution ordering, PII unmasking order, cache validation
TestMainStructural Async fix, rate limiter, API key handling
TestHallucinationGuard Task field verification, punctuation tokenizer, Japanese task_ja grounding

Japanese Language Support

Honorific Register Analysis (敬語)

Classifies speaker registers using morphological analysis (MeCab) and auxiliary verb pattern hierarchies:

Register Level Morphological Markers Contextual Significance
尊敬語 (Sonkeigo) おっしゃる, いらっしゃる, なさる Elevates the counterparty's actions; client-facing respect
謙譲語 (Kenjōgo I/II) いたす, 申し上げる, 拝受する, 賜る Lowers speaker's own actions; formal vendor posture
丁寧語 (Teineigo) です, ます, ございます, でございます Standard business politeness
普通体 (Futsuutai) だ, である, plain forms Informal register; sudden drops signal friction or internal alignment

Cross-Module Sentiment Backstop: Keigo register directly informs sentiment interpretation. When a speaker maintaining strict formal honorific register expresses negative or stalling statements, the system reclassifies the tone as politely_evasive rather than overt hostility (frustrated) — accurately reflecting the controlled restraint of Japanese business disputes.

Soft Rejection vs. Escalation

The system distinguishes two patterns that appear similar in Japanese business speech but represent opposite risk signals:

Pattern Example Classification
Soft rejection 少々難しい状況でございます INDIRECT_REFUSAL
Escalation このまま改善されない場合、契約を見直す必要があります ULTIMATUM

A client issuing an ultimatum has not rejected the vendor — they want resolution. A speaker using DEFERRAL or INDIRECT_REFUSAL has signalled non-commitment to proceed.


API Endpoints

Method Endpoint Description
GET / Main interface
POST /analyze-text Analyse a transcript (form: transcript, language)
POST /transcribe Upload audio or text file → transcript
POST /jobs/submit Submit async job (returns job_id)
GET /jobs/{job_id} Poll job status and retrieve result
GET /health Module availability and provider status
POST /export/pptx Export result as PowerPoint
POST /export/markdown Export as Markdown
POST /export/json Export raw JSON
GET /api/last-result Retrieve last result (authenticated users)

Production Considerations & Deployment Scope

  • PII Scope & Regulated Environments — The built-in privacy layer focuses on deterministic, zero-latency masking of high-frequency personal identifiers (top 300+ Japanese surnames, phone numbers, email addresses, postal codes, and My Number strings). For enterprise deployments subject to formal APPI certification, an upstream Japanese NER model (GiNZA or spaCy's ja_core_news_lg) can be hooked into mask_transcript() to cover arbitrary full names, street addresses, and financial accounts.
  • Consensus & Approval Gate Scope — The system tracks in-meeting consensus dynamics (indirect agreement-seeking, phased commitment language, committee deferrals). True off-the-record pre-meeting lobbying (Nemawashi) occurs outside recorded transcripts; when detected, these patterns are surfaced as Inferred Consensus Checks and Approval Gates (稟議).
  • Multilingual Sentiment Architecture — Sentiment analysis combines LLM inference with deterministic linguistic safeguards. For Japanese dialogues, semantic sentiment is inferred by the LLM and cross-validated by the Keigo and Soft-Rejection detectors. The local 25-label pattern engine provides micro-turn valence tracking optimized for English and Hinglish mixed utterances.
  • Horizontal Scaling & Distributed Cache — For multi-worker container deployments (WEB_CONCURRENCY > 1), configure REDIS_URL in .env to enable distributed session caching across worker processes.

Project Structure

transcriptai/
├── main.py                          # FastAPI server, routing, rate limiting
├── analysis/
│   ├── analyzer.py                  # Pipeline orchestrator & multi-stage synthesis
│   ├── sentiment_engine.py          # Fine-grained sentiment taxonomy & speaker arcs
│   ├── hallucination_guard.py       # Deterministic token-overlap verification
│   ├── soft_rejection_detector.py   # 3-tier risk & indirect refusal classifier
│   ├── deal_outcome_detector.py     # 8-state meeting outcome verdict engine
│   └── conversation_dynamics.py    # Role distribution, turn balance, speaker pivots
├── prompts/
│   └── analysis_prompt.py          # Grounded system prompts & structured JSON schemas
├── transcription/
│   ├── pii_masker.py               # Local PII sanitization & bidirectional restoration
│   └── speaker_normalizer.py       # Speaker label unification & PII-masked name handling
├── utils/
│   └── speaker_detector.py         # Zero-LLM speaker demarcation & normalization
├── tests/
│   ├── conftest.py                  # Pytest fixtures & dependency stubs
│   └── test_pipeline.py            # 81-test automated verification suite
├── Dockerfile                       # Multi-stage, MeCab-enabled, unprivileged user
├── docker-compose.yml               # Standard & Ollama deployment profiles
├── requirements.txt
└── .env.example

Tech Stack

Layer Technology
Server FastAPI 0.111+ · uvicorn · Jinja2
Async HTTP httpx 0.27+
LLM providers NVIDIA NIM · Groq · Ollama (local)
LLM orchestration LangChain (optional fallback path)
Japanese NLP MeCab + ipadic-utf8
Vector cache ChromaDB (per-user isolation)
Experiment tracking MLflow
Auth Google OAuth (Authlib) · bcrypt email/password
Rate limiting SlowAPI with X-Forwarded-For support
Containerisation Docker multi-stage · docker-compose · tini

License

MIT License — see LICENSE for details.

About

In modern international business, conversations often shift between languages. Transcript AI bridges this gap by utilizing Large Language Models (LLMs) and Retrieval-Augmented Generation (RAG) to ensure no context is lost in translation. It doesn't just transcribe; it understands business intent.

Topics

Resources

Contributing

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages