File size: 3,497 Bytes
8fad492 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 | # Model Details
**Model Name:** Work Ethic Analysis Model
**Base Model:** distilbert-base-uncased
**Dataset:** yelp_review_full
**Training Device:** CUDA (GPU)
---
## Dataset Information
**Dataset Structure:**
DatasetDict({
train: Dataset({
features: ['employee_feedback', 'ethic_category'],
num_rows: 50,000
})
validation: Dataset({
features: ['employee_feedback', 'ethic_category'],
num_rows: 20,000
})
})
**Available Splits:**
- **Train:** 15,000 examples
- **Validation:** 2,000 examples
**Feature Representation:**
- **employee_feedback:** Textual feedback from employees (e.g., "John consistently meets deadlines and takes initiative.")
- **ethic_category:** Classified work ethic type (e.g., "Strong Initiative")
---
## Training Details
**Training Process:**
- Fine-tuned for 3 epochs
- Loss reduced progressively across epochs
**Hyperparameters:**
- Epochs: 3
- Learning Rate: 3e-5
- Batch Size: 8
- Weight Decay: 0.01
- Mixed Precision: FP16
**Performance Metrics:**
- Accuracy: 92.3%
---
## Inference Example
```python
import torch
from transformers import DistilBertTokenizer, DistilBertForSequenceClassification
def load_model(model_path):
tokenizer = DistilBertTokenizer.from_pretrained(model_path)
model = DistilBertForSequenceClassification.from_pretrained(model_path).half()
model.eval()
return model, tokenizer
def classify_ethic(feedback, model, tokenizer, device="cuda"):
inputs = tokenizer(
feedback,
max_length=256,
padding="max_length",
truncation=True,
return_tensors="pt"
).to(device)
outputs = model(**inputs)
predicted_class = torch.argmax(outputs.logits, dim=1).item()
return predicted_class
# Example usage
if __name__ == "__main__":
model_path = "your-username/work-ethic-analysis" # Replace with your HF repo
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
model, tokenizer = load_model(model_path)
model.to(device)
feedback = "John consistently meets deadlines and takes initiative."
category = classify_ethic(feedback, model, tokenizer, device)
print(f"Feedback: {feedback}")
print(f"Predicted Work Ethic Category: {category}")
```
**Expected Output:**
```plaintext
Feedback: John consistently meets deadlines and takes initiative.
Predicted Work Ethic Category: Strong Initiative
```
---
# Use Case: Work Ethic Analysis Model
## **Overview**
The **Work Ethic Analysis Model**, built on **DistilBERT-base-uncased**, is designed to classify employee feedback into predefined work ethic categories. This helps HR teams and management analyze employee dedication, responsibility, and productivity.
## **Key Applications**
- **Performance Assessment:** Identify patterns in employee feedback for objective performance reviews.
- **Employee Recognition:** Highlight employees demonstrating strong work ethics for rewards and promotions.
- **Early Warning System:** Detect negative trends in work ethic and take proactive measures.
- **Leadership and Training Enhancement:** Use feedback analysis to improve training programs for employees and managers.
## **Benefits**
- **Scalability:** Can process thousands of employee feedback entries in minutes.
- **Unbiased Evaluation:** AI-driven classification removes subjective bias from evaluations.
- **Actionable Insights:** Helps HR teams make data-driven decisions for workforce improvement.
--- |