# 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 text markets.

- **Type:** Skill
- **Install:** `agentstack add skill-rkiding-awesome-finance-skills-alphaear-sentiment`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [RKiding](https://agentstack.voostack.com/s/rkiding)
- **Installs:** 0
- **Category:** [AI & ML](https://agentstack.voostack.com/c/ai-and-ml)
- **Latest version:** 0.1.0
- **License:** Apache-2.0
- **Upstream author:** [RKiding](https://github.com/RKiding)
- **Source:** https://github.com/RKiding/Awesome-finance-skills/tree/main/skills/alphaear-sentiment

## Install

```sh
agentstack add skill-rkiding-awesome-finance-skills-alphaear-sentiment
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# 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.

```markdown
请分析以下金融/新闻文本的情绪极性。
返回严格的 JSON 格式:
{"score": , "label": "", "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.

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [RKiding](https://github.com/RKiding)
- **Source:** [RKiding/Awesome-finance-skills](https://github.com/RKiding/Awesome-finance-skills)
- **License:** Apache-2.0

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-rkiding-awesome-finance-skills-alphaear-sentiment
- Seller: https://agentstack.voostack.com/s/rkiding
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
