File size: 2,175 Bytes
fbd6716
 
 
64a9b84
fbd6716
c2af364
fbd6716
 
 
 
 
 
 
 
 
 
 
 
6e37164
fbd6716
 
 
07ce302
fbd6716
 
 
07ce302
fbd6716
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6e37164
 
 
 
 
fbd6716
 
 
 
 
 
 
 
07ce302
 
 
 
8256f03
07ce302
 
 
 
 
8256f03
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
---
license: mit
tags:
- kobart-summarization-diary
- generated_from_trainer
base_model: gogamza/kobart-summarization
model-index:
- name: summary
  results: []
---

<!-- This model card has been generated automatically according to the information the Trainer had access to. You
should probably proofread and complete it, then remove this comment. -->

# summary

This model is a fine-tuned version of [gogamza/kobart-summarization](https://huggingface.co/gogamza/kobart-summarization) on an unknown dataset.
It achieves the following results on the evaluation set:
- Loss: 0.4011

## Model description

This model summarizes the diary.

## Training and evaluation data

This model was trained by the self-instruction process. All data used for fine-tuning this model were generated by chatGPT 3.5.

## Training procedure

### Training hyperparameters

The following hyperparameters were used during training:
- learning_rate: 5.6e-05
- train_batch_size: 8
- eval_batch_size: 8
- seed: 42
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
- lr_scheduler_type: linear
- lr_scheduler_warmup_steps: 300
- num_epochs: 50

### Training results

| Training Loss | Epoch | Step | Validation Loss |
|:-------------:|:-----:|:----:|:---------------:|
| 1.4804        | 1.47  | 500  | 0.4035          |
| 0.2475        | 2.93  | 1000 | 0.4011          |
| 0.1249        | 4.4   | 1500 | 0.4591          |
| 0.072         | 5.87  | 2000 | 0.4671          |
| 0.039         | 7.33  | 2500 | 0.5022          |


### Framework versions

- Transformers 4.37.2
- Pytorch 2.1.2+cu118
- Datasets 2.16.1
- Tokenizers 0.15.0


### How to Get Started with the Model
Use the code below to get started with the model. You can adjust hyperparameters to fit on your data.
```python
def diary_summary(text):
  input_ids = tokenizer.encode(text, return_tensors = 'pt').to(device)
  summary_text_ids = model.generate(input_ids = input_ids, bos_token_id = model.config.bos_token_id, eos_token_id = model.config.eos_token_id,
                                    length_penalty = 2.0, max_length = 150, num_beams = 2)
  return tokenizer.decode(summary_text_ids[0], skip_special_tokens = True)
```