Skip to main content


UPDATE 05.05.2024:

Due to the changes related with the hosting, it is recommended to update the version of the package to the newest one, using command:

pip install --upgrade speakleash

SpeakLeash is a lightweight library providing datasets for the Polish language and tools to make them useful:

Installation

Speakleash package can be installed from PyPi and has to be installed in a virtual environment:

pip install speakleash

Basic Usage

If you just want to see the details of the datasets:

from speakleash import Speakleash
import os

base_dir = os.path.join(os.path.dirname(__file__))
replicate_to = os.path.join(base_dir, "datasets")

sl = Speakleash(replicate_to)

for d in sl.datasets:
    size_mb = round(d.characters/1024/1024)
    print("Dataset: {0}, size: {1} MB, characters: {2}, documents: {3}".format(d.name, size_mb, d.characters, d.documents))

You can use individual properties (e.g.:characters, documents), but you can display the entire manifest:

sl = Speakleash(replicate_to)
print(sl.get("plwiki").manifest)

If you chose one of them (.get(name of dataset)) then you will get a lot of text data:

from speakleash import Speakleash
import os

base_dir = os.path.join(os.path.dirname(__file__))
replicate_to = os.path.join(base_dir, "datasets")

sl = Speakleash(replicate_to)

wiki = sl.get("plwiki").data
for doc in wiki:
    print(doc[:40])

If you also need meta data then use the ext_data property:

ds = sl.get("plwiki").ext_data
for doc in ds:
    print(doc)
    txt, meta = doc
    print(meta.get("title"))
    print(txt)

Popular meta data:

  • title
  • length
  • sentences
  • words
  • verbs
  • nouns
  • symbols
  • punctuations

Metadata

Release files for speakleash 0.3.51

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for speakleash 0.3.51
File Size Uploaded
speakleash-0.3.51.tar.gz 12.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for speakleash 0.3.51
File Interpreter ABI Platform
speakleash-0.3.51-py3-none-any.whl Python 3 none any Details

Total release size: 27.1 kB

Release files / speakleash-0.3.51.tar.gz

Download URL speakleash-0.3.51.tar.gz
Size 12.5 kB
Tags Source
SHA-256 checksum
How to use checksums
b24bbcb20ade82ae4bc81c42ec6214f40fac6cded6dbd3d9491fecfaa01b1335
BLAKE2b-256 checksum
How to use checksums
bbaf0bf80fcd047e0d0f62843d83b858b74b43defb25bbacb266671a241bd0b6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.9.10

Release files / speakleash-0.3.51-py3-none-any.whl

Download URL speakleash-0.3.51-py3-none-any.whl
Size 14.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2c469f7f2a7466f4807b05b13beb7c34453b82f0556dd1cf7eee23061770beb8
BLAKE2b-256 checksum
How to use checksums
62d7b5891b38e57b89d6abe3d0938599b01adb0a357b6a5472280cef4b503e8d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.9.10

Release history Release notifications | RSS feed

This release

0.3.51 This release

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.2.3

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.11

2 release files

0.0.10

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page