提交 42c832da 编写于 作者: S Steffy-zxf

fix typo

上级 e2af73a6
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
# limitations under the License. # limitations under the License.
from paddlehub.datasets.chnsenticorp import ChnSentiCorp from paddlehub.datasets.chnsenticorp import ChnSentiCorp
from paddlehub.finetune.trainer import Trainer from paddlehub.finetune.trainer import Trainer
from paddlehub.model.modeling_ernie import ErnieforSequenceClassification from paddlehub.model.modeling_ernie import ErnieForSequenceClassification
import paddle.fluid as fluid import paddle.fluid as fluid
import paddlehub as hub import paddlehub as hub
...@@ -29,7 +29,7 @@ if __name__ == '__main__': ...@@ -29,7 +29,7 @@ if __name__ == '__main__':
dev_dataset = ChnSentiCorp( dev_dataset = ChnSentiCorp(
tokenizer=ernie.get_tokenizer(tokenize_chinese_chars=True), max_seq_len=128, mode='dev') tokenizer=ernie.get_tokenizer(tokenize_chinese_chars=True), max_seq_len=128, mode='dev')
model = ErnieforSequenceClassification(ernie_module=ernie, num_classes=len(train_dataset.get_labels())) model = ErnieForSequenceClassification(ernie_module=ernie, num_classes=len(train_dataset.get_labels()))
optimizer = fluid.optimizer.AdamOptimizer(learning_rate=5e-5, parameter_list=model.parameters()) optimizer = fluid.optimizer.AdamOptimizer(learning_rate=5e-5, parameter_list=model.parameters())
trainer = Trainer(model, optimizer, checkpoint_dir='test_ernie_text_cls') trainer = Trainer(model, optimizer, checkpoint_dir='test_ernie_text_cls')
......
...@@ -22,7 +22,7 @@ from paddlehub.module.module import moduleinfo, Module ...@@ -22,7 +22,7 @@ from paddlehub.module.module import moduleinfo, Module
from paddlehub.tokenizer.bert_tokenizer import BertTokenizer from paddlehub.tokenizer.bert_tokenizer import BertTokenizer
class ErnieforSequenceClassification(dygraph.Layer): class ErnieForSequenceClassification(dygraph.Layer):
""" """
This model is customized for that enrie module does the sequence classification, such as the text sentiment classification. This model is customized for that enrie module does the sequence classification, such as the text sentiment classification.
This model exploits the ernie + full-connect layers (softmax as activation) to classify the texts. This model exploits the ernie + full-connect layers (softmax as activation) to classify the texts.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册