Text segmentation method, device, electronic device and computer-readable storage medium

By using a preset sample vocabulary library and a word segmentation model in the word segmentation technology to perform multiple word segmentations and importance calculations on the text to be segmented, the problem of poor representativeness of the importance indicators in the existing technology is solved and more accurate word segmentation results are achieved.

CN114626375BActive Publication Date: 2024-09-27LINKAGE TECHNOLOGY (NANJING) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110432388.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-04-21
Publication Date
2024-09-27
Estimated Expiration
2041-04-21

AI Technical Summary

Technical Problem

In existing word segmentation technology, the importance indicators are poorly representative, resulting in unsatisfactory word segmentation results. It is difficult for users to accurately set word frequency, which affects the word segmentation effect.

Method used

Using the word segmentation level and word segmentation model based on the preset sample vocabulary library, the text to be segmented is segmented twice, the segmentable vocabulary is determined and its importance coefficient is calculated, and the segmentation result is determined through the word segmentation combination probability algorithm.

Benefits of technology

It improves the accuracy and effect of word segmentation, ensures that high-priority words are segmented first, ensures that all texts to be segmented are completely segmented, and calculates the importance coefficient of words to determine the word segmentation combination with the highest probability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114626375B
    Figure CN114626375B
Patent Text Reader

Abstract

The embodiment of the present application provides a text segmentation method, device, electronic device and computer-readable storage medium, which relates to the field of text processing technology. The method includes: obtaining a text to be segmented; performing a first segmentation based on the segmentation level of the vocabulary in the sample vocabulary library, performing a second segmentation based on a preset segmentation model, and determining the separable vocabulary of the text to be segmented and the importance coefficient of each separable vocabulary, and calculating the segmentation combination with the highest probability to determine the segmentation result of the text to be segmented. The embodiment of the present application ensures that the vocabulary with high priority will be segmented first and will not be covered by the first segmentation, and continues to segment through the model to ensure that all texts to be segmented can be segmented, and then by determining the vocabulary that can be segmented and calculating the importance coefficient of each vocabulary that can be segmented, a preset segmentation combination probability algorithm is used to calculate the segmentation combination with the highest probability, determine the segmentation result of the text to be segmented, and ensure the accuracy of the segmentation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of text processing, and in particular to a text segmentation method, device, electronic device and computer-readable storage medium. Background Art

[0002] Word segmentation is the process of recombining continuous character sequences into word sequences according to certain specifications. Although the Chinese character is the smallest combination of sound and meaning in form, in modern Chinese, the word has the function of expressing complete semantics, and most words are composed of multiple characters. Therefore, Chinese word segmentation has become a basic step in many Chinese NLP tasks.

[0003] In the existing word segmentation technology, the Jieba word segmentation tool is usually used to segment the text. However, the Jieba word segmentation tool generally considers the frequency of the words appearing in the text. However, relying solely on the word frequency as an indicator of word importance, it is difficult for users to understand the frequency of words that often appear before and after a certain word in the training corpus, resulting in users being unable to accurately set the word frequency and thus add their own prior knowledge, and thus failing to achieve ideal word segmentation results. The word frequency setting of the dictionary is very difficult.

[0004] It can be seen that the existing technology has the technical problem that the importance index is poorly representative, resulting in unsatisfactory word results, and needs to be improved. Summary of the invention

[0005] The purpose of this application is to solve at least one of the above-mentioned technical defects, especially the technical problem that the existing technology has poor representativeness of importance indicators, resulting in unsatisfactory word segmentation results.

[0006] According to one aspect of the present application, a text segmentation method is provided, the method comprising:

[0007] Get the text to be segmented;

[0008] The text to be segmented is segmented based on the segmentation level of each first sample vocabulary in a preset sample vocabulary library to obtain a first segmentation vocabulary, wherein the segmentation level is used to indicate the order in which each first sample vocabulary is segmented first in each sample text, and the first segmentation vocabulary is a vocabulary recorded in the sample vocabulary library;

[0009] Based on a preset word segmentation model, the remaining text in the to-be-segmented text except the first word segmentation vocabulary is segmented to obtain a second word segmentation vocabulary, wherein the second word segmentation vocabulary is a vocabulary not recorded in the sample vocabulary library;

[0010] Determine the separable vocabulary of the text to be segmented and the importance coefficient of the separable vocabulary based on the first segmentation vocabulary, the second segmentation vocabulary and the first sample vocabulary in the sample vocabulary library; wherein the separable vocabulary represents the vocabulary that can be segmented in the text to be segmented;

[0011] Based on the importance coefficient of each of the separable words, a preset word segmentation combination probability algorithm is used to calculate the probability of each word segmentation combination of the text to be segmented, and the word segmentation combination with the largest probability is determined as the segmentation result of the text to be segmented.

[0012] As a possible implementation manner of the present application, in this implementation manner, the word segmentation level includes a priority level, and the priority level is used to indicate the level at which each of the first sample words is prioritized for word segmentation;

[0013] The step of segmenting the text to be segmented based on the segmentation level of each first sample vocabulary in a preset sample vocabulary library to obtain a first segmentation vocabulary includes:

[0014] Dividing the to-be-segmented text into a plurality of to-be-confirmed segmented words, wherein the to-be-confirmed segmented words are words that appear in both the to-be-segmented text and the first sample words;

[0015] When at least one character in the to-be-segmented text is divided into at least two to-be-confirmed segmentation words, if the number of words with the highest priority in the at least two to-be-confirmed segmentation words is 1, the word with the highest priority is determined as the first segmentation word.

[0016] As a possible implementation manner of the present application, in this implementation manner, the word segmentation level includes a position level, and the level of the position level is proportional to the position before and after each of the first sample words appears in the sample text; when a word in the to-be-segmented text is divided into at least two to-be-confirmed word segmentation words, it also includes:

[0017] If the number of words with the highest priority among the at least two to-be-confirmed word segmentation words is greater than 1, the word with the highest position level among the words with the highest priority is determined as the first word segmentation word.

[0018] As a possible implementation manner of the present application, in this implementation manner, determining the segmentable vocabulary of the to-be-segmented text based on the first segmentation vocabulary, the second segmentation vocabulary, and the first sample vocabulary in the sample vocabulary library includes:

[0019] The first segmentation vocabulary, the second segmentation vocabulary, and vocabulary that appear simultaneously in the text to be segmented and the first sample vocabulary are determined as segmentable vocabulary of the text to be segmented.

