CN117010364A - Method and device for extracting event slots, storage medium and electronic device - Google Patents

Method and device for extracting event slots, storage medium and electronic device Download PDF

Info

Publication number
CN117010364A
CN117010364A CN202210468880.XA CN202210468880A CN117010364A CN 117010364 A CN117010364 A CN 117010364A CN 202210468880 A CN202210468880 A CN 202210468880A CN 117010364 A CN117010364 A CN 117010364A
Authority
CN
China
Prior art keywords
candidate
verb
target
word
words
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210468880.XA
Other languages
Chinese (zh)
Inventor
苑春明
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Qingdao Haier Technology Co Ltd
Haier Smart Home Co Ltd
Original Assignee
Qingdao Haier Technology Co Ltd
Haier Smart Home Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Qingdao Haier Technology Co Ltd, Haier Smart Home Co Ltd filed Critical Qingdao Haier Technology Co Ltd
Priority to CN202210468880.XA priority Critical patent/CN117010364A/en
Priority to PCT/CN2022/096436 priority patent/WO2023206703A1/en
Publication of CN117010364A publication Critical patent/CN117010364A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/205Parsing
    • G06F40/211Syntactic parsing, e.g. based on context-free grammar [CFG] or unification grammars
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/253Grammatical analysis; Style critique
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/30Semantic analysis

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Machine Translation (AREA)
  • Selective Calling Equipment (AREA)

Abstract

The application discloses a method and a device for extracting event slots, a storage medium and an electronic device, and relates to the technical field of intelligent home/intelligent families, wherein the method comprises the following steps: obtaining a target control statement of an event slot to be extracted, wherein the target control statement comprises a plurality of words; carrying out syntactic analysis on the target control sentence, and determining a group of candidate words from the plurality of words, wherein the number of the candidate words contained in the group of candidate words is smaller than the number of the words contained in the plurality of words; determining a target word from a group of candidate words according to the syntactic relation between each candidate word in the group of candidate words and the associated word of each candidate word, wherein the target word and the associated word of the target word are in a specified syntactic relation; and determining the target words and the associated words of the target words as target event slots of the target control statement.

Description

