fast-scores
Calculate correlatioin matrix fast
Preinstall fasttext
pip install fasttext
For Windows without a C/C++ compiler:
- Download a proper whl (e.g.,
fasttext‑0.9.2‑cp36‑cp36m‑win_amd64.whlfor 64bits Python 3.6 etc) from https://www.lfd.uci.edu/~gohlke/pythonlibs/#fasttext
pip install fasttext*.whl
or (for python 3.8)
pip install https://github.com/ffreemt/ezbee/raw/main/data/artifects/fasttext-0.9.2-cp38-cp38-win_amd64.whl
Installation
pip install fast-scores
Usage
# from fast-scores\tests\test_gen_cmat.py
from fast_scores.gen_cmat import gen_cmat
text_en = "test this\nbla bla\n love"
text_zh = "测试\n 爱\n吃了吗\n你好啊"
list1 = [elm.strip() for elm in text_en.splitlines() if elm.strip()]
list2 = [elm.strip() for elm in text_zh.splitlines() if elm.strip()]
cmat = gen_cmat(list1, list2) # len(list2) x len(list1)
print(cmat)
# [[0.75273851 0. 0. ]
# [0. 0. 0.86848247]
# [0. 0. 0. ]
# [0. 0. 0. ]]
len_y, len_x = cmat.shape
assert cmat.max() > 0.86 # 0.868
_ = divmod(cmat.argmax(), len_x)
assert cmat[_] == cmat.max()
Metadata
Release files for fast-scores 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| fast_scores-0.1.4.tar.gz | 1.2 MB | Without provenance | Details for fast_scores-0.1.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| fast_scores-0.1.4-py3-none-any.whl | Python 3 | none | any | Details for fast_scores-0.1.4-py3-none-any.whl |
Total release size: 2.4 MB
Release files / fast_scores-0.1.4.tar.gz
| Download URL | fast_scores-0.1.4.tar.gz |
|---|---|
| Size | 1.2 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5673b31b100a6531c7daae2eae9b38dca42a6c6655996cf2a4c367e2f1edd6a4
|
|
BLAKE2b-256 checksum How to use checksums |
ddf9c5ca7d03bfaa379ec975b49060848d489d7070d3b25fbe9574135899c883
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.7.1 CPython/3.8.10 Windows/10
|
Release files / fast_scores-0.1.4-py3-none-any.whl
| Download URL | fast_scores-0.1.4-py3-none-any.whl |
|---|---|
| Size | 1.2 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ee6dc1a08d8e0dd208922850792b75b9b4a44b91299b6afcd85e55837579c6fa
|
|
BLAKE2b-256 checksum How to use checksums |
1894d317d5702582146625ba9d3be10b795116e635af3f4fe5093bcbdf33a1bc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.7.1 CPython/3.8.10 Windows/10
|
Security for fast-scores 0.1.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.