WO2021051584A1 - 语义解析方法、装置、电子设备及存储介质 - Google Patents

语义解析方法、装置、电子设备及存储介质 Download PDF

Info

Publication number
WO2021051584A1
WO2021051584A1 PCT/CN2019/118017 CN2019118017W WO2021051584A1 WO 2021051584 A1 WO2021051584 A1 WO 2021051584A1 CN 2019118017 W CN2019118017 W CN 2019118017W WO 2021051584 A1 WO2021051584 A1 WO 2021051584A1
Authority
WO
WIPO (PCT)
Prior art keywords
user
word segmentation
segmentation result
initial
service type
Prior art date
Application number
PCT/CN2019/118017
Other languages
English (en)
French (fr)
Inventor
欧阳碧云
石志娟
Original Assignee
平安科技(深圳)有限公司
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 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2021051584A1 publication Critical patent/WO2021051584A1/zh

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

Definitions

  • the present invention relates to the field of semantic analysis, in particular to a semantic analysis method, device, electronic equipment and storage medium.
  • the present disclosure provides a semantic analysis method, device, electronic device, and storage medium.
  • a semantic analysis method which includes: obtaining a user's voice; performing text conversion on the user's voice to obtain a corresponding text; performing word segmentation on the text to obtain a corresponding word segmentation result; Determine the nouns and verbs in the word segmentation results, and determine the user's initial semantics based on the nouns and verbs in the word segmentation results; determine whether there are interrogative modal particles in the segmentation results, and determine the user's voice based on whether there are interrogative modal particles in the word segmentation results Tone category; based on the initial semantics and the corresponding tone category, determine the user's target semantics.
  • a semantic analysis device including: a first acquirer configured to acquire a user's voice; a second acquirer configured to perform a text conversion on the user's voice to acquire the corresponding text
  • the third obtainer is configured to segment the text to obtain the corresponding word segmentation results;
  • the first determiner is configured to determine the nouns and verbs in the word segmentation results, and based on the nouns and verbs in the word segmentation results, determine the user’s Initial semantics;
  • the second determiner configured to determine whether there are interrogative modal particles in the word segmentation result, and based on whether there are interrogative modal particles in the word segmentation result, determine the tone category of the user's voice;
  • the third determiner is configured to be based on the The initial semantics and the corresponding tone category determine the user's target semantics.
  • a semantic parsing electronic device which includes: a memory configured to store executable instructions; a processor configured to execute the executable instructions stored in the memory to execute the foregoing Methods.
  • a computer-readable storage medium which stores computer instructions, and when the computer instructions are executed by a computer, the computer executes the method described above.
  • Fig. 1 shows a flowchart of semantic parsing according to an exemplary embodiment of the present disclosure.
  • FIG. 2 shows a flowchart of determining nouns and verbs in a word segmentation result according to an exemplary embodiment of the present disclosure, and determining the initial semantics of the user sentence based on the nouns and verbs in the word segmentation result.
  • Fig. 3 shows a flowchart of determining the initial semantics of the user sentence based on the noun and the verb according to an exemplary embodiment of the present disclosure.
  • Fig. 4 shows a flow chart of determining whether a question modal particle exists in a word segmentation result according to an exemplary embodiment of the present disclosure, and determining the modal category of the user sentence based on whether there is a question modal particle in the word segmentation result.
  • Fig. 5 shows a flowchart of determining the target semantics of the user sentence based on the initial semantics and the belonging tone category according to an exemplary embodiment of the present disclosure.
  • Fig. 6 shows a flowchart of determining the target service type in the target semantics of the user sentence based on the initial service type and the belonging tone category according to an exemplary embodiment of the present disclosure.
  • Fig. 7A shows a block diagram of a semantic parsing apparatus according to an exemplary embodiment of the present disclosure.
  • Fig. 7B shows a block diagram of a semantic parsing apparatus according to an exemplary embodiment of the present disclosure.
  • Fig. 9 shows a diagram of an electronic device for semantic analysis according to an exemplary embodiment of the present disclosure.
  • FIG. 10 shows a diagram of a computer-readable storage medium for semantic analysis according to an exemplary embodiment of the present disclosure.
  • the initial semantics is determined according to the nouns and verbs in the word segmentation result; then, the tone of the user's voice is judged according to whether there are interrogative modal particles in the word segmentation result. Combining the initial semantics to determine the target semantics, the semantic analysis is completed, and the accuracy of the semantic analysis is improved.
  • Fig. 1 shows a flowchart of semantic parsing according to an exemplary embodiment of the present disclosure:
  • Step S110 Obtain the user voice corresponding to the user sentence
  • Step S130 perform word segmentation on the text to obtain a corresponding word segmentation result
  • Step S140 Determine the nouns and verbs in the word segmentation result, and determine the user's initial semantics based on the nouns and verbs in the word segmentation result;
  • Step S150 Determine whether there are interrogative modal particles in the word segmentation result, and determine whether the user's voice belongs to the modal category based on whether there are interrogative modal particles in the word segmentation result;
  • Step S160 Determine the user's target semantics based on the initial semantics and the belonging tone category.
  • semantic analysis is performed, and the user's voice is first obtained, and the user's voice is converted into text.
  • the text is segmented, and the nouns and verbs in the segmentation result are determined, so as to determine the user's initial semantics.
  • the user's target semantics is determined according to the user's initial semantics and the tone category to which they belong.
  • the user's initial semantics refers to the implementation object indicated by the user and the initial service type indicated by the user.
  • the initial service type refers to the service type indicated by the user initially determined without considering the tone category of the user's voice.
  • the user's target semantics refers to the implementation object indicated by the user and the target service type indicated by the user.
  • the target service type refers to the service type actually indicated by the final user.
  • the content of the user's voice is "Is the window closed?"
  • the user is requesting the service to query whether the window is closed, that is, the user's target semantics are: implementation object-window, target service type-query service.
  • step S110 the user's voice is acquired.
  • the server serves as the center of the Internet of Things system and provides users with corresponding services according to the user's voice instructions. For example, in a smart vehicle system, the user can issue a voice command to the smart vehicle system. After receiving the user's voice instruction, the server as the center of the intelligent vehicle system analyzes the user's voice, analyzes the user's target semantics, and then provides the user with corresponding services.
  • the server obtains the user's voice through a voice collection terminal in the Internet of Things.
  • a voice collection terminal in the Internet of Things.
  • a microphone is provided at a fixed position inside the vehicle, where the microphone is the voice collection terminal.
  • the microphone collects the user's voice and uploads the user's voice to the server.
  • step S120 text conversion is performed on the user voice to obtain the corresponding text.
  • the user's voice is input into an existing voice-to-text component (for example, a JAVA-based voice-to-text component) to obtain the text corresponding to the user's voice.
  • an existing voice-to-text component for example, a JAVA-based voice-to-text component
  • the advantage of this embodiment is that the server processes the text more directly and efficiently, converts speech into text, and improves the efficiency of semantic analysis.
  • step S130 word segmentation is performed on the text, and a corresponding word segmentation result is obtained.
  • the text is segmented based on jieba in python, and the corresponding segmentation result is obtained.
  • jieba is a word segmentation library in python, which supports Chinese word segmentation and can make part-of-speech judgments on the separated words.
  • the word segmentation result is: (‘put’, preposition)(‘window’, noun)(‘open’, verb).
  • step S140 the nouns and verbs in the word segmentation result are determined, and the initial semantics of the user is determined based on the nouns and verbs in the word segmentation result.
  • the initial semantics of the user must first be determined, that is, the implementation object indicated by the user and the indicated initial service type are determined. Since the entity of the implementer of the action is already the server by default; therefore, it is necessary to determine the entity of the implementer of the action and the initial service type indicated by the user, that is, the action involved in the user's voice. Since entities exist in the text in the form of nouns, and actions exist in the text in the form of verbs, the initial semantics of the user is determined based on the nouns and verbs in the word segmentation result.
  • step S140 includes:
  • Step S1401 Determine the noun in the word segmentation result based on the part-of-speech judgment of each word in the word segmentation result;
  • Step S1402 Determine the verb in the word segmentation result based on the part-of-speech judgment of each word in the word segmentation result;
  • Step S1403 Determine the initial semantics of the user based on the noun and the verb.
  • the nouns and verbs in the word segmentation result are determined based on the part-of-speech judgment of each word in advance based on the word segmentation model.
  • the user's initial semantics is determined.
  • step S1403 includes:
  • Step S14032 Determine the action corresponding to the verb as the initial service type indicated by the user;
  • Step S14033 Determine the implementation object and the initial service type as the user's initial semantics.
  • the entity corresponding to the noun in the voice instruction may be determined as the implementation object indicated by the user, and the action corresponding to the verb in the voice instruction may be determined as the initial service type indicated by the user.
  • the implementation object is determined as the window, and the initial service type is determined as the open service.
  • the advantage of this embodiment is that based on nouns and verbs, the user's initial semantics can be quickly determined.
  • the reason why it is determined whether the user's voice is an interrogative sentence is because the target semantics expressed in the interrogative sentence and the non-interrogative sentence are quite different for the same set of entities and actions.
  • step S150 includes:
  • Step S1501 Match the word segmentation result with a preset set of interrogative modal particles, and determine whether there are interrogative modal particles in the word segmentation result;
  • Step S1502 If there are interrogative particles in the word segmentation result, determine the user's voice as an interrogative sentence;
  • Step S1503 If there is no interrogative particle in the word segmentation result, determine the user's voice as a non-interrogative sentence.
  • a set of interrogative modal particles is preset, and each interrogative modal particle is stored in the interrogative modal particle set. Compare each word in the segmentation result with each interrogative modal particle in the interrogative modal particle set, so as to determine whether there is an interrogative modal particle in the segmentation result. If there are interrogative particles in the word segmentation result, the corresponding user voice is determined as an interrogative sentence; if there are no interrogative particles in the word segmentation result, the corresponding user voice is determined as a non-interrogative sentence.
  • the preset set of interrogative particles are: ‘?’, ‘is it’, ‘has it’, ‘how’, and ‘is it’.
  • the word segmentation result is: ('ba', preposition) ('window', noun) ('open', verb); through matching with the interrogative modal particle set, it is determined that there is no question in the word segmentation result Modal particle, then "open the window" is determined as a non-interrogative sentence.
  • the preset interrogative modal particle set includes not only words that are consistent with the modal particle identified by the word segmentation model, such as "?" and “ ⁇ ”; it can also include phrases that express questions, such as: “Is it right?" “Is it right?” In other words, the interrogative particles contained in the interrogative particle set are not fully summarized by the modal particles recognized by the word segmentation model.
  • the advantage of this embodiment is that it can quickly determine whether the user's voice is an interrogative sentence by matching with a preset interrogative particle set.
  • step S160 the target semantics of the user is determined based on the initial semantics and the belonging tone category.
  • the initial semantics determines the implementation target 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 of the user's voice, so as to determine the user's target semantics.
  • Step S1601 Determine the target service type indicated by the user based on the initial service type and the tone category to which it belongs;
  • Step S1602 Determine the implementation object and the target service type as the user's target semantics.
  • the target service type indicated by the user is determined based on the initial service type determined in the initial semantics and the tone category of the user's voice, so as to determine the user's target semantics in combination with the implementation object determined in the initial semantics.
  • step S1601 includes:
  • Step S16011 If the user sentence is a question sentence, determine the query service as the target service type;
  • Step S16012 If the user sentence is a non-questioning sentence, determine the initial service type as the target service type.
  • the user's voice is a question, it expresses a query of objective facts, so the query service is determined as the target service type; if the user's voice is a non-question, it expresses a service request corresponding to the action, that is, with The service request corresponding to the initial service type, so the initial service type is determined as the target service type.
  • the server of the intelligent vehicle system can respond by opening the windows of the vehicle.
  • the server of the intelligent vehicle system can respond by querying the current state of the vehicle window and returning the current state to the user.
  • the semantic analysis device includes: a first acquirer 210 configured to acquire a user's voice; a second acquirer 220 configured to perform a text conversion on the user's voice, Obtain the corresponding text; the third obtainer 230 is configured to segment the text to obtain the corresponding word segmentation result; the first determiner 240 is configured to determine the nouns and verbs in the word segmentation result, and based on the nouns in the word segmentation result And the verb to determine the user’s initial semantics; the second determiner 250 is configured to determine whether there are interrogative modal particles in the word segmentation result, and based on whether there are interrogative modal particles in the word segmentation result, determine the tone category of the user’s voice; third determination The device 260 is configured to determine the user's target semantics based on the initial semantics and the belonging tone category.
  • the first determiner 240 includes: a noun determiner 2401, configured to determine the noun in the word segmentation result based on the part-of-speech judgment of each word in the word segmentation result; verb determination The device 2402 is configured to determine the verb in the word segmentation result based on the part-of-speech judgment of each word in the word segmentation result; the initial semantic determiner 2403 is configured to determine the user's initial semantics based on the noun and the verb.
  • the initial semantic determiner 2403 includes: an implementation object determiner 24031, configured to determine the entity corresponding to the noun as the implementation object indicated by the user; and the initial service type
  • the determiner 24032 is configured to determine the action corresponding to the verb as the initial service type indicated by the user; the combiner 24033 is configured to determine the implementation object and the initial service type as the user's initial semantics.
  • the second determiner 250 includes: an interrogative modal particle determiner 2501, configured to match the word segmentation result with a preset interrogative modal particle set, and determine whether the word segmentation result is Whether there are interrogative modal particles; the interrogative sentence discriminator 2502 is configured to determine the user’s voice as an interrogative sentence if there are interrogative modal particles in the word segmentation result; the interrogative sentence discriminator 2502 is configured to determine if there is no interrogative modal particle in the word segmentation result, The user’s voice is determined as a non-questioning sentence.
  • the third determiner 260 includes: a target service type determiner 2601, configured to determine what the user indicates based on the initial service type and the belonging tone category Target service type; the target semantic determiner 2602 is configured to determine the implementation object and the target service type as the user's target semantics.
  • the target service type determiner is configured to: if the user sentence is a question sentence, determine the query service as the target service type; if the user sentence is a non-question sentence, the initial The service type is determined as the target service type.
  • the example embodiments described here can be implemented by software, or can be implemented by combining software with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, U disk, mobile hard disk, etc.) or on the network , Including several instructions to make a computing device (which can be a personal computer, server, mobile terminal, or network device, etc.) execute the method according to the embodiment of the present disclosure.
  • a non-volatile storage medium which can be a CD-ROM, U disk, mobile hard disk, etc.
  • Including several instructions to make a computing device which can be a personal computer, server, mobile terminal, or network device, etc.
  • Fig. 8 shows a system architecture diagram of semantic parsing according to an exemplary embodiment of the present disclosure.
  • the system architecture includes: a server 310, a service providing terminal 320, and a voice collection terminal 330.
  • the service providing terminal 320 refers to a terminal used to provide corresponding services to users, and may be a group of terminals or a single terminal.
  • the user sends a voice command to obtain the corresponding service.
  • the voice collection terminal 330 collects the user's voice, it uploads the user's voice to the server 310.
  • the server 310 performs semantic analysis on the received user voice, determines the implementation object and the target service type indicated by the user, and provides corresponding services to the user through the service providing terminal 320.
  • an electronic device capable of implementing the above method is also provided.
  • the electronic device 400 according to this embodiment of the present invention will be 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 function and application scope of the embodiment of the present invention.
  • the electronic device 400 is represented in the form of a general-purpose computing device.
  • the components of the electronic device 400 may include, but are not limited to: the aforementioned at least one processing unit 410, the aforementioned at least one storage unit 420, and a bus 430 connecting different system components (including the storage unit 420 and the processing unit 410).
  • the storage unit stores program code, and the program code can be executed by the processing unit 410, so that the processing unit 410 executes the various exemplary methods described in the "Exemplary Method" section of this specification. Steps of implementation.
  • the processing unit 410 may perform step S110 as shown in FIG.
  • Step S120 obtain the user’s voice
  • step S120 perform text conversion on the user’s voice to obtain the corresponding text
  • step S130 perform word segmentation on the text, Obtain the corresponding word segmentation results
  • Step S140 Determine the nouns and verbs in the word segmentation results, and determine the user's initial semantics based on the nouns and verbs in the word segmentation results
  • Step S150 Determine whether there are interrogative modal particles in the word segmentation results, and based on the word segmentation Whether there are interrogative modal particles in the result, determine the tone category of the user's voice
  • step S160 determine the target semantics of the user based on the initial semantics and the tone category to which they belong.
  • the storage unit 420 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 4201 and/or a cache storage unit 4202, and may further include a read-only storage unit (ROM) 4203.
  • RAM random access storage unit
  • ROM read-only storage unit
  • the storage unit 420 may also include a program/utility tool 4204 having a set (at least one) program module 4205.
  • program module 4205 includes but is not limited to: an operating system, one or more application programs, other program modules, and program data, Each of these examples or some combination may include the implementation of a network environment.
  • the bus 430 may represent one or more of several types of bus structures, including a storage unit bus or a storage unit controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local area using any bus structure among multiple bus structures. bus.
  • the electronic device 400 can also communicate with one or more external devices 500 (such as keyboards, pointing devices, Bluetooth devices, etc.), and can also communicate with one or more devices that enable a user to interact with the electronic device 400, and/or communicate with Any device (such as a router, modem, etc.) that enables the electronic device 400 to communicate with one or more other computing devices. This communication can be performed through an input/output (I/O) interface 450.
  • the electronic device 400 may also communicate with one or more networks (such as a local area network (LAN), a wide area network (WAN), and/or a public network, such as the Internet) through the network adapter 460. As shown in the figure, the network adapter 460 communicates with other modules of the electronic device 400 through the bus 430.
  • LAN local area network
  • WAN wide area network
  • public network such as the Internet
  • the example embodiments described here can be implemented by software, or can be implemented by combining software with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, U disk, mobile hard disk, etc.) or on the network , Including several instructions to make a computing device (which may be a personal computer, a server, a terminal device, or a network device, etc.) execute the method according to the embodiments of the present disclosure.
  • a computing device which may be a personal computer, a server, a terminal device, or a network device, etc.
  • a computer-readable storage medium on which is stored a program product capable of implementing the above-mentioned method in this specification.
  • various aspects of the present invention may also be implemented in the form of a program product, which includes program code.
  • the program product runs on a terminal device, the program code is used to make the The terminal device executes the steps according to various exemplary embodiments of the present invention described in the above-mentioned "Exemplary Method" section of this specification.
  • a program product 600 for implementing the above method according to an embodiment of the present invention is described. It can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be installed in a terminal device, For example, running on a personal computer.
  • the program product of the present invention is not limited to this.
  • the readable storage medium can be any tangible medium that contains or stores a program, and the program can be used by or combined with an instruction execution system, device, or device.
  • the program product can use any combination of one or more readable media.
  • the readable medium may be a readable signal medium or a readable storage medium.
  • the readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or a combination of any of the above. More specific examples (non-exhaustive list) of readable storage media include: electrical connections with one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable Type programmable read only memory (EPROM or flash memory), optical fiber, portable compact disk read only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above.
  • the computer-readable signal medium may include a data signal propagated in baseband or as a part of a carrier wave, and readable program code is carried therein. This propagated data signal can take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing.
  • the readable signal medium may also be any readable medium other than a readable storage medium, and the readable medium may send, propagate, or transmit a program for use by or in combination with the instruction execution system, apparatus, or device.
  • the program code contained on the readable medium can be transmitted by any suitable medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the above.
  • the program code used to perform the operations of the present invention can be written in any combination of one or more programming languages.
  • the programming languages include object-oriented programming languages-such as Java, C++, etc., as well as conventional procedural programming languages. Programming language-such as "C" language or similar programming language.
  • the program code can be executed entirely on the user's computing device, partly on the user's device, executed as an independent software package, partly on the user's computing device and partly executed on the remote computing device, or entirely on the remote computing device or server Executed on.
  • the remote computing device can be connected to a user computing device through any kind of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (for example, using Internet service providers). Business to connect via the Internet).
  • LAN local area network
  • WAN wide area network
  • Internet service providers for example, using Internet service providers.

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)

