WO2014190901A1 - 语法编译方法、语义解析方法、装置、计算机存储介质和设备 - Google Patents

语法编译方法、语义解析方法、装置、计算机存储介质和设备 Download PDF

Info

Publication number
WO2014190901A1
WO2014190901A1 PCT/CN2014/078596 CN2014078596W WO2014190901A1 WO 2014190901 A1 WO2014190901 A1 WO 2014190901A1 CN 2014078596 W CN2014078596 W CN 2014078596W WO 2014190901 A1 WO2014190901 A1 WO 2014190901A1
Authority
WO
WIPO (PCT)
Prior art keywords
function
exp
key
text
grammar
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/CN2014/078596
Other languages
English (en)
French (fr)
Inventor
王育军
贾磊
万广鲁
蒋正翔
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Baidu Online Network Technology Beijing Co Ltd
Original Assignee
Baidu Online Network Technology Beijing Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Baidu Online Network Technology Beijing Co Ltd filed Critical Baidu Online Network Technology Beijing Co Ltd
Priority to KR1020157033354A priority Critical patent/KR101726667B1/ko
Priority to JP2016515634A priority patent/JP6238494B2/ja
Priority to US14/892,818 priority patent/US20160124936A1/en
Publication of WO2014190901A1 publication Critical patent/WO2014190901A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/253Grammatical analysis; Style critique
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/205Parsing
    • G06F40/211Syntactic parsing, e.g. based on context-free grammar [CFG] or unification grammars
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/30Semantic analysis
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/42Syntactic analysis
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/42Syntactic analysis
    • G06F8/427Parsing

