Giter VIP home page Giter VIP logo

finsent's Introduction

finsent

Extract sentiment from financial news headlines for every US public company


Finsent is a fast and seamless way to collect, classify and visualize sentiment polarity of financial news headlines for every US listed company.

Requirements:

  • requests
  • BeautifulSoup
  • nltk
  • Vader Corpus

Running:

The app uses a series of methods to perform different analysis and classification actions:

1. news_sent: A method that creates a DataFrame of all the headlines for a specific company and a classification of sentiment polarity. Just feed it a ticker and the df will be created:

#We define the ticker (Oracle Corp.):
ticker = 'ORCL'
#And call the method:
headlines_df = finsent(ticker).news_sent()
headlines_df

2. sentiment: A method that returns the aggregated sentiment of a given company:

#We define the ticker (Adobe Inc.):
ticker = 'ADBE'
#And call the method:
sentiment_df = finsent(ticker).sentiment()
sentiment_df

3. get_all_stocks: A method that returns a DataFrame with sentiment polarity scores for a given array of tickers:

#We define a list of tickers:
tickers = ['F','AMD','NVDA','MU','FB','AMZN']

#And call the method:
sentiment_companies = finsent.get_all_stocks(tickers)
sentiment_companies

Output:

The script took circa 2 seconds to capture and classify the sentiment embedded in over 600 key news headlines for a set of 6 companies, providing a convenient and time-efficient solution for a highly time-consuming practice.


Enjoy!

License:

GNU General Public License v3.0

Copyright © 2019 giuetr

finsent's People

Contributors

giuetr avatar

Stargazers

 avatar  avatar  avatar  avatar  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.