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