A specialized neural machine translation model designed to translate natural language text within LaTeX documents from English to Indonesian while rigorously preserving document structure, LaTeX commands, mathematical expressions, and formatting.
This model is particularly suited for:
Academic papers and journal articles
Theses and dissertations
Technical books and monographs
Scientific reports and documentation
🏗️ Model Architecture
Attribute
Specification
Base Architecture
MarianMT (Transformer)
Encoder Layers
6
Decoder Layers
6
Total Parameters
~72.3M
Source Language
English (en)
Target Language
Indonesian (id)
Model Format
Safetensors + PyTorch
License
MIT
🚀 Quick Start
Installation
pip install transformers torch
Basic Usage
python
1from transformers import MarianTokenizer, MarianMTModel
23# Load model and tokenizer4model_name ="Ik45/mt-en-id-latex-translation"5tokenizer = MarianTokenizer.from_pretrained(model_name)6model = MarianMTModel.from_pretrained(model_name)78# Example LaTeX input9latex_text =r"""
10The \\textbf{quick brown fox} jumps over the lazy dog.
11This is an important \\textit{result}.
12We use \\begin{equation} E = mc^2 \\end{equation} in physics.
13"""1415# Tokenize and translate16inputs = tokenizer(latex_text, return_tensors="pt", padding=True)17translated = model.generate(18**inputs,19 max_length=512,20 num_beams=5,21 early_stopping=True22)2324# Decode output25output = tokenizer.decode(translated[0], skip_special_tokens=True)26print(output)
Advanced Configuration
For production-grade translation quality, the following generation parameters are recommended: