In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
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.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.