Method and device for extracting event slots, storage medium and electronic device
Technical Field
The present application relates to the field of communications, and in particular, to a method and apparatus for extracting an event slot, a storage medium, and an electronic device.
Background
In the intelligent question-answering field, the user intention can be understood through slot extraction, and taking slot extraction in the schedule field in the question-answering system as an example, the related slots can comprise slot information of time, event, singer, song and the like. The content of the event slots is richer relative to other slots, which results in more complex extraction.
In the related art, an event slot is generally extracted from a sentence by adopting a dictionary library matching mode: and matching the words in the dictionary database with the sentences, and determining the slot positions of the words matched with the dictionary database in the sentences as event slots.
However, in the dictionary library matching mode, a database dictionary library of event slots needs to be maintained, and time slots are extracted through a strong matching strategy, and because event slots cannot be exhausted, the method is often only used for extracting high-frequency event slots, and low-frequency event slots are difficult to extract, so that the accuracy of event slot extraction is reduced.
It can be seen that the event slot extraction method in the related art has a problem of low accuracy of event slot extraction due to difficulty in exhausting the event slots.
Disclosure of Invention
The embodiment of the application provides an event slot extraction method and device, a storage medium and an electronic device, which at least solve the problem that the event slot extraction accuracy is low due to the fact that the event slot is difficult to exhaust in the event slot extraction method in the related technology.
According to an aspect of an embodiment of the present application, there is provided a method for extracting an event slot, including: obtaining a target control statement of an event slot to be extracted, wherein the target control statement comprises a plurality of words; carrying out syntactic analysis on the target control sentence, and determining a group of candidate words from the plurality of words, wherein the number of the candidate words contained in the group of candidate words is smaller than the number of words contained in the plurality of words; determining a target word from the group of candidate words according to the syntactic relation between each candidate word in the group of candidate words and the associated word of each candidate word, wherein the target word and the associated word of the target word are in a specified syntactic relation; and determining the target words and the associated words of the target words as target event slots of the target control sentences.
According to another aspect of the embodiment of the present application, there is also provided an extraction apparatus for an event slot, including: the device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring a target control statement of an event slot to be extracted, and the target control statement comprises a plurality of words; the analysis unit is used for carrying out syntactic analysis on the target control sentence and determining a group of candidate words from the plurality of words, wherein the number of the candidate words contained in the group of candidate words is smaller than the number of words contained in the plurality of words; the first determining unit is used for determining a target word from the group of candidate words according to the syntactic relation between each candidate word in the group of candidate words and the associated word of each candidate word, wherein the target word and the associated word of the target word are in a specified syntactic relation; and the second determining unit is used for determining the target word and the associated word of the target word as a target event slot of the target control statement.
In an exemplary embodiment, the first determining unit includes: the first determining module is configured to determine, according to a syntactic relationship between each candidate verb in a set of candidate verbs and an associated word of each candidate verb, a target verb from the set of candidate verbs, where the set of candidate words includes the set of candidate verbs, and the target verb includes the target verb.
In an exemplary embodiment, the analysis unit includes: the second determining module is used for carrying out syntactic analysis on the target control statement and determining the words contained in the target control statement and the part of speech of each word in the words; and the third determining module is used for determining each word with the part of speech as a verb in the plurality of words as a candidate verb to obtain the set of candidate verbs.
In an exemplary embodiment, the analysis unit includes: the analysis module is used for carrying out syntactic analysis on the target control statement and determining a core verb of the target control instruction; a fourth determining module, configured to determine each verb having the specified syntactic relationship with the core verb in the plurality of words as a candidate verb, to obtain the set of candidate verbs; a searching module, configured to search a verb having the specified syntactic relation with any candidate verb in the set of candidate verbs; and the adding module is used for adding the searched verb as the candidate verb to the group of candidate verbs under the condition that the verb with the appointed syntactic relation with any candidate verb is searched.
In an exemplary embodiment, the associated word of each candidate verb is a neighboring word of the each candidate verb, and the neighboring word of each candidate verb is a word located after and neighboring the each candidate verb; the first determining module includes: and the first determination submodule is used for determining the candidate verb meeting a first screening condition between the candidate verb and the adjacent word in the group of candidate verbs as the target verb, wherein the first screening condition comprises a syntactic relation which is the appointed syntactic relation.
In an exemplary embodiment, the first determining submodule includes: a first determining subunit, configured to determine, when any candidate verb in the set of candidate verbs and a syntactic relation between adjacent words of the candidate verb are a moving object relation and parts of speech of adjacent words of the candidate verb are nouns, any candidate verb as the target verb, where the specified syntactic relation includes the moving object relation, and the first filtering condition further includes parts of speech of adjacent words as nouns; a second determining subunit, configured to determine, when a syntactic relationship between the arbitrary candidate verb and a neighboring word of the arbitrary candidate verb is a juxtaposition relationship, the arbitrary candidate verb as the target verb, where the specified syntactic relationship includes the juxtaposition relationship.
In an exemplary embodiment, the associated word of each candidate verb is a word having a syntactic relationship with the each candidate verb; the first determining module includes: and a second determining sub-module, configured to determine, as the target verb, a candidate verb that satisfies a second filtering condition between words having a syntactic relationship in the set of candidate verbs, where the second filtering condition includes that the syntactic relationship is the specified syntactic relationship.
In an exemplary embodiment, the second determining submodule includes: a third determining subunit, configured to determine, when any candidate verb in the set of candidate verbs and a syntactic relation between words having a syntactic relation with the any candidate verb are a moving object relation and a part of speech of a word having a syntactic relation with the any candidate verb is a noun, any candidate verb as the target verb, where the specified syntactic relation includes the moving object relation, and the second filtering condition further includes the part of speech of the word having a syntactic relation being a noun; a fourth determining subunit, configured to determine, when a syntactic relationship between the arbitrary candidate verb and a word having a syntactic relationship with the arbitrary candidate verb is a juxtaposition relationship, the arbitrary candidate verb as the target verb, where the specified syntactic relationship includes the juxtaposition relationship.
In an exemplary embodiment, the second determining unit includes: a fifth determining module, configured to determine, when there are a plurality of target words, each target word and an associated word of each target word as an event slot corresponding to each target word; and a sixth determining module, configured to determine, as the target event slots, a combination of event slots corresponding to each of the target words.
According to yet another aspect of the embodiments of the present application, there is also provided a computer-readable storage medium having a computer program stored therein, wherein the computer program is configured to execute the above-described event slot extraction method when running.
According to still another aspect of the embodiments of the present application, there is further provided an electronic device including a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor executes the above-mentioned method for extracting an event slot by using the computer program.
In the embodiment of the application, a mode of firstly extracting candidate words in a control sentence, then selecting words belonging to an event slot and related words thereof according to the syntactic relation between the candidate words and the related words is adopted, and a target control sentence of the event slot to be extracted is obtained, wherein the target control sentence comprises a plurality of words; carrying out syntactic analysis on the target control sentence, and determining a group of candidate words from the plurality of words, wherein the number of the candidate words contained in the group of candidate words is smaller than the number of the words contained in the plurality of words; determining a target word from a group of candidate words according to the syntactic relation between each candidate word in the group of candidate words and the associated word of each candidate word, wherein the target word and the associated word of the target word are in a specified syntactic relation; the method comprises the steps of determining target words and related words of the target words as target event slots of a target control sentence, obtaining candidate words in the control sentence by carrying out syntactic analysis on the control sentence, selecting words which can be used as event slots according to a syntactic structure formed by the candidate words and the related words of the candidate words, determining the selected words and the related words as extracted event slots, carrying out event slot extraction by considering information features such as parts of speech, syntaxes, sentence structures and the like, and realizing the purpose of accurately extracting the event slots based on the syntactic structure without maintaining a dictionary library corresponding to the event slots, thereby achieving the technical effect of improving the accuracy of event slot extraction, and further solving the problem of low accuracy of event slot extraction caused by difficult exhaustion of the event slots in the extraction method of the event slots in the related technology.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description, serve to explain the principles of the application.
In order to more clearly illustrate the embodiments of the application or the technical solutions of the prior art, the drawings which are used in the description of the embodiments or the prior art will be briefly described, and it will be obvious to a person skilled in the art that other drawings can be obtained from these drawings without inventive effort.
FIG. 1 is a schematic diagram of a hardware environment of an alternative event slot extraction method according to an embodiment of the present application;
FIG. 2 is a flow chart of an alternative method for extracting event slots according to an embodiment of the present application;
FIG. 3 is a schematic diagram of an alternative sentence structure in accordance with an embodiment of the present application;
FIG. 4 is a schematic diagram of another alternative sentence structure in accordance with an embodiment of the present application;
FIG. 5 is a schematic diagram of yet another alternative sentence structure in accordance with an embodiment of the present application;
FIG. 6 is a schematic diagram of yet another alternative sentence structure in accordance with an embodiment of the present application;
FIG. 7 is a schematic diagram of yet another alternative sentence structure in accordance with an embodiment of the present application;
FIG. 8 is a flow chart of an alternative method of event slot extraction according to an embodiment of the application;
FIG. 9 is a block diagram of an alternative event slot extraction apparatus according to an embodiment of the application;
fig. 10 is a block diagram of an alternative electronic device according to an embodiment of the application.
Detailed Description
In order that those skilled in the art will better understand the present application, a technical solution in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present application without making any inventive effort, shall fall within the scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present application and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the application described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
According to one aspect of the embodiment of the application, an event slot extraction method is provided. The method for extracting the event slots can be applied to full-house intelligent digital control application scenarios such as Smart Home (Smart Home), intelligent Home device ecology, intelligent Home (Intelligence House) ecology, etc., and optionally, in this embodiment, the method for extracting the event slots can be applied to a hardware environment composed of the terminal 102 and the server 104 as shown in fig. 1. As shown in fig. 1, the server 104 is connected to the terminal 102 through a network, and may be used to provide services (such as application services, etc.) for the terminal or clients installed on the terminal, and cloud computing and/or edge computing services may be configured on the server or independent of the server, for providing data computing services for the server 104.
The network may include, but is not limited to, at least one of: wired network, wireless network. The wired network may include, but is not limited to, at least one of: a wide area network, a metropolitan area network, a local area network, and the wireless network may include, but is not limited to, at least one of: WIFI (Wireless Fidelity ), bluetooth. The terminal 102 may not be limited to a PC, a mobile phone, a tablet computer, an intelligent air conditioner, an intelligent smoke machine, an intelligent refrigerator, an intelligent oven, an intelligent cooking range, an intelligent washing machine, an intelligent water heater, an intelligent washing device, an intelligent dish washer, an intelligent projection device, an intelligent television, an intelligent clothes hanger, an intelligent curtain, an intelligent video, an intelligent socket, an intelligent sound box, an intelligent fresh air device, an intelligent kitchen and toilet device, an intelligent bathroom device, an intelligent sweeping robot, an intelligent window cleaning robot, an intelligent mopping robot, an intelligent air purifying device, an intelligent steam box, an intelligent microwave oven, an intelligent kitchen appliance, an intelligent purifier, an intelligent water dispenser, an intelligent door lock, and the like.
The method for extracting the event slots in the embodiment of the present application may be executed by the server 104, may be executed by the terminal 102, or may be executed by both the server 104 and the terminal 102. The method for extracting the event slots by the terminal 102 according to the embodiment of the present application may be performed by a client installed thereon.
Taking the server 104 as an example to execute the event slot extraction method in this embodiment, fig. 2 is a schematic flow chart of an alternative event slot extraction method according to an embodiment of the present application, and as shown in fig. 2, the flow chart of the method may include the following steps:
step S202, a target control statement of an event slot to be extracted is obtained, wherein the target control statement comprises a plurality of words.
The method for extracting the event slots in the embodiment can be applied to a scene of extracting the event slots in the control statement in the field of smart home or smart home, and can be applied to a system with man-machine interaction function such as a voice intelligent question-answering system. The user inputs the control statement, and the machine extracts the slot positions of the control statement, so that the user intention is analyzed and responses to different user intentions are made. For example, for slot extraction in the calendar domain, the slots involved may include slot information for time, event, singer, song, etc.
For different slots, different slot extraction modes can be adopted. For example, the slots can be extracted by means of matching rules defined by regular expressions, singers and songs can be extracted by maintaining a database dictionary base and matching by means of lexical data, and the slots of events are richer in content, so that the extraction of the slots of events is more complex.
In order to extract an event slot (for example, the event slot in the calendar field is extracted), an event slot is usually extracted from a sentence by adopting a dictionary library matching manner, however, because the event slot is difficult to exhaust (for example, the event slot in the calendar field cannot exhaust), the accuracy of the event slot extraction is low. Moreover, even if the system is exhaustive, if the dictionary library is too large, the system running speed is affected to a certain extent, so that the generalization of the system is greatly reduced by the strong matching strategy.
In addition, an algorithm model can be adopted to automatically extract the event slots, and the model can be trained through large-scale data to automatically extract the slots. However, the method is only suitable for the task of extracting the slots with limited slot numbers, has a narrow application range, is more commonly used on the task with controllable slot numbers, and has lower generalized controllability than a dictionary library. Therefore, the extraction mode of the event slots based on dictionary matching and algorithm models cannot be used for combining generalization and precision.
Considering that event slots such as 'play \v basketball\n', 'go \v school\n' are verb and noun structures, part-of-speech rules can be formulated by means of part-of-speech analysis to match and extract event slots, and all phrases conforming to the part-of-speech rules in sentences are extracted as event slots. For example, the syntactic structure of verbs plus nouns is considered as an event slot, which is more generalized than a dictionary library.
If only part-of-speech feature information is considered, and the syntactic and sentence structural features are not considered, the accuracy of event slot extraction is reduced by formulating part-of-speech rules to match the way of extracting event slots. For example, event slots such as "go \v play \v", "go \v stadium \n play \v basketball \n" are not extracted due to non-compliance with proper noun rules. For another example, "using \v songs\ n A \n" also satisfies the defined event slot rule, the song slots are extracted by mistake as event slots, which adds a certain difficulty to the semantic understanding of the question-answering system.
In order to improve the accuracy of event slot extraction, in this embodiment, syntax analysis may be introduced, and a matching rule may be formulated to assist in extracting an event slot, and by analyzing a control sentence by considering syntax and sentence structural features, a corresponding event slot may be determined, so that the accuracy of event slot extraction may be improved.
The target server (an example of the server 104 described above) may obtain a target control statement for the event slots to be extracted, the target control statement including a plurality of words therein. The process of obtaining the target control statement of the event slot to be extracted may be receiving the target control statement sent by the terminal device through the communication connection established with the terminal device.
The user may send out a target control statement to his terminal device by means of voice or the like, which may be used to control the terminal device to perform the target device operation. After the target control sentence is acquired, the terminal device may transmit the acquired target control sentence to the target server. Alternatively, the target server may obtain a target voice command including a control sentence, and parse the received target voice command to extract the target control sentence included therein.
For example, after the smart phone (the above terminal device) acquires the voice command of "alert me to basketball in stadium at 8 am" sent by the user, the acquired voice command may be sent to the server. For the received voice command, the server can analyze the voice command and extract the control statement therein.
The device operation indicated by the target control instruction may be a device operation performed by the terminal device, or may be a device operation performed by a device other than the terminal device (e.g., an intelligent home device). The above-mentioned device operation may be an operation of adjusting a device parameter, or an operation of setting a schedule, etc., and correspondingly, the target control instruction may be a schedule reminding instruction, for example, the target control instruction may be a device control instruction such as "open morning water heater on", etc., or a schedule reminding instruction such as "open morning 8 am reminding me to play basketball in a gym", etc., which is not limited in this embodiment.
In step S204, a target control sentence is parsed, and a set of candidate words is determined from a plurality of words, where the number of candidate words included in the set of candidate words is less than the number of words included in the plurality of words.
In this embodiment, after the target control sentence is obtained, the target server may perform a syntactic analysis on the target control sentence, and determine a set of candidate words from a plurality of words, where the number of candidate words included in the set of candidate words is smaller than the number of words included in the plurality of words, and the extracted set of candidate words may be words with parts of speech as verbs or words with parts of speech as nouns in the target control sentence. When a set of candidate words is a set of candidate verbs, the candidate words may be core verbs in the control sentence, all verbs in the control sentence, verbs located after the core verbs in the control sentence, verbs located before the core verbs in the control sentence, verbs whose semantic weights for the control sentence exceed a weight threshold, and verbs located at non-end positions of the target control sentence in the target control sentence, which is not limited in this embodiment.
The above-mentioned process of syntactic analyzing the target control sentence may be that syntactic analyzing the target control sentence by using a syntactic analysis algorithm (may be implemented using open-source syntactic analysis software), extracting a plurality of words (may be core words of the extracted sentence) included in the target control sentence, analyzing parts of speech of each word of the plurality of words and relationships between the words (i.e., extracting structural features of the sentence), extracting parts of speech and sentence structural features of the sentence.
Optionally, after determining the multiple words and the parts of speech of the words included in the target control sentence, the target server may determine a set of candidate words according to the parts of speech of each word in the multiple words, or may first perform syntactic analysis on the target control sentence to determine a core word in the target control sentence, and then determine the words having a specified syntactic relation with the core word as the candidate words, so as to obtain a set of candidate words, or may also determine other ways of determining the candidate words, which is not limited in this embodiment.
For example, as shown in FIG. 3, when the control sentence is "remind me to play basketball with Song A at 8 A.m. in Ming day," the "remind", "go" and "play" in the sentence may be determined as a set of candidate words.
Step S206, determining a target word from the group of candidate words according to the syntactic relation between each candidate word in the group of candidate words and the associated word of each candidate word, wherein the association word between the target word and the target word is a designated syntactic relation.
In this embodiment, after determining a set of candidate words from the plurality of words, the target server may determine an associated word with each candidate word in the set of candidate words. The related term of each candidate word may be a term adjacent to each candidate word, or a term having a syntactic relationship with each candidate word, or a term having another related relationship with each candidate word, for example, a first term after each candidate word or a first noun after each candidate word, which is not limited in this embodiment.
In this embodiment, after determining the associated word with each candidate word, the target server may determine the target word from a set of candidate words according to the syntactic relationship between each candidate word and the associated word of each candidate word, or alternatively may determine the syntactic relationship between each candidate word and the associated word in the set of candidate words as a candidate word with a specified syntactic relationship.
For example, the designated syntactic relationship is a guest-moving relationship or a parallel relationship, the associated word of each candidate word is the adjacent word of the candidate word, and the control sentence "8 am in Ming Tian reminds me to play basketball in stadium with song A" includes: the adjacent words of reminding, going, beating and reminding are not in a moving guest relation or a parallel relation, so that the reminding is not a target word, the adjacent words of going are in a moving guest relation, the going is a target word, the adjacent words of beating are in a basketball, the syntactic relation between the two words is also in a moving guest relation, and the beating is also a target word.
Step S208, determining the target word and the related word of the target word as a target event slot of the target control statement.
In this embodiment, after determining the target word, the target server may determine the target word and the related word to the target word as the target event slot of the target control sentence. Alternatively, in the case that the target words are plural, each target word and the associated word of each target word may be determined as the target event slot of the target control sentence.
For example, when the server reminds me to play a basketball at stadium with Song A from the control statement "8 am tomorrow," it determines that the target word includes "go" and "play" both may be determined as event slots for the control statement.
Through the steps, a target control statement of the event slot to be extracted is obtained, wherein the target control statement comprises a plurality of words; carrying out syntactic analysis on the target control sentence, and determining a group of candidate words from the plurality of words, wherein the number of the candidate words contained in the group of candidate words is smaller than the number of the words contained in the plurality of words; determining a target word from a group of candidate words according to the syntactic relation between each candidate word in the group of candidate words and the associated word of each candidate word, wherein the target word and the associated word of the target word are in a specified syntactic relation; the target words and the associated words of the target words are determined to be the target event slots of the target control statement, so that the problem that the event slots are extracted with low accuracy due to the fact that the event slots are difficult to exhaust in the extraction method of the event slots in the related technology is solved, and the accuracy of the event slots extraction is improved.
In one exemplary embodiment, determining a target word from a set of candidate words based on a syntactic relationship between each candidate word in the set of candidate words and an associated word for each candidate word, includes:
s11, determining a target verb from a group of candidate verbs according to a syntactic relation between each candidate verb in the group of candidate verbs and an associated word of each candidate verb, wherein the group of candidate verbs comprises a group of candidate verbs, and the target verb comprises the target verb.
Since event slots in a control sentence generally include verbs, after a target control sentence is parsed and a set of candidate words is determined from a plurality of words, a target verb may be determined in the set of candidate words, and then a target event slot of the target control sentence may be determined according to the target verb. Optionally, the process of determining the target verb in the set of candidate words may be: determining a target verb from a set of candidate verbs according to a syntactic relation between each candidate verb in the set of candidate verbs and an associated word of each candidate verb, wherein the set of candidate verbs comprises a set of candidate verbs, and the target verb comprises the target verb.
The above-described syntactic relationship may be a specific syntactic relationship or may be another syntactic relationship. Alternatively, a candidate verb, in which a syntactic relationship between the candidate verb and the associated word is a specified syntactic relationship, may be determined as the target verb.
For example, when the specified syntactic relationship is a guest-moving relationship or a parallel relationship, and the associated word of each candidate verb is a neighboring word of the candidate verb, the control sentence "remind me to play basketball in a gym with song a at 8 am on tomorrow" includes: the adjacent words of 'reminding', 'going', 'typing' and 'reminding' are 'me', and the syntactic relation formed between the two words is neither a moving guest relation nor a parallel relation, so that 'reminding' is not a target verb, the adjacent words of 'going' are 'gym', the syntactic relation formed between the two words is a moving guest relation, the 'going' is a target verb, the adjacent words of 'typing' are 'basketball', the syntactic relation formed between the two words is also a moving guest relation, and the 'typing' is also a target verb.
According to the method and the device, the target verb is determined from the control statement according to the syntactic relation between each candidate verb and the associated word of each candidate verb in the control statement, so that the determination efficiency of the target verb can be improved.
In one exemplary embodiment, syntactic analysis of a target control sentence, determining a set of candidate words from a plurality of words, includes:
s21, carrying out syntactic analysis on the target control statement, and determining a plurality of words contained in the target control statement and the part of speech of each word in the plurality of words;
s22, determining each word with part of speech as a verb in the plurality of words as a candidate verb to obtain a group of candidate verbs.
In this embodiment, the target server may perform a syntactic analysis on the target control sentence, and determine a plurality of words included in the target control sentence and a part of speech of each word in the plurality of words. Optionally, in addition to the part of speech of each term, the target server may determine a syntactic relationship between each term and a term other than the term of the plurality of terms. For example, the server may parse the control statement "get Song A at 8 am tomorrow to remind me to play basketball at a gym" to obtain the part of speech of each of the plurality of words included in the control statement, and the syntactic relationship between each word and other words.
The above-mentioned process of performing syntactic analysis on the target control sentence, and determining the plurality of words and the part of speech of each word in the plurality of words included in the target control sentence may be: analyzing the target control statement through a part-of-speech tagging algorithm to obtain a plurality of words contained in the target control statement and part-of-speech of each word in the plurality of words. The part-of-speech tagging algorithm may include at least one of: sequence models, hidden markov models (Hidden Markov Model, HMM), markov models such as MEMM (Maximum Entropy Markov Model ), CRFS (Conditional Random Fields, conditional random field), etc., deep learning, conventional classifiers such as machine learning (e.g., SVM (Support Vector Machine, support vector machine), deep learning algorithms typified by RNN (Recurrent Neural Network ), etc., which are not limited in this embodiment.
For example, as shown in fig. 3, fig. 4, fig. 5, fig. 6, and fig. 7, syntax analysis may be performed on different control sentences to determine words included in the different control sentences, parts of speech of the words, and syntax relationships between the words, where nt (temporal noise), p (pre-dbb, mediate relationship), n (general noise), v (verb), r (process, pronoun), WP (punctuation), nl (location noise), nd (direction noise) are used to represent parts of speech of the corresponding words, and HED (head, middle), ATT (adaptive noise), ADV (adaptive noise), POB (pre-dbb, mediate relationship), l (double), VOB (transient-object), and WP (position-object), and point-to-object) above the control sentences are used to represent parts of speech of the corresponding words.
After determining the plurality of words and the part of speech of each word included in the target control sentence, the target server may determine each word whose part of speech is a verb in the plurality of words as a candidate verb, and obtain a set of candidate verbs, that is, all verbs in the plurality of words in the set of candidate verbs.
According to the method and the device, the words with parts of speech as verbs in the control sentences are determined to be the candidate verbs, so that the step of determining the candidate verbs can be simplified, and the efficiency of determining the candidate verbs can be improved.
In one exemplary embodiment, syntactic analysis of a target control sentence, determining a set of candidate words from a plurality of words, includes:
s31, carrying out syntactic analysis on the target control statement, and determining a core verb of the target control instruction;
s32, each verb with a specified syntactic relation with the core verb in the words is respectively determined to be a candidate verb, and a group of candidate verbs are obtained;
s33, searching a verb with a specified syntactic relation with any candidate verb in the set of candidate verbs;
s34, when finding the verb with the appointed syntactic relation with any candidate verb, adding the found verb as a candidate verb into a group of candidate verbs.
In this embodiment, a set of candidate verbs may be determined based on the core verbs in the target control statement. The target server may parse the target control statement to determine the core verbs of the target control instruction. The core verb is a verb that governs other words in the target control instruction and is not governed by other words. The core verb represents the core HED of the whole sentence (root), for example, the calendar field core verb is generally 'reminding', 'called' and the like, and the position of the core word in the sentence has a certain reference value for extracting an event slot; and extracting event slots based on a syntactic structure formed by the core verbs and adjacent words of the core verbs. Because of the consideration of the syntactic and sentence structural characteristics, the accuracy of event slot extraction can be improved.
For example, the word pointed by the root in fig. 3, fig. 4, fig. 5, fig. 6, and fig. 7 is a core verb of the corresponding control sentence, where in the control sentence shown in fig. 3, "reminder" is a core word in the control sentence, in the control sentence shown in fig. 4, "go" is a core word in the control sentence, in the control sentence shown in fig. 5, "reminder" is a core word in the control sentence, in the control sentence shown in fig. 6, "reminder" is a core word in the control sentence, in the control sentence shown in fig. 7, "recall" is a core word in the control sentence.
After determining the core verbs of the target control instruction, the target server may determine each verb having a specified syntactic relationship with the core verbs among the plurality of words included in the target control statement as a candidate verb, to obtain a set of candidate verbs, where the specified syntactic relationship may be a verb having a VOB relationship with the core verbs or a verb having a COO relationship with the core verbs, and this is not limited in this embodiment.
The set of candidate verbs may include a plurality of candidate verbs, or may include only one candidate verb, which is not limited in this embodiment. For example, as shown in fig. 3, after determining that "reminder" is a core word of a control sentence, a verb "go" having a VOB relation with "reminder" may be determined as a candidate verb, and since a verb having a VOB relation or COO relation with a core verb does not exist in the control sentence except for the candidate verb "go", a group of candidate verbs in the control sentence includes only one candidate verb "go".
After determining a set of candidate verbs, the destination server may find a verb having a specified syntactic relationship with any of the set of candidate verbs. Alternatively, the process of searching for a verb having a specified syntactic relationship with any candidate verb in the set of candidate verbs may be: the verb having a VOB relationship or the verb having a COO relationship with any one of the candidate verbs in the set of candidate verbs is searched. This is not limited in this embodiment. In the case where a verb having a specified syntactic relationship with any one of the candidate verbs is found, the found verb may be added as a candidate verb to a set of the candidate verbs.
For example, as shown in fig. 3, after the verb candidate "go" is determined, since "beat" and the verb candidate "go" have a COO relationship, it is possible to add "beat" to a set of verbs candidate too, at which time the verbs included in the set of verbs candidate are changed from 1 (i.e., "go") to 2 (i.e., "beat", "go"). As shown in fig. 4, after the verb "go" candidate is determined and the verb "beat", "recall" having a COO relationship with the "reminder" is determined as a set of verbs candidate, since the verb "reminder" has a VOB relationship with the verb "recall" candidate, "a" reminder "may also be added to a set of verbs candidate, at which time the verbs included in the set of verbs candidate are changed from 2 (i.e.," beat "," recall ") to 3 (i.e.," beat "," recall "," reminder ").
By the embodiment, the verb with the specified syntactic relation with the core verb in the control statement is determined as the candidate verb, and the verb with the specified syntactic relation with the candidate verb is also determined as the candidate verb, so that accuracy of the determination of the candidate verb can be improved, and omission of the candidate verb is avoided.
In one exemplary embodiment, the associated term of each candidate verb is a neighboring term of each candidate verb, the neighboring term of each candidate verb is a term that is located after and neighboring each candidate verb; determining a target verb from the set of candidate verbs according to a syntactic relationship between each candidate verb in the set of candidate verbs and an associated word of each candidate verb, including:
s41, determining candidate verbs meeting first screening conditions between the candidate verbs and adjacent words in a group of candidate verbs as target verbs, wherein the first screening conditions comprise that the syntactic relation is a specified syntactic relation.
In this embodiment, after determining a set of candidate verbs, the destination server may determine, as the destination verb, a candidate verb that satisfies the first filtering condition between the adjacent words in the set of candidate verbs.
Optionally, the related word of each candidate verb is a neighboring word of each candidate verb, the neighboring word of each candidate verb is a word located behind each candidate verb and neighboring each candidate verb, and the first filtering condition includes that the syntactic relation is a specified syntactic relation.
For example, as shown in fig. 4, the control sentence "i am going to basketball on the open day, remembers that i am reminded of eight o 'clock in the open day," the candidate verbs "play", "remembers", "reminded" associated words of "basketball", "on" and "i am", instead of "go", "on" and "eight o' clock".
According to the embodiment, the candidate words with the appointed syntactic relation with the adjacent words in the candidate verbs are determined to be the target words, so that the accuracy and the flexibility of determining the target words can be improved.
In one exemplary embodiment, determining a candidate verb in a set of candidate verbs that satisfies a first filtering condition with respect to adjacent words as a target verb includes:
s51, determining any candidate verb as a target verb under the condition that any candidate verb in a group of candidate verbs and the syntactic relation between the candidate verb and the adjacent word of any candidate verb are dynamic guest relations and the part of speech of the adjacent word of any candidate verb is noun, wherein the appointed syntactic relation comprises the dynamic guest relations, and the first screening condition further comprises the part of speech of the adjacent word as noun;
S52, if the syntactic relation between any candidate verb and the adjacent word of any candidate verb is the parallel relation, determining any candidate verb as the target verb, wherein the appointed syntactic relation comprises the parallel relation.
In this embodiment, the first screening condition may include, but is not limited to, one of the following: the syntactic relation between the candidate verb and the adjacent word is a guest-moving relation, and the part of speech between the candidate verb and the adjacent word is a noun; the syntactic relation between the candidate verb and the adjacent word is a parallel relation.
As an alternative embodiment, in a case where any candidate verb in the set of candidate verbs and a syntactic relationship between adjacent words of any candidate verb are a moving object relationship, and parts of speech of adjacent words of any candidate verb are nouns, any candidate verb may be determined as a target verb, the specified syntactic relationship includes a moving object relationship (i.e., VOB relationship), and the first filtering condition further includes parts of speech of adjacent words as nouns.
For example, as shown in fig. 4, the control sentence "i am going to basketball on tomorrow, remembers that in tomorrow's day and eight o' clock reminding me", adjacent words of the candidate verb "play", "remembering", "remind" are "basketball", "in" and "i am", respectively, wherein a syntactic relationship formed between the candidate verb "play" and "basketball" is a moving guest relationship, and "basketball" is a noun, the candidate verb "play" may be determined as a target verb, and there is no syntactic relationship between the candidate verb "remembering" and "in", so the candidate verb "remembering" is not a target verb, and a syntactic relationship formed between the candidate verb "remind" and "i am" is a moving guest relationship, but the part of the candidate verb "i" is a code word and is not a noun, so the candidate verb "remind" is not a target verb.
As another alternative embodiment, in the case where the syntactic relationship between any candidate verb and the adjacent word of any candidate verb is a juxtaposition relationship, any candidate verb may be determined as the target verb, where the specified syntactic relationship includes a juxtaposition relationship (i.e., COO relationship).
For example, as shown in fig. 7, in the control sentence "remembers that me is reminded of going out and walking at eight o' clock in tomorrow," adjacent words of the candidate verb "remind", "go out", "walking" are "me" and "walking", respectively, wherein a syntactic relationship formed between the candidate verb "remind" and "me" is a DBL not a guest moving relationship or a parallel relationship, so the candidate verb "remind" is not a target verb, and a syntactic relationship formed between the candidate verb "go out" and "walking" is a parallel relationship, so the candidate verb "go out" can be determined as a target verb.
According to the method and the device, the target verb is determined from the group of candidate verbs according to the syntactic relation between any candidate verb in the group of candidate verbs and the adjacent word of any candidate verb and the part of speech of the adjacent word of any candidate verb, so that the accuracy of determining the target verb can be improved, and the accuracy of determining the event slot position can be further improved.
In one exemplary embodiment, the associated word of each candidate verb is a word having a syntactic relationship with each candidate verb; determining a target verb from the set of candidate verbs according to a syntactic relationship between each candidate verb in the set of candidate verbs and an associated word of each candidate verb, including:
s61, determining candidate verbs which meet a second screening condition between the candidate verbs and the words with the syntactic relations in the group of candidate verbs as target verbs, wherein the second screening condition comprises that the syntactic relations are specified syntactic relations.
In this embodiment, after determining the set of candidate verbs, the destination server may determine, as the destination verb, a candidate verb that satisfies the second filtering condition between the words having the syntactic relationship in the set of candidate verbs.
Optionally, the associated word of each candidate verb is a word having a syntactic relationship with each candidate verb, and the second filtering condition includes the syntactic relationship being a specified syntactic relationship.
For example, a syntactic relationship between a word having a syntactic relationship in a set of candidate verbs may be a VOB relationship or a candidate verb having a COO relationship, and may be determined as a target verb.
According to the method and the device, the candidate words with the appointed syntactic relation between the candidate verbs and the words with the syntactic relation in the candidate verbs are determined to be target words, and therefore accuracy and flexibility in determining the target words can be improved. .
In one exemplary embodiment, a candidate verb of a set of candidate verbs that satisfies a second filtering condition with respect to a word having a syntactic relationship is determined as a target verb:
s71, determining any candidate verb as a target verb in the case that any candidate verb in a group of candidate verbs and the syntactic relation between words with syntactic relation with any candidate verb are dynamic guest relations and the part of speech of the word with syntactic relation with any candidate verb is noun, wherein the designated syntactic relation comprises the dynamic guest relation, and the second screening condition further comprises the part of speech of the word with syntactic relation as noun;
s72, when the syntactic relationship between any one of the candidate verbs and the word having the syntactic relationship with any one of the candidate verbs is a parallel relationship, determining any one of the candidate verbs as a target verb, wherein the specified syntactic relationship includes the parallel relationship.
In this embodiment, the first screening condition may include, but is not limited to, one of the following: the syntactic relation between the candidate verb and the words with syntactic relation with the candidate verb is a guest-moving relation, and the part of speech between the candidate verb and the adjacent words is a noun; the syntactic relationship between the candidate verb and the word having the syntactic relationship with the candidate verb is a juxtaposition relationship.
As an alternative embodiment, in a case where any candidate verb in the set of candidate verbs and a syntactic relationship between words having a syntactic relationship with any candidate verb are a guest-to-move relationship and a part of speech of a word having a syntactic relationship with any candidate verb is a noun, any candidate verb may be determined as a target verb, the specified syntactic relationship includes a guest-to-move relationship (i.e., VOB relationship), and the second filtering condition further includes the part of speech of the word having a syntactic relationship as a noun.
For example, as shown in fig. 4, the control sentence "i am going to play basketball on the open day, remembers that in the alert me" at eight o' clock on the open day, the associated words of the candidate verb "go", "play", "remembered" and "alert" are "go", "basketball", "alert" and "me", respectively, wherein the candidate verb "go" has no word having a moving guest relationship or a parallel relationship other than "play", and has a moving guest relationship with "basketball", so that "go" is not a target verb, the candidate verb "play" has a moving guest relationship with "basketball", and "basketball" is a noun, so that the candidate verb "play" can be determined as a target verb, the candidate verb "remembers" has a parallel relationship with "alert", but has a moving guest relationship with "me" other than "remember", so that the candidate verb "remembers" is not a target, but the candidate "alert" has a moving guest relationship with "me", so that the word properties of "i" play "and" basketball "are not a target verb, and the candidate verb" is not a verb.
As another alternative embodiment, in the case where a syntactic relationship between any candidate verb and a word having a syntactic relationship with any candidate verb is a juxtaposition relationship, any candidate verb may be determined as a target verb, and the above-specified syntactic relationship includes a juxtaposition relationship (i.e., COO relationship).
For example, as shown in fig. 7, in the control sentence "remembers that me is reminded of going out and walking at eight o' clock in tomorrow," the associated words of the candidate verbs "remind", "go out", "walk" are "me" and "walk", respectively, wherein the syntactic relationship formed between the candidate verbs "remind" and "me" is that DBL is not a guest moving relationship or a parallel relationship, so the candidate verb "remind" is not a target verb, and the syntactic relationship formed between the candidate verbs "go out" and "walk" is a parallel relationship, so the candidate verb "go out" can be determined as a target verb.
It should be noted that, the noun structures of "go\v gym\n", "play\v basketball\n" are syntactically called a moving guest relationship VOB, and two moving guest relationship VOB structures adjacent to each other are syntactically called a parallel relationship COO. By means of the parallel structure in the moving guest relation, the correct event slot position can be extracted: the basketball is played by going to the gym, and the event slot extraction precision is higher.
According to the embodiment, the target verb is determined from the set of candidate verbs according to the syntactic relation between any candidate verb in the set of candidate verbs and the words having syntactic relation with any candidate verb and the part of speech of the associated word of any candidate verb, so that the determination accuracy of the target verb can be improved, and the determination accuracy of the event slot position can be further improved.
In one exemplary embodiment, determining a target word, and associated words of the target word, as a target event slot of a target control statement includes:
s81, when a plurality of target words exist, determining each target word and the associated word of each target word as an event slot corresponding to each target word;
s82, determining the combination of event slots corresponding to each target word as a target event slot.
In this embodiment, in the case where there are a plurality of target words, the target server may determine each target word and the associated word of each target word, determine an event slot corresponding to each target word, and determine a combination of event slots corresponding to each target word as the target event slot.
For example, when the control sentence is "song a reminds me to play basketball at stadium at 8 am in the open world," the target word "go", "play" and the words associated with the target word "stadium", "basketball" may be determined as event slots, with the resulting final event slots being: the basketball playing system is used for playing basketball in a gym instead of playing basketball in a single mode, so that the groove position extraction is more complete, the question answering system plays back on NLG (Natural Language Generation ), and the experience effect of a user is better.
The above process of determining the combination of the event slots corresponding to each target word as the target event slot may be to splice adjacent event slots into one event slot under the condition that the event slots corresponding to each target word are adjacent, and then determine the spliced event slot as the target event slot.
Alternatively, in the case where the target control sentence is a schedule setting sentence corresponding to the target schedule, the target server may determine a schedule reminder time corresponding to the target schedule from the target control sentence, for example, when the control sentence is "song a reminds me to play a basketball in a gym at 8 am in the open morning", 8 am in the open morning may be determined as the schedule reminder time corresponding to the schedule.
After determining the target event slot, the target server may construct a schedule reminder statement according to the target event slot, where the target reminder statement is used to remind to execute the target schedule. The process of constructing the schedule reminding statement according to the target event slot position can be as follows: according to the target event slot, the words in the target event slot are extracted from the target control sentence, and the schedule reminding sentence is constructed according to the words, which is not limited in the embodiment. After the schedule reminding statement is constructed, the target reminding statement can be converted into corresponding reminding voice to carry out voice broadcasting under the condition that the target reminding time arrives, wherein the target reminding time is the reminding time of the target schedule extracted from the target control statement.
According to the embodiment, the combination of the event slots corresponding to each target word is determined as the event slots, so that the determination accuracy of the event slots can be improved.
The method for extracting the event slots in the embodiment of the application is explained below with reference to an optional example. In the method, a method for extracting slots by using syntax analysis of day Cheng Shixiang in the schedule field is provided, in the process of extracting event slots in the schedule field of a question-answering system, syntax analysis is introduced to assist in extracting the event slots in the schedule field, core verbs of sentences are extracted, and core verbs are used as references, and a syntax rule strategy is formulated by means of a moving guest relation of verbs close to nouns and a parallel relation of verbs close to verbs to extract the event slots, so that the accuracy of extracting the event slots is improved, and the generalization of schedule event slots is enhanced.
In conjunction with fig. 8, the flow of the event slot extraction method in this alternative example may include the following steps:
step S802, analyzing the sentence by calling a syntactic analysis algorithm to obtain a candidate verb in the sentence.
And calling a syntactic analysis algorithm to analyze the syntactic structure of the sentence, so that candidate verbs in the sentence structure can be obtained, and other words can be diverged around the core verbs.
Step S804, judging the part of speech of the adjacent words of the candidate verb and the structural relationship formed between the adjacent words and the candidate verb.
In step S806, when the syntactic relationship formed between the adjacent word and the candidate verb is a guest-moving relationship or a parallel relationship, the candidate verb and the slot where the word adjacent to the candidate verb is located are determined as event slots.
When the syntax structure of the immediate verb noun is a moving object structure VOB (corresponding to the moving object relationship described above), if the two VOB structures are also in close proximity, the final event slot is an assembly of the two VOBs, for example, "play basketball at gym", if there is no moving object structure in the sentence, but there is a COO juxtaposition of the immediate verb, it is also considered as a possibility of a transaction slot, such as "go walk".
Through the optional example, the syntactic analysis technology is applied to the event slot extraction of a complex sentence, the position of a core verb in the sentence, the moving object structure VOB in the sentence and the parallel relation COO can provide certain auxiliary information for the extraction of the event slot in the schedule field, so that the robustness and the accuracy of the slot extraction algorithm are higher, and after the syntactic structure characteristic information is introduced, the event slot can be extracted more accurately in the complex slots such as schedule matters.
It should be noted that, for simplicity of description, the foregoing method embodiments are all described as a series of acts, but it should be understood by those skilled in the art that the present application is not limited by the order of acts described, as some steps may be performed in other orders or concurrently in accordance with the present application. Further, those skilled in the art will also appreciate that the embodiments described in the specification are all preferred embodiments, and that the acts and modules referred to are not necessarily required for the present application.
From the description of the above embodiments, it will be clear to a person skilled in the art that the method according to the above embodiments may be implemented by means of software plus the necessary general hardware platform, but of course also by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM (Read-Only Memory)/RAM (Random Access Memory), magnetic disk, optical disk), comprising instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method according to the embodiments of the present application.
According to another aspect of the embodiment of the application, an event slot extraction device for implementing the event slot extraction method is also provided. Fig. 9 is a block diagram of an alternative event slot extraction apparatus according to an embodiment of the present application, and as shown in fig. 9, the apparatus may include:
an obtaining unit 902, configured to obtain a target control sentence of a slot of an event to be extracted, where the target control sentence includes a plurality of words;
an analysis unit 904, coupled to the obtaining unit 902, configured to perform a syntactic analysis on the target control sentence, and determine a set of candidate words from the plurality of words, where a number of candidate words included in the set of candidate words is less than a number of words included in the plurality of words;
a first determining unit 906, connected to the analyzing unit 904, configured to determine, from the set of candidate words, a target word according to a syntactic relationship between each candidate word in the set of candidate words and an associated word of each candidate word, where the target word and the associated word of the target word are in a specified syntactic relationship;
the second determining unit 908 is connected to the first determining unit 906, and is configured to determine the target word and the associated word of the target word as a target event slot of the target control sentence.
It should be noted that the acquiring unit 902 in this embodiment may be used to perform the above-described step S202, the analyzing unit 904 in this embodiment may be used to perform the above-described step S204, the first determining unit 906 in this embodiment may be used to perform the above-described step S206, and the second determining unit 908 in this embodiment may be used to perform the above-described step S208.
Acquiring a target control statement of an event slot to be extracted through the module, wherein the target control statement comprises a plurality of words; carrying out syntactic analysis on the target control sentence, and determining a group of candidate words from the plurality of words, wherein the number of the candidate words contained in the group of candidate words is smaller than the number of the words contained in the plurality of words; determining a target word from a group of candidate words according to the syntactic relation between each candidate word in the group of candidate words and the associated word of each candidate word, wherein the target word and the associated word of the target word are in a specified syntactic relation; the target words and the associated words of the target words are determined to be the target event slots of the target control statement, so that the problem that the event slots are extracted with low accuracy due to the fact that the event slots are difficult to exhaust in the extraction method of the event slots in the related technology is solved, and the accuracy of the event slots extraction is improved.
In one exemplary embodiment, the first determining unit includes:
the first determining module is configured to determine a target verb from a set of candidate verbs according to a syntactic relationship between each candidate verb in the set of candidate verbs and an associated word of each candidate verb, where the set of candidate verbs includes a set of candidate verbs and the target verb includes a target verb.
In one exemplary embodiment, the analysis unit includes:
the second determining module is used for carrying out syntactic analysis on the target control statement and determining a plurality of words contained in the target control statement and the part of speech of each word in the plurality of words;
and the third determining module is used for determining each word with the part of speech as a verb in the plurality of words as a candidate verb to obtain a group of candidate verbs.
In one exemplary embodiment, the analysis unit includes:
the analysis module is used for carrying out syntactic analysis on the target control statement and determining a core verb of the target control instruction;
a fourth determining module, configured to determine each verb having a specified syntactic relationship with the core verb in the plurality of words as a candidate verb, respectively, to obtain a set of candidate verbs;
a searching module for searching a verb having a specified syntactic relationship with any candidate verb in the set of candidate verbs;
And the adding module is used for adding the searched verb as a candidate verb to a group of candidate verbs under the condition that the verb with the appointed syntactic relation with any candidate verb is searched.
In one exemplary embodiment, the associated term of each candidate verb is a neighboring term of each candidate verb, the neighboring term of each candidate verb is a term that is located after and neighboring each candidate verb; the first determination module includes:
the first determining submodule is used for determining candidate verbs meeting first screening conditions between a group of candidate verbs and adjacent words as target verbs, wherein the first screening conditions comprise that the syntactic relation is a specified syntactic relation.
In one exemplary embodiment, the first determination submodule includes:
a first determining subunit, configured to determine, when any candidate verb in the set of candidate verbs and a syntactic relation between adjacent words of any candidate verb are a moving object relation and parts of speech of adjacent words of any candidate verb are nouns, any candidate verb as a target verb, where the specified syntactic relation includes the moving object relation, and the first filtering condition further includes parts of speech of adjacent words as nouns;
And a second determination subunit configured to determine, when the syntactic relationship between any one of the candidate verbs and the adjacent word of the any one of the candidate verbs is a juxtaposition relationship, any one of the candidate verbs as a target verb, wherein the specified syntactic relationship includes the juxtaposition relationship.
In one exemplary embodiment, the associated word of each candidate verb is a word having a syntactic relationship with each candidate verb; the first determination module includes:
and a second determining sub-module, configured to determine, as the target verb, a candidate verb that satisfies a second filtering condition between a set of candidate verbs and a word having a syntactic relationship, where the second filtering condition includes the syntactic relationship being a specified syntactic relationship.
In one exemplary embodiment, the second determination submodule includes:
a third determining subunit, configured to determine, when any candidate verb in the set of candidate verbs and a syntactic relation between words having a syntactic relation with any candidate verb are moving object relations and parts of speech of words having a syntactic relation with any candidate verb are nouns, any candidate verb as a target verb, where the specified syntactic relation includes the moving object relations, and the second filtering condition further includes the parts of speech of words having a syntactic relation as nouns;
A fourth determination subunit configured to determine, when a syntactic relationship between any one of the candidate verbs and the word having the syntactic relationship with the any one of the candidate verbs is a juxtaposition relationship, any one of the candidate verbs as a target verb, wherein the specified syntactic relationship includes the juxtaposition relationship.
In one exemplary embodiment, the second determining unit includes:
a fifth determining module, configured to determine, when there are a plurality of target words, each target word and an associated word of each target word as an event slot corresponding to each target word;
and a sixth determining module, configured to determine a combination of event slots corresponding to each target word as a target event slot.
It should be noted that the above modules are the same as examples and application scenarios implemented by the corresponding steps, but are not limited to what is disclosed in the above embodiments. It should be noted that the above modules may be implemented in software or in hardware as part of the apparatus shown in fig. 1, where the hardware environment includes a network environment.
According to yet another aspect of an embodiment of the present application, there is also provided a storage medium. Alternatively, in this embodiment, the storage medium may be used to execute the program code of the method for extracting an event slot in any of the foregoing embodiments of the present application.
Alternatively, in this embodiment, the storage medium may be located on at least one network device of the plurality of network devices in the network shown in the above embodiment.
Alternatively, in the present embodiment, the storage medium is configured to store program code for performing the steps of:
s1, acquiring a target control statement of an event slot to be extracted, wherein the target control statement comprises a plurality of words;
s2, carrying out syntactic analysis on the target control sentence, and determining a group of candidate words from the plurality of words, wherein the number of the candidate words contained in the group of candidate words is smaller than the number of the words contained in the plurality of words;
s3, determining a target word from the group of candidate words according to the syntactic relation between each candidate word in the group of candidate words and the associated word of each candidate word, wherein the association word between the target word and the target word is a designated syntactic relation;
s4, determining the target words and the related words of the target words as target event slots of the target control sentences.
Alternatively, specific examples in the present embodiment may refer to examples described in the above embodiments, which are not described in detail in the present embodiment.
Alternatively, in the present embodiment, the storage medium may include, but is not limited to: various media capable of storing program codes, such as a U disk, ROM, RAM, a mobile hard disk, a magnetic disk or an optical disk.
According to still another aspect of the embodiments of the present application, there is further provided an electronic device for implementing the method for extracting an event slot, where the electronic device may be a server, a terminal, or a combination thereof.
Fig. 10 is a block diagram of an alternative electronic device, according to an embodiment of the present application, as shown in fig. 10, including a processor 1002, a communication interface 1004, a memory 1006, and a communication bus 1008, wherein the processor 1002, the communication interface 1004, and the memory 1006 communicate with each other via the communication bus 1008, wherein,
a memory 1006 for storing a computer program;
processor 1002, when executing computer programs stored on memory 1006, performs the following steps:
s1, acquiring a target control statement of an event slot to be extracted, wherein the target control statement comprises a plurality of words;
s2, carrying out syntactic analysis on the target control sentence, and determining a group of candidate words from the plurality of words, wherein the number of the candidate words contained in the group of candidate words is smaller than the number of the words contained in the plurality of words;
S3, determining a target word from the group of candidate words according to the syntactic relation between each candidate word in the group of candidate words and the associated word of each candidate word, wherein the association word between the target word and the target word is a designated syntactic relation;
s4, determining the target words and the related words of the target words as target event slots of the target control sentences.
Alternatively, in the present embodiment, the communication bus may be a PCI (Peripheral Component Interconnect, peripheral component interconnect standard) bus, or an EISA (Extended Industry Standard Architecture ) bus, or the like. The communication bus may be classified as an address bus, a data bus, a control bus, or the like. For ease of illustration, only one thick line is shown in fig. 10, but not only one bus or one type of bus. The communication interface is used for communication between the electronic device and other equipment.
The memory may include RAM or may include non-volatile memory (non-volatile memory), such as at least one disk memory. Optionally, the memory may also be at least one memory device located remotely from the aforementioned processor.
As an example, the memory 1006 may include, but is not limited to, an acquisition unit 902, an analysis unit 904, a first determination unit 906, and a second determination unit 908 in the extraction apparatus including the event slots. In addition, other module units in the event slot extraction device may be included but not limited to the above, which is not described in detail in this example.
The processor may be a general purpose processor and may include, but is not limited to: CPU (Central Processing Unit ), NP (Network Processor, network processor), etc.; but also DSP (Digital Signal Processing, digital signal processor), ASIC (Application Specific Integrated Circuit ), FPGA (Field-Programmable Gate Array, field programmable gate array) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components.
Alternatively, specific examples in this embodiment may refer to examples described in the foregoing embodiments, and this embodiment is not described herein.
It will be understood by those skilled in the art that the structure shown in fig. 10 is only schematic, and the device implementing the event slot extraction method may be a terminal device, and the terminal device may be a smart phone (such as an Android mobile phone, an iOS mobile phone, etc.), a tablet computer, a palm computer, a mobile internet device (Mobile Internet Devices, MID), a PAD, etc. Fig. 10 is not limited to the structure of the electronic device. For example, the electronic device may also include more or fewer components (e.g., network interfaces, display devices, etc.) than shown in FIG. 10, or have a different configuration than shown in FIG. 10.
Those of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be implemented by a program for instructing a terminal device to execute in association with hardware, the program may be stored in a computer readable storage medium, and the storage medium may include: flash disk, ROM, RAM, magnetic or optical disk, etc.
The foregoing embodiment numbers of the present application are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
The integrated units in the above embodiments may be stored in the above-described computer-readable storage medium if implemented in the form of software functional units and sold or used as separate products. Based on such understanding, the technical solution of the present application may be embodied in essence or a part contributing to the prior art or all or part of the technical solution in the form of a software product stored in a storage medium, comprising several instructions for causing one or more computer devices (which may be personal computers, servers or network devices, etc.) to perform all or part of the steps of the method described in the embodiments of the present application.
In the foregoing embodiments of the present application, the descriptions of the embodiments are emphasized, and for a portion of this disclosure that is not described in detail in this embodiment, reference is made to the related descriptions of other embodiments.
In several embodiments provided by the present application, it should be understood that the disclosed client may be implemented in other manners. The above-described embodiments of the apparatus are merely exemplary, and the division of the units, such as the division of the units, is merely a logical function division, and may be implemented in another manner, for example, multiple units or components may be combined or may be integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be through some interfaces, units or modules, or may be in electrical or other forms.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution provided in the present embodiment.
In addition, each functional unit in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The foregoing is merely a preferred embodiment of the present application and it should be noted that modifications and adaptations to those skilled in the art may be made without departing from the principles of the present application, which are intended to be comprehended within the scope of the present application.

