You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

README.md 3.6 kB

7 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. # fastNLP
  2. [![Build Status](https://travis-ci.org/fastnlp/fastNLP.svg?branch=master)](https://travis-ci.org/fastnlp/fastNLP)
  3. [![codecov](https://codecov.io/gh/fastnlp/fastNLP/branch/master/graph/badge.svg)](https://codecov.io/gh/fastnlp/fastNLP)
  4. [![PyPI version](https://badge.fury.io/py/fastNLP.svg)](https://badge.fury.io/py/fastNLP)
  5. ![Hex.pm](https://img.shields.io/hexpm/l/plug.svg)
  6. [![Documentation Status](https://readthedocs.org/projects/fastnlp/badge/?version=latest)](http://fastnlp.readthedocs.io/?badge=latest)
  7. 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:
  8. ![](https://github.com/fastnlp/fastNLP/raw/master/fastnlp-architecture.jpg)
  9. ## Requirements
  10. - numpy>=1.14.2
  11. - torch==0.4.0
  12. - torchvision>=0.1.8
  13. - tensorboardX
  14. ## Resources
  15. - [Documentation](https://fastnlp.readthedocs.io/en/latest/)
  16. - [Source Code](https://github.com/fastnlp/fastNLP)
  17. ## Installation
  18. Run the following commands to install fastNLP package.
  19. ```shell
  20. pip install fastNLP
  21. ```
  22. ### Cloning From GitHub
  23. If you just want to use fastNLP, use:
  24. ```shell
  25. git clone https://github.com/fastnlp/fastNLP
  26. cd fastNLP
  27. ```
  28. ### PyTorch Installation
  29. Visit the [PyTorch official website] for installation instructions based on your system. In general, you could use:
  30. ```shell
  31. # using conda
  32. conda install pytorch torchvision -c pytorch
  33. # or using pip
  34. pip3 install torch torchvision
  35. ```
  36. ### TensorboardX Installation
  37. ```shell
  38. pip3 install tensorboardX
  39. ```
  40. ## Project Structure
  41. ```
  42. FastNLP
  43. ├── docs
  44. ├── fastNLP
  45. │   ├── core
  46. │   │   ├── action.py
  47. │   │   ├── __init__.py
  48. │   │   ├── loss.py
  49. │   │   ├── metrics.py
  50. │   │   ├── optimizer.py
  51. │   │   ├── predictor.py
  52. │   │   ├── preprocess.py
  53. │   │   ├── README.md
  54. │   │   ├── tester.py
  55. │   │   └── trainer.py
  56. │   ├── fastnlp.py
  57. │   ├── __init__.py
  58. │   ├── loader
  59. │   │   ├── base_loader.py
  60. │   │   ├── config_loader.py
  61. │   │   ├── dataset_loader.py
  62. │   │   ├── embed_loader.py
  63. │   │   ├── __init__.py
  64. │   │   └── model_loader.py
  65. │   ├── models
  66. │   ├── modules
  67. │   │   ├── aggregation
  68. │   │   ├── decoder
  69. │   │   ├── encoder
  70. │   │   ├── __init__.py
  71. │   │   ├── interaction
  72. │   │   ├── other_modules.py
  73. │   │   └── utils.py
  74. │   └── saver
  75. ├── LICENSE
  76. ├── README.md
  77. ├── reproduction
  78. ├── requirements.txt
  79. ├── setup.py
  80. └── test
  81. ├── core
  82. ├── data_for_tests
  83. ├── __init__.py
  84. ├── loader
  85. ├── modules
  86. └── readme_example.py
  87. ```

一款轻量级的自然语言处理(NLP)工具包,目标是减少用户项目中的工程型代码,例如数据处理循环、训练循环、多卡运行等