JOY-SWang / mindnlp

An opensource NLP library based on MindSpore.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MindNLP

docs GitHub PRs Welcome open issues ci

Installation | Introduction | Quick Links |

News πŸ“’

  • πŸ”₯ Latest Features

    • πŸ€— Hugging huggingface ecosystem, we use datasets lib as default dataset loader to support mounts of useful datasets.
    • πŸ“ MindNLP supports NLP tasks such as language model, machine translation, question answering, sentiment analysis, sequence labeling, summarization, etc. You can access them through examples.
    • πŸš€ MindNLP currently supports industry-leading Large Language Models (LLMs), including Llama, GLM, RWKV, etc. For support related to large language models, including pre-training, fine-tuning, and inference demo examples, you can find them in the "llm" directory.
    • πŸ€— Pretrained models support huggingface transformers-like apis, including 28+ models like BERT, Roberta, GPT2, T5, etc. You can use them easily by following code snippet:
      from mindnlp.models import BertModel
      
      model = BertModel.from_pretrained('bert-base-cased')

Installation

Version Compatibility:

MindNLP version MindSpore version Supported Python version
master daily build >=3.7.5, <=3.9
0.1.1 >=1.8.1, <=2.0.0 >=3.7.5, <=3.9
0.2.0 >=2.1.0 >=3.7.5, <=3.9

Daily build

You can download MindNLP daily wheel from here.

Install from source

To install MindNLP from source, please run:

pip install git+https://github.com/mindspore-lab/mindnlp.git
# or
git clone https://github.com/mindspore-lab/mindnlp.git
cd mindnlp
bash scripts/build_and_reinstall.sh

Introduction

MindNLP is an open source NLP library based on MindSpore. It supports a platform for solving natural language processing tasks, containing many common approaches in NLP. It can help researchers and developers to construct and train models more conveniently and rapidly.

The master branch works with MindSpore master.

Major Features

  • Comprehensive data processing: Several classical NLP datasets are packaged into friendly module for easy use, such as Multi30k, SQuAD, CoNLL, etc.
  • Friendly NLP model toolset: MindNLP provides various configurable components. It is friendly to customize models using MindNLP.
  • Easy-to-use engine: MindNLP simplified complicated training process in MindSpore. It supports Trainer and Evaluator interfaces to train and evaluate models easily.

Quick Links

Supported models

The table below represents the current support in the library for each of those models, whether they have support in Pynative mode or Graph mode.

Model Pynative support Graph Support
ALBERT βœ… βœ…
Autoformer βœ… (Inference only) ❌
BaiChuan βœ… ❌
Bark βœ… ❌
BART βœ… ❌
BERT βœ… βœ…
BLIP TODO βœ…
BLIP2 TODO βœ…
BLOOM βœ… ❌
ChatGLM βœ… ❌
ChatGLM2 βœ… ❌
ChatGLM3 βœ… ❌
CLIP βœ… ❌
CodeGen βœ… ❌
ConvBERT TODO ❌
CPM βœ… ❌
CPM-Ant βœ… ❌
CPM-Bee βœ… ❌
MiniCPM βœ… ❌
Electra TODO ❌
EnCodec βœ… ❌
ERNIE βœ… βœ…
ERNIEM βœ… βœ…
Falcon βœ… ❌
OpenAI GPT βœ… ❌
OpenAI GPT-2 βœ… βœ…
Gemma βœ… ❌
GPT Neo βœ… ❌
GPT NeoX TODO ❌
GPT Pangu βœ… ❌
GPTBigCode βœ… ❌
Graphormer βœ… ❌
Hubert βœ… ❌
Llama βœ… ❌
Llama2 βœ… ❌
CodeLlama βœ… ❌
Longformer βœ… ❌
LongT5 βœ… ❌
LUKE βœ… ❌
MaskFormer βœ… ❌
mBART-50 βœ… ❌
Megatron-BERT βœ… ❌
Megatron-GPT2 βœ… ❌
Mistral βœ… ❌
MobileBERT βœ… ❌
Moss βœ… ❌
Nezha βœ… ❌
OPT βœ… ❌
Phi2 βœ… ❌
Pop2piano βœ… ❌
RegNet Todo ❌
RoBERTa βœ… βœ…
RWKV βœ… ❌
SeamlessM4T βœ… ❌
SeamlessM4Tv2 βœ… ❌
T5 βœ… ❌
Timesformer TODO ❌
Tinybert βœ… ❌
wav2vec βœ… ❌
Whisper βœ… ❌
XLM βœ… ❌
XLM-RoBERTa βœ… ❌

License

This project is released under the Apache 2.0 license.

Feedbacks and Contact

The dynamic version is still under development, if you find any issue or have an idea on new features, please don't hesitate to contact us via Github Issues.

Acknowledgement

MindSpore is an open source project that welcome any contribution and feedback.
We wish that the toolbox and benchmark could serve the growing research
community by providing a flexible as well as standardized toolkit to reimplement existing methods
and develop their own new semantic segmentation methods.

Citation

If you find this project useful in your research, please consider citing:

@misc{mindnlp2022,
    title={{MindNLP}: a MindSpore NLP library},
    author={MindNLP Contributors},
    howpublished = {\url{https://github.com/mindlab-ai/mindnlp}},
    year={2022}
}

About

An opensource NLP library based on MindSpore.

License:Apache License 2.0


Languages

Language:Python 99.3%Language:Jupyter Notebook 0.4%Language:Shell 0.1%Language:Cuda 0.1%Language:Cython 0.0%