Home

Awesome

<img src="https://i.imgur.com/IanH6xI.png" width="450">

Building Your NLP DNN Models Like Playing Lego

language python pytorch license

简体中文

Tutorial 中文教程 Demo Video

Table of Contents

Overview

NeuronBlocks is a NLP deep learning modeling toolkit that helps engineers/researchers to build end-to-end pipelines for neural network model training for NLP tasks. The main goal of this toolkit is to minimize developing cost for NLP deep neural network model building, including both training and inference stages.

NeuronBlocks consists of two major components: Block Zoo and Model Zoo.

<img src="https://i.imgur.com/LMD0PFQ.png" width="250">

<span id="language-supported">Language Supported</span>

NLP Tasks Supported

Toolkit Usage

Users can either pick existing models (config files) in Model Zoo to start model training or create new models by leveraging neural network blocks in Block Zoo just like playing with Lego.

<img src="https://i.imgur.com/q0p6Wvz.png" width="300"> <img src="https://i.imgur.com/lFaBtnh.png" width="700">

Get Started in 60 Seconds

<span id="installation">Installation</span>

Note: NeuronBlocks requires Python 3.6 and above.

  1. Clone this project.

    git clone https://github.com/Microsoft/NeuronBlocks
    
  2. Install Python packages in requirements.txt by the following command.

    pip install -r requirements.txt
    
  3. Install PyTorch (NeuronBlocks supports PyTorch 0.4.1 and above).

    For Linux, run the following command:

    pip install "torch>=0.4.1"
    

    For Windows, we suggest you to install PyTorch via Conda by following the instruction of PyTorch.

<span id="quick-start">Quick Start</span>

Get started by trying the given examples. Both Linux/Windows, GPU/CPU are supported. For Windows, we suggest you to use PowerShell instead of CMD.

Tips: in the following instruction, PROJECTROOT denotes the root directory of this project.

# train
cd PROJECT_ROOT
python train.py --conf_path=model_zoo/demo/conf.json

# test
python test.py --conf_path=model_zoo/demo/conf.json

# predict
python predict.py --conf_path=model_zoo/demo/conf.json

For prediction, NeuronBlocks have two modes: Interactive and Batch.

# use the above example
# interactive prediction
python predict.py --conf_path=model_zoo/demo/conf.json --predict_mode='interactive'
# use the above example
# batch prediction
python predict.py --conf_path=model_zoo/demo/conf.json --predict_mode='batch' --predict_data_path=dataset/demo/predict.tsv

For more details, please refer to Tutorial.md and Code documentation.

Who should consider using NeuronBlocks

Engineers or researchers who face the following challenges when using neural network models to address NLP problems:

The advantages of leveraging NeuronBlocks for NLP neural network model training includes:

Contribute

NeuronBlocks operates in an open model. It is designed and developed by STCA NLP Group, Microsoft. Contributions from academia and industry are also highly welcome. For more details, please refer to Contributing.md.

Ongoing Work and Call for Contributions

Anyone who are familiar with are highly encouraged to contribute code.

Reference

NeuronBlocks -- Building Your NLP DNN Models Like Playing Lego. EMNLP 2019, at https://arxiv.org/abs/1904.09535.

@article{gong2019neuronblocks,
  title={NeuronBlocks--Building Your NLP DNN Models Like Playing Lego},
  author={Gong, Ming and Shou, Linjun and Lin, Wutao and Sang, Zhijie and Yan, Quanjia and Yang, Ze, Cheng, Feixiang and Jiang, Daxin},
  journal={arXiv preprint arXiv:1904.09535},
  year={2019}
}

Related Project

License

Copyright (c) Microsoft Corporation. All rights reserved.

Licensed under the MIT License.

Contact

If you have any questions, please contact NeuronBlocks@microsoft.com

If you have wechat, you can also add the following account:

<img src="https://i.imgur.com/UfOYvt1.jpg" width="200">