Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use golang Natural language processing tool gohanlp

2025-01-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article will explain in detail how to use gohanlp, a natural language processing tool for golang. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.

Preface of GoHanlp

Hanlp is a multilingual NLP library based on PyTorch and TensorFlow 2.x for researchers and companies to promote state-of-the-art deep learning technologies in academia and industry. HanLP was designed from the beginning to be efficient, user-friendly and extensible. It comes with pre-training models for a variety of human languages, including English, Chinese and many other languages. GoHanlp is the golang implementation version of the api interface of Hanlp

How to install GoHanlpgo get-u github.com/xxjwxc/gohanlp@master use apply for auth certification

Https://bbs.hanlp.com/t/hanlp2-1-restful-api/53

Do not authenticate hanlp.WithAuth ("") Please fill in the blanks

Text form package mainimport ("fmt"github.com/xxjwxc/gohanlp/hanlp") func main () {client: = hanlp.HanLPClient (hanlp.WithAuth (")) / / if you do not fill in the auth,auth, anonymous s, _: = client.Parse (" 2021 HanLPv2.1 brings the next generation of the most advanced multilingual NLP technology to the production environment. My mother-in-law came to Beijing Cube Court to visit the Natural semantic Technology Company. " , hanlp.WithLanguage ("zh") fmt.Println (s)} object form package mainimport ("fmt"github.com/xxjwxc/gohanlp/hanlp") func main () {client: = hanlp.HanLPClient (hanlp.WithAuth (")) / / Anonymous resp if the auth,auth you applied for is not filled in _: = client.ParseObj ("2021 HanLPv2.1 brings the next generation of the most advanced multilingual NLP technology to the production environment. My mother-in-law came to Beijing Cube Court to visit the Natural semantic Technology Company. " , hanlp.WithLanguage ("zh") fmt.Println (resp)} API description

Option in HanLPClient is a variable parameter, which is taken with each call.

Parse... Option is a 00:00 parameter, which is only valid for this call.

This is the end of the article on "how to use gohanlp, a natural language processing tool for golang". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.

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.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report