Migrated repository
Go to file
FengZiYjun 758f0c0bd6 Introduce Field concept to optimize data representation.
- add DataSet, Instance, Field to represent data in different levels
- encapsulate batching method in Batch class
- modify samplers in action.py to fit Batch
- preprocessor.run returns DataSet, instead of list
- Use Batch in Trainer/Tester
- add required_arg "task" in Trainer/Tester
- remove SeqLabelTrainer/SeqLabelTester dependencies successfully. They empty classes to deprecate.
- modify SeqLabeling model, add another argument in forward, in order to compute mask inside model
- test\model\seq_labeling.py works
2018-09-15 16:48:59 +08:00
.github add logging in Trainer & Tester 2018-08-17 11:16:13 +08:00
docs add mathjax and update pictures 2018-09-12 16:57:55 +08:00
examples format test folder 2018-09-14 14:19:39 +08:00
fastNLP Introduce Field concept to optimize data representation. 2018-09-15 16:48:59 +08:00
reproduction - clean up unused codes 2018-09-02 13:32:57 +08:00
test Introduce Field concept to optimize data representation. 2018-09-15 16:48:59 +08:00
.travis.yml Update .travis.yml 2018-08-17 19:28:38 +08:00
LICENSE add LICENSE, setup.py & requirements.txt 2018-05-25 18:32:02 +08:00
README.md Merge pull request #60 from KuNyaa/master 2018-09-06 09:56:14 +08:00
requirements.txt add tensorboardX for loss visualization 2018-09-03 19:37:44 +08:00
setup.py Text classification interface is ready. 2018-09-05 10:00:57 +08:00

fastNLP

Build Status codecov PyPI version Hex.pm Documentation Status

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:

Requirements

  • numpy>=1.14.2
  • torch==0.4.0
  • torchvision>=0.1.8
  • tensorboardX

Resources

Installation

Run the following commands to install fastNLP package.

pip install fastNLP

Cloning From GitHub

If you just want to use fastNLP, use:

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:

# using conda
conda install pytorch torchvision -c pytorch
# or using pip
pip3 install torch torchvision

TensorboardX Installation

pip3 install tensorboardX

Project Structure

FastNLP
├── docs
├── fastNLP
│   ├── core
│   │   ├── action.py
│   │   ├── __init__.py
│   │   ├── loss.py
│   │   ├── metrics.py
│   │   ├── optimizer.py
│   │   ├── predictor.py
│   │   ├── preprocess.py
│   │   ├── 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
│   │   └── model_loader.py
│   ├── models
│   ├── modules
│   │   ├── aggregation
│   │   ├── decoder
│   │   ├── encoder
│   │   ├── __init__.py
│   │   ├── interaction
│   │   ├── other_modules.py
│   │   └── utils.py
│   └── saver
├── LICENSE
├── README.md
├── reproduction
├── requirements.txt
├── setup.py
└── test
    ├── core
    ├── data_for_tests
    ├── __init__.py
    ├── loader
    ├── modules
    └── readme_example.py