Claims (12)

1. The method for extracting the event slots is characterized by comprising the following steps:
obtaining a target control statement of an event slot to be extracted, wherein the target control statement comprises a plurality of words;
carrying out syntactic analysis on the target control sentence, and determining a group of candidate words from the plurality of words, wherein the number of the candidate words contained in the group of candidate words is smaller than the number of words contained in the plurality of words;
determining a target word from the group of candidate words according to the syntactic relation between each candidate word in the group of candidate words and the associated word of each candidate word, wherein the target word and the associated word of the target word are in a specified syntactic relation;
and determining the target words and the associated words of the target words as target event slots of the target control sentences.
2. The method of claim 1, wherein the determining the target word from the set of candidate words based on a syntactic relationship between each candidate word in the set of candidate words and the associated word for each candidate word comprises:
determining a target verb from a set of candidate verbs according to a syntactic relation between each candidate verb in the set of candidate verbs and an associated word of each candidate verb, wherein the set of candidate verbs comprises the set of candidate verbs, and the target verb comprises the target verb.
3. The method of claim 2, wherein said parsing the target control sentence to determine a set of candidate words from the plurality of words comprises:
performing syntactic analysis on the target control statement, and determining the words contained in the target control statement and the part of speech of each word in the words;
and determining each word with the part of speech as a verb in the plurality of words as a candidate verb to obtain the set of candidate verbs.
4. The method of claim 2, wherein said parsing the target control sentence to determine a set of candidate words from the plurality of words comprises:
Carrying out syntactic analysis on the target control statement to determine a core verb of the target control instruction;
each verb with the appointed syntactic relation with the core verb in the words is respectively determined to be a candidate verb, and the candidate verb group is obtained;
searching a verb with the appointed syntactic relation with any candidate verb in the set of candidate verbs;
and under the condition that the verb with the appointed syntactic relation with any candidate verb is found, adding the found verb as a candidate verb into the group of candidate verbs.
5. The method of claim 2, wherein the associated term of each candidate verb is a term adjacent to the each candidate verb, the term adjacent to the each candidate verb being a term located after and adjacent to the each candidate verb;
the determining, according to a syntactic relation between each candidate verb in the set of candidate verbs and an associated word of each candidate verb, a target verb from the set of candidate verbs includes:
and determining a candidate verb meeting a first screening condition between the candidate verb and the adjacent word in the group of candidate verbs as the target verb, wherein the first screening condition comprises a syntactic relation which is the appointed syntactic relation.
6. The method of claim 5, wherein determining a candidate verb of the set of candidate verbs that satisfies a first filtering condition with respect to adjacent words as the target verb comprises:
determining any candidate verb in the set of candidate verbs as the target verb under the condition that the syntactic relation between the candidate verb and the adjacent word of the candidate verb is a moving object relation and the part of speech of the adjacent word of the candidate verb is a noun, wherein the appointed syntactic relation comprises the moving object relation, and the first screening condition further comprises the part of speech of the adjacent word as the noun;
and determining any candidate verb as the target verb under the condition that the syntactic relation between the candidate verb and the adjacent word of the candidate verb is a parallel relation, wherein the appointed syntactic relation comprises the parallel relation.
7. The method of claim 2, wherein the associated word of each candidate verb is a word having a syntactic relationship with the each candidate verb;
the determining, according to a syntactic relation between each candidate verb in the set of candidate verbs and an associated word of each candidate verb, a target verb from the set of candidate verbs includes:
And determining candidate verbs which meet a second screening condition between the candidate verbs and the words with the syntactic relations as the target verbs, wherein the second screening condition comprises the syntactic relations as the appointed syntactic relations.
8. The method of claim 7, wherein determining a candidate verb of the set of candidate verbs that satisfies a second filtering condition with respect to the syntactically related word as the target verb comprises:
determining any candidate verb in the set of candidate verbs as the target verb in the case that the syntactic relation between the candidate verb and the word having the syntactic relation with the candidate verb is a moving object relation and the part of speech of the word having the syntactic relation with the candidate verb is a noun, wherein the specified syntactic relation comprises the moving object relation and the second filtering condition further comprises the part of speech of the word having the syntactic relation as the noun;
and determining any candidate verb as the target verb in the case that the syntactic relation between the any candidate verb and the word having the syntactic relation with the any candidate verb is the juxtaposition relation, wherein the appointed syntactic relation comprises the juxtaposition relation.
9. The method according to any one of claims 1 to 8, wherein the determining the target word and the associated word of the target word as the target event slot of the target control sentence includes:
when a plurality of target words exist, determining each target word and the associated word of each target word as an event slot corresponding to each target word;
and determining a combination of event slots corresponding to each target word as the target event slot.
10. An extraction device for an event slot, comprising:
the device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring a target control statement of an event slot to be extracted, and the target control statement comprises a plurality of words;
the analysis unit is used for carrying out syntactic analysis on the target control sentence and determining a group of candidate words from the plurality of words, wherein the number of the candidate words contained in the group of candidate words is smaller than the number of words contained in the plurality of words;
the first determining unit is used for determining a target word from the group of candidate words according to the syntactic relation between each candidate word in the group of candidate words and the associated word of each candidate word, wherein the target word and the associated word of the target word are in a specified syntactic relation;
And the second determining unit is used for determining the target word and the associated word of the target word as a target event slot of the target control statement.
11. A computer-readable storage medium, characterized in that the computer-readable storage medium comprises a stored program, wherein the program when run performs the method of any one of claims 1 to 9.
12. An electronic device comprising a memory and a processor, characterized in that the memory has stored therein a computer program, the processor being arranged to execute the method according to any of claims 1 to 9 by means of the computer program.
CN202210468880.XA 2022-04-29 2022-04-29 Method and device for extracting event slots, storage medium and electronic device Pending CN117010364A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202210468880.XA CN117010364A (en) 2022-04-29 2022-04-29 Method and device for extracting event slots, storage medium and electronic device
PCT/CN2022/096436 WO2023206703A1 (en) 2022-04-29 2022-05-31 Event slot extraction method and apparatus, storage medium and electronic apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210468880.XA CN117010364A (en) 2022-04-29 2022-04-29 Method and device for extracting event slots, storage medium and electronic device