[0020] As a possible implementation manner of the present application, in this implementation manner, after performing a first segmentation on the to-be-segmented text based on the position level and the priority level of each of the sample words in the sample vocabulary library to obtain a first segmentation word, the method further includes:

[0021] Determine a preset prefix vocabulary library, wherein the prefix vocabulary library records the second sample vocabulary and the first letter of each of the second sample vocabulary;

[0022] According to the first characters of each of the second sample words, the remaining text in the to-be-segmented text except the first segmented words is segmented by using the maximum forward matching method to obtain a third segmented word;

[0023] The determining of the segmentable vocabulary of the to-be-segmented text based on the first segmentation vocabulary, the second segmentation vocabulary and the first sample vocabulary in the sample vocabulary library comprises:

[0024] The segmentable vocabulary of the text to be segmented is determined based on the first segmentation vocabulary, the second segmentation vocabulary, the third segmentation vocabulary and the first sample vocabulary in the sample vocabulary library.

[0025] As a possible implementation manner of the present application, in this implementation manner, determining the segmentable vocabulary of the to-be-segmented text based on the first segmentation vocabulary, the second segmentation vocabulary, the third segmentation vocabulary, and the first sample vocabulary in the sample vocabulary library includes:

[0026] The first segmentation vocabulary, the second segmentation vocabulary, the third segmentation vocabulary, and the vocabulary that appear simultaneously in the first sample vocabulary and the text to be segmented are determined as the segmentable vocabulary of the text to be segmented.

[0027] As a possible implementation of the present application, in this implementation, determining the importance coefficient of each of the separable words includes:

[0028] Determining a position importance parameter of the separable word vocabulary based on the position level of the separable word vocabulary in each sample text;

[0029] Determine the importance accumulation coefficient of different separable word words in each sample text based on the position level of each different separable word word in each sample text and the frequency of occurrence of each different separable word word in each sample text;

[0030] The importance coefficient of each separable word is determined based on the position importance parameter of the separable word vocabulary and the importance accumulation coefficients of different separable word vocabulary in each sample text.

[0031] According to another aspect of the present application, a text segmentation device is provided, the device comprising:

[0032] A text acquisition module is used to acquire the text to be segmented;

[0033] A first word segmentation module is used to segment the text to be segmented based on the word segmentation level of each first sample word in a preset sample word library to obtain a first word segmentation word, wherein the word segmentation level is used to indicate the order in which each first sample word is preferentially segmented in each sample text, and the first word segmentation word is a word recorded in the sample word library;

[0034] A second word segmentation module is used to segment the remaining text in the to-be-segmented text except the first word segmentation vocabulary based on a preset word segmentation model to obtain a second word segmentation vocabulary, wherein the second word segmentation vocabulary is a vocabulary not recorded in the sample vocabulary library;

[0035] An importance calculation module, used for determining the separable words of the text to be segmented and the importance coefficients of the separable words based on the first segmentation words, the second segmentation words and the first sample words in the sample word library; wherein the separable words represent all the words that can be segmented in the text to be segmented;

[0036] The word segmentation combination module is used to calculate the probability of each word segmentation combination of the text to be segmented based on the importance coefficient of each separable word, using a preset word segmentation combination probability algorithm, and determine the word segmentation combination with the largest probability as the word segmentation result of the text to be segmented.

[0037] According to another aspect of the present application, an electronic device is provided, the electronic device comprising:

[0038] one or more processors;

[0039] Memory;

[0040] One or more application programs, wherein the one or more application programs are stored in the memory and are configured to be executed by the one or more processors, and the one or more programs are configured to: execute the above-mentioned text segmentation method.

[0041] According to another aspect of the present application, a computer-readable storage medium is provided, which stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set are loaded by the processor and execute the above-mentioned text segmentation method.

[0042] The embodiment of the present application performs the first segmentation on the text to be segmented through the preset segmentation level of the first sample vocabulary, ensuring that the vocabulary with high priority will be segmented first and will not be overwritten, and continues to segment the text that was not segmented during the first segmentation through the model to ensure that all the text to be segmented can be segmented, and then determines all the words that can be segmented in the text to be segmented through the two segmentation results and the sample vocabulary in the preset vocabulary library, and calculates the importance coefficient of each word that can be segmented, and according to the importance coefficient, uses the preset segmentation combination probability algorithm to calculate the segmentation combination with the highest probability, determines the segmentation result of the text to be segmented, and ensures the accuracy of the segmentation. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in describing the embodiments of the present application are briefly introduced below.

[0044] Figure 1 A flowchart of a text segmentation method provided in an embodiment of the present application;

[0045] Figure 2 A flowchart of a method for determining a first word segmentation vocabulary provided in an embodiment of the present application;

[0046] Figure 3 A schematic diagram of a flow chart of a method for calculating importance coefficient provided in an embodiment of the present application;

[0047] Figure 4 A structural diagram of a text segmentation device provided in an embodiment of the present application;

[0048] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.

[0049] The above and other features, advantages and aspects of the embodiments of the present application will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale. DETAILED DESCRIPTION

[0050] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, and cannot be interpreted as limiting the present application.

[0051] It will be understood by those skilled in the art that, unless expressly stated, the singular forms "one", "said", and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present application refers to the presence of the features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof. It should be understood that when we refer to an element as being "connected" or "coupled" to another element, it may be directly connected or coupled to the other element, or there may be an intermediate element. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The term "and / or" used herein includes all or any unit and all combinations of one or more associated listed items.

[0052] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below in conjunction with the accompanying drawings.

[0053] In the existing word segmentation technology, the Jieba word segmentation tool is usually used to segment the text. However, the Jieba word segmentation tool generally considers the frequency of the words in the text. However, it only relies on the word frequency as the word importance index. It is difficult for users to understand the frequency of words that often appear before and after a certain word in the training corpus, resulting in users being unable to accurately set the word frequency and add their own prior knowledge, and thus unable to achieve ideal word segmentation results. The word frequency setting of the dictionary is very difficult. The existing technology has a technical problem that the importance index is poorly representative, resulting in unsatisfactory word results, which needs to be improved.

[0054] The text segmentation method, device, electronic device and computer-readable storage medium provided in this application are intended to solve the above technical problems in the prior art.

[0055] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0056] The present application provides a text segmentation method, such as Figure 1 As shown, the method includes:

