File size: 5,186 Bytes
f3f5fee
 
44a71f3
 
 
 
 
f3f5fee
 
 
 
6d76dd8
cda9923
f3f5fee
 
 
 
9835a6e
 
 
f3f5fee
 
44a71f3
 
f3f5fee
cda9923
 
 
 
 
f3f5fee
 
 
d05ed29
f3f5fee
 
 
cda9923
 
f3f5fee
 
 
cda9923
 
f3f5fee
 
 
cda9923
 
f3f5fee
 
 
cda9923
 
f3f5fee
 
 
 
 
4273acd
a3c5a8e
41100f4
 
 
 
 
 
 
 
 
 
 
 
a3c5a8e
 
 
 
 
41100f4
 
 
 
 
 
 
 
 
a3c5a8e
 
 
 
 
 
 
 
41100f4
 
 
 
 
 
 
 
 
f3f5fee
 
 
 
 
43f673f
 
f3f5fee
 
 
43f673f
 
 
 
f3f5fee
 
 
43f673f
 
f3f5fee
 
 
43f673f
f3f5fee
 
 
43f673f
 
 
 
 
 
 
 
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
---
base_model: google/gemma-2b-it
library_name: transformers
license: gemma
language:
- ko
pipeline_tag: text-generation
---

# Model Card for Model ID

The **WriteMyPaper Gemma-2-2b-it model** helps users to write abstracts of papers, fine-tuned by massive datasets of
text summarization (each section and entire paper) of korean papers. 


## Model Details

- ๋ชจ๋ธ์„ ์ž‘์„ฑํ•˜๊ณ  ํ…Œ์ŠคํŠธ ์ฝ”๋“œ๋ฅผ ์ž‘์„ฑํ–ˆ๋˜ ๊ณผ์ •์˜ ํŠœํ† ๋ฆฌ์–ผ์„ https://espebaum.github.io/ml/Gemma2FineTuning ์—์„œ ํ™•์ธํ•˜์‹ค ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
- ๊นƒํ—ˆ๋ธŒ ๋ ˆํฌ์ง€ํ† ๋ฆฌ๋Š” https://github.com/Espebaum/Gemma2b-it-Write-My-Paper ์—์„œ ํ™•์ธํ•˜์‹ค ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

### Model Description

This model is a fine-tuned version of the Gemma-2-2B-IT model, tailored for academic paper summarization and generation tasks. 
It focuses on processing large-scale academic data to **use abstract summaries to generate expanded full abstracts**.

- **Developed by:** gyopark
- **Model type:** Causal Language Model (AutoModelForCausalLM)
- **Language(s) (NLP):** Korean
- **License:** Gemma Term of Use 
- **Finetuned from model [optional]:** google/gemma-2-2b-it

### Model Sources [optional]

- **Repository:** https://huggingface.co/gyopark/gemma-2-2b-it-WriteMyPaper

### Direct Use

This model is designed for use in academic environments where summarizing, analyzing, and generating longer texts based on research papers or technical documents is required. 
**Users can input a brief overview of the abstract, and the model will provide a detailed expansion of the content**.

### Downstream Use [optional]

The model can be further fine-tuned for specific domains within academic writing, such as biomedical research, legal papers, or engineering documentation. 
It can also be integrated into platforms for automated academic writing assistance or research paper generation.

### Out-of-Scope Use

The model is not suitable for general-purpose text generation outside academic or technical contexts. 
It may not perform well in creative writing tasks or in generating content without structured input like research articles.

### Recommendations

Users should ensure that the input is structured in a format appropriate for academic or technical summarization. 
Since the model generates based on existing research content, it is recommended to verify the accuracy of the output for fact-checking.

## How to Get Started with the Model

Use the code below to get started with the model.

