AlphaFin  by AlphaFin-proj

Financial analysis framework with RAG

Created 1 year ago
401 stars

Top 72.1% on SourcePulse

GitHubView on GitHub
Project Summary

AlphaFin provides a framework and datasets for financial analysis, specifically targeting stock trend prediction and financial question answering. It aims to mitigate LLM hallucination and real-time data limitations by integrating Retrieval-Augmented Generation (RAG). The project is geared towards researchers and developers in the financial technology space.

How It Works

AlphaFin utilizes a retrieval-augmented approach, referred to as Stock-Chain, to enhance LLM capabilities in financial analysis. This involves fine-tuning LLMs (StockGPT-Stage1 and Stage2) on curated financial datasets, including traditional research data, real-time financial information, and Chain-of-Thought (CoT) data. The RAG integration allows the models to access and incorporate up-to-date information, addressing the common LLM issue of generating outdated or fabricated content.

Quick Start & Requirements

  • Installation: Clone the repository (git clone https://github.com/AlphaFin-proj/AlphaFin.git), navigate into the directory (cd AlphaFin), and install dependencies (pip install -r requirements.txt).
  • Prerequisites: Requires local model checkpoints for ChatGLM2-6B, StockGPT-Stage1/Stage2, and BGE-Large-zh (depending on the stage). A tushare api token is also necessary.
  • Setup: Running the provided bash scripts (scripts/stage1_trend_prediction.sh or scripts/stage2_financial_qa.sh) after configuring API tokens and model paths.
  • Documentation: Links to Hugging Face datasets and models are provided within the README.

Highlighted Details

  • The AlphaFin dataset includes diverse financial data in both English and Chinese, covering NLI, financial QA, stock trend predictions, and more.
  • StockGPT-Stage1 is specialized for stock trend prediction, while StockGPT-Stage2 is more comprehensive for financial Q&A.
  • Stock-Chain demonstrates effectiveness in investment, achieving a 30.8% ARR (Annualized Return Rate).

Maintenance & Community

  • The project is associated with authors Xiang Li, Zhenyu Li, Chen Shi, Yong Xu, Qing Du, Mingkui Tan, Jun Huang, and Wei Lin.
  • A citation is provided for academic use, indicating a research-oriented community.

Licensing & Compatibility

  • The repository content is explicitly for ACADEMIC RESEARCH AND EDUCATIONAL PURPOSE ONLY.
  • Users agree to indemnify, defend, and hold harmless the authors and contributors from any claims or damages. No explicit software license (e.g., MIT, Apache) is mentioned for the code itself, implying a restrictive, non-commercial use case.

Limitations & Caveats

  • The project is strictly for academic research and educational purposes, with a disclaimer against its use for actual financial advice. Users bear all risks associated with its use. The licensing terms appear to prohibit commercial use.
Health Check
Last Commit

1 year ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
33 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.