How lokeshg018/text-to-text-conversion-after-rephrasing works
RePhraseAI is a text paraphrasing application with a React interface, FastAPI backend, local FLAN-T5 generation, and quality/explainability features; it also includes a separate seq2seq and Transformer training/evaluation track. The principal user flow is text and style submission, generation, then viewing alternatives and analysis. The README documents the API capabilities and the overall generation stages. Source excerpts establish some internal calls; unsampled route and page details are represented only where documented, so their specific internal wiring is not inferred.
Main entry points: rephrase_service.py FLAN-T5 generation · api.js API client · main.py FastAPI application · rephrase.py Rephrase routes
Components 23
User interface
- React application
frontend/src/App.jsx - Rephraser screen
frontend/src/pages/Rephraser.jsx - Rephrase state
frontend/src/hooks/useRephrase.js - API client
frontend/src/services/api.js - Results and metrics
frontend/src/components/MetricsPanel.jsx - Auth state
frontend/src/context/AuthContext.jsx - Login and signup
frontend/src/pages/AuthPage.jsx
API and accounts
- FastAPI application
backend/app/main.py - Authentication routes
backend/app/routes/auth.py - Rephrase routes
backend/app/routes/rephrase.py - History routes
backend/app/routes/history.py - SQLAlchemy database
backend/app/database.py - ORM models
backend/app/models/history.py
Generation and analysis
- FLAN-T5 generation
backend/app/services/rephrase_service.py - Text preprocessing
backend/app/services/preprocessing.py - Style prompts
backend/app/services/prompt_service.py - Explainability and analytics
backend/app/services/analysis_service.py - Quality evaluation
backend/app/services/evaluation_service.py
Model training
- Training data preparation
training/preprocessing.py - LSTM and GRU seq2seq
training/rnn_seq2seq.py - FLAN-T5 fine-tuning
training/train_transformer.py - Model comparison
training/evaluate.py
Other components
- User
Connections 23
- User → React application: uses
- React application → Rephraser screen: offers
- Rephraser screen → Rephrase state: submits text
- Rephrase state → API client: calls
frontend/src/hooks/useRephrase.js - API client → Rephrase routes: POSTs rephrase
- API client → Authentication routes: calls auth endpoints
- API client → History routes: calls history endpoints
- Rephrase routes → FLAN-T5 generation: requests generation
- FLAN-T5 generation → Text preprocessing: chunks text
backend/app/services/rephrase_service.py - FLAN-T5 generation → Style prompts: builds prompts
backend/app/services/rephrase_service.py - FLAN-T5 generation → Explainability and analytics: post-processes output
backend/app/services/rephrase_service.py - FLAN-T5 generation → Results and metrics: returns candidates
- Quality evaluation → Explainability and analytics: measures lexical change
backend/app/services/evaluation_service.py - FastAPI application → Authentication routes: registers router
backend/app/main.py - FastAPI application → Rephrase routes: registers router
backend/app/main.py - FastAPI application → History routes: registers router
backend/app/main.py - FastAPI application → SQLAlchemy database: creates tables
backend/app/main.py - Login and signup → Auth state: invokes login
frontend/src/pages/AuthPage.jsx - Auth state → API client: calls auth API
frontend/src/context/AuthContext.jsx - Training data preparation → LSTM and GRU seq2seq: prepares training data
- Training data preparation → FLAN-T5 fine-tuning: prepares training data
- LSTM and GRU seq2seq → Model comparison: compared by
training/evaluate.py - FLAN-T5 fine-tuning → Model comparison: compared by
training/evaluate.py