未验证 提交 94631f03 编写于 作者: S Steffy-zxf 提交者: GitHub

update docs (#5095)

* update codes

* update codes

* update codes

* update docs

* update docs
上级 c29f5ca1
...@@ -99,6 +99,15 @@ For more pretrained model selection, please refer to [Pretrained-Models](./docs/ ...@@ -99,6 +99,15 @@ For more pretrained model selection, please refer to [Pretrained-Models](./docs/
Please refer to our official AI Studio account for more interactive tutorials: [PaddleNLP on AI Studio](https://aistudio.baidu.com/aistudio/personalcenter/thirdview/574995) Please refer to our official AI Studio account for more interactive tutorials: [PaddleNLP on AI Studio](https://aistudio.baidu.com/aistudio/personalcenter/thirdview/574995)
* [paddlenlp.seq2vec是什么? 瞧瞧它怎么完成情感分析教程](https://aistudio.baidu.com/aistudio/projectdetail/1294333) shows how to use lstm to do sentiment analysis.
* [使用PaddleNLP语义预训练模型ERNIE优化情感分析教程](https://aistudio.baidu.com/aistudio/projectdetail/1283423) shows how to exploit the pretrained ERNIE to make sentiment analysis better.
* [基于Bi-GRU+CRF的快递单信息抽取](https://aistudio.baidu.com/aistudio/projectdetail/1317771) shows how to make use of bigru and crf to do information extraction.
* [使用PaddleNLP预训练模型ERNIE优化快递单信息抽取](https://aistudio.baidu.com/aistudio/projectdetail/1329361) shows how to exploit the pretrained ERNIE to do information extraction better.
## Community ## Community
* SIG for Pretrained Model Contribution * SIG for Pretrained Model Contribution
......
...@@ -87,10 +87,22 @@ For more pretrained model selection, please refer to [PretrainedModels](./paddle ...@@ -87,10 +87,22 @@ For more pretrained model selection, please refer to [PretrainedModels](./paddle
* [Metrics API](./docs/embeddings.md) * [Metrics API](./docs/embeddings.md)
* [Models API](./docs/models.md) * [Models API](./docs/models.md)
## Tutorials ## Tutorials
Please refer to our official AI Studio account for more interactive tutorials: [PaddleNLP on AI Studio](https://aistudio.baidu.com/aistudio/personalcenter/thirdview/574995) Please refer to our official AI Studio account for more interactive tutorials: [PaddleNLP on AI Studio](https://aistudio.baidu.com/aistudio/personalcenter/thirdview/574995)
* [paddlenlp.seq2vec是什么? 瞧瞧它怎么完成情感分析教程](https://aistudio.baidu.com/aistudio/projectdetail/1294333) shows how to use lstm to do sentiment analysis.
* [使用PaddleNLP语义预训练模型ERNIE优化情感分析教程](https://aistudio.baidu.com/aistudio/projectdetail/1283423) shows how to exploit the pretrained ERNIE to make sentiment analysis better.
* [基于Bi-GRU+CRF的快递单信息抽取](https://aistudio.baidu.com/aistudio/projectdetail/1317771) shows how to make use of bigru and crf to do information extraction.
* [使用PaddleNLP预训练模型ERNIE优化快递单信息抽取](https://aistudio.baidu.com/aistudio/projectdetail/1329361) shows how to exploit the pretrained ERNIE to do information extraction better.
## Community ## Community
* SIG for Pretrained Model Contribution * SIG for Pretrained Model Contribution
......
...@@ -9,3 +9,13 @@ ...@@ -9,3 +9,13 @@
## Pretrained Model (PTMs) ## Pretrained Model (PTMs)
[Pretrained Models](./pretrained_models) 展示了如何使用以ERNIE为代表的模型Fine-tune完成文本分类任务。 [Pretrained Models](./pretrained_models) 展示了如何使用以ERNIE为代表的模型Fine-tune完成文本分类任务。
## 线上体验教程
* [paddlenlp.seq2vec是什么? 瞧瞧它怎么完成情感分析教程](https://aistudio.baidu.com/aistudio/projectdetail/1294333)展示了使用序列模型LSTM完成情感分析任务。
* [使用PaddleNLP语义预训练模型ERNIE优化情感分析教程](https://aistudio.baidu.com/aistudio/projectdetail/1283423)展示了使用ERNIE优化情感分析任务。
* [基于Bi-GRU+CRF的快递单信息抽取](https://aistudio.baidu.com/aistudio/projectdetail/1317771)
* [使用PaddleNLP预训练模型ERNIE优化快递单信息抽取](https://aistudio.baidu.com/aistudio/projectdetail/1329361)
...@@ -125,3 +125,13 @@ Data: 这个宾馆比较陈旧了,特价的房间也很一般。总体来说 ...@@ -125,3 +125,13 @@ Data: 这个宾馆比较陈旧了,特价的房间也很一般。总体来说
Data: 怀着十分激动的心情放映,可是看着看着发现,在放映完毕后,出现一集米老鼠的动画片 Label: negative Data: 怀着十分激动的心情放映,可是看着看着发现,在放映完毕后,出现一集米老鼠的动画片 Label: negative
Data: 作为老的四星酒店,房间依然很整洁,相当不错。机场接机服务很好,可以在车上办理入住手续,节省时间。 Label: positive Data: 作为老的四星酒店,房间依然很整洁,相当不错。机场接机服务很好,可以在车上办理入住手续,节省时间。 Label: positive
``` ```
## 线上体验教程
* [paddlenlp.seq2vec是什么? 瞧瞧它怎么完成情感分析教程](https://aistudio.baidu.com/aistudio/projectdetail/1294333)展示了使用序列模型LSTM完成情感分析任务。
* [使用PaddleNLP语义预训练模型ERNIE优化情感分析教程](https://aistudio.baidu.com/aistudio/projectdetail/1283423)展示了使用ERNIE优化情感分析任务。
* [基于Bi-GRU+CRF的快递单信息抽取](https://aistudio.baidu.com/aistudio/projectdetail/1317771)
* [使用PaddleNLP预训练模型ERNIE优化快递单信息抽取](https://aistudio.baidu.com/aistudio/projectdetail/1329361)
...@@ -161,3 +161,13 @@ Data: 这个宾馆比较陈旧了,特价的房间也很一般。总体来说 ...@@ -161,3 +161,13 @@ Data: 这个宾馆比较陈旧了,特价的房间也很一般。总体来说
Data: 怀着十分激动的心情放映,可是看着看着发现,在放映完毕后,出现一集米老鼠的动画片 Lable: negative Data: 怀着十分激动的心情放映,可是看着看着发现,在放映完毕后,出现一集米老鼠的动画片 Lable: negative
Data: 作为老的四星酒店,房间依然很整洁,相当不错。机场接机服务很好,可以在车上办理入住手续,节省时间。 Lable: positive Data: 作为老的四星酒店,房间依然很整洁,相当不错。机场接机服务很好,可以在车上办理入住手续,节省时间。 Lable: positive
``` ```
## 线上体验教程
* [paddlenlp.seq2vec是什么? 瞧瞧它怎么完成情感分析教程](https://aistudio.baidu.com/aistudio/projectdetail/1294333)展示了使用序列模型LSTM完成情感分析任务。
* [使用PaddleNLP语义预训练模型ERNIE优化情感分析教程](https://aistudio.baidu.com/aistudio/projectdetail/1283423)展示了使用ERNIE优化情感分析任务。
* [基于Bi-GRU+CRF的快递单信息抽取](https://aistudio.baidu.com/aistudio/projectdetail/1317771)
* [使用PaddleNLP预训练模型ERNIE优化快递单信息抽取](https://aistudio.baidu.com/aistudio/projectdetail/1329361)
...@@ -91,7 +91,6 @@ def convert_example(example, ...@@ -91,7 +91,6 @@ def convert_example(example,
title_segment_ids(obj: `list[int]`): List of title sequence pair mask. title_segment_ids(obj: `list[int]`): List of title sequence pair mask.
label(obj:`numpy.array`, data type of int64, optional): The input label if not is_test. label(obj:`numpy.array`, data type of int64, optional): The input label if not is_test.
""" """
print(example)
query, title = example[0], example[1] query, title = example[0], example[1]
query_encoded_inputs = tokenizer.encode( query_encoded_inputs = tokenizer.encode(
...@@ -193,7 +192,7 @@ if __name__ == "__main__": ...@@ -193,7 +192,7 @@ if __name__ == "__main__":
args.model_type = args.model_type.lower() args.model_type = args.model_type.lower()
model_class, tokenizer_class = MODEL_CLASSES[args.model_type] model_class, tokenizer_class = MODEL_CLASSES[args.model_type]
if args.model_name == 'ernie_tiny': if args.model_name == 'ernie-tiny':
# ErnieTinyTokenizer is special for ernie_tiny pretained model. # ErnieTinyTokenizer is special for ernie_tiny pretained model.
tokenizer = ppnlp.transformers.ErnieTinyTokenizer.from_pretrained( tokenizer = ppnlp.transformers.ErnieTinyTokenizer.from_pretrained(
args.model_name) args.model_name)
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
__version__ = '2.0.0a8' __version__ = '2.0.0a9'
from . import data from . import data
from . import datasets from . import datasets
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册