🚀 蘇傑金融 8B v0.1 模型介紹
蘇傑金融 8B v0.1 是一款專注於金融領域的語言模型,它在蘇傑金融指令 177k 數據集上進行了精細微調。該模型基於強大的 LLAMA 3 模型,能夠精準處理各類金融問題,為金融領域的信息分析和決策提供有力支持。

✨ 主要特性
🎯 微調聚焦
在首次微調中,模型著重關注以下三個關鍵金融任務:
- ✅❌ 是非問題回答
- 描述:回答需要簡單“是”或“否”回應的金融問題。
- 類別分佈:
- 訓練集:5265 個“是”的示例,5302 個“否”的示例。
- 評估集:1340 個“是”的示例,1303 個“否”的示例。
- 📂 主題分類
- 描述:將金融文本分類到特定的金融相關類別,如公司新聞、市場、收益等。
- 類別分佈:
- 訓練集:在 20 個類別中均衡分佈,每個類別有 29 - 40 個示例。
- 評估集:各類別數量不同,每個類別有 4 - 15 個示例。
- 😊😐😡 情感分析
- 描述:分析金融文本,將情感分類為積極、消極、中性、看跌或看漲。
- 類別分佈:
- 訓練集:1160 個積極示例,1155 個消極示例,1150 箇中性示例,1133 個看跌示例,1185 個看漲示例。
- 評估集:281 個積極示例,286 個消極示例,291 箇中性示例,308 個看跌示例,256 個看漲示例。
🎓 訓練方法
為確保最佳性能,採用了平衡的訓練方法。在數據集準備過程中,從三個重點任務的每個子類別中策略性地選擇了相同數量的示例。最終的平衡訓練數據集包含 17036 個示例,評估數據集包含 4259 個示例。
🔧 模型規格
屬性 |
詳情 |
基礎模型 |
LLAMA 3 8B 🦙 |
微調技術 |
LoRA(低秩自適應),r = 16,alpha = 32 |
學習率 |
2e - 4 📈 |
權重衰減 |
0.01 🏋️♂️ |
訓練輪數 |
1 🔄 |
量化方式 |
用於 VLLM 的 float16 🗜️ |
📊 評估結果
將模型與基礎 LLAMA 3 模型在評估數據集上進行了對比測試,結果令人印象深刻!以模型生成的前 10 個單詞中是否包含正確答案作為判斷標準,確保模型不僅能提供準確答案,還能優先輸出最相關的信息。

📦 安裝指南
此模型使用 Unsloth 進行微調,請參考其 GitHub 倉庫 並確保在使用模型前已安裝。
💻 使用示例
基礎用法
from unsloth import FastLanguageModel
max_seq_length = 2048
dtype = None
load_in_4bit = False
alpaca_prompt = """Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
{}
### Input:
{}
### Response:
{}"""
model, tokenizer = FastLanguageModel.from_pretrained(
model_name = "sujet-ai/Sujet-Finance-8B-v0.1",
max_seq_length = max_seq_length,
dtype = dtype,
load_in_4bit = load_in_4bit,
token = "your hf token here",
)
example = {
'system_prompt': 'You are a financial sentiment analysis expert. Your task is to analyze the sentiment expressed in the given financial text.Only reply with bearish, neutral, or bullish.',
'user_prompt': "Expedia's Problems Run Deeper Than SEO Headwinds",
'answer': 'bearish',
}
inputs = tokenizer(
[alpaca_prompt.format(
example['system_prompt'],
example['user_prompt'],
"",
)],
return_tensors="pt"
).to("cuda")
outputs = model.generate(**inputs, max_new_tokens=2048, use_cache=True, pad_token_id=tokenizer.eos_token_id)
output = tokenizer.batch_decode(outputs)[0]
response = output.split("### Response:")[1].strip()
print(response)
你可以點擊此鏈接獲取關於數據集的更多信息。
📄 許可證
本模型遵循 Apache - 2.0 許可證。