# Analysis of Poetry Style Based on Text Classification Algorithm

Authors: Can Wang
Journal: Scientific Programming
 (2022)

---

## Abstract

In order to realize the effect of intelligent poetry style analysis, this paper applies the text classification algorithm to the poetry style analysis, combines the knowledge representation algorithm to perform text classification and recognition, improves the algorithm, and applies it to the poetry style analysis model. Moreover, this paper combines intelligent algorithms to construct a poetry style analysis system, constructs the system’s functional modules, preprocesses the poetry documents in the corpus, and maps them to the vector space that can be directly processed by the computer. In addition, after constructing the system model, this paper verifies the poetry style analysis system based on the text classification algorithm through simulation experiments. From the research results, the effect of the poetry style analysis method based on the text classification algorithm proposed in this paper is very good, which meets the actual needs of poetry style analysis.


---

## Body

## 1. Introduction

At present, a lot of progress has been made in natural language processing technology. As a branch of natural language processing, computer processing of literary language is now in front of academia. With the support of the National Natural Science Foundation of China, this paper is trying to make preliminary explorations in this field. The focus of this paper is how to use machines to realize the style of poetry. As one of the essences of Chinese traditional culture, the classical poems have meaningful meaning, simple and deep sentiment, and their style is intoxicating. However, for a long time, the judgment of the style of poetry works is mostly based on the reader’s judgment and cognition of the style based on experience and feeling. Moreover, traditionally, there are no clear quantitative rules and no formal rules. For machines, it can only rely on the text content of the poem to determine the style. From the form, the poem is also a paragraph of text, and the judgment of its style can also be regarded as the classification of the text style. Therefore, this problem is essentially transformed into a text classification problem in machine learning. That is, under a given style classification system, the machine automatically learns the rules according to the content of the text, and establishes a classification discriminator according to the rules, and the classification discriminator automatically determines the style of the text. Based on this, this paper proposes a model framework for computing the style of Chinese classical poetry based on machine learning. This research is of great significance for expanding the application field of machine learning, for the informatization and excavation of traditional poetry, and for the language understanding of poetry and the computer-aided research of various literary works.As one of the treasures in the history of Chinese literature, poetry has been passed down through the ages because of its enduring charm. This literary form, favored by the general public and literati and poojas, has been growing, evolving, and disseminating and has reached the peak of its development in the Tang and Song dynasties. The research on Tang poetry has always been a research hotspot among scholars and literary lovers. Since ancient times, countless experts and scholars have carried on extensive and in-depth research on Tang poetry and poetry from a literary perspective. However, with the continuous development of information science and technology, people have begun to try to use information science and technology to deal with some of the language problems encountered in work and life. Natural linguistics has developed rapidly in recent years. Faced with the victories of natural language processing in modern Chinese, some natural language processing methods are applied to ancient poetry. At the same time, in view of the difference between ancient poetry and modern Chinese, from the perspective of computer, integrated data mining, genetic algorithm, and other technologies and resources such as HowNet, it focuses on the application of text classification technology in the classification of poetry style.In the process of creating poems, the different talents, temperaments, literary accomplishments, life experience, ideological realm, and ideological feelings of the literati and the ink guest will affect the content and expression of the poems written by the literati and ink guest, and they will also have the ability to Poems with different characteristics, therefore, do not have the same style of poems. However, in the process of appreciating classical poems, if you blindly pay attention to the individual differences between poems and ignore the common characteristics of the poems, it is likely to cause the problem of nihilism.This article combines the intelligent computer algorithm to apply the text classification algorithm to the poetry style analysis and builds an intelligent classification system, which lays the foundation for the intelligent classification of poetry.


## 2. Related Work

