CN110688858A - Semantic analysis method and device, electronic equipment and storage medium - Google Patents

Semantic analysis method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN110688858A
CN110688858A CN201910877053.4A CN201910877053A CN110688858A CN 110688858 A CN110688858 A CN 110688858A CN 201910877053 A CN201910877053 A CN 201910877053A CN 110688858 A CN110688858 A CN 110688858A
Authority
CN
China
Prior art keywords
determining
user
segmentation result
word segmentation
initial
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
CN201910877053.4A
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.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen 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 Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN201910877053.4A priority Critical patent/CN110688858A/en
Priority to PCT/CN2019/118017 priority patent/WO2021051584A1/en
Publication of CN110688858A publication Critical patent/CN110688858A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • G06F40/284Lexical analysis, e.g. tokenisation or collocates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/30Semantic analysis

Abstract

The invention discloses a semantic analysis method, a semantic analysis device, electronic equipment and a storage medium, and relates to the field of semantic analysis, wherein the method comprises the following steps: acquiring the voice of a user; performing text conversion on the user voice to obtain a corresponding text; performing word segmentation on the text to obtain a corresponding word segmentation result; determining nouns and verbs in the word segmentation result, and determining initial semantics of the user based on the nouns and verbs in the word segmentation result; determining whether a query language word exists in the word segmentation result, and determining the language category to which the user voice belongs based on whether the query language word exists in the word segmentation result; and determining the target semantics of the user based on the initial semantics and the mood category. The method improves the precision of semantic analysis.

Description

