How lynote-ai/ai-text-detector works
Lynote contains two distinct products: an explainable offline risk analyzer and a production document-and-sentence classifier. The local path reads text through the CLI and returns a scored report; the production path prepares data, trains and calibrates a joint model, evaluates it, and serves detection results. The production model offers ModernBERT and XLM-R variants. Some pipeline stages are represented by their exact enclosing directories because their implementation excerpts were not provided; edges are limited to relationships shown in excerpts or documented in the README.
Main entry points: j_train_hier_model.py Joint training · m_serve_hier_api.py Detection API · hier_model_factory.py Backbone factory · cli.py CLI input
Components 14
Local Analyzer
- CLI input
src/aidetect/cli.py - Risk analysis
src/aidetect/core.py - Risk report
src/aidetect/cli.py
Model Pipeline
- Data preparation
detection-model-pipeline/code - Joint training
detection-model-pipeline/code/j_train_hier_model.py - Calibration
detection-model-pipeline/code/k_calibrate_hier_model.py - Model evaluation
detection-model-pipeline/code/l_eval_hier_model.py
Joint Model
- Backbone factory
detection-model-pipeline/model_entity/hier_model_factory.py - ModernBERT model
detection-model-pipeline/model_entity/hier_aidetect_model.py - XLM-R model
detection-model-pipeline/model_entity/hier_xlmr_model.py
Detection Service
- Sentence splitting
detection-model-pipeline/code/sentence_splitter.py - Detection API
detection-model-pipeline/code/m_serve_hier_api.py
Other components
- Text submitter
- Human reviewer
Connections 14
- Text submitter → CLI input: provides text
README.md - CLI input → Risk analysis: analyzes text
src/aidetect/cli.py - Risk analysis → Risk report: returns result
src/aidetect/cli.py - Data preparation → Joint training: prepares training data
README.md - Joint training → Backbone factory: loads model class
detection-model-pipeline/code/j_train_hier_model.py - Backbone factory → ModernBERT model: routes ModernBERT
detection-model-pipeline/model_entity/hier_model_factory.py - Backbone factory → XLM-R model: routes XLM-R
detection-model-pipeline/model_entity/hier_model_factory.py - Joint training → Calibration: produces model
README.md - Calibration → Model evaluation: calibrates model
README.md - Joint training → Model evaluation: evaluates model
README.md - Text submitter → Detection API: submits document
README.md - Detection API → Sentence splitting: splits sentences
detection-model-pipeline/code/m_serve_hier_api.py - Detection API → Backbone factory: loads model class
detection-model-pipeline/code/m_serve_hier_api.py - Detection API → Human reviewer: returns classifications
README.md