All Projects → microsoft → Neuronblocks

microsoft / Neuronblocks

Licence: mit
NLP DNN Toolkit - Building Your NLP DNN Models Like Playing Lego

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Neuronblocks

Ncrfpp
NCRF++, a Neural Sequence Labeling Toolkit. Easy use to any sequence labeling tasks (e.g. NER, POS, Segmentation). It includes character LSTM/CNN, word LSTM/CNN and softmax/CRF components.
Stars: ✭ 1,767 (+30.31%)
Mutual labels:  artificial-intelligence, natural-language-processing, sequence-labeling
Cdqa
⛔ [NOT MAINTAINED] An End-To-End Closed Domain Question Answering System.
Stars: ✭ 500 (-63.13%)
Mutual labels:  artificial-intelligence, question-answering, natural-language-processing
Pyss3
A Python package implementing a new machine learning model for text classification with visualization tools for Explainable AI
Stars: ✭ 191 (-85.91%)
Mutual labels:  artificial-intelligence, natural-language-processing, text-classification
Spago
Self-contained Machine Learning and Natural Language Processing library in Go
Stars: ✭ 854 (-37.02%)
Mutual labels:  artificial-intelligence, question-answering, natural-language-processing
Spacy
💫 Industrial-strength Natural Language Processing (NLP) in Python
Stars: ✭ 21,978 (+1520.8%)
Mutual labels:  artificial-intelligence, natural-language-processing, text-classification
Ml Classify Text Js
Machine learning based text classification in JavaScript using n-grams and cosine similarity
Stars: ✭ 38 (-97.2%)
Mutual labels:  artificial-intelligence, natural-language-processing, text-classification
Bidaf Keras
Bidirectional Attention Flow for Machine Comprehension implemented in Keras 2
Stars: ✭ 60 (-95.58%)
Mutual labels:  question-answering, natural-language-processing
Textblob Ar
Arabic support for textblob
Stars: ✭ 60 (-95.58%)
Mutual labels:  natural-language-processing, text-classification
Hackerrank
This is the Repository where you can find all the solution of the Problems which you solve on competitive platforms mainly HackerRank and HackerEarth
Stars: ✭ 68 (-94.99%)
Mutual labels:  artificial-intelligence, natural-language-processing
Monkeylearn Ruby
Official Ruby client for the MonkeyLearn API. Build and consume machine learning models for language processing from your Ruby apps.
Stars: ✭ 76 (-94.4%)
Mutual labels:  natural-language-processing, text-classification
Scdv
Text classification with Sparse Composite Document Vectors.
Stars: ✭ 54 (-96.02%)
Mutual labels:  natural-language-processing, text-classification
Get started with deep learning for text with allennlp
Getting started with AllenNLP and PyTorch by training a tweet classifier
Stars: ✭ 69 (-94.91%)
Mutual labels:  artificial-intelligence, natural-language-processing
Jupyterlab Prodigy
🧬 A JupyterLab extension for annotating data with Prodigy
Stars: ✭ 97 (-92.85%)
Mutual labels:  artificial-intelligence, natural-language-processing
Sentence Similarity
PyTorch implementations of various deep learning models for paraphrase detection, semantic similarity, and textual entailment
Stars: ✭ 96 (-92.92%)
Mutual labels:  question-answering, natural-language-processing
Botsharp
The Open Source AI Chatbot Platform Builder in 100% C# Running in .NET Core with Machine Learning algorithm.
Stars: ✭ 1,103 (-18.66%)
Mutual labels:  artificial-intelligence, natural-language-processing
Text Analytics With Python
Learn how to process, classify, cluster, summarize, understand syntax, semantics and sentiment of text data with the power of Python! This repository contains code and datasets used in my book, "Text Analytics with Python" published by Apress/Springer.
Stars: ✭ 1,132 (-16.52%)
Mutual labels:  natural-language-processing, text-classification
Comet
A Neural Framework for MT Evaluation
Stars: ✭ 58 (-95.72%)
Mutual labels:  artificial-intelligence, natural-language-processing
Nlp Tutorial
A list of NLP(Natural Language Processing) tutorials
Stars: ✭ 1,188 (-12.39%)
Mutual labels:  natural-language-processing, text-classification
Happy Transformer
A package built on top of Hugging Face's transformer library that makes it easy to utilize state-of-the-art NLP models
Stars: ✭ 97 (-92.85%)
Mutual labels:  artificial-intelligence, question-answering
Turkish Bert Nlp Pipeline
Bert-base NLP pipeline for Turkish, Ner, Sentiment Analysis, Question Answering etc.
Stars: ✭ 85 (-93.73%)
Mutual labels:  question-answering, natural-language-processing

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.

  • In Block Zoo, we provide commonly used neural network components as building blocks for model architecture design.
  • In Model Zoo, we provide a suite of NLP models for common NLP tasks, in the form of JSON configuration files.

Language Supported

  • English
  • Chinese

NLP Tasks Supported

  • Sentence Classification
  • Sentiment Analysis
  • Question Answering Matching
  • Textual Entailment
  • Slot tagging
  • Machine Reading Comprehension
  • Knowledge Distillation for Model Compression
  • More on-going

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.

Get Started in 60 Seconds

Installation

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.

Quick Start

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.

  • 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.
# use the above example
# interactive prediction
python predict.py --conf_path=model_zoo/demo/conf.json --predict_mode='interactive'
  • 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.
# 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:

  • Many frameworks to choose and high framework studying cost.
  • Heavy coding cost. A lot of details make it hard to debug.
  • Fast Model Architecture Evolution. It is difficult for engineers to understand the mathematical principles behind them.
  • Model Code optimization requires deep expertise.
  • Model Platform Compatibility Requirement. It requires extra coding work for the model to run on different platforms, such as Linux/Windows, GPU/CPU.

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

  • Model Building: for model building and parameter tuning, users only need to write simple JSON config files, which greatly minimize the effort of implementing new ideas.

  • Model Sharing It is super easy to share models just through JSON files, instead of nasty codes. For different models or tasks, our users only need to maintain one single centralized source code base.

  • Code Reusability: Common blocks can be easily shared across various models or tasks, reducing duplicate coding work.

  • Platform Flexibility: NeuronBlocks can run both on Linux and Windows machines, using both CPU and GPU. It also supports training on GPU platforms like Philly and PAI.

    CPU inference Single-GPU inference Multi-GPU inference
    CPU train
    Single-GPU train
    Multi-GPU train
  • Model Visualization: A model visualizer is provided for visualization and configure correctness checking, which helps users to visualize the model architecture easily during debugging.

  • Extensibility: NeuronBlocks is extensible, allowing users to contribute new blocks or contributing novel models (JSON files).

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.

  • Knowledge Distillation for Model Compression. Knowledge distillation for heavy models such as BERT, OpenAI Transformer. Teacher-Student based knowledge distillation is one common method for model compression.
  • Multi-Lingual Support
  • NER Model Support
  • Multi-Task Training Support

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

  • OpenPAI is an open source platform that provides complete AI model training and resource management capabilities, it is easy to extend and supports on-premise, cloud and hybrid environments in various scale.
  • Samples for AI:  a deep learning samples and projects collection. It contains a lot of classic deep learning algorithms and applications with different frameworks, which is a good entry for the beginners to get started with deep learning.

License

Copyright (c) Microsoft Corporation. All rights reserved.

Licensed under the MIT License.

Contact

If you have any questions, please contact [email protected]

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].