{"id":15158089,"url":"https://github.com/bonysmoke/speliuk","last_synced_at":"2026-02-14T19:31:36.623Z","repository":{"id":257290910,"uuid":"857833514","full_name":"BonySmoke/speliuk","owner":"BonySmoke","description":"A more accurate spelling correction for the Ukrainian language.","archived":false,"fork":false,"pushed_at":"2024-11-10T12:50:16.000Z","size":148,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-07T01:41:57.909Z","etag":null,"topics":["correction","kenlm","spacy","spelling","symspell","ukrainian"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BonySmoke.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-15T18:15:10.000Z","updated_at":"2025-01-04T17:45:46.000Z","dependencies_parsed_at":"2025-02-09T17:41:23.282Z","dependency_job_id":null,"html_url":"https://github.com/BonySmoke/speliuk","commit_stats":null,"previous_names":["bonysmoke/speliuk"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/BonySmoke/speliuk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BonySmoke%2Fspeliuk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BonySmoke%2Fspeliuk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BonySmoke%2Fspeliuk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BonySmoke%2Fspeliuk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BonySmoke","download_url":"https://codeload.github.com/BonySmoke/speliuk/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BonySmoke%2Fspeliuk/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273073344,"owners_count":25040706,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-01T02:00:09.058Z","response_time":120,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["correction","kenlm","spacy","spelling","symspell","ukrainian"],"created_at":"2024-09-26T20:23:18.490Z","updated_at":"2026-02-14T19:31:36.372Z","avatar_url":"https://github.com/BonySmoke.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Speliuk\n\nA more accurate spelling correction for the Ukrainian language.\n\n## Motivation\n\nWhen using a spell checker in systems that perform an automatic spelling correction without human verification, the following questions arise:\n- How to avoid false correction, i.e. when a real word that is not present in a vocabulary is corrected? This is especially viable for fusional languages such as Ukrainian.\n- How to find a single best correction for a misspelled word? Many spell checkers rely on the frequency of candidates and their edit distance discarding the surrounding context.\n\nTo address these issues, we propose a system that is compatible with any spell checker but focuses on precision over recall.\u003cbr\u003e\nWe improve the accuracy of a spell checker by using these complimentary models:\n- [KenLM](https://github.com/kpu/kenlm). The model is used for fast perplexity calculation to find the best candidate for a misspelled word.\n- Transfomer-based NER pipeline to detect misspelled words.\n- [SymSpell](https://github.com/wolfgarbe/SymSpell). As of now, this is the only supported spell checker.\n\n## Installation\n\n1. For CPU-only inference, install the CPU version of [PyTorch](https://pytorch.org/get-started/locally/).\n2. Make sure you can compile Python extension modules (required for KenLM). If you are on Linux, you can install them like this:\n```\nsudo apt-get install python-dev\n```\n3. Install Speliuk:\n```\npip install speliuk\n```\n\n## Usage\n\nBy default, Speliuk will use pre-trained models stored on [Hugging Face](https://huggingface.co/BonySmoke/Speliuk/tree/main).\n\n```python\n\u003e\u003e\u003e from speliuk.correct import Speliuk\n\u003e\u003e\u003e speliuk = Speliuk()\n\u003e\u003e\u003e speliuk.load()\n\u003e\u003e\u003e speliuk.correct(\"то він моее це зраабити для меніе?\")\nCorrection(corrected_text='то він може це зробити для мене?', annotations=[Annotation(start=7, end=11, source_text='моее', suggestions=['може'], meta={}), Annotation(start=15, end=23, source_text='зраабити', suggestions=['зробити'], meta={}), Annotation(start=28, end=33, source_text='меніе', suggestions=['мене'], meta={})])\n```\n\nSpeliuk can also be used directly from a spaCy model:\n```python\n\u003e\u003e\u003e import spacy\n\u003e\u003e\u003e from speliuk.correct import CorrectionPipe\n\u003e\u003e\u003e nlp = spacy.blank('uk')\n\u003e\u003e\u003e nlp.add_pipe('speliuk', config=dict(spacy_spelling_model_path='/my/custom/model'))\n\u003e\u003e\u003e doc = nlp(\"то він моее це зраабити для меніе?\")\n\u003e\u003e\u003e doc._.speliuk_corrected\n'то він може це зробити для мене?'\n\u003e\u003e\u003e doc.spans[\"speliuk_errors\"]\n[моее, зраабити, меніе]\n```\n\n## Training Details\n\n### Spelling Error Detection\n\nTo detect spelling errors, a spaCy NER model is used.\n\nIt was trained on a combination of synthetic and golden data:\n- For synthetic data generation, we used [UberText](https://lang.org.ua/en/ubertext/) as base texts and [nlpaug](https://github.com/makcedward/nlpaug) for errors generation. In total, 10k samples from different categories were used.\n- For golden data, we used spelling errors from the [UA-GEC](https://github.com/grammarly/ua-gec) corpus.\n\n### Perplexity Calculation\n\nWe used KenLM for quick perplexity calculation. We used an existing model [Yehor/kenlm-uk](https://huggingface.co/Yehor/kenlm-uk) trained on UberText.\n\n### Spell Checker\n\nWe used [SymSpell](https://github.com/wolfgarbe/SymSpell) for error correction. The dictionary consists of 500k most frequent words from the UberText corpus.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbonysmoke%2Fspeliuk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbonysmoke%2Fspeliuk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbonysmoke%2Fspeliuk/lists"}