--- language: - en license: mit tags: - token-classification - prose-format - prose-formatting - pytorch - transformers pipeline_tag: token-classification --- # khwstolle/prose-format-bert-mini This model predicts token-level line-break and indentation boundaries for formatting prose and documentation with `prose-format`. ## Architecture Details - **Base Architecture**: `BertForTokenClassification` - **Hidden Dimensions**: 256 - **Hidden Layers**: 4 - **Attention Heads**: 4 - **Maximum Sequence Length**: 512 tokens - **Output Classes**: 9 line-break boundary classes ## Direct Inference with Transformers This repository contains standard Hugging Face configuration and model weights, allowing standard loading via `transformers`: ```python import torch from transformers import AutoModelForTokenClassification, AutoTokenizer model_id = "khwstolle/prose-format-bert-mini" tokenizer = AutoTokenizer.from_pretrained(model_id) model = AutoModelForTokenClassification.from_pretrained(model_id) model.eval() text = "Clear line breaks improve version control diff readability." inputs = tokenizer(text, return_tensors="pt") with torch.no_grad(): logits = model(**inputs).logits predictions = logits.argmax(dim=-1) ```