N- LTP : An Open-source Neural Language Technology Platform for C hinese (2021)

Abstract: We introduce N-LTP, an open-source neural language technology platform supporting six fundamental Chinese NLP tasks: lexical analysis (Chinese word segmentation, part-of-speech tagging, and named entity recognition), syntactic parsing (dependency parsing), and semantic parsing (semantic dependency parsing and semantic role labeling). Unlike the existing state-of-the-art toolkits, such as Stanza, that adopt an independent model for each task, N-LTP adopts the multi-task framework by using a shared pre-trained model, which has the advantage of capturing the shared knowledge across relevant Chinese tasks. In addition, a knowledge distillation method (Clark et al., 2019) where the single-task model teaches the multi-task model is further introduced to encourage the multi-task model to surpass its single-task teacher. Finally, we provide a collection of easy-to-use APIs and a visualization tool to make users to use and view the processing results more easily and directly. To the best of our knowledge, this is the first toolkit to support six Chinese NLP fundamental tasks. Source code, documentation, and pre-trained models are available at https://github.com/HIT-SCIR/ltp .

## introduction there is a wide of range of existing natural language processing (nlp) toolkits such as corenlp @xcite , udpipe @xcite , flair @xcite , spacy, 1 and stanza @xcite in english, which makes it easier for users to build tools with sophisticated linguistic processing. recently, the need for chinese nlp has a dramatic increase in many downstream applications. a chinese nlp platform usually includes lexical analysis (chinese word segmentation (cws), part-of-speech (pos) 1 https://spacy.io ## design and architecture figure 2 shows an overview of the main architecture of n-ltp. it mainly consists of the components including a shared encoder and different decoders for each task. our framework shares one encoder for leveraging the shared knowledge across all tasks. different task decoders are used for each task separately. all tasks are optimized simultaneously via a joint learning scheme. in addition, the knowledge distillation technique is introduced to encourage the multi-task model to surpass its single-task teacher model. ## usage n-ltp is a pytorch-based chinese nlp toolkit based on the above model. all the configurations can be initialized from json files, and thus it is easy for users to use n-ltp where users just need one line of code to load the model or process the input sentences. specifically, n-ltp can be installed easily by the command: in addition, n-ltp has bindings available for many programming languages, including c++, python, java and rust directly. ## experiments 4.1 experimental setting to evaluate the efficiency of our multi-task model, we conduct experiments on six chinese tasks. the n-ltp model is based on the chinese electra base @xcite . the learning ratio (lr) for teacher models, student model and crf layer is {1e -4}, {1e -4}, {1e -3}, respectively. the gradient clip value adopted in our experiment is 1.0 and the warmup proportion is 0.02. we use bertadam @xcite to optimize the parameters and adopted the suggested hyper-parameters for optimization. ## conclusion in this paper, we presented n-ltp, an open-source neural language technology platform supporting chinese. to the best of our knowledge, this is the first chinese toolkit that supports six fundamental chinese nlp tasks. experimental results show n-ltp obtains state-of-the-art or competitive performance and has high speed. we hope n-ltp can facilitate chinese nlp research.