Code Monkey home page Code Monkey logo

nngm17's Introduction

The House(s) that ConceptNet Built

This project is a children's book generated by walking through related nouns and verbs in ConceptNet, with illustrations from The Noun Project. The structure is based on the classic nursery rhyme, "The House that Jack built," with quite a few permutations.

The core idea is relatively simple, even though it took me a few weeks of trial and error to implement it: the code builds chains of concepts of whatever length that end in "house". Once I figured out how to generate those chains, I found that 7 chains of 55 concepts each (chapters) would get me over 50,000 words, so then I had to figure out how to illustrate it.

Running it Yourself

If for some reason you want to run this yourself, you'll need quite a few Python modules: I think most are pretty standard, but a few that are not may be requests, textblob, pattern.en, glob, flickrapi, weasyprint, and pycorpora.

You'll also need a file called "credentials" formatted like this:

flickr_key = {yours goes here}
flickr_secret = {yours goes here}
noun_key = {yours goes here}
noun_secret = {yours goes here}

And you'll need these directories for all of the page and pdf generation:

  • pages/
  • icons/
  • images/
  • pdfs/

Finally, this uses Fred Weinhaus's "watercolor" script for ImageMagick to make the illustrations. Put this in the same directory as the Python script.

Samples

The Smaller Sample is 7 chapters with 5 concepts each. It's about 15mb after optimizing it in Adobe Acrobat.

The Complete Version, titled The several houses of Brian, Spencer, Liam, Victoria, Brayden, Vincent, and Alex is 7 chapters with 55 concepts each. It's 800 pages long, but only 23mb after optimization. I generated this on Saturday, December 16 2017, and it took about 1 hour to complete. The main text comes to 49,799, but that doesn't count the chapter titles, front matter, or end credits, so I'm sure it's over 50K all together.

Screenshots

Here are some screenshots.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.