[0057] Step S101, obtaining the text to be segmented.

[0058] In the embodiment of the present application, the text to be segmented refers to the text that needs to be segmented. Optionally, it can be a text converted from voice information, such as a customer service call record text, or it can be a direct text text.

[0059] Step S102, segmenting the text to be segmented based on the segmentation level of each first sample vocabulary in a preset sample vocabulary library to obtain first segmentation vocabulary, wherein the segmentation level is used to indicate the order in which each first sample vocabulary is prioritized in each sample text, and the first segmentation vocabulary is a vocabulary recorded in the sample vocabulary library.

[0060] In an embodiment of the present application, a sample vocabulary library refers to a pre-set vocabulary library. For texts in different fields, the sample vocabulary libraries may be different. For example, for texts such as customer service call records, the corresponding sample vocabulary library may be a sample vocabulary library of customer service calls. The sample vocabulary library includes a first sample vocabulary and a segmentation level of the first sample vocabulary. The segmentation level of a first sample vocabulary refers to the order in which the first sample vocabulary is prioritized in the sample text in which it is located. For example, for a first sample vocabulary, its segmentation level in the sample text is level one. When the first sample vocabulary appears in the text to be segmented, the first sample vocabulary will be the first to be segmented.

[0061] For the embodiments of the present application, for the convenience of explanation, taking a specific embodiment as an example, for the text to be segmented, such as "How many users disassembled in Beijing in the first half of the year", by matching in the sample vocabulary library, the words that can be matched include: "disassembly users", "number of users", "first half of the year", "Beijing area", "disassembly", and "how many", among which the segmentation level of "disassembly users" is level two, and the segmentation level of "number of users" is level one. Then, the segmentation result for "number of disassembly users" will give priority to separating the word "number of users", and then form the word "disassembly", then the segmentation result of "number of disassembly users" is disassembly / number of users. Optionally, the segmentation results of other texts in the text to be segmented are "first half of the year", "Beijing area", and "how many", then the result of the text to be segmented after the first segmentation is: first half of the year / Beijing area / disassembly / number of users / how many; correspondingly, the first segmentation vocabulary generated is "first half of the year", "Beijing area", "disassembly", "number of users", and "how many". Of course, the sample vocabulary library corresponding to each text to be segmented may be different. The first sample vocabulary in the sample vocabulary library can be constructed based on the prior knowledge of business personnel in the field of the corresponding text to be segmented, thereby ensuring the accuracy of the first segmentation result.

[0062] Step S103, segmenting the remaining text in the to-be-segmented text except the first segmentation vocabulary based on a preset segmentation model to obtain a second segmentation vocabulary, wherein the second segmentation vocabulary is a vocabulary not recorded in the sample vocabulary library.

[0063] In the embodiment of the present application, after the first segmentation of the text to be segmented in the aforementioned step S102, some characters or words in the text to be segmented may not be divided into words, resulting in incomplete segmentation, that is, there are words in the text to be segmented that do not exist in the sample vocabulary library, and the text to be segmented needs to be segmented again. In the embodiment of the present application, a preset segmentation model (such as a hidden Markov model) is used to segment the remaining text in the text to be segmented except the first segmentation vocabulary to obtain a second segmentation vocabulary.

[0064] For the embodiment of the present application, for the convenience of explanation, taking a specific embodiment as an example, for the text to be segmented "I am talking about the voice usage under the condition of using the local network", after the first segmentation in step S102, the first segmentation vocabulary obtained includes: "I" "I am talking about" "using" "under the condition" "of", wherein the first segmentation vocabulary does not involve "local network" and "voice usage" in the original text to be segmented, then for this part of the text, the preset segmentation model can be used to segment "local network" and "voice usage" to obtain the second segmentation vocabulary, for example, the second segmentation vocabulary can be "local network" and "voice usage", of course, it is not directly to simply divide all the remaining texts in the text to be segmented except the first segmentation vocabulary into words, but to divide according to the model, for example, in a certain embodiment, the remaining text in the text to be segmented except the first segmentation vocabulary is "WeChat voice" and "call time is 300 minutes", then the second segmentation vocabulary that may be obtained is "WeChat voice", "call time" "is" "300 minutes". It can be understood that the second segmentation vocabulary should be a vocabulary that is not counted in the sample vocabulary library.

[0065] Step S104, determining the separable vocabulary of the text to be segmented and the importance coefficient of each of the separable vocabulary based on the first segmentation vocabulary, the second segmentation vocabulary and the first sample vocabulary in the sample vocabulary library; wherein the separable vocabulary represents the vocabulary that can be segmented in the text to be segmented.

[0066] In the embodiment of the present application, the separable vocabulary refers to all the vocabulary that may be decomposed from a text to be segmented. After the two segmentation operations of step S102 and step S103, the separable vocabulary of the text to be segmented is determined based on the obtained first segmentation vocabulary and the second segmentation vocabulary and the first sample vocabulary in the sample vocabulary library, wherein all the vocabulary in the first segmentation vocabulary, all the vocabulary in the second segmentation vocabulary and the vocabulary in the sample vocabulary library that appear in the text to be segmented can be directly determined as the separable vocabulary of the text to be segmented.

[0067] For the embodiments of the present application, for the convenience of explanation, a specific embodiment is taken as an example. For a text to be segmented, such as "How many users in Beijing reported disassembling in the first half of the year", after the segmentation operation of the above two steps, the first segmentation vocabulary obtained is "first half of the year", "Beijing area", "number of disassembling users", "how many", and the second sample vocabulary obtained is "reported", and the vocabulary existing in the sample vocabulary library includes "first half of the year", "Beijing", "area", "Beijing area", "disassembling", "number of users", "number of disassembling users", "how many", then based on the first segmentation vocabulary, the second segmentation vocabulary and the vocabulary in the sample vocabulary library, the separable vocabulary of the text to be segmented can be determined as: "first half of the year", "Beijing", "area", "Beijing area", "reported", "disassembling", "number of users", "number of disassembling users", "how many". After determining the separable vocabulary of the text to be segmented, the importance coefficients of the separable vocabulary are calculated respectively.

[0068] Step S105, based on the importance coefficient of each of the separable words, a preset segmentation combination probability algorithm is used to calculate the probability of each segmentation combination of the text to be segmented, and the segmentation combination with the largest probability is determined as the segmentation result of the text to be segmented.

