Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Talent-Match-AI: Resume and Job Description Matching
|
| 2 |
+
|
| 3 |
+
## π Overview
|
| 4 |
+
|
| 5 |
+
This repository hosts the quantized version of the **BERT-base-uncased** model for **Resume and Job Description Matching**. The model is designed to determine whether a resume aligns well with a given job description. If they are a strong match, the model outputs "Good Fit" with a confidence score; otherwise, it categorizes them as "Potential Fit" or "Not a Good Fit." The model has been optimized for efficient deployment while maintaining reasonable accuracy, making it suitable for real-time applications.
|
| 6 |
+
|
| 7 |
+
## π° Model Details
|
| 8 |
+
|
| 9 |
+
- **Model Architecture:** BERT-base-uncased
|
| 10 |
+
- **Task:** Resume and Job Description Matching
|
| 11 |
+
- **Dataset:** `facehuggerapoorv/resume-jd-match`
|
| 12 |
+
- **Quantization:** Float16 (FP16) for optimized inference
|
| 13 |
+
- **Fine-tuning Framework:** Hugging Face Transformers
|
| 14 |
+
|
| 15 |
+
## π Usage
|
| 16 |
+
|
| 17 |
+
### Installation
|
| 18 |
+
|
| 19 |
+
```bash
|
| 20 |
+
pip install transformers torch
|
| 21 |
+
```
|
| 22 |
+
|
| 23 |
+
### Loading the Model
|
| 24 |
+
|
| 25 |
+
```python
|
| 26 |
+
from transformers import BertTokenizer, BertForSequenceClassification
|
| 27 |
+
import torch
|
| 28 |
+
|
| 29 |
+
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 30 |
+
|
| 31 |
+
model_name = "AventIQ-AI/bert-talentmatchai"
|
| 32 |
+
model = BertForSequenceClassification.from_pretrained(model_name).to(device)
|
| 33 |
+
tokenizer = BertTokenizer.from_pretrained(model_name)
|
| 34 |
+
```
|
| 35 |
+
|
| 36 |
+
### Resume Matching Inference
|
| 37 |
+
|
| 38 |
+
```python
|
| 39 |
+
import torch
|
| 40 |
+
|
| 41 |
+
# Set device (use GPU if available)
|
| 42 |
+
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 43 |
+
model.to(device)
|
| 44 |
+
|
| 45 |
+
# Define label mapping
|
| 46 |
+
label_mapping = {0: "Not a Good Fit", 1: "Potential Fit", 2: "Good Fit"}
|
| 47 |
+
|
| 48 |
+
# Sample resume text for testing
|
| 49 |
+
test_resume = ["I have worked in different industries and have a lot of experience. I am a hard worker and can learn anything."]
|
| 50 |
+
|
| 51 |
+
# Tokenize test data
|
| 52 |
+
test_tokens = tokenizer(test_resume, padding="max_length", truncation=True, return_tensors="pt").to(device) # Move input to same device as model
|
| 53 |
+
|
| 54 |
+
# Make predictions
|
| 55 |
+
with torch.no_grad(): # Disable gradient computation for inference
|
| 56 |
+
output = model(**test_tokens)
|
| 57 |
+
|
| 58 |
+
# Get predicted label
|
| 59 |
+
predicted_label = output.logits.argmax(dim=1).item()
|
| 60 |
+
|
| 61 |
+
# Print result
|
| 62 |
+
print(f"Predicted Category: {predicted_label} ({label_mapping[predicted_label]})")
|
| 63 |
+
|
| 64 |
+
label_mapping = {0: "No Fit", 1: "Low Fit", 2: "Potential Fit", 3: "Good Fit"}
|
| 65 |
+
print(f"Predicted Category: {label_mapping[predictions]}")
|
| 66 |
+
|
| 67 |
+
```
|
| 68 |
+
|
| 69 |
+
## π Quantized Model Evaluation Results
|
| 70 |
+
|
| 71 |
+
### π₯ Evaluation Metrics π₯
|
| 72 |
+
|
| 73 |
+
- β
**Accuracy:** 0.9224
|
| 74 |
+
- β
**Precision:** 0.9212
|
| 75 |
+
- β
**Recall:** 0.8450
|
| 76 |
+
- β
**F1-score:** 0.7718
|
| 77 |
+
|
| 78 |
+
## β‘ Quantization Details
|
| 79 |
+
|
| 80 |
+
Post-training quantization was applied using PyTorch's built-in quantization framework. The model was quantized to Float16 (FP16) to reduce model size and improve inference efficiency while balancing accuracy.
|
| 81 |
+
|
| 82 |
+
## π½ Repository Structure
|
| 83 |
+
|
| 84 |
+
```
|
| 85 |
+
.
|
| 86 |
+
βββ model/ # Contains the quantized model files
|
| 87 |
+
βββ tokenizer_config/ # Tokenizer configuration and vocabulary files
|
| 88 |
+
βββ model.safetensors/ # Quantized Model
|
| 89 |
+
βββ README.md # Model documentation
|
| 90 |
+
```
|
| 91 |
+
|
| 92 |
+
## β οΈ Limitations
|
| 93 |
+
|
| 94 |
+
- The model may struggle with resumes and job descriptions that use non-standard terminology.
|
| 95 |
+
- Quantization may lead to slight degradation in accuracy compared to full-precision models.
|
| 96 |
+
- Performance may vary across different industries and job levels.
|
| 97 |
+
|
| 98 |
+
## π€ Contributing
|
| 99 |
+
|
| 100 |
+
Contributions are welcome! Feel free to open an issue or submit a pull request if you have suggestions or improvements.
|