Semantic analysis method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of semantic parsing, and in particular, to a semantic parsing method and apparatus, an electronic device, and a storage medium.
Background
In the use of the internet of things system, for example, in the use of an intelligent vehicle system, it is often necessary to analyze a voice instruction sent by a user, determine semantics, and further provide a corresponding service for the user. In the existing semantic analysis, a regular expression mode is usually adopted to match all words, so that the semantics of a user is determined. In actual life, due to the diversity of user expression modes, the semantic analysis is performed by using a regular expression matching method alone, and sometimes, a semantic analysis error occurs, so that the semantic analysis accuracy is low.
Disclosure of Invention
Based on this, in order to solve the technical problem in the related art how to perform semantic parsing on user speech more accurately from a technical level, the present disclosure provides a semantic parsing method, an apparatus, an electronic device, and a storage medium.
According to a first aspect of the present disclosure, there is provided a semantic parsing method, including:
acquiring the voice of a user;
performing text conversion on the user voice to obtain a corresponding text;
performing word segmentation on the text to obtain a corresponding word segmentation result;
determining nouns and verbs in the word segmentation result, and determining initial semantics of the user based on the nouns and verbs in the word segmentation result;
determining whether the query language words exist in the word segmentation result, and determining the language category to which the user voice belongs based on whether the query language words exist in the word segmentation result;
and determining the target semantics of the user based on the initial semantics and the mood category.
In an exemplary embodiment of the present disclosure, determining nouns and verbs in the segmentation result, and determining the initial semantics of the user based on the nouns and verbs in the segmentation result includes:
determining nouns in the word segmentation result based on the part-of-speech judgment of each word in the word segmentation result;
determining verbs in the word segmentation result based on the part-of-speech judgment of each word in the word segmentation result;
based on the noun and the verb, an initial semantic of the user is determined.
In an exemplary embodiment of the disclosure, determining the initial semantics of the user based on the real word and the verb includes:
determining an entity corresponding to the noun as a user-indicated implementation object;
determining the action corresponding to the verb as the initial service type indicated by the user;
and determining the implementation object and the initial service type as the initial semantics of the user.
In an exemplary embodiment of the present disclosure, determining whether a query linguistic word exists in the word segmentation result, and determining the linguistic category to which the user voice belongs based on whether the query linguistic word exists in the word segmentation result includes:
matching the word segmentation result with a preset query language word set to determine whether query language words exist in the word segmentation result;
if the word segmentation result has the query language words, determining the user voice as a query sentence;
and if no query language qi word exists in the word segmentation result, determining the user voice as a non-query sentence.
In an exemplary embodiment of the present disclosure, determining a target semantic of a user based on the initial semantic and the mood category includes:
determining a target service type indicated by a user based on the initial service type and the mood category to which the user belongs;
and determining the implementation object and the target service type as the target semantics of the user.
In an exemplary embodiment of the present disclosure, determining a target service type in target semantics of a user based on the initial service type and the mood category includes:
if the user statement is an interrogative statement, determining the query service as the target service type;
and if the user statement is a non-question statement, determining the initial service type as the target service type.
According to a second aspect of the present disclosure, there is provided a semantic parsing apparatus, including;
the first acquisition module is used for acquiring the voice of a user;
the second acquisition module is used for performing text conversion on the user voice to acquire a corresponding text;
the third acquisition module is used for segmenting the text to acquire a corresponding segmentation result;
the first determining module is used for determining nouns and verbs in the word segmentation result and determining the initial semantics of the user based on the nouns and verbs in the word segmentation result;
the second determining module is used for determining whether the query language words exist in the word segmentation result and determining the language category to which the user voice belongs based on whether the query language words exist in the word segmentation result;
and the third determining module is used for determining the target semantic of the user based on the initial semantic and the mood category.
According to a third aspect of the present disclosure, there is provided a semantic parsing electronic device, comprising:
a memory configured to store executable instructions;
a processor configured to execute executable instructions stored in the memory to implement the above-described method.
According to a fourth aspect of the present disclosure, there is provided a computer readable storage medium storing computer program instructions which, when executed by a computer, cause the computer to perform the method described above.
Compared with the semantic analysis based on the matching of the regular expression in the traditional technology, the embodiment of the disclosure determines the initial semantic according to the noun and verb in the word segmentation result when performing the semantic analysis; and judging the tone of the voice of the user according to whether the query tone words exist in the word segmentation result. And determining the target semantics by combining the initial semantics, thereby completing the semantic analysis and improving the precision of the semantic analysis.
Additional features and advantages of the disclosure will be set forth in the detailed description which follows, or in part will be obvious from the description, or may be learned by practice of the disclosure.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
FIG. 1 shows a flow diagram of semantic parsing according to an example embodiment of the present disclosure.
FIG. 2 illustrates a flowchart for determining nouns and verbs in the segmentation result and determining initial semantics of the user sentence based on the nouns and verbs in the segmentation result according to an example embodiment of the present disclosure.
FIG. 3 illustrates a flow diagram for determining initial semantics of the user sentence based on the noun and the verb, according to an example embodiment of the present disclosure.
Fig. 4 is a flowchart illustrating a process of determining whether a query linguistic word exists in a segmentation result and determining an linguistic category to which a user sentence belongs based on whether the query linguistic word exists in the segmentation result according to an example embodiment of the present disclosure.
FIG. 5 is a flow diagram for determining a target semantic of the user sentence based on the initial semantic and the mood class according to an example embodiment of the present disclosure.
FIG. 6 shows a flowchart for determining a target service type in target semantics of the user statement based on the initial service type and the mood class according to an example embodiment of the present disclosure.
Fig. 7 illustrates a block diagram of a semantic parsing apparatus according to an example embodiment of the present disclosure.
FIG. 8 illustrates a system architecture diagram for semantic parsing according to an example embodiment of the present disclosure.
FIG. 9 illustrates a diagram of an electronic device for semantic parsing according to an example embodiment of the present disclosure.
FIG. 10 illustrates a computer-readable storage medium diagram of semantic parsing according to an example embodiment of the present disclosure.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the disclosure. One skilled in the relevant art will recognize, however, that the subject matter of the present disclosure can be practiced without one or more of the specific details, or with other methods, components, devices, steps, and the like. In other instances, well-known technical solutions have not been shown or described in detail to avoid obscuring aspects of the present disclosure.
Furthermore, the drawings are merely schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and thus their repetitive description will be omitted. Some of the block diagrams shown in the figures are functional entities and do not necessarily correspond to physically or logically separate entities. These functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor devices and/or microcontroller devices.
Compared with the semantic analysis based on the matching of the regular expression in the traditional technology, the embodiment of the disclosure determines the initial semantic according to the noun and verb in the word segmentation result when performing the semantic analysis; and judging the tone of the voice of the user according to whether the query tone words exist in the word segmentation result. And determining the target semantics by combining the initial semantics, thereby completing the semantic analysis and improving the precision of the semantic analysis.
Fig. 1 shows a flow diagram of semantic parsing according to an example embodiment of the present disclosure:
step S110: acquiring user voice corresponding to user sentences;
step S120: performing text conversion on the user voice to obtain a corresponding text;
step S130: performing word segmentation on the text to obtain a corresponding word segmentation result;
step S140: determining nouns and verbs in the word segmentation result, and determining initial semantics of the user based on the nouns and verbs in the word segmentation result;
step S150: determining whether the query language words exist in the word segmentation result, and determining the language category to which the user voice belongs based on whether the query language words exist in the word segmentation result;
step S160: and determining the target semantics of the user based on the initial semantics and the mood category.
In the embodiment of the disclosure, semantic analysis is performed, the voice of the user is obtained first, and the voice of the user is converted into a text. And performing word segmentation on the text, and determining nouns and verbs in word segmentation results so as to determine the initial semantics of the user. And determining whether the word segmentation result has the query language words, thereby determining the language category to which the voice of the user belongs. And finally, determining the target semantics of the user according to the initial semantics and the mood category of the user.
The initial semantics of the user refer to the implementation object indicated by the user and the initial service type indicated by the user. The initial service type refers to a service type indicated by the user that is preliminarily determined without considering a tone class to which the user's voice belongs.
The target semantics of the user refer to the implementation object indicated by the user and the target service type indicated by the user. The target service type refers to a service type actually indicated by the finally determined user.
For example, the content of the user voice is "is closed, the user is in the service of requesting to query whether the window is in the closed state, that is, the target semantics of the user are: the object, window, target service type, query service is implemented.
Before this, the mood type of the user voice is not considered, and the judgment is carried out only by taking nouns and verbs as the basis, and the determined initial semantics of the user are as follows: implementation object-window, initial service type-close service.
The following describes specific implementation processes of each step of the present disclosure.
In step S110, the voice of the user is acquired.
In one embodiment, the server serves as a center of the internet of things system and provides corresponding services for the user according to the voice instruction of the user. For example, in a smart vehicle system, a user may issue voice instructions to the smart vehicle system. After receiving a voice instruction of a user, a server serving as an intelligent vehicle system center analyzes the voice of the user to obtain target semantics of the user, and further provides corresponding service for the user.
In one embodiment, the server acquires the voice of the user through a voice acquisition terminal in the internet of things. For example, in an intelligent vehicle system, a microphone is disposed at a fixed position inside a vehicle, wherein the microphone is a voice acquisition terminal. When the user sends a voice instruction to the intelligent vehicle system, the microphone collects the voice of the user and uploads the voice of the user to the server.
In step S120, text conversion is performed on the user speech to obtain a corresponding text.
After receiving the user voice, the voice is converted into text, so that the server can perform further processing on the basis of the text to analyze the target semantics of the user.
In one embodiment, the user speech is input into an existing speech-to-text component (e.g., a JAVA-based speech-to-text component) to obtain text corresponding to the user speech.
The embodiment has the advantages that the server processes the text more directly and efficiently, converts the voice into the text and improves the efficiency of semantic analysis.
In step S130, the text is segmented to obtain corresponding segmentation results.
In the embodiment of the disclosure, based on a preset word segmentation model, words are segmented for a text, and a corresponding word segmentation result is obtained. The word segmentation result comprises each separated vocabulary and the part of speech corresponding to each separated vocabulary.
In one embodiment, based on jieba in python, the text is segmented to obtain the corresponding segmentation result. Wherein jieba is a word segmentation library in python, supports Chinese word segmentation and can make part of speech judgment on the separated words.
For example, the text is "open window", and after the text is segmented based on jieba, the segmentation result is obtained as follows: ('will', preposition) ('Window', noun) ('open', verb).
In step S140, nouns and verbs in the segmentation result are determined, and the initial semantics of the user are determined based on the nouns and verbs in the segmentation result.
In the embodiment of the present disclosure, to analyze the target semantics of the user, first, the initial semantics of the user is determined, that is, the implementation object indicated by the user and the indicated initial service type are determined. The entity that is the implementer of the action has defaulted to the server; therefore, there is a need to determine the entity that implements the action, and the initial service type indicated by the user, i.e. the action involved in the user's speech. Since the entity exists in the text in the form of a noun and the action exists in the text in the form of a verb, the initial semantics of the user is determined based on the noun and the verb in the word segmentation result.
In one embodiment, as shown in fig. 2, step S140 includes:
step S1401: determining nouns in the word segmentation result based on the part-of-speech judgment of each word in the word segmentation result;
step S1402: determining verbs in the word segmentation result based on the part-of-speech judgment of each word in the word segmentation result;
step S1403: based on the noun and the verb, an initial semantic of the user is determined.
In one embodiment, after the word segmentation result of the user voice is obtained, the part of speech of each word is judged in advance based on the word segmentation model, and a noun and a verb in the word segmentation result are determined. Thus, the initial semantics of the user is determined based on the nouns and verbs in the word segmentation result.
For example, the resulting word segmentation results are: ('will', preposition) ('Window', noun) ('open', verb). From this, the noun is determined to be 'window' and the verb is 'open', thereby determining the initial semantics of the user.
In one embodiment, as shown in fig. 3, step S1403 includes:
step S14031: determining an entity corresponding to the noun as a user-indicated implementation object;
step S14032: determining the action corresponding to the verb as the initial service type indicated by the user;
step S14033: and determining the implementation object and the initial service type as the initial semantics of the user.
When a user issues a voice instruction to the Internet of things system, the user can generally and directly indicate the voice instruction without mixing redundant information. Therefore, in this embodiment, the entity corresponding to the noun in the voice command may be determined as the implementation object indicated by the user, and the action corresponding to the verb in the voice command may be determined as the initial service type indicated by the user.
For example, from the word segmentation result of the user voice, the noun is determined to be 'window' and the verb is 'open'. The implementation object is determined to be a window and the initial service type is determined to be an open service.
This embodiment has the advantage that based on nouns and verbs, the initial semantics of the user can be determined quickly.
In step S150, it is determined whether there is a query word in the word segmentation result, and the mood category to which the user voice belongs is determined based on whether there is a query word in the word segmentation result.
When semantic parsing is performed on user voice, it is determined whether the user voice is an question because the target semantics expressed in the question and a non-question are very different due to the same set of entities and actions.
For example, also a set of entities and actions "window" and "open", in the non-questionable sentence "open window", what the user would express is: the window is opened. The response that the server should make at this time is: the window is opened.
In the question "do window open", what the user is to express is: inquiring whether the window is in an open state. In the question sentence, the user expresses a query for the objective fact and does not require a change in the state of the entity. The response that the server should make at this time is: the status of the window at that time is reported to the user without any change to the status of the window.
Therefore, when semantic analysis is performed on the user voice, in addition to determining the entity as the implementation object and the action as the initial service type, it is also determined whether the user voice is an question sentence, so as to determine whether the initial service type is the target service type.
In one embodiment, as shown in fig. 4, step S150 includes:
step S1501: matching the word segmentation result with a preset query language word set to determine whether query language words exist in the word segmentation result;
step S1502: if the word segmentation result has the query language words, determining the user voice as a query sentence;
step S1503: and if no query language qi word exists in the word segmentation result, determining the user voice as a non-query sentence.
In one embodiment, a set of query linguistic words is preset, and each query linguistic word is stored in the set of query linguistic words. And comparing each word in the word segmentation result with each query language word in the query language word set so as to determine whether the query language word exists in the word segmentation result. If the word segmentation result has the question language words, determining the corresponding user voice as a question sentence; and if no question language words exist in the word segmentation result, determining the corresponding user voice as a non-question sentence.
For example, the preset set of query words is: ' Dome ', ' is not ', ' has or not ', ' what ' and ' is. For "open window", the word segmentation results in: ('will', preposition) ('Window', noun) ('open', verb); and determining that no query language words exist in the word segmentation result through matching with the query language word set, and determining that the 'opening the window' is a non-query sentence. For "window is opened", the word segmentation result is: (' Window ', noun) (' open ', verb) (' Assistant) (' Doma '); and determining that the query language words are stored in the word segmentation result through matching with the query language word set, and determining that the 'window is opened' as the query sentence.
In the preset query corpus, not only the words consistent with the semantic words identified by the word segmentation model are included, for example: "Dome", "woollen"; phrases that represent questions may also be included, such as: "is or not", "is or not". That is, the query tone words included in the set of query tone words are not completely summarized by the tone words identified by the segmentation model.
The embodiment has the advantage that whether the user voice is a question sentence can be quickly determined through matching with the preset question language word set.
In step S160, a target semantic meaning of the user is determined based on the initial semantic meaning and the mood category.
The initial semantics determine the implementation object and the tentative initial service type; the server needs to determine the target service type actually specified by the user according to the tone category to which the user voice belongs, so as to determine the target semantics of the user.
In one embodiment, as shown in fig. 5, step S160 includes:
step S1601: determining a target service type indicated by a user based on the initial service type and the mood category to which the user belongs;
step S1602: and determining the implementation object and the target service type as the target semantics of the user.
In this embodiment, the target service type indicated by the user is determined based on the initial service type determined in the initial semantics and the mood class to which the user voice belongs, and thus the target semantics of the user is determined in combination with the implementation object determined in the initial semantics.
In one embodiment, as shown in fig. 6, step S1601 includes:
step S16011: if the user statement is an interrogative statement, determining the query service as the target service type;
step S16012: and if the user statement is a non-question statement, determining the initial service type as the target service type.
As can be seen from the above description, if the user speech is an interrogative sentence, the query for the objective fact is expressed, so that the query service is determined as the target service type; if the user voice is not an question, a service request corresponding to the action, i.e., a service request corresponding to the initial service type is expressed, and thus the initial service type is determined as the target service type.
For example, in the smart vehicle system, when the user speech of "open a window" is received, the noun is determined to be "window" after word segmentation, and the verb is "open", the initial semantics is determined to be: implementation object-window, initial service type-open service; determining that the service type of the target language is a non-question sentence, determining that the initial service type of the target language is a target service type, and determining that the target language is defined as: implementation object-window, target service type-open service. The server of the intelligent vehicle system can then respond-opening the window of the vehicle.
In the intelligent vehicle system, after receiving the voice of the user, that is, the window is opened, the noun is determined to be the window after word segmentation, and the verb is determined to be open, the initial semantics is determined as: implementation object-window, initial service type-open service; determining that the query sentence is an interrogative sentence, determining the query service as a target service type, and determining the target language as: the object, window, target service type, query service is implemented. The server of the intelligent vehicle system is thus able to respond-query the current state of the vehicle window and return the current state to the user.
In an embodiment, as shown in fig. 7, a semantic parsing apparatus is provided, which specifically includes:
a first obtaining module 210, configured to obtain a voice of a user;
a second obtaining module 220, configured to perform text conversion on the user speech to obtain a corresponding text;
a third obtaining module 230, configured to perform word segmentation on the text to obtain a corresponding word segmentation result;
a first determining module 240, configured to determine nouns and verbs in the segmentation result, and determine an initial semantic of the user based on the nouns and verbs in the segmentation result;
a second determining module 250, configured to determine whether a query language word exists in the word segmentation result, and determine a language category to which the user voice belongs based on whether the query language word exists in the word segmentation result;
a third determining module 260, configured to determine a target semantic of the user based on the initial semantic and the mood category to which the user belongs.
The implementation process of the functions and actions of each module in the above device is specifically described in the implementation process of the corresponding step in the above semantic parsing method, and is not described herein again.
It should be noted that although in the above detailed description several modules or units of the device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit, according to embodiments of the present disclosure. Conversely, the features and functions of one module or unit described above may be further divided into embodiments by a plurality of modules or units.
Moreover, although the steps of the methods of the present disclosure are depicted in the drawings in a particular order, this does not require or imply that the steps must be performed in this particular order, or that all of the depicted steps must be performed, to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step execution, and/or one step broken down into multiple step executions, etc.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which may be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the embodiments of the present disclosure.
FIG. 8 illustrates a system architecture diagram for semantic parsing according to an example embodiment of the present disclosure. The system architecture includes: server 310, service providing terminal 320, voice collecting terminal 330. The service providing terminal 320 is a terminal for providing a corresponding service to a user, and may be a group of terminals or a single terminal.
In one embodiment, the user sends a voice command to obtain the corresponding service. After the voice collecting terminal 330 collects the user voice, the user voice is uploaded to the server 310. The server 310 performs semantic parsing on the received user voice, determines an implementation object and a target service type indicated by the user, and thus provides a corresponding service to the user through the service providing terminal 320.
From the above description of the system architecture, those skilled in the art can easily understand that the system architecture described herein can implement the functions of the respective modules in the semantic parsing apparatus shown in fig. 7.
In an exemplary embodiment of the present disclosure, an electronic device capable of implementing the above method is also provided.
As will be appreciated by one skilled in the art, aspects of the present invention may be embodied as a system, method or program product. Thus, various aspects of the invention may be embodied in the form of: an entirely hardware embodiment, an entirely software embodiment (including firmware, microcode, etc.) or an embodiment combining hardware and software aspects that may all generally be referred to herein as a "circuit," module "or" system.
An electronic device 400 according to this embodiment of the invention is described below with reference to fig. 9. The electronic device 400 shown in fig. 9 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 10, electronic device 400 is embodied in the form of a general purpose computing device. The components of electronic device 400 may include, but are not limited to: the at least one processing unit 410, the at least one memory unit 420, and a bus 430 that couples various system components including the memory unit 420 and the processing unit 410.
Wherein the storage unit stores program code that is executable by the processing unit 410 to cause the processing unit 410 to perform steps according to various exemplary embodiments of the present invention as described in the above section "exemplary methods" of the present specification. For example, the processing unit 410 may perform step S110 as shown in fig. 1: acquiring the voice of a user; step S120: performing text conversion on the user voice to obtain a corresponding text; step S130: performing word segmentation on the text to obtain a corresponding word segmentation result; step S140: determining nouns and verbs in the word segmentation result, and determining initial semantics of the user based on the nouns and verbs in the word segmentation result; step S150: determining whether a query language word exists in the word segmentation result, and determining the language category to which the user voice belongs based on whether the query language word exists in the word segmentation result; step S160: and determining the target semantics of the user based on the initial semantics and the mood category.
The storage unit 420 may include readable media in the form of volatile storage units, such as a random access memory unit (RAM)4201 and/or a cache memory unit 4202, and may further include a read only memory unit (ROM) 4203.
The storage unit 420 may also include a program/utility 4204 having a set (at least one) of program modules 4205, such program modules 4205 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may comprise an implementation of a network environment.
Bus 430 may be any bus representing one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
The electronic device 400 may also communicate with one or more external devices 500 (e.g., keyboard, pointing device, bluetooth device, etc.), with one or more devices that enable a user to interact with the electronic device 400, and/or with any devices (e.g., router, modem, etc.) that enable the electronic device 400 to communicate with one or more other computing devices. Such communication may occur via input/output (I/O) interfaces 450. Also, the electronic device 400 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the internet) via the network adapter 460. As shown, the network adapter 460 communicates with the other modules of the electronic device 400 over the bus 430. It should be appreciated that although not shown in the figures, other hardware and/or software modules may be used in conjunction with electronic device 400, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which may be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the embodiments of the present disclosure.
In an exemplary embodiment of the present disclosure, there is also provided a computer-readable storage medium having stored thereon a program product capable of implementing the above-described method of the present specification. In some possible embodiments, aspects of the invention may also be implemented in the form of a program product comprising program code means for causing a terminal device to carry out the steps according to various exemplary embodiments of the invention described in the above section "exemplary methods" of the present description, when said program product is run on the terminal device.
Referring to fig. 10, a program product 600 for implementing the above method according to an embodiment of the present invention is described, which may employ a portable compact disc read only memory (CD-ROM) and include program code, and may be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited in this regard and, in the present document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
A computer readable signal medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable signal medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., through the internet using an internet service provider).
Furthermore, the above-described figures are merely schematic illustrations of processes involved in methods according to exemplary embodiments of the invention, and are not intended to be limiting. It will be readily understood that the processes shown in the above figures are not intended to indicate or limit the chronological order of the processes. In addition, it is also readily understood that these processes may be performed synchronously or asynchronously, e.g., in multiple modules.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.

