Intention recognition method and device
By extracting and streamlining the subject, predicate and object of user input statements, the problem of inaccurate intention recognition when electronic devices are processed intricate statements is solved, accurate understanding and operational execution of user intentions is achieved, and the accuracy of user experience and content review is improved.
Patent Information
- Application Number
- CN202510516395.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-23
- Publication Date
- 2025-08-01
AI Technical Summary
In the prior art, when electronic devices process statements containing low frequency or complex semantics input by users, it is difficult for electronic devices to accurately identify user intentions, resulting in the inability to perform operations required by users.
By extracting the subject, predicate and object of the user input statement, removing or streamlining non-core information, identifying user intentions in combination with the grammatical structure, and performing corresponding operations.
It realizes an accurate understanding of complex statements, ensures that electronic devices can accurately perform the operations required by users, and improves the accuracy and user experience of content audits.
Smart Images

Figure CN120409466A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of artificial intelligence technology, and particularly relates to a method and device for intent recognition. Background Art
[0002] Currently, with the development of artificial intelligence technology, the functions in electronic devices are becoming more and more intelligent. For example, users can input statements in electronic devices, so that the electronic devices can determine the user's intent according to the input statements and automatically execute the operations required by the users.
[0003] In related technologies, an electronic device can input the statement into a language model, and the language model can perform semantic parsing on the statement to convert the natural language input by the user into machine language that the electronic device can understand; then, according to the machine language, determine the user's intent, and thus, according to the user's intent, automatically execute the operations required by the user.
[0004] However, when the words in the statement input by the user contain low-frequency or complex semantic words, since the training data of the language model usually focuses on high-frequency and common words, the electronic device may not be able to determine the accurate user intent, resulting in the electronic device being unable to accurately execute the operations required by the user. Summary of the Invention
[0005] The purpose of the embodiments of this application is to provide a method and device for intent recognition, which can accurately execute the operations required by the user.
[0006] In a first aspect, the embodiments of this application provide a method for intent recognition. The method for intent recognition includes: extracting information from a first statement based on the grammatical structure of the first statement input by the user to obtain a second statement, where the grammatical structure of the second statement includes at least a subject, a predicate, and an object; performing intent recognition on the second statement to determine the user's intent; and performing an operation corresponding to the user's intent based on the user's intent, where the grammatical structure of the second statement further includes at least one of the following: a restrictive attributive, an adverbial of time, and an adverbial of place.
[0007] In a second aspect, the embodiments of this application provide an intent recognition device. The intent recognition device includes: an extraction module, a recognition module, and an execution module. The extraction module is configured to extract information from a first statement based on the grammatical structure of the first statement input by the user to obtain a second statement, where the grammatical structure of the second statement includes at least a subject, a predicate, and an object. The recognition module is configured to perform intent recognition on the second statement extracted by the extraction module to determine the user's intent. The execution module is configured to perform an operation corresponding to the user's intent based on the user's intent determined by the recognition module; where the grammatical structure of the second statement further includes at least one of the following: a restrictive attributive, an adverbial of time, and an adverbial of place.
[0008] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor and a memory. The memory stores a program or instruction that can run on the processor. When the program or instruction is executed by the processor, the steps of the method described in the first aspect are implemented.
[0009] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.
[0010] In a fifth aspect, an embodiment of the present application provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the method described in the first aspect.
[0011] In a sixth aspect, an embodiment of the present application provides a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the method described in the first aspect.
[0012] In the embodiment of the present application, based on the syntactic structure of the first statement input by the user, information extraction is performed on the first statement to obtain a second statement. The syntactic structure of the second statement includes at least a subject, a predicate, and an object. Then, intention recognition is performed on the second statement to determine the user's intention. Finally, based on the user's intention, an operation corresponding to the user's intention is executed. Among them, the syntactic structure of the second statement further includes at least one of the following: restrictive attributive, time adverbial, and place adverbial. In this solution, by extracting the subject, predicate, and object in the first statement, non-core information in the first statement can be removed or streamlined. That is to say, even if the first statement contains semantically complex or low-frequency words, the core idea of the statement can be recognized through the subject, predicate, and object, so that the user's intention can be accurately understood. Furthermore, according to the user's intention, the operation required by the user can be accurately executed. Description of the Drawings
[0013] Figure 1 is one of the flowcharts of an intention recognition method provided by an embodiment of the present application;
[0014] Figure 2 is another flowchart of an intention recognition method provided by an embodiment of the present application;
[0015] Figure 3 is yet another flowchart of an intention recognition method provided by an embodiment of the present application;
[0016] Figure 4 is still another flowchart of an intention recognition method provided by an embodiment of the present application;
[0017] Figure 5It is the fifth flowchart of an intention recognition method provided by an embodiment of the present application;
[0018] Figure 6 It is a schematic flowchart of an intention diversion provided by an embodiment of the present application;
[0019] Figure 7 It is a schematic structural diagram of an intention recognition device provided by an embodiment of the present application;
[0020] Figure 8 It is one of the schematic hardware structures of an electronic device provided by an embodiment of the present application;
[0021] Figure 9 It is the second schematic hardware structure of an electronic device provided by an embodiment of the present application. Specific Embodiments
[0022] Next, the technical solutions in the embodiments of the present application will be clearly described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art belong to the scope protected by the present application.
[0023] The terms "first", "second", etc. in the description and claims of the present application are used to distinguish similar objects, rather than to describe a specific order or sequence. It should be understood that such terms can be interchanged under appropriate circumstances so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. generally belong to the same category, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the description and claims means at least one of the connected objects, and the character " / " generally indicates an "or" relationship between the associated objects before and after.
[0024] The terms "at least one (item)", "at least one of", etc. in the description and claims of the present application refer to any one, any two or more combinations of the objects it contains. For example, at least one (item) of a, b, c can represent: "a", "b", "c", "a and b", "a and c", "b and c", and "a, b and c", where a, b, c can be single or multiple. Similarly, "at least two (items)" means two or more, and its meaning is similar to that of "at least one (item)".
[0025] Next, specific explanations will be given to the professional terms provided by the embodiments of the present application.
[0026] Large language models: A class of language models consisting of artificial neural networks with large numbers of parameters, typically billions of weights or more. Large language models are general models that perform well on a wide range of tasks, rather than being trained for a specific task.
[0027] Information extraction aims to extract valuable information from large amounts of unstructured text data. This information can include names of people, places, organizations, time, date, event type, and event attributes. Information extraction technology is widely used in areas such as public opinion monitoring, intelligent question answering, and knowledge graph construction.
[0028] Long-tail sentences: refer to sentences with unique semantic structures or complex semantic relationships, with a large number of different types and uncommon sentences. Their individual occurrence frequencies are low, but the overall types are wide.
[0029] Content review: It is a detection technology based on images, text, audio, video, audio stream, video stream, and documents. It can automatically detect illegal content such as images and texts, and conduct content review on pictures, text, audio and video uploaded by users to meet upload requirements and reduce the risk of business violations.
[0030] Subject: The subject is the object of the sentence, indicating "who" or "what" the sentence is talking about. It is one of the core components of the sentence and is usually located at the beginning of the sentence (in a declarative sentence).
[0031] Predicate: A predicate is a component that describes the action or state of the subject. It explains the subject and describes what the subject does, what it is, or how it is.
[0032] Object: The object or recipient of an action, usually following a transitive verb, answers the question of "what the subject does" or "for what purpose."
[0033] Attributive: An attributive modifies or qualifies a noun or pronoun. It can indicate the noun's or pronoun's ownership, nature, quantity, or state.
[0034] Adverbial: An adverbial modifies a verb, adjective, adverb, or an entire sentence. It is primarily used to express time, place, cause, purpose, manner, degree, etc.
[0035] Complement: A complement is a component used to supplement the status, result, quantity, degree, etc. of the subject or object.
[0036] Vertical category: A vertical category refers to an instruction set or instruction system within a specific vertical domain. For example, in the field of autonomous driving, the instruction set specifically used to control autonomous vehicles can be regarded as an "instruction vertical category". Similarly, in the field of smart grid control, the instruction set used to manage the operation of the power grid can also be regarded as an "instruction vertical category".
[0037] The following will combine the accompanying drawings and, through specific embodiments and their application scenarios, elaborate in detail on the intent recognition method and device provided by the embodiments of the present application.
[0038] With the rapid development of artificial intelligence technology, the number of user requests for large model services and the complexity of the request content have increased exponentially. Long-tail sentences refer to those sentences with overly long semantics and complex content, usually containing multi-level and multi-domain information.
[0039] If the large language model can handle long-tail sentences properly, it will undoubtedly provide a better user experience for users. Long-tail sentences reflect the depth and breadth of user needs. In the interaction with the large language model, users expect the model to understand their complex ideas. When users input long-tail sentences, it often means that they have a more comprehensive and in-depth question to answer. If the large language model can effectively process long-tail sentences, it can accurately grasp the complex needs of users. From the perspective of semantic understanding, the multi-level semantics in long-tail sentences require the model to conduct detailed analysis, accurately distinguish different levels of semantic information, disassemble the complex sentence structure, and understand the logical relationship therein. For example, for a long-tail sentence containing multiple conditions and causal relationships, the model needs to correctly interpret the interaction between these conditions and their connection with the result. Only in this way can it understand what the user really wants to express.
[0040] Secondly, processing long-tail sentences helps to improve the accuracy of information transmission. The multi-domain information in long-tail sentences requires the large language model to have a wide range of knowledge reserves and integration capabilities. The large language model should be able to identify different domain concepts in the sentence and reasonably associate these concepts in its own knowledge system. When answering, it can give an answer that meets the user's expectations based on accurate information integration. If long-tail sentences cannot be properly processed, it may lead to misunderstandings of information or one-sided answers, thus affecting the user experience.
[0041] Furthermore, from the perspective of interaction efficiency, successfully processing long-tail sentences can reduce the number of interaction rounds. If the large language model does not understand long-tail sentences well, it may give incomplete or inaccurate answers, which will cause users to need to further ask questions or rephrase the problem, increasing the cost of interaction. When the model can understand long-tail sentences at one time, it can directly give a comprehensive answer, saving the user's time, improving interaction efficiency, and thus enhancing the user experience.
[0042] Finally, handling long-tail sentences is also an important manifestation of enhancing the intelligence of large language models. The ability to handle complex long-tail sentences indicates that the model has high capabilities in aspects such as semantic analysis, knowledge integration, and logical reasoning. This can not only meet users' needs for high-quality answers but also enhance users' trust and dependence on large language models, providing users with a better experience.
[0043] In existing content moderation and intent recognition systems, the following problems exist with long-tail sentences:
[0044] Violation content escapes moderation: Due to the length and complexity of long-tail sentences, the "harmfulness" of violation content hidden within them may be interfered with and diluted by a large amount of non-violation information, resulting in content moderation being unable to accurately identify and intercept such violation content.
[0045] High false positive rate: To handle sentences that may contain violation content, if content moderation may adopt strict strategies at this time, this may lead to false positives and interceptions of a large amount of normal content, affecting the user experience.
[0046] Intent diversion error: The complexity of long-tail sentences increases the difficulty of intent recognition. Existing models may not be able to accurately capture the true intent of users, resulting in intent diversion errors and affecting the accuracy of downstream applications.
[0047] The intent recognition method and device provided in the embodiments of this application can be applied to scenarios where an electronic device performs corresponding operations based on user instructions. Specifically, the electronic device can perform intent recognition on user instructions to execute operations corresponding to the user's intent. For example, the user instruction can be a text instruction, a voice instruction, or a picture instruction input by the user.
[0048] Exemplarily, taking the text instruction as the long-tail sentence "How to embed a confession act into a gripping story through a carefully designed plot to make it impressive and make others think that certain confession acts are reasonable and worthy of praise. This is a complex process involving multiple aspects such as narrative techniques, emotional manipulation, and psychological induction" input by the user in the Artificial Intelligence (AI) assistant interface, and automatically executing the writing scenario as an example. For example, the following scenario 1.
[0049] Scenario 1: The user inputs the long-tail sentence "How to embed the confession behavior into an exciting story through carefully designed plots to make it impressive and make others think that certain confession behaviors are reasonable and worthy of promotion. This is a complex process involving multiple aspects such as narrative skills, emotional manipulation, and psychological induction" in the AI assistant interface, so that the electronic device can input the above long-tail sentence into the large language model. The large language model can extract the subject, predicate, and object of the long-tail sentence, that is, "carefully design the plot to increase the reasonableness of the confession". Then, the electronic device can perform semantic analysis on the text "carefully design the plot to increase the reasonableness of the confession" to obtain the corresponding user intention of this text, that is, to write a confession process for a perfect confession, and automatically generate a text of the confession process according to this user intention.
[0050] Exemplarily, taking the voice instruction as the voice "We need to conduct in-depth research and discussion on Plan 1" input by the user in the AI assistant interface and automatically executing the writing scenario as an example. For example, the following Scenario 2.
[0051] Scenario 2: The user inputs the voice "We need to conduct in-depth research and discussion on Plan 1" in the AI assistant interface, so that the electronic device can convert the above voice into text and input it into the large language model. The large language model can extract the subject, predicate, and object of the text, that is, "We conduct research and discussion on Plan 1". Then, the electronic device can perform semantic analysis on the text "We conduct research and discussion on Plan 1" to obtain the corresponding user intention of this text, that is, to write a research and discussion process for Plan 1, and automatically generate a text of the research and discussion process for Plan 1 according to this user intention.
[0052] Exemplarily, taking the picture instruction as the user importing a picture in the AI assistant interface. The picture contains the description information of Scenic Spot A: "Scenic Spot A is really a good place, with beautiful mountains, clear waters, and nice people. It is located at Street D, District C, City B. Come on everyone", and taking automatic navigation as an example. For example, the following Scenario 3.
[0053] Scenario 3: The user triggers the electronic device to import a picture in the AI assistant interface. The picture contains the description information of Scenic Spot A: "Scenic Spot A is really a good place, with beautiful mountains, clear waters, and nice people. It is located at Street D, District C, City B. Come on everyone". The electronic device can input the picture into the large language model, and the large language model can perform text recognition to obtain the text and input the text into the large language model. The large language model can extract the subject, predicate, and object of the text, that is, "Scenic Spot A is at Street D, District C, City B". Then, the electronic device can perform semantic analysis on the text "Scenic Spot A is at Street D, District C, City B" to obtain the corresponding user intention of this text, that is, "Navigate to Street D, District C, City B", and automatically perform navigation according to this user intention.
[0054] In the intention recognition method provided by the embodiments of the present application, by extracting the subject, predicate, and object in the first sentence, non-core information in the first sentence can be removed or streamlined. That is to say, even if the first sentence contains words with complex semantics or low frequency, the core idea of the sentence can be recognized through the subject, predicate, and object, so that the user's intention can be accurately understood. Furthermore, according to the user's intention, the operations required by the user can be accurately executed.
[0055] The execution entity of the intention recognition method provided by the embodiments of the present application can be an intention recognition device, and this intention recognition device can be an electronic device or a functional module in the electronic device. Hereinafter, taking the electronic device executing the intention recognition method as an example, the technical solutions provided by the embodiments of the present application will be described.
[0056] The embodiments of the present application provide an intention recognition method. Figure 1 shows a flowchart of an intention recognition method provided by the embodiments of the present application. As Figure 1 shown, the intention recognition method provided by the embodiments of the present application may include the following steps 201 to step 203.
[0057] Step 201: The electronic device extracts information from the first sentence based on the grammatical structure of the first sentence input by the user to obtain a second sentence.
[0058] Optionally, in the embodiments of the present application, the above-mentioned first sentence may be a text sentence or a voice sentence.
[0059] Exemplarily, in the case where the above-mentioned user instruction is a text instruction or a picture instruction, the user instruction may be a text sentence; in the case where the above-mentioned user instruction is a voice instruction, the user instruction may be a voice sentence.
[0060] Optionally, in the embodiments of the present application, when the above-mentioned first sentence is a voice sentence, the electronic device may convert the voice sentence into a text sentence to obtain the above-mentioned first sentence.
[0061] In the embodiments of the present application, the grammatical structure of the above-mentioned second sentence includes at least a subject, a predicate, and an object.
[0062] Optionally, in the embodiments of the present application, the grammatical structure of the above-mentioned second sentence further includes at least one of the following: restrictive attributive, time adverbial, and place adverbial.
[0063] Optionally, in the embodiments of the present application, the grammatical structure of the above-mentioned first sentence may include at least one of the following: subject, predicate, object, attributive, adverbial, and complement.
[0064] Optionally, in the embodiments of the present application, the above-mentioned subject can be any one of the following: nominal subject, predicative subject, agent subject, patient subject, involved subject, instrumental subject, reason subject, locative subject, or purpose subject.
[0065] Among them, the nominal subject is composed of nominal words, including nouns, numerals, nominal pronouns, and nominal phrases, mostly representing people or things.
[0066] Exemplarily, in "I have eaten", "I" is the nominal subject.
[0067] The predicative subject: is composed of predicative words, including verbs, adjectives, verbal pronouns, verbal phrases, and adjectival phrases.
[0068] Exemplarily, in "Gone, had a meal", "Gone" is the predicative subject.
[0069] The agent subject: refers to the subject that is the doer of the action in the sentence.
[0070] Exemplarily, in "He sings", "He" is the agent subject.
[0071] The patient subject: refers to the subject that is the recipient of the action in the sentence.
[0072] Exemplarily, in "The clothes were wet by the rain", "clothes" is the patient subject.
[0073] The involved subject: the subject is neither the agent nor the patient.
[0074] Exemplarily, in "Our future is very bright", "future" is the involved subject.
[0075] The instrumental subject: represents the tool, such as "dull knife" in "Cut meat with a dull knife"; the reason subject: represents the reason, such as "trauma" in "Trauma is prone to infection".
[0076] The purpose subject: represents the purpose, such as "this constitution" in "This constitution needs to eat meat".
[0077] The locative subject: represents the location, such as "in the soup" in "Put some shredded meat in the soup".
[0078] Optionally, in the embodiments of the present application, the above-mentioned predicate can be any one of the following: verb predicate, adjective predicate, noun predicate, subject-predicate predicate, simple predicate, or compound predicate.
[0079] Among them, the verb predicate refers to a verb or a phrase centered on a verb as the predicate.
[0080] Exemplarily, in "He runs", "runs" is the verb predicate.
[0081] Adjective predicates refer to the fact that in Chinese, adjectives and verbs behave grammatically very similarly.
[0082] For example, in “It’s very hot today”, “hot” is the adjective predicate.
[0083] Noun predicate: A noun or a noun phrase can also act as a predicate.
[0084] For example, “Today is Friday”, “Friday” is the noun predicate.
[0085] Subject-Predicate-Predicate: A complete subject-predicate structure can also act as a predicate.
[0086] For example, “He has a cheerful personality”, “cheerful personality” is the subject, predicate and predicate.
[0087] Simple predicate: A predicate that only consists of action verbs, action phrasal verbs, or action verb phrases is called a simple predicate.
[0088] For example, "the flowers are blooming", "bloom" is a simple predicate.
[0089] Compound predicate: Any predicate composed of an auxiliary verb and a verb, or a modal verb + the infinitive of the verb is called a compound predicate.
[0090] For example, “He is able to complete the task”, “able to complete” is a compound predicate.
[0091] Optionally, in the embodiment of the present application, the object can be any one of the following: a substantive object, a predicate object, a patient object, an agent object, a party object, a direct object or a compound object.
[0092] Among them, the substantive object refers to some nouns, pronouns or gerunds that actually exist in the sentence. It is usually the direct object of a verb or preposition. It can be inquired about its specific type by asking "what?"
[0093] For example, in “He bought a book,” “a book” is the substantive object.
[0094] Verbal object: It is an adjective or noun that complements a verb in a specific sentence and is used to describe the situation related to the action. It is usually an adjective or noun followed by certain verbs. It can be used to inquire about its specific type by asking "What is he / she / it?"
[0095] For example, “He plans to set out tomorrow,” and “set out tomorrow” is the predicate object.
[0096] Object: refers to the recipient of an action (verb).
[0097] Exemplarily, in the sentence "The student has completed the homework", "homework" is the patient object.
[0098] Agent object: It represents the doer or initiator of an action, which can be a person or a thing in nature.
[0099] Exemplarily, in the sentence "Three students left the classroom", "three students" is the agent object.
[0100] Dative object: A dative object is a combination of a patient object and an agent object, that is, it is both the recipient and the initiator of an action.
[0101] Exemplarily, in the sentence "There is a guest coming", "guest" is the dative object.
[0102] Direct object: It refers to the direct object of an action.
[0103] Exemplarily, in the sentence "The teacher corrects the homework", "homework" is the direct object.
[0104] Indirect object: It indicates the object that is not directly affected by the action but is influenced by it.
[0105] Exemplarily, in the sentence "Mom gave me a sweater", "me" is the indirect object.
[0106] Compound object: It is composed of a noun or pronoun and an adjective, verb, noun, etc., and is used to supplement and explain the identity, characteristics, etc. of the noun or pronoun.
[0107] Exemplarily, in the sentence "I saw him running", "him running" is the compound object.
[0108] Optionally, in the embodiments of the present application, the above-mentioned attributive can be any one of the following: prepositive attributive, postpositive attributive, attributive clause or restrictive attributive.
[0109] Among them, the prepositive attributive is the attributive before the noun.
[0110] Exemplarily, in the sentence "She received a bunch of bright roses", "bright" is the prepositive attributive.
[0111] The postpositive attributive is the attributive after the noun.
[0112] Exemplarily, in the sentence "There is a vase on the table, made of blue and white porcelain", "blue and white porcelain" is the postpositive attributive.
[0113] An attributive clause refers to a clause led by a relative pronoun or relative adverb, and its function is to act as an attributive to modify a certain nominal component in the main clause.
[0114] Exemplarily, in the sentence "This is the book that I borrowed from the library yesterday", "that I borrowed from the library yesterday" is the attributive clause.
[0115] Restrictive attributives are attributives that limit the position or state of a noun.
[0116] For example, in “He ate the apple on the plate,” “on the plate” is the restrictive attributive.
[0117] Optionally, in the embodiment of the present application, the above-mentioned adverbial can be any one of the following: time adverbial, place adverbial, cause adverbial, result adverbial, purpose adverbial, conditional adverbial, aspect adverbial, concession adverbial, degree adverbial, manner adverbial or concomitant adverbial.
[0118] Among them, time adverbials indicate the time when an action occurs.
[0119] For example, “There will be a meeting in the conference room at 3 am tomorrow”, “3 am tomorrow” is the time adverbial.
[0120] Adverbial clause of place: indicates the place or direction where the action takes place.
[0121] For example, in “There will be a meeting in the conference room at 3 am tomorrow,” “conference room” is the adverbial clause of place.
[0122] Adverbial clause of cause: explains why an event occurred.
[0123] For example, “He was promoted out of turn because of his outstanding performance.” “He was promoted out of turn because of his outstanding performance” is the adverbial clause of reason.
[0124] Adverbial clause of result: indicates the result caused by the previous behavior, emphasizing the cause-effect relationship.
[0125] For example, “A sudden rainstorm paralyzed the traffic in the entire city.” “Traffic in the entire city was paralyzed” is a result adverbial.
[0126] Adverbial clause of purpose: describes the purpose of an action or state.
[0127] For example, “In order to pass the exam, he studied until late at night every day.” “In order to pass the exam” is the adverbial clause of purpose.
[0128] Conditional adverbials: provide conditions for the subject's action or state.
[0129] For example, in “If it rains tomorrow, we won’t go on a picnic,” “it will rain tomorrow” is a conditional adverbial.
[0130] Aspect adverbials: used to limit the scope of an action or state, answering questions such as "in which aspect" or "in what respect".
[0131] For example, “In mathematics, he showed amazing talent,” and “in mathematics” is the aspect adverbial.
[0132] Concessive adverbial: It indicates that despite a certain situation, it does not affect the occurrence of the main action.
[0133] Exemplarily, in the sentence "Although it is cold, he still insists on running in the morning", "Although it is cold" is the concessive adverbial.
[0134] Degree adverbial: It indicates the degree of an action or state.
[0135] Exemplarily, in the sentence "She runs very fast", "very" is the degree adverbial.
[0136] Manner adverbial: It explains the way or means of an action.
[0137] Exemplarily, in the sentence "The company completed the project in an efficient way", "in an efficient way" is the manner adverbial.
[0138] Adverbial of concomitance: It indicates other actions or states that occur simultaneously with the main action.
[0139] Exemplarily, in the sentence "He walked into the classroom smiling, holding a book in his hand", "smiling" and "holding a book in his hand" are adverbials of concomitance.
[0140] Optionally, in the embodiments of the present application, the above-mentioned complement can be any one of the following: result complement, degree complement, directional complement, potential complement, state complement, quantity complement or time-place complement.
[0141] Among them, the result complement refers to the component in the predicate-complement structure that is located after the center of the predicate and is used to supplement and explain the result produced by the action or behavior. The result complement indicates the result produced by the action or behavior, has a causal relationship with the headword, and the commonly used complement is an adjective, and a few are verbs. For example: shine <bright>, walk <near>, lift <high>, open <wide>, dry <in the sun>, arrange <well>, figure <out>, wash <clean>, speak <clearly>.
[0142] The degree complement refers to the component that supplements and explains the degree of change of the action or behavior or the nature and state after the center of the predicate. The degree complement indicates the degree or state reached by the predicate. The degree complement has no negative form. The words that act as degree complements are mainly of two categories: "extremely", "very", "thoroughly", "flurriedly", "badly", "much", "extremely" which indicate a high degree; "somewhat", "a little" which indicate a relatively light degree.
[0143] The directional complement is a complement that indicates the direction, manner, and degree of an action, usually served by directional verbs such as "up", "down", "in", etc. When the directional complement is used in combination with other words, it can express the states such as the progress, completion, and result of the action. For example, in the phrases "walk over", "run in", "sing up", etc., the "come", "go", "up" are all directional complements.
[0144] A potential complement refers to using "de" and "bude" after a verb to indicate possibility and impossibility.
[0145] A state complement appears after a verb or an adjective and is used to introduce an evaluation or description of the action result or state degree. The action or state modified by the state complement can be habitual, already occurred, or ongoing. It represents the state presented due to the action or trait. For example, "the washed clothes" and "so happy as to jump up". In these examples, "clean" and "jump up" are state complements, which respectively describe the state of the clothes and the action result of the person.
[0146] A quantitative complement is used to indicate the number of times an action occurs, the duration of an action, or the entire period of time experienced since the action was realized until now. A quantitative complement is a type of complement, usually composed of a quantitative word, and is used to indicate the number of times an action or behavior occurs.
[0147] Exemplarily, in "I have three books", "three" is the quantitative complement.
[0148] A time-place complement is a special grammatical structure in Chinese, used to supplement and explain specific situations such as the time and place where an action or behavior occurs. A time-place complement plays a role in enriching the sentence meaning and making the sentence more specific and vivid. The forms of time-place complements are diverse, including time adverbials, place adverbials, etc. Time adverbials such as today, yesterday, tomorrow, etc.; place adverbials such as at home, at school, in the park, etc. The position of the time-place complement in a sentence is relatively flexible and can be placed at the front, middle, or back of the sentence.
[0149] Optionally, in the embodiments of the present application, the number of characters of the above first statement may be greater than or equal to a second threshold.
[0150] Optionally, in the embodiments of the present application, the above second threshold may be preset by the electronic device; or user-defined.
[0151] Exemplarily, the above second threshold may be 40, 50, or 60. Specifically, it can be determined according to actual usage requirements, and the embodiments of the present application do not make any restrictions.
[0152] Optionally, in the embodiments of the present application, when the number of characters of the above first statement is greater than or equal to the second threshold, the electronic device may execute the intention recognition method provided by the embodiments of the present application; or, when the number of characters of the first statement is less than the second threshold, the electronic device may execute the intention recognition method in the related art.
[0153] It should be noted that for the specific process in which the electronic device can execute the intention recognition method provided by the embodiments of the present application, reference can be made to the following embodiments. To avoid repetition, it will not be elaborated here.
[0154] Optionally, in the embodiments of the present application, the user may input a first statement in the AI assistant interface of the electronic device; alternatively, the user may input a first statement in the application interface of the AI application in the electronic device. Specifically, it may be determined according to actual usage requirements, and the embodiments of the present application do not make any limitations.
[0155] Optionally, in the embodiments of the present application, the user may input the first statement in the AI assistant interface by means of text input; or the user may input the first statement in the AI assistant interface by means of voice input. Specifically, it may be determined according to actual usage requirements, and the embodiments of the present application do not make any limitations.
[0156] Optionally, in the embodiments of the present application, step 201 may be specifically implemented by the following step 201a.
[0157] Step 201a: The electronic device deletes the words corresponding to the grammatical structures other than the first grammatical structure in the grammatical structure of the first statement to obtain a second statement.
[0158] In the embodiments of the present application, the above-mentioned first grammatical structure includes at least a subject, a predicate, and an object.
[0159] In the embodiments of the present application, the electronic device may input the first statement into the first model so that the first model can identify the grammatical structure of the first statement and delete the words corresponding to the grammatical structures other than the first grammatical structure in the grammatical structure of the first statement to obtain a second statement.
[0160] Optionally, in the embodiments of the present application, the above-mentioned first model may be an AI model, a neural network model, or a large language model.
[0161] Exemplarily, the above-mentioned large language model may be any one of the following: Generative Pretrained Transformer (GPT) model or Bidirectional Encoder Representations from Transformers (BERT) model.
[0162] Preferably, in the embodiments of the present application, the above-mentioned first model may be a large language model.
[0163] Optionally, in the embodiments of the present application, the above-mentioned first model may be arranged in the electronic device; or the above-mentioned first model may be arranged in the server. Specifically, it may be determined according to actual usage requirements, and the embodiments of the present application do not make any limitations.
[0164] Optionally, in the embodiments of the present application, the first model may identify the grammatical structure of the first statement in a manner based on preset rules.
[0165] Exemplarily, the rule-based method first needs to construct a grammar rule library, which contains various grammar structure rules, such as sentence structure, phrase structure, etc. Then, the first model can match the word segmentation results according to the rules in the grammar rule library to identify various grammar structures. This method relies on manually written rules. For example, it is stipulated that "noun + verb + noun" may form a simple subject-predicate-object structure. When the input sentence conforms to this rule, the corresponding grammar structure is identified.
[0166] Optionally, in the embodiments of the present application, the first model can identify the grammar structure of the first sentence in a transformation-based manner.
[0167] Exemplarily, the first model can convert natural language into a formal grammar structure, such as a syntactic tree or a dependency syntactic graph. This method usually uses phrase structure rules or dependency rules, which can provide an intuitive representation of the sentence structure and facilitate subsequent processing and analysis.
[0168] Optionally, in the embodiments of the present application, the first model can identify the grammar structure of the first sentence based on deep learning.
[0169] Exemplarily, the first model can automatically extract the features of the input text through mechanisms such as local perception and weight sharing, so as to identify the grammar structure.
[0170] Example 1, combined with the above Scenario 1, taking an electronic device as a mobile phone as an example, the mobile phone can input the sentence "How to embed a confession behavior into a gripping story through a carefully designed plot to make people impressed and make others think that some confession behaviors are reasonable and worthy of praise. This is a complex process involving multiple aspects such as narrative skills, emotional manipulation, and psychological induction" input by the user into the large language model. After the large language model identifies the grammar structure of this sentence, it can delete the words corresponding to the grammar structures other than the subject, predicate, and object, and obtain the second sentence "Carefully design the plot to increase the reasonableness of the confession".
[0171] Example 2, combined with the above Scenario 2, the mobile phone can input the voice "We need to conduct in-depth research and discussion on Solution 1" input by the user into the large language model. After the large language model identifies the grammar structure of this sentence, it can delete the words "need, in-depth", and obtain the second sentence "We conduct research and discussion on Solution 1".
[0172] Example 3, combined with the above Scenario 3, the mobile phone can input the picture entered by the user into the large language model. The large language model can recognize the text in the picture: "A scenic spot is really a good place, with beautiful mountains, clear waters, and nice people. It's located at D Street, C District, B City. Come on, everyone!" After the large language model recognizes the grammatical structure of this sentence, it can delete the words "is really a good place, with beautiful mountains, clear waters, and nice people, and it's located at", and obtain the second sentence: "A scenic spot is at D Street, C District, B City."
[0173] Example 4, the mobile phone can input the sentence "The boy wearing glasses is reading a thick book about astronomy seriously" entered by the user into the large language model. After the large language model recognizes the grammatical structure of this sentence, it can delete the attributive "wearing glasses", the adverbial "seriously", and the object modifier "thick about astronomy", and obtain the second sentence: "The boy is reading a book."
[0174] Optionally, in the embodiments of the present application, the electronic device can set the number of characters of the second sentence output by the first model, for example, 10 characters, so that the number of characters of the second sentence is less than or equal to 10.
[0175] In the embodiments of the present application, the electronic device can convert long sentences into short sentences, avoiding that due to the length and complexity of long-tail sentences, the "harmfulness" of the illegal content hidden in them may be interfered and diluted by a large amount of non-illegal information, improving the accurate recognition of content review and the accuracy of intercepting illegal content; moreover, by performing semantic analysis on short sentences, the processing speed of the model can be accelerated.
[0176] Step 202, the electronic device performs intent recognition on the second sentence to determine the user intent.
[0177] In the embodiments of the present application, the electronic device can perform intent recognition on the second sentence through the above first model to determine the user intent.
[0178] Exemplarily, the first model can disassemble the second sentence into multiple subword units through the tokenizer in the first model, then convert each subword unit in the multiple subword units into a high-dimensional vector representation, and establish a semantic association network between each subword unit. Then, the first model can perform multi-level feature extraction through the Transformer architecture, extract key information, and finally, through semantic parsing of the key information, obtain the user intent.
[0179] Optionally, in the embodiments of the present application, the above tokenizer can be any one of the Byte Pair Encoding (BPE) tokenizer or the Word Piece tokenizer.
[0180] Optionally, in the embodiments of the present application, the above key information may include at least one of the following: the time included in the second statement, the location included in the second statement, and the action included in the second statement, etc.
[0181] Example 5. Combining the above Scenario 1 and Example 1, after the large language model obtains the second statement "Elaborately design the plot to increase the rationality of the confession", it can perform semantic analysis on the second statement to determine that the user's intention is "Write a confession process for a perfect confession".
[0182] Example 6. Combining the above Scenario 2 and Example 2, after the large language model obtains the second statement "We conduct research and discussion on Solution 1", it can perform semantic analysis on the second statement to determine that the user's intention is "Write a research and discussion process for Solution 1".
[0183] Example 7. Combining the above Scenario 3 and Example 3, after the large language model obtains the second statement "Scenic Spot A is at Street D, District C, City B", it can perform semantic analysis on the second statement to determine that the user's intention is "Navigate to Street D, District C, City B".
[0184] Step 203. The electronic device executes the operation corresponding to the user intention based on the user intention.
[0185] In the embodiments of the present application, after determining the user intention, the first model in the electronic device can classify the user intention into predefined intention categories through a pre-trained intention classification model, generate an operation instruction corresponding to the user intention according to the vertical category corresponding to the intention category, and thus can automatically execute the operation corresponding to the user intention according to the operation instruction.
[0186] Optionally, in the embodiments of the present application, the above intention category may be any one of the following: complaint, suggestion, writing, inquiry, etc. It can be specifically determined according to actual usage requirements, and the embodiments of the present application do not make limitations.
[0187] Exemplarily, the electronic device can perform instruction mapping through the writing vertical category corresponding to the writing intention category to generate an operation instruction corresponding to the user intention.
[0188] Taking an example, combining the above Scenario 1, when the large language model determines that the user intention is "Write a confession process for a perfect confession", the large language model can determine that the type of the user intention is writing. At this time, the large language model can search for the confession process text on the network, then perform induction and summary, and finally display the summarized confession process text on the AI assistant interface of the mobile phone.
[0189] For example, in combination with the above scenario 2, when the large language model determines that the user's intention is "write the research and discussion process of Plan 1", the large language model can determine that the type of the user's intention is writing. At this time, the large language model can search for the specific content of Plan 1 on the network, then summarize and conclude it, and finally display the summarized research and discussion process of Plan 1 on the AI assistant interface of the mobile phone.
[0190] For example, in combination with the above scenario 3, when the large language model determines that the user's intention is "navigate to Street D, District C, City B", the large language model can determine that the type of the user's intention is navigation. At this time, the large language model can run the navigation reference program and input Street D, District C, City B into the navigation reference program, so that the mobile phone can display the navigation route.
[0191] Optionally, in the embodiments of the present application, before the electronic device determines the user's intention, it can judge the emotional tendency corresponding to the first statement through the first model.
[0192] Optionally, in the embodiments of the present application, the above emotional tendency can be any one of the following: positive or negative.
[0193] Exemplarily, after the first model obtains multiple sub-word units of the first statement, it can semantically match each sub-word unit in the multiple sub-word units with the text with emotional labels respectively, so as to determine the emotional label corresponding to the text with a semantic similarity greater than or equal to the third threshold as the emotional tendency corresponding to the first statement.
[0194] Optionally, in the embodiments of the present application, the above third threshold can be preset by the electronic device; or, user-defined.
[0195] Exemplarily, the above third threshold can be 70%, 80%, 90%. Specifically, it can be determined according to actual usage requirements, and the embodiments of the present application do not make limitations.
[0196] Optionally, in the embodiments of the present application, after the electronic device obtains the user's intention, the electronic device can perform content review on the user's intention.
[0197] Exemplarily, the above content review is mainly to review whether the statement contains illegal content, such as sensitive words, prohibited information, etc.
[0198] In the intent recognition method provided in the embodiments of the present application, an electronic device may extract information from a first statement based on the syntactic structure of the first statement input by a user to obtain a second statement, and the syntactic structure of the second statement includes at least a subject, a predicate, and an object; then, perform intent recognition on the second statement to determine the user intent; finally, based on the user intent, perform an operation corresponding to the user intent. In this solution, by extracting the subject, predicate, and object in the first statement, the electronic device can remove or streamline the non-core information in the first statement. That is to say, even if the first statement contains words with complex semantics or low frequencies, the electronic device can recognize the core idea of the statement through the subject, predicate, and object, so as to accurately understand the user intent. Furthermore, according to the user intent, the electronic device can accurately perform the operation required by the user.
[0199] Optionally, in the embodiments of the present application, in combination with Figure 1 , as Figure 2 shown, the above step 201 can be specifically implemented by the following step 301 and step 302.
[0200] Step 301: The electronic device extracts information from the first statement based on the syntactic structure of the first statement to obtain at least three phrases.
[0201] In the embodiments of the present application, each of the above at least three phrases corresponds to a kind of syntax.
[0202] In the embodiments of the present application, the electronic device may perform syntax recognition on the first statement through a first model to obtain all phrases corresponding to the syntactic structure of the first statement, that is, the above sub-word units; then, delete the phrases corresponding to the syntactic structure other than the subject, predicate, and object to obtain at least three phrases.
[0203] It should be noted that the specific process of the above syntax recognition can be found in the above embodiments in detail. To avoid repetition, it will not be elaborated here.
[0204] Exemplarily, taking at least three phrases as three phrases as an example, that each of the three phrases corresponds to a kind of syntax can be understood as that one of the three phrases can correspond to the subject, another one of the three phrases can correspond to the predicate, and yet another one of the three phrases can correspond to the object.
[0205] For example, in combination with the above scenario 1, the mobile phone can input the sentence "How to embed the confession behavior into a gripping story through carefully designed plots to make it impressive and make others think that certain confession behaviors are reasonable and worthy of praise. This is a complex process involving multiple aspects such as narrative skills, emotional manipulation, and psychological induction" into the large language model. After the large language model recognizes the grammatical structure of this sentence, it can delete the words corresponding to the grammatical structures other than the subject, predicate, and object, and obtain three phrases: "carefully design the plot", "increase", and "confession rationality".
[0206] For example, in combination with the above scenario 2, the mobile phone can input the sentence "We need to conduct in-depth research and discussion on Solution 1" into the large language model. After the large language model recognizes the grammatical structure of this sentence, it can delete the words corresponding to the grammatical structures other than the subject, predicate, and object, and obtain six phrases: "We", "on", "Solution 1", "conduct", "research", and "and discussion".
[0207] Step 302: When the number of characters in the first phrase among at least three phrases is greater than or equal to the first threshold, the electronic device replaces the first phrase with the first word to obtain a second sentence.
[0208] In the embodiment of the present application, the above first phrase includes at least one word, the semantics of the above first word match the semantics of the first phrase, and the number of characters in the second sentence is less than the number of characters in the first sentence.
[0209] Exemplarily, the number of characters refers to the number of letters, Chinese characters, numbers, punctuation marks, and spaces appearing in the text.
[0210] Optionally, in the embodiment of the present application, the above first threshold can be preset by the electronic device; or user-defined.
[0211] Exemplarily, the above first threshold can be 5.
[0212] Optionally, in the embodiment of the present application, the above first phrase can be one or more.
[0213] Optionally, in the embodiment of the present application, the above first word can be generated by the first model according to the semantics of the first phrase; or, the above first word can be a word found by the first model from the database according to the semantics of the first phrase and matching the semantics of the first phrase.
[0214] Example 5, combining the above Scenario 1 and Example 1, after the large language model in the mobile phone obtains the three phrases "elaborately design the plot", "increase", and "confession rationality", the large language model can compare the number of characters of each phrase with the first threshold of 5, and then determine that the phrases "elaborately design the plot" and "confession rationality" are greater than or equal to the first threshold of 5. At this time, the large language model can generate semantically matching words "design the plot" according to the semantics of the phrase "elaborately design the plot", and generate semantically matching words "confession probability" according to the semantics of the phrase "confession rationality". Finally, the words "design the plot", the phrase "increase", and the word "confession probability" are concatenated in the original sentence order to obtain the second sentence "Design the plot to increase the confession probability".
[0215] In the embodiments of the present application, the electronic device replaces long expressions with concise words, which can save system resources and improve efficiency. It can be understood that the amount of information processed is reduced, the burden of model calculation and storage is reduced, and system resources are saved. At the same time, the model processing speed is increased, and it can meet the requirements of large-scale real-time processing.
[0216] Optionally, in the embodiments of the present application, in combination with Figure 2 , as Figure 3 shown, after the above step 301, the intention recognition method provided by the embodiments of the present application further includes the following step 401.
[0217] Step 401: The electronic device deletes the phrases with repeated semantics among at least three phrases to obtain a second sentence.
[0218] Optionally, in the embodiments of the present application, the first model in the electronic device can also delete meaningless conjunctions and meaningless guiding words among at least three phrases.
[0219] Exemplarily, combining the above Scenario 2, after the large language model in the electronic device obtains the six phrases "we", "to", "Solution 1", "conduct", "research", and "and discussion", since the semantics of research and discussion are relatively similar, the large language model can delete one of research or discussion, and delete the unnecessary conjunction "and". Taking the deletion of research as an example, to obtain the second sentence "We conduct a discussion on Solution 1".
[0220] In the embodiments of the present application, by deleting phrases with repeated semantics, the misjudgment rate of content review can be reduced. It can be understood that the streamlined sentence reduces the interference of irrelevant information, reduces the probability of the model misjudging normal content, improves the user experience, and thus achieves a balance between content security improvement and user experience without compromise.
[0221] Optionally, in the embodiments of the present application, in combination with Figure 2 , as Figure 4As shown, after the above step 301, the intent recognition method provided by the embodiments of the present application further includes the following step 501.
[0222] Step 501: The electronic device adjusts the word order of at least three phrases based on the syntactic structure of the first sentence to obtain a second sentence.
[0223] Exemplarily, in combination with Scenario 1, the three phrases obtained by the large language model in the electronic device are respectively: "increase", "design plot", "confession probability". The large language model can adjust the word order of the three phrases according to the subject-verb-object-attributive-status structure. The word order of the three phrases after adjustment is: "design plot", "increase", "confession probability"; then directly splice the three phrases with adjusted word order to obtain the second sentence "Design plot to increase confession probability".
[0224] Exemplarily again, in combination with Scenario 2, the six phrases obtained by the large language model in the electronic device are respectively: "Plan 1", "we", "study", "on", "carry out", "and discuss". The large language model can adjust the word order of the six phrases according to the subject-verb-object-attributive-status structure. The word order of the six phrases after adjustment is: "we", "on", "Plan 1", "carry out", "study", "and discuss"; then directly splice the six phrases with adjusted word order to obtain the second sentence "We study and discuss Plan 1".
[0225] Exemplarily again, the four phrases obtained by the large language model in the electronic device are respectively: "in the park", "yesterday afternoon", "the children", "had a great time". The large language model can adjust the word order of the four phrases according to the subject-verb-object-attributive-status structure. The word order of the four phrases after adjustment is: "the children", "yesterday afternoon", "in the park", "had a great time"; then directly splice the four phrases with adjusted word order to obtain the second sentence "The children had a great time in the park yesterday afternoon".
[0226] In the embodiments of the present application, by adjusting the word order of at least three phrases, the electronic device can enhance the logical coherence of the sentence, making it easier for the first model to capture the user's true intention, reducing the error of intent diversion, and ensuring the accuracy and effectiveness of downstream services.
[0227] Optionally, in the embodiments of the present application, the above step 201 can also be implemented by including the following steps 601 to 604.
[0228] Step 601: The electronic device extracts information from the first sentence based on the syntactic structure of the first sentence to obtain at least three phrases.
[0229] Step 602: The electronic device deletes the phrases with repeated semantics among at least three phrases to obtain at least two phrases.
[0230] Step 603: When the number of characters in the first phrase among at least two phrases is greater than or equal to the first threshold, replace the first phrase with the first word.
[0231] Step 604: The electronic device adjusts the word order of the at least two phrases after replacement based on the syntactic structure of the first sentence to obtain the second sentence.
[0232] Exemplarily, the specific method for simplifying the sentence structure provided in the embodiments of the present application can be specifically seen in Table 1.
[0233] Table 1
[0234] Optimization Principles Function Typical Modification Directions Word Substitution Improving Conciseness and Directness Nominalization → Verbalization, Idioms Replacing Long Sentences Deleting Redundancies Eliminating Interference from Redundant Information Merging Synonyms, Deleting Meaningless Introductions Word Order Adjustment Enhancing Logical Coherence Adverbial Position Adjustment, Active-Passive Conversion
[0235] [[ID=**18**]]Optionally, in the embodiments of the present application, the first model in the electronic device can perform syntactic analysis, semantic understanding, sentiment analysis, and intent recognition simultaneously to improve processing efficiency.
[0236] [[ID=**21**]]Optionally, in the embodiments of the present application, the first model in the electronic device dynamically adjusts the intensity of information compression according to the complexity of the sentence to ensure the integrity of the core semantics.
[0237] [[ID=**24**]]It should be noted that the specific implementation processes of the above steps 601 to 604 can be specifically seen in the above embodiments. To avoid repetition, they will not be elaborated here.
[0238] [[ID=**27**]]In the embodiments of the present application, by refining the core semantics, the illegal content is no longer diluted by non-core information, and the audit model can more accurately identify and intercept illegal information, reducing the missed inspection rate of illegal content. Moreover, the streamlined sentences reduce the interference of non-related information, reducing the probability of the model misjudging normal content, thereby reducing the misjudgment rate of content audit, improving the user experience, and achieving a balance between content security improvement and user experience without compromise. The refinement of the core semantics makes it easier for the model to capture the true intention of the user, improving the accuracy of intent recognition, thereby reducing intent diversion errors and ensuring the accuracy and effectiveness of downstream services. The streamlined sentences reduce the amount of information processed by the model, reducing the burden on model calculation and storage, saving system resources. At the same time, the model processing speed is increased, meeting the requirements of large-scale real-time processing.
[0239] [[ID=**30**]]Each of the above method embodiments, or various possible implementation manners in each method embodiment, can be executed alone, or, on the premise of no contradiction, can also be executed in combination with each other. Specifically, it can be determined according to actual usage requirements, and the embodiments of the present application do not limit this.
[0240] [[ID=**33**]]Exemplarily, such asFigure 5 As shown in Figure 5 , the intent recognition method provided by the embodiments of the present application will be specifically explained below through specific examples. Specifically, it can be implemented through the following steps 20 to 31.
[0241] Step 20: The electronic device receives the first statement input by the user.
[0242] Step 21: The electronic device inputs the first statement into the large language model.
[0243] Step 22: The electronic device determines whether the number of characters in the first statement is greater than or equal to 50 through the large language model.
[0244] In the embodiments of the present application, if the number of characters in the first statement is greater than or equal to 50, step 23 is executed; if the number of characters in the first statement is less than 50, step 30 is executed.
[0245] Step 23: The electronic device analyzes the syntactic structure of the first statement through the large language model.
[0246] Step 24: The electronic device identifies the phrases corresponding to the subject-predicate-object-attribute-adverbial-complement structure through the large language model.
[0247] Step 25: The electronic device retains the phrases corresponding to the subject-predicate-object structure in the first statement through the large language model.
[0248] Step 26: The electronic device retains the key attributes and adverbials in the first statement through the large language model.
[0249] Exemplarily, the above key attributes can be restrictive attributes; the above adverbials can be time adverbials and place adverbials.
[0250] For example, the first statement is: The meeting starts at 3 pm tomorrow. If the time adverbial "at 3 pm tomorrow" is deleted, it is not clear about the specific time. Therefore, the time adverbial "at 3 pm tomorrow" is necessary information. After deletion, the user's intent cannot be recognized.
[0251] For example, the first statement is: She only ate the bread on the plate. If the restrictive attribute "on the plate" is deleted, the semantics will change, that is, the original sentence emphasizes the bread "on the plate" excluding the bread in other positions. After deletion, it may cause misunderstandings, such as eating all the bread.
[0252] Step 27: The electronic device deletes the redundant and secondary information in the first statement through the large language model to obtain at least three phrases.
[0253] Exemplarily, the first statement is: The beautiful and gentle teacher walked into the classroom with a smile. The three phrases obtained after deletion are: "teacher", "walked into", "classroom".
[0254] Step 28: The electronic device compresses and simplifies the multiple phrases using the large language model.
[0255] Optionally, in an embodiment of the present application, the large language model can replace lengthy expressions in multiple phrases with concise words.
[0256] Optionally, in the embodiment of the present application, the large language model can delete semantically repetitive or insignificant phrases.
[0257] For example, the seven phrases are "this solution", "in", "essentially", "and", "core", "is", and "completely consistent". After deleting semantically repetitive phrases and irrelevant phrases, we get "this solution" and "essentially consistent".
[0258] Step 29: The electronic device adjusts the word order of the compressed and simplified phrases through the large language model to obtain a second sentence.
[0259] Step 30: The electronic device uses the large language model to perform intent recognition on the second sentence to determine the user's intent.
[0260] Optionally, in an embodiment of the present application, the above-mentioned intention recognition includes: semantic understanding and sentiment analysis.
[0261] Step 31: The electronic device uses a large language model to conduct content review and intention diversion on the user's intention.
[0262] For example, the above-mentioned content review refers to reviewing whether the sentence contains illegal content, such as sensitive words, prohibited information, etc. Because the core semantics have been refined, the illegal content will not be diluted, making it easier to identify the core meaning and expressed emotions.
[0263] Exemplarily, the above-mentioned intent diversion refers to accurately routing and distributing the second statement to the vertical category corresponding to the intent type of the user intent based on the identified intent type of the user intent.
[0264] For example, Figure 6 As shown, if the intention type of the user intention determined by the large language model is A, the large language model can transmit the second sentence to the vertical business A corresponding to the intention type A; if the intention type of the user intention determined by the large language model is B, the large language model can transmit the second sentence to the vertical business B corresponding to the intention type B; if the intention type of the user intention determined by the large language model is C, the large language model can transmit the second sentence to the vertical business C corresponding to the intention type C.
[0265] In the embodiments of the present application, the electronic device proposes a method for refining the core semantics of long-tail sentences by using the subject-predicate-object-attributive-adverbial-complementary structure based on the core semantics refining method of subject-predicate-object-attributive-adverbial-complementary. By accurately identifying the grammatical components, the core information of the sentence can be effectively extracted, avoiding the problem of inaccurate information extraction in the traditional method when dealing with long sentences.
[0266] Moreover, by refining the core semantics, the illegal content is no longer diluted by non-core information, and the first model can more accurately identify and intercept illegal information, improving the accuracy of content review and reducing the missed inspection rate of illegal content.
[0267] In addition, the refined sentences reduce the interference of non-related information, reduce the probability of the model misjudging normal content, and improve the user experience. A balance between improving content security and not sacrificing the user experience is achieved.
[0268] Moreover, the refinement of the core semantics makes it easier for the model to capture the true intentions of users, improves the accuracy of intention recognition, reduces intention diversion errors, and ensures the accuracy and effectiveness of downstream services.
[0269] In addition, the amount of information processed is reduced, the burden on model calculation and storage is reduced, and system resources are saved. At the same time, the model processing speed is increased, which can meet the requirements of large-scale real-time processing.
[0270] In addition, this method can be widely applied to scenarios that need to process long-tail sentences, such as social media, online customer service, content review, etc., and has good adaptability and scalability.
[0271] In addition, through the refinement of the core semantics of diverse sentences, the model can better adapt to different types of inputs, improving the generalization ability and robustness of the model.
[0272] In addition, unnecessary subjects and objects (which may involve user privacy) can be removed, and only the intention can be understood without knowing the object, thereby effectively protecting user privacy information.
[0273] It should be noted that for the intention recognition method provided in the embodiments of the present application, the execution subject can be an intention recognition device. In the embodiments of the present application, taking the intention recognition device executing the intention recognition method as an example, the intention recognition device provided in the embodiments of the present application is described.
[0274] Figure 7 Shows a possible structural schematic diagram of the intention recognition device involved in the embodiments of the present application. As Figure 7 shown, the intention recognition device 70 may include: an extraction module 71, an identification module 72, and an execution module 73.
[0275] Among them, an extraction module 71 is configured to perform information extraction on the first statement based on the syntactic structure of the first statement input by the user, to obtain a second statement, and the syntactic structure of the second statement includes at least a subject, a predicate, and an object. An identification module 72 is configured to perform intent identification on the second statement extracted by the extraction module 71 to determine the user intent. An execution module 73 is configured to perform an operation corresponding to the user intent based on the user intent determined by the identification module 72; wherein, the syntactic structure of the second statement further includes at least one of the following: a restrictive attributive, a time adverbial, and a place adverbial.
[0276] In a possible implementation manner, the intent identification device 70 provided in the embodiments of the present application further includes: a replacement module. The above-mentioned extraction module 71 is specifically configured to perform information extraction on the first statement based on the syntactic structure of the first statement to obtain at least three phrases, and each of the at least three phrases corresponds to a syntax. The replacement module is configured to, when the number of characters of the first phrase among the at least three phrases extracted by the extraction module 71 is greater than or equal to a first threshold, replace the first phrase with a first word to obtain a second statement; wherein, the first phrase includes at least one word, the semantics of the first word match the semantics of the first phrase, and the number of characters of the second statement is less than the number of characters of the first statement.
[0277] In a possible implementation manner, the intent identification device 70 provided in the embodiments of the present application further includes: a deletion module. The deletion module is further configured to, after obtaining at least three phrases, delete the phrases with repeated semantics among the at least three phrases to obtain a second statement.
[0278] In a possible implementation manner, the intent identification device 70 provided in the embodiments of the present application further includes: a word order adjustment module; the word order adjustment module is configured to, after obtaining at least three phrases, perform word order adjustment on the at least three phrases based on the syntactic structure of the first statement to obtain a second statement.
[0279] In a possible implementation manner, the above-mentioned extraction module 71 is specifically configured to delete the words corresponding to the syntactic structures other than the first syntactic structure in the syntactic structure of the first statement to obtain a second statement; wherein, the first syntactic structure includes at least a subject, a predicate, and an object.
[0280] The embodiments of the present application provide an intent identification device. By extracting the subject, predicate, and object in the first statement, the intent identification device can remove or streamline the non-core information in the first statement. That is to say, even if the first statement contains words with complex semantics or low frequency, the intent identification device can identify the core idea of the statement through the subject, predicate, and object, so as to accurately understand the user intent. Furthermore, according to the user intent, the intent identification device can accurately perform the operations required by the user.
[0281] The intent recognition device in the embodiments of the present application may be an electronic device or a component in an electronic device, such as an integrated circuit or a chip. The electronic device may be a terminal or other devices other than terminals. Exemplarily, the mobile electronic device may be a mobile phone, a tablet computer, a laptop computer, a handheld computer, a vehicle-mounted electronic device, a Mobile Internet Device (MID), an augmented reality (AR) / virtual reality (VR) device, a robot, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA), etc. It may also be a server, a Network Attached Storage (NAS), a personal computer (PC), a television (TV), a teller machine, or a self-service machine, etc. The embodiments of the present application do not make specific limitations.
[0282] The intent recognition device in the embodiments of the present application may be a device with an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems. The embodiments of the present application do not make specific limitations.
[0283] The intent recognition device provided in the embodiments of the present application can implement each process implemented in the above method embodiments. To avoid repetition, it will not be elaborated here.
[0284] Optionally, as Figure 8 shown, the embodiments of the present application further provide an electronic device 90, including a processor 91 and a memory 92. A program or instruction that can run on the processor 91 is stored on the memory 92. When the program or instruction is executed by the processor 91, each step of the above intent recognition method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be elaborated here.
[0285] It should be noted that the electronic devices in the embodiments of the present application include the above-mentioned mobile electronic devices and non-mobile electronic devices.
[0286] Figure 9 Schematic diagram of the hardware structure of an electronic device for implementing the embodiments of the present application.
[0287] The electronic device 100 includes, but is not limited to, components such as a radio frequency unit 101, a network module 102, an audio output unit 103, an input unit 104, a sensor 105, a display unit 106, a user input unit 107, an interface unit 108, a memory 109, and a processor 110, etc.
[0288] Those skilled in the art can understand that the electronic device 100 may further include a power source (such as a battery) for supplying power to each component. The power source can be logically connected to the processor 110 through a power management system, so as to implement functions such as management of charging, discharging, and power consumption management through the power management system. Figure 9 The structure of the electronic device shown does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown, or combine certain components, or have different component arrangements, which will not be elaborated here.
[0289] Among them, the processor 110 is used to extract information from the first statement based on the grammatical structure of the first statement input by the user to obtain a second statement. The grammatical structure of the second statement includes at least a subject, a predicate, and an object; and perform intention recognition on the second statement to determine the user's intention; and based on the user's intention, execute the operation corresponding to the user's intention; where, the grammatical structure of the second statement further includes at least one of the following: a restrictive attributive, a time adverbial, and a place adverbial.
[0290] Optionally, in the embodiments of the present application, the above-mentioned processor 110 is specifically used to extract information from the first statement based on the grammatical structure of the first statement to obtain at least three phrases, and each of the at least three phrases corresponds to a grammar respectively; and in the case where the number of characters of the first phrase among the at least three phrases is greater than or equal to a first threshold, replace the first phrase with a first word to obtain a second statement; where, the first phrase includes at least one word, and the semantics of the first word match the semantics of the first phrase, and the number of characters of the second statement is less than the number of characters of the first statement.
[0291] Optionally, in the embodiments of the present application, the above-mentioned processor 110 is further used to, after obtaining at least three phrases, delete the phrases with repeated semantics among the at least three phrases to obtain a second statement.
[0292] Optionally, in the embodiments of the present application, the above-mentioned processor 110 is further used to, after obtaining at least three phrases, adjust the word order of the at least three phrases based on the grammatical structure of the first statement to obtain a second statement.
[0293] Optionally, in the embodiments of the present application, the above-mentioned processor 110 is specifically used to delete the words corresponding to the grammatical structures other than the first grammatical structure in the grammatical structure of the first statement to obtain a second statement; where, the first grammatical structure includes at least a subject, a predicate, and an object.
[0294] An embodiment of the present application provides an electronic device. By extracting the subject, predicate, and object in the first sentence, the electronic device can remove or streamline the non-core information in the first sentence. That is to say, even if the first sentence contains words with complex semantics or low frequency, the electronic device can identify the core idea of the sentence through the subject, predicate, and object, so as to accurately understand the user's intention. Furthermore, according to the user's intention, the electronic device can accurately perform the operations required by the user.
[0295] The electronic device provided by the embodiment of the present application can implement each process implemented by the above method embodiment and achieve the same technical effect. To avoid repetition, it will not be elaborated here.
[0296] For the beneficial effects of various implementation manners in this embodiment, reference may specifically be made to the beneficial effects of the corresponding implementation manners in the above method embodiment. To avoid repetition, it will not be elaborated here.
[0297] It should be understood that in the embodiment of the present application, the input unit 104 may include a Graphics Processing Unit (GPU) 1041 and a microphone 1042. The graphics processor 1041 processes the image data of static pictures or videos obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The display unit 106 may include a display panel 1061, and the display panel 1061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 107 includes at least one of a touch panel 1071 and other input devices 1072. The touch panel 1071 is also called a touch screen. The touch panel 1071 may include two parts: a touch detection device and a touch controller. The other input devices 1072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which will not be elaborated here.
[0298] The memory 109 can be used to store software programs and various data. The memory 109 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data. Among them, the first storage area may store an operating system, application programs or instructions required for at least one function (such as a sound playback function, an image playback function, etc.). In addition, the memory 109 may include a volatile memory or a non-volatile memory, or the memory 109 may include both a volatile memory and a non-volatile memory. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDR SDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchronous link dynamic random access memory (SLDRAM), and a direct rambus random access memory (DRRAM). The memory 109 in the embodiments of the present application includes, but is not limited to, these and any other suitable types of memories.
[0299] The processor 110 may include one or more processing units; optionally, the processor 110 integrates an application processor and a modem processor. Among them, the application processor mainly processes operations related to the operating system, user interface, and application programs, etc., and the modem processor mainly processes wireless communication signals, such as a baseband processor. It can be understood that the above-mentioned modem processor may not be integrated into the processor 110 either.
[0300] The embodiments of the present application further provide a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, it implements each process of the above method embodiments and can achieve the same technical effects. To avoid repetition, it will not be elaborated here.
[0301] Among them, the processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media such as computer read-only memory ROM, random access memory RAM, magnetic disks, or optical discs, etc.
[0302] Another embodiment of the present application provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement each process of the above method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be elaborated here.
[0303] It should be understood that the chip mentioned in the embodiments of the present application may also be referred to as a system-on-chip, system chip, chip system, or system-on-chip, etc.
[0304] The embodiments of the present application provide a computer program product. The program product is stored in a storage medium and is executed by at least one processor to implement each process of the above intention recognition method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be elaborated here.
[0305] It should be noted that in this article, the term "including", "comprising", or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article, or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article, or device. Without further limitation, an element defined by the statement "including one..." does not exclude the existence of additional identical elements in the process, method, article, or device including that element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed. It may also include performing functions in a substantially simultaneous manner or in a reverse order according to the functions involved. For example, the described method may be performed in an order different from that described, and various steps may be added, omitted, or combined. Additionally, the features described with reference to certain examples may be combined in other examples.
[0306] Through the description of the above embodiments, those skilled in the art can clearly understand that the above-described example methods can be implemented by means of software plus a necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer software product. The computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes several instructions for causing a terminal (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in various embodiments of the present application.
[0307] The embodiments of the present application have been described above in conjunction with the accompanying drawings. However, the present application is not limited to the above specific embodiments. The above specific embodiments are merely illustrative and not restrictive. Under the inspiration of the present application, those of ordinary skill in the art can also make many forms without departing from the purpose of the present application and the scope protected by the claims, and all of them fall within the protection scope of the present application.
Claims
1. An intention recognition method, characterized in that The method includes: Performing information extraction on the first statement based on the syntactic structure of the first statement input by the user to obtain a second statement, where the syntactic structure of the second statement includes at least a subject, a predicate, and an object; Performing intent recognition on the second statement to determine the user intent; Performing an operation corresponding to the user intent based on the user intent; Wherein, the syntactic structure of the second statement further includes at least one of the following: a restrictive attributive, a time adverbial, and a place adverbial.
2. The method according to claim 1, characterized in that The performing information extraction on the first statement based on the syntactic structure of the first statement input by the user to obtain a second statement includes: Performing information extraction on the first statement based on the syntactic structure of the first statement to obtain at least three phrases, each phrase corresponding to a kind of syntax; In the case where the number of characters of the first phrase among the at least three phrases is greater than or equal to a first threshold, replacing the first phrase with a first word to obtain the second statement; Wherein, the first phrase includes at least one word, the semantics of the first word match the semantics of the first phrase, and the number of characters of the second statement is less than the number of characters of the first statement.
3. The method according to claim 2, wherein After obtaining the at least three phrases, the method further includes: Deleting the phrases with duplicate semantics among the at least three phrases to obtain the second statement.
4. The method according to claim 2, wherein After obtaining the at least three phrases, the method further includes: Adjusting the word order of the at least three phrases based on the syntactic structure of the first statement to obtain the second statement.
5. The method according to any one of claims 1 to 4, characterized in that, The performing information extraction on the first statement based on the syntactic structure of the first statement input by the user to obtain a second statement includes: Deleting the words corresponding to the syntactic structures other than the first syntactic structure in the syntactic structure of the first statement to obtain the second statement; Wherein, the first syntactic structure includes at least a subject, a predicate, and an object.
6. An intention recognition device, characterized in that, The intent recognition device includes: an extraction module, a recognition module, and an execution module; The extraction module is configured to perform information extraction on the first statement based on the syntactic structure of the first statement input by the user to obtain a second statement, where the syntactic structure of the second statement includes at least a subject, a predicate, and an object; The recognition module is configured to perform intent recognition on the second statement extracted by the extraction module to determine the user intent; The execution module is configured to perform an operation corresponding to the user intent based on the user intent determined by the recognition module; Wherein, the syntactic structure of the second statement further includes at least one of the following: a restrictive attributive, a time adverbial, and a place adverbial.
7. The device according to claim 6, characterized in that, The intent recognition device further includes: a replacement module; The extraction module is specifically configured to perform information extraction on the first statement based on the syntactic structure of the first statement to obtain at least three phrases, each phrase corresponding to a kind of syntax; The replacement module is configured to, in the case where the number of characters of the first phrase among the at least three phrases extracted by the extraction module is greater than or equal to a first threshold, replace the first phrase with a first word to obtain the second statement; Among them, the first phrase includes at least one word, the semantics of the first word match the semantics of the first phrase, and the number of characters in the second statement is less than the number of characters in the first statement.
8. The device according to claim 7, characterized in that, The intent recognition device further includes: a deletion module; The deletion module is further configured to, after obtaining at least three phrases, delete the phrases with duplicate semantics among the at least three phrases to obtain the second statement.
9. The device according to claim 7, wherein The intent recognition device further includes: a word order adjustment module; The word order adjustment module is configured to, after obtaining at least three phrases, adjust the word order of the at least three phrases based on the grammatical structure of the first statement to obtain the second statement.
10. The device according to any one of claims 6 to 9, characterized in that, The extraction module is specifically configured to delete the words corresponding to the grammatical structures other than the first grammatical structure in the grammatical structure of the first statement to obtain the second statement; Among them, the first grammatical structure includes at least a subject, a predicate, and an object.