2018-08-15 20:27:05 +08:00
# fastNLP
2018-08-11 10:11:09 +08:00
[![Build Status ](https://travis-ci.org/fastnlp/fastNLP.svg?branch=master )](https://travis-ci.org/fastnlp/fastNLP)
[![codecov ](https://codecov.io/gh/fastnlp/fastNLP/branch/master/graph/badge.svg )](https://codecov.io/gh/fastnlp/fastNLP)
2018-09-02 15:23:13 +08:00
[![PyPI version ](https://badge.fury.io/py/fastNLP.svg )](https://badge.fury.io/py/fastNLP)
![Hex.pm ](https://img.shields.io/hexpm/l/plug.svg )
[![Documentation Status ](https://readthedocs.org/projects/fastnlp/badge/?version=latest )](http://fastnlp.readthedocs.io/?badge=latest)
2018-08-15 20:27:05 +08:00
fastNLP is a modular Natural Language Processing system based on PyTorch, for fast development of NLP tools. It divides the NLP model based on deep learning into different modules. These modules fall into 4 categories: encoder, interaction, aggregation and decoder, while each category contains different implemented modules. Encoder modules encode the input into some abstract representation, interaction modules make the information in the representation interact with each other, aggregation modules aggregate and reduce information, and decoder modules decode the representation into the output. Most current NLP models could be built on these modules, which vastly simplifies the process of developing NLP models. The architecture of fastNLP is as the figure below:
2018-08-20 14:51:10 +08:00
![](https://github.com/fastnlp/fastNLP/raw/master/fastnlp-architecture.jpg)
2018-08-15 20:27:05 +08:00
## Requirements
- numpy>=1.14.2
- torch==0.4.0
- torchvision>=0.1.8
2018-09-03 19:37:44 +08:00
- tensorboardX
2018-08-15 20:27:05 +08:00
## Resources
2018-09-02 20:08:17 +08:00
- [Documentation ](https://fastnlp.readthedocs.io/en/latest/ )
2018-08-15 20:27:05 +08:00
- [Source Code ](https://github.com/fastnlp/fastNLP )
## Installation
2018-09-01 21:33:28 +08:00
Run the following commands to install fastNLP package.
```shell
pip install fastNLP
```
2018-08-15 20:27:05 +08:00
### Cloning From GitHub
If you just want to use fastNLP, use:
```shell
git clone https://github.com/fastnlp/fastNLP
cd fastNLP
```
### PyTorch Installation
Visit the [PyTorch official website] for installation instructions based on your system. In general, you could use:
```shell
# using conda
conda install pytorch torchvision -c pytorch
# or using pip
pip3 install torch torchvision
```
2018-09-03 19:37:44 +08:00
### TensorboardX Installation
```shell
pip3 install tensorboardX
```
2018-08-15 20:27:05 +08:00
## Project Structure
2018-06-25 14:41:30 +08:00
```
FastNLP
2018-07-28 11:57:25 +08:00
├── docs
├── fastNLP
2018-09-02 13:32:57 +08:00
│ ├── core
2018-07-28 11:57:25 +08:00
│ │ ├── action.py
│ │ ├── __init__ .py
2018-09-02 13:32:57 +08:00
│ │ ├── loss.py
2018-07-28 11:57:25 +08:00
│ │ ├── metrics.py
│ │ ├── optimizer.py
2018-09-02 13:32:57 +08:00
│ │ ├── predictor.py
│ │ ├── preprocess.py
2018-07-28 11:57:25 +08:00
│ │ ├── README.md
│ │ ├── tester.py
│ │ └── trainer.py
│ ├── fastnlp.py
│ ├── __init__ .py
│ ├── loader
│ │ ├── base_loader.py
│ │ ├── config_loader.py
│ │ ├── dataset_loader.py
│ │ ├── embed_loader.py
│ │ ├── __init__ .py
2018-09-02 13:32:57 +08:00
│ │ └── model_loader.py
2018-07-28 11:57:25 +08:00
│ ├── models
│ ├── modules
│ │ ├── aggregation
│ │ ├── decoder
│ │ ├── encoder
│ │ ├── __init__ .py
│ │ ├── interaction
│ │ ├── other_modules.py
│ │ └── utils.py
│ └── saver
├── LICENSE
├── README.md
├── reproduction
├── requirements.txt
├── setup.py
└── test
2018-09-02 13:32:57 +08:00
├── core
2018-07-28 11:57:25 +08:00
├── data_for_tests
2018-09-02 13:32:57 +08:00
├── __init__ .py
├── loader
├── modules
└── readme_example.py
2018-06-25 14:41:30 +08:00
```