← 返回
未分类 中文

alphaear-sentiment

Analyze finance text sentiment using FinBERT or LLM. Use when the user needs to determine the sentiment (positive/negative/neutral) and score of financial te...
使用FinBERT或LLM分析金融文本情感,判断正面、负面或中性并给出评分。
zhouzhonglu8-png
未分类 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 347
下载
💾 3
安装
1
版本
#latest

概述

AlphaEar Sentiment Skill

Overview

This skill provides sentiment analysis capabilities tailored for financial texts, supporting both FinBERT (local model) and LLM-based analysis modes.

Capabilities

Capabilities

1. Analyze Sentiment (FinBERT / Local)

Use scripts/sentiment_tools.py for high-speed, local sentiment analysis using FinBERT.

Key Methods:

  • analyze_sentiment(text): Get sentiment score and label using localized FinBERT model.
  • Returns: {'score': float, 'label': str, 'reason': str}.
  • Score Range: -1.0 (Negative) to 1.0 (Positive).
  • batch_update_news_sentiment(source, limit): Batch process unanalyzed news in the database (FinBERT only).

2. Analyze Sentiment (LLM / Agentic)

For higher accuracy or reasoning capabilities, YOU (the Agent) should perform the analysis using the Prompt below, calling the LLM directly, and then update the database if necessary.

Sentiment Analysis Prompt

Use this prompt to analyze financial texts if the local tool is insufficient or if reasoning is required.

请分析以下金融/新闻文本的情绪极性。
返回严格的 JSON 格式:
{"score": <float: -1.0到1.0>, "label": "<positive/negative/neutral>", "reason": "<简短理由>"}

文本: {text}

Scoring Guide:

  • Positive (0.1 to 1.0): Optimistic news, profit growth, policy support, etc.
  • Negative (-1.0 to -0.1): Losses, sanctions, price drops, pessimism.
  • Neutral (-0.1 to 0.1): Factual reporting, sideways movement, ambiguous impact.

Helper Methods

  • update_single_news_sentiment(id, score, reason): Use this to save your manual analysis to the database.

Dependencies

  • torch (for FinBERT)
  • transformers (for FinBERT)
  • sqlite3 (built-in)

Ensure DatabaseManager is initialized correctly.

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-05-07 09:35 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

alphaear-predictor

zhouzhonglu8-png
Kronos 市场预测技能,用于金融市场时间序列预测或基于新闻的行情调整。
★ 0 📥 396

alphaear-signal-tracker

zhouzhonglu8-png
跟踪金融投资信号演变并根据最新金融市场信息更新逻辑;用于监控金融信号并判断是否需要调整。
★ 0 📥 333

alphaear-search

zhouzhonglu8-png
执行金融网页搜索和本地上下文搜索。适用于用户需要从网页(Jina/DDG/Baidu)获取一般金融信息或需要检索金融数据。
★ 0 📥 366