[0069] In the embodiment of the present application, after determining the separable words of the text to be segmented and calculating the importance coefficient of each separable word, each separable word is combined to form a plurality of word segmentation combinations, and a preset word segmentation combination probability algorithm is used to calculate the probability of each word segmentation combination, and the word segmentation combination with the largest probability is determined as the word segmentation result of the text to be segmented. Among them, the words in each word segmentation combination should be combined to fully include the content of the text to be segmented and the content of the text to be analyzed cannot be repeated.

[0070] For the embodiments of the present application, for the convenience of explanation, taking the aforementioned specific embodiments as an example, the segmentable words of the text to be segmented are: "first half of the year", "Beijing", "region", "Beijing region", "reported", "disassembly", "number of users", "number of disassembly users", "how much"; among them, the segmentation combination one is first half of the year / Beijing / region / reported / number of disassembly users / how much, and the probability of the segmentation combination calculated by the preset method is 30%, and the segmentation combination two is first half of the year / Beijing region / reported / disassembly / number of users / how much, and its probability is 70%, then the segmentation combination two with a larger probability is used as the segmentation result of the text to be segmented. Of course, a text to be segmented may have more than two possible segmentation combinations, and the probability of each segmentation combination needs to be calculated separately, and the segmentation combination with the largest probability is used as the segmentation result of the text to be segmented.

[0071] The embodiment of the present application performs the first segmentation on the text to be segmented through the preset segmentation level of the first sample vocabulary, ensuring that the vocabulary with high priority will be segmented first and will not be overwritten, and continues to segment the text that was not segmented during the first segmentation through the model to ensure that all the text to be segmented can be segmented, and then determines all the words that can be segmented in the text to be segmented through the two segmentation results and the sample vocabulary in the preset vocabulary library, and calculates the importance coefficient of each word that can be segmented, and according to the importance coefficient, uses the preset segmentation combination probability algorithm to calculate the segmentation combination with the highest probability, determines the segmentation result of the text to be segmented, and ensures the accuracy of the segmentation.

[0072] The present application embodiment provides a possible implementation method, in which the word segmentation level includes a priority level, and the priority level is used to indicate the level at which each of the first sample words is prioritized for word segmentation; Figure 2 As shown, the word segmentation of the to-be-segmented text based on the word segmentation level of each first sample vocabulary in the preset sample vocabulary library to obtain the first word segmentation vocabulary includes:

[0073] Step S201: divide the text to be segmented into a plurality of segmentation words to be confirmed, wherein the segmentation words to be confirmed are words that appear in both the text to be segmented and the first sample words.

[0074] In an embodiment of the present application, the segmentation level of the first sample vocabulary includes a priority level, which refers to the level at which the first sample vocabulary is prioritized for segmentation in the sample text. For example, the first sample vocabulary can be divided into four levels, level one, level two, level three, and level four, wherein level one indicates that when the first sample vocabulary appears in the text to be segmented, it will be first divided into words, and level four indicates that when the first sample vocabulary appears in the text to be segmented, it will be last divided into words. In an embodiment of the present application, the priority level of the first sample vocabulary can be determined based on the prior knowledge of the field staff. For example, in the customer service field, the priority level of each first sample vocabulary can be determined based on the work experience of the customer service staff.

[0075] For the embodiments of the present application, when segmenting the text to be segmented, the text to be segmented can be first divided into multiple words to be confirmed. For example, by matching in the sample vocabulary library, the first sample vocabulary appearing in the text to be segmented is determined, and all the first sample vocabulary appearing in the text to be segmented are determined as words to be confirmed. For example, for the text to be segmented "How many users disassembled machines in Beijing in the first half of the year", the divided words to be confirmed include: first half of the year, Beijing area, Beijing, area, number of disassembled users, disassembly, number of users, how many.

[0076] Step S202: when at least one character in the to-be-segmented text is divided into at least two to-be-confirmed segmented words, if the number of words with the highest priority in the at least two to-be-confirmed segmented words is 1, the word with the highest priority is determined as the first segmented word.

[0077] In an embodiment of the present application, when the text to be segmented is segmented, if at least one character in the text to be segmented is divided into at least two segmentation vocabularies to be confirmed, only the vocabulary with the highest priority among the at least two segmentation vocabularies to be confirmed is determined as the first segmentation vocabulary. For example, for the text to be segmented "How many users of disassembly in Beijing in the first half of the year are there", the words to be confirmed that can be divided include: first half of the year, Beijing area, Beijing, area, number of disassembly users, disassembly, number of users, how many. Among them, the two words Beijing area and Beijing, area are repeated, and the two words disassembly users and disassembly, number of users are repeated. Among them, the priority of the word Beijing area is one level, and the priority of the two words Beijing, area are both two levels, then Beijing area should be used as the first segmentation vocabulary. Similarly, the priority of the word number of disassembly users is one level, and the priority of the two words disassembly and number of users is two levels, then the number of disassembly users should be used as the first segmentation vocabulary.

[0078] In an embodiment of the present application, by using the priority level of the first sample vocabulary, when at least one character in the text to be segmented is divided into at least two segmented vocabulary to be confirmed, only the vocabulary with the highest priority level among the at least two segmented vocabulary to be confirmed is determined as the first segmented vocabulary, wherein the priority level is determined based on the prior knowledge of the staff in the field, thereby ensuring the relevance of the segmentation result to the field and making the segmentation more accurate.

[0079] The embodiment of the present application provides a possible implementation mode, in which the word segmentation level includes a position level, and the level of the position level is proportional to the position of each of the first sample words in the sample text; when a word in the to-be-segmented text is divided into at least two to-be-confirmed word segmentation words, it also includes:

[0080] If the number of words with the highest priority among the at least two to-be-confirmed word segmentation words is greater than 1, only the word with the highest position level among the words with the highest priority is determined as the first word segmentation word.

[0081] In the embodiment of the present application, the segmentation level of the first sample vocabulary also includes a position level, wherein the level of the position level is proportional to the position of the first sample vocabulary in the sample text. For a first sample vocabulary, its position level is calculated according to formula (1):

[0082]

[0083] Among them, Position represents the position level of the first sample vocabulary, and the value range is 1, 2, 3, 4, 5, representing the five position stages of the first sample vocabulary in the sample text, namely front, relatively front, middle, relatively back, and back. p represents the position where the first sample vocabulary appears for the first time in the sample text; n represents the number of single words in the sample text.

