File size: 5,829 Bytes
17c6d62
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
<!--Copyright 2020 The HuggingFace Team. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.

โš ๏ธ Note that this file is in Markdown but contain specific syntax for our doc-builder (similar to MDX) that may not be
rendered properly in your Markdown viewer.

-->

# ConvBERT [[convbert]]

<div class="flex flex-wrap space-x-1">
<a href="https://huggingface.co/models?filter=convbert">
<img alt="Models" src="https://img.shields.io/badge/All_model_pages-convbert-blueviolet">
</a>
<a href="https://huggingface.co/spaces/docs-demos/conv-bert-base">
<img alt="Spaces" src="https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Spaces-blue">
</a>
</div>

## ๊ฐœ์š” [[overview]]

ConvBERT ๋ชจ๋ธ์€ Zihang Jiang, Weihao Yu, Daquan Zhou, Yunpeng Chen, Jiashi Feng, Shuicheng Yan์— ์˜ํ•ด ์ œ์•ˆ๋˜์—ˆ์œผ๋ฉฐ, ์ œ์•ˆ ๋…ผ๋ฌธ ์ œ๋ชฉ์€ [ConvBERT: Improving BERT with Span-based Dynamic Convolution](https://arxiv.org/abs/2008.02496)์ž…๋‹ˆ๋‹ค.

๋…ผ๋ฌธ์˜ ์ดˆ๋ก์€ ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค:

*BERT์™€ ๊ทธ ๋ณ€ํ˜• ๋ชจ๋ธ๊ณผ ๊ฐ™์€ ์‚ฌ์ „ ํ•™์Šต๋œ ์–ธ์–ด ๋ชจ๋ธ๋“ค์€ ์ตœ๊ทผ ๋‹ค์–‘ํ•œ ์ž์—ฐ์–ด ์ดํ•ด ๊ณผ์ œ์—์„œ ๋†€๋ผ์šด ์„ฑ๊ณผ๋ฅผ ์ด๋ฃจ์—ˆ์Šต๋‹ˆ๋‹ค. ๊ทธ๋Ÿฌ๋‚˜ BERT๋Š” ๊ธ€๋กœ๋ฒŒ ์…€ํ”„ ์–ดํ…์…˜ ๋ธ”๋ก์— ํฌ๊ฒŒ ์˜์กดํ•˜๊ธฐ ๋•Œ๋ฌธ์— ๋ฉ”๋ชจ๋ฆฌ ์‚ฌ์šฉ๋Ÿ‰์ด ๋งŽ๊ณ  ๊ณ„์‚ฐ ๋น„์šฉ์ด ํฝ๋‹ˆ๋‹ค. ๋ชจ๋“  ์–ดํ…์…˜ ํ—ค๋“œ๊ฐ€ ๊ธ€๋กœ๋ฒŒ ๊ด€์ ์—์„œ ์–ดํ…์…˜ ๋งต์„ ์ƒ์„ฑํ•˜๊ธฐ ์œ„ํ•ด ์ž…๋ ฅ ์‹œํ€€์Šค ์ „์ฒด๋ฅผ ํƒ์ƒ‰ํ•˜์ง€๋งŒ, ์ผ๋ถ€ ํ—ค๋“œ๋Š” ๋กœ์ปฌ ์ข…์†์„ฑ๋งŒ ํ•™์Šตํ•  ํ•„์š”๊ฐ€ ์žˆ๋‹ค๋Š” ๊ฒƒ์„ ๋ฐœ๊ฒฌํ–ˆ์Šต๋‹ˆ๋‹ค. ์ด๋Š” ๋ถˆํ•„์š”ํ•œ ๊ณ„์‚ฐ์ด ํฌํ•จ๋˜์–ด ์žˆ์Œ์„ ์˜๋ฏธํ•ฉ๋‹ˆ๋‹ค. ๋”ฐ๋ผ์„œ ์šฐ๋ฆฌ๋Š” ์ด๋Ÿฌํ•œ self-attention ํ—ค๋“œ๋“ค์„ ๋Œ€์ฒดํ•˜์—ฌ ๋กœ์ปฌ ์ข…์†์„ฑ์„ ์ง์ ‘ ๋ชจ๋ธ๋งํ•˜๊ธฐ ์œ„ํ•ด ์ƒˆ๋กœ์šด span ๊ธฐ๋ฐ˜ ๋™์  ์ปจ๋ณผ๋ฃจ์…˜์„ ์ œ์•ˆํ•ฉ๋‹ˆ๋‹ค. ์ƒˆ๋กœ์šด ์ปจ๋ณผ๋ฃจ์…˜ ํ—ค๋“œ์™€ ๋‚˜๋จธ์ง€ self-attention ํ—ค๋“œ๋“ค์ด ๊ฒฐํ•ฉํ•˜์—ฌ ๊ธ€๋กœ๋ฒŒ ๋ฐ ๋กœ์ปฌ ๋ฌธ๋งฅ ํ•™์Šต์— ๋” ํšจ์œจ์ ์ธ ํ˜ผํ•ฉ ์–ดํ…์…˜ ๋ธ”๋ก์„ ๊ตฌ์„ฑํ•ฉ๋‹ˆ๋‹ค. ์šฐ๋ฆฌ๋Š” BERT์— ์ด ํ˜ผํ•ฉ ์–ดํ…์…˜ ์„ค๊ณ„๋ฅผ ์ ์šฉํ•˜์—ฌ ConvBERT ๋ชจ๋ธ์„ ๊ตฌ์ถ•ํ–ˆ์Šต๋‹ˆ๋‹ค. ์‹คํ—˜ ๊ฒฐ๊ณผ, ConvBERT๋Š” ๋‹ค์–‘ํ•œ ๋‹ค์šด์ŠคํŠธ๋ฆผ ๊ณผ์ œ์—์„œ BERT ๋ฐ ๊ทธ ๋ณ€ํ˜• ๋ชจ๋ธ๋ณด๋‹ค ๋” ์šฐ์ˆ˜ํ•œ ์„ฑ๋Šฅ์„ ๋ณด์˜€์œผ๋ฉฐ, ํ›ˆ๋ จ ๋น„์šฉ๊ณผ ๋ชจ๋ธ ํŒŒ๋ผ๋ฏธํ„ฐ ์ˆ˜๊ฐ€ ๋” ์ ์—ˆ์Šต๋‹ˆ๋‹ค. ํŠนํžˆ ConvBERTbase ๋ชจ๋ธ์€ GLUE ์Šค์ฝ”์–ด 86.4๋ฅผ ๋‹ฌ์„ฑํ•˜์—ฌ ELECTRAbase๋ณด๋‹ค 0.7 ๋†’์€ ์„ฑ๊ณผ๋ฅผ ๋ณด์ด๋ฉฐ, ํ›ˆ๋ จ ๋น„์šฉ์€ 1/4 ์ดํ•˜๋กœ ์ค„์—ˆ์Šต๋‹ˆ๋‹ค. ์ฝ”๋“œ์™€ ์‚ฌ์ „ ํ•™์Šต๋œ ๋ชจ๋ธ์€ ๊ณต๊ฐœ๋  ์˜ˆ์ •์ž…๋‹ˆ๋‹ค.*

์ด ๋ชจ๋ธ์€ [abhishek](https://huggingface.co/abhishek)์— ์˜ํ•ด ๊ธฐ์—ฌ๋˜์—ˆ์œผ๋ฉฐ, ์›๋ณธ ๊ตฌํ˜„์€ ์—ฌ๊ธฐ์—์„œ ์ฐพ์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค : https://github.com/yitu-opensource/ConvBert



## ์‚ฌ์šฉ ํŒ [[usage-tips]]
ConvBERT ํ›ˆ๋ จ ํŒ์€ BERT์™€ ์œ ์‚ฌํ•ฉ๋‹ˆ๋‹ค. ์‚ฌ์šฉ ํŒ์€ [BERT ๋ฌธ์„œ](bert).๋ฅผ ์ฐธ๊ณ ํ•˜์‹ญ์‹œ์˜ค.


## ๋ฆฌ์†Œ์Šค [[resources]]

- [ํ…์ŠคํŠธ ๋ถ„๋ฅ˜ ์ž‘์—… ๊ฐ€์ด๋“œ (Text classification task guide)](../tasks/sequence_classification)
- [ํ† ํฐ ๋ถ„๋ฅ˜ ์ž‘์—… ๊ฐ€์ด๋“œ (Token classification task guide)](../tasks/token_classification)
- [์งˆ์˜์‘๋‹ต ์ž‘์—… ๊ฐ€์ด๋“œ (Question answering task guide)](../tasks/question_answering)
- [๋งˆ์Šคํ‚น๋œ ์–ธ์–ด ๋ชจ๋ธ๋ง ์ž‘์—… ๊ฐ€์ด๋“œ (Masked language modeling task guide)](../tasks/masked_language_modeling)
- [๋‹ค์ค‘ ์„ ํƒ ์ž‘์—… ๊ฐ€์ด๋“œ (Multiple choice task guide)](../tasks/multiple_choice)

## ConvBertConfig [[transformers.ConvBertConfig]]

[[autodoc]] ConvBertConfig

## ConvBertTokenizer [[transformers.ConvBertTokenizer]]

[[autodoc]] ConvBertTokenizer
    - build_inputs_with_special_tokens
    - get_special_tokens_mask
    - create_token_type_ids_from_sequences
    - save_vocabulary

## ConvBertTokenizerFast [[transformers.ConvBertTokenizerFast]]

[[autodoc]] ConvBertTokenizerFast

<frameworkcontent>
<pt>

## ConvBertModel [[transformers.ConvBertModel]]

[[autodoc]] ConvBertModel
    - forward

## ConvBertForMaskedLM [[transformers.ConvBertForMaskedLM]]

[[autodoc]] ConvBertForMaskedLM
    - forward

## ConvBertForSequenceClassification [[transformers.ConvBertForSequenceClassification]]

[[autodoc]] ConvBertForSequenceClassification
    - forward

## ConvBertForMultipleChoice [[transformers.ConvBertForMultipleChoice]]

[[autodoc]] ConvBertForMultipleChoice
    - forward

## ConvBertForTokenClassification [[transformers.ConvBertForTokenClassification]]

[[autodoc]] ConvBertForTokenClassification
    - forward

## ConvBertForQuestionAnswering [[transformers.ConvBertForQuestionAnswering]]

[[autodoc]] ConvBertForQuestionAnswering
    - forward

</pt>
<tf>

## TFConvBertModel [[transformers.TFConvBertModel]]

[[autodoc]] TFConvBertModel
    - call

## TFConvBertForMaskedLM [[transformers.TFConvBertForMaskedLM]]

[[autodoc]] TFConvBertForMaskedLM 
    - call

## TFConvBertForSequenceClassification [[transformers.TFConvBertForSequenceClassification]]

[[autodoc]] TFConvBertForSequenceClassification
    - call

## TFConvBertForMultipleChoice [[transformers.TFConvBertForMultipleChoice]]

[[autodoc]] TFConvBertForMultipleChoice
    - call

## TFConvBertForTokenClassification [[transformers.TFConvBertForTokenClassification]]

[[autodoc]] TFConvBertForTokenClassification
    - call

## TFConvBertForQuestionAnswering [[transformers.TFConvBertForQuestionAnswering]]

[[autodoc]] TFConvBertForQuestionAnswering
    - call

</tf>
</frameworkcontent>