summary model
Browse files- README.md +82 -0
- config.json +70 -0
- generation_config.json +16 -0
- merges.txt +0 -0
- pytorch_model.bin +3 -0
- special_tokens_map.json +51 -0
- tokenizer_config.json +63 -0
- vocab.json +0 -0
README.md
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
language:
|
| 4 |
+
- en
|
| 5 |
+
library_name: transformers
|
| 6 |
+
---
|
| 7 |
+
|
| 8 |
+
# Model Card: bart_fine_tuned_model-v2
|
| 9 |
+
|
| 10 |
+
<!-- Provide a quick summary of what the model is/does. -->
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
## Model Name
|
| 14 |
+
|
| 15 |
+
## bart_fine_tuned_model-v2
|
| 16 |
+
|
| 17 |
+
### Model Description
|
| 18 |
+
|
| 19 |
+
<!-- This model represents a fine-tuned version of the facebook/bart-large model, specifically adapted for the task of Resume Summarization. The model has been trained to efficiently generate concise and relevant summaries from extensive resume texts. The fine-tuning process has tailored the original BART model to specialize in summarization tasks based on a specific dataset.. -->
|
| 20 |
+
This model represents a fine-tuned version of the facebook/bart-large model, specifically adapted for the task of Resume Summarization. The model has been trained to efficiently generate concise and relevant summaries from extensive resume texts. The fine-tuning process has tailored the original BART model to specialize in summarization tasks based on a specific dataset.
|
| 21 |
+
|
| 22 |
+
### Model information
|
| 23 |
+
|
| 24 |
+
-**Base Model: derekiya/bart_fine_tuned_model-v2**
|
| 25 |
+
|
| 26 |
+
|
| 27 |
+
-**Finetuning Dataset: To be made available in the future.**
|
| 28 |
+
|
| 29 |
+
### Training Parameters
|
| 30 |
+
|
| 31 |
+
- **Evaluation Strategy: epoch:**
|
| 32 |
+
- **Learning Rate: 5e-5**
|
| 33 |
+
- **Per Device Train Batch Size: 8:**
|
| 34 |
+
- **Per Device Eval Batch Size: 8**
|
| 35 |
+
- **Weight Decay: 0.01**
|
| 36 |
+
- **Save Total Limit: 5**
|
| 37 |
+
- **Number of Training Epochs: 10**
|
| 38 |
+
- **Predict with Generate: True**
|
| 39 |
+
- **Gradient Accumulation Steps: 1**
|
| 40 |
+
- **Optimizer: paged_adamw_32bit**
|
| 41 |
+
- **Learning Rate Scheduler Type: cosine**
|
| 42 |
+
|
| 43 |
+
|
| 44 |
+
## how to use
|
| 45 |
+
|
| 46 |
+
<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
|
| 47 |
+
**1.** Install the transformers library:
|
| 48 |
+
|
| 49 |
+
**pip install transformers**
|
| 50 |
+
|
| 51 |
+
**2.** Import the necessary modules:
|
| 52 |
+
|
| 53 |
+
import torch
|
| 54 |
+
from transformers import BartTokenizer, BartForConditionalGeneration
|
| 55 |
+
|
| 56 |
+
**3.** Initialize the model and tokenizer:
|
| 57 |
+
|
| 58 |
+
model_name = 'derekiya/bart_fine_tuned_model-v2'
|
| 59 |
+
tokenizer = BartTokenizer.from_pretrained(model_name)
|
| 60 |
+
model = BartForConditionalGeneration.from_pretrained(model_name)
|
| 61 |
+
|
| 62 |
+
**4.** Prepare the text for summarization:
|
| 63 |
+
|
| 64 |
+
text = 'Your resume text here'
|
| 65 |
+
inputs = tokenizer(text, return_tensors="pt", truncation=True, padding="max_length")
|
| 66 |
+
|
| 67 |
+
**5.** Generate the summary:
|
| 68 |
+
|
| 69 |
+
min_length_threshold = 55
|
| 70 |
+
summary_ids = model.generate(inputs["input_ids"], num_beams=4, min_length=min_length_threshold, max_length=150, early_stopping=True)
|
| 71 |
+
summary = tokenizer.decode(summary_ids[0], skip_special_tokens=True)
|
| 72 |
+
|
| 73 |
+
**6.** Output the summary:
|
| 74 |
+
|
| 75 |
+
print("Summary:", summary)
|
| 76 |
+
|
| 77 |
+
## Model Card Authors
|
| 78 |
+
|
| 79 |
+
Dereje Hinsermu
|
| 80 |
+
|
| 81 |
+
## Model Card Contact
|
| 82 |
+
|
config.json
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_name_or_path": "facebook/bart-large-cnn",
|
| 3 |
+
"_num_labels": 3,
|
| 4 |
+
"activation_dropout": 0.0,
|
| 5 |
+
"activation_function": "gelu",
|
| 6 |
+
"add_final_layer_norm": false,
|
| 7 |
+
"architectures": [
|
| 8 |
+
"BartForConditionalGeneration"
|
| 9 |
+
],
|
| 10 |
+
"attention_dropout": 0.0,
|
| 11 |
+
"bos_token_id": 0,
|
| 12 |
+
"classif_dropout": 0.0,
|
| 13 |
+
"classifier_dropout": 0.0,
|
| 14 |
+
"d_model": 1024,
|
| 15 |
+
"decoder_attention_heads": 16,
|
| 16 |
+
"decoder_ffn_dim": 4096,
|
| 17 |
+
"decoder_layerdrop": 0.0,
|
| 18 |
+
"decoder_layers": 12,
|
| 19 |
+
"decoder_start_token_id": 2,
|
| 20 |
+
"dropout": 0.1,
|
| 21 |
+
"early_stopping": true,
|
| 22 |
+
"encoder_attention_heads": 16,
|
| 23 |
+
"encoder_ffn_dim": 4096,
|
| 24 |
+
"encoder_layerdrop": 0.0,
|
| 25 |
+
"encoder_layers": 12,
|
| 26 |
+
"eos_token_id": 2,
|
| 27 |
+
"force_bos_token_to_be_generated": true,
|
| 28 |
+
"forced_bos_token_id": 0,
|
| 29 |
+
"forced_eos_token_id": 2,
|
| 30 |
+
"gradient_checkpointing": false,
|
| 31 |
+
"id2label": {
|
| 32 |
+
"0": "LABEL_0",
|
| 33 |
+
"1": "LABEL_1",
|
| 34 |
+
"2": "LABEL_2"
|
| 35 |
+
},
|
| 36 |
+
"init_std": 0.02,
|
| 37 |
+
"is_encoder_decoder": true,
|
| 38 |
+
"label2id": {
|
| 39 |
+
"LABEL_0": 0,
|
| 40 |
+
"LABEL_1": 1,
|
| 41 |
+
"LABEL_2": 2
|
| 42 |
+
},
|
| 43 |
+
"length_penalty": 2.0,
|
| 44 |
+
"max_length": 142,
|
| 45 |
+
"max_position_embeddings": 1024,
|
| 46 |
+
"min_length": 56,
|
| 47 |
+
"model_type": "bart",
|
| 48 |
+
"no_repeat_ngram_size": 3,
|
| 49 |
+
"normalize_before": false,
|
| 50 |
+
"num_beams": 4,
|
| 51 |
+
"num_hidden_layers": 12,
|
| 52 |
+
"output_past": true,
|
| 53 |
+
"pad_token_id": 1,
|
| 54 |
+
"prefix": " ",
|
| 55 |
+
"scale_embedding": false,
|
| 56 |
+
"task_specific_params": {
|
| 57 |
+
"summarization": {
|
| 58 |
+
"early_stopping": true,
|
| 59 |
+
"length_penalty": 2.0,
|
| 60 |
+
"max_length": 142,
|
| 61 |
+
"min_length": 56,
|
| 62 |
+
"no_repeat_ngram_size": 3,
|
| 63 |
+
"num_beams": 4
|
| 64 |
+
}
|
| 65 |
+
},
|
| 66 |
+
"torch_dtype": "float32",
|
| 67 |
+
"transformers_version": "4.31.0",
|
| 68 |
+
"use_cache": true,
|
| 69 |
+
"vocab_size": 50264
|
| 70 |
+
}
|
generation_config.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_from_model_config": true,
|
| 3 |
+
"bos_token_id": 0,
|
| 4 |
+
"decoder_start_token_id": 2,
|
| 5 |
+
"early_stopping": true,
|
| 6 |
+
"eos_token_id": 2,
|
| 7 |
+
"forced_bos_token_id": 0,
|
| 8 |
+
"forced_eos_token_id": 2,
|
| 9 |
+
"length_penalty": 2.0,
|
| 10 |
+
"max_length": 142,
|
| 11 |
+
"min_length": 56,
|
| 12 |
+
"no_repeat_ngram_size": 3,
|
| 13 |
+
"num_beams": 4,
|
| 14 |
+
"pad_token_id": 1,
|
| 15 |
+
"transformers_version": "4.31.0"
|
| 16 |
+
}
|
merges.txt
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
pytorch_model.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:031e4b4460dd4ff71dfe9aac405f384bfe6936c5aaed04a302463dc324943b10
|
| 3 |
+
size 1625537802
|
special_tokens_map.json
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"bos_token": {
|
| 3 |
+
"content": "<s>",
|
| 4 |
+
"lstrip": false,
|
| 5 |
+
"normalized": true,
|
| 6 |
+
"rstrip": false,
|
| 7 |
+
"single_word": false
|
| 8 |
+
},
|
| 9 |
+
"cls_token": {
|
| 10 |
+
"content": "<s>",
|
| 11 |
+
"lstrip": false,
|
| 12 |
+
"normalized": true,
|
| 13 |
+
"rstrip": false,
|
| 14 |
+
"single_word": false
|
| 15 |
+
},
|
| 16 |
+
"eos_token": {
|
| 17 |
+
"content": "</s>",
|
| 18 |
+
"lstrip": false,
|
| 19 |
+
"normalized": true,
|
| 20 |
+
"rstrip": false,
|
| 21 |
+
"single_word": false
|
| 22 |
+
},
|
| 23 |
+
"mask_token": {
|
| 24 |
+
"content": "<mask>",
|
| 25 |
+
"lstrip": true,
|
| 26 |
+
"normalized": true,
|
| 27 |
+
"rstrip": false,
|
| 28 |
+
"single_word": false
|
| 29 |
+
},
|
| 30 |
+
"pad_token": {
|
| 31 |
+
"content": "<pad>",
|
| 32 |
+
"lstrip": false,
|
| 33 |
+
"normalized": true,
|
| 34 |
+
"rstrip": false,
|
| 35 |
+
"single_word": false
|
| 36 |
+
},
|
| 37 |
+
"sep_token": {
|
| 38 |
+
"content": "</s>",
|
| 39 |
+
"lstrip": false,
|
| 40 |
+
"normalized": true,
|
| 41 |
+
"rstrip": false,
|
| 42 |
+
"single_word": false
|
| 43 |
+
},
|
| 44 |
+
"unk_token": {
|
| 45 |
+
"content": "<unk>",
|
| 46 |
+
"lstrip": false,
|
| 47 |
+
"normalized": true,
|
| 48 |
+
"rstrip": false,
|
| 49 |
+
"single_word": false
|
| 50 |
+
}
|
| 51 |
+
}
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"add_prefix_space": false,
|
| 3 |
+
"bos_token": {
|
| 4 |
+
"__type": "AddedToken",
|
| 5 |
+
"content": "<s>",
|
| 6 |
+
"lstrip": false,
|
| 7 |
+
"normalized": true,
|
| 8 |
+
"rstrip": false,
|
| 9 |
+
"single_word": false
|
| 10 |
+
},
|
| 11 |
+
"clean_up_tokenization_spaces": true,
|
| 12 |
+
"cls_token": {
|
| 13 |
+
"__type": "AddedToken",
|
| 14 |
+
"content": "<s>",
|
| 15 |
+
"lstrip": false,
|
| 16 |
+
"normalized": true,
|
| 17 |
+
"rstrip": false,
|
| 18 |
+
"single_word": false
|
| 19 |
+
},
|
| 20 |
+
"eos_token": {
|
| 21 |
+
"__type": "AddedToken",
|
| 22 |
+
"content": "</s>",
|
| 23 |
+
"lstrip": false,
|
| 24 |
+
"normalized": true,
|
| 25 |
+
"rstrip": false,
|
| 26 |
+
"single_word": false
|
| 27 |
+
},
|
| 28 |
+
"errors": "replace",
|
| 29 |
+
"mask_token": {
|
| 30 |
+
"__type": "AddedToken",
|
| 31 |
+
"content": "<mask>",
|
| 32 |
+
"lstrip": true,
|
| 33 |
+
"normalized": true,
|
| 34 |
+
"rstrip": false,
|
| 35 |
+
"single_word": false
|
| 36 |
+
},
|
| 37 |
+
"model_max_length": 1024,
|
| 38 |
+
"pad_token": {
|
| 39 |
+
"__type": "AddedToken",
|
| 40 |
+
"content": "<pad>",
|
| 41 |
+
"lstrip": false,
|
| 42 |
+
"normalized": true,
|
| 43 |
+
"rstrip": false,
|
| 44 |
+
"single_word": false
|
| 45 |
+
},
|
| 46 |
+
"sep_token": {
|
| 47 |
+
"__type": "AddedToken",
|
| 48 |
+
"content": "</s>",
|
| 49 |
+
"lstrip": false,
|
| 50 |
+
"normalized": true,
|
| 51 |
+
"rstrip": false,
|
| 52 |
+
"single_word": false
|
| 53 |
+
},
|
| 54 |
+
"tokenizer_class": "BartTokenizer",
|
| 55 |
+
"unk_token": {
|
| 56 |
+
"__type": "AddedToken",
|
| 57 |
+
"content": "<unk>",
|
| 58 |
+
"lstrip": false,
|
| 59 |
+
"normalized": true,
|
| 60 |
+
"rstrip": false,
|
| 61 |
+
"single_word": false
|
| 62 |
+
}
|
| 63 |
+
}
|
vocab.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|