[0084] For the embodiments of the present application, for the convenience of explanation, a specific embodiment is taken as an example, for the to-be-confirmed words "number of disassembled users" and "number of users" in the text to be segmented "how many users disassembled machines in Beijing in the first half of the year", where the priority levels of the number of disassembled users and the number of users are both level two, while the position level of the number of disassembled users is level three, and the position level of the number of users is level two, then when the priority levels are the same, "number of users" will be divided into words according to the position level, and the final segmentation result is first half of the year / Beijing area / disassembly / number of users / is / how many.

[0085] The embodiment of the present application takes into account the position level of the first sample vocabulary. This is because for the text to be segmented, especially the text to be segmented in the customer service field, the closer the position of the vocabulary in the text is, the greater the importance of the vocabulary may be. By adding the position level factor, the accuracy of the segmentation result is further guaranteed.

[0086] The present application embodiment provides a possible implementation mode, in which the determining of the segmentable vocabulary of the to-be-segmented text based on the first segmentation vocabulary, the second segmentation vocabulary and the first sample vocabulary in the sample vocabulary library includes:

[0087] The first segmentation vocabulary, the second segmentation vocabulary, and the vocabulary that appear simultaneously in the text to be segmented and the first sample vocabulary are determined as the separable vocabulary of the text to be segmented.

[0088] In an embodiment of the present application, separable vocabulary refers to all the vocabulary that may be decomposed from a text to be segmented, and the separable vocabulary of the text to be segmented is determined based on the obtained first segmentation vocabulary and the second segmentation vocabulary and the first sample vocabulary in the sample vocabulary library, wherein all the vocabulary in the first segmentation vocabulary, all the vocabulary in the second segmentation vocabulary and the vocabulary in the sample vocabulary library that appear in the text to be segmented can be directly determined as the separable vocabulary of the text to be segmented.

[0089] For the embodiments of the present application, for the convenience of explanation, taking a specific embodiment as an example, for a text to be segmented, such as "How many users reported for disassembly in Beijing in the first half of the year", after the segmentation operation of the above two steps, the first segmentation vocabulary obtained is "first half of the year", "Beijing area", "number of disassembly users", "how many", and the second sample vocabulary obtained is "reported", and the vocabulary existing in the sample vocabulary library includes "first half of the year", "Beijing", "area", "Beijing area", "disassembly", "number of users", "number of disassembly users", "how many", then based on the first segmentation vocabulary, the second segmentation vocabulary and the vocabulary in the sample vocabulary library, it can be determined that the separable vocabulary of the text to be segmented is: "first half of the year", "Beijing", "area", "Beijing area", "reported", "disassembly", "number of users", "number of disassembly users", "how many".

[0090] In the embodiment of the present application, by determining the first segmentation vocabulary, the second segmentation vocabulary and the vocabulary that appears in both the first sample vocabulary and the text to be segmented as the separable vocabulary of the text to be segmented, it is ensured that no separable vocabulary is missed when determining the separable vocabulary of the text to be segmented, thereby ensuring the accuracy of the segmentation.

[0091] The present application embodiment provides a possible implementation mode, in which the first segmentation of the to-be-segmented text based on the position level and the priority level of each of the sample words in the sample vocabulary library to obtain the first segmentation vocabulary further includes:

[0092] Determine a preset prefix vocabulary library, wherein the prefix vocabulary library records the second sample vocabulary and the first letter of each of the second sample vocabulary;

[0093] According to the first characters of each of the second sample words, the remaining text in the to-be-segmented text except the first segmented words is segmented by using the maximum forward matching method to obtain a third segmented word;

[0094] The determining of the segmentable vocabulary of the to-be-segmented text based on the first segmentation vocabulary, the second segmentation vocabulary and the first sample vocabulary in the sample vocabulary library comprises:

[0095] The segmentable vocabulary of the text to be segmented is determined based on the first segmentation vocabulary, the second segmentation vocabulary, the third segmentation vocabulary and the first sample vocabulary in the sample vocabulary library.

[0096] In an embodiment of the present application, for the text to be segmented, after the first segmentation, the remaining text in the text to be segmented except the first segmentation vocabulary can also be segmented according to a preset prefix vocabulary library, wherein the preset prefix vocabulary library records the second sample vocabulary and the first word of each second sample vocabulary. When segmenting according to the second sample vocabulary, the maximum forward matching method can be used for segmentation. For the convenience of explanation, a specific embodiment is taken as an example. For example, for the text to be segmented, after the first segmentation, the remaining text includes "the number of users who disassemble the machine". When the maximum forward matching method is used, the first word of the remaining text is matched with the first word of the second sample vocabulary. Then, the remaining text can be matched with the vocabulary including "the number of users who disassemble the machine" and "disassembly". The longest word is used as the third segmentation vocabulary, that is, "the number of users who disassemble the machine" is used as the third segmentation vocabulary. After determining the third segmentation vocabulary, when determining the separable vocabulary of the text to be segmented, it is necessary to determine the separable vocabulary of the text to be segmented based on the first segmentation vocabulary, the second segmentation vocabulary, the third segmentation vocabulary and the first sample vocabulary in the sample vocabulary library.

[0097] The embodiment of the present application performs word segmentation on the remaining text except the first word segmentation vocabulary in the text to be segmented based on the prefix vocabulary library, thereby increasing the possibility of word segmentation and further ensuring the accuracy of word segmentation.

[0098] The present application embodiment provides a possible implementation mode, in which the determining of the segmentable vocabulary of the to-be-segmented text based on the first segmentation vocabulary, the second segmentation vocabulary, the third segmentation vocabulary and the first sample vocabulary in the sample vocabulary library includes:

[0099] The first segmentation vocabulary, the second segmentation vocabulary, the third segmentation vocabulary, and the vocabulary that appears in both the first sample vocabulary and the text to be segmented are determined as segmentable vocabulary of the text to be segmented.

[0100] In an embodiment of the present application, separable vocabulary refers to all the vocabulary that may be decomposed from a text to be segmented, and the separable vocabulary of the text to be segmented is determined based on the obtained first segmentation vocabulary and the second segmentation vocabulary and the first sample vocabulary in the sample vocabulary library, wherein all the words in the first segmentation vocabulary, all the words in the second segmentation vocabulary, all the words in the third segmentation vocabulary and the words in the sample vocabulary library that appear in the text to be segmented can be directly determined as the separable vocabulary of the text to be segmented.

