Information identification method, device, equipment, storage medium and product
By extracting and comparing the semantic feature information of the target text and the annotation text, the problems of low accuracy and high cost of manual review and recognition of metaphor information are solved, and automated metaphor information recognition is realized, improving accuracy and reducing costs.
Patent Information
- Application Number
- CN202210166578.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-23
- Publication Date
- 2024-12-13
- Estimated Expiration
- 2042-02-23
AI Technical Summary
In the prior art, manual review and identification of metaphorical information in Internet texts is low in accuracy and costly, making it difficult to effectively identify metaphorical information in massive texts.
By obtaining the corpus unit and annotation text of the target text, the semantic information is extracted, the semantic feature information is obtained, and the metaphorical information is recognized based on these feature information, which improves the accuracy of metaphorical information recognition and reduces labor costs.
It realizes metaphor information recognition without manual annotation, improves the accuracy and efficiency of metaphor information recognition, reduces labor costs, and can automatically identify metaphorical information in text.
Smart Images

Figure CN114662496B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to an information recognition method, device, equipment, storage medium and product. Background Art
[0002] With the development of Internet technology, a large amount of text has appeared on the Internet. Some users choose to use metaphors to circumvent the Internet's security review strategy, such as metaphors.
[0003] In related technologies, manual review is usually used to determine whether the text content published on the Internet contains metaphorical information, and to manually mark whether the metaphorical information complies with regulations; or, existing metaphor cases and semantic rules are combined to identify newly emerging texts to determine whether they contain non-compliant metaphorical information.
[0004] In the related art, the accuracy of information recognition for metaphor information is low and the labor cost is high. Summary of the invention
[0005] The embodiments of the present application provide an information recognition method, device, equipment, storage medium and product, which can improve the accuracy of metaphor information recognition and reduce labor costs.
[0006] According to one aspect of an embodiment of the present application, there is provided an information identification method, the method comprising:
[0007] Obtain the target corpus unit corresponding to the target text;
[0008] Obtaining annotation text corresponding to the target corpus unit;
[0009] Performing word semantic information extraction processing on the target text to obtain first semantic feature information corresponding to the target corpus unit;
[0010] Performing text semantic information extraction processing on the annotation text to obtain second semantic feature information corresponding to the annotation text;
[0011] Based on the first semantic feature information and the second semantic feature information, metaphor information recognition processing is performed on the target text to obtain metaphor information corresponding to the target text.
[0012] According to one aspect of an embodiment of the present application, there is provided an information identification device, the device comprising:
[0013] A target corpus acquisition module is used to acquire the target corpus unit corresponding to the target text;
[0014] An annotation text acquisition module, used to acquire the annotation text corresponding to the target corpus unit;
[0015] A semantic information extraction module, used for performing word semantic information extraction processing on the target text to obtain first semantic feature information corresponding to the target corpus unit;
[0016] The semantic information extraction module is further used to perform text semantic information extraction processing on the annotation text to obtain second semantic feature information corresponding to the annotation text;
[0017] The metaphor information recognition module is used to perform metaphor information recognition processing on the target text based on the first semantic feature information and the second semantic feature information to obtain the metaphor information corresponding to the target text.
[0018] According to one aspect of an embodiment of the present application, a computer device is provided, comprising a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the above-mentioned information identification method.
[0019] According to one aspect of an embodiment of the present application, a computer-readable storage medium is provided, in which at least one instruction, at least one program, a code set or an instruction set is stored, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by a processor to implement the above-mentioned information identification method.
[0020] According to one aspect of the embodiments of the present application, a computer program product is provided, the computer program product comprising computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes to implement the above-mentioned information identification method.
[0021] The technical solution provided in the embodiments of the present application can bring the following beneficial effects:
[0022] By performing word semantic information extraction on the target text, the semantic feature information corresponding to the target corpus unit in the target text can be obtained. By performing text semantic information extraction on the annotation text corresponding to the target corpus unit, the semantic feature information corresponding to the annotation text can be obtained. Based on the semantic feature information of the target corpus unit and the second semantic feature information of the annotation text corresponding to the target corpus unit, metaphor information recognition can be performed on the target text to obtain the metaphor information of the target text using metaphors, without the need for manual annotation, thus reducing labor costs. In addition, the method of performing metaphor recognition in combination with the semantic features of the annotation text corresponding to the target corpus unit can improve the accuracy of metaphor information recognition. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0024] Figure 1 is a schematic diagram of an application program operating environment provided by an embodiment of the present application;
[0025] Figure 2 This is the process of the information identification method provided by an embodiment of the present application Figure 1 ;
[0026] Figure 3 This is the process of the information identification method provided by an embodiment of the present application Figure 2 ;
[0027] Figure 4 A schematic diagram of a process for determining semantic similarity is exemplified;
[0028] Figure 5 is a block diagram of an information identification device provided by an embodiment of the present application;
[0029] Figure 6 It is a structural block diagram of a computer device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0030] The information recognition method provided in the embodiments of the present application can be applied to various scenarios, including but not limited to cloud technology, artificial intelligence, smart transportation, assisted driving, etc.
[0031] The information identification method provided in the embodiment of the present application involves artificial intelligence technology and cloud technology, which are briefly described below to facilitate understanding by those skilled in the art.
[0032] Artificial Intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines so that machines have the functions of perception, reasoning and decision-making.
[0033] Artificial intelligence technology is a comprehensive discipline that covers a wide range of fields, including both hardware-level and software-level technologies. Basic artificial intelligence technologies generally include sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operating / interactive systems, mechatronics, and other technologies. Artificial intelligence software technologies mainly include computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0034] Natural language processing (NLP) is an important direction in the fields of computer science and artificial intelligence. It studies various theories and methods that can achieve effective communication between people and computers using natural language. Natural language processing is a science that integrates linguistics, computer science, and mathematics. Therefore, research in this field will involve natural language, that is, the language people use in daily life, so it is closely related to the study of linguistics. Natural language processing technology usually includes text processing, semantic understanding, machine translation, robot question answering, knowledge graph and other technologies.
[0035] Machine Learning (ML) is a multi-disciplinary subject that involves probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory and other disciplines. It specializes in studying how computers simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications are spread across all areas of artificial intelligence. Machine learning and deep learning usually include artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and self-learning.
[0036] Cloud technology refers to a hosting technology that unifies hardware, software, network and other resources within a wide area network or local area network to achieve data computing, storage, processing and sharing.
[0037] Cloud computing is a computing model that distributes computing tasks on a resource pool composed of a large number of computers, allowing various application systems to obtain computing power, storage space and information services as needed. The network that provides resources is called a "cloud". From the user's perspective, the resources in the "cloud" are infinitely scalable and can be obtained at any time, used on demand, expanded at any time, and paid for by use.
[0038] As a provider of basic cloud computing capabilities, a cloud computing resource pool (referred to as a cloud platform, generally referred to as an IaaS (Infrastructure as a Service) platform) will be established, and various types of virtual resources will be deployed in the resource pool for external customers to choose to use. The cloud computing resource pool mainly includes: computing devices (virtualized machines, including operating systems), storage devices, and network devices.
[0039] According to the logical function division, the PaaS (Platform as a Service) layer can be deployed on the IaaS (Infrastructure as a Service) layer, and the SaaS (Software as a Service) layer can be deployed on the PaaS layer. SaaS can also be deployed directly on IaaS. PaaS is a platform for software operation, such as databases, web (network) containers, etc. SaaS is a variety of business software, such as web portals, SMS mass senders, etc. Generally speaking, SaaS and PaaS are upper layers relative to IaaS.
[0040] Cloud computing technology will become an important support. The backend services of technical network systems require a large amount of computing and storage resources, such as video websites, image websites and more portal websites. With the rapid development and application of the Internet industry, the massive amount of text that appears may have its own identification marks in the future, and all need to be transmitted to the backend system for logical processing. Data of different levels will be processed separately. All kinds of industry data require strong system backing support, which can only be achieved through cloud computing.
[0041] Artificial intelligence cloud service is generally referred to as AIaaS (AI as a Service). This is the service mode of a mainstream artificial intelligence platform. Specifically, the AIaaS platform will split several common AI services and provide independent or packaged services in the cloud. This service model is similar to opening an AI theme mall: all developers can access and use one or more artificial intelligence services provided by the platform through API interfaces. Some senior developers can also use the AI framework and AI infrastructure provided by the platform to deploy and operate their own cloud artificial intelligence services.
[0042] With the research and progress of artificial intelligence technology and cloud technology, artificial intelligence technology and cloud technology have been studied and applied in many fields. For example, common information service systems, smart homes, smart wearable devices, virtual assistants, smart speakers, smart marketing, unmanned driving, automatic driving, drones, robots, smart medical care, smart customer service, etc. It is believed that with the development of technology, artificial intelligence technology will be applied in more fields and play an increasingly important role.
[0043] The present application provides an information recognition method, which can combine the above-mentioned artificial intelligence technology and cloud technology to perform information recognition on the text to identify the metaphorical information that uses metaphorical rhetoric.
[0044] The following is a brief introduction to the application scenarios, relevant terms or nouns that may be involved in the embodiments of the method of the present application, so as to facilitate understanding by technicians in the field of the present application.
[0045] Metaphor is the core issue of human thought and language understanding. With the development of the Internet and the emergence of massive texts, more and more users choose to use metaphors to circumvent existing censorship strategies, such as using metaphors to insult or post inappropriate remarks. Automatic identification of metaphorical texts has become an urgent need in the censorship business.
[0046] Metaphor is the main means to describe and understand abstract concepts. It is not only a linguistic phenomenon, but also a cognitive method. People often use simple, concrete, and familiar concepts to describe and explain complex, abstract, and unknown concepts, thereby forming concepts and using them to experience and perceive the world. For example, "time is money" is a metaphor that uses the concrete concept of "money" to describe the valuable attributes of the abstract concept of "time". The essence of metaphor is a systematic mapping from the concrete concept domain (source domain) to the abstract concept domain (target domain).
[0047] The information recognition method provided in the embodiment of the present application can be used for metaphor recognition, and a computer device can automatically recognize metaphor information in a text by applying the above method.
[0048] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
[0049] Please refer to Figure 1 , which shows a schematic diagram of an application program running environment provided by an embodiment of the present application. The application program running environment may include: a terminal 10 and a server 20.
[0050] The terminal 10 includes, but is not limited to, electronic devices such as mobile phones, computers, intelligent voice interaction devices, smart home appliances, vehicle-mounted terminals, game consoles, e-book readers, multimedia playback devices, wearable devices, and aircraft. The terminal 10 may be installed with a client of an application program.
[0051] In the embodiment of the present application, the above-mentioned application can be any application that can provide information services. Typically, the application is a social application. Of course, in addition to social applications, information services can also be provided in other types of applications. For example, interest applications, comment applications, video applications, news applications, interactive entertainment applications, browser applications, shopping applications, content sharing applications, virtual reality (Virtual Reality, VR) applications, augmented reality (Augmented Reality, AR) applications, etc., the embodiment of the present application does not limit this. In addition, for different applications, the text content involved will also be different, and the corresponding functions will also be different, which can be pre-configured according to actual needs, and the embodiment of the present application does not limit this. Optionally, a client of the above-mentioned application is running in the terminal 10.
[0052] The server 20 is used to provide background services for the client of the application in the terminal 10. For example, the server 20 can be the background server of the above application. The server 20 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. Optionally, the server 20 provides background services for applications in multiple terminals 10 at the same time.
[0053] Optionally, the terminal 10 and the server 20 may communicate with each other via a network 30. The terminal 10 and the server 20 may be directly or indirectly connected via wired or wireless communication, which is not limited in the present application.
[0054] Please refer to Figure 2 , which shows the process of the information identification method provided by an embodiment of the present application Figure 1 The method can be applied to a computer device, which refers to an electronic device with data calculation and processing capabilities. For example, the execution subject of each step can be Figure 1 The terminal 10 or server 20 in the application running environment shown. The method may include the following steps (201-205).
[0055] Step 201, obtaining a target corpus unit corresponding to a target text.
[0056] The target text is the text to be detected in the embodiment of the present application. The target text includes but is not limited to video text, audio text, recording text, article text, paragraph text, sentence text. The video text includes but is not limited to the subtitle text, narration text, audio transcription text, etc. corresponding to the video.
[0057] The target corpus units include but are not limited to characters and / or words in the target text. For example, nouns, verbs, adjectives, adverbs and single characters in the target text can all serve as the target corpus units.
[0058] Optionally, the target corpus unit can be obtained by performing word recognition on the target text. For example, the target text is processed for word recognition to obtain a corpus unit sequence; the characters and / or words in the corpus unit sequence that meet the preset word conditions are determined as target corpus units. The preset word conditions include but are not limited to part-of-speech conditions. For example, the part-of-speech condition is that the part of speech is noun and / or verb; accordingly, the nouns and / or verbs in the target text are determined as target corpus units.
[0059] In an exemplary embodiment, if Figure 3 As shown, the above step 210 may include the following steps (2011-2013): Figure 3 The following is a flow chart of an information identification method provided by an embodiment of the present application. Figure 2 .
[0060] Step 2011, perform word segmentation processing on the target text to obtain a corpus unit sequence.
[0061] By using the word segmentation method, the input target text is segmented into words to obtain the above-mentioned corpus unit sequence. The corpus unit sequence includes at least one recognized corpus unit. The word segmentation result corresponding to the above-mentioned word segmentation processing is to divide the above-mentioned target text into each recognized corpus unit.
[0062] Optionally, the target text is input into a word segmentation machine learning model to perform the word segmentation processing to obtain the corpus unit sequence.
[0063] Optionally, a character sequence consisting of each character in the target text is obtained, and each character in the above character sequence is input into a word segmentation neural network model. The word segmentation neural network model can learn to obtain the association relationship between each character, and output the word segmentation result according to the association relationship. Each recognition corpus unit in the above word segmentation result constitutes the above corpus unit sequence according to the order of their position in the target text.
[0064] Step 2012: Obtain part-of-speech information corresponding to at least one recognition corpus unit.
[0065] Since metaphor information can be divided into different types according to different parts of speech, for example, metaphors in metaphors are usually divided into noun metaphors and verb metaphors, the part of speech information corresponding to the at least one recognition corpus unit can be obtained to find the target corpus unit. The above part of speech information is used to characterize the part of speech type corresponding to the word.
[0066] Optionally, a correspondence information library between corpus units and part-of-speech types is obtained; after obtaining the at least one recognition corpus unit, the part-of-speech information corresponding to the at least one recognition corpus unit can be determined based on the correspondence library.
[0067] Step 2013, determining the target corpus unit based on the part-of-speech information.
[0068] Optionally, the recognition corpus unit whose part of speech type in the at least one recognition corpus unit is the target part of speech type is determined as the target corpus unit. The target part of speech type includes noun type, verb type, etc., which is not limited in the embodiment of the present application. For example, the nouns and verbs in the target text are determined as the target corpus unit.
[0069] Other corpus units in the target text except the target corpus units can be used as context corpus units.
[0070] Step 202: Obtain the annotation text corresponding to the target corpus unit.
[0071] In a possible implementation, word dictionary information is obtained, the word dictionary information includes at least one annotation text corresponding to multiple corpus units; after the target corpus unit is obtained, the annotation text corresponding to the target corpus unit can be obtained from the word dictionary information.
[0072] Optionally, the above-mentioned word dictionary information includes but is not limited to dictionaries in various languages such as Chinese dictionaries, English dictionaries, and dictionaries of various programming languages. The embodiment of the present application is not limited to this. The selection of the above-mentioned word dictionary information can be flexibly configured according to the specific application scenario.
[0073] Optionally, the annotation texts are the first preset number of annotation texts corresponding to the target corpus unit in the word dictionary information.
[0074] For example, the annotation text is the first annotation text corresponding to the target corpus unit in the dictionary information. Since the first annotation of a word included in some dictionaries is the most common and commonly used meaning of the word, the annotation text can represent the semantic information of the corresponding corpus unit itself. Selecting the annotation text as a reference can effectively improve the accuracy of metaphor information recognition.
[0075] Step 203: extract word semantic information from the target text to obtain first semantic feature information corresponding to the target corpus unit.
[0076] Optionally, the first semantic feature information corresponding to the target corpus unit is the semantic feature information corresponding to the target corpus unit in the target text, which represents the actual semantic information corresponding to the target corpus unit in the target text.
[0077] In an exemplary embodiment, the target text includes a target corpus unit and a context corpus unit, wherein the context corpus unit is a corpus unit other than the target corpus unit in the target text; accordingly, Figure 3 As shown, the above step 203 may include the following steps (2031-2302).
[0078] Step 2031, input the target text into the semantic feature extraction model.
[0079] Step 2032: Based on the semantic feature extraction model, perform semantic information feature extraction processing on the context corpus unit to obtain a first semantic feature vector corresponding to the target corpus unit.
[0080] The first semantic feature information includes a first semantic feature vector, and the first semantic feature vector is used to represent the semantic information corresponding to the target corpus unit in the target text.
[0081] In a possible implementation, the target corpus unit in the target text is replaced with a preset marker to obtain a replaced target text, wherein the replaced target text includes the preset marker and the context corpus unit. The replaced target text is input into a semantic feature extraction model, and based on the semantic feature extraction model, semantic information feature extraction is performed on the context corpus unit in the replaced target text, and a first semantic feature vector corresponding to the target corpus unit is output.
[0082] In an exemplary embodiment, the semantic feature extraction model is a machine learning model trained based on sample text, and the amount of information of the metaphor information corresponding to the sample text is less than an information amount threshold. Optionally, the sample text includes at least two sentence texts.
[0083] Since metaphorical information exists in large quantities in daily texts, some pre-trained language models have already partially included metaphorical information, which is not conducive to the identification of metaphorical information. Therefore, the embodiment of the present application chooses to collect sample texts from relatively serious and objective news and academic papers to train the above-mentioned semantic feature extraction model. Since news and academic papers are objective and serious, the metaphorical information contained therein is relatively small, and the texts whose information amount of metaphorical information is less than the information amount threshold can be selected as sample texts, or the texts in the above-mentioned news texts and academic papers can be used as sample texts. The information amount of the above-mentioned metaphorical information can be determined according to the number of metaphorical words in the text. Based on the above-mentioned sample texts, the above-mentioned target machine learning model is trained to obtain a trained semantic feature extraction model, so that the feature information output by the trained semantic feature extraction model will not contain metaphorical information or contain less metaphorical information, which can improve the accuracy and stability of the semantic feature information, and is conducive to improving the accuracy of identifying the metaphorical information in the text by comparing the semantic feature information in the subsequent steps.
[0084] Optionally, the sample texts mentioned above also include texts from interactive commentary texts, literary classics, and legal texts, which are not limited in this application.
[0085] Optionally, the target machine learning model is a bidirectional encoder representation model based on a transformation model (Bidirectional Encoder Representations from Transformers, BERT). Optionally, the BERT model includes 12 layers of encoders and 12 layers of decoders, and the hidden layer dimension of each encoder / decoder is 768, and accordingly, the output semantic feature vector is also 768-dimensional.
[0086] In a possible implementation, the training task corresponding to the semantic feature extraction model is divided into two different parts. One of them is a character masking task (Masked Language Model, Masked LM), and its corresponding operation includes: randomly replacing a word in the sample text with a preset marker [Mask], and then inputting the replaced sample text into the semantic feature extraction model, so that the semantic feature extraction model predicts the word at the position of the preset marker based on other context words in the sample text except the word, and obtains the embedded feature vector corresponding to the word.
[0087] Accordingly, the training process of the above semantic feature extraction model includes the following:
[0088] Traverse at least two sentence texts. Optionally, traverse each sentence text of the at least two sentence texts.
[0089] Each time a sentence text is traversed, the corpus unit at the target position in the traversed sentence text is replaced with a preset marker to obtain the replaced sentence text. Optionally, the above target position is a randomly determined position, and the above corpus unit can be a character or word at the target position in the sentence text.
[0090] The replaced sentence text is input into the target machine learning model, and the semantic feature vector corresponding to the corpus unit is output. The corpus unit at the above target position can be used as the corpus unit to be predicted by the target machine learning model. After the corpus unit at the target position is replaced with a preset marker, the replaced sentence text only includes the corpus units outside the target position. The corpus unit in the replaced sentence text is the context corpus unit corresponding to the corpus unit at the target position. The target machine learning model can represent the corpus unit at the target position based on the context corpus unit to obtain the semantic feature vector corresponding to the corpus unit.
[0091] When at least two sentences are traversed, a semantic feature extraction model is obtained based on the target machine learning model. Optionally, when at least two sentences are traversed, the target machine learning model has learned the language knowledge in the sample text, and the target machine learning model can be determined as the above-mentioned semantic feature extraction model.
[0092] Another task corresponding to the above semantic feature extraction model is the context prediction task (Next SentencePrediction), which is to determine whether the two input texts are in a context relationship. Correspondingly, the above training process also includes the following contents:
[0093] Determine a sentence text pair from at least two sentence texts. Optionally, the sentence text pair is determined based on two different sentence texts from the at least two sentence texts. In a possible implementation, the sentence texts from the at least two sentence texts can be randomly combined in pairs to obtain a plurality of sentence text pairs.
[0094] Traverse the sentence text pairs; optionally, traverse each pair of sentence texts in the above multiple sentence text pairs.
[0095] The traversed sentence text pair is input into the target machine learning model, and the contextual relationship information corresponding to the traversed sentence text pair is output. The above-mentioned contextual relationship information is used to characterize the contextual relationship between the two sentence texts in the traversed sentence text pair. Optionally, the above-mentioned target machine learning model can perform feature extraction processing on each corpus unit in the input pair of sentence texts to obtain the embedded feature vectors of the corpus units corresponding to each of the two sentence texts. Then, the embedded feature vectors corresponding to each corpus unit corresponding to the two sentence texts are respectively average pooled to obtain the text semantic feature vectors corresponding to the two sentence texts, so as to judge whether the two sentence texts are in a contextual relationship based on the text semantic feature vectors corresponding to the above-mentioned two sentence texts. According to the actual positional relationship between the two sentence texts in the sample text, it can be judged whether the contextual relationship information output by the target machine learning model is accurate, thereby completing the training of the target machine learning model.
[0096] When at least two sentence texts and sentence text pairs are traversed, a semantic feature extraction model is obtained based on the target machine learning model. Optionally, when at least two sentence texts and sentence text pairs are traversed, the above two training tasks are completed, and the target machine learning model has learned the high-level language knowledge in the sample text, so the target machine learning model can be determined as the above semantic feature extraction model.
[0097] Training the semantic feature extraction model based on the above two tasks can enable the semantic feature extraction model to obtain language knowledge of relevant contexts, so that it can extract semantic feature vectors corresponding to target words according to dynamic context words, and can better distinguish the different meanings of words in different contexts, and solve the recognition difficulties caused by polysemy of a word.
[0098] In an embodiment of the present application, the amount of metaphorical information in the sample text used to train the above-mentioned semantic feature extraction model is less than or equal to the information amount threshold, thereby improving the accuracy of semantic feature information extraction, ensuring the accuracy of semantic feature information, and avoiding the metaphorical information in the sample text from affecting the accuracy of semantic information feature extraction processing.
[0099] In order to verify that the semantic feature extraction model trained in the first step of the model is effective, it can reasonably establish the feature embedding space corresponding to the word and determine the semantic feature vector corresponding to the word. The semantic feature extraction model in the embodiment of the present application can also be trained with other corpus resources, and the above-mentioned other corpus resources can replace the above-mentioned academic papers and news texts as sample texts. In some practical application scenarios, encyclopedia texts, account release texts and information flow texts can be selected as sample texts to pre-train and train the semantic feature extraction model. When the similarity threshold is set to 0.8, the metaphor information recognition effect corresponding to the semantic feature extraction model obtained by training different sample texts can be measured by recognition quality parameters such as accuracy (Acc), precision (P), recall (R) and F1 value (F1-score), and the above-mentioned accuracy, precision, recall and F1 value are positively correlated with the metaphor information recognition effect corresponding to the above-mentioned semantic feature extraction model. Exemplarily, the recognition quality parameters corresponding to the semantic feature extraction model trained with the above-mentioned three sample texts and the sample text selected in the embodiment of the present application can refer to the following Table 1.
[0100] Table 1
[0101] Sample text Acc P R F1 Academic papers and news texts 0.7396 0.7218 0.7092 0.7358 Encyclopedia text 0.6791 0.6768 0.6587 0.6706 Account post text 0.6864 0.6762 0.6800 0.6880 Stream text 0.6652 0.6600 0.6495 0.6595
[0102] According to the results shown in Table 1, in the embodiment of the present application, academic papers and news texts are used as sample texts to train the semantic feature extraction model, which is of great help to the effect of the metaphor information recognition task. This indirectly shows that the sample text contains more words that conform to the semantics of the vocabulary itself, which can help the vocabulary pattern in the trained semantic feature extraction model to be closer to its "original meaning", and more appropriate results can be obtained when determining the semantic similarity and finding similar words in the subsequent determination, thereby helping to improve the recognition accuracy of metaphor information recognition, with the result improvement of more than 5%.
[0103] In addition, the sample text corresponding to the above-mentioned semantic feature extraction model does not need to be labeled, which also reduces the sample annotation cost. The information recognition method based on the above-mentioned semantic feature extraction model is an unsupervised metaphor information recognition method, which does not need to rely on a large amount of annotations and a large amount of training data, has low computational overhead, and the model has strong interpretability. The above-mentioned semantic feature extraction model can accurately extract the semantic features of the target corpus unit in the target text and the text semantic features of the annotated text, and will not be disturbed by the metaphor information in the sample text.
[0104] Step 204: perform text semantic information extraction processing on the annotation text to obtain second semantic feature information corresponding to the annotation text.
[0105] Optionally, the above annotations are respectively segmented to obtain an annotation corpus unit sequence. The annotation corpus unit sequence includes at least one annotation corpus unit, and the at least one annotation corpus unit is the result of the above segmentation process.
[0106] Optionally, the annotation corpus units are annotation words, and the annotation words are characters and / or words in the annotation text.
[0107] After obtaining the at least one annotation corpus unit, text semantic information extraction processing can be performed on it to obtain semantic feature information corresponding to the entire annotation text, that is, the second semantic feature information. The second semantic feature information is used to characterize the text semantic information of the annotation text. The text semantic information of the annotation text is used to characterize the semantic information of the target corpus unit itself.
[0108] In an exemplary embodiment, the annotation text includes at least one annotation corpus unit; accordingly, Figure 3 As shown, the implementation process of the above step 204 may include the following steps (2041-2043).
[0109] Step 2041, input the annotation text into the semantic feature extraction model.
[0110] Step 2042: Based on the semantic feature extraction model, semantic information feature extraction processing is performed on at least one annotation corpus unit to obtain an embedded feature vector corresponding to the at least one annotation corpus unit.
[0111] The embedded feature vector is used to represent the semantic information corresponding to at least one annotation corpus unit.
[0112] In a possible implementation, the at least one annotation corpus unit is input into the semantic feature extraction model, and an embedded feature vector corresponding to each of the at least one annotation corpus unit is output.
[0113] Step 2043: Determine a second semantic feature vector corresponding to the annotation text based on the embedded feature vector.
[0114] The second semantic feature information includes a second semantic feature vector, and the second semantic feature vector is used to represent the semantic information of the annotation text.
[0115] Optionally, average pooling processing is performed on the embedded feature vectors corresponding to each of the at least one annotation corpus units to obtain a second semantic feature vector corresponding to the annotation text.
[0116] Optionally, the dimensions of the first semantic feature vector and the second semantic feature vector are set to 768 dimensions.
[0117] Step 205 : Based on the first semantic feature information and the second semantic feature information, metaphor information recognition processing is performed on the target text to obtain metaphor information corresponding to the target text.
[0118] The rhetorical device of metaphor usually includes two elements, namely, the subject information and the metaphor information. In metaphor, the subject information is usually compared to the metaphor information. After obtaining the above-mentioned first semantic feature information and the second semantic feature information, since the first semantic feature information can represent the semantic information of the target corpus unit in the target text, and the second semantic feature information can represent the semantic information of the target corpus unit itself, the above-mentioned first semantic feature information and the second semantic feature information can be compared to determine whether the semantic information of the target corpus unit in the target text is consistent with its own semantic information. If the semantic information of the target corpus unit in the target text is consistent with its own semantic information, then the target corpus unit is not the metaphor information, but ordinary text information. If the semantic information of the target corpus unit in the target text is inconsistent with its own semantic information, then the above-mentioned target corpus unit can be considered to be the metaphor word in the metaphor, that is, the metaphor information in the target text.
[0119] In some application scenarios, the above metaphors are specific metaphors, and the text using metaphorical rhetoric usually does not include the subject information and metaphorical words. Through the above information recognition method, even if the target text does not include the subject information and metaphorical words, the metaphor information in the target text can be identified based on the above two semantic feature information, thereby improving the accuracy of metaphor information recognition.
[0120] In an exemplary embodiment, the implementation process of the above step 205 may include the following steps (2051-2052).
[0121] Step 2051: Determine the semantic similarity between the first semantic feature information and the second semantic feature information.
[0122] Optionally, the first semantic feature information includes the first semantic feature vector, and the second semantic feature information includes the second semantic feature vector.
[0123] In step 2051, the vector similarity between the first semantic feature vector and the second semantic feature vector may be determined, and the vector similarity may be used as the semantic similarity. The semantic similarity is used to characterize the degree of similarity between the first semantic feature information and the second semantic feature information. The vector similarity may be cosine similarity, Euclidean distance, etc., which is not limited in the present embodiment of the application.
[0124] In one example, if Figure 4 As shown, it exemplarily shows a flow chart of determining semantic similarity. Figure 4 In the process, the target text to be detected includes context word 1, ..., target word, ..., context word m, where m is an integer greater than 1; the annotation text corresponding to the target corpus unit in the word dictionary information includes annotation word 1, ..., annotation word n, where n is an integer greater than 1; the target text and the annotation text are respectively input into the BERT model, and the first semantic feature vector w corresponding to the target word in the context of the target text and the second semantic feature vector s corresponding to the annotation text are respectively output, wherein the second semantic feature vector s is a semantic feature vector obtained by averaging the embedded feature vectors corresponding to each annotation word in the annotation text by pooling. Then, the cosine similarity (cos(w, s)) between the first semantic feature vector w and the second semantic feature vector s is calculated. Optionally, the cosine similarity can be used as the semantic similarity between the above two vectors.
[0125] Step 2052: If the semantic similarity is less than or equal to the similarity threshold, the target corpus unit is determined as metaphor information.
[0126] If the semantic similarity is less than or equal to the similarity threshold, it means that the semantic information of the target corpus unit in the target text is significantly different from the semantic information of the target semantic unit itself, and the target corpus unit can be identified as metaphor information. If the semantic similarity is greater than the similarity threshold, it means that the semantic information of the target corpus unit in the target text is the same or similar to the semantic information of the target semantic unit itself, and is not metaphor information, and the target corpus unit is then identified as ordinary text information.
[0127] Optionally, the above similarity threshold is a hyperparameter and can be set according to actual application requirements. The higher the similarity threshold is, the looser the determination of metaphor information is; the lower the similarity threshold is, the stricter the determination of metaphor information is.
[0128] In a possible practical application scenario, the similarity threshold is determined by traversing a threshold interval, for example, the threshold interval is [0.3-1].
[0129] In this embodiment, the evaluation index of the above information recognition method can be set as accuracy (Acc), precision (P), recall (R) and F1 value (F1-score), and the above accuracy, precision, recall and F1 value are positively correlated with the recognition effect of the method. For different similarity thresholds, the corresponding accuracy, precision, recall and F1 value of the above information recognition method may be different, and the specific results can be seen in Table 2 below.
[0130] Table 2
[0131] Similarity Threshold Accuracy Accuracy Recall F1 value 0.3 0.5337 0.2678 0.5000 0.3738 0.4 0.5660 0.6256 0.5496 0.4763 0.5 0.6575 0.6617 0.6651 0.6593 0.6 0.7066 0.6924 0.6926 0.7067 0.7 0.7253 0.7068 0.7024 0.7238 0.8 0.7396 0.7218 0.7092 0.7358 0.9 0.5758 0.6000 0.5885 0.5635 1.0 0.5357 0.2678 0.5000 0.3738
[0132] According to the above data, when the similarity threshold is 0.8, the accuracy, precision, recall and F1 value are all maximum values, indicating that the metaphor information recognition effect is relatively accurate.
[0133] In an embodiment of the present application, if the semantic similarity corresponding to a target corpus unit is less than or equal to a similarity threshold, the target corpus unit can be determined as metaphor information. This is equivalent to simplifying the metaphor information identification task into an outlier identification task. By identifying the target corpus unit whose corresponding semantic similarity is less than or equal to the similarity threshold, the metaphor information in the target text is identified, thereby improving the metaphor information identification efficiency.
[0134] In an exemplary embodiment, if Figure 3 As shown, after the above step 205, the following steps (206-209) may also be included.
[0135] Step 206: When the metaphor information includes the target language unit, determine that the target language unit is a metaphor language unit.
[0136] Obtain target corpus units whose semantic similarity is less than or equal to a similarity threshold, and determine these target corpus units as metaphor corpus units. Optionally, the above-mentioned metaphor corpus units are metaphor words and phrases using metaphors in the target text, including metaphor words and metaphor phrases.
[0137] Step 207: Determine the body corpus unit corresponding to the metaphor corpus unit according to the first semantic feature information.
[0138] Since the first semantic feature information is the semantic information corresponding to the target corpus unit in the context corresponding to the target text, after some target corpus units are determined to be metaphor corpus units, the corresponding entity corpus unit of the metaphor corpus unit can be determined according to the first semantic feature information corresponding to the metaphor corpus unit. The semantic feature information of the entity corpus unit itself matches the first semantic feature information corresponding to the metaphor corpus unit, which can be understood as the semantic information corresponding to the metaphor corpus unit in the context corresponding to the target text is the same as the semantic information of the entity corpus unit of its metaphor.
[0139] Step 208: Obtain the ontology content type information corresponding to the ontology corpus unit.
[0140] The ontology content type information is used to characterize the content type corresponding to the ontology corpus unit.
[0141] The above content types include compliant types and non-compliant types. The above compliant types refer to vocabulary types that comply with preset regulations, and correspondingly, the above non-compliant types refer to vocabulary types that comply with preset regulations.
[0142] Step 209: Determine the metaphor content type information corresponding to the metaphor corpus unit according to the ontology content type information.
[0143] The metaphor content type information is used to characterize the content type corresponding to the metaphor corpus unit.
[0144] When the ontology content type information indicates that the content type corresponding to the ontology corpus unit is a compliant type, the content type corresponding to the metaphor corpus unit is determined to be a compliant type; when the ontology content type information indicates that the content type corresponding to the ontology corpus unit is an uncompliant type, the content type corresponding to the metaphor corpus unit is determined to be an uncompliant type.
[0145] When the metaphor content type information indicates that the content type corresponding to the metaphor corpus unit is an illegal type, the target text is filtered. The filtering process includes prohibiting publishing, stopping uploading, removing from shelves, returning publishing, etc., which is not limited in the present embodiment.
[0146] In some possible scenarios, it is difficult to judge the true semantics of a text by determining the content type of the text or words based on the meaning of the text or words in the text. For humans, metaphors and negative emotions in sentences can be easily identified by reading. However, for computers, since they do not have true intelligence and association, they tend to focus on some positive words and ignore the impact of metaphorical words on meaning. They cannot accurately determine the characteristics of metaphorical words, so it is difficult to judge the true meaning of a sentence by judging the meaning of each word in the sentence.
[0147] The embodiments of the present application can determine the entity words corresponding to the metaphor words according to the actual semantics of the metaphor words in the context of the target text, and judge the content type of the metaphor words according to the content type of the entity words, so as to accurately identify the target text that does not meet the requirements and perform corresponding processing, thereby improving the efficiency of information screening and filtering, reducing misjudgments and improving the text recall rate.
[0148] In an exemplary embodiment, if Figure 3 As shown, after the above step 205, the following step 210 may also be included.
[0149] Step 210: Determine the content quality parameter corresponding to the target text according to the metaphor information.
[0150] Among them, the content quality parameter is used to characterize the text content quality corresponding to the target text, and the content quality parameter is positively correlated with the information content of the metaphor information.
[0151] The metaphor information includes at least one metaphor corpus unit, and the semantic similarity corresponding to the metaphor corpus unit is less than or equal to a similarity threshold.
[0152] In a possible implementation, the number of words corresponding to the at least one metaphorical corpus unit is determined, and the number of words is used to characterize the amount of information in the metaphorical information; and the content quality parameter is determined based on the number of words. Optionally, the content quality parameter includes a content quality score, and the content quality score is used to characterize the quality of the text content, and the content quality score is positively correlated with the number of words.
[0153] In some embodiments, the position information corresponding to the at least one metaphorical corpus unit in the target text can be determined, and the position information can be a text position such as a paragraph, title, or body text; after determining the position information, the weight information corresponding to the position information and the number of metaphorical words corresponding to the position information can be obtained, and the weight information is used to characterize the importance of the text corresponding to the position information in the target text; the content quality score can be determined based on the weight information and the number of words.
[0154] The more the above words are, the more important the position of the metaphorical words is, which means that the metaphorical rhetoric devices quoted in the target text are richer and more eye-catching, reflecting the higher the creativity of the text and the better the quality of the text content.
[0155] In some practical application scenarios, there is a lack of methods for automatically evaluating text creativity. One of the main reasons is that it is impossible to formulate objective quantitative standards for the creativity of literary works. Metaphor, as one of the main means of expression for humans, can reflect the author's cognitive attitude towards things. Novel and original metaphors can greatly improve the artistic level and creativity of literary works. By identifying metaphor information in the target text, the embodiment of the present application can determine the parameters used to characterize the quality of the text content, and can automatically evaluate the creativity of the text, thereby improving the efficiency and accuracy of determining the text quality.
[0156] In summary, the technical solution provided by the embodiment of the present application can obtain semantic feature information corresponding to the target corpus unit in the target text by performing word semantic information extraction processing on the target text, and can obtain semantic feature information corresponding to the annotation text by performing text semantic information extraction processing on the annotation text corresponding to the target corpus unit. Based on the semantic feature information of the target corpus unit and the second semantic feature information of the annotation text corresponding to the target corpus unit, metaphor information can be identified on the target text to obtain metaphor information using metaphors in the target text, without the need for manual annotation, thus reducing labor costs, and the method of performing metaphor identification in combination with the semantic features of the annotation text corresponding to the target corpus unit can improve the accuracy of metaphor information identification.
[0157] The beneficial effects of the technical solution provided by the embodiment of the present application are described below in combination with specific data. Please refer to Table 3 below, which shows the corresponding values of parameter indicators for metaphor information recognition under different implementation schemes. Among them, the parameter indicators include precision P, recall R, F1 value and parameter quantity, and the parameter quantity is the number of parameters that the model needs to learn, excluding hyperparameters.
[0158] Table 3
[0159] Implementation P R F1 Parameter quantity Solution 1 0.3704 0.8297 0.6026 0 Solution 2 0.6641 0.6261 0.6454 0 Option 3 0.7643 0.8262 0.7954 10M(Megabyte) This application 0.7218 0.7092 0.7358 0
[0160] Among them, the first option is based on the priority semantics method, which believes that the metaphorical meaning is understood differently from the ordinary literal meaning, and there is a logical conflict in the literal meaning of the metaphorical sentence. When the conflict occurs, semantic processing is performed to identify the metaphorical information; the second option is based on reasoning, which uses some commonly used reasoning techniques combined with existing metaphor cases to identify and understand metaphors, which can be subdivided into analogy reasoning and logical reasoning; the third option is based on statistics, which uses a large-scale corpus for statistics and analysis, and classifies and identifies new texts.
[0161] Solutions 1 and 2 rely on existing lexicons and metaphor cases, which makes it difficult to capture changes in lexical meanings and cannot be updated in real time. In addition, rule-based methods perform poorly in terms of metaphor recognition accuracy. In contrast, Solution 3 has significantly improved recognition accuracy thanks to the development of deep learning technology. However, deep learning models rely on a large amount of high-quality annotated corpus for training, which greatly increases data costs and training costs. In addition, due to the black box nature of deep learning models, it is difficult to make a reasonable explanation for the recognition results.
[0162] According to Table 3 above, compared with Solution 1 and Solution 2, the technical solution provided by the embodiment of the present application can significantly improve the effect of metaphor information recognition (by 13% and 9% respectively). Compared with Solution 3, the technical solution provided by the embodiment of the present application can approach the recognition effect of Solution 3 while greatly simplifying the complexity of the model. Moreover, the unsupervised learning model does not require training labels and large-scale training data, which greatly saves data costs and training costs, and can more efficiently utilize the currently scarce and precious Chinese metaphor data set.
[0163] In addition, the technical solution provided by the embodiment of the present application also has strong interpretability and can make a reasonable explanation for the recognition results. For example, in the sentence "But the investment enthusiasm of many large enterprises has not been braked, and the investment is still in the billions." In the dictionary, "brake" is the target word, and its definition is "to stop a car or machine. Use a brake to stop the vehicle from moving." According to human cognitive habits and semantic habits, "brake" is generally applicable to machines, but no machine appears in the example sentence. Therefore, the scope of use of the target word "brake" is expanded here, and "investment enthusiasm" is compared to a certain "machine", thus forming a metaphor. The cosine similarity between the semantic feature vectors corresponding to "brake" and its annotated text determined by the semantic feature extraction model provided by the embodiment of the present application is only 0.4988, which is lower than the similarity threshold, so the example sentence is identified as a metaphor. Similarly, in the sentence “As soon as the door opened, everyone rushed into the library.”, the model detects that the most suitable entity verb for the semantic feature information corresponding to the word “rush in” in the current context is “enter”, while the actual verb is “rush in”, and the corresponding cosine similarity is 0.6783, which is lower than the threshold, so the sentence is identified as a metaphor. The embodiment of the present application compares the semantic information of the annotation text of the target word with the semantic information of the target word in the target text, which can provide a clear basis for the classification of the model and improve the efficiency and accuracy of metaphor information recognition.
[0164] In addition, the technical solution provided by the embodiments of the present application can also be applied to more upper-level businesses, such as identifying non-compliant content in metaphor information; or determining text quality parameters based on metaphor information, thereby providing a new dimension for the automated evaluation of the creativity of literary works.
[0165] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.
[0166] Please refer to Figure 5 , which shows a block diagram of an information identification device provided by an embodiment of the present application. The device has the function of implementing the above-mentioned information identification method, and the function can be implemented by hardware, or by hardware executing corresponding software. The device can be a computer device, or it can be set in a computer device. The device 500 may include: a target corpus acquisition module 510, an annotation text acquisition module 520, a semantic information extraction module 530, and a metaphor information recognition module 540.
[0167] The target corpus acquisition module 510 is used to acquire the target corpus unit corresponding to the target text.
[0168] The annotation text acquisition module 520 is used to acquire the annotation text corresponding to the target corpus unit.
[0169] The semantic information extraction module 530 is used to perform word semantic information extraction processing on the target text to obtain the first semantic feature information corresponding to the target corpus unit.
[0170] The semantic information extraction module 530 is further used to perform text semantic information extraction processing on the annotation text to obtain second semantic feature information corresponding to the annotation text.
[0171] The metaphor information recognition module 540 is used to perform metaphor information recognition processing on the target text based on the first semantic feature information and the second semantic feature information to obtain the metaphor information corresponding to the target text.
[0172] In an exemplary embodiment, the target corpus acquisition module 510 includes: a word segmentation unit, a part-of-speech information acquisition unit, and a target corpus determination unit.
[0173] The word segmentation unit is used to perform word segmentation processing on the target text to obtain a corpus unit sequence, wherein the corpus unit sequence includes at least one recognition corpus unit.
[0174] The part-of-speech information acquisition unit is used to acquire the part-of-speech information corresponding to the at least one recognition corpus unit.
[0175] The target corpus determining unit is used to determine the target corpus unit based on the part-of-speech information.
[0176] In an exemplary embodiment, the target text includes the target corpus unit and context corpus unit, the context corpus unit is a corpus unit in the target text other than the target corpus unit, and the semantic information extraction module 530 includes: a text input unit and a first semantic feature extraction unit.
[0177] The text input unit is used to input the target text into the semantic feature extraction model.
[0178] The word semantic feature extraction unit is used to perform semantic information feature extraction processing on the context corpus unit based on the semantic feature extraction model to obtain a first semantic feature vector corresponding to the target corpus unit.
[0179] The first semantic feature information includes the first semantic feature vector, and the first semantic feature vector is used to represent the semantic information corresponding to the target corpus unit in the target text.
[0180] In an exemplary embodiment, the annotation text includes at least one annotation corpus unit, and the semantic information extraction module 530 further includes: an annotation corpus feature extraction unit and a text semantic feature extraction unit.
[0181] The text input unit is also used to input the annotation text into a semantic feature extraction model.
[0182] The annotation corpus feature extraction unit is used to perform semantic information feature extraction processing on the at least one annotation corpus unit based on the semantic feature extraction model to obtain an embedded feature vector corresponding to the at least one annotation corpus unit, and the embedded feature vector is used to characterize the semantic information corresponding to the at least one annotation corpus unit.
[0183] The text semantic feature extraction unit is used to determine a second semantic feature vector corresponding to the annotation text based on the embedded feature vector.
[0184] The second semantic feature information includes the second semantic feature vector, and the second semantic feature vector is used to represent the semantic information of the annotation text.
[0185] In an exemplary embodiment, the semantic feature extraction model is a machine learning model trained based on sample text, the amount of information of the metaphor information corresponding to the sample text is less than an information amount threshold, and the sample text includes at least two sentence texts; the training process of the semantic feature extraction model includes:
[0186] Traversing the at least two sentence texts;
[0187] The corpus unit at the target position in the traversed sentence text is replaced with a preset marker to obtain a replaced sentence text;
[0188] Inputting the replaced sentence text into a target machine learning model, and outputting a semantic feature vector corresponding to the corpus unit;
[0189] When the traversal of the at least two sentence texts is completed, the semantic feature extraction model is obtained based on the target machine learning model.
[0190] In an exemplary embodiment, the training process further includes:
[0191] Determine a sentence text pair in the at least two sentence texts, wherein the sentence text pair is determined based on two different sentence texts in the at least two sentence texts;
[0192] Traversing the sentence text pairs;
[0193] Inputting the traversed sentence text pair into the target machine learning model, and outputting contextual relationship information corresponding to the traversed sentence text pair, wherein the contextual relationship information is used to characterize the contextual relationship between the two sentence texts in the traversed sentence text pair;
[0194] When the at least two sentence texts are traversed, the semantic feature extraction model is obtained based on the target machine learning model, including:
[0195] When the traversal of the at least two sentence texts is completed and the traversal of the sentence text pair is completed, the semantic feature extraction model is obtained based on the target machine learning model.
[0196] In an exemplary embodiment, the metaphor information identification module 540 includes: a similarity determination unit and a metaphor information determination unit.
[0197] A similarity determination unit is used to determine the semantic similarity between the first semantic feature information and the second semantic feature information.
[0198] The metaphor information determination unit determines the target corpus unit as the metaphor information if the semantic similarity is less than or equal to a similarity threshold.
[0199] In an exemplary embodiment, the apparatus 500 further includes: a metaphor corpus determination module, an ontology corpus determination module, an ontology type determination module, and a metaphor type determination module.
[0200] The metaphor body language determining module is used to determine that the target language unit is a metaphor body language unit when the metaphor body information includes the target language unit.
[0201] The body corpus determination module is used to determine the body corpus unit corresponding to the metaphor corpus unit according to the first semantic feature information.
[0202] An ontology type determination module, used to obtain ontology content type information corresponding to the ontology corpus unit, wherein the ontology content type information is used to characterize the content type corresponding to the ontology corpus unit;
[0203] The metaphor type determination module is used to determine the metaphor content type information corresponding to the metaphor corpus unit according to the body content type information, wherein the metaphor content type information is used to characterize the content type corresponding to the metaphor corpus unit.
[0204] In an exemplary embodiment, the apparatus 500 further includes: a text quality determination module.
[0205] The text quality determination module is used to determine the content quality parameter corresponding to the target text according to the metaphor information.
[0206] The content quality parameter is used to characterize the text content quality corresponding to the target text, and the content quality parameter is positively correlated with the information content of the metaphor information.
[0207] In summary, the technical solution provided by the embodiment of the present application can obtain semantic feature information corresponding to the target corpus unit in the target text by performing word semantic information extraction processing on the target text, and can obtain semantic feature information corresponding to the annotation text by performing text semantic information extraction processing on the annotation text corresponding to the target corpus unit. Based on the semantic feature information of the target corpus unit and the second semantic feature information of the annotation text corresponding to the target corpus unit, metaphor information can be identified on the target text to obtain metaphor information using metaphors in the target text, without the need for manual annotation, thus reducing labor costs, and the method of performing metaphor identification in combination with the semantic features of the annotation text corresponding to the target corpus unit can improve the accuracy of metaphor information identification.
[0208] It should be noted that the device provided in the above embodiment, when implementing its functions, is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device and method embodiments provided in the above embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.
[0209] Please refer to Figure 6 , which shows a structural block diagram of a computer device provided by an embodiment of the present application. The computer device may be a server for executing the above-mentioned information identification method. Specifically:
[0210] The computer device 600 includes a central processing unit (CPU) 601, a system memory 604 including a random access memory (RAM) 602 and a read only memory (ROM) 603, and a system bus 605 connecting the system memory 604 and the central processing unit 601. The computer device 600 also includes a basic input / output system (I / O (Input / Output) system) 606 for facilitating information transmission between various components in the computer, and a large-capacity storage device 607 for storing an operating system 613, application programs 614, and other program modules 615.
[0211] The basic input / output system 606 includes a display 608 for displaying information and an input device 609 such as a mouse and a keyboard for user inputting information. The display 608 and the input device 609 are connected to the central processing unit 601 through an input / output controller 610 connected to the system bus 605. The basic input / output system 606 may also include an input / output controller 610 for receiving and processing inputs from a plurality of other devices such as a keyboard, a mouse, or an electronic stylus. Similarly, the input / output controller 610 also provides output to a display screen, a printer, or other types of output devices.
[0212] The mass storage device 607 is connected to the central processing unit 601 through a mass storage controller (not shown) connected to the system bus 605. The mass storage device 607 and its associated computer readable medium provide non-volatile storage for the computer device 600. That is, the mass storage device 607 may include a computer readable medium (not shown) such as a hard disk or a CD-ROM (Compact Disc Read-Only Memory) drive.
[0213] Without loss of generality, computer readable media may include computer storage media and communication media. Computer storage media include volatile and non-volatile, removable and non-removable media implemented by any method or technology for storing information such as computer readable instructions, data structures, program modules or other data. Computer storage media include RAM, ROM, EPROM (Erasable Programmable Read Only Memory), EEPROM (Electrically Erasable Programmable Read Only Memory), flash memory or other solid-state storage technologies, CD-ROM, DVD (Digital Video Disc) or other optical storage, cassettes, magnetic tapes, disk storage or other magnetic storage devices. Of course, those skilled in the art will appreciate that computer storage media are not limited to the above. The above-mentioned system memory 604 and mass storage device 607 can be collectively referred to as memory.
[0214] According to various embodiments of the present application, the computer device 600 can also be connected to a remote computer on the network through a network such as the Internet. That is, the computer device 600 can be connected to the network 612 through the network interface unit 611 connected to the system bus 605, or the network interface unit 611 can be used to connect to other types of networks or remote computer systems (not shown).
[0215] The memory also includes a computer program, which is stored in the memory and configured to be executed by one or more processors to implement the above-mentioned information identification method.
[0216] In an exemplary embodiment, a computer-readable storage medium is also provided, in which at least one instruction, at least one program, a code set or an instruction set is stored, and when the at least one instruction, the at least one program, the code set or the instruction set is executed by a processor, the above-mentioned information identification method is implemented.
[0217] Optionally, the computer readable storage medium may include: ROM (Read Only Memory), RAM (Random Access Memory), SSD (Solid State Drives) or optical disks, etc. Among them, the random access memory may include ReRAM (Resistance Random Access Memory) and DRAM (Dynamic Random Access Memory).
[0218] In an exemplary embodiment, a computer program product or a computer program is also provided, the computer program product or the computer program comprising computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the above-mentioned information identification method.
[0219] It should be understood that the "multiple" mentioned in this article refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the previous and subsequent associated objects are in an "or" relationship. In addition, the step numbers described in this article only illustrate a possible execution sequence between the steps. In some other embodiments, the above steps may not be executed in the order of the numbers, such as two steps with different numbers are executed at the same time, or two steps with different numbers are executed in the opposite order to the diagram. The embodiments of the present application are not limited to this.
[0220] In addition, in the specific implementation of this application, related data such as user information is involved. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.
[0221] The above description is only an exemplary embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. An information identification method, It is characterized in that The method comprises: Obtain the target corpus unit corresponding to the target text; Acquire the annotation text corresponding to the target corpus unit, wherein the annotation text is the commonly used interpretation corresponding to the target corpus unit in the word dictionary information; Performing word semantic information extraction processing on the target text to obtain first semantic feature information corresponding to the target corpus unit, wherein the first semantic feature information represents semantic information of the target corpus unit in the target text; Performing text semantic information extraction processing on the annotation text to obtain second semantic feature information corresponding to the annotation text, wherein the second semantic feature information represents semantic information of the target corpus unit itself; Determining a semantic similarity between the first semantic feature information and the second semantic feature information; If the semantic similarity is less than or equal to a similarity threshold, determining the target corpus unit as metaphor information; The first semantic feature information and the second semantic feature information are both extracted by a semantic feature extraction model, and the semantic feature extraction model is trained based on two training tasks: a character occlusion task and a context prediction task, so that the semantic feature extraction model obtains language knowledge of relevant contexts and distinguishes different meanings of words in different contexts; The semantic feature extraction model is a machine learning model trained based on sample texts, the amount of information of the metaphor information corresponding to the sample texts is less than an information amount threshold, and the sample texts include at least two sentence texts.
2. The method according to claim 1, It is characterized in that The step of obtaining a target corpus unit corresponding to the target text includes: Performing word segmentation processing on the target text to obtain a corpus unit sequence, wherein the corpus unit sequence includes at least one recognition corpus unit; Obtaining part-of-speech information corresponding to the at least one recognition corpus unit; Based on the part-of-speech information, the target corpus unit is determined.
3. The method according to claim 1, It is characterized in that The target text includes the target corpus unit and the context corpus unit, wherein the context corpus unit is a corpus unit in the target text other than the target corpus unit, and the word semantic information extraction process is performed on the target text to obtain the first semantic feature information corresponding to the target corpus unit, including: Inputting the target text into the semantic feature extraction model; Based on the semantic feature extraction model, performing semantic information feature extraction processing on the context corpus unit to obtain a first semantic feature vector corresponding to the target corpus unit; The first semantic feature information includes the first semantic feature vector, and the first semantic feature vector is used to represent the semantic information corresponding to the target corpus unit in the target text.
4. The method according to claim 1, It is characterized in that The annotation text includes at least one annotation corpus unit, and the extracting text semantic information from the annotation text to obtain second semantic feature information corresponding to the annotation text includes: Inputting the annotation text into the semantic feature extraction model; Based on the semantic feature extraction model, a semantic information feature extraction process is performed on the at least one annotation corpus unit to obtain an embedded feature vector corresponding to the at least one annotation corpus unit, wherein the embedded feature vector is used to represent the semantic information corresponding to the at least one annotation corpus unit; Based on the embedded feature vector, determining a second semantic feature vector corresponding to the annotation text; The second semantic feature information includes the second semantic feature vector, and the second semantic feature vector is used to represent the semantic information of the annotation text.
5. The method according to claim 3 or 4, It is characterized in that The training process of the semantic feature extraction model includes: Traversing the at least two sentence texts; The corpus unit at the target position in the traversed sentence text is replaced with a preset marker to obtain a replaced sentence text; Inputting the replaced sentence text into a target machine learning model, and outputting a semantic feature vector corresponding to the corpus unit; When the traversal of the at least two sentence texts is completed, the semantic feature extraction model is obtained based on the target machine learning model.
6. The method according to claim 5, It is characterized in that The training process also includes: Determine a sentence text pair in the at least two sentence texts, wherein the sentence text pair is determined based on two different sentence texts in the at least two sentence texts; Traversing the sentence text pairs; Inputting the traversed sentence text pair into the target machine learning model, and outputting contextual relationship information corresponding to the traversed sentence text pair, wherein the contextual relationship information is used to characterize the contextual relationship between the two sentence texts in the traversed sentence text pair; When the at least two sentence texts are traversed, the semantic feature extraction model is obtained based on the target machine learning model, including: When the traversal of the at least two sentence texts is completed and the traversal of the sentence text pair is completed, the semantic feature extraction model is obtained based on the target machine learning model.
7. The method according to claim 1, It is characterized in that The method further comprises: In the case where the metaphor information includes the target language unit, determining the target language unit as a metaphor language unit; Determine the body language unit corresponding to the metaphor language unit according to the first semantic feature information; Acquire ontology content type information corresponding to the ontology corpus unit, wherein the ontology content type information is used to characterize the content type corresponding to the ontology corpus unit; According to the ontology content type information, the metaphor content type information corresponding to the metaphor corpus unit is determined, and the metaphor content type information is used to characterize the content type corresponding to the metaphor corpus unit.
8. The method according to claim 1, It is characterized in that The method further comprises: Determining content quality parameters corresponding to the target text according to the metaphor information; The content quality parameter is used to characterize the text content quality corresponding to the target text, and the content quality parameter is positively correlated with the information content of the metaphor information.
9. An information recognition device, It is characterized in that The device comprises: A target corpus acquisition module is used to acquire the target corpus unit corresponding to the target text; An annotation text acquisition module, used to acquire the annotation text corresponding to the target corpus unit, wherein the annotation text is the commonly used interpretation corresponding to the target corpus unit in the word dictionary information; A semantic information extraction module, used for performing word semantic information extraction processing on the target text to obtain first semantic feature information corresponding to the target corpus unit, wherein the first semantic feature information represents the semantic information of the target corpus unit in the target text; The semantic information extraction module is further used to perform text semantic information extraction processing on the annotation text to obtain second semantic feature information corresponding to the annotation text, where the second semantic feature information represents the semantic information of the target corpus unit itself; A metaphor information identification module, used to determine the semantic similarity between the first semantic feature information and the second semantic feature information; if the semantic similarity is less than or equal to a similarity threshold, determine the target corpus unit as metaphor information; The first semantic feature information and the second semantic feature information are both extracted by a semantic feature extraction model, and the semantic feature extraction model is trained based on two training tasks: a character occlusion task and a context prediction task, so that the semantic feature extraction model obtains language knowledge of relevant contexts and distinguishes different meanings of words in different contexts; The semantic feature extraction model is a machine learning model trained based on sample texts, the amount of information of the metaphor information corresponding to the sample texts is less than an information amount threshold, and the sample texts include at least two sentence texts.
10. A computer device, It is characterized in that The computer device includes a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the information identification method as described in any one of claims 1 to 8.
11. A computer-readable storage medium, It is characterized in that The storage medium stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the information identification method as described in any one of claims 1 to 8.
12. A computer program product, It is characterized in that The computer program product includes computer instructions, which are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes to implement the information identification method as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Corpus processing method
CN110717017A
Chinese statement metaphor recognition system
CN111859934A