Using computer technology to assist in the study of the field of classical poetry literature, some scholars have begun preliminary attempts and explorations early on. The construction of the classical poetry database and cultural knowledge base is in the computer research laboratories of some universities and research organizations [1]. With the increasing progress of natural language processing technology in the study of Chinese language, it can even gradually support the analysis of rhythm, emotional element, and style characteristics of classical poetry [2]. “Computational Poetics” is proposed in this context [3]. There have been many research results on the related fields of poetry style. According to the literature [4] “The topic model-based corpus construction and computer-aided creation research,” the topic model based on LDA uses the method of reference word recommendation to study and analyze the word characteristics in poetry, vocabulary semantic analysis, and style feature analysis. Literature [5] uses the vector space model (VSM) to represent the text of poems and proposes two types of classification models of classical poems, bold and graceful and graceful. The classification models are based on machine learning and natural language processing. Poetry styles are classified, and a good judgment effect has been achieved. According to literature [6] after segmenting the poems according to the poetry metric and statistical word segmentation methods, they established a poetry vocabulary database and used machine learning methods to analyze the characteristics of poetry styles, classification evaluation, and sentiment analysis. In addition, research in related fields has focused on the algorithm improvement of the poetry style machine classification model, in order to gradually improve the accuracy of the classification model for the poetry style evaluation. The early stage corpus construction and computer processing procedures have been very clear. Various research work is still in-depth [7]. It can be seen that there have been quite a lot of research studies on the classification and judgment of poetry style, which has accumulated rich experience for the classification and judgment of poetry style based on machine learning in this article.The handling of poems can actually be regarded as a text handling problem with a special content in form [8]. Literature [9] developed a “Poetry Computer Aided Research System,” which takes the vocabulary in the poem as the main research unit to realize word retrieval, word frequency statistics, and image indexing. Literature [10] proposed a natural language processing technology based on word connection and used it for the understanding of poetry language. It successfully carried out a test of poetry vocabulary material labeling, a preliminary analysis test of poetry language, and an evaluation test of poem language boldness and graceful style. Literature [11] combined naive Bayes with the genetic algorithm, and put forward a calculation model for judging the bold and graceful style of classical poetry based on each character of the poem as the smallest unit, and tested the corpus in the classic poetry. Good results have been achieved. Literature [12] introduced Bayesian classification technology into poetry research from the subject point of view and achieved good experimental results. Literature [13] proposed a classification method of poem topics based on point mutual information and LDA and achieved a good classification effect on the relationship between poem topics and the evolution of the times. Literature [14] uses the vector space model (VSM) to convert the poetry text into a vector and selects the word feature through the chi-square test. Finally, the text classifier is constructed based on the naive Bayes and support vector machine algorithm, and the average classification accuracy rate reaches 74.7%. With the rise of deep learning, the literature [15] applied the RNN neural network to the generation of ancient Chinese poetry, and used the entire historical corpus of poetry as training corpus, adding certain constraints between the words and lines of the generated poetry to achieve it has a better effect than the traditional poetry generation system. Literature [16] uses the RNN model to generate poetry quatrains, and successfully adds an attention mechanism, so that the poetry can learn semantics, structure, rhyme, and other information at the same time. Literature [17] based on the RNN model, by optimizing the word vector of poetry, introducing attention mechanism and hybrid training, a model that can produce topic-related poems based on keywords has been obtained, and good results have been achieved.


## 3. Knowledge Representation of Intelligent Poetry Text Generation System

