Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to use hanlp to derive dependency syntactic Visualization through python and jpype

Shulou Source: shulou.com Published: 2022-06-01 17:55:48 10月01日 Update

Today, I will talk to you about how to use hanlp to export dependency syntax visualization through python combined with jpype. Many people may not know much about it. In order to make you understand better, the editor has summarized the following content for you. I hope you can get something according to this article.

Effect picture

> from jpype import *

> > >

... StartJVM (getDefaultJVMPath (), "- Djava.class.path=E:\ hanlp\ hanlp-1.5.4.jar;E:\ hanlp", "- Xms1g", "- Xmx1g")

> HanLP = JClass ('com.hankcs.hanlp.HanLP')

>

1 Mr. Xu Mr. Xu nh nr _ 4 subject-predicate relation _ _

2 also return d d _ 4-shaped medium structure _ _

3 concrete a _ 4-shaped medium structure _ _

4 help v _ 0 core relationship _ _

5 he r rr _ 4 and language _ _

6 determine v v _ 4 verb-object relationship _ _

7 u ule _ 6 right additional relation _ _

8 handle p pba _ 15 medium structure _ _

9 draw v v _ 8 prepositional object relation _ _

10 Eagle Eagle n n _ 9 verb-object relationship

11. Wp w _ 12 punctuation mark _ _

12 squirrel n n _ 10 juxtaposition relation _ _

13 and the left additional relation to c cc _ 14 _ _

14 Sparrow n n 10 juxtaposition relation _ _

15 as p p _ 6 verb-object relationship _ _

16 main attack v vn _ 17 Dingzhong relationship _ _

17 Target n n _ 15 verb-object relationship _ _

18 . . Wp w _ 4 punctuation mark _ _

> f = open ("E:/ab.txt", 'averse')

> , file = f)

-there is a utf-8 coding problem--

Solution: save as--

After reading the above, do you have any further understanding of how to use hanlp to derive dependency syntax visualization through python and jpype? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.

Tags: Main attack verb object squirrel target eagle sparrow help content structure syntax visualization sir punctuation punctuation symbols additions concurrent words effects effect diagrams methods Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi MariaDB vpn macOS Redmi