Matt's Ollama Tools
I needed some simple tools to make it easier to work with integrating Ollama with the real world. This is a collection of those tools.
Chunker
Sometimes you need to take a bunch of text in and then spit it out in an array of chunks. This will take in a long text and then split it into chunks of up to a defined number of words. It won't ever get sentence fragments. It will overlap each chunk by one sentence. If you have a text with a bunch of poorly written run-on sentences, this might not work.
Usage
from mattsollamatools import chunker
textchunks = chunker(text, max_words_per_chunk=110, language='spanish')
If you don't include max_words_per_chunk, it will default to 100. If you don't include language, it will default to 'english'.
Release files for mattsollamatools 0.0.25
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| mattsollamatools-0.0.25.tar.gz | 3.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mattsollamatools-0.0.25-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 6.8 kB
Release files / mattsollamatools-0.0.25.tar.gz
| Download URL | mattsollamatools-0.0.25.tar.gz |
|---|---|
| Size | 3.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9b46af73c52eb3d1656c651423ebd11da5aadce148f2931b882edb6c0031f774
|
|
BLAKE2b-256 checksum How to use checksums |
8ddf483b56638c619b140e00102ee794869ebf858405fc46062de06c99e01e10
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/4.0.2 CPython/3.11.9
|
Release files / mattsollamatools-0.0.25-py3-none-any.whl
| Download URL | mattsollamatools-0.0.25-py3-none-any.whl |
|---|---|
| Size | 3.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a6d32eb65217006faff58591b4187c086047f3ade998b0539d0b6807b7b13533
|
|
BLAKE2b-256 checksum How to use checksums |
2ba736590304bee11ef4fa64f2c36b49f857a633751fe7622e0af8dfa1aa0ce8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/4.0.2 CPython/3.11.9
|