WO2014086101A1 - 将自然语言翻译成计算机语言的方法、语义分析器及人机对话系统 - Google Patents

将自然语言翻译成计算机语言的方法、语义分析器及人机对话系统 Download PDF

Info

Publication number
WO2014086101A1
WO2014086101A1 PCT/CN2013/001506 CN2013001506W WO2014086101A1 WO 2014086101 A1 WO2014086101 A1 WO 2014086101A1 CN 2013001506 W CN2013001506 W CN 2013001506W WO 2014086101 A1 WO2014086101 A1 WO 2014086101A1
Authority
WO
WIPO (PCT)
Prior art keywords
computer
language
natural language
logical
code
Prior art date
Application number
PCT/CN2013/001506
Other languages
English (en)
French (fr)
Inventor
万继华
Original Assignee
Wan Jihua
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 Wan Jihua filed Critical Wan Jihua
Publication of WO2014086101A1 publication Critical patent/WO2014086101A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/205Parsing
    • G06F40/211Syntactic parsing, e.g. based on context-free grammar [CFG] or unification grammars
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/40Processing or translation of natural language
    • G06F40/55Rule-based translation

Definitions

  • the present invention relates to the field of computers, and more particularly to a method for translating a natural language into a computer language, a semantic analyzer made by the method, and a human-machine dialogue system.
  • the language used to convey information and communicate in human daily life is a natural language, including verbal language, that is, speech, and written language, that is, text. Natural language is the transformation of the human world
  • a method for translating a natural language into a computer language comprising the following steps:
  • the computer uses the thesaurus and natural language segmentation rules to identify the grammatical components, logical conjunctions and logical semantics in the natural language text, and translates the grammatical components into the basic element names in the computer object-oriented language based on the information management library.
  • a string code translating a logical conjunction into a program transfer instruction code representing program control, and translating logical semantics into binary code representing affirmation and negation;
  • step (2) the computer recognizes and extracts six grammatical components of the subject, the predicate, the attributive, the object, the adverbial, and the complement in the natural language text, and corresponds to the object, function, and function in the computer object-oriented language.
  • the subject is translated into a string code representing the name of the object
  • the predicate is translated into a string code representing the name of the function
  • the attribute is translated into a string code representing the attribute or parameter name, object, adverbial, and complement.
  • Translated into a string code that represents the name of the parameter is
  • the logical concatenation word in the step (2) includes three logical relationships of AND, OR, and condition, respectively corresponding to the AND, OR, and condition, and is respectively translated into a sequential transfer instruction code, a selection transfer instruction code, and Conditional transfer instruction code,
  • step (2) refers to affirmation and negation in the subject and the predicate.
  • the word store stores words, phrases, and part of speech corresponding to words and phrases.
  • the above technical solution divides the grammatical components of the natural language according to the grammar rules, and performs technical processing on each grammatical component according to the mapping and splicing method of the computer program, thereby translating any natural language into a computer readable programming language, realizing the computer to the nature.
  • the recognition and understanding of language lays the technical foundation for the development of deep intelligent electronic products.
  • the present invention also provides a semantic analyzer which is constructed in accordance with the above method and which can be expressed in software or hardware form for the purpose of translating a natural language into a computer language readable program language.
  • the present invention provides a human-machine dialogue system including the above-described semantic analyzer, and further includes:
  • Compile executor Call the class library, dynamically compile the programming language of the semantic parser, and execute, complete the function operation.
  • the method further includes controlling the display or the player, the function operation is to dynamically generate corresponding resource call information according to the semantic requirement; controlling the display or the player to receive the resource call information, and displaying or playing the corresponding resource in the resource library according to the call information.
  • the information management library stores a corresponding relationship between the vocabulary, the class library and the resource library; the resource library stores an information resource corresponding to the text; and the class library stores the class file of the function class.
  • information resources include text, pictures, video, and animation resources.
  • the above solution realizes the dialogue and conversation between the person and the computer through the human-machine dialogue system, and the computer can respond to the natural language of the person, and can directly perform the specific operation through the semantics expressed by the voice signal.
  • the system can be widely used in various frontier fields of the future Semantic Internet, Internet of Things, Robot Control, and Artificial Intelligence and Simplified Computer Hardware Systems.
  • Figure 1 is a flow chart of the method of the present invention. Instruction manual
  • FIG. 2 is a structural block diagram of a human-machine dialog system of the present invention.
  • the method of the invention comprises the following steps:
  • Input natural language into the machine natural language includes speech and text, and if the input is voice, it must be converted into text.
  • the computer uses the thesaurus and natural language segmentation rules to identify the grammatical components, logical conjunctions and logical semantics in the natural language text, and translates the grammatical components into the basic element names in the computer object-oriented language based on the information management library.
  • String code translate logical conjunction words into program transfer instruction code representing program control, translate logical semantics into binary code representing affirmation and negation; wherein grammatical components include subject, predicate, object, attributive, adverbial, and complement .
  • the scheme is based on the correspondence between the part-of-speech and grammatical components and the structural rules of the grammatical components.
  • the first noun or pronoun in the statement is the subject, and the noun or pronoun in front of the subject is modified by the attribute auxiliary "" as the identification mark;
  • the last verb in the statement is a predicate.
  • the adjective without a verb in the predicate is a predicate.
  • the components before the subject are attributives.
  • the number of attributives can be zero or one or more.
  • the components before the predicate are adverbial.
  • the number of adverbials can be zero or one or more.
  • the components after the predicate It is an object or a complement.
  • the part of speech is a noun or a pronoun.
  • the object can be decorated with an attribute before it.
  • the attribute of the object is modified with the word "" and the complement is marked with "de”.
  • the application is not limited to the above identification rules.
  • Grammatical components can also be extracted by other rules.
  • the six grammatical components correspond to the four basic element names representing objects, functions, attributes, and parameters of the computer object-oriented language.
  • the specific primitive is translated into the string code of the object name, and the predicate is translated into the string code of the function name.
  • a string code that is the name of the attribute or parameter a string code that translates to the attribute name when the attribute modifiers the subject; a string code that translates to the name of the class library parameter when the attribute is modified; the object, the adverbial, and the complement.
  • the logical joint words include (combined), or (disjunction), and conditions (implication), which respectively correspond to and/or conditions.
  • the logical relationship is translated into a sequential transfer instruction code, a selection transfer instruction code, and a conditional branch instruction code, and the transfer instruction code is also called a jump transfer instruction code. among them:
  • the relationship with the relationship is: and... and... (parallel semantic relationship), not only... and... (incremental semantic relationship), although...but... (transitional semantic relationship), etc.;
  • Or relational conjunctions are: or... or... (choose semantic relations), either... or... (alternative semantic relations), etc.;
  • Conditional relationship conjunctions are: If... Then... (Conditional Semantic Relations), because...so... (cause semantic relations), etc.;
  • This scheme is based on digital logic rules, which encodes logical semantics into binary code.
  • the logical semantics refer to the two semantics of affirmation and negation in the subject and predicate. When there are negative words such as no, no, no and no in the subject and predicate When negating logical semantics, otherwise affirming logical semantics and encoding them as binary code, negating to 0, definitely ⁇ .
  • the word library stores words, phrases, and part of speech corresponding to words and phrases.
  • the lexicon is divided into a common lexicon and a user vocabulary.
  • the common vocabulary is maintained and updated by the developer and shared by all users. Each user has their own vocabulary, maintained by the administrator, and updated by the user for their own needs, for personal use only.
  • DHd0albaefd7d3 object new DHd0albaef d7d3( "DHbf c9b0aeb5c4" ); object .
  • DHb4f3cff3 object2 n w 3Hb4f3cff3( ) j
  • Another example is to enter the text into the computer. "If the little monkey didn't go to the store, then the little monkey didn't buy the peach.”
  • the grammar rules "Little Monkey”, the main language, "go”, "buy” as the predicate, "shop””Peach” is the object.
  • the computer first extracts these grammatical components by using the corresponding words and part of speech in the lexicon, and then analyzes the "little monkey” as an object in the computer language, "go” and “buy” as functions, "shop", “peach”.
  • Hdealbaefd7d3 object new 3Hd0albaefd7d3()
  • the computer first extracts these grammatical components by using the corresponding words and part of speech in the lexicon, and then analyzes the "little monkey” as an object in computer language, "play” and “sleeping” as functions, and “in” as parameters, and Use the letter window and management library to translate the "little monkey” into the string code of the object name, ie] Hd0albaefd7d3, and translate the "play” and "sleeping” into the string code of the function name, namely: JHcde6cba3 and ;] Hcbafbef5, "In” is translated into the string code of the parameter name, ie: Hd4da; then the logical connection word in the above text is analyzed, the logical connection word "or...
  • the invention also provides a semantic analyzer, which is manufactured according to the above method, and the specific correspondence is:
  • Input module input natural language into the computer
  • the translation module uses the thesaurus and the natural language segmentation rule to identify and extract the grammatical components, logical conjunctions and logical semantics in the natural language text, and translates the grammatical components into the representation of the basic element names in the computer object-oriented language based on the information management library.
  • the splicing module splices the string code, the program branch instruction code, and the binary code into a program language recognizable by the computer.
  • the semantic analysis of the present invention can be expressed in the form of software or hardware, wherein the software form is a conventional technology; the hardware form can burn the semantic analysis code into a customized PCB circuit board or a customized chip to form a semantic analysis system to complete semantic understanding. Function, the purpose of translating natural language into a computer language recognizable programming language.
  • the present invention also provides a human-machine dialog system including a top semantic analyzer 12, as shown in Fig. 2, which further includes:
  • Voice converter 11 converts natural language speech into text in real time
  • Compiler executor 13 Calling the class library, dynamically compiling the programming language of the semantic parser, and executing, performing functional operations, wherein the functional operations include various scientific calculations, data processing, and intelligent control.
  • the human-machine dialog system of the present invention further includes a control display or player 14, the function operation of dynamically generating corresponding resource call information according to semantic requirements; controlling the display or the player to receive resource call information, displaying or broadcasting resources according to the call information The corresponding resources in the library.
  • Information resources corresponding to text, information resources include text, pictures, video, and animation resources; class inventory class files for storage functions, function classes refer to code combinations for specific function operations.
  • the voice converter converts the voice into text and delivers the text to the semantic analyzer; then the semantic analyzer translates the text into a computer-readable programming language according to the technical solution of the method of the present application,
  • the class library is called, the programming language of the semantic analyzer is dynamically compiled, and functions are performed, such as various scientific calculations, data processing, and intelligent control.
  • the present invention also provides a specific functional operation: that is, the compiler executor dynamically compiles the programming language of the semantic analyzer by calling a class library, and executes, generates resource call information, and controls the display or the player to receive resource call information, and Displaying or playing corresponding resources in the resource library according to the calling information, thereby displaying or playing content corresponding to the spoken words, such as text, pictures, videos, and animations.
  • the human-machine dialogue system of the invention can enable people to display related content, and can display information related to the content, so that the human-machine can reach a deeper intelligent interaction.