Like many other intelligent systems, knowledge representation is a very important key decision during system construction. We treat Chinese characters and works of art as images in a parametric form. Mathematically, the “image” of Calligraphy C is represented as a band-shaped image area covered by a series of ellipses. It means that this series of C is composed ofnum0 ellipses P1, P2,…,Pnum0. F0=1,2,…,num0, xi,yi, and ai,bi are used as the center, semimajor axis, and segment semiaxis of ellipse Pi, respectively. We define the text of traditional Chinese poetry as(1)Area≜x,y∈R2|∃i∈F0,x−xi2ai2+y−yi2bi2⩽1.The above knowledge representation method is inspired by the method of the paper. In this paper, a band-shaped area is defined as an ellipse moving along a predefined curve.We now turn to the concept of equivalence and use a formalized definition of the hierarchical representation of the text of poetry. IfR is an equivalence relation defined in the A=a1,a2,…,an field, that is to say, R is as follows [18]:(1)
Reflexive,(2)
symmetrical, and(3)
passed.Domain A can be decomposed into a series of subsetsA1,A2,…,Am in relation R, which satisfy the following properties:(a)
Ifi≠j,1≤i,j≤m, then Ai∩Aj=ϕ and(b)
∀ai∈A,∃j,1≤j≤m$,s.t. $ai∈Aj.Under the equivalence relationR, if ai,aj∈R,1≤i,j≤n, we say that ai is equivalent to aj, which can be expressed as ai↔Raj.In order to establish the hierarchical representation of poetry text, we introduced four equivalence relationsR1,R2,R3,R4:R1: all the structural ellipses used to form the same original sign are equivalent to each other.R2: all the original strokes used to form the same combination sign are equivalent to each other.R3: all the combined strokes used to form the same radical are equivalent to each other.R4: all the radicals used to form the same Chinese character are equivalent to each other.We assume that the constructed ellipseC=Pt|t∈F0 is decomposed into num1 equivalence classes under the equivalence relation R1, which can be expressed as F1≜1,2,…,num1. The num1 original signs are decomposed into num2 equivalence classes under the equivalence relation R2, which can be expressed as F2≜1,2,…,num2. num2 combined strokes are decomposed into num3 equivalence classes under equivalence relation R3, which can be expressed as F3Δ¯11,2,…,num3. The num3 radicals are decomposed into num4 equivalence classes under the equivalence relation R4, which can be expressed as F4≜1,2,…,num4 [19].In other words, in a specific poetic text work C, there are a total ofnum1 original strokes P1,i$,$i∈F1. Moreover, C contains num2 combined strokes P2,i,i∈F2. We can say that C has num3 radicals P3,i,i∈F3. We can also say that C consists of num4 words P4,i,i∈F4. Obviously, when we use the granularity of a single word to apply comprehensive reasoning, num≡1[20].Now, the hierarchical representation of traditional poetry text works can be formally described as follows:(2)Pk,1=Pk−1,s|Pk−1,s↔RkPk−1,1,s∈Fk−1Pk,l=Pk−1,s|Pk−1,s↔RkPk−1,qin which q=mint|Pk−1,t∉∪i=1l−1Pk,it∈Fk−1s∈Fk−1,l∈Fk1k=1,2,3,4P0,l=Pl,l∈F0,where the number of elements in the set M is M. Therefore, the following hierarchical relationship expressed in poetry text works can be expressed as follows:(3)∑s=1FkPk,s=Fk−1=numk−1,k=1,2,3,4,P0,s=1,s=1,…,F0.This hierarchical representation describes how the poetry text works at the lowest level are composed of structural ellipses. Each higher level describes how to generate a representation of its current level from the information of the lower level. In essence, it is a tree-shaped knowledge representation.At the 0th level of the hierarchical representation, the poetry text works are regarded as a series of ellipses, denoted asP0. These ellipses are called structural ellipses for poetry text works. For each construction ellipse, it is denoted as P0,i, and xi,yi is taken as its center, and ai and bi are taken as its semimajor axis and semiminor axis, respectively. Then, the image of the poetic text work C will be presented as a series of image areas covered by an ellipse.If a lower-level element cannot be merged with other elements at the same level, it will be promoted to an adjacent higher-level element. In the same way, it is also possible that a radical will be downgraded into a combined gesture, or even an original one. Through these upgrade and downgrade arrangements, we have obtained a unified 6-level hierarchical system, which will be used in the generation of poetry text.We denote the first structural ellipse of the poem text work asPk,s, and its corresponding topological structure is Tk,s. k=1,2,3,4,s∈Fk°Tk,s contains topology information, and through it, Pk−1,1+1,Pk−1,2+1,…,Pk−1,Pk,s+1l=∑i=1s−1Pk,i can be used to form Pk,s.We denote the bounding box of the image area occupied by elementPk,s as Ck⋅s=CXk,s$s$CYk,sCHk,sCWk,s,k=1,2,3,4,s∈Fk. Here, CXk,s,CYk,s,CHk,s,CWk,s are the x,y coordinates of the lower left corner of the bounding box Ck,s and its height and width, respectively. All coordinates are in the world coordinate system. Therefore, we have(4)Tk,s≜TCRk,s,TCSk,s≜TRk,1+lTRk,2+l⋮TRk,Pk,s+l,TSk,1+lTSk,2+l⋯TSk,Pk,s+l.Here, l=∑i=1s−1Pk,i;s∈Fk;k=1,2,3,4.TCRk,sandTCSk,s is the scaling and transition matrix, respectively. The strict mathematical definition of matrix TRk,z,TSk,z is as (5)TRk,z≜RWk,z00RHk,z≜CWk,sCWk−1,z00CHk,sCHk−1,z,k=2,3,4,1001,k=1,z=1+l,2+l,…,Pk,s+l,TSk,z≜RXk,zRYk,zT≜CXk−1,z−CXk,sCWk,sCYk−1,z−CYk,sCHk,sT,k=2,3,4,00T,k=1.Ifk≥1,Pk,im must be a combination of one or more construction elements one level lower. We call the latter substructural elements. All the information needed to combine Pk,i is stored in Tk,i, which is the topology constructor of Pk,i.Through the topology constructor, we can build a one-to-one mapping of different levels of hierarchical representation. In other words, any hierarchical representation pixelxk,syk,sT of the s-th structural element Pk,s belonging to the k-th level can be uniquely mapped to the hierarchical representation pixel xl,tyl,tT of the c-th structural element P1,t of the first level. Among them, l>k,1,k=0,1,2,3,4,∃mj∈Fk+jj=1,2,…,1−k−1$ s.t. $Pk,s∈Pk+1,ml∈⋯∈Pk+1−k−1,ml−k−1∈P1,t.If we introduce the operator∇m,nb,(6)∇m,nbxy2×1≜TRm+1,nxy2×1+TSm+1,n.Then, there will be a relationship:(7)xl,tyl,tT=∇l−1,ml−k−1b⋯∇k+1,m1b∇k,sbxk,syk,sT.Thes-th structural element of the k-th level of the hierarchical system is denoted as Pk⋅r,s, and its parameter is denoted as Ek⋅s,k=0,1,…,4,s∈Fk. We now introduce a new matrix operator ∇nc, which can be used to generate an m×∑l=1ndl -dimensional matrix M=ai,jm×∑l=1ndl and nm×d1l=1,2,…,n-dimensional matrices M1=al,i,jm×d1l=1,2,…,n. If ∇ncM1,M2,…,Mn=M, then we have(8)ai,j=az+1,i,j−∑t=1zdtin which∑t=1zdt<j⩽∑t=1z+1dt,z=1,2,…,n−1,a1,i,j,j⩽d1,i=1,2,…,m.We further define a matrix operator∇nd:(9)∇ndA≜∇ncA,A,…,A︸n.Then, the hierarchy of poetry text works can be formally expressed as follows:(10)E0,i=xi′,yi′,Ek,s,=∇Pk,sc∇k−1,1+leEk−1,1+l,∇k−1,2+leEk−1,2+l,…,∇k−1,Pk,a+lEk−1,Pk,s+l.Among them,(11)l=∑i=1s−1Pk,i,k=1,2,3,4,s∈Fk.At this time, the operator is defined as follows:(12)∇n,meEn,m≜∇2c∇2cTRn,m,02×2T,∇2c02×2,TRn,mTEn,m+∇colEn,md∇2cTSn,mT,00T.Among them,colEn,m is the number of columns of matrix En,m, and 02×2 is an 2×2-dimensional zero matrix.In the above equation, eachE0,i represents an area covered by the constructed ellipse, and x−xi′2/ai′2 + y−yi′2/bi′2≤1. This ellipse is the normalized version of the original ellipse x−xi2/ai2+y−yi2/bi2≤1 for its bounding box. That is, if P0,i∈P1 and j,i∈F0,j∈F1 is assumed, we have(13)xi′yi′ai′bi′=xi−CX1,jCW1,jyi−CY1,jCH1,jaiCW1,jbiCH1,j.For an element higher than the 0th level, such asPk+1,1, for all k>0, it is composed of Nk+1,1 adjacent lower-level elements: Pk,11,Pk,12,…,Pk,1Nk+1,1. The corresponding shape matrix Ek+1,1 is deduced, which is obtained from the matrix Ek,11,Ek,12,…,Ek,1Nk+1,1 by linking columns by column. Because the parameterized representation of constructing an ellipse is a 4×1-dimensional matrix, the above-mentioned recommended connection method will accurately generate a matrix with only 4 rows at a higher level. Each row of the generated matrix is called the parameterized representation domain of the element. The different domains of an element can be inferred independently.The weight associated with thes-th field of the i-th source knowledge on the k-th level; that is, the weight of the i-th training example pk,li is denoted as wl,si. wl,sis=1,...,4 is the reasoning strength of pk,li in synthetic reasoning. Therefore, the set of similar reasoning strengths arranged in order constitutes the “view sequence” of the current comprehensive reasoning process. This is what we said that different sequences of showing training examples will lead to different results of poetry text.For the comprehensive reasoning process generated by novel poetry text works, we assume thatn comprehensive source knowledge Pk,11,Pk,12,…,Pk,ln at the k-th level participates in this reasoning process. Moreover, each comprehensive source knowledge consists of m components, where ∀i≠j;i,j=1,2,…,n⇒li,lj∈Fk,li≠lj. Therefore, we can use an m×1-dimensioned matrix to represent a single comprehensive reasoning source and use an m×∑i=1nli-dimensioned matrix to represent all active sources in the current comprehensive reasoning. If we apply synthetic reasoning at the single-character level, then m≡4. The t-th attribute of source knowledge is denoted as Pk,li,t°, which has an associated strength Wk,li,t in the process of comprehensive reasoning, and they have the following relationship:(14)∑i=1nωk,li,t=1t=1,2,…,m.In the intelligent poetry text generation system, this reasoning intensity can be adjusted through a graphical user interface. The new knowledge generated in the synthetic reasoning process is denoted asPk,r, and its matrix form parameterization is denoted as Ek,r°. To apply the principle of comprehensive reasoning process, all source knowledge in reasoning must have equal dimensions. That is to say, if we apply synthetic reasoning on source knowledge Pk,s and Pk,t, their corresponding matrix form parameterized representations Ek,sm1×n1 and Ek,tm2×n2 must satisfy the relationship n1=n2. This equal requirement is a soft constraint of the synthetic reasoning process. If it is violated, we can introduce a source knowledge equality operator ∇te to relax this soft constraint. This is very similar to the mapping problem in similar reasoning. Next, we will introduce a few symbols and define ∇te in a strict mathematical way.We first denoteen,i=Δσi,1σi,2⋯σi,nT, where σi,j=1,i=j0,i≠j°.We can also obtain a discrete curve composed of the centers of all the covering ellipses for each structural element in the intelligent poetry text generation system, which can be expressed asPk. Its corresponding parameterization is expressed as Ek,ls°. Therefore, a dispersion curve acquisition method can be described as follows:(15)Ck,ls=∇2ce4,1T×Ek,lsT,e4,2T×Ek,lsTT=x1x2⋯xcoy1y2⋯yco,co=colEk,ls.Then, an overview of the key columns of a matrix can be introduced and defined. If a curveCk has v+1 key points and its coordinates are Ck,1seco,u0,Ck,1secoul,…,Ck,lseco.uv, respectively, then the key column of Ek,ls can be identified as Ek,1seco.u0,Ek,1seco,u1,…,Ek,1seco.uv°. Aiming at the key point extraction of a given plane curve Ck,ls, we use the algorithm introduced in this paper. Moreover, more refined key point extraction algorithms are introduced in, but they may cause more serious computational overhead.We assume that now we have identifiedv+1 key columns, which are the u0,u1,…uv-th matrix column, through the parameterized representation Ek,ls of a matrix form of a comprehensive reasoning source Pk,ls, where 1=u0<u1<⋯<uv$$=colEk,ls,s=1,2,…,n. Therefore, we can define the capacity equality operator of the comprehensive reasoning source ∇te as follows:(16)∇teEk,lset,i≜Ek,lsecolEk,ls,θ,i=1,2,…,t.Among them,(17)θ=uj+uj+1−ujt×j+1/v−t×j/vi−t×jv;t×jv<i⩽t×j+1v.j∈0,1,…,v−1;s=1,2,…,n. [] is an integer trimming operator. Specifically, if each column of matrix Ek⋅ls is considered to be a key column, we can use a simpler mapping to define the operator ∇te:(18)∇teEk,lset,i≜Ek,lsecolEk,ls,i×colEk,ls/t.Among them,i=1,2,…,t, and [] is an integer trim function. Based on the definition of ∇te, we can further define a comprehensive inference source knowledge superposition operator ∇tf:(19)∇nfM1,M2,…,Mn≜∇nc∇hϵM1,∇hϵM2,…,∇hϵMn,h=maxcolMi|i=1,2,…,n.Through the operator∇tf, we can obtain the matrix representation of the superimposed comprehensive reasoning source:(20)Ek≜∇nfEk,l1,Ek,l2,…,Ek,ln.With this operator, we can further calculate the feature matrix of all comprehensive inference source knowledge:(21)Sk≜Ek−∇nc∇heEk,nor,h=maxcolEk,li|i=1,2,…,n.In the above equation,b, Ek, nor are the matrix representations of standard source knowledge at the k-th level.According to the user input intensitywk,li,t for different comprehensive reasoning sources, we can calculate the comprehensive reasoning viewpoint matrix:(22)Wk,t≜∇ncωk,l1,t×Ih×h,ωk,l2,t×Ih×h,…,ωk,ln,t×Ih×hT.Among them,h=maxcolEk,li|i=1,2,…,n.Ihxh is a hxh dimensional unit matrix.Now, we can generate a comprehensive reasoning feature resultSk,r through the comprehensive reasoning process described by the following form:(23)Sk,r=∇mcSk⊗Wk,1Tem,1,Sk⊗Wk,2Tem,2,…,Sk⊗Wk,mTem,mT.In the above equation,⊗ is a comprehensive reasoning simulation operator. If the synthetic reasoning process models human creative thinking as a linear process, then Ek⊗Wk=Ek⋅Wk, where ⋅ is an ordinary matrix multiplication operator. If the comprehensive reasoning process models human creative thinking as a z-order polygon, then ⊗ will be defined as follows:(24)Ap×q⊗Bq×r=Cp×r⇒ci,j=∑k=1qai,kbk,jzz,i=1,2,…,p;j=1,2,…,r.We can also model creative thinking as a geometric average process, as shown in the equation of (25):(25)ci,j=∏k=1qai,kbk,jq,i=1,2,…,p;j=1,2,…,r$.Generally speaking, we can use the comprehensive reasoning model to overload the comprehensive reasoning simulation operator⊗ to achieve the purpose of simulating different types of creative thinking.Finally, by adding the shape ofEk,nor, which is the standard structural element related to the inference result Pk,nor in the process of comprehensive inference, we obtain the parameterized representation Ek,r:Ek,r=Sk,r⊗∇heEk,nor of Pk,r, where Ek,nor is the matrix form of the parameterized representation of the shape of Pk,nor.The definition of operator⊕ can be overloaded to realize different novel creative thinking activities in intelligent systems. Some simple synthetic reasoning simulation operators for topology constructors are as follows:(1)
The arithmetic mean is(26)Tk,r=1n∑i=1nTk,li×ωk,li.(2)
The geometric mean is(27)Tk,r=∏i=1nTk,li×ωk,lin.(3)
The harmonic mean is(28)1Tk,r=1n∑i=1n1Tk,li×ωk,li.The integrated reasoning process proposed in this paper is essentially either a value process or an extrapolation process. In other words,wi is the interpolation weight or extrapolation weight of Pk,li, and the constraint ∑i=1nwi=1 needs to be satisfied here.


## 4. Analysis of Poetry Style Based on Text Classification Algorithm

In the research of this paper, the judgment of poetry style based on machine learning, that is, the flow chart of the pattern recognition of poetry text, is shown in Figure1.Figure 1
Flow chart of pattern recognition of poetry style.The development and design of the system are shown in Figure2 according to the research and processing sequence.Figure 2
The processing flow chart of poem vocabulary material.Judging the style of poetry is similar to the general process of text classification. First, the algorithm needs to preprocess the poetry documents in the corpus and then map them to the vector space that can be directly processed by the computer. The algorithm selects the poem documents that have been styled in advance as the training corpus and the test corpus. Subsequently, the algorithm uses machine learning methods to generate model data for style classification. Finally, the algorithm builds a machine judging tool for poetry style on the basis of the model data tested on the test corpus. This tool can judge the style of other poetry documents in the corpus. The flow chart of style evaluation is shown in Figure3.Figure 3
Poetry classification process.Poems are composed of text content and belong to unstructured data. It is difficult to analyze them using quantitative analysis methods. It is necessary to introduce data indicators that can be measured to perform data analysis and processing. The commonly used method is to segment the text content and then count the word frequency data. For high-frequency words such as “Wanli,” “Jiangshan,” “Dongfeng,” and “Twilight” that often appear in poems, they can generally express the emotional bias and style characteristics of the poet’s choice of poetry imagery. In order to classify and aggregate the genres of poets and poets, this paper mainly uses the method of high-frequency word statistics to classify and aggregate the style characteristics of the poets. The cluster analysis of word style is shown in Figure4.Figure 4
Cluster analysis of word style.In order to obtain word vectors with more efficient algorithms, Word2Vec can efficiently train on millions of word lists and hundreds of millions of datasets. The obtained training result-word vector can well measure the semantic relevance and similarity between words. Word2Vec includes two network models: CBOW (Continuous Bag-of-Words) model and Skip-Gram model. The network structure is shown in Figure5. Skip-Gram can be seen as the reverse process of CBOW. The essence of the CBOW model is a feed forward neural network language model (Feed Forward NNLM).Figure 5
Structure diagram of CBOW and Skip-Gram model.RNN is a neural network designed specifically for serialization problems, and its basic network structure is shown in Figure6.Figure 6
Basic network structure diagram.This article summarizes the sequence learning methods of the above two statistical language models. The framework of the joint language response model based on statistical learning is shown in Figure7.Figure 7
Schematic diagram of the joint language response model based on statistical learning.In the research of this paper, Brill’s conversion learning method is used to cope with the generated context-sensitive rules in conjunction with the language. The flowchart of the learning algorithm is shown in Figure8.Figure 8
Schematic diagram of the learning of the joint language response model based on conversion.The text visualization technology is mainly composed of three modules: text analysis and processing, visual design presentation, and interactive design, as shown in Figure9. First, the algorithm collects text information, preprocesses data and expresses knowledge, and transforms it into a corresponding structured data format. Then, the algorithm visually presents the information with graphics and color elements through visual coding. In the visual presentation, the algorithm should provide users with effective and reasonable visual presentation and interactive operations based on the user’s cognitive characteristics. At the same time, the algorithm performs data operations on the visualized information elements through a reasonable interactive method to facilitate users to quickly and clearly understand the displayed information content, thereby realizing a complete visual design implementation process.Figure 9
Logical architecture diagram of text visualization.After constructing the above model, the effect of the model is verified, and the system function is verified based on actual needs. Moreover, this paper combines the simulation test to verify the effect of the poetry text classification and the poetry style verification of the system of this paper. The poetry text classification is shown in Table1 and Figure 10.Table 1
Experimental data of poem text classification.
NOText categorization194.63294.29394.85495.85594.73697.07797.45897.61995.501095.521195.881293.561395.881493.991593.271696.851797.691896.651996.702094.012195.602294.702393.272494.922595.532693.172796.022893.142997.773097.403196.083294.403395.913495.883594.453696.50Figure 10
Statistical diagram of the evaluation of the classification effect of poetry text.From the above research, it can be seen that the poetry style analysis method based on the text classification algorithm proposed in this paper has a good classification effect. The experimental results of the poetry style analysis are shown in Table2 and Figure 11.Table 2
Test data of poetry style analysis.
NOStyle analysis175.40276.61376.06488.70582.39684.98791.28883.30981.221078.601183.991281.161379.141484.991584.501679.331773.701874.901989.732087.792176.672289.302391.012476.102589.192680.652790.652874.652991.063090.543184.273284.073377.953489.933590.933687.56Figure 11
Statistical diagram of the effect of poetry style analysis.From the above research, the effect of the poetry style analysis method based on the text classification algorithm proposed in this paper is very good, which meets the actual needs of poetry style analysis.


## 5. Conclusion

Before the classification of poetry text begins, the algorithm needs to represent the unstructured document data into a data form that the computer can understand. This requires the algorithm to perform corresponding preprocessing and feature representation of the document first and convert the unstructured or semistructured data form into a structured data form that can be processed by the computer. This includes a series of processes such as word segmentation, filtering of low-frequency words and forbidden words, feature representation, and feature extraction. The so-called word segmentation is to add a separator between each entry in a Chinese document to convert the continuous character stream form of the Chinese document into a discrete word stream form. At present, the main word segmentation methods used are forward and reverse maximum matching method, word-by-word traversal method, best matching method, and word frequency statistics method. In addition, there are two-scan method, adjacency constraint method, and so on. This paper applies the text classification algorithm to the analysis of the style of poetry and constructs an intelligent classification system. From the research results, it can be seen that the poetry style analysis method based on the text classification algorithm proposed in this paper is very effective and meets the actual needs of poetry style analysis.



---

*Source: 2763380-2022-01-31.xml*