# spacy_fastlang
## Install
Assuming you have a working python environment, you can simply install it using
```
pip install spacy_fastlang
```
## Usage
The library exports a pipeline component called `language_detector` that will set two spacy extensions
- doc.\_.language = ISO code of the detected language or `xx` as a fallback
- doc.\_.language_score = confidence
```
import spacy_fastlang # noqa: F401 # pylint: disable=unused-import
nlp = spacy.load("...")
nlp.add_pipe("language_detector")
doc = nlp(en_text)
doc._.language == "..."
doc._.language_score >= ...
```
## Options
[Check the tests](./tests/test_spacy_fastlang.py) to see more examples and available options
## License
Everythin is under `MIT` except the default model which is distributed under [Creative Commons Attribution-Share-Alike License 3.0](https://creativecommons.org/licenses/by-sa/3.0/) by facebook [here](https://fasttext.cc/docs/en/language-identification.html)
Raw data
{
"_id": null,
"home_page": "https://github.com/thomasthiebaud/spacy-fastlang",
"name": "spacy_fastlang",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8,<4.0",
"maintainer_email": "",
"keywords": "spacy,fasttext,language,detection",
"author": "Thomas Thiebaud",
"author_email": "thiebaud.tom@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/d5/b9/845453dbaf261dd4623b30a79038718c554af719ee1afd639675bfbcee18/spacy_fastlang-2.1.0.tar.gz",
"platform": null,
"description": "# spacy_fastlang\n\n## Install\n\nAssuming you have a working python environment, you can simply install it using\n\n```\npip install spacy_fastlang\n```\n\n## Usage\n\nThe library exports a pipeline component called `language_detector` that will set two spacy extensions\n\n- doc.\\_.language = ISO code of the detected language or `xx` as a fallback\n- doc.\\_.language_score = confidence\n\n```\nimport spacy_fastlang # noqa: F401 # pylint: disable=unused-import\nnlp = spacy.load(\"...\")\nnlp.add_pipe(\"language_detector\")\ndoc = nlp(en_text)\n\ndoc._.language == \"...\"\ndoc._.language_score >= ...\n```\n\n## Options\n\n[Check the tests](./tests/test_spacy_fastlang.py) to see more examples and available options\n\n## License\n\nEverythin is under `MIT` except the default model which is distributed under [Creative Commons Attribution-Share-Alike License 3.0](https://creativecommons.org/licenses/by-sa/3.0/) by facebook [here](https://fasttext.cc/docs/en/language-identification.html)\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Language detection using FastText and Spacy",
"version": "2.1.0",
"project_urls": {
"Documentation": "https://github.com/thomasthiebaud/spacy-fastlang",
"Homepage": "https://github.com/thomasthiebaud/spacy-fastlang",
"Repository": "https://github.com/thomasthiebaud/spacy-fastlang"
},
"split_keywords": [
"spacy",
"fasttext",
"language",
"detection"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "63f5ae0e5d30979c4090f12178f31c8fb08f7d43458f48f55233e3cb2b0709a9",
"md5": "cfedcdf5a76eaec549c8d623b00bdc02",
"sha256": "401a5838f7f483ba8efd93ab420317bbc16223fe07a28a9d89747e8bacdbb2d2"
},
"downloads": -1,
"filename": "spacy_fastlang-2.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "cfedcdf5a76eaec549c8d623b00bdc02",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8,<4.0",
"size": 780386,
"upload_time": "2023-12-17T10:53:54",
"upload_time_iso_8601": "2023-12-17T10:53:54.369214Z",
"url": "https://files.pythonhosted.org/packages/63/f5/ae0e5d30979c4090f12178f31c8fb08f7d43458f48f55233e3cb2b0709a9/spacy_fastlang-2.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "d5b9845453dbaf261dd4623b30a79038718c554af719ee1afd639675bfbcee18",
"md5": "d1449e4d2b53ba62249ea682f15667a5",
"sha256": "e10e7056275926211e5453e2e4f7047fec83e1c3c84f50f0a1b9229d33b83801"
},
"downloads": -1,
"filename": "spacy_fastlang-2.1.0.tar.gz",
"has_sig": false,
"md5_digest": "d1449e4d2b53ba62249ea682f15667a5",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8,<4.0",
"size": 782378,
"upload_time": "2023-12-17T10:53:56",
"upload_time_iso_8601": "2023-12-17T10:53:56.303242Z",
"url": "https://files.pythonhosted.org/packages/d5/b9/845453dbaf261dd4623b30a79038718c554af719ee1afd639675bfbcee18/spacy_fastlang-2.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-12-17 10:53:56",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "thomasthiebaud",
"github_project": "spacy-fastlang",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "spacy_fastlang"
}