Claims (9)

1. A method of semantic parsing, the method comprising:
acquiring the voice of a user;
performing text conversion on the user voice to obtain a corresponding text;
performing word segmentation on the text to obtain a corresponding word segmentation result;
determining nouns and verbs in the word segmentation result, and determining initial semantics of the user based on the nouns and verbs in the word segmentation result;
determining whether a query language word exists in the word segmentation result, and determining the language category to which the user voice belongs based on whether the query language word exists in the word segmentation result;
and determining the target semantics of the user based on the initial semantics and the mood category.
2. The method of claim 1, wherein determining nouns and verbs in the segmentation result and determining the initial semantics of the user based on the nouns and verbs in the segmentation result comprises:
determining nouns in the word segmentation result based on the part-of-speech judgment of each word in the word segmentation result;
determining verbs in the word segmentation result based on the part-of-speech judgment of each word in the word segmentation result;
based on the noun and the verb, an initial semantic of the user is determined.
3. The method of claim 2, wherein determining an initial semantic of a user based on the noun and the verb comprises:
determining an entity corresponding to the noun as a user-indicated implementation object;
determining the action corresponding to the verb as the initial service type indicated by the user;
and determining the implementation object and the initial service type as the initial semantics of the user.
4. The method according to claim 1, wherein the determining whether the query linguistic words exist in the segmentation result and the determining the linguistic category to which the user voice belongs based on whether the query linguistic words exist in the segmentation result comprise:
matching the word segmentation result with a preset query language word set to determine whether query language words exist in the word segmentation result;
if the word segmentation result has the query language words, determining the user voice as a query sentence;
and if no query language qi word exists in the word segmentation result, determining the user voice as a non-query sentence.
5. The method of claim 3, wherein determining the target semantics of the user based on the initial semantics and the mood class comprises:
determining a target service type indicated by a user based on the initial service type and the mood category to which the user belongs;
and determining the implementation object and the target service type as the target semantics of the user.
6. The method of claim 5, wherein determining a target service type indicated by a user based on the initial service type and the mood category comprises:
if the user statement is an interrogative statement, determining the query service as the target service type;
and if the user statement is a non-question statement, determining the initial service type as the target service type.
7. A semantic analysis device, comprising;
the first acquisition module is used for acquiring the voice of a user;
the second acquisition module is used for performing text conversion on the user voice to acquire a corresponding text;
the third acquisition module is used for segmenting the text to acquire a corresponding segmentation result;
the first determining module is used for determining nouns and verbs in the word segmentation result and determining the initial semantics of the user based on the nouns and verbs in the word segmentation result;
the second determining module is used for determining whether the query language words exist in the word segmentation result and determining the language category to which the user voice belongs based on whether the query language words exist in the word segmentation result;
and the third determining module is used for determining the target semantic of the user based on the initial semantic and the mood category.
8. A semantic parsing electronic device, comprising:
a memory configured to store executable instructions;
a processor configured to execute executable instructions stored in the memory to implement the method of any of claims 1-6.
9. A computer-readable storage medium, characterized in that it stores computer program instructions which, when executed by a computer, cause the computer to perform the method according to any one of claims 1-6.
CN201910877053.4A 2019-09-17 2019-09-17 Semantic analysis method and device, electronic equipment and storage medium Pending CN110688858A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201910877053.4A CN110688858A (en) 2019-09-17 2019-09-17 Semantic analysis method and device, electronic equipment and storage medium
PCT/CN2019/118017 WO2021051584A1 (en) 2019-09-17 2019-11-13 Semantic parsing method and apparatus, electronic device, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910877053.4A CN110688858A (en) 2019-09-17 2019-09-17 Semantic analysis method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN110688858A true CN110688858A (en) 2020-01-14