Publications (1)

Publication Number Publication Date
CN117010364A true CN117010364A (en) 2023-11-07

Family

ID=88517108

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210468880.XA Pending CN117010364A (en) 2022-04-29 2022-04-29 Method and device for extracting event slots, storage medium and electronic device

Country Status (2)

Country Link
CN (1) CN117010364A (en)
WO (1) WO2023206703A1 (en)

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111460787B (en) * 2020-03-27 2023-09-22 深圳价值在线信息科技股份有限公司 Topic extraction method, topic extraction device, terminal equipment and storage medium
US11636274B2 (en) * 2020-05-14 2023-04-25 Google Llc Systems and methods to identify most suitable grammar suggestions among suggestions from a machine translation model
CN112231494B (en) * 2020-12-16 2021-08-03 完美世界(北京)软件科技发展有限公司 Information extraction method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
WO2023206703A1 (en) 2023-11-02

Similar Documents

Publication Publication Date Title
JP7346609B2 (en) Systems and methods for performing semantic exploration using natural language understanding (NLU) frameworks
US11302337B2 (en) Voiceprint recognition method and apparatus
US20200301954A1 (en) Reply information obtaining method and apparatus
US9514742B2 (en) System and method for managing conversation
Mairesse et al. Stochastic language generation in dialogue using factored language models
CN110377716A (en) Exchange method, device and the computer readable storage medium of dialogue
US10574597B2 (en) Conversational log replay with voice and debugging information
US20220036012A1 (en) Deriving multiple meaning representations for an utterance in a natural language understanding (nlu) framework
EP3779972A1 (en) Voice wake-up method and apparatus
CN110287461A (en) Text conversion method, device and storage medium
CN110795913B (en) Text encoding method, device, storage medium and terminal
CN107797984A (en) Intelligent interactive method, equipment and storage medium
AU2017276360B2 (en) A system for the automated semantic analysis processing of query strings
CN113314119B (en) Voice recognition intelligent household control method and device
CN105390137A (en) Response generation method, response generation apparatus, and response generation program
Jiang et al. Exploring Patterns of Stability and Change in Caregivers' Word Usage Across Early Childhood
CN112885338B (en) Speech recognition method, device, computer-readable storage medium, and program product
CN109472032A (en) A kind of determination method, apparatus, server and the storage medium of entity relationship diagram
CN117010364A (en) Method and device for extracting event slots, storage medium and electronic device
CN109885668A (en) A kind of expansible field interactive system status tracking method and apparatus
CN116504222A (en) Text conversion method and device, storage medium and electronic device
US20210294980A1 (en) Knowledge Based-Operating System
CN117689020B (en) Method and device for constructing intelligent home body based on large model and electronic equipment
CN112735380B (en) Scoring method and voice recognition method for re-scoring language model
CN116504225A (en) Voice control method and device of equipment, storage medium and electronic device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination