Java RESTful API

Java RESTful API

Add the following dependency into the pom.xml file of your project.

<dependency>
  <groupId>com.hankcs.hanlp.restful</groupId>
  <artifactId>hanlp-restful</artifactId>
  <version>0.0.15</version>
</dependency>

Obtain an auth from any compatible service provider like our free service, then initiate a HanLPClient and call its parse interface.

HanLPClient client = new HanLPClient("https://hanlp.hankcs.com/api", null); // Replace null with your auth
System.out.println(client.parse("2021年HanLPv2.1为生产环境带来次世代最先进的多语种NLP技术。晓美焰来到北京立方庭参观自然语义科技公司。"));

Refer to our testcases and data format for more details.