Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2703379

Browse files
linjiecccZeyuChenjoey12300
authored
Update README.md (PaddlePaddle#2177)
* Update README.md * fix codestyle * fix codestyle Co-authored-by: Zeyu Chen <[email protected]> Co-authored-by: zhoushunjie <[email protected]>
1 parent e4e0baa commit 2703379

9 files changed

Lines changed: 31 additions & 37 deletions

File tree

README.md

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<a href=#安装> 安装 </a> |
2525
<a href=#QuickStart> 快速开始 </a> |
2626
<a href=#API文档> API文档 </a> |
27-
<a href=#社区交流> 社区交流 </a>
27+
<a href=#社区交流> 社区交流 </a>
2828
</h4>
2929

3030
## News <img src="./docs/imgs/news_icon.png" width="40"/>
@@ -48,11 +48,11 @@ PaddleNLP是飞桨自然语言处理开发库,旨在提升开发者在文本
4848

4949
#### <img src="https://user-images.githubusercontent.com/11793384/168454776-2075cc68-9402-4b0b-8723-5be0a315ddc3.png" width="20" height="20" /><a href=#开箱即用的NLP能力> 开箱即用的NLP能力 </a>
5050

51-
#### <img src="https://user-images.githubusercontent.com/11793384/168454751-f111d8b4-a16a-4e36-b9de-3af8a2f00714.png" width="20" height="20" /><a href=#丰富完备的中文模型库> 丰富完备的中文模型库 </a>
51+
#### <img src="https://user-images.githubusercontent.com/11793384/168454751-f111d8b4-a16a-4e36-b9de-3af8a2f00714.png" width="20" height="20" /><a href=#丰富完备的中文模型库> 丰富完备的中文模型库 </a>
5252

53-
#### <img src="https://user-images.githubusercontent.com/11793384/168454721-0ac49e17-22db-4074-ba20-940365daf9f6.png" width="20" height="20" /><a href=#产业级端到端系统范例> 产业级端到端系统范例 </a>
53+
#### <img src="https://user-images.githubusercontent.com/11793384/168454721-0ac49e17-22db-4074-ba20-940365daf9f6.png" width="20" height="20" /><a href=#产业级端到端系统范例> 产业级端到端系统范例 </a>
5454

55-
#### <img src="https://user-images.githubusercontent.com/11793384/168454587-8b5a0f63-3d4b-4339-be47-f3ad7ef9e16c.png" width="20" height="20" /><a href=#高性能分布式训练与推理> 高性能分布式训练与推理 </a>
55+
#### <img src="https://user-images.githubusercontent.com/11793384/168454587-8b5a0f63-3d4b-4339-be47-f3ad7ef9e16c.png" width="20" height="20" /><a href=#高性能分布式训练与推理> 高性能分布式训练与推理 </a>
5656

5757

5858
### 开箱即用的NLP能力
@@ -267,16 +267,16 @@ pip install --upgrade paddlenlp
267267

268268
- 一键预测
269269

270-
PaddleNLP提供[一键预测功能](./docs/model_zoo/taskflow.md),无需训练,直接输入数据,即可得到预测结果,以情感分析任务为例
270+
PaddleNLP提供[一键预测功能](./docs/model_zoo/taskflow.md),无需训练,直接输入数据,即可得到预测结果:
271271

272272
```python
273-
from pprint import pprint
274-
from paddlenlp import Taskflow
273+
>>> from pprint import pprint
274+
>>> from paddlenlp import Taskflow
275275

276-
schema = ['时间', '选手', '赛事名称'] # Define the schema for entity extraction
277-
ie = Taskflow('information_extraction', schema=schema)
278-
pprint(ie("2月8日上午北京冬奥会自由式滑雪女子大跳台决赛中中国选手谷爱凌以188.25分获得金牌!"))
279-
>>> [{'时间': [{'end': 6,
276+
>>> schema = ['时间', '选手', '赛事名称'] # Define the schema for entity extraction
277+
>>> ie = Taskflow('information_extraction', schema=schema)
278+
>>> pprint(ie("2月8日上午北京冬奥会自由式滑雪女子大跳台决赛中中国选手谷爱凌以188.25分获得金牌!"))
279+
[{'时间': [{'end': 6,
280280
'probability': 0.9857378532924486,
281281
'start': 0,
282282
'text': '2月8日上午'}],
@@ -292,13 +292,7 @@ pprint(ie("2月8日上午北京冬奥会自由式滑雪女子大跳台决赛中
292292

293293
- 定制训练
294294

295-
如果对一键预测效果不满意,也可以进行模型微调,这里对UIE模型进行微调,以进一步提升命名实体识别的准确率:
296-
297-
```python
298-
from paddlenlp.transformers import ErniePretrainedModel,AutoTokenizer
299-
```
300-
301-
完整微调代码,可参考[UIE微调](./model_zoo/uie/)
295+
如果对一键预测效果不满意,也可以使用少量数据进行模型微调,进一步提升模型在特定场景的效果,详见[UIE小样本定制训练](./model_zoo/uie/)
302296

303297
更多内容可参考:[多场景示例](./examples)[PaddleNLP on AI Studio](https://aistudio.baidu.com/aistudio/personalcenter/thirdview/574995)
304298

@@ -309,7 +303,7 @@ PaddleNLP提供全流程的文本领域API,可大幅提升NLP任务建模的
309303

310304
- 支持丰富中文数据集加载的[Dataset API](https://paddlenlp.readthedocs.io/zh/latest/data_prepare/dataset_list.html)
311305
- 灵活高效地完成数据预处理的[Data API](https://paddlenlp.readthedocs.io/zh/latest/source/paddlenlp.data.html)
312-
- 提供500+预训练模型的[Transformers API](./docs/model_zoo/transformers.rst)
306+
- 提供500+预训练模型的[Transformers API](./docs/model_zoo/transformers.rst)
313307

314308
更多使用方法请参考[API文档](https://paddlenlp.readthedocs.io/zh/latest/source/paddlenlp.data.html)
315309

README_en.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<a href=#Installation> Installation </a> |
2424
<a href=#QuickStart> Quick Start </a> |
2525
<a href=#APIReference> API Reference </a> |
26-
<a href=#Community> Community </a>
26+
<a href=#Community> Community </a>
2727
</h4>
2828

2929
## News <img src="./docs/imgs/news_icon.png" width="40"/>
@@ -45,11 +45,11 @@ PaddleNLP is an easy-to-use and high performance NLP library with awesome pre-tr
4545

4646
#### <img src="https://user-images.githubusercontent.com/11793384/168454776-2075cc68-9402-4b0b-8723-5be0a315ddc3.png" width="20" height="20" /><a href=#Off-the-shelf NLP Pre-built Task> Off-the-shelf NLP Pre-built Task </a>
4747

48-
#### <img src="https://user-images.githubusercontent.com/11793384/168454751-f111d8b4-a16a-4e36-b9de-3af8a2f00714.png" width="20" height="20" /><a href=#Awesome Chinese Pre-trained Model Zoo> Awesome Chinese Pre-trained Model Zoo </a>
48+
#### <img src="https://user-images.githubusercontent.com/11793384/168454751-f111d8b4-a16a-4e36-b9de-3af8a2f00714.png" width="20" height="20" /><a href=#Awesome Chinese Pre-trained Model Zoo> Awesome Chinese Pre-trained Model Zoo </a>
4949

50-
#### <img src="https://user-images.githubusercontent.com/11793384/168454721-0ac49e17-22db-4074-ba20-940365daf9f6.png" width="20" height="20" /><a href=#Industrial End-to-end NLP System> Industrial End-to-end NLP System </a>
50+
#### <img src="https://user-images.githubusercontent.com/11793384/168454721-0ac49e17-22db-4074-ba20-940365daf9f6.png" width="20" height="20" /><a href=#Industrial End-to-end NLP System> Industrial End-to-end NLP System </a>
5151

52-
#### <img src="https://user-images.githubusercontent.com/11793384/168454587-8b5a0f63-3d4b-4339-be47-f3ad7ef9e16c.png" width="20" height="20" /><a href=#High Performance Distributed Training and Infernece> High Performance Distributed Training and Infernece </a>
52+
#### <img src="https://user-images.githubusercontent.com/11793384/168454587-8b5a0f63-3d4b-4339-be47-f3ad7ef9e16c.png" width="20" height="20" /><a href=#High Performance Distributed Training and Infernece> High Performance Distributed Training and Infernece </a>
5353

5454

5555
### Off-the-shelf NLP Pre-built Task
@@ -64,7 +64,7 @@ For more usage please refer to [Taskflow Docs](./docs/model_zoo/taskflow.md)。
6464

6565
#### Comprehensive Chinese Transformer Models
6666

67-
We provide 45+ network architectures and over 500+ pretrained models. Not only includes all the SOTA model like ERNIE, PLATO and SKEP released by Baidu, but also integrates most of the high quality Chinese pretrained model developed by other organizations. Use AutoModel API to **⚡FAST⚡** download pretrained mdoels of different architecture. We welcome all developers to contribute your Transformer models to PaddleNLP!
67+
We provide 45+ network architectures and over 500+ pretrained models. Not only includes all the SOTA model like ERNIE, PLATO and SKEP released by Baidu, but also integrates most of the high quality Chinese pretrained model developed by other organizations. Use AutoModel API to **⚡FAST⚡** download pretrained mdoels of different architecture. We welcome all developers to contribute your Transformer models to PaddleNLP!
6868

6969
```python
7070
from paddlenlp.transformers import *
@@ -152,7 +152,7 @@ For more pretrained model usage, please refer to [Transformer API Docs](./docs/m
152152

153153
PaddleNLP provides rich application examples covering mainstream NLP task to help developers accelerate problem solving. You can find our powerful transformer [Model Zoo](./model_zoo), and wide-range NLP application [exmaples](./examples) with detailed instructions.
154154

155-
Also you can run our interactive [Notebook tutorial](https://aistudio.baidu.com/aistudio/personalcenter/thirdview/574995) on AI Studio, a powerful platform with **FREE** computing resource.
155+
Also you can run our interactive [Notebook tutorial](https://aistudio.baidu.com/aistudio/personalcenter/thirdview/574995) on AI Studio, a powerful platform with **FREE** computing resource.
156156

157157

158158
### Industrial End-to-end System Cases
@@ -161,7 +161,7 @@ We provide high value scenarios including information extraction, semantic retri
161161

162162
#### Speech Command Analysis
163163

164-
Integrated ASR Model, Information Extraction, we provide a speech command analysis pipeline that show how to use PaddleNLP and PaddleSpeech to solve Speech + NLP real scenarios.
164+
Integrated ASR Model, Information Extraction, we provide a speech command analysis pipeline that show how to use PaddleNLP and PaddleSpeech to solve Speech + NLP real scenarios.
165165

166166
<div align="center">
167167
<img src="https://user-images.githubusercontent.com/11793384/168412618-04897a47-79c9-4fe7-a054-5dc1f6a1f75c.png" width="500">
@@ -293,4 +293,4 @@ We have borrowed from Hugging Face's [Transformer](https://github.com/huggingfac
293293

294294
## License
295295

296-
PaddleNLP is provided under the [Apache-2.0 License](./LICENSE).
296+
PaddleNLP is provided under the [Apache-2.0 License](./LICENSE).

examples/dependency_parsing/ddparser/data.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,8 +258,8 @@ class BucketsSampler(object):
258258
def __init__(self, buckets, batch_size, shuffle=False):
259259
self.batch_size = batch_size
260260
self.shuffle = shuffle
261-
self.sizes, self.buckets = zip(* [(size, bucket)
262-
for size, bucket in buckets.items()])
261+
self.sizes, self.buckets = zip(*[(size, bucket)
262+
for size, bucket in buckets.items()])
263263
# The number of chunks in each bucket, which is clipped by range [1, len(bucket)]
264264
self.chunks = []
265265
for size, bucket in zip(self.sizes, self.buckets):

examples/text_to_sql/IGSQL/eval_scripts/evaluation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -542,8 +542,8 @@ def print_scores(scores, etype):
542542

543543
print("{:20} {:20} {:20} {:20} {:20} {:20}".format("", *levels))
544544
counts = [scores[level]['count'] for level in levels]
545-
print("{:20} {:<20d} {:<20d} {:<20d} {:<20d} {:<20d}".format("count",
546-
*counts))
545+
print("{:20} {:<20d} {:<20d} {:<20d} {:<20d} {:<20d}".format("count", *
546+
counts))
547547

548548
if etype in ["all", "exec"]:
549549
print(

examples/text_to_sql/IGSQL/eval_scripts/evaluation_sqa.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -598,8 +598,8 @@ def print_scores(scores, etype):
598598

599599
print("\n\n{:20} {:20} {:20} {:20} {:20} {:20}".format("", *turns))
600600
counts = [scores[turn]['count'] for turn in turns]
601-
print("{:20} {:<20d} {:<20d} {:<20d} {:<20d} {:<20d}".format("count",
602-
*counts))
601+
print("{:20} {:<20d} {:<20d} {:<20d} {:<20d} {:<20d}".format("count", *
602+
counts))
603603

604604
if etype in ["all", "exec"]:
605605
print(

model_zoo/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
# PaddleNLP Selected Model Zoo
1+
# PaddleNLP Selected Model Zoo
22

33
本目录是飞桨PaddleNLP精选模型库,提供了高质量的预训练模型和端到端的全流程部署工具链。

paddlenlp/datasets/dataset.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class DatasetTuple:
6565
def __init__(self, splits):
6666
self.identifier_map, identifiers = self._gen_identifier_map(splits)
6767
self.tuple_cls = namedtuple('datasets', identifiers)
68-
self.tuple = self.tuple_cls(* [None for _ in splits])
68+
self.tuple = self.tuple_cls(*[None for _ in splits])
6969

7070
def __getitem__(self, key):
7171
if isinstance(key, (int, slice)):

paddlenlp/datasets/nlpcc13_evsam05_hit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def _read(self, filename, split):
8484

8585
for i, line in enumerate(lines):
8686
if not line:
87-
values = list(zip(* [j.split('\t') for j in lines[start:i]]))
87+
values = list(zip(*[j.split('\t') for j in lines[start:i]]))
8888
if split == "test":
8989
ID, FORM, LEMMA, CPOS, POS, FEATS, HEAD, DEPREL = values
9090
else:

paddlenlp/datasets/nlpcc13_evsam05_thu.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def _read(self, filename, split):
8282

8383
for i, line in enumerate(lines):
8484
if not line:
85-
values = list(zip(* [j.split('\t') for j in lines[start:i]]))
85+
values = list(zip(*[j.split('\t') for j in lines[start:i]]))
8686

8787
ID, FORM, LEMMA, CPOS, POS, FEATS, HEAD, DEPREL = values
8888
if values:

0 commit comments

Comments
 (0)