[0101] For the embodiments of the present application, for the convenience of explanation, taking a specific embodiment as an example, for a text to be segmented, such as "How many users in Beijing reported for disassembly in the first half of the year", after the segmentation operation of the above two steps, the first segmentation vocabulary obtained is "first half of the year", "Beijing area", "number of disassembly users", "how many", and the second sample vocabulary obtained is "reported", and the vocabulary existing in the sample vocabulary library includes "first half of the year", "Beijing", "area", "Beijing area", "disassembly", "number of users", "number of disassembly users", "how many", and the third segmentation vocabulary obtained is "number of disassembly users". Based on the first segmentation vocabulary, the second segmentation vocabulary, the third segmentation vocabulary and the vocabulary in the sample vocabulary library, it can be determined that the segmentable vocabulary of the text to be segmented is: "first half of the year", "Beijing", "area", "Beijing area", "reported", "disassembly", "number of users", "number of disassembly users", "how many".

[0102] In the embodiment of the present application, by determining the first participle vocabulary, the second participle vocabulary, the third participle vocabulary and the vocabulary that appears in both the first sample vocabulary and the text to be segmented as the separable vocabulary of the text to be segmented, it is ensured that no separable vocabulary of the text to be segmented is omitted when determining the separable vocabulary of the text to be segmented, thereby ensuring the accuracy of the word segmentation.

[0103] The present application embodiment provides a possible implementation method, in which, Figure 3 As shown, the determining of the importance coefficient of each separable word vocabulary includes:

[0104] Step S301, determining a position importance parameter of the separable word based on the position level of the separable word in each sample text;

[0105] Step S302, determining the importance accumulation coefficient of different separable words in each sample text based on the position level of each different separable word in each sample text and the frequency of occurrence of each different separable word in each sample text;

[0106] Step S303: determining the importance coefficient of each separable word based on the position importance parameter of the separable word and the importance accumulation coefficients of different separable words in each sample text.

[0107] In the embodiment of the present application, the importance coefficient of the separable word vocabulary is determined according to the position level and the occurrence frequency of each separable word vocabulary in each sample text, wherein, for the separable word vocabulary x, the position importance parameter of the separable word vocabulary is determined based on the position level of the separable word vocabulary in each sample text, which can be obtained by the calculation method of formula (2):

[0108]

[0109] Among them, t position is the position importance coefficient of the separable word x, k i Represents the position level of the separable word x in the i-th sample text.

[0110] When determining the importance accumulation coefficient of different separable words in each sample text based on the position level of each different separable word in each sample text and the frequency of occurrence of each different separable word in each sample text, it can be calculated according to formula (3):

[0111]

[0112] Among them, w i represents the frequency of the separable word x in the i-th sample text, W i Represents the number of words in the i-th sample text, normalization i represents the cumulative importance coefficient of different words in the i-th sample text, which is treated as a normalized term. M represents the number of different words in the i-th sample text, and k m represents the position level of the mth different word in the i-th sample text, w m Represents the frequency of the mth different word in the ith sample text.

[0113] When determining the importance coefficient of each separable word based on the position importance parameter of the separable word and the importance accumulation coefficient of different separable words in each sample text, formula (4) can be used for calculation:

[0114]

[0115] Among them, importance word=x represents the importance coefficient of word x, and N represents the number of sample texts in the sample vocabulary library.

[0116] The embodiment of the present application uses the position level as a reference factor for the separable word lexical importance coefficient. The higher the position level, the greater the weight and the higher the word segmentation priority, thereby comprehensively measuring the lexical importance.

[0117] The embodiment of the present application performs the first segmentation on the text to be segmented through the preset segmentation level of the first sample vocabulary, ensuring that the vocabulary with high priority will be segmented first and will not be overwritten, and continues to segment the text that was not segmented during the first segmentation through the model to ensure that all the text to be segmented can be segmented, and then determines all the words that can be segmented in the text to be segmented through the two segmentation results and the sample vocabulary in the preset vocabulary library, and calculates the importance coefficient of each word that can be segmented, and according to the importance coefficient, uses the preset segmentation combination probability algorithm to calculate the segmentation combination with the highest probability, determines the segmentation result of the text to be segmented, and ensures the accuracy of the segmentation.

[0118] The present application embodiment provides a text segmentation device, such as Figure 4 As shown, the text segmentation device 40 may include: a text acquisition module 401, a first segmentation module 402, a second segmentation module 403, an importance calculation module 404, and a segmentation combination module 405, wherein:

[0119] The text acquisition module 401 is used to acquire the text to be segmented;

[0120] A first word segmentation module 402 is used to segment the text to be segmented based on the word segmentation level of each first sample word in a preset sample word library to obtain a first word segmentation word, wherein the word segmentation level is used to indicate the order in which each first sample word is preferentially segmented in each sample text, and the first word segmentation word is a word recorded in the sample word library;

[0121] A second word segmentation module 403 is used to segment the remaining text in the to-be-segmented text except the first word segmentation vocabulary based on a preset word segmentation model to obtain a second word segmentation vocabulary, wherein the second word segmentation vocabulary is a vocabulary not recorded in the sample vocabulary library;

[0122] The importance calculation module 404 is used to determine the separable words of the text to be segmented and the importance coefficients of the separable words based on the first segmentation words, the second segmentation words and the first sample words in the sample word library; wherein the separable words represent all the words that can be segmented in the text to be segmented;

[0123] The word segmentation combination module 405 is used to calculate the probability of each word segmentation combination of the text to be segmented based on the importance coefficient of each of the separable words, using a preset word segmentation combination probability algorithm, and determine the word segmentation combination with the largest probability as the word segmentation result of the text to be segmented.

[0124] Optionally, the word segmentation level includes a priority level, and the priority level is used to indicate the level at which each of the first sample words is prioritized for word segmentation; when the first word segmentation module 402 performs word segmentation on the to-be-segmented text based on the word segmentation level of each of the first sample words in the preset sample word library to obtain the first word segmentation words, it can be used to:

[0125] Dividing the to-be-segmented text into a plurality of to-be-confirmed segmented words, wherein the to-be-confirmed segmented words are words that appear in both the to-be-segmented text and the first sample words;

[0126] When at least one character in the to-be-segmented text is divided into at least two to-be-confirmed segmentation words, if the number of words with the highest priority in the at least two to-be-confirmed segmentation words is 1, the word with the highest priority is determined as the first segmentation word.