Abstract

本申请公开了一种语义解析方法、装置、电子设备及存储介质,涉及语义解析领域,所述方法包括:获取用户的语音;对所述用户语音进行文本转换,获取对应的文本;对所述文本进行分词,获取对应的分词结果;确定分词结果中的名词与动词,并基于分词结果中的名词与动词,确定用户的初始语义;确定分词结果中是否存在疑问语气词,并基于分词结果中是否存在疑问语气词,确定所述用户语音所属语气类别;基于所述初始语义及所述所属语气类别,确定用户的目标语义。本公开实施例的技术方案提高了语义解析的精准度。

Description

语义解析方法、装置、电子设备及存储介质 技术领域
本申请基于并要求2019年09月17日递交、发明名称为“语义解析方法、装置、电子设备及存储介质”的中国专利申请CN201910877053.4的优先权,在此通过引用将其全部内容合并于此。
本发明涉及语义解析领域,具体而言,涉及一种语义解析方法、装置、电子设备及存储介质。
背景技术
在物联网系统的使用中,例如,在智能车辆系统的使用中,常常需要对用户发送的语音指令进行解析,确定语义,进而为用户提供相应的服务。现有的语义解析中,通常采用正则表达式的方式,将各词进行匹配,从而确定用户的语义。本申请的发明人意识到,实际生活中,由于用户表达方式的多样性,单单以正则表达式匹配的方法进行语义解析,有时会出现语义解析错误的出现,从而导致语义解析的精准度较低。
发明概述
技术问题
问题的解决方案
技术解决方案
基于此,为解决相关技术中如何从技术层面上更加精准的对用户语音进行语义解析所面临的技术问题,本公开提供了一种语义解析方法、装置、电子设备及存储介质。
根据本公开的第一方面,提供了一种语义解析方法,包括:获取用户的语音;对所述用户语音进行文本转换,获取对应的文本;对所述文本进行分词,获取对应的分词结果;确定分词结果中的名词与动词,并基于分词结果中的名词与动词,确定用户的初始语义;确定分词结果中是否存在疑问语气词,并基于分词结果中是否存在疑问语气词,确定用户语音所属语气类别;基于所述初始语 义及所述所属语气类别,确定用户的目标语义。
根据本公开的第二方面,提供了一种语义解析装置,包括:第一获取器,配置为获取用户的语音;第二获取器,配置为对所述用户语音进行文本转换,获取对应的文本;第三获取器,配置为对所述文本进行分词,获取对应的分词结果;第一确定器,配置为确定分词结果中的名词与动词,并基于分词结果中的名词与动词,确定用户的初始语义;第二确定器,配置为确定分词结果中是否存在疑问语气词,并基于分词结果中是否存在疑问语气词,确定所述用户语音所属语气类别;第三确定器,配置为基于所述初始语义及所述所属语气类别,确定用户的目标语义。
根据本公开的第三方面,提供了一种语义解析的电子设备,其中,包括:存储器,配置为存储可执行指令;处理器,配置为执行存储器中存储的可执行指令,以执行以上所述的方法。
根据本公开的第四方面,提供了一种计算机可读存储介质,其存储有计算机指令,当所述计算机指令被计算机执行时,使计算机执行以上所述的方法。
本公开的实施例进行语义解析时,先根据分词结果中的名词与动词,确定初始语义;再根据分词结果中是否存在疑问语气词,判断用户语音所属语气。结合初始语义,确定目标语义,从而完成语义解析,提高了语义解析的精准度。
本公开的其他特性和优点将通过下面的详细描述变得显然,或部分地通过本公开的实践而习得。
应当理解的是,以上的一般描述和后文的细节描述仅是示例性的,并不能限制本公开。
发明的有益效果
对附图的简要说明
附图说明
图1示出根据本公开一示例实施方式的语义解析的流程图。
图2示出根据本公开一示例实施方式的确定分词结果中的名词与动词,并基于分词结果中的名词与动词,确定所述用户语句的初始语义的流程图。
图3示出根据本公开一示例实施方式的基于所述名词与所述动词,确定所述用 户语句的初始语义的流程图。
图4示出根据本公开一示例实施方式的确定分词结果中是否存在疑问语气词,并基于分词结果中是否存在疑问语气词,确定所述用户语句所属语气类别的流程图。
图5示出根据本公开一示例实施方式的基于所述初始语义及所述所属语气类别,确定所述用户语句的目标语义的流程图。
图6示出根据本公开一示例实施方式的基于所述初始服务类型及所述所属语气类别,确定所述用户语句的目标语义中的目标服务类型的流程图。
图7A示出根据本公开一示例实施方式的语义解析装置的方框图。
图7B示出根据本公开一示例实施方式的语义解析装置的方框图。
图8示出根据本公开一示例实施方式的语义解析的系统架构图。
图9示出根据本公开一示例实施方式的语义解析的电子设备图。
图10示出根据本公开一示例实施方式的语义解析的计算机可读存储介质图。
发明实施例
本发明的实施方式
现在将参考附图更全面地描述示例实施方式。然而,示例实施方式能够以多种形式实施,且不应被理解为限于在此阐述的范例;相反,提供这些实施方式使得本公开将更加全面和完整,并将示例实施方式的构思全面地传达给本领域的技术人员。所描述的特征、结构或特性可以以任何合适的方式结合在一个或更多实施方式中。在下面的描述中,提供许多具体细节从而给出对本公开的实施方式的充分理解。然而,本领域技术人员将意识到,可以实践本公开的技术方案而省略所述特定细节中的一个或更多,或者可以采用其它的方法、组元、装置、步骤等。在其它情况下,不详细示出或描述公知技术方案以避免喧宾夺主而使得本公开的各方面变得模糊。
此外,附图仅为本公开的示意性图解,并非一定是按比例绘制。图中相同的附图标记表示相同或类似的部分,因而将省略对它们的重复描述。附图中所示的一些方框图是功能实体,不一定必须与物理或逻辑上独立的实体相对应。可以采用软件形式来实现这些功能实体,或在一个或多个硬件模块或集成电路中实 现这些功能实体,或在不同网络和/或处理器装置和/或微控制器装置中实现这些功能实体。
本公开的实施例进行语义解析时,先根据分词结果中的名词与动词,确定初始语义;再根据分词结果中是否存在疑问语气词,判断用户语音所属语气。结合初始语义,确定目标语义,从而完成语义解析,提高了语义解析的精准度。
图1示出根据本公开一示例实施方式的语义解析的流程图:
步骤S110:获取用户语句对应的用户语音;
步骤S120:对所述用户语音进行文本转换,获取对应的文本;
步骤S130:对所述文本进行分词,获取对应的分词结果;
步骤S140:确定分词结果中的名词与动词,并基于分词结果中的名词与动词,确定用户的初始语义;
步骤S150:确定分词结果中是否存在疑问语气词,并基于分词结果中是否存在疑问语气词,确定用户语音所属语气类别;
步骤S160:基于所述初始语义及所述所属语气类别,确定用户的目标语义。
本公开实施例中,进行语义解析,先获取用户的语音,将用户语音转换为文本。对文本进行分词,确定分词结果中的名词与动词,从而确定用户的初始语义。确定分词结果中是否有疑问语气词,从而确定用户语音所属语气类别。最终根据用户的初始语义与所属语气类别,确定用户的目标语义。
用户的初始语义是指用户所指示的实施对象以及用户所指示的初始服务类型。初始服务类型是指在不考虑用户语音所属语气类别的时候,初步确定的用户所指示的服务类型。
用户的目标语义是指用户所指示的实施对象以及用户所指示的目标服务类型。目标服务类型是指最终确定的用户实际所指示的服务类型。
例如,用户语音的内容为“窗户关上了吗”,用户是在请求查询窗户是否处于关闭状态这一服务,即,用户的目标语义为:实施对象——窗户,目标服务类型——查询服务。
而在这之前,不考虑用户语音所属语气类型,仅以其中的名词、动词为依据进行判断,确定出的用户的初始语义为:实施对象——窗户,初始服务类型—— 关闭服务。
下面对本公开各步骤的具体实施过程进行描述。
在步骤S110中,获取用户的语音。
在一实施例中,服务器作为物联网系统的中心,根据用户的语音指令,为用户提供相应的服务。例如,在智能车辆系统中,用户可以向智能车辆系统发出语音指令。作为智能车辆系统中心的服务器在接收到用户的语音指令后,对用户语音进行解析,解析出用户的目标语义,进而为用户提供相应的服务。
在一实施例中,服务器通过物联网中的语音采集终端,获取用户的语音。例如,智能车辆系统中,于车辆内部的固定位置设置有麦克风,其中,麦克风即为语音采集终端。当用户向智能车辆系统发送语音指令时,麦克风对用户的语音进行采集,将用户的语音上传至服务器中。
在步骤S120中,对所述用户语音进行文本转换,获取对应的文本。
接收到用户语音后,将其转换为文本,使得服务器能够在文本的基础上进行进一步的处理,以解析出用户的目标语义。
在一实施例中,将用户语音输入现有的语音转文本组件(例如,基于JAVA的语音转文本组件),得到该用户语音对应的文本。
该实施例的优点在于,服务器对文本的处理更为直接高效,将语音转换为文本,提高了语义解析的效率。
在步骤S130中,对所述文本进行分词,获取对应的分词结果。
本公开实施例中,基于预设的分词模型,对文本进行分词,获取对应的分词结果。其中,分词结果包括分离出的各词汇及各分离出的词汇对应的词性。
在一实施例中,基于python中的jieba,对文本进行分词,获取对应的分词结果。其中,jieba是python中的一个分词库,支持中文分词,并可对分离出的词汇作出词性判断。
例如,文本为“把窗户打开”,基于jieba对其进行分词后,得到的分词结果为:(‘把’,介词)(‘窗户’,名词)(‘打开’,动词)。
在步骤S140中,确定分词结果中的名词与动词,并基于分词结果中的名词与动词,确定用户的初始语义。
本公开实施例中,要解析用户的目标语义,首先要确定用户的初始语义,即确定出用户所指示的实施对象以及所指示的初始服务类型。由于动作的实施者这一实体已经默认为服务器;因此,需要确定动作的实施对象这一实体、以及用户所指示的初始服务类型,即,用户语音中所涉及的动作。由于实体以名词的形式存在于文本中,动作以动词的形式存在于文本中,因此基于分词结果中的名词与动词,确定用户的初始语义。
在一实施例中,如图2所示,步骤S140包括:
步骤S1401:基于对分词结果中各词的词性判断,确定分词结果中的名词;
步骤S1402:基于对分词结果中各词的词性判断,确定分词结果中的动词;
步骤S1403:基于所述名词与所述动词,确定用户的初始语义。
在一实施例中,获取用户语音的分词结果后,基于分词模型预先对各词的词性判断,确定分词结果中的名词、动词。从而基于分词结果中的名词、动词,确定用户的初始语义。
例如,得到的分词结果为:(‘把’,介词)(‘窗户’,名词)(‘打开’,动词)。从中确定出名词为‘窗户’,动词为‘打开’,从而确定用户的初始语义。
在一实施例中,如图3所示,步骤S1403包括:
步骤S14031:将所述名词对应的实体确定为用户所指示的实施对象;
步骤S14032:将所述动词对应的动作确定为用户所指示的初始服务类型;
步骤S14033:将所述实施对象及初始服务类型确定为用户的初始语义。
用户在对物联网系统下达语音指令时,通常会直接进行指示,不会参杂多余的信息。因此,该实施例中,可以将语音指令中名词对应的实体确定为用户所指示的实施对象,语音指令中动词对应的动作确定为用户所指示的初始服务类型。
例如,从用户语音的分词结果中,确定出名词为‘窗户’,动词为‘打开’。则将实施对象确定为窗户,初始服务类型确定为打开服务。
该实施例的优点在于,基于名词与动词,能够快速确定用户的初始语义。
在步骤S150中,确定分词结果中是否存在疑问语气词,并基于分词结果中是否存在疑问语气词,确定所述用户语音所属语气类别。
在对用户语音进行语义解析时,之所以要确定用户语音是否为疑问句,是因为同一组实体以及动作,在疑问句与非疑问句中所表达的目标语义大不相同。
例如,同样是“窗户”与“打开”这一组实体以及动作,在非疑问句“把窗户打开”中,用户所要表达的为:打开窗户。此时服务器应作出的响应为:打开窗户。
在疑问句“窗户打开了吗”中,用户所要表达的为:查询窗户是否处于打开的状态。在疑问句中,用户表达的是对客观事实的查询,并未要求改变实体的状态。此时服务器应作出的响应为:将窗户此时的状态报告给用户,而不对窗户的状态作出任何改变。
由此可见,对用户语音进行语义解析时,除了确定作为实施对象的实体、与作为初始服务类型的动作之外,还要确定用户语音是否为疑问句,从而确定初始服务类型是否为目标服务类型。
在一实施例中,如图4所示,步骤S150包括:
步骤S1501:将分词结果与预设的疑问语气词集合进行匹配,确定分词结果中是否存在疑问语气词;
步骤S1502:如果分词结果中存在疑问语气词,将所述用户语音确定为疑问句;
步骤S1503:如果分词结果中不存在疑问语气词,将所述用户语音确定为非疑问句。
在一实施例中,预设疑问语气词集合,疑问语气词集合中存储着各个疑问语气词。将分词结果中的各词与疑问语气词集合中的各疑问语气词进行比较,从而确定分词结果中是否存在疑问语气词。如果分词结果中存在疑问语气词,将对应的用户语音确定为疑问句;如果分词结果中不存在疑问语气词,将对应的用户语音确定为非疑问句。
例如,预设的疑问语气词集合为:‘吗’、‘是不是’、‘有没有’、‘怎么样’、‘是否’。对于“把窗户打开”,其分词结果为:(‘把’,介词)(‘窗户’,名词)(‘打开’,动词);通过与疑问语气词集合的匹配,确定分词结果中不存在疑问语气词,则将“把窗户打开”确定为非疑问句。对于“窗户打开了吗”,其分词结果为:(‘窗户’,名词)(‘打开’,动词)(‘了’,助词)(‘吗’语气词);通过与疑问 语气词集合的匹配,确定分词结果中存储疑问语气词,则将“窗户打开了吗”确定为疑问句。
其中,预设的疑问语气词集合中,包含的不仅仅有和分词模型识别出的语气词保持一致的词,例如:“吗”、“呢”;还可以包含有表示疑问的词组,例如:“是不是”、“是否”。也就是说,疑问语气词集合中包含的疑问语气词并不被分词模型识别出的语气词完全概括。
该实施例的优点在于,通过与预设疑问语气词集合的匹配,能够快速确定用户语音是否为疑问句。
步骤S160中,基于所述初始语义及所述所属语气类别,确定用户的目标语义。
初始语义确定了实施对象以及暂定的初始服务类型;服务器需要根据用户语音所属语气类别,来确定用户实际所指定的目标服务类型,从而确定用户的目标语义。
在一实施例中,如图5所示,步骤S160包括:
步骤S1601:基于所述初始服务类型及所述所属语气类别,确定用户所指示的目标服务类型;
步骤S1602:将所述实施对象及所述目标服务类型确定为用户的目标语义。
该实施例中,基于初始语义中确定的初始服务类型及用户语音所属语气类别,确定用户所指示的目标服务类型,从而结合初始语义中确定的实施对象,确定用户的目标语义。
在一实施例中,如图6所示,步骤S1601包括:
步骤S16011:如果所述用户语句为疑问句,将查询服务确定为所述目标服务类型;
步骤S16012:如果所述用户语句为非疑问句,将所述初始服务类型确定为所述目标服务类型。
由上述说明可知,用户语音如果是疑问句,表达的是对客观事实的查询,因此将查询服务确定为目标服务类型;用户语音如果是非疑问句,表达的是与动作相对应的服务请求,即,与初始服务类型相对应的服务请求,因此将初始服务类型确定为目标服务类型。
例如,智能车辆系统中,接收到用户语音“把窗户打开”,分词后确定名词为“窗户”,动词为“打开”,则将初始语义确定为:实施对象——窗户,初始服务类型——打开服务;确定其为非疑问句,将其初始服务类型确定为目标服务类型,则将目标语义确定为:实施对象——窗户,目标服务类型——打开服务。从而智能车辆系统的服务器能够作出响应——将车辆的窗户打开。
智能车辆系统中,接收到用户语音“窗户打开了吗”,分词后确定名词为“窗户”,动词为“打开”,则将初始语义确定为:实施对象——窗户,初始服务类型——打开服务;确定其为疑问句,将查询服务确定为目标服务类型,则将目标语义确定为:实施对象——窗户,目标服务类型——查询服务。从而智能车辆系统的服务器能够作出响应——查询车辆窗户的当前状态,并将当前状态返回给用中。
参照图7A所示,根据本公开的一个实施例的语义解析装置,包括:第一获取器210,配置为获取用户的语音;第二获取器220,配置为对所述用户语音进行文本转换,获取对应的文本;第三获取器230,配置为对所述文本进行分词,获取对应的分词结果;第一确定器240,配置为确定分词结果中的名词与动词,并基于分词结果中的名词与动词,确定用户的初始语义;第二确定器250,配置为确定分词结果中是否存在疑问语气词,并基于分词结果中是否存在疑问语气词,确定所述用户语音所属语气类别;第三确定器260,配置为基于所述初始语义及所述所属语气类别,确定用户的目标语义。
参照图7B所示,根据本公开的一个实施例,所述第一确定器240包括:名词确定器2401,配置为基于对分词结果中各词的词性判断,确定分词结果中的名词;动词确定器2402,配置为基于对分词结果中各词的词性判断,确定分词结果中的动词;初始语义确定器2403,配置为基于所述名词与所述动词,确定用户的初始语义。
参照图7B所示,根据本公开的一个实施例,所述初始语义确定器2403包括:实施对象确定器24031,配置为将所述名词对应的实体确定为用户所指示的实施对象;初始服务类型确定器24032,配置为将所述动词对应的动作确定为用户所指示的初始服务类型;组合器24033,配置为将所述实施对象及所述初始服务类型 确定为用户的初始语义。
参照图7B所示,根据本公开的一个实施例,所述第二确定器250包括:疑问语气词确定器2501,配置为将分词结果与预设的疑问语气词集合进行匹配,确定分词结果中是否存在疑问语气词;疑问句判别器2502,配置为如果分词结果中存在疑问语气词,将所述用户语音确定为疑问句;疑问句判别器2502,配置为如果分词结果中不存在疑问语气词,将所述用户语音确定为非疑问句。
参照图7B所示,根据本公开的一个实施例,所述第三确定器260包括:目标服务类型确定器2601,配置为基于所述初始服务类型及所述所属语气类别,确定用户所指示的目标服务类型;目标语义确定器2602,配置为将所述实施对象及所述目标服务类型确定为用户的目标语义。
根据本公开的一个实施例,所述目标服务类型确定器配置为:如果所述用户语句为疑问句,将查询服务确定为所述目标服务类型;如果所述用户语句为非疑问句,将所述初始服务类型确定为所述目标服务类型。
上述装置中各个模块的功能和作用的实现过程具体详见上述语义解析的方法中对应步骤的实现过程,在此不再赘述。
应当注意,尽管在上文详细描述中提及了用于动作执行的设备的若干模块或者单元,但是这种划分并非强制性的。实际上,根据本公开的实施方式,上文描述的两个或更多模块或者单元的特征和功能可以在一个模块或者单元中具体化。反之,上文描述的一个模块或者单元的特征和功能可以进一步划分为由多个模块或者单元来具体化。
此外,尽管在附图中以特定顺序描述了本公开中方法的各个步骤,但是,这并非要求或者暗示必须按照该特定顺序来执行这些步骤,或是必须执行全部所示的步骤才能实现期望的结果。附加的或备选的,可以省略某些步骤,将多个步骤合并为一个步骤执行,以及/或者将一个步骤分解为多个步骤执行等。
通过以上的实施方式的描述,本领域的技术人员易于理解,这里描述的示例实施方式可以通过软件实现,也可以通过软件结合必要的硬件的方式来实现。因此,根据本公开实施方式的技术方案可以以软件产品的形式体现出来,该软件产品可以存储在一个非易失性存储介质(可以是CD-ROM,U盘,移动硬盘等) 中或网络上,包括若干指令以使得一台计算设备(可以是个人计算机、服务器、移动终端、或者网络设备等)执行根据本公开实施方式的方法。
图8示出根据本公开一示例实施方式的语义解析的系统架构图。该系统架构包括:服务器310、服务提供终端320、语音采集终端330。其中,服务提供终端320是指用于向用户提供相应服务的终端,可以为一组终端,也可以为单一终端。
在一实施例中,用户发送语音指令,以获取相应的服务。语音采集终端330采集到用户语音后,将用户语音上传至服务器310。服务器310对接收到的用户语音进行语义解析,确定用户所指示的实施对象与目标服务类型,从而通过服务提供终端320为用户提供相应服务。
通过以上对系统架构的描述,本领域的技术人员易于理解,这里描述的系统架构能够实现图7所示的语义解析装置中各个模块的功能。
在本公开的示例性实施例中,还提供了一种能够实现上述方法的电子设备。
所属技术领域的技术人员能够理解,本发明的各个方面可以实现为系统、方法或程序产品。因此,本发明的各个方面可以具体实现为以下形式,即:完全的硬件实施方式、完全的软件实施方式(包括固件、微代码等),或硬件和软件方面结合的实施方式,这里可以统称为“电路”、“模块”或“系统”。
下面参照图9来描述根据本发明的这种实施方式的电子设备400。图9显示的电子设备400仅仅是一个示例,不应对本发明实施例的功能和使用范围带来任何限制。
如图10所示,电子设备400以通用计算设备的形式表现。电子设备400的组件可以包括但不限于:上述至少一个处理单元410、上述至少一个存储单元420、连接不同系统组件(包括存储单元420和处理单元410)的总线430。
其中,所述存储单元存储有程序代码,所述程序代码可以被所述处理单元410执行,使得所述处理单元410执行本说明书上述“示例性方法”部分中描述的根据本发明各种示例性实施方式的步骤。例如,所述处理单元410可以执行如图1中所示步骤S110:获取用户的语音;步骤S120:对所述用户语音进行文本转换,获取对应的文本;步骤S130:对所述文本进行分词,获取对应的分词结果;步骤S140:确定分词结果中的名词与动词,并基于分词结果中的名词与动词,确 定用户的初始语义;步骤S150:确定分词结果中是否存在疑问语气词,并基于分词结果中是否存在疑问语气词,确定所述用户语音所属语气类别;步骤S160:基于所述初始语义及所述所属语气类别,确定用户的目标语义。
存储单元420可以包括易失性存储单元形式的可读介质,例如随机存取存储单元(RAM)4201和/或高速缓存存储单元4202,还可以进一步包括只读存储单元(ROM)4203。
存储单元420还可以包括具有一组(至少一个)程序模块4205的程序/实用工具4204,这样的程序模块4205包括但不限于:操作系统、一个或者多个应用程序、其它程序模块以及程序数据,这些示例中的每一个或某种组合中可能包括网络环境的实现。
总线430可以为表示几类总线结构中的一种或多种,包括存储单元总线或者存储单元控制器、外围总线、图形加速端口、处理单元或者使用多种总线结构中的任意总线结构的局域总线。
电子设备400也可以与一个或多个外部设备500(例如键盘、指向设备、蓝牙设备等)通信,还可与一个或者多个使得用户能与该电子设备400交互的设备通信,和/或与使得该电子设备400能与一个或多个其它计算设备进行通信的任何设备(例如路由器、调制解调器等等)通信。这种通信可以通过输入/输出(I/O)接口450进行。并且,电子设备400还可以通过网络适配器460与一个或者多个网络(例如局域网(LAN),广域网(WAN)和/或公共网络,例如因特网)通信。如图所示,网络适配器460通过总线430与电子设备400的其它模块通信。应当明白,尽管图中未示出,可以结合电子设备400使用其它硬件和/或软件模块,包括但不限于:微代码、设备驱动器、冗余处理单元、外部磁盘驱动阵列、RAID系统、磁带驱动器以及数据备份存储系统等。
通过以上的实施方式的描述,本领域的技术人员易于理解,这里描述的示例实施方式可以通过软件实现,也可以通过软件结合必要的硬件的方式来实现。因此,根据本公开实施方式的技术方案可以以软件产品的形式体现出来,该软件产品可以存储在一个非易失性存储介质(可以是CD-ROM,U盘,移动硬盘等)中或网络上,包括若干指令以使得一台计算设备(可以是个人计算机、服务器 、终端装置、或者网络设备等)执行根据本公开实施方式的方法。
在本公开的示例性实施例中,还提供了一种计算机可读存储介质,其上存储有能够实现本说明书上述方法的程序产品。在一些可能的实施方式中,本发明的各个方面还可以实现为一种程序产品的形式,其包括程序代码,当所述程序产品在终端设备上运行时,所述程序代码用于使所述终端设备执行本说明书上述“示例性方法”部分中描述的根据本发明各种示例性实施方式的步骤。
参考图10所示,描述了根据本发明的实施方式的用于实现上述方法的程序产品600,其可以采用便携式紧凑盘只读存储器(CD-ROM)并包括程序代码,并可以在终端设备,例如个人电脑上运行。然而,本发明的程序产品不限于此,在本文件中,可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。
所述程序产品可以采用一个或多个可读介质的任意组合。可读介质可以是可读信号介质或者可读存储介质。可读存储介质例如可以为但不限于电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。可读存储介质的更具体的例子(非穷举的列表)包括:具有一个或多个导线的电连接、便携式盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。
计算机可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了可读程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。可读信号介质还可以是可读存储介质以外的任何可读介质,该可读介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。
可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于无线、有线、光缆、RF等等,或者上述的任意合适的组合。
可以以一种或多种程序设计语言的任意组合来编写用于执行本发明操作的程序代码,所述程序设计语言包括面向对象的程序设计语言-诸如Java、C++等,还包括常规的过程式程序设计语言-诸如“C”语言或类似的程序设计语言。程序代 码可以完全地在用户计算设备上执行、部分地在用户设备上执行、作为一个独立的软件包执行、部分在用户计算设备上部分在远程计算设备上执行、或者完全在远程计算设备或服务器上执行。在涉及远程计算设备的情形中,远程计算设备可以通过任意种类的网络,包括局域网(LAN)或广域网(WAN),连接到用户计算设备,或者,可以连接到外部计算设备(例如利用因特网服务提供商来通过因特网连接)。
此外,上述附图仅是根据本发明示例性实施例的方法所包括的处理的示意性说明,而不是限制目的。易于理解,上述附图所示的处理并不表明或限制这些处理的时间顺序。另外,也易于理解,这些处理可以是例如在多个模块中同步或异步执行的。
本领域技术人员在考虑说明书及实践这里公开的发明后,将容易想到本公开的其他实施例。本申请旨在涵盖本公开的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本公开的一般性原理并包括本公开未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本公开的真正范围和精神由权利要求指出。

Claims (20)

  1. 一种语义解析方法,包括:
    获取用户的语音;
    对所述用户语音进行文本转换,获取对应的文本;
    对所述文本进行分词,获取对应的分词结果;
    确定分词结果中的名词与动词,并基于分词结果中的名词与动词,确定用户的初始语义;
    确定分词结果中是否存在疑问语气词,并基于分词结果中是否存在疑问语气词,确定所述用户语音所属语气类别;
    基于所述初始语义及所述所属语气类别,确定用户的目标语义。
  2. 根据权利要求1所述的方法,其中,所述确定分词结果中的名词与动词,并基于分词结果中的名词与动词,确定用户的初始语义,包括:
    基于对分词结果中各词的词性判断,确定分词结果中的名词;
    基于对分词结果中各词的词性判断,确定分词结果中的动词;
    基于所述名词与所述动词,确定用户的初始语义。
  3. 根据权利要求2所述的方法,其中,所述基于所述名词与所述动词,确定用户的初始语义,包括:
    将所述名词对应的实体确定为用户所指示的实施对象;
    将所述动词对应的动作确定为用户所指示的初始服务类型;
    将所述实施对象及所述初始服务类型确定为用户的初始语义。
  4. 根据权利要求1所述的方法,其中,所述确定分词结果中是否存在疑问语气词,并基于分词结果中是否存在疑问语气词,确定所述用户语音所属语气类别,包括:
    将分词结果与预设的疑问语气词集合进行匹配,确定分词结果中是否存在疑问语气词;
    如果分词结果中存在疑问语气词,将所述用户语音确定为疑问句;
    如果分词结果中不存在疑问语气词,将所述用户语音确定为非疑问句。
  5. 根据权利要求3所述的方法,其中,所述基于所述初始语义及所述所属语气类别,确定用户的目标语义,包括:
    基于所述初始服务类型及所述所属语气类别,确定用户所指示的目标服务类型;
    将所述实施对象及所述目标服务类型确定为用户的目标语义。
  6. 根据权利要求5所述的方法,其中,所述基于所述初始服务类型及所述所属语气类别,确定用户所指示的目标服务类型,包括:
    如果所述用户语句为疑问句,将查询服务确定为所述目标服务类型;
    如果所述用户语句为非疑问句,将所述初始服务类型确定为所述目标服务类型。
  7. 根据权利要求1所述的方法,其中,所述获取用户的语音,包括:
    从物联网系统中获取用户的语音。
  8. 一种语义解析装置,包括;
    第一获取器,配置为获取用户的语音;
    第二获取器,配置为对所述用户语音进行文本转换,获取对应的文本;
    第三获取器,配置为对所述文本进行分词,获取对应的分词结果;
    第一确定器,配置为确定分词结果中的名词与动词,并基于分词结果中的名词与动词,确定用户的初始语义;
    第二确定器,配置为确定分词结果中是否存在疑问语气词,并基于分词结果中是否存在疑问语气词,确定所述用户语音所属语气类别;
    第三确定器,配置为基于所述初始语义及所述所属语气类别,确定用户的目标语义。
  9. 根据权利要求8所述的装置,其中,所述第一确定器包括:
    名词确定器,配置为基于对分词结果中各词的词性判断,确定分词结果中的名词;
    动词确定器,配置为基于对分词结果中各词的词性判断,确定分词结果中的动词;
    初始语义确定器,配置为基于所述名词与所述动词,确定用户的初始语义。
  10. 根据权利要求9所述的装置,其中,所述初始语义确定器包括:
    实施对象确定器,配置为将所述名词对应的实体确定为用户所指示的实施对象;
    初始服务类型确定器,配置为将所述动词对应的动作确定为用户所指示的初始服务类型;
    组合器,配置为将所述实施对象及所述初始服务类型确定为用户的初始语义。
  11. 根据权利要求8所述的装置,其中,所述第二确定器包括:
    疑问语气词确定器,配置为将分词结果与预设的疑问语气词集合进行匹配,确定分词结果中是否存在疑问语气词;
    疑问句判别器,配置为如果分词结果中存在疑问语气词,将所述用户语音确定为疑问句;
    疑问句判别器,配置为如果分词结果中不存在疑问语气词,将所述用户语音确定为非疑问句。
  12. 根据权利要求10所述的装置,其中,所述第三确定器包括:
    目标服务类型确定器,配置为基于所述初始服务类型及所述所属语气类别,确定用户所指示的目标服务类型;
    目标语义确定器,配置为将所述实施对象及所述目标服务类型确定为用户的目标语义。
  13. 根据权利要求12所述的装置,其中,所述目标服务类型确定器配置为:
    如果所述用户语句为疑问句,将查询服务确定为所述目标服务类型;
    如果所述用户语句为非疑问句,将所述初始服务类型确定为所述目标服务类型。
  14. 一种语义解析的电子设备,包括:
    存储器,配置为存储可执行指令;
    处理器,配置为执行存储器中存储的可执行指令;
    其中,所述处理器在执行所述可执行指令时配置为执行以下处理:
    获取用户的语音;
    对所述用户语音进行文本转换,获取对应的文本;
    对所述文本进行分词,获取对应的分词结果;
    确定分词结果中的名词与动词,并基于分词结果中的名词与动词,确定用户的初始语义;
    确定分词结果中是否存在疑问语气词,并基于分词结果中是否存在疑问语气词,确定所述用户语音所属语气类别;
    基于所述初始语义及所述所属语气类别,确定用户的目标语义。
  15. 根据权利要求14所述的电子设备,其中,所述处理器在执行所述可执行指令时配置为执行以下处理来实现所述确定分词结果中的名词与动词,并基于分词结果中的名词与动词,确定用户的初始语义:
    基于对分词结果中各词的词性判断,确定分词结果中的名词;
    基于对分词结果中各词的词性判断,确定分词结果中的动词;
    基于所述名词与所述动词,确定用户的初始语义。
  16. 根据权利要求15所述的电子设备,其中,所述处理器在执行所述可执行指令时配置为执行以下处理来实现所述基于所述名词与所述动词,确定用户的初始语义:
    将所述名词对应的实体确定为用户所指示的实施对象;
    将所述动词对应的动作确定为用户所指示的初始服务类型;
    将所述实施对象及所述初始服务类型确定为用户的初始语义。
  17. 根据权利要求14所述的电子设备,其中,所述处理器在执行所述可执行指令时配置为执行以下处理来实现所述确定分词结果中是否存在疑问语气词,并基于分词结果中是否存在疑问语气词,确定所述用户语音所属语气类别:
    将分词结果与预设的疑问语气词集合进行匹配,确定分词结果中是否存在疑问语气词;
    如果分词结果中存在疑问语气词,将所述用户语音确定为疑问句;
    如果分词结果中不存在疑问语气词,将所述用户语音确定为非疑问句。
  18. 根据权利要求16所述的电子设备,其中,所述处理器在执行所述可执行指令时配置为执行以下处理来实现所述基于所述初始语义及所述所属语气类别,确定用户的目标语义:
    基于所述初始服务类型及所述所属语气类别,确定用户所指示的目标服务类型;
    将所述实施对象及所述目标服务类型确定为用户的目标语义。
  19. 根据权利要求18所述的电子设备,其中,所述处理器在执行所述可执行指令时配置为执行以下处理来实现所述基于所述初始服务类型及所述所属语气类别,确定用户所指示的目标服务类型:
    如果所述用户语句为疑问句,将查询服务确定为所述目标服务类型;
    如果所述用户语句为非疑问句,将所述初始服务类型确定为所述目标服务类型。
  20. 一种计算机可读存储介质,其存储有计算机指令,当所述计算机指令被计算机执行时,使计算机执行根据权利要求1至7中任一个所述的方法。
