Text vector determination method and device, electronic equipment and storage medium
By precoding texts in different vertical fields and using domain-specific text classification models, the problem of inaccuracy of text vectors is solved, and the accuracy and correlation degree of text vectors are improved.
Patent Information
- Application Number
- CN202411092834.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-09
- Publication Date
- 2024-11-15
AI Technical Summary
In text information processing in different professional fields, it is difficult for the prior art to accurately determine text vectors, resulting in inaccurate text vectors and affecting subsequent application effects.
By obtaining the pending text for multiple vertical fields, precoding is performed and processing the precoding vectors using the vector coding submodel in the text classification model corresponding to the vertical field, the target vector is obtained and the accuracy of the text vector is improved.
It realizes the determination of the pending text vectors for different vertical fields, and improves the correlation and accuracy between the text vector and its corresponding fields.
Smart Images

Figure CN118964614A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of natural language processing technology, and in particular to a text vector determination method, device, electronic device and storage medium. Background Art
[0002] Text vector is a commonly used and relatively effective text representation method. It represents different words through different sparse or dense vectors, which can express the semantics of the text to a certain extent.
[0003] In the related art, the text is usually processed through a general text vector encoding method to obtain a vector representation of the text. However, when the text vector is determined based on the above method, if the text to be processed is text information in different professional fields with large differences, the text vector may be inaccurate, which in turn affects the subsequent application effect of the text vector. Summary of the invention
[0004] The present invention provides a text vector determination method, device, electronic device and storage medium to achieve the effect of targeted text vector determination for text to be processed in different vertical fields, thereby improving the correlation between the text vector and its corresponding vertical field and improving the accuracy of the text vector.
[0005] According to one aspect of the present invention, a text vector determination method is provided, the method comprising:
[0006] For multiple vertical fields, obtain the text to be processed in the current vertical field;
[0007] Precoding the text to be processed in the current vertical field to obtain a precoding vector corresponding to the text to be processed;
[0008] Retrieving a text classification model corresponding to the current vertical field, and processing the pre-encoded vector according to a vector encoding sub-model in the text classification model to obtain a target vector corresponding to the text to be processed;
[0009] The text classification model is obtained by training a neural network model based on a sample precoding vector corresponding to a sample text in the current vertical field and a real text category corresponding to the sample text.
[0010] According to another aspect of the present invention, a text vector determination device is provided, the device comprising:
[0011] A text acquisition module is used to acquire the text to be processed in the current vertical field for multiple vertical fields;
[0012] A text precoding module, used for precoding the text to be processed in the current vertical field to obtain a precoding vector corresponding to the text to be processed;
[0013] A vector determination module, used to call a text classification model corresponding to the current vertical field, and process the pre-encoded vector according to a vector encoding sub-model in the text classification model to obtain a target vector corresponding to the text to be processed;
[0014] The text classification model is obtained by training a neural network model based on a sample precoding vector corresponding to a sample text in the current vertical field and a real text category corresponding to the sample text.
[0015] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0016] at least one processor; and
[0017] a memory communicatively connected to the at least one processor; wherein,
[0018] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the text vector determination method described in any embodiment of the present invention.
[0019] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the text vector determination method described in any embodiment of the present invention when executed.
[0020] The technical solution of the embodiment of the present invention obtains the text to be processed in the current vertical field for multiple vertical fields, further pre-encodes the text to be processed in the current vertical field to obtain a pre-encoding vector corresponding to the text to be processed, further calls a text classification model corresponding to the current vertical field, and processes the pre-encoding vector according to the vector encoding sub-model in the text classification model to obtain a target vector corresponding to the text to be processed, thereby solving the problem of inaccurate text vectors in the related art when the text to be processed is text information in different professional fields with large differences, and achieves the effect of targeted text vector determination for the text to be processed in different vertical fields, thereby improving the correlation between the text vector and its corresponding vertical field, and improving the accuracy of the text vector.
[0021] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0023] Figure 1 is a flowchart of a text vector determination method provided according to Embodiment 1 of the present invention;
[0024] Figure 2 is a flowchart of a text vector determination method provided in Embodiment 2 of the present invention;
[0025] Figure 3 is a flowchart of a method for determining a text vector provided in Embodiment 3 of the present invention;
[0026] Figure 4 is a structural diagram of a text vector determination device provided according to a fourth embodiment of the present invention;
[0027] Figure 5 It is a structural schematic diagram of an electronic device for implementing the text vector determination method of an embodiment of the present invention. DETAILED DESCRIPTION
[0028] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0029] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0030] Embodiment 1
[0031] Figure 1 1 is a flowchart of a text determination method provided by the first embodiment of the present invention. This embodiment is applicable to the case of determining the vector representation of the text to be processed in different vertical fields. The method can be executed by a text determination device. The text determination device can be implemented in the form of hardware and / or software. The text determination device can be configured in a terminal and / or a server. Figure 1 As shown, the method includes:
[0032] S110. For multiple vertical fields, obtain the text to be processed in the current vertical field.
[0033] Among them, the vertical field refers to a market or industry division that focuses on a specific industry, field or demand group and provides in-depth, professional services and products. The application scope of the vertical field is very wide, covering e-commerce, online education, medical health, financial technology, life services and other fields. The text to be processed can be the text to be processed, and the text is associated with the current vertical field. The text to be tested can be any text associated with the current vertical field. Optionally, the text to be processed can be professional literature, industry reports, case studies, user interaction information, etc. It should be noted that the text to be processed can be any word in the text information associated with the current vertical field, or it can be any sentence in the text information associated with the current vertical field, and this embodiment does not specifically limit this.
[0034] In this embodiment, the text to be processed can be a pre-stored text retrieved from a relevant database; or, it can be a text information transmission received from an external device; or, it can be a response to a text input operation, and based on the text input operation, the input text is obtained, and the text to be processed is determined based on the input text, etc.
[0035] It should be noted that in a specific application scenario, the text to be processed can be obtained in real time or periodically; or, when it is detected that a user has uploaded a text, the text can be obtained and used as the text to be processed. This embodiment does not specifically limit this.
[0036] As an optional implementation of this embodiment, in order to process texts in different vertical fields in a targeted manner, for multiple vertical fields, text information can be randomly retrieved from the corpus corresponding to the current vertical field. Then, the retrieved text information can be used as the text to be processed.
[0037] It should be noted that the text to be processed can be determined from the information to be processed associated with the current vertical field. Generally, in addition to the text to be processed, the information to be processed may also include information in other forms of expression, and the same text may appear repeatedly in the text information included in the information to be processed. Therefore, before obtaining the text to be processed, the obtained information to be processed can be preprocessed first, and then the text to be processed can be obtained.
[0038] Based on this, before the above technical solutions, it also includes: for multiple vertical fields, obtaining the information to be processed in the current vertical field; preprocessing the information to be processed based on a preset information preprocessing method to obtain the text to be processed in the current vertical field.
[0039] The information to be processed may be the original corpus directly obtained and unprocessed. Exemplarily, the information to be processed may be a vertical domain knowledge corpus. The information to be processed may include at least one information representation form. Optionally, the information representation form in the information to be processed may include but is not limited to text, images, tables, sounds, and videos. The information preprocessing method may be a pre-set method for preprocessing the original corpus including different information representation forms. Optionally, the information preprocessing method may include at least one of deduplication, denoising, sentence segmentation, and word segmentation. Deduplication refers to removing repeated information. Denoising refers to deleting information in other information representation forms except the target information representation form in the information. Exemplarily, if the target representation form is text, the information to be processed may be denoised to delete information in other information representation forms except text in the information to be processed. Sentence segmentation refers to segmenting text information according to a defined delimiter. The delimiter defined in the text may be a period. Sentence segmentation refers to segmenting words in a sentence.
[0040] It should be noted that the information to be processed may also be pre-stored information retrieved from a relevant database, or may be information transmitted from an external device, or may be information obtained by other means, etc. This embodiment does not specifically limit this.
[0041] As an optional implementation of this embodiment, the information to be processed in the current vertical field can be first obtained, and then the information to be processed can be preprocessed according to a preset information preprocessing method. Specifically, if the information to be processed includes repeated information, the information to be processed can be deduplicated and the repeated information can be deleted to avoid unnecessary processing; if the information to be processed includes information in other information forms other than text, the information to be processed can be denoised and the information in other information forms can be deleted, for example, interfering information such as images and tables in the information to be processed can be deleted; after deduplication and denoising, the information to be processed only includes text without repeated information. At this time, the information to be processed can be sentence-processed, and the text in the information to be processed can be segmented according to the defined separator, that is, the text in the information to be processed can be segmented according to the period to obtain a text including at least one sentence. Finally, the information to be processed is word-segmented, the words in the sentence are segmented, and the text after word segmentation is used as the text to be processed. At this time, the text to be processed includes all non-repeated text sentences in the information to be processed and all words in each sentence.
[0042] S120 , pre-encode the text to be processed in the current vertical field to obtain a pre-encoding vector corresponding to the text to be processed.
[0043] Among them, precoding can be understood as pre-coding the text to encode the text into a vector. The precoded vector can be a vector representation of the text, which is obtained after precoding the text. It can be understood that the vector representation can be a vector of a preset dimension, which can represent the text feature information corresponding to the text.
[0044] In this embodiment, the text to be processed in the current vertical field can be pre-coded according to a preset pre-coding method. Then, a pre-coding vector corresponding to the text to be processed can be obtained. The pre-coding method can be any method that can implement the pre-coding process. Optionally, the pre-coding method can be to determine the pre-coding vector based on a pre-trained vector embedding model.
[0045] Optionally, pre-encoding the text to be processed to obtain a pre-encoded vector corresponding to the text to be processed includes: pre-encoding the text to be processed according to a pre-trained vector embedding model to obtain a pre-encoded vector corresponding to the text to be processed.
[0046] Among them, the pre-trained vector embedding model can be a neural network model that takes text as an input object to determine the vector representation corresponding to the text. It should be noted that the pre-trained vector embedding model can be obtained by training a neural network model based on sample text in any vertical field and the vector representation corresponding to the sample text. In other words, the pre-trained vector embedding model is a universal vector embedding model that can process the text to be processed in all vertical fields. The text to be processed in any vertical field can be processed based on the pre-trained vector embedding model, and the vector representation corresponding to the corresponding text to be processed can be obtained. The pre-trained vector embedding model can be an embedding model of any model structure that can implement the vector embedding process.
[0047] As an optional implementation of this embodiment, when the text to be processed in the current vertical field is obtained, the text to be processed can be input into the pre-trained vector embedding model. Furthermore, the text to be processed can be pre-encoded based on the pre-trained vector embedding model, and a vector representation corresponding to the text to be processed can be output, and the vector representation can be used as the pre-encoded vector corresponding to the text to be processed.
[0048] S130, calling a text classification model corresponding to the current vertical field, and processing the pre-encoded vector according to the vector encoding sub-model in the text classification model to obtain a target vector corresponding to the text to be processed.
[0049] Wherein, the text classification model can be a neural network model that takes the text vector representation as an input object to identify the category to which the text belongs based on the text vector representation. The text classification model can be a neural network model of any model structure. Exemplarily, the text classification model can be a deep convolutional neural network (DCNN). It should be noted that the text classification model corresponds to the vertical field, that is, each vertical field corresponds to a different text classification model. For each vertical field, the text classification model corresponding to the current vertical field can be used to perform text classification on the text to be processed in the current vertical field. The text classification model is obtained by training the neural network model based on the sample precoding vector corresponding to the sample text of the current vertical field and the real text category corresponding to the sample text.
[0050] In this embodiment, the text classification model may include at least one sub-model. Optionally, the text classification model may include a vector encoding sub-model and a text classification sub-model. Among them, the vector encoding sub-model can be used to re-encode the input text vector representation to obtain a target vector corresponding to the text to be processed. The target vector can be a vector representation obtained after re-encoding the pre-encoding vector, and the vector representation can better characterize the vertical field text features corresponding to the text to be processed. In other words, compared with the pre-encoding vector, the target vector can better highlight the domain knowledge characteristics and text characteristics of the corresponding current vertical field. The text classification sub-model can be used to perform text classification on the text to be processed based on the target vector of the text to be processed.
[0051] In practical applications, the method of determining the vector representation of a text is usually to process the text to be processed based on a vector embedding model that is universal in any vertical field to obtain a vector representation of the text to be processed. However, there are certain differences in language usage and semantics in different vertical fields, and these differences will be reflected in professional terminology, concept expression, and context. General vector embedding models are often trained based on a wide range of corpora. When determining the vector representation of a text based on the above method, there may be a situation where the general vector embedding model cannot accurately capture the semantic relationships and semantic features in a specific field, and thus, the final vector representation cannot accurately represent the text features of the text to be processed.
[0052] In view of the above situation, in this embodiment, a text classification model corresponding to the current vertical field can be retrieved. Further, the pre-encoded vector of the text to be processed can be processed based on the vector encoding sub-model in the text classification model to obtain a target vector corresponding to the text to be processed.
[0053] In this embodiment, the text classification model can be a model that has been pre-trained and stored in the target storage space. In order to facilitate accurate retrieval of the text classification model corresponding to the current vertical field, for multiple vertical fields, the field identifier corresponding to each vertical field can be determined respectively. Furthermore, when the text classification model corresponding to each vertical field is obtained, the text classification model and the field identifier can be associated and stored in the target storage space. Furthermore, when retrieving the text classification model corresponding to the current vertical field, it can be retrieved according to the field identifier corresponding to the current vertical field.
[0054] Optionally, calling the text classification model corresponding to the current vertical field includes: obtaining a field identifier corresponding to the current vertical field; determining and calling the text classification model corresponding to the current vertical field according to the field identifier and pre-established model corresponding information.
[0055] The domain identifier may be information for identifying a vertical domain. The domain identifier may be any type of information. Optionally, the domain identifier may be the name of the vertical domain, an identification diagram corresponding to the vertical domain, or a number corresponding to the vertical domain. The model corresponding information may be used to indicate the association between the vertical domain and the text classification model.
[0056] As an optional implementation of the present embodiment, multiple vertical fields can be determined, the field identifier corresponding to each vertical field can be determined respectively, and the text classification model corresponding to each vertical field can be determined respectively. Further, an association relationship between the field identifier and the text classification model can be established, and the established association relationship can be used as the model corresponding information. Further, in the case of determining the current vertical field, the field identifier corresponding to the current vertical field can be obtained. Furthermore, the text classification model corresponding to the field identifier can be determined according to the information corresponding to the model, and the text classification model can be retrieved as the text classification model corresponding to the current vertical field. Further, the vector encoding sub-model in the text classification model can be extracted. Furthermore, the pre-encoding vector of the text to be processed can be input into the vector encoding sub-model to process the pre-encoding vector based on the vector encoding sub-model, and the vector input to the model is used as the target vector corresponding to the text to be processed.
[0057] In this embodiment, when the target vector corresponding to the text to be processed is obtained, the target vector is a vector that can accurately characterize the vertical field-specific semantic features and text features of the text to be processed. Furthermore, in order to accurately determine the degree of similarity between the text to be processed and other texts corresponding to the current vertical field, after obtaining the target vector corresponding to the text to be processed, it also includes: determining the vector distance between the target vector corresponding to the text to be processed and the target vector corresponding to other texts in the current vertical field; determining the similarity between the text to be processed and other texts based on the vector distance.
[0058] Among them, other texts can be any text other than the text to be processed in the current vertical field. Vector distance can be understood as the distance between vector representations. It can be understood that vector distance refers to a quantitative measure of the relative position relationship between two vectors in a multidimensional space. Similarity can be a quantitative representation of the degree of similarity between any two vectors.
[0059] It should be noted that there are multiple ways to determine the vector distance. Optionally, the way to determine the vector distance may include Euclidean distance, Manhattan distance, cosine similarity, Pearson correlation coefficient, etc.
[0060] In this embodiment, after obtaining the target vector corresponding to the text to be processed, the target vector corresponding to the text to be processed and the target vectors corresponding to other texts in the current vertical field can be processed according to a preset vector distance determination method, and the vector distance between the text to be processed and the other texts can be obtained. Further, when the vector distance is closer, it can be determined that the similarity between the text to be processed and the other text is higher; when the vector distance is farther, it can be determined that the similarity between the text to be processed and the other text is lower.
[0061] The technical solution of the embodiment of the present invention obtains the text to be processed in the current vertical field for multiple vertical fields, further pre-encodes the text to be processed in the current vertical field to obtain a pre-encoding vector corresponding to the text to be processed, further calls a text classification model corresponding to the vertical field, and processes the pre-encoding vector according to the vector encoding sub-model in the text classification model to obtain a target vector corresponding to the text to be processed, thereby solving the problem of inaccurate text vectors in the related art when the text to be processed is text information in different professional fields with large differences, and achieves the effect of targeted text vector determination for the text to be processed in different vertical fields, thereby improving the correlation between the text vector and its corresponding vertical field, and improving the accuracy of the text vector.
[0062] Embodiment 2
[0063] Figure 2 It is a flowchart of a text vector method provided in the second embodiment of the present invention. On the basis of the above-mentioned embodiment, the vector encoding submodel includes at least one convolution layer, a pooling layer and a flattening layer. Furthermore, the pre-encoded vector is processed according to the vector encoding submodel in the text classification model to obtain a target vector corresponding to the text to be processed, including: the pre-encoded vector is processed in sequence according to at least one convolution layer, a pooling layer and a flattening layer in the vector encoding submodel in the text classification model to obtain a target vector corresponding to the text to be processed. The specific implementation method can refer to the technical solution of this embodiment. Among them, the technical terms that are the same or similar to those in the above-mentioned embodiments are not repeated here.
[0064] like Figure 2 As shown, the method includes:
[0065] S210: For multiple vertical fields, obtain the text to be processed in the current vertical field.
[0066] S220 , pre-encode the text to be processed in the current vertical field to obtain a pre-encoding vector corresponding to the text to be processed.
[0067] S230, calling a text classification model corresponding to the current vertical field, and extracting sub-models from the text classification model to obtain a vector encoding sub-model.
[0068] In this embodiment, when a text classification model corresponding to the current vertical field is obtained, sub-models may be extracted from the text classification model, and the extracted sub-models may be used as vector encoding sub-models.
[0069] S240, processing the pre-encoded vector in sequence according to at least one convolutional layer, pooling layer, and flattening layer in the vector encoding sub-model to obtain a target vector corresponding to the text to be processed.
[0070] Among them, the convolution layer refers to all layers except the input layer and the output layer. The convolution layer extracts feature information by performing complex mathematical transformations and combinations on the input data, and the extracted feature information helps the model to better understand and process data. In this embodiment, the number of convolutional layers can be one or more. Exemplarily, the number of convolutional layers in the vector encoding submodel can be 4 layers. The pooling layer is mainly used to reduce the spatial size (i.e., height and width) of the input data, reduce the computational complexity of the model, reduce the risk of overfitting, and extract important features of the input data to a certain extent. The flattening layer can be understood as a neural network model that flattens the features. The flattening layer is used to convert multi-dimensional input data into a one-dimensional array, and is usually used between the convolutional neural network and the fully connected layer. It does not change the total amount of data itself, but only changes the shape of the data.
[0071] In this embodiment, when a vector encoding sub-model is obtained, the pre-encoded vector corresponding to the text to be processed can be input into the vector encoding sub-model. Then, the pre-encoded vector can be processed in sequence based on at least one convolutional layer, pooling layer and flattening layer in the vector encoding sub-model, and the target vector corresponding to the text to be processed can be output.
[0072] Optionally, the precoded vector is processed in sequence according to at least one convolutional layer, pooling layer and flattening layer in the vector coding sub-model to obtain a target vector corresponding to the text to be processed, including: performing feature mapping on the precoded vector in sequence based on at least one convolutional layer in the vector coding sub-model to obtain a feature mapping vector corresponding to the precoded vector; pooling the feature mapping vector based on the pooling layer in the vector coding sub-model to obtain a pooled feature mapping vector; and formatting the pooled feature mapping vector based on the flattening layer in the vector coding sub-model to obtain a target vector corresponding to the text to be processed.
[0073] The feature map vector can be understood as the output data obtained by performing a convolution operation on the input data through the convolution layer. These output data may include different features in the input data, such as edge, texture, shape and other information.
[0074] As an optional implementation of the first embodiment of the present invention, when the pre-coding vector is input into the vector coding sub-model, the pre-coding vector can be sequentially convolved based on at least one convolutional layer in the vector coding sub-model to obtain a feature mapping vector corresponding to the pre-coding vector. Afterwards, the feature mapping vector can be input into the pooling layer to perform a maximum pooling operation on the feature mapping vector based on the pooling layer. Then, a pooled feature mapping vector can be obtained. Furthermore, the pooled feature mapping vector can be input into the flattening layer to perform format conversion on the pooled feature mapping vector based on the flattening layer. Then, a target vector corresponding to the text to be processed can be obtained.
[0075] The technical solution of the embodiment of the present invention obtains the text to be processed in the current vertical field for multiple vertical fields, further pre-encodes the text to be processed in the current vertical field to obtain a pre-encoding vector corresponding to the text to be processed, further calls a text classification model corresponding to the vertical field, and processes the pre-encoding vector according to the vector encoding sub-model in the text classification model to obtain a target vector corresponding to the text to be processed, thereby solving the problem of inaccurate text vectors in the related art when the text to be processed is text information in different professional fields with large differences, and achieves the effect of targeted text vector determination for the text to be processed in different vertical fields, thereby improving the correlation between the text vector and its corresponding vertical field, and improving the accuracy of the text vector.
[0076] Embodiment 3
[0077] Figure 3 This is a flowchart of a text vector method provided by the third embodiment of the present invention. Based on the above embodiment, before applying the text classification model, the text classification model to be trained can be trained first. Then, the text vector can be determined based on the trained text classification model. The specific implementation method can refer to the technical solution of this embodiment. Among them, the technical terms that are the same or similar to the above embodiment are not repeated here.
[0078] like Figure 3 As shown, the method includes:
[0079] S310: Train and obtain a text classification model corresponding to the current vertical field.
[0080] It should be noted that before applying the text classification model provided by the embodiment of the present invention, it is first necessary to train the pre-built model to be trained. Before training the model, multiple training samples can be constructed, and then the model can be trained based on the training samples to obtain a trained text classification model. In order to improve the accuracy of the text classification model, as many and rich training samples as possible can be constructed.
[0081] Optionally, training to obtain a text classification model corresponding to the current vertical field includes: constructing multiple training samples corresponding to the current vertical field, wherein the training samples include sample precoding vectors corresponding to sample texts in the current vertical field and real text categories corresponding to the sample texts. For multiple training samples, the sample precoding vectors corresponding to the sample texts in the current training samples are input into the text classification model to be trained to obtain text classification results corresponding to the current training samples; based on the real text categories and text classification results of the current training samples, a loss value is determined, and model parameters in the text classification model to be trained are corrected based on the loss value until the loss function in the text classification model to be trained converges to obtain a text classification model corresponding to the current vertical field.
[0082] In this embodiment, in order to make the model performance of the text classification model finally trained higher, as many and rich training samples as possible can be constructed. In the case of training a text classification model corresponding to the current vertical field, multiple training samples can be constructed based on sample text data corresponding to the current vertical field.
[0083] Optionally, constructing multiple training samples corresponding to the current vertical field, including: obtaining multiple sample texts of the current vertical field, respectively determining a sample precoding vector and a real text category of each sample text, and grouping the sample precoding vectors of the multiple sample texts according to the real text category to obtain at least one sample text vector group; for at least one sample text vector group, when the number of texts corresponding to the current sample text vector group is less than a preset text number threshold, performing data enhancement on the current sample text vector group to expand the current sample text vector group; constructing multiple training samples corresponding to the current vertical field according to the at least one sample text vector group and the real text category corresponding to each sample text vector group.
[0084] Among them, the sample text can be any text associated with the current vertical field. Optionally, the sample text can be a pre-stored text retrieved from a relevant database; or, it can also be a text information transmission received from an external device; or, it can also be in response to a text input operation, and based on the text input operation, the input text is obtained, and the sample text is determined based on the input text, etc. The sample precoding vector can be a precoding vector obtained after precoding the sample text. The real text category can be the actual category to which the sample text belongs. The preset text quantity threshold can be a predetermined standard value of the text quantity used to measure whether the text quantity is sufficient. The preset text quantity threshold can be an arbitrary value, optionally, 500, 1000 or 1500, etc.
[0085] As an optional implementation of this embodiment, multiple sample texts in the current vertical field can be obtained, and then the real text category corresponding to each sample text can be determined respectively, and each sample text can be pre-coded according to a preset pre-coding method to obtain a sample pre-coding vector corresponding to each sample text. Afterwards, the sample pre-coding vectors of multiple sample texts can be grouped according to the text category so that the real text category corresponding to the sample texts included in the same group is the same real text category, and at least one sample text vector group is obtained. The real text category corresponding to the multiple sample texts included in the same sample text vector group is the same real text category. Further, for at least one sample text vector group, the number of texts corresponding to the current sample text vector group can be compared with a preset text quantity threshold. Furthermore, when it is determined that the number of texts corresponding to the current sample text vector group is less than the preset text quantity threshold, the current sample text vector group can be data enhanced to expand the current sample text vector group. When it is determined that the number of texts corresponding to the current sample text vector group is not less than the preset text quantity threshold, no processing is performed on the current sample text vector group. Furthermore, a plurality of training samples corresponding to the current vertical field may be constructed based on at least one sample text vector group and the real text category corresponding to each sample text vector group.
[0086] In this embodiment, data enhancement is performed on the current sample text vector group, and vector generation can be performed based on multiple sample pre-coding vectors included in the current sample text vector group to obtain a generated coding vector. Furthermore, the current sample vector group can be expanded based on the generated coding vector.
[0087] Optionally, data enhancement is performed on the current sample text vector group to expand the current sample text vector group, including: for multiple sample texts included in the current sample text vector group, determining the vector distance between the sample precoding vector of the current sample text and the sample precoding vectors of other sample texts; determining the similar distribution feature value corresponding to the current sample text vector group based on the multiple vector distances corresponding to the current sample text vector group; extracting at least one sample coding vector from the current text vector group, and performing vector generation based on the similar distribution feature value and the at least one extracted sample coding vector to obtain at least one generated coding vector corresponding to the current sample text; expanding the current sample text vector group based on the at least one generated coding vector, and using the generated coding vector as the sample precoding vector corresponding to the corresponding sample text.
[0088] The similarity distribution feature value may be used to characterize the feature value of the similarity distribution between multiple sample precoding vectors included in the current sample text vector group. Optionally, the similarity distribution feature value includes a mathematical expectation feature value and / or a variance feature value.
[0089] As an optional implementation of the present embodiment, for multiple sample texts included in the current sample text vector group, the sample precoding vector of the current sample text and the sample precoding vectors of other sample texts can be processed according to a preset text vector determination method to obtain the vector distance between the current sample text and other sample texts. Furthermore, the vector distance between any two sample precoding vectors in the current sample text vector group can be obtained, and at least one vector distance corresponding to the current sample text vector group can be obtained. Furthermore, the mathematical expectation eigenvalue and variance eigenvalue corresponding to the current sample text vector group can be determined based on the at least one vector distance obtained.
[0090] Exemplarily, the mathematical expectation eigenvalue and the variance eigenvalue corresponding to the current sample text vector group can be determined based on the following formulas:
[0091]
[0092] Among them, μ D represents the mathematical expectation eigenvalue corresponding to the current sample text vector group; n represents the number of sample precoding vectors included in the current sample text vector group; i, j represents the order number of the sample precoding vectors in the current sample text vector group; w i represents the i-th sample precoding vector in the current sample text vector group; w j Represents the jth sample precoding vector in the current sample text vector group.
[0093]
[0094] in, represents the variance eigenvalue corresponding to the current sample text vector group; (||w i -w j ||2 represents the vector distance between the i-th sample precoding vector and the j-th sample precoding vector.
[0095] Furthermore, at least one sample precoding vector can be randomly extracted from the current sample text vector group. Furthermore, vector generation can be performed based on the similar distribution eigenvalue and the extracted at least one sample precoding vector to obtain at least one generated coding vector. The advantage of this setting is that this enhancement method helps the model to better understand the distribution of word vectors in space, so that synonyms can be identified more accurately. In addition, the advantage of using mathematical expectation eigenvalues and variance eigenvalues for data enhancement is that the calculation methods of these two features are relatively simple, and the scale and parameters of data enhancement can be adjusted according to actual needs, which has certain flexibility and scalability.
[0096] Exemplarily, vector generation may be performed based on the following formula:
[0097]
[0098] Among them, w i ′ (k) represents the generated encoding vector; w i (k) represents the kth bit of the i-th sample precoding vector; K represents the total dimension of the sample precoding vector, where k = 1, 2, …, K.
[0099] Furthermore, the at least one generated coding vector that has been obtained may be updated to the current sample text vector group, and the generated coding vector may be used as a sample pre-coding vector.
[0100] In this embodiment, when a plurality of training samples corresponding to the current vertical field are obtained, a text classification model corresponding to the current vertical field can be obtained based on the training of the plurality of training samples. Specifically, for a plurality of training samples, the sample precoding vector corresponding to the sample text in the current training sample can be input into the text classification model to be trained to obtain a text classification result corresponding to the current training sample. Further, the text classification result can be compared with the real text category in the current training sample to determine the loss value. Then, the model parameters in the text classification model to be trained can be corrected according to the loss value. Afterwards, the training error of the loss function in the text classification model to be trained, that is, the loss parameter, can be used as a condition for detecting whether the current loss function has reached convergence, for example, the training error is less than the preset error or the error change trend tends to be stable, or whether the current model iteration number is equal to the preset number of times, etc. If the convergence condition is detected, for example, the training error of the loss function is less than the preset error or the error change tends to be stable, it indicates that the text classification model training is completed, and at this time, the iterative training can be stopped. If it is detected that the convergence condition is not reached at present, other training samples can be further obtained to train the text classification model to be trained until the training error of the loss function is within the preset range. When the training error of the loss function reaches convergence, the trained text classification model can be obtained.
[0101] S320: For multiple vertical fields, obtain the text to be processed in the current vertical field.
[0102] S330 , pre-encode the text to be processed in the current vertical field to obtain a pre-encoding vector corresponding to the text to be processed.
[0103] S340, calling a text classification model corresponding to the current vertical field, and processing the pre-encoded vector according to the vector encoding sub-model in the text classification model to obtain a target vector corresponding to the text to be processed.
[0104] The technical solution of the embodiment of the present invention obtains the text to be processed in the current vertical field for multiple vertical fields, further pre-encodes the text to be processed in the current vertical field to obtain a pre-encoding vector corresponding to the text to be processed, further calls a text classification model corresponding to the vertical field, and processes the pre-encoding vector according to the vector encoding sub-model in the text classification model to obtain a target vector corresponding to the text to be processed, thereby solving the problem of inaccurate text vectors in the related art when the text to be processed is text information in different professional fields with large differences, and achieves the effect of targeted text vector determination for the text to be processed in different vertical fields, thereby improving the correlation between the text vector and its corresponding vertical field, and improving the accuracy of the text vector.
[0105] Embodiment 4
[0106] Figure 4 Schematic diagram of a text vector determination device provided by Embodiment 4 of the present invention. Figure 4 As shown, the device includes: a text acquisition module 410, a text precoding module 420 and a vector determination module 430.
[0107] Among them, the text acquisition module 410 is used to obtain the text to be processed in the current vertical field for multiple vertical fields; the text precoding module 420 is used to precode the text to be processed in the current vertical field to obtain a precoding vector corresponding to the text to be processed; the vector determination module 430 is used to call the text classification model corresponding to the current vertical field, and process the precoding vector according to the vector encoding sub-model in the text classification model to obtain a target vector corresponding to the text to be processed; wherein the text classification model is obtained by training a neural network model based on a sample precoding vector corresponding to a sample text in the current vertical field and a real text category corresponding to the sample text.
[0108] The technical solution of the embodiment of the present invention obtains the text to be processed in the current vertical field for multiple vertical fields, further pre-encodes the text to be processed in the current vertical field to obtain a pre-encoding vector corresponding to the text to be processed, further calls a text classification model corresponding to the vertical field, and processes the pre-encoding vector according to the vector encoding sub-model in the text classification model to obtain a target vector corresponding to the text to be processed, thereby solving the problem of inaccurate text vectors in the related art when the text to be processed is text information in different professional fields with large differences, and achieves the effect of targeted text vector determination for the text to be processed in different vertical fields, thereby improving the correlation between the text vector and its corresponding vertical field, and improving the accuracy of the text vector.
[0109] Optionally, the text precoding module 420 is specifically configured to precode the text to be processed according to a pre-trained vector embedding model to obtain a precoding vector corresponding to the text to be processed.
[0110] Optionally, the vector determination module 430 includes: a model extraction submodule and a vector determination submodule.
[0111] A model extraction submodule, used for extracting sub-models from the text classification model to obtain a vector encoding sub-model;
[0112] The vector determination submodule is used to process the pre-encoded vector in sequence according to at least one convolution layer, pooling layer and flattening layer in the vector encoding submodel to obtain a target vector corresponding to the text to be processed.
[0113] Optionally, the vector determination submodule includes: a feature mapping unit, a feature pooling unit and a vector determination unit.
[0114] A feature mapping unit, configured to perform feature mapping on the pre-encoding vector in sequence based on at least one convolutional layer in the vector encoding sub-model, to obtain a feature mapping vector corresponding to the pre-encoding vector;
[0115] A feature pooling unit, used for performing pooling processing on the feature mapping vector based on the pooling layer in the vector encoding sub-model to obtain the pooled feature mapping vector;
[0116] A vector determination unit is used to convert the format of the pooled feature mapping vector based on the flattening layer in the vector encoding sub-model to obtain a target vector corresponding to the text to be processed.
[0117] Optionally, the device also includes: a model training module.
[0118] A model training module, used for training a text classification model corresponding to the current vertical field;
[0119] The model training module includes: a training sample construction submodule, a text classification result determination submodule and a model parameter correction submodule.
[0120] A training sample construction submodule, used to construct a plurality of training samples corresponding to the current vertical field, wherein the training samples include sample precoding vectors corresponding to sample texts of the current vertical field and real text categories corresponding to the sample texts;
[0121] A text classification result determination submodule is used to input the sample precoding vector in the current training sample into the text classification model to be trained for the multiple training samples, so as to obtain the text classification result corresponding to the current training sample;
[0122] The model parameter correction submodule is used to determine the loss value according to the text classification result and the real text category in the current training sample, and correct the model parameters in the text classification model to be trained based on the loss value until the loss function in the text classification model to be trained converges, thereby obtaining a text classification model corresponding to the current vertical field.
[0123] Optionally, the training sample construction submodule includes: a sample text acquisition unit, a vector enhancement unit and a training sample construction unit.
[0124] A sample text acquisition unit, used to acquire multiple sample texts in the current vertical field, respectively determine a sample precoding vector and a real text category of each of the sample texts, and group the sample precoding vectors of the multiple sample texts according to the text category to obtain at least one sample text vector group;
[0125] A vector enhancement unit, configured to perform vector enhancement on the at least one sample text vector group, so as to expand the current sample text vector group, when the number of texts corresponding to the current sample text vector group is less than a preset text number threshold;
[0126] The training sample construction unit is used to construct a plurality of training samples corresponding to the current vertical field according to the at least one sample text vector group and the real text category corresponding to each of the sample text vector groups.
[0127] Optionally, the vector enhancement unit includes: a vector distance determination subunit, a distribution characteristic value determination subunit, a vector generation subunit and a vector group expansion subunit.
[0128] A vector distance determination subunit, used to determine, for a plurality of sample texts included in the current sample text vector group, a vector distance between a sample precoding vector of the current sample text and sample precoding vectors of other sample texts;
[0129] A distribution feature value determination subunit, used to determine a similar distribution feature value corresponding to the current sample text vector group according to at least one vector distance corresponding to the current sample text vector group; wherein the similar distribution feature value includes a mathematical expectation feature value and / or a variance feature value;
[0130] A vector generation subunit, used to extract at least one sample coding vector from the current sample text vector group, and perform vector generation according to the similar distribution feature value and the extracted at least one sample coding vector to obtain at least one generated coding vector corresponding to the current sample text;
[0131] The vector group expansion subunit is used to expand the current sample text vector group according to the at least one generated coding vector, and use the generated coding vector as a sample pre-coding vector corresponding to the corresponding sample text.
[0132] The text vector determination device provided in the embodiment of the present invention can execute the text vector determination method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0133] Embodiment 5
[0134] Figure 5A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0135] like Figure 5 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0136] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0137] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as a text vector determination method.
[0138] In some embodiments, the text vector determination method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the text vector determination method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the text vector determination method in any other appropriate manner (e.g., by means of firmware).
[0139] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0140] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0141] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or 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 foregoing.
[0142] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0143] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0144] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0145] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0146] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for determining a text vector, It is characterized in that include: For multiple vertical fields, obtain the text to be processed in the current vertical field; Precoding the text to be processed in the current vertical field to obtain a precoding vector corresponding to the text to be processed; Retrieving a text classification model corresponding to the current vertical field, and processing the pre-encoded vector according to a vector encoding sub-model in the text classification model to obtain a target vector corresponding to the text to be processed; The text classification model is obtained by training a neural network model based on a sample precoding vector corresponding to a sample text in the current vertical field and a real text category corresponding to the sample text.
2. The text vector determination method according to claim 1, It is characterized in that The precoding of the to-be-processed text to obtain a precoding vector corresponding to the to-be-processed text includes: The text to be processed is pre-encoded according to a pre-trained vector embedding model to obtain a pre-encoded vector corresponding to the text to be processed.
3. The text vector determination method according to claim 1, It is characterized in that The processing of the pre-encoded vector according to the vector encoding sub-model in the text classification model to obtain a target vector corresponding to the text to be processed includes: Extracting sub-models from the text classification model to obtain a vector encoding sub-model; The pre-encoded vector is processed in sequence according to at least one convolutional layer, a pooling layer, and a flattening layer in the vector encoding sub-model to obtain a target vector corresponding to the text to be processed.
4. The text vector determination method according to claim 3, It is characterized in that The step of sequentially processing the pre-encoded vector according to at least one convolutional layer, a pooling layer, and a flattening layer in the vector encoding sub-model to obtain a target vector corresponding to the text to be processed includes: Based on at least one convolutional layer in the vector coding sub-model, sequentially perform feature mapping on the pre-coding vector to obtain a feature mapping vector corresponding to the pre-coding vector; Performing pooling processing on the feature map vector based on the pooling layer in the vector encoding sub-model to obtain the pooled feature map vector; The format of the pooled feature mapping vector is converted based on the flattening layer in the vector encoding sub-model to obtain a target vector corresponding to the text to be processed.
5. The text vector determination method according to claim 1, It is characterized in that Also includes: Train and obtain a text classification model corresponding to the current vertical field; The training obtains a text classification model corresponding to the current vertical field, including: Constructing a plurality of training samples corresponding to the current vertical field, wherein the training samples include sample precoding vectors corresponding to sample texts of the current vertical field and real text categories corresponding to the sample texts; For the multiple training samples, input the sample precoding vector in the current training sample into the text classification model to be trained to obtain the text classification result corresponding to the current training sample; According to the text classification result and the real text category in the current training sample, a loss value is determined, and the model parameters in the text classification model to be trained are corrected based on the loss value until the loss function in the text classification model to be trained converges, thereby obtaining a text classification model corresponding to the current vertical field.
6. The text vector determination method according to claim 5, It is characterized in that The constructing of multiple training samples corresponding to the current vertical field includes: Acquire multiple sample texts in the current vertical field, determine the sample precoding vector and the real text category of each sample text respectively, and group the sample precoding vectors of the multiple sample texts according to the text category to obtain at least one sample text vector group; For the at least one sample text vector group, when the number of texts corresponding to the current sample text vector group is less than a preset text number threshold, vector enhancement is performed on the current sample text vector group to expand the current sample vector group; A plurality of training samples corresponding to the current vertical field are constructed according to the at least one sample text vector group and the real text category corresponding to each of the sample text vector groups.
7. The text vector determination method according to claim 6, It is characterized in that The performing data enhancement on the current sample text vector group to expand the current sample text vector group includes: For a plurality of sample texts included in the current sample text vector group, determining a vector distance between a sample precoding vector of the current sample text and sample precoding vectors of other sample texts; Determine a similar distribution feature value corresponding to the current sample text vector group according to at least one vector distance corresponding to the current sample text vector group; wherein the similar distribution feature value includes a mathematical expectation feature value and / or a variance feature value; Extracting at least one sample coding vector from the current sample text vector group, and performing vector generation according to the similar distribution feature value and the extracted at least one sample coding vector to obtain at least one generated coding vector corresponding to the current sample text; The current sample text vector group is expanded according to the at least one generated coding vector, and the generated coding vector is used as a sample pre-coding vector corresponding to the corresponding sample text.
8. A text vector determination device, It is characterized in that include: A text acquisition module is used to acquire the text to be processed in the current vertical field for multiple vertical fields; A text precoding module, used for precoding the text to be processed in the current vertical field to obtain a precoding vector corresponding to the text to be processed; A vector determination module, used to call a text classification model corresponding to the vertical field, and process the pre-encoded vector according to the vector encoding sub-model in the text classification model to obtain a target vector corresponding to the text to be processed; The text classification model is obtained by training a neural network model based on a sample precoding vector corresponding to a sample text in the current vertical field and a real text category corresponding to the sample text.
9. An electronic device, It is characterized in that The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can perform the text vector determination method according to any one of claims 1 to 7.
10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the text vector determination method according to any one of claims 1 to 7 when executed.
Citation Information
Patent Citations
Word vector model based on point mutual information and text classification method based on CNN
CN109189925A
Domain model training method and device, equipment and storage medium
CN113741885A
Training data generation method and device, classifier training method and device, equipment and medium
CN114925758A
Method of training text detection model, method of detecting text, and device
US20240265718A1
