A feature word classification method and device, electronic equipment and storage medium
By constructing a semantic model of character combinations and performing weighted accumulation, the problem of the influence of character combinations within feature words not being considered is solved, thereby improving the accuracy and generalization ability of feature word classification.
Patent Information
- Application Number
- CN202211453690.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-21
- Publication Date
- 2026-01-06
- Estimated Expiration
- 2042-11-21
AI Technical Summary
Traditional feature word classification methods ignore the semantic information of character combinations within feature words, leading to inaccurate category judgments, especially when character inclusion relationships are complex.
By extracting character combinations of feature words, a character combination semantic model is constructed, and the semantic vector and weight of the character combinations are obtained. These are then weighted and accumulated to form the overall semantic vector of the feature words, which is used for classification and clustering.
It improves the accuracy and generalization ability of feature word classification, and can better handle the impact of character combinations on category judgment.
Smart Images

Figure CN115905950B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of Internet technology, and more specifically, to a feature word classification method, apparatus, electronic device, and storage medium. Background Technology
[0002] When classifying feature words in industry marketing data, traditional strategies based on the semantic vector similarity or statistical modeling of each feature word as a whole often overlook the meaning of the internal character combinations that constitute the current feature word and their significant impact on the feature word's category determination. Moreover, certain important character combinations that constitute each feature word often influence the final category classification of the entire feature word.
[0003] For example, in the beauty industry, "moisturizing" belongs to the "efficacy" category, while "moisturizing cream" belongs to the "product category." Similarly, some feature words with character inclusion relationships may belong to completely different categories. For instance, "Herborist" belongs to the "brand" category, while "Herborist New Seven White Whitening and Nourishing Mask" belongs to the "single product" category. In these cases, traditional classification methods based on the semantic vector or statistical features of the feature words as a whole often overlook the semantic information of certain important character combinations that lead to category differences.
[0004] Therefore, how to provide a more effective feature word classification method is an urgent problem to be solved. Summary of the Invention
[0005] To address the aforementioned problems, this invention provides a feature word classification method, apparatus, electronic device, and storage medium.
[0006] A first aspect of this invention provides a feature word classification method, the method comprising:
[0007] Retrieve newly added industry-specific keywords;
[0008] Extract character combinations of newly added industry-specific keywords and segment them;
[0009] Based on the pre-saved character combination semantic model, obtain the semantic vector of the character combination of the industry feature words and the corresponding weights;
[0010] The semantic vector of the current industry feature words is obtained by weighting and accumulating the semantic vector of the character combination.
[0011] The overall category of the industry feature words is determined based on the overall semantic vector.
[0012] Optionally, the training method for the character combination semantic model includes:
[0013] Acquire pre-accumulated feature word text data;
[0014] A distributed n-gram mining strategy is adopted to extract the character combination of each feature word in the feature word text data, which serves as the atomic semantics for the overall category judgment of the feature word;
[0015] Semantic vectors are constructed from the character combinations of the extracted feature words to obtain a character combination semantic model.
[0016] Optionally, the step of constructing semantic vectors from the character combinations of the extracted feature words specifically includes:
[0017] The character combinations of feature words are segmented according to the extracted atomic semantics to construct sample data for semantic training;
[0018] Use the gensim toolkit to load sample data and train semantic vectors;
[0019] Save the semantic vector results of the trained character combinations.
[0020] Optionally, when performing the step of constructing sample data for semantic training, all possible segments of each feature word text data are added to the training sample set, and it is ensured that the positional order of each character combination is consistent with the order of appearance in the original text, and there is no overlap in the segmentation positions.
[0021] Optionally, the step of extracting character combinations of newly added industry feature words and segmenting them specifically includes:
[0022] Extract character combinations of the industry feature words according to the atomic semantics and segment them;
[0023] The "full segmentation" strategy is adopted to extract all character combinations that appear in the text data of the industry feature words.
[0024] Optionally, the method for obtaining the weights corresponding to the character combinations of the industry feature words specifically includes:
[0025] The logic for calculating the relative importance of two words (character combinations) is provided by the gensim toolkit to calculate the relative importance of any pair of character combinations.
[0026] Generate the importance of each character combination within the current feature word based on the relative importance;
[0027] The importance of each character combination within the current feature word is used as the weight of each character combination.
[0028] Optionally, the step of determining the overall category of the industry feature words based on the overall semantic vector specifically includes:
[0029] For clustering operations, the overall semantic vector calculated based on industry feature words is directly subjected to clustering processing;
[0030] For classification operations, in addition to the overall semantic vector calculated based on industry feature words, a fully connected layer for classification is superimposed, and the corresponding classification model is trained for classification.
[0031] A second aspect of the present invention provides a feature word classification device, the device comprising:
[0032] The feature word acquisition unit is used to acquire newly added industry feature words;
[0033] The character extraction unit is used to extract the character combinations of newly added industry feature words and perform segmentation.
[0034] The vector acquisition unit is used to acquire the semantic vector of the character combination of the industry feature words and the corresponding weights based on the pre-saved character combination semantic model.
[0035] The vector calculation unit is used to weight and accumulate the semantic vector of the character combination to obtain the overall semantic vector of the current industry feature words;
[0036] The feature word classification unit is used to determine the overall category of the industry feature words based on the overall semantic vector.
[0037] A third aspect of the present invention provides an electronic device, characterized in that it comprises:
[0038] One or more processors; memory; one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, the one or more applications being configured to perform the method as described in the first aspect.
[0039] A fourth aspect of the present invention provides a computer-readable storage medium, characterized in that the computer-readable storage medium stores program code that can be invoked by a processor to execute the method described in the first aspect.
[0040] In summary, this invention provides a feature word classification method, apparatus, electronic device, and storage medium. It can extract atomic semantic character combinations for constructing various feature words from massive amounts of historically accumulated text, and train semantic models for these character combinations. For new feature words, it first extracts these character combinations, obtains the latest trained semantic vector and calculates importance weights, and then performs a weighted summation of the semantic vectors to obtain the overall semantic vector of the current feature word. This processing method deconstructs and analyzes the internal features of extremely short texts like feature words, improving the semantic influence of important internal character combinations. Furthermore, by using semantic vectors, it enhances the overall generalization ability of the strategy, resulting in significant improvements in subsequent classification and clustering processes. Attached Figure Description
[0041] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0042] Figure 1 This is a flowchart of the feature word classification method according to an embodiment of the present invention;
[0043] Figure 2 This is a flowchart of the character combination semantic model training method according to an embodiment of the present invention;
[0044] Figure 3 This is a flowchart of a method for obtaining the weights corresponding to character combinations of industry feature words according to an embodiment of the present invention.
[0045] Figure 4 This is a functional block diagram of the feature word classification device according to an embodiment of the present invention;
[0046] Figure 5 This is a structural block diagram of an electronic device for performing a feature word classification method according to an embodiment of the present invention;
[0047] Figure 6 This is a structural block diagram of a computer-readable storage medium for storing or carrying program code implementing the feature word classification method according to an embodiment of the present invention.
[0048] icon:
[0049] Feature word acquisition unit 110; character extraction unit 120; vector acquisition unit 130; vector calculation unit 140; feature word classification unit 150; electronic device 300; processor 310; memory 320; computer-readable storage medium 400; program code 410. Detailed Implementation
[0050] When classifying feature words in industry marketing data, traditional strategies based on the semantic vector similarity or statistical modeling of each feature word as a whole often overlook the meaning of the internal character combinations that constitute the current feature word and their significant impact on the feature word's category determination. Moreover, certain important character combinations that constitute each feature word often influence the final category classification of the entire feature word.
[0051] For example, in the beauty industry, "moisturizing" belongs to the "efficacy" category, while "moisturizing cream" belongs to the "product category." Similarly, some feature words with character inclusion relationships may belong to completely different categories. For instance, "Herborist" belongs to the "brand" category, while "Herborist New Seven White Whitening and Nourishing Mask" belongs to the "single product" category. In these cases, traditional classification methods based on the semantic vector or statistical features of the feature words as a whole often overlook the semantic information of certain important character combinations that lead to category differences.
[0052] In addition, it is also necessary to take into account cases where the internal character combinations are different but belong to the same category. For example, "SAIC Audi" and "AUDI" both represent the same car brand; "firming", "anti-aging", "reducing wrinkles", "whitening", and "anti-wrinkle" are all used to represent the "anti-aging" efficacy category in the beauty industry, etc.
[0053] In addition, there are cases where the characters have a certain degree of similarity and their meanings are also related, and they need to be grouped into one category. For example, "fans" and "fan club" represent user group categories; "New Oriental" and "New Oriental Online" represent a certain educational institution; and "spokesperson," "brand spokesperson," and "brand ambassador" represent celebrity endorsement keywords, etc.
[0054] As the examples above demonstrate, classifying industry-specific feature words requires deconstructing and analyzing the character combinations within each feature word, taking into account the semantic meaning of these combinations. Integrating strategies for mining important character combinations and constructing semantic meanings can improve the accuracy and generalization ability of overall feature word category judgment.
[0055] Therefore, how to provide a more accurate feature word classification method is an urgent problem to be solved.
[0056] In view of this, the inventors of this invention have designed a feature word classification method, device, electronic device, and storage medium. First, atomic semantic character combinations used to construct each feature word are periodically extracted from a massive amount of historically accumulated text, and semantic models of these character combinations are trained. For new feature words, these character combinations are extracted first, and the latest trained semantic vector and importance weights are obtained. Then, the semantic vectors are weighted and accumulated to form the overall semantic vector of the current feature word. This process performs internal feature deconstruction analysis on the extremely short text containing feature words, improving the semantic influence of important internal character combinations. Furthermore, by using semantic vectors, the overall generalization ability of this strategy is improved, resulting in significant performance improvements in subsequent classification and clustering processes.
[0057] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.
[0058] Therefore, the following detailed description of the embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.
[0059] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.
[0060] In the description of this invention, it should be noted that the terms "top," "bottom," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings, or the orientation or positional relationship commonly used when the product of the invention is in use. They are only for the convenience of describing the invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the invention. In addition, the terms "first," "second," etc., are only used to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0061] In the description of this invention, it should also be noted that, unless otherwise explicitly specified and limited, the terms "set," "install," "connect," and "link" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in this invention based on the specific circumstances.
[0062] It should be noted that, unless otherwise specified, the embodiments and features described in the present invention can be combined with each other.
[0063] Example
[0064] like Figure 1 The image shows a feature word classification method provided in an embodiment of the present invention. The method includes:
[0065] Step S101: Obtain the newly added industry feature words.
[0066] Online processing involves collecting and acquiring newly added industry-specific keywords to be categorized.
[0067] Step S102: Extract the character combinations of the newly added industry feature words and segment them.
[0068] In the embodiments of the present invention, the method of extracting and segmenting the corresponding character combinations of industry feature words is the same as the method of extracting character combinations of historically accumulated text data when training the character combination semantic model. That is, the character combinations of the industry feature words are extracted and segmented according to atomic semantics. The specific method will be explained in the following steps and will not be repeated here.
[0069] As a preferred embodiment of this example, in order to fully analyze the semantic information of all character combinations within the newly added industry feature words and their impact on feature word classification, when extracting and segmenting the character combinations of the newly added industry feature words, a "full segmentation" strategy is adopted, in which all character combinations contained within the industry feature words that appear in the feature word text data are extracted.
[0070] Step S103: Based on the pre-saved character combination semantic model, obtain the semantic vector of the character combination of the industry feature words and the corresponding weights.
[0071] As a preferred embodiment, such as Figure 2 As shown, the training methods for the character combination semantic model include:
[0072] Step S201: Obtain pre-accumulated feature word text data;
[0073] Acquire massive amounts of pre-accumulated text data, including a large number of feature word texts.
[0074] Step S202: Using a distributed n-gram mining strategy, the character combinations of each feature word in the feature word text data are extracted as atomic semantics for the overall category judgment of the feature word.
[0075] The distributed n-gram mining strategy used in this step has been disclosed in patent application number 202010664165 and will not be elaborated here. In this implementation, n=3 is used to extract 1 to 3 common Chinese character combinations from the feature word text data, which serve as the "atoms" for subsequent overall category judgment of each feature word, i.e., atomic semantics. Specifically, for feature word text data containing English words, the English words are segmented by spaces.
[0076] In practical use, some extracted Chinese character combinations and English words with atomic semantics are shown in the table below:
[0077]
[0078] Step S203 involves constructing semantic vectors from the extracted feature words' character combinations to obtain a character combination semantic model. The specific operation method is as follows:
[0079] The character combinations of feature words are segmented according to the extracted atomic semantics to construct sample data for semantic training;
[0080] Use the gensim toolkit to load sample data and train semantic vectors;
[0081] Save the semantic vector results of the trained character combinations.
[0082] It is important to note that when constructing sample data for semantic training, in order to fully train the semantic meaning of each character combination extracted in the above steps, all possible segments of each feature word text data should be added to the training sample set, and the positional order of each character combination should be consistent with the order of appearance in the original text, and there should be no overlap in the segmentation positions.
[0083] The following two specific examples illustrate this point:
[0084] Example 1: Taking the text "Zhao Moumou's 'Who Rules the World'. Come watch the exclusive drama 'Who Rules the World' on Tencent Video tomorrow night. Bai Fengxi is so dashing!" as an example, taking the combination of characters such as "video", "watch video", "watch", "exclusive broadcast", "exclusive drama", and "drama" as an example, the sample that can be segmented is as follows:
[0085]
[0086] Example 2. Taking the text "Why has the price of Youku membership increased?" as an example, taking the character combinations "also", "price increase", "the price has increased", and "also increase the price" in it, the samples that can be segmented are as follows:
[0087]
[0088] Punctuation marks, emojis and other symbols are removed here because it is considered that these characters are usually not included in the feature words. Each character combination separated by spaces in the segmented samples is the n-gram combination (n takes 3) mined and extracted in the previous step.
[0089] As a preferred implementation manner of the embodiment of the present invention, when constructing the semantic meaning of the character combination, an open-source python toolkit gensim is used. The construction statements and parameter configurations are as follows:
[0090] import gensim # Load the toolkit
[0091] word2vec = gensim.models.word2vec.Word2Vec(myPatterns, size=256, window=20, min_count=8, sg=1, hs=1, iter=6, workers=4) # Load the sample data and train the semantic vector
[0092] word2vec.save('models / charsSemModel') # Save the semantic vector result of the character combination
[0093] Among them, myPatterns is an iterator constructed by oneself to traverse and obtain the data of the sample file. The configurations and meanings of other parameters can be referred to the open-source materials. For example, the dimension of the semantic vector here is 256, the sliding window size of adjacent texts is 20, the training iterates 6 rounds, and there are 4 computing processes, etc.
[0094] Through the above steps, the process of offline mining and semantic construction of atomic semantic character combinations based on a large amount of historical data is completed, and the training of the character combination semantic model is realized.
[0095] As a preferred implementation manner, as Figure 3 shown, step S103 specifically includes:
[0096] Step S301, using the calculation logic of calculating the relative importance of two words自带 in the gensim toolkit, calculate the relative importance of any two character combinations;
[0097] Step S302: Generate the importance of each character combination within the current feature word based on the relative importance;
[0098] Step S303: The importance of each character combination within the current feature word is used as the weight of each character combination.
[0099] Each character combination extracted from the feature word is assigned a semantic importance weight, which is used for subsequent weighted summation to generate the overall semantic vector of the feature word.
[0100] The following is a specific example illustrating the process. In practice, the table below shows all the internal character combinations and importance weights for some feature words extracted:
[0101]
[0102] The following is a sample code used during execution:
[0103] def predict_proba(oCmb, cCmb): # Get the relative semantic importance of the two character combinations, here it is the importance of cCmb relative to oCmb.
[0104] cCmb_vec = word2vec[cCmb]
[0105] oCmb = word2vec.wv.vocab[oCmb]
[0106] oCmb_l = word2vec.syn1[oCmb.point].T
[0107] dot = np.dot(cCmb_vec, oCmb_l)
[0108] lprob = -sum(np.logaddexp(0, -dot) + oCmb.code*dot)
[0109] return lprob
[0110] ws = {w:sum([predict_proba(u, w) for u in s]) for w in curKeyWord}
[0111] The above statement is used to obtain the importance weight of each character combination (variable w in the code) within each keyword (curKeyWord), and then normalized and scaled to the range [0,1].
[0112] Step S104: Weight and accumulate the semantic vector of the character combination to obtain the overall semantic vector of the current industry feature words.
[0113] The semantic vectors of each character combination extracted in step S103 are multiplied by semantic weights and summed to form the overall semantic vector of the current feature word. This weighted summation enhances the influence of important character combinations within each feature word on the semantic classification of the overall feature word.
[0114] Step S105: Determine the overall category of the industry feature words based on the overall semantic vector.
[0115] After the above steps, the semantic vector of each industry feature word to be classified is obtained, which can be clustered or classified according to the needs of the business scenario.
[0116] In a preferred embodiment, step S105 specifically includes:
[0117] For clustering operations, the overall semantic vector calculated based on industry feature words is directly subjected to clustering processing;
[0118] For classification operations, in addition to the overall semantic vector calculated based on industry feature words, a fully connected layer for classification is superimposed, and the corresponding classification model is trained for classification.
[0119] In summary, the feature word classification method provided in this embodiment can extract atomic semantic character combinations for constructing each feature word from massive amounts of historically accumulated text, and train semantic models for these character combinations. For new feature words, it first extracts these character combinations, obtains the latest trained semantic vector and calculates importance weights, and then performs weighted summation of the semantic vectors to obtain the overall semantic vector of the current feature word. This processing method deconstructs and analyzes the internal features of extremely short texts like feature words, improving the semantic influence of important internal character combinations. Furthermore, by using semantic vectors, it enhances the overall generalization ability of the strategy, resulting in significant improvements in subsequent classification and clustering processes.
[0120] like Figure 4 As shown, the feature word classification device provided by this invention includes:
[0121] Feature word acquisition unit 110 is used to acquire newly added industry feature words;
[0122] The character extraction unit 120 is used to extract the character combinations of newly added industry feature words and perform segmentation.
[0123] The vector acquisition unit 130 is used to acquire the semantic vector of the character combination of the industry feature words and the corresponding weights according to the pre-saved character combination semantic model.
[0124] Vector calculation unit 140 is used to weight and accumulate the semantic vector of character combinations to obtain the overall semantic vector of the current industry feature words;
[0125] The feature word classification unit 150 is used to make an overall category judgment on the industry feature words based on the overall semantic vector.
[0126] The feature word classification device provided in this embodiment of the invention is used to implement the above-described feature word classification method. Therefore, the specific implementation method is the same as the above method and will not be described again here.
[0127] like Figure 5 The diagram shows a structural block diagram of an electronic device 300 provided in an embodiment of the present invention. The electronic device 300 can be a smartphone, tablet computer, e-reader, or other electronic device capable of running applications. The electronic device 300 in this application may include one or more of the following components: a processor 310, a memory 320, and one or more applications, wherein the one or more applications can be stored in the memory 320 and configured to be executed by one or more processors 310, and the one or more applications are configured to perform the methods described in the foregoing method embodiments.
[0128] Processor 310 may include one or more processing cores. Processor 310 connects to various parts within the electronic device 300 using various interfaces and lines, and performs various functions and processes data of the electronic device 300 by running or executing instructions, programs, code sets, or instruction sets stored in memory 320, and by calling data stored in memory 320. Optionally, processor 310 may be implemented using at least one hardware form of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). Processor 310 may integrate one or a combination of several of the following: Central Processing Unit (CPU), Graphics Processing Unit (GPU), and modem. The CPU primarily handles the operating system, user interface, and applications; the GPU is responsible for rendering and drawing the displayed content; and the modem handles wireless communication. It is understood that the modem may also not be integrated into processor 310 and may be implemented separately using a communication chip.
[0129] The memory 320 may include random access memory (RAM) or read-only memory (ROM). The memory 320 can be used to store instructions, programs, code, code sets, or instruction sets. The memory 320 may include a program storage area and a data storage area. The program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as touch functionality, sound playback functionality, image playback functionality, etc.), and instructions for implementing the various method embodiments described below. The data storage area may also store data created by the terminal during use (such as phonebook data, audio and video data, chat log data, etc.).
[0130] like Figure 6 The diagram shows a structural block diagram of a computer-readable storage medium 400 provided in an embodiment of the present invention. The computer-readable medium stores program code 410, which can be called by a processor to execute the methods described in the above method embodiments.
[0131] The computer-readable storage medium 400 may be an electronic memory such as flash memory, EEPROM (Electrically Erasable Programmable Read-Only Memory), EPROM, hard disk, or ROM. Optionally, the computer-readable storage medium 400 includes a non-transitory computer-readable storage medium. The computer-readable storage medium 400 has storage space for program code 410 that performs any of the method steps described above. This program code 410 can be read from or written to one or more computer program products. The program code 410 may be compressed, for example, in a suitable form.
[0132] In summary, this invention provides a feature word classification method, apparatus, electronic device, and storage medium. It can extract atomic semantic character combinations for constructing various feature words from massive amounts of historically accumulated text, and train semantic models for these character combinations. For new feature words, it first extracts these character combinations, obtains the latest trained semantic vector and calculates importance weights, and then performs a weighted summation of the semantic vectors to obtain the overall semantic vector of the current feature word. This processing method deconstructs and analyzes the internal features of extremely short texts like feature words, improving the semantic influence of important internal character combinations. Furthermore, by using semantic vectors, it enhances the overall generalization ability of the strategy, resulting in significant improvements in subsequent classification and clustering processes.
[0133] In the embodiments disclosed in this application, it should be understood that the disclosed apparatus and methods can also be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code, which contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0134] In addition, the functional modules in the various embodiments of this application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0135] If the aforementioned functions are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
Claims
1. A feature word classification method, characterized by, The method comprises: acquiring newly added industry characteristic words; extracting character combinations of the newly added industry characteristic words and performing segmentation; acquiring semantic vectors of the character combinations of the industry characteristic words and corresponding weights according to a pre-stored character combination semantic model; weighting and accumulating the semantic vectors of the character combinations to obtain an overall semantic vector of the current industry characteristic word; performing overall category judgment on the industry characteristic word according to the overall semantic vector; the training method of the character combination semantic model comprises: acquiring pre-accumulated characteristic word text data; extracting character combinations of each characteristic word in the characteristic word text data as atomic semantics for overall category judgment of the characteristic word by using a distributed-based n-gram mining strategy; constructing semantic vectors of the extracted character combinations of the characteristic word to obtain a character combination semantic model; the step of extracting character combinations of the newly added industry characteristic words and performing segmentation specifically comprises: extracting character combinations of the industry characteristic words according to the atomic semantics and performing segmentation; all character combinations appearing in the characteristic word text data contained in the industry characteristic words are extracted by using a "full-amount segmentation" strategy; the method for acquiring the weights corresponding to the character combinations of the industry characteristic words specifically comprises: calculating the relative importance of any two character combinations by using the calculation logic for calculating the relative importance of two words provided by the gensim toolkit; generating the importance of each character combination in the current characteristic word according to the relative importance; taking the importance of each character combination in the current characteristic word as the weight of each character combination.
2. The feature word classifying method according to claim 1, characterized in that, the step of constructing semantic vectors of the extracted character combinations of the characteristic word specifically comprises: segmenting the character combinations of the characteristic word according to the extracted atomic semantics to construct sample data for semantic training; loading the sample data and training semantic vectors by using the gensim toolkit; saving the semantic vector results of the trained character combinations.
3. The feature word classifying method according to claim 2, characterized in that, When the step of constructing sample data for semantic training is performed, all segmentation possibilities of each characteristic word text data are added to the training sample set, and the position order of each character combination is ensured to be consistent with the order appearing in the original text, and there is no overlap in the segmentation position.
4. The feature classification method according to claim 3, characterized by, the step of performing overall category judgment on the industry characteristic word according to the overall semantic vector specifically comprises: for clustering operation, the overall semantic vector calculated according to the industry characteristic word is directly subjected to clustering processing; for classification operation, a full-connection layer for classification is superimposed on the overall semantic vector calculated according to the industry characteristic word, and a corresponding classification model is trained for classification.
5. A feature word classifying apparatus characterized by comprising: The device comprises: a characteristic word acquisition unit configured to acquire newly added industry characteristic words; a character extraction unit configured to extract character combinations of the newly added industry characteristic words and perform segmentation; a vector acquisition unit configured to acquire semantic vectors of the character combinations of the industry characteristic words and corresponding weights according to a pre-stored character combination semantic model; A vector calculation unit is configured to accumulate semantic vectors of the character combinations to obtain an overall semantic vector of the current industry feature word; A feature word classification unit is configured to perform overall category judgment on the industry feature word according to the overall semantic vector; The training method of the character combination semantic model comprises the following steps: Obtaining pre-accumulated feature word text data; An n-gram mining strategy based on distribution is adopted to extract character combinations of each feature word in the feature word text data as atomic semantics for overall category judgment of the feature word; Semantic vectors of the extracted character combinations of the feature word are constructed to obtain a character combination semantic model; The character extraction unit is specifically configured to: extract and split the character combinations of the industry feature word according to the atomic semantics; An "all-quantity splitting" strategy is adopted to extract all character combinations contained in the industry feature word and appearing in the feature word text data; The vector acquisition unit is specifically configured to: A calculation logic for calculating the relative importance of two words provided by a gensim toolkit is adopted to calculate the relative importance of any two character combinations; The importance of each character combination in the current feature word is generated according to the relative importance; The importance of each character combination in the current feature word is used as the weight of each character combination.
6. An electronic device, comprising: It comprises: one or more processors; a memory; one or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to perform the method of any one of claims 1-4.
7. A computer-readable storage medium, characterized in that, The computer readable storage medium stores program codes, and the program codes can be called and executed by the processor to perform the method of any one of claims 1-4.
Citation Information
Patent Citations
Word weight determination method and device, server and computer readable storage medium
CN112507724A
Document classification method and system, computer equipment and storage medium
CN115292498A