Tomiwajin commited on
Commit
12fbd54
·
verified ·
1 Parent(s): 008d07e

Upload 14 files

Browse files

Add fine-tuned Model

1_Pooling/config.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "word_embedding_dimension": 384,
3
+ "pooling_mode_cls_token": false,
4
+ "pooling_mode_mean_tokens": true,
5
+ "pooling_mode_max_tokens": false,
6
+ "pooling_mode_mean_sqrt_len_tokens": false,
7
+ "pooling_mode_weightedmean_tokens": false,
8
+ "pooling_mode_lasttoken": false,
9
+ "include_prompt": true
10
+ }
README.md CHANGED
@@ -1,3 +1,164 @@
1
- ---
2
- license: mit
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # SetFit Email Job Status Classifier
2
+
3
+ A fine-tuned SetFit model for classifying job application emails into different categories. This model can automatically categorize job-related emails to help track application status and organize your job search process.
4
+
5
+ ## Model Description
6
+
7
+ This model is based on [sentence-transformers/all-MiniLM-L6-v2](https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2) and fine-tuned using SetFit (Sentence Transformer Fine-tuning) for email classification tasks.
8
+
9
+ **Base Model:** `sentence-transformers/all-MiniLM-L6-v2`
10
+ **Framework:** SetFit
11
+ **Task:** Multi-class text classification
12
+ **Language:** English
13
+
14
+ ## Model Performance
15
+
16
+ - **Overall Accuracy:** 90%
17
+ - **Training Samples:** 235
18
+ - **Test Samples:** 59
19
+ - **Classes:** 7
20
+
21
+ ## Intended Use
22
+
23
+ ### Primary Use Cases
24
+
25
+ - **Job Search Management:** Automatically categorize job-related emails
26
+ - **Email Organization:** Sort incoming emails by job application status
27
+ - **Application Tracking:** Monitor progress of job applications
28
+ - **Workflow Automation:** Integrate into email filtering systems
29
+
30
+ ### Supported Categories
31
+
32
+ 1. **Applied** - Confirmation emails after submitting applications
33
+ 2. **Interview** - Interview invitations and scheduling emails
34
+ 3. **Next-Step** - Follow-up emails about next steps in the process
35
+ 4. **Not Job Related** - Non-job related emails
36
+ 5. **Not Job Status Update** - Job-related but not status updates
37
+ 6. **Offer** - Job offers and offer-related communications
38
+ 7. **Rejected** - Rejection notifications
39
+
40
+ ## How to Use
41
+
42
+ ### Installation
43
+
44
+ ```bash
45
+ pip install setfit
46
+ ```
47
+
48
+ ### Quick Start
49
+
50
+ ```python
51
+ from setfit import SetFitModel
52
+
53
+ # Load the model
54
+ model = SetFitModel.from_pretrained("your-username/setfit-email-classifier")
55
+
56
+ # Classify emails
57
+ emails = [
58
+ "Thank you for your application. We will review it and get back to you.",
59
+ "We would like to schedule an interview with you for next Tuesday.",
60
+ "Unfortunately, we have decided to move forward with other candidates.",
61
+ "Congratulations! We would like to offer you the position."
62
+ ]
63
+
64
+ predictions = model(emails)
65
+ print(predictions)
66
+ # Output: ['applied', 'interview', 'rejected', 'offer']
67
+ ```
68
+
69
+ ### Batch Processing
70
+
71
+ ```python
72
+ import pandas as pd
73
+
74
+ # Process multiple emails
75
+ df = pd.DataFrame({
76
+ 'subject': ['Application Confirmation', 'Interview Invitation', 'Unfortunately...'],
77
+ 'body': ['Thank you for applying...', 'We would like to schedule...', 'We regret to inform...']
78
+ })
79
+
80
+ # Combine subject and body
81
+ df['email_text'] = df['subject'] + ' ' + df['body']
82
+
83
+ # Get predictions
84
+ predictions = model(df['email_text'].tolist())
85
+ df['classification'] = predictions
86
+
87
+ print(df[['subject', 'classification']])
88
+ ```
89
+
90
+ ### Confidence Scores
91
+
92
+ ```python
93
+ # Get prediction probabilities
94
+ email_text = "We would like to schedule a phone interview with you."
95
+ embeddings = model.model_body.encode([email_text])
96
+ probabilities = model.model_head.predict_proba(embeddings)[0]
97
+ classes = model.model_head.classes_
98
+
99
+ # Display results
100
+ prediction = model([email_text])[0]
101
+ print(f"Prediction: {prediction}")
102
+
103
+ for class_name, prob in zip(classes, probabilities):
104
+ print(f"{class_name}: {prob:.3f}")
105
+ ```
106
+
107
+ ## Training Data
108
+
109
+ The model was trained on a dataset of 294 job-related emails with the following distribution:
110
+
111
+ - **Not Job Related:** 53 samples
112
+ - **Rejected:** 47 samples
113
+ - **Interview:** 47 samples
114
+ - **Not Job Status Update:** 46 samples
115
+ - **Applied:** 43 samples
116
+ - **Next-Step:** 30 samples
117
+ - **Offer:** 28 samples
118
+
119
+ ## Training Details
120
+
121
+ **Training Framework:** SetFit
122
+ **Training Time:** ~1 hour
123
+ **Hardware:** Local training (CPU/GPU)
124
+ **Optimization:** Contrastive learning + classification head fine-tuning
125
+
126
+ ### Training Parameters
127
+
128
+ - **Base Model:** sentence-transformers/all-MiniLM-L6-v2
129
+ - **Train/Test Split:** 80/20
130
+ - **Stratified Split:** Yes (maintains class distribution)
131
+ - **Random State:** 42 (reproducible results)
132
+
133
+ ## Limitations
134
+
135
+ - **Domain Specific:** Trained specifically on job application emails
136
+ - **English Only:** Optimized for English language emails
137
+ - **Class Imbalance:** Some categories have fewer training examples
138
+ - **Context Length:** Best performance on email-length texts (not very long documents)
139
+ - **Temporal Drift:** Performance may degrade on very recent email formats/styles
140
+
141
+ ## Bias and Fairness
142
+
143
+ - The model may reflect biases present in the training data
144
+ - Performance may vary across different industries, company sizes, or communication styles
145
+ - Regular evaluation recommended when deployed in production
146
+
147
+ ## Citation
148
+
149
+ If you use this model, please cite:
150
+
151
+ ```bibtex
152
+ @misc{setfit-email-classifier-2025,
153
+ title={SetFit Email Job Status Classifier},
154
+ author={Oluwatomiwa Jinadu},
155
+ year={2025},
156
+ howpublished={\\url{https://huggingface.co/Tomiwajin/setfit_email_classifier}},
157
+ }
158
+ ```
159
+
160
+ ---
161
+
162
+ **Model Card Authors:** Oluwatomiwa Jinadu
163
+ **Model Card Date:** September 2025
164
+ **Model Version:** 1.0
config.json ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "BertModel"
4
+ ],
5
+ "attention_probs_dropout_prob": 0.1,
6
+ "classifier_dropout": null,
7
+ "dtype": "float32",
8
+ "gradient_checkpointing": false,
9
+ "hidden_act": "gelu",
10
+ "hidden_dropout_prob": 0.1,
11
+ "hidden_size": 384,
12
+ "initializer_range": 0.02,
13
+ "intermediate_size": 1536,
14
+ "layer_norm_eps": 1e-12,
15
+ "max_position_embeddings": 512,
16
+ "model_type": "bert",
17
+ "num_attention_heads": 12,
18
+ "num_hidden_layers": 6,
19
+ "pad_token_id": 0,
20
+ "position_embedding_type": "absolute",
21
+ "transformers_version": "4.56.1",
22
+ "type_vocab_size": 2,
23
+ "use_cache": true,
24
+ "vocab_size": 30522
25
+ }
config_sentence_transformers.json ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "__version__": {
3
+ "sentence_transformers": "5.1.0",
4
+ "transformers": "4.56.1",
5
+ "pytorch": "2.2.2"
6
+ },
7
+ "model_type": "SentenceTransformer",
8
+ "prompts": {
9
+ "query": "",
10
+ "document": ""
11
+ },
12
+ "default_prompt_name": null,
13
+ "similarity_fn_name": "cosine"
14
+ }
config_setfit.json ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "labels": [
3
+ "applied",
4
+ "interview",
5
+ "next-step",
6
+ "not_job_related",
7
+ "not_job_status_update",
8
+ "offer",
9
+ "rejected"
10
+ ],
11
+ "normalize_embeddings": false
12
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:deec023621bfb0a09323c23fcb6a2b2cd73367b983cd8ae61425e23d91084a0e
3
+ size 90864192
model_head.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4203f0bf3387d026cb71eb9b2e4fa5262c460b42e7052d57d10296112c7f1a5a
3
+ size 22991
model_info.json ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "model_path": "setfit_email_classifier_20250909_135238",
3
+ "timestamp": "20250909_135238",
4
+ "base_model": "sentence-transformers/all-MiniLM-L6-v2",
5
+ "training_date": "2025-09-09T13:52:39.181047",
6
+ "model_type": "SetFit Email Classifier",
7
+ "training_samples": 235,
8
+ "test_samples": 59,
9
+ "classes": [
10
+ "applied",
11
+ "interview",
12
+ "next-step",
13
+ "not_job_related",
14
+ "not_job_status_update",
15
+ "offer",
16
+ "rejected"
17
+ ]
18
+ }
modules.json ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "idx": 0,
4
+ "name": "0",
5
+ "path": "",
6
+ "type": "sentence_transformers.models.Transformer"
7
+ },
8
+ {
9
+ "idx": 1,
10
+ "name": "1",
11
+ "path": "1_Pooling",
12
+ "type": "sentence_transformers.models.Pooling"
13
+ },
14
+ {
15
+ "idx": 2,
16
+ "name": "2",
17
+ "path": "2_Normalize",
18
+ "type": "sentence_transformers.models.Normalize"
19
+ }
20
+ ]
sentence_bert_config.json ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ {
2
+ "max_seq_length": 256,
3
+ "do_lower_case": false
4
+ }
special_tokens_map.json ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cls_token": {
3
+ "content": "[CLS]",
4
+ "lstrip": false,
5
+ "normalized": false,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "mask_token": {
10
+ "content": "[MASK]",
11
+ "lstrip": false,
12
+ "normalized": false,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ },
16
+ "pad_token": {
17
+ "content": "[PAD]",
18
+ "lstrip": false,
19
+ "normalized": false,
20
+ "rstrip": false,
21
+ "single_word": false
22
+ },
23
+ "sep_token": {
24
+ "content": "[SEP]",
25
+ "lstrip": false,
26
+ "normalized": false,
27
+ "rstrip": false,
28
+ "single_word": false
29
+ },
30
+ "unk_token": {
31
+ "content": "[UNK]",
32
+ "lstrip": false,
33
+ "normalized": false,
34
+ "rstrip": false,
35
+ "single_word": false
36
+ }
37
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "added_tokens_decoder": {
3
+ "0": {
4
+ "content": "[PAD]",
5
+ "lstrip": false,
6
+ "normalized": false,
7
+ "rstrip": false,
8
+ "single_word": false,
9
+ "special": true
10
+ },
11
+ "100": {
12
+ "content": "[UNK]",
13
+ "lstrip": false,
14
+ "normalized": false,
15
+ "rstrip": false,
16
+ "single_word": false,
17
+ "special": true
18
+ },
19
+ "101": {
20
+ "content": "[CLS]",
21
+ "lstrip": false,
22
+ "normalized": false,
23
+ "rstrip": false,
24
+ "single_word": false,
25
+ "special": true
26
+ },
27
+ "102": {
28
+ "content": "[SEP]",
29
+ "lstrip": false,
30
+ "normalized": false,
31
+ "rstrip": false,
32
+ "single_word": false,
33
+ "special": true
34
+ },
35
+ "103": {
36
+ "content": "[MASK]",
37
+ "lstrip": false,
38
+ "normalized": false,
39
+ "rstrip": false,
40
+ "single_word": false,
41
+ "special": true
42
+ }
43
+ },
44
+ "clean_up_tokenization_spaces": false,
45
+ "cls_token": "[CLS]",
46
+ "do_basic_tokenize": true,
47
+ "do_lower_case": true,
48
+ "extra_special_tokens": {},
49
+ "mask_token": "[MASK]",
50
+ "max_length": 128,
51
+ "model_max_length": 256,
52
+ "never_split": null,
53
+ "pad_to_multiple_of": null,
54
+ "pad_token": "[PAD]",
55
+ "pad_token_type_id": 0,
56
+ "padding_side": "right",
57
+ "sep_token": "[SEP]",
58
+ "stride": 0,
59
+ "strip_accents": null,
60
+ "tokenize_chinese_chars": true,
61
+ "tokenizer_class": "BertTokenizer",
62
+ "truncation_side": "right",
63
+ "truncation_strategy": "longest_first",
64
+ "unk_token": "[UNK]"
65
+ }
vocab.txt ADDED
The diff for this file is too large to render. See raw diff