Definitions

  • the present invention relates to the field of computer application technologies, and in particular, to a syntax compilation method, a semantic analysis method, an apparatus, a computer storage medium, and a device.
  • Speech recognition and colloquial semantic analysis are two important technologies of speech interaction products.
  • Speech recognition is the conversion of speech content into text. Spoken semantic analysis is to understand the information carried by spoken speech signals.
  • the accuracy of speech recognition rate and colloquial semantic analysis directly affects the user experience.
  • the two context-free grammars of the W3C (World Wide Web Consortium) specification are mainly used to construct the recognition space, that is, the grammar based on the B NF (Bacchus paradigm) form or based on The syntax of the XML (Extensible Markup Language) format.
  • the present invention provides a syntax compilation method, a semantic analysis method, and a pair It should be installed to improve readability and maintainability.
  • a grammar compiling method according to a common statement of semantic expression, using a logical grammar intuitive language LGML to predefine a corresponding grammar description file and a part class description file, wherein the grammar description file is composed of a word class, an operator and a function. Description, the word class description file is used to describe a specific value of a word class;
  • the word class tree is hooked to the position of the corresponding word class in the syntax tree to form a grammar of the semantics.
  • the part-of-speech description file includes a term, or contains at least one of an operator and a function in addition to the term to describe the relationship between the terms.
  • the operator includes at least one of the following: an operator + indicates that two or more operands are connected in series;
  • the operator 0 indicates that the operand forms a non-negligible combination
  • the operator [] indicates that the operand forms a negligible combination
  • the function in the grammar description file includes at least one of the following functions:
  • the function &repeat(EXP, min, max) indicates that the 4 bar grammar fragment EXP repeats at least min times, up to max times;
  • the function &repeat(EXP, n) means repeating EXP for n times;
  • the function &perm(EXPl, EXP2, 7) means to make EXP1, EXP2,... do all the way to 'J;
  • the function &grammar(gammar_name) represents the syntax description file whose syntax name is grammar_name;
  • Function &magic(EXP, key, default, display) or function &magic(EXP, key, default) implements the mapping of EXP to semantic tag key; where function &magic(EXP, key, default) is in the syntax matching process, when EXP and one When the text fragment T matches successfully, the value of key is T, otherwise the value of key is default; function &magic(EXP, key, default, display) In the syntax matching process, when EXP matches a text fragment T successfully, key The value is display, otherwise the value of the key is default.
  • the function in the part-of-speech description file includes at least one of the following functions:
  • the function &repeat(EXP, min, max) represents a 4 bar grammar fragment EXP repeats at least min times, up to max times;
  • the function &repeat(EXP, n) means repeating EXP for n times;
  • the leaf node is a term in the word class description file or an external dictionary referenced
  • the non-leaf node is an operator or a function name
  • the operand of the non-leaf node is The content represented by each subtree of the non-leaf node.
  • the function &magic(EXP, key, default, display) or function &magic(EXP, key, default) is used as the semantic syntax tree.
  • the non-leaf node is identified, and the mapping table corresponding to the function &magic(EXP, key, default, display) or function &magic(EXP, key, default) is saved.
  • a semantic parsing method comprising:
  • the process of matching if a certain text segment in the text to be parsed is associated with the function &magic(EXP, key, default, display) or function &magic(EXP, key, default) If the identified subtree matches, the value of the key in the mapping table corresponding to the function &magic(EXP, key, default, display) or the function &magic(EXP, key, default) in the parsing result is the text fragment or The value of display in the mapping table.
  • a semantic parsing method comprising:
  • the value of the key in the mapping table corresponding to the matching function &magic(EXP, key, default, display) or the function &magic(EXP, key, default) in the parsing result is the text segment or The value of display in the mapping table.
  • only the text segment and the key function &magic(EXP, key, default, display) or key function &magic(EXP, key, default) are preset in the text to be parsed.
  • the identified subtrees match, and the grammar tree is The corresponding semantics are determined as the semantics of the text to be parsed.
  • a semantic parsing method comprising:
  • the text to be parsed is matched according to the preset sequence in a syntax tree obtained by using the foregoing syntax compilation method, and if the to-be-analyzed text completely matches the syntax tree, the syntax tree corresponds to Semantic determination is the semantics of the text to be parsed; otherwise step S2 is performed;
  • the value of the key in the mapping table corresponding to the matching function &magic(EXP key, default, display) or the function &magic(EXP, key, default) in the parsing result is the text fragment or mapping.
  • the value of display in the table is the text fragment or mapping.
  • a grammar compiling device comprising:
  • a file storage unit configured to store a semantic corresponding grammar description file and a part-of-speech description file, wherein the grammar description file and the part-of-speech description file are pre-defined according to a semantic common expression expression, using a logic-based grammar intuitive language LGML, in the grammar
  • LGML logic-based grammar intuitive language
  • a syntax tree generating unit configured to generate the syntax tree of the grammar description file and the part-of-speech tree of the part-of-speech description file according to the reduction method of the grammar description file and the part-of-speech description file respectively, and attach the word class tree to the word class tree The position of the corresponding word class in the grammar tree, forming the language The grammar tree of righteousness.
  • the part-of-speech description file includes a term, or contains at least one of an operator and a function in addition to the term to describe the relationship between the terms.
  • the operator includes at least one of the following: an operator + indicates that two or more operands are connected in series;
  • the operator 0 indicates that the operand forms a non-negligible combination
  • the operator [] indicates that the operand forms a negligible combination
  • the function in the grammar description file comprises at least one of the following functions:
  • the function &repeat(EXP, min, max) represents a 4 bar grammar fragment EXP repeats at least min times, up to max times;
  • the function &repeat(EXP, n) means repeating EXP for n times;
  • the function &perm(EXPl, EXP2, 7) means to make EXP1, EXP2,... do all the way to 'J;
  • the function &grammar(gammar_name) represents the syntax description file whose syntax name is grammar_name;
  • Function &magic(EXP, key, default, display) or function &magic(EXP, key, default) implements the mapping of EXP to semantic tag key; where function &magic(EXP, key, default) is in the syntax matching process, when EXP and one When the text fragment T matches successfully, key The value of the key is T, otherwise the value of the key is default; the function &magic(EXP, key, default, display) In the syntax matching process, when the EXP matches a text fragment T successfully, the value of key is display, otherwise the value of key Is default.
  • the function in the part-of-speech description file includes at least one of the following functions:
  • the function &repeat(EXP, min, max) represents a 4 bar grammar fragment EXP repeats at least min times, up to max times;
  • the function &repeat(EXP, n) means repeating EXP for n times;
  • the leaf node is a term in the word class description file or an external dictionary referenced
  • the non-leaf node is an operator or a function name
  • the operand of the non-leaf node is The content represented by each subtree of the non-leaf node.
  • the function &magic(EXP, key, default, display) or the function &magic(EXP, key, default) is identified as a non-leaf node in the semantic syntax tree, and the file is stored.
  • the unit further saves the mapping table corresponding to the function &magic(EXP key, default, display) or the function &magic(EXP, key, default).
  • a semantic parsing device comprising:
  • a whole sentence matching unit configured to match the to-be-analyzed text on the syntax tree obtained by the syntax compiling device according to the preset order, if the whole sentence matching unit determines that the to-be-analyzed text is completely related to the syntax tree
  • the matching result is sent to the result determining unit, and the result determining unit is configured to determine the semantics corresponding to the syntax tree as the semantics of the text to be parsed when the matching result is received.
  • the text segment in the text is matched with the subtree identified by the function &magic(EXP, key, default, display) or the function &magic(EXP, key, default), and the result is obtained in the parsing result obtained by the result determining unit.
  • the value of the key in the mapping table corresponding to the function &magic(EXP, key, default, display) or function &magic(EXP, key, default) is the value of the display in the text fragment or mapping table.
  • a semantic parsing device comprising:
  • a semantic mapping matching unit configured to perform forward maximum matching on the grammar tree obtained by the grammar compiling device according to the preset order in the grammar tree obtained by the grammar compiling device, if there is a text segment and the grammar tree in the to-be-analyzed text If the subtree matched by the function &magic(EXP, key, default, display) or the function &magic(EXP, key, default) matches, the matching result is sent to the result determining unit;
  • a result determining unit configured to determine, according to the matching result, the semantics corresponding to the syntax tree as the semantics of the text to be parsed.
  • the function &magic(EXP, key, default, display) or the function &magic(EXP, key, default) corresponds to the key in the mapping table.
  • the value is the value of display in the text fragment or mapping table.
  • the semantic mapping matching unit only has a text segment and a key function &magic(EXP, key, default, display) or a key function &magic preset in the syntax tree in the text to be parsed.
  • the matching result is sent to the result determining unit.
  • a semantic parsing device comprising:
  • a full sentence matching unit for parsing the text to be parsed in the syntax tree obtained by the grammar compiling device Matching in the preset order, if the whole sentence matching unit determines that the to-be-analyzed text completely matches the syntax tree, the matching result is sent to the result determining unit; otherwise, the semantic mapping matching unit is triggered;
  • a semantic mapping matching unit configured to perform a forward maximum matching on the syntax tree according to the preset sequence after being triggered, if a text segment and the syntax tree exist in the to-be-analyzed text If the subtree matched by the function &magic(EXP, key, default, display) or the function &magic(EXP, key, default) matches, the matching result is sent to the result determining unit;
  • the result determining unit is configured to determine, when the matching result is received, the semantics corresponding to the syntax tree as the semantics of the text to be parsed.
  • the result determining unit receives the matching result of the semantic mapping matching unit, the matching function &magic(EXP, key, default, display) or function &magic(EXP,
  • the value of the key in the mapping table corresponding to key, default) is the value of display in the text fragment or mapping table.
  • the grammar compiling method and the semantic parsing method provided by the present invention are based on the LGML pre-defined grammar description file and the part-of-speech description file, which is closer to the human oral expression, compared with the BNF and XML interpretation levels. More readable and easier to maintain.
  • FIG. 1a is a schematic diagram of a syntax tree of a grammar description file according to an embodiment of the present invention
  • FIG. 1b, FIG. 1c and FIG. 1d are schematic diagrams of a part-of-speech tree of a part-of-speech description file according to an embodiment of the present invention
  • Figure le is a schematic diagram of a semantic syntax tree provided by an embodiment of the present invention
  • 2a is a schematic diagram of a syntax tree of a grammar description file according to an embodiment of the present invention
  • FIG. 2b and FIG. 2c are diagrams showing an example of a word class tree of a word class description file according to an embodiment of the present invention
  • FIG. 2 is a schematic diagram of a semantic syntax tree according to an embodiment of the present invention.
  • FIG. 3 is a syntax tree for semantic correspondence of query weather according to an embodiment of the present invention
  • FIG. 4 is a structural diagram of a syntax compiling apparatus according to an embodiment of the present invention
  • FIG. 5 is a structural diagram of a first semantic parsing apparatus according to an embodiment of the present invention
  • FIG. 6 is a structural diagram of a second semantic parsing apparatus according to an embodiment of the present invention
  • a structural diagram of a semantic parsing device A structural diagram of a semantic parsing device.
  • the grammar compilation method provided by the present invention is based on a new grammar description language, namely LGML (Logical Grammar by Manifest Language), which is different from the existing BNF or XML complex structure, and more Close to the order and description of natural spoken language.
  • LGML Logical Grammar by Manifest Language
  • the common expressions for each semantic expression use LGML to predefine the corresponding grammar.
  • the grammar defined by LGML consists of two parts: a grammar description file and a word class description file.
  • the common statement description is composed of operators, word classes and functions.
  • the grammar description file usually defines various statement descriptions in an exhaustive manner. Word classes and functions are usually used as operands of operators in a grammar description file. In addition to appearing as a separate operation object in a grammar description file, a word class can also appear as a parameter in a function.
  • a word class is a unified identifier for a number of terms (referring to words or phrases) that have the same meaning.
  • a word class specifically contains a term defined in the word class description file corresponding to the word class, that is, the word class description file is used to describe the specific value of the word class, and the word class description file also includes operators and/or functions to describe The relationship between the terms.
  • the word class description file can be manually defined or the result of machine mining can be used.
  • the operators in the grammar description file and the word class description file may include but are not limited to the following:
  • the operator + indicates that two or more operands are concatenated.
  • the so-called concatenation is to describe the statements in order (the operator I represents the relationship of two or more operands in parallel, and the so-called parallel relationship is the same meaning of the operand alternative expression.
  • 0 means that the operands form a non-negligible combination.
  • the operator [] indicates that the operands form a negligible combination.
  • the operator "" indicates that an external dictionary is referenced, and the vocabulary in the dictionary is a parallel relationship.
  • the functions in the part-of-speech description file may include but are not limited to the following:
  • the function &repeat(EXP, min, max) represents a 4 bar grammar fragment. EXP repeats at least min times, up to max times.
  • the function &repeat(EXP, n) means that EXP is repeated n times.
  • &perm(EXPl, EXP2, 7) means to make EXP1, EXP2,... do all the way to 'J.
  • &perm(EXPl, EXP2, EXP3) is equivalent to the juxtaposition of 6 concatenations:
  • the syntax description file can include but is not limited to the following functions:
  • the function &grammar(gammar_name) is usually written at the beginning of the grammar file, indicating that the grammar name of a statement expression is grammar_name , which identifies the grammar description file expressed by the statement.
  • the function &magic(EXP, key, default, display) and the function &magic(EXP, key, default) implement the mapping of EXP to the semantic tag key.
  • the grammar description file can be defined as:
  • the word class description file can be defined as: [willingness] : I + (I want I want);
  • the grammar compilation provided in the present invention is to compile the semantics into a grammar tree based on LGML, and use the preset order for the grammar description file and the word class description file in the process of compiling the grammar tree (this In the embodiment of the invention, the reduction method from left to right is used, and the syntax tree generated according to the relationship between the function and the operator is generated. Specifically, the left-to-right reduction method is used to generate a syntax tree from the syntax description file, and the word class description file is generated into a word class tree by using a left-to-right reduction method, and then the word class tree is hooked in the syntax tree. Corresponding to the location of the word class, the final word class tree is attached to the leaf node of the syntax tree.
  • the leaf nodes are word classes
  • the non-leaf nodes are operators
  • the operands of the operators that are non-leaf nodes are the contents represented by the subtrees of the non-leaf nodes. Since the functions &repeat(EXP, min, max), &repeat(EXP, n), &perm(EXPl, EXP2, ...) can all be expressed as a combination of the syntax fragment EXP and the operator, and the function &magic(EXP, key , default, display) and &magic(EXP, key, default) are implemented because of the mapping relationship. Therefore, the &magic function needs to be identified in the syntax tree.
  • the way of identification can be as a non-leaf node, and the &magic function exists at the same time.
  • the corresponding mapping table for example, the identifier of the &magic function and its corresponding mapping table may have a location pointing.
  • the reduction is made from left to right.
  • the syntax tree of the generated grammar description file is shown in Figure la.
  • the leaf nodes are the word classes [A], [B], and [C]
  • the non-leaf nodes are operators.
  • the operands of the non-leaf nodes "+,[]" are [A] and [B]
  • the non-leaf nodes ⁇ " are the contents of their subtrees
  • the subtree contents of the left branch are [[A] + [B ⁇ ]
  • the subtree content of the right branch is [C].
  • semantic word class description file is:
  • the word class is round-to-right reduced, and the word class trees corresponding to the word classes [A], [B], and [C] are shown in Figure lb, Figure lc, and Figure Id. Then, each word class tree is attached to the position of the corresponding word class on the syntax tree of the grammar description file, and finally the grammar tree of the above semantics is formed as shown in FIG.
  • each word class is reduced from left to right, and the word classes [X] and [Y] are corresponding.
  • the word class tree is shown in Figure 2b and Figure 2c, respectively.
  • each word class tree is attached to the position of the corresponding word class on the syntax tree of the grammar description file, and finally the grammar tree forming the semantics is as shown in FIG. 2d.
  • the leaf node is a term in the word class description file or an external dictionary referenced
  • the non-leaf node is an operator or a function name
  • the operand of the non-leaf node is the non-leaf node The content of each subtree represented.
  • mapping tables of all &magic functions in the grammar description file can merge the mapping tables of all &magic functions in the grammar description file to form a mapping table for storage and query.
  • the text to be parsed may be a text result such as a recognition of the user's voice, thereby semantically parsing the text result to obtain the semantics expressed by the text, or may be a text such as a user inputting a search engine, and semantically inputting the text input by the user. Parsing the semantics it expresses, etc., is no longer exhaustive.
  • the text to be parsed is matched with each syntax tree, and the matching method from left to right is used in the matching, and the semantics corresponding to the matching syntax tree are determined as the semantics of the text to be parsed.
  • the whole sentence matching method may be used, or the semantic mapping matching method may be adopted, or the combination of the whole sentence matching and the semantic mapping matching may be adopted, that is, the whole sentence is matched first, and if there is no matching result, the matching is performed.
  • the so-called whole sentence matching is that the text to be parsed can completely match the grammar tree of a certain semantic LGML.
  • This matching method is a universal and highly accurate matching method, no matter what function is used in LGML.
  • the semantic mapping matching is that the text segment in the text to be parsed can match the grammar segment defined by the &magic function, that is, all or part of the text in the text to be parsed can match the subtree identified by the &magic function in the grammar tree, and the parsed text is determined.
  • the semantics of the &magic The semantics of the function mapping.
  • the matching manner between the text to be parsed and the syntax tree is basically the same as the matching manner of the existing syntax tree, except that the order is performed in a left-to-right order, and only the text to be parsed can be completely matched in the syntax tree. Then it is determined that the match is successful. Specifically, in the matching process, if the subtree identified by the &magic function is matched, the mapping result is obtained from the mapping table indicated by the &magic function as a result of the analysis according to the matching result of the subtree identified by the &magic function.
  • the value of the key in the mapping table indicated by the &magic function in the parsing result is the display of the text segment or the mapping table. Value.
  • the subtree to which it is identified can use the semantic mapping matching method, that is, the subtree identified by the &magic function is matched to the text to be parsed to the greatest extent, if there is text in the text to be parsed If the fragment matches the subtree identified by the &magic function, the semantics of the text to be parsed may be determined as the semantics of the syntax tree.
  • the value of the key in the mapping table indicated by the &magic function is the text fragment. Or the value of display in the mapping table.
  • the text to be parsed is eabdc
  • the syntax tree is forward-matched to the text to be parsed (ie, e is matched from the beginning of the text to be parsed, if the matching is unsuccessful)
  • the result is that the text fragment abd can match the syntax tree, and then the semantics of the text to be parsed can be determined as the semantics corresponding to the syntax tree, and the value of the key in the parsing result is The value of display.
  • the manner of matching the semantic mapping after the whole sentence matching may be obtained, that is, if the whole sentence matches Failure to perform semantic mapping matching.
  • each magic mapping table can be combined into a form of a mapping table.
  • the text to be parsed is "tell me temperature"
  • the relevant grammar fragment of "tell me” is not defined in the grammar
  • the whole sentence fails to match, and then the semantic mapping is matched, where the text fragment "temperature” and the subtree of magic3
  • the semantic mapping is successfully matched.
  • the semantics of the text to be parsed can still be considered as the query weather, and magicl is mapped to "today”.
  • Magic2 maps to "LBS” and magic3 maps to "weather”, so the value of date in the parsing result is "today”, the value of place is “LBS”, and the value of weather is "weather”.
  • the key magic function can be set in the semantic mapping matching process. Only when the subtree corresponding to the key magic function is successfully matched, the semantic mapping is successfully matched.
  • the magic3 function in the syntax tree shown in Figure 3 can be set as a key magic function, and only if the subtree corresponding to the magic function matches successfully, the semantic mapping is successfully matched. For example, when the text to be parsed is "I want to know Beijing", although "I want to know Beijing" the entire sentence fails to match, but the "Beijing" text fragment matches the subtree corresponding to the magic2 function, but due to the key If the magic3 function does not match successfully, the semantic mapping will not be considered as a successful error. The text to be parsed cannot be considered as the semantics of the query weather.
  • FIG. 4 is a structural diagram of a syntax compiling apparatus according to an embodiment of the present invention.
  • the syntax compiling apparatus mainly includes a file storage unit 41 and a syntax tree generating unit 42.
  • the file storage unit 41 stores a semantically corresponding grammar description file and a part-of-speech description file.
  • the grammar description file and the part-of-speech description file are expressed in accordance with semantic common expressions, which are pre-defined based on LGML, and the word class, the operator and the function in the grammar description file.
  • semantic common expressions which are pre-defined based on LGML, and the word class, the operator and the function in the grammar description file.
  • the word class description file is used to describe the specific value of the word class.
  • the above operators may include, but are not limited to, at least one of the following operators:
  • the operator + indicates that more than two operands are concatenated
  • the operator 0 indicates that the operand forms a non-negligible combination
  • the operator [] indicates that the operand forms a negligible combination
  • the functions in the part-of-speech description file may include but are not limited to the following:
  • the function &repeat(EXP, min, max) represents a 4 bar grammar fragment. EXP repeats at least min times, up to max times.
  • the function &repeat(EXP, n) means that EXP is repeated n times.
  • &perm(EXPl, EXP2, 7) means to make EXPl, EXP2,... do all the way to 'J.
  • &perm(EXPl, EXP2, EXP3) is equivalent to the juxtaposition of 6 concatenations:
  • the function &grammar(gammar_name) is usually written at the beginning of the grammar file, indicating that the grammar name of a statement expression is grammar_name, which identifies the grammar description file expressed by the statement.
  • the function &magic(EXP, key, default, display) and the function &magic(EXP, key, default) implement the mapping of the EXP to the semantic tag key.
  • the syntax tree generating unit 42 is responsible for generating a syntax tree of the grammar description file and a word class tree of the word class description file according to a reduction method of the grammar description file and the part class description file in a preset order (for example, using a left-to-right order),
  • the word class tree is attached to the position of the corresponding word class in the syntax tree to form a semantic syntax tree.
  • the leaf nodes are word classes
  • the non-leaf nodes are operators
  • the operands of the operators that are non-leaf nodes are the contents represented by the subtrees of the non-leaf nodes. Since the functions &repeat(EXP, min, max), &repeat(EXP, n), &perm(EXPl, EXP2, ...) can all be expressed as a combination of the syntax fragment EXP and the operator, and the function &magic(EXP, key , default, display) and &magic(EXP, key, default) are implemented because of the mapping relationship. Therefore, the &magic function needs to be identified in the syntax tree. The identification can be performed as a non-leaf node, and the &magic can be further saved.
  • the semantic mapping corresponding to the function for example, the location of the &magic function identifier and its corresponding mapping table may exist.
  • the leaf node is a term in the word class description file or an external dictionary referenced
  • the non-leaf node is an operator or a function name
  • the operand of the non-leaf node is each child of the non-leaf node.
  • the content represented by the tree If there are more than two &magic functions in the grammar description file, the mapping tables of all &magic functions in the grammar description file can be merged to form a mapping table for convenient storage and query.
  • the semantic parsing apparatus provided by the present invention can be implemented by using three structures, one simply using the whole sentence matching method, and the other simply using the semantic mapping.
  • FIG. 5 is a structural diagram of a first semantic parsing apparatus according to an embodiment of the present invention.
  • the semantic parsing apparatus uses a whole sentence matching manner. As shown in FIG. 5, the semantic parsing apparatus includes: a whole sentence matching unit 51 and Result determination unit 52.
  • the whole sentence matching unit 51 matches the to-be-analyzed texts on the syntax tree of the above semantics in a preset order. If it is determined that the to-be-analyzed text completely matches the syntax tree, the matching result is sent to the result determining unit 52.
  • the semantics corresponding to the syntax tree are determined as the semantics of the text to be parsed.
  • the sub-tree identified by the &magic function may be matched during the entire sentence matching process, if a text fragment in the text to be parsed is associated with the function &magic(EXP, key, default, display) or the function &magic(EXP, key, If the subtrees identified by the defaults match, the key of the mapping table corresponding to the function &magic(EXP, key, default, display) or the function &magic(EXP, key, default) in the parsing result obtained by the result determining unit 52 is taken. Value is the text fragment Or the value of display in the mapping table.
  • FIG. 6 is a structural diagram of a second semantic parsing apparatus according to an embodiment of the present invention.
  • the semantic parsing apparatus uses semantic mapping matching only, and the method is applied to a syntax tree including a subtree identified by a &magic function.
  • the semantic parsing apparatus includes: a semantic mapping matching unit 61 and a result determining unit 62.
  • the semantic mapping matching unit 61 performs forward maximum matching on the semantic syntax tree of the to-be-parsed text according to a preset order, if there is a function in the text to be parsed and a function &magic(EXP, key, default, display) or function in the syntax tree If the subtrees identified by &magic(EXP, key, default) match, the matching result is sent to the result determining unit 62.
  • the result determining unit 62 determines the semantics corresponding to the syntax tree as the semantics of the text to be parsed upon receiving the matching result. Further, in the analysis result obtained by the result determining unit 62, the value of the key in the mapping table corresponding to the function &magic(EXP, key, default, display) or the function &magic(EXP, key, default) is the text segment or The value of display in the mapping table.
  • the key magic function can be set in the semantic mapping matching process. Only when the subtree corresponding to the key magic function is successfully matched, the semantic mapping is successfully matched. That is, the semantic mapping matching unit 61 only has the sub-tree identified by the key function &magic(EXP, key, default, display) or the key function &magic(EXP, key, default) preset in the text segment and the syntax tree in the text to be parsed. When the match is made, the matching result is sent to the result determining unit 62.
  • FIG. 7 is a structural diagram of a third semantic parsing apparatus according to an embodiment of the present invention.
  • the semantic parsing apparatus uses a combination of whole sentence matching and semantic mapping matching, wherein the semantic mapping matching is generally applicable to a syntax tree containing a &magic function. The case of the corresponding subtree.
  • the semantic parsing apparatus includes: a whole sentence matching unit 71, a semantic mapping matching unit 72, and a result.
  • the unit 73 is determined.
  • the whole sentence matching unit 71 matches the to-be-analyzed text in a semantic sequence on the semantic syntax tree. If the whole sentence matching unit 71 determines that the to-be-analyzed text completely matches the syntax tree, the matching result is sent to the result determining unit 73; otherwise The semantic mapping matching unit 72 is triggered.
  • the text to be parsed is forward-forwarded in the predetermined order in the syntax tree. If there is a function in the text to be parsed and the function in the syntax tree &magic(EXP, key, default, display) Or the subtrees identified by the function &magic(EXP, key, default) match, and the matching result is sent to the result determining unit 73.
  • the result determining unit 73 can determine the semantics corresponding to the syntax tree as the semantics of the text to be parsed, regardless of whether the matching result of the whole sentence matching unit 71 or the matching result of the semantic mapping matching unit 72 is received.
  • the result determining unit 73 receives the matching result of the semantic mapping matching unit 72, the matching function &magic(EXP, key, default, display) or the function &magic(EXP, key, default) in the analysis result corresponds to
  • the value of the key in the mapping table is the value of the display in the text fragment or mapping table.
  • the key magic function can be set, and only if the subtree corresponding to the key magic function is successfully matched, the semantic mapping is successfully matched. That is, the semantic mapping matching unit 72 only has a key function &magic(EXP, key, default, display) or a key function preset in the text segment and the syntax tree in the text to be parsed.
  • the matching result is sent to the result determining unit 73.
  • the syntax trees of each semantic are usually matched one by one to determine the semantics corresponding to the text to be parsed, in an embodiment of the present invention.
  • the descriptions are made by taking a match on a syntax tree as an example, and the matching process for each syntax tree is the same.
  • multi-level semantic analysis is used, and then the semantic analysis method and the semantic analysis device provided by the embodiments of the present invention can be implemented in each level of semantic analysis.
  • the disclosed apparatus and method can be implemented in other ways.
  • the device embodiments described above are merely illustrative.
  • the division of the units is only a logical function division, and the actual implementation may have another division manner.
  • the components displayed as units may or may not be physical units, i.e., may be located in one place, or may be distributed over multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solution of the embodiment.
  • each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware or in the form of hardware plus software functional units.
  • the above-described integrated unit implemented in the form of a software functional unit can be stored in a computer readable storage medium.
  • the software functional unit is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor to perform the method of various embodiments of the present invention. Part of the steps.
  • the foregoing storage medium includes: a U disk, a mobile hard disk, a Read-Only Memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like, which can store program codes. .

Landscapes

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

Abstract

本发明提供了一种语法编译方法、语义解析方法以及对应装置,按照语义的常用语句表达采用基于逻辑语法直观语言(LGML)预先定义对应的语法描述文件和词类描述文件,在语法描述文件中由词类、操作符和函数构成常用语句的描述,词类描述文件用于描述词类的具体取值;将语法描述文件和词类描述文件分别按照预设顺序的归约方法生成语法描述文件的语法树和词类描述文件的词类树,将词类树挂接在语法树中对应词类的位置,形成语义的语法树,从而实现语法编译。基于该方式建立的语义的语法树,采用整句匹配、语义映射匹配或者整句匹配和语义映射匹配相结合的方式进行语义解析。

Description

、 , 、¾ 7J , , , „
云¾¾ 万 、 语义罕 万 、 、 务 口父合 本申请要求了申请日为 2013年 05月 28日,申请号为 201310203987.2 发明名称为 "语法编译方法、 语义解析方法以及对应装置"的中国专利申 请的优先权。
技术领域
本发明涉及计算机应用技术领域, 特别涉及语法编译方法、 语义解 析方法、 装置、 计算机存储介质和设备。
背景技术
语音识别和口语语义解析是语音交互产品的两个重要技术, 语音识 别是将语音的内容转换成文字, 口语语义解析是理解口语语音信号承载 的信息。 语音识别率和口语语义解析的准确度直接影响用户体验。 为了 提高语音识别率和口语语义解析的准确度, 目前主要釆用的是 W3C (万 维网联盟)规范的两种上下文无关语法来构建识别空间, 即利用 B NF (巴 克斯范式) 形式的语法或基于 XML (可扩展标记语言)格式的语法。
人们说话的方式为自然口语,行为、措词和文本输入都有较大差异, 例如口语中存在语法不严格和语序颠倒, W3 C推荐的 B NF语法和 XML格 式的语法为主流的大词汇量连续语音识别器所应用, 但由于 BNF和 XML 的解释层级深, 釆用这两种语法进行的语义映射和句法理解定义非常复 杂, 具有可读性差和可维护性差的缺陷, 且很难进行相关的语法编译和 语义解析。
发明内容
有鉴于此, 本发明提供了一种语法编译方法、 语义解析方法以及对 应装置, 以便于提高可读性和可维护性。
具体技术方案如下:
一种语法编译方法, 按照语义的常用语句表达釆用基于逻辑语法直 观语言 LGML预先定义对应的语法描述文件和词类描述文件,在所述语 法描述文件中由词类、 操作符和函数构成常用语句的描述, 所述词类描 述文件用于描述词类的具体取值;
将所述语法描述文件和词类描述文件分别按照预设顺序的归约方法 生成语法描述文件的语法树和词类描述文件的词类树;
将所述词类树挂接在所述语法树中对应词类的位置, 形成所述语义 的语法 4对。
根据本发明一优选实施方式, 所述词类描述文件中包含词项, 或者 除了包含词项外还包含操作符和函数中的至少一种以描述各词项之间的 关系。
根据本发明一优选实施方式所述操作符包括以下至少一种: 操作符 +表示两个以上的操作数串联;
操作符 I表示两个以上的操作数并列关系;
操作符 0表示操作数形成一个不可忽略的组合;
操作符 []表示操作数形成一个可忽略的组合;
操作符; 表示语句结束;
操作符: 表示词类描述文件中词类的解释关系;
操作符 "" 表示引用了外部词典。
根据本发明一优选实施方式, 所述语法描述文件中的函数包括以下 函数中的至少一种: 函数 &repeat(EXP, min, max) 表示 4巴语法片段 EXP重复最少 min遍, 最多 max遍;
函数 &repeat(EXP, n)表示把 EXP重复 n遍;
函数 &perm(EXPl, EXP2, ...) 表示把 EXP1, EXP2,…做全排歹' J; 函数 &grammar(gammar_name)表示语法名称为 grammar—name的语 法描述文件;
函数 &magic(EXP, key, default, display)或函数 &magic(EXP, key, default)实现 EXP到语义标签 key的映射; 其中函数 &magic(EXP, key, default)在语法匹配过程中, 当 EXP与一个文本片段 T匹配成功时, key 的值为 T,否则 key的值为 default;函数 &magic(EXP, key, default, display) 在语法匹配过程中, 当 EXP与一个文本片段 T匹配成功时, key的值为 display, 否则 key的值为 default。
根据本发明一优选实施方式, 所述词类描述文件中的函数包括以下 函数中的至少一种:
函数 &repeat(EXP, min, max) 表示 4巴语法片段 EXP重复最少 min遍, 最多 max遍;
函数 &repeat(EXP, n)表示把 EXP重复 n遍;
函数 &perm(EXPl, EXP2, ...) 表示把 EXP1, EXP2,…做全排歹' J。
根据本发明一优选实施方式, 在所述语义的语法树中, 叶节点为词 类描述文件中的词项或者引用的外部词典,非叶节点为操作符或函数名, 非叶节点的操作数为该非叶节点的各子树表示的内容。
根据本发明一优选实施方式, 在所述语义的语法树中所述函数 &magic(EXP, key, default, display)或函数 &magic(EXP, key, default)作为 非叶节点进行标识,保存所述函数 &magic(EXP, key, default, display)或函 数 &magic(EXP, key, default)对应的映射表。
一种语义解析方法, 该语义解析方法包括:
将待解析文本在釆用上述语法编译方法得到的语法树上按照所述预 设顺序进行匹配, 如果所述待解析文本完全与所述语法树匹配, 则将所 述语法树所对应的语义确定为所述待解析文本的语义。
根据本发明一优选实施方式, 在所述匹配的过程中, 如果所述待解 析文本中某文本片段与所述函数 &magic(EXP, key, default, display)或函 数 &magic(EXP, key, default)所标识的子树匹配, 则在解析结果中所述函 数 &magic(EXP, key, default, display)或函数 &magic(EXP, key, default)所 对应的映射表中 key的取值为该文本片段或映射表中 display的取值。
一种语义解析方法, 该语义解析方法包括:
将待解析文本在釆用上述语法编译方法得到的语法树上按照所述预 设顺序进行前向最大匹配, 如果所述待解析文本中存在文本片段与所述 语法树中函数 &magic(EXP, key, default, display)或函数 &magic(EXP, key default)所标识的子树匹配, 则将所述语法树所对应的语义确定为所述待 解析文本的语义。
根据本发明一优选实施方式,在解析结果中匹配的函数 &magic(EXP, key, default, display)或函数 &magic(EXP, key, default)所对应的映射表中 key的取值为该文本片段或映射表中 display的取值。
根据本发明一优选实施方式, 只有所述待解析文本中存在文本片段 与所述语法树中预设的关键函数 &magic(EXP, key, default, display)或关 键函数 &magic(EXP, key, default)所标识的子树匹配, 才将所述语法树所 对应的语义确定为所述待解析文本的语义。
一种语义解析方法, 该语义解析方法包括:
51、 将待解析文本在釆用上述语法编译方法得到的语法树上按照所 述预设顺序进行匹配, 如果所述待解析文本完全与所述语法树匹配, 则 将所述语法树所对应的语义确定为所述待解析文本的语义; 否则执行步 骤 S2;
52、 将所述待解析文本在所述语法树上按照所述预设顺序进行前向 最大匹配, 如果所述待解析文本中存在文本片段与所述语法树中函数 &magic(EXP, key, default, display)或函数 &magic(EXP, key, default)所标 识的子树匹配, 则将所述语法树所对应的语义确定为所述待解析文本的 语义。
根据本发明一优选实施方式,在解析结果中匹配的函数 &magic(EXP key, default, display)或函数 &magic(EXP, key, default)所对应的映射表中 key的取值为该文本片段或映射表中 display的取值。
一种语法编译装置, 该语法编译装置包括:
文件存储单元,用于存储语义对应的语法描述文件和词类描述文件, 所述语法描述文件和词类描述文件是按照语义的常用语句表达釆用基于 逻辑语法直观语言 LGML预先定义的, 在所述语法描述文件中由词类、 操作符和函数构成常用语句的描述, 所述词类描述文件用于描述词类的 具体取值;
语法树生成单元, 用于将所述语法描述文件和词类描述文件分别按 照预设顺序的归约方法生成语法描述文件的语法树和词类描述文件的词 类树, 将所述词类树挂接在所述语法树中对应词类的位置, 形成所述语 义的语法树。
根据本发明一优选实施方式, 所述词类描述文件中包含词项, 或者 除了包含词项外还包含操作符和函数中的至少一种以描述各词项之间的 关系。
根据本发明一优选实施方式, 所述操作符包括以下至少一种: 操作符 +表示两个以上的操作数串联;
操作符 I表示两个以上的操作数并列关系;
操作符 0表示操作数形成一个不可忽略的组合;
操作符 []表示操作数形成一个可忽略的组合;
操作符; 表示语句结束;
操作符: 表示词类描述文件中词类的解释关系;
操作符 "" 表示引用了外部词典。
根据本发明一优选实施方式, 所述语法描述文件中的函数包括以下 函数中的至少一种:
函数 &repeat(EXP, min, max) 表示 4巴语法片段 EXP重复最少 min遍, 最多 max遍;
函数 &repeat(EXP, n)表示把 EXP重复 n遍;
函数 &perm(EXPl, EXP2, ...) 表示把 EXP1, EXP2,…做全排歹' J; 函数 &grammar(gammar_name)表示语法名称为 grammar—name的语 法描述文件;
函数 &magic(EXP, key, default, display)或函数 &magic(EXP, key, default)实现 EXP到语义标签 key的映射; 其中函数 &magic(EXP, key, default)在语法匹配过程中, 当 EXP与一个文本片段 T匹配成功时, key 的值为 T,否则 key的值为 default;函数 &magic(EXP, key, default, display) 在语法匹配过程中, 当 EXP与一个文本片段 T匹配成功时, key的值为 display, 否则 key的值为 default。
根据本发明一优选实施方式, 所述词类描述文件中的函数包括以下 函数中的至少一种:
函数 &repeat(EXP, min, max) 表示 4巴语法片段 EXP重复最少 min遍, 最多 max遍;
函数 &repeat(EXP, n)表示把 EXP重复 n遍;
函数 &perm(EXPl, EXP2, ...) 表示把 EXP1, EXP2,…做全排歹' J。
根据本发明一优选实施方式, 在所述语义的语法树中, 叶节点为词 类描述文件中的词项或者引用的外部词典,非叶节点为操作符或函数名, 非叶节点的操作数为该非叶节点的各子树表示的内容。
根据本发明一优选实施方式, 在所述语义的语法树中所述函数 &magic(EXP, key, default, display)或函数 &magic(EXP, key, default)作为 非叶节点进行标识,所述文件存储单元进一步保存所述函数 &magic(EXP key, default, display)或函数 &magic(EXP, key, default)对应的映射表。
一种语义解析装置, 该语义解析装置包括:
整句匹配单元, 用于将待解析文本在由上述语法编译装置得到的语 法树上按照所述预设顺序进行匹配, 如果所述整句匹配单元确定所述待 解析文本完全与所述语法树匹配, 则将匹配结果发送给结果确定单元; 结果确定单元, 用于接收到所述匹配结果时, 将所述语法树所对应 的语义确定为所述待解析文本的语义。
根据本发明一优选实施方式, 在所述匹配的过程中, 如果所述待解 析文本中某文本片段与所述函数 &magic(EXP, key, default, display)或函 数 &magic(EXP, key, default)所标识的子树匹配, 则在所述结果确定单元 得到的解析结果中所述函数 &magic(EXP, key, default, display)或函数 &magic(EXP, key, default)所对应的映射表中 key的取值为该文本片段或 映射表中 display的取值。
一种语义解析装置, 该语义解析装置包括:
语义映射匹配单元, 用于将待解析文本在由上述语法编译装置得到 的语法树上按照所述预设顺序进行前向最大匹配, 如果所述待解析文本 中存在文本片段与所述语法树中函数 &magic(EXP, key, default, display) 或函数 &magic(EXP, key, default)所标识的子树匹配, 则将匹配结果发送 给结果确定单元;
结果确定单元, 用于在接收到所述匹配结果时, 将所述语法树所对 应的语义确定为所述待解析文本的语义。
根据本发明一优选实施方式, 在所述结果确定单元得到的解析结果 中所述函数 &magic(EXP, key, default, display)或函数 &magic(EXP, key, default)所对应的映射表中 key的取值为该文本片段或映射表中 display 的取值。
根据本发明一优选实施方式, 所述语义映射匹配单元只有在所述待 解析文本中存在文本片段与所述语法树中预设的关键函数 &magic(EXP, key, default, display)或关键函数 &magic(EXP, key, default)所标识的子树 匹配时, 才将匹配结果发送给所述结果确定单元。
一种语义解析装置, 该语义解析装置包括:
整句匹配单元, 用于将待解析文本在由语法编译装置得到的语法树 上按照所述预设顺序进行匹配, 如果所述整句匹配单元确定所述待解析 文本完全与所述语法树匹配,则将匹配结果发送给结果确定单元;否则, 触发语义映射匹配单元;
语义映射匹配单元, 用于受到触发后, 将所述待解析文本在所述语 法树上按照所述预设顺序进行前向最大匹配, 如果所述待解析文本中存 在文本片段与所述语法树中函数 &magic(EXP, key, default, display)或函 数 &magic(EXP, key, default)所标识的子树匹配, 则将匹配结果发送给结 果确定单元;
结果确定单元, 用于接收到匹配结果时, 将所述语法树对应的语义 确定为所述待解析文本的语义。
根据本发明一优选实施方式, 所述结果确定单元如果接收到所述语 义映射匹配单元的匹配结果, 则在解析结果中匹配的函数 &magic(EXP, key, default, display)或函数 &magic(EXP, key, default)所对应的映射表中 key的取值为该文本片段或映射表中 display的取值。
由以上技术方案可以看出, 本发明提供的语法编译方法和语义解析 方法基于 LGML预先定义的语法描述文件和词类描述文件,其更接近于 人的口语表达, 相比较 BNF和 XML解释层级浅, 可读性更强且更易维 护。
附图说明
图 1 a为本发明实施例提供的一个语法描述文件的语法树示意图; 图 lb、 图 lc和图 Id为本发明实施例提供的词类描述文件的词类树 示意图;
图 le为本发明实施例提供的一个语义的语法树示意图; 图 2a为本发明实施例提供的一个语法描述文件的语法树实例图; 图 2b和图 2c为本发明实施例提供的一个词类描述文件的词类树实 例图;
图 2d为本发明实施例提供的一个语义的语法树实例图;
图 3为本发明实施例提供的针对查询天气的语义对应的语法树; 图 4为本发明实施例提供的语法编译装置的结构图;
图 5为本发明实施例提供的第一种语义解析装置的结构图; 图 6为本发明实施例提供的第二种语义解析装置的结构图; 图 7为本发明实施例提供的第三种语义解析装置的结构图。
具体实施方式
为了使本发明的目的、 技术方案和优点更加清楚, 下面结合附图和 具体实施例对本发明进行详细描述。
本发明所提供的语法编译方法基于一种新的语法描述语言, 即基于 逗辑语法直观语言 ( LGML, Logical Grammar by Manifest Language ) , 该 LGML不同于现有的 BNF或 XML的复杂结构,而更接近于自然口语 的顺序和描述方式。针对各语义的常用语句表达釆用 LGML预先定义对 应的语法, 釆用 LGML定义的语法由两部分构成: 语法描述文件和词类 描述文件。
在语法描述文件中由操作符, 词类和函数构成常用的语句描述, 该 语法描述文件通常釆用穷举的方式预先定义各种语句描述。 词类和函数 在语法描述文件中通常作为操作符的操作数, 词类除了在语法描述文件 中作为一个独立的操作对象出现之外, 也可以作为函数中的参数出现。 词类是对若干具有相同含义的词项(指词汇或词组)所进行的统一标识, 一个词类具体包含的词项在该词类对应的词类描述文件中定义, 也就是 说, 词类描述文件用于描述词类的具体取值, 在词类描述文件中也会包 含操作符和 /或函数来描述各词项之间的关系。词类描述文件可以釆用人 工定义的方式, 也可以釆用机器挖掘的结果。
下面对本发明实施例提供的 LGML的上述具体构成进行详细描述。 首先语法描述文件和词类描述文件中的操作符可以包括但不限于以下几 种:
操作符 +表示两个以上的操作数串联,所谓串联就是按顺序描述语句 ( 操作符 I表示两个以上的操作数并列的关系, 所谓并列的关系就是操 作数择一的表达相同含义。 操作符 0表示操作数形成一个不可忽略的组合。
操作符 []表示操作数形成一个可忽略的组合。
操作符; 表示语句结束。
操作符: 表示词类描述文件中词类的解释关系。
操作符 "" 表示引用了外部词典, 词典中的词汇是并列关系。
词类描述文件中的函数可以包括但不限于以下几种:
函数 &repeat(EXP, min, max) 表示 4巴语法片段 EXP重复最少 min遍, 最多 max遍。
函数 &repeat(EXP, n)表示把 EXP重复 n遍。
函数 &perm(EXPl, EXP2, ...) 表示把 EXP1, EXP2,…做全排歹' J。例如: &perm(EXPl, EXP2, EXP3)等价于 6个串联项的并列:
XP2+EXP 1 +EXP3) I (EXP3+EXP 1 +EXP2)I(EXP3+EXP2+EXP 1 ) 语法描述文件中除了上面的函数 &repeat(EXP, min, max) , 函数 &repeat(EXP, n)和函数 &perm(EXPl, EXP2,…)之外, 还可以包括但不限 于以下几种函数:
函数 &grammar(gammar_name) 通常写在语法文件开头,表示一个语 句表达的语法名称为 grammar_name , 该 grammar—name标识该语句表达 的语法描述文件。
函数 &magic(EXP, key, default, display)和函数 &magic(EXP, key, default)实现 EXP到语义标签 key的映射。
其中函数 &magic(EXP, key, default)在语法匹配过程中,当 EXP与一 个文本片段 T匹配成功时, key的值为 T。否则 key的值为缺省值 default。
函数 &magic(EXP, key, default, display) 在语法匹配过程中, 当 EXP 与一个文本片段 T匹配成功时, key的值为显示值 display, 否则 key的 值为 default
下面举一个例子, 假设针对查询天气的语句表达预先定义语法描述 文件和词类描述文件, 则语法描述文件可以定义为:
&grammar( weather);
[【意愿】 +【查询】 ]+
&perm(
&magic([【时间】 ], date, today), &magic([【地点】 ], lace,
LBS)
)+ [的] +&magic(【天气指标】 , weather, error, weather); 词类描述文件可以定义为: 【意愿】 : 我 + (想 I想要);
【查询】 : 知道 I查询;
【时间】 : 今天 I明天;
【地点】 : &repeat( "place. die" + [省 I市], 1,2);
【天气指标】 : 气温 I湿度; 本发明中提供的语法编译是将语义基于 LGML编译成一棵语法树, 在编译语法树的过程中对上述语法描述文件和词类描述文件釆用预设顺 序 (本发明实施例中釆用从左至右的顺序) 的归约方法, 按照函数和操 作符所约束的关系生成的语法树。 具体地, 釆用从左至右的归约方法, 将语法描述文件生成语法树, 并且釆用从左至右的归约方法将词类描述 文件生成词类树, 然后将词类树挂接在语法树中对应词类的位置, 最终 各词类树挂接在语法树的叶子节点上。
在将语法描述文件生成语法树时, 叶节点为词类, 非叶节点为操作 符,作为非叶结点的操作符的操作数为该非叶结点的各子树表示的内容。 由于函数 &repeat(EXP, min, max)、 &repeat(EXP, n)、 &perm(EXPl, EXP2, ...)都可以表示成语法片段 EXP与操作符的组合的形式, 而函数 &magic(EXP, key, default, display)和 &magic(EXP, key, default)由于实现 的是映射关系, 因此需要在语法树中对 &magic函数进行标识, 标识的方 式可以是作为一个非叶节点出现,同时存在该 &magic函数所对应的映射 表,例如该 &magic函数的标识与其对应的映射表之间可以存在一个位置 指向。
下面举一些简单的例子: 假设某语义的语法描述文件的内容为: [ 【A】 + 【B】 ]1 【C】
从左至右进行归约, 生成的语法描述文件的语法树如图 la所示, 在 图 la中, 叶节点为词类 【A】 、 【B】和【C】 , 非叶结点为操作符, 其 中非叶节点 "+,[]" 的操作数为 【A】 和 【B】 , 非叶节点 Ί" 为其各子 树的内容, 左边分支的子树内容为[【A】 + 【B】 ], 右边分支的子树内 容为 【C】 。
如果该语义的词类描述文件分别为:
【A】 : a+b;
【B】 : [c+d]+e;
【C】 : fig;
那么分别对各词类进行从左至右的归约, 词类【A】 、 【B】和【C】 对应的词类树分别为图 lb、 图 lc和图 Id所示。 然后将各词类树挂接在 语法描述文件的语法树上对应词类的位置, 最终形成上述语义的语法树 如图 le所示。
假设某语义的语法描述文件的内容为:
&magic(( 【X】 I 【Y】 ),key,default,display)
从左至右归约, 生成的语法描述文件的语法树如图 2a所示, 非叶节 点 "magic, +,, 标识 &magic函数, 并且存在一个 magic映射表, 并指示 出该 magic函数的语法树在映射表中的位置。
假设该语义的词类描述文件为:
【X】 : [a+b]+c;
【Y】 : [a+b]+d;
那么分别对各词类进行从左至右的归约, 词类【X】和【Y】对应的 词类树分别为图 2b和图 2c所示。 然后将各词类树挂接在语法描述文件 的语法树上对应词类的位置, 最终形成该语义的语法树如图 2d所示。
也就是说, 最终形成的语义的语法树中, 叶节点为词类描述文件中 的词项或者引用的外部词典, 非叶节点为操作符或函数名, 非叶节点的 操作数为该非叶节点的各子树表示的内容。
如果在语法描述文件中存在两个以上的 &magic函数,则可以将语法 描述文件中的所有 &magic函数的映射表合并形成一个映射表,以方便存 储和查询。
在完成上述语法编译后, 就可以在语法编译形成的语法树的基础上 进行语义解析。 待解析文本可以是诸如对用户的语音进行识别的文本结 果, 从而对该文本结果进行语义解析得到其所表达的语义, 也可以是诸 如用户输入搜索引擎的文本, 对用户输入的该文本进行语义解析得到其 所表达的语义, 等等, 在此不再——穷举。
在进行语义解析时, 是将待解析文本与各语法树进行匹配, 在匹配 时釆用从左至右的匹配方式, 将匹配的语法树所对应的语义确定为待解 析文本的语义。 在匹配过程中可以釆用整句匹配的方式, 也可以釆用语 义映射匹配的方式, 或者釆用整句匹配和语义映射匹配相结合的方式, 即先整句匹配, 若无匹配结果再进行语义映射匹配的方式。 所谓整句匹 配是待解析文本能够完全与某语义的 LGML的语法树匹配, 这种匹配方 式是一种通用的、 准确度较高的匹配方式, 无论 LGML中釆用什么函数 均适用。语义映射匹配是待解析文本中的文本片段能够与 &magic函数定 义的语法片段匹配, 即待解析文本中的全部或部分文本能够与语法树中 &magic函数所标识的子树匹配,则确定该解析文本的语义包含该 &magic 函数所映射的语义。
整句匹配时, 将待解析文本与语法树的匹配方式与现有语法树匹配 方式基本相同, 只是顺序是按照从左至右的顺序进行, 只有待解析文本 能够在语法树上完全匹配到,则确定匹配成功。特别地,在匹配过程中, 如果匹配到 &magic函数所标识的子树, 则根据 &magic函数所标识的子 树的匹配结果从该 &magic函数所指示的映射表中获取映射结果作为解 析结果。 即, 如果待解析文本中某文本片段与 &magic函数所标识的子树 完全匹配,则在解析结果中该 &magic函数所指示的映射表中的 key的取 值为该文本片段或映射表中 display的取值。
以图 2b所示语法树为例, 假设待解析文本为: abd, 那么从左至右 在语法树上进行匹配, Ί" 左边子树没有匹配, 但右边子树能够完全匹 配, 因此可以确定 abd的语义解析结果为该语义树所对应的语义, 在解 析结果中 key的取值为 display的取值。 如果待解析文本为 eabdc, 则与 该语法树不匹配, 该语法树所对应的语义不是该待解析文本的语义。
对于 &magic函数这种特殊的函数,对其所标识的子树可以釆用语义 映射匹配的方式,即将 &magic函数所标识的子树与待解析文本做前向最 大匹配,如果待解析文本中存在文本片段与 &magic函数所标识的子树匹 配, 则可以确定该待解析文本的语义为该语法树对应的语义, 在解析结 果中该 &magic函数所指示的映射表中的 key的取值为该文本片段或映射 表中 display的取值。
同样以图 2b所示语法树为例, 叚设待解析文本为 eabdc, 将该语法 树与待解析文本进行前向最大匹配 (即从 e作为待解析文本的开始进行 匹配, 如果匹配不成功再从 a开始作为待解析文本的开始进行匹配, 如 果不成功再从 b开始, 依次类推) , 结果是其中的文本片段 abd能够与 该语法树匹配, 则可以确定待解析文本的语义为该语法树对应的语义, 解析结果中 key的取值为 display的取值。
鉴于整句匹配的准确性和语义映射匹配的高覆盖率, 为了整合两种 匹配方式的优点, 在本发明实施例中可以釆取先整句匹配后语义映射匹 配的方式, 即如果整句匹配失败再进行语义映射匹配。
下面举一个具体的实例, H没针对查询天气的语义对应的语法树如 图 3所示, 需要说明的是, 在该图中为了描述方便将该 &magic的标识 magic进行了编号,在实际情况中语法树中的节点 magic标识是相同的, 但存在与其对应的 magic映射表的位置指向, 图 3中为了清楚没有釆用 位置指向的方式, 而是将 magic标识釆用编号的方式来呈现与 magic映 射表的指向关系。 另外, 在实际情况中可以将各 magic映射表合并成一 张映射表的形式。
如果待解析文本为 "我想知道北京温度",能够整句匹配成功, magicl 映射 J "today (今天)", magic2映射 J ";)匕京", magic3映射 J "weather (天气信息) " , 因此该待解析文本的语义为查询天气, 解析结果中曰 期 date的取值为 "today" , 地点 place的取值为 "北京" , 天气 weather 的取值为 "weather" , 用户虽然没有说今天, 但由于语法中规定 magicl 的操作符为 []是可忽略的, 因此取默认值 "today" 。
如果待解析文本为 "告诉我温度" , 由于语法中未定义 "告诉我" 的相关语法片段, 因此整句匹配失败, 然后进行语义映射匹配,其中 "温 度" 这一文本片段与 magic3的子树匹配成功, 则语义映射匹配成功, 仍 可以认为该待解析文本的语义为查询天气, magicl映射到 "today" , magic2映射到 "LBS" , magic3映射到 "weather" , 因此解析结果中 date的取值为 "today", place的取值为 "LBS", weather的取值为 "weather"。
另外在语义映射匹配过程中可以对关键的 magic函数进行设置, 只 有关键的 magic函数对应的子树匹配成功才认为语义映射匹配成功。 例 如可以将图 3所示的语法树中 magic3函数设置为关键的 magic函数,只 有该 magic函数对应的子树匹配成功才认为语义映射匹配成功。 举个例 子, 当待解析文本为 "我想知道北京" , 虽然 "我想知道北京" 整句匹 配失败, 但 "北京" 这一文本片段与 magic2函数对应的子树匹配成功, 但由于关键的 magic3函数没有匹配成功,仍不会认为语义映射匹配成功 error, 不能认为该待解析文本为查询天气的语义。
还可能存在这样的情况, 在一个语义的语法树中进行语义映射匹配 时, 存在多个 &magic函数的子树都能够与待解析文本匹配的情况, 为了 解决这种情况下的冲突, 可以釆用预先定义各子树的优先级的方式来解 决, 或者以匹配的词项数目最大等约束条件来解决。
以上是对本发明所提供的方法进行的描述, 下面结合实施例对本发 明提供的装置进行详细描述。
图 4为本发明实施例提供的语法编译装置的结构图, 如图 4所示, 该语法编译装置主要包括文件存储单元 41和语法树生成单元 42。
文件存储单元 41存储语义对应的语法描述文件和词类描述文件,语 法描述文件和词类描述文件是按照语义的常用语句表达釆用基于 LGML 预先定义的, 在语法描述文件中由词类、 操作符和函数构成常用语句的 描述, 词类描述文件用于描述词类的具体取值。
在词类描述文件中包含词项, 或者除了包含词项外还包含操作符和 函数中的至少一种以描述各词项之间的关系。
上述的操作符可以包括但不限于以下操作符中的至少一种:
操作符 +表示两个以上的操作数串联;
操作符 I表示两个以上的操作数并列关系;
操作符 0表示操作数形成一个不可忽略的组合;
操作符 []表示操作数形成一个可忽略的组合;
操作符; 表示语句结束;
操作符: 表示词类描述文件中词类的解释关系;
操作符 "" 表示引用了外部词典。
词类描述文件中的函数可以包括但不限于以下几种:
函数 &repeat(EXP, min, max) 表示 4巴语法片段 EXP重复最少 min遍, 最多 max遍。
函数 &repeat(EXP, n)表示把 EXP重复 n遍。
函数 &perm(EXPl, EXP2, ...) 表示把 EXPl, EXP2,…做全排歹' J。例如: &perm(EXPl, EXP2, EXP3)等价于 6个串联项的并列:
XP2+EXP 1 +EXP3 )1 (EXP3+EXP 1 +EXP2)I(EXP3+EXP2+EXP 1 )
语法描述文件中除了上面的函数 &repeat(EXP, min, max) , 函数
&repeat(EXP, n)和函数 &perm(EXPl, EXP2,…)之外, 还可以包括但不限 于以下几种函数:
函数 &grammar(gammar_name) 通常写在语法文件开头,表示一个语 句表达的语法名称为 grammar_name , 该 grammar—name标识该语句表达 的语法描述文件。 函数 &magic(EXP, key, default, display)和函数 &magic(EXP, key, default)实现 EXP到语义标签 key的映射。
其中函数 &magic(EXP, key, default)在语法匹配过程中,当 EXP与一 个文本片段 τ匹配成功时, key的值为 T。 否则 key的值为 default。
函数 &magic(EXP, key, default, display) 在语法匹配过程中, 当 EXP 与一个文本片段 T匹配成功时, key的值为 display, 否则 key的值为 default。
语法树生成单元 42负责将语法描述文件和词类描述文件分别按照 预设顺序 (例如釆用从左至右的顺序) 的归约方法生成语法描述文件的 语法树和词类描述文件的词类树, 将词类树挂接在语法树中对应词类的 位置, 形成语义的语法树。
在将语法描述文件生成语法树时, 叶节点为词类, 非叶节点为操作 符,作为非叶结点的操作符的操作数为该非叶结点的各子树表示的内容。 由于函数 &repeat(EXP, min, max)、 &repeat(EXP, n)、 &perm(EXPl, EXP2, ...)都可以表示成语法片段 EXP与操作符的组合的形式, 而函数 &magic(EXP, key, default, display)和 &magic(EXP, key, default)由于实现 的是映射关系, 因此需要在语法树中对 &magic函数进行标识, 标识的方 式可以是作为一个非叶节点出现,同时进一步保存该 &magic函数所对应 的语义映射,例如该 &magic函数的标识与其对应的映射表之间可以存在 一个位置指向。
在最终生成的语义的语法树中, 叶节点为词类描述文件中的词项或 者引用的外部词典, 非叶节点为操作符或函数名, 非叶节点的操作数为 该非叶节点的各子树表示的内容。 如果在语法描述文件中存在两个以上的 &magic函数,则可以将语法 描述文件中的所有 &magic函数的映射表合并形成一个映射表,以方便存 储和查询。
基于图 4所示的语法编译装置得到的语义的语法树, 本发明提供的 语义解析装置可以釆用三种结构实现, 一种单纯釆用整句匹配的方式, 另一种单纯釆用语义映射匹配的方式, 还有一种釆用整句匹配和语义映 射匹配相结合的方式。
图 5为本发明实施例提供的第一种语义解析装置的结构图, 该语义 解析装置单纯釆用整句匹配的方式,如图 5所示,该语义解析装置包括: 整句匹配单元 51和结果确定单元 52。
整句匹配单元 51将待解析文本在上述语义的语法树上按照预设顺 序进行匹配, 如果确定待解析文本完全与语法树匹配, 则将匹配结果发 送给结果确定单元 52。
结果确定单元 52接收到匹配结果时,将语法树所对应的语义确定为 待解析文本的语义。
可以看出, 整句匹配是待解析文本能够完全与某语义的 LGML的语 法树匹配, 这种匹配方式是一种通用的、 准确度较高的匹配方式, 无论 LGML中釆用什么函数均适用。
特别地,在整句匹配的过程中可能会匹配到 &magic函数所标识的子 树, 如果待解析文本中某文本片段与函数 &magic(EXP, key, default, display)或函数 &magic(EXP, key, default)所标识的子树匹配, 则在结果确 定单元 52得到的解析结果中函数 &magic(EXP, key, default, display)或函 数 &magic(EXP, key, default)所对应的映射表中 key的取值为该文本片段 或映射表中 display的取值。
图 6为本发明实施例提供的第二种语义解析装置的结构图, 该语义 解析装置单纯釆用语义映射匹配,这种方式应用于包含将 &magic函数所 标识的子树的语法树, 如图 6所示, 该语义解析装置包括: 语义映射匹 配单元 61和结果确定单元 62。
语义映射匹配单元 61将待解析文本在语义的语法树上按照预设顺 序进行前向最大匹配, 如果待解析文本中存在文本片段与语法树中函数 &magic(EXP, key, default, display)或函数 &magic(EXP, key, default)所标 识的子树匹配, 则将匹配结果发送给结果确定单元 62。
结果确定单元 62在接收到匹配结果时,将语法树所对应的语义确定 为待解析文本的语义。 更进一步地,在结果确定单元 62得到的解析结果 中函数 &magic(EXP, key, default, display)或函数 &magic(EXP, key, default)所对应的映射表中 key的取值为该文本片段或映射表中 display 的取值。
另外在语义映射匹配过程中可以对关键的 magic函数进行设置, 只 有关键的 magic函数对应的子树匹配成功才认为语义映射匹配成功。 即 语义映射匹配单元 61只有在待解析文本中存在文本片段与语法树中预 设的关键函数 &magic(EXP, key, default, display)或关键函数 &magic(EXP, key, default)所标识的子树匹配时,才将匹配结果发送给结果确定单元 62。
图 7为本发明实施例提供的第三种语义解析装置的结构图, 该语义 解析装置釆用整句匹配和语义映射匹配相结合的方式, 其中语义映射匹 配通常适用于语法树中包含 &magic函数对应的子树的情况。如图 7所示, 该语义解析装置包括: 整句匹配单元 71、 语义映射匹配单元 72和结果 确定单元 73。
整句匹配单元 71将待解析文本在语义的语法树上按照预设顺序进 行匹配,如果整句匹配单元 71确定待解析文本完全与语法树匹配, 则将 匹配结果发送给结果确定单元 73 ; 否则, 触发语义映射匹配单元 72。
语义映射匹配单元 72受到触发后,将待解析文本在语法树上按照预 设顺序进行前向最大匹配, 如果待解析文本中存在文本片段与语法树中 函数 &magic(EXP, key, default, display)或函数 &magic(EXP, key, default) 所标识的子树匹配, 则将匹配结果发送给结果确定单元 73。
结果确定单元 73无论接收到整句匹配单元 71匹配结果还是语义映 射匹配单元 72的匹配结果,都可以将语法树对应的语义确定为待解析文 本的语义。
更进一步地, 结果确定单元 73如果接收到语义映射匹配单元 72的 匹配结果,则在解析结果中匹配的函数 &magic(EXP, key, default, display) 或函数 &magic(EXP, key, default)所对应的映射表中 key的取值为该文本 片段或映射表中 display的取值。
同样, 在语义映射匹配过程中可以对关键的 magic函数进行设置, 只有关键的 magic函数对应的子树匹配成功才认为语义映射匹配成功。 即语义映射匹配单元 72只有在待解析文本中存在文本片段与语法树中 预设的关键函数 &magic(EXP, key, default, display)或关键函数
&magic(EXP, key, default)所标识的子树匹配时, 才将匹配结果发送给结 果确定单元 73。
需要特别说明的是, 在语义解析的过程中, 通常是对各语义的语法 树逐个进行匹配从而确定待解析文本对应的语义的, 在本发明的实施例 中均以在一个语法树上进行匹配为例进行的描述, 对于各语法树的匹配 过程相同。 另外, 在一些应用中, 釆用多层次的语义分析, 那么可以在 每一层次的语义分析中均釆用本发明实施例提供的语义解析方法和语义 解析装置来实现。
在本发明所提供的几个实施例中, 应该理解到, 所揭露的装置和方 法, 可以通过其它的方式实现。 例如, 以上所描述的装置实施例仅仅是 示意性的, 例如, 所述单元的划分, 仅仅为一种逻辑功能划分, 实际实 现时可以有另外的划分方式。 作为单元显示的部件可以是或者也可以不是物理单元, 即可以位于一个 地方, 或者也可以分布到多个网络单元上。 可以根据实际的需要选择其 中的部分或者全部单元来实现本实施例方案的目的。
另外, 在本发明各个实施例中的各功能单元可以集成在一个处理单 元中, 也可以是各个单元单独物理存在, 也可以两个或两个以上单元集 成在一个单元中。 上述集成的单元既可以釆用硬件的形式实现, 也可以 釆用硬件加软件功能单元的形式实现。
上述以软件功能单元的形式实现的集成的单元, 可以存储在一个计 算机可读取存储介质中。 上述软件功能单元存储在一个存储介质中, 包 括若干指令用以使得一台计算机设备(可以是个人计算机, 服务器, 或 者网络设备等) 或处理器 (processor )执行本发明各个实施例所述方法 的部分步骤。 而前述的存储介质包括: U盘、 移动硬盘、 只读存储器 ( Read-Only Memory , ROM )、随机存取存储器( Random Access Memory , RAM ) 、 磁碟或者光盘等各种可以存储程序代码的介质。 以上所述仅为本发明的较佳实施例而已, 并不用以限制本发明, 凡 在本发明的精神和原则之内, 所做的任何修改、 等同替换、 改进等, 均 应包含在本发明保护的范围之内。

Claims

权 利 要 求 书
1、 一种语法编译方法, 其特征在于, 按照语义的常用语句表达釆用 基于逻辑语法直观语言 LGML预先定义对应的语法描述文件和词类描述 文件, 在所述语法描述文件中由词类、 操作符和函数构成常用语句的描 述, 所述词类描述文件用于描述词类的具体取值;
将所述语法描述文件和词类描述文件分别按照预设顺序的归约方法 生成语法描述文件的语法树和词类描述文件的词类树;
将所述词类树挂接在所述语法树中对应词类的位置, 形成所述语义 的语法 4对。
2、 根据权利要求 1所述的语法编译方法, 其特征在于, 所述词类描 述文件中包含词项, 或者除了包含词项外还包含操作符和函数中的至少 一种以描述各词项之间的关系。
3、 根据权利要求 1或 2所述的语法编译方法, 其特征在于, 所述操 作符包括以下至少一种:
操作符 +表示两个以上的操作数串联;
操作符 I表示两个以上的操作数并列关系;
操作符 0表示操作数形成一个不可忽略的组合;
操作符 []表示操作数形成一个可忽略的组合;
操作符; 表示语句结束;
操作符: 表示词类描述文件中词类的解释关系;
操作符 "" 表示引用了外部词典。
4、 根据权利要求 1所述的语法编译方法, 其特征在于, 所述语法描 述文件中的函数包括以下函数中的至少一种:
函数 &repeat(EXP, min, max) 表示 4巴语法片段 EXP重复最少 min遍, 最多 max遍;
函数 &repeat(EXP, n)表示把 EXP重复 n遍;
函数 &perm(EXPl, EXP2, ...) 表示把 EXP1, EXP2,…做全排歹' J; 函数 &grammar(gammar_name)表示语法名称为 grammar—name的语 法描述文件;
函数 &magic(EXP, key, default, display)或函数 &magic(EXP, key, default)实现 EXP到语义标签 key的映射; 其中函数 &magic(EXP, key, default)在语法匹配过程中, 当 EXP与一个文本片段 T匹配成功时, key 的值为 T,否则 key的值为 default;函数 &magic(EXP, key, default, display) 在语法匹配过程中, 当 EXP与一个文本片段 T匹配成功时, key的值为 display, 否则 key的值为 default。
5、 根据权利要求 2所述的语法编译方法, 其特征在于, 所述词类描 述文件中的函数包括以下函数中的至少一种:
函数 &repeat(EXP, min, max) 表示 4巴语法片段 EXP重复最少 min遍, 最多 max遍;
函数 &repeat(EXP, n)表示把 EXP重复 n遍;
函数 &perm(EXPl, EXP2, ...) 表示把 EXP1, EXP2,…做全排歹' J。
6、 根据权利要求 1所述的方法, 其特征在于, 在所述语义的语法树 中, 叶节点为词类描述文件中的词项或者引用的外部词典, 非叶节点为 操作符或函数名,非叶节点的操作数为该非叶节点的各子树表示的内容。
7、 根据权利要求 4所述的方法, 其特征在于, 在所述语义的语法树 中所述函数 &magic(EXP, key, default, display)或函数 &magic(EXP, key, default)作为非叶节点进行标识, 保存所述函数 &magic(EXP, key, default, display)或函数 &magic(EXP, key, default)对应的映射表。
8、 一种语义解析方法, 其特征在于, 该语义解析方法包括: 将待解析文本在釆用如权利要求 1、 2、 4、 5、 6或 7任一权项所述 语法编译方法得到的语法树上按照所述预设顺序进行匹配, 如果所述待 解析文本完全与所述语法树匹配, 则将所述语法树所对应的语义确定为 所述待解析文本的语义。
9、 根据权利要求 8所述的解析方法, 其特征在于, 当釆用如权利要 求 7所述的语法编译方法得到的语法树时, 在所述匹配的过程中, 如果 所述待解析文本中某文本片段与所述函数 &magic(EXP, key, default, display)或函数 &magic(EXP, key, default)所标识的子树匹配, 则在解析结 果中所述函数 &magic(EXP, key, default, display)或函数 &magic(EXP, key default)所对应的映射表中 key的取值为该文本片段或映射表中 display 的取值。
10、 一种语义解析方法, 其特征在于, 该语义解析方法包括: 将待解析文本在釆用如权利要求 7所述语法编译方法得到的语法树 上按照所述预设顺序进行前向最大匹配, 如果所述待解析文本中存在文 本片段与所述语法树中函数 &magic(EXP, key, default, display)或函数 &magic(EXP, key, default)所标识的子树匹配, 则将所述语法树所对应的 语义确定为所述待解析文本的语义。
11、 根据权利要求 10所述的方法, 其特征在于, 在解析结果中匹配 的函数 &magic(EXP, key, default, display)或函数 &magic(EXP, key, default)所对应的映射表中 key的取值为该文本片段或映射表中 display 的取值。
12、 根据权利要求 10所述的方法, 其特征在于, 只有所述待解析文 本中存在文本片段与所述语法树中预设的关键函数 &magic(EXP, key, default, display)或关键函数 &magic(EXP, key, default)所标识的子树匹配, 才将所述语法树所对应的语义确定为所述待解析文本的语义。
13、 一种语义解析方法, 其特征在于, 该语义解析方法包括:
51、 将待解析文本在釆用如权利要求 7所述语法编译方法得到的语 法树上按照所述预设顺序进行匹配, 如果所述待解析文本完全与所述语 法树匹配,则将所述语法树所对应的语义确定为所述待解析文本的语义; 否则执行步骤 S2;
52、 将所述待解析文本在所述语法树上按照所述预设顺序进行前向 最大匹配, 如果所述待解析文本中存在文本片段与所述语法树中函数 &magic(EXP, key, default, display)或函数 &magic(EXP, key, default)所标 识的子树匹配, 则将所述语法树所对应的语义确定为所述待解析文本的 语义。
14、 根据权利要求 13所述的方法, 其特征在于, 在解析结果中匹配 的函数 &magic(EXP, key, default, display)或函数 &magic(EXP, key, default)所对应的映射表中 key的取值为该文本片段或映射表中 display 的取值。
15、 一种语法编译装置, 其特征在于, 该语法编译装置包括: 文件存储单元,用于存储语义对应的语法描述文件和词类描述文件, 所述语法描述文件和词类描述文件是按照语义的常用语句表达釆用基于 逻辑语法直观语言 LGML预先定义的, 在所述语法描述文件中由词类、 操作符和函数构成常用语句的描述, 所述词类描述文件用于描述词类的 具体取值;
语法树生成单元, 用于将所述语法描述文件和词类描述文件分别按 照预设顺序的归约方法生成语法描述文件的语法树和词类描述文件的词 类树, 将所述词类树挂接在所述语法树中对应词类的位置, 形成所述语 义的语法树。
16、 根据权利要求 15所述的语法编译装置, 其特征在于, 所述词类 描述文件中包含词项, 或者除了包含词项外还包含操作符和函数中的至 少一种以描述各词项之间的关系。
17、 根据权利要求 15或 16所述的语法编译装置, 其特征在于, 所 述操作符包括以下至少一种:
操作符 +表示两个以上的操作数串联;
操作符 I表示两个以上的操作数并列关系;
操作符 0表示操作数形成一个不可忽略的组合;
操作符 []表示操作数形成一个可忽略的组合;
操作符; 表示语句结束;
操作符: 表示词类描述文件中词类的解释关系;
操作符 "" 表示引用了外部词典。
18、 根据权利要求 15所述的语法编译装置, 其特征在于, 所述语法 描述文件中的函数包括以下函数中的至少一种:
函数 &repeat(EXP, min, max) 表示 4巴语法片段 EXP重复最少 min遍, 最多 max遍; 函数 &repeat(EXP, n)表示把 EXP重复 n遍;
函数 &perm(EXPl, EXP2, ...) 表示把 EXP1, EXP2,…做全排歹' J; 函数 &grammar(gammar_name)表示语法名称为 grammar—name的语 法描述文件;
函数 &magic(EXP, key, default, display)或函数 &magic(EXP, key, default)实现 EXP到语义标签 key的映射; 其中函数 &magic(EXP, key, default)在语法匹配过程中, 当 EXP与一个文本片段 T匹配成功时, key 的值为 T,否则 key的值为 default;函数 &magic(EXP, key, default, display) 在语法匹配过程中, 当 EXP与一个文本片段 T匹配成功时, key的值为 display, 否则 key的值为 default。
19、 根据权利要求 16所述的语法编译装置, 其特征在于, 所述词类 描述文件中的函数包括以下函数中的至少一种:
函数 &repeat(EXP, min, max) 表示 4巴语法片段 EXP重复最少 min遍, 最多 max遍;
函数 &repeat(EXP, n)表示把 EXP重复 n遍;
函数 &perm(EXPl, EXP2, ...) 表示把 EXP1, EXP2,…做全排歹' J。
20、 根据权利要求 15所述的语法编译装置, 其特征在于, 在所述语 义的语法树中, 叶节点为词类描述文件中的词项或者引用的外部词典, 非叶节点为操作符或函数名, 非叶节点的操作数为该非叶节点的各子树 表示的内容。
21、 根据权利要求 18所述的语法编译装置, 其特征在于, 在所述语 义的语法树中所述函数 &magic(EXP, key, default, display)或函数
&magic(EXP, key, default)作为非叶节点进行标识, 所述文件存储单元进 一步保存所述函数 &magic(EXP, key, default, display)或函数 &magic(EXP, key, default)对应的映射表。
22、 一种语义解析装置, 其特征在于, 该语义解析装置包括: 整句匹配单元, 用于将待解析文本在由权利要求 15、 16、 18、 19、 20或 21任一权项所述语法编译装置得到的语法树上按照所述预设顺序 进行匹配, 如果所述整句匹配单元确定所述待解析文本完全与所述语法 树匹配, 则将匹配结果发送给结果确定单元;
结果确定单元, 用于接收到所述匹配结果时, 将所述语法树所对应 的语义确定为所述待解析文本的语义。
23、 根据权利要求 22所述的语义解析装置, 其特征在于, 当釆用如 权利要求 21所述的语法编译装置得到的语法树时,在所述匹配的过程中, 如果所述待解析文本中某文本片段与所述函数 &magic(EXP, key, default, display)或函数 &magic(EXP, key, default)所标识的子树匹配, 则在所述结 果确定单元得到的解析结果中所述函数 &magic(EXP, key, default, display)或函数 &magic(EXP, key, default)所对应的映射表中 key的取值为 该文本片段或映射表中 display的取值。
24、 一种语义解析装置, 其特征在于, 该语义解析装置包括: 语义映射匹配单元,用于将待解析文本在由如权利要求 21所述语法 编译装置得到的语法树上按照所述预设顺序进行前向最大匹配, 如果所 述待解析文本中存在文本片段与所述语法树中函数 &magic(EXP, key, default, display)或函数 &magic(EXP, key, default)所标识的子树匹配, 贝1 J 将匹配结果发送给结果确定单元;
结果确定单元, 用于在接收到所述匹配结果时, 将所述语法树所对 应的语义确定为所述待解析文本的语义。
25、 根据权利要求 24所述的语义解析装置, 其特征在于, 在所述结 果确定单元得到的解析结果中所述函数 &magic(EXP, key, default, display)或函数 &magic(EXP, key, default)所对应的映射表中 key的取值为 该文本片段或映射表中 display的取值。
26、 根据权利要求 24所述的语义解析装置, 其特征在于, 所述语义 映射匹配单元只有在所述待解析文本中存在文本片段与所述语法树中预 设的关键函数 &magic(EXP, key, default, display)或关键函数 &magic(EXP key, default)所标识的子树匹配时, 才将匹配结果发送给所述结果确定单 元。
27、 一种语义解析装置, 其特征在于, 该语义解析装置包括: 整句匹配单元,用于将待解析文本在由权利要求 21所述语法编译装 置得到的语法树上按照所述预设顺序进行匹配, 如果所述整句匹配单元 确定所述待解析文本完全与所述语法树匹配, 则将匹配结果发送给结果 确定单元; 否则, 触发语义映射匹配单元;
语义映射匹配单元, 用于受到触发后, 将所述待解析文本在所述语 法树上按照所述预设顺序进行前向最大匹配, 如果所述待解析文本中存 在文本片段与所述语法树中函数 &magic(EXP, key, default, display)或函 数 &magic(EXP, key, default)所标识的子树匹配, 则将匹配结果发送给结 果确定单元;
结果确定单元, 用于接收到匹配结果时, 将所述语法树对应的语义 确定为所述待解析文本的语义。
28、 根据权利要求 27所述的语义解析装置, 其特征在于, 所述结果 确定单元如果接收到所述语义映射匹配单元的匹配结果, 则在解析结果 中匹配的函数 &magic(EXP, key, default, display)或函数 &magic(EXP, key default)所对应的映射表中 key的取值为该文本片段或映射表中 display 的取值。
29、 一种计算机存储介质, 所述计算机存储介质被编码有计算机程 序, 其特征在于, 所述程序在被一个或多个计算机执行时使得所述一个 或多个计算机执行如下操作:
按照语义的常用语句表达釆用基于逻辑语法直观语言 LGML预先定 义对应的语法描述文件和词类描述文件,在所述语法描述文件中由词类、 操作符和函数构成常用语句的描述, 所述词类描述文件用于描述词类的 具体取值;
将所述语法描述文件和词类描述文件分别按照预设顺序的归约方法 生成语法描述文件的语法树和词类描述文件的词类树;
将所述词类树挂接在所述语法树中对应词类的位置, 形成所述语义 的语法 4对。
30、 一种计算机存储介质, 所述计算机存储介质被编码有计算机程 序, 其特征在于, 所述程序在被一个或多个计算机执行时使得所述一个 或多个计算机执行如下操作:
将待解析文本在釆用如权利要求 1、 2、 4、 5、 6或 7任一权项所述 语法编译方法得到的语法树上按照所述预设顺序进行匹配, 如果所述待 解析文本完全与所述语法树匹配, 则将所述语法树所对应的语义确定为 所述待解析文本的语义。
31、 一种计算机存储介质, 所述计算机存储介质被编码有计算机程 序, 其特征在于, 所述程序在被一个或多个计算机执行时使得所述一个 或多个计算机执行如下操作:
将待解析文本在釆用如权利要求 7所述语法编译方法得到的语法树 上按照所述预设顺序进行前向最大匹配, 如果所述待解析文本中存在文 本片段与所述语法树中函数 &magic(EXP, key, default, display)或函数 &magic(EXP, key, default)所标识的子树匹配, 则将所述语法树所对应的 语义确定为所述待解析文本的语义。
32、 一种计算机存储介质, 所述计算机存储介质被编码有计算机程 序, 其特征在于, 所述程序在被一个或多个计算机执行时使得所述一个 或多个计算机执行如下操作:
51、 将待解析文本在釆用如权利要求 7所述语法编译方法得到的语 法树上按照所述预设顺序进行匹配, 如果所述待解析文本完全与所述语 法树匹配,则将所述语法树所对应的语义确定为所述待解析文本的语义; 否则执行步骤 S2;
52、 将所述待解析文本在所述语法树上按照所述预设顺序进行前向 最大匹配, 如果所述待解析文本中存在文本片段与所述语法树中函数 &magic(EXP, key, default, display)或函数 &magic(EXP, key, default)所标 识的子树匹配, 则将所述语法树所对应的语义确定为所述待解析文本的 语义。
33、 一种设备, 包括至少一个处理器、 存储器以及至少一个计算机 程序; 所述至少一个计算机程序存储于所述存储器并被所述至少一个处 理器执行; 其特征在于, 所述计算机程序包括执行以下操作的指令: 按照语义的常用语句表达釆用基于逻辑语法直观语言 LGML预先定 义对应的语法描述文件和词类描述文件,在所述语法描述文件中由词类、 操作符和函数构成常用语句的描述, 所述词类描述文件用于描述词类的 具体取值;
将所述语法描述文件和词类描述文件分别按照预设顺序的归约方法 生成语法描述文件的语法树和词类描述文件的词类树;
将所述词类树挂接在所述语法树中对应词类的位置, 形成所述语义 的语法 4对。
34、 一种设备, 包括至少一个处理器、 存储器以及至少一个计算机 程序; 所述至少一个计算机程序存储于所述存储器并被所述至少一个处 理器执行; 其特征在于, 所述计算机程序包括执行以下操作的指令: 将待解析文本在釆用如权利要求 1、 2、 4、 5、 6或 7任一权项所述 语法编译方法得到的语法树上按照所述预设顺序进行匹配, 如果所述待 解析文本完全与所述语法树匹配, 则将所述语法树所对应的语义确定为 所述待解析文本的语义。
35、 一种设备, 包括至少一个处理器、 存储器以及至少一个计算机 程序; 所述至少一个计算机程序存储于所述存储器并被所述至少一个处 理器执行; 其特征在于, 所述计算机程序包括执行以下操作的指令: 将待解析文本在釆用如权利要求 7所述语法编译方法得到的语法树 上按照所述预设顺序进行前向最大匹配, 如果所述待解析文本中存在文 本片段与所述语法树中函数 &magic(EXP, key, default, display)或函数 &magic(EXP, key, default)所标识的子树匹配, 则将所述语法树所对应的 语义确定为所述待解析文本的语义。
36、 一种设备, 包括至少一个处理器、 存储器以及至少一个计算机 程序; 所述至少一个计算机程序存储于所述存储器并被所述至少一个处 理器执行; 其特征在于, 所述计算机程序包括执行以下操作的指令:
51、 将待解析文本在釆用如权利要求 7所述语法编译方法得到的语 法树上按照所述预设顺序进行匹配, 如果所述待解析文本完全与所述语 法树匹配,则将所述语法树所对应的语义确定为所述待解析文本的语义; 否则执行步骤 S2;
52、 将所述待解析文本在所述语法树上按照所述预设顺序进行前向 最大匹配, 如果所述待解析文本中存在文本片段与所述语法树中函数 &magic(EXP, key, default, display)或函数 &magic(EXP, key, default)所标 识的子树匹配, 则将所述语法树所对应的语义确定为所述待解析文本的 语义。
PCT/CN2014/078596 2013-05-28 2014-05-28 语法编译方法、语义解析方法、装置、计算机存储介质和设备 Ceased WO2014190901A1 (zh)

Priority Applications (3)

Application Number Priority Date Filing Date Title
KR1020157033354A KR101726667B1 (ko) 2013-05-28 2014-05-28 어법컴파일방법, 어의해석방법, 디바이스, 컴퓨터 저장매체 및 장치
JP2016515634A JP6238494B2 (ja) 2013-05-28 2014-05-28 文法コンパイル方法、語義解析方法、及び装置
US14/892,818 US20160124936A1 (en) 2013-05-28 2014-05-28 Grammar compiling methods, semantic parsing methods, devices, computer storage media, and apparatuses

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201310203987.2 2013-05-28
CN201310203987.2A CN103294666B (zh) 2013-05-28 2013-05-28 语法编译方法、语义解析方法以及对应装置

Publications (1)

Publication Number Publication Date
WO2014190901A1 true WO2014190901A1 (zh) 2014-12-04

Family

ID=49095560

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/078596 Ceased WO2014190901A1 (zh) 2013-05-28 2014-05-28 语法编译方法、语义解析方法、装置、计算机存储介质和设备

Country Status (5)

Country Link
US (1) US20160124936A1 (zh)
JP (1) JP6238494B2 (zh)
KR (1) KR101726667B1 (zh)
CN (1) CN103294666B (zh)
WO (1) WO2014190901A1 (zh)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110928550A (zh) * 2019-11-19 2020-03-27 上海工程技术大学 基于关键词Trie树消除GCC抽象语法树冗余的方法
CN110968634A (zh) * 2019-12-03 2020-04-07 普元信息技术股份有限公司 大数据场景下基于xml描述实现利用可编程函数式进行etl转换处理的方法
CN112114812A (zh) * 2020-08-26 2020-12-22 中国船舶重工集团公司第七一六研究所 一种应用于工业机器人编程语言的语法检查方法
CN112287663A (zh) * 2020-11-25 2021-01-29 平安数字信息科技(深圳)有限公司 一种文本解析方法、设备、终端及存储介质

Families Citing this family (27)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103294666B (zh) * 2013-05-28 2017-03-01 百度在线网络技术(北京)有限公司 语法编译方法、语义解析方法以及对应装置
US11100291B1 (en) 2015-03-13 2021-08-24 Soundhound, Inc. Semantic grammar extensibility within a software development framework
CN105912521A (zh) * 2015-12-25 2016-08-31 乐视致新电子科技(天津)有限公司 一种解析语音内容的方法及装置
CN106933832A (zh) * 2015-12-30 2017-07-07 中国科学院沈阳自动化研究所 一种油藏的数字字典的构建方法
CN106228983B (zh) * 2016-08-23 2018-08-24 北京谛听机器人科技有限公司 一种人机自然语言交互中的场景处理方法及系统
CN108399919A (zh) * 2017-02-06 2018-08-14 中兴通讯股份有限公司 一种语义识别方法和装置
US11106867B2 (en) 2017-08-15 2021-08-31 Oracle International Corporation Techniques for document marker tracking
CN107704450B (zh) * 2017-10-13 2020-12-04 威盛电子股份有限公司 自然语言识别设备以及自然语言识别方法
CN109841210B (zh) * 2017-11-27 2024-02-20 西安中兴新软件有限责任公司 一种智能操控实现方法及装置、计算机可读存储介质
CN108021559B (zh) * 2018-02-05 2022-05-03 威盛电子股份有限公司 自然语言理解系统以及语意分析方法
CN108228191B (zh) * 2018-02-06 2022-01-25 威盛电子股份有限公司 语法编译系统以及语法编译方法
CN109254776B (zh) * 2018-09-29 2022-02-01 深圳市雷赛控制技术有限公司 多语言代码编译方法及编译器
CN109783806B (zh) * 2018-12-21 2023-05-02 众安信息技术服务有限公司 一种利用语义解析结构的文本匹配方法
CN110109676B (zh) * 2019-04-30 2023-10-17 努比亚技术有限公司 编译方法、终端及计算机可读存储介质
CN110109681B (zh) * 2019-05-08 2023-06-09 上海携程商务有限公司 不同平台间代码的转换方法及系统
CN110471666A (zh) * 2019-07-18 2019-11-19 五八有限公司 代码自动转换方法和装置、代码转换器及介质
CN110826314B (zh) * 2019-11-07 2023-08-22 中金智汇科技有限责任公司 一种规则解析方法、装置、电子设备及存储介质
KR20210061141A (ko) * 2019-11-19 2021-05-27 삼성전자주식회사 자연어 처리 방법 및 장치
CN112069801B (zh) * 2020-09-14 2024-09-20 深圳前海微众银行股份有限公司 基于依存句法的句子主干抽取方法、设备和可读存储介质
CN112256837B (zh) * 2020-11-05 2022-07-12 思必驰科技股份有限公司 语义解析方法和装置
CN112908488B (zh) * 2021-02-09 2022-03-11 北京药明津石医药科技有限公司 事件识别方法、装置、计算机设备和存储介质
CN113408299B (zh) * 2021-06-30 2022-03-25 北京百度网讯科技有限公司 语义表示模型的训练方法、装置、设备和存储介质
CN114089960B (zh) * 2021-10-11 2024-10-25 阿里云计算有限公司 对象处理方法以及装置
CN114443048B (zh) * 2021-12-30 2025-05-06 天翼云科技有限公司 一种基于文本的编译方法、装置、电子设备及存储介质
CN115145584B (zh) * 2022-07-15 2024-11-26 杭州博盾习言科技有限公司 语法分析器的生成方法、数据处理方法、介质、设备
EP4587950A1 (en) * 2022-09-16 2025-07-23 Telefonaktiebolaget LM Ericsson (publ) Method and system to implement privacy-preserving collaborative semantic mapping
CN118332586B (zh) * 2024-03-21 2025-11-11 成都飞机工业(集团)有限责任公司 一种基于语法树的文本分级脱敏方法、系统及存储介质

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5559693A (en) * 1991-06-28 1996-09-24 Digital Equipment Corporation Method and apparatus for efficient morphological text analysis using a high-level language for compact specification of inflectional paradigms
CN101814065A (zh) * 2009-02-23 2010-08-25 富士通株式会社 句法分析装置及句法分析方法
CN103294666A (zh) * 2013-05-28 2013-09-11 百度在线网络技术(北京)有限公司 语法编译方法、语义解析方法以及对应装置

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3709305B2 (ja) * 1999-07-01 2005-10-26 日立オムロンターミナルソリューションズ株式会社 地名文字列照合方法、地名文字列照合装置、地名文字列認識装置及び郵便物区分システム
JP2007102530A (ja) * 2005-10-05 2007-04-19 Advanced Telecommunication Research Institute International 特定言語の文法を生成する装置
JP4451435B2 (ja) * 2006-12-06 2010-04-14 本田技研工業株式会社 言語理解装置、言語理解方法、及び、コンピュータプログラム
KR101092363B1 (ko) * 2008-12-22 2011-12-09 한국전자통신연구원 중한자동번역을 위한 한국어 연결어미 생성 방법 및 그 장치
US8892419B2 (en) * 2012-04-10 2014-11-18 Artificial Solutions Iberia SL System and methods for semiautomatic generation and tuning of natural language interaction applications

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5559693A (en) * 1991-06-28 1996-09-24 Digital Equipment Corporation Method and apparatus for efficient morphological text analysis using a high-level language for compact specification of inflectional paradigms
CN101814065A (zh) * 2009-02-23 2010-08-25 富士通株式会社 句法分析装置及句法分析方法
CN103294666A (zh) * 2013-05-28 2013-09-11 百度在线网络技术(北京)有限公司 语法编译方法、语义解析方法以及对应装置

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110928550A (zh) * 2019-11-19 2020-03-27 上海工程技术大学 基于关键词Trie树消除GCC抽象语法树冗余的方法
CN110928550B (zh) * 2019-11-19 2023-11-24 上海工程技术大学 基于关键词Trie树消除GCC抽象语法树冗余的方法
CN110968634A (zh) * 2019-12-03 2020-04-07 普元信息技术股份有限公司 大数据场景下基于xml描述实现利用可编程函数式进行etl转换处理的方法
CN110968634B (zh) * 2019-12-03 2024-02-02 普元信息技术股份有限公司 大数据场景下基于xml描述实现利用可编程函数式进行etl转换处理的方法
CN112114812A (zh) * 2020-08-26 2020-12-22 中国船舶重工集团公司第七一六研究所 一种应用于工业机器人编程语言的语法检查方法
CN112287663A (zh) * 2020-11-25 2021-01-29 平安数字信息科技(深圳)有限公司 一种文本解析方法、设备、终端及存储介质

Also Published As

Publication number Publication date
US20160124936A1 (en) 2016-05-05
CN103294666A (zh) 2013-09-11
JP6238494B2 (ja) 2017-11-29
CN103294666B (zh) 2017-03-01
KR20160004325A (ko) 2016-01-12
JP2016526224A (ja) 2016-09-01
KR101726667B1 (ko) 2017-04-13

Similar Documents

Publication Publication Date Title
JP6238494B2 (ja) 文法コンパイル方法、語義解析方法、及び装置
US11657816B2 (en) Developer voice actions system
US9858039B2 (en) Voice recognition of commands extracted from user interface screen devices
CN108984529B (zh) 实时庭审语音识别自动纠错方法、存储介质及计算装置
CN110121705B (zh) 将语用学原理应用于与可视分析交互的系统和方法
US10585924B2 (en) Processing natural-language documents and queries
US8117023B2 (en) Language understanding apparatus, language understanding method, and computer program
CN105531758B (zh) 使用外国单词语法的语音识别
CN112559689B (zh) 一种基于车载问答的数据处理方法和装置
US20120072204A1 (en) Systems and methods for normalizing input media
CN108399919A (zh) 一种语义识别方法和装置
WO2015195744A1 (en) Syntactic parser assisted semantic rule inference by generation of alternate parse trees
US9892191B2 (en) Complex query handling
WO2007144853A2 (en) Method and apparatus for performing customized paring on a xml document based on application
US20180349344A1 (en) Hybrid grammatical and ungrammatical parsing
CN110268472B (zh) 用于自动化对话系统的检测机构
US8812294B2 (en) Translating phrases from one language into another using an order-based set of declarative rules
US20060212859A1 (en) System and method for generating XML-based language parser and writer
US11086937B2 (en) Speech based structured querying
CN112823332B (zh) 语义行业术语
WO2017016286A1 (zh) 一种多语言语义解析的方法和装置
US20210109960A1 (en) Electronic apparatus and controlling method thereof
CN106156110B (zh) 文本语义理解方法及系统
KR100921563B1 (ko) 의존 문법 구문 트리를 이용한 문장 요약 방법
CN108984600B (zh) 交互处理方法、装置、计算机设备及可读介质

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

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 14892818

Country of ref document: US

ENP Entry into the national phase

Ref document number: 20157033354

Country of ref document: KR

Kind code of ref document: A

ENP Entry into the national phase

Ref document number: 2016515634

Country of ref document: JP

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 14804799

Country of ref document: EP

Kind code of ref document: A1