Landscapes

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

Abstract

公开了一种将自然语言翻译成计算机语言的方法、语义分析器及人机对话系统,其包括将自然语言输入计算机,计算机提取语法成分、逻辑联接词和逻辑语义,并将其分别翻译成字符串代码、指令代码和二进制代码,然后将代码拼接成计算机可识别的程序语言。通过以上方案,可按照计算机程序的映射、拼接方法对各语法成分进行技术处理,将自然语言翻译成计算机可识别的程序语言,实现了计算机对自然语言的理解,从而实现人与计算机的对话和交谈。

Description

将自然语言翻译成计算机语言的方法、 语义分析器及人机对话系统 技术领域
本发明涉及计算机领域, 具体说是将一种将自然语言翻译成计算机语言的 方法、 利用该方法制成的语义分析器及人机对话系统。
背景技术
人类日常生活中用于传递信息和进行交流的语言, 是自然语言, 包括口头 语言即语音, 和书面语言即文字两种基本形式。 自然语言是人类在改造客观世
界的过程中产生的, 并随着人类社会和客观世界的变化而不断发展。 人类自然 语言中所涉及的每一概念总是与客观世界中的某一具体事物或事件相对应, 由 于客观世界中的任一具体事物或事件的存在形式总是一个特定的唯一对象, 所 以人类自然语言中的概念或词语所及的任一特定事物或事件也必然是唯一的对 象。
当今社会已进入到了一个科技日新月异的时代。 其中, 一个最明显的标志 是高科技信息产品大量涌入消费市场。 它们为人们的工作, 生活, 交流, 学习 和通信带来了很大的便利和享受。 另一方面, 高科技信息产品的普及也为高科 技信息产品自身的提升带来很大挑战。 其中一大挑战是基于自然语言的人机对 话。 要实现基于自然语言的人机对话, 有两大问题需要解决。 一是把语音信号 转换成文字符号; 二是把文字符号转换成计算机可识别的程序语言。 目前, 第 一个问题已得到较好解决, 它就是人们通常所说的语音识别技术。 但是, 当今 的语音识别技术没有解决计算机对自然语言文字的理解这个问题。 比如, 现有 的人机对话系统和信息搜索产品都使用查表算法。 从根本上说, 它们都没有解 决机器对自然语言文字的识别和理解。 这一缺陷导致很多高科技产品, 无法实 现一些非常有用的功能。
目前, 世界上没有一台电脑能懂得人们日常用的自然语言, 也就是说, 人 们还无法通过自然语言去告诉电脑要去做什么, 或回答人们的提问。 展望未来, 说 明 书
在日本等国家的推动下, 家用机器人将成为普及率很高的消费品之一。 为了实 现这个商业目标, 目前急待要解决的一大技术难题是怎么将自然语言翻译成计 算机语言。
由于将自然语言翻译成计算机语言是一个技术难题, 目前市场上出现的人 机对话装置均不能实现深层智能化应用需求的自然语言识别和理解功能, 如根 据人的自然语言作出响应、 通过语音信号所表达的语义直接完成具体操作等。 发明内容
针对计算机无法对自然语言识别的技术问题, 本发明的目的在于提供一种 将自然语言翻译成计算机语言的方法。
本发明解决上述技术问题采用的技术方案为: 一种将自然语言翻译成计算 机语言的方法, 其包括以下步骤:
( 1 )将自然语言输入计 【机;
( 2 )计算机利用词库和自然语言分词规则识别提取自然语言文字中的语法 成分、 逻辑联结词和逻辑语义, 并基于信息管理库将语法成分翻译成表示计算 机面向对象语言中的基本元素名称的字符串代码、 将逻辑联结词翻译成表示程 序控制的程序转移指令代码、将逻辑语义翻译成表示肯定和否定的二进制代码;
( 3 )将所述字符串代码、 程序转移指令代码和二进制代码拼接成计算机可 识别的程序语言。
进一步地, 步骤(2 ) 中 i算机识别和提取自然语言文字中的主语、 谓语、 定语、 宾语、 状语和补语六种语法成分, 并将其对应为计算机面向对象语言中 的对象、 函数、 属性和参数四种基本元素, 其中主语翻译为表示对象名称的字 符串代码, 谓语翻译为表示函数名称的字符串代码, 定语翻译为表示属性或参 数名称的字符串代码, 宾语、 状语和补语翻译为表示参数名称的字符串代码。
进一步地, 步骤(2 ) 中所述逻辑联结词包括与、 或、 条件三种, 分别对应 与、 或、 条件三种逻辑关系, 并将其分别翻译成顺序转移指令代码、 选择转移 指令代码和条件转移指令代码,
进一步地, 步骤(2 ) 中所述逻辑语义是指主语和谓语中表示肯定和否定的 说 明 书
两种语义, '当主语和谓语中出现如没、 不、 非和无等否定词时, 为否定逻辑语 义, 否则为肯定逻辑语义, 并将其编码为二进制代码, 否定为 0, 肯定为 1。
进一步地, 所述词库存储单词、 词组及与单词和词组对应的词性。
上述技术方案根据语法规则对自然语言进行语法成分的划分, 按照计算机 程序的映射、 拼接方法对各语法成分进行技术处理, 从而将任何自然语言翻译 成计算机可识别的程序语言, 实现了计算机对自然语言的识别和理解, 为开发 深层智能化电子产品奠定了技术基础。
本发明还提供一种语义分析器, 该语义分析器按照上述方法制成, 其可通 过软件或硬件形式表现, 以达到将自然语言翻译为计算机语言可识别的程序语 言的目的。
针对现有电子产品不能实现深层智能化的技术问题, 本发明提供一种包含 上述语义分析器的人机对话系统, 还包括:
语音转换器, 将自然语言的语音实时转换成文字;
编译执行器: 调用类库, 动态编译所述语义分析器的程序语言, 并执行, 完成功能操作。
进一步地, 还包括控制显示器或播放器, 所述功能操作为根据语义要求动 态生成对应的资源调用信息; 控制显示器或播放器接收资源调用信息, 根据调 用信息显示或播放资源库内对应的资源。
进一步地, 所述信息管理库存储词库、 类库和资源库之间的对应关系; 所 述资源库存储与文字对应的信息资源; 所述类库存储功能类的类文件。
进一步地, 信息资源包括文本、 图片、 视频和动漫资源。
上述方案通过人机对话系统实现人与计算机之间的对话和交谈, 计算机可 对人的自然语言作出响应, 并可通过语音信号所表达的语义直接完成具体操作。 因而, 该系统可广泛应用于未来语义互联网、 物联网、 机器人控制以及人工智 能和简化计算机硬件系统的各种前沿领域中。
附图说明
图 1是本发明的方法的流程图; 说 明 书
图 2是本发明人机对话系统的结构框图。
具体实施方式
下面结合图 1对本发明的方法作进一步的详细说明:
本发明的方法包括以下步骤:
( 1 ) 将自然语言输入计箅机; 自然语言包括语音和文字, 如果输入的是语 音, 则须转换成文字。
( 2 )计算机利用词库和自然语言分词规则识别提取自然语言文字中的语法 成分、 逻辑联结词和逻辑语义, 并基于信息管理库分别将语法成分翻译成表示 计算机面向对象语言中的基本元素名称的字符串代码、 将逻辑联结词翻译成表 示程序控制的程序转移指令代码、 将逻辑语义翻译成表示肯定和否定的二进制 代码; 其中语法成分包括主语、 谓语、 宾语、 定语、 状语和补语六种。 本方案 基于词语词性与语法成分之间的对应关系和语法成分的结构规律所采用的识别 方法为:
语句中的第一个名词或代词是主语, 主语前有名词或者代词作定语修饰的 以结构助词 "的"作为识别标记;
语句中的最后一个动词是谓语, 谓语中没有动词的形容词是谓语, 谓语后 有补语修饰的以结构助词 "得"作为识别标记,;
主语之前的成分是定语, 定语的个数可以是零, 也可以是一个或者多个; 谓语之前的成分是状语, 状语的个数可以是零, 也可以是一个或者多个; 谓语之后的成分是宾语或补语, 宾语的词性是名词或者代词, 宾语之前可 有定语修饰, 修饰宾语的定语以 "的"字作为识别标记, 补语以 "得"字标记; 本申请并不限于上述识别规则, 还可通过其他的规则提取语法成分。 六种 语法成分与表示计算机面向对象语言的对象、 函数、 属性和参数四种基本元素 名称对应, 具体为主语翻译为对象名称的符串代码, 谓语翻译为函数名称的字 符串代码, 定语翻译为属性或参数名称的字符串代码; 当定语修饰主语时, 翻 译为属性名称的宇符串代码; 当定语修饰宾语时, 翻译为类库参数名称的字符 串代码; 宾语、 状语和补语翻泽为参数名称的字符串代码。 说 明 书
本方案基于自然语句之间的逻辑联结规律, 识别逻辑联结词, 其中逻辑联 结词包括与 (合取) 、 或(析取) 、 条件 (蕴涵)三种, 分别对应与、 或、 条 件三种逻辑关系, 并将其分别翻译成顺序转移指令代码、 选择转移指令代码和 条件转移指令代码, 选择转移指令代码又称跳转转移指令代码。 其中:
与关系联结词有: 并且…并且… (并列语义关系) , 不但…而且… (递进 语义关系) , 虽然…但是… (转折语义关系)等;
或关系联结词有: 或者…或者… (选择语义关系) , 要么…要么… (择一 语义关系) 等;
条件关系联结词有: 如果…那么… (条件语义关系) , 因为…所以… (因 果语义关系) 等;
语句之间没有联结词的默汄为与逻辑关系, 即顺序转移。
本方案基于数字逻辑规则, 将逻辑语义编码为二进制代码, 其中逻辑语义 是指主语和谓语中表示肯定和否定的两种语义, 当主语和谓语中出现如没、 不、 非和无等否定词时, 为否定逻辑语义, 否则为肯定逻辑语义, 并将其编码为二 进制代码, 否定为 0, 肯定为 ί。
( 3)将所述字符串代码、 程序转移指令代码和二进制代码拼接成计算机可 识别的程序语言。
在上述技术方案中, 词库存储单词、 词组及与单词和词组对应的词性。 词 库分为公共词库、 用户词库。 ^共词库由开发方进行维护更新, 所有用户共享。 每一个用户拥有自己的词库, 由管理员进行维护, 用户根据自己需求更新, 仅 供个人使用。
下面举例说明上述实现过程:
如向计算机输入文字 "可爱的小猴子高兴地吃桃子。 大象摘苹果。 "这句 话, 根据语法规则 "小猴子"、 "大象 "为主语, "买"、 "摘"为谓语, "可 爱的"为定语, "桃子"、 "苹果"为宾语, "高兴地"为状语。 计算机首先 利用词库中对应的词语和词性分别提取这些语法成分, 然后将 "小猴子"、 "大 象"分析为计算机语言中的对象, "买"、 "摘"分析为函数, "可爱的"分 说 明 书
析为属性, "桃子"、 "苹果" 、 "高兴地"分析为参数, 并利用信息管理库 将 "小猴子"、 "大象 "翻译为对象名称的字符串代码, 即 JHd0albaefd7d3和 JHb4f3cff3, 将"买"、 "摘"翻译为函数的字符串代码, 即 JHc2f2和 JHd5aa, 将 "可爱的"翻译为属性名称的字符串代码, 即 JHbfc9b0aeb5c4, 将 "桃子"、 "苹果"、 "高兴地"翻译为参数名称的字符串代码,即 JHccd2d7d3、 JHc6bbb9fb 和 JHb8dfd0cbb5d8; 然后对上述文字进行逻辑连接词分析, 由于无逻辑联结词, 默认为顺序转移, 并翻译成顺序转移指令代码 null ; 再对上述文字进行逻辑语 义分析, 前一句主语中没有出现否定词, 默认为肯定语义, 并翻译为对应的二 进制代码 1, 而谓语中也没有出现否定词, 因此翻译为 1。后一句主语中没有出 现否定词, 默认为肯定语义, 并翻译为对应的二进制代码 1, 而谓语中也没有出 现否定词, 因此翻译为 1; 接着将上述的字符串代码、指令代码和二进制代码进 行拼接, 从而形成计算机可识别的程序语言, 具体为:
DHd0albaefd7d3 object=new DHd0albaef d7d3( "DHbf c9b0aeb5c4" ); object . Hc2f2( " DHccd 2d7d3_:Hb8dfd0cbb5d8" , "1" T' ) ;
DHb4f3cff3 object2=n w 3Hb4f3cff3( ) j
obj ect2. DHd5aa( "DHc63bb9fb" Ί" , "1" ) ;
再如向计算机输入文字"如果小猴子没有去商店,那么小猴子没有买桃子。 " 这句话, 根据语法规则 "小猴子"、 为主语, "去"、 "买"为谓语, "商店"、 "桃子"为宾语。 计算机首先利用词库中对应的词语和词性分别提取这些语法 成分, 然后将 "小猴子"分析为计算机语言中的对象, "去" 、 "买"分析为 函数, "商店"、 "桃子" "分析为参数, 并利用信息管理库将 "小猴子" 翻 译为对象名称的字符串代码, 即 ]Hd0albaefd7d3, 将 "去"、 "买"翻译为 函数名称的字符串代码, 即: Hc8a5b9fd和〕Hc2f2, 将 "商店"、 "桃子"翻 译为参数名称的字符串代码, 即] Hc9ccb5ea和] Hccd2d7d3; 然后对上述文字 中的逻辑连接词进行分析, 逻辑连接词 "如果 ...那么 ..."对应于条件逻辑关系, 因此将其翻译成条件转移指令代码, 即 if...else...; 再对上述文字进行逻辑语义 分析, 前一句主语中没有出现否定词, 默认为肯定语义, 并翻译为对应的二进 说 明 书
制代码 1, 而谓语中出现了否定词 "没有", 因此翻译为 ø。 后一句主语中没有 出现否定词, 默认为肯定语义: 并翻译为对应的二进制代码 1, 而谓语中出现了 否定词 "没有", 因此翻译为 3; 接着将上述的字符串代码、 指令代码和二进制 代码进行拼接, 从而形成计算机可识别的程序语言, 具体为:
Hdealbaefd7d3 object=new 3Hd0albaefd7d3();
if (object.〕Hc8a5b9干 d(":iHc9ccb5ea" )==ø){
object . ]Hc2f 2( "〕Hccd2d7d3" ,"1", "0" );
}else{
object. Hc2f2(":iHccd2d7d3" ,l"J"l")j
}
再如向计算机输入文字 "小猴子或者在玩耍, 小猴子或者在睡觉。 "这句 话, 根据语法规则 "小猴子"为主语, "玩耍"、 "睡觉"为谓语, "在"为 状语。 计算机首先利用词库中对应的词语和词性分别提取这些语法成分, 然后 将 "小猴子"分析为计算机语言中的对象, "玩耍" 、 "睡觉"分析为函数, "在"分析为参数, 并利用信窗、管理库将 "小猴子" 翻译为对象名称的字符串 代码, 即 ]Hd0albaefd7d3, 将 "玩耍"、 "睡觉"翻译为函数名称的字符串 代码, 即: JHcde6cba3和;] Hcbafbef5, 将 "在" 翻译为参数名称的字符串代 码, 即:) Hd4da;然后对上述文字中的逻辑连接词进行分析,逻辑连接词"或者... 或者 ..."对应于或逻辑关系, 因此将其翻译成跳转转移指令代码; 再对上述文字 进行逻辑语义分析, 前一句主语中没有出现否定词, 默认为肯定语义, 并翻译 为对应的二进制代码 1, 而谓语中也没有出现否定词, 因此翻译为 1。后一句主 语中没有出现否定词, 默认为肯定语义, 并翻译为对应的二进制代码 1, 而谓语 中也没有出现否定词, 因此翻译为 1; 接着将上述的字符串代码、指令代码和二 进制代码进行拼接, 从而形成计算机可识别的程序语言, 具体为:
3Hd0albaefd7d3 object=new 3Hdealbaefcl7cl3();
int hichMethod = (i t) (Math.random()*2);
if(whichMethod==0){
object · 3Hcde6cbci3("3Hd4da" , "1" ,"1"); 说 明 书
}else{
obj ec t .〕 He bafbe 5 ( " ]Hd4da " ,■■ 1 '■ ■ 1" ) ;
}
本发明还提供一种语义分析器, 该语义分析器是按照上述方法制成的, 具 体对应关系为:
输入模块, 将自然语言输入计算机;
翻译模块, 计算机利用词库和自然语言分词规则识别提取自然语言文字中 的语法成分、 逻辑联结词和逻辑语义, 并基于信息管理库将语法成分翻译成表 示计算机面向对象语言中的基本元素名称的字符串代码、 将逻辑联结词翻译成 表示程序控制的程序转移指令代码、 将逻辑语义翻译成表示肯定和否定的二进 制代码;
拼接模块, 将所述字符串代码、 程序转移指令代码和二进制代码拼接成计 算机可识别的程序语言。
其中具体的翻译、 拼接过程按上述方法操作, 在此不再赘述。
本发明的语义分析可采用软件或硬件形式表现, 其中, 软件形式为常规的 技术; 硬件形式可将语义分析代码烧刻入定制的 PCB 电路板或者定制的芯片, 构成语义分析系统, 完成语义理解功能, 实现将自然语言翻译为计算机语言可 识别的程序语言的目的。
本发明还提供一种包括上 ¾语义分析器 12的人机对话系统, 如图 2, 其还 包括:
语音转换器 11, 将自然语言的语音实时转换成文字;
编译执行器 13: 调用类库, 动态编译所述语义分析器的程序语言, 并执行, 完成功能操作, 其中功能操作包括各种科学计算、 数据处理和智能控制等。
本发明的人机对话系统还包括控制显示器或播放器 14, 所述功能操作为根 据语义要求动态生成对应的资源调用信息; 控制显示器或播放器接收资源调用 信息, 根据调用信息显示或播改资源库内对应的资源。
其中, 信息管理库存储词库、 类库和资源库之间的对应关系; 资源库存储 说 明 书
与文字对应的信息资源, 信息资源包括文本、 图片、 视频和动漫资源; 类库存 储功能类的类文件, 功能类指具体功能操作的代码组合。
当人向系统说话时, 首先, 语音转换器将语音转换成文字, 并将文字输送 至语义分析器; 接着语义分析器根据本申请的方法的技术方案将文字翻译为计 算机可识别的程序语言, 调用类库, 动态编译所述语义分析器的程序语言, 并 执行, 完成功能操作, 如各种科学计算、 数据处理和智能控制等。 本发明还提 供一种具体的功能操作: 即编译执行器通过调用类库, 动态编译所述语义分析 器的程序语言, 并执行, 生成资源调用信息, 控制显示器或播放器接收资源调 用信息, 并根据调用信息显示或播放资源库内对应的资源, 从而显示或播放与 所说话语对应的内容, 如文字、 图片、 视频和动漫等。 本发明的人机对话系统, 可以做到人说出相关内容, 就可显示与内容相关的信息, 使人机达到更深层次 的智能互动。
上述实施方式仅供说明本发明之用, 而并非是对本发明的限制, 有关技术 领域的普通技术人员, 在不脱离本发明精神和范围的情况下, 还可以作出各种 变化和变型, 因此所有等同的技术方案也应属于本发明的范畴。

Claims

权 利 要 求 书
1、 将自然语言翻译成 i算机语言的方法, 其包括以下步骤:
( 1 )将自然语言输入 i算机;
(2)计算机利用词库和分词规则识别提取自然语言文字中的语法成 分、 逻辑联结词和逻辑语义, 并基于信息管理库将语法成分翻译成表示 计算机面向对象语言中的基本元素名称的字符串代码、 将逻辑联结词翻 译成表示程序控制的程序转移指令代码、 将逻辑语义翻译成表示肯定和 否定的二进制代码;
(3)将所述字符串代码、程序转移指令代码和二进制代码拼接成计 算机可识别的程序语言。
2、 根据权利要求 1所述的方法, 其特征在于: 步骤(2) 中计算机 识别和提取文字中的主语、 谓语、 定语、 宾语、 状语和补语六种语法成 分, 并将其对应为计算机面向对象语言中的对象、 函数、 属性和参数四 种基本元素名称, 其中主语翻译为表示对象名称的字符串代码, 谓语翻 译为表示函数名称的字符串代码, 定语翻译为表示属性或参数名称的字 符串代码, 宾语、 状语和补语翻译为表示参数名称的字符串代码。
3、 根据权利要求 1所: 的方法, 其特征在于: 步骤(2 ) 中所述逻 辑联结词包括与、 或、 条件三种, 分别对应与、 或、 条件三种逻辑关系, 并将其分别翻译成顺序转移指令代码、 选择转移指令代码和条件转移指 令代码。
4、 根据权利要求 2所述的方法, 其特征在于: 步骤(2) 中所述逻 辑语义是指主语和谓语中表示肯定和否定的两种语义。
5、 根据权利要求 1所 ¾的方法, 其特征在于: 所述词库存储单词、 词组及与单词和词组对应的同性。
6、 一种根据权利要求〗至 5中任一项所述方法制成的语义分析器, 其特征在于: 所述语义分析器采用软件或硬件形式。 权 利 要 求 书
7、 一种包含权利要求 e所述语义分析器的人机对话系统, 其特征在 于- 还包括:
语音转换器, 将自然语言的语音实时转换成文字;
编译执行器: 调用类库, 动态编译所述语义分析器的程序语言, 并 执行, 完成功能操作。
8、 根据权利要求 7所¾的人机对话系统, 其特征在于: 还包括控制 显示器或播放器, 所述功能操作为根据语义要求动态生成对应的资源调 用信息; 控制显示器或播放器接收资源调用信息, 根据调用信息显示或 播放资源库内对应的资源。
9、 根据权利要求 8所述的人机对话系统, 其特征在于: 所述信息管 理库存储词库、 类库和资源库之间的对应关系; 所述资源库存储与文字 对应的信息资源; 所述类库存储功能类的类文件。
10、 根据权利要求 1所述的方法, 其特征在于: 信息资源包括文本、 图片、 视频和动漫资源。
PCT/CN2013/001506 2012-12-07 2013-12-06 将自然语言翻译成计算机语言的方法、语义分析器及人机对话系统 WO2014086101A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201210522527 2012-12-07
CN201210522527.1 2012-12-07

Publications (1)

Publication Number Publication Date
WO2014086101A1 true WO2014086101A1 (zh) 2014-06-12

Family

ID=50167862

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2013/001506 WO2014086101A1 (zh) 2012-12-07 2013-12-06 将自然语言翻译成计算机语言的方法、语义分析器及人机对话系统

Country Status (2)

Country Link
CN (1) CN103617159B (zh)
WO (1) WO2014086101A1 (zh)

Families Citing this family (27)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103902248B (zh) * 2013-09-06 2017-01-18 王柳 基于自然语言自动调度程序的智能微信银行系统及自然语言对计算机系统的智能调度方法
JP6618735B2 (ja) * 2015-08-31 2019-12-11 国立研究開発法人情報通信研究機構 質問応答システムの訓練装置及びそのためのコンピュータプログラム
CN105446146B (zh) * 2015-11-19 2019-05-28 深圳创想未来机器人有限公司 基于语义分析的智能终端控制方法、系统及智能终端
CN105912692B (zh) * 2016-04-22 2019-09-27 华讯方舟科技有限公司 一种智能语音对话的方法和装置
CN107305446B (zh) * 2016-04-25 2020-08-14 北京字节跳动网络技术有限公司 获取压力感应区域内关键字的方法和装置
CN106649421A (zh) * 2016-05-29 2017-05-10 陈勇 一种人机对话平台
CN106339159A (zh) * 2016-08-25 2017-01-18 乐视控股(北京)有限公司 字符选择处理方法、终端和语义分析服务器
CN107977387A (zh) * 2016-10-25 2018-05-01 北京酷我科技有限公司 一种基于语义识别的歌曲推荐方法及系统
CN107169569A (zh) * 2017-04-17 2017-09-15 湖南本体信息科技研究有限公司 一种逻辑推理机、机器模拟人脑学习和工作的方法及人工智能系统
US10460044B2 (en) * 2017-05-26 2019-10-29 General Electric Company Methods and systems for translating natural language requirements to a semantic modeling language statement
CN107861879A (zh) * 2017-11-28 2018-03-30 成都视达科信息技术有限公司 一种实现软件自动化测试的方法和系统
CN108257616A (zh) * 2017-12-05 2018-07-06 苏州车萝卜汽车电子科技有限公司 人机对话的检测方法以及装置
CN107977207A (zh) * 2017-12-18 2018-05-01 黄根根 计算机语言编译器
CN108196941A (zh) * 2017-12-29 2018-06-22 美的集团股份有限公司 终端控制的方法、装置及计算机可读存储介质
CN108595811B (zh) * 2018-04-16 2022-03-11 东南大学 一种用于无人车训练模拟的突发性事件仿真方法
CN109144493A (zh) * 2018-07-18 2019-01-04 平安科技(深圳)有限公司 业务规则的生成方法、电子装置及可读存储介质
JP7169125B2 (ja) * 2018-08-29 2022-11-10 株式会社日立製作所 質問回答システム、質問回答処理方法、及び質問回答統合システム
CN109559748B (zh) * 2018-12-21 2019-09-24 出门问问信息科技有限公司 一种语义识别方法、装置、智能设备及存储介质
AU2020205593B2 (en) * 2019-01-10 2023-07-06 Brane Cognitives Pte. Ltd. Natural solution language
CN110442332A (zh) * 2019-07-04 2019-11-12 深圳壹账通智能科技有限公司 自然语言转换成程序语言的方法、装置及计算机设备
CN112819166A (zh) * 2019-11-15 2021-05-18 万继华 一种基于量子信息计算、存储和通信的编码方法
CN110991191A (zh) * 2019-12-05 2020-04-10 南京品微智能科技有限公司 一种基于自然语义转换实现流程自定义的方法
CN111158630B (zh) * 2019-12-25 2023-06-23 网易(杭州)网络有限公司 一种播放控制方法及装置
CN111209755A (zh) * 2019-12-25 2020-05-29 广东飞企互联科技股份有限公司 高效率的翻译方法
CN111552779A (zh) * 2020-04-28 2020-08-18 深圳壹账通智能科技有限公司 人机对话方法、装置、介质及电子设备
CN114821257B (zh) * 2022-04-26 2024-04-05 中国科学院大学 导航中视频流与自然语言的智能处理方法和装置、设备
CN116820564B (zh) * 2023-07-06 2024-04-02 四川大学 程序语言的统一形式语义化方法

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101930428A (zh) * 2009-06-18 2010-12-29 万继华 计算机理解自然语言的系统及方法
CN101968785A (zh) * 2009-07-28 2011-02-09 万继华 理解人类自然语言的逻辑机器模型

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101303692B (zh) * 2008-06-19 2012-08-29 徐文和 一种供机器语言翻译的通用数码语义库
CN101923539B (zh) * 2009-06-11 2014-02-12 珠海市智汽电子科技有限公司 基于自然语言的人机对话系统
CN101931394A (zh) * 2009-06-18 2010-12-29 万继华 自然语言程序的逻辑控制和计算方法

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101930428A (zh) * 2009-06-18 2010-12-29 万继华 计算机理解自然语言的系统及方法
CN101968785A (zh) * 2009-07-28 2011-02-09 万继华 理解人类自然语言的逻辑机器模型

Also Published As

Publication number Publication date
CN103617159B (zh) 2016-10-12
CN103617159A (zh) 2014-03-05

Similar Documents

Publication Publication Date Title
WO2014086101A1 (zh) 将自然语言翻译成计算机语言的方法、语义分析器及人机对话系统
JP7247441B2 (ja) セマンティック表現モデルの処理方法、装置、電子機器、及び記憶媒体
Purver et al. Splitting the ‘I’s and crossing the ‘You’s: Context, speech acts and grammar
Bazzanella Discourse markers in Italian: Towards a “compositional” meaning
US9805718B2 (en) Clarifying natural language input using targeted questions
RU2509350C2 (ru) Способ семантической обработки естественного языка с использованием графического языка-посредника
AU2015315225A1 (en) Systems and methods for cinematic direction and dynamic character control via natural language output
KR20140094919A (ko) 문장 형식별 구성요소 배열 및 확장에 따른 언어 교육 시스템 및 방법과 기록 매체: 팩토리얼 언어 교육법
Okur et al. Data augmentation with paraphrase generation and entity extraction for multimodal dialogue system
KR20130057277A (ko) 텍스트로부터 애니메이션을 생성하는 방법 및 장치
CN102479078A (zh) 汉语语音码计算机汉语编程方法
KR20140012469A (ko) 단일화 문법을 이용한 자연어 처리 방법
Alberts Meeting them halfway: Altering language conventions to facilitate human-robot interaction
Zygadlo A therapeutic dialogue agent for polish language
Lv et al. StyleBERT: Chinese pretraining by font style information
Tulsian et al. Generating ISL using audio speech
Sowa Graphics and languages for the Flexible Modular Framework
Babeş-Vroman et al. Learning to interpret natural language instructions
Atterer et al. RUBISC-a robust unification-based incremental semantic chunker
Sharma et al. „Translating Speech to Indian Sign Language Using Natural Language Processing “, Future Internet 2022, 14, 253
Badawi The Effectiveness of Natural Language Processing (Nlp) as a Processing Solution and Semantic Improvement
Bilal Context Free Grammar (CFG)-based English/Urdu Translation System from Video & Audio to Pakistan Sign Language (PSL) Gestures
Chang et al. A structured context model for grammar learning
Ghosh Voice-Based Interactions for Editing Text on the Go
Zou Human-computer Interactive Oral Translation Methods and Related Issues

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

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

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 13860682

Country of ref document: EP

Kind code of ref document: A1