Giter Site home page Giter Site logo

txsun1997 / fastnlp Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fastnlp/fastnlp

1.0 1.0 1.0 14.42 MB

fastNLP: A Modularized and Extensible NLP Framework. Currently still in incubation.

License: Apache License 2.0

Python 96.24% Shell 0.08% Jupyter Notebook 3.68%

fastnlp's Introduction

fastNLP

Build Status codecov Pypi Hex.pm Documentation Status

fastNLP 是一款轻量级的 NLP 处理套件。你既可以使用它快速地完成一个命名实体识别(NER)、中文分词或文本分类任务; 也可以使用他构建许多复杂的网络模型,进行科研。它具有如下的特性:

  • 统一的Tabular式数据容器,让数据预处理过程简洁明了。内置多种数据集的DataSet Loader,省去预处理代码。
  • 各种方便的NLP工具,例如预处理embedding加载; 中间数据cache等;
  • 详尽的中文文档以供查阅;
  • 提供诸多高级模块,例如Variational LSTM, Transformer, CRF等;
  • 封装CNNText,Biaffine等模型可供直接使用;
  • 便捷且具有扩展性的训练器; 提供多种内置callback函数,方便实验记录、异常捕获等。

安装指南

fastNLP 依赖如下包:

  • numpy
  • torch>=0.4.0
  • tqdm
  • nltk

其中torch的安装可能与操作系统及 CUDA 的版本相关,请参见 PyTorch 官网 。 在依赖包安装完成的情况,您可以在命令行执行如下指令完成安装

pip install fastNLP

参考资源

内置组件

大部分用于的 NLP 任务神经网络都可以看做由编码(encoder)、聚合(aggregator)、解码(decoder)三种模块组成。

fastNLP 在 modules 模块中内置了三种模块的诸多组件,可以帮助用户快速搭建自己所需的网络。 三种模块的功能和常见组件如下:

类型 功能 例子
encoder 将输入编码为具有具 有表示能力的向量 embedding, RNN, CNN, transformer
aggregator 从多个向量中聚合信息 self-attention, max-pooling
decoder 将具有某种表示意义的 向量解码为需要的输出 形式 MLP, CRF

完整模型

fastNLP 为不同的 NLP 任务实现了许多完整的模型,它们都经过了训练和测试。

你可以在以下两个地方查看相关信息

项目结构

fastNLP的大致工作流程如上图所示,而项目结构如下:

fastNLP 开源的自然语言处理库
fastNLP.core 实现了核心功能,包括数据处理组件、训练器、测速器等
fastNLP.models 实现了一些完整的神经网络模型
fastNLP.modules 实现了用于搭建神经网络模型的诸多组件
fastNLP.io 实现了读写功能,包括数据读入,模型读写等

In memory of @FengZiYjun. May his soul rest in peace. We will miss you very very much!

fastnlp's People

Contributors

fengziyjun avatar yhcc avatar xuyige avatar xpqiu avatar augc000 avatar lyhuang18 avatar keezen avatar 2017alan avatar willqvq avatar fftyyy avatar txsun1997 avatar kunyaa avatar h00jiang avatar wlhgtc avatar henryl7 avatar chenkaiyu1997 avatar hazelnutsgz avatar

Stargazers

 avatar

Watchers

James Cloos avatar

Forkers

liulian4633

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.