Giter Club home page Giter Club logo

reaction-maps's Introduction

Reaction Maps with n-gram matching

XKCD 2260 - Reaction Maps

© Randall Monroe, 2020

Reaction maps, AKA homophones with North American cities. This version uses 3 phonemes at the ends of city names (from Geofabrik's version of the OSM North American places dataset) to reconstruct sentences that sound similar.

Use it here! maps.lam.io

The method is simple, and I've attempted to justify it in this post from some statistics that I encountered.

On the live site, the following is used:

  1. A 3M-place subset of the US.zip Geonames Gazetteer dataset 200K place names from the OSM North America dataset were converted to phonemes. The names were first split into words and compared against the CMU Pronouncing Dictionary; missing entries were transcribed using CMU g2p-seq2seq.
  2. Phoneme-to-phoneme similarity came from Stefan Frisch's 1996 doctoral thesis: SIMILARITY AND FREQUENCY IN PHONOLOGY. Vowels matching was guessed by myself. See the original matrix on page 40 of Frisch's thesis and the one used here at M.csv.
  3. The database encodes the relationships between:
    • Places pl and their terminal 3-grams ng3 (and the ngram's phonemes ph),
    • The top 40 similar ng3 for each ng3 via ng_ng_w
    • Between dictionary words dict and their phonemes dict_ph.

The full SQL database can be found here, on Google Drive with the table of place names pl under the same license as the OSM: the Open Data Commons Open Database License (ODbL).

The server uses expressjs to serve pages. First, you must have a database config file at ./pg.js that defines a node-postgres connection pool. Supposing you installed into database reaction_maps, for a postgres user postgres with password postgres, this will work:

const { Pool } = require('pg');
module.exports = {
	pool: (new Pool({
		host: 'localhost',
		user: 'reaction_maps',
		database: 'postgres',
		database: 'postgres'
	}))
};

To launch, run node server.js. To build, run npx webpack. The site pulls from the OSM public tileserver at the moment, so don't go too crazy.

reaction-maps's People

Contributors

acrylic-origami avatar

Stargazers

Abhijit Hota avatar Jonathan avatar  avatar BK avatar Leonardo avatar

Watchers

James Cloos avatar  avatar

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.