Skip to content

hobg0blin/digital_oracle

Repository files navigation

Digital Oracle

A meditation on computer as querent and reader

Digital Oracle is two things: a char-rn-based oracle deck generator and a terminal-based tarot reading script. It uses sentiment analysis on an RNN-generated tarot deck (in JSON format) to determine an action for your computer to take - either running the start command and ‘cherishing’ an existing process, or killing an existing process if the reading is determined to be negative.

You can find a blog post about the process here.

Getting started

To generate your own deck, visit https://brondle.github.io/digital_oracle/. If you want to play with it locally, clone this repo, install http-server

npm i http-server and start it inside the repo.

Then go to localhost:{portnumber}/index.html Once you feel you’ve generated enough cards, you can download them as a JSON file (a warning - after running the generate function about 20 times, it tends to drastically slow down and give bad output, same if you click it a bunch of times at once without waiting for the newest card to be generated). This is pretty easily fixed by just reloading the page.

Running the script

From the root folder, run npm install, then node index_v2.js to initiate a reading. If you’ve generated your own cards, then you’ll want to go into index_v2 and change the data path to reflect your own cards.

Other stuff

If you’re interested, you can follow the same steps above with index_v1.js to do a reading based on cards pulled from a tarot api.

There are a few basic models trained on data from the tarot api if you want to play around with them as well. To train your own, you can follow the ml5 tutorial here.

There’s also a script (deepai_script.js) that was an attempt to pull from deepai’s text2img model. I couldn’t get it to work with their API but you’re welcome to try if you’d like to generate images for your rnn-generated cards.

Sources

The LSTM model is trained (for titles) on the 78 original tarot cards from the Rider-Waite deck, and for descriptions on the texts of A Guide to Tarot Meanings and The Unofficial Wild Unknown Meanings. I’m using ml5’s char-rnn model to generate the cards. Sentiment analysis is done through the npm sentiment module. If I’m missing anything else that deserves credit, please feel free to reach out and let me know. This is extremely open-source and anyone is welcome to steal any and all of my code.

Happy divining!

About

an oracle deck for computers

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published