Git Product home page Git Product logo

usa_presidential_vocab's Introduction

USA_Presidential_Vocab

##Getting Started: Must Install the following Libraries on python:

  • Flask
  • Selenuim
  • Genism
  • NLTK
  • Collections
  • Spacy

Presidential Vocabulary

presidentialVocab.py

A Python script that finds the most similar words to a given word based on all the speeches made by U.S. presidents. It preprocesses speeches using the process_speeches() and merge_speeches() functions from president_helper.py. The findMostSimilar() function uses the gensim library to create a Word2Vec model of the speeches and returns a list of the most similar words to the input word.

president_helper.py

A module with helper functions used by presidentialVocab.py. Functions include read_file(), process_speeches(), merge_speeches(), get_president_sentences(), get_presidents_sentences(), and most_frequent_words().

GatherData.py

A Python script that uses Selenium to scrape transcripts of speeches by US presidents from the Miller Center website. It appends the text to separate files in directories named after the corresponding president. The data will be returned in the presidents file.

webpage.py

A Flask web application that allows users to search for the most similar words to a given word in the speeches of selected U.S. presidents. It calls functions from presidentialVocab.py and president_helper.py to find and display the results. The run() function from GatherData.py is called to gather data required by the Flask app (presidents name).

Note: If run() takes a long time to execute, it may delay the startup of the Flask app. Consider running it in a separate process or thread or finding a way to pre-cache the data it generates.

usa_presidential_vocab's People

Contributors

ahmedmoamen1 avatar

Watchers

 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.