Family

ID=69109362

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910877053.4A Pending CN110688858A (en) 2019-09-17 2019-09-17 Semantic analysis method and device, electronic equipment and storage medium

Country Status (2)

Country Link
CN (1) CN110688858A (en)
WO (1) WO2021051584A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112494013A (en) * 2020-12-15 2021-03-16 深圳麦科田生物医疗技术股份有限公司 Health management device, method, electronic device, and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102117283A (en) * 2009-12-30 2011-07-06 安世亚太科技(北京)有限公司 Semantic indexing-based data retrieval method
CN103425640A (en) * 2012-05-14 2013-12-04 华为技术有限公司 Multimedia questioning-answering system and method
US20130325442A1 (en) * 2010-09-24 2013-12-05 National University Of Singapore Methods and Systems for Automated Text Correction
CN106933807A (en) * 2017-03-20 2017-07-07 北京光年无限科技有限公司 Memorandum event-prompting method and system
CN107679042A (en) * 2017-11-15 2018-02-09 北京灵伴即时智能科技有限公司 A kind of multi-layer dialog analysis method towards Intelligent voice dialog system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150142444A1 (en) * 2013-11-15 2015-05-21 International Business Machines Corporation Audio rendering order for text sources

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102117283A (en) * 2009-12-30 2011-07-06 安世亚太科技(北京)有限公司 Semantic indexing-based data retrieval method
US20130325442A1 (en) * 2010-09-24 2013-12-05 National University Of Singapore Methods and Systems for Automated Text Correction
CN103425640A (en) * 2012-05-14 2013-12-04 华为技术有限公司 Multimedia questioning-answering system and method
CN106933807A (en) * 2017-03-20 2017-07-07 北京光年无限科技有限公司 Memorandum event-prompting method and system
CN107679042A (en) * 2017-11-15 2018-02-09 北京灵伴即时智能科技有限公司 A kind of multi-layer dialog analysis method towards Intelligent voice dialog system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112494013A (en) * 2020-12-15 2021-03-16 深圳麦科田生物医疗技术股份有限公司 Health management device, method, electronic device, and storage medium

