Skip to content

NgHoangDat/python_vncorenlp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

A Python wrapper for VnCoreNLP using Pyjnius

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages