Text vector processing method, device, medium and electronic device

By obtaining and weighting sub-text vectors, combined with standard classification vectors, semantic text vectors are generated, which solves the problems of high complexity and low accuracy of text vector generation in the existing technology, and improves the accuracy and user experience of text vectors.

CN114676701BActive Publication Date: 2024-10-01TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN202011550151.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-24
Publication Date
2024-10-01
Estimated Expiration
2040-12-24

AI Technical Summary

Technical Problem

In the existing technology, the coarse-grained word vector model has complex logic and insufficient training samples. The aggregation operation combination method changes the semantic space distribution of the original text, resulting in low accuracy of text vectors.

Method used

By obtaining the associated text vector, determining the weight of the sub-text vector, and performing weighted calculations to obtain the semantic text vector, combined with the standard classification vector, full connection processing is performed to generate the semantic classification vector, which solves the problem of high complexity and low accuracy of text vector generation. question.

Benefits of technology

It improves the accuracy of text vectors, makes full use of the semantic information of sub-text vectors, is suitable for content recommendation scenarios, and optimizes user experience and recommendation effects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114676701B_ABST
    Figure CN114676701B_ABST
Patent Text Reader

Abstract

The present disclosure provides a text vector processing method, device, medium and electronic device. The method includes: obtaining an associated text vector; wherein the associated text vector is generated based on at least two sub-text vectors; determining at least two text vector weights of at least two sub-text vectors, and determining a target weight from at least two text vector weights; performing weighted calculation on at least two sub-text vectors and the target weight to obtain a weight calculation result; performing full connection processing on the weight calculation result to obtain a semantic text vector of the associated text vector; obtaining a standard classification vector corresponding to the associated text vector, and performing full connection processing on the semantic text vector and the standard classification vector to obtain a semantic classification vector. The present disclosure makes full use of the semantic information of the sub-text vector to ensure the accuracy of the generated semantic text vector, and optimizes the recommendation effect and user experience when the semantic text vector is applied in a variety of application scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of artificial intelligence technology, and in particular, to a text vector processing method, a text vector processing device, a computer-readable medium, and an electronic device. Background Art

[0002] In recent years, text processing can enhance the full utilization of text. Generally, the text vectorization is achieved through a combination of coarse-grained word vector models and aggregation operations.

[0003] However, the coarse-grained word vector model has complex logic and insufficient training samples, and the aggregation operation combination method will change the semantic space distribution of the original text, resulting in low accuracy of the generated text vector.

[0004] In view of this, there is an urgent need in the art to develop a new text vector processing method and device.

[0005] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the technical background of the present application, and therefore may include information that does not constitute prior art known to ordinary technicians in the field. Summary of the invention

[0006] The purpose of the present disclosure is to provide a text vector processing method, a text vector processing device, a computer-readable medium and an electronic device, thereby overcoming the technical problems of high complexity and low accuracy of text vector generation at least to a certain extent.

[0007] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by the practice of the present disclosure.

[0008] According to one aspect of an embodiment of the present disclosure, a method for processing a text vector is provided, the method comprising: obtaining an associated text vector; wherein the associated text vector is generated based on at least two sub-text vectors;

[0009] determining at least two text vector weights of the at least two sub-text vectors, and determining a target weight from the at least two text vector weights;

[0010] Performing weighted calculation on the at least two subtext vectors and the target weight to obtain a weight calculation result;

[0011] Performing full connection processing on the weight calculation result to obtain the semantic text vector of the associated text vector;

[0012] A standard classification vector corresponding to the associated text vector is obtained, and a full connection process is performed on the semantic text vector and the standard classification vector to obtain a semantic classification vector.

[0013] According to one aspect of an embodiment of the present disclosure, a device for processing a text vector is provided, the device comprising: a vector acquisition module, configured to acquire an associated text vector; wherein the associated text vector is generated based on at least two sub-text vectors;

[0014] a weight determination module configured to determine at least two text vector weights of the at least two sub-text vectors, and determine a target weight from the at least two text vector weights;

[0015] A weight calculation module, configured to perform weighted calculation on the at least two sub-text vectors and the target weight to obtain a weight calculation result;

[0016] A connection processing module, configured to perform full connection processing on the weight calculation result to obtain a semantic text vector of the associated text vector;

[0017] The classification vector module is configured to obtain a standard classification vector corresponding to the associated text vector, and perform full connection processing on the semantic text vector and the standard classification vector to obtain a semantic classification vector.

[0018] In some embodiments of the present disclosure, based on the above technical solution, the weight determination module includes: a weight comparison submodule, configured to compare the weights of the at least two text vectors to obtain a weight comparison result;

[0019] The comparison result submodule is configured to determine a target weight among the at least two text vector weights according to the weight comparison result.

[0020] In some embodiments of the present disclosure, based on the above technical solution, the weight calculation module includes: a weighted calculation submodule, configured to perform weighted calculation on the at least two sub-text vectors and the at least two text vector weights to obtain a weighted calculation result;

[0021] The result calculation submodule is configured to perform semantic weight calculation on the weighted calculation result and the target weight to obtain a weight calculation result.

[0022] In some embodiments of the present disclosure, based on the above technical solution, the weight calculation module includes: a weight calculation submodule, configured to perform weighted calculation on the at least two sub-text vectors and the at least two text vector weights to obtain a weighted calculation result;

[0023] A combination vector submodule is configured to perform full connection processing on the at least two sub-text vectors to obtain a connection vector, and perform mapping processing on the connection vector to obtain a combination vector;

[0024] The vector calculation submodule is configured to perform semantic association calculation on the weighted calculation result, the target weight and the combination vector to obtain a weight calculation result.

[0025] In some embodiments of the present disclosure, based on the above technical solution, the weight determination module includes: a connection vector submodule, configured to perform full connection processing on the at least two sub-text vectors to obtain a connection vector;

[0026] The mapping processing submodule is configured to perform mapping processing on the connection vector to obtain at least two text vector weights of the at least two sub-text vectors.

[0027] In some embodiments of the present disclosure, based on the above technical solution, the mapping processing submodule includes: a focus text unit configured to obtain a main text vector corresponding to the associated text vector, and respectively calculate at least two similarities between the main text vector and the at least two sub-text vectors;

[0028] An original vector unit, configured to perform mapping processing on the connection vector to obtain at least two original vector weights corresponding to the at least two sub-text vectors;

[0029] The target loss unit is configured to perform weight loss calculation on the at least two similarities and the at least two original vector weights to obtain a target loss value, so as to determine the at least two original vector weights as at least two text vector weights according to the target loss value.

[0030] In some embodiments of the present disclosure, based on the above technical solution, the target loss unit includes: a distance loss subunit configured to perform similarity calculation on the at least two similarities and the at least two original vector weights to obtain a similarity loss value;

[0031] A semantic loss subunit, configured to perform vector loss calculation on the main text vector and the semantic text vector to obtain a difference loss value;

[0032] The loss determination subunit is configured to perform loss aggregation calculation on the similarity loss value and the difference loss value to obtain a target loss value.

[0033] In some embodiments of the present disclosure, based on the above technical solution, the vector acquisition module includes: a word segmentation processing submodule, configured to acquire original text and perform word segmentation processing on the original text to obtain associated text;

[0034] The text vector submodule is configured to perform mapping processing on the associated text to obtain an associated text vector.

[0035] In some embodiments of the present disclosure, based on the above technical solution, the classification vector module includes: a vector connection submodule, configured to perform full connection processing on the semantic text vector and the standard classification vector to obtain a classification vector to be verified;

[0036] The reconstruction loss submodule is configured to determine a reconstruction loss value corresponding to the classification vector to be verified, so as to determine that the classification vector to be verified is a semantic classification vector according to the reconstruction loss value.

[0037] In some embodiments of the present disclosure, based on the above technical solution, the vector connection submodule includes: a stacked encoding unit, configured to input the semantic text vector and the standard classification vector into a pre-trained stacked encoder, so that the stacked encoder performs full connection processing on the semantic text vector and the standard classification vector to output a classification vector to be verified.

[0038] In some embodiments of the present disclosure, based on the above technical solution, the reconstruction loss submodule includes: a vector reconstruction unit configured to perform full connection processing on the classification vector to be verified to obtain a reconstructed text vector and a reconstructed classification vector;

[0039] The vector calculation unit is configured to perform reconstruction loss calculation on the reconstructed text vector and the reconstructed classification vector to obtain a reconstruction loss value.

[0040] In some embodiments of the present disclosure, based on the above technical solution, the vector calculation unit includes: a text loss subunit configured to perform text loss calculation on the reconstructed text vector and the semantic text vector to obtain a text loss value;

[0041] A classification loss subunit, configured to perform classification loss calculation on the reconstructed classification vector and the standard classification vector to obtain a classification loss value;

[0042] The reconstruction calculation subunit is configured to perform loss sum calculation on the text loss value and the classification loss value to obtain a reconstruction loss value.

[0043] According to one aspect of an embodiment of the present disclosure, a computer-readable medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the text vector processing method in the above technical solution is implemented.

[0044] According to one aspect of an embodiment of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute a text vector processing method as in the above technical solution by executing the executable instructions.

[0045] In the technical solution provided by the embodiments of the present disclosure, on the one hand, the associated text vector for generating a semantic text vector includes at least two sub-text vectors, which ensures the number of associated text vectors, solves the problem of insufficient associated text vectors, and can also make full use of the semantic information of the sub-text vectors to ensure the accuracy of the generated semantic text vector; on the other hand, the weight calculation result is obtained by calculating using the determined target weight, which solves the problem of highlighting the importance of the core sub-text vector, and also solves the problem of paying attention to the corresponding semantics when the sub-text vectors are mutually limited. Furthermore, the semantic text vector is applied in the scenario of generalized content recommendation, or the semantic classification vector is applied in the application scenario of precise recommendation, which can also optimize the content recommendation effect and user experience in application scenarios with various needs, and improve user return to a certain extent.

[0046] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present disclosure, and together with the specification, are used to explain the principles of the present disclosure. Obviously, the drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:

[0048] Figure 1 The schematic diagram schematically shows an exemplary system architecture to which the technical solution of the present disclosure is applied;

[0049] Figure 2 A flowchart schematically shows a method for processing a text vector in some embodiments of the present disclosure;

[0050] Figure 3 A flowchart schematically shows the steps of a method for obtaining an associated text vector in some embodiments of the present disclosure;

[0051] Figure 4 A flowchart schematically shows the steps of a method for determining a target weight in some embodiments of the present disclosure;

[0052] Figure 5 A flowchart schematically shows a method for determining at least two text vector weights in some embodiments of the present disclosure;

[0053] Figure 6 A flowchart schematically shows another method for determining weights of at least two text vectors in some embodiments of the present disclosure;

[0054] Figure 7 A flowchart schematically shows the steps of a method for calculating a target loss value in some embodiments of the present disclosure;

[0055] Figure 8 A flowchart schematically shows a method for obtaining a weight calculation result in some embodiments of the present disclosure;

[0056] Fig. 9 A flowchart schematically shows another method for obtaining weight calculation results in some embodiments of the present disclosure;

[0057] Fig.10 A flowchart schematically shows the steps of a method for determining a semantic classification vector according to a reconstruction loss value in some embodiments of the present disclosure;

[0058] Fig.11 A flowchart schematically shows the steps of a method for calculating a reconstruction loss value in some embodiments of the present disclosure;

[0059] Fig.12 A flowchart schematically shows the steps of a method for further calculating a reconstruction loss value in some embodiments of the present disclosure;

[0060] Fig.13 The overall step flow chart of the text vector processing method in some embodiments of the present disclosure is schematically shown;

[0061] Fig.14 The flowchart schematically shows the steps of the text vector processing method in the application scenario of some embodiments of the present disclosure;

[0062] Fig.15 Schematically shows a network structure diagram of a first deep learning network in an application scenario of some embodiments of the present disclosure;

[0063] Fig.16 The network structure diagram of the second deep learning network in the application scenario of some embodiments of the present disclosure is schematically shown;

[0064] Fig.17 The following schematically shows a recommendation effect diagram of some embodiments of the present disclosure in a content recommendation scenario;

[0065] Fig.18 The following schematically shows a recommendation effect diagram of another content recommendation scenario according to some embodiments of the present disclosure;

[0066] Fig.19 The structure block diagram of a text vector processing device in some embodiments of the present disclosure is schematically shown;

[0067] Fig. 20The structure diagram of a computer system suitable for implementing the electronic device of the embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION

[0068] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be more comprehensive and complete and will fully convey the concept of the example embodiments to those skilled in the art.

[0069] In addition, the described features, structures or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced without one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known methods, devices, implementations or operations are not shown or described in detail to avoid blurring the various aspects of the present disclosure.

[0070] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.

[0071] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.

[0072] In the related technologies in this field, the traditional approach is to use text as an isolated object. For example, when the text is a keyword, the user's preference for the keyword can be quantified, and the corresponding articles can be recalled based on the keyword, or the keyword can be simply one-hot encoded in the sorting process and added to the machine learning model as a feature.

[0073] However, this approach cannot establish the connection between keywords, and one-hot encoding will cause the extracted features to be too sparse, which is not conducive to improving the effect of machine learning models. Obviously, the traditional approach does not make full use of keywords and other texts.

[0074] In recent years, with the rise of methods such as vectorization, people have gradually considered vectorizing texts such as keywords.

[0075] Vectorization is to represent an object with a multidimensional vector, thereby corresponding the object to a point in the multidimensional space. The result of vectorization makes the object effectively quantified, and the relationship between objects can be converted into the relationship between vectors. Therefore, vectorization can not only establish the connection between texts, but also solve the sparsity problem caused by one-hot encoding.

[0076] There are generally two approaches to vectorization. One is to vectorize the text as a whole. This approach requires a good sample construction method and is greatly affected by the specific corpus. The other is to first obtain the word vectors and then combine the word vectors into the text vector. This approach is divided into two steps and is more convenient and targeted than the first approach.

[0077] The method used for the first approach is the coarse-grained word-to-vector (word2vec) model. This method treats texts such as keywords as a whole and uses the word2vec model to vectorize texts such as keywords. In the implementation process, the sample is constructed at the keyword granularity instead of the word granularity.

[0078] However, since this method divides the text into words according to the granularity of keywords and other texts to obtain training samples, it is equivalent to adding a new word segmentation method, which increases the complexity of the process. At the same time, the coarsening of the granularity will lead to sparse samples. For example, the number of times "RMB" and "internationalization" appear alone is very high, but the number of times they appear in combination may be very small, resulting in insufficient samples.

[0079] The method used for the second idea is the aggregation operation combination method. This method first obtains the word vector, and then aggregates the vectors corresponding to multiple words contained in the text such as keywords according to the dimension by the mean or maximum value to obtain the text vector.

[0080] However, this method changes the semantic distribution space of the original word vector and fails to distinguish the importance of multiple subwords, resulting in low accuracy of the generated text vector.

[0081] Based on the problems existing in the above solutions, the present disclosure provides a text vector processing method based on artificial intelligence, a text vector processing device, a computer-readable medium and an electronic device.

[0082] Artificial Intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines so that machines have the functions of perception, reasoning and decision-making.

[0083] Artificial intelligence technology is a comprehensive discipline that covers a wide range of fields, including both hardware-level and software-level technologies. The basic technologies of artificial intelligence generally include sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics and other technologies. Artificial intelligence software technology mainly includes computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning.

[0084] Among them, machine learning (ML) is a multi-disciplinary interdisciplinary subject, involving probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory and other disciplines. It specializes in studying how computers simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications are spread across all areas of artificial intelligence. Machine learning and deep learning usually include artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and self-learning.

[0085] The text vector processing method using machine learning technology in artificial intelligence can solve the problem of insufficient associated text vectors, and can also make full use of the semantic information of sub-text vectors to ensure the accuracy of the generated semantic text vectors. Furthermore, semantic text vectors can also be used in a variety of application scenarios such as content recommendation, optimizing content recommendation effects and user experience, and increasing user return to a certain extent.

[0086] Figure 1 A schematic diagram of an exemplary system architecture applying the technical solution of the present disclosure is shown.

[0087] like Figure 1 As shown, the system architecture 100 may include a terminal 110 , a network 120 , and a server 130 . The terminal 110 and the server 130 are connected via the network 120 .

[0088] The terminal 110 may be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, etc., but is not limited thereto. The network 120 may be a communication medium of various connection types that can provide a communication link between the terminal 110 and the server 130, such as a wired communication link, a wireless communication link, or an optical fiber cable, etc., which is not limited in this application. The server 130 may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms.

[0089] Specifically, the server end 130 obtains an associated text vector; wherein the associated text vector is generated based on at least two sub-text vectors. Further, at least two text vector weights of at least two sub-text vectors are determined, and a target weight is determined from the at least two text-to-flow weights, so as to perform weighted calculation on at least two sub-text vectors and the target weight to obtain a weight calculation result. Then, the weight calculation result is fully connected to obtain a semantic text vector of the associated text vector. Finally, a standard classification vector corresponding to the associated text vector is obtained, and the semantic text vector and the standard classification vector are fully connected to obtain a semantic classification vector.

[0090] In addition, the text vector processing method in the embodiment of the present disclosure can be applied to a terminal or a server, and the present disclosure does not specifically limit this. The embodiment of the present disclosure mainly uses the text vector processing method applied to the server 130 as an example.

[0091] The text vector processing method, text vector processing device, computer-readable medium and electronic device provided by the present disclosure are described in detail below in conjunction with specific implementation methods.

[0092] Figure 2 The flowchart schematically shows the steps of the text vector processing method in some embodiments of the present disclosure, such as Figure 2 As shown, the text vector processing method can mainly include the following steps:

[0093] Step S210: Obtain an associated text vector; wherein the associated text vector is generated based on at least two sub-text vectors.

[0094] Step S220: Determine at least two text vector weights of at least two sub-text vectors, and determine a target weight from the at least two text vector weights.

[0095] Step S230: Perform weighted calculation on at least two sub-text vectors and the target weight to obtain a weight calculation result.

[0096] Step S240: Perform full connection processing on the weight calculation result to obtain the semantic text vector of the associated text vector.

[0097] Step S250: Obtain a standard classification vector corresponding to the associated text vector, and perform full connection processing on the semantic text vector and the standard classification vector to obtain a semantic classification vector.

[0098] In an exemplary embodiment of the present disclosure, on the one hand, the associated text vector for generating a semantic text vector includes at least two sub-text vectors, which ensures the number of associated text vectors, solves the problem of insufficient associated text vectors, and can also make full use of the semantic information of the sub-text vectors to ensure the accuracy of the generated semantic text vector; on the other hand, the weight calculation result is obtained by calculating using the determined target weight, which solves the problem of highlighting the importance of the core sub-text vector, and also solves the problem of paying attention to corresponding semantics when sub-text vectors limit each other. Furthermore, applying the semantic text vector in the application scenario of generalized content recommendation, or applying the semantic classification vector in the application scenario of precise recommendation, can also optimize the content recommendation effect and user experience in application scenarios with multiple needs, and improve user return to a certain extent.

[0099] The following is a detailed description of each step of the text vector processing method.

[0100] In step S210, an associated text vector is obtained; wherein the associated text vector is generated based on at least two sub-text vectors.

[0101] In an exemplary embodiment of the present disclosure, the associated text vector may be composed of word vectors of 1 to 3 words, or may be composed of word vectors of other numbers, which is not particularly limited in the exemplary embodiment. Furthermore, the associated text vector may be generated based on the original text.

[0102] In an alternative embodiment, Figure 3 A flowchart of the steps of obtaining the associated text vector is shown, as Figure 3 As shown, the method includes at least the following steps: In step S310, original text is obtained, and word segmentation is performed on the original text to obtain associated text.

[0103] The original text may include various types of text data from different sources, and may be various forms of text obtained on the Internet, such as news information, webpage articles, and question queries. In addition, the original text may be divided according to the field or classification to which it belongs. For example, for news resources, there may be multiple categories such as finance, current affairs, and history. For other original texts, there may also be other classification methods, and this exemplary embodiment does not specifically limit this.

[0104] After the original text is obtained, the original text can be segmented to obtain the corresponding associated text. Specifically, the segmentation processing method can include rule-based segmentation and statistical-based segmentation.

[0105] Among them, rule-based word segmentation is to perform word segmentation in a matching manner by pre-building a dictionary. The dictionary can be a polynomial N-gram (Chinese language model) dictionary, and according to the word segmentation strategy, the character string contained in the original text is matched with the pre-built polynomial N-gram dictionary to obtain all possible segmentation results for each character, and then the shortest path method based on the polynomial N-gram dictionary is used to calculate the final associated text.

[0106] Statistical word segmentation is to use a classifier constructed by training annotated corpus to perform word segmentation. The classifier can be trained and constructed using machine learning or deep learning algorithms. Such algorithms can use hidden Markov models (HMM), conditional random field algorithms (CRF), and deep learning.

[0107] In addition, it is also possible to directly call a variety of different word segmentation tools as word segmentation models, and call different types of word segmentation tools to perform word segmentation processing on the original text to obtain associated text. The associated text can also be called a rough segmentation corpus. Call different types of word segmentation tools to perform preliminary word segmentation processing on the original text to obtain multiple initial word segmentations corresponding to different word segmentation tools, and merge the multiple initial word segmentations into an initial word segmentation set. At this time, the initial word segmentation set contains a lot of initial word segmentation data, and the number of initial word segmentations can be reduced by voting for each initial word segmentation. Among them, the voting process can be obtained according to the statistics of the word segmentation tools. For example, for a certain initial word segmentation, three word segmentation tools can all obtain the initial word segmentation from the original text, and the initial word segmentation is used as an associated text. If the word segmentation results of the three word segmentation tools for the initial word segmentation are inconsistent, the initial word segmentation is directly discarded; if the word segmentation results of two word segmentation tools for the initial word segmentation are consistent, and the word segmentation results of another word segmentation tool are inconsistent, the initial word segmentation can be determined as an associated text.

[0108] When using multiple word segmentation tools for word segmentation, the number of initial word segmentations in the initial word segmentation set can be initially reduced through voting to ensure the validity of the associated text.

[0109] Among them, the word segmentation tool can use open source Chinese word segmentation tools, such as Jieba Chinese word segmentation, Hanlp word segmenter, Harbin Institute of Technology Language Technology Platform (Language Technology Platform, referred to as LTP), a set of Chinese lexical analysis toolkits (THU Lexial Analyzer for Chinese, referred to as THULAC) developed and launched by the Natural Language Processing and Social Humanities Computing Laboratory of Tsinghua University, Stanford word segmenter, natural language processing and information retrieval sharing platform NLPIR, etc. These word segmentation tools have their own word segmentation characteristics. For example, the multiple word segmentation tools called can be LTP, THULAV and NLPIR three word segmentation tools to perform word segmentation processing on the original text.

[0110] The word segmentation module of LTP is trained and decoded based on the CRF model. It models the target sequence based on the observed sequence, and the data source used is the data in People's Daily from January to June 1998. It is initialized by obtaining the file path word segmentation interface, and the word segmentation interface is called to segment the original text to obtain the associated text.

[0111] The THULAC toolkit comes with model training raw corpus, but authorization is required. The Chinese word segmentation and part-of-speech tagging functions of the THULAC toolkit are powerful and accurate. It can configure interface parameters and call word segmentation statements to segment the original text to obtain associated text.

[0112] The NLPIR tool is a full-chain analysis tool that can segment the original text. In the specific segmentation process, it is necessary to import a pre-built dictionary and call the dictionary to perform the initial segmentation to obtain the segmentation result. Furthermore, probabilistic statistical methods and simple rules are used to eliminate ambiguous words, and word frequency information is used to identify unregistered words. After eliminating ambiguity and identifying unregistered words, the associated text is obtained.

[0113] It is worth noting that the associated text is composed of 1 to 3 words, or may be composed of other numbers of words. Therefore, the words that make up the associated text are subtexts.

[0114] In step S320, mapping processing is performed on the associated text to obtain an associated text vector.

[0115] After the word segmentation process obtains the associated text, the word2vec model can be used to map the associated text to obtain the word vector corresponding to the associated text, that is, the associated text vector. In addition, other models or methods can also be used for mapping, which is not specifically limited in this exemplary embodiment.

[0116] The word2vec model is a form of word vector model. The word2vec model is a shallow neural network that maps each word in the associated text into a low-dimensional dense vector, thereby realizing the vectorization of the associated text. After the associated texts of different lengths are input into the word2vec model, the word2vec model will output the associated text vector of the specified length, and the vector distance of the associated text vectors corresponding to different associated texts, such as the closer the cosine distance, the closer the semantics between the words.

[0117] The word2vec model includes two different network structure models, namely the bag-of-words model (Continuous Bag-Of-Words, referred to as CBOW) and the continuous skip-gram model. In the mapping process, both models are applicable.

[0118] Since the associated text is composed of at least two words, the associated text vector may also include at least two sub-text vectors, that is, the sub-text vector is the word vector corresponding to the multiple sub-texts constituting the associated text.

[0119] Furthermore, at least two sub-text vectors in the associated text vector may be mutually restricted, or one of the sub-text vectors may be more important.

[0120] In this exemplary embodiment, by performing word segmentation and mapping processing on the acquired original text, the corresponding associated text vector can be obtained. Using rich original text to determine the associated text vector can be applied to a variety of business scenarios, and the original text covers a comprehensive range, ensuring the accuracy of the word segmentation results and the subsequent text vector processing results from the corpus aspect.

[0121] In step S220, at least two text vector weights of at least two sub-text vectors are determined, and a target weight is determined from the at least two text vector weights.

[0122] In an exemplary embodiment of the present disclosure, after the associated text vector is obtained, the target weights corresponding to at least two sub-text vectors included in the associated text vector may be determined. The target weight may be the largest weight among the at least two text vector weights corresponding to the at least two sub-text vectors, or may be other weights, which are not particularly limited in the exemplary embodiment.

[0123] In an alternative embodiment, Figure 4 A flow chart showing the steps of a method for determining target weights is shown in FIG. Figure 4 As shown, the method includes at least the following steps: in step S410, at least two text vector weights of at least two sub-text vectors are determined, and the at least two text vector weights are compared to obtain a weight comparison result.

[0124] In an alternative embodiment, Figure 5 A flowchart of the steps of a method for determining weights of at least two text vectors is shown, such as Figure 5 As shown, the method at least includes the following steps: In step S510, at least two sub-text vectors are fully connected to obtain a connection vector.

[0125] The full connection process can be implemented in the dense layer of the deep learning network. The full connection process can be a process of connecting each node to all nodes in the previous layer, that is, combining at least two sub-text vectors to obtain a connection vector.

[0126] In step S520, mapping processing is performed on the connection vector to obtain at least two text vector weights of at least two sub-text vectors.

[0127] After obtaining the connection vector, the connection vector may be mapped to obtain at least two text vector weights. The mapping process may be implemented in an activation function layer of a deep learning network, and the activation function used in the activation function layer may be a Sigmoid (S-shaped growth curve) function or other activation functions, which is not particularly limited in this exemplary embodiment.

[0128] After the mapping process, at least two text vector weights of at least two sub-text vectors can be obtained.

[0129] In this exemplary embodiment, at least two corresponding text vector weights can be obtained by performing full connection processing and mapping processing on at least two sub-text vectors, which effectively utilizes the at least two sub-text vectors and strengthens the feature transfer of the at least two sub-text vectors.

[0130] It is worth noting that this method of determining at least two text vector weights is used in the application stage. If at least two text vector weights are to be determined in this way, the deep learning network must be successfully trained in the training stage. Therefore, it is possible to determine whether the deep learning network is successfully trained by at least two original vector weights determined in the training stage, so as to determine the corresponding at least two text vector weights when the deep learning network is successfully trained. That is, in step S520, there can also be another method for determining at least two text vector weights, that is, determining when the training is successful.

[0131] In an alternative embodiment, Figure 6 A flowchart of another method for determining weights of at least two text vectors is shown, such as Figure 6 As shown, the method includes at least the following steps: In step S610, a main text vector corresponding to the associated text vector is obtained, and at least two similarities between the main text vector and at least two sub-text vectors are calculated respectively.

[0132] The main text vector can also be a word vector obtained by performing word segmentation and mapping on the text data in the original text. Figure 3 The processing method for generating the associated text vector is the same as that shown in FIG. 1 , and will not be repeated here. In addition, the main text vector is composed of one word vector, that is, the text data corresponding to the main text vector is one word.

[0133] Since the main text vector and the associated text vector are vectors obtained from text data in the same original text, the main text vector and the associated text vector may be matched in pairs to determine the association relationship between the main text vector and the associated text vector.

[0134] Based on this association relationship, a main text vector corresponding to the associated text vector can be obtained during the training phase.

[0135] In addition, in actual situations, the main text vector and the associated text vector may also be determined in different original texts, that is, there are other associations between the main text vector and the associated text vector, which is not specifically limited in this exemplary embodiment.

[0136] Since both the associated text vector and the main text vector are in vector form, the corresponding similarity can be determined by calculating the cosine distance between the associated text vector and the main text vector.

[0137] Specifically, since the associated text vector is generated based on at least two sub-text vectors, the cosine distances between the main text vector and the at least two sub-text vectors are calculated respectively to determine at least two similarities between the main text vector and the at least two sub-text vectors.

[0138] In step S620, mapping processing is performed on the connection vector to obtain at least two original vector weights corresponding to at least two sub-text vectors.

[0139] The connection vector may be obtained by the dense layer in step S510, which will not be described in detail here.

[0140] After obtaining the connection vector, the connection vector may be mapped to obtain at least two original vector weights. The mapping process may be implemented in an activation function layer of a deep learning network, and the activation function used in the activation function layer may be a Sigmoid (S-type growth curve) function or other activation functions, which is not particularly limited in this exemplary embodiment.

[0141] After the mapping process, at least two original vector weights of at least two sub-text vectors can be obtained.

[0142] In step S630, a weight loss calculation is performed on at least two similarities and at least two original vector weights to obtain a target loss value, so as to determine at least two original vector weights as at least two text vector weights according to the target loss value.

[0143] After obtaining at least two original vector weights, the original vector weights may be learned using at least two similarities to determine whether the original vector weights have been learned through a target loss value.

[0144] In an alternative embodiment, Figure 7 A flowchart showing the steps of the method for calculating the target loss value is shown as follows: Figure 7 As shown, the method includes at least the following steps: In step S710, similarity calculation is performed on at least two similarities and at least two original vector weights to obtain a similarity loss value.

[0145] The similarity calculation method for the similarity loss value may be to calculate the mean square error of at least two similarities and at least two original vector weights, or other calculation methods may be used, which is not particularly limited in this exemplary embodiment.

[0146] In step S720, vector loss calculation is performed on the main text vector and the semantic text vector to obtain a difference loss value.

[0147] Since it is in the training stage, steps S220 to S230 can be executed to obtain the semantic text vector of the associated text vector, so as to determine whether the training process of the deep learning network is completed and successful through the difference loss value between the main text vector and the semantic text vector.

[0148] The vector loss calculation method for the difference loss value may be to calculate the mean square error between the main text vector and the semantic text vector, or may be other calculation methods, which is not particularly limited in this exemplary embodiment.

[0149] In step S730, the similarity loss value and the difference loss value are aggregated and calculated to obtain a target loss value.

[0150] After obtaining the similarity loss value and the difference loss value, a similarity loss parameter corresponding to the similarity loss value can be further obtained to calculate the product between the similarity loss value and the similarity loss parameter, and then the product and the difference loss value are summed to obtain the target loss value. In addition, there may be other loss aggregation calculation methods, which are not specifically limited in this exemplary embodiment.

[0151] In this exemplary embodiment, the corresponding target loss value can be determined by calculating the similarity loss value and the difference loss value. The calculation method is simple and can accurately reflect the training process of the deep learning network, providing a basis for judging whether the deep learning network is successfully trained through the target loss value during the training process.

[0152] After obtaining the target loss value, if the target loss value meets the loss value threshold in the actual situation, it indicates that the deep learning network training is successful, and at least two original vector weights can be determined to be at least two text vector weights.

[0153] After determining at least two text vector weights of at least two sub-text vectors, the at least two text vector weights may be compared to obtain a weight comparison result.

[0154] Specifically, the comparison method may be to compare the sizes of at least two text vector weights, or to compare the priorities of at least two text vector weights, or other comparison methods, which are not particularly limited in this exemplary embodiment.

[0155] In step S420, a target weight is determined among at least two text vector weights according to the weight comparison result.

[0156] After obtaining the weight comparison result, a target weight may be determined from at least two text vector weights according to the weight comparison result.

[0157] Considering the importance of at least two sub-text vectors to the semantic text vector, the largest text vector weight among the at least two text vector weights may be determined as the target weight. In actual situations, other text vector weights may also be selected as the target weight according to other requirements.

[0158] In this exemplary embodiment, the target weight can be determined by comparing the weights of at least two text vectors. The determination method is simple and accurate, and the influence of different sub-text vectors on the semantic text vector is taken into consideration, thereby ensuring the accuracy of generating the semantic text vector.

[0159] In step S230, weighted calculation is performed on at least two subtext vectors and a target weight to obtain a weight calculation result.

[0160] In an exemplary embodiment of the present disclosure, after determining the target weight, at least two self-text vectors and the target weight may be calculated to obtain a weight calculation result.

[0161] Figure 8 and Fig. 9 The following are flowcharts of two methods for obtaining weight calculation results. Figure 8 A flowchart of the steps of a method for calculating a weight calculation result when there is a core text vector with a high degree of importance in at least two sub-text vectors in an associated text vector is shown. Fig. 9 A flowchart of the steps of a method for calculating a weight calculation result when at least two sub-text vectors in an associated text vector are mutually restricted is shown.

[0162] In an alternative embodiment, Figure 8 A flow chart of the steps of a method for obtaining a weight calculation result is shown, such as Figure 8 As shown, the method at least includes the following steps: In step S810, weighted calculation is performed on at least two sub-text vectors and at least two text vector weights to obtain a weighted calculation result.

[0163] A corresponding weighted calculation result can be obtained by performing weighted calculation on at least two sub-text vectors and at least two text vector weights.

[0164] In step S820, semantic weight calculation is performed on the weighted calculation result and the target weight to obtain a weight calculation result.

[0165] The weighted calculation result and the target weight can be multiplied to obtain the corresponding weight calculation result.

[0166] It is worth noting that this semantic weight calculation method is suitable for the case where one of the at least two sub-text vectors in the associated text vector has a higher degree of importance, which is the core text vector.

[0167] In this exemplary embodiment, the weight calculation result when a core text vector exists can be determined by calculating between the weighted calculation result and the target weight. Not only can the semantic space distribution of at least two sub-text vectors be paid attention to, but also the importance of at least two sub-text vectors can be distinguished, thereby ensuring the accuracy of the semantic text vector generated in this context.

[0168] Fig. 9 Another method for obtaining weight calculation results is shown in the flowchart of steps. Fig. 9 As shown, the method at least includes the following steps: In step S910, weighted calculation is performed on at least two sub-text vectors and at least two text vector weights to obtain a weighted calculation result.

[0169] The method of calculating the weights of at least two sub-text vectors and at least two text vectors to obtain a weighted calculation result is the same as step S810, and will not be repeated here.

[0170] In step S920, full connection processing is performed on at least two sub-text vectors to obtain a connection vector, and mapping processing is performed on the connection vector to obtain a combination vector.

[0171] The method of performing full connection processing on at least two sub-text vectors to obtain a connection vector is the same as step S510, and will not be repeated here.

[0172] It is worth noting that the full connection processing can be a dense layer of the same deep learning network as step S510, or another dense layer, and this exemplary embodiment does not make any special limitation on this.

[0173] After obtaining the connection vector, the connection vector may be mapped to obtain a combination vector. The mapping process may be implemented in an activation function layer of a deep learning network, and the activation function used in the activation function layer may be a Tanh (hyperbolic tangent) function or other activation functions, which is not specifically limited in this exemplary embodiment.

[0174] In step S930, a semantic association calculation is performed on the weighted calculation result, the target weight and the combination vector to obtain a weighted calculation result.

[0175] After obtaining the weighted calculation result, the target weight and the combination vector, a semantic association calculation may be performed to obtain the weight calculation result.

[0176] Specifically, the weight product of the target weight and the weighted calculation result can be calculated first, and then the difference between 1 and the target weight is calculated, and then the vector product between the difference and the combination vector is calculated, and finally the weight product and the vector product are summed to obtain the corresponding weight calculation result.

[0177] In addition, the weight calculation result may also be calculated in other ways, which is not particularly limited in this exemplary embodiment.

[0178] It is worth noting that this calculation method is applicable to the case where at least two sub-text vectors in the associated text vector are mutually restricted.

[0179] In this exemplary embodiment, by calculating the weighted calculation results, target weights and combined vectors, the weight calculation results when at least two sub-text vectors restrict each other can be determined, and more attention is paid to the semantic space distribution of at least two sub-text vectors, thereby ensuring the accuracy of generating semantic text vectors in this context.

[0180] In step S240, a full connection process is performed on the weight calculation result to obtain a semantic text vector of the associated text vector.

[0181] In an exemplary embodiment of the present disclosure, after obtaining the weight calculation result, the weight calculation result can be fully connected to obtain a semantic text vector. The fully connected processing can be performed in another dense layer of the deep learning network. In addition, the generated semantic text vector can reflect new semantics in two contexts and can be used in multiple application scenarios such as content recommendation.

[0182] For use in application scenarios such as content recommendation, standard classification information can be further added to the semantic text vector to enhance the recommendation effect of the semantic text vector.

[0183] In step S250, a standard classification vector corresponding to the associated text vector is obtained, and a full connection process is performed on the semantic text vector and the standard classification vector to obtain a semantic classification vector.

[0184] In an exemplary embodiment of the present disclosure, the standard classification vector may be a vector corresponding to the classification information of the original text. To determine the standard classification vector corresponding to the associated text vector, the vector of the classification information to which the associated text belongs may be determined in the vector of the classification information of the original text. Furthermore, the determined standard classification vector may be a vector corresponding to one level of classification information, or may be a vector corresponding to at least two levels of classification information, which is not particularly limited in the present exemplary embodiment.

[0185] After obtaining the standard classification vector, the semantic text vector and the standard classification vector may be further fully connected to obtain the semantic classification vector.

[0186] In an alternative embodiment, Fig.10 A flowchart of the steps of determining a semantic classification vector according to a reconstruction loss value is shown. Fig.10 As shown, the method includes at least the following steps: In step S1010, the semantic text vector and the standard classification vector are fully connected to obtain the classification vector to be verified.

[0187] The full connection processing of the semantic text vector and the standard classification vector can also be implemented in a dense layer of a deep learning network. In addition, after the full connection processing, a latent vector, that is, a classification vector to be verified, can be obtained. The classification vector to be verified is the semantic text vector with the standard classification vector added.

[0188] In an optional embodiment, the semantic text vector and the standard classification vector are input into a pre-trained stacked encoder, so that the stacked encoder performs full-connection processing on the semantic text vector and the standard classification vector to output a classification vector to be verified.

[0189] The deep learning network that obtains the vector to be verified from the semantic text vector and the standard classification vector can be a stacked encoder. The stacked encoder is a neural network model composed of multiple layers of sparse autoencoders, that is, the output of the previous autoencoder is used as the input of the next autoencoder. In other words, the stacked encoder is a cascade of multiple autoencoders to complete the task of layer-by-layer feature extraction, so that the final features are more representative and have a small dimension. It is a dimensionality reduction process.

[0190] After the stacked encoder is trained layer by layer, there is a fine-tuning process. After the layer-by-layer training, the weights of each layer of the autoencoder and the weights of the classification layer have a pre-trained value. At this time, the entire network is connected and trained with data to improve the weight parameters of each layer at the same time. Therefore, the dimensionality reduction processing accuracy of the stacked encoder is significantly higher than that of other encoders.

[0191] In this exemplary embodiment, a stacked encoder is used to perform full connection processing on the semantic text vector and the standard classification vector to obtain the classification vector to be verified, which can improve the accuracy of the classification vector to be verified to ensure the effect and efficiency of generating the semantic classification vector.

[0192] In step S1020, a reconstruction loss value corresponding to the classification vector to be verified is determined, so as to determine that the classification vector to be verified is a semantic classification vector according to the reconstruction loss value.

[0193] If the classification vector to be verified is obtained during the use phase, it can be determined that the classification vector to be verified is a semantic classification vector.

[0194] However, the classification vector to be verified is obtained during the training phase, and the classification vector to be verified can be reconstructed to determine whether the classification vector to be verified is a semantic classification vector according to the reconstruction loss value.

[0195] In an alternative embodiment, Fig.11 A flowchart showing the steps of the method for calculating the reconstruction loss value is shown, as Fig.11 As shown, the method includes at least the following steps: In step S1110, the classification vector to be verified is fully connected to obtain a reconstructed text vector and a reconstructed classification vector.

[0196] The fully connected processing of the verification vector can also be implemented in a dense layer of a deep learning network. Therefore, the verification vector can be fully connected to obtain the corresponding reconstructed text vector and reconstructed classification vector.

[0197] In step S1120, reconstruction loss is calculated for the reconstructed text vector and the reconstructed classification vector to obtain a reconstruction loss value.

[0198] In an alternative embodiment, Fig.12 A flowchart of the steps of further calculating the reconstruction loss value is shown, such as Fig.12 As shown, the method includes at least the following steps: In step S1210, text loss calculation is performed on the reconstructed text vector and the semantic text vector to obtain a text loss value.

[0199] The mean square error between the reconstructed text vector and the semantic text vector is calculated as the text loss value. There may also be other ways to calculate the text loss, which is not particularly limited in this exemplary embodiment.

[0200] In step S1220, classification loss is calculated for the reconstructed classification vector and the standard classification vector to obtain a classification loss value.

[0201] The classification loss value between the reconstructed classification vector and the standard classification vector may also be determined by calculating the mean square error, or by other classification loss calculation methods, which is not particularly limited in this exemplary embodiment.

[0202] In step S1230, the text loss value and the classification loss value are summed to obtain a reconstruction loss value.

[0203] After obtaining the text loss value and the classification loss value, the classification loss parameter corresponding to the classification loss value can be determined. Further, the product of the classification loss value and the classification loss parameter is calculated, and the product and the text loss value are summed to obtain the reconstruction loss value. In addition, the reconstruction loss value can also be obtained by other loss summation calculation methods, which are not specifically limited in this exemplary embodiment.

[0204] In this exemplary embodiment, the reconstruction loss value is calculated to determine whether the deep learning network is successfully trained. The determination method is accurate and efficient, and provides a feasible solution for fusing semantic text vectors with standard classification vectors.

[0205] When the reconstruction loss value meets the loss value threshold in the actual situation, it can be determined that the classification vector to be verified during the training process is the semantic classification vector, which provides an automated and intelligent way to subsequently apply the semantic classification vector to multiple fields such as content recommendation.

[0206] To further illustrate the relationship between the drawings, Fig.13 The overall step flow chart of the text vector processing method is shown as follows: Fig.13As shown, in step S1301, the original text is obtained, and the original text is segmented to obtain the associated text, wherein the associated text vector is generated based on at least two sub-text vectors; in step S1302, the associated text is mapped to obtain the associated text vector, and the at least two sub-text vectors are fully connected to obtain the connection vector; in step S1303, the main text vector corresponding to the associated text vector is obtained, and at least two similarities between the main text vector and the at least two sub-text vectors are respectively calculated; in step S1304, the connection vector is mapped to obtain at least two original vector weights corresponding to the at least two sub-text vectors; in step S13 In step S1305, similarity calculation is performed on at least two similarities and at least two original vector weights to obtain a similarity loss value, and vector loss calculation is performed on the main text vector and the semantic text vector to obtain a difference loss value; in step S1306, loss summary calculation is performed on the similarity loss value and the difference loss value to obtain a target loss value, so as to determine at least two original vector weights as at least two text vector weights according to the target loss value; in step S1307, at least two text vector weights are compared to obtain a weight comparison result, and a target weight is determined in at least two text vector weights according to the weight comparison result; in step S1308, at least two sub-text vectors and at least two text vectors are compared. The weighted weight is weighted to obtain a weighted calculation result, so as to execute step S1309 or continuously execute step S1310 and step S1311; in step S1309, the weighted calculation result and the target weight are semantically calculated to obtain a weight calculation result; in step S1310, at least two sub-text vectors are fully connected to obtain a connection vector, and the connection vector is mapped to obtain a combination vector; in step S1311, the weighted calculation result, the target weight and the combination vector are semantically associated to obtain a weight calculation result; in step S1312, a standard classification vector corresponding to the associated text vector is obtained; in step S1313, the semantic text vector is mapped to the combination vector; This vector and the standard classification vector are input into a pre-trained stacked encoder so that the stacked encoder performs full connection processing on the semantic text vector and the standard classification vector to output the classification vector to be verified; in step S1314, the classification vector to be verified is fully connected to obtain a reconstructed text vector and a reconstructed classification vector, and text loss calculation is performed on the reconstructed text vector and the semantic text vector to obtain a text loss value; in step S1315, classification loss calculation is performed on the reconstructed classification vector and the standard classification vector to obtain a classification loss value, and the text loss value and the classification loss value are summed up to obtain a reconstruction loss value, so as to determine that the classification vector to be verified is a semantic classification vector according to the reconstruction loss value.

[0207] The text vector processing method provided in the embodiment of the present disclosure is described in detail below in conjunction with a specific application scenario.

[0208] Fig.14 A flowchart of the steps of the text vector processing method in the application scenario is shown, such as Fig.14 As shown, in step S1401, the original text is obtained.

[0209] The original text may include various types of text data from different sources, and may be various forms of text obtained on the Internet, such as news information, webpage articles, and question queries. In addition, the original text may be divided according to the field or classification to which it belongs. For example, for news resources, there may be multiple categories such as finance, current affairs, and history. For other original texts, there may also be other classification methods, and this exemplary embodiment does not specifically limit this.

[0210] In step S1402, the original text is segmented to generate a word sequence.

[0211] The word segmentation processing of the original text may be based on rule-based word segmentation, based on statistical word segmentation, or may be performed using a word segmentation tool, which is not particularly limited in this exemplary embodiment.

[0212] The word sequence obtained after word segmentation may include single word keywords or multi-word keywords. Among them, single word keywords are main texts, which means that each text contains only one word; multi-word keywords are associated texts, which means that each text contains at least two sub-texts. Generally, an associated text contains 1 to 3 sub-texts.

[0213] Moreover, there are two kinds of contexts in the associated text. One is that one sub-text in the associated text is dominant. For example, in the associated text "Cultural Plaza", "culture" is the core word. The other is that at least two sub-texts in the associated text limit each other. For example, in the associated text "Thailand Tourism", "Thailand" and "Tourism" limit each other, and in "RMB Internationalization", "RMB" and "Internationalization" also limit each other.

[0214] In step S1403, the word2vec model is trained to generate word vectors.

[0215] By inputting the associated text and the main text into the trained word2vec model, the associated text and the main text can be mapped to obtain the corresponding associated text vector and main text vector, that is, the word vector.

[0216] In step S1404, keywords are classified into single words and multi-words.

[0217] Since the word sequence of the original text includes the main text and the associated text, the corresponding word vector may also include the main text vector of a single word and the associated text vector of multiple words.

[0218] In step S1405, samples (multi-words->single words) are generated.

[0219] The associated text vectors and main text vectors of multiple keywords in the same original text are paired in pairs, and each pair is a training sample.

[0220] In step S1406, word vectors are combined through network 1.

[0221] In the network 1, the associated text vector is used as input, and the main text vector is aggregated during the training process to obtain the corresponding semantic text vector.

[0222] Fig.15 The network structure diagram of the first deep learning network in the application scenario is shown, Fig.15 As shown in the figure, if the associated text is "Federal Reserve Chairman", then the two sub-texts in the associated text are "Federal Reserve" and "Chairman". At this time, the main text is "interest rate hike".

[0223] To ensure that the case where the associated text includes three subtexts is applicable, an input terminal of word 3 can also be set. In addition, when the associated text includes only two subtexts, null (zero value) can be input to the input terminal of word 3.

[0224] Therefore, the main text vector of "interest rate hike" is input at the input end of the word tag (keyword) of the deep network learning model, the sub-text vector of "Federal Reserve" is input at the input end of word 1, and the sub-text vector of "Chairman" is input at the input end of word 2.

[0225] Furthermore, fully connected processing is performed on word 1, word 2 and word 3 in the dense layer to obtain the corresponding connection vector. Since word 1, word 2 and word 3 are 128-dimensional vectors, the connection vector is also 128-dimensional.

[0226] The connection vector is mapped using the sigmoid function in the activation function layer to learn the text vector weights corresponding to word 1, word 2, and word 3. The text vector weight is a 1*3 vector.

[0227] The largest text vector weight among the text vector weights corresponding to word 1, word 2, and word 3 is determined as the target weight, that is, max.

[0228] Furthermore, in another activation function layer, the connection vector is mapped using the tanh function to obtain a combination vector, i.e., c2. The combination vector c2 is also 128-dimensional.

[0229] On this basis, word 1, word 2, word 3 and the corresponding text vector weights are weighted to obtain a weighted calculation result, namely c1.

[0230] The combination vector c2, the weighted calculation result c1 and the target weight max are semantically associated according to formula (1) to obtain the weight calculation result:

[0231] c=max*c1+(1-max)*c2 Formula (1)

[0232] The weight calculation result c is a 128-dimensional vector.

[0233] After obtaining the weight calculation result c, the weight calculation result c may be fully connected in a dense layer in a deep learning network to obtain a semantic text vector of the associated text vector.

[0234] It is worth noting that if the associated text vector has a sub-text vector as the core word vector, the target weight max will be close to 1, meeting the requirement of highlighting the influence of the core word vector on the semantic text vector in this context; if at least two text vectors in the associated text vector restrict each other, the target weight max is between 0 and 1, which is related to the strength of the restriction between at least two text vectors.

[0235] At the same time, during the training process, the cosine distance between the word tag and word 1, word 2 and word 3 can also be calculated to obtain the corresponding similarity. The similarity is a 1*3 vector.

[0236] In addition, the mean square error loss1 between the similarity and at least two text vector weights is calculated, that is, the similarity loss value, and the mean square error loss2 between the semantic text vector and the main text vector of the word tag is calculated, that is, the difference loss value. Then, the similarity loss parameter a is used to calculate the loss1 and loss2 according to formula (2) to obtain the target loss value:

[0237] loss=a*loss1+loss2 formula (2)

[0238] Among them, loss is the target loss value.

[0239] If the target loss value meets the loss value threshold in the application scenario, it can be determined that the first deep learning network is successfully trained, and any associated text vector can be processed to obtain the corresponding semantic text vector.

[0240] The first deep learning network uses the co-occurrence information of the associated text vector and the main text vector. In order to add more prior information, the standard classification vector can also be added through the second deep learning network.

[0241] Furthermore, to facilitate training and tuning, only the standard classification information can be added to the second deep learning network.

[0242] In step S1407, keyword classification information is obtained.

[0243] The keyword classification information is the standard classification vector of the associated text vector. The standard classification vector may be a vector corresponding to the first-level classification information or a vector corresponding to at least two-level classification information, which is not particularly limited in this exemplary embodiment.

[0244] In step S1408, a sample (vector+classification information->vector+classification information) is generated.

[0245] Specifically, the semantic text vector and the standard classification vector are used as half of a training sample, and the other half of the training sample can be a reconstructed text vector and a reconstructed classification vector obtained by reconstructing the vector to be verified obtained by fully connecting the semantic text vector and the standard classification vector.

[0246] In step S1409, classification information is added through network 2 and input into the input-hidden layer and output of network 2.

[0247] Fig.16 The network structure diagram of the second deep learning network is shown as Fig.16 As shown in the figure, the semantic text vector, i.e. the tag vector x1, and the standard classification vector x2, i.e. the classification proportion, are input into the fully connected layer of the deep learning network for dimensionality reduction to obtain the latent vector, i.e. the vector to be verified.

[0248] It is worth noting that the deep learning network that obtains the vector to be verified from the semantic text vector and the standard classification vector can be a stacked encoder.

[0249] Among them, the semantic text vector x1 is 128-dimensional, and the standard classification vector x2 is 500-dimensional. Therefore, the vector to be verified is 128-dimensional.

[0250] It is worth noting that when the standard classification vector is 500-dimensional, it can represent multiple classification levels, and of course it can also be a primary classification level, and this exemplary embodiment does not make any special limitation on this.

[0251] Furthermore, the verification vector is fully connected to obtain a reconstructed text vector y1 and a reconstructed classification vector y2. The reconstructed text vector y1 is 128-dimensional, while the reconstructed classification vector y2 is 500-dimensional.

[0252] To determine whether the second deep learning network is trained, that is, whether the vector to be verified is a semantic classification vector, the mean square error loss3 between the semantic text vector x1 and the reconstructed text vector y1, that is, the text loss value, can be calculated, and the mean square error loss4 between the standard classification vector x2 and the reconstructed classification vector y2, that is, the classification loss value, can be calculated to determine the reconstruction loss value according to the text loss value loss3 and the classification loss value loss4 according to formula (3):

[0253] loss=loss3+α*loss4 formula (3)

[0254] Among them, loss is the reconstruction loss value, and α is the classification loss parameter.

[0255] In step S1410, the hidden layer of network 2 is used as the vector of the keyword.

[0256] When the reconstruction loss parameter meets the loss value threshold in the application scenario, it can be determined that the second deep learning network is successfully trained, and the vector to be verified output by the hidden layer is determined as a semantic classification vector.

[0257] The semantic classification vector is obtained by fusing the semantic text vector and the standard classification vector, and can be more conveniently applied in various application scenarios such as content recommendation.

[0258] Fig.17 A recommendation effect diagram in a content recommendation scenario is shown, such as Fig.17 As shown, the main text of model1 is "Zhuge Liang". During training, the first deep learning network is used to determine that the text represented by the semantic text vector corresponding to the main text includes text data such as "Xinyou".

[0259] Since "Zhuge Liang" has a large proportion in the standard classification vector of "history", the standard classification information can be added to determine that the text represented by the semantic classification vector at this time does not include text data related to the game.

[0260] Obviously, the component influence of the standard classification vector of “game” can be weakened by adding the standard classification information.

[0261] Fig.18 shows another recommendation effect diagram in a content recommendation scenario, such as Fig.18 As shown, the main text of model2 is "Federal Reserve". During training, the first deep learning network is used to determine that the text represented by the semantic text vector corresponding to the main text includes text data such as "Grovskopf".

[0262] Since the weight of "Federal Reserve" in the standard classification vector of "Finance" is relatively large, the standard classification vector can be increased to determine that the text represented by the semantic classification vector at this time does not include text data related to current affairs.

[0263] Obviously, by adding standard classification information, the component influence of the standard classification vector of "current affairs" can be weakened.

[0264] Therefore, in the application scenario of generalized content recommendation, semantic text vectors can be applied; in the application scenario of precise content recommendation, semantic classification vectors can be used.

[0265] Based on the above application scenarios, it can be seen that the text vector processing method provided by the embodiment of the present disclosure, on the one hand, generates an associated text vector of a semantic text vector including at least two sub-text vectors, thereby ensuring the number of associated text vectors and solving the problem of insufficient associated text vectors. It can also make full use of the semantic information of the sub-text vectors to ensure the accuracy of the generated semantic text vector. On the other hand, the weight calculation result is obtained by calculating using the determined target weight, thereby solving the problem of highlighting the importance of the core sub-text vector, and also solving the problem of paying attention to the corresponding semantics when the sub-text vectors are mutually limited. Furthermore, the semantic text vector is applied in the scenario of generalized content recommendation, or the semantic classification vector is applied in the application scenario of precise recommendation, which can also optimize the content recommendation effect and user experience in application scenarios with multiple needs, thereby improving the user return rate to a certain extent.

[0266] It should be noted that although the steps of the method in the present disclosure are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.

[0267] The following describes an apparatus embodiment of the present disclosure, which can be used to execute the text vector processing method in the above-mentioned embodiment of the present disclosure. For details not disclosed in the apparatus embodiment of the present disclosure, please refer to the embodiment of the text vector processing method in the above-mentioned embodiment of the present disclosure.

[0268] Fig.19 The structural block diagram of a text vector processing device in some embodiments of the present disclosure is schematically shown, such as Fig.19 As shown, the text vector processing device 1900 may mainly include: a vector acquisition module 1910, a weight determination module 1920, a weight calculation module 1930, a connection processing module 1940 and a classification vector module 1950.

[0269] The vector acquisition module 1910 is configured to acquire an associated text vector; wherein the associated text vector is generated based on at least two sub-text vectors; the weight determination module 1920 is configured to determine at least two text vector weights of at least two sub-text vectors, and determine a target weight from the at least two text vector weights; the weight calculation module 1930 is configured to calculate at least two sub-text vectors and the target weight to obtain a weight calculation result; the connection processing module 1940 is configured to perform full connection processing on the weight calculation result to obtain a semantic text vector of the associated text vector; the classification vector module 1950 is configured to acquire a standard classification vector corresponding to the associated text vector, and perform full connection processing on the semantic text vector and the standard classification vector to obtain a semantic classification vector.

[0270] In some embodiments of the present disclosure, the weight determination module includes: a weight comparison submodule configured to compare at least two text vector weights to obtain a weight comparison result;

[0271] The comparison result submodule is configured to determine a target weight among at least two text vector weights according to the weight comparison result.

[0272] In some embodiments of the present disclosure, the weight calculation module includes: a weight calculation submodule configured to perform weighted calculation on at least two sub-text vectors and at least two text vector weights to obtain a weighted calculation result;

[0273] The result calculation submodule is configured to perform semantic weight calculation on the weighted calculation result and the target weight to obtain a weight calculation result.

[0274] In some embodiments of the present disclosure, the weight calculation module includes: a weight calculation submodule configured to perform weighted calculation on at least two sub-text vectors and at least two text vector weights to obtain a weighted calculation result;

[0275] A combination vector submodule is configured to perform full connection processing on at least two sub-text vectors to obtain a connection vector, and perform mapping processing on the connection vector to obtain a combination vector;

[0276] The vector calculation submodule is configured to perform semantic association calculation on the weighted calculation result, the target weight and the combination vector to obtain the weight calculation result.

[0277] In some embodiments of the present disclosure, the weight determination module includes: a connection vector submodule configured to perform full connection processing on at least two sub-text vectors to obtain a connection vector;

[0278] The mapping processing submodule is configured to perform mapping processing on the connection vector to obtain at least two text vector weights of at least two sub-text vectors.

[0279] In some embodiments of the present disclosure, the mapping processing submodule includes: a focus text unit configured to obtain a main text vector corresponding to the associated text vector, and respectively calculate at least two similarities between the main text vector and at least two sub-text vectors;

[0280] An original vector unit is configured to perform mapping processing on the connection vector to obtain at least two original vector weights corresponding to at least two sub-text vectors;

[0281] The target loss unit is configured to perform weight loss calculation on at least two similarities and at least two original vector weights to obtain a target loss value, so as to determine at least two original vector weights as at least two text vector weights according to the target loss value.

[0282] In some embodiments of the present disclosure, the target loss subunit includes: a distance loss unit configured to perform similarity calculation on at least two similarities and at least two original vector weights to obtain a similarity loss value;

[0283] The semantic loss subunit is configured to perform vector loss calculation on the main text vector and the semantic text vector to obtain a difference loss value;

[0284] The loss determination subunit is configured to perform loss aggregation calculation on the similarity loss value and the difference loss value to obtain a target loss value.

[0285] In some embodiments of the present disclosure, the vector acquisition module includes: a word segmentation processing submodule configured to acquire original text and perform word segmentation processing on the original text to obtain associated text;

[0286] The text vector submodule is configured to perform mapping processing on the associated text to obtain the associated text vector.

[0287] In some embodiments of the present disclosure, the classification vector module includes: a vector connection submodule configured to perform full connection processing on the semantic text vector and the standard classification vector to obtain a classification vector to be verified;

[0288] The reconstruction loss submodule is configured to determine a reconstruction loss value corresponding to the classification vector to be verified, so as to determine that the classification vector to be verified is a semantic classification vector according to the reconstruction loss value.

[0289] In some embodiments of the present disclosure, the vector connection submodule includes: a stacked encoding unit, configured to input the semantic text vector and the standard classification vector into a pre-trained stacked encoder, so that the stacked encoder performs full connection processing on the semantic text vector and the standard classification vector to output a classification vector to be verified.

[0290] In some embodiments of the present disclosure, the reconstruction loss submodule includes: a vector reconstruction unit configured to perform full connection processing on the classification vector to be verified to obtain a reconstructed text vector and a reconstructed classification vector;

[0291] The vector calculation unit is configured to perform reconstruction loss calculation on the reconstructed text vector and the reconstructed classification vector to obtain a reconstruction loss value.

[0292] In some embodiments of the present disclosure, the vector calculation unit includes: a text loss subunit configured to perform text loss calculation on the reconstructed text vector and the semantic text vector to obtain a text loss value;

[0293] A classification loss subunit is configured to perform classification loss calculation on the reconstructed classification vector and the standard classification vector to obtain a classification loss value;

[0294] The reconstruction calculation subunit is configured to calculate the text loss value and the classification loss value by summing the losses to obtain the reconstruction loss value.

[0295] The specific details of the text vector processing device provided in each embodiment of the present disclosure have been described in detail in the corresponding method embodiment, so they will not be repeated here.

