A product name matching method, system, device and storage medium
By integrating the product name matching method of multiple text similarity calculation methods, the problem of low accuracy of product name matching in the prior art is solved, and the accuracy of matching and the ability to handle complex situations are improved.
Patent Information
- Application Number
- CN202110067464.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-01-19
- Publication Date
- 2025-04-08
- Estimated Expiration
- 2041-01-19
AI Technical Summary
The accuracy of product name matching in the prior art is low, especially when dealing with adjective sequence switching, and excessive dependence on participle results in inaccurate matches.
Product name matching methods that combine multiple text similarity calculation methods, including text word segmentation, minimum editing distance algorithm, cosine similarity algorithm and Sequence Matcher algorithm, are used to calculate the target similarity through the weighted average method to match.
It improves the accuracy of product name matching, avoids the limitations of using a single text similarity calculation method, and enhances the ability to handle complex situations such as order switching of adjectives.
Smart Images

Figure CN112749542B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of text processing technology, and in particular to a product name matching method, system, device and storage medium. Background Art
[0002] In the process of executing crawler tasks, a product name is usually entered on different media platforms to crawl the product information corresponding to the product name. However, since different media platforms do not necessarily use a unified standard product name, there will be inaccurate product name association matching problems during the crawling process.
[0003] At present, in order to solve the problem of inaccurate association matching of product names, the prior art usually adopts the longest common string algorithm, cosine similarity algorithm or minimum edit distance algorithm to calculate the similarity between the texts to be matched, so as to match whether the product names in the texts to be matched are consistent.
[0004] However, as far as the prior art is concerned, when the longest common string algorithm is used for similarity calculation, the order of two adjectives in the product name may be swapped when processing the product name, making the calculated similarity inaccurate, thereby causing inaccurate matching of the product name in the text; when the cosine similarity algorithm is used for similarity calculation, it relies too much on word segmentation, thereby also causing inaccurate matching of the product name in the text. Summary of the invention
[0005] In order to solve the technical problem of low accuracy of product name matching in the prior art, the present invention provides a product name matching method, which integrates multiple text similarity calculation methods, improves the accuracy of product name matching, and avoids the limitations of using a single text similarity calculation method.
[0006] The present invention provides a product name matching method, comprising the following steps:
[0007] The text segmentation step is to perform a segmentation process on the two texts to be matched that contain the product name description, and obtain word sets corresponding to the two texts to be matched respectively;
[0008] The text similarity calculation step comprises: based on the word sets of the two texts to be matched, respectively using the minimum edit distance algorithm and the cosine similarity algorithm to calculate the similarity of the word sets of the two texts to be matched, so as to obtain the first similarity and the second similarity of the two texts to be matched; and using the Sequence Matcher algorithm to calculate the similarity of the two texts to be matched, so as to obtain the third similarity of the two texts to be matched;
[0009] The text matching step calculates the target similarity of the two texts to be matched based on the first similarity, the second similarity and the third similarity, and matches the two texts to be matched according to the target similarity and a preset threshold.
[0010] The above-mentioned product name matching method further includes:
[0011] In the text preprocessing step, based on preset rules, two to-be-matched texts containing product name descriptions are preprocessed to obtain two preprocessed to-be-matched texts.
[0012] In the above-mentioned product name matching method, the preset rules in the text preprocessing step include: deleting spaces in the text, converting uppercase English letters in the text into corresponding lowercase English letters, and converting brackets in the text into Chinese format brackets.
[0013] In the above-mentioned product name matching method, the method for calculating the target similarity in the text matching step specifically includes:
[0014] assigning a first weight to the first similarity, a second weight to the second similarity, and a third weight to the third similarity;
[0015] Based on the first similarity, the first weight, the second similarity, the second weight, the third similarity and the third weight, a weighted average method is used to calculate a target similarity of the two texts to be matched.
[0016] In the above-mentioned product name matching method, the method of matching the two texts to be matched in the text matching step specifically includes:
[0017] Comparing the target similarity with a preset threshold;
[0018] When the target similarity is greater than or equal to the preset threshold, the two texts to be matched are matched successfully;
[0019] When the target similarity is less than the preset threshold, the two texts to be matched fail to match.
[0020] The present invention also provides a product name matching system, comprising:
[0021] A text segmentation unit is used to perform segmentation processing on two to-be-matched texts containing product name descriptions, and obtain word sets corresponding to the two to-be-matched texts respectively;
[0022] A text similarity calculation unit is used to calculate the similarity of the word sets of the two texts to be matched by using a minimum edit distance algorithm and a cosine similarity algorithm, respectively, based on the word sets of the two texts to be matched, to obtain a first similarity and a second similarity of the two texts to be matched; and to calculate the similarity of the two texts to be matched by using a Sequence Matcher algorithm, to obtain a third similarity of the two texts to be matched;
[0023] The text matching unit is used to calculate the target similarity of the two texts to be matched based on the first similarity, the second similarity and the third similarity, and match the two texts to be matched according to the target similarity and a preset threshold.
[0024] The above-mentioned product name matching system, wherein, further comprises:
[0025] The text preprocessing unit is used to preprocess two to-be-matched texts containing product name descriptions based on preset rules to obtain two preprocessed to-be-matched texts.
[0026] In the above-mentioned product name matching system, the preset rules in the text preprocessing unit include: deleting spaces in the text, converting uppercase English letters in the text into corresponding lowercase English letters, and converting brackets in the text into Chinese format brackets.
[0027] The present invention also provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned product name matching method when executing the computer program.
[0028] The present invention also provides a computer-readable storage medium on which a computer program is stored, characterized in that when the program is executed by a processor, the product name matching method as described above is implemented.
[0029] Technical effects or advantages of the present invention:
[0030] The present invention provides a method for matching product names. The method performs word segmentation processing on two texts to be matched that contain product name descriptions, respectively obtaining word sets corresponding to the two texts to be matched. Based on the word sets of the two texts to be matched, the method uses a minimum edit distance algorithm and a cosine similarity algorithm to calculate similarity on the word sets of the two texts to be matched, respectively, obtaining a first similarity and a second similarity of the two texts to be matched. The method uses a Sequence Matcher algorithm to calculate similarity on the two texts to be matched, obtaining a third similarity of the two texts to be matched. Based on the first similarity, the second similarity and the third similarity, the method calculates the target similarity of the two texts to be matched, and matches the two texts to be matched according to the target similarity and a preset threshold. In the above manner, the method combines a plurality of text similarity calculation methods, improves the accuracy of product name matching, and avoids the limitations of using a single text similarity calculation method. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 A flowchart of a product name matching method provided by an embodiment of the present invention;
[0032] Figure 2 A schematic diagram of the structure of a product name matching system provided by an embodiment of the present invention;
[0033] Figure 3 A framework diagram of an electronic device provided by an embodiment of the present invention;
[0034] In the above picture:
[0035] 1. Text preprocessing unit; 2. Text segmentation unit; 3. Text similarity calculation unit; 4. Text matching unit;
[0036] 10. Bus; 11. Processor; 12. Memory; 13. Communication interface. DETAILED DESCRIPTION
[0037] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution 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 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 are within the scope of protection of the present invention.
[0038] Obviously, the drawings described below are only some examples or embodiments of the present application. For ordinary technicians in the field, the present application can also be applied to other similar scenarios based on these drawings without creative work. In addition, it can also be understood that although the efforts made in this development process may be complex and lengthy, for ordinary technicians in the field related to the content disclosed in the present application, some changes such as design, manufacturing or production based on the technical content disclosed in the present application are just conventional technical means, and should not be understood as insufficient content disclosed in the present application. The reference to "embodiment" in the present application means that the specific features, structures or characteristics described in conjunction with the embodiment can be included in at least one embodiment of the present application. The phrase appears in various positions in the specification and does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by ordinary technicians in the field that the embodiments described in the present application can be combined with other embodiments without conflict. Unless otherwise defined, the technical terms or scientific terms involved in the present application should be the common meaning understood by people with general skills in the technical field to which the present application belongs. The words "one", "a", "a kind of", "the" and the like used in this application do not indicate a quantitative limitation and may indicate the singular or the plural. The terms "include", "comprise", "have" and any variations thereof used in this application are intended to cover non-exclusive inclusions; for example, a process, method, system, product or device that includes a series of steps or modules (units) is not limited to the listed steps or units, but may also include steps or units that are not listed, or may also include other steps or units that are inherent to these processes, methods, products or devices. The words "connect", "connected", "coupled" and the like used in this application are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect.
[0039] The "multiple" involved in this application refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. The terms "first", "second", "third", etc. involved in this application are merely used to distinguish similar objects and do not represent a specific ordering of objects.
[0040] In order to solve the technical problem of low accuracy of product name matching in the prior art, the present invention provides a product name matching method, which integrates multiple text similarity calculation methods to improve the accuracy of product name matching and avoid the limitations of using a single text similarity calculation method.
[0041] The technical solution of the present invention is described in detail below in conjunction with specific embodiments and the accompanying drawings.
[0042] This embodiment provides a product name matching method, including the following steps:
[0043] The text segmentation step is to perform a segmentation process on the two texts to be matched that contain the product name description, and obtain word sets corresponding to the two texts to be matched respectively;
[0044] The text similarity calculation step comprises: based on the word sets of the two texts to be matched, respectively using the minimum edit distance algorithm and the cosine similarity algorithm to calculate the similarity of the word sets of the two texts to be matched, so as to obtain the first similarity and the second similarity of the two texts to be matched; and using the Sequence Matcher algorithm to calculate the similarity of the two texts to be matched, so as to obtain the third similarity of the two texts to be matched;
[0045] The text matching step calculates the target similarity of the two texts to be matched based on the first similarity, the second similarity and the third similarity, and matches the two texts to be matched according to the target similarity and a preset threshold.
[0046] The product name matching method provided in this embodiment combines multiple text similarity calculation methods, improves the accuracy of product name matching, and avoids the limitations of using a single text similarity calculation method.
[0047] The text similarity calculation method used in this embodiment is specifically introduced below, as follows:
[0048] (1) Cosine similarity algorithm
[0049] The cosine similarity algorithm measures the similarity between two vectors by measuring the cosine value of the angle between the two vectors. Usually, the text is segmented and the word frequency is used as the feature weight to calculate the cosine value of the angle.
[0050] As an example, the application of the cosine similarity algorithm is introduced as follows:
[0051] For example, the two texts are "Xiao Ming is good at mathematics" and "Xiao Ming is not good at mathematics". After word segmentation of "Xiao Ming is good at mathematics", we get ['Xiao Ming', 'mathematics', 'good'], and its corresponding word frequency vector is [1, 1, 1, 0]. After word segmentation of "Xiao Ming is not good at mathematics", we get ['Xiao Ming', 'mathematics', 'not good'], and its corresponding word frequency vector is [1, 1, 0, 1]. Based on the two word vectors, calculate the cosine value of the angle between the two word vectors:
[0052]
[0053] Among them, the larger the cosine value calculated by the cosine similarity algorithm, the higher the similarity between the two vectors.
[0054] (2) Minimum edit distance algorithm
[0055] The minimum edit distance algorithm is the minimum number of edits (operations such as adding characters, deleting characters, and replacing characters) required to transform one string into another string.
[0056] As an example, the application of the minimum edit distance algorithm is specifically introduced as follows:
[0057] For example, two texts are "Xiaoming is good at math" and "Xiaoming is not good at English". Among them, replace the character "math" in the string "Xiaoming is good at math" with "English", replace "math" with "English", and add "not". Based on the modified string, calculate the similarity between the two texts:
[0058]
[0059] Among them, d represents the number of operations such as adding, deleting, and replacing characters; min(n, m) represents the number of characters in the text with the fewest characters among the two strings.
[0060] Among them, the smaller the edit distance calculated by the minimum edit distance algorithm, the higher the similarity between the two strings.
[0061] (3) Sequence Matcher algorithm
[0062] The Sequence Matcher algorithm is based on the python diffib module to compare the distance between two texts. It returns the ratio of the length of the same text segment to the length of the shorter text among the two texts through ratio, so as to obtain the similarity between the two texts. Among them, the larger the ratio calculated by the Sequence Matcher algorithm, the higher the similarity between the two texts.
[0063] Specifically, refer to Figure 1 , Figure 1 is a flowchart of a commodity name matching method provided by an embodiment of the present invention. This embodiment provides a commodity name matching method, including the following steps:
[0064] Text preprocessing step S1, based on preset rules, preprocess two texts to be matched containing commodity name descriptions to obtain two preprocessed texts to be matched.
[0065] In this embodiment, the preset rules in the text preprocessing step S1 include: deleting spaces in the text, converting uppercase English letters in the text into corresponding lowercase English letters, and converting brackets in the text into Chinese-format brackets.
[0066] In a specific application, before calculating the text similarity, in order to reduce interference information, the two to-be-matched texts containing the product description are preprocessed in a unified format to obtain two preprocessed to-be-matched texts.
[0067] In the text segmentation step S2, two texts to be matched containing product name descriptions are segmented to obtain word sets corresponding to the two texts to be matched.
[0068] In this embodiment, the text segmentation step S2 is a word segmentation process performed on the two preprocessed texts to be matched obtained in the text preprocessing step S1, thereby obtaining word sets corresponding to the two texts to be matched respectively.
[0069] The text similarity calculation step S3 is to calculate the similarity of the word sets of the two texts to be matched by using the minimum edit distance algorithm and the cosine similarity algorithm respectively, so as to obtain the first similarity and the second similarity of the two texts to be matched; and to calculate the similarity of the two texts to be matched by using the Sequence Matcher algorithm to obtain the third similarity of the two texts to be matched.
[0070] In a specific application, the word set of the two texts to be matched in this embodiment is the word set corresponding to the two texts to be matched obtained after the two pre-processed texts to be matched containing the description of the product name are segmented. Based on the word set of the two texts to be matched, the minimum edit distance algorithm is used to add characters, delete characters, and replace characters on the two text strings, and the similarity of the two texts to be matched is calculated according to the number of operations and the number of characters contained in the two texts to be matched, so as to obtain the first similarity; based on the word set of the two texts to be matched, the cosine similarity algorithm is used to calculate the cosine value of the angle between the two word sets, so as to obtain the second similarity; based on the two pre-processed texts to be matched obtained after the text pre-processing step S1, the distance between the two pre-processed texts to be matched is compared based on the python diffib module, so as to obtain the third similarity.
[0071] In the text matching step S4, based on the first similarity, the second similarity and the third similarity, a target similarity of the two texts to be matched is calculated, and the two texts to be matched are matched according to the target similarity and a preset threshold.
[0072] In this embodiment, the method for calculating the target similarity in the text matching step S4 specifically includes:
[0073] assigning a first weight to the first similarity, a second weight to the second similarity, and a third weight to the third similarity;
[0074] Based on the first similarity, the first weight, the second similarity, the second weight, the third similarity and the third weight, a weighted average method is used to calculate a target similarity of the two texts to be matched.
[0075] In a specific application, the first weight, the second weight and the third weight can be used to allocate weights to the first similarity, the second similarity and the third similarity according to the characteristic that the product name text has many descriptive words.
[0076] In this embodiment, the method for matching the two to-be-matched texts in the text matching step S4 specifically includes:
[0077] Comparing the target similarity with a preset threshold;
[0078] When the target similarity is greater than or equal to the preset threshold, the two texts to be matched are matched successfully;
[0079] When the target similarity is less than the preset threshold, the two texts to be matched fail to match.
[0080] In a specific application, the preset threshold value can be selected according to actual needs. In this embodiment, the preset threshold value selected according to actual needs is 0.75. In this embodiment, since the two texts to be matched contain descriptions of product names respectively, when the two texts to be matched are matched successfully, it means that the two texts to be matched are descriptions of the same product.
[0081] The present embodiment provides a method for matching product names. The method combines a minimum edit distance algorithm, a cosine similarity algorithm, and a sequence matcher algorithm, respectively calculates the similarities of two texts to be matched, and calculates multiple similarities by a weighted average method to obtain a target similarity of the two texts to be matched, thereby improving the accuracy of product name matching and avoiding the limitations of using a single text similarity calculation method.
[0082] As an example, the following is a detailed description of the product name matching process, as follows:
[0083] For example, the two texts to be matched are as follows:
[0084] Text to be matched 1: French HKH men's skin care product set oil control, moisturizing, pore tightening, lotion and essence
[0085] Text to be matched 2: French HKH men's skin care products 4-piece set moisturizing pore-tightening lotion essence oil control hydration brightens dullness
[0086] Based on the preset rules, the text to be matched 1 and the text to be matched 2 are preprocessed to obtain two preprocessed texts to be matched, which are as follows:
[0087] Pre-processed matching text 1: French HKH men's skin care product set oil control, hydrating, moisturizing, shrinking pores, water lotion essence
[0088] Pre-processed matching text 2: French HKH men's skin care products 4-piece set moisturizing pore-tightening water lotion essence oil control hydration brighten dullness
[0089] The preprocessed text to be matched 1 and the preprocessed text to be matched 2 are segmented to obtain the word sets corresponding to the two texts to be matched, which are as follows:
[0090] The word set of the text to be matched 1: ['France', 'hkh', 'Men', 'Skin Care Products', 'Set', 'Oil Control', 'Moisturizing', 'Moisturizing', 'Contraction', 'Pores', 'Water Lotion', 'Essence']
[0091] The word set of the text to be matched 2: ['France', 'hkh', 'Men', 'Skin Care Products', '4', 'Set', 'Moisturizing', 'Contraction', 'Pores', 'Water Lotion', 'Essence', 'Oil Control', 'Moisturizing', 'Brightening', 'Dull']
[0092] Based on the word set of the to-be-matched text 1 and the word set of the preprocessed to-be-matched text 2, the minimum edit distance algorithm is used to calculate the similarity of the word set of the to-be-matched text 1 and the to-be-matched text 2, thereby obtaining the first similarity between the to-be-matched text 1 and the to-be-matched text 2: P 1 =0.53; Based on the word set of the text to be matched 1 and the word set of the preprocessed text to be matched 2, the cosine similarity algorithm is used to calculate the similarity of the word set of the preprocessed text to be matched 1 and the preprocessed text to be matched 2, thereby obtaining the second similarity of the text to be matched 1 and the text to be matched 2: P 2 =0.82; the Sequence Matcher algorithm is used to calculate the similarity between the preprocessed text to be matched 1 and the preprocessed text to be matched 2, thereby obtaining the third similarity between the text to be matched 1 and the text to be matched 2: P 3 =0.76.
[0093] The first similarity is assigned a first weight of 0.1, the second similarity is assigned a second weight of 0.5, and the third similarity is assigned a third weight of 0.4. The first similarity, the first weight, the second similarity, the second weight, the third similarity and the third weight are calculated using the weighted average method, thereby obtaining the target similarity of the two texts to be matched: P = 0.1*P 1 +0.5*P 2 +0.4*P 3 =0.76.
[0094] Compare the target similarity P and the preset threshold. If the target similarity P is greater than the preset threshold 0.75, the two texts to be matched are matched successfully, that is, the two texts to be matched are descriptions of the same product.
[0095] The embodiment of the present invention also provides a product name matching system, referring to Figure 2 The product name matching system includes a text preprocessing unit 1, a text segmentation unit 2, a text similarity calculation unit 3 and a text matching unit 4, wherein the text preprocessing unit 1 is connected to the text segmentation unit 2, the text segmentation unit 2 is connected to the text similarity calculation unit 3, and the text similarity calculation unit 3 is connected to the text matching unit 4.
[0096] In this embodiment, the text preprocessing unit 1 is used to preprocess the two to-be-matched texts containing the product name description based on a preset rule to obtain two preprocessed to-be-matched texts. The text preprocessing unit 1 sends the obtained two preprocessed to-be-matched texts to the text segmentation unit 2 and the text similarity calculation unit 3.
[0097] In this embodiment, the preset rules in the text preprocessing unit 1 include: deleting spaces in the text, converting uppercase English letters in the text into corresponding lowercase English letters, and converting brackets in the text into Chinese format brackets.
[0098] The text segmentation unit 2 is used to perform segmentation processing on the two to-be-matched texts containing the product name description, and obtain word sets corresponding to the two to-be-matched texts respectively. The text segmentation unit 2 sends the obtained word sets of the two to-be-matched texts to the text similarity calculation unit 3.
[0099] The text similarity calculation unit 3 is used to calculate the similarity of the word sets of the two texts to be matched by using the minimum edit distance algorithm and the cosine similarity algorithm respectively, based on the word sets of the two texts to be matched, to obtain the first similarity and the second similarity of the two texts to be matched; and to calculate the similarity of the two texts to be matched by using the Sequence Matcher algorithm to obtain the third similarity of the two texts to be matched. The text similarity calculation unit 3 is used to send the first similarity, the second similarity and the third similarity to the text matching unit 4.
[0100] The text matching unit 4 is used to calculate the target similarity of the two texts to be matched based on the first similarity, the second similarity and the third similarity, and match the two texts to be matched according to the target similarity and a preset threshold.
[0101] The present embodiment provides a product name matching system, which integrates the minimum edit distance algorithm, the cosine similarity algorithm and the Sequence Matcher algorithm, respectively calculates the similarity of two texts to be matched, calculates multiple similarities by weighted average method, and obtains the target similarity of the two texts to be matched, thereby improving the accuracy of product name matching and avoiding the limitations of using a single text similarity calculation method.
[0102] refer to Figure 3 This embodiment also provides a computer device, including a memory 12, a processor 11, and a computer program stored in the memory 12 and executable on the processor 11, and the processor 11 implements the above-mentioned product name matching method when executing the computer program.
[0103] The device may include a processor 11 and a memory 12 storing computer program instructions. Specifically, the processor 11 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
[0104] Among them, the memory 12 may include a large-capacity memory for data or instructions. By way of example and not limitation, the memory 12 may include a hard disk drive (HDD), a floppy disk drive, a solid-state drive (SSD), a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive, or a combination of two or more of these. Where appropriate, the memory 12 may include a removable or non-removable (or fixed) medium. Where appropriate, the memory 12 may be inside or outside a data processing device. In a specific embodiment, the memory 12 is a non-volatile memory. In a specific embodiment, the memory 12 includes a read-only memory (ROM) and a random access memory (RAM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable ROM (Programmable Read-Only Memory, PROM for short), an erasable PROM (Erasable ProgrammableRead-Only Memory, EPROM for short), an electrically erasable PROM (Electrically Erasable ProgrammableRead-Only Memory, EEPROM for short), an electrically alterable ROM (Electrically Alterable Read-Only Memory, EAROM for short) or a flash memory (FLASH) or a combination of two or more of these. Under appropriate circumstances, the RAM can be a static random access memory (SRAM) or a dynamic random access memory (DRAM), wherein the DRAM can be a fast page mode dynamic random access memory (FPMDRAM), an extended data output dynamic random access memory (EDODRAM), a synchronous dynamic random access memory (SDRAM), etc.
[0105] The memory 12 may be used to store or cache various data files that need to be processed and / or used for communication, as well as possible computer program instructions executed by the processor 11 .
[0106] The processor 11 implements any one of the product name matching methods in the above embodiments by reading and executing computer program instructions stored in the memory 12 .
[0107] In some of the embodiments, the computer device may further include a communication interface 13 and a bus 10. Figure 3 , the processor 11, the memory 12, and the communication interface 13 are connected through the bus 10 and communicate with each other. The communication interface 13 is used to realize the communication between the modules, devices, units and / or equipment in the embodiment of the present application. The communication interface 13 can also realize data communication with other components such as: external devices, image / data acquisition equipment, databases, external storage, and image / data processing workstations.
[0108] The bus 10 includes hardware, software or both, and couples the components of the electronic device to each other. The bus 10 includes but is not limited to at least one of the following: a data bus, an address bus, a control bus, an expansion bus, and a local bus. By way of example and not limitation, bus 10 may include an Accelerated Graphics Port (AGP) or other graphics bus, an Extended Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hyper Transport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an InfiniBand interconnect, a Low Pin Count (LPC) bus, a memory bus, a Micro Channel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local Bus (VLB) bus, or other suitable buses or a combination of two or more of these. Where appropriate, bus 10 may include one or more buses. Although embodiments of the present application describe and illustrate a particular bus, the present application contemplates any suitable bus or interconnect.
[0109] In addition, in combination with the product name matching method in the above embodiment, the embodiment of the present application can provide a computer-readable storage medium for implementation. The computer-readable storage medium stores computer program instructions; when the computer program instructions are executed by a processor, any one of the product name matching methods in the above embodiment is implemented.
[0110] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A product name matching method, characterized in that: The steps include: The text segmentation step is to perform a segmentation process on the two texts to be matched that contain the product name description, and obtain word sets corresponding to the two texts to be matched respectively; The text similarity calculation step comprises: based on the word sets of the two texts to be matched, respectively using the minimum edit distance algorithm and the cosine similarity algorithm to calculate the similarity of the word sets of the two texts to be matched, so as to obtain the first similarity and the second similarity of the two texts to be matched; and using the Sequence Matcher algorithm to calculate the similarity of the two texts to be matched, so as to obtain the third similarity of the two texts to be matched; A text matching step, based on the first similarity, the second similarity and the third similarity, calculating a target similarity of the two texts to be matched, and matching the two texts to be matched according to the target similarity and a preset threshold; The method for calculating the target similarity in the text matching step specifically includes: assigning a first weight to the first similarity, a second weight to the second similarity, and a third weight to the third similarity; Based on the first similarity, the first weight, the second similarity, the second weight, the third similarity and the third weight, a weighted average method is used to calculate a target similarity of the two texts to be matched.
2. The product name matching method according to claim 1, characterized in that: Also includes: In the text preprocessing step, based on preset rules, two to-be-matched texts containing product name descriptions are preprocessed to obtain two preprocessed to-be-matched texts.
3. The product name matching method according to claim 2, characterized in that: The preset rules in the text preprocessing step include: deleting spaces in the text, converting uppercase English letters in the text into corresponding lowercase English letters, and converting brackets in the text into Chinese format brackets.
4. The product name matching method according to claim 1, characterized in that: The method for matching the two texts to be matched in the text matching step specifically includes: Comparing the target similarity with a preset threshold; When the target similarity is greater than or equal to the preset threshold, the two texts to be matched are matched successfully; When the target similarity is less than the preset threshold, the two texts to be matched fail to match.
5. A product name matching system, characterized in that: include: A text segmentation unit is used to perform segmentation processing on two to-be-matched texts containing product name descriptions, and obtain word sets corresponding to the two to-be-matched texts respectively; A text similarity calculation unit is used to calculate the similarity of the word sets of the two texts to be matched by using a minimum edit distance algorithm and a cosine similarity algorithm, respectively, based on the word sets of the two texts to be matched, to obtain a first similarity and a second similarity of the two texts to be matched; and to calculate the similarity of the two texts to be matched by using a Sequence Matcher algorithm, to obtain a third similarity of the two texts to be matched; A text matching unit, configured to calculate a target similarity of the two texts to be matched based on the first similarity, the second similarity and the third similarity, and match the two texts to be matched according to the target similarity and a preset threshold; The method for calculating the target similarity in the text matching unit specifically includes: assigning a first weight to the first similarity, a second weight to the second similarity, and a third weight to the third similarity; Based on the first similarity, the first weight, the second similarity, the second weight, the third similarity and the third weight, a weighted average method is used to calculate a target similarity of the two texts to be matched.
6. The product name matching system according to claim 5, characterized in that: Also includes: The text preprocessing unit is used to preprocess two to-be-matched texts containing product name descriptions based on preset rules to obtain two preprocessed to-be-matched texts.
7. The product name matching system according to claim 6, characterized in that: The preset rules in the text preprocessing unit include: deleting spaces in the text, converting capital letters in the text into corresponding lowercase letters, and converting brackets in the text into Chinese format brackets.
8. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the product name matching method according to any one of claims 1 to 4 is implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the product name matching method according to any one of claims 1 to 4 is implemented.
Citation Information
Patent Citations
Text recognition method, device and equipment and storage medium
CN110909725A