Coder Social home page Coder Social logo

u.s-presidential-speeches's Introduction

U.S-Presidential-Speeches

This is an attempt to analyse text of U.S. President's Speeches from 1790 to 2006 using Word2Vec model in gensim.

  • Data in enclosed here as speech.txt

  • all_speech.txt is the processed version of the speeches such that each line contains one processed speeches

  • data_processed.txt is the text file of json.dumps() containing full metadata from speech.txt in the form of list of dictionaries - 'who' : President's name - 'date' : date of speech (example : January 27, 1984) - 'speech' : Full speech - 'what' :'State of the Union Address'

  • speech.py contains code to process speech.txt

  • w2v_speech.py contains gensim model to learn w2v model of the from speeches. Here I have assumed one speech to constitute one sentence. Speech vector is then calculated by averaging all the word vectors in the speech

  • w2v_tsne.py contains the code to plot 2D version of 100 dimensional speech vectors

  • speech_vectors.npy is numpy vector of all speeches as processed in w2v_tsne.py

  • .png files are respective tsne plots of speech vectors

Here is the t-SNE plot of speech vectors: (labeled version is in the repo. You can download the image to use zoom functionality)

alt tag

Here is the distance matrix between speech. One might need to zoom in order to see year of speech vectors. Effective visualisation tool for zooming is the next project that I am working on. alt tag

u.s-presidential-speeches's People

Watchers

James Cloos avatar Ashok Kumar Pant 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.