Idiomatic sentiment lexicon expansion method and apparatus based on dual chain-of-thoughts, electronic device, and storage medium
Through the method based on the dual thinking chain, the example sentences and origin information of the idiom are obtained, the emotional label is determined and updated to the dictionary, which solves the problem of untimely update of the existing dictionary and achieves the accurate and comprehensive update of the idiom emotional label.
Patent Information
- Application Number
- PCT/CN2023/135228
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-11-29
- Publication Date
- 2025-06-05
AI Technical Summary
The existing idiom emotional dictionary is difficult to enhance the emotional label of idioms in a timely and accurate manner, and the entries are limited and updated frequently, so it cannot fully cover the emotional meaning of all idioms.
Using a method based on a dual thinking chain, the first and second emotional tags are determined by obtaining example sentences and origin information of the target idiom, and the final idiom tag is determined through the voting mechanism, and updated to the emotional dictionary.
It realizes timely and accurate updates of idiom emotional labels, enhances the understanding of idiom usage and emotional resonance, and ensures the comprehensiveness and accuracy of the emotional dictionary.
Smart Images

Figure CN2023135228_05062025_PF_FP_ABST
Abstract
Description
Idiom sentiment dictionary expansion method, device, electronic device and storage medium based on dual thinking chain Technical Field
[0001] The present application relates to the field of computer technology. Specifically, the present application relates to a method, device, electronic device and storage medium for expanding an idiom emotion dictionary based on a dual thinking chain. Background Art
[0002] Idioms are a concise, vivid, and culturally rich way of expressing language. They embody people's understanding of the world, their emotions, and their values. Idioms are not just a linguistic tool, but also a vehicle for cultural heritage and emotional communication.
[0003] Traditional idiom sentiment dictionaries often have limitations. Due to the diversity and complexity of idioms, existing dictionaries struggle to fully capture the emotional meanings of all idioms. Furthermore, the sentiment of an idiom is influenced by context and cultural background, and its emotional tone can vary depending on the environment and region. However, sentiment dictionaries for idioms have limited entries and can become outdated due to infrequent updates. This means that many well-established and newly created idioms are not included and their sentiments remain unlabeled.
[0004] From the above, we can see that how to enhance the emotions of existing idioms in a timely and accurate manner remains to be solved.
[0005] Summary of the Invention
[0006] This application provides a method, device, electronic device, and storage medium for expanding an idiom sentiment dictionary based on a dual-chain thinking process, which can solve the problem in related technologies of not being able to enhance the sentiment of existing idioms in a timely and accurate manner. The technical solution is as follows:
[0007] According to one aspect of the present application, a method for expanding an idiom sentiment dictionary based on a dual thinking chain includes: obtaining a corresponding target idiom; obtaining a target example sentence set corresponding to the target idiom, wherein the target example sentence set includes multiple examples; determining a corresponding first sentiment label based on each target example sentence in the target example sentence set; obtaining target origin information corresponding to the target idiom; retrieving a corresponding origin explanation example sentence set based on the target origin information, wherein the origin explanation example sentence set includes multiple origin explanation example sentences; determining a corresponding second sentiment label based on each origin explanation example sentence in the origin explanation example sentence set; determining a target idiom label corresponding to the target idiom based on the first sentiment label and the second sentiment label; and updating the target idiom label to the sentiment dictionary.
[0008] According to one aspect of the present application, an idiom sentiment dictionary expansion device based on a dual thinking chain includes: a target idiom acquisition module, used to acquire the corresponding target idiom; an example sentence set acquisition module, used to acquire the target example sentence set corresponding to the target idiom, wherein the target example sentence set includes multiple examples; a first sentiment label determination module, used to determine the corresponding first sentiment label based on each target example sentence in the target example sentence set; a target origin information acquisition module, used to acquire the target origin information corresponding to the target idiom; an explanation example sentence set retrieval module, used to retrieve the corresponding origin explanation example sentence set based on the target origin information, wherein the origin explanation example sentence set includes multiple origin explanation example sentences; a second sentiment label determination module, used to determine the corresponding second sentiment label based on each origin explanation example sentence in the origin explanation example sentence set; a target idiom label determination module, used to determine the target idiom label corresponding to the target idiom based on the first sentiment label and the second sentiment label; and an update module, used to update the target idiom label to the sentiment dictionary.
[0009] In an exemplary embodiment, the device also includes: an emotion label retrieval module, used to retrieve the first emotion label and the second emotion label; a voting module, used to vote on the first emotion label and the second emotion label respectively; a vote acquisition module, used to obtain a first number of votes corresponding to the first emotion label and a second number of votes corresponding to the second emotion label; a target idiom label determination module, used to determine the target idiom label based on the first number of votes and the second number of votes.
[0010] In an exemplary embodiment, the device also includes: a first idiom input module, used to input the target idiom into the idiom model, wherein the idiom model is trained in advance and stores a large number of idiom examples and corresponding emotional information in the idiom model; a first retrieval module, used to retrieve all first target examples corresponding to the target idiom and the first emotional information corresponding to the target idiom; a first emotional label determination module, used to determine the first emotional label based on all the first target examples and the first emotional information corresponding to the first target examples.
[0011] In an exemplary embodiment, the device also includes: an origin information acquisition module, which receives an origin query instruction based on the idiom model and is used to obtain the origin information corresponding to the target idiom, wherein the origin information includes the nature of the idiom and the usage of the idiom; a guidance instruction acquisition module, which is used to obtain the corresponding guidance instruction; and an origin description example sentence acquisition module, which is used to obtain the corresponding origin description example sentence based on the origin information and the guidance instruction, wherein the origin description example sentence can be one or more.
[0012] In an exemplary embodiment, the device further includes: a first idiom input module for inputting the target idiom into the idiom model; a control module for controlling the idiom model to query the target idiom, wherein the query method can be one, type, or more of direct query, usage query, or idiom query.
[0013] In an exemplary embodiment, the device also includes: an emotional attribute acquisition module, which is used to obtain the emotional attributes corresponding to each target example sentence, wherein the emotional attributes include positive, neutral and negative attributes; an attribute parameter acquisition module, which is used to obtain the attribute parameters corresponding to each emotional attribute of the target idiom; and a target emotional attribute determination module, which uses the emotional attribute with the largest attribute parameter to determine the target emotional attribute.
[0014] In an exemplary embodiment, the device also includes: an output module, which is used to output a manual labeling prompt if the target idiom fails to determine the corresponding first emotional label and one or both of the second emotional labels; an emotional label determination module, which is used to determine the corresponding first emotional label or one or both of the second emotional labels based on the acquired manually input emotional label after the staff receives the manual labeling prompt.
[0015] According to one aspect of the present application, an electronic device includes at least one processor and at least one memory, wherein the memory stores computer-readable instructions; the computer-readable instructions are executed by one or more of the processors, so that the electronic device implements the idiom emotion dictionary expansion method based on the dual thinking chain as described above.
[0016] According to one aspect of the present application, a storage medium stores computer-readable instructions thereon, and the computer-readable instructions are executed by one or more processors to implement the above-mentioned method for expanding an idiom sentiment dictionary based on a dual thinking chain.
[0017] The beneficial effects of the technical solution provided by the present application are as follows: in the solution of the present application, in the process of updating the emotional labels of idioms to the emotional dictionary, first of all, in addition to focusing on the emotional meaning of idioms, the solution also provides an explanation of the origin and usage of idioms; by consulting the idiom model about the origin of idioms and providing examples of origin derivatives, we can enhance our understanding of the usage and emotional resonance of idioms, and provide an explanation of the emotional meaning of idioms. In order to make the emotional analysis of idioms more accurate, our method adopts two methods to determine the emotional labels corresponding to idioms, which can more comprehensively understand and analyze the emotional meaning of idioms. On the one hand, the query ability of the idiom model is used to generate examples and extract emotional connotations, effectively capturing the emotional expression of idioms; on the other hand, by analyzing the origin of idioms and providing examples of origin derivatives, we can deeply understand the meaning and emotional resonance of idioms. This comprehensive analysis method makes the emotional analysis of idioms more accurate and comprehensive. Finally, the determined target emotional labels are updated to the corresponding idiom emotional dictionary as soon as possible, thereby realizing timely and accurate updating of idiom emotional labels.
[0018] In the above technical solution, the corresponding target idiom is first obtained, and then the corresponding target example sentence set is obtained through the target idiom, and each idiom corresponds to multiple examples, so there are multiple examples in the target example sentence set, and the idioms in these examples all carry corresponding emotional colors, so the system can determine the corresponding first emotional label based on each target example sentence in the target example sentence set. After determining the first emotional label, the target origin information corresponding to the target idiom can also be obtained. Similarly, each idiom will also have a part of explanatory examples in the origin process, so the system can retrieve the corresponding origin description example sentence set based on the target origin information, wherein there are multiple origin description example sentences in the origin description example sentence set, and Each origin explanation sentence also carries the corresponding emotional color, so the corresponding second emotional label can be determined based on each origin explanation sentence in the origin explanation sentence set; finally, the target idiom label corresponding to the target idiom is determined based on the corresponding first emotional label and the second emotional label. Through the above process, on the one hand, the query ability of the idiom model is utilized to generate examples and extract emotional connotations, effectively capturing the emotional expression of the idiom; on the other hand, through the origin of the idiom and the provision of examples of origin derivation, the emotion of the idiom can be made more accurate and comprehensive, and then the target idiom label is updated to the emotional dictionary as soon as possible, thereby effectively solving the problem in related technologies that the emotions of existing idioms cannot be enhanced in a timely and accurate manner. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for describing the embodiments of the present application. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without inventive efforts.
[0020] FIG1 is a schematic diagram of an implementation environment according to the present application;
[0021] FIG2 is a flow chart of a method for expanding an idiom sentiment dictionary based on a dual thinking chain according to an exemplary embodiment;
[0022] FIG3 is a flowchart from S121 to S123 in a method for expanding an idiom sentiment dictionary based on a dual thinking chain according to an exemplary embodiment;
[0023] FIG4 is a flowchart from S141 to S143 in a method for expanding an idiom sentiment dictionary based on a dual thinking chain according to an exemplary embodiment;
[0024] FIG5 is a flowchart of steps S161 to S164 in a method for expanding an idiom sentiment dictionary based on a dual thought chain according to an exemplary embodiment;
[0025] FIG6 is a flowchart from S111 to S113 in a method for expanding an idiom sentiment dictionary based on a dual thinking chain according to an exemplary embodiment;
[0026] FIG7 is a structural block diagram of an idiom sentiment dictionary expansion device based on a dual thinking chain according to an exemplary embodiment;
[0027] Fig. 8 is a structural block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION
[0028] The following describes in detail embodiments of the present application, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, and are not to be construed as limiting the present application.
[0029] It will be understood by those skilled in the art that, unless expressly stated otherwise, the singular forms "a", "an", "said" and "the" used herein may also include the plural forms. It should be further understood that the term "comprising" used in the specification of the present disclosure refers to the presence of the features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof. It should be understood that when we refer to an element as being "connected" or "coupled" to another element, it may be directly connected or coupled to the other element, or there may be intermediate elements. In addition, "connected" or "coupled" as used herein may include wireless connections or wireless couplings. The term "and / or" used herein includes all or any units and all combinations of one or more associated listed items.
[0030] As mentioned above, the sentiment of idioms is also influenced by context and cultural background, and their emotional coloring can vary depending on environmental and regional differences. However, sentiment dictionaries for idioms have limited entries and can become outdated due to infrequent updates. Therefore, related technologies still struggle to accurately enhance the sentiment of existing idioms in a timely manner.
[0031] To this end, the idiom emotion dictionary expansion method based on dual thinking chain provided by the present application can effectively improve the accuracy of the idiom emotion dictionary expansion based on dual thinking chain. Accordingly, the idiom emotion dictionary expansion method based on dual thinking chain is suitable for the idiom emotion dictionary expansion device based on dual thinking chain. The idiom emotion dictionary expansion device based on dual thinking chain can be deployed in electronic equipment.
[0032] In order to make the objectives, technical solutions and advantages of this application clearer, the implementation methods of this application will be further described in detail below with reference to the accompanying drawings.
[0033] Figure 1 is a schematic diagram of an implementation environment involved in a method for expanding an idiom sentiment dictionary based on a dual thought chain. The implementation environment includes a terminal, a server, and a service system configured with a member association database.
[0034] Specifically, the terminal is used to run a client that provides a video playback function, and can be an electronic device such as a desktop computer, a laptop computer, a tablet computer, a smart phone, etc., which is not limited here.
[0035] Among them, the client provides the emotion label update function.
[0036] A server can be a standalone physical server, a server cluster or distributed system consisting 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, and big data and artificial intelligence platforms. This server is an electronic device that provides backend services. For example, in this implementation, the server provides a cloud storage service for example sentence queries to terminals.
[0037] The server establishes a communication connection with the service system in advance through wired or wireless means, and realizes linkage with the service system through the communication connection. The service system can be a single server or a server cluster composed of multiple servers.
[0038] Through the interaction between the terminal and the server, the client running on the terminal will initiate a resource usage invitation to the server, requesting the server to determine the resource location and resource usage time through resource allocation, and then issue the invitation.
[0039] For the server, the resource allocation process is executed for the client of the inviter through the resource usage invitation linkage service system, and the invitation result indicating the location of the resource and the resource usage time is returned to the client of the inviter, so that the client of the inviter can further confirm whether to issue a resource usage invitation to the client of the invitee.
[0040] Of course, according to actual operational needs, the server and service system can also be integrated into the same server cluster so that resource allocation is completed by the same server cluster.
[0041] In the following method embodiments, for ease of description, the execution subject of each step of the method is taken as an electronic device as an example for illustration, but this does not constitute a specific limitation.
[0042] As shown in Figure 2, a method for expanding an idiom sentiment dictionary based on a dual thinking chain includes:
[0043] S100, obtaining the corresponding target idiom;
[0044] Among them, when updating the sentiment label of an idiom, it is necessary to determine whether the term is an idiom, so as to obtain the corresponding target idiom first.
[0045] S110, obtaining a target sentence set corresponding to the target idiom;
[0046] Among them, in the process of obtaining example sentences, each target idiom can query multiple example sentences, so there are multiple example sentences in the target example sentence set. It should be pointed out here that although there are multiple target example sentences for the target idiom, the emotional color carried by each target example sentence may be the same or different.
[0047] S120, determining a corresponding first emotion label based on each target example sentence in the target example sentence set;
[0048] As mentioned above, the target example sentence set may carry one or more emotional colors. In the process of determining the corresponding first emotional label, as shown in FIG3 , the following steps are specifically included:
[0049] S121, inputting the target idiom into the idiom model;
[0050] Among them, the idiom model is trained in advance, and a large number of idiom examples and corresponding emotional information are stored in the idiom model. When the target idiom is input into the idiom model, the idiom model can be queried. At this time, the existing emotional information and target examples of the target idiom can be queried first, and the examples that have newly appeared on the Internet and the emotions with new emotional colors can be queried. It should be pointed out here that after the target idiom is input into the idiom model, the system will control the idiom model to query the target idiom, among which the query method can be one, type or more of direct query, usage query or idiom query.
[0051] In the process of direct query, instructions are directly issued to the idiom model to query the emotions related to the target idiom; in the process of usage query, for example, this part of the example sentences can indicate the usage of the idiom, and the generated example sentences are usually usage in meaning, which can facilitate understanding the emotional meaning of the idiom in different contexts; in the process of idiom query, after the model determines the idiom, it can predict the emotional expression of the idiom.
[0052] S122, retrieve all first target example sentences corresponding to the target idiom and first emotion information corresponding to the target idiom;
[0053] After the target idiom is searched, the first target example sentence and the first emotion information are directly retrieved, and the first target example sentence and the first emotion information are mapped.
[0054] S123, determining a first emotion label based on all first target sentences and first emotion information corresponding to the first target sentences;
[0055] After the first emotion information of the target idiom is determined, the first emotion label of the target idiom in the first target example sentence can be determined.
[0056] By providing idioms as input to the idiom model, the idiom model will generate first target examples related to the idioms based on the knowledge it remembers. Queries can be performed to generate first target examples, which can help the idiom model acquire memory and understanding of the idioms.
[0057] S130, obtaining target origin information corresponding to the target idiom;
[0058] The target origin information includes the origin of the idiom, relevant examples of the formation of the corresponding idiom, the nature of the idiom, and the usage of the idiom.
[0059] S140, retrieving a corresponding set of example sentences explaining the origin based on the target origin information;
[0060] There are multiple origin explanation example sentences in the origin explanation example sentence set, and before calling the origin explanation example sentence set, as shown in FIG4 , the following steps are also included:
[0061] S141, receiving an origin query instruction based on the idiom model to obtain origin information corresponding to the target idiom;
[0062] Among them, after receiving the origin query instruction, the idiom model can query the origin and historical story or background culture corresponding to the target idiom.
[0063] S142, obtaining the corresponding guidance instructions. By guiding the idiom model, the cognitive process of the idiom model can be enhanced, and the subsequent prediction of the emotional color carried by the idiom can be more accurate; after receiving the origin query instruction, when querying the origin information of the target idiom, the query can be combined with the usage query.
[0064] Then asking the idiom model about the origin of the target idiom can make the idiom model clearly aware of the nature of the given idiom and its original usage as an idiom.
[0065] S143, based on the origin information and the guidance instructions, corresponding examples of origin explanations are obtained. For idioms, different background cultures may have different origin statements, resulting in different emotions expressed in different regional cultures. Therefore, for the same target idiom, the corresponding examples of origin explanations can be one or more.
[0066] S150, determining the corresponding second emotion label based on each origin explanation example sentence in the origin explanation example sentence set; with the help of the obtained origin information, we guide the idiom model to provide illustrative examples derived from these origins, that is, the origin explanation examples in the embodiment of the present application. These origin explanation examples help to deepen the idiom model's understanding of the usage of idioms and enhance its cognitive ability. By providing origin explanation examples related to the origin of the idiom, it can better understand the meaning and emotional connotation of the idiom.
[0067] The corresponding first emotion label and second emotion label are obtained through the above two methods. However, it should be pointed out here that although the previous article puts the acquisition process of the first emotion label first, the acquisition process of the second emotion label can also be put first, so the order of the acquisition process of the first emotion label and the acquisition process of the second emotion label can be swapped.
[0068] S160, determining a target idiom label corresponding to the target idiom based on the first emotion label and the second emotion label;
[0069] In the process of determining the target idiom label, as shown in FIG5 , the following steps are specifically included:
[0070] S161, retrieve a first emotion label and a second emotion label;
[0071] It should be noted here that both the first emotion label and the second emotion label have corresponding label attributes. For example, in the embodiment of the present application, the label attributes are divided into three attributes: positive, neutral, and negative. Therefore, after obtaining the target sentence set corresponding to the target idiom, the emotion attribute of each target sentence will be marked in advance. As shown in Figure 6, the specific emotion attribute marking process is as follows:
[0072] S111, obtaining the sentiment attribute corresponding to each target sentence. The idiom model can directly query the sentiment attribute of the target sentence, or directly analyze the corresponding sentiment attribute through the target sentence.
[0073] S112, obtaining attribute parameters corresponding to each emotional attribute of the target idiom;
[0074] If the target sentence only has one sentiment attribute, the corresponding sentiment attribute can be determined without obtaining the corresponding attribute parameters. If multiple sentiment attributes are obtained, voting can proceed. For example, if the target idiom has two sentiment attributes, positive or neutral, the voting mechanism can be started.
[0075] S113, determining the emotional attribute with the largest attribute parameter as the target emotional attribute;
[0076] Combined with the description of step S112, when the voting results are "positive", "positive", "positive", "positive" and "negative", the positive attribute parameter is 4, the neutral attribute parameter is 1, and the target emotional attribute is selected as positive; in addition, if the attribute parameters of multiple emotional attributes are consistent, it means that there are multiple corresponding emotional attributes.
[0077] S162: Vote for the first emotion label and the second emotion label respectively.
[0078] S163, obtaining a first number of votes corresponding to the first emotion label and a second number of votes corresponding to the second emotion label;
[0079] During the voting process, the corresponding vote data is recorded.
[0080] S164, determining a target idiom label based on the first number of votes and the second number of votes;
[0081] What needs to be attributed here is that, generally speaking, the target idiom may correspond to one idiom label, that is, the target idiom label is determined when there are more votes. For example, when the first number of votes is greater than the second number of votes, the first emotional label is used as the target idiom label. However, if the first number of votes is the same as the second number of votes, then the target idiom corresponds to multiple emotional labels, that is, the first emotional label and the second emotional label are used as the target idiom label together.
[0082] In the process of determining the first emotional label and determining the second emotional label, the method also includes: if the target idiom fails to determine the corresponding first emotional label and one or both of the second emotional labels, that is, after voting, the first emotional label and the second emotional label both fail to obtain the corresponding number of votes, and the system cannot determine whether the first emotional label or the second emotional label can be used as the target idiom label of the target idiom, then a manual labeling prompt is output. At this time, after the staff receives the manual labeling prompt, the corresponding staff needs to manually input the corresponding emotional label, or use one or both of the first emotional label and the second emotional label as emotional labels.
[0083] S170: After determining the target idiom label, the target idiom label is updated to the sentiment dictionary immediately, thereby achieving the update of the idiom sentiment dictionary.
[0084] The following is an embodiment of the device of the present application, which can be used to execute the method for expanding the idiom sentiment dictionary based on the dual thinking chain involved in the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the method embodiment of the method for expanding the idiom sentiment dictionary based on the dual thinking chain involved in the present application.
[0085] Please refer to FIG7 . In an embodiment of the present application, a device for expanding an idiom sentiment dictionary based on a dual thinking chain is provided, including but not limited to:
[0086] Target idiom acquisition module 200, example sentence set acquisition module 210, first emotion label determination module 220, target origin information acquisition module 230, explanatory example sentence set retrieval module 240, second emotion label determination module 250, target idiom label determination module 260, and updating module 270;
[0087] Wherein, the target idiom acquisition module 200 is used to acquire the corresponding target idiom;
[0088] An example sentence set acquisition module 210 is used to acquire a target example sentence set corresponding to a target idiom, wherein the target example sentence set includes multiple example sentences;
[0089] A first emotion label determination module 220 is configured to determine a corresponding first emotion label based on each target sentence in the target sentence set;
[0090] The target origin information acquisition module 230 is used to acquire the target origin information corresponding to the target idiom;
[0091] The description example sentence set retrieval module 240 is used to retrieve a corresponding origin description example sentence set based on the target origin information, wherein the origin description example sentence set includes a plurality of origin description example sentences;
[0092] A second emotion label determination module 250 is configured to determine a corresponding second emotion label based on each origin description example sentence in the origin description example sentence set;
[0093] A target idiom label determination module 260 is configured to determine a target idiom label corresponding to the target idiom based on the first emotion label and the second emotion label;
[0094] The updating module 270 is used to update the target idiom label into the sentiment dictionary.
[0095] In an exemplary embodiment, the apparatus further includes but is not limited to: an emotion label retrieval module 300, a voting module 310, a vote number acquisition module 320, and a target idiom label determination module 330;
[0096] The emotion tag retrieval module 300 is used to retrieve the first emotion tag and the second emotion tag;
[0097] A voting module 310 is used to vote on the first emotion label and the second emotion label respectively;
[0098] A vote acquisition module 320 is configured to acquire a first vote corresponding to a first emotion label and a second vote corresponding to a second emotion label;
[0099] The target idiom label determination module 330 is configured to determine the target idiom label based on the first number of votes and the second number of votes.
[0100] In an exemplary embodiment, the apparatus further includes but is not limited to: a first idiom input module 400, a first retrieval module 410, and a first emotion tag determination module 420;
[0101] The first idiom input module 400 is used to input the target idiom into the idiom model, wherein the idiom model is trained in advance and stores a large number of idiom examples and corresponding emotional information;
[0102] A first retrieval module 410 is used to retrieve all first target example sentences corresponding to the target idiom and first emotion information corresponding to the target idiom;
[0103] The first emotion label determination module 420 is used to determine the first emotion label based on all the first target sentences and the first emotion information corresponding to the first target sentences.
[0104] In an exemplary embodiment, the apparatus further includes but is not limited to: an origin information acquisition module 500, a guidance instruction acquisition module 510, and an origin description example sentence acquisition module 520;
[0105] The origin information acquisition module 500 receives an origin query instruction based on the idiom model and is used to acquire the origin information corresponding to the target idiom, wherein the origin information includes the nature of the idiom and the usage of the idiom;
[0106] A guidance instruction acquisition module 510 is used to acquire corresponding guidance instructions;
[0107] The origin description example sentence acquisition module 520 is used to acquire corresponding origin description example sentences based on the origin information and the guidance instruction, wherein the origin description example sentences may be one or more.
[0108] In an exemplary embodiment, the apparatus further includes but is not limited to: a first idiom input module 600, a control module 610;
[0109] The first idiom input module 600 is used to input the target idiom into the idiom model;
[0110] The control module 610 is used to control the idiom model to query the target idiom, wherein the query method can be one, one or more of direct query, usage query or idiom query.
[0111] In an exemplary embodiment, the apparatus further includes but is not limited to: an emotion attribute acquisition module 700, an attribute parameter acquisition module 710, and a target emotion attribute determination module 720;
[0112] The sentiment attribute acquisition module 700 is used to acquire the sentiment attribute corresponding to each target sentence, wherein the sentiment attribute includes three attributes: positive, neutral and negative;
[0113] An attribute parameter acquisition module 710 is used to acquire attribute parameters corresponding to each emotional attribute of the target idiom;
[0114] The target emotional attribute determination module 720 determines the emotional attribute with the largest attribute parameter as the target emotional attribute.
[0115] In an exemplary embodiment, the apparatus further includes but is not limited to: an output module 800 and an emotion tag determination module 810;
[0116] The output module 800 is configured to output a manual annotation prompt if the target idiom fails to determine the corresponding first emotion tag and the second emotion tag, or both emotion tags.
[0117] The emotion label determination module 810 is used to determine one or both of the corresponding first emotion label and the second emotion label based on the emotion label input manually after the staff receives the manual labeling prompt.
[0118] It should be noted that the idiom emotion dictionary expansion device based on dual thinking chains provided in the above embodiment only uses the division of the above-mentioned functional modules as an example when expanding the idiom emotion dictionary based on dual thinking chains. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the idiom emotion dictionary expansion device based on dual thinking chains will be divided into different functional modules to complete all or part of the functions described above.
[0119] In addition, the idiom emotion dictionary expansion device based on dual thinking chain provided in the above embodiment and the idiom emotion dictionary expansion method based on dual thinking chain belong to the same concept, and the specific way in which each module performs operations has been described in detail in the method embodiment and will not be repeated here.
[0120] Please refer to FIG8 . An embodiment of the present application provides an electronic device 4000 . The electronic device 400 may include a desktop computer, a laptop computer, a server, etc.
[0121] In FIG. 8 , the electronic device 4000 includes at least one processor 4001 and at least one memory 4003 .
[0122] Data exchange between the processor 4001 and the memory 4003 can be achieved via at least one communication bus 4002. The communication bus 4002 may include a path for transmitting data between the processor 4001 and the memory 4003. The communication bus 4002 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. The communication bus 4002 may be divided into an address bus, a data bus, a control bus, etc.
[0123] Optionally, the electronic device 4000 may further include a transceiver 4004, which may be used for data exchange between the electronic device and other electronic devices, such as data transmission and / or data reception. It should be noted that in actual applications, the number of transceivers 4004 is not limited to one, and the structure of the electronic device 4000 does not constitute a limitation on the embodiments of the present application.
[0124] Processor 4001 can be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. Processor 4001 can also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.
[0125] The memory 4003 can be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disk storage, optical disc storage (including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program instructions or codes in the form of instructions or data structures and can be accessed by the electronic device 400, but is not limited to these.
[0126] Computer-readable instructions are stored in the memory 4003 , and the processor 4001 can read the computer-readable instructions stored in the memory 4003 through the communication bus 4002 .
[0127] The computer-readable instructions are executed by one or more processors 4001 to implement the idiom sentiment dictionary expansion method based on dual thinking chain in the above embodiments.
[0128] In addition, an embodiment of the present application provides a storage medium having computer-readable instructions stored thereon, and the computer-readable instructions are executed by one or more processors to implement the above-mentioned method for expanding the idiom sentiment dictionary based on the dual thinking chain.
[0129] In an embodiment of the present application, a computer program product is provided, which includes computer-readable instructions. The computer-readable instructions are stored in a storage medium. One or more processors of an electronic device read the computer-readable instructions from the storage medium, load and execute the computer-readable instructions, so that the electronic device implements the idiom emotion dictionary expansion method based on the dual thinking chain as described above.
[0130] In an embodiment of the present application, after determining the target idiom, the system can first obtain the first emotion label or the second emotion label. As mentioned above, the order of obtaining the first emotion label and obtaining the second emotion label can be swapped, and will not be repeated here. In the process of obtaining the first emotion label, the target idiom is input into the idiom for query. Here, the query can be performed through direct query, usage query or idiom query, or a variety of query methods can be combined to query, so that the system can obtain the corresponding first target example sentence. However, during the query process, the number of first target example sentences may be one or more, so the system can obtain the corresponding target example sentence set.
[0131] Each target sentence carries a corresponding emotional color, so when an idiom is provided as input to the idiom model, the idiom model will generate a first target sentence related to the idiom based on the knowledge it remembers, and the first target sentence corresponds to the first emotional information. The first emotional label of the target idiom in the first target sentence can be determined through the first emotional information. In the case where there are more first target sentences, the corresponding first emotional label can be determined. At this time, the content in the emotional label can be one or more.
[0132] In the process of obtaining the second emotional label, the idiom model receives the origin query instruction and can obtain the origin information corresponding to the target idiom. The target origin information corresponding to the target idiom can be obtained through the target idiom, and the target origin information includes information about the origin of the idiom, relevant examples of the formation of the corresponding idiom, the nature of the idiom, and the use of the idiom. Then, the corresponding origin description example sentence is obtained through the guidance instruction, and then the corresponding second emotional label is determined based on each origin description example sentence in the origin description example sentence set.
[0133] After determining the first emotional label and the second emotional label, you can vote on the first emotional label and the second emotional label respectively. When the first number of votes is greater than the second number of votes, the first emotional label will be used as the target idiom label. However, if the first number of votes is the same as the second number of votes, this is the case where the target idiom corresponds to multiple emotional labels, that is, the first emotional label and the second emotional label are used as target idiom labels together. Finally, the target idiom label corresponding to the target idiom is updated to the idiom emotional dictionary as soon as possible.
[0134] To sum up, in the process of updating the emotional labels of idioms to the emotional dictionary, the scheme not only focuses on the emotional meaning of idioms, but also provides explanations of the origin and usage of idioms; by consulting the idiom model about the origin of idioms and providing examples of origin derivatives, we can enhance our understanding of the usage and emotional resonance of idioms, and provide explanations of the emotional meaning of idioms. In order to make the emotional analysis of idioms more accurate, our method adopts two methods to determine the emotional labels corresponding to idioms, which can more comprehensively understand and analyze the emotional meaning of idioms. On the one hand, it uses the query ability of the idiom model to generate examples and extract emotional connotations, effectively capturing the emotional expression of idioms; on the other hand, by analyzing the origin of idioms and providing examples of origin derivatives, we have an in-depth understanding of the meaning and emotional resonance of idioms. This comprehensive analysis method makes the emotional analysis of idioms more accurate and comprehensive. Finally, the determined target emotional labels are updated to the corresponding idiom emotional dictionary as soon as possible, so that the emotional labels of idioms can be updated in a timely and accurate manner.
[0135] It should be understood that although the steps in the flowcharts of the accompanying drawings are shown in sequence as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some of the steps in the flowcharts of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
[0136] The above description is only part of the implementation methods of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A method for expanding an idiom emotion dictionary based on a dual thinking chain, characterized in that, it includes: Obtain the corresponding target idiom; Obtain the set of target example sentences corresponding to the target idiom, where there are multiple example sentences in the set of target example sentences; Determine the corresponding first emotion label based on each target example sentence in the set of target example sentences; Obtain the target origin information corresponding to the target idiom; Retrieve the corresponding set of origin explanation example sentences based on the target origin information, where there are multiple origin explanation example sentences in the set of origin explanation example sentences; Determine the corresponding second emotion label based on each origin explanation example sentence in the set of origin explanation example sentences; Determine the target idiom label corresponding to the target idiom based on the first emotion label and the second emotion label; Update the target idiom label to the emotion dictionary.
2. The method according to claim 1, characterized in that, In the process of determining the target idiom label corresponding to the target idiom based on the first emotion label and the second emotion label, the method further includes: Retrieve the first emotion label and the second emotion label; Vote on the first emotion label and the second emotion label respectively; Obtain the first vote count corresponding to the first emotion label and the second vote count corresponding to the second emotion label; Determine the target idiom label based on the first vote count and the second vote count.
3. The method according to claim 1, characterized in that, In the process of determining the corresponding first emotion label based on each target example sentence in the set of target example sentences, the method further includes: Input the target idiom into an idiom model, where the idiom model is pre-trained and stores a large number of example sentences of idioms and their corresponding emotion information; Retrieve all the first target example sentences corresponding to the target idiom and the first emotion information corresponding to the target idiom; Determine the first emotion label based on all the first target example sentences and the first emotion information corresponding to the first target example sentences.
4. The method according to claim 1, characterized in that, In the process of retrieving the corresponding set of origin explanation example sentences based on the target origin information, the method further includes: Obtain the origin information corresponding to the target idiom based on the idiom model receiving an origin query instruction, where the origin information includes the nature of the idiom and the usage of the idiom; Obtain the corresponding guiding instruction; Obtain the corresponding origin explanation example sentence based on the origin information and the guiding instruction, where the origin explanation example sentence can be one or more.
5. The method according to claim 2, characterized in that, The method further includes: In the process of retrieving all the first target example sentences corresponding to the target idiom and the first emotion information corresponding to the target idiom, the method further includes: Input the target idiom into an idiom model; Control the idiom model to query the target idiom, where the query method can be one, some or multiple of direct query, usage query or idiom query.
6. The method according to claim 1, characterized in that, The method further includes: After obtaining the set of target example sentences corresponding to the target idiom, the method includes: Obtain the emotion attribute corresponding to each target example sentence, where the emotion attribute includes three attributes: positive, neutral and negative; Obtain the attribute parameter corresponding to each emotion attribute of the target idiom; Determine the emotional attribute with the largest attribute parameter as the target emotional attribute.
7. The method according to claim 1, wherein, the method further includes: during the process of determining the first emotional label and determining the second emotional label, the method further includes: if the target idiom fails to determine one or both of the corresponding first emotional label and second emotional label, output an artificial annotation prompt; after the staff receives the artificial annotation prompt, determine one or both of the corresponding first emotional label and second emotional label based on the obtained artificial input of emotional labels.
8. An idiom emotional dictionary expansion device based on a dual thinking chain, wherein, comprising: a target idiom acquisition module for acquiring the corresponding target idiom; an example sentence set acquisition module for acquiring the target example sentence set corresponding to the target idiom, wherein there are multiple example sentences in the target example sentence set; a first emotional label determination module for determining the corresponding first emotional label based on each target example sentence in the target example sentence set; a target origin information acquisition module for acquiring the target origin information corresponding to the target idiom; an explanatory example sentence set retrieval module for retrieving the corresponding origin explanatory example sentence set based on the target origin information, wherein there are multiple origin explanatory example sentences in the origin explanatory example sentence set; a second emotional label determination module based on each origin explanatory example sentence in the origin explanatory example sentence set for determining the corresponding second emotional label; a target idiom label determination module for determining the target idiom label corresponding to the target idiom based on the first emotional label and the second emotional label; an update module for updating the target idiom label to the emotional dictionary.
9. An electronic device, wherein, comprising: at least one processor and at least one memory, wherein, the memory stores computer-readable instructions; the computer-readable instructions are executed by one or more of the processors, so that the electronic device implements the idiom emotional dictionary expansion method based on a dual thinking chain according to any one of claims 1 to 7.
10. A storage medium, on which computer-readable instructions are stored, wherein, the computer-readable instructions are executed by one or more processors to implement the idiom emotional dictionary expansion method based on a dual thinking chain according to any one of claims 1 to 7.
Citation Information
Patent Citations
Method and device for correcting and / or expanding sentiment dictionary
CN102236650A
Emotion enhancement device based on emotion dictionary
CN114357983A
Emotion dictionary construction method and device, electronic equipment and computer readable medium
CN115796158A
Idiom recognition method and device, storage medium and electronic equipment
CN116013302A
System and method for sentiment lexicon expansion
US20170192955A1