Skip to main content Switch to mobile version detector-ia 1.5.2 Detector de texto generado por IA y de copia entre entregas · AI-text and plagiarism detection for student submissions
pip install detector-ia==1.5.2 Copy PIP instructions
Desarrollado por Alberto Ortiz Sánchez · albertoortiz.is-a.dev · PyPI · GitHub
pip install detector-ia && detector-ia --version Español
Herramienta de línea de comandos para detectar indicios de texto generado por IA y posibles copias entre entregas de alumnos, y generar un reporte CSV ordenado por riesgo.
Analiza cuadernos de Jupyter (.ipynb), PDF, Word (.docx), Markdown (.md) y texto plano (.txt) en una sola pasada.
Es una ayuda para la revisión, no una prueba. Un porcentaje alto es un motivo para hablar con el alumno o revisar el trabajo a mano; nunca un veredicto automático.
Guías en español e inglés dentro de cada archivo:
Uso y formatos: qué se extrae de cada formato y solución de problemas.
Changelog: historial de cambios por versión.
Integración continua: usar --fail-on y los informes en GitHub Actions.
Seguridad: cómo reportar un problema y qué datos no compartir.
Idiomas, entrenamiento y cifras: cómo se añade un idioma, cómo entrenar tu perfil y qué precisión se ha medido de verdad.
Método y calibración: de dónde salen los pesos y los umbrales, y cómo recalibrar.
Uso responsable: qué hacer con un caso marcado antes de hablar con el alumno.
Contribuir: entorno, estructura del código y convención de commits.
Ejemplos: textos inventados para probar la herramienta.
Evaluación: corpus etiquetado y script de métricas (evaluar.py).
Reportar un error · Código de conducta.
Índice de documentación.
Cada entrega se parte en bloques de ~1500 caracteres y cada bloque de más de 300 caracteres se puntúa combinando tres señales:
Opcionalmente (--perplejidad, experimental) se añade una cuarta señal tipo Binoculars: la perplejidad del texto bajo dos modelos de lenguaje emparentados. No necesita entrenar con ejemplos de IA, pero sus límites no están calibrados para español: mídela con evaluacion/evaluar.py --perplejidad antes de fiarte.
Cada resultado lleva una confianza (Alta, Media o Baja) y avisos cuando hay poca base: texto corto, bloques que se contradicen (posible texto mixto), puntuación que viene solo de la uniformidad o muchas citas. La confianza no es la probabilidad de acertar; indica cuánto se puede fiar uno del número.
Plagio entre entregas
Se compara el orden de las palabras, no solo el vocabulario: cada entrega se parte en n-gramas y se seleccionan huellas con winnowing (la idea de MOSS). La similitud es el porcentaje de huellas de la entrega más pequeña que aparecen en la otra, así que detecta también la copia parcial y no se deja engañar por trabajos que solo hablan del mismo tema. En los cuadernos se normaliza el código (nombres de variables, números y cadenas), de modo que renombrar variables no esconde la copia. El informe muestra los pasajes coincidentes de las dos entregas. El coseno clásico (bolsa de palabras) se sigue calculando como segunda opinión, en la columna Similitud_Coseno (%).
Con --base se indica el enunciado o la plantilla que reciben todos los alumnos, para que lo compartido no cuente como copia. Con --traduccion (extra semantica) se buscan frases con el mismo significado entre entregas en español e inglés; solo genera un aviso, nunca cambia el veredicto. Un mismo trabajo entregado en dos formatos (por ejemplo PDF y TXT) no se cuenta como copia.
Con las señales estructurales, el texto generado sin editar se detecta mucho mejor que el retocado a mano o el escrito «como un estudiante»; y los textos muy formales, traducidos o de quien escribe en una lengua que no es la suya pueden dar falsos positivos. El detalle y las cifras del corpus de pruebas están en Método y calibración.
Requiere Python 3.13 o superior.
pip install detector-ia # desde PyPI: señales estructurales, sin modelo neuronal pip install "detector-ia[modelo]" # con el modelo neuronal (torch + transformers) pip install "detector-ia[semantica]" # solo para --traduccion (sentence-transformers) El extra modelo instala torch y transformers; sin él la herramienta sigue funcionando con --sin-modelo, usando solo las señales estructurales. La primera ejecución descarga el modelo (~500 MB) en cache_modelo/, que está fuera del control de versiones. Las siguientes arrancan sin conexión.
Con el paquete instalado el comando es detector-ia; comprueba que responde con detector-ia --version.
Desde el código fuente
Si prefieres trabajar sobre el repositorio, clona y sincroniza. Para esto hace falta uv:
git clone https://github.com/alberto2005-coder/detector-ia.git cd detector-ia uv sync --extra modelo Dentro del repositorio los comandos del resto de la guía se ejecutan con uv run detector-ia.
Copia las entregas a analizar en revision_ia/ y ejecuta:
uv run detector-ia Eso lee revision_ia/, imprime el progreso y guarda reporte_profesional_ia.csv. Hay textos inventados de prueba en ejemplos/:
uv run detector-ia -c ejemplos -s reporte_ejemplos.csv Con opciones:
uv run detector-ia --carpeta entregas --salida reportes/marzo.csv uv run detector-ia --texto "Pega aquí el texto que quieres revisar..." # un texto suelto, sin archivos cat redaccion.txt | uv run detector-ia --texto - # o leído de la entrada estándar uv run detector-ia -c ejemplos/misma_entrega.md --sin-modelo # un solo archivo uv run detector-ia --folder entregas --output reporte.csv --en uv run detector-ia --modelo fakespot-ai/roberta-base-ai-text-detection-v1 uv run detector-ia -c entregas --html informe.html --markdown informe.md # informes para leer uv run detector-ia -c entregas --base enunciado.ipynb # sin contar la plantilla También funciona sin uv, con el entorno activado:
python -m detector_ia --carpeta revision_ia Opciones
Todos los flags, sus valores y la ayuda de -h se pueden escribir en español o en inglés: --carpeta entregas y --folder entregas hacen lo mismo, igual que --salida/--output. Con --lang en (o el atajo --en) se traduce todo: mensajes de consola, ayuda -h, veredictos, avisos, informes HTML y Markdown, CSV (cabeceras File, Format, AI_Mean (%), AI_Peak_Max (%), Peer_Similarity (%), Matches_With, Verdict, Suspicious_Fragment, Error, Cosine_Similarity (%), Confidence, Warnings, Matching_Fragment, Translated_Similarity (%), Group), CSV de calificaciones y claves del JSON (summary, results…). Sin ningún flag de idioma todo sale en español. También se puede fijar con la variable de entorno DETECTOR_IA_LANG=en; la línea de comandos gana a la variable. Si lees el CSV o el JSON desde un programa, fija el idioma para que las columnas y claves no varíen. -h sale en un solo idioma si eliges uno (detector-ia -h --en) y bilingüe si no pones ningún flag de idioma.
El CSV se guarda en UTF-8 con BOM y separador ;. La primera línea es sep=;, una pista que hace que Excel separe bien las columnas con cualquier configuración regional (sin ella, un Excel configurado con coma lo mete todo en una sola columna). Si lo lees con pandas u otro programa, usa --csv-limpio o skiprows=1. Columnas:
Archivo / Formato: nombre y extensión de la entrega.
IA_Media (%): media de la puntuación híbrida de los bloques evaluados.
IA_Pico_Max (%): bloque con la puntuación más alta, el que más se parece a texto de IA.
Similitud_Companero (%) y Coincide_Con: similitud por n-gramas con la entrega más parecida y su nombre si llega al 40 % (o si el coseno supera el 75 %). Desde la 1.1.0 esta columna ya no es el coseno; el coseno está en Similitud_Coseno (%).
Veredicto: ALTO RIESGO IA, REVISAR COPIA ENTRE ALUMNOS, Sospechoso (Revisar), Normal, Poco texto o, solo con --alta-precision, No concluyente.
Fragmento_Sospechoso: el bloque con mayor puntuación, para leerlo en contexto.
Error: vacía salvo que el archivo no se pudiera leer o puntuar; en ese caso el veredicto es Error y aquí aparece el motivo, sin detener el resto del lote.
Columnas añadidas en la 1.1.0, al final para no mover las anteriores: Similitud_Coseno (%), Confianza (Alta/Media/Baja), Avisos, Fragmento_Coincidente (el pasaje más largo que comparte con Coincide_Con) y Similitud_Traducida (%) (solo con --traduccion).
Columna añadida en la 1.2.0: Grupo (G1, G2… si varias entregas se copian entre sí; vacía si no).
Umbrales actuales (en src/detector_ia/main.py): pico ≥ 58 % o media ≥ 45 % es alto riesgo; pico ≥ 45 % o media ≥ 35 % es sospechoso; similitud por n-gramas ≥ 60 % o coseno > 88 % es posible copia.
Qué hay de nuevo en la 1.2.0
Crédito: al terminar cada análisis se imprime detector-ia 1.2.0 · Alberto Ortiz Sánchez · albertoortiz.is-a.dev por la salida de errores, y los informes HTML y Markdown llevan un pie con la web del autor y el enlace a PyPI. --sin-credito lo quita.
Trucos con caracteres: los espacios de ancho cero y las letras cirílicas que imitan letras latinas se detectan, se normalizan y se avisan. Medido en el corpus adversario (solo señales estructurales), sin esa limpieza la detección bajaba de 5/6 a 1–2/6; con ella vuelve a 5/6. Las erratas y el cambio de orden de palabras no afectan a esas señales; su efecto sobre el modelo neuronal no está medido.
Calibración: detector-ia --calibrar textos_humanos/ -s calibracion.json y luego --calibracion calibracion.json. Hacen falta al menos 10 textos (mejor 50 o más); con pocos, los umbrales no son fiables. Guía completa: docs/CALIBRACION.md.
Grupos de copia, --lms, metadatos de Word y puntuación por frase: ver el changelog. Los minutos de edición de Word y el indicio de humanizador son señales débiles y orientativas.
--html informe.html genera una sola página que se abre sin conexión (no carga nada de internet): resumen por veredicto, tabla que se ordena y se filtra, puntuación de cada bloque, los rasgos que suben o bajan la puntuación marcados dentro del texto, los pasajes copiados lado a lado y los pares de entregas más parecidos. El texto de los alumnos se escapa, así que no puede ejecutar nada. Como contiene trabajos reales, trátalo igual que el CSV.
detector-ia/ ├── src/detector_ia/ │ ├── main.py # CLI, umbrales y generación del reporte │ ├── extractores.py # Lectura de .ipynb, .pdf, .docx, .txt y .md │ ├── motores.py # Modelo neuronal, huella estructural y puntuación por bloques │ ├── perplejidad.py # Señal tipo Binoculars (opcional, experimental) │ ├── similitud.py # N-gramas con winnowing, fragmentos copiados y plantilla base │ ├── semantica.py # Plagio traducido por significado (opcional) │ ├── confianza.py # Nivel de confianza y avisos │ └── informes.py # Informes HTML y Markdown ├── tests/ # Pruebas con un detector falso, sin descargar el modelo ├── docs/ # Índice, método, uso responsable y formatos ├── ejemplos/ # Textos inventados para probar ├── evaluacion/ # Corpus etiquetado y script de métricas ├── scripts/ # Notas de release a partir del CHANGELOG ├── .github/ # CI, releases, Dependabot y plantillas ├── revision_ia/ # Entregas de entrada (ignoradas por git) ├── README.md # Guía completa, en español e inglés ├── CONTRIBUTING.md # Cómo contribuir ├── SECURITY.md # Política de seguridad ├── CODE_OF_CONDUCT.md # Código de conducta ├── CHANGELOG.md # Historial de cambios por versión ├── LICENSE # Licencia MIT ├── pyproject.toml # Metadatos, dependencias y entry point ├── uv.lock # Versiones exactas de las dependencias ├── .gitattributes # Finales de línea normalizados └── .gitignore # Excluye .venv, cache_modelo y entregas Privacidad
Las entregas de los alumnos y los reportes generados están excluidos de git (.gitignore), porque contienen trabajos reales y nombres de archivo. No los subas al repositorio ni compartas los CSV fuera del ámbito docente.
GitHub: https://github.com/alberto2005-coder/
Web personal: https://albertoortiz.is-a.dev/
PyPI: https://pypi.org/project/detector-ia/
Incidencias: https://github.com/alberto2005-coder/detector-ia/issues
Distribuido bajo la licencia MIT. Consulta LICENSE. © 2026 Alberto Ortiz Sánchez.
A command-line tool to spot AI-generated text and possible copying between students' submissions, and to produce a CSV report sorted by risk.
It analyses Jupyter notebooks (.ipynb), PDF, Word (.docx), Markdown (.md) and plain text (.txt) in a single pass.
This is a review aid, not evidence. A high score is a reason to talk to the student or read the work by hand; never an automatic verdict.
Guides in Spanish and English within each file:
Usage and formats: what is extracted from each format and troubleshooting.
Changelog: change history per version.
Continuous integration: using --fail-on and the reports in GitHub Actions.
Security: how to report a problem and which data never to share.
Languages, training and numbers: how languages work, how to train your profile and what accuracy has really been measured.
Method and calibration: where the weights and thresholds come from, and how to recalibrate.
Responsible use: what to do with a flagged case before talking to the student.
Contributing: environment, code layout and commit convention.
Examples: invented texts for trying the tool.
Evaluation: labelled corpus and metrics script (evaluar.py).
Report a bug · Code of conduct.
Documentation index.
Each submission is split into blocks of ~1500 characters, and every block longer than 300 characters is scored by combining three signals:
Optionally (--perplejidad, experimental) a fourth signal in the style of Binoculars is added: the perplexity of the text under two related language models. It needs no training on AI examples, but its limits are not calibrated for Spanish: measure it with evaluacion/evaluar.py --perplejidad before trusting it.
Every result carries a confidence (Alta, Media or Baja) and notices when the basis is thin: short text, blocks that disagree (possibly mixed text), a score that comes only from uniformity, or many quotations. Confidence is not the probability of being right; it tells you how far the number can be trusted.
Plagiarism between submissions
The order of the words is compared, not just the vocabulary: every submission is split into n-grams and fingerprints are chosen with winnowing (the idea behind MOSS). Similarity is the share of fingerprints of the smaller submission found in the other, so it also catches partial copying and is not fooled by pieces of work that merely cover the same topic. In notebooks the code is normalised (variable names, numbers and strings), so renaming variables does not hide the copy. The report shows the shared passages from both submissions. The classic cosine (bag of words) is still computed as a second opinion, in the Similitud_Coseno (%) column.
--base takes the assignment brief or template every student receives, so what is shared does not count as copying. --traduccion (the semantica extra) looks for sentences with the same meaning across Spanish and English submissions; it only raises a notice and never changes the verdict. The same assignment submitted in two formats (say PDF and TXT) is not counted as copying.
What it does not do well
With the structural signals, unedited generated text is detected far better than text edited by hand or written "like a student"; and very formal or translated text, or text by people not writing in their first language, can produce false positives. The details and the numbers from the test corpus are in Method and calibration.
Requires Python 3.13 or newer.
pip install detector-ia # from PyPI: structural signals, no neural model pip install "detector-ia[modelo]" # with the neural model (torch + transformers) pip install "detector-ia[semantica]" # only for --traduccion (sentence-transformers) The modelo extra installs torch and transformers; without it the tool still works with --sin-modelo, using only the structural signals. The first run downloads the model (~500 MB) into cache_modelo/, which is not tracked by git. Later runs start offline.
Once installed, the command is detector-ia; check it with detector-ia --version.
If you prefer working on the repository, clone and sync. This needs uv:
Copy the submissions into revision_ia/ and run:
uv run detector-ia That reads revision_ia/, prints progress and writes reporte_profesional_ia.csv. There are invented test texts in ejemplos/:
Every flag, its values and the -h help can be written in Spanish or in English: --carpeta entregas and --folder entregas are the same thing, as are --salida/--output. With --lang en (or the --en shortcut) everything is translated: console messages, the -h help, verdicts, warnings, HTML and Markdown reports, CSV (headers File, Format, AI_Mean (%), AI_Peak_Max (%), Peer_Similarity (%), Matches_With, Verdict, Suspicious_Fragment, Error, Cosine_Similarity (%), Confidence, Warnings, Matching_Fragment, Translated_Similarity (%), Group), the gradebook CSV and the JSON keys (summary, results…). With no language flag everything is in Spanish. You can also set it with the environment variable DETECTOR_IA_LANG=en; the command line wins over the variable. If you read the CSV or JSON from a program, fix the language so columns and keys do not vary. -h prints in a single language if you choose one (detector-ia -h --en) and bilingual if you give no language flag.
The CSV is written in UTF-8 with BOM and a ; separator. Its first line is sep=;, a hint that makes Excel split the columns correctly under any regional setting (without it, an Excel set to use commas puts everything in one column). If you read it with pandas or another tool, use --plain-csv or skiprows=1. Columns:
Archivo / Formato: file name and extension of the submission.
IA_Media (%): mean hybrid score of the scored blocks.
IA_Pico_Max (%): highest-scoring block, the most AI-like passage.
Similitud_Companero (%) and Coincide_Con: n-gram similarity with the most similar submission, and its name when it reaches 40 % (or the cosine is above 75 %). Since 1.1.0 this column is no longer the cosine; the cosine is in Similitud_Coseno (%).
Fragmento_Sospechoso: the highest-scoring block, to read it in context.
Error: empty unless the file could not be read or scored; the verdict is then Error and the reason appears here, without stopping the rest of the batch.
Columns added in 1.1.0, at the end so the earlier ones do not move: Similitud_Coseno (%), Confianza (Alta/Media/Baja), Avisos, Fragmento_Coincidente (the longest passage shared with Coincide_Con) and Similitud_Traducida (%) (only with --traduccion).
Column added in 1.2.0: Grupo (G1, G2… when several submissions copy each other; empty otherwise).
Current thresholds (in src/detector_ia/main.py): peak ≥ 58 % or mean ≥ 45 % is high risk; peak ≥ 45 % or mean ≥ 35 % is suspicious; n-gram similarity ≥ 60 % or cosine > 88 % is possible copying.
What is new in 1.2.0
Credit: after each analysis detector-ia 1.2.0 · Alberto Ortiz Sánchez · albertoortiz.is-a.dev is printed to stderr, and the HTML and Markdown reports carry a footer with the author's website and the PyPI link. --no-credit removes it.
Character tricks: zero-width spaces and Cyrillic letters that mimic Latin ones are detected, normalised and flagged. Measured on the adversarial corpus (structural signals only), without this cleaning detection fell from 5/6 to 1–2/6; with it it returns to 5/6. Typos and word-order swaps do not affect those signals; their effect on the neural model is not measured.
Calibration: detector-ia --calibrate human_texts/ -s calibration.json, then --calibration calibration.json. At least 10 texts are needed (50 or more is better); with fewer, the thresholds are not reliable. Full guide: docs/CALIBRACION.md.
Copy groups, --lms, Word metadata and per-sentence scoring: see the changelog. Word editing minutes and the humaniser hint are weak, indicative signals.
--html report.html writes a single page that opens offline (it loads nothing from the internet): a summary by verdict, a sortable and filterable table, the score of every block, the traits that raise or lower the score marked inside the text, copied passages side by side and the most similar pairs of submissions. Student text is escaped, so it cannot run anything. Since it contains real work, treat it like the CSV.
Student submissions and generated reports are excluded from git (.gitignore), because they contain real work and file names. Do not push them to the repository or share the CSVs outside the classroom.
Developed by Alberto Ortiz Sánchez.
Personal website: https://albertoortiz.is-a.dev/
Issues: https://github.com/alberto2005-coder/detector-ia/issues
Distributed under the MIT license. See LICENSE. © 2026 Alberto Ortiz Sánchez.
Released: Nov 27, 2026
Author/Maintainer: Alberto Ortiz Sánchez
Both files in this release have provenance metadata.
View provenance details
MIT View SPDX License List
ia ai-detection plagio plagiarism educacion education roberta docencia teaching csv cli jupyter pdf docx similarity winnowing binoculars html-report
Development Status 4 - Beta
Intended Audience Education
License OSI Approved :: MIT License
Natural Language English
Operating System OS Independent
Programming Language Python :: 3
Text Processing :: Linguistic
Release files for detector-ia 1.5.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
Built distribution (wheel)
Total release size: 220.3 kB
Release files / detector_ia-1.5.2.tar.gz
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.
Release files / detector_ia-1.5.2-py3-none-any.whl
Security for detector-ia 1.5.2
Both files in this release have been uploaded with provenance metadata.
With provenance detector_ia-1.5.2.tar.gz Nov 27, 2026
With provenance detector_ia-1.5.2-py3-none-any.whl Nov 27, 2026
Attestation for detector_ia-1.5.2.tar.gz
Attestation for detector_ia-1.5.2-py3-none-any.whl
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.
Release history Release notifications | RSS feed
Nov 27, 2026 2 release files Full provenance
Nov 25, 2026 2 release files Full provenance
Nov 23, 2026 2 release files Full provenance
Nov 22, 2026 2 release files Full provenance
Nov 21, 2026 2 release files Full provenance
Nov 20, 2026 2 release files Full provenance
Nov 19, 2026 2 release files Full provenance
Nov 18, 2026 2 release files Full provenance
Nov 18, 2026 2 release files No provenance
Nov 17, 2026 2 release files No provenance
"PyPI", "Python Package Index", and the blocks logos are registered trademarks of the Python Software Foundation.
© 2026 Python Software Foundation
Deployed from fc0d8e6











