CoolFace
Modelpublic

susnato/ernie-m-large_pytorch

sourceHugging Faceapache-2.0updated 4y agoView on Hugging Face
5likes30downloads
Model Card

Disclaimer :- I don't own the weights of ernie-m-large neither did I train the model. I only converted the model weights from paddle to pytorch(using the scripts listed in files).

The real(paddle) weights can be found here.

The rest of the README is copied from the same page listed above,

![paddlenlp-banner](https://github.com/PaddlePaddle/PaddleNLP)

PaddlePaddle/ernie-m-base

Ernie-M

ERNIE-M, proposed by Baidu, is a new training method that encourages the model to align the representation of multiple languages with monolingual corpora, to overcome the constraint that the parallel corpus size places on the model performance. The insight is to integrate back-translation into the pre-training process by generating pseudo-parallel sentence pairs on a monolingual corpus to enable the learning of semantic alignments between different languages, thereby enhancing the semantic modeling of cross-lingual models. Experimental results show that ERNIE-M outperforms existing cross-lingual models and delivers new state-of-the-art results in various cross-lingual downstream tasks.

We proposed two novel methods to align the representation of multiple languages:

Cross-Attention Masked Language Modeling(CAMLM): In CAMLM, we learn the multilingual semantic representation by restoring the MASK tokens in the input sentences. Back-Translation masked language modeling(BTMLM): We use BTMLM to train our model to generate pseudo-parallel sentences from the monolingual sentences. The generated pairs are then used as the input of the model to further align the cross-lingual semantics, thus enhancing the multilingual representation.

[image]

Benchmark

XNLI

XNLI is a subset of MNLI and has been translated into 14 different kinds of languages including some low-resource languages. The goal of the task is to predict testual entailment (whether sentence A implies / contradicts / neither sentence B).

ModelenfresdeelbgrutrarvithzhhiswurAvg
Cross-lingual Transfer
XLM85.078.778.977.876.677.475.372.573.176.173.276.569.668.467.375.1
Unicoder85.179.079.477.877.277.276.372.873.576.473.676.269.469.766.775.4
XLM-R85.879.780.778.777.579.678.174.273.876.574.676.772.466.568.376.2
INFOXLM86.480.680.878.977.878.977.675.674.077.073.776.772.066.467.176.2
ERNIE-M85.580.181.279.279.180.478.176.876.378.375.877.472.969.568.877.3
XLM-R Large89.184.185.183.982.984.081.279.679.880.878.180.276.973.973.880.9
INFOXLM Large89.784.585.584.183.484.281.380.980.480.878.980.977.974.873.781.4
VECO Large88.279.283.182.981.284.282.876.280.374.377.078.471.380.479.179.9
ERNIR-M Large89.385.185.784.483.784.582.081.281.281.979.281.078.676.275.482.0
Translate-Train-All
XLM85.080.881.380.379.180.978.375.677.678.576.079.572.972.868.577.8
Unicoder85.681.182.380.979.581.479.776.878.277.977.180.573.473.869.678.5
XLM-R85.481.482.280.380.481.379.778.677.379.777.980.276.173.173.079.1
INFOXLM86.182.082.881.880.982.080.279.078.880.578.380.577.473.071.679.7
ERNIE-M86.282.583.882.682.483.480.280.680.581.179.280.577.775.073.380.6
XLM-R Large89.185.186.685.785.385.983.583.283.183.781.583.781.678.078.183.6
VECO Large88.982.486.084.785.386.285.880.183.077.280.982.875.383.183.083.0
ERNIE-M Large89.586.586.986.186.086.884.183.884.184.582.183.581.179.477.984.2

Cross-lingual Named Entity Recognition

  • datasets:CoNLI
ModelennlesdeAvg
Fine-tune on English dataset
mBERT91.9777.5774.9669.5678.52
XLM-R92.2578.0876.5369.6079.11
ERNIE-M92.7878.0179.3768.0879.56
XLM-R LARGE92.9280.8078.6471.4080.94
ERNIE-M LARGE93.2881.4578.8372.9981.64
Fine-tune on all dataset
XLM-R91.0889.0987.2883.1787.66
ERNIE-M93.0491.7388.3384.2089.32
XLM-R LARGE92.0091.6089.5284.6089.43
ERNIE-M LARGE94.0193.8189.2386.2090.81

Cross-lingual Question Answering

  • datasets:MLQA
ModelenesdearhivizhAvg
mBERT77.7 / 65.264.3 / 46.657.9 / 44.345.7 / 29.843.8 / 29.757.1 / 38.657.5 / 37.357.7 / 41.6
XLM74.9 / 62.468.0 / 49.862.2 / 47.654.8 / 36.348.8 / 27.361.4 / 41.861.1 / 39.661.6 / 43.5
XLM-R77.1 / 64.667.4 / 49.660.9 / 46.754.9 / 36.659.4 / 42.964.5 / 44.761.8 / 39.363.7 / 46.3
INFOXLM81.3 / 68.269.9 / 51.964.2 / 49.660.1 / 40.965.0 / 47.570.0 / 48.664.7 / 41.267.9 / 49.7
ERNIE-M81.6 / 68.570.9 / 52.665.8 / 50.761.8 / 41.965.4 / 47.570.0 / 49.265.6 / 41.068.7 / 50.2
XLM-R LARGE80.6 / 67.874.1 / 56.068.5 / 53.663.1 / 43.562.9 / 51.671.3 / 50.968.0 / 45.470.7 / 52.7
INFOXLM LARGE84.5 / 71.675.1 / 57.371.2 / 56.267.6 / 47.672.5 / 54.275.2 / 54.169.2 / 45.473.6 / 55.2
ERNIE-M LARGE84.4 / 71.574.8 / 56.670.8 / 55.967.4 / 47.272.6 / 54.775.0 / 53.771.1 / 47.573.7 / 55.3

Cross-lingual Paraphrase Identification

  • datasets:PAWS-X
ModelendeesfrjakozhAvg
Cross-lingual Transfer
mBERT94.085.787.487.073.069.677.081.9
XLM94.085.988.387.469.364.876.580.9
MMTE93.185.187.286.972.069.275.981.3
XLM-R LARGE94.789.790.190.478.779.082.386.4
VECO LARGE96.291.391.492.081.882.985.188.7
ERNIE-M LARGE96.091.991.492.283.984.586.989.5
Translate-Train-All
VECO LARGE96.493.093.093.587.286.887.991.1
ERNIE-M LARGE96.593.593.393.887.988.489.291.8

Cross-lingual Sentence Retrieval

  • dataset:Tatoeba
ModelAvg
XLM-R LARGE75.2
VECO LARGE86.9
ERNIE-M LARGE87.9
ERNIE-M LARGE( after fine-tuning)93.3

Citation Info

text
@article{Ouyang2021ERNIEMEM,
  title={ERNIE-M: Enhanced Multilingual Representation by Aligning Cross-lingual Semantics with Monolingual Corpora},
  author={Xuan Ouyang and Shuohuan Wang and Chao Pang and Yu Sun and Hao Tian and Hua Wu and Haifeng Wang},
  journal={ArXiv},
  year={2021},
  volume={abs/2012.15674}
}