[0296] Fig. 20 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present disclosure is shown.

[0297] It should be noted that Fig. 20 The computer system 2000 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0298] like Fig. 20 As shown, computer system 2000 includes a central processing unit (CPU) 2001, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 2002 or a program loaded from a storage part 2008 to a random access memory (RAM) 2003. Various programs and data required for system operation are also stored in RAM 2003. CPU 2001, ROM 2002 and RAM 2003 are connected to each other via a bus 2004. An input / output (I / O) interface 2005 is also connected to bus 2004.

[0299] The following components are connected to the I / O interface 2005: an input section 2006 including a keyboard, a mouse, etc.; an output section 2007 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 2008 including a hard disk, etc.; and a communication section 2009 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 2009 performs communication processing via a network such as the Internet. A drive 2010 is also connected to the I / O interface 2005 as needed. A removable medium 2011, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 2010 as needed, so that a computer program read therefrom is installed into the storage section 2008 as needed.

[0300] In particular, according to an embodiment of the present disclosure, the process described in each method flow chart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flow chart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication part 2009, and / or installed from a removable medium 2011. When the computer program is executed by a central processing unit (CPU) 2001, various functions defined in the system of the present application are executed.

[0301] It should be noted that the computer-readable medium shown in the embodiment of the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by an instruction execution system, device or device or used in combination with it. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a computer-readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate, or transmit programs for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.

[0302] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0303] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.

[0304] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the implementation of the present disclosure.

[0305] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any modifications, uses or adaptations of the present disclosure, which follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure.

[0306] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A text vector processing method, characterized in that: The method comprises: Acquire an original text, perform word segmentation processing on the original text to obtain an associated text, and perform mapping processing on the associated text to obtain an associated text vector including at least two sub-text vectors; determining at least two text vector weights of the at least two sub-text vectors, and determining a target weight from the at least two text vector weights; Performing weighted calculation on the at least two sub-text vectors and the at least two text vector weights to obtain a weighted calculation result, and performing semantic weight calculation on the weighted calculation result and the target weight to obtain a weighted calculation result; Performing full connection processing on the weight calculation result to obtain the semantic text vector of the associated text vector; Acquire a standard classification vector corresponding to the associated text vector, wherein the standard classification vector is a vector corresponding to classification information of the original text; Performing full connection processing on the semantic text vector and the standard classification vector to obtain a classification vector to be verified; The classification vector to be verified is fully connected to obtain a reconstructed text vector and a reconstructed classification vector, and reconstruction loss calculation is performed on the reconstructed text vector and the reconstructed classification vector to obtain a reconstruction loss value, and when the reconstruction loss value meets a loss value threshold, the classification vector to be verified is determined to be a semantic classification vector.

2. The text vector processing method according to claim 1, characterized in that: The step of determining a target weight from the at least two text vector weights comprises: Comparing the weights of the at least two text vectors to obtain a weight comparison result; A target weight is determined among the at least two text vector weights according to the weight comparison result.

3. The text vector processing method according to claim 1, characterized in that: The performing semantic weight calculation on the weighted calculation result and the target weight to obtain a weight calculation result includes: Performing full connection processing on the at least two sub-text vectors to obtain a connection vector, and performing mapping processing on the connection vector to obtain a combination vector; Performing a product operation on the target weight and the weighted calculation result to obtain a weighted product; Performing a difference operation on the weight product and the target weight to obtain a difference, and performing a product operation on the difference and the combined vector to obtain a vector product; A sum operation is performed on the weight product and the vector product to obtain a weight calculation result.

4. The text vector processing method according to claim 1, characterized in that: The determining of at least two text vector weights of the at least two sub-text vectors comprises: Performing full connection processing on the at least two sub-text vectors to obtain a connection vector; Mapping is performed on the connection vector to obtain at least two text vector weights of the at least two sub-text vectors.

5. The text vector processing method according to claim 4, characterized in that: The mapping process of the connection vector to obtain at least two text vector weights of the at least two sub-text vectors includes: Acquire a main text vector corresponding to the associated text vector, and respectively calculate at least two similarities between the main text vector and the at least two sub-text vectors; Mapping the connection vector to obtain at least two original vector weights corresponding to the at least two sub-text vectors; A weight loss calculation is performed on the at least two similarities and the at least two original vector weights to obtain a target loss value, so as to determine the at least two original vector weights as at least two text vector weights according to the target loss value.

6. The text vector processing method according to claim 5, characterized in that: The step of performing weight loss calculation on the at least two similarities and the at least two original vector weights to obtain a target loss value includes: Performing similarity calculation on the at least two similarities and the at least two original vector weights to obtain a similarity loss value; Performing vector loss calculation on the main text vector and the semantic text vector to obtain a difference loss value; The similarity loss value and the difference loss value are aggregated and calculated to obtain a target loss value.

7. The text vector processing method according to claim 1, characterized in that: The step of performing full connection processing on the semantic text vector and the standard classification vector to obtain the classification vector to be verified includes: The semantic text vector and the standard classification vector are input into a pre-trained stacked encoder, so that the stacked encoder performs full-connection processing on the semantic text vector and the standard classification vector to output a classification vector to be verified.

8. The text vector processing method according to claim 1, characterized in that: The performing reconstruction loss calculation on the reconstructed text vector and the reconstructed classification vector to obtain a reconstruction loss value includes: Performing text loss calculation on the reconstructed text vector and the semantic text vector to obtain a text loss value; Performing classification loss calculation on the reconstructed classification vector and the standard classification vector to obtain a classification loss value; The text loss value and the classification loss value are summed up to obtain a reconstruction loss value.

9. A text vector processing device, characterized in that: The device comprises: A vector acquisition module is configured to acquire an original text, perform word segmentation processing on the original text to obtain an associated text, and perform mapping processing on the associated text to obtain an associated text vector including at least two sub-text vectors; a weight determination module configured to determine at least two text vector weights of the at least two sub-text vectors, and determine a target weight from the at least two text vector weights; A weight calculation module is configured to perform weighted calculation on the at least two sub-text vectors and the at least two text vector weights to obtain a weighted calculation result, and perform semantic weight calculation on the weighted calculation result and the target weight to obtain a weighted calculation result; A connection processing module, configured to perform full connection processing on the weight calculation result to obtain a semantic text vector of the associated text vector; The classification vector module is configured to obtain a standard classification vector corresponding to the associated text vector, wherein the standard classification vector is a vector corresponding to the classification information of the original text; perform full connection processing on the semantic text vector and the standard classification vector to obtain a classification vector to be verified; perform full connection processing on the classification vector to be verified to obtain a reconstructed text vector and a reconstructed classification vector, perform reconstruction loss calculation on the reconstructed text vector and the reconstructed classification vector to obtain a reconstruction loss value, and when the reconstruction loss value meets a loss value threshold, determine that the classification vector to be verified is a semantic classification vector.

10. The text vector processing device according to claim 9, characterized in that: The weight determination module comprises: A weight comparison submodule, configured to compare the weights of the at least two text vectors to obtain a weight comparison result; The comparison result submodule is configured to determine a target weight among the at least two text vector weights according to the weight comparison result.

11. The text vector processing device according to claim 9, characterized in that: The weight determination module comprises: A connection vector submodule, configured to perform full connection processing on the at least two sub-text vectors to obtain a connection vector; The mapping processing submodule is configured to perform mapping processing on the connection vector to obtain at least two text vector weights of the at least two sub-text vectors.

12. The text vector processing device according to claim 11, characterized in that: The mapping processing submodule includes: A focus text unit, configured to obtain a main text vector corresponding to the associated text vector, and respectively calculate at least two similarities between the main text vector and the at least two sub-text vectors; An original vector unit, configured to perform mapping processing on the connection vector to obtain at least two original vector weights corresponding to the at least two sub-text vectors; The target loss unit is configured to perform weight loss calculation on the at least two similarities and the at least two original vector weights to obtain a target loss value, so as to determine the at least two original vector weights as at least two text vector weights according to the target loss value.

13. The text vector processing device according to claim 12, characterized in that: The target loss unit comprises: A distance loss subunit is configured to perform similarity calculation on the at least two similarities and the at least two original vector weights to obtain a similarity loss value; A semantic loss subunit, configured to perform vector loss calculation on the main text vector and the semantic text vector to obtain a difference loss value; The loss determination subunit is configured to perform loss aggregation calculation on the similarity loss value and the difference loss value to obtain a target loss value.

14. A computer readable medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the text vector processing method described in any one of claims 1 to 8 is implemented.

15. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to execute the text vector processing method according to any one of claims 1 to 8 by executing the executable instructions.

Citation Information

Patent Citations

  • A text representation method based on BM25 weighting combined with a word vector

    CN109597995A

  • Feature vector generation method and device and text classification method and device based on feature vector

    CN110119445A

  • Entity relationship extraction method of concerned associated words

    CN110196978A

  • Text processing method and device, storage medium and electronic device

    CN110704621A

  • Text similarity calculation method based on x2-C

    CN110705247A