Get the App
SLTechnology News&Howtos  ›  Network Security  › 

The usage of HanLP word Separator

Shulou Source: shulou.com Published: 2022-06-01 01:29:39 10月04日 Update

This article introduces the relevant knowledge of "the usage of HanLP Separator". Many people will encounter such a dilemma in the operation of actual cases, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Preface: analyze key words

How to extract the corresponding keywords from a text?

I have thought about using machine learning method for lexical analysis before, but the accuracy of the test in the project is not enough. At this time, there is the idea of HanLP- Chinese language processing package to extract keywords.

Download: .jar .properties data and other files

Here is the official website download address HanLP download, 1.3.3 packet download

Configure the environment in intellij and run the first demo

Configure the jar package in the project to add dependencies.

File- > Project Structure- > Modules- > Dependencies- > + Jars

Transfer the properties file to the src root directory, and modify root to your own dataset path

Failed to load the corresponding table of character types: D:/BaiduYunDownload/data-for-1.3.3/data/dictionary/other/CharType.dat.yes

Solution: check to see if the file is available under the error page, and if not, download one online. For example, here, because I only use part of its functions, I no longer download it for convenience. Here I directly change the file name of a file-successfully run it!

Run successfully

-

This is the end of the introduction of "the usage of HanLP Separator". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Tags: File key keyword run success content data more knowledge project analysis learning configuration practical successful learning next not enough preface method Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Docker OPPO Reno vpn Huawei Shulou Tech Info