This application repo rewrites text from any language into normative Galician. It uses:
- Ollama3.1 as local LLM engine for advanced linguistic processing
src.translatorto detect and translate the textsrc.correctorto correct grammatical issues in the translated textsrc.configto configure and style the Streamlit interface
-
Language Detection
Usesdetectar_idiomato identify the source language automatically. -
Translation
Leverages theobtener_traductorfunction to translate any input text into Galician. -
Correction
Appliesobtener_correctorandcorregir_textoto refine grammar and syntax after translation.
poetry install
poetry shellstreamlit run main.py --server.fileWatcherType none- Enter or paste the text you want to translate.
- Click “Procesar texto” to run detection, translation, and correction.
- Review the final output in Galician.
-
Local LLM Processing
UsesOllamawith custom-trained Galician language models for:- Context-aware translations
- Grammatical nuance correction
- Style adaptation to normative Galician
-
Language Detection
Usesdetectar_idiomawith fallback to LLM when confidence < 75% -
Hybrid Correction System
Combines:- Rule-based checks from
language_tool_python - LLM-powered contextual corrections via Ollama
- Rule-based checks from
graph TD
A[User Input] --> B(Language Detection)
B --> C{Translation}
C -->|Helsinki-NLP| D[Raw Galician]
C -->|Ollama Fallback| D[Raw Galician]
D --> E[Hybrid Correction]
E --> F[Rule-Based Checks]
E --> G[LLM Refinement]
G --> H[Final Output]




