Part-of-Speech Tagging


Part-of-Speech Tagging

184/800
loading

Introduction

Part-of-speech tagging (PoS tagging) is the task of tagging a word in a text with its part of speech. A part of speech is a category of words with similar grammatical properties. HanLP supports Universal Dependenciesopen in new window tagset。

How to Use

Apply for Auth

We are hosting a non-commercial API service and you are welcome to apply for an auth keyopen in new window. An auth key is a password which gives you access to our API and protects our server from being abused.

Create RESTful Client

Create a HanLPClientopen in new window:

      from hanlp_restful import HanLPClient
# Fill in your auth
HanLP = HanLPClient('https://www.hanlp.com/api', auth=None, language='mul')

    

Tag

Set tasks='ud' to perform PoS:

      
HanLP('''In 2021, HanLPv2.1 delivers state-of-the-art multilingual NLP techniques to production environments.
2021年、HanLPv2.1は次世代の最先端多言語NLP技術を本番環境に導入します。
2021年 HanLPv2.1为生产环境带来次世代最先进的多语种NLP技术。''', tasks='ud')['pos']

    

Native APIs

Please refer to docsopen in new window.

Last update: 7/3/2022, 5:05:28 PM
Contributors: hankcs