Also Published As

Publication number Publication date
WO2021051584A1 (en) 2021-03-25

Similar Documents

Publication Publication Date Title
KR102117574B1 (en) Dialog system with self-learning natural language understanding
CN106897439B (en) Text emotion recognition method, device, server and storage medium
US11688391B2 (en) Mandarin and dialect mixed modeling and speech recognition
US20140316764A1 (en) Clarifying natural language input using targeted questions
US20190164540A1 (en) Voice recognition system and voice recognition method for analyzing command having multiple intents
CN110415679B (en) Voice error correction method, device, equipment and storage medium
CN109754809A (en) Audio recognition method, device, electronic equipment and storage medium
US20150199340A1 (en) System for translating a language based on user's reaction and method thereof
JP7213943B2 (en) Audio processing method, device, device and storage medium for in-vehicle equipment
CN111177186B (en) Single sentence intention recognition method, device and system based on question retrieval
EP3620994A1 (en) Methods, apparatuses, devices, and computer-readable storage media for determining category of entity
CN111798833A (en) Voice test method, device, equipment and storage medium
US20180226068A1 (en) Detection mechanism for automated dialog systems
CN116235245A (en) Improving speech recognition transcription
CN112466289A (en) Voice instruction recognition method and device, voice equipment and storage medium
CN112100339A (en) User intention recognition method and device for intelligent voice robot and electronic equipment
CN110503956B (en) Voice recognition method, device, medium and electronic equipment
CN111400463B (en) Dialogue response method, device, equipment and medium
CN110688858A (en) Semantic analysis method and device, electronic equipment and storage medium
CN113051895A (en) Method, apparatus, electronic device, medium, and program product for speech recognition
CN110705308A (en) Method and device for recognizing field of voice information, storage medium and electronic equipment
CN113782005B (en) Speech recognition method and device, storage medium and electronic equipment
WO2021051565A1 (en) Machine learning-based semantic parsing method and apparatus, electronic device, and computer non-volatile readable storage medium
CN114297229A (en) Data query method and device, electronic equipment and storage medium
CN114283810A (en) Improving speech recognition transcription

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