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 understand that RNN is doing semantic analysis?

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

Share

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

Today, I will tell you how to understand RNN when doing semantic analysis. The content of the article is good. Now I would like to share it with you. Friends who feel in need can understand it. I hope it will be helpful to you. Let's read it along with the editor's ideas.

This example is an example in deeplearnling/tutorial/rnnslu.html.

Task:

The Slot-Filling (Spoken Language Understanding) consists in assigning a label to each word given a sentence. It's a classification task.

Oral comprehension is assigning labels to a given sentence. It's a question of classification.

Data set

The data set used is ATIS (Airline Travel Information System) dataset, which is a text data classification data set, which is based on the phone records of the aerospace company when the telephone reservation is made. It has been converted into text through voice processing and expressed in the way of (IOB).

The representation of IOB: B is the beginning of a class, I is the middle of a class, and O is an empty class. It is shown as follows:

Input (words) showflightsfromBostontoNewYorktodayOutput (labels) OOOB-deptOB-arrI-arrB-date

The number of classes (different slots) is 128including the O label (NULL).

ATIS officially divides the entire data set into a training set / test set-49780.893 sentences, with a total of 56590thumb 9198 words (an average of 15 words per sentence). It is divided into 128 classes, which contain O (empty class).

If there is no word class that appears.

The accuracy of data classification uses the following three indicators: Precision (accuracy), Recall (recall rate), F1 score. This Baidu will know, to put it simply, these three can express the classification accuracy, the full score is 100, of which Precision,Recall has a certain degree of mutual exclusion, so F1 score is the best.

We can also use conlleval.pl 's PERL program to see the classified results.

RNN Model and data processing

Data: the beginning of each word is represented by a token, programmed as a number, a sentence is composed of multiple numbers, this is the input representation, but not the final representation, the output corresponding to a label.

Context window:

The index-1 corresponds to the PADDING index we insert at the beginning/end of the sentence.

As can be seen from above, the larger the window is, the longer the data length is.

Word vector:

Word vector is a very innovative way to express, one word means if you use One-hot Representation, such as

"microphone" is expressed as [0,01,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,

Only one of them is 1, and there are many defects, so there is a word vector. Express a word as [0.792, − 0.177, − 0.107, 0.109, − 0.542, …] . Dimensions of 50 and 100 are more common. The vector of this word is not fixed, but also needs to be trained.

Parameters to be learned by RNN:

The parameters set by the entire architecture of RNN:

Running program

These are all the contents of how to understand when RNN is doing semantic analysis. For more information about how to understand how RNN is doing semantic analysis, you can search the previous articles or browse the following articles to learn! I believe the editor will add more knowledge to you. I hope you can support it!

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