A package for dealing with histograms.
Project description
realtweets: the world's most popular destination for real tweets
kiwi
kiwi is a Python library generating and using histograms of a large corpus.
Installation
Use the package manager pip to install kiwi.
pip install kiwi
Usage
from kiwi.grams import Histogram
# Generate a histogram from a list of sentences
hist = Histogram(['A sentence here.',
'A sentence there.',
'A sentence anywhere.'])
# Generate a histogram from a text file
with open('corpus.txt', 'r') as file:
file_hist = Histogram(file)
# Compare the similarity of two histograms
similarity = hist.similarity(file_hist)
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
License
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
grams-0.0.1.tar.gz
(13.0 kB
view hashes)
Built Distribution
grams-0.0.1-py3-none-any.whl
(31.0 kB
view hashes)