WO2018141140A1 - 一种语义识别方法和装置 - Google Patents

一种语义识别方法和装置 Download PDF

Info

Publication number
WO2018141140A1
WO2018141140A1 PCT/CN2017/083943 CN2017083943W WO2018141140A1 WO 2018141140 A1 WO2018141140 A1 WO 2018141140A1 CN 2017083943 W CN2017083943 W CN 2017083943W WO 2018141140 A1 WO2018141140 A1 WO 2018141140A1
Authority
WO
WIPO (PCT)
Prior art keywords
text information
information
document
matching
sub
Prior art date
Application number
PCT/CN2017/083943
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 WO2018141140A1 publication Critical patent/WO2018141140A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/30Semantic analysis
    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
    • G10L15/00Speech recognition
    • G10L15/26Speech to text systems
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72403User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality
    • H04M1/7243User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality with interactive means for internal management of messages
    • H04M1/72433User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality with interactive means for internal management of messages for voice messaging, e.g. dictaphones
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/725Cordless telephones

Definitions

  • the present disclosure relates to the field of communications, and in particular, to a semantic recognition method and apparatus.
  • a common method of speech semantic service is to convert the user's voice data into text information, then perform semantic analysis on the text information to understand the user's manipulation intention, and then return various data corresponding to the control intention to the terminal device, and the terminal device obtains according to the acquisition.
  • the data content performs the corresponding operation.
  • FIG. 1 is a flowchart of a speech semantic processing in the related art.
  • the speech semantic processing flow in the related art includes the following steps: after starting the speech semantic processing, the terminal device acquires the voice data of the user instruction, and then the terminal device The voice data is converted into text information by the voice recognition module, and then the text information is uploaded to the cloud server for semantic recognition, and the terminal device performs an operation corresponding to the user instruction according to the semantic recognition result.
  • the mainstream voice semantic processing scheme is based on the Client/Server (client/server) structure, because the Client/Server structure can exert powerful storage and computing capabilities on the server side.
  • the terminal device When the client/server structure is applied, the terminal device must use the voice service when the data service or WiFi (Wireless Fidelity) is connected. If the network is relatively congested or the network speed is slow, the server returns. The result of the parsing is slower, which causes the terminal device to determine that the time of the user's instruction becomes longer and slower. At the same time, because the scenario of the voice usage of the terminal device is relatively limited, the recognition result of the cloud server is not targeted and the execution efficiency is low. It also affects the recognition rate.
  • WiFi Wireless Fidelity
  • the embodiments of the present disclosure provide a semantic identification method and device, which solves the problem that a related network solution must be connected to a network to perform semantic analysis, and implements a function of processing most text information locally. In turn, the recognition rate and the pertinence of text information processing are improved.
  • an embodiment of the present disclosure provides a semantic recognition method, where the method includes:
  • an embodiment of the present disclosure provides a semantic recognition apparatus, where the apparatus includes: an obtaining module and a first determining module, where:
  • the obtaining module is configured to obtain text information converted according to voice information input by a user
  • the first determining module is configured to determine a semantic recognition result of the text information according to the text information and the text information in the matching document.
  • an embodiment of the present disclosure provides a semantic recognition device, the device comprising: a processor; a memory storing instructions executable by the processor; wherein the processor is configured to perform the above method.
  • an embodiment of the present disclosure provides a storage medium storing a computer program that, when executed by a processor of a computer, causes the computer to perform the method as described above.
  • the semantic recognition method and device after converting the acquired voice information into text information, determining the text information and the matching document according to the scene identifier corresponding to the matching document according to the scene identifier of the acquired voice information. Whether the subdocuments match, if they match, the operation instructions are executed and executed. If the matching fails, the text information is uploaded to the server in the network for matching and the operation instruction is obtained. In this way, the function of processing most of the text information locally can be realized, and the recognition rate and the pertinence of the text information processing are improved.
  • FIG. 1 is a schematic flow chart of a semantic recognition method in the related art
  • FIG. 2 is a schematic flowchart of a semantic recognition method according to Embodiment 1 of the present disclosure
  • FIG. 3 is a schematic flowchart of a semantic recognition method according to Embodiment 2 of the present disclosure.
  • FIG. 4 is a tree structure diagram of a sub-document provided in Embodiment 3 of the present disclosure.
  • 5-1 is a schematic flowchart of a semantic recognition method according to Embodiment 4 of the present disclosure.
  • 5-3 is a schematic flowchart of a semantic BEF-based semantic recognition process according to Embodiment 4 of the present disclosure
  • 5-4 is a tree structure diagram of a BNF document according to Embodiment 4 of the present disclosure.
  • FIGS. 5-5 are diagrams showing a tree structure of a BNF document according to Embodiment 4 of the present disclosure.
  • FIGS. 5-6 are diagrams 3 of a tree structure of a BNF document according to Embodiment 4 of the present disclosure.
  • FIG. 6 is a schematic structural diagram of a semantic recognition apparatus according to Embodiment 5 of the present disclosure.
  • An embodiment of the present disclosure provides a semantic recognition method. As shown in FIG. 2, the method includes:
  • Step S101 Acquire text information converted according to the voice information input by the user.
  • the execution subject of the embodiment is a semantic recognition device
  • the semantic recognition device can be loaded on the terminal
  • the terminal can be a smart phone, a smart computer, a portable smart device, a tablet computer, a desktop computer, a smart TV, etc.
  • the embodiment describes a semantic recognition method by taking a smartphone as an example.
  • the smart phone is loaded with a voice recognition module.
  • the smart phone receives the voice information through the voice recognition module and converts the voice information into text information.
  • Step S102 Determine semantics of the text information according to the text information and the text information in the matching document. Identify the results.
  • the matching document may be a matching document stored in the local terminal of the smart terminal, or may be a matching document stored on other devices in the local area network where the smart terminal is located.
  • the text information converted according to the voice information input by the user is first acquired, and the semantic recognition result of the text information is determined according to the text information and the text information in the matching document. Since the matching document is stored in the smart terminal local device or stored on other devices in the local area network where the smart terminal is located, the function of processing most of the text information locally can be realized, thereby improving the recognition rate and text information. The relevance of the treatment.
  • An embodiment of the present disclosure provides a semantic recognition method. As shown in FIG. 3, the method includes:
  • Step S101 Acquire text information converted according to the voice information input by the user.
  • the execution subject of the embodiment is a semantic recognition device
  • the semantic recognition device can be loaded on the terminal
  • the terminal can be a smart phone, a smart computer, a portable smart device, a tablet computer, a desktop computer, a smart TV, etc.
  • the embodiment describes a semantic recognition method by taking a smartphone as an example.
  • the smart phone is loaded with a voice recognition module.
  • the smart phone receives the voice information through the voice recognition module and converts the voice information into text information.
  • Step S102 Determine a semantic recognition result of the text information according to the text information and the text information in the matching document.
  • the matching document may be a matching document stored in the local terminal of the smart terminal, or may be a matching document stored on other devices in the local area network where the smart terminal is located.
  • the step S102 is a process of determining a semantic recognition result of the text information according to the text information and the text information in the matching document, and further includes:
  • Step S1021 Determine a scene identifier corresponding to the text information.
  • step S1021 further includes:
  • the relationship table is used to indicate a mapping relationship between the identification information of the application and the scene identifier of the terminal.
  • Step S1022 Determine a sub-document according to the scene identifier and the matching document
  • Step S1023 Determine whether the text information matches the text information of the sub-document, and obtain a matching result
  • the matching document is divided into sub-documents according to the scene identifier, and each of the sub-documents is represented by a tree structure, wherein the tree structure has a scene identifier as a root node, a sub-scene identifier or text information as described above.
  • the child node of the root node represented by the scene identifier is a tree structure, wherein the tree structure has a scene identifier as a root node, a sub-scene identifier or text information as described above.
  • the child node of the root node represented by the scene identifier.
  • step S1023 further includes:
  • Step S1023 determining whether the root node of the tree structure has a first child node of the sub-scene identifier
  • Step S1023b If the root node of the tree structure has a first child node of the sub-scene identifier, determine a second child node set that only includes the leaf node in the sub-tree with the first child node as the root node;
  • Step S1023c Determine a first leaf node set included in each of the second child nodes
  • Step S1023d determining whether text information included in a leaf node exists in the first leaf node set included in each second child node exists in the text information;
  • the text information matches the text information of the sub-document, If any text information contained in a leaf node that does not exist in the first leaf node set included in any one of the second child nodes exists in the text information, the text information does not match the text information of the sub-document .
  • another method for determining whether the text information matches the content in the matching document in the embodiment is: dividing the local matching document into sub-documents according to the scene identifier, and each of the sub-documents according to a tree structure Representing, in the tree structure, a child node of a root node represented by a scene identifier as a root node, a sub-scene identifier or text information as the scene identifier, and determining a child node including only a leaf node from the root node
  • the left side to the right side are the first child node to the Nth child node, and N is an integer greater than 0.
  • the first child node to the Nth child node are a series of nodes arranged according to a preset syntax format.
  • the first character obtains a second piece of text information having a length of the second information length; determining whether the information contained in one of the leaf nodes in the second leaf node set is the same as the second semantic segment; Determining, in the second leaf
  • the scene identifier corresponding to the text information is a preset scene identifier, where the preset scene identifier is a scene that receives text information when the smart phone displays the main interface, and the smart phone acquires the voice of the user.
  • Information, at which time the smartphone cannot determine the scene identifier of the text information, and the process of semantic recognition is: traversing the scene identifier Corresponding tree structure, determining whether one of the tree structures corresponding to all the scene identifiers matches the text information; if the information of the leaf node of one of the tree structures includes the Text information, the text information matching the content of one of the tree structures; if the information of the leaf node of any one of the tree structures does not include the text information, the text information and the leaf The contents of the node do not match.
  • Step S1024 determining a semantic recognition result of the text information according to the matching result
  • the semantic recognition result of the text information is that the recognition is successful; if the matching result is the text information and the sub-document If the text information does not match, the semantic recognition result of the text information is that the recognition fails.
  • Step S103 Determine an operation instruction according to the recognition result
  • step S103 further includes:
  • Step S1031 If the recognition result indicates that the text information matches the text information in the matching document, output an operation instruction corresponding to the text information in the matching document in a preset format,
  • the operation instruction instructs the terminal to process an operation represented by the text information
  • Step S1032 If the recognition result indicates that the text information does not match the text information in the matching document, upload the text information to a server in the network;
  • Step S1033 Receive an operation instruction sent by the server.
  • the voice information is converted into text information, and the obtained text information is first matched with the matching document stored in other devices in the local area network where the terminal or the terminal is located. If the recognition is successful, the operation instruction is generated according to the text information in the matching document. If the recognition fails, the text information is sent to the remote server, thereby determining an operation instruction corresponding to the voice information of the user. In this way, the speech recognition efficiency can be improved, and then sent to the server when it is not recognized, thereby ensuring the correctness of the recognition.
  • Step S104 executing the operation instruction.
  • the smartphone executes the locally generated operation instruction or the operation instruction acquired from the server to complete the operation indicated by the user's voice information.
  • the semantic recognition method determines the text information and a sub-document of the matching document according to the scene identifier corresponding to the matching document, after converting the obtained voice information into text information, according to the scene identifier of the acquired voice information. Whether it matches, the matching result is obtained, and the semantic recognition result is determined according to the matching result. In this way, the function of processing most of the text information locally can be realized, thereby improving the recognition rate and the pertinence of the text information processing.
  • Embodiments of the present disclosure provide a semantic recognition method, the method comprising:
  • Step S201 Acquire text information, where the text information is text information after the voice information input by the user is converted.
  • step S101 This step is the same as the content of step S101 in the first embodiment, and details are not described herein again.
  • Step S202 Determine a scene identifier corresponding to the text information.
  • the application running on the terminal that is, the user inputs voice information.
  • the scenario is to query the preset relationship table according to the identifier information of the application, and obtain the scene identifier of the terminal.
  • the preset relationship table is used to indicate the mapping relationship between the identification information of the application and the scene identifier of the terminal, and the scene identifier can be obtained by the query and used for the next operation.
  • a terminal acquires text information.
  • the terminal is running an application, such as a library, chat software, a dictionary, etc., if the user inputs voice information when running a program, the voice information is related to the running application, Determining the scene identifier of the text information by querying the identifier information of the application. If the obtained scene identifier is an application in the terminal, proceeding to step S203; second, when the terminal acquires the voice information input by the user, the terminal displays The main interface, does not run an application, the scene identifier obtained by the terminal is the main interface, then proceeds to step S205;
  • an application such as a library, chat software, a dictionary, etc.
  • Step S203 Determine a sub-document according to the scene identifier.
  • the terminal may pre-store a plurality of text information that may be acquired under the scene identifier, and the text information constitutes a matching document that is accessed locally by the terminal, where each scene identifier has a corresponding sub-document, the sub-document It contains the text information that the terminal can recognize locally under the scene identifier.
  • the sub-document can be in various storage forms.
  • the sub-document uses BNF (Backus-Naur Form) to edit and store the matching document, and the BNF is a formalized symbol.
  • BNF Backus-Naur Form
  • brackets ( ⁇ ) contain the items that can be repeated from 0 to innumerable times in the statement;
  • the content of the subdocument under the scenario of the translation application is as follows:
  • the terminal runs the translation application according to the acquisition of the voice information, determines that the scene identifier is ⁇ translate>, and uses the ⁇ translate> subdocument to match the text information.
  • Step S204 determining whether the text information matches the text information of the sub-document; if the text information matches the text information of the sub-document, determining that the matching result is the text information and the matching document Matching text information; if the text information does not match the text information of the sub-document, determining that the matching result is The text information does not match the content in the matching document.
  • the sub-documents are divided into two ways to match the text information.
  • the sub-document is represented by a tree structure
  • the leaf node information of the tree structure is obtained
  • the leaf node information is confirmed to contain text information
  • the syntax format of the leaf node information is confirmed to be the same as the text information.
  • the process of the first method is: the local matching document is divided into sub-documents according to the scene identifier, and each of the sub-documents is represented by a tree structure, wherein the tree structure is identified by the scene identifier as a root node The scene identifier or text information is a child node of the root node represented by the scene identifier;
  • Step S2411 determining text information of all leaf nodes under the root node; determining whether text information of all the leaf nodes can constitute the text information;
  • Step S2412 If the text information of all the leaf nodes can constitute the text information, determine a sequence consisting of the identifiers constituting the text information according to the language structure of the text information;
  • Step S2413 determining whether the sequence is legal. If it is legal, determining that the text information matches the text information of the sub-document, and if not, determining that the text information does not match the text information of the sub-document;
  • step S2414 if it is legal, the operation instruction is determined according to the sequence.
  • the text information acquired by the terminal is "How is the weather of Chengdu today?"
  • the acquired scene identifier of the terminal is ⁇ translate>, and then the tree structure with the ⁇ translate> as the root node is used to match the acquired text information.
  • the subdocument is compared with the text message "How to translate the weather in Chengdu today"
  • the grammar rules of the sub-document are more translated into what language type, so the text information of the sub-document is different from the text information, so it is illegal, the text information and text of the sub-document The information does not match.
  • the local matching document is represented by a tree structure, and the text information is matched by traversing the tree structure.
  • the process of the second method is: the local matching document is divided into sub-documents according to the scene identifier, and each of the sub-documents is represented by a tree structure, wherein the tree structure is identified by the scene identifier as a root node The scene identifier or text information is a child node of the root node represented by the scene identifier;
  • Step S2421 Determining that the child node including only the leaf node is the first child node to the Nth child node from the left side to the right side of the root node, and N is an integer greater than 0, and the first child node to the Nth
  • the child nodes are a series of nodes arranged in a grammatical format that constitutes a preset;
  • Step S2422 determining a first leaf node set included in the first child node
  • Step S2423 Determine a first information length, where the first information length is a length of information included in each leaf node in the first leaf node set;
  • Step S2424 Obtain a first text information segment having a length of the first information length from a first character of the text information.
  • Step S2425 determining whether the information included in one of the first leaf node sets is the same as the first semantic segment
  • Step S2426 If the information included in one of the first leaf node sets is the same as the first semantic segment, determining a second leaf node set included in the second child node;
  • Step S2427 Determine a second information length, where the second information length is a length of information included in each leaf node in the second leaf node set;
  • Step S2428 Obtain a second text information segment having a length of the second information length from a first character of the text information of the first semantic segment.
  • Step S2429 determining whether the information contained in one of the leaf nodes in the second leaf node set is the same as the second semantic segment;
  • Step S2430 If one of the leaf nodes in the second leaf node set has the same information as the first semantic segment, determining whether the leaf node set included in the third child node has one of the leaf nodes The information contained is the same as the third semantic segment;
  • Step S2431 until determining whether one of the leaf node sets included in the Nth child node contains information that is identical to the Nth semantic segment, and the last character of the Nth semantic segment is The last character of the text message;
  • Step S2432 if the information contained in one of the leaf nodes included in the Nth child node is the same as the Nth semantic segment, the text information matches the text information of the subdocument;
  • the leaf node information included in any one of the first child node to the Nth child node does not exist in the text information, and determines that the text information does not match the text information of the sub-document.
  • the text information obtained by the terminal is "Translate about the weather of Chengdu today."
  • the acquired scene identifier of the terminal is ⁇ translate>, and then the information of the tree structure with the ⁇ translate> as the root node is matched with the obtained text information.
  • the tree structure with ⁇ translate> as the root node is shown in Figure 4, where ⁇ translate> is the root node of the tree structure, ⁇ translate_only> is the child node of ⁇ translate>, and the child node of ⁇ translate_only> is ⁇ TranslateCmd> And ⁇ ...>, ⁇ TranslateCmd> and ⁇ ...> contain only leaf nodes, which are the first child node to the Nth child node in this step, where N is equal to 2.
  • the first child node to the second child node are arranged nodes in accordance with a grammatical format constituting a translation scenario.
  • the leaf nodes included in the first child node ⁇ TranslateCmd> are “translated”, “translated”, “translated”; the content of the second child node ⁇ ...> is the uncertain content defined in the embodiment.
  • the terminal obtains the sub-node ⁇ translate_only> through ⁇ translate>, and ⁇ translate_only> has two branches. First, query the branch on the left side, and query the sub-node ⁇ TranslateCmd>, the content of the sub-node ⁇ TranslateCmd> ("translate", " Under the translation, "translation” is the first set of leaf nodes, and the terminal device will "translate” and "translate” The three text messages of "under” and “translation” are matched starting from the first character of the text information "Translate the weather of Chengdu today.” The first information is “translation”, “translation”, “ Translate "any of the three strings, and then match the three strings with the text information.
  • the terminal first obtains the length of the "translated” string, and obtains The length of the character string "translated" to the first information is four characters; the length of the first information length is defined as the first text information segment from the first character of the text information, that is, in this example "Translating", it may be determined that one of the text information in the first information is identical to the first text information segment, then the first information matches the first text information segment; and determining whether the second leaf node set is related to the second text information Fragment matching; the second child node is ⁇ ...>, because the content corresponding to ⁇ ...> is not limited, so it can be combined with the second text information segment How is the weather in Tiancheng “matching; so the tree structure with ⁇ translate> as the root node matches the text information “How to translate the weather in Chengdu today”.
  • Step S205 If the scene identifier corresponding to the text information is a preset scene identifier, traverse the tree structure corresponding to the scene identifier, and determine one of all tree structures corresponding to the scene identifiers. Whether the structure matches the text information.
  • Step S205 describes a case where the scene identifier is obtained as a main interface. If the information of the leaf node of one of the tree structures includes the text information, the text information matches the content of the one of the tree structures; The information of the leaf nodes of one of the tree structures does not include the text information, and the text information does not match the content of the leaf node.
  • the scene identifier of the main interface is ⁇ main>
  • the main interface ⁇ main> is the root node
  • each scene is identified as a child node of ⁇ main>, and the tree structure formed by each scene identifier is traversed. Determine if there is a tree structure composed of one of the scene identifiers that matches the text information.
  • step S204 the tree structure under the scene identifier corresponding to the translation scenario is first matched, and if the matching is successful, step S206 is performed according to the tree structure under the scenario identifier corresponding to the translation scenario;
  • step S206 is performed according to the tree structure corresponding to the scene identifier corresponding to the search picture scene;
  • step S206 is performed.
  • Step S206 determining an operation instruction according to the matching result.
  • the terminal obtains two matching results, one is that the matching is successful, and the other is the matching failure; wherein, if the matching is successful, the tree structure in the matching document is converted into a preset operation instruction format, where the preset is preset.
  • the operation instruction format is an operation instruction format that the terminal can understand and execute, for example, expressed in a JSON (JavaScript Object Notation, Data Object Notation) data format. If the matching fails, the terminal uploads the text information to the server in the network. After matching the text information, the server sends an operation instruction to the terminal, and the terminal acquires the operation instruction.
  • Step S207 executing the operation instruction.
  • the terminal performs the operations required by the text information according to the operation instruction. For example, “Translate about the weather in Chengdu today", the terminal's translation application translates the sentence “What is the weather like in Chengdu today?"
  • the semantic recognition method determines the text information under the scene identifier corresponding to the local matching document according to the scene identifier of the local matching document, by pre-storing the matching document locally and converting the obtained voice information into text information. Whether it matches a sub-document of the matching document. If it matches, the operation instruction is obtained and executed. If the matching fails, the text information is uploaded to the server in the network for matching and obtaining an operation instruction. In this way, the function of processing most of the text information locally can be realized, thereby improving the recognition rate and the pertinence of the text information processing.
  • the embodiment of the present disclosure proposes a semantic recognition method that is combined with a cloud server locally.
  • the voice usage scenario of the terminal device is limited, and the requirements for the scenario are high. Therefore, in this embodiment, the instructions in the corresponding scenario are split to form a preset syntax format (this syntax format is equivalent to matching information).
  • this syntax format is equivalent to matching information.
  • the matching and recognition are performed locally and the preset syntax format, and if the matching recognition is successful, the instruction data content corresponding to the text information is returned. If it is not successful, the current text information is sent to the cloud server for matching identification.
  • local identification can basically identify most of the user's voice commands successfully, so that most of the user's voice command operations can be performed without the network, and because the local processing, the recognition speed of the user instructions is faster.
  • the speed of cloud recognition When the text information is locally matched with the preset grammar mode, this embodiment proposes to perform local semantic parsing based on the improved BNF method.
  • the semantic recognition method provided by the embodiment is described in three parts in the following with reference to the following three parts: speech semantic recognition, semantic recognition based on improved BNF method. BNF resolution and BNF matching processing based on semantic recognition of the improved BNF method.
  • Figure 5-1 depicts the process of semantic recognition in the proposed scheme. The steps are as follows:
  • Step S311 The voice recognition module of the terminal device acquires voice data that is instructed by the user;
  • Step S312 The voice recognition module of the terminal device converts the voice data into text information.
  • Step S313 the terminal device sends the text information to the local semantic analysis module for local semantic analysis
  • Step S314 The terminal device determines whether the local semantic analysis module recognizes the result, and if the result is successfully recognized, the process proceeds to step S317; otherwise, the process proceeds to step S315;
  • Step S315 the terminal device uploads text information that is not recognized by the local semantic analysis module to the server for semantic recognition;
  • Step S316 The terminal device acquires a result of semantic recognition returned by the server
  • Step S317 The terminal device performs an operation corresponding to the user voice data according to the semantic recognition result
  • Step S318 The process ends.
  • FIG. 5-2 describes the BNF parsing processing flow based on the semantic recognition of the improved BNF method in the embodiment, and the steps are as follows:
  • Step S321 start;
  • Step S322 The terminal device reads the BNF syntax content from the matching document.
  • Step S323 the terminal device parses the BNF syntax information, and parses and converts the syntax information in text form into a tree structure cache for subsequent matching search.
  • Step S324 The process ends.
  • the steps described in Figure 5-2 are mainly to parse the syntax information in text form into a tree structure that facilitates computer matching search, and cache it in memory to prepare for the text information identification shown in Figure 5-3.
  • the BNF grammar content mentioned in this section is based on the instruction set in the semantic recognition application scenario, and is pre-loaded in the terminal device. And the content of the BNF grammar can be written and adjusted by the user according to the BNF rules, so that the matching information is more customized and targeted.
  • FIG. 5-3 describes the BNF matching processing procedure based on the semantic recognition of the improved BNF method in the embodiment, and the steps are as follows:
  • Step S331 Start, the terminal device acquires text information to be parsed and a scene identifier of the terminal device, where the text information is information obtained after the voice recognition module processes the voice information;
  • Step S332 The terminal device acquires a corresponding tree structure from the cached tree data structure by using the scenario identifier.
  • Step S333 The terminal device performs a matching search on the text information and the tree structure
  • Step S334 The terminal device determines that if the text information matches a certain path of the tree structure, go to step S336; otherwise, go to step S335;
  • Step S335 the terminal device returns null data; go to step S337;
  • Step S336 the terminal device converts the matching searched path information into an agreed data structure and returns;
  • Step S337 The process ends.
  • BNF is a method of describing a given language grammar by formalizing symbols, and is usually used to define grammar rules of a programming language. Its contents are as follows:
  • brackets ( ⁇ ) contain the items that can be repeated from 0 to innumerable times in the statement;
  • this embodiment adds a definition as follows:
  • Scene 1 The whole process of speech semantic recognition of terminal equipment:
  • the contents of the known BNF file are as follows:
  • the terminal device After the terminal device starts semantic analysis, it needs two input parameters, one is the text information that needs to be semantically recognized, and the other is the scene identifier.
  • the text information is text information generated after the terminal device's voice recognition module recognizes the voice information after the terminal device collects the user voice information.
  • the label information defined in the content of the above BNF file may be described by a tree data structure, as shown in Figure 5-4.
  • the root node in the tree data structure in the figure is the scene identifier, and the subsequent scenes involved in the scene are different.
  • the starting point of the search path will also be different, that is, the scenes using semantic analysis are different in different scenarios of the terminal device.
  • the scene identifier of the voice command spoken by the user is unclear, so the root node ⁇ main> of the tree structure can be used as the scene to traverse the scene identifiers, so that You can search for everything.
  • the scene identifier at this time is a translation scenario
  • the user's instruction is related to the translation
  • the scene identifier ie, the starting point of the tree structure
  • selects ⁇ translate> to perform related semantic recognition. This can narrow the scope of the matching search and improve the efficiency of semantic recognition.
  • Step S341 The terminal device acquires its child nodes ⁇ search_picture> and ⁇ translate> through the scene ⁇ main>;
  • Step S342 The terminal device first searches for the ⁇ translate> branch, and obtains the child node ⁇ translate_only> through ⁇ translate>;
  • Step S343 The terminal device acquires the child nodes ⁇ TranslateCmd> and ⁇ ...> through ⁇ translate_only>;
  • Step S344 The terminal device matches the content of the child node ⁇ TranslateCmd> ("translation”, “translation”, “translation”) from the first character of the text information, because the text information has "the picture in WeChat” "The content of the child node ⁇ TranslateCmd> does not match, so the ⁇ translate> branch cannot match the text information, so switch to the search ⁇ search_picture> branch;
  • Step S345 the terminal device obtains its child nodes ⁇ Has>, ⁇ PhotoAlbum>, ⁇ Auxiliary>, ⁇ Picture>, ⁇ Interrogative> through ⁇ search_picture>;
  • Step S346 The terminal device searches the content of the child node ⁇ Has> ("Yes") in the text information.
  • the first character matching the text message to "Is there a picture in WeChat” is “Yes ", so the match is successful; if there is no match, the match fails and the search is stopped;
  • Step S347 Searching for the content with ⁇ PhotoAlbum> after the string "Yes” in the text information, in this embodiment, the content is matched with the content "WeChat", so the matching is successful; if there is no match, the matching fails, stopping search for;
  • Step S348 The terminal device searches for the content of the ⁇ Auxiliary> in the text message "WeChat".
  • the content is matched to the content "in the case", so the matching is successful; if there is no match, the matching is performed. Failed, stop searching;
  • Step S349 The terminal device searches for the content of the ⁇ Picture> after the string "in the text" in the text information.
  • the content "picture” is matched, so the matching is successful; if there is no match, the matching is performed. Failed, stop searching;
  • Step S350 The terminal device searches for the content of the ⁇ Interrogative> after the character string "picture" in the text information.
  • the content is matched with the content "?", so the matching is successful; if there is no match, the matching fails. , stop searching;
  • Step S351 The terminal device detects whether there is content after the string “?” in the text information. If there is no content indicating complete matching, the matching fails, and the corresponding syntax information is not found.
  • the path information of the above search is as shown in Figure 5-5.
  • the default data format is returned.
  • the data is returned in the JSON data format
  • the JSON data format of the data of the above tree structure is expressed as follows:
  • Scenario 2 Identifying scenes in the terminal device that contain semantics of the newly added BNF rules.
  • Step S361 The terminal device acquires the child nodes ⁇ search_picture> and ⁇ translate> of ⁇ main> through the scene ⁇ main>;
  • Step S362 The terminal device searches for the ⁇ translate> branch first, and obtains the child node ⁇ translate_only> through ⁇ translate>;
  • Step S363 The terminal device acquires the child nodes ⁇ TranslateCmd> and ⁇ ...> through ⁇ translate_only>;
  • Step S364 The terminal device converts the content of the child node ⁇ TranslateCmd> ("translate”, “translate”, “turn” Translation ”) starts from the first character of the text message;
  • Step S365 The terminal device matches the "translate" string in the text information. Since the next search node of ⁇ TranslateCmd> is ⁇ ...>, the matching string is undefined, so the text information is "translated". The following string is the content that ⁇ ...> matches.
  • each field of the above JSON data format is: "domain” is translate, indicating that the semantic recognition category is translation-related content; “action” is 1, indicating translation operation; “content” is “how is the weather in Chengdu today”, indicating The statement that needs to be translated; “belocal” is 1, indicating that the result is returned by local recognition.
  • the terminal device clearly knows how to translate “What is the weather in Chengdu today” according to the contents of each field, and performs the translation "How is the weather in Chengdu today?"
  • Scenario 3 The process of recognizing the speech semantics of the specified scene in the terminal device.
  • the terminal device Assume that the terminal device is running the library software at this time. The voice command sent by the user at this time should be related to the image search. Therefore, the terminal device obtains the scene identifier ⁇ search_picture>, and still uses the text message “has a picture in WeChat?” as an example.
  • the description of the process the process is as follows:
  • Step S371 the terminal device acquires its child nodes ⁇ Has>, ⁇ PhotoAlbum>, ⁇ Auxiliary>, ⁇ Picture>, ⁇ Interrogative> through ⁇ search_picture>;
  • Step S372 The terminal device matches the content of the child node ⁇ Has> ("Yes") in the text information, and matches the information. If there is no match, the matching fails, and the search is stopped.
  • Step S373 The terminal device matches the content with ⁇ PhotoAlbum> after the string "has” in the text information, and matches the content "WeChat”. If there is no match, the matching fails, and the search is stopped;
  • Step S374 The terminal device matches the content of the word "Auxiliary" in the text message "WeChat". In this embodiment, the content is matched to the content "in the middle”. If there is no match, the matching fails, and the search is stopped. ;
  • Step S375 The terminal device matches the content of the word "in” in the text information with the content of ⁇ Picture>.
  • the content "picture” is matched. If there is no match, the matching fails, and the search is stopped. ;
  • Step S376 The terminal device matches the content of the word "picture” in the text information with the content of ⁇ Interrogative>.
  • the content is matched with the content "?”, if there is no match, the matching fails, and the search is stopped;
  • Step S377 The terminal device determines whether there is any content after the string “?” in the text information. In the embodiment, there is no content indicating complete matching. Otherwise, the matching fails, and the corresponding syntax information is not found.
  • the path information finally searched by the terminal device is as shown in Figure 5-5.
  • the shape structure can return the data format in the scene one, and will not be described here.
  • the most common voice commands of the user can be basically recognized locally without using the network, and the semantic processing of the embodiment is The speed is faster than the C/S architecture through cloud recognition.
  • the user can modify and customize the voice semantic instructions, and the instructions of the semantic recognition module are highly targeted.
  • the semantic recognition method provided by the embodiment of the present disclosure determines the text information under the scene identifier corresponding to the local matching document according to the scene identifier of the obtained text information, after the obtained voice information is converted into the text information by pre-storing the matching document locally. Whether it matches a sub-document of the matching document. If it matches, the operation instruction is obtained and executed. If the matching fails, the text information is uploaded to the server in the network for matching and obtaining an operation instruction.
  • an embodiment of the present disclosure provides a semantic identification apparatus.
  • the apparatus 500 includes: an obtaining module 501, a first determining module 502, a second determining module 503, and an executing module 504. among them:
  • the obtaining module 501 is configured to acquire text information converted according to voice information input by a user.
  • the first determining module 502 is configured to determine a semantic recognition result of the text information according to the text information and the text information in the matching document.
  • the second determining module 503 is configured to determine an operation instruction according to the recognition result.
  • the execution module 504 is configured to execute the operation instruction.
  • the first determining module 502 further includes:
  • a first determining unit configured to determine a scene identifier corresponding to the text information
  • the first determining unit further includes:
  • a third determining subunit configured to query a preset relationship table according to the identifier information of the application, and determine a scene identifier of the terminal, where the relationship table is used to indicate identifier information of the application and the terminal Mapping relationship between scene identifiers.
  • a second determining unit configured to determine a sub-document according to the scene identifier and the matching document
  • a first determining unit configured to determine whether the text information matches the text information of the sub-document, and obtain a matching result
  • the matching document is divided into sub-documents according to the scene identifier, and each of the sub-documents is represented by a tree structure, wherein the tree structure has a scene identifier as a root node, a sub-scene identifier or text information as described above.
  • a first determining subunit configured to determine whether a root node of the tree structure has a first child node of a sub-scene identifier
  • a first determining subunit configured to determine, if the root node of the tree structure has a first child node of a sub-scene identifier, a second sub-tree containing only the leaf node in the sub-tree with the first sub-node as a root node Node set
  • a second determining subunit configured to determine a first leaf node set included in each of the second child nodes
  • a second determining subunit configured to determine whether each of the first leaf nodes included in the second child node is stored in the first leaf node set
  • the text information contained in a leaf node exists in the text information; wherein if each of the first leaf node sets included in each second child node has a leaf node, the text information contained in the leaf node exists in the text
  • the text information matches the text information of the sub-document, and if any one of the first leaf node sets included in the second child node does not exist, the leaf information contained in the leaf node exists in the text. In the information, the text information does not match the text information of the sub-document.
  • the first determining unit further includes:
  • a third determining sub-unit configured to: if the scene identifier corresponding to the text information is a preset scene identifier, traverse the tree structure corresponding to the scene identifier, and determine all the tree structures corresponding to the scene identifiers Whether one of the tree structures matches the text information;
  • the text information matches the content of the one of the tree structures
  • the text information does not match the content of the leaf node.
  • a third determining unit configured to determine a semantic recognition result of the text information according to the matching result
  • the semantic recognition result of the text information is that the recognition is successful; if the matching result is the text information and the sub-document If the text information does not match, the semantic recognition result of the text information is that the recognition fails.
  • the second determining module 503 further includes:
  • an output unit configured to: if the recognition result indicates that the text information matches the text information in the matching document, output an operation instruction corresponding to the text information in the matching document in a preset format, where the operation instruction indicates The terminal processes the operation indicated by the text information;
  • a uploading unit configured to upload the text information to a server in a network if the recognition result indicates that the text information does not match the text information in the matching document;
  • a receiving unit configured to receive an operation instruction sent by the server.
  • the present disclosure also provides a semantic recognition device, the device comprising: a processor; a memory storing instructions executable by the processor; wherein the processor is configured to perform any of the above implementations The method described in the example.
  • the present disclosure also provides a storage medium storing a computer program that, when executed by a processor of a computer, causes the computer to perform the method of any of the above embodiments.
  • embodiments of the present disclosure can be provided as a method, system, or computer program product. Accordingly, the present disclosure may take the form of a hardware embodiment, a software embodiment, or an embodiment combining software and hardware aspects. formula. Moreover, the present disclosure may take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) including computer usable program code.
  • the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
  • the apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
  • These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device.
  • the instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.
  • the semantic recognition method and device provided by the present disclosure can be applied to terminals such as a smart phone, a smart computer, a portable smart device, a tablet computer, a desktop computer, a smart TV, etc., and the obtained voice information is converted into text information according to the acquisition.
  • the scene identifier of the voice information determines whether the text information matches a certain sub-document of the matching document under the scene identifier corresponding to the matching document. If the matching, the operation instruction is obtained and executed, and if the matching fails, the text information is uploaded to the server in the network. Match and get the operation instructions. In this way, the function of processing most of the text information locally can be realized, and the recognition rate and the pertinence of the text information processing are improved.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computational Linguistics (AREA)
  • Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Artificial Intelligence (AREA)
  • General Health & Medical Sciences (AREA)
  • Signal Processing (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Human Computer Interaction (AREA)
  • Acoustics & Sound (AREA)
  • Multimedia (AREA)
  • Business, Economics & Management (AREA)
  • General Business, Economics & Management (AREA)
  • Information Transfer Between Computers (AREA)
  • Machine Translation (AREA)

Abstract

一种语义识别方法和装置,所述方法包括:获取根据用户输入的语音信息转换得到的文本信息(S101);根据所述文本信息与匹配文档中的文本信息,确定所述文本信息的语义识别结果(S102)。

Description

一种语义识别方法和装置 技术领域
本公开涉及通讯领域,尤其涉及一种语义识别方法和装置。
背景技术
随着通讯技术的发展,手机、电脑等设备上的语音服务已广泛应用于人们的日常生活之中,例如IPhone手机的语音服务、哦啦语音服务、百度语音服务等。语音语义服务的常见方法是先将用户的语音数据转换为文本信息,然后对文本信息进行语义分析来理解用户的操控意图,然后返回各种操控意图对应内容的数据给终端设备,终端设备根据获取的数据内容进行对应的操作。
图1描述了相关技术中的语音语义处理的流程图,如图1所示,相关技术中语音语义处理流程包括以下步骤:开始语音语义处理后,终端设备获取用户指令的语音数据,然后终端设备通过语音识别模块将语音数据转换为文本信息,接着将文本信息上传至云端服务器进行语义识别,终端设备根据语义识别结果执行用户指令所对应的操作。目前主流的语音语义处理方案都基于Client/Server(客户端/服务器)结构,因为Client/Server结构可以发挥服务器端强大的存储和运算能力。而应用Client/Server结构时,终端设备必须在连接数据业务或者WiFi(Wireless Fidelity,无线保真)的情况下才能正常使用语音服务,若在网络比较拥堵或网速比较慢的情况下,服务器返回解析结果会比较慢,从而导致终端设备确定用户指令的时间变长、速度变慢;同时,因为终端设备语音使用的场景是比较有限的,云端服务器的识别结果针对性不强,执行效率低,也会影响识别率。
发明内容
为解决现有存在的技术问题,本公开实施例提供一种语义识别方法和装置,解决了相关技术方案中必须连接网络才能进行语义分析的问题,实现了在本地处理大部分文本信息的功能,进而提高了识别速率和文本信息处理的针对性。
为达到上述目的,本公开实施例的技术方案是这样实现的:
第一方面,本公开实施例提供了一种语义识别方法,所述方法包括:
获取根据用户输入的语音信息转换得到的文本信息;
根据所述文本信息与匹配文档中的文本信息,确定所述文本信息的语义识别结果。
第二方面,本公开实施例提供了一种语义识别装置,所述装置包括:获取模块和第一确定模块,其中:
所述获取模块,用于获取根据用户输入的语音信息转换得到的文本信息;
所述第一确定模块,用于根据所述文本信息与匹配文档中的文本信息,确定所述文本信息的语义识别结果。
第三方面,本公开实施例提供了一种语义识别设备,所述设备包括:处理器;存储器,存储有可由所述处理器执行的指令;其中所述处理器被配置为执行如上所述的方法。
第四方面,本公开实施例提供了一种存储有计算机程序的存储介质,所述计算机程序在由计算机的处理器运行时,使所述计算机执行如上所述的方法。
本公开的实施例提供的语义识别方法和装置,通过将获取的语音信息转换为文本信息后,根据获取语音信息的场景标识,在匹配文档对应的场景标识下确定文本信息与匹配文档的某一子文档是否匹配,若匹配则获取操作指令并执行,若匹配失败则将文本信息上传至网络中的服务器进行匹配并获取操作指令。如此,能够实现在本地处理大部分文本信息的功能,且提高了识别速率和文本信息处理的针对性。
附图说明
图1为本相关技术中的语义识别方法流程示意图;
图2为本公开实施例一提供的语义识别方法流程示意图;
图3为本公开实施例二提供的语义识别方法流程示意图;
图4为本公开实施例三提供的子文档树形结构图;
图5-1为本公开实施例四提供的语义识别方法流程示意图;
图5-2为本公开实施例四提供的语义识别方法的BNF文件解析处理流程示意图;
图5-3为本公开实施例四提供的基于改进BNF的语义识别处理流程示意图;
图5-4为本公开实施例四提供的BNF文档树形结构图一;
图5-5为本公开实施例四提供的BNF文档树形结构图二;
图5-6为本公开实施例四提供的BNF文档树形结构图三;
图6为本公开实施例五提供的语义识别装置结构示意图。
具体实施方式
下面将结合本公开实施例中的附图,对本公开实施例中的技术方案进行清楚、完整地描述。
实施例一
本公开实施例提供一种语义识别方法,如图2所示,该方法包括:
步骤S101、获取根据用户输入的语音信息转换得到的文本信息。
需要说明的是,本实施例的执行主体为语义识别装置,该语义识别装置可以装载在终端上,终端可以为智能手机、智能电脑、便携智能设备、平板电脑、台式电脑、智能电视等,本实施例以智能手机为例对语义识别方法进行描述。
智能手机中装载有语音识别模块,当用户向智能手机输入语音信息时,智能手机通过语音识别模块接收语音信息并将语音信息转化成文本信息。
步骤S102、根据所述文本信息与匹配文档中的文本信息,确定所述文本信息的语义 识别结果。
这里,所述匹配文档可以是存储在智能终端本机中的匹配文档,也可以是存储在所述智能终端所在局域网中其他设备上的匹配文档。
在本公开实施例提供的语义识别方法中,首先获取根据用户输入的语音信息转换得到的文本信息,再根据所述文本信息与匹配文档中的文本信息,确定所述文本信息的语义识别结果。由于匹配文档是存储在智能终端本机中的或者是存储在所述智能终端所在局域网中其他设备上的,因此,能够实现在本地处理大部分文本信息的功能,进而提高了识别速率和文本信息处理的针对性。
实施例二
本公开实施例提供一种语义识别方法,如图3所示,该方法包括:
步骤S101、获取根据用户输入的语音信息转换得到的文本信息。
需要说明的是,本实施例的执行主体为语义识别装置,该语义识别装置可以装载在终端上,终端可以为智能手机、智能电脑、便携智能设备、平板电脑、台式电脑、智能电视等,本实施例以智能手机为例对语义识别方法进行描述。
智能手机中装载有语音识别模块,当用户向智能手机输入语音信息时,智能手机通过语音识别模块接收语音信息并将语音信息转化成文本信息。
步骤S102、根据所述文本信息与匹配文档中的文本信息,确定所述文本信息的语义识别结果。
这里,所述匹配文档可以是存储在智能终端本机中的匹配文档,也可以是存储在所述智能终端所在局域网中其他设备上的匹配文档。
所述步骤S102根据所述文本信息与匹配文档中的文本信息,确定所述文本信息的语义识别结果的过程,进一步包括:
步骤S1021、确定所述文本信息对应的场景标识;
在本公开其他实施例中,所述步骤S1021进一步包括:
获取正在运行在所述终端上的应用程序的标识信息;
根据所述应用程序的标识信息查询预设的关系表,得到所述终端的场景标识;
这里,所述关系表用于表明应用程序的标识信息与所述终端的场景标识之间的映射关系。
步骤S1022、根据所述场景标识和所述匹配文档确定子文档;
步骤S1023、判断所述文本信息与所述子文档的文本信息是否匹配,得到匹配结果;
这里,所述匹配文档按照场景标识分为子文档,每一所述子文档按照树形结构表示,其中所述树形结构中以场景标识为根节点、以子场景标识或文本信息为所述场景标识表示的根节点的子节点。
对应地,在本公开其他实施例中,所述步骤S1023进一步包括:
步骤S1023a、判断所述树形结构的根节点是否有子场景标识的第一子节点;
步骤S1023b、如果所述树形结构的根节点有子场景标识的第一子节点,确定以所述第一子节点为根节点的子树中仅包含叶子节点的第二子节点集合;
步骤S1023c、确定所述每一个第二子节点所包含的第一叶子节点集合;
步骤S1023d、判断是否每一个第二子节点所包含的第一叶子节点集合中都存在一个叶子节点所包含的文本信息存在于所述文本信息中;
其中,如果每一个第二子节点所包含的第一叶子节点集合中都存在一个叶子节点所包含的文本信息存在于所述文本信息中则所述文本信息与所述子文档的文本信息匹配,如果有任何一个第二子节点中所包含的第一叶子节点集合中不存在一个叶子节点所包含的文本信息存在于所述文本信息中则所述文本信息与所述子文档的文本信息不匹配。
这里,本实施例中另一种确定文本信息是否与所述匹配文档中的内容匹配的方法为:将所述本地匹配文档按照场景标识分为子文档,每一所述子文档按照树形结构表示,其中所述树形结构中以场景标识为根节点、以子场景标识或文本信息为所述场景标识表示的根节点的子节点;确定仅包含叶子节点的子节点从所述根节点的左侧至右侧依次为第一子节点至第N子节点,N为大于0的整数,所述第一子节点至第N子节点是按照构成预设的语法格式的进行排列的一系列节点;确定所述第一子节点包含的第一叶子节点集合;确定第一信息长度,所述第一信息长度为所述第一叶子节点集合中每一个叶子节点所包含的信息的长度;从所述文本信息的第一个字符起获取长度为所述第一信息长度的第一文本信息片段;确定所述第一叶子节点集合中是否有其中一个叶子节点所包含的信息与所述第一语义片段相同;若所述第一叶子节点集合中有其中一个叶子节点所包含的信息与所述第一语义片段相同,则确定所述第二子节点包含的第二叶子节点集合;确定第二信息长度,所述第二信息长度为所述第二叶子节点集合中每一个叶子节点所包含的信息的长度;从去掉所述第一语义片段的文本信息的第一个字符起获取长度为所述第二信息长度的第二文本信息片段;确定所述第二叶子节点集合中是否有其中一个叶子节点所包含的信息与所述第二语义片段相同;若所述第二叶子节点集合中有其中一个叶子节点所包含的信息与所述第一语义片段相同,则确定所述第三子节点包含的叶子节点集合中是否有其中一个叶子节点所包含的信息与所述第三语义片段相同;依次类推,直至确定所述第N子节点包含的叶子节点集合中是否有其中一个叶子节点所包含的信息与所述第N语义片段相同,所述第N语义片段的最后一个字符是所述文本信息的最后一个字符;若所述第N子节点包含的叶子节点集合中有其中一个叶子节点所包含的信息与所述第N语义片段相同,则所述文本信息与所述子文档的文本信息匹配;若所述第一子节点至所述第N子节点中任意一个子节点所包含的叶子节点信息不存在于所述文本信息中,确定所述文本信息与所述子文档的文本信息不匹配。
而对于若所述文本信息对应的场景标识为预设的场景标识的情形,其中,所述预设的场景标识为在智能手机显示主界面时接收到文本信息的场景,智能手机获取用户的语音信息,这时智能手机无法确定文本信息的场景标识,语义识别的过程为:遍历所述场景标识 对应的树形结构,确定所述所有场景标识所对应的所有树形结构中的其中一个树形结构是否与所述文本信息匹配;若其中一个树形结构的所述叶子节点的信息包含所述文本信息,所述文本信息与所述其中一个树形结构的内容匹配;若任意一个所述树形结构的所述叶子节点的信息均不包含所述文本信息,所述文本信息与所述叶子节点的内容不匹配。
步骤S1024、根据所述匹配结果,确定所述文本信息的语义识别结果;
这里,如果所述匹配结果为所述文本信息与所述子文档的文本信息匹配,则所述文本信息的语义识别结果为识别成功;如果所述匹配结果为所述文本信息与所述子文档的文本信息不匹配,则所述文本信息的语义识别结果为识别失败。
步骤S103、根据所述识别结果确定操作指令;
这里,所述步骤S103进一步包括:
步骤S1031、若所述识别结果表明所述文本信息与所述匹配文档中的文本信息匹配,按预设格式输出与所述匹配文档中的文本信息对应的操作指令,
这里,所述操作指令指示终端处理所述文本信息所表示的操作;
步骤S1032、若所述识别结果表明所述文本信息与所述匹配文档中的文本信息不匹配,则将所述文本信息上传至网络中的服务器;
步骤S1033、接收所述服务器发送的操作指令。
也就是说,当智能终端接收到用户的语音信息后,将所述语音信息转换为文本信息,并首先将得到的文本信息与存储在本机或者终端所在局域网中其他设备中的匹配文档进行匹配,判断是否识别成功,如果识别成功则根据匹配文档中的文本信息生成操作指令,如果识别失败,再将所述文本信息发送到远端服务器,进而确定用户的语音信息所对应的操作指令。这样,即可以提高语音识别效率,并且在不能识别的时候再发送给服务器,进而保证了识别的正确性。
步骤S104、执行所述操作指令。
这里,智能手机执行本地生成的操作指令或者从服务器端获取的操作指令,完成用户的语音信息指示的操作。
本公开的实施例提供的语义识别方法,通过将获取的语音信息转换为文本信息后,根据获取语音信息的场景标识,在匹配文档对应的场景标识下确定文本信息与匹配文档的某一子文档是否匹配,得到匹配结果,并根据所述匹配结果确定语义识别结果。如此,能够实现在本地处理大部分文本信息的功能,进而提高了识别速率和文本信息处理的针对性。
实施例三
本公开实施例提供一种语义识别方法,该方法包括:
步骤S201、获取文本信息,所述文本信息是用户输入的语音信息转换后的文本信息。
本步骤和实施例一中的步骤S101内容相同,这里不再赘述。
步骤S202、确定所述文本信息对应的场景标识。
这里,当用户进行语音信息输入时,终端上正在运行的应用程序即用户输入语音信息 的场景,根据应用程序的标识信息,查询预设的关系表,得到所述终端的场景标识。这里,预设的关系表用于表明应用程序的标识信息与终端的场景标识之间的映射关系,通过查询可获取场景标识并用于下一步的操作。
终端获取文本信息的场景有两种情形。第一种,终端正在运行某一应用程序,例如图库、聊天软件、词典等,如果在运行某一程序时用户进行了语音信息输入,那么该语音信息会与所运行的应用程序相关,即可通过查询应用程序的标识信息确定文本信息的场景标识,若获取的场景标识是终端中的某一应用程序,则继续步骤S203;第二种,终端获取用户输入的语音信息时,终端显示的是主界面,并未运行某一应用程序,这时终端获取的场景标识是主界面,这时则继续步骤S205;
步骤S203、根据所述场景标识确定子文档。
需要说明的是,终端中预存储了很多场景标识下可能获取的文本信息,这些文本信息构成了存取于终端本地的匹配文档,其中每一个场景标识下会有一个对应的子文档,子文档中包含了该场景标识下终端在本地可识别的文本信息。其中,子文档可为多种存储形式,本实施例中,子文档使用BNF(Backus-Naur Form,巴科斯-劳尔范式)对匹配文档进行编辑和存储,BNF是一种通过形式化符号来描述给定语言语法的方法。BNF的语法规则如下:
1)在双引号中的字("word")代表着这些字符本身;
2)在双引号外的字(有可能有下划线)代表语法部分;
3)尖括号(<>)内包含的为该语句中的必选项;
4)方括号([])内包含的为该语句中的可选项;
5)大括号({})内包含的为该语句中的可重复0至无数次的项;
6)竖线(|)表示在竖线左右两边任选一项,相当于“OR”的意思;
7):=是“被定义为”的意思;
本实施例为了完成语义识别,增加了如下的一个定义:
8)<…>表示不确定的内容,为必选项。增加该定义,主要是用于表示语法中出现的不确定信息(比如人名、地名、时间等不确定文本信息)。
示例性地,对于在翻译应用程序的场景下子文档的内容如下:
<translate>:=<translate_only>;
<translate_only>:=<TranslateCmd><...>;
<TranslateCmd>:="翻译一下"|"翻译下"|"翻译";
终端根据获取语音信息时正在运行翻译应用程序,确定场景标识为<translate>,使用<translate>子文档对文本信息进行匹配。
步骤S204、确定所述文本信息与所述子文档的文本信息是否匹配;如果所述文本信息与所述子文档的文本信息匹配,确定所述匹配结果为所述文本信息与所述匹配文档中的文本信息匹配;如果所述文本信息与所述子文档的文本信息不匹配,确定所述匹配结果为 所述文本信息与所述匹配文档中的内容不匹配。
本实施例中将子文档分为两种方式分别与文本信息进行匹配。
第一种方式,将子文档使用树形结构表示,获取树形结构的叶子节点信息,确认叶子节点信息是否包含文本信息,并确认一系列叶子节点信息的语法格式是否与文本信息相同。
第一种方式的处理过程为:所述本地匹配文档按照场景标识分为子文档,每一所述子文档按照树形结构表示,其中所述树形结构中以场景标识为根节点、以子场景标识或文本信息为所述场景标识表示的根节点的子节点;
步骤S2411、确定根节点下所有叶子节点的文本信息;判断所述所有叶子节点的文本信息是否能够组成所述文本信息;
步骤S2412、如果所述所有叶子节点的文本信息能够组成所述文本信息,按照所述文本信息的语言结构确定组成所述文本信息的标识所组成的序列;
步骤S2413、判断所述序列是否合法,如果合法,确定所述文本信息与所述子文档的文本信息匹配,如果不合法,确定所述文本信息与所述子文档的文本信息不匹配;
步骤S2414、如果合法,按照所述序列确定操作指令。
示例性地,终端获取的文本信息为“翻译今天成都的天气怎么样”。获取该文本信息时,终端的获取的场景标识为<translate>,那么使用以<translate>为根节点的树形结构与获取的文本信息进行匹配。判断<translate>为根节点的树形结构的叶节点信息是否包含了文本信息“翻译今天成都的天气怎么样”,如果包含了文本信息,那么判断组成文本信息“翻译今天成都的天气怎么样”的叶节点信息是否符合语法规则;如果合法,则匹配,不合法,则不匹配。例如,子文档中的场景标识为<translate>下的语法规则是{“翻译”<…>“为”“英语”},那么与文本信息“翻译今天成都的天气怎么样”相比,子文档虽然包含了文本信息,但是子文档的语法规则中多了将某字符串翻译成什么语言类型,所以子文档的文本信息与文本信息不同,这样则为不合法的,子文档的文本信息与文本信息不匹配。
第二种方式,将本地匹配文档按照树形结构表示,以遍历树形结构的方式与文本信息进行匹配。
第二种方式的处理过程为:所述本地匹配文档按照场景标识分为子文档,每一所述子文档按照树形结构表示,其中所述树形结构中以场景标识为根节点、以子场景标识或文本信息为所述场景标识表示的根节点的子节点;
步骤S2421、确定仅包含叶子节点的子节点从所述根节点的左侧至右侧依次为第一子节点至第N子节点,N为大于0的整数,所述第一子节点至第N子节点是按照构成预设的语法格式的进行排列的一系列节点;
步骤S2422、确定所述第一子节点包含的第一叶子节点集合;
步骤S2423、确定第一信息长度,所述第一信息长度为所述第一叶子节点集合中每一个叶子节点所包含的信息的长度;
步骤S2424、从所文本信息的第一个字符起获取长度为所述第一信息长度的第一文本信息片段;
步骤S2425、确定所述第一叶子节点集合中是否有其中一个叶子节点所包含的信息与所述第一语义片段相同;
步骤S2426、若所述第一叶子节点集合中有其中一个叶子节点所包含的信息与所述第一语义片段相同,则确定所述第二子节点包含的第二叶子节点集合;
步骤S2427、确定第二信息长度,所述第二信息长度为所述第二叶子节点集合中每一个叶子节点所包含的信息的长度;
步骤S2428、从去掉所述第一语义片段的文本信息的第一个字符起获取长度为所述第二信息长度的第二文本信息片段;
步骤S2429、确定所述第二叶子节点集合中是否有其中一个叶子节点所包含的信息与所述第二语义片段相同;
步骤S2430、若所述第二叶子节点集合中有其中一个叶子节点所包含的信息与所述第一语义片段相同,则确定所述第三子节点包含的叶子节点集合中是否有其中一个叶子节点所包含的信息与所述第三语义片段相同;
步骤S2431、依次类推,直至确定所述第N子节点包含的叶子节点集合中是否有其中一个叶子节点所包含的信息与所述第N语义片段相同,所述第N语义片段的最后一个字符是所述文本信息的最后一个字符;
步骤S2432、若所述第N子节点包含的叶子节点集合中有其中一个叶子节点所包含的信息与所述第N语义片段相同,则所述文本信息与所述子文档的文本信息匹配;若所述第一子节点至所述第N子节点中任意一个子节点所包含的叶子节点信息不存在于所述文本信息中,确定所述文本信息与所述子文档的文本信息不匹配。
示例性地,终端获取的文本信息为“翻译一下今天成都的天气怎么样”。获取该文本信息时,终端的获取的场景标识为<translate>,那么使用以<translate>为根节点的树形结构的信息和获取的文本信息进行匹配。以<translate>为根节点的树形结构如图4所示,其中<translate>是树形结构的根节点,<translate_only>是<translate>的子节点,<translate_only>的子节点为<TranslateCmd>和<...>,<TranslateCmd>和<...>仅包含叶子节点,即为本步骤中的第一子节点至第N子节点,这里N等于2。第一子节点至第二子节点是按照构成翻译情景的语法格式的进行排列节点。第一子节点<TranslateCmd>包含的叶子节点为“翻译一下”、“翻译下”、“翻译”;第二子节点<...>的内容为本实施例中定义的不确定内容。
进行语义匹配时,由根节点<translate>的由左至右方向遍历该树形结构。具体过程为:
终端通过<translate>获取到子节点<translate_only>,<translate_only>有两个分支,首先查询左侧的分支,查询到子节点<TranslateCmd>,子节点<TranslateCmd>的内容(“翻译一下”、“翻译下”、“翻译”)即为第一叶子节点集合,终端设备将“翻译一下”、“翻译 下”、“翻译”这三个文本信息分别从文本信息“翻译一下今天成都的天气怎么样”的第一字符起开始进行匹配。其中第一信息为“翻译一下”、“翻译下”、“翻译”三个字符串中的任意一个,依次将三个字符串与文本信息进行匹配。例如,匹配“翻译一下”是否存在于文本信息中:终端首先获取“翻译一下”的字符串长度,获取到第一信息“翻译一下”的字符串长度为四个字符;从所文本信息的第一个字符起获取长度为所述第一信息长度的定义为第一文本信息片段,即为本例中的“翻译一下”,可以确定第一信息中的其中一个文本信息与第一文本信息片段相同,那么第一信息与第一文本信息片段匹配;继续确定第二叶子节点集合是否与第二文本信息片段匹配;第二子节点为<…>,因<…>对应的内容是不限定的,所以可以与第二文本信息片段“今天成都的天气怎么样”匹配;所以以<translate>为根节点的树形结构与文本信息“翻译一下今天成都的天气怎么样”匹配。
步骤S205、若所述文本信息对应的场景标识为预设的场景标识,则遍历所述场景标识对应的树形结构,确定所述所有场景标识所对应的所有树形结构中的其中一个树形结构是否与所述文本信息匹配。
步骤S205描述了获取场景标识为主界面的情况,若其中一个树形结构的所述叶子节点的信息包含所述文本信息,所述文本信息与所述其中一个树形结构的内容匹配;若任意一个所述树形结构的所述叶子节点的信息均不包含所述文本信息,所述文本信息与所述叶子节点的内容不匹配。
本实施例中主界面的场景标识为<main>,以主界面<main>为根节点,每一个场景标识为<main>的子节点,遍历每一个场景标识构成的树形结构。确定是否有其中一个场景标识构成的树形结构与文本信息匹配。
例如,对于主界面<main>有翻译和搜索图片两种场景,即<main>根节点有<translate>和<search_picture>两个子节点,<translate>和<search_picture>分别构成一个树形结构。按照步骤S204的方法,首先与翻译场景对应的场景标识下的树形结构进行匹配,若匹配成功,则根据翻译场景对应的场景标识下的树形结构执行步骤S206;
如果与翻译场景匹配失败,则与搜索图片场景对应的场景标识下树形结构进行匹配,若匹配成功,则根据搜索图片场景对应的场景标识下树形结构执行步骤S206;
如果均匹配失败,那么本地没有与文本信息匹配的匹配文档的文本信息,执行步骤S206。
步骤S206、根据所述匹配结果确定操作指令。
这里,终端获取的匹配结果有两种,一种是匹配成功,一种是匹配失败;其中,若匹配成功,将从匹配文档中的树形结构转化成预设的操作指令格式,这里预设的操作指令格式是终端可以理解和执行的操作指令格式,例如,用JSON(JavaScript Object Notation,JavaScript对象表示法)数据格式表示。若匹配失败,终端将文本信息上传值网络中的服务器,服务器对文本信息匹配后将操作指令发送给终端,终端获取该操作指令。
步骤S207、执行所述操作指令。
终端根据操作指令执行文本信息所要求的操作。例如对于“翻译一下今天成都的天气怎么样”,终端的翻译应用程序翻译句子“今天成都的天气怎么样”。
本公开的实施例提供的语义识别方法,通过在本地预存储匹配文档,将获取的语音信息转换为文本信息后,根据获取语音信息的场景标识,在本地匹配文档对应的场景标识下确定文本信息与匹配文档的某一子文档是否匹配,若匹配则获取操作指令并执行,若匹配失败则将文本信息上传至网络中的服务器进行匹配并获取操作指令。如此,能够实现在本地处理大部分文本信息的功能,进而提高了识别速率以及文本信息处理的针对性。
实施例四
本公开实施例提出了一种本地与云端服务器结合的语义识别方法。由于终端设备的语音使用场景比较有限,且对于场景要求较高,因此本实施例将相应场景下的指令进行拆分后形成预设的语法格式(此语法格式相当于匹配信息)。对于文本信息,先在本地与预设的语法格式进行匹配识别,如果匹配识别成功,就返回文本信息对应的指令数据内容。如果不成功,再将当前的文本信息送到云端服务器进行匹配识别。这样本地识别基本能将绝大部分的用户语音指令识别成功,使得在没有网络的情况下用户的大部分语音指令操作也能进行,同时因为是本地处理,所以对于用户指令的识别速度也快于云端识别的速度。文本信息在本地与预设的语法模式进行匹配时,本实施例提出采用基于改进的BNF方法来进行本地语义解析。
为了使本公开的目的、技术方案及优点更加清晰,下面结合附图分三部分对本实施例提供的语义识别方法进行说明,这三部分内容包括:语音语义识别、基于改进BNF方法的语义识别的BNF解析和基于改进BNF方法的语义识别的BNF匹配处理。
第一,图5-1描述了本文提出的方案中语义识别的处理流程,步骤如下:
步骤S311:终端设备的语音识别模块获取用户指令的语音数据;
步骤S312:终端设备的语音识别模块将语音数据转换为文本信息;
步骤S313:终端设备将文本信息传入本地语义分析模块进行本地语义分析;
步骤S314:终端设备判断本地语义分析模块是否识别出结果,如果成功识别出结果,转步骤S317;反之,转步骤S315;
步骤S315:终端设备将本地语义分析模块未能识别的文本信息上传至服务器进行语义识别;
步骤S316:终端设备获取服务器返回的语义识别的结果;
步骤S317:终端设备根据语义识别结果执行用户语音数据所对应的操作;
步骤S318:流程结束。
第二,图5-2描述了本实施例中基于改进BNF方法的语义识别的BNF解析处理流程,步骤如下:
步骤S321:开始;
步骤S322:终端设备从匹配文档中读取BNF语法内容;
步骤S323:终端设备解析BNF语法信息,将文本形式的语法信息解析转换成树形结构缓存,以用于后续的匹配搜索;
步骤S324:流程结束。
图5-2描述的步骤主要是将文本形式的语法信息解析转换成利于计算机匹配搜索的树形结构,并缓存在内存中,为图5-3所示的文本信息识别做准备。本部分提及的BNF语法内容,是根据语义识别应用场景中的指令集进行语句拆分和合并而成的,是预先装载在终端设备中的。并且BNF语法的内容可以由使用者自行按照BNF规则进行撰写和调整,从而使匹配信息的定制性和针对性都较强。
第三,图5-3描述了本实施例中基于改进BNF方法的语义识别的BNF匹配处理流程,步骤如下:
步骤S331:开始,终端设备获取待解析的文本信息和终端设备的场景标识,其中文本信息是语音识别模块处理语音信息后获得的信息;
步骤S332:终端设备通过场景标识从缓存的树形数据结构中获取对应的树形结构;
步骤S333:终端设备将文本信息与树形结构进行匹配搜索;
步骤S334:终端设备判断如果文本信息与树形结构的某一路径匹配成功,转步骤S336;反之,转步骤S335;
步骤S335:终端设备返回空数据;转步骤S337;
步骤S336:终端设备将匹配搜索到的路径信息转换为约定的数据结构返回;
步骤S337:流程结束。
需要说明地是,BNF是一种通过形式化符号来描述给定语言语法的方法,通常用于定义编程语言的语法规则。其内容如下:
1)在双引号中的字("word")代表着这些字符本身;
2)在双引号外的字(有可能有下划线)代表语法部分;
3)尖括号(<>)内包含的为该语句中的必选项;
4)方括号([])内包含的为该语句中的可选项;
5)大括号({})内包含的为该语句中的可重复0至无数次的项;
6)竖线(|)表示在竖线左右两边任选一项,相当于“OR”的意思;
7):=是“被定义为”的意思;
本实施例为了适应语义解析,增加了如下的一个定义:
8)<…>表示不确定的内容,为必选项。增加该定义,主要是用于表示语法中出现的不确定信息的(比如人名、地名、时间等不确定文本信息)。
下面结合实例对上述步骤进行说明:
场景一、终端设备的语音语义识别的全过程:
已知BNF文件的内容如下:
<main>:=<search_picture>|<translate>;
<search_picture>:=<Has><PhotoAlbum>[<Auxiliary>]<Picture><Interrogative>;
<Has>:="有";
<PhotoAlbum>:="相机"|"本地"|"屏幕截图"|
"截图"|"蓝牙"|"微信"|"QQ分组"|"qq分组"|"QQ"|"qq";
<Auxiliary>:="里的"|"里面的"|"上的"|"的";
<Picture>:="相片"|"相册"|"照片"|"图片"|"图库";
<Interrogative>:="吗?"|"吗"|"么?"|"么";
<translate>:=<translate_only>;
<translate_only>:=<TranslateCmd><...>;
<TranslateCmd>:="翻译一下"|"翻译下"|"翻译";
下面以文本信息为“有微信里的图片吗”为例进行说明:
终端设备开始语义分析后,需要两个输入参数,一个是需要进行语义识别的文本信息,另外一个是场景标识。文本信息是终端设备采集用户语音信息后,终端设备的语音识别模块识别语音信息后生成的文本信息。场景标识对应于上述BNF文件内容中:=左边被定义的标签(比如:<main>、<search_picture>、<translate>)等。上述BNF文件内容中定义的标签信息,可以采用树形数据结构来描述,如图5-4所示,图中树形数据结构中的根节点即所述场景标识,场景不同涉及到的后续的搜索路径的起点也会不同,即在终端设备不同的场景下,使用语义分析的场景是不同的。当在终端设备的主界面上使用语义分析,这时候用户说出的语音指令的场景标识是不清楚的,所以可以使用树形结构的根节点<main>作为场景对各个场景标识进行遍历,这样可以将各种情况都进行搜索。如果此时终端设备正在运行翻译应用程序,那么此时的场景标识是翻译场景,用户的指令则与翻译相关,场景标识(即树形结构的起点)选择<translate>,进行相关的语义识别。这样可以缩小匹配搜索的范围,使得语义识别的效率提高。
下面以<main>为场景、文本信息:“有微信里的图片吗”为例对整个流程进行说明,以下为该场景下语义识别的流程步骤:
步骤S341:终端设备通过场景<main>,获取其子节点<search_picture>和<translate>;
步骤S342:终端设备首先搜索<translate>分支,通过<translate>获取到子节点<translate_only>;
步骤S343:终端设备通过<translate_only>获取到子节点<TranslateCmd>和<…>;
步骤S344:终端设备将子节点<TranslateCmd>的内容(“翻译一下”、“翻译下”、“翻译”)分别从文本信息的第一个字符开始匹配,由于文本信息中“有微信里的图片吗”和子节点<TranslateCmd>的内容不匹配,因此该<translate>分支无法匹配文本信息,因此切换到搜索<search_picture>分支;
步骤S345:终端设备通过<search_picture>获取到其子节点<Has>、<PhotoAlbum>、<Auxiliary>、<Picture>、<Interrogative>;
步骤S346:终端设备将子节点<Has>的内容(“有”)在文本信息中进行搜索,本实施例中匹配到文本信息为“有微信里的图片吗”的第一个字符为“有”,故匹配成功;如果没有匹配到,则匹配失败,停止搜索;
步骤S347:在文本信息中“有”这个字符串以后搜索有没有<PhotoAlbum>的内容,本实施例中匹配到有该内容“微信”,故匹配成功;如果没有匹配到,则匹配失败,停止搜索;
步骤S348:终端设备在文本信息中“微信”这个字符串后搜索有没有<Auxiliary>的内容,本实施例中匹配到有该内容“里的”,故匹配成功;如果没有匹配到,则匹配失败,停止搜索;
步骤S349:终端设备在文本信息中“里的”这个字符串后搜索有没有<Picture>的内容,本实施例中匹配到有该内容“图片”,故匹配成功;如果没有匹配到,则匹配失败,停止搜索;
步骤S350:终端设备在文本信息中“图片”这个字符串后搜索有没有<Interrogative>的内容,本实施例中匹配到有该内容“吗”,故匹配成功;如果没有匹配到,则匹配失败,停止搜索;
步骤S351:终端设备检测文本信息中“吗”这字符串后是否有内容,若没有内容说明完全匹配,反之,则匹配失败,没有找到对应的语法信息。
上述步骤的搜索的路径信息如图5-5所示,最后根据图5-5所示的树形结构,返回预设的数据格式。例如采用JSON数据格式返回数据,上述树形结构的数据的JSON数据格式表示如下:
{"album":"微信","domain":"picsearch","action":1,"belocal":1}
上面这个JSON数据格式各个字段的意思为:“domain”为picsearch,表示图片相关的操作;“action”为1,表示搜索、查询之类的操作;“album”为“微信”,表示是微信中的内容;“belocal”为1,表示这个结果是本地识别返回的。从这个JSON数据中可知,终端设备根据各个字段的内容可以清楚的知道要执行搜索微信中的图片的操作。
场景二、终端设备中对于含有新增的BNF规则的语义的识别场景。
BNF继续使用场景一中的BNF文档的内容。
下面以场景为<main>,文本信息为“翻译一下今天成都的天气怎么样”为例进行整个流程的说明,此时处理流程为:
步骤S361:终端设备通过场景<main>,获取到<main>的子节点<search_picture>和<translate>;
步骤S362:终端设备先搜索<translate>分支,通过<translate>获取到子节点<translate_only>;
步骤S363:终端设备通过<translate_only>获取到子节点<TranslateCmd>和<…>;
步骤S364:终端设备将子节点<TranslateCmd>的内容("翻译一下"、"翻译下"、"翻 译")分别从文本信息的第一个字符开始匹配;
步骤S365:终端设备在文本信息中匹配到“翻译一下”这个字符串,由于<TranslateCmd>的下一个搜索节点是<…>,所以其匹配的字符串是不确定的,因此文本信息中"翻译一下"后的字符串就是<…>匹配到的内容。
通过上述步骤之后,最后搜索到的路径信息如图5-6所示。最后根据上述树形结构,返回约定的数据格式。例如约定采用JSON数据格式,则可以采用下面的方式返回:
{"domain":"translate","action":1,"content":"今天成都的天气怎么样","belocal":1}
上述JSON数据格式各个字段的意思是:“domain”为translate,表示语义识别类别为翻译相关的内容;“action”为1,表示翻译操作;“content”为"今天成都的天气怎么样",表示需要翻译的语句;“belocal”为1,表示这个结果是本地识别返回的。根据这个JSON数据,终端设备根据各个字段的内容清楚的知道需要翻译“今天成都的天气怎么样”,并执行翻译“今天成都的天气怎么样”。
需要说明地是,由于需要翻译的内容是不确定的,因此没有办法使用固定的标签内容来匹配,所以本公开中在BNF规则中增加了一个<…>标签的定义,用于表示匹配中出现的不确定的字符串。
场景三、终端设备中指定场景的语音语义的识别过程。
仍以场景一中的BNF文档为例。
假设此时终端设备正在运行图库软件,此时的用户发出的语音指令应该与图片搜索相关,因此终端设备获得场景标识<search_picture>,仍以文本信息“有微信里的图片吗”为例进行整个流程的说明,此时处理流程如下:
步骤S371:终端设备通过<search_picture>获取到其子节点<Has>、<PhotoAlbum>、<Auxiliary>、<Picture>、<Interrogative>;
步骤S372:终端设备将子节点<Has>的内容("有")在文本信息中进行匹配,匹配到有该信息,如果没有匹配到,则匹配失败,停止搜索;
步骤S373:终端设备在文本信息中“有”这个字符串以后匹配有没有<PhotoAlbum>的内容,匹配到有该内容“微信”,如果没有匹配到,则匹配失败,停止搜索;
步骤S374:终端设备在文本信息中“微信”这个字符串后匹配有没有<Auxiliary>的内容,本实施例中匹配到有该内容“里的”,如果没有匹配到,则匹配失败,停止搜索;
步骤S375:终端设备在文本信息中“里的”这个字符串后匹配有没有<Picture>的内容,本实施例中匹配到有该内容“图片”,如果没有匹配到,则匹配失败,停止搜索;
步骤S376:终端设备在文本信息中“图片”这个字符串后匹配有没有<Interrogative>的内容,本实施例中匹配到有该内容“吗”,如果没有匹配到,则匹配失败,停止搜索;
步骤S377:终端设备判断文本信息中“吗”这字符串后还有没有内容,本实施例中没有内容说明完全匹配,反之,则匹配失败,没有找到对应的语法信息。
通过上述步骤之后,终端设备最后搜索到的路径信息如图5-5所示。最后根据上述树 形结构可以返回场景一中的数据格式,在此不再赘述。
使用本实施例,对于终端设备上使用语音的场景有限的情况下,可以基本做到在不使用网络的情况下在本地即可识别用户的大部分常用的语音指令,并且本实施例的语义处理速度比C/S架构通过云端识别的方式要快,同时用户也可以自行修改和定制语音语义指令,语义识别模块的指令针对性强。
本公开的实施例提供的语义识别方法,通过在本地预存储匹配文档,将获取的语音信息转换为文本信息后,根据获取文本信息的场景标识,在本地匹配文档对应的场景标识下确定文本信息与匹配文档的某一子文档是否匹配,若匹配则获取操作指令并执行,若匹配失败则将文本信息上传至网络中的服务器进行匹配并获取操作指令。
实施例五
基于前述的实施例,本公开实施例提供了一种语义识别装置,如图5所示,所述装置500包括:获取模块501、第一确定模块502、第二确定模块503和执行模块504,其中:
所述获取模块501,用于获取根据用户输入的语音信息转换得到的文本信息。
所述第一确定模块502,用于根据所述文本信息与匹配文档中的文本信息,确定所述文本信息的语义识别结果。
所述第二确定模块503,用于根据所述识别结果确定操作指令。
所述执行模块504,用于执行所述操作指令。
这里,所述第一确定模块502进一步包括:
第一确定单元,用于确定所述文本信息对应的场景标识;
这里,所述第一确定单元进一步包括:
获取子单元,用于获取正在运行在所述终端上的应用程序的标识信息;
第三确定子单元,用于根据所述应用程序的标识信息查询预设的关系表,确定所述终端的场景标识,其中,所述关系表用于表明应用程序的标识信息与所述终端的场景标识之间的映射关系。
第二确定单元,用于根据所述场景标识和所述匹配文档确定子文档;
第一判断单元,用于判断所述文本信息与所述子文档的文本信息是否匹配,得到匹配结果;
这里,所述匹配文档按照场景标识分为子文档,每一所述子文档按照树形结构表示,其中所述树形结构中以场景标识为根节点、以子场景标识或文本信息为所述场景标识表示的根节点的子节点;对应地,所述第一判断单元包括:
第一判断子单元,用于判断所述树形结构的根节点是否有子场景标识的第一子节点;
第一确定子单元,用于如果所述树形结构的根节点有子场景标识的第一子节点,确定以所述第一子节点为根节点的子树中仅包含叶子节点的第二子节点集合;
第二确定子单元,用于确定所述每一个第二子节点所包含的第一叶子节点集合;
第二判断子单元,用于判断是否每一个第二子节点所包含的第一叶子节点集合中都存 在一个叶子节点所包含的文本信息存在于所述文本信息中;其中,如果每一个第二子节点所包含的第一叶子节点集合中都存在一个叶子节点所包含的文本信息存在于所述文本信息中则所述文本信息与所述子文档的文本信息匹配,如果有任何一个第二子节点中所包含的第一叶子节点集合中不存在一个叶子节点所包含的文本信息存在于所述文本信息中则所述文本信息与所述子文档的文本信息不匹配。
在本公开其他实施例中,所述第一判断单元还包括:
第三判断子单元,用于若所述文本信息对应的场景标识为预设的场景标识,则遍历所述场景标识对应的树形结构,判断所述所有场景标识所对应的所有树形结构中的其中一个树形结构是否与所述文本信息匹配;
若其中一个树形结构的所述叶子节点的信息包含所述文本信息,所述文本信息与所述其中一个树形结构的内容匹配;
若任意一个所述树形结构的所述叶子节点的信息均不包含所述文本信息,所述文本信息与所述叶子节点的内容不匹配。
第三确定单元,用于根据所述匹配结果,确定所述文本信息的语义识别结果;
这里,如果所述匹配结果为所述文本信息与所述子文档的文本信息匹配,则所述文本信息的语义识别结果为识别成功;如果所述匹配结果为所述文本信息与所述子文档的文本信息不匹配,则所述文本信息的语义识别结果为识别失败。
所述第二确定模块503进一步包括:
输出单元,用于若所述识别结果表明所述文本信息与所述匹配文档中的文本信息匹配,按预设格式输出与所述匹配文档中的文本信息对应的操作指令,所述操作指令指示终端处理所述文本信息所表示的操作;
上传单元,用于若所述识别结果表明所述文本信息与所述匹配文档中的文本信息不匹配,则将所述文本信息上传至网络中的服务器;
接收单元,用于接收所述服务器发送的操作指令。
这里需要指出的是:以上语义识别装置实施例的描述,与上述方法实施例的描述是类似的,具有同方法实施例相似的有益效果,因此不做赘述。对于本公开语义识别装置实施例中未披露的技术细节,请参照本公开方法实施例的描述而理解,为节约篇幅,因此不再赘述。
为实现上述目的,本公开还提供一种基于语义识别设备,所述设备包括:处理器;存储器,存储有可由所述处理器执行的指令;其中所述处理器被配置为执行如上任一实施例所述的方法。
为实现上述目的,本公开还提供一种存储有计算机程序的存储介质,所述计算机程序在由计算机的处理器运行时,使所述计算机执行如上任一实施例所述的方法。
本领域内的技术人员应明白,本公开的实施例可提供为方法、系统、或计算机程序产品。因此,本公开可采用硬件实施例、软件实施例、或结合软件和硬件方面的实施例的形 式。而且,本公开可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器和光学存储器等)上实施的计算机程序产品的形式。
本公开是参照根据本公开实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
以上所述,仅为本公开的较佳实施例而已,并非用于限定本公开的保护范围。
工业实用性
本公开提供的语义识别方法和装置,可应用于例如智能手机、智能电脑、便携智能设备、平板电脑、台式电脑、智能电视等终端中,通过将获取的语音信息转换为文本信息后,根据获取语音信息的场景标识,在匹配文档对应的场景标识下确定文本信息与匹配文档的某一子文档是否匹配,若匹配则获取操作指令并执行,若匹配失败则将文本信息上传至网络中的服务器进行匹配并获取操作指令。如此,能够实现在本地处理大部分文本信息的功能,且提高了识别速率和文本信息处理的针对性。

