Instructions to use dmuturia/phi2_emotrack_finetuned with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use dmuturia/phi2_emotrack_finetuned with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("microsoft/phi-2") model = PeftModel.from_pretrained(base_model, "dmuturia/phi2_emotrack_finetuned") - Notebooks
- Google Colab
- Kaggle
|
Download README.md from dmuturia/phi2_emotrack_finetuned: direct link, hf CLI and curl.
- Browser
- Download file 2.55 kB
-
https://huggingface.co/dmuturia/phi2_emotrack_finetuned/resolve/main/README.md
- Command line
-
hf download hf://dmuturia/phi2_emotrack_finetuned/README.md
-
curl -L -o README.md https://huggingface.co/dmuturia/phi2_emotrack_finetuned/resolve/main/README.md
2.55 kB
| base_model: microsoft/phi-2 | |
| library_name: peft | |
| # Model Card for EmotiTrack Emotion & Sarcasm Classifier (`phi2_emotrack_finetuned`) | |
| A fine-tuned `phi-2` language model for classifying emotional tone and detecting sarcasm in text messages. This model is part of the **EmotiTrack** project, designed for use in emotional journaling, mental health tech, and empathetic AI assistants. | |
| --- | |
| ## Model Details | |
| ### Model Description | |
| - **Developed by:** Dennis Muturia for the EmotiTrack project | |
| - **Funded by:** Self-funded | |
| - **Shared by:** Dennis Muturia | |
| - **Model type:** Causal Language Model | |
| - **Language(s):** English | |
| - **License:** Apache 2.0 (inherits from `microsoft/phi-2`) | |
| - **Finetuned from model:** `microsoft/phi-2` using PEFT (LoRA) | |
| This model is fine-tuned to detect **emotions** (based on GoEmotions) and **sarcasm** (modeled after `deepset/sarcasm-xlm-roberta-base`) in short-form user text. | |
| --- | |
| ## Model Sources | |
| - **Repository:** [https://huggingface.co/dmuturia/phi2_emotrack_finetuned](https://huggingface.co/dmuturia/phi2_emotrack_finetuned) | |
| --- | |
| ## Uses | |
| ### Direct Use | |
| - Emotion & sarcasm classification for conversational agents | |
| - Tagging emotional states in journaling or logging apps | |
| - Enriching sentiment understanding in chatbots and voice assistants | |
| ### Downstream Use | |
| - Integrated into the EmotiTrack backend to drive real-time insight | |
| - Supports longitudinal tracking of emotional states | |
| ### Out-of-Scope Use | |
| - Not suitable for diagnosis or clinical use | |
| - Not designed for multilingual inputs | |
| - Not ideal for long or formal documents | |
| --- | |
| ## Bias, Risks, and Limitations | |
| - May reflect bias from emotion/sarcasm datasets scraped from internet text | |
| - Limited context window makes deep sarcasm or subtext detection unreliable | |
| - Emotion misclassification may occur on neutral or ambiguous expressions | |
| ### Recommendations | |
| - Use in user-facing applications should include disclaimers | |
| - Avoid using outputs for automated decision-making in sensitive domains | |
| --- | |
| ## How to Get Started with the Model | |
| ```python | |
| from transformers import pipeline | |
| pipe = pipeline( | |
| "text-generation", | |
| model="dmuturia/phi2_emotrack_finetuned", | |
| tokenizer="dmuturia/phi2_emotrack_finetuned", | |
| device=0 # Use -1 for CPU | |
| ) | |
| prompt = """### Instruction: | |
| Classify the emotional tone and detect sarcasm in the following message. | |
| ### Input: | |
| "I just love it when everything breaks right before a deadline." | |
| ### Response: | |
| """ | |
| output = pipe(prompt, max_new_tokens=60)[0]["generated_text"] | |
| print(output) |