[0127] Optionally, the word segmentation level includes a position level, and the level of the position level is proportional to the position of each of the first sample words in the sample text. When a word in the to-be-segmented text is divided into at least two to-be-confirmed word segmentation words, the first word segmentation module 402 may also be used to:

[0128] If the number of words with the highest priority among the at least two to-be-confirmed word segmentation words is greater than 1, the word with the highest position level among the words with the highest priority is determined as the first word segmentation word.

[0129] Optionally, when determining the separable words of the text to be segmented based on the first segmentation words, the second segmentation words and the first sample words in the sample word library, the importance calculation module 404 may be used to:

[0130] The first segmentation vocabulary, the second segmentation vocabulary, and vocabulary that appear simultaneously in the text to be segmented and the first sample vocabulary are determined as segmentable vocabulary of the text to be segmented.

[0131] Optionally, after the first word segmentation module 402 performs the first word segmentation on the to-be-segmented text based on the position level and the priority level of each sample word in the sample word library to obtain the first word segmentation vocabulary, it can also be used to:

[0132] Determine a preset prefix vocabulary library, wherein the prefix vocabulary library records the second sample vocabulary and the first letter of each of the second sample vocabulary;

[0133] According to the first characters of each of the second sample words, the remaining text in the to-be-segmented text except the first segmented words is segmented by using the maximum forward matching method to obtain a third segmented word;

[0134] When determining the segmentable vocabulary of the to-be-segmented text based on the first segmentation vocabulary, the second segmentation vocabulary and the first sample vocabulary in the sample vocabulary library, the importance calculation module 404 can be used to:

[0135] Based on the first segmentation vocabulary, the second segmentation vocabulary, the third segmentation vocabulary, and the first sample vocabulary in the sample vocabulary library, the segmentable vocabulary of the text to be segmented is determined.

[0136] Optionally, when the importance calculation module 404 determines the segmentable vocabulary of the to-be-segmented text based on the first segmentation vocabulary, the second segmentation vocabulary, the third segmentation vocabulary and the first sample vocabulary in the sample vocabulary library, it can be used to:

[0137] The first segmentation vocabulary, the second segmentation vocabulary, the third segmentation vocabulary, and the vocabulary that appears in both the first sample vocabulary and the text to be segmented are determined as segmentable vocabulary of the text to be segmented.

[0138] Optionally, when determining the importance coefficient of each separable word, the importance calculation module 404 may be used to:

[0139] Determining a position importance parameter of the separable word vocabulary based on the position level of the separable word vocabulary in each sample text;

[0140] Determine the importance accumulation coefficient of different separable word words in each sample text based on the position level of each different separable word word in each sample text and the frequency of occurrence of each different separable word word in each sample text;

[0141] The importance coefficient of each separable word is determined based on the position importance parameter of the separable word vocabulary and the importance accumulation coefficients of different separable word vocabulary in each sample text.

[0142] The text segmentation device of the embodiment of the present application can execute the text segmentation method shown in the aforementioned embodiment of the present application. The implementation principle is similar and will not be repeated here.

[0143] The embodiment of the present application performs the first segmentation on the text to be segmented through the preset segmentation level of the first sample vocabulary, ensuring that the vocabulary with high priority will be segmented first and will not be overwritten, and continues to segment the text that was not segmented during the first segmentation through the model to ensure that all the text to be segmented can be segmented, and then determines all the words that can be segmented in the text to be segmented through the two segmentation results and the sample vocabulary in the preset vocabulary library, and calculates the importance coefficient of each word that can be segmented, and according to the importance coefficient, uses the preset segmentation combination probability algorithm to calculate the segmentation combination with the highest probability, determines the segmentation result of the text to be segmented, and ensures the accuracy of the segmentation.

[0144] An electronic device is provided in an embodiment of the present application, and the electronic device includes: a memory and a processor; at least one program, which is stored in the memory and is used to be executed by the processor. Compared with the prior art, the following can be achieved: the embodiment of the present application performs a first segmentation on a text to be segmented by using a preset segmentation level of a first sample vocabulary, ensuring that vocabulary with a high priority will be segmented first and will not be overwritten, and continues to segment text that has not been segmented in the first segmentation through a model to ensure that all texts to be segmented can be segmented, and then determines all words that can be segmented in the text to be segmented through the results of the two segmentations and sample vocabulary in a preset vocabulary library, and calculates the importance coefficient of each word that can be segmented, and according to the importance coefficient, uses a preset segmentation combination probability algorithm to calculate the segmentation combination with the highest probability, determines the segmentation result of the text to be segmented, and ensures the accuracy of the segmentation.

[0145] In an alternative embodiment, an electronic device is provided, such as Figure 5 As shown, Figure 5 The electronic device 4000 shown includes: a processor 4001 and a memory 4003. The processor 4001 and the memory 4003 are connected, such as through a bus 4002. Optionally, the electronic device 4000 may also include a transceiver 4004, which may be used for data interaction between the electronic device and other electronic devices, such as data transmission and / or data reception. It should be noted that in actual applications, the transceiver 4004 is not limited to one, and the structure of the electronic device 4000 does not constitute a limitation on the embodiments of the present application.

[0146] Processor 4001 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. It may implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of this application. Processor 4001 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.

[0147] The bus 4002 may include a path to transmit information between the above components. The bus 4002 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus 4002 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 5 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0148] The memory 4003 can be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disk storage, optical disk storage (including compressed optical disk, laser disk, optical disk, digital versatile disk, Blu-ray disk, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited to this.

[0149] The memory 4003 is used to store the application code (computer program) for executing the solution of the present application, and the execution is controlled by the processor 4001. The processor 4001 is used to execute the application code stored in the memory 4003 to implement the contents shown in the above method embodiment.

[0150] Among them, electronic devices include but are not limited to: computers, tablets, car computers, mobile phones, smart watches, smart wearable devices, etc.

[0151] An embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer-readable storage medium is run on a computer, the computer can execute the corresponding content in the aforementioned method embodiment.

[0152] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

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

[0154] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0155] In the context of the present application, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0156] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.

