polyglot3 2026.10.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- polyglot3-2026.10.1/AUTHORS.md +28 -0
- polyglot3-2026.10.1/CONTRIBUTING.md +44 -0
- polyglot3-2026.10.1/HISTORY.md +57 -0
- polyglot3-2026.10.1/LICENSE +680 -0
- polyglot3-2026.10.1/MANIFEST.in +6 -0
- polyglot3-2026.10.1/Makefile +47 -0
- polyglot3-2026.10.1/PKG-INFO +258 -0
- polyglot3-2026.10.1/README.md +222 -0
- polyglot3-2026.10.1/docs/CLI.md +113 -0
- polyglot3-2026.10.1/docs/Concurrency.md +86 -0
- polyglot3-2026.10.1/docs/Detection.md +111 -0
- polyglot3-2026.10.1/docs/Dev.md +138 -0
- polyglot3-2026.10.1/docs/Download.md +88 -0
- polyglot3-2026.10.1/docs/Embeddings.md +121 -0
- polyglot3-2026.10.1/docs/Installation.md +65 -0
- polyglot3-2026.10.1/docs/Makefile +177 -0
- polyglot3-2026.10.1/docs/NamedEntityRecognition.md +89 -0
- polyglot3-2026.10.1/docs/POS.md +86 -0
- polyglot3-2026.10.1/docs/README.md +222 -0
- polyglot3-2026.10.1/docs/Sentiment.md +105 -0
- polyglot3-2026.10.1/docs/Tokenization.md +100 -0
- polyglot3-2026.10.1/docs/api.md +107 -0
- polyglot3-2026.10.1/docs/authors.md +2 -0
- polyglot3-2026.10.1/docs/conf.py +36 -0
- polyglot3-2026.10.1/docs/contributing.md +3 -0
- polyglot3-2026.10.1/docs/history.md +2 -0
- polyglot3-2026.10.1/docs/index.md +23 -0
- polyglot3-2026.10.1/docs/make.bat +242 -0
- polyglot3-2026.10.1/docs/requirements.txt +3 -0
- polyglot3-2026.10.1/polyglot3/__init__.py +22 -0
- polyglot3-2026.10.1/polyglot3/__main__.py +321 -0
- polyglot3-2026.10.1/polyglot3/base.py +210 -0
- polyglot3-2026.10.1/polyglot3/decorators.py +44 -0
- polyglot3-2026.10.1/polyglot3/detect/__init__.py +3 -0
- polyglot3-2026.10.1/polyglot3/detect/base.py +140 -0
- polyglot3-2026.10.1/polyglot3/detect/langids.py +227 -0
- polyglot3-2026.10.1/polyglot3/downloader.py +1399 -0
- polyglot3-2026.10.1/polyglot3/load.py +122 -0
- polyglot3-2026.10.1/polyglot3/mapping/__init__.py +12 -0
- polyglot3-2026.10.1/polyglot3/mapping/base.py +238 -0
- polyglot3-2026.10.1/polyglot3/mapping/embeddings.py +327 -0
- polyglot3-2026.10.1/polyglot3/mapping/expansion.py +101 -0
- polyglot3-2026.10.1/polyglot3/mapping/tests/__init__.py +0 -0
- polyglot3-2026.10.1/polyglot3/mapping/tests/test_embeddings.py +79 -0
- polyglot3-2026.10.1/polyglot3/mapping/tests/test_expansion.py +95 -0
- polyglot3-2026.10.1/polyglot3/mixins.py +166 -0
- polyglot3-2026.10.1/polyglot3/tag/__init__.py +17 -0
- polyglot3-2026.10.1/polyglot3/tag/base.py +219 -0
- polyglot3-2026.10.1/polyglot3/tag/tests/__init__.py +0 -0
- polyglot3-2026.10.1/polyglot3/tests/__init__.py +1 -0
- polyglot3-2026.10.1/polyglot3/tests/test_utils.py +25 -0
- polyglot3-2026.10.1/polyglot3/text.py +483 -0
- polyglot3-2026.10.1/polyglot3/tokenize/__init__.py +6 -0
- polyglot3-2026.10.1/polyglot3/tokenize/_tables.py +13461 -0
- polyglot3-2026.10.1/polyglot3/tokenize/base.py +40 -0
- polyglot3-2026.10.1/polyglot3/tokenize/breakiter.py +445 -0
- polyglot3-2026.10.1/polyglot3/tokenize/data/LICENSE-ICU +568 -0
- polyglot3-2026.10.1/polyglot3/tokenize/data/thaidict.txt.gz +0 -0
- polyglot3-2026.10.1/polyglot3/tokenize/tests/__init__.py +0 -0
- polyglot3-2026.10.1/polyglot3/tokenize/tests/test_base.py +86 -0
- polyglot3-2026.10.1/polyglot3/utils.py +44 -0
- polyglot3-2026.10.1/polyglot3.egg-info/PKG-INFO +258 -0
- polyglot3-2026.10.1/polyglot3.egg-info/SOURCES.txt +150 -0
- polyglot3-2026.10.1/polyglot3.egg-info/dependency_links.txt +1 -0
- polyglot3-2026.10.1/polyglot3.egg-info/entry_points.txt +2 -0
- polyglot3-2026.10.1/polyglot3.egg-info/requires.txt +5 -0
- polyglot3-2026.10.1/polyglot3.egg-info/top_level.txt +1 -0
- polyglot3-2026.10.1/pyproject.toml +76 -0
- polyglot3-2026.10.1/setup.cfg +4 -0
- polyglot3-2026.10.1/tests/__init__.py +1 -0
- polyglot3-2026.10.1/tests/fixtures/corpus/ar.jsonl +24 -0
- polyglot3-2026.10.1/tests/fixtures/corpus/bg.jsonl +24 -0
- polyglot3-2026.10.1/tests/fixtures/corpus/cs.jsonl +24 -0
- polyglot3-2026.10.1/tests/fixtures/corpus/edge_cases.jsonl +36 -0
- polyglot3-2026.10.1/tests/fixtures/corpus/et.jsonl +24 -0
- polyglot3-2026.10.1/tests/fixtures/corpus/fa.jsonl +24 -0
- polyglot3-2026.10.1/tests/fixtures/corpus/ga.jsonl +24 -0
- polyglot3-2026.10.1/tests/fixtures/corpus/he.jsonl +24 -0
- polyglot3-2026.10.1/tests/fixtures/corpus/hi.jsonl +24 -0
- polyglot3-2026.10.1/tests/fixtures/corpus/hr.jsonl +24 -0
- polyglot3-2026.10.1/tests/fixtures/corpus/hu.jsonl +24 -0
- polyglot3-2026.10.1/tests/fixtures/corpus/id.jsonl +24 -0
- polyglot3-2026.10.1/tests/fixtures/corpus/lv.jsonl +24 -0
- polyglot3-2026.10.1/tests/fixtures/corpus/ms.jsonl +24 -0
- polyglot3-2026.10.1/tests/fixtures/corpus/no.jsonl +24 -0
- polyglot3-2026.10.1/tests/fixtures/corpus/sk.jsonl +24 -0
- polyglot3-2026.10.1/tests/fixtures/corpus/sl.jsonl +24 -0
- polyglot3-2026.10.1/tests/fixtures/corpus/sr.jsonl +24 -0
- polyglot3-2026.10.1/tests/fixtures/corpus/th.jsonl +48 -0
- polyglot3-2026.10.1/tests/fixtures/corpus/tr.jsonl +24 -0
- polyglot3-2026.10.1/tests/fixtures/corpus/uk.jsonl +24 -0
- polyglot3-2026.10.1/tests/fixtures/corpus/vi.jsonl +24 -0
- polyglot3-2026.10.1/tests/fixtures/golden/ar.jsonl +24 -0
- polyglot3-2026.10.1/tests/fixtures/golden/bg.jsonl +24 -0
- polyglot3-2026.10.1/tests/fixtures/golden/cs.jsonl +24 -0
- polyglot3-2026.10.1/tests/fixtures/golden/edge_cases.jsonl +36 -0
- polyglot3-2026.10.1/tests/fixtures/golden/et.jsonl +24 -0
- polyglot3-2026.10.1/tests/fixtures/golden/fa.jsonl +24 -0
- polyglot3-2026.10.1/tests/fixtures/golden/ga.jsonl +24 -0
- polyglot3-2026.10.1/tests/fixtures/golden/he.jsonl +24 -0
- polyglot3-2026.10.1/tests/fixtures/golden/hi.jsonl +24 -0
- polyglot3-2026.10.1/tests/fixtures/golden/hr.jsonl +24 -0
- polyglot3-2026.10.1/tests/fixtures/golden/hu.jsonl +24 -0
- polyglot3-2026.10.1/tests/fixtures/golden/id.jsonl +24 -0
- polyglot3-2026.10.1/tests/fixtures/golden/lv.jsonl +24 -0
- polyglot3-2026.10.1/tests/fixtures/golden/ms.jsonl +24 -0
- polyglot3-2026.10.1/tests/fixtures/golden/no.jsonl +24 -0
- polyglot3-2026.10.1/tests/fixtures/golden/sk.jsonl +24 -0
- polyglot3-2026.10.1/tests/fixtures/golden/sl.jsonl +24 -0
- polyglot3-2026.10.1/tests/fixtures/golden/sr.jsonl +24 -0
- polyglot3-2026.10.1/tests/fixtures/golden/th.jsonl +48 -0
- polyglot3-2026.10.1/tests/fixtures/golden/tr.jsonl +24 -0
- polyglot3-2026.10.1/tests/fixtures/golden/uk.jsonl +24 -0
- polyglot3-2026.10.1/tests/fixtures/golden/vi.jsonl +24 -0
- polyglot3-2026.10.1/tests/fixtures/segmentation/META.json +5 -0
- polyglot3-2026.10.1/tests/fixtures/segmentation/ar.jsonl +24 -0
- polyglot3-2026.10.1/tests/fixtures/segmentation/bg.jsonl +24 -0
- polyglot3-2026.10.1/tests/fixtures/segmentation/cs.jsonl +24 -0
- polyglot3-2026.10.1/tests/fixtures/segmentation/edge_cases.jsonl +36 -0
- polyglot3-2026.10.1/tests/fixtures/segmentation/et.jsonl +24 -0
- polyglot3-2026.10.1/tests/fixtures/segmentation/fa.jsonl +24 -0
- polyglot3-2026.10.1/tests/fixtures/segmentation/ga.jsonl +24 -0
- polyglot3-2026.10.1/tests/fixtures/segmentation/he.jsonl +24 -0
- polyglot3-2026.10.1/tests/fixtures/segmentation/hi.jsonl +24 -0
- polyglot3-2026.10.1/tests/fixtures/segmentation/hr.jsonl +24 -0
- polyglot3-2026.10.1/tests/fixtures/segmentation/hu.jsonl +24 -0
- polyglot3-2026.10.1/tests/fixtures/segmentation/id.jsonl +24 -0
- polyglot3-2026.10.1/tests/fixtures/segmentation/lv.jsonl +24 -0
- polyglot3-2026.10.1/tests/fixtures/segmentation/ms.jsonl +24 -0
- polyglot3-2026.10.1/tests/fixtures/segmentation/no.jsonl +24 -0
- polyglot3-2026.10.1/tests/fixtures/segmentation/sk.jsonl +24 -0
- polyglot3-2026.10.1/tests/fixtures/segmentation/sl.jsonl +24 -0
- polyglot3-2026.10.1/tests/fixtures/segmentation/sr.jsonl +24 -0
- polyglot3-2026.10.1/tests/fixtures/segmentation/th.jsonl +48 -0
- polyglot3-2026.10.1/tests/fixtures/segmentation/tr.jsonl +24 -0
- polyglot3-2026.10.1/tests/fixtures/segmentation/uk.jsonl +24 -0
- polyglot3-2026.10.1/tests/fixtures/segmentation/vi.jsonl +24 -0
- polyglot3-2026.10.1/tests/test_detect.py +81 -0
- polyglot3-2026.10.1/tests/test_downloader.py +95 -0
- polyglot3-2026.10.1/tests/test_entity_sentiment.py +33 -0
- polyglot3-2026.10.1/tests/test_golden.py +50 -0
- polyglot3-2026.10.1/tests/test_segmentation.py +34 -0
- polyglot3-2026.10.1/tests/test_threading.py +69 -0
- polyglot3-2026.10.1/tools/data/build_index.py +50 -0
- polyglot3-2026.10.1/tools/data/upload_to_hf.py +48 -0
- polyglot3-2026.10.1/tools/fixtures/fetch_corpus.py +103 -0
- polyglot3-2026.10.1/tools/fixtures/gen_golden.py +103 -0
- polyglot3-2026.10.1/tools/fixtures/gen_icu_fixtures.py +76 -0
- polyglot3-2026.10.1/tools/icu_port/build_tables.py +573 -0
- polyglot3-2026.10.1/tools/icu_port/fuzz.py +99 -0
- polyglot3-2026.10.1/tools/icu_port/rules/sent.txt +83 -0
- polyglot3-2026.10.1/tools/icu_port/rules/word.txt +172 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Credits
|
|
2
|
+
|
|
3
|
+
## polyglot3
|
|
4
|
+
|
|
5
|
+
polyglot3 is maintained by **Dcipher Analytics AB** (<info@dcipheranalytics.com>).
|
|
6
|
+
|
|
7
|
+
This repository has been updated by the Dcipher Analytics dev team with help
|
|
8
|
+
from Claude Opus.
|
|
9
|
+
|
|
10
|
+
## polyglot
|
|
11
|
+
|
|
12
|
+
Many thanks to the authors of the original
|
|
13
|
+
[polyglot](https://github.com/aboSamoor/polyglot), created at the Data
|
|
14
|
+
Science Lab, Stony Brook University, on which polyglot3 is built:
|
|
15
|
+
|
|
16
|
+
- Rami Al-Rfou <rmyeid@gmail.com> (development lead)
|
|
17
|
+
- Yingtao Tian <yittian@cs.stonybrook.edu>
|
|
18
|
+
- All contributors to https://github.com/aboSamoor/polyglot
|
|
19
|
+
|
|
20
|
+
The models come from the research of Rami Al-Rfou, Bryan Perozzi, Vivek
|
|
21
|
+
Kulkarni, Yanqing Chen and Steven Skiena; see the README for citations.
|
|
22
|
+
|
|
23
|
+
## Third-party data
|
|
24
|
+
|
|
25
|
+
- Tokenization tables and the Thai dictionary are derived from ICU
|
|
26
|
+
(Unicode License V3, `polyglot3/tokenize/data/LICENSE-ICU`).
|
|
27
|
+
- Language detection uses fastText's `lid.176` model through
|
|
28
|
+
fasttext-langdetect.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
Contributions are welcome. Report bugs and propose features at
|
|
4
|
+
https://github.com/dcipheranalytics/polyglot3/issues. For bugs, include your
|
|
5
|
+
operating system, Python version, polyglot3 version and the steps to
|
|
6
|
+
reproduce.
|
|
7
|
+
|
|
8
|
+
## Development setup
|
|
9
|
+
|
|
10
|
+
1. Fork and clone the repository:
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
git clone git@github.com:your_name_here/polyglot3.git
|
|
14
|
+
cd polyglot3
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
2. Install it in a virtual environment in editable mode:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
python -m venv .venv && source .venv/bin/activate
|
|
21
|
+
pip install -e ".[test]" ruff
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
3. Create a branch, make your changes, then run the checks:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
ruff format .
|
|
28
|
+
ruff check polyglot3 tests tools
|
|
29
|
+
python -m pytest
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Tests that need models skip themselves unless the models are installed
|
|
33
|
+
(see the [developer guide](docs/Dev.md)).
|
|
34
|
+
|
|
35
|
+
4. Push your branch and open a pull request.
|
|
36
|
+
|
|
37
|
+
## Pull request guidelines
|
|
38
|
+
|
|
39
|
+
1. Include tests for bug fixes and new features.
|
|
40
|
+
2. Update the documentation in `docs/` when behaviour changes.
|
|
41
|
+
3. The tests must pass on Python 3.9 to 3.13 on Linux, macOS and Windows;
|
|
42
|
+
GitHub Actions runs them for every pull request.
|
|
43
|
+
4. Tokenization must stay identical to ICU's (see the
|
|
44
|
+
[developer guide](docs/Dev.md)); the NER and POS models depend on it.
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# History
|
|
2
|
+
|
|
3
|
+
## 2026.10.1 (2026-10-22)
|
|
4
|
+
|
|
5
|
+
First release as **polyglot3**, by Dcipher Analytics AB.
|
|
6
|
+
|
|
7
|
+
- The package is now imported as `polyglot3` (`from polyglot3.text import Text`)
|
|
8
|
+
and the command is `polyglot3`, so it can be installed next to the original
|
|
9
|
+
`polyglot`. Models, `polyglot_data/` and the `POLYGLOT_*` environment
|
|
10
|
+
variables are unchanged.
|
|
11
|
+
- Python 3.9 to 3.13 only; Python 2 support and `six` removed.
|
|
12
|
+
- Removed the PyICU dependency: word and sentence segmentation use a
|
|
13
|
+
pure-Python port of ICU 78.3's break iterators (including the Thai
|
|
14
|
+
dictionary engine) that reproduces ICU's boundaries.
|
|
15
|
+
- Removed the pycld2 dependency: language detection uses fastText's
|
|
16
|
+
`lid.176` model via fasttext-langdetect. Hebrew is now `he`, not `iw`.
|
|
17
|
+
- Models are downloaded from a new server (Hugging Face) with checksum
|
|
18
|
+
verification; `POLYGLOT_DATA_URL` selects a mirror.
|
|
19
|
+
- Packaging with `pyproject.toml`.
|
|
20
|
+
- Thread-safe: models are loaded once per process even when several threads
|
|
21
|
+
need them at the same time. See the Threads and Concurrency page.
|
|
22
|
+
- Removed morphological analysis and transliteration (models unavailable)
|
|
23
|
+
and the TextBlob leftovers `correct()`, `tokenize()` and `np_counts` (they
|
|
24
|
+
always raised errors).
|
|
25
|
+
- Bug fixes: garbled tokens after emoji and other non-BMP characters; the
|
|
26
|
+
`sentiment` subcommand did nothing; entity sentiment only used the first
|
|
27
|
+
polar word; `Embedding.normalize_words()` failed on expanded vocabularies;
|
|
28
|
+
`Downloader.status()` returned `None` for a custom download directory;
|
|
29
|
+
`Downloader.supported_language()` crashed; the CLI closed stdin repeatedly
|
|
30
|
+
on Python 3.13.
|
|
31
|
+
|
|
32
|
+
## polyglot 16.07.04 (2016-07-03)
|
|
33
|
+
|
|
34
|
+
- New features:
|
|
35
|
+
- Support Transfer POS Tagging.
|
|
36
|
+
- Support supplying `hint_language_code` for `Text`.
|
|
37
|
+
- Bug fixes:
|
|
38
|
+
- Improve sentence serialization (PR #34)
|
|
39
|
+
- Fix rare unicode encode error (PR #35)
|
|
40
|
+
- Fix transliteration from languages other than English (PR #46)
|
|
41
|
+
- Add link to Github in README (PR #49)
|
|
42
|
+
- Make handling of paths more coherent (PR #55)
|
|
43
|
+
- Fix normalizing embedding in place for NER corrupts the features of POS
|
|
44
|
+
(issue #60, PR #62)
|
|
45
|
+
|
|
46
|
+
## polyglot 15.10.03 (2015-10-03)
|
|
47
|
+
|
|
48
|
+
- Change the polyglot models mirror to Stony Brook University DSL lab instead
|
|
49
|
+
of Google cloud storage.
|
|
50
|
+
|
|
51
|
+
## polyglot 15.5.2 (2015-05-02)
|
|
52
|
+
|
|
53
|
+
- Polyglot is feature complete.
|
|
54
|
+
|
|
55
|
+
## polyglot 14.11 (2014-01-11)
|
|
56
|
+
|
|
57
|
+
- First release on PyPI.
|