Word bank generation method and device, equipment and medium
By determining and updating the character length of the text information to be processed, and using word segmentation algorithm and N-gram model to expand the dictionary content, the problems of low efficiency and poor accuracy in the prior art are solved, and the efficiency and accuracy of information retrieval are improved. .
Patent Information
- Application Number
- CN202411007940.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-25
- Publication Date
- 2024-12-03
AI Technical Summary
In the prior art, information retrieval relies on the lexicon configured by third-party plug-ins, which increases maintenance difficulty, limits the breadth and depth of search keyword associations, and reduces the efficiency and accuracy of information retrieval.
By determining whether the character length of the text information to be processed is within the set character threshold interval, the lexicon matches and updates are performed, phrases are divided using word segmentation algorithms, and the lexicon updates are used to expand the lexicon content by using the preset N-gram model. To improve the efficiency and accuracy of information retrieval.
It improves the efficiency and accuracy of information retrieval, expands the vocabulary storage content, reduces development costs, and enhances the breadth and depth of search keyword associations.
Smart Images

Figure CN119067113A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of information processing technology, and in particular to a method, device, equipment and medium for generating a vocabulary library. Background Art
[0002] With the development of artificial intelligence, search association function is becoming a basic service function of Internet products. In related technologies, information retrieval usually relies on the configured word library provided by third-party plug-ins to perform information retrieval and obtain retrieval results. Since the word library configured by the third-party plug-in can only provide fixed query results, it not only increases the difficulty of maintenance, but also limits the breadth and depth of the search keyword association of information retrieval, thereby reducing the efficiency and accuracy of information retrieval. Summary of the invention
[0003] The present invention provides a method, device, equipment and medium for generating a word library to solve the problems of low efficiency and poor accuracy of current information retrieval.
[0004] In order to solve the above problems, the present invention discloses a method for generating a vocabulary library, comprising:
[0005] For the text information to be processed that does not contain punctuation marks, determining whether the character length of the text information to be processed is within a set character threshold range;
[0006] When the character length of the text information to be processed is within the set character threshold range, the text information to be processed is determined as a target phrase, matched with an existing word library, and a corresponding word library update operation is performed according to the matching result;
[0007] When the length of the text information to be processed is greater than the maximum value of the character threshold interval, the text information to be processed is divided into phrases according to the word segmentation algorithm, and the phrases whose length is greater than the minimum value of the character threshold interval are determined as target phrases, matched with the existing vocabulary, and corresponding vocabulary update operations are performed according to the matching results.
[0008] Optionally, performing a corresponding word library update operation according to the matching result includes:
[0009] If the word library is in the target phrase, adjusting the first word frequency quantity corresponding to the target phrase;
[0010] If the phrase does not exist in the vocabulary, the target phrase is updated into the vocabulary.
[0011] Optionally, the method further comprises:
[0012] For the text information to be processed containing punctuation marks, dividing the text information to be processed into a plurality of phrases based on the punctuation marks;
[0013] The first character length of the phrase is obtained. If the first character length is greater than the minimum value of the character threshold interval, the phrase whose first character length is greater than the minimum value of the character threshold interval is determined as the target phrase, matched with the existing vocabulary, and a corresponding vocabulary update operation is performed according to the matching result.
[0014] Optionally, dividing the text information to be processed into phrases according to a word segmentation algorithm and determining a phrase having a length greater than a minimum value of the character threshold interval as a target phrase comprises:
[0015] Using a preset N-gram model to segment the text information to be processed, obtaining a plurality of phrases, and determining a phrase whose length is greater than the minimum value of the character threshold interval as a target phrase;
[0016] The preset N-gram model is obtained by training using target phrases stored in the vocabulary.
[0017] In order to solve the above problem, the present invention further discloses a keyword association method based on a vocabulary, wherein the vocabulary is generated by the vocabulary generation method, and the method comprises:
[0018] Get the keywords to be searched;
[0019] If the keyword to be searched exists in the vocabulary, the target phrase is obtained;
[0020] intercepting a character string of a set length after the keyword to be searched in the target phrase;
[0021] Assembling the keyword to be searched with the character string of the set length to generate an associative phrase;
[0022] The associative phrase is used as the search result of the keyword to be searched.
[0023] In order to solve the above problem, the present invention also discloses a device for generating a vocabulary library, comprising:
[0024] A determination module, for determining, for the text information to be processed that does not contain punctuation marks, whether the character length of the text information to be processed is within a set character threshold range;
[0025] A target phrase module is used to determine the text information to be processed as a target phrase when the character length of the text information to be processed is within a set character threshold interval, match it with an existing word library, and perform a corresponding word library update operation according to the matching result;
[0026] The division module is used to divide the text information to be processed into phrases according to the word segmentation algorithm when the length of the text information to be processed is greater than the maximum value of the character threshold interval, and determine the phrases whose length is greater than the minimum value of the character threshold interval as target phrases, match them with the existing vocabulary, and perform corresponding vocabulary update operations according to the matching results.
[0027] Optionally, the target phrase module is used to perform corresponding vocabulary update operations according to the matching results, including:
[0028] an adjusting unit, configured to adjust a first word frequency quantity corresponding to the target phrase if the word library is in the target phrase;
[0029] An updating unit is configured to update the target phrase into the vocabulary if the phrase does not exist in the vocabulary.
[0030] In order to solve the above problem, the present invention further discloses a keyword association device based on a word library, wherein the word library is generated by the word library generating device, and the device comprises:
[0031] An acquisition module is used to obtain keywords to be searched;
[0032] A retrieval module, used to obtain a target phrase if the keyword to be searched exists in the vocabulary;
[0033] An interception module, used for intercepting a character string of a set length after the keyword to be searched in the target phrase;
[0034] An assembling module, used for assembling the keyword to be searched with the character string of the set length to generate an associative phrase;
[0035] The output module is used to use the associative phrase as the search result of the keyword to be searched.
[0036] In order to solve the above problems, the present invention also discloses an electronic device, including a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method for generating a vocabulary library or the method for associating keywords based on the vocabulary library is implemented.
[0037] In order to solve the above problems, the present invention also discloses a computer-readable storage medium, which stores a computer program that implements the method for generating a vocabulary library or the method for associating keywords based on the vocabulary library when executed by a processor.
[0038] Compared with the prior art, the present invention has the following advantages:
[0039] The present invention determines whether the character length of the text information to be processed is within a set character threshold interval for text information to be processed that does not contain punctuation marks; when the character length of the text information to be processed is within the set character threshold interval, the text information to be processed is determined as a target phrase, matched with an existing vocabulary, and a corresponding vocabulary update operation is performed according to the matching result; when the length of the text information to be processed is greater than the maximum value of the character threshold interval, the text information to be processed is divided into phrases according to a word segmentation algorithm, and phrases with a length greater than the minimum value of the character threshold interval are determined as target phrases, matched with an existing vocabulary, and a corresponding vocabulary update operation is performed according to the matching result. Compared with the prior art, the vocabulary of the present invention stores phrases, and the vocabulary is continuously updated according to the length in the text information to be processed, thereby expanding the content stored in the vocabulary, thereby improving the efficiency and accuracy of information retrieval.
[0040] Of course, any product implementing the present invention does not necessarily need to achieve all of the advantages described above at the same time. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 It is a schematic diagram of the overall concept of generating and using a vocabulary library according to an embodiment of the present invention;
[0042] Figure 2 is a flow chart of a method for generating a vocabulary library according to an embodiment of the present invention;
[0043] Figure 3 is a flow chart of a method for generating a vocabulary library according to an embodiment of the present invention;
[0044] Figure 4 is a flow chart of a keyword association method based on a vocabulary according to an embodiment of the present invention;
[0045] Figure 5 is a structural diagram of a device for generating a vocabulary library according to an embodiment of the present invention;
[0046] Figure 6 It is a structural diagram of a keyword association device described in an embodiment of the present invention. DETAILED DESCRIPTION
[0047] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0048] See also Figure 1 , which shows a schematic diagram of the overall concept of a method for generating and using a vocabulary library according to an embodiment of the present invention, specifically including:
[0049] Data source configuration, word library generation and keywords to be searched.
[0050] The data source may include one or more data sources, each of which includes multiple text information. The data source is read at a set time every day, and then the generated word library is updated.
[0051] The text information in each data source is obtained, and then the text information is processed to obtain phrases and word frequencies corresponding to the phrases, and the phrases and word frequency data are stored in a database.
[0052] When the keyword to be searched is obtained, a target phrase is obtained by searching in the word library; a character string of a set length after the keyword to be searched in the query target phrase is intercepted; the keyword to be searched and the character string of the set length are assembled to generate an associative phrase; and the associative phrase is used as a search result of the keyword to be searched.
[0053] Based on the above concept, Figure 2 , which shows a flow chart of a method for generating a vocabulary library according to an embodiment of the present invention, specifically comprising:
[0054] Step 201: for text information to be processed that does not contain punctuation marks, determine whether the character length of the text information to be processed is within a set character threshold range.
[0055] In practical applications, for the text information to be processed that does not contain punctuation marks, the character length of the text information to be processed is obtained to determine whether the character length is within a set character threshold range.
[0056] Among them, the character threshold interval can be set by technical personnel in this field in any appropriate manner, such as by artificial experience, or by setting it based on the difference value of historical data. For example, the character threshold interval can be 5-30 or 8-35 or 10-30, or it can be other lengths, and the present invention is not limited to this.
[0057] Step 202: When the character length of the text information to be processed is within the set character threshold range, the text information to be processed is determined as a target phrase, matched with an existing word library, and a corresponding word library update operation is performed according to the matching result.
[0058] When the character length of the text information to be processed is within the set character threshold range, the text information to be processed is directly determined as a target phrase, the target phrase is matched with an existing word library, and a corresponding word library update operation is performed according to the matching result.
[0059] The updating operation of the vocabulary according to the matching result includes: if the vocabulary exists in the target phrase, adjusting the first word frequency number corresponding to the target phrase, that is, adding 1 to the first word frequency data of the target phrase; if the vocabulary does not exist in the target phrase, updating the target phrase to the vocabulary.
[0060] Step 203: When the length of the text information to be processed is greater than the maximum value of the character threshold interval, the text information to be processed is divided into phrases according to the word segmentation algorithm, and phrases with a length greater than the minimum value of the character threshold interval are determined as target phrases, matched with the existing vocabulary, and corresponding vocabulary update operations are performed according to the matching results.
[0061] When the length of the text information to be processed is greater than the maximum value of the character threshold interval, the text information to be processed will not be directly stored. Instead, the text information to be processed will be divided into phrases according to the word segmentation algorithm, and divided into multiple phrases. Among the multiple phrases, the phrase whose length is greater than the minimum value of the character threshold interval is determined as the target phrase, which is matched with the existing vocabulary, and the corresponding vocabulary update operation is performed according to the matching result.
[0062] In this embodiment, for the text information to be processed that does not contain punctuation marks, it is determined whether the character length of the text information to be processed is within the set character threshold interval; when the character length of the text information to be processed is within the set character threshold interval, the text information to be processed is determined as a target phrase, matched with an existing vocabulary, and a corresponding vocabulary update operation is performed according to the matching result; when the length of the text information to be processed is greater than the maximum value of the character threshold interval, the text information to be processed is divided into phrases according to the word segmentation algorithm, and phrases with a length greater than the minimum value of the character threshold interval are determined as target phrases, matched with an existing vocabulary, and a corresponding vocabulary update operation is performed according to the matching result. Compared with the prior art, the vocabulary of the present invention stores phrases, and continuously updates the vocabulary according to the length in the text information to be processed, thereby expanding the content stored in the vocabulary, thereby improving the efficiency and accuracy of information retrieval.
[0063] Based on the above concept, Figure 3 , which shows a flow chart of a method for generating a vocabulary library according to an embodiment of the present invention, specifically comprising:
[0064] Step 301: Obtain text information to be processed.
[0065] In practical applications, the text information to be processed can be obtained through one or more data sources.
[0066] Step 302: Determine whether the text information to be processed contains punctuation marks. If the text information to be processed contains punctuation marks, execute step 303; if the text information to be processed does not contain punctuation marks, execute step 306.
[0067] Step 303: Divide the text information to be processed into multiple phrases based on the punctuation marks.
[0068] Step 304: Obtain a first character length of the phrase. If the first character length is greater than the minimum value of the character threshold interval, determine the phrase whose first character length is greater than the minimum value of the character threshold interval as a target phrase.
[0069] Step 305: The target phrase is matched with the existing vocabulary, and a corresponding vocabulary update operation is performed according to the matching result.
[0070] In actual application, if the target phrase exists in the vocabulary, the first word frequency quantity corresponding to the target phrase is adjusted; if the target phrase does not exist in the vocabulary, the target phrase is stored in the vocabulary.
[0071] Step 306: Obtain the character length of the text information to be processed.
[0072] Step 307: Determine whether the character length is within the character threshold interval. If the character length is within the character threshold interval, execute step 308; if the character length is greater than the maximum value of the character threshold interval, execute step 309.
[0073] In practical applications, the character threshold interval can be set by a person skilled in the art in any appropriate manner, such as setting the character threshold interval to be greater than 5 and less than 30, or setting the character threshold interval to be greater than 8 and less than 35, or other methods, which are not limited by the present invention.
[0074] Step 308: Determine the text information to be processed as the target phrase, and then execute step 305, and the process ends.
[0075] Step 309: dividing the text information to be processed into phrases according to the word segmentation algorithm, and determining the phrases whose length is greater than the minimum value of the character threshold interval as target phrases. After executing step 305, the process ends.
[0076] The step of dividing the text information to be processed into phrases according to a word segmentation algorithm and determining a phrase having a length greater than a minimum value of the character threshold interval as a target phrase includes:
[0077] The text information to be processed is segmented using a preset N-gram model to obtain multiple phrases, the lengths of the multiple phrases are obtained, and a phrase whose length is greater than the minimum value of the character threshold interval is determined as a target phrase.
[0078] The preset N-gram model is obtained by training using phrases and text information stored in the vocabulary.
[0079] For example, the original text entered by the user is: Huizhou City Comprehensive Management Center, Huiyang District Comprehensive Management Center, received an incident that syzl suspicious persons violating regulations were found around the campus, and hoped to send someone to investigate the authenticity.
[0080] Using conventional word segmentation in the prior art, the associative participles obtained are: [Huizhou City, Comprehensive Administration, Center, Huiyang District, Comprehensive Administration, Center, received, event, campus, surrounding, discovered, syzl, violation, suspicious, personnel, hope, send, people to, investigate, authenticity].
[0081] By using the word segmentation algorithm of the present invention, the target phrase obtained is: [Huizhou City Comprehensive Management Center Huiyang District Comprehensive Management Center received an event around the campus and found that syzl was suspected of violating regulations. The personnel hoped to send someone to investigate and verify the authenticity].
[0082] In this embodiment, first, the word segmenter uses a preset N-gram model to segment the text information to be processed to obtain multiple phrases; wherein the preset N-gram model is obtained by training using phrases stored in a vocabulary, thereby improving the efficiency and accuracy of information retrieval.
[0083] Secondly, the word library is generated through an algorithm program, and the development cost of the word library is lower than that of third-party tools such as Solr, Elasticsearch, and Lucene in the existing technology.
[0084] Based on the above concept, Figure 4 , which shows a flowchart of a keyword association method based on a vocabulary according to an embodiment of the present invention, wherein the vocabulary is generated by the vocabulary generation method according to the above embodiment, specifically comprising:
[0085] Step 401: Obtain keywords to be searched.
[0086] Step 402: If the keyword to be searched exists in the vocabulary, the target phrase is obtained.
[0087] If the keyword to be searched exists in the vocabulary, the target phrase is directly obtained. In practical applications, the target phrases can be sorted according to the word frequency, and the target phrases with high word frequency are displayed first.
[0088] Step 403: intercepting a character string of a set length after the keyword to be searched in the target phrase.
[0089] In actual applications, after obtaining the target phrase of the keyword to be searched, the target will not be returned directly to the user. Instead, the keyword to be searched is used as a dividing point to intercept a character string of a set length after the keyword to be searched in the target phrase, and then the keyword to be searched and the character string of the set length are reassembled to generate an associative phrase. This is equivalent to not using the character string in front of the keyword to be searched as an associative phrase.
[0090] Among them, the set length of the character string can be set by a person skilled in the art in any appropriate manner, such as by manual experience, or by setting it based on the difference value of historical data. For example, the set length of the character string can be 5, 8, or 10, or other lengths, and the present invention is not limited to this.
[0091] Step 404: Assemble the keyword to be searched and the character string of the set length to generate an associative phrase.
[0092] Multiple target phrases can be obtained from the word library through the keyword to be searched, and then the multiple target phrases are intercepted to obtain multiple character strings of set lengths, and the keyword to be searched and the multiple character strings of set lengths are assembled to generate multiple associative phrases corresponding to the keyword to be searched.
[0093] Step 405: taking the associative phrase as the search result of the keyword to be searched.
[0094] In this embodiment, a keyword to be searched is obtained; if the keyword to be searched exists in a vocabulary, a target phrase is obtained; a character string of a set length after the keyword to be searched in the target phrase is intercepted; the keyword to be searched and the character string of the set length are assembled to generate an associative phrase; the associative phrase is used as a search result of the keyword to be searched, that is, the associative phrase is generated by reassembling the keyword to be searched and the target phrase in the vocabulary, thereby expanding the breadth and depth of association of the keyword to be searched, thereby improving the efficiency and accuracy of information retrieval.
[0095] It should be noted that, for the above method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should know that the present invention is not limited by the order of the actions described, because according to the present invention, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the present invention.
[0096] Based on the description of the above method embodiments, the present invention also provides corresponding device embodiments to implement the contents described in the above method embodiments.
[0097] Reference Figure 5 , which shows a structural diagram of a device for generating a vocabulary library according to an embodiment of the present invention, specifically comprising:
[0098] The determination module 501 is used to determine, for the text information to be processed that does not contain punctuation marks, whether the character length of the text information to be processed is within a set character threshold range.
[0099] The target phrase module 502 is used to determine the text information to be processed as a target phrase when the character length of the text information to be processed is within a set character threshold range, match it with an existing vocabulary, and perform a corresponding vocabulary update operation according to the matching result.
[0100] The division module 503 is used to divide the text information to be processed into phrases according to the word segmentation algorithm when the length of the text information to be processed is greater than the maximum value of the character threshold interval, and determine the phrases whose length is greater than the minimum value of the character threshold interval as target phrases, match them with the existing vocabulary, and perform corresponding vocabulary update operations based on the matching results.
[0101] Optionally, the target phrase module is used to perform corresponding vocabulary update operations according to the matching results, including:
[0102] an adjusting unit, configured to adjust a first word frequency quantity corresponding to the target phrase if the word library is in the target phrase;
[0103] An updating unit is configured to update the target phrase into the vocabulary if the phrase does not exist in the vocabulary.
[0104] Optionally, the device further comprises:
[0105] The determination module is further configured to divide the text information to be processed containing punctuation marks into a plurality of phrases based on the punctuation marks;
[0106] A matching module is used to obtain the first character length of the phrase. If the first character length is greater than the minimum value of the character threshold interval, the phrase whose first character length is greater than the minimum value of the character threshold interval is determined as a target phrase, matched with an existing vocabulary, and a corresponding vocabulary update operation is performed according to the matching result.
[0107] Optionally, the segmentation module is used to segment the text information to be processed into phrases according to the word segmentation algorithm, and determine the phrases whose length is greater than the minimum value of the character threshold interval as target phrases, including:
[0108] Using a preset N-gram model to segment the text information to be processed, obtaining a plurality of phrases, and determining a phrase whose length is greater than the minimum value of the character threshold interval as a target phrase;
[0109] The preset N-gram model is obtained by training using target phrases stored in the vocabulary.
[0110] Reference Figure 6 , which shows a keyword association device based on a word library according to an embodiment of the present invention, wherein the word library is generated by the word library generation device described in the above embodiment, and the device comprises:
[0111] The acquisition module 601 is used to acquire keywords to be searched.
[0112] The search module 602 is used to obtain a target phrase if the keyword to be searched exists in the vocabulary.
[0113] The interception module 603 is used to intercept the character string of a set length after the keyword to be searched in the target phrase.
[0114] The assembling module 604 is used to assemble the keyword to be searched with the character string of the set length to generate an associative phrase.
[0115] The output module 605 is used to use the associative phrase as the search result of the keyword to be searched.
[0116] In this embodiment, a keyword to be searched is obtained; if the keyword to be searched exists in a vocabulary, a target phrase is obtained; a character string of a set length after the keyword to be searched in the target phrase is intercepted; the keyword to be searched and the character string of the set length are assembled to generate an associative phrase; the associative phrase is used as a search result of the keyword to be searched, that is, an associative phrase is generated by reassembling the keyword to be searched and the search result in the vocabulary, thereby expanding the breadth and depth of association of the keyword to be searched, thereby improving the efficiency and accuracy of information retrieval.
[0117] As for the above-mentioned device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts may refer to the partial description of the method embodiment.
[0118] An embodiment of the present invention further provides an electronic device, including:
[0119] It includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the method for generating a vocabulary library or the method for associating keywords based on the vocabulary library is implemented.
[0120] The embodiment of the present invention also provides a computer-readable storage medium, which stores a computer program that implements the method for generating a vocabulary or the method for associating keywords based on the vocabulary when executed by a processor. Optionally, the computer-readable storage medium may be a non-temporary computer-readable storage medium, for example, the non-temporary computer-readable storage medium may be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0121] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0122] It is easy for a person skilled in the art to think that any combination of the above embodiments is feasible, so any combination of the above embodiments is an implementation scheme of the present invention, but due to space limitations, this specification will not be described in detail here. Although the preferred embodiments of the present invention have been described, once a person skilled in the art knows the basic creative concept, he can make other changes and modifications to these embodiments. Therefore, the attached claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.
[0123] The above is a detailed introduction to the method, device, equipment and medium for generating a vocabulary library provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A method for generating a vocabulary, characterized in that: include: For the text information to be processed that does not contain punctuation marks, determining whether the character length of the text information to be processed is within a set character threshold range; When the character length of the text information to be processed is within the set character threshold range, the text information to be processed is determined as a target phrase, matched with an existing word library, and a corresponding word library update operation is performed according to the matching result; When the length of the text information to be processed is greater than the maximum value of the character threshold interval, the text information to be processed is divided into phrases according to the word segmentation algorithm, and the phrases whose length is greater than the minimum value of the character threshold interval are determined as target phrases, matched with the existing vocabulary, and corresponding vocabulary update operations are performed according to the matching results.
2. The method according to claim 1, characterized in that The corresponding word library update operation is performed according to the matching result, including: If the word library is in the target phrase, adjusting the first word frequency quantity corresponding to the target phrase; If the phrase does not exist in the vocabulary, the target phrase is updated into the vocabulary.
3. The method according to claim 1, characterized in that The method further comprises: For the text information to be processed containing punctuation marks, dividing the text information to be processed into a plurality of phrases based on the punctuation marks; The first character length of the phrase is obtained. If the first character length is greater than the minimum value of the character threshold interval, the phrase whose first character length is greater than the minimum value of the character threshold interval is determined as the target phrase, matched with the existing vocabulary, and a corresponding vocabulary update operation is performed according to the matching result.
4. The method according to claim 1, characterized in that: The step of dividing the text information to be processed into phrases according to the word segmentation algorithm and determining the phrases whose length is greater than the minimum value of the character threshold interval as target phrases includes: Using a preset N-gram model to segment the text information to be processed, obtaining a plurality of phrases, and determining a phrase whose length is greater than the minimum value of the character threshold interval as a target phrase; The preset N-gram model is obtained by training using target phrases stored in the vocabulary.
5. A keyword association method based on a vocabulary, characterized in that: The word library is generated by using the word library generation method according to any one of claims 1 to 4, the method comprising: Get the keywords to be searched; If the keyword to be searched exists in the vocabulary, the target phrase is obtained; intercepting a character string of a set length after the keyword to be searched in the target phrase; Assembling the keyword to be searched with the character string of the set length to generate an associative phrase; The associative phrase is used as a search result of the keyword to be searched.
6. A device for generating a vocabulary library, characterized in that: include: A determination module, for determining, for the text information to be processed that does not contain punctuation marks, whether the character length of the text information to be processed is within a set character threshold range; A target phrase module is used to determine the text information to be processed as a target phrase when the character length of the text information to be processed is within a set character threshold interval, match it with an existing word library, and perform a corresponding word library update operation according to the matching result; The division module is used to divide the text information to be processed into phrases according to the word segmentation algorithm when the length of the text information to be processed is greater than the maximum value of the character threshold interval, and determine the phrases whose length is greater than the minimum value of the character threshold interval as target phrases, match them with the existing vocabulary, and perform corresponding vocabulary update operations according to the matching results.
7. The generating device according to claim 6, characterized in that The target phrase module is used to perform corresponding vocabulary update operations based on the matching results, including: an adjusting unit, configured to adjust a first word frequency quantity corresponding to the target phrase if the word library is in the target phrase; An updating unit is configured to update the target phrase into the vocabulary if the phrase does not exist in the vocabulary.
8. A keyword association device based on a vocabulary library, characterized in that: The word library is generated by a word library generating device according to any one of claims 6 to 7, wherein the device comprises: An acquisition module is used to obtain keywords to be searched; A retrieval module, used to obtain a target phrase if the keyword to be searched exists in the vocabulary; An interception module, used for intercepting a character string of a set length after the keyword to be searched in the target phrase; An assembling module, used for assembling the keyword to be searched with the character string of the set length to generate an associative phrase; The output module is used to use the associative phrase as the search result of the keyword to be searched.
9. An electronic 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 method for generating a vocabulary library described in any one of claims 1 to 4 or the method for associating keywords based on a vocabulary library described in claim 5 is implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method for generating a vocabulary library as described in any one of claims 1 to 4 or the method for associating keywords based on a vocabulary library as described in claim 5.
