🚀 Emollama-chat-7b
Emollama-chat-7bは、EmoLLMsプロジェクトの一部です。これは、命令に従う能力を備えた包括的な感情分析用の最初のオープンソース大規模言語モデル(LLM)シリーズです。このモデルは、Meta LLaMA2-chat-7B基礎モデルと完全なAAID命令微調整データに基づいて微調整されています。このモデルは、感情分類タスク(例:感情極性やカテゴリ別の感情)や回帰タスク(例:感情強度や感情の激しさ)に使用できます。
🚀 クイックスタート
Emollama-chat-7bは、感情分析用の大規模言語モデルです。Meta LLaMA2-chat-7Bをベースに微調整され、感情分類や回帰タスクに使用できます。
✨ 主な機能
- 感情分類タスク(感情極性やカテゴリ別の感情)に使用可能。
- 回帰タスク(感情強度や感情の激しさ)に使用可能。
📦 インストール
このモデルを使用するには、Hugging Face Transformersライブラリを使用します。以下は、モデルをロードする簡単な例です。
from transformers import LlamaTokenizer, LlamaForCausalLM
tokenizer = LlamaTokenizer.from_pretrained('lzw1008/Emollama-chat-7b')
model = LlamaForCausalLM.from_pretrained('lzw1008/Emollama-chat-7b', device_map='auto')
この例では、LlamaTokenizerを使用してトークナイザーをロードし、LlamaForCausalLMを使用してモデルをロードしています。device_map='auto'
引数は、GPUが利用可能な場合に自動的にGPUを使用するために使用されます。
💻 使用例
基本的な使用法
from transformers import LlamaTokenizer, LlamaForCausalLM
tokenizer = LlamaTokenizer.from_pretrained('lzw1008/Emollama-chat-7b')
model = LlamaForCausalLM.from_pretrained('lzw1008/Emollama-chat-7b', device_map='auto')
高度な使用法
以下は、いくつかのプロンプト例です。
感情強度
Human:
Task: Assign a numerical value between 0 (least E) and 1 (most E) to represent the intensity of emotion E expressed in the text.
Text: @CScheiwiller can't stop smiling 😆😆😆
Emotion: joy
Intensity Score:
Assistant:
>>0.896
感情強度評価
Human:
Task: Evaluate the valence intensity of the writer's mental state based on the text, assigning it a real-valued score from 0 (most negative) to 1 (most positive).
Text: Happy Birthday shorty. Stay fine stay breezy stay wavy @daviistuart 😘
Intensity Score:
Assistant:
>>0.879
感情分類
Human:
Task: Categorize the text into an ordinal class that best characterizes the writer's mental state, considering various degrees of positive and negative sentiment intensity. 3: very positive mental state can be inferred. 2: moderately positive mental state can be inferred. 1: slightly positive mental state can be inferred. 0: neutral or mixed mental state can be inferred. -1: slightly negative mental state can be inferred. -2: moderately negative mental state can be inferred. -3: very negative mental state can be inferred
Text: Beyoncé resentment gets me in my feelings every time. 😩
Intensity Class:
Assistant:
>>-3: very negative emotional state can be inferred
感情カテゴリ化
Human:
Task: Categorize the text's emotional tone as either 'neutral or no emotion' or identify the presence of one or more of the given emotions (anger, anticipation, disgust, fear, joy, love, optimism, pessimism, sadness, surprise, trust).
Text: Whatever you decide to do make sure it makes you #happy.
This text contains emotions:
Assistant:
>>joy, love, optimism
タスクの説明は、具体的なタスクに合わせて調整できます。
📚 ドキュメント
EmoLLMsのモデル
EmoLLMsには、Emollama-7b、Emollama-chat-7b、Emollama-chat-13b、Emoopt-13b、Emobloom-7b、Emot5-large、Emobart-largeなどの一連のモデルがあります。
- Emollama-7b:このモデルは、LLaMA2-7Bに基づいて微調整されています。
- Emollama-chat-7b:このモデルは、LLaMA2-chat-7Bに基づいて微調整されています。
- Emollama-chat-13b:このモデルは、LLaMA2-chat-13Bに基づいて微調整されています。
- Emoopt-13b:このモデルは、OPT-13Bに基づいて微調整されています。
- Emobloom-7b:このモデルは、Bloomz-7b1-mtに基づいて微調整されています。
- Emot5-large:このモデルは、T5-largeに基づいて微調整されています。
- Emobart-large:このモデルは、bart-largeに基づいて微調整されています。
すべてのモデルは、完全なAAID命令微調整データで学習されています。
倫理的な考慮事項
最近の研究では、LLMが潜在的なバイアス(例:性別格差)を引き起こす可能性があることが示されています。また、いくつかの誤った予測結果や過剰一般化も、現在のLLMの潜在的なリスクを示しています。したがって、このモデルを実際のシナリオの感情分析システムに適用するには、まだ多くの課題があります。
📄 ライセンス
EmoLLMsシリーズは、MITライセンスの下で提供されています。詳細については、MITファイルを参照してください。
引用
あなたの研究でEmoLLMsシリーズを使用する場合は、以下の論文を引用してください。
@article{liu2024emollms,
title={EmoLLMs: A Series of Emotional Large Language Models and Annotation Tools for Comprehensive Affective Analysis},
author={Liu, Zhiwei and Yang, Kailai and Zhang, Tianlin and Xie, Qianqian and Yu, Zeping and Ananiadou, Sophia},
journal={arXiv preprint arXiv:2401.08508},
year={2024}
}