LocalOptimum commited on
Commit
91f046a
·
verified ·
1 Parent(s): 2fff1d1

v6.0: F1=84.88%, 2208 training samples, geopolitical news classification fixed

Browse files
Files changed (3) hide show
  1. README.md +249 -232
  2. model.safetensors +1 -1
  3. training_args.bin +2 -2
README.md CHANGED
@@ -1,232 +1,249 @@
1
- ---
2
- language: zh
3
- license: apache-2.0
4
- tags:
5
- - sentiment-analysis
6
- - chinese
7
- - finance
8
- - finbert
9
- - crypto
10
- - text-classification
11
- - news
12
- datasets:
13
- - custom
14
- metrics:
15
- - accuracy
16
- - f1
17
- - precision
18
- - recall
19
- model-index:
20
- - name: Chinese Financial Sentiment Analysis (Crypto)
21
- results:
22
- - task:
23
- type: text-classification
24
- name: Sentiment Analysis
25
- metrics:
26
- - type: accuracy
27
- value: 0.7736
28
- name: Accuracy
29
- - type: f1
30
- value: 0.7688
31
- name: F1 Score
32
- - type: precision
33
- value: 0.7864
34
- name: Precision
35
- - type: recall
36
- value: 0.7736
37
- name: Recall
38
- ---
39
-
40
- # Chinese Financial Sentiment Analysis Model (Crypto Focus)
41
-
42
- 中文金融情感分析模型(加密货币领域)
43
-
44
- ## 模型描述 | Model Description
45
-
46
- 本模型基于 `yiyanghkust/finbert-tone-chinese` 经过多轮迭代微调,专门用于分析中文加密货币相关新闻和社交媒体内容的情感倾向。模型可以识别三种情感类别:正面(Positive)、中性(Neutral)和负面(Negative)。
47
-
48
- 训练数据经过 Claude AI 逐条人工审阅、纠正标注错误,确保数据质量。
49
-
50
- This model is iteratively fine-tuned from `yiyanghkust/finbert-tone-chinese`, specifically designed for sentiment analysis of Chinese cryptocurrency-related news and social media content. It classifies text into three sentiment categories: Positive, Neutral, and Negative.
51
-
52
- Training data is manually reviewed and corrected entry-by-entry by Claude AI to ensure annotation quality.
53
-
54
- ## 训练数据 | Training Data
55
-
56
- - **数据量 | Size**: 2008条人工审阅标注的中文金融新闻 | 2008 manually reviewed Chinese financial news articles
57
- - **数据来源 | Source**: 加密货币相关新闻和推文 | Cryptocurrency-related news and tweets
58
- - **标注方式 | Annotation**: 模型预测 + Claude AI 逐条审阅纠正 | Model prediction + Claude AI manual review & correction
59
- - **数据分布 | Distribution**:
60
- - Positive(正面): 731条 (36.4%)
61
- - Neutral(中性): 846条 (42.1%)
62
- - Negative(负面): 431条 (21.5%)
63
-
64
- ## 性能指标 | Performance Metrics
65
-
66
- 402条测试集上的表现(80/20分层划分) | Performance on 402 test samples (80/20 stratified split):
67
-
68
- | 指标 Metric | 数值 Value |
69
- |-------------|-----------|
70
- | 准确率 Accuracy | 77.36% |
71
- | F1分数 F1 Score | 76.88% |
72
- | 精确率 Precision | 78.64% |
73
- | 召回率 Recall | 77.36% |
74
-
75
- ### 性能迭代历史 | Performance History
76
-
77
- | 版本 Version | 训练数据 Data | F1 Score | Accuracy |
78
- |------|----------|----------|----------|
79
- | v1.0 | 500条 | 61.65% | |
80
- | v2.0 | 1000条 | 63.65% | 64.50% |
81
- | v3.5 | 1500条 | 67.16% | 68.33% |
82
- | v4.0 | 1700条 | 70.91% | 72.06% |
83
- | **v5.0** | **2008条** | **76.88%** | **77.36%** |
84
-
85
- ## 使用方法 | Usage
86
-
87
- ### 快速开始 | Quick Start
88
-
89
- ```python
90
- from transformers import AutoTokenizer, AutoModelForSequenceClassification
91
- import torch
92
-
93
- # 加载模型和分词器 | Load model and tokenizer
94
- model_name = "LocalOptimum/chinese-crypto-sentiment"
95
- tokenizer = AutoTokenizer.from_pretrained(model_name)
96
- model = AutoModelForSequenceClassification.from_pretrained(model_name)
97
-
98
- # 分析文本 | Analyze text
99
- text = "比特币突破10万美元创历史新高"
100
- inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=128)
101
-
102
- # 预测 | Predict
103
- with torch.no_grad():
104
- outputs = model(**inputs)
105
- predictions = torch.nn.functional.softmax(outputs.logits, dim=-1)
106
- predicted_class = torch.argmax(predictions, dim=-1).item()
107
-
108
- # 结果映射 | Result mapping
109
- labels = ['positive', 'neutral', 'negative']
110
- sentiment = labels[predicted_class]
111
- confidence = predictions[0][predicted_class].item()
112
-
113
- print(f"情感: {sentiment}")
114
- print(f"置信度: {confidence:.4f}")
115
- ```
116
-
117
- ### 批量处理 | Batch Processing
118
-
119
- ```python
120
- texts = [
121
- "币安获得阿布扎比监管授权",
122
- "以太坊完成Fusaka升级",
123
- "某交易所遭攻击损失100万美元"
124
- ]
125
-
126
- inputs = tokenizer(texts, return_tensors="pt", truncation=True,
127
- max_length=128, padding=True)
128
-
129
- with torch.no_grad():
130
- outputs = model(**inputs)
131
- predictions = torch.nn.functional.softmax(outputs.logits, dim=-1)
132
- predicted_classes = torch.argmax(predictions, dim=-1)
133
-
134
- labels = ['positive', 'neutral', 'negative']
135
- for text, pred in zip(texts, predicted_classes):
136
- print(f"{text} -> {labels[pred]}")
137
- ```
138
-
139
- ## 训练参数 | Training Configuration
140
-
141
- - **基础模型 | Base Model**: yiyanghkust/finbert-tone-chinese(经多轮迭代微调)
142
- - **训练轮数 | Epochs**: 5(Early Stopping patience=3,实际在 Epoch 1 达到最佳)
143
- - **批次大小 | Batch Size**: 16
144
- - **学习率 | Learning Rate**: 2e-5
145
- - **最大序列长度 | Max Length**: 128
146
- - **训练设备 | Device**: NVIDIA GeForce RTX 5080 Laptop GPU (16GB)
147
- - **混合精度 | Mixed Precision**: FP16
148
- - **最佳模型选择 | Best Model**: metric_for_best_model='f1'
149
-
150
- ## 适用场景 | Use Cases
151
-
152
- - 加密货币新���情感分析
153
- - 社交媒体舆情监控
154
- - 金融市场情绪指标
155
- - 实时新闻情感跟踪
156
- - 投资决策辅助参考
157
-
158
- ## 核心标注原则 | Annotation Principles
159
-
160
- - 加密货币是**风险资产**(类似美股),不是避险资产(类似黄金)
161
- - 战争、地缘冲突、关税 → **negative**(利空风险资产)
162
- - 平台上线新币种/功能 → **neutral**(常规运营,非利好)
163
- - 个人观点/分析师预测 → **neutral**(主观意见)
164
- - 明确利好(ETF通过、大额买入、政策支持)→ **positive**
165
- - 明确利空(清算、暴跌、诈骗、监管打压)→ **negative**
166
-
167
- ## 局限性 | Limitations
168
-
169
- - ⚠️ 主要针对加密货币领域的金融新闻,其他金融领域可能表现不佳
170
- - ⚠️ 短文本少于10字的分析准确率可能下降
171
- - ⚠️ 仅支持简体中文
172
- - ⚠️ 模型不替代人工判断仅供参考
173
-
174
- ## 许可证 | License
175
-
176
- Apache-2.0
177
-
178
- ## 引用 | Citation
179
-
180
- 如果使用模型,请引用:
181
-
182
- ```bibtex
183
- @misc{watchtower-sentiment-2026,
184
- title={Chinese Financial Sentiment Analysis Model (Crypto Focus)},
185
- author={Onefly},
186
- year={2026},
187
- howpublished={\url{https://huggingface.co/LocalOptimum/chinese-crypto-sentiment}},
188
- note={Fine-tuned from yiyanghkust/finbert-tone-chinese, 2008 samples, F1=76.88\%}
189
- }
190
- ```
191
-
192
- ## 基础模型 | Base Model
193
-
194
- 本模型基于以下模型微调:
195
- - [yiyanghkust/finbert-tone-chinese](https://huggingface.co/yiyanghkust/finbert-tone-chinese)
196
-
197
- 感谢原作者的贡献!
198
-
199
- ## 更新日志 | Changelog
200
-
201
- ### v5.0 (2026-02-28)
202
- - 扩充训练数据至2008条(+308条Claude人工审阅数据)
203
- - ✅ F1分数大幅提升(70.91% → 76.88%,+5.97%)
204
- - ✅ 纠正模型系统性错误(positive→neutral 过度预测等)
205
- - ✅ 数据分布优化:negative从362增至431条
206
-
207
- ### v4.0 (2026-02-28)
208
- - ✅ 扩充训练数据至1700条
209
- - F1分数提升(67.16% → 70.91%,+3.75%)
210
- - ✅ 引入Claude AI逐条审阅标注流程
211
-
212
- ### v3.5 (2026-02-27)
213
- - ✅ 扩充训练据至1500条
214
- - ✅ F1分数提升63.65% 67.16%+3.51%
215
- - ✅ 大幅修正战争/地缘冲突positive的系统性错误
216
-
217
- ### v2.0 (2025-12-09)
218
- - 扩充训练数据至1000条
219
- - ✅ 修正标注错误,提升数据质量
220
- - ✅ F1分数提升(61.65% → 63.65%,+2.01%)
221
-
222
- ### v1.0 (Initial Release)
223
- - 基于500条标注数据的初始版本
224
-
225
- ## 联系方式 | Contact
226
-
227
- 如有问题或建议,欢迎提 issue PR。
228
-
229
- ---
230
-
231
- **维护者 | Maintainer**: Onefly
232
- **最后更新 | Last Updated**: 2026-02-28
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language: zh
3
+ license: apache-2.0
4
+ tags:
5
+ - sentiment-analysis
6
+ - chinese
7
+ - finance
8
+ - finbert
9
+ - crypto
10
+ - text-classification
11
+ - news
12
+ datasets:
13
+ - custom
14
+ metrics:
15
+ - accuracy
16
+ - f1
17
+ - precision
18
+ - recall
19
+ model-index:
20
+ - name: Chinese Financial Sentiment Analysis (Crypto)
21
+ results:
22
+ - task:
23
+ type: text-classification
24
+ name: Sentiment Analysis
25
+ metrics:
26
+ - type: accuracy
27
+ value: 0.8484
28
+ name: Accuracy
29
+ - type: f1
30
+ value: 0.8488
31
+ name: F1 Score
32
+ - type: precision
33
+ value: 0.8536
34
+ name: Precision
35
+ - type: recall
36
+ value: 0.8484
37
+ name: Recall
38
+ ---
39
+
40
+ # Chinese Financial Sentiment Analysis Model (Crypto Focus)
41
+
42
+ 中文金融情感分析模型(加密货币领域)
43
+
44
+ ## 模型描述 | Model Description
45
+
46
+ 本模型基于 `yiyanghkust/finbert-tone-chinese` 经过多轮迭代微调,专门用于分析中文加密货币相关新闻和社交媒体内容的情感倾向。模型可以识别三种情感类别:正面(Positive)、中性(Neutral)和负面(Negative)。
47
+
48
+ 训练数据经过 Claude AI 逐条人工审阅、纠正标注错误,确保数据质量。
49
+
50
+ This model is iteratively fine-tuned from `yiyanghkust/finbert-tone-chinese`, specifically designed for sentiment analysis of Chinese cryptocurrency-related news and social media content. It classifies text into three sentiment categories: Positive, Neutral, and Negative.
51
+
52
+ Training data is manually reviewed and corrected entry-by-entry by Claude AI to ensure annotation quality.
53
+
54
+ ## 训练数据 | Training Data
55
+
56
+ - **数据量 | Size**: 2208条人工审阅标注的中文金融新闻 | 2208 manually reviewed Chinese financial news articles
57
+ - **数据来源 | Source**: 加密货币相关新闻和推文 | Cryptocurrency-related news and tweets
58
+ - **标注方式 | Annotation**: 模型预测 + Claude AI 逐条审阅纠正 | Model prediction + Claude AI manual review & correction
59
+ - **数据分布 | Distribution**:
60
+ - Positive(正面): 734条 (33.2%)
61
+ - Neutral(中性): 899条 (40.7%)
62
+ - Negative(负面): 575条 (26.0%)
63
+
64
+ ## 性能指标 | Performance Metrics
65
+
66
+ 442条测试集上的表现(80/20分层划分) | Performance on 442 test samples (80/20 stratified split):
67
+
68
+ | 指标 Metric | 数值 Value |
69
+ |-------------|-----------|
70
+ | 准确率 Accuracy | 84.84% |
71
+ | F1分数 F1 Score | 84.88% |
72
+ | 精确率 Precision | 85.36% |
73
+ | 召回率 Recall | 84.84% |
74
+
75
+ ### 各类别详细指标 | Per-class Metrics
76
+
77
+ | 类别 Class | Precision | Recall | F1 |
78
+ |-----------|-----------|--------|----|
79
+ | negative | 0.938 | 0.791 | 0.858 |
80
+ | neutral | 0.806 | 0.878 | 0.840 |
81
+ | positive | 0.846 | 0.857 | 0.851 |
82
+ | **weighted avg** | **0.854** | **0.848** | **0.849** |
83
+
84
+ ### 性能迭代历史 | Performance History
85
+
86
+ | 版本 Version | 训练数据 Data | F1 Score | Accuracy |
87
+ |------|----------|----------|----------|
88
+ | v1.0 | 500条 | 61.65% | — |
89
+ | v2.0 | 1000条 | 63.65% | 64.50% |
90
+ | v3.5 | 1500条 | 67.16% | 68.33% |
91
+ | v4.0 | 1700条 | 70.91% | 72.06% |
92
+ | v5.0 | 2008条 | 76.88% | 77.36% |
93
+ | **v6.0** | **2208条** | **84.88%** | **84.84%** |
94
+
95
+ ## 使用方法 | Usage
96
+
97
+ ### 快速开始 | Quick Start
98
+
99
+ ```python
100
+ from transformers import AutoTokenizer, AutoModelForSequenceClassification
101
+ import torch
102
+
103
+ # 加载模型和分词器 | Load model and tokenizer
104
+ model_name = "LocalOptimum/chinese-crypto-sentiment"
105
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
106
+ model = AutoModelForSequenceClassification.from_pretrained(model_name)
107
+
108
+ # 分析文本 | Analyze text
109
+ text = "比特币突破10万美元创历史新高"
110
+ inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=128)
111
+
112
+ # 预测 | Predict
113
+ with torch.no_grad():
114
+ outputs = model(**inputs)
115
+ predictions = torch.nn.functional.softmax(outputs.logits, dim=-1)
116
+ predicted_class = torch.argmax(predictions, dim=-1).item()
117
+
118
+ # 结果映射 | Result mapping
119
+ labels = ['positive', 'neutral', 'negative']
120
+ sentiment = labels[predicted_class]
121
+ confidence = predictions[0][predicted_class].item()
122
+
123
+ print(f"情感: {sentiment}")
124
+ print(f"置信度: {confidence:.4f}")
125
+ ```
126
+
127
+ ### 批量处理 | Batch Processing
128
+
129
+ ```python
130
+ texts = [
131
+ "币安获得阿布扎比监管授权",
132
+ "以太坊完成Fusaka升级",
133
+ "某交易所遭攻击损失100万美元"
134
+ ]
135
+
136
+ inputs = tokenizer(texts, return_tensors="pt", truncation=True,
137
+ max_length=128, padding=True)
138
+
139
+ with torch.no_grad():
140
+ outputs = model(**inputs)
141
+ predictions = torch.nn.functional.softmax(outputs.logits, dim=-1)
142
+ predicted_classes = torch.argmax(predictions, dim=-1)
143
+
144
+ labels = ['positive', 'neutral', 'negative']
145
+ for text, pred in zip(texts, predicted_classes):
146
+ print(f"{text} -> {labels[pred]}")
147
+ ```
148
+
149
+ ## 训练参数 | Training Configuration
150
+
151
+ - **基础模型 | Base Model**: yiyanghkust/finbert-tone-chinese(经多轮迭代微调)
152
+ - **训练轮数 | Epochs**: 5(Early Stopping patience=3,Epoch 5 达到最佳)
153
+ - **批次大小 | Batch Size**: 16
154
+ - **学习率 | Learning Rate**: 2e-5
155
+ - **最大序列长度 | Max Length**: 128
156
+ - **训练设备 | Device**: NVIDIA GeForce RTX 5080 Laptop GPU (16GB)
157
+ - **混合精度 | Mixed Precision**: FP16
158
+ - **最佳模型选择 | Best Model**: metric_for_best_model='f1'
159
+
160
+ ## 适用场景 | Use Cases
161
+
162
+ - 加密货币新闻情感分析
163
+ - 社交媒体舆情监控
164
+ - 金融市场情绪指标
165
+ - 实时新闻情感跟踪
166
+ - ✅ 投资决策辅助参考
167
+
168
+ ## 核心标注原则 | Annotation Principles
169
+
170
+ - 加密货币是**风险资产**类似美股,不是避险资产(类似黄金)
171
+ - 战争、地缘冲突、关税 → **negative**(利空风险资产)
172
+ - 平台上线新币种/功 → **neutral**(常规运营非利好)
173
+ - 个人观点/分析师预测 → **neutral**(主观意见)
174
+ - 明确利好(ETF通过、大额买入、政策支持)→ **positive**
175
+ - 明确利空(清算、暴跌、诈骗、监管打压)→ **negative**
176
+
177
+ ## 局限性 | Limitations
178
+
179
+ - ⚠️ 主要针对加密货币领域的金融新闻,其他金融领域可能表现不佳
180
+ - ⚠️ 短文(少于10字)的分析准确率可能下降
181
+ - ⚠️ 仅支持简体中文
182
+ - ⚠️ 模型不能替代人工判断,仅供参考
183
+
184
+ ## 许可证 | License
185
+
186
+ Apache-2.0
187
+
188
+ ## 引用 | Citation
189
+
190
+ 如果使用本模型,请引用:
191
+
192
+ ```bibtex
193
+ @misc{watchtower-sentiment-2026,
194
+ title={Chinese Financial Sentiment Analysis Model (Crypto Focus)},
195
+ author={Onefly},
196
+ year={2026},
197
+ howpublished={\url{https://huggingface.co/LocalOptimum/chinese-crypto-sentiment}},
198
+ note={Fine-tuned from yiyanghkust/finbert-tone-chinese, 2208 samples, F1=84.88\%}
199
+ }
200
+ ```
201
+
202
+ ## 基础模型 | Base Model
203
+
204
+ 模型基于以下模型微调:
205
+ - [yiyanghkust/finbert-tone-chinese](https://huggingface.co/yiyanghkust/finbert-tone-chinese)
206
+
207
+ 感谢原作者的贡献!
208
+
209
+ ## 更新日志 | Changelog
210
+
211
+ ### v6.0 (2026-02-28)
212
+ - 扩充训练数据至2208条(+200条Claude人工审阅数据)
213
+ - ✅ F1分大幅提升(76.88% → 84.88%,+8.00%)
214
+ - ✅ 大规模纠正地缘政治/战争新闻标注97条 positivenegative修复"美以打击伊朗"系统性错误
215
+ - ✅ negative recall 显著提升(67.0% 79.1%,+12.1pp)
216
+ - ✅ 地缘政治专项验证:14条测试全部几乎正确(92.9%),8条战争新闻置信度1.00判为negative
217
+
218
+ ### v5.0 (2026-02-28)
219
+ - ✅ 扩充训练数据至2008条(+308条Claude人工审阅数据)
220
+ - ✅ F1分数大幅提升(70.91% → 76.88%,+5.97%)
221
+ - ✅ 纠正模型系统性错误(positive→neutral 过度预测等)
222
+ - 数据分布优化:negative从362增至431条
223
+
224
+ ### v4.0 (2026-02-28)
225
+ - 扩充训练数据至1700条
226
+ - ✅ F1分数提升(67.16% → 70.91%,+3.75%)
227
+ - 引入Claude AI逐条审阅标注流程
228
+
229
+ ### v3.5 (2026-02-27)
230
+ - ✅ 扩充训练数据至1500条
231
+ - F1分数提升(63.65% → 67.16%,+3.51%)
232
+ - 大幅修正战争/地缘冲突→positive的系统性错误
233
+
234
+ ### v2.0 (2025-12-09)
235
+ - ✅ 扩充训练数据至1000条
236
+ - ✅ 修正标注错误,提升数据质量
237
+ - ✅ F1分数提升(61.65% → 63.65%,+2.01%)
238
+
239
+ ### v1.0 (Initial Release)
240
+ - 基于500条标注数据的初始版本
241
+
242
+ ## 联系方式 | Contact
243
+
244
+ 如有问题或建议,欢迎提 issue 或 PR。
245
+
246
+ ---
247
+
248
+ **维护者 | Maintainer**: Onefly
249
+ **最后更新 | Last Updated**: 2026-02-28
model.safetensors CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:7db1818a4a08b3b1dd9022e0d95064d075d137177e23a1f7557e405bbae06e46
3
  size 409103292
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:44b746b367d2ca13cf146c38ef06c41286c2cace39fa936c417267b76a039eef
3
  size 409103292
training_args.bin CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:92dfe961fb52dc1b69afe75a1a36ee5850f2525ca6066e2863f577c3d75cba51
3
- size 5841
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5fe872dd8854f7b0a528984f96afc2567cc77ccb11430575e28876e89580f83e
3
+ size 5265