PCT/CN2019/118017 2019-09-17 2019-11-13 语义解析方法、装置、电子设备及存储介质 WO2021051584A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910877053.4A CN110688858A (zh) 2019-09-17 2019-09-17 语义解析方法、装置、电子设备及存储介质
CN201910877053.4 2019-09-17

Publications (1)

Publication Number Publication Date
WO2021051584A1 true WO2021051584A1 (zh) 2021-03-25

Family

ID=69109362

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/118017 WO2021051584A1 (zh) 2019-09-17 2019-11-13 语义解析方法、装置、电子设备及存储介质

Country Status (2)

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

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112494013A (zh) * 2020-12-15 2021-03-16 深圳麦科田生物医疗技术股份有限公司 健康管理装置、方法、电子设备和存储介质

Citations (3)

* 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
CN106933807A (zh) * 2017-03-20 2017-07-07 北京光年无限科技有限公司 备忘录事件提醒方法及系统
CN107679042A (zh) * 2017-11-15 2018-02-09 北京灵伴即时智能科技有限公司 一种面向智能语音对话系统的多层级对话分析方法

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102117283A (zh) * 2009-12-30 2011-07-06 安世亚太科技(北京)有限公司 一种基于语义索引的数据检索方法
SG188531A1 (en) * 2010-09-24 2013-04-30 Univ Singapore Methods and systems for automated text correction
CN103425640A (zh) * 2012-05-14 2013-12-04 华为技术有限公司 一种多媒体问答系统及方法

