FastSpell
FastSpell is a free GPL-3.0 Python library that pairs fastText detection with Hunspell spell-checking to tell closely related languages apart, giving NLP and corpus teams a targeted language identifier that runs entirely on their own machine.
What is FastSpell?
FastSpell is a targeted language identifier: a Python library whose job is not to guess any language on earth, but to decide reliably whether a piece of text really is in the one language you care about. Its repository sums it up in a single line, Targetted language identifier, based on FastText and Hunspell. The problem it addresses is familiar to anyone who has assembled a multilingual corpus. Generic identifiers cope badly with languages that share vocabulary and orthography, and they routinely label Galician as Spanish, Catalan as Spanish, or Bosnian as Croatian. FastSpell answers this with a two-stage mechanism. First fastText proposes a language; if that proposal is very close to the target language, a second stage takes over and Hunspell arbitrates by comparing spelling error rates across the candidate dictionaries. The README's own example is fastText returning Spanish while the target language is Galician, which is exactly the case the extra check exists to settle. The candidate sets are declarative rather than hard-coded: similar.yaml lists 68 target languages with the languages each can be confused with (gl with es and pt, ca with es and oc, cs with sk, da with nb and sv, is with da, nb, nn and sv, bs with hr, sr_lat and sl), while hunspell.yaml maps 92 dictionary entries. Two modes govern the verdict. Aggressive always commits to an answer; conservative returns the label unk when the evidence is tied, which matters when a wrong label costs more than a missing one. There are two ways in. As a module, from fastspell import FastSpell, then fsobj.getlang('Hola, mundo') returns es. As a command, fastspell with --aggr or --cons, a target language, an input and an output. Configuration is overridable with -c/--config or the FASTSPELL_CONFIG environment variable. FastSpell is free software under GPL-3.0, installed with pip install fastspell or conda install -c conda-forge -c bitextor fastspell, and developed in the open on GitHub, where the repository shows 38 stars, 5 forks and 14 releases, the latest being v0.13.1. It grew out of the corpus-cleaning work of its publisher, Prompsit Language Engineering, S.L., with declared links to ParaCrawl, MaCoCu and HPLT, and it was presented at LREC-COLING 2024 in the paper FastSpell: The LangId Magic Spell by Marta Bañón, Gema Ramírez-Sánchez, Jaume Zaragoza-Bernabeu and Sergio Ortiz Rojas.
What it does
- Identify the language of a text among closely related languages
- Tell Galician from Spanish and Portuguese, Catalan from Spanish, or Bosnian from Croatian and Serbian
- Filter a multilingual corpus before training, alignment or annotation
- Choose between an aggressive and a conservative verdict depending on your tolerance for false positives
- Label files in batch from the command line, or call getlang() directly from Python
- Override the language configuration to add or remove a target language without touching the code
When to use FastSpell / When not to
A quick filter to help you decide if FastSpell is the right fit.
When to use FastSpell
- Corpus engineers cleaning and filtering large multilingual datasets, as in the ParaCrawl, MaCoCu and HPLT pipelines
- NLP teams whose processing chains break when a general-purpose identifier confuses two closely related languages
- Practitioners working on lower-resourced languages and regional varieties such as Galician, Catalan, Asturian, Occitan, Sardinian or Venetian
- Academic groups in computational linguistics who need a citable, peer-reviewed method (LREC-COLING 2024)
- Organizations that must keep text offline or on-premises, since everything runs locally once installed
When not to use FastSpell
- Anyone expecting a graphical interface: FastSpell offers a Python module and a command line, nothing else
- Teams that want a hosted service or a REST endpoint to call remotely, because there is nothing to call over the network
- Windows and macOS users expecting supported builds: the package classifiers declare POSIX/Linux only
- Users looking for a spell checker or a proofreading assistant, since Hunspell is used here purely to arbitrate between candidate languages
- Non-technical profiles unwilling to handle system dependencies, as the install may require python3-dev, build-essential, autoconf, autopoint and libtool
How to use FastSpell
A typical end-to-end flow, from setup to results.
- Check the prerequisites: a suitable Python interpreter and the system package python3-dev (sudo apt-get install python3-dev)
- Install the library with pip install fastspell, with conda install -c conda-forge -c bitextor fastspell, or with pip install . from a clone of the sources
- If cyhunspell 2.0.2 fails to build, a case reported on Python 3.10, install build-essential, autoconf, autopoint and libtool, then install cyhunspell==2.0.3 from git before retrying
- Optionally run fastspell-download to fetch the fastText model; since version 0.7 the Hunspell dictionaries come with the pip package
- From Python: from fastspell import FastSpell, then fsobj = FastSpell.FastSpell('en', mode='cons') and fsobj.getlang('Hello, world'), which returns en
- From the shell: fastspell [--aggr|--cons] [--hbs] [-q|--debug] [--logfile F] lang [input] [output]
- Pick the mode deliberately: --aggr always commits to a language, --cons returns unk when the check is inconclusive
- Profile a whole corpus in one line: cat inputtext | fastspell --aggr $L | cut -f2 | sort | uniq -c | sort -nr
- Customize the behavior by copying config/similar.yaml and config/hunspell.yaml, then pointing -c/--config or FASTSPELL_CONFIG at your own versions
- Validate the installation from the tests directory with python3 -m unittest discover; dictionaries are looked up in ~/.local/share/fastspell, ~/.local/share/hunspell, $VIRTUAL_ENV/share/hunspell and /usr/share/hunspell
Pros & Cons
Pros
- Solves a precise, well-documented problem, the confusion between closely related languages, exactly where general-purpose identifiers fail
- Peer-reviewed method presented at LREC-COLING 2024, so the approach can be cited and scrutinized rather than taken on trust
- First-party benchmark comparing it against nine other identifiers, with test data drawn from ParaCrawl human evaluations
- Free software under GPL-3.0: no usage cost, and source code that can be audited line by line
- Runs entirely locally, so no text ever leaves the machine, which suits confidential or regulated corpora
- Unusually broad coverage of lower-resourced languages and regional varieties
- Open configuration and two explicit modes, letting you trade precision against recall without touching the code
Cons
- Installation can be fragile: the README devotes a whole section to cyhunspell build failures and to system dependencies that must be installed by hand
- The project contradicts itself on the Python requirement, the README announcing Python3.8 or higher while pyproject.toml declares requires-python = ">=3.10"; both statements are first-party and neither is retracted
- Package classifiers declare POSIX/Linux only, so neither Windows nor macOS is announced as a supported platform
- No documentation beyond the README: no dedicated site, no generated API reference, no tutorials
- Small project by any measure: 38 stars, 2 watchers, 6 contributors and 5 open issues
- Slow publication rhythm, with release v0.13.1 dated 13/02/2025 and the last push dated 04/09/2025
- No graphical interface and no hosted service; benchmark results also live in an external Google spreadsheet that is not versioned with the code
Pricing & Plans
FastSpell is free software released under the GPL-3.0 license. There is no paid tier, no subscription and no price point to report, because the tool is not sold: installation from PyPI or conda-forge costs nothing, and no pricing page exists for it. That absence follows from the licensing model, not from a gap in the research. The only real cost of adoption is the technical effort of installing and running it on hardware you already own. For the avoidance of doubt, the publisher separately markets a commercial translation API on subscription; that is a different product, and none of its pricing applies to FastSpell.
Data, GDPR & hosting
A consolidated view of how FastSpell handles your data.
GDPR overview
No GDPR claim is made for FastSpell anywhere. The library runs on your own machine and transmits nothing, so it performs no remote processing of personal data on your behalf, and there is no privacy notice attached to the package. The GDPR material that does exist belongs to the publisher's website. That privacy policy, last updated on 16 September 2025, names Prompsit Language Engineering, S.L. (CIF B54085782), Avinguda Universitat, s/n. Edifici Quorum III. 03202 Elx (Alacant), Spain, as controller. It sets out rights of access, rectification, erasure, objection, restriction and portability, and the right to complain to the Spanish supervisory authority, the AEPD. International transfers are limited to Google LLC in the United States under the EU-US Data Privacy Framework, and only where analytics are accepted. The publisher is established in the European Union, so no Article 27 representative applies. Read that document as covering prompsit.com, not the library.
Who owns the data?
FastSpell is a library you install and run on your own machine, so the text you analyze never leaves it. Neither the repository, the package nor the GPL-3.0 license claims any ownership over the content you process: what you feed in and what you get back remain entirely yours, and there is no account, sign-up or authentication that could tie your material to a provider. The only privacy document the publisher publishes states its own perimeter in the first line, Scope: Website https://prompsit.com, so it governs the website of Prompsit Language Engineering, S.L., not this library. No third party receives the analyzed text.
Reuse rights
Because everything happens locally, there is no data reuse policy to negotiate: the text you submit is processed on your own machine and is never transmitted, stored or shared. You may reuse both the input and the labeled output freely, without asking anyone's permission, subject only to whatever rights you already hold over the text itself. The single documented network flow is the download of the fastText model and the Hunspell dictionaries through the fastspell-download command, and since version 0.7 the dictionaries ship with the pip package anyway. The publisher's privacy policy applies only to prompsit.com, where it describes Google analytics collected on consent and a Nodemailer contact form whose messages are not stored in a database; it says nothing about material processed with the library. Note the distinction that matters legally: GPL-3.0 sets conditions on redistributing the software, not on the texts you analyze with it.
Data retention & training
Hosting summary
There is no hosting to describe, and that is a property of the product rather than a gap in the research. FastSpell is a library you install on your own machine or server: it runs inside your process, on your hardware, under your jurisdiction. No hosting country and no hosting region is declared because none applies. There is no backend, no account and no storage operated by the publisher, and the text you analyze is never uploaded. The only network traffic the project documents is outbound and occasional, namely downloading the fastText model and the Hunspell dictionaries, which since version 0.7 arrive with the pip package in any case. In practice the hosting question is therefore yours to answer: whichever machine you run FastSpell on determines where the processing happens and which law applies to it. The publisher, Prompsit Language Engineering, S.L., is established in Elx (Alacant), Spain, but that is where the company sits, not where your data goes; its published privacy policy covers only its own website.
Things to keep in mind
Risks and trade-offs to weigh before adopting FastSpell.
- The project contradicts itself on the Python requirement: the README says Python3.8 or higher, pyproject.toml declares >=3.10. Both are first-party, and betting on the wrong one wastes an install cycle
- cyhunspell 2.0.2 is known to break the build in some cases; the documented workaround means installing compilers and autotools on the target machine, which is not always permitted in locked-down environments
- Package classifiers declare POSIX/Linux only, so Windows and macOS users sit outside the announced support perimeter and are on their own if something breaks
- The publisher's privacy policy scopes itself explicitly to its own website and does not cover the library; do not read it as a guarantee about the text you process locally
- The PyPI page of the package is currently unreachable to automated clients, because pypi.org serves a JavaScript verification challenge in its place; treat the GitHub repository as the authoritative source
- The published benchmark results live in an external Google spreadsheet that is not versioned with the code, so they can change or vanish without leaving a trace in the repository
- Automated language labels invite over-trust: a conservative unk is information rather than a failure, and accepting any identifier's output as ground truth without sampling and human review will silently degrade a corpus
Setup & Integrations
Technical difficulty
Moderate, and squarely aimed at a technical audience. In the nominal case it is one command, pip install fastspell, but real system prerequisites exist: python3-dev, and sometimes build-essential, autoconf, autopoint and libtool when cyhunspell has to be compiled. A documented failure on cyhunspell 2.0.2 requires a manual detour through git. Since version 0.7 the dictionaries are installed automatically by pip, which removes one step. Expect to be comfortable with Python, a Linux terminal and package managers. The bundled unit tests let you confirm the installation before trusting any result.
Deployment
Integrations
Supported languages
Behind FastSpell
Social
Resources
All the official URLs gathered for verification and reference.
Alternatives
Tools that compete with or complement FastSpell.
Frequently asked questions
What is FastSpell based on?
How many languages does it cover?
Under which license is it published?
How do I install it?
Which version of Python does it need?
What is the difference between aggressive and conservative mode?
Can I use it without writing Python?
Is my text sent anywhere?
Is there a web API?
How should I cite it?
Should you pick FastSpell?
FastSpell is a niche tool that knows exactly what it is for. It does not try to identify every language on earth; it tries to stop a pipeline from calling Galician Spanish, Catalan Spanish or Bosnian Croatian, which is the precise failure mode that quietly poisons a multilingual corpus. The two-stage design, with fastText proposing and Hunspell arbitrating through spelling error rates, is simple enough to reason about and open enough to adjust: the 68 target languages and their confusable neighbours live in YAML files you can edit without touching a line of code. The method was published and evaluated at LREC-COLING 2024, and a first-party benchmark sets it against nine other identifiers, which is more accountability than tools of this kind usually offer. It is used in the corpus-cleaning ecosystem behind ParaCrawl, MaCoCu and HPLT, a reasonable proxy for whether it survives contact with real data. Being free software under GPL-3.0, it costs nothing, can be audited, and runs entirely on your own machine, so no text ever leaves your infrastructure. The reservations are practical rather than conceptual. Installation is more demanding than the single pip command suggests: system packages are needed, and cyhunspell has a documented failure mode with a manual workaround. The project declares POSIX/Linux support only, its documentation stops at the README, and the release rhythm is slow. The README and pyproject.toml also disagree about the minimum Python version, the kind of small inconsistency that costs an afternoon. If you work with closely related languages at scale and are comfortable in a terminal, FastSpell is worth the setup effort. If you want a graphical tool, a hosted endpoint or something a non-technical colleague can run unaided, look elsewhere.
- Choosing a selection results in a full page refresh.
- Opens in a new window.