Instructions to use LiquidAI/LFM2.5-Encoder-350M-Spellchecker with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use LiquidAI/LFM2.5-Encoder-350M-Spellchecker with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("token-classification", model="LiquidAI/LFM2.5-Encoder-350M-Spellchecker", trust_remote_code=True)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("LiquidAI/LFM2.5-Encoder-350M-Spellchecker", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
LFM2.5-Encoder-350-Spellchecker
A full fine-tune of LFM2.5-Encoder-350M with a subword-level GECToR-style grammatical-error-correction tagger. It covers grammar, spelling, punctuation, and casing in English.
Find more details about our encoders in our blog post.
💻 Demos: Try this fine-tuned model running in a CPU-only Hugging Face space: Spell checking — correct misspellings token by token.
Usage
⚠️ Loads custom code via
trust_remote_code=True(the model wraps atrust_remote_codeencoder).
Install the required packages:
pip install torch transformers
Run spell checking:
from transformers import AutoModel
model_id = "LiquidAI/LFM2.5-Encoder-350-Spellchecker"
model = AutoModel.from_pretrained(
model_id,
trust_remote_code=True,
).float().eval()
print(model.correct(["She go to school every day ."]))
# ['She goes to school every day .']
correct() accepts a string or a list; tune precision with min_error_prob (higher → fewer edits) and
max_iter (refinement passes). Input should be whitespace-tokenized (punctuation separated by spaces),
matching the training data.
Evaluation
Fixed inference setting: max_iter=4, precision knobs off. Headline ERRANT F0.5:
MASTER composite (selection metric): 64.24
| Benchmark | Precision | Recall | F0.5 |
|---|---|---|---|
| LOCNESS native (ERRANT) | 53.77 | 34.53 | 48.38 |
| BEA-dev (ERRANT) | 56.48 | 28.96 | 47.46 |
| CoNLL-14 (ERRANT) | 67.54 | 18.91 | 44.59 |
| FCE-test (ERRANT) | 57.31 | 32.63 | 49.78 |
| Robustness (ERRANT) | 91.96 | 87.98 | 91.14 |
| Multilingual dev (F0.5) | — | — | — |
Examples
| Input | Correction |
|---|---|
She go to school every day . |
She goes to school every day . |
I has went to the stor yesterday . |
I went to the store yesterday . |
Their are many reason to study hard . |
There are many reasons to study hard . |
He don't like coffee but he like tea . |
He does n't like coffee , but he likes tea . |
📬 Contact
- Got questions or want to connect? Join our Discord community
- If you are interested in custom solutions with edge deployment, please contact our sales team.
Citation
@article{liquidAI2026Encoders,
author = {Liquid AI},
title = {LFM2.5-Encoders: Fast at Long Context, Even on CPU},
journal = {Liquid AI Blog},
year = {2026},
note = {www.liquid.ai/blog/lfm2-5-encoders},
}
- Downloads last month
- 117
Model tree for LiquidAI/LFM2.5-Encoder-350M-Spellchecker
Base model
LiquidAI/LFM2.5-350M-Base