Skip to content

Commit e690ed6

Browse files
adolphk-ykljshou
authored andcommitted
add prediction mode in README (#73)
1 parent e79bf00 commit e690ed6

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,21 @@ python test.py --conf_path=model_zoo/demo/conf.json
9898
# predict
9999
python predict.py --conf_path=model_zoo/demo/conf.json
100100
```
101+
102+
For prediction, NeuronBlocks have two modes: **Interactive** and **Batch**.
103+
- *Interactive Prediction Mode:* The interactive mode provides interactive interface, users can input case according to corresponding prompt message and get realtime prediction result from trained model, and input "exit" to exit interactive interface.
104+
```bash
105+
# use the above example
106+
# interactive prediction
107+
python predict.py --conf_path=model_zoo/demo/conf.json --predict_mode='interactive'
108+
```
109+
- *Batch Prediction Mode:* For batched cases prediction, NeuronBlocks provides batch prediction mode which receives a cases file as input and write the prediction results in the prediction file.
110+
```bash
111+
# use the above example
112+
# batch prediction
113+
python predict.py --conf_path=model_zoo/demo/conf.json --predict_mode='batch' --predict_data_path=dataset/demo/predict.tsv
114+
```
115+
101116
For more details, please refer to [Tutorial.md](Tutorial.md) and [Code documentation](https://microsoft.github.io/NeuronBlocks/).
102117

103118
# Who should consider using NeuronBlocks

README_zh_CN.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,19 @@ python test.py --conf_path=model_zoo/demo/conf.json
9898
python predict.py --conf_path=model_zoo/demo/conf.json
9999
```
100100

101+
对于预测,NeuronBlocks 提供了两种预测的形式: **交互式****批量式**
102+
- *交互式:* 交互式模式预测提供了交互界面,用户可以根据输入提示信息每次输入一个样本并实时得到模型前向计算出的结果,输入 "exit" 时退出交互预测模式。
103+
```bash
104+
# use the above example
105+
# interactive prediction
106+
python predict.py --conf_path=model_zoo/demo/conf.json --predict_mode='interactive'
107+
```
108+
- *批量式:* 对于批量样本预测的需求,NeuronBlocks 提供批量预测模式,其接受一个包含批量样本的文件作为输入,并且将模型前向计算的结果写回这个文件。
109+
```bash
110+
# use the above example
111+
# batch prediction
112+
python predict.py --conf_path=model_zoo/demo/conf.json --predict_mode='batch' --predict_data_path=dataset/demo/predict.tsv
113+
```
101114
更多细节, 请查看[Tutorial_zh_CN.md](Tutorial_zh_CN.md) 和 [Code documentation](https://microsoft.github.io/NeuronBlocks/)。
102115

103116
# 适用人群

0 commit comments

Comments
 (0)