Code Monkey home page Code Monkey logo

word-analogizer's Introduction

Word Analogizer

Paris is to France as Berlin is to ?

Car is to road as train is to ?

King is to queen as husband is to ?

These all seem like really easy analogies, and they are for humans, at least. For machines, not so much. That's why I tried creating a little program capable of taking advantage of word vectorization and Wikipedia's entire corpus to predict the answer to analogies like those above!

This program has around a 19% accuracy rate, which might seem terrible but hear me out: the algorithm is not choosing from a pool of words (like multiple choice); it's actually supplying its own output (like short answer on tests). From past experience, I can say randomly guessing on short answers does NOT give correct solutions 1/5 of the time.

How to have fun with Word Analogizer

  1. Make sure your machine is using Python 3!!!
  2. Clone this repo
  3. Download pip
  4. Navigate to the word-analogizer folder and type pip install -r requirements.txt
  5. Run runme.py
  6. Follow the instructions from Terminal and have fun!

Important note: using the default values, it will take around a minute for the algorithm to train on the Wikipedia dataset. Please be patient, and do not mess with the command line until it prompts you for an analogy to solve.

word-analogizer's People

Contributors

jiroger avatar

Watchers

James Cloos avatar  avatar

Forkers

bopopescu

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.