Patent Citations (3)

* 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
CN106933807A (zh) * 2017-03-20 2017-07-07 北京光年无限科技有限公司 备忘录事件提醒方法及系统
CN107679042A (zh) * 2017-11-15 2018-02-09 北京灵伴即时智能科技有限公司 一种面向智能语音对话系统的多层级对话分析方法

Also Published As

Publication number Publication date
CN110688858A (zh) 2020-01-14

Similar Documents

Publication Publication Date Title
US11887604B1 (en) Speech interface device with caching component
WO2019101083A1 (zh) 一种语音数据处理方法、语音交互设备及存储介质
US20150371628A1 (en) User-adapted speech recognition
WO2019153777A1 (zh) 电器设备的控制方法、装置、设备和存储介质
US20210241775A1 (en) Hybrid speech interface device
WO2020133946A1 (zh) 设备控制方法、装置、设备及介质
CN107657950B (zh) 基于云端和多命令词的汽车语音控制方法、系统及装置
WO2019001194A1 (zh) 语音识别方法、装置、设备及存储介质
CN109961792A (zh) 用于识别语音的方法和装置
US20140207716A1 (en) Natural language processing method and system
JP7213943B2 (ja) 車載機器の音声処理方法、装置、機器及び記憶媒体
WO2020024620A1 (zh) 语音信息的处理方法以及装置、设备和存储介质
WO2020233363A1 (zh) 语音识别的方法、装置、电子设备和存储介质
US20120271639A1 (en) Permitting automated speech command discovery via manual event to command mapping
US11393490B2 (en) Method, apparatus, device and computer-readable storage medium for voice interaction
WO2019232980A1 (zh) 节点配置方法及装置、计算机可读存储介质和电子设备
WO2019148585A1 (zh) 会议摘要生成方法以及装置
CN112466289A (zh) 语音指令的识别方法、装置、语音设备和存储介质
KR20220044446A (ko) 차량용 음성기기의 테스트 방법, 장치, 전자기기 및 저장매체
CN109597996B (zh) 一种语义解析方法、装置、设备和介质
WO2021051584A1 (zh) 语义解析方法、装置、电子设备及存储介质
CN111400463B (zh) 对话响应方法、装置、设备和介质
US20190164541A1 (en) Real-time utterance verification system and method thereof
WO2022193892A1 (zh) 语音交互方法、装置、计算机可读存储介质及电子设备
US20190198023A1 (en) Method for associating a device with a speaker in a gateway, corresponding computer program, computer and apparatus

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19945892

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19945892

Country of ref document: EP

Kind code of ref document: A1