Giter Site home page Giter Site logo

sastocks's Introduction

Readme File: Stock Market Sentiment Analysis Script using Polygon.io and OPEN.ai CHAT-GPT 3.5-Turbo

Application Functional Summary

config.py: This script sets up the configuration for the project, including environment variables for the OpenAI and Polygon API keys, and the names of the SQLite database and the CSV file containing the stock tickers.

database.py: This script is used to interact with a SQLite database. It includes a Database class with methods for saving and retrieving articles and sentiment scores.

api.py: This script fetches stock tickers from a CSV file and retrieves news related to those tickers from the Polygon.io API.

sentiment_analysis.py: This script performs sentiment analysis on the news articles fetched by the api.py script. It uses either the VADER sentiment analysis tool from NLTK or the OpenAI API to analyze the sentiment of the articles.

These scripts work together to fetch news related to a list of stock tickers, perform sentiment analysis on these news articles, and store both the articles and the sentiment scores in a SQLite database. The sentiment analysis can be performed by either NLTK's VADER or OpenAI's GPT-3.5-turbo, depending on the requirements of the task. Configuration for the project, such as API keys and filenames, is managed by the config.py script.

Required or Suggested Programs Python 3.6 or higher is required to run this application. You'll also need several Python libraries, including pandas, nltk, requests, sqlite3, openai, and retrying. You can install these libraries using pip:

Copy code pip install pandas nltk requests sqlite3 openai retrying API Keys and Websites You'll need API keys for the following services:

OpenAI: You can get an API key by creating an account on the OpenAI website (https://www.openai.com/). The cost is $20 per month plus additional charges based on usage - You pay per token using the gpt-3.5-turbo rates (subject to change, check open.ai)

Polygon.io: You can get an API key by creating an account on the Polygon.io website (https://polygon.io/). The cost is $30 per month.

Areas for Improvement Code is currently being optimized - thanks to all involved Model can be tuned with additional inputs and prompt clarification Offline model to be generated Gpt-4 analysis to be considered Further improvements TBD - You are welcome to contribute!

Remember to always keep your API keys secure and never share them publicly.

sastocks's People

Contributors

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