A module for the characterization and quantification of concise humour
Project description
pyhumour
This is a module for the characterization and quantification of concise humour using 10 distinct computational features. These features were inspired by Ritchie's Incongruity-Resolution Theory, and are formulated as follows:
- Obviousness (
obviousness) - Compatibility (
compatibility) - Inappropriateness (
inappropriateness) - Humorous Conflict (
humorous_conflict) - Non-humorous Conflict (
non_humorous_conflict) - Adjective Absurdity (
adjective_absurdity) - Humorous Noun Absurdity (
humorous_noun_absurdity) - Non-humorous Noun Absurdity (
non_humorous_noun_absurdity) - HMM Probability (
hmm_probability) - N-Gram Probability (
ngram_probability)
Example
import pyhumour
a = pyhumour.PyHumour([<humorous_corpus>], [<non_humorous_corpus>])
a.fit()
a.obviousness('this is an obvious statement')
Installation
Run the following to install:
pip install pyhumour
Usage
Developing pyhumour
To install pyhumour, along with the tools you need to develop and run tests, run the following in your virtualenv:
pip install -e .[dev]
Distributing pyhumour
python setup.py bdist_wheel
python setup.py sdist
Pushing pyhumour (to pypi)
pip install twine
twine upload dist/*
Pushing to testpypi
twine upload --repository testpypi dist/*
Testing in different distributions of python
pip install tox
tox
Unit tests developed with unittest
Running Unit Tests
Use the following command inside of git root directory to run the unit tests:
nosetests -w ./ --with-coverage --cover-html --cover-package=./ --cover-erase --with-timer --timer-top-n 10
A folder called cover will be created in src post running the
command. You can open cover/index.html to view the lines (if any)
that need to be additionally covered in the unit tests.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyhumour-0.1.1.tar.gz.
File metadata
- Download URL: pyhumour-0.1.1.tar.gz
- Upload date:
- Size: 205.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.7.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
599b096d622e08b6b4eadd1d5aee51c5d58ca6f3fd047062cd8d223ed8173a00
|
|
| MD5 |
71e206be268c5f2a78dc0cf113eeebd7
|
|
| BLAKE2b-256 |
4ae08d432ef52751c076d5ac116ef4d98c7fac0faf398a17d3d540c3b391e132
|
File details
Details for the file pyhumour-0.1.1-py3-none-any.whl.
File metadata
- Download URL: pyhumour-0.1.1-py3-none-any.whl
- Upload date:
- Size: 212.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.7.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0e5dd830cba6687af2486cecdc3a5cf09521bd7282cd7edb92b71e80b9a7dd6e
|
|
| MD5 |
997d987774377a2ce5f60733b5c55836
|
|
| BLAKE2b-256 |
80dec025adeaf499bc26692fe7f1b5607a4d9abd7f6d7232afb6a7ee000f40d3
|