Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Implementation:AI4Finance Foundation FinGPT Market Sentiment Labeler

From Leeroopedia
Knowledge Sources
Domains Data_Preparation, Sentiment_Classification, domain:Trading
Last Updated 2026-10-18 00:00 GMT

Overview

Concrete tool for labeling Chinese A-share news with market-based sentiment derived from post-news stock price movements provided by the FinGPT Sentiment Analysis v1 subproject.

Description

The add_labels module downloads A-share daily price data via FinRL-Meta's Akshare processor (or the `akshare` package directly), merges news timestamps with price movements, and assigns sentiment labels (up/down/neutral) based on the price change after each news event.

Usage

Import this module when you need to create market-labeled sentiment training data from Chinese financial news and A-share price data. Requires FinRL-Meta or akshare.

Code Reference

Source Location

Signature

class Akshare:
    """Data processor for A-share market data via akshare.

    Args:
        provider: data provider name
        start_date: start date string
        end_date: end date string
        time_interval: data granularity
    """
    def download_data(self, code_list, save_path): ...

Import

from data_preparations.add_labels import Akshare

I/O Contract

Inputs

Name Type Required Description
code_list list[str] Yes A-share stock codes (e.g., ["000001", "600519"])
start_date str Yes Start date (YYYY-MM-DD)
end_date str Yes End date (YYYY-MM-DD)
save_path str No Where to save the downloaded price CSV

Outputs

Name Type Description
dataframe pd.DataFrame Daily price data with code column

Usage Examples

Download A-Share Price Data

from data_preparations.add_labels import Akshare

processor = Akshare(
    provider="akshare",
    start_date="2023-01-01",
    end_date="2023-12-31",
    time_interval="daily",
)
processor.download_data(
    code_list=["000001", "600519"],
    save_path="a_share_prices.csv",
)
print(processor.dataframe.head())

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment