From 4daf1a8b95c726d2fffcf0efabb5545fdbd531a9 Mon Sep 17 00:00:00 2001 From: Xiaoyao Xi <24541791+xixiaoyao@users.noreply.github.com> Date: Tue, 4 Feb 2020 18:23:15 +0800 Subject: [PATCH] Update README.md --- examples/predict/README.md | 37 +++---------------------------------- 1 file changed, 3 insertions(+), 34 deletions(-) diff --git a/examples/predict/README.md b/examples/predict/README.md index ca8338f..49d0512 100644 --- a/examples/predict/README.md +++ b/examples/predict/README.md @@ -1,38 +1,7 @@ -## Examples 5: Predict(Classification) -This task is a sentiment analysis task. The following sections detail model preparation, dataset preparation, and how to run the task. +## Example 5: Prediction +This example demonstrates how to directly do prediction with PaddlePALM. You can either initialize the model from a checkpoint, a pretrained model or just randomly initialization. Here we reuse the task and data in example 1. Hence repeat the step 1 in example 1 to pretrain data. -### Step 1: Prepare Pre-trained Models & Datasets - -#### Pre-trianed Model - -The pre-training model of this mission is: [ernie-zh-base](https://github.com/PaddlePaddle/PALM/tree/r0.3-api). - -Make sure you have downloaded the required pre-training model in the current folder. - - -#### Dataset - -This task uses the `chnsenticorp` dataset. - -Download dataset: -```shell -python download.py -``` - -If everything goes well, there will be a folder named `data/` created with all the datas in it. - -The data should have 2 fields, `label text_a`, with tsv format. Here is some example datas: - -``` -label text_a -0 当当网名不符实,订货多日不见送货,询问客服只会推托,只会要求用户再下订单。如此服务留不住顾客的。去别的网站买书服务更好。 -0 XP的驱动不好找!我的17号提的货,现在就降价了100元,而且还送杀毒软件! -1 <荐书> 推荐所有喜欢<红楼>的红迷们一定要收藏这本书,要知道当年我听说这本书的时候花很长时间去图书馆找和借都没能如愿,所以这次一看到当当有,马上买了,红迷们也要记得备货哦! -``` - -### Step 2: Predict - -The code used to perform classification task is in `run.py`. If you have prepared the pre-training model and the data set required for the task, run: +After you have prepared the pre-training model and the data set required for the task, run: ```shell python run.py -- GitLab