python-vncorenlp

python_vncorenlp


Keywords
python-vncorenlp, vncorenlp, nlp, vietnamese-nlp, parser, word-segmentation, tokenizer, pos-tagger, named-entity-recognition, ner, dependency-parser
License
MIT
Install
pip install python-vncorenlp==0.1.8

Documentation

python-vncorenlp

A Python wrapper for VnCoreNLP using Pyjnius

Table Of Contents

Prerequisites

Installation

You can install this package from PyPI using pip:

$ pip install python-vncorenlp

Example

#!/usr/bin/python
# -*- coding: utf-8 -*-
import python_vncorenlp

python_vncorenlp.install('-Xmx2g')
python_vncorenlp.Package.load_class()


def main():
    pipeline = python_vncorenlp.Pipeline()
    pipeline.load_model()
    print(pipeline.annotate_doc('TĂŽi lĂ  chĂ ng sinh viĂȘn BĂĄch Khoa'))
    print(pipeline.annotate_docs([
        'TĂŽi lĂ  chĂ ng sinh viĂȘn BĂĄch Khoa',
        'TĂŽi học ToĂĄn tin ứng dỄng'
    ]))


if __name__ == '__main__':
    main()

The parameter -Xmx2g means that the VM can allocate a maximum of 2 GB for the Heap Space. If you want to use all module, set heap space to -Xmx4g