Skip to content

🧠 Corrector Contextual - Transforma mensajes para cualquier situación profesional. Sistema dual (FastAPI + Streamlit) con 9 contextos predefinidos, control de intensidad/formalidad y edición granular de cambios.

License

Notifications You must be signed in to change notification settings

JPatronC92/corrector-contextual

✍️ Context Corrector

Live Demo Streamlit App Python Streamlit License GitHub last commit GitHub repo size

Transform your messages for any professional context in seconds
Herramienta web bilingüe (🇪🇸/🇬🇧) que adapta el tono de tus textos según el contexto

🌐 Try it now - No registration required, 100% free


✨ Features

🎯 Smart Context Detection

  • 11 Professional Contexts: Angry boss, demanding client, casual coworker, professional email, formal apology, raise request, diplomatic resignation, incident report, constructive feedback, polite rejection, firm negotiation
  • Automatic Detection: Analyzes your text to identify the best matching context
  • Manual Override: Choose your context explicitly if needed

🌍 Bilingual Interface

  • English & Spanish: Full UI translation with language selector
  • Context-aware Examples: Sample texts in both languages
  • Native Experience: Seamless switching between languages

🎨 Customization Controls

  • Intensity Levels: Subtle, Medium, or Strong transformations
  • Formality Options: Informal (tú) or Formal (usted) treatment
  • Character Limit: Up to 1000 characters per correction

� Advanced Features

  • Side-by-side Comparison: See original vs transformed text
  • Highlighted Differences: Visual diff with color-coded changes
  • Granular Editing: Accept or reject individual changes
  • Export Options: Download corrected text as .txt file
  • History: Undo changes with one click

🚀 Quick Start

Web App (Recommended)

Just visit context-corrector.streamlit.app - no installation needed!

Local Development

# Clone the repository
git clone https://github.com/JPatronC92/corrector-contextual.git
cd corrector-contextual

# Create virtual environment
python -m venv .venv
.venv\Scripts\activate  # Windows
source .venv/bin/activate  # Linux/Mac

# Install dependencies
pip install -r requirements.txt

# Run the app
streamlit run app.py

The app will open in your browser at http://localhost:8501

� Controles en la Interfaz

En la barra lateral encontrarás:

  • Modo de ejecución: Local o API, con indicador de estado de la API.
  • Contexto: selección manual (con detección automática como respaldo).
  • Intensidad y tratamiento: ajusta el grado de cambios y la formalidad.
  • Límite de caracteres: define un tope; si se excede, se trunca con aviso.
  • Vista de diferencias: normal o lado a lado; acepta/rechaza cambios por fragmento.
  • Registro en CSV: activa/desactiva un log local de correcciones.

�📂 Estructura del Proyecto

corrector_contextual/
├── app.py               → Frontend con Streamlit para la interacción del usuario.
├── app.py               → Main Streamlit application
├── corrector.py         → Core correction logic and context detection
├── context_rules.py     → Text transformation rules for each context
├── i18n.py              → Internationalization system (ES/EN)
├── requirements.txt     → Python dependencies
└── .streamlit/          → Streamlit configuration
    └── config.toml      → Theme and server settings

🛠️ Tech Stack

  • Frontend: Streamlit 1.50+
  • Backend Logic: Python 3.11+
  • Diff Engine: diff-match-patch
  • Deployment: Streamlit Cloud
  • i18n: Custom dictionary-based system

📝 How It Works

  1. Input: User writes or pastes text
  2. Context Detection: Keyword-based heuristics identify context
  3. Transformation: Regex-based rules modify tone, formality, and empathy
  4. Output: Transformed text with explanation and diff visualization

🤝 Contributing

Contributions are welcome! Please read CONTRIBUTING.md for guidelines.

Development Setup

# Fork and clone
git clone https://github.com/YOUR_USERNAME/corrector-contextual.git

# Create feature branch
git checkout -b feature/amazing-feature

# Make changes and test locally
streamlit run app.py

# Commit and push
git commit -m "feat: add amazing feature"
git push origin feature/amazing-feature

# Open Pull Request

📄 License

This project is licensed under the MIT License - see LICENSE for details.

🙏 Acknowledgments

📧 Contact

Juan Pablo Patrón - @JPatronC92

Project Link: https://github.com/JPatronC92/corrector-contextual

Live App: https://context-corrector.streamlit.app


Made with ❤️ in Colombia
Transforming professional communication, one context at a time

About

🧠 Corrector Contextual - Transforma mensajes para cualquier situación profesional. Sistema dual (FastAPI + Streamlit) con 9 contextos predefinidos, control de intensidad/formalidad y edición granular de cambios.

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

No packages published

Languages