junnyu commited on
Commit
da2234d
1 Parent(s): a5aafc6

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +55 -0
README.md CHANGED
@@ -13,6 +13,61 @@ https://github.com/ZhuiyiTechnology/roformer-v2
13
  ### pytorch版本+tf2.0版本
14
  https://github.com/JunnYu/RoFormer_pytorch
15
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  ### 安装
17
  - pip install roformer==0.4.3
18
 
 
13
  ### pytorch版本+tf2.0版本
14
  https://github.com/JunnYu/RoFormer_pytorch
15
 
16
+ ## 评测对比
17
+ ### CLUE-dev榜单分类任务结果,base+large版本。
18
+
19
+ | | iflytek | tnews | afqmc | cmnli | ocnli | wsc | csl |
20
+ | :-----: | :-----: | :---: | :---: | :---: | :---: | :---: | :---: |
21
+ | BERT | 60.06 | 56.80 | 72.41 | 79.56 | 73.93 | 78.62 | 83.93 |
22
+ | RoBERTa | 60.64 | 58.06 | 74.05 | 81.24 | 76.00 | 87.50 | 84.50 |
23
+ | RoFormer | 60.91 | 57.54 | 73.52 | 80.92 | 76.07 | 86.84 | 84.63 |
24
+ | RoFormerV2<sup>*</sup> | 60.87 | 56.54 | 72.75 | 80.34 | 75.36 | 80.92 | 84.67 |
25
+ | GAU-α | 61.41 | 57.76 | 74.17 | 81.82 | 75.86 | 79.93 | 85.67 |
26
+ | RoFormer-pytorch(本仓库代码) | 60.60 | 57.51 | 74.44 | 80.79 | 75.67 | 86.84 | 84.77 |
27
+ | RoFormerV2-pytorch(本仓库代码) | **62.87** | 59.03 | **76.20** | 80.85 | 79.73 | 87.82 | **91.87** |
28
+ | GAU-α-pytorch(Adafactor) | 61.18 | 57.52 | 73.42 | 80.91 | 75.69 | 80.59 | 85.5 |
29
+ | GAU-α-pytorch(AdamW wd0.01 warmup0.1) | 60.68 | 57.95 | 73.08 | 81.02 | 75.36 | 81.25 | 83.93 |
30
+ | RoFormerV2-large-pytorch(本仓库代码) | 61.75 | **59.21** | 76.14 | 82.35 | **81.73** | **91.45** | 91.5 |
31
+ | Chinesebert-large-pytorch | 61.25 | 58.67 | 74.70 | **82.65** | 79.63 | 87.83 | 84.97 |
32
+
33
+
34
+ ### CLUE-1.0-test榜单分类任务结果,base+large版本。
35
+
36
+ | | iflytek | tnews | afqmc | cmnli | ocnli | wsc | csl |
37
+ | :-----: | :-----: | :---: | :---: | :---: | :---: | :---: | :---: |
38
+ | RoFormer-pytorch(本仓库代码) | 59.54 | 57.34 | 74.46 | 80.23 | 73.67 | 80.69 | 84.57 |
39
+ | RoFormerV2-pytorch(本仓库代码) | **63.15** | 58.24 | 75.42 | 80.59 | 74.17 | 83.79 | 83.73 |
40
+ | GAU-α-pytorch(Adafactor) | 61.38 | 57.08 | 74.05 | 80.37 | 73.53 | 74.83 | **85.6** |
41
+ | GAU-α-pytorch(AdamW wd0.01 warmup0.1) | 60.54 | 57.67 | 72.44 | 80.32 | 72.97 | 76.55 | 84.13 |
42
+ | RoFormerV2-large-pytorch(本仓库代码) | 61.85 | **59.13** | **76.38** | 80.97 | 76.23 | **85.86** | 84.33 |
43
+ | Chinesebert-large-pytorch | 61.54 | 58.57 | 74.8 | **81.94** | **76.93** | 79.66 | 85.1 |
44
+
45
+ ### 注:
46
+ - 其中RoFormerV2<sup>*</sup>表示的是未进行多任务学习的RoFormerV2模型,该模型苏神并未开源,感谢苏神的提醒。
47
+ - 其中不带有pytorch后缀结果都是从[GAU-alpha](https://github.com/ZhuiyiTechnology/GAU-alpha)仓库复制过来的。
48
+ - 其中带有pytorch后缀的结果都是自己训练得出的。
49
+ - 苏神代码中拿了cls标签后直接进行了分类,而本仓库使用了如下的分类头,多了2个dropout,1个dense,1个relu激活。
50
+
51
+ ```python
52
+ class RoFormerClassificationHead(nn.Module):
53
+ def __init__(self, config):
54
+ super().__init__()
55
+ self.dense = nn.Linear(config.hidden_size, config.hidden_size)
56
+ self.dropout = nn.Dropout(config.hidden_dropout_prob)
57
+ self.out_proj = nn.Linear(config.hidden_size, config.num_labels)
58
+
59
+ self.config = config
60
+
61
+ def forward(self, features, **kwargs):
62
+ x = features[:, 0, :] # take <s> token (equiv. to [CLS])
63
+ x = self.dropout(x)
64
+ x = self.dense(x)
65
+ x = ACT2FN[self.config.hidden_act](x) # 这里是relu
66
+ x = self.dropout(x)
67
+ x = self.out_proj(x)
68
+ return x
69
+ ```
70
+
71
  ### 安装
72
  - pip install roformer==0.4.3
73