Skip to main content

A package for financial sentiment analysis using news articles.

Project description

FinSenti

FinSenti is a comprehensive financial sentiment analysis library designed to help users analyze and interpret sentiment in financial texts.

It uses financial RoBERTa models to provide accurate sentiment analysis for financial news articles.

Features

  • Financial Sentiment Analysis: Analyze sentiment in financial texts using state-of-the-art RoBERTa models.
  • Compound Score Aggregation: Aggregate sentiment scores to provide a comprehensive view of sentiment over time.

Installation

pip install finsenti

Usage

  1. Preprocess your financial text data.
import pandas as pd
from finsenti import finsenti_pipeline
# Input DataFrame df with a 'body' column and a list of tickers
df = pd.DataFrame({'body': ["The stock market is bullish today.", 
                             "Economic downturn expected next quarter.",
                            "Google's new product launch boosts investor confidence."]})
tickers = ['AAPL', 'GOOGL']
df = finsenti_pipeline(tickers=tickers, df=df,text_column='body', gemini_api_key='your_api_key', aggregate=True, aggregation_method='mean')
print(df.info())

Dependencies

  • pandas
  • marketminer
  • python-dotenv
  • google-genai
  • transformers
  • torch
  • hf_xet
  • scipy

License

MIT License. Free to use and modify.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

finsenti-0.1.0.tar.gz (8.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

finsenti-0.1.0-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

Details for the file finsenti-0.1.0.tar.gz.

File metadata

  • Download URL: finsenti-0.1.0.tar.gz
  • Upload date:
  • Size: 8.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for finsenti-0.1.0.tar.gz
Algorithm Hash digest
SHA256 986a09108b5f7bfb5ec219c03ffb9288ae04082d7add20bf8c36e652ae9ffa43
MD5 9087d3744caa7926ad7ce6b2f5a38002
BLAKE2b-256 c5a3477d8436d514139921a38597d70710ae742ac2c0d34a994ca191ea5f7610

See more details on using hashes here.

File details

Details for the file finsenti-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: finsenti-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for finsenti-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6290a8b48125ef75eb2a2cbcb744a4b3a1a02875c822cc8484c484d208e6d6fa
MD5 178f5ef1a1a09b0d210450e198328695
BLAKE2b-256 d1f7831775d9f08972be0ea0fc809a28773360ba09bac3a19ce9154a0b970117

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page