Skip to main content

Ai solution for Luhmann's Zettelkasten

Project description

ZmsAi

Development Status py3.8 GPLv3

Say Thanks Black

A command line utility for topic discovery and doc-linking within the Zettelkasten using AI approaches.

Installation

Install zmsai by executing the following command-

$ pip3 install zmsai

Test Run

Test run using dummy docs (see ./custom)

$ zmsai test

Usage

To learn n topics in your Zettelkasten at /path/to/your/zettelkasten/-

$ zmsai run -t n -p "/path/to/your/zettelkasten/"

This will create a metadata file meta.zms storing all the distributions exhibited by the documents in your Zettelkasten.

[Running the model] it may take a while. Hang tight!
[Data stored] ... kb

You can delete your metadata file by executing-

$ zmsai delete

These learnt distributions can be printed using zmsai display. You can pass an additional argument -w, the number of top most occuring words that you want to print from the distributions involing words.

To display doc-topic distribution-

$ zmsai display -d dt

To display topic-word distribution-

$ zmsai display -w n -d tw

To display doc-word distribution-

$ zmsai display -w n -d dw

To display vocabulary-

$ zmsai display -w n -d voc

To display all distributions at once-

$ zmsai display -w n -d all

or simply

$ zmsai display

This will take default value of 5 for nwords argument.

Troubleshooting

If you get ModuleNotFoundError: No module named 'sklearn' error with display, try installing scikit-learn manually.

$ sudo pip3 install -U scikit-learn

Alternatively, if you're on ubuntu, try executing the following command-

$ zmsai fix-ubuntu

Feel free to raise an issue if you feel stuck.

Manual

usage: zmsai [-h] [--path [PATH]] [--topics [TOPICS]] [--nwords [NWORDS]] [--distro [DISTRO]] [task]

positional arguments:
  task                  Provide task to perform [default : 'run'] [values : 'run', 'delete', 'display', 'man', 'test', 'fix-ubuntu']

optional arguments:
  -h, --help            show this help message and exit
  --path [PATH], -p [PATH]
                        Provide directory of text files. [with : 'run'] [default : './custom']
  --topics [TOPICS], -t [TOPICS]
                        How many topics do you expect? [with : 'run'] [default : 'number of docs']
  --nwords [NWORDS], -w [NWORDS]
                        How many words per topic/doc do you want to display? [with : 'display'] [default : 5]
  --distro [DISTRO], -d [DISTRO]
                        What distributions do you want to display? [with : 'display'] [default : all] [values : 'dt', 'tw', 'dw', 'voc', 'all']

Dependency Graph

attrs==20.2.0
  - pytest==6.1.1 [requires: attrs>=17.4.0]
iniconfig==1.1.1
  - pytest==6.1.1 [requires: iniconfig]
joblib==0.17.0
  - scikit-learn==0.23.2 [requires: joblib>=0.11]
    - sklearn==0.0 [requires: scikit-learn]
numpy==1.19.2
  - scikit-learn==0.23.2 [requires: numpy>=1.13.3]
    - sklearn==0.0 [requires: scikit-learn]
  - scipy==1.5.3 [requires: numpy>=1.14.5]
    - scikit-learn==0.23.2 [requires: scipy>=0.19.1]
      - sklearn==0.0 [requires: scikit-learn]
pip==20.1.1
pluggy==0.13.1
  - pytest==6.1.1 [requires: pluggy>=0.12,<1.0]
py==1.9.0
  - pytest==6.1.1 [requires: py>=1.8.2]
pyparsing==2.4.7
  - packaging==20.4 [requires: pyparsing>=2.0.2]
    - pytest==6.1.1 [requires: packaging]
setuptools==46.4.0
six==1.15.0
  - packaging==20.4 [requires: six]
    - pytest==6.1.1 [requires: packaging]
threadpoolctl==2.1.0
  - scikit-learn==0.23.2 [requires: threadpoolctl>=2.0.0]
    - sklearn==0.0 [requires: scikit-learn]
toml==0.10.1
  - pytest==6.1.1 [requires: toml]
wheel==0.34.2

Contribution

Are welcome.

License

GNU General Public License v3 (GPLv3)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zmsai-0.1.5.tar.gz (6.1 kB view hashes)

Uploaded Source

Built Distribution

zmsai-0.1.5-py3-none-any.whl (19.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page