[0157] The above is only a partial implementation method of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A text segmentation method, characterized in that: include: Get the text to be segmented; The text to be segmented is segmented based on the segmentation level of each first sample vocabulary in a preset sample vocabulary library to obtain first segmentation vocabulary, wherein the segmentation level is used to indicate the order in which each first sample vocabulary is preferentially segmented in each sample text, and the first segmentation vocabulary is a vocabulary recorded in the sample vocabulary library; the segmentation level includes a position level, and the position level is proportional to the position of each first sample vocabulary in the sample text; Based on a preset word segmentation model, the remaining text in the to-be-segmented text except the first word segmentation vocabulary is segmented to obtain a second word segmentation vocabulary, wherein the second word segmentation vocabulary is a vocabulary not recorded in the sample vocabulary library; Determine the separable vocabulary of the text to be segmented and the importance coefficient of the separable vocabulary based on the first segmentation vocabulary, the second segmentation vocabulary and the first sample vocabulary in the sample vocabulary library; wherein the separable vocabulary represents the vocabulary that can be segmented in the text to be segmented; Based on the importance coefficient of each of the separable words, a preset word segmentation combination probability algorithm is used to calculate the probability of each word segmentation combination of the text to be segmented, and the word segmentation combination with the greatest probability is determined as the word segmentation result of the text to be segmented; Determining the importance coefficient of each of the separable words includes: Determining a position importance parameter of the separable word vocabulary based on the position level of the separable word vocabulary in each sample text; Determine the importance accumulation coefficient of different separable word words in each sample text based on the position level of each different separable word word in each sample text and the frequency of occurrence of each different separable word word in each sample text; Determining the importance coefficient of each separable word based on the position importance parameter of the separable word and the importance accumulation coefficients of different separable words in each sample text; The determining of the segmentable vocabulary of the text to be segmented based on the first segmentation vocabulary, the second segmentation vocabulary and the first sample vocabulary in the sample vocabulary library includes: The first segmentation vocabulary, the second segmentation vocabulary, and vocabulary that appear simultaneously in the text to be segmented and the first sample vocabulary are determined as segmentable vocabulary of the text to be segmented.

2. The text segmentation method according to claim 1, characterized in that: The word segmentation level includes a priority level, and the priority level is used to indicate the level at which each of the first sample words is prioritized for word segmentation; The step of segmenting the text to be segmented based on the segmentation level of each first sample vocabulary in a preset sample vocabulary library to obtain a first segmentation vocabulary includes: Dividing the to-be-segmented text into a plurality of to-be-confirmed segmented words, wherein the to-be-confirmed segmented words are words that appear in both the to-be-segmented text and the first sample words; When at least one character in the to-be-segmented text is divided into at least two to-be-confirmed segmentation words, if the number of words with the highest priority in the at least two to-be-confirmed segmentation words is 1, the word with the highest priority is determined as the first segmentation word.

3. The text segmentation method according to claim 2, characterized in that: When at least one character in the to-be-segmented text is divided into at least two to-be-confirmed segmented words, the method further comprises: If the number of words with the highest priority among the at least two to-be-confirmed word segmentation words is greater than 1, the word with the highest position level among the words with the highest priority is determined as the first word segmentation word.

4. The text segmentation method according to claim 2, characterized in that: After segmenting the text to be segmented based on the segmentation level of each of the sample words in the sample vocabulary library to obtain the first segmentation word, the method further includes: Determine a preset prefix vocabulary library, wherein the prefix vocabulary library records the second sample vocabulary and the first letter of each of the second sample vocabulary; According to the first characters of each of the second sample words, the remaining text in the to-be-segmented text except the first segmented words is segmented by using the maximum forward matching method to obtain a third segmented word; The determining of the segmentable vocabulary of the to-be-segmented text based on the first segmentation vocabulary, the second segmentation vocabulary and the first sample vocabulary in the sample vocabulary library comprises: The segmentable vocabulary of the text to be segmented is determined based on the first segmentation vocabulary, the second segmentation vocabulary, the third segmentation vocabulary and the first sample vocabulary in the sample vocabulary library.

5. The text segmentation method according to claim 4, characterized in that: The determining of the segmentable vocabulary of the to-be-segmented text based on the first segmentation vocabulary, the second segmentation vocabulary, the third segmentation vocabulary and the first sample vocabulary in the sample vocabulary library comprises: The first segmentation vocabulary, the second segmentation vocabulary, the third segmentation vocabulary, and the vocabulary that appear simultaneously in the first sample vocabulary and the text to be segmented are determined as the segmentable vocabulary of the text to be segmented.

6. A text segmentation device, characterized in that: include: A text acquisition module is used to acquire the text to be segmented; A first word segmentation module is used to segment the text to be segmented based on the word segmentation level of each first sample word in a preset sample word library to obtain a first word segmentation word, wherein the word segmentation level is used to indicate the order in which each first sample word is preferentially segmented in each sample text, and the first word segmentation word is a word recorded in the sample word library; the word segmentation level includes a position level, and the position level is proportional to the position of each first sample word in the sample text; A second word segmentation module is used to segment the remaining text in the to-be-segmented text except the first word segmentation vocabulary based on a preset word segmentation model to obtain a second word segmentation vocabulary, wherein the second word segmentation vocabulary is a vocabulary not recorded in the sample vocabulary library; An importance calculation module, used for determining the separable words of the text to be segmented and the importance coefficients of the separable words based on the first segmentation words, the second segmentation words and the first sample words in the sample word library; wherein the separable words represent all the words that can be segmented in the text to be segmented; A word segmentation combination module is used to calculate the probability of each word segmentation combination of the text to be segmented based on the importance coefficient of each of the separable words, using a preset word segmentation combination probability algorithm, and determine the word segmentation combination with the greatest probability as the word segmentation result of the text to be segmented; The importance calculation module determines the importance coefficient of each of the separable words, including: Determining a position importance parameter of the separable word vocabulary based on the position level of the separable word vocabulary in each sample text; Determine the importance accumulation coefficient of different separable word words in each sample text based on the position level of each different separable word word in each sample text and the frequency of occurrence of each different separable word word in each sample text; Determining the importance coefficient of each separable word based on the position importance parameter of the separable word and the importance accumulation coefficients of different separable words in each sample text; The importance calculation module determines the separable vocabulary of the text to be segmented, including: The first segmentation vocabulary, the second segmentation vocabulary, and vocabulary that appear simultaneously in the text to be segmented and the first sample vocabulary are determined as segmentable vocabulary of the text to be segmented.

7. An electronic device, characterized in that: The electronic device comprises: one or more processors; 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: execute the text segmentation method according to any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that: The storage medium stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the text segmentation method as described in any one of claims 1 to 5.