Information processing method and device
By incorporating verb similarity and sentiment analysis, the method improves text similarity comparison accuracy, addressing the limitations of existing methods and enhancing NLP applications like event graph construction and text classification.
Patent Information
- Application Number
- JP2024041874
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2023-04-26
- Filing Date
- 2024-03-18
- Publication Date
- 2025-11-26
- Estimated Expiration
- 2044-03-18
AI Technical Summary
Existing text similarity comparison methods in NLP often fail to accurately determine similarities between texts, leading to incorrect judgments, particularly when considering only noun similarities, as seen in cases like 'oil prices rise' and 'oil prices fall' being incorrectly determined as similar.
The method involves determining verb similarity based on parts of speech, along with noun and sentiment polarity, using models like word2vec and BERT to generate quantified representations, and calculating similarities through cosine values, followed by a weighted sum to determine final text similarity.
This approach enhances the accuracy of text similarity comparison, improving the quality of event graphs and text classification by accurately identifying similar events and categories, reducing redundancy and enhancing NLP results.
Smart Images

Figure 0007775909000005 
Figure 0007775909000006 
Figure 0007775909000007
Abstract
Description
[Technical Field]
[0001] FIELD OF THE DISCLOSURE Exemplary embodiments of the present disclosure relate generally to the field of computers, and more particularly to information processing methods and apparatus. [Background technology]
[0002] With the development of computer technology, natural language processing (NLP) has a wide range of applications and has brought convenience to production and daily life. Summary of the Invention [Problem to be solved by the invention]
[0003] In some NLP scenarios, it is necessary to compare different texts to determine whether they are similar, for example, whether two sentences are similar, whether two phrases are similar, etc. The results of the text similarity comparison can be used to further determine the NLP results. Therefore, the accuracy of the text similarity comparison is important to the accuracy of the NLP results. [Means for solving the problem]
[0004] A first aspect of the present disclosure provides an information processing method, including: obtaining a reference text for comparison with a target text; determining a verb similarity based on parts of speech corresponding to words in the target text and the reference text, the verb similarity indicating whether the target text includes a verb and whether the reference text includes a verb, or a degree of similarity between verbs included in the target text and verbs included in the reference text; and determining a first similarity between the target text and the reference text based on at least the verb similarity. A second aspect of the present disclosure provides an electronic device, including at least one processing circuit configured to obtain a reference text for comparison with a target text, determine a verb similarity based on parts of speech corresponding to words in the target text and the reference text, the verb similarity indicating whether the target text includes a verb and whether the reference text includes a verb, or a degree of similarity between verbs included in the target text and verbs included in the reference text, and determine a first similarity between the target text and the reference text based on at least the verb similarity. In some embodiments of the second aspect, the at least one processing circuit is further configured to determine whether the target text includes a verb and whether the reference text includes a verb based on the corresponding parts of speech, and in response to determining that the target text includes a verb and that the reference text includes a verb, determine a verb similarity based on a quantified representation of the verb in the target text and a quantified representation of the verb in the reference text. In some embodiments of the second aspect, the at least one processing circuit is further configured to determine whether the target text includes a noun and whether the reference text includes a noun based on corresponding parts of speech, and in response to determining that the target text includes a noun and that the reference text includes a noun, determine a noun similarity based on a quantified representation of the noun in the target text and a quantified representation of the noun in the reference text, and determine a first similarity based on at least the verb similarity and the noun similarity. In some embodiments of the second aspect, the at least one processing circuit is further configured to obtain a quantified representation of the target text generated based on a context of the target text and a quantified representation of the reference text generated based on a context of the reference text, determine a second similarity between the target text and the reference text based on the quantified representation of the target text and the quantified representation of the reference text, and determine a first similarity based on the verb similarity, the noun similarity, and the second similarity. In some embodiments of the second aspect, the at least one processing circuit is further configured to determine whether sentiment polarities of the target text and the reference text are opposite to each other, and in response to the sentiment polarities not being opposite to each other, determine a first similarity based at least on the verb similarity. In some embodiments of the second aspect, the emotional polarity of the corresponding text in the target text and the reference text is determined based on at least one of the emotional value of the emotional word in the corresponding text, whether the corresponding text includes a negation word associated with the emotional word, or the degree value of the degree adverb associated with the emotional word in the corresponding text. In some embodiments of the second aspect, the at least one processing circuit is further configured to determine, for each candidate text in the plurality of candidate texts, a third similarity between the candidate text and the target text based on the quantified representation of each word in the target text and the quantified representation of each word in the candidate text, and determine, as the reference text, a candidate text for which the third similarity is greater than the first threshold similarity. In some implementations of the second aspect, the target text is used to describe a first event and the reference text is used to describe a second event, and the at least one processing circuit is further configured to determine that the first event and the second event have a similarity relationship in response to the first similarity being greater than a second threshold similarity. In a third aspect of the present disclosure, there is provided an electronic device including at least one processing unit and at least one memory, the at least one memory being coupled to the at least one processing unit and configured to store instructions for execution by the at least one processing unit, the instructions, when executed by the at least one processing unit, causing the device to perform the method of the first aspect. In a fourth aspect of the present disclosure, there is provided a computer-readable storage medium having stored thereon a computer program that, when executed by a processor, implements the method of the first aspect. It should be noted that the contents described in the Summary of the Invention section do not limit the key or important features of the embodiments of the present disclosure, nor do they limit the scope of the present disclosure. It should be understood that other features of the present disclosure can be more easily understood by reading the following description. [Brief explanation of the drawings]
[0005] These and other features, advantages, and aspects of the embodiments of the present disclosure will become more apparent from the following detailed description taken in conjunction with the accompanying drawings, in which like or similar reference numerals indicate like or similar elements. [Figure 1] FIG. 1 is a schematic diagram illustrating an exemplary environment in which embodiments of the present disclosure may be implemented. [Figure 2] FIG. 1 is a schematic diagram of an architecture for text comparison according to some embodiments of the present disclosure. [Figure 3] 1 is a flowchart of an example process for text comparison according to some embodiments of the present disclosure. [Figure 4] 1 is a flowchart illustrating a process for information processing according to some embodiments of the present disclosure. [Figure 5] 1 is a block diagram illustrating several example electronic devices embodying the present disclosure. DETAILED DESCRIPTION OF THE INVENTION
[0006] Hereinafter, embodiments of the present disclosure will be described in more detail with reference to the accompanying drawings. Although the accompanying drawings show several embodiments of the present disclosure, it should be understood that the present disclosure can be implemented in various forms and is not limited to the embodiments herein, and these embodiments are used to more thoroughly and completely understand the present disclosure. It should be understood that the accompanying drawings and embodiments of the present disclosure are used for illustrative purposes only and are not intended to limit the scope of protection of the present disclosure.
[0007] It should be noted that any section / subsection titles provided herein are not limiting. Various embodiments are described throughout this specification, and any embodiment may be included in any section / subsection. Furthermore, any embodiment described in any section / subsection may be combined in any manner with any other embodiment described in the same section / subsection and / or different sections / subsections.
[0008] In describing embodiments of the present disclosure, the term "comprises" and similar terms should be understood as broadly inclusive, i.e., "including, but not limited to." The term "based on" means "based at least in part on." "An embodiment" or "the embodiment" means "at least one embodiment." "Some embodiments" means "at least some embodiments." The following may include explicit and implicit definitions.
[0009] As used herein, the term "circuitry" refers to a hardware circuit and / or a combination of a hardware circuit and software. For example, a circuit may be a combination of analog and / or digital hardware circuitry and software / firmware. As another example, a circuit may be any portion of a hardware processor, including software, where the hardware processor includes digital signal processor(s), software, and memory(s), which work together to operate a device and perform various functions. As another example, a circuit may be a hardware circuit and / or processor, e.g., a microprocessor or portion of a microprocessor, that requires software / firmware for operation, but may not require software if it is not required for operation. As used herein, the term "circuitry" may include implementations of only a hardware circuit or processor, or a portion of a hardware circuit or processor and its (or their) accompanying software and / or firmware.
[0010] As used herein, the term "text" refers to any length of language. By way of example, text may refer to one or more words, phrases, parts of sentences, sentences, etc.
[0011] As used herein, the term "event" refers to the occurrence of some action or situation in which participants participate, or a change in an objective state. Text describing an event may include multiple words and is used to describe the occurrence of the event or some component of the event. Formally, factors contributing to an event may include trigger words or types of the event, key participants in the event, time and place of the event, etc.
[0012] As used herein, the term "similar text pair" refers to text that differs in description but conveys the same meaning. For example, the text "price increase" and the text "price rise" are a similar text pair. Similarly, the term "similar event pair" refers to events that differ in description text but convey the same meaning. For example, the event "price increase" and the event "price rise" are a similar event pair.
[0013] The term "word" as used herein may have any suitable granularity. For example, in one language, a "word" may include one or more words. In another language, a "word" may be a single word made up of one or more characters.
[0014] Basic principles of the example environment 1 shows a schematic diagram of an example environment 100 in which embodiments of the present disclosure may be implemented. The environment 100 is comprised of one or more reference texts 120-1, 120-2, ..., 120-N, also referred to collectively or individually as reference texts 120, where N is an integer equal to or greater than 1. For a target text 110 to be processed, the electronic device 150 examines the reference texts 120 to determine whether there is text similar to the target text 110. That is, the electronic device 150 performs a text similarity determination.
[0015] In environment 100, electronic device 150 may be any device with computing capabilities, including a terminal device. The terminal device may be any mobile, fixed, or portable terminal, including a mobile phone, desktop computer, laptop computer, notebook computer, netbook computer, tablet computer, media computer, multimedia computer, personal communication system (PCS) device, personal navigation device, personal digital assistant (PDA), audio / video player, digital camera / camera, locator device, television receiver, radio receiver, e-book device, gaming device, or any combination thereof, or any combination thereof, including accessories and peripherals including such devices. Electronic device 120 may be any device with computing capabilities, including a server-side device. The server-side device may include, for example, a computing system / server, such as a mainframe, an edge computing node, a computing device in a cloud environment, etc.
[0016] In some embodiments, target text 110 and reference text 120 are each used to describe an event. By comparing target text 110 and reference text 120, it can be determined whether the described events are similar. The determination of event similarity is used for event graph querying or event graph construction.
[0017] A matter graph is a matter-logic knowledge base for describing evolutionary rules and patterns among events. Structurally, a matter graph is a directed graph consisting of nodes and edges, where nodes represent events and directed edges represent relationships, and directed edges represent logical relationships between events, such as order, causality, conditionality, and superiority / subordinateity. As an example, the target text 110 may be a statement that queries or searches the matter graph, and the reference text 120 may be a statement that describes an event in the matter graph. Determining text similarity allows the queried or searched event to be identified from the matter graph.
[0018] An event graph typically contains a large number of event pairs with an associated relationship. For example, a causal event graph typically contains a large number of event pairs with a causal relationship, describing the causal propagation relationship between events. Due to the large number of events, there may be many events with different expressions but the same actual meaning during the event graph construction process. If event similarity is not taken into consideration, duplicate nodes will be introduced into the event graph, resulting in a large amount of redundancy. This reduces the accuracy and permeability of event chain propagation. Therefore, during the event graph construction process, these similar events can be merged through event similarity determination to simplify the network structure and improve the quality of the event graph.
[0019] As another example, when applied to event graph construction, target text 110 is used to describe events extracted from media content (e.g., news), and reference text 120 is used to describe existing events in the event graph. Text similarity determination can determine whether a newly extracted event needs to be merged with an existing event.
[0020] In some embodiments, the text similarity determination may be applied to search recommendations. The target text 110 may be a current keyword or statement that one wishes to search for, and the reference text 120 may be a past keyword or statement for which search results exist. By determining the text similarity, search results for past keywords or statements that are similar to the current keyword or statement are recommended to the user as search recommendations.
[0021] In some embodiments, text similarity determination can be applied to automated Q&A. Target text 110 is a statement corresponding to the current question. Reference text 120 can be a statement corresponding to a past or reference question for which an answer exists. By determining text similarity, a past or reference question similar to the current question can be determined, and the answer to the past or reference question can be used as the answer to the current question.
[0022] In some embodiments, the text similarity determination can be applied to text classification. The target text 110 is the text to be classified. The reference text 120 can be the classified text. The text similarity determination can find classified texts that are similar to the text to be classified, and the categories of the classified texts can be used as the classification results for the text to be classified.
[0023] It should be understood that the structure and functionality of environment 100 have been described for illustrative purposes and are not intended to imply any limitation on the scope of the present disclosure. Furthermore, the application scenarios described above are merely examples and are not intended to limit the scope of the present disclosure. The information processing solutions of the embodiments of the present disclosure may be applied to any suitable scenario.
[0024] Several similarity calculation solutions have been proposed for comparing texts. Some solutions consider the similarity between nouns or sentences in two texts to determine whether the two texts are similar. However, this can lead to incorrect judgments. For example, if only noun similarity is considered, "oil prices rise" and "oil prices fall" may be incorrectly determined to be similar texts.
[0025] To address at least some of the above problems and other potential problems, embodiments of the present disclosure provide a solution for information processing. According to one or more embodiments, a reference text is obtained for comparison with a target text. A verb similarity is determined based on parts of speech corresponding to words in the target text and the reference text. The verb similarity indicates whether the target text contains a verb and whether the reference text contains a verb, or the degree of similarity between verbs contained in the target text and verbs contained in the reference text. Whether the target text and the reference text are similar is determined based on at least the verb similarity.
[0026] In this way, taking verb similarity into account in text comparison is beneficial to improving the accuracy of text similarity comparison. Improving the accuracy of text similarity comparison is beneficial to improving the accuracy of NLP results. For example, in an event graph application scenario, it can accurately query the related event graph of an event that a user is interested in, or it can help reduce the redundancy of the event graph to build a high-quality event graph. Furthermore, in a text classification scenario, it is beneficial to achieving accurate text classification.
[0027] To make the above and other advantages comprehensible, illustrative embodiments of the present disclosure are described below in conjunction with the accompanying drawings.
[0028] Example Architecture for Text Comparison 2 is a schematic diagram of an architecture 200 for text comparison according to some embodiments of the present disclosure. The architecture 200 may be implemented in an electronic device 150. The architecture 200 will now be described with reference to FIG. 1. As shown in FIG. 2, the architecture 200 includes a reference text acquisition module 210 configured to acquire reference text 120 for comparison with the target text 110. For example, in an event graph scenario, the reference text acquisition module 210 may acquire text describing an existing event in the event graph as reference text.
[0029] In some embodiments, the reference text acquisition module 210 can select the reference text from multiple candidate texts. For example, because there may be a large number of existing events in the event graph, some of which may be significantly different from the events described in the target text 110, text describing these events can be filtered. That is, in such embodiments, a large number of candidate texts can be roughly screened. More efficient text similarity calculation methods can also be used to select the reference text for comparison. For example, Jaccard similarity or word vector-based text similarity can be used.
[0030] In some embodiments, the reference text acquisition module 210 may employ a text similarity measure based on word vectors. For each candidate text, the similarity measure between the candidate text and the target text is determined based on the quantified representation of each word (e.g., word vector) obtained from the target text 110 and the quantified representation of each word in the candidate text. For example, the average of the quantified representations of each word is regarded as the quantified representation of the corresponding text. The quantified representations of the target text 110 and the candidate text can then be used to determine the similarity measure between the target text 110 and the candidate text. It should be understood that the determined similarity measure is an intermediate result and is only used for selecting the reference text. A candidate text whose similarity measure is greater than a threshold similarity measure (also referred to as a first threshold similarity measure) may be determined as the reference text.
[0031] As an example, text similarity may be calculated using the word2vec model. First, the target text 110 and the candidate text may be encoded using the word2vec model. The word2vec model may be used to generate a word vector for each word that constitutes the text. The average value of these word vectors may be used as a text vector representing the text. The cosine value of the text vector of the target text 110 and the text vector of the candidate text may then be calculated as the similarity. If the similarity is greater than a first threshold similarity, it means that the two texts may be similar. Therefore, the candidate text may be selected as the reference text 120.
[0032] In some embodiments, to improve the efficiency of text screening, the quantified representation of each candidate text can be pre-generated and stored in a database for backup, so that during the text screening process, the quantified representation of each candidate text can be directly retrieved from the database and compared with the quantified representation of the target text.
[0033] In this embodiment, a computationally efficient algorithm can be adopted to roughly screen a larger number of candidate texts, thereby filtering out most of the dissimilar text pairs, thus significantly reducing the burden of subsequent processing.
[0034] The architecture 200 includes a word similarity determination module 230 configured to determine word similarity based on the parts of speech corresponding to each word in the reference text 120 and the target text 110. The word similarity may indicate the degree of similarity between the target text 110 and the reference text 120 in terms of words of the same part of speech. In other words, the word similarity may indicate whether the target text 110 contains words of a certain part of speech, whether the reference text 120 contains words of that part of speech, or the degree of similarity between the words of that part of speech contained in the target text 110 and the words of that part of speech contained in the reference text 120. The word similarity determination module 230 may employ any suitable algorithm to perform word segmentation and part-of-speech determination of the target text 110 and the reference text 120. The scope of the present disclosure is not limited in this respect.
[0035] Word similarity may be determined in any suitable manner. In some embodiments, for a certain part of speech, if one text in the target text 110 and the reference text 120 contains words of that part of speech and the other text does not, the similarity for that part of speech may be determined as a first value indicating dissimilarity, such as 0. If neither the target text 110 nor the reference text 120 contains words of that part of speech, the similarity for that part of speech may be determined as a second value indicating similarity, such as 1. If both the target text 110 and the reference text 120 contain words of that part of speech, the similarity for that part of speech may be determined based on the similarity between the words of that part of speech in the target text 110 and the words of that part of speech in the reference text 120. As an example, the cosine value between the quantified representations of the words of the part of speech contained in the target text 110 (e.g., vectors obtained using a word2vec model) and the quantified representations of the words of the part of speech contained in the reference text 120 (e.g., vectors obtained using a word2vec model) may be determined as the similarity of the part of speech.
[0036] The word similarity determination module 230 may include one or more modules for determining the similarity of corresponding parts of speech. As shown in FIG. 2, the verb similarity determination module 231 is configured to determine verb similarity based on the parts of speech of corresponding words in the target text 110 and the reference text 120. The verb similarity may indicate the similarity of verbs between the target text 110 and the reference text 120. In other words, the verb similarity may indicate whether the target text 110 contains a verb, whether the reference text 120 contains a verb, or the degree of similarity between the verbs included in the target text 110 and the verbs included in the reference text 120.
[0037] Verb similarity may be determined in any suitable manner. In some embodiments, if one of the target text 110 and the reference text 120 contains a verb and the other does not, the verb similarity may be determined as a first value indicating dissimilarity, such as 0. If neither the target text 110 nor the reference text 120 contains a verb, the verb similarity may be determined as a second value indicating similarity, such as 1. If both the target text 110 and the reference text 120 contain verbs, the verb similarity may be determined as the semantic similarity between the verbs included in the target text 110 and the verbs included in the reference text 120. As an example, the verb similarity may be determined based on quantified expressions of verbs included in the target text 110 and quantified expressions of verbs included in the reference text 120.
[0038] For example, we use a word2vec model to encode verbs in the target text 110 and the reference text 120, respectively, and generate quantified representations v1 verb and v2 verb can be obtained. Quantification expression v1 verb and v2 verb cosine value of cos(v1 verb , v2 verb ) may be determined as the verb similarity. If there are multiple verbs in the text, the quantified representation of the text verb may be the average of the quantified representations of these verbs, or a similarity may be determined for each pair of verbs and then an average similarity may be calculated for multiple pairs of verbs.
[0039] Note that the above-described method for determining verb similarity is merely an example and is not intended to limit the scope of the present disclosure. Other appropriate methods may be used to determine verb similarity. For example, the number of verbs may be further considered. Furthermore, the semantics of verbs may be analyzed and the similarity may be determined based on the semantics.
[0040] In some implementations, the word similarity determination module 230 further includes a noun similarity determination module 232 configured to determine noun similarity based on parts of speech corresponding to words in the target text 110 and the reference text 120. The noun similarity may indicate the similarity of nouns in the target text 110 and the reference text 120. In other words, the noun similarity may indicate whether the target text 110 contains nouns and whether the reference text 120 contains nouns, or the degree of similarity between the nouns included in the target text 110 and the nouns included in the reference text 120.
[0041] Noun similarity may be determined in any suitable manner. In some embodiments, if one of the target text 110 and the reference text 120 contains a noun and the other does not, the noun similarity may be determined as a first value indicating dissimilarity, such as 0. If the target text 110 and the reference text 120 do not contain any nouns, the noun similarity may be determined as a second value indicating similarity, such as 1. If the target text 110 and the reference text 120 all contain nouns, the noun similarity may be determined as the semantic similarity between the nouns in the target text 110 and the nouns in the reference text 120. As an example, the noun similarity may be determined based on quantified representations of the nouns in the target text 110 and the nouns in the reference text 120.
[0042] For example, we use a word2vec model to encode the nouns in the target text 110 and the reference text 120, respectively, and generate a quantified representation of the noun v1 noun and v2 noun can be obtained. Quantification expression v1 nounand v2 noun cosine value of cos(v1 noun , v2 noun ) may be determined as the noun similarity. If there are multiple nouns in the text, the quantified representation of the text verb may be the average of the quantified representations of these nouns, or a similarity may be determined for each pair of nouns and then an average similarity may be calculated for the multiple pairs of nouns.
[0043] The verb similarity and the noun similarity have been described above. In some other embodiments, the similarity of other parts of speech (e.g., adjectives) may be considered. For example, the similarity of other parts of speech may be considered depending on the application scenario.
[0044] In some embodiments, architecture 200 may further include a text similarity determination module 240 configured to determine a similarity (also referred to as a second similarity or text similarity) between target text 110 and reference text 120 based on the context of target text 110 and reference text 120. It should be understood that the similarity determined here is an intermediate result and can be combined with other types of similarities (e.g., verb similarity, noun similarity) to provide a text comparison result.
[0045] The text similarity determination module 240 may obtain a quantified representation of the target text 110 generated based on the context of the target text 110 and a quantified representation of the reference text 120 generated based on the context of the reference text 120. The text similarity determination module 240 may then determine a text similarity between the target text 110 and the reference text 120 based on the quantified representation of the target text 110 and the quantified representation of the reference text 120.
[0046] For example, a deep learning language model (e.g., a BERT model) may be used to encode the target text 110 and the reference text 120, respectively, and generate a quantified representation of the text V1. sen and V2 sen We obtain the quantification expression V1 senThe cosine value of may be determined as the text similarity.
[0047] Text typically has a sentiment polarity, such as positive, negative, or neutral. In some cases, text with high verb-noun similarity may have opposite sentiment polarities. For example, the sentiment polarities of the texts "price rise" and "price unlikely to rise" are opposite. In light of this, in some embodiments, the sentiment polarities of the target text 110 and the reference text 120 may be considered to determine whether the texts are similar.
[0048] 2, architecture 200 may further include a sentiment determination module 220 configured to determine the corresponding sentiment between target text 110 and reference text 120. The sentiment determination module 220 may determine the sentiment using any suitable algorithm. In some embodiments, a classical machine learning algorithm, such as plain Bayes, a support vector machine, or the like, may be employed. In some embodiments, a deep learning algorithm, such as a recurrent neural network model, may be employed.
[0049] In some embodiments, a sentiment dictionary may be used to determine the corresponding sentiment polarity of the target text 110 and the reference text 120. For any text, various appropriate dictionaries (e.g., a sentiment dictionary, a negation dictionary, a degree adverb dictionary) may be used to extract sentiment words, negation words, and degree adverbs in the text. The sentiment polarity of the text can then be determined based on the sentiment values of the sentiment words in the text, whether the text contains negation words associated with the sentiment words, or the degree values of the degree adverbs associated with the sentiment words in the text.
[0050] As an example, the sentiment polarity of the target text 110 or the reference text 120 can be calculated according to the following formula: TIFF0007775909000001.tif18153(1)
[0051] Here, Se indicates the sentiment polarity score, and i indicates the i-th sentiment word group in the text. All negation words and degree adverbs between two sentiment words, together with the subsequent sentiment word in the two sentiment words, form a sentiment word group. For example, "not very friendly" forms a sentiment word group, "not" is a negation word, "not very" is a degree adverb, and "friendly" is a sentiment word. The value of N is 0 or 1, where 1 indicates that the i-th sentiment word group contains a negation word, and 0 indicates that the i-th sentiment word group does not contain a negation word. W adv (i) indicates the degree value or weight of the degree adverb in the i-th emotion group, and relates to the degree of strength that the degree adverb indicates. word (i) indicates the emotional value of the emotional word in the i-th emotional word group, where an emotional value greater than 0 indicates a positive emotion, a value less than 0 indicates a negative emotion, and a value equal to 0 indicates a neutral emotion.
[0052] The architecture 200 may further include a comparison result generation module 250 configured to generate a comparison result indicating whether the target text 110 and the reference text 120 are similar. In some embodiments, the comparison result generation module 250 may determine whether the target text 110 and the reference text 120 are similar based on sentiment polarity, verb similarity, noun similarity, and text similarity. For example, a weighted sum of the sentiment polarity, verb similarity, noun similarity, and text similarity may be performed. If the result of the weighted sum is greater than a threshold, it may be determined that the target text 110 and the reference text 120 are similar.
[0053] In some embodiments, a matching determination of sentiment polarity may be performed first. If the sentiment polarities of the target text 110 and the reference text 120 are not opposite, the similarity (final similarity) between the target text 110 and the reference text 120 is determined based on the verb similarity, the noun similarity, and the text similarity. For example, the final similarity may be a weighted average of the verb similarity, the noun similarity, and the text similarity, as shown in the following formula: TIFF0007775909000002.tif17155(2)
[0054] Here, Score indicates the final similarity between the target text 110 and the reference text 120, and α, β, and γ indicate the weights of verb similarity, noun similarity, and text similarity, respectively.
[0055] An example of process 300 is described below with reference to Figure 3. Process 300 is used to compare whether text A and text B are similar, where, for example, text A may be considered an example of target text 110 and text B may be considered an example of reference text 120.
[0056] In block 305, the text similarity is determined based on the word vectors. For example, as described above with reference to FIG. 2, word vectors are generated based on the word2vec model, and then a text vector is determined based on the word vector average. Next, the text similarity (also referred to as word vector-based similarity) may be determined using the cosine value of the vectors of text A and text B. In block 305, it is determined whether the word vector-based similarity is greater than a threshold.
[0057] If the similarity based on the word vectors is less than or equal to the threshold, process 300 ends, i.e., text B is not used as a reference text for further detailed comparison. If the similarity based on the word vectors is greater than the threshold, process 300 proceeds to block 315. In block 315, the part of speech of each word in text A and text B is determined. For example, any suitable method can be used to perform word segmentation on text A and text B, respectively, and determine the part of speech of each word.
[0058] Next, a matching determination of emotional polarity is performed. In block 320, emotional words, negation words, and degree adverbs are matched using a dictionary. For example, an emotional dictionary, a negation dictionary, and a degree adverb dictionary are used to determine emotional words, negation words, and degree adverbs in text A and text B, respectively. In block 325, the emotional polarity of text A and text B is determined. For example, a emotional polarity score SeA for text A and a emotional polarity score SeB for text B are generated according to equation (1), respectively.
[0059] At block 330, it is determined whether the sentiment polarities of text A and text B are opposite. If the sentiment polarities are opposite, text A and text B are deemed dissimilar, and process 300 terminates accordingly. If the sentiment polarities of text A and text B are not opposite, the two texts may be similar. Therefore, process 300 proceeds to block 335.
[0060] In block 335, word vectors of nouns in text A and text B are determined. For example, if a text contains multiple nouns, the sum of the word vectors of each noun may be calculated. In block 340, noun similarity between text A and text B is determined. For example, the cosine value between the word vectors of the noun set in text A and the noun set in text B may be calculated as the noun similarity.
[0061] In block 345, word vectors of verbs in text A and text B are determined. For example, if a text contains multiple verbs, the word vectors of each verb may be summed. In block 350, verb similarity between text A and text B is determined. For example, the cosine value between the word vectors of the verb set in text A and the verb set in text B may be calculated as the verb similarity.
[0062] In block 360, text vectors for text A and text B are obtained based on a deep learning model. For example, a BERT model may be used to generate text vector A for text A and text vector B for text B. In block 365, a text similarity based on the deep learning model is determined. For example, the cosine value of text vector A and text vector B may be determined as the text similarity based on the deep learning model.
[0063] In block 370, a weighted sum of the noun similarity, the verb similarity, and the text similarity based on the deep learning model is calculated to obtain a final similarity. For example, the final similarity may be calculated according to Equation (2). In block 375, a comparison result is generated based on a threshold. If the final similarity determined in block 370 is equal to or less than the threshold, it is determined that text A and text B are dissimilar.
[0064] If the final similarity determined in block 370 is greater than a threshold, it is determined that text A and text B are similar. Thus, the processing result of the NLP task can be obtained. For example, in an event graph scenario, it can be determined that the event described by text A and the event described by text B are similar events. In a text classification scenario, it can be determined that text A and text B are classified into the same category.
[0065] It should be understood that process 300 is merely an exemplary embodiment of text similarity determination and is not intended to limit the scope of the present disclosure. Many suitable variations on process 300 may be made.
[0066] As an example, Table 1 shows the durations of the major steps in the exemplary process 300. [Table 1]
[0067] As can be seen from Table 1, the execution efficiency of the text screening step is high, and most dissimilar texts can be filtered out. By screening the remaining text using sophisticated ranking (sentiment polarity calculation, text similarity calculation, verb similarity calculation, and noun similarity calculation), the screening efficiency of similar text pairs can be effectively improved.
[0068] Table 2 shows an example of the performance of the similarity determination method of the embodiment of the present disclosure, where the performance parameter F1 is related to the precision rate and the recall rate and can comprehensively reflect the precision rate and the recall rate. The performance in Table 2 was obtained by measuring 315 similar text pairs and 700 dissimilar text pairs. [Table 2]
[0069] Compared with some conventional solutions, the solution of the embodiment of the present disclosure improves the F1 value by about 18% to 28% and takes less time (e.g., a few seconds). Therefore, according to the embodiment of the present disclosure, an overall improvement in performance can be achieved.
[0070] Example process 4 is a flowchart of a process 400 for processing information according to some embodiments of the present disclosure. Process 400 may be implemented in electronic device 150. For ease of discussion, process 400 will be described with reference to FIG.
[0071] In block 410, the electronic device 150 obtains reference text for comparison with the target text. For example, in an event graph scenario, the reference text is used to describe an existing event in the event graph.
[0072] In some embodiments, to obtain the reference text, the electronic device 150 determines, for each candidate text in the plurality of candidate texts, a third similarity between the candidate text and the target text based on the quantified representation of each word in the target text and the quantified representation of each word in the candidate text, and determines the candidate text whose third similarity is greater than the first threshold similarity as the reference text.
[0073] In block 420, the electronic device 150 determines verb similarity based on the parts of speech corresponding to words in the target text and the reference text, which indicates whether the target text contains a verb and whether the reference text contains a verb, or the similarity between the verbs in the target text and the verbs in the reference text.
[0074] In some embodiments, to determine the verb similarity, the electronic device 150 determines whether the target text includes a verb and whether the reference text includes a verb based on corresponding parts of speech, and in response to determining that the target text includes a verb and that the reference text includes a verb, determines the verb similarity based on the quantified representation of the verb in the target text and the quantified representation of the verb in the reference text.
[0075] In block 430, the electronic device 150 determines a first similarity between the target text and the reference text based on at least the verb similarity.
[0076] In some embodiments, to determine the first similarity, the electronic device 150 determines whether the target text or the reference text contains a noun based on corresponding parts of speech, and in response to determining that the target text contains a noun and the reference text contains a noun, determines a noun similarity based on quantified representations of the nouns in the target text and quantified representations of the nouns in the reference text, and determines the first similarity based on at least the verb similarity and the noun similarity.
[0077] In some embodiments, to determine the first similarity, the electronic device 150 determines a quantified representation of the target text generated based on the context of the target text and a quantified representation of the reference text generated based on the context of the reference text, determines a second similarity between the target text and the reference text based on the quantified representation of the target text and the quantified representation of the reference text, and determines the first similarity based on the verb similarity, the noun similarity, and the second similarity.
[0078] In some embodiments, to determine the first similarity, the electronic device 150 determines whether the sentiment polarities of the target text and the reference text are opposite to each other, and in response to the sentiment polarities not being opposite to each other, determines the first similarity based at least on the verb similarity.
[0079] In some embodiments, the emotional polarity of the corresponding text in the target text and the reference text is determined based on at least one of the emotional value of the emotional word in the corresponding text, whether the corresponding text includes a negation word associated with the emotional word, or the degree value of the degree adverb associated with the emotional word in the corresponding text.
[0080] In some embodiments, the target text is used to describe a first event and the reference text is used to describe a second event, and the electronic device 150 further determines that the first event and the second event have a similarity relationship in response to the first similarity being greater than a second threshold similarity.
[0081] Example Device 5 is a block diagram of one or more example electronic devices 500 in which the present disclosure may be implemented. It should be understood that the electronic device 500 shown in FIG. 5 is merely an example and is not intended to limit in any way the functionality or scope of the examples described herein. The electronic device 500 shown in FIG. 5 may be used to implement the electronic device 150 of FIG. 1.
[0082] 5, electronic device 500 is a form of general-purpose electronic device. Components of electronic device 500 include, but are not limited to, one or more processors or processing units 510, memory 520, storage device 530, one or more communication units 540, one or more input devices 550, and one or more output devices 560. Processing unit 510 may be a real or virtual processor and performs various processes according to programs stored in memory 520. In a multiprocessor system, multiple processing units execute computer-executable instructions in parallel to increase the parallel processing capabilities of electronic device 500.
[0083] The electronic device 500 typically includes a number of computer storage media. Such media may be any available media accessible by the electronic device 500, including, but not limited to, volatile and nonvolatile media, removable and non-removable media. The memory 520 may be volatile memory (e.g., registers, cache, random access memory (RAM)), non-volatile memory (e.g., read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory), or a combination thereof. The storage device 530 may be removable or non-removable media, and may be a machine-readable medium, such as a flash memory drive, a magnetic disk, or any other medium, for storing information and / or data (e.g., training data for training) and accessible within the electronic device 500.
[0084] The electronic device 500 may further include other removable / non-removable, volatile / non-volatile storage media. Although not shown in FIG. 5, a magnetic disk drive capable of reading from or writing to a removable, non-volatile magnetic disk (e.g., a "floppy disk") and an optical disk drive capable of reading from or writing to a removable, non-volatile optical disk may also be provided. In these configurations, each drive is connected to a bus (not shown) via one or more data medium interfaces. The memory 520 may include a computer program product 525 having one or more program modules configured to perform various methods or operations of various embodiments of the present disclosure.
[0085] The communication unit 540 can communicate with other electronic devices via a communication medium. Furthermore, the functionality of the components of the electronic device 500 can be implemented as a single computational cluster or multiple computing machines, which can communicate via a communication connection. Thus, the electronic device 500 can operate in a networked environment via logical connections to one or more other servers, network personal computers (PCs), or other network nodes.
[0086] The input device(s) 550 may be one or more input devices, such as a mouse, a keyboard, a tracking ball, etc. The output device(s) 560 may be one or more output devices, such as a display, a speaker, a printer, etc. If necessary, the electronic device 500 may communicate via the communication unit 540 with one or more external devices (not shown), such as a storage device, a display device, one or more devices for user interaction with the electronic device 500, or any device (e.g., a network card, a modem, etc.) for communication between the electronic device 500 and one or more other electronic devices. Such communication may be performed via an input / output (I / O) interface (not shown).
[0087] According to an exemplary embodiment of the present disclosure, a computer-readable storage medium is provided having computer-executable instructions stored thereon, the computer-executable instructions being executed by a processor to perform the above-described method. According to an exemplary embodiment of the present disclosure, a computer program product is further provided, the computer program product being tangibly stored on a non-transitory computer-readable medium and including computer-executable instructions, the computer-executable instructions being executed by a processor to perform the above-described method.
[0088] Aspects of the present disclosure will now be described with reference to flowchart and / or block diagrams of methods, apparatus, devices and computer program products implemented in accordance with the present disclosure, where each block of the flowchart and / or block diagrams, and combinations of blocks in the flowchart and / or block diagrams, can all be implemented by computer-readable program instructions.
[0089] These computer-readable program instructions may be provided to a processing unit of a general-purpose computer, special-purpose computer, or other programmable data processing device to produce an apparatus, and when these instructions are executed by the processing unit of the computer or other programmable data processing device, the apparatus implements the functions / operations specified in one or more blocks in the flowcharts and / or block diagrams. These computer-readable program instructions may be stored on a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other apparatus to operate in a particular manner, and a computer-readable medium having instructions stored thereon includes an article of manufacture having various instructions for implementing the functions / operations specified in one or more blocks in the flowcharts and / or block diagrams.
[0090] The computer-readable program instructions are loaded into a computer, other programmable data processing apparatus, or other device and cause the computer, other programmable data processing apparatus, or other device to execute a series of operational steps to produce a computer-implemented process, and the instructions executing on the computer, other programmable data processing apparatus, or other device implement the functions / acts specified in one or more blocks in the flowcharts and / or block diagrams.
[0091] The flowcharts and block diagrams in the accompanying drawings illustrate possible architectures, functions, and operations of systems, methods, and computer program products that may be implemented according to aspects of the present disclosure. In this regard, each block in a flowchart or block diagram represents a module, program segment, or part of an instruction, which includes one or more executable instructions for implementing a specified logical function. In some alternative embodiments, the functions marked in the blocks may occur in a different order than that shown in the accompanying drawings. For example, two consecutive blocks may be executed substantially in parallel, and depending on the function, may be executed in reverse order. Furthermore, each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented by a dedicated hardware-based system that performs the specified functions or operations, or by a combination of dedicated hardware and computer instructions.
[0092] Although each aspect of the present disclosure has been described above, the above description is illustrative and not exhaustive, and is not limited to each of the disclosed aspects. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of each of the described aspects. The terms used in this specification are selected to best explain the principles, practical applications, or technical improvements in the marketplace of each aspect, or to enable those skilled in the art to understand each embodiment disclosed herein.
Claims
1. A processor comprising: Obtaining a reference text to compare with the target text; determining whether the target text includes a verb, whether the reference text includes a verb, or a verb similarity indicating a similarity between a verb included in the target text and a verb included in the reference text based on parts of speech corresponding to words in the target text and the reference text; determining a first similarity between the target text and the reference text based at least on the verb similarity; Determining the first similarity includes: determining whether the target text and the reference text have opposite sentiment polarities; determining the first similarity based at least on the verb similarity in response to the sentiment polarities being not opposite to each other; Information processing methods.
2. Determining the verb similarity includes: determining whether the target text includes a verb and whether the reference text includes a verb based on the corresponding parts of speech; and 10. The method of claim 1, comprising: in response to the target text including a verb and the reference text including a verb, determining the verb similarity based on a quantified representation of a verb in the target text and a quantified representation of a verb in the reference text.
3. Determining the first similarity includes: determining whether the target text includes a noun and whether the reference text includes a noun based on the corresponding parts of speech; responsive to determining that the target text includes nouns and that the reference text includes nouns, determining a noun similarity based on quantified representations of nouns in the target text and quantified representations of nouns in the reference text; The method of claim 1 , comprising determining the first similarity measure based on at least the verb similarity measure and the noun similarity measure.
4. Determining the first similarity includes: determining a quantified representation of the target text generated based on the context of the target text and a quantified representation of the reference text generated based on the context of the reference text; determining a second similarity between the target text and the reference text based on the quantified representation of the target text and the quantified representation of the reference text; The method of claim 3 , further comprising determining the first similarity measure based on the verb similarity measure, the noun similarity measure, and the second similarity measure.
5. The sentiment polarity of the corresponding text in the target text and the reference text is the emotional values of the emotional words in the corresponding text; whether the corresponding text includes a negative word related to the emotion word; or The method of claim 1 , wherein the degree value of the emotion word is determined based on at least one of degree values of degree adverbs associated with the emotion word in the corresponding text.
6. A processor comprising: Obtaining a reference text to compare with the target text; determining whether the target text includes a verb, whether the reference text includes a verb, or a verb similarity indicating a similarity between a verb included in the target text and a verb included in the reference text based on parts of speech corresponding to words in the target text and the reference text; determining a first similarity between the target text and the reference text based at least on the verb similarity; Obtaining the reference text comprises: For each candidate text among a plurality of candidate texts, determining a third similarity between the candidate text and the target text based on the quantified representation of each word in the target text and the quantified representation of each word in the candidate text; determining, as the reference text, a candidate text for which the third similarity is greater than a first threshold similarity.
7. the target text is used to describe a first event and the reference text is used to describe a second event; The method comprises: The method of claim 1 , further comprising: determining that the first event and the second event have a similarity relationship in response to the first similarity being greater than a second threshold similarity.
8. An electronic device comprising at least one processing circuit configured to perform the method of any one of claims 1 to 7.
Citation Information
Patent Citations
Semantic collating device
JP1987196726A
Relevance analyzing device and method
JP2021103406A