A method for determining identification text and related equipment
By judging whether the identification text to be determined meets the position requirements of the vocabulary in the target object description text at the same time, the problem of low identification text matching in the existing technology is solved, and more accurate identification text determination is achieved.
Patent Information
- Application Number
- CN202111166029.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-30
- Publication Date
- 2025-09-09
- Estimated Expiration
- 2041-09-30
AI Technical Summary
Existing technologies make it difficult to set high-quality and highly matching identification text for target objects, resulting in inaccurate retrieval and recommendation.
By determining whether the identification text to be determined satisfies the first condition and the second condition at the same time, the first condition is that the vocabulary is located in the description text of the target object, and the second condition is that the position group of the vocabulary in the description text meets the target position requirements, including the order relationship of the vocabulary in the position group and the number of spacing characters.
Accurately determine the identification text with a high degree of matching with the target object, improving the accuracy of retrieval and recommendation.
Smart Images

Figure CN113868378B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a method for determining a marked text and related devices. Background Art
[0002] With the rapid development of internet technology, it's often necessary to set relevant identifiers for target objects to facilitate user retrieval and recommend interesting objects. For example, if the target object is a video, identifiers such as "action," "science fiction," and "adventure" can be set for the video. If the target object is a book, identifiers such as "history," "published in 2017," and "approximately 29,080 words" can be set for the book. If the target object is a person, identifiers such as "Han ethnicity," "Libra," "Oscar Best Actor," and "actor" can be set for the person.
[0003] In order to enable the target object to be accurately retrieved and recommended, how to set high-quality and highly matching identification text for the target object has become one of the key issues that technicians in this field focus on. Summary of the Invention
[0004] In view of the above problems, the present disclosure provides a method for determining a marked text and related devices that overcome the above problems or at least partially solve the above problems. The technical solutions are as follows:
[0005] A method for determining a marked text, comprising:
[0006] Obtaining a to-be-determined identification text corresponding to the target object, wherein the to-be-determined identification text includes at least one word;
[0007] Determining whether the identification text to be determined satisfies both a first condition and a second condition; if so, determining that the identification text to be determined is the identification text of the target object; and if not, determining that the identification text to be determined is not the identification text of the target object;
[0008] The first condition is that all the words in the to-be-determined identification text are located in the description text of the target object;
[0009] The second condition is that at least one position group of each of the words in the to-be-determined identification text in the description text meets the target position requirement, wherein the position group consists of one position of each of the words in the to-be-determined identification text in the description text.
[0010] Optionally, the target position requirement is that the order of the positions of each of the words in the position group is consistent with the order of arrangement in the to-be-determined identification text, and / or the number of other characters between the positions of each of the words in the position group does not exceed a preset number.
[0011] Optionally, the number of other characters between the positions of the words in the position group does not exceed a preset number, including:
[0012] When the preset number is 0, the number of other characters between the positions of each of the words in the position group is 0, or, when the preset number is an integer greater than 0, the number of other characters between the positions of each of the words in the position group is an integer greater than 0.
[0013] Optionally, the process of determining whether the to-be-determined identification text satisfies the first condition includes:
[0014] For each of the words in the to-be-determined identification text, searching for the word in the description text, and if the word is found, obtaining each position of the word in the description text; if the word is not found, determining that the to-be-determined identification text does not meet the first condition;
[0015] When the positions of the words in the to-be-determined identification text in the description text are obtained, it is determined that the to-be-determined identification text meets the first condition.
[0016] Optionally, the process of determining whether the to-be-determined identification text satisfies the second condition includes:
[0017] For any of the words in the to-be-determined identification text, sequentially: combining the positions of the word in the description text into a position sequence corresponding to the word;
[0018] By using the position sequence corresponding to each of the words, it is determined that at least one position group of each of the words in the to-be-determined identification text in the description text meets the target position requirement.
[0019] Optionally, if the target position requirement is that the order of the positions of the words in the position group is consistent with the order of arrangement in the to-be-determined identification text and the number of other characters between the positions of the words in the position group is 0, and the first identification text includes N+1 words, then using the position sequence corresponding to each word to determine whether at least one position group of each word in the to-be-determined identification text meets the target position requirement includes:
[0020] Determine the first word of the to-be-determined identification text as the current word;
[0021] Determine a position in the position sequence corresponding to the current word that has not been subjected to a judgment process as the current position;
[0022] The judgment process includes: determining whether N positions after the current position are respectively and sequentially stored in the position sequence corresponding to the N words after the current word, the N words being all words after the current word in the to-be-determined identified text;
[0023] If yes, it is determined that at least one position group of each of the words in the to-be-determined identification text in the description text meets the target position requirement.
[0024] Optionally, if the target position requirement is that the order of the positions of the words in the position group is consistent with the order of arrangement in the to-be-determined identification text and the number of other characters between the positions of the words in the position group is 0, then the process of determining whether the to-be-determined identification text satisfies both the first condition and the second condition includes:
[0025] Searching for a first word of the identification text to be determined in the description text, and if found, obtaining each first position of the first word in the description text and combining the first positions into a first position sequence corresponding to the first word;
[0026] Determine the second word of the to-be-determined identification text as the current word, wherein the second word is arranged consecutively with the first word and follows the first word in the to-be-determined identification text;
[0027] Searching for the current word in the description text, and if the current word is found, obtaining each second position of the current word in the description text and combining the second positions into a second position sequence corresponding to the current word; determining whether there is at least one valid position in the second position sequence based on the first position sequence and the second position sequence, wherein the valid position is a second position in the description text that is arranged continuously with and after any first position in the first position sequence;
[0028] If there is at least one valid position in the second position sequence, determining the at least one valid position as a valid position sequence;
[0029] Take the word in the to-be-determined identification text that is arranged continuously with the second word and after the second word as the current word, take the valid position sequence as the first position sequence, and take the second position in the valid position sequence as the first position, and return to execute the step of searching for the current word in the description text until it is determined that there is at least one valid position in the position sequence of the last word in the to-be-determined identification text, and determine that the first identification text satisfies both the first condition and the second condition.
[0030] A device for determining an identification text includes: a unit for obtaining an identification text to be determined and a unit for determining an identification text.
[0031] The to-be-determined identification text obtaining unit is configured to obtain the to-be-determined identification text corresponding to the target object, wherein the to-be-determined identification text includes at least one word;
[0032] The identification text determination unit is configured to determine whether the identification text to be determined satisfies both a first condition and a second condition; if both conditions are satisfied, the identification text to be determined is determined to be the identification text of the target object; if both conditions are not satisfied, the identification text to be determined is determined not to be the identification text of the target object;
[0033] The first condition is that all the words in the to-be-determined identification text are located in the description text of the target object;
[0034] The second condition is that at least one position group of each of the words in the to-be-determined identification text in the description text meets the target position requirement, wherein the position group consists of one position of each of the words in the to-be-determined identification text in the description text.
[0035] A computer-readable storage medium stores a program thereon, wherein when the program is executed by a processor, the method for determining identification text as described in any one of the above items is implemented.
[0036] An electronic device comprising at least one processor, and at least one memory and bus connected to the processor; wherein the processor and the memory communicate with each other via the bus; and the processor is configured to call program instructions in the memory to execute a method for determining identification text as described in any one of the above items.
[0037] By means of the above technical solution, the present disclosure provides a method for determining an identification text and related equipment, which can obtain the identification text to be determined corresponding to the target object, wherein the identification text to be determined includes at least one word; determine whether the identification text to be determined satisfies the first condition and the second condition at the same time, if both conditions are satisfied, determine that the identification text to be determined is the identification text of the target object, if both conditions are not satisfied, determine that the identification text to be determined is not the identification text of the target object; the first condition is: each word in the identification text to be determined is located in the description text of the target object; the second condition is: at least one position group of each word in the identification text to be determined in the description text meets the target position requirement, wherein the position group consists of a position of each word in the identification text to be determined in the description text. The present disclosure determines that the identification text to be determined is the identification text of the target object by the position of each word in the identification text to be determined in the description text, when the first condition and the second condition are satisfied, and accurately judges the identification text with a high degree of match with the target object.
[0038] The above description is only an overview of the technical solution of the present disclosure. In order to more clearly understand the technical means of the present disclosure, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present disclosure more obvious and easy to understand, the specific implementation methods of the present disclosure are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Various other advantages and benefits will become apparent to those skilled in the art upon reading the detailed description of the preferred embodiment below. The accompanying drawings are for illustration purposes only and are not to be considered as limiting the present disclosure. The same reference symbols are used throughout the drawings to represent the same components. In the drawings:
[0040] Figure 1 A schematic diagram showing an embodiment of the method for determining identification text provided by the present disclosure;
[0041] Figure 2 A schematic diagram showing a process of determining whether a to-be-identified text satisfies a first condition provided by the present disclosure is shown;
[0042] Figure 3 A schematic diagram showing a process of determining whether a to-be-identified text satisfies a second condition provided by the present disclosure is shown;
[0043] Figure 4 A schematic diagram showing a specific implementation of step S21 in the process of determining whether the identified text to be determined meets the second condition provided by the present disclosure;
[0044] Figure 5 A schematic diagram showing a specific implementation of step S200 of the identification text determination method provided by the present disclosure;
[0045] Figure 6 A schematic structural diagram of an identification text determination device provided by the present disclosure is shown;
[0046] Figure 7 A schematic structural diagram of an electronic device provided by the present disclosure is shown. DETAILED DESCRIPTION
[0047] Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0048] like Figure 1 As shown, an embodiment of the method for determining a marking text provided by the present disclosure may include:
[0049] S100: Obtain a to-be-determined identification text corresponding to a target object, where the to-be-determined identification text includes at least one word.
[0050] The target object may be a thing being targeted. For example, the target object may be a person, an object, an image, audio, or video. The to-be-identified text may be text related to the target object.
[0051] Optionally, the embodiment of the present disclosure can crawl a to-be-determined identification text group related to the target object through a web crawler technology, wherein the to-be-determined identification text group includes at least one to-be-determined identification text. Specifically, the embodiment of the present disclosure can segment each to-be-determined identification text in the to-be-determined identification text group, and obtain the part of speech of each to-be-determined identification text. Among them, each word included in the to-be-determined identification text is the smallest unit that cannot be further segmented. The embodiment of the present disclosure can determine the frequency of occurrence of each to-be-determined identification text in the to-be-determined identification text group. For example: a to-be-determined identification text that appears no less than 12 times in the to-be-determined identification text group is determined as a high-frequency text, a to-be-determined identification text that appears less than 12 times and greater than 2 in the to-be-determined identification text group is determined as a medium-frequency text, and a to-be-determined identification text that appears no more than 2 times in the to-be-determined identification text group is determined as a low-frequency text.
[0052] Furthermore, the embodiment of the present disclosure can filter part of the to-be-determined identification text in the to-be-determined identification text group based at least on the part of speech of the to-be-determined identification text and the frequency of occurrence in the to-be-determined identification text group. Specifically, the embodiment of the present disclosure can filter out low-frequency texts with a number of occurrences equal to 1 in the to-be-determined identification text group. The embodiment of the present disclosure can filter out medium-frequency texts with the part of speech of "personal name" and "place name" in the identification text group. The embodiment of the present disclosure can filter out to-be-determined identification texts with a label length greater than 5 characters in medium-frequency texts and low-frequency texts. It can be understood that the embodiment of the present disclosure can obtain the to-be-determined identification text corresponding to the target object in the filtered to-be-determined identification text group. By filtering the to-be-determined identification text group, the embodiment of the present disclosure can improve the efficiency and accuracy of determining the identification text corresponding to the target object from the filtered to-be-determined identification text group.
[0053] S200: Determine whether the identification text to be determined satisfies both the first condition and the second condition. If so, execute step S210; if not, execute step S220.
[0054] S210: Determine that the identification text to be determined is the identification text of the target object.
[0055] S220: Determine whether the identification text to be determined is not the identification text of the target object.
[0056] The first condition is that all words in the text to be identified are located in the description text of the target object.
[0057] The description text of the target object can be a text that summarizes the target object. Optionally, the description text of the target object can be an encyclopedia description text corresponding to the target object. For example, when the target object corresponds to a movie, the description text of the target object can be a plot introduction of the movie.
[0058] Optionally, embodiments of the present disclosure may pre-construct a corresponding knowledge graph for the target object, wherein the node corresponding to the target object in the knowledge graph is connected to the node corresponding to the description text of the target object via an edge. It is understood that embodiments of the present disclosure may obtain the description text corresponding to the target object based on the knowledge graph corresponding to the target object.
[0059] It is understandable that the embodiment of the present disclosure can perform word segmentation on the description text corresponding to the target object. Optionally, the word segmentation method used by the embodiment of the present disclosure to perform word segmentation on the description text corresponding to the target object can be the same as the word segmentation method used to perform word segmentation on each to-be-determined identification text in the to-be-determined identification text group. The embodiment of the present disclosure uses the same word segmentation method to segment the description text and the to-be-determined identification text, which can more accurately determine the position of the vocabulary in the to-be-determined identification text on the description text, which is beneficial to the subsequent determination of the identification text of the target object.
[0060] Optional, such as Figure 2 As shown, the process of determining whether the to-be-identified text satisfies the first condition provided by the present disclosure may include:
[0061] S10. For each word in the identified text, search for the word in the description text. If the word is found, execute step S11; if not, execute step S12.
[0062] S11. Obtain the positions of the word in the description text.
[0063] S12: Determine whether the identification text to be determined satisfies the first condition.
[0064] S13. When the positions of the words in the to-be-determined identification text in the description text are obtained, it is determined that the to-be-determined identification text meets the first condition.
[0065] The embodiment of the present disclosure searches for the positions of the words in the to-be-determined identification text in the description text, and uses the position of the words in the to-be-determined identification text in the description text as a basis for determining whether the to-be-determined identification text meets the first condition.
[0066] The second condition is that at least one position group of each word in the to-be-determined identification text in the description text meets the target position requirement, wherein the position group consists of one position of each word in the to-be-determined identification text in the description text.
[0067] To facilitate understanding of the position group, an example is given here: assuming that the text to be identified is "adapted from a novel", the text to be identified may include three words: "based on", "novel" and "adapted". Assume that the result of word segmentation of the description text of the target object is " / ABC / film / based on / the / novel / of / the / same / name / , / after / the / adaptation / the / ABC / film / won / the / EFG / award / in / 2010 / year / .", wherein the slash indicates the position of the word segmentation. The position of each word in the description text is represented by consecutive numbers from small to large, so the position of the word "ABC" can be represented as 0, the position of the word "film" can be represented as 1, the position of the word "based on" can be represented as 2, and so on. From this, we can see that the position of "based on" in the to-be-determined identification text in the description text is 2, the position of "novel" in the to-be-determined identification text in the description text is 4, and the positions of "adaptation" in the to-be-determined identification text in the description text are 5 and 7. Then, the position group of the to-be-determined identification text in the description text can include 16 permutations and combinations including "2-4-5" and "2-4-7".
[0068] Optionally, the target position requirement may be that the order of positions of the words in the position group is consistent with the order of arrangement in the identification text to be determined, and / or the number of other characters between the positions of the words in the position group does not exceed a preset number.
[0069] Optionally, when the preset number is 0, the number of other characters between the positions of each word in the position group is 0, or, when the preset number is an integer greater than 0, the number of other characters between the positions of each word in the position group is an integer greater than 0.
[0070] It can be understood that, when the number of other characters between the positions of the words in the position group is 0, the positions of the words in the position group are arranged continuously.
[0071] The embodiment of the present disclosure makes specific settings for the target position requirements, so that the identification text of the target object determined according to the target position requirements more accurately meets actual needs.
[0072] Optional, such as Figure 3 As shown, the process of determining whether the to-be-determined identification text satisfies the second condition provided by the embodiment of the present disclosure may include:
[0073] S20 , sequentially treating any word in the determined identification text: combining each position of the word in the description text into a position sequence corresponding to the word.
[0074] S21 , using the position sequence corresponding to each word, determining whether at least one position group of each word in the to-be-determined identification text in the description text meets the target position requirement.
[0075] For ease of understanding, an example is given here to illustrate: if the identification text to be determined is "superhero", the identification text to be determined includes the word "super" and the word "hero". Assuming that the positions of "super" in the description text are 1 and 7, the position sequence corresponding to the word "super" can be "1; 7". Assuming that the positions of "hero" in the description text are 2 and 9, the position sequence corresponding to the word "hero" can be "2; 9". It can be seen from the "1" in the position sequence corresponding to the word "super" and the "2" in the position sequence corresponding to the word "hero" that the number of other characters between the positions of each word in a position group in the identification text to be determined is 0, and the arrangement order of the two words "super" and "hero" in the position group in the identification text to be determined and the description text is consistent. It can be seen from the "7" in the position sequence corresponding to the word "super" and the "9" in the position sequence corresponding to the word "hero" that there is a position group in the to-be-determined identification text in which the arrangement order of the two words "super" and "hero" in the to-be-determined identification text and the description text is consistent, and the number of other characters between the two words "super" and "hero" in this position group is 1.
[0076] The embodiment of the present disclosure combines the positions of each word in the to-be-determined identification text in the description text into position sequences, and then arranges and combines the positional relationships between the positions of the position sequences corresponding to each word to obtain at least one position group, so that each position relationship is expressed in units of position groups, which helps to quickly determine whether each position group meets the target position requirements and improves the accuracy of determining the identification text.
[0077] Optionally, if the target position requirement is that the order of the positions of the words in the position group is consistent with the order of the positions in the to-be-determined mark text and the number of other characters between the positions of the words in the position group is 0, the to-be-determined mark text includes N+1 words, based on Figure 3 The process shown, as Figure 4 As shown, the specific implementation of step S21 in the process of determining whether the identified text to be determined meets the second condition provided by the present disclosure may include:
[0078] S21a: Determine the first word of the to-be-determined identification text as the current word.
[0079] It is understood that the first word of the to-be-determined identification text may be the word at the beginning of the text. For example, if the to-be-determined identification text is " / according to / novel / adaptation / ", then the word "according to" is the first word of the to-be-determined identification text. If the to-be-determined identification text is " / super / hero / ", then the word "super" is the first word of the to-be-determined identification text.
[0080] S21b. Determine a position in the position sequence corresponding to the current word that has not been judged as the current position, wherein the judgment process includes: determining whether N positions after the current position are respectively and sequentially stored in the position sequence corresponding to the N words after the current word, and the N words are all words located after the current word in the to-be-determined identified text; if so, execute step S21c.
[0081] S21c: Determine whether at least one position group of each word in the to-be-determined identification text in the description text meets the target position requirement.
[0082] For ease of understanding, an example is given here to illustrate: if the target position requirement is that the order of the positions of each word in the position group is consistent with the order of arrangement in the to-be-determined identification text and the number of other characters between the positions of each word in the position group is 0, assuming that the to-be-determined identification text is " / according to / novel / adapted / ", if the description text is " / according to / novel / adapted / of / ABC / film / won / the / EFG award / ", the word "according to" is used as the current word, and the position "0" in the position sequence corresponding to the current word that has not been judged and processed is determined as the current position, then it is determined whether positions "1" and "2" are respectively stored in the position sequence corresponding to the word "novel" and the position sequence corresponding to the word "adaptation". Since the position sequence corresponding to the word "novel" includes position "1" and the position sequence corresponding to the word "adaptation" includes position "2", it can be seen that each word in the to-be-determined identification text has a position group in the description text that meets the target position requirement.
[0083] It can be understood that if it is determined that the N positions after the current position are not stored in sequence in the position sequence corresponding to the N words after the current word, it is determined that there is no position group in the description text that meets the target position requirements for each word in the identification text to be determined.
[0084] For ease of understanding, an example is provided here. If the target position requirement is that the order of the positions of the words in the position group is consistent with the order of arrangement in the to-be-determined identification text, and the number of other characters between the positions of the words in the position group is 0, assuming that the to-be-determined identification text is " / according to / novel / adapted / ", and the description text is " / ABC / film / according to / novel / adapted / of / the / same / name / , / the / adapted / ABC / film / won / the / EFG / award / in / 2010 / .", the word "according to" is used as the current word, and the position "2" in the position sequence corresponding to the current word that has not been judged is determined as the current position. Then, it is determined whether positions "3" and "4" are stored in the position sequence corresponding to the word "novel" and the position sequence corresponding to the word "adapted", respectively. Since the position sequence corresponding to the word "novel" includes "4" but does not include "3", and the position sequence corresponding to the word "adapted" is "5; 7" but does not include "4", it can be known that the words in the to-be-determined identification text do not have a position group that meets the target position requirement in the description text.
[0085] The embodiment of the present disclosure judges and processes each position in the position sequence corresponding to the first word of the identification text to be determined, and determines whether the consecutive positions after the position in the description text exist in the position sequence corresponding to all words after the first word respectively. This can quickly determine the position group of each word in the identification text to be determined that meets the target position requirement in the description text, thereby improving the processing efficiency of determining the identification text of the target object.
[0086] Optionally, if the target position requires that the order of the positions of the words in the position group is consistent with the order of the positions in the to-be-determined markup text and the number of other characters between the positions of the words in the position group is 0, based on Figure 1 The identification text determination method shown in Figure 5 As shown, a specific implementation of step S200 of the method for determining the identification text provided by the present disclosure may include:
[0087] S201. Search the description text for the first word of the identification text to be determined. If the word is found, execute step S202.
[0088] It is understandable that if the first word is not found, it is determined that the to-be-determined identification text does not simultaneously satisfy the first condition and the second condition, and the process of determining whether the to-be-determined identification text simultaneously satisfies the first condition and the second condition is terminated.
[0089] S202: Obtain each first position of the first word in the description text and combine the first positions into a first position sequence corresponding to the first word.
[0090] S203: Determine the second word of the to-be-determined identification text as the current word, wherein the second word is arranged consecutively with the first word in the to-be-determined identification text and is after the first word.
[0091] S204: Search the current word in the description text. If the current word is found, execute step S205.
[0092] It is understandable that if the current word is not found, it is determined that the to-be-determined identification text does not simultaneously satisfy the first condition and the second condition, and the process of determining whether the to-be-determined identification text simultaneously satisfies the first condition and the second condition is terminated.
[0093] S205: Obtain each second position of the current word in the description text and combine the second positions into a second position sequence corresponding to the current word.
[0094] S206. Determine whether there is at least one valid position in the second position sequence based on the first position sequence and the second position sequence, wherein the valid position is a second position in the description text that is arranged continuously with any first position in the first position sequence and is after the first position.
[0095] S207: If there is at least one valid position in the second position sequence, determine the at least one valid position as a valid position sequence.
[0096] S208: The word that is arranged consecutively with the second word and follows the second word in the to-be-determined identified text is used as the current word, the valid position sequence is used as the first position sequence, and the second position in the valid position sequence is used as the first position, and the process returns to step S204.
[0097] S209: When it is determined that there is at least one valid position in the position sequence of the last word of the to-be-determined identification text, determine that the to-be-determined identification text satisfies both the first condition and the second condition.
[0098] For ease of understanding, an example is given here: If the requirement for the target position is that the order of the positions of the words in the position group is the same as the order of arrangement in the to-be-determined identification text and the number of other characters between the positions of the words in the position group is 0. Suppose the to-be-determined identification text is " / traditional / wuxia / novel / ". When the first word "traditional" is found in the description text, the position sequence of the positions of the word "traditional" in each position combination in the description text is obtained as "1; 8; 15; 21". Then, it is determined that the word "wuxia" that is continuously arranged after the word "traditional" in the to-be-determined identification text is the current word, and the word "wuxia" is searched for in the description text. When the word "wuxia" is found in the description text, the position sequence of the positions of the word "wuxia" in each position combination in the description text is obtained as "2; 16; 38". Since "2" in the position sequence corresponding to "wuxia" is continuously arranged after "1" in the position sequence corresponding to "traditional", "2" is a valid position. Similarly, it can be known that "16" in the position sequence corresponding to "wuxia" is also a valid position, so the valid position sequence is "2; 16". Then, the word "novel" is searched for in the description text. When the word "novel" is found in the description text, the position sequence of the positions of the word "novel" in each position combination in the description text is "3; 25; 38; 64". Since "3" in the position sequence corresponding to the word "novel" is continuously arranged after "2" in the valid position sequence, it is determined that "3" in the position sequence corresponding to the word "novel" is a valid position. Since the word "novel" is the last word of the to-be-determined identification text and there is a valid position "3", it is determined that the to-be-determined identification text meets both the first condition and the second condition under this target position requirement.
[0099] In the embodiments of the present disclosure, by determining that the order of the positions of the words in the position group is the same as the order of arrangement in the to-be-determined identification text and the number of other characters between the positions of the words in the position group is 0, it is determined whether the to-be-determined identification text is the identification text of the target object. Based on whether the positions of the words in the to-be-determined identification text in the description text are continuously arranged and the order of arrangement is the same, it can be accurately judged whether the to-be-determined identification text has a high degree of matching with the target object.
[0100] The present disclosure provides a method for determining an identification text, which can obtain a to-be-determined identification text corresponding to a target object, wherein the to-be-determined identification text includes at least one word; determine whether the to-be-determined identification text satisfies a first condition and a second condition at the same time; if both conditions are satisfied, determine that the to-be-determined identification text is the identification text of the target object; if both conditions are not satisfied, determine that the to-be-determined identification text is not the identification text of the target object; the first condition is: each word in the to-be-determined identification text is located in the description text of the target object; the second condition is: at least one position group of each word in the to-be-determined identification text in the description text meets the target position requirement, wherein the position group consists of a position of each word in the to-be-determined identification text in the description text. The present disclosure determines that the to-be-determined identification text is the identification text of the target object by the position of each word in the to-be-determined identification text in the description text, if the first condition and the second condition are satisfied, and accurately judges the identification text with a high degree of match with the target object.
[0101] In an embodiment of the present disclosure, when at least one word in a to-be-determined identification text corresponding to the target object is not located in the description text of the target object, another to-be-determined identification text corresponding to the target object can be obtained, and it can be determined whether the other to-be-determined identification text satisfies the first condition and the second condition at the same time.
[0102] It can be understood that the embodiment of the present disclosure can arbitrarily select an unselected identification text to be determined in the filtered identification text group when the identification text to be determined satisfies both the first condition and the second condition, and determine whether the identification text to be determined satisfies both the first condition and the second condition, until there is no unselected identification text to be determined in the filtered identification text group, thereby determining the identification text of the target object in the filtered identification text group.
[0103] The embodiment of the present disclosure can screen out multiple identification texts of the target object by determining whether multiple identification texts to be determined are identification texts of the target object, thereby facilitating subsequent related processing or operations on the target object.
[0104] Corresponding to the above method embodiment, the embodiment of the present disclosure also provides a valid tag determination device, whose structure is as follows: Figure 6 As shown, the method may include: an identification text obtaining unit 100 and an identification text determining unit 200 .
[0105] The to-be-determined identification text obtaining unit 100 is configured to obtain the to-be-determined identification text corresponding to the target object, wherein the to-be-determined identification text includes at least one word.
[0106] The target object may be a thing being targeted. For example, the target object may be a person, an object, an image, audio, or video. The to-be-identified text may be text related to the target object.
[0107] The identification text determination unit 200 is used to determine whether the identification text to be determined satisfies the first condition and the second condition at the same time. If both conditions are satisfied, the identification text to be determined is determined to be the identification text of the target object. If both conditions are not satisfied, the identification text to be determined is determined not to be the identification text of the target object.
[0108] The first condition is that all the words in the to-be-determined identification text are located in the description text of the target object.
[0109] The description text of the target object may be a text that provides a general description of the target object. Optionally, the description text of the target object may be an encyclopedia description text corresponding to the target object.
[0110] Optionally, the identified text determining unit 200 may include: a first vocabulary search subunit, a vocabulary position obtaining subunit, a first determining subunit, and a second determining subunit.
[0111] The first vocabulary search subunit is used to search for any of the words in the to-be-determined identification text in turn: if the word is found, the vocabulary position acquisition subunit is triggered; if not found, the first determination subunit is triggered.
[0112] The word position obtaining subunit is used to obtain the various positions of the word in the description text.
[0113] The first determining subunit is configured to determine whether the to-be-determined identification text satisfies the first condition.
[0114] The second determining subunit is configured to determine that the to-be-determined identification text satisfies the first condition when obtaining the positions of the words in the to-be-determined identification text in the description text.
[0115] The embodiment of the present disclosure searches for the positions of the words in the to-be-determined identification text in the description text, and uses the position of the words in the to-be-determined identification text in the description text as a basis for determining whether the to-be-determined identification text meets the first condition.
[0116] The second condition is that at least one position group of each of the words in the to-be-determined identification text in the description text meets the target position requirement, wherein the position group consists of one position of each of the words in the to-be-determined identification text in the description text.
[0117] Optionally, the target position requirement is that the order of the positions of each of the words in the position group is consistent with the order of arrangement in the to-be-determined identification text, and / or the number of other characters between the positions of each of the words in the position group does not exceed a preset number.
[0118] Optionally, when the preset number is 0, the number of other characters between the positions of each of the words in the position group is 0, or, when the preset number is an integer greater than 0, the number of other characters between the positions of each of the words in the position group is an integer greater than 0.
[0119] It can be understood that, when the number of other characters between the positions of the words in the position group is 0, the positions of the words in the position group are arranged continuously.
[0120] The embodiment of the present disclosure makes specific settings for the target position requirements, so that the identification text of the target object determined according to the target position requirements more accurately meets actual needs.
[0121] Optionally, the identification text determination unit 200 may include: a position sequence combination subunit and a target position requirement satisfaction determination subunit.
[0122] The position sequence combining subunit is used to sequentially combine the positions of any of the words in the to-be-determined identification text into a position sequence corresponding to the word.
[0123] The target position requirement satisfaction determination subunit is configured to determine, using the position sequence corresponding to each of the words, whether at least one position group of each of the words in the to-be-determined identification text in the description text satisfies the target position requirement.
[0124] The embodiment of the present disclosure combines the positions of each word in the to-be-determined identification text in the description text into position sequences, and then arranges and combines the positional relationships between the positions of the position sequences corresponding to each word to obtain at least one position group, so that each position relationship is expressed in units of position groups, which helps to quickly determine whether each position group meets the target position requirements and improves the accuracy of determining the identification text.
[0125] Optionally, the target position requirement satisfaction determination subunit may include: a first current vocabulary determination subunit, a current position determination subunit, and a third determination subunit. If the target position requirement is that the order of the positions of the words in the position group is consistent with the order of arrangement in the to-be-determined identification text and the number of other characters between the positions of the words in the position group is 0, the first identification text includes N+1 words.
[0126] The first current vocabulary determining subunit is configured to determine the first vocabulary of the to-be-determined identification text as the current vocabulary.
[0127] The current position determination subunit is used to determine a position in the position sequence corresponding to the current word that has not been judged as the current position, wherein the judgment process includes: determining whether the N positions after the current position are respectively stored in the position sequence corresponding to the N words after the current word, and the N words are all words located after the current word in the text to be determined; if so, triggering the third determination subunit.
[0128] The third determining subunit is configured to determine whether at least one position group of each of the words in the to-be-determined identification text in the description text meets the target position requirement.
[0129] The embodiment of the present disclosure judges and processes each position in the position sequence corresponding to the first word of the identification text to be determined, and determines whether the consecutive positions after the position in the description text exist in the position sequence corresponding to all words after the first word respectively. This can quickly determine the position group of each word in the identification text to be determined that meets the target position requirement in the description text, thereby improving the processing efficiency of determining the identification text of the target object.
[0130] Optionally, the identification text determination unit 200 provided in the embodiment of the present disclosure may include: a second vocabulary search subunit, a first position sequence acquisition subunit, a second current vocabulary determination subunit, a third vocabulary search subunit, a second position sequence acquisition subunit, a valid position determination subunit, a valid position sequence determination subunit, a fourth determination subunit, and a fifth determination subunit. If the target position requirement is that the order of the positions of the words in the position group is consistent with the order of arrangement in the identification text to be determined and the number of other characters between the positions of the words in the position group is 0.
[0131] The second vocabulary search subunit is used to search for the first vocabulary of the to-be-determined identification text in the description text, and if the first vocabulary is found, trigger the first position sequence obtaining subunit.
[0132] The first position sequence obtaining subunit is configured to obtain the first positions of the first word in the description text and combine the first positions into a first position sequence corresponding to the first word.
[0133] The second current word determination subunit is configured to determine the second word of the to-be-determined identification text as the current word, wherein the second word is arranged consecutively with the first word and follows the first word in the to-be-determined identification text.
[0134] The third vocabulary search subunit is used to search for the current vocabulary in the description text, and if the current vocabulary is found, trigger the second position sequence acquisition subunit.
[0135] The second position sequence obtaining subunit is configured to obtain the second positions of the current word in the description text and combine the second positions into a second position sequence corresponding to the current word.
[0136] The valid position determination subunit is used to determine whether there is at least one valid position in the second position sequence based on the first position sequence and the second position sequence, wherein the valid position is a second position in the description text that is continuously arranged with any first position in the first position sequence and is after the first position.
[0137] The valid position sequence determining subunit is configured to determine, if there is at least one valid position in the second position sequence, the at least one valid position as a valid position sequence.
[0138] The fourth determination subunit is used to take the word in the to-be-determined identification text that is arranged continuously with the second word and after the second word as the current word, the valid position sequence as the first position sequence, and the second position in the valid position sequence as the first position, to trigger the third word search subunit.
[0139] The fifth determining subunit is configured to determine that the first identification text satisfies both the first condition and the second condition when it is determined that there is at least one valid position in the position sequence of the last word of the identification text to be determined.
[0140] The embodiment of the present disclosure determines whether the identification text to be determined is the identification text of the target object by ensuring that the order of positions of the words in the position group is consistent with the order of arrangement in the identification text to be determined and the number of other characters between the positions of the words in the position group is 0. Based on whether the positions of the words in the identification text to be determined are arranged continuously in the description text and the order of arrangement is consistent, it can be accurately judged whether the identification text to be determined has a high degree of match with the target object.
[0141] The present disclosure provides an identification text determination device, which can obtain a to-be-determined identification text corresponding to a target object, wherein the to-be-determined identification text includes at least one word; determine whether the to-be-determined identification text satisfies a first condition and a second condition at the same time; if both conditions are satisfied, the to-be-determined identification text is determined to be the identification text of the target object; if both conditions are not satisfied, the to-be-determined identification text is determined not to be the identification text of the target object; the first condition is: each word in the to-be-determined identification text is located in the description text of the target object; the second condition is: at least one position group of each word in the to-be-determined identification text in the description text meets the target position requirement, wherein the position group consists of a position of each word in the to-be-determined identification text in the description text. The present disclosure determines that the to-be-determined identification text is the identification text of the target object by the position of each word in the to-be-determined identification text in the description text, if the first condition and the second condition are satisfied, and accurately judges the identification text with a high degree of matching with the target object.
[0142] The valid label determination device includes a processor and a memory. The above-mentioned identification text acquisition unit 100 and identification text determination unit 200 are stored in the memory as program units, and the processor executes the above-mentioned program units stored in the memory to realize corresponding functions.
[0143] The processor includes a kernel that retrieves corresponding program units from memory. One or more kernels can be provided. By adjusting kernel parameters, the kernel determines that the to-be-determined identification text is the identification text of the target object based on the position of each word in the description text, if first and second conditions are met, and accurately identifies the identification text with a high degree of match to the target object.
[0144] An embodiment of the present disclosure provides a computer-readable storage medium having a program stored thereon, which implements the identification text determination method when executed by a processor.
[0145] An embodiment of the present disclosure provides a processor, which is used to run a program, wherein the identification text determination method is executed when the program is run.
[0146] like Figure 7 As shown, an embodiment of the present disclosure provides an electronic device 300, which includes at least one processor 301, at least one memory 302 connected to the processor 301, and a bus 303. The processor 301 and the memory 302 communicate with each other via the bus 303. The processor 301 is configured to invoke program instructions in the memory 302 to execute the aforementioned identification text determination method. The electronic device 300 herein may be a server, a PC, a PAD, a mobile phone, or the like.
[0147] The present disclosure also provides a computer program product, which, when executed on an electronic device, is suitable for executing a program initialized with the steps of the above-mentioned identification text determination method.
[0148] The present disclosure is described with reference to the flowcharts and / or block diagrams of the methods, apparatuses, electronic devices (systems), and computer program products according to the embodiments of the present disclosure. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable device to produce a machine, so that the instructions executed by the processor of the computer or other programmable device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0149] In a typical configuration, an electronic device includes one or more processors (CPUs), a memory, and a bus. The electronic device may also include an input / output interface, a network interface, and the like.
[0150] Memory may include non-permanent memory in a computer-readable medium, random access memory (RAM), and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory includes at least one memory chip. Memory is an example of a computer-readable medium.
[0151] Computer-readable media includes permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. The information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory computer-readable media (transitory media), such as modulated data signals and carrier waves.
[0152] It should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. It should also be noted that the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, commodity, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, commodity, or device comprising the element.
[0153] Those skilled in the art will appreciate that embodiments of the present disclosure may be provided as methods, systems, or computer program products. Thus, the present disclosure may take the form of a fully hardware embodiment, a fully software embodiment, or an embodiment combining software and hardware. Furthermore, the present disclosure may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0154] The above are merely examples of the present disclosure and are not intended to limit the present disclosure. Various modifications and variations are possible for those skilled in the art. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present disclosure are intended to be included within the scope of the claims of the present disclosure.
Claims
1. A method for determining a marked text, characterized in that: include: Obtaining a to-be-determined identification text corresponding to the target object, wherein the to-be-determined identification text includes at least one word; Determining whether the identification text to be determined satisfies both a first condition and a second condition; if so, determining that the identification text to be determined is the identification text of the target object; and if not, determining that the identification text to be determined is not the identification text of the target object; The first condition is that all the words in the to-be-determined identification text are located in the description text of the target object; The second condition is that at least one position group of each word in the to-be-determined identification text in the description text meets the target position requirement, wherein the position group consists of one position of each word in the to-be-determined identification text in the description text; The target position requirement is that the order of the positions of the words in the position group is consistent with the order of arrangement in the to-be-determined identification text, and / or the number of other characters between the positions of the words in the position group does not exceed a preset number.
2. The method according to claim 1, characterized in that The number of other characters between the positions of the words in the position group does not exceed a preset number, including: When the preset number is 0, the number of other characters between the positions of each of the words in the position group is 0, or, when the preset number is an integer greater than 0, the number of other characters between the positions of each of the words in the position group is an integer greater than 0.
3. The method according to claim 1, characterized in that The process of determining whether the to-be-determined identification text satisfies the first condition includes: For each of the words in the to-be-determined identification text, searching for the word in the description text, and if the word is found, obtaining each position of the word in the description text; if the word is not found, determining that the to-be-determined identification text does not meet the first condition; When the positions of the words in the to-be-determined identification text in the description text are obtained, it is determined that the to-be-determined identification text meets the first condition.
4. The method according to claim 1, wherein The process of determining whether the to-be-determined identification text satisfies the second condition includes: For any of the words in the to-be-determined identification text, sequentially: combining the positions of the word in the description text into a position sequence corresponding to the word; By using the position sequence corresponding to each of the words, it is determined that at least one position group of each of the words in the to-be-determined identification text in the description text meets the target position requirement.
5. The method according to claim 4, characterized in that If the target position requirement is that the order of the positions of the words in the position group is consistent with the order of arrangement in the to-be-determined identification text and the number of other characters between the positions of the words in the position group is 0, and the to-be-determined identification text includes N+1 words, then using the position sequence corresponding to each word to determine whether at least one position group of each word in the to-be-determined identification text meets the target position requirement includes: Determine the first word of the to-be-determined identification text as the current word; Determine a position in the position sequence corresponding to the current word that has not been subjected to a judgment process as the current position; The judgment process includes: determining whether N positions after the current position are respectively and sequentially stored in the position sequence corresponding to the N words after the current word, the N words being all words after the current word in the to-be-determined identified text; If yes, it is determined that at least one position group of each of the words in the to-be-determined identification text in the description text meets the target position requirement.
6. The method according to claim 1, characterized in that If the target position requirement is that the order of the positions of the words in the position group is consistent with the order of arrangement in the to-be-determined markup text and the number of other characters between the positions of the words in the position group is 0, then the process of determining whether the to-be-determined markup text satisfies both the first condition and the second condition includes: Searching for a first word of the identification text to be determined in the description text, and if found, obtaining each first position of the first word in the description text and combining the first positions into a first position sequence corresponding to the first word; Determine the second word of the to-be-determined identification text as the current word, wherein the second word is arranged consecutively with the first word and follows the first word in the to-be-determined identification text; Searching for the current word in the description text, and if the current word is found, obtaining each second position of the current word in the description text and combining the second positions into a second position sequence corresponding to the current word; determining whether there is at least one valid position in the second position sequence based on the first position sequence and the second position sequence, wherein the valid position is a second position in the description text that is arranged continuously with and after any first position in the first position sequence; If there is at least one valid position in the second position sequence, determining the at least one valid position as a valid position sequence; The word in the to-be-determined identification text that is arranged continuously with the second word and follows the second word is taken as the current word, the valid position sequence is taken as the first position sequence, and the second position in the valid position sequence is taken as the first position, and the step of searching for the current word in the description text is returned to execute until it is determined that there is at least one valid position in the position sequence of the last word in the to-be-determined identification text, and it is determined that the to-be-determined identification text satisfies both the first condition and the second condition.
7. A device for determining a marked text, characterized in that: include: a unit for obtaining the identification text to be determined and a unit for determining the identification text, The to-be-determined identification text obtaining unit is configured to obtain the to-be-determined identification text corresponding to the target object, wherein the to-be-determined identification text includes at least one word; The identification text determination unit is configured to determine whether the identification text to be determined satisfies both a first condition and a second condition; if both conditions are satisfied, the identification text to be determined is determined to be the identification text of the target object; if both conditions are not satisfied, the identification text to be determined is determined not to be the identification text of the target object; The first condition is that all the words in the to-be-determined identification text are located in the description text of the target object; The second condition is that at least one position group of each word in the to-be-determined identification text in the description text meets the target position requirement, wherein the position group consists of one position of each word in the to-be-determined identification text in the description text; The target position requirement is that the order of the positions of the words in the position group is consistent with the order of arrangement in the to-be-determined identification text, and / or the number of other characters between the positions of the words in the position group does not exceed a preset number.
8. A computer-readable storage medium having a program stored thereon, characterized in that: When the program is executed by a processor, the identification text determination method according to any one of claims 1 to 6 is implemented.
9. An electronic device comprising at least one processor, and at least one memory and bus connected to the processor; wherein: The processor and the memory communicate with each other via the bus; The processor is configured to call program instructions in the memory to execute the identification text determination method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Text annotation method and device
CN110377743A
Mathematical processing method, apparatus and device for text problem, and storage medium
WO2019029723A1