未验证 提交 88209721 编写于 作者: Y Yibing Liu 提交者: GitHub

Update doc for XLNet (#3833)

上级 ad6a16c5
......@@ -8,7 +8,21 @@ For more details, please refer to the research paper
[XLNet: Generalized Autoregressive Pretraining for Language Understanding](https://arxiv.org/abs/1906.08237)
## Directory structure
```
├── model/ # directory for model structure definition
│ ├── classifier.py # model for regression/classification
│ ├── xlnet.py # model for XLNet
├── reader/ # directory for data reader
│ ├── cls.py # data reader for regression/classification
│ ├── squad.py # data reader for squad
├── utils/ # directory for utility files
│── modeling.py # network modules
│── optimization.py # optimization method
│── run_classifier.py # script for running regression/classification task
│── run_squad.py # script for running squad
```
## Installation
......
......@@ -8,11 +8,27 @@ XLNet 与 [BERT](https://github.com/PaddlePaddle/models/tree/develop/PaddleNLP/P
[XLNet: Generalized Autoregressive Pretraining for Language Understanding](https://arxiv.org/abs/1906.08237)
## 目录结构
```
├── model/ # 模型结构定义目录
│ ├── classifier.py # 回归/分类模型结构
│ ├── xlnet.py # XLNet 模型结构
├── reader/ # 数据读取 reader 定义目录
│ ├── cls.py # 分类任务数据读取
│ ├── squad.py # squad 数据读取
├── utils/ # 辅助文件目录
│── modeling.py # 网络定义模块
│── optimization.py # 优化方法
│── run_classifier.py # 运行回归/分类任务的脚本
│── run_squad.py # 运行 squad 任务的脚本
```
## 安装
该项目要求 Paddle Fluid 1.6.0 及以上版本,请参考 [安装指南](https://www.paddlepaddle.org.cn/start) 进行安装。
## Pre-trained models
## 预训练模型
这里提供了从官方开源模型转换而来的两个预训练模型供下载
......
# Copyright (c) 2019 PaddlePaddle Authors. 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.
import re
import numpy as np
import paddle.fluid as fluid
import collections
def log_softmax(logits, axis=-1):
......
......@@ -170,6 +170,7 @@ PaddlePaddle 提供了丰富的计算单元,使得用户可以采用模块化
| ------------------------------------------------------------ | ------------------------------------------------------------ |
| [ERNIE](https://github.com/PaddlePaddle/ERNIE)(Enhanced Representation from kNowledge IntEgration) | 百度自研的语义表示模型,通过建模海量数据中的词、实体及实体关系,学习真实世界的语义知识。相较于 BERT 学习原始语言信号,ERNIE 直接对先验语义知识单元进行建模,增强了模型语义表示能力。 |
| [BERT](https://github.com/PaddlePaddle/models/tree/develop/PaddleNLP/PaddleLARK/BERT)(Bidirectional Encoder Representation from Transformers) | 一个迁移能力很强的通用语义表示模型, 以 Transformer 为网络基本组件,以双向 Masked Language Model和 Next Sentence Prediction 为训练目标,通过预训练得到通用语义表示,再结合简单的输出层,应用到下游的 NLP 任务,在多个任务上取得了 SOTA 的结果。 |
| [XLNet](https://github.com/PaddlePaddle/models/tree/develop/PaddleNLP/PaddleLARK/XLNet)(XLNet: Generalized Autoregressive Pretraining for Language Understanding) | 重要的语义表示模型之一,引入 Transformer-XL 为骨架,以 Permutation Language Modeling 为优化目标,在若干下游任务上优于 BERT 的性能。 |
| [ELMo](https://github.com/PaddlePaddle/models/tree/develop/PaddleNLP/PaddleLARK/ELMo)(Embeddings from Language Models) | 重要的通用语义表示模型之一,以双向 LSTM 为网路基本组件,以 Language Model 为训练目标,通过预训练得到通用的语义表示,将通用的语义表示作为 Feature 迁移到下游 NLP 任务中,会显著提升下游任务的模型性能。 |
#### 文本相似度计算
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册