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 do text analysis in SAP HANA Express Edition

2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

This article introduces the relevant knowledge of "how to conduct text analysis in SAP HANA Express Edition". Many people will encounter this 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!

This exercise uses SAP HANA Express Edition's text semantic analysis engine to analyze documents in JSON format.

First create a column table and turn on the fuzzy text search (fuzzy search) function for its index.

The operations described above can be done with the following SQL statement:

Create column table food_analysis

(

Name nvarchar (64)

Description text FAST PREPROCESS ON FUZZY SEARCH INDEX ON

);

The description field enables the fuzzy search function.

Copy the json key-value key-value pair stored in the document store collection named doc_store into the database table you just created:

Insert into food_analysis with doc_store as (select "name", "description" from food_collection) select doc_store. "name" as name, doc_store. "description" as description from doc_store

Execute the above sql statement to ensure that all the data is copied to the database table food_analysis:

Use the following sql statement to fuzzy search the description field:

Select name, score () as similarity, TO_VARCHAR (description) from food_analysis where contains (description, 'nuts', fuzzy (0.5)) order by similarity desc

Execution result:

The linguistic text analysis steps in HANA Express Edition are also relatively simple.

First, create a database table:

Create column table food_sentiment (name nvarchar (64) primary key, description nvarchar (2048))

Copy the json data from document store to the database table:

Create a new index for the description field:

CREATE FULLTEXT INDEX FOOD_SENTIMENT_INDEX ON "FOOD_SENTIMENT" ("DESCRIPTION") CONFIGURATION 'GRAMMATICAL_ROLE_ANALYSIS' LANGUAGE DETECTION (' EN') SEARCH ONLY OFF FAST PREPROCESS OFF TEXT MINING OFF TOKEN SEPARATORS''TEXT ANALYSIS ON

The above SQL statement automatically creates a text analysis table named $TA_FOOD_SENTIMENT_INDEX:

The contents of the table:

From this, we can find that the English sentences we imported into the database table are broken down into words by HANA text engine, and the part of speech of each word is automatically parsed by HANA.

This is the end of the content of "how to analyze text in SAP HANA Express Edition". 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!

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

Servers

Wechat

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

12
Report