Claims (12)

  1. 一种语义识别方法,包括:
    获取根据用户输入的语音信息转换得到的文本信息;
    根据所述文本信息与匹配文档中的文本信息,确定所述文本信息的语义识别结果。
  2. 根据权利要求1中所述的方法,其中,在所述根据所述文本信息与匹配文档中的文本信息,确定所述文本信息的语义识别结果之后,所述方法还包括:
    根据所述识别结果确定操作指令;
    执行所述操作指令。
  3. 根据权利要求2所述的方法,其中,所述根据所述识别结果确定操作指令,包括:
    若所述识别结果表明所述文本信息与所述匹配文档中的文本信息匹配,按预设格式输出与所述匹配文档中的文本信息对应的操作指令,所述操作指令指示终端处理所述文本信息所表示的操作;
    若所述识别结果表明所述文本信息与所述匹配文档中的文本信息不匹配,则将所述文本信息上传至网络中的服务器;
    接收所述服务器发送的操作指令。
  4. 根据权利要求1所述的方法,其中,所述根据所述文本信息与匹配文档中的文本信息,确定所述文本信息的语义识别结果,包括:
    确定所述文本信息对应的场景标识;
    根据所述场景标识和所述匹配文档确定子文档;
    判断所述文本信息与所述子文档的文本信息是否匹配,得到匹配结果;
    根据所述匹配结果,确定所述文本信息的语义识别结果;其中,如果所述匹配结果为所述文本信息与所述子文档的文本信息匹配,则所述文本信息的语义识别结果为识别成功;如果所述匹配结果为所述文本信息与所述子文档的文本信息不匹配,则所述文本信息的语义识别结果为识别失败。
  5. 根据权利要求4所述的方法,其中,所述匹配文档按照场景标识分为子文档,每一所述子文档按照树形结构表示,其中所述树形结构中以场景标识为根节点、以子场景标识或文本信息为所述场景标识表示的根节点的子节点;对应地,所述判断所述文本信息与所述子文档的文本信息是否匹配,包括:
    判断所述树形结构的根节点是否有子场景标识的第一子节点;
    如果所述树形结构的根节点有子场景标识的第一子节点,确定以所述第一子节点为根节点的子树中仅包含叶子节点的第二子节点集合;
    确定所述每一个第二子节点所包含的第一叶子节点集合;
    判断是否每一个第二子节点所包含的第一叶子节点集合中都存在一个叶子节点所包含的文本信息存在于所述文本信息中;其中,如果每一个第二子节点所包含的第一叶子节点集合中都存在一个叶子节点所包含的文本信息存在于所述文本信息中则所述文本信息 与所述子文档的文本信息匹配,如果有任何一个第二子节点中所包含的第一叶子节点集合中不存在一个叶子节点所包含的文本信息存在于所述文本信息中则所述文本信息与所述子文档的文本信息不匹配。
  6. 根据权利要求4或5所述的方法,其中,所述判断所述文本信息与所述子文档的文本信息是否匹配,还包括:
    若所述文本信息对应的场景标识为预设的场景标识,则遍历所述场景标识对应的树形结构,判断所述所有场景标识所对应的所有树形结构中的其中一个树形结构是否与所述文本信息匹配;
    若其中一个树形结构的所述叶子节点的信息包含所述文本信息,所述文本信息与所述其中一个树形结构的内容匹配;
    若任意一个所述树形结构的所述叶子节点的信息均不包含所述文本信息,所述文本信息与所述叶子节点的内容不匹配。
  7. 根据权利要求4所述的方法,其中,所述确定所述文本信息对应的场景标识,包括:
    获取正在运行在所述终端上的应用程序的标识信息;
    根据所述应用程序的标识信息查询预设的关系表,得到所述终端的场景标识,其中所述关系表用于表明应用程序的标识信息与所述终端的场景标识之间的映射关系。
  8. 一种语义识别装置,其中,所述装置包括:获取模块和第一确定模块,其中:
    所述获取模块,设置为获取根据用户输入的语音信息转换得到的文本信息;
    所述第一确定模块,设置为根据所述文本信息与匹配文档中的文本信息,确定所述文本信息的语义识别结果。
  9. 根据权利要求8所述的装置,其中,所述装置还包括,第二确定模块和执行模块,其中:
    所述第二确定模块,设置为根据所述识别结果确定操作指令;
    所述执行模块,设置为执行所述操作指令。
  10. 根据权利要求8中所述的装置,其中,所述第一确定模块包括:
    第一确定单元,设置为确定所述文本信息对应的场景标识;
    第二确定单元,设置为根据所述场景标识和所述匹配文档确定子文档;
    第一判断单元,设置为判断所述文本信息与所述子文档的文本信息是否匹配,得到匹配结果;
    第三确定单元,设置为根据所述匹配结果,确定所述文本信息的语义识别结果;其中,如果所述匹配结果为所述文本信息与所述子文档的文本信息匹配,则所述文本信息的语义识别结果为识别成功;如果所述匹配结果为所述文本信息与所述子文档的文本信息不匹配,则所述文本信息的语义识别结果为识别失败。
  11. 一种语义识别设备,包括:
    处理器;
    存储器,存储有可由所述处理器执行的指令;
    其中所述处理器被配置为执行如权利要求1-7任一项所述的方法。
  12. 一种存储有计算机程序的存储介质,所述计算机程序在由计算机的处理器运行时,使所述计算机执行如权利要求1-7任一项所述的方法。