```python
from transformers import AutoTokenizer, AutoModelForCausalLM, pipeline

FINETUNED_MODEL = "gyopark/gemma-2-2b-it-WriteMyPaper"

model = AutoModelForCausalLM.from_pretrained(FINETUNED_MODEL, device_map="auto")
tokenizer = AutoTokenizer.from_pretrained(FINETUNED_MODEL)

pipe = pipeline(
    "text-generation", 
    model=model, 
    tokenizer=tokenizer, 
)

# doc
<!-- ํ•œใ†์ค‘ใ†์ผ 3๊ตญ์˜ ์ •์น˜์  ํƒœ๋„์™€ ์‚ฌํšŒ๊ฒฝ์ œ์ฒด์ œ๋ฅผ โ€˜์„ธ๊ณ„๊ฐ€์น˜๊ด€์กฐ์‚ฌโ€™ ์ž๋ฃŒ๋ฅผ ์ด์šฉํ•˜์—ฌ ๊ตญ๊ฐ€ ๊ฐ„ ๋น„๊ต๋ถ„์„ํ•˜์˜€๋‹ค.
์ค‘๊ตญ์˜ ์•„์‹œ์•„์  ๊ฐ€์น˜ ์ง€ํ–ฅ์„ฑ์ด ๊ฐ€์žฅ ๋†’๊ณ  ์ผ๋ณธ์ด ๊ฐ€์žฅ ๋‚ฎ๋‹ค. ์„œ๊ตฌ์  ๋ฏผ์ฃผ์ฃผ์˜ ์ง€ํ–ฅ์„ฑ์€ ์ผ๋ณธ์ด ๊ฐ€์žฅ ๋†’๊ณ  ํ•œ๊ตญ์ด ๊ทธ ๋‹ค์Œ์ด๋ฉฐ ์ค‘๊ตญ์ด ๊ฐ€์žฅ ๋‚ฎ๋‹ค.
ํ•œใ†์ค‘ใ†์ผ 3๊ตญ์˜ ์ •์น˜์  ํƒœ๋„์—์„œ์˜ ์ฐจ์ด๋Š” ์‚ฌํšŒ๊ตฌ์กฐ์  ๋ณ€๋™ ๊ฒฝํ—˜์„ ๋ฐ˜์˜ํ•˜๋Š” ๊ฒƒ์ด๋‹ค. -->

messages = [
    {
        "role": "user",
        "content": "๋‹ค์Œ ์š”์•ฝ๋œ ๊ธ€์„ ํ•œ ๋ฌธ๋‹จ์œผ๋กœ ๊ธธ๊ฒŒ ์จ์ฃผ์„ธ์š”.:\n\n{}".format(doc)
    }
]

prompt = pipe.tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)

# prompt
<!-- <bos><start_of_turn>user
\n๋‹ค์Œ ์š”์•ฝ๋œ ๊ธ€์„ ํ•œ ๋ฌธ๋‹จ์œผ๋กœ ๊ธธ๊ฒŒ ์จ์ฃผ์„ธ์š”.:\n
\nํ•œใ†์ค‘ใ†์ผ 3๊ตญ์˜ ์ •์น˜์  ํƒœ๋„์™€ ์‚ฌํšŒ๊ฒฝ์ œ์ฒด์ œ๋ฅผ โ€˜์„ธ๊ณ„๊ฐ€์น˜๊ด€์กฐ์‚ฌโ€™ ์ž๋ฃŒ๋ฅผ ์ด์šฉํ•˜์—ฌ ๊ตญ๊ฐ€ ๊ฐ„ ๋น„๊ต๋ถ„์„ํ•˜์˜€๋‹ค.
์ค‘๊ตญ์˜ ์•„์‹œ์•„์  ๊ฐ€์น˜ ์ง€ํ–ฅ์„ฑ์ด ๊ฐ€์žฅ ๋†’๊ณ  ์ผ๋ณธ์ด ๊ฐ€์žฅ ๋‚ฎ๋‹ค. ์„œ๊ตฌ์  ๋ฏผ์ฃผ์ฃผ์˜ ์ง€ํ–ฅ์„ฑ์€ ์ผ๋ณธ์ด ๊ฐ€์žฅ ๋†’๊ณ  ํ•œ๊ตญ์ด ๊ทธ ๋‹ค์Œ์ด๋ฉฐ ์ค‘๊ตญ์ด ๊ฐ€์žฅ ๋‚ฎ๋‹ค.
ํ•œใ†์ค‘ใ†์ผ 3๊ตญ์˜ ์ •์น˜์  ํƒœ๋„์—์„œ์˜ ์ฐจ์ด๋Š” ์‚ฌํšŒ๊ตฌ์กฐ์  ๋ณ€๋™ ๊ฒฝํ—˜์„ ๋ฐ˜์˜ํ•˜๋Š” ๊ฒƒ์ด๋‹ค.<end_of_turn>\n
<start_of_turn>model\n -->

outputs = pipe(
    prompt,
    do_sample=True,
    add_special_tokens=True,
    max_new_tokens=1024
)

outputs[0]['generated_text']
```

## Training Details

### Training Data

The model was fine-tuned on a dataset of academic papers, including research articles and technical reports, 
focusing on generating accurate summaries and expanding scientific content.

### Training Procedure

- **Training regime:** Mixed precision (fp16)
- **Hardware:** 1 L4 GPU
- **Training time:** Approximately 3 hours
- **Fine-tuning approach:** Low-Rank Adaptation (LoRA)

#### Summary

The model effectively processes academic papers, providing high-quality summaries and generating longer expansions of sections or abstracts. 
It supports Korean research documents.

## Citation [optional]

### Citation

**BibTeX:**

```bibtex
@misc{gyopark_gemma_2_2b_it_WriteMyPaper, 
  author = {gyopark}, 
  title = {WriteMyPaper}, 
  year = {2024}, 
  url = {https://huggingface.co/gyopark/gemma-2-2b-it-WriteMyPaper}, 
}
```