Huawei Could API Artificial Intelligence Series - Keyword Extraction

Huawei Could API Artificial Intelligence Series - Keyword Extraction


Preface

In the cloud native era, developers' programming methods and programming habits have undergone earth-shaking changes, and everyone is gradually getting used to building their own applications in the cloud. As a new generation of developers, how to understand the cloud more quickly, learn the cloud, use the cloud, develop code more conveniently and intelligently, thereby improving our development efficiency, is one of the hottest topics at present, and Huawei Cloud Toolkit, As a treasure chest connected to Huawei Cloud, it is a collection of plug-ins integrated on major IDE platforms, which will improve developer efficiency in all aspects.

The Huawei Cloud API Development Kit helps developers quickly integrate Huawei Cloud. It can easily connect to 200+ Huawei Cloud services, reference 7,000+ Huawei Cloud API services, and integrate Huawei Cloud functions in the IDE, allowing developers to communicate with Huawei Cloud in the cloud. establish connection.

In terms of intelligent coding, it integrates the large code model and software analysis technology independently developed by Huawei Cloud. It generates full-scenario function-level and line-level code, and ranks first in the industry in terms of computing power at the same scale. This will help developers use automatic semantics more efficiently. Generate to achieve rapid development and make the entire process smarter.

Environmental preparation

Development language: Python

Development tools: PyCharm Community Edition 2023.1.4

PyCharm plugin:

1. Chinese (Simplified) Language Pack/Chinese Language Pack

2. Huawei Cloud API: Huawei Cloud API plug-in provides Huawei Cloud service full API retrieval, debugging, SDK code automatic completion, integration of Huawei Cloud CLI, sample code and other functions

3. Huawei Cloud CodeArts Check: Huawei Cloud CodeArts Check plug-in provides industry standard (including Huawei Cloud) inspection, supports one-click formatting and automatic code repair, currently supports Java, C++, and C. This allows you to operate in the environment you are using. The python I use here has no prompts.

4. Huawei Cloud CodeArts Snap: Huawei Cloud CodeArt Snap intelligent programming assistant is committed to creating a new paradigm of modern development. By converting natural language into a standardized and readable programming language without open source vulnerabilities, it improves developer coding efficiency and helps enterprises quickly respond to the market. Uncertainty;

5. Huawei Cloud Toolkit Platform: Huawei Cloud base plug-in provides public capabilities for various Huawei Cloud cloud service plug-ins, such as single sign-on, UI integration, API access and other functions;

Construction of PyCharm environment: https://laoshifu.blog.csdn.net/article/details/135279145

API interface activation address: https://console.huaweicloud.com/nlp/#/nlp/overview 


Keyword extraction

Given a text, extract the words that best reflect the theme or meaning of the text.

Activation address: https://console.huaweicloud.com/nlp/#/nlp/overview

Activation effect:

Request parameters

name type IN required describe
X-Auth-Token string header true

User Token. Obtain the user Token interface by calling the IAM service (the value of X-Subject-Token in the response message header).

project_id string path true

Project ID from public cloud for resource isolation.

Body parameters

name type required describe
text string true

The length of the text to be analyzed is 1~512, and the text encoding is UTF-8.

limit integer false

The maximum number of keywords returned, default is 5.

lang string false

The supported text language type currently only supports Chinese, and the default is zh.

Return parameters 

name type required describe
words Array of strings false

Keyword list. This field is not available when the call fails.

error_code string false

The error code when the call fails, please see the error code for details. This field is not available when the call is successful.

error_msg string false

Error message when the call fails. This field is not available when the call is successful.

API debugging

Test words: [

Happy New Year! I am Hongmu Aromatherapy. On this new year full of hopes and dreams, I want to say to you: Thank you for your continued companionship and support.

I hope that in the new year, we can all find our own happiness and joy in every corner of our lives. May our friendship be like the fireworks of this New Year, lighting up our lives and warming our hearts.

I hope that in the new year, every dream of yours will come true and every effort will be rewarded. May we all have a better future, a world full of love and peace.

Thank you again for your company. May the ringing of the New Year bring us a new beginning, new hope, and new strength. Let us welcome the new year, new challenges, and new opportunities together!

Happy New Year! Red Eye Aromatherapy bless you!

Return results:

{
 "words": [
  "新年",
  "迎接",
  "梦想",
  "生活",
  "陪伴",
  "香薰",
  "烟火",
  "照亮",
  "钟声",
  "红目",
  "充满希望",
  "带给",
  "谢谢你们",
  "和平",
  "拥有",
  "未来",
  "温暖",
  "希望",
  "友情",
  "世界",
  "属于",
  "找到",
  "角落里",
  "回报",
  "实现",
  "得到",
  "心灵",
  "挑战",
  "机遇",
  "力量",
  "支持",
  "感谢",
  "祝福",
  "新年快乐"
 ]
}

This keyword is good, very good.

local test

The test was successful, the interface is very good and easy to use.

Guess you like

Origin blog.csdn.net/feng8403000/article/details/135340894