PCT/CN2017/083943 2017-02-06 2017-05-11 一种语义识别方法和装置 WO2018141140A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710067253.4A CN108399919A (zh) 2017-02-06 2017-02-06 一种语义识别方法和装置
CN201710067253.4 2017-02-06

Publications (1)

Publication Number Publication Date
WO2018141140A1 true WO2018141140A1 (zh) 2018-08-09

Family

ID=63040275

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/083943 WO2018141140A1 (zh) 2017-02-06 2017-05-11 一种语义识别方法和装置

Country Status (2)

Country Link
CN (1) CN108399919A (zh)
WO (1) WO2018141140A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111178081A (zh) * 2018-11-09 2020-05-19 中移(杭州)信息技术有限公司 语义识别的方法、服务器、电子设备及计算机存储介质
CN114639395A (zh) * 2020-12-16 2022-06-17 观致汽车有限公司 车载虚拟人物的语音控制方法、装置及具有其的车辆

Families Citing this family (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110875038A (zh) * 2018-09-03 2020-03-10 蔚来汽车有限公司 意图行为关系的定义方法及意图转换为行为的执行方法
CN109284467A (zh) * 2018-09-14 2019-01-29 阿里巴巴集团控股有限公司 一种用户生成内容ugc重复次数确定方法及装置
CN109194529B (zh) * 2018-11-01 2021-07-27 苏州畅途网络科技有限公司 一种用于虚拟SIM卡与服务器apdu的交互方法及装置
CN109410927B (zh) * 2018-11-29 2020-04-03 北京蓦然认知科技有限公司 离线命令词与云端解析结合的语音识别方法、装置和系统
CN109817212A (zh) * 2019-02-26 2019-05-28 浪潮金融信息技术有限公司 一种基于医疗自助终端的智能语音交互方法
CN110222159A (zh) * 2019-04-30 2019-09-10 电子科技大学 一种基于文本的人机交互训练方法及系统
CN110113473A (zh) * 2019-05-10 2019-08-09 南京硅基智能科技有限公司 一种基于云端虚拟手机的智能过滤来电的方法及系统
CN110176235B (zh) * 2019-05-23 2022-02-01 腾讯科技(深圳)有限公司 语音识别文的展示方法、装置、存储介质和计算机设备
CN112114770A (zh) * 2019-06-19 2020-12-22 百度在线网络技术(北京)有限公司 基于语音交互的界面引导方法、装置及设备
CN110418181B (zh) * 2019-07-25 2021-09-28 腾讯科技(深圳)有限公司 对智能电视的业务处理方法、装置、智能设备及存储介质
CN112509585A (zh) * 2020-12-22 2021-03-16 北京百度网讯科技有限公司 车载设备的语音处理方法、装置、设备及存储介质
CN113378843B (zh) * 2021-05-26 2024-04-19 递易(上海)智能科技有限公司 一种快递运单手机号识别结果校准方法、装置及存储介质
WO2023246151A1 (zh) * 2022-06-22 2023-12-28 海信视像科技股份有限公司 显示设备和控制方法

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070124142A1 (en) * 2005-11-25 2007-05-31 Mukherjee Santosh K Voice enabled knowledge system
CN101169780A (zh) * 2006-10-25 2008-04-30 华为技术有限公司 一种基于语义本体的检索系统和方法
CN102750949A (zh) * 2012-07-16 2012-10-24 深圳市车音网科技有限公司 语音识别方法和装置
CN103219007A (zh) * 2013-03-27 2013-07-24 谢东来 语音识别方法及装置
CN103425668A (zh) * 2012-05-16 2013-12-04 联想(北京)有限公司 信息检索方法及电子设备
CN103956169A (zh) * 2014-04-17 2014-07-30 北京搜狗科技发展有限公司 一种语音输入方法、装置和系统

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
AT6920U1 (de) * 2002-02-14 2004-05-25 Sail Labs Technology Ag Verfahren zur erzeugung natürlicher sprache in computer-dialogsystemen
CN101178705A (zh) * 2007-12-13 2008-05-14 中国电信股份有限公司 一种自然语言理解方法和人机交互智能系统
CN103294666B (zh) * 2013-05-28 2017-03-01 百度在线网络技术(北京)有限公司 语法编译方法、语义解析方法以及对应装置
CN103400579B (zh) * 2013-08-04 2015-11-18 徐华 一种语音识别系统和构建方法
CN104537036B (zh) * 2014-12-23 2018-11-13 华为软件技术有限公司 一种分析语言特征的方法及装置
CN106326295B (zh) * 2015-07-01 2021-12-14 中兴通讯股份有限公司 语义数据的存储方法及装置
CN106372054B (zh) * 2015-07-24 2020-10-09 中兴通讯股份有限公司 一种多语言语义解析的方法和装置
CN105912521A (zh) * 2015-12-25 2016-08-31 乐视致新电子科技(天津)有限公司 一种解析语音内容的方法及装置
CN106356056B (zh) * 2016-10-28 2017-12-01 腾讯科技(深圳)有限公司 语音识别方法和装置

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070124142A1 (en) * 2005-11-25 2007-05-31 Mukherjee Santosh K Voice enabled knowledge system
CN101169780A (zh) * 2006-10-25 2008-04-30 华为技术有限公司 一种基于语义本体的检索系统和方法
CN103425668A (zh) * 2012-05-16 2013-12-04 联想(北京)有限公司 信息检索方法及电子设备
CN102750949A (zh) * 2012-07-16 2012-10-24 深圳市车音网科技有限公司 语音识别方法和装置
CN103219007A (zh) * 2013-03-27 2013-07-24 谢东来 语音识别方法及装置
CN103956169A (zh) * 2014-04-17 2014-07-30 北京搜狗科技发展有限公司 一种语音输入方法、装置和系统

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111178081A (zh) * 2018-11-09 2020-05-19 中移(杭州)信息技术有限公司 语义识别的方法、服务器、电子设备及计算机存储介质
CN114639395A (zh) * 2020-12-16 2022-06-17 观致汽车有限公司 车载虚拟人物的语音控制方法、装置及具有其的车辆

Also Published As

Publication number Publication date
CN108399919A (zh) 2018-08-14

Similar Documents

Publication Publication Date Title
WO2018141140A1 (zh) 一种语义识别方法和装置
US11681877B2 (en) Systems and method for vocabulary management in a natural learning framework
JP6922538B2 (ja) Api学習
JP7420842B2 (ja) 自然言語理解(nlu)フレームワークにおける予測的類似性スコアリングサブシステム
JP2021018797A (ja) 対話の交互方法、装置、コンピュータ可読記憶媒体、及びプログラム
US10122380B2 (en) Compression of javascript object notation data using structure information
CN110727417B (zh) 一种数据处理方法和装置
WO2007144853A2 (en) Method and apparatus for performing customized paring on a xml document based on application
WO2018153273A1 (zh) 语义解析方法、装置及存储介质
US20190095524A1 (en) Context-based virtual assistant implementation
EP2455936A1 (en) Speech translation system, dictionary server device, and program
JP2022006173A (ja) 知識事前訓練モデルの訓練方法、装置及び電子機器
CN111666372B (zh) 解析查询词query的方法、装置、电子设备和可读存储介质
WO2020038337A1 (zh) 网络配置方法、装置及系统
KR101743731B1 (ko) 분산된 데이터를 통합하여 생성한 온톨로지를 기반으로 쿼리를 처리하는 방법 및 장치
US20230017449A1 (en) Method and apparatus for processing natural language text, device and storage medium
US11449500B2 (en) Method and apparatus for outputting structured query sentence
US10579738B2 (en) System and method for generating a multi-lingual and multi-intent capable semantic parser based on automatically generated operators and user-designated utterances relating to the operators
CN110231935A (zh) 一种脚本执行和更新的方法、装置、设备和存储介质
CN106933999B (zh) 一种独立搜索的ApacheLucene评分高亮方法
CN109739970A (zh) 信息处理方法及装置、以及电子设备
US11977852B2 (en) Anaphoric reference resolution using natural language processing and machine learning
US10762279B2 (en) Method and system for augmenting text in a document
KR102374034B1 (ko) 시드 파일 생성 장치 및 그 방법
US20210109960A1 (en) Electronic apparatus and controlling method thereof

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: 17894803

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: 17894803

Country of ref document: EP

Kind code of ref document: A1