Tools for working with Ollama
Project description
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'.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for mattsollamatools-0.0.25-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a6d32eb65217006faff58591b4187c086047f3ade998b0539d0b6807b7b13533 |
|
MD5 | 532fdee528d14fca7d64ce0d773d2878 |
|
BLAKE2b-256 | 2ba736590304bee11ef4fa64f2c36b49f857a633751fe7622e0af8dfa1aa0ce8 |