提交 62eedcf2 编写于 作者: Z Zeyu Chen

update readme

上级 cc9c0c25
...@@ -37,36 +37,52 @@ pip install paddlenlp==2.0.0a ...@@ -37,36 +37,52 @@ pip install paddlenlp==2.0.0a
### Quick Dataset Loading ### Quick Dataset Loading
```python ```python
train_ds, test_ds = paddlenlp.datasets.ChnSentiCorp.get_datasets(['train','test'])
from paddlenlp.datasets import ChnSentiCrop
train_ds, test_ds = ChnSentiCorp.get_datasets(['train','test'])
``` ```
### Reusable Text Emebdding ### Chinese Text Emebdding Loading
```python ```python
from paddlenlp.embeddings import TokenEmbedding from paddlenlp.embeddings import TokenEmbedding
wordemb = TokenEmbedding("word2vec.baike.300d") wordemb = TokenEmbedding("word2vec.baike.300d")
print(wordemb.search("中国")) print(wordemb.search("中国"))
>>> [0.260801 0.1047 0.129453 ... 0.096542 0.0092513] >>> [0.260801, 0.1047, 0.129453 ... 0.096542, 0.0092513]
```
### One-Line Classical Model Building
```python
from paddlenlp.models import Ernie
ernie = Ernie(Ernie.Task.SeqCls)
ernie.forward(input_ids, segment_ids)
``` ```
### High Quality Chinsese Pre-trained Model ### Rich Chinsese Pre-trained Models
```python ```python
from paddlenlp.transformers import ErnieModel from paddlenlp.transformers import ErnieModel, BertModel, RobertaModel, ElectraModel
ernie = ErnieModel.from_pretrained("ernie") ernie = ErnieModel.from_pretrained('ernie-1.0')
sequence_output, pooled_output = ernie.forward(input_ids, segment_ids) bert = BertModel.from_pretrained('bert-wwm-ext-large')
electra = ElectraModel.from_pretrained('eclectra-chinese')
roberta = RobertaModel.from_pretrained('roberta-wwm-ext')
``` ```
For more pretrained model selection, please refer to [PretrainedModels](./paddlenlp/transformers/README.md)
## Tutorials ## Tutorials
List our notebook tutorials based on AI Studio. List our notebook tutorials based on AI Studio.
TBD
## Community ## Community
* SIG for Pretrained Model Contribution * SIG for Pretrained Model Contribution
* SIG for Dataset Integration * SIG for Dataset Integration
TBD
## FAQ ## FAQ
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册