From 4b4b254789edc374e013970cb046a857b0331ed1 Mon Sep 17 00:00:00 2001 From: Renato97 Date: Tue, 31 Mar 2026 01:32:50 -0300 Subject: [PATCH] docs: update README with bilingual documentation - Add English and Spanish sections - Improve project description and features - Add professional formatting --- README.md | 271 ++++++++++++++---------------------------------------- 1 file changed, 70 insertions(+), 201 deletions(-) diff --git a/README.md b/README.md index d209386..0a6f1f1 100644 --- a/README.md +++ b/README.md @@ -1,220 +1,89 @@ -# 🎡 CBCFacil v9 +# 🎡 CBC FΓ‘cil - Document Processing Platform -Sistema de IA para procesamiento inteligente de documentos (audio, PDF, texto) con integraciΓ³n a Nextcloud y dashboard web interactivo. +## πŸ“ Description / DescripciΓ³n -## ✨ CaracterΓ­sticas Principales +**English:** +An intelligent document processing platform that uses AI (Gemini/Claude) to analyze, summarize, and convert various document formats (PDF, audio, text) into structured knowledge bases. Integrates with Notion for knowledge management. -- πŸŽ™οΈ **TranscripciΓ³n de Audio** - Whisper con soporte GPU/CPU -- πŸ“ **GeneraciΓ³n de ResΓΊmenes** - Claude AI o Gemini -- πŸ“„ **MΓΊltiples Formatos** - Genera TXT, MD, DOCX, PDF -- ☁️ **SincronizaciΓ³n Nextcloud** - Descarga y sube automΓ‘ticamente -- πŸ–₯️ **Dashboard Web** - Monitoreo y regeneraciΓ³n de resΓΊmenes -- πŸ“± **Notificaciones Telegram** - Alertas en tiempo real -- πŸ”„ **Reprocesamiento** - Regenera resΓΊmenes sin re-transcribir +**EspaΓ±ol:** +Una plataforma inteligente de procesamiento de documentos que utiliza IA (Gemini/Claude) para analizar, resumir y convertir varios formatos de documentos (PDF, audio, texto) en bases de conocimiento estructuradas. Se integra con Notion para gestiΓ³n del conocimiento. -## πŸ—οΈ Arquitectura +## πŸš€ Features / CaracterΓ­sticas + +**English:** +- Multi-format document processing (PDF, MP3, WAV, TXT) +- AI-powered content analysis and summarization +- Automatic LaTeX generation from processed content +- Notion integration for knowledge base creation +- GPU acceleration support (ROCm/AMD) +- Parallel AI provider processing (Gemini + Claude) +- Telegram notifications for processing status +- WebDAV file management + +**EspaΓ±ol:** +- Procesamiento de documentos multi-formato (PDF, MP3, WAV, TXT) +- AnΓ‘lisis y resumen de contenido con IA +- GeneraciΓ³n automΓ‘tica de LaTeX desde contenido procesado +- IntegraciΓ³n con Notion para creaciΓ³n de bases de conocimiento +- Soporte de aceleraciΓ³n GPU (ROCm/AMD) +- Procesamiento paralelo de proveedores de IA (Gemini + Claude) +- Notificaciones Telegram para estado de procesamiento +- GestiΓ³n de archivos WebDAV + +## πŸ› οΈ Tech Stack / Stack TecnolΓ³gico + +- **Language:** Python 3.11+ +- **AI Providers:** Google Gemini, Anthropic Claude +- **Document Processing:** PyPDF2, SpeechRecognition, pydub +- **LaTeX Generation:** Custom templates +- **Storage:** Notion API, WebDAV +- **Notifications:** Telegram Bot API +- **GPU:** ROCm/HIP (AMD GPU support) + +## πŸ“‹ Architecture / Arquitectura ``` -β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” -β”‚ CBCFacil v9 β”‚ -β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ -β”‚ β”‚ -β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ -β”‚ β”‚ Nextcloud │────▢│ Processor │────▢│ AI Service β”‚ β”‚ -β”‚ β”‚ (WebDAV) β”‚ β”‚Audio/PDF/TXTβ”‚ β”‚Claude/Geminiβ”‚ β”‚ -β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ -β”‚ β”‚ β”‚ β”‚ β”‚ -β”‚ β”‚ β–Ό β–Ό β”‚ -β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ -β”‚ β”‚ β”‚ Whisper β”‚ β”‚ Document β”‚ β”‚ -β”‚ β”‚ β”‚ (GPU) β”‚ β”‚ Generator β”‚ β”‚ -β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ -β”‚ β”‚ β”‚ β”‚ -β”‚ β–Ό β–Ό β”‚ -β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ -β”‚ β”‚ Dashboard Web (Flask) β”‚ β”‚ -β”‚ β”‚ β€’ Vista de archivos β€’ Regenerar resΓΊmenes β”‚ β”‚ -β”‚ β”‚ β€’ Panel de versiones β€’ PrevisualizaciΓ³n β”‚ β”‚ -β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ -β”‚ β”‚ β”‚ -β”‚ β–Ό β”‚ -β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ -β”‚ β”‚ Telegram β”‚ β”‚ -β”‚ β”‚ (Notifica) β”‚ β”‚ -β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ -β”‚ β”‚ -β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ +cbcren2026/ +β”œβ”€β”€ api/ # REST API routes +β”œβ”€β”€ core/ # Core business logic +β”œβ”€β”€ document/ # Document generation (LaTeX) +β”œβ”€β”€ processors/ # File processors (PDF, audio, text) +β”œβ”€β”€ services/ # External service integrations +β”‚ β”œβ”€β”€ ai/ # AI providers (Claude, Gemini) +β”‚ └── notion/ # Notion integration +β”œβ”€β”€ storage/ # Data persistence +└── config/ # Configuration management ``` -## πŸ“ Estructura del Proyecto +## πŸ”§ Setup / ConfiguraciΓ³n -``` -cbcfacil/ -β”œβ”€β”€ main.py # Punto de entrada principal -β”œβ”€β”€ config/ -β”‚ └── settings.py # ConfiguraciΓ³n centralizada -β”œβ”€β”€ services/ -β”‚ β”œβ”€β”€ webdav_service.py # Cliente WebDAV/Nextcloud -β”‚ β”œβ”€β”€ vram_manager.py # GestiΓ³n memoria GPU -β”‚ β”œβ”€β”€ telegram_service.py # Notificaciones -β”‚ └── ai/ -β”‚ β”œβ”€β”€ claude_provider.py # Provider Claude (Z.ai) -β”‚ β”œβ”€β”€ gemini_provider.py # Provider Gemini -β”‚ └── provider_factory.py -β”œβ”€β”€ processors/ -β”‚ β”œβ”€β”€ audio_processor.py # TranscripciΓ³n Whisper -β”‚ β”œβ”€β”€ pdf_processor.py # OCR y extracciΓ³n -β”‚ └── text_processor.py # ClasificaciΓ³n -β”œβ”€β”€ document/ -β”‚ └── generators.py # Genera DOCX, PDF, Markdown -β”œβ”€β”€ storage/ -β”‚ └── processed_registry.py # Registro de procesados -β”œβ”€β”€ api/ -β”‚ └── routes.py # API REST + Dashboard -β”œβ”€β”€ templates/ -β”‚ └── index.html # Dashboard UI -└── downloads/ # Archivos descargados -``` +**English:** +1. Clone the repository +2. Install dependencies: `pip install -r requirements.txt` +3. Create `.env` file with API keys (Gemini, Claude, Notion, Telegram) +4. Run: `python main.py` -## πŸš€ InstalaciΓ³n +**EspaΓ±ol:** +1. Clona el repositorio +2. Instala dependencias: `pip install -r requirements.txt` +3. Crea archivo `.env` con claves API (Gemini, Claude, Notion, Telegram) +4. Ejecuta: `python main.py` -### Requisitos -- Python 3.10+ -- NVIDIA GPU + CUDA 12.1+ (opcional, fallback a CPU) -- Nextcloud con WebDAV habilitado +## πŸ”Œ API Endpoints -### InstalaciΓ³n RΓ‘pida +- `POST /api/process` - Process new documents +- `GET /api/status` - Check processing status +- `GET /api/health` - Health check -```bash -# Clonar repositorio -git clone https://gitea.cbcren.online/renato97/cbcren2026.git -cd cbcren2026 +## πŸ‘¨β€πŸ’» Author / Autor -# Crear entorno virtual -python3 -m venv .venv -source .venv/bin/activate +**Renato CBC** +- GitHub: [renato97](https://gitea.cbcren.online/renato97) -# Instalar dependencias -pip install -r requirements.txt +## πŸ“„ License / Licencia -# Configurar -cp .env.example .env -nano .env # Editar con tus credenciales - -# Ejecutar -python3 main.py -``` - -## βš™οΈ ConfiguraciΓ³n - -### Variables de Entorno (.env) - -```bash -# === NEXTCLOUD/WEBDAV === -NEXTCLOUD_URL=https://tu-nextcloud.com/remote.php/webdav -NEXTCLOUD_USER=usuario -NEXTCLOUD_PASSWORD=contraseΓ±a - -# === AI PROVIDERS === -GEMINI_API_KEY=AIza... # Para resΓΊmenes con Gemini -# o -ANTHROPIC_AUTH_TOKEN=sk-ant-... # Para resΓΊmenes con Claude - -# === TELEGRAM (Opcional) === -TELEGRAM_TOKEN=bot_token -TELEGRAM_CHAT_ID=chat_id - -# === DASHBOARD === -DASHBOARD_HOST=0.0.0.0 -DASHBOARD_PORT=5000 -``` - -## πŸ–₯️ Dashboard Web - -El dashboard se ejecuta en `http://localhost:5000` junto con el servicio principal. - -### Funcionalidades - -| CaracterΓ­stica | DescripciΓ³n | -|----------------|-------------| -| πŸ“Š **Vista de Archivos** | Lista todos los archivos de audio con estado | -| πŸ” **BΓΊsqueda y Filtros** | Filtra por local/WebDAV, ordena por fecha/nombre | -| πŸ‘οΈ **Panel de Preview** | Visualiza transcripciones y resΓΊmenes | -| πŸ“ **Tab Versiones** | Lista todos los formatos generados (TXT, MD, DOCX, PDF) | -| ✨ **Regenerar Resumen** | Genera nueva versiΓ³n del resumen con IA | -| πŸ”„ **Resetear Estado** | Marca archivo como no procesado | - -### API REST Endpoints - -``` -GET /api/files # Lista archivos -GET /api/files-detailed # Lista con info de transcripciones -GET /api/transcription/ # Obtiene transcripciΓ³n -GET /api/summary/ # Obtiene resumen -GET /api/versions/ # Lista versiones generadas -POST /api/regenerate-summary # Regenera resumen desde transcripciΓ³n -POST /api/mark-unprocessed # Resetea estado de archivo -GET /health # Estado del servicio -``` - -## πŸ”„ Flujo de Procesamiento - -1. **DetecciΓ³n** - El servicio monitorea Nextcloud cada 5 segundos -2. **Descarga** - Archivos nuevos se descargan localmente -3. **TranscripciΓ³n** - Whisper convierte audio a texto (.txt) -4. **Resumen** - Claude/Gemini genera resumen estructurado -5. **Documentos** - Se generan .md, .docx, .pdf -6. **Subida** - Documentos se suben a Nextcloud -7. **NotificaciΓ³n** - Telegram notifica finalizaciΓ³n - -## πŸ“± Regenerar ResΓΊmenes - -Cuando un resumen no es satisfactorio, puedes regenerarlo: - -### Desde el Dashboard -1. Clic en el archivo procesado -2. Panel lateral se abre con transcripciΓ³n/resumen -3. Clic en "✨ Regenerar" o tab "πŸ“ Versiones" -4. Nueva versiΓ³n se genera y reemplaza la anterior - -### Desde la Lista -- Archivos procesados muestran botΓ³n "✨ Regenerar" -- Clic directo sin abrir panel lateral - -## πŸ› οΈ Uso CLI - -```bash -# Ejecutar servicio completo -python3 main.py - -# Transcribir audio especΓ­fico -python3 main.py whisper archivo.mp3 ./output/ - -# Procesar PDF especΓ­fico -python3 main.py pdf documento.pdf ./output/ -``` - -## πŸ“Š MΓ©tricas - -| Componente | Performance | -|------------|-------------| -| TranscripciΓ³n Whisper | ~1x duraciΓ³n audio (GPU) | -| Resumen Gemini | ~5-15s por documento | -| OCR PDF | ~2-5s por pΓ‘gina | -| Inicio del servicio | ~5-10s | - -## πŸ”§ TecnologΓ­as - -- **Backend**: Python 3.10+, Flask -- **IA**: OpenAI Whisper, Google Gemini, Anthropic Claude -- **Frontend**: HTML5, CSS3, JavaScript (Vanilla) -- **Storage**: Nextcloud (WebDAV) -- **GPU**: CUDA, PyTorch - -## πŸ“ Licencia - -MIT License +Private project / Proyecto privado --- -**Desarrollado por CBC** | Última actualizaciΓ³n: Enero 2026 +**Tags / Etiquetas:** `python` `ai` `document-processing` `gemini` `claude` `notion` `latex` `automation`