CN111782781A - A semantic analysis method, device, computer equipment and storage medium - Google Patents
A semantic analysis method, device, computer equipment and storage medium Download PDFInfo
- Publication number
- CN111782781A CN111782781A CN202010477643.0A CN202010477643A CN111782781A CN 111782781 A CN111782781 A CN 111782781A CN 202010477643 A CN202010477643 A CN 202010477643A CN 111782781 A CN111782781 A CN 111782781A
- Authority
- CN
- China
- Prior art keywords
- semantic
- entity
- text information
- node
- logical
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000004458 analytical method Methods 0.000 title claims abstract description 27
- 238000006243 chemical reaction Methods 0.000 claims abstract description 30
- 238000000034 method Methods 0.000 claims abstract description 24
- 230000002776 aggregation Effects 0.000 claims description 16
- 238000004220 aggregation Methods 0.000 claims description 16
- 238000004590 computer program Methods 0.000 claims description 11
- 238000013519 translation Methods 0.000 claims description 8
- 230000011218 segmentation Effects 0.000 claims description 7
- 238000010276 construction Methods 0.000 claims description 5
- 230000008451 emotion Effects 0.000 abstract description 7
- 238000013473 artificial intelligence Methods 0.000 abstract description 3
- 230000014509 gene expression Effects 0.000 description 8
- 230000008520 organization Effects 0.000 description 8
- 238000004364 calculation method Methods 0.000 description 7
- 230000008569 process Effects 0.000 description 7
- 238000012795 verification Methods 0.000 description 7
- 238000009795 derivation Methods 0.000 description 6
- 238000010586 diagram Methods 0.000 description 6
- 230000006870 function Effects 0.000 description 5
- 238000007689 inspection Methods 0.000 description 4
- 230000008439 repair process Effects 0.000 description 4
- 239000007787 solid Substances 0.000 description 4
- 238000012545 processing Methods 0.000 description 3
- 230000009286 beneficial effect Effects 0.000 description 2
- 230000006854 communication Effects 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 238000012797 qualification Methods 0.000 description 2
- FLDSMVTWEZKONL-AWEZNQCLSA-N 5,5-dimethyl-N-[(3S)-5-methyl-4-oxo-2,3-dihydro-1,5-benzoxazepin-3-yl]-1,4,7,8-tetrahydrooxepino[4,5-c]pyrazole-3-carboxamide Chemical compound CC1(CC2=C(NN=C2C(=O)N[C@@H]2C(N(C3=C(OC2)C=CC=C3)C)=O)CCO1)C FLDSMVTWEZKONL-AWEZNQCLSA-N 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 238000012937 correction Methods 0.000 description 1
- 239000000284 extract Substances 0.000 description 1
- 230000010365 information processing Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 238000010845 search algorithm Methods 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/33—Querying
- G06F16/332—Query formulation
- G06F16/3329—Natural language query formulation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/30—Semantic analysis
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/40—Processing or translation of natural language
- G06F40/58—Use of machine translation, e.g. for multi-lingual retrieval, for server-side translation for client devices or for real-time translation
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computational Linguistics (AREA)
- General Engineering & Computer Science (AREA)
- Artificial Intelligence (AREA)
- General Health & Medical Sciences (AREA)
- Audiology, Speech & Language Pathology (AREA)
- Health & Medical Sciences (AREA)
- Mathematical Physics (AREA)
- Human Computer Interaction (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Machine Translation (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
本发明涉及人工智能,提供一种语义分析方法、语义分析装置、计算机设备及存储介质。该方法包括:接收用户终端针对智能问答系统发送的查询请求,查询请求至少携带有查询文本信息;读取本地实体库,基于本地实体库以及预设逻辑规则对查询文本信息进行翻译操作,获取逻辑文本信息;基于语义树转换规则将逻辑文本信息转换成目标语义树;将目标语义树作为智能问答系统的输入内容进行智能问答操作。此外,本发明还涉及区块链技术,用户的隐私信息可存储于区块链中。本申请可以结合用户输入的文本的上下文逻辑关系,识别到用户的真实情绪,能够向用户提供更加契合用户需求的回答内容。
The invention relates to artificial intelligence, and provides a semantic analysis method, a semantic analysis device, computer equipment and a storage medium. The method includes: receiving a query request sent by a user terminal for an intelligent question answering system, where the query request at least carries query text information; reading a local entity library, and translating the query text information based on the local entity library and preset logic rules to obtain logic Text information; convert logical text information into target semantic tree based on semantic tree conversion rules; use the target semantic tree as the input content of the intelligent question answering system to perform intelligent question answering operations. In addition, the present invention also relates to the blockchain technology, and the user's private information can be stored in the blockchain. The present application can identify the user's real emotion in combination with the contextual logical relationship of the text input by the user, and can provide the user with answer content that is more suitable for the user's needs.
Description
技术领域technical field
本申请涉及人工智能技术领域,尤其涉及一种语义分析方法、装置、计算机设备及存储介质。The present application relates to the technical field of artificial intelligence, and in particular, to a semantic analysis method, apparatus, computer equipment and storage medium.
背景技术Background technique
智能问答系统是人工智能在产业界落地的重要阵地。随着大数据时代,AI时代的到来,越来越多的传统BI系统面临数据维度和业务功能维度集成整合的压力和挑战。The intelligent question answering system is an important position for artificial intelligence to be implemented in the industry. With the advent of the era of big data and AI, more and more traditional BI systems are facing the pressure and challenge of integrating data dimension and business function dimension.
现有一种客服机器人问答方法,是通过预设的客服机器人与用户进行交流,并基于用户交流的过程中提问的关键字在数据库中提取对应的答复内容进行回答,从而实现智能问答的过程。There is a customer service robot question answering method, which communicates with the user through a preset customer service robot, and extracts the corresponding reply content in the database based on the keywords asked during the user communication process, so as to realize the process of intelligent question answering.
然而,传统的客服机器人问答方法普遍不智能,该客服机器人只能通过配置关键字来返回固定的文字回答提问,没有考虑到上下文的结合,也没有识别到用户的真实情绪,而只是机械式的回答,用户体验较差。However, the traditional question and answer method of customer service robots is generally unintelligent. The customer service robot can only return fixed texts to answer questions by configuring keywords. It does not consider the combination of contexts and does not recognize the real emotions of users, but only mechanically. Answer, the user experience is poor.
发明内容SUMMARY OF THE INVENTION
本申请实施例的目的旨在解决传统的客服机器人问答方法普遍只能通过配置关键字来返回固定的文字回答提问,没有考虑到上下文的结合,也没有识别到用户的真实情绪,而只是机械式的回答,用户体验较差的问题。The purpose of the embodiments of the present application is to solve the problem that traditional customer service robot question answering methods generally only return fixed text to answer questions by configuring keywords, do not consider the combination of contexts, and do not recognize the real emotions of users, but only mechanically The answer to the problem of poor user experience.
为了解决上述技术问题,本申请实施例提供一种语义分析方法,采用了如下所述的技术方案:In order to solve the above technical problems, the embodiment of the present application provides a semantic analysis method, which adopts the following technical solutions:
接收用户终端针对智能问答系统发送的查询请求,所述查询请求至少携带有查询文本信息;receiving a query request sent by the user terminal for the intelligent question answering system, where the query request at least carries query text information;
读取本地实体库,基于所述本地实体库以及预设逻辑规则对所述查询文本信息进行翻译操作,获取逻辑文本信息;reading a local entity library, and performing a translation operation on the query text information based on the local entity library and preset logic rules to obtain logical text information;
基于语义树转换规则将所述逻辑文本信息转换成目标语义树;Converting the logical text information into a target semantic tree based on a semantic tree conversion rule;
将所述目标语义树作为所述智能问答系统的输入内容进行智能问答操作。The intelligent question answering operation is performed using the target semantic tree as the input content of the intelligent question answering system.
为了解决上述技术问题,本申请实施例还提供一种语义分析装置,采用了如下所述的技术方案:In order to solve the above technical problems, the embodiment of the present application also provides a semantic analysis device, which adopts the following technical solutions:
请求接收模块,用于接收用户终端针对智能问答系统发送的查询请求,所述查询请求至少携带有查询文本信息;a request receiving module, configured to receive a query request sent by the user terminal for the intelligent question answering system, where the query request at least carries query text information;
文本获取模块,用于读取本地实体库,基于所述本地实体库以及预设逻辑规则对所述查询文本信息进行翻译操作,获取逻辑文本信息;a text acquisition module, configured to read a local entity library, perform a translation operation on the query text information based on the local entity library and preset logic rules, and acquire logical text information;
语义转换模块,用于基于语义树转换规则将所述逻辑文本信息转换成目标语义树;a semantic conversion module for converting the logical text information into a target semantic tree based on a semantic tree conversion rule;
语义输入模块,用于将所述目标语义树作为所述智能问答系统的输入内容进行智能问答操作。The semantic input module is configured to use the target semantic tree as the input content of the intelligent question answering system to perform intelligent question answering operations.
为了解决上述技术问题,本申请实施例还提供一种计算机设备,采用了如下所述的技术方案:In order to solve the above-mentioned technical problems, the embodiment of the present application also provides a computer device, which adopts the following technical solutions:
包括存储器和处理器,所述计算机可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时实现如上所述语义分析方法的步骤。A memory and a processor are included, and a computer program is stored on the computer-readable storage medium, and when the computer program is executed by the processor, the steps of the semantic analysis method as described above are implemented.
为了解决上述技术问题,本申请实施例还提供一种计算机可读存储介质,采用了如下所述的技术方案:In order to solve the above technical problems, the embodiments of the present application also provide a computer-readable storage medium, which adopts the following technical solutions:
所述计算机可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时实现如上所述语义分析方法的步骤。A computer program is stored on the computer-readable storage medium, and when the computer program is executed by the processor, implements the steps of the semantic analysis method as described above.
与现有技术相比,本申请实施例提供的语义分析方法以及语义分析装置至少具有以下有益效果:Compared with the prior art, the semantic analysis method and the semantic analysis device provided by the embodiments of the present application have at least the following beneficial effects:
通过将用户输入的查询文本翻译成逻辑文本,有效帮助我们将自然语言问句转化为机器可识别的表达,澄清了问句中模糊的表述,将问句以更规范、更清晰的规则展现,为后续基于自然语言的功能实现奠定了坚实的基础;并将所述逻辑文本转换成语义树,可以以严谨的逻辑顺序组织语义,逻辑规则与语义树的转换可以使人理解的语言信息转化为计算机可识别的数据结构,为后续执行查询操作提供基础,逻辑规则的校验为语义的检查以及修复提供基础,将语义树作为输入内容进行问答操作,可以结合用户输入的文本的上下文逻辑关系,识别到用户的真实情绪,能够向用户提供更加契合用户需求的回答内容。By translating the query text input by the user into logical text, it effectively helps us convert natural language questions into machine-recognizable expressions, clarifies the vague expressions in questions, and presents questions with more standardized and clearer rules. It lays a solid foundation for the subsequent realization of functions based on natural language; and converts the logical text into a semantic tree, which can organize semantics in a rigorous logical order, and the conversion of logical rules and semantic trees can make understandable language information into The computer-identifiable data structure provides the basis for subsequent query operations. The verification of logic rules provides the basis for semantic inspection and repair. The semantic tree is used as the input content for question-and-answer operations, which can be combined with the contextual logic relationship of the text input by the user. Recognizing the real emotions of users can provide users with answer content that is more in line with user needs.
附图说明Description of drawings
为了更清楚地说明本申请中的方案,下面将对本申请实施例描述中所需要使用的附图作一个简单介绍,显而易见地,下面描述中的附图是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to illustrate the solutions in the present application more clearly, the following will briefly introduce the accompanying drawings used in the description of the embodiments of the present application. For those of ordinary skill, other drawings can also be obtained from these drawings without any creative effort.
图1是本发明实施例一提供的语义分析方法的实现流程图;Fig. 1 is the realization flow chart of the semantic analysis method provided by the first embodiment of the present invention;
图2是本发明实施例一提供的目标语义树的示意图;2 is a schematic diagram of a target semantic tree provided by Embodiment 1 of the present invention;
图3是图1中步骤S102的实现流程图;Fig. 3 is the realization flow chart of step S102 in Fig. 1;
图4是图1中步骤S103的实现流程图;Fig. 4 is the realization flow chart of step S103 in Fig. 1;
图5是本发明实施例一提供的逻辑校验方法的实现流程图;Fig. 5 is the realization flow chart of the logic verification method provided by the first embodiment of the present invention;
图6是本发明实施例二提供的语义分析装置的结构示意图;6 is a schematic structural diagram of a semantic analysis device provided in Embodiment 2 of the present invention;
图7是图6中文本获取模块的结构示意图;Fig. 7 is the structural representation of the text acquisition module in Fig. 6;
图8是图6中语义转换模块的结构示意图;Fig. 8 is the structural representation of the semantic conversion module in Fig. 6;
图9是根据本申请的计算机设备的一个实施例的结构示意图。FIG. 9 is a schematic structural diagram of an embodiment of a computer device according to the present application.
具体实施方式Detailed ways
除非另有定义,本文所使用的所有的技术和科学术语与属于本申请的技术领域的技术人员通常理解的含义相同;本文中在申请的说明书中所使用的术语只是为了描述具体的实施例的目的,不是旨在于限制本申请;本申请的说明书和权利要求书及上述附图说明中的术语“包括”和“具有”以及它们的任何变形,意图在于覆盖不排他的包含。本申请的说明书和权利要求书或上述附图中的术语“第一”、“第二”等是用于区别不同对象,而不是用于描述特定顺序。Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the technical field of this application; the terms used herein in the specification of the application are for the purpose of describing specific embodiments only It is not intended to limit the application; the terms "comprising" and "having" and any variations thereof in the description and claims of this application and the above description of the drawings are intended to cover non-exclusive inclusion. The terms "first", "second" and the like in the description and claims of the present application or the above drawings are used to distinguish different objects, rather than to describe a specific order.
在本文中提及“实施例”意味着,结合实施例描述的特定特征、结构或特性可以包含在本申请的至少一个实施例中。在说明书中的各个位置出现该短语并不一定均是指相同的实施例,也不是与其它实施例互斥的独立的或备选的实施例。本领域技术人员显式地和隐式地理解的是,本文所描述的实施例可以与其它实施例相结合。Reference herein to an "embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the present application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor a separate or alternative embodiment that is mutually exclusive of other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
为了使本技术领域的人员更好地理解本申请方案,下面将结合附图,对本申请实施例中的技术方案进行清楚、完整地描述。In order to make those skilled in the art better understand the solutions of the present application, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the accompanying drawings.
实施例一Example 1
参考图1,示出了本发明实施例一提供的语义分析方法的实现流程图,为了便于说明,仅示出与本发明相关的部分。Referring to FIG. 1 , an implementation flowchart of the semantic analysis method provided by Embodiment 1 of the present invention is shown. For convenience of description, only parts related to the present invention are shown.
在步骤S101中,接收用户终端针对智能问答系统发送的查询请求,查询请求至少携带有查询文本信息。In step S101, a query request sent by the user terminal for the intelligent question answering system is received, where the query request at least carries query text information.
在本发明实施例中,用户终端可以是诸如移动电话、智能电话、笔记本电脑、数字广播接收器、PDA(个人数字助理)、PAD(平板电脑)、PMP(便携式多媒体播放器)、导航装置等等的移动终端以及诸如数字TV、台式计算机等等的固定终端,应当理解,此处对用户终端的举例仅为方便理解,不用于限定本发明。In the embodiment of the present invention, the user terminal may be such as a mobile phone, a smart phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a navigation device, etc. such as mobile terminals and fixed terminals such as digital TVs, desktop computers, etc., it should be understood that the examples of user terminals here are only for convenience of understanding, and are not intended to limit the present invention.
在本发明实施例中,智能问答系统主要用于精确的定位网站用户所需要的提问知识,通过与网站用户进行交互,为网站用户提供个性化的信息服务。In the embodiment of the present invention, the intelligent question answering system is mainly used to accurately locate the questioning knowledge required by website users, and provide personalized information services for website users by interacting with website users.
在本发明实施例中,查询请求指的是用户通过该用户终端向系统发送的包含用户需要提问的内容的数据流信息,该查询请求可以是文本输入的文本数据,也可以是语音输入的音频数据。当该查询请求为音频数据的时候,需要对该音频数据进行语音识别操作,转换成系统可进行语义分析的文本数据,应当理解,此处对查询请求的举例仅为方便理解,不用于限定本发明。In this embodiment of the present invention, the query request refers to the data stream information that the user sends to the system through the user terminal and contains the content that the user needs to ask. The query request may be text data input by text, or audio input by voice. data. When the query request is audio data, it is necessary to perform speech recognition on the audio data and convert it into text data that the system can perform semantic analysis. invention.
在本发明实施例中,查询文本信息指的是用户输入的文本数据,或者是用户输入的音频数据转换成的文本数据,该查询文本信息为用户最原始的语义内容。In this embodiment of the present invention, the query text information refers to text data input by the user, or text data converted from audio data input by the user, and the query text information is the most original semantic content of the user.
在步骤S102中,读取本地实体库,基于本地实体库以及预设逻辑规则对查询文本信息进行翻译操作,获取逻辑文本信息。In step S102, the local entity library is read, and the query text information is translated based on the local entity library and preset logic rules to obtain logical text information.
在本发明实施例中,本地实体库主要用于预先存储实体内容的知识库。In this embodiment of the present invention, the local entity library is mainly used to pre-store a knowledge base of entity content.
在本发明实施例中,预设逻辑规则主要用于精确表达自然语言信息,并便于机器进行识别,该预设逻辑规则可根据实际需要进行对应设计。In the embodiment of the present invention, the preset logic rules are mainly used to accurately express natural language information and facilitate machine identification, and the preset logic rules can be correspondingly designed according to actual needs.
在本发明实施例中,翻译操作指的是识别上述查询文本信息后,通过实体连接的方式,将查询文本信息与上述知识库中的实体内容进行对照,获取实体内容一致的文本,并通过基于语义表示的逻辑规则符号集对该文本进行翻译,从而获得上述逻辑文本信息。In the embodiment of the present invention, the translation operation refers to, after identifying the above query text information, by means of entity connection, comparing the query text information with the entity content in the above knowledge base, obtaining the text with the same entity content, The semantically represented logical rule symbol set translates the text, so as to obtain the above-mentioned logical text information.
在本发明实施例中,将问句中出现的最大的排序实体作为该问句的主题实体词,将用户最终询问的实体作为查询图链路的结尾。通过遍历问句中出现的实体、关系、属性,得到从主题实体词到结尾实体词的核心推理链路。针对每一条核心推导链路,将其转化为树结构进行存储,通过比较该树结构与已知意图的相似性,得到与该问句最相似的核心推导链路。最终将该核心推导链路的链接信息解析为查询参数和查询流程。In the embodiment of the present invention, the largest ranking entity that appears in the question is taken as the subject entity word of the question, and the entity finally queried by the user is taken as the end of the query graph link. By traversing the entities, relations and attributes in the question, the core reasoning link from the subject entity word to the ending entity word is obtained. For each core derivation link, it is converted into a tree structure for storage, and the core derivation link that is most similar to the question is obtained by comparing the similarity between the tree structure and the known intent. Finally, the link information of the core derivation link is parsed into query parameters and query process.
在步骤S103中,基于语义树转换规则将逻辑文本信息转换成目标语义树。In step S103, the logical text information is converted into a target semantic tree based on the semantic tree conversion rule.
在本发明实施例中,语义树转换规则指的是逻辑规则以“<>”表达最小语义。我们首先将逻辑规则切分为一系列最小语义单元,然后将最小语义单元转换为语义树的节点(语义组合与拼装),根据语义单元之间的引用关系建立语义树,这种引用关系代表了查询的先后关系以及知识图谱实体之间的关联方式。In this embodiment of the present invention, the semantic tree conversion rule refers to a logical rule expressing minimal semantics with "<>". We first divide the logic rules into a series of minimum semantic units, and then convert the minimum semantic units into nodes of the semantic tree (semantic combination and assembly), and build the semantic tree according to the reference relationship between the semantic units. This reference relationship represents the The sequence of queries and the way of association between knowledge graph entities.
在实际应用中,叶子节点对应三元组的实体,非叶子节点对应三元组的实体间的关系或者实体的属性,答案节点位于根节点处。以XX公司的交易对手的敞口信息为例,XX公司和交易对手为实体,交易关系为实体间关系,敞口信息为属性,最后的答案节点询问的是属性值,如图2所示。In practical applications, leaf nodes correspond to entities of triples, non-leaf nodes correspond to relationships between entities of triples or attributes of entities, and answer nodes are located at the root node. Taking the exposure information of the counterparty of XX company as an example, XX company and the counterparty are entities, the transaction relationship is an inter-entity relationship, the exposure information is an attribute, and the final answer node asks for the attribute value, as shown in Figure 2.
在步骤S104中,将目标语义树作为智能问答系统的输入内容进行智能问答操作。In step S104, the intelligent question answering operation is performed using the target semantic tree as the input content of the intelligent question answering system.
通过将用户输入的查询文本翻译成逻辑文本,有效帮助我们将自然语言问句转化为机器可识别的表达,澄清了问句中模糊的表述,将问句以更规范、更清晰的规则展现,为后续基于自然语言的功能实现奠定了坚实的基础;并将所述逻辑文本转换成语义树,可以以严谨的逻辑顺序组织语义,逻辑规则与语义树的转换可以使人理解的语言信息转化为计算机可识别的数据结构,为后续执行查询操作提供基础,逻辑规则的校验为语义的检查以及修复提供基础,将语义树作为输入内容进行问答操作,可以结合用户输入的文本的上下文逻辑关系,识别到用户的真实情绪,能够向用户提供更加契合用户需求的回答内容。By translating the query text input by the user into logical text, it effectively helps us convert natural language questions into machine-recognizable expressions, clarifies the vague expressions in questions, and presents questions with more standardized and clearer rules. It lays a solid foundation for the subsequent realization of functions based on natural language; and converts the logical text into a semantic tree, which can organize semantics in a rigorous logical order, and the conversion of logical rules and semantic trees can make understandable language information into The computer-identifiable data structure provides the basis for subsequent query operations. The verification of logic rules provides the basis for semantic inspection and repair. The semantic tree is used as the input content for question-and-answer operations, which can be combined with the contextual logic relationship of the text input by the user. Recognizing the real emotions of users can provide users with answer content that is more in line with user needs.
作为实施例一的一些可选实现方式中,该预设逻辑规则具体包括Unary一元规则、Binary二元规则以及Aggregation聚合规则。As some optional implementation manners of the first embodiment, the preset logic rules specifically include Unary unary rules, Binary binary rules, and Aggregation aggregation rules.
在本发明实施例中,为精确表达自然语言信息,并以机器可识别的逻辑规则展现,设计了三种语义单元模板,分别是Unary一元规则、Binary二元规则以及Aggregation聚合规则,具体规则如下:In the embodiment of the present invention, in order to accurately express natural language information and display it with machine-recognizable logical rules, three semantic unit templates are designed, namely Unary unary rule, Binary binary rule and Aggregation aggregation rule. The specific rules are as follows :
(1)Unary一元规则(1) Unary unary rule
对于问句中的实体e,需要明确实体e表示的是一类实体还是一个实例Instance。若问句中仅出现了实体的类别,表示成<Unary(class=’E’)>;若问句中出现的是实体的实例值,则需找到其对应的实体类别,表示成<Unary(class=’E’,value=’Instance’)>。例如,定义‘机构’为一种实体类型。当问句中出现‘公司’时,表示成<Unary(class=’机构’)>,若问句中出现‘XXX公司’时,则表示成<Unary(class=’机构’,value=’XXX公司’)>。For the entity e in the question, it needs to be clear whether the entity e represents a class of entities or an instance Instance. If only the category of the entity appears in the question, it is expressed as <Unary(class='E')>; if the instance value of the entity appears in the question, the corresponding entity category needs to be found, expressed as <Unary( class='E', value='Instance')>. For example, define 'organization' as an entity type. When 'company' appears in the question, it is expressed as <Unary(class='organization')>, and if 'XXX company' appears in the question, it is expressed as <Unary(class='organization', value='XXX company')>.
(2)Binary二元规则(2) Binary binary rule
Binary主要用于描述三元组的关系,三元组可以理解为(头实体、关系、尾实体),(头实体、属性、属性值)或(关系,关系属性,关系属性值)。Binary规则是已知其中两个元素,求第三个元素,使用‘?’来标记要查询的元素。Binary is mainly used to describe the relationship of triples, and triples can be understood as (head entity, relationship, tail entity), (head entity, attribute, attribute value) or (relation, relationship attribute, relationship attribute value). The Binary rule is to know two of the elements, to find the third element, use '? ' to mark the element to query.
关系类问题,S和E表示的是实体,rel表示的是关系Relationship class problem, S and E represent entities, rel represents relationships
Binary(S,rel?,E)返回的是S和E之间的关系;Binary(S,rel?,E) returns the relationship between S and E;
Binary(S,rel,E?)返回的是S的rel是什么;Binary(S,rel,E?) returns what the rel of S is;
Binary(S?,rel,E)回答的是有哪些实体和E有rel关系;Binary(S?,rel,E) answers which entities have a rel relationship with E;
b)实体属性类问题,S表示实体,PRO表示属性,value表示属性值b) Entity attribute class problem, S means entity, PRO means attribute, value means attribute value
Binary(S,PRO,value?)返回的是S的属性PRO是多少;Binary(S, PRO, value?) returns the property PRO of S;
Binary(S?,PRO,value)求的是属性PRO是value的实体S;Binary(S?,PRO,value) seeks the entity S whose attribute PRO is value;
Binary(S,PRO?,value)求的是value是S的什么属性;Binary(S, PRO?, value) asks what property of S is value;
c)关系属性类问题,R表示关系,RPRO表示关系的属性,value表示属性值c) Relational attribute class problem, R represents the relationship, RPRO represents the attribute of the relationship, and value represents the value of the attribute
Binary(R,RPRO,value?)求的是关系的属性RPRO是多少;Binary(R,RPRO,value?) What is the attribute RPRO of the relationship;
(3)Aggregation聚合规则(3) Aggregation aggregation rules
此处引用了一系列聚合操作符,来表达问句中的运算逻辑和限定逻辑,主要有如下七种:A series of aggregation operators are quoted here to express the operational logic and qualification logic in the question, mainly including the following seven types:
Rank操作Rank operation
参数设置:by—排序的属性;obj—操作的对象;range—排序的返回范围Parameter settings: by—sorted property; obj—operated object; range—sorted return range
用途:排序,用于回答‘前N个’,‘第N个’等问题Purpose: Sorting, used to answer 'Top N', 'Nth' and other questions
Count操作Count operation
参数设置:obj—计数的对象;con—计数时过滤条件Parameter setting: obj—counted object; con—filter condition when counting
用途:统计,用于回答‘有多少个’类似问题Purpose: Statistics, used to answer 'how many' similar questions
Sum操作Sum operation
参数设置:obj—求和的对象;con—加总时过滤条件Parameter setting: obj—the object to be summed; con—the filter condition when adding up
用途:对数值类属性做加总计算Purpose: Summarize numeric attributes
Opr操作Opr operation
参数设置:‘=’--计算方法(+-*/and or);Parameter setting: '='--calculation method (+-*/and or);
S—数值1;E—数值2;con—计算时的过滤条件S—value 1; E—value 2; con—filter condition during calculation
用途:二元计算,用于回答各类计算问题Purpose: Binary computing, used to answer various computing problems
Filter操作Filter operation
参数设置:obj--过滤的对象;con—过滤条件Parameter settings: obj--filtered object; con-filter condition
用途:对于关系的属性进行筛选操作Purpose: to filter the properties of the relationship
Time操作Time operation
参数设置:con—时间限定范围Parameter setting: con—time limit range
用途:用于表示问句的时间跨度Purpose: used to express the time span of a question
Trend&Distribution操作Trend&Distribution operation
参数设置:无Parameter setting: none
用途:分布与变化趋势计算Purpose: Distribution and trend calculation
整个逻辑规则由多个语义单元组成,单个语义单元的语法规范如下:The entire logic rule consists of multiple semantic units, and the syntax specification of a single semantic unit is as follows:
<unit_code:semantic_unit><unit_code:semantic_unit>
逻辑规则构建应遵循了原问句的语序,语义单元的排列顺序应与原问句中该语义所在位置一致。The construction of logical rules should follow the word order of the original question, and the arrangement order of the semantic units should be consistent with the semantic location in the original question.
unit_code代表语义单元的编码,逻辑规则应有且只有一个主单元。主单元表示问句最终要返回的答案内容,用A表示,主单元一定是最后执行的。语义单元编码的原则是从A先向前再向后命名扩展,比如:V5 V4 V3 V2 V1 AV6 V7 V8。unit_code represents the encoding of the semantic unit, and the logic rule should have only one main unit. The main unit indicates the content of the answer to be returned in the final question sentence, which is represented by A. The main unit must be executed last. The principle of semantic unit coding is to name extensions from A to the front and then back, for example: V5 V4 V3 V2 V1 AV6 V7 V8.
semantic_unit即为上单元提到的三元组表示,不再复述。Semantic_unit is the triple representation mentioned in the previous unit, and will not be repeated.
继续参考图3,示出了图1中步骤S102的实现流程图,为了便于说明,仅示出与本发明相关的部分。Continuing to refer to FIG. 3 , a flowchart of the implementation of step S102 in FIG. 1 is shown. For the convenience of description, only the parts related to the present invention are shown.
作为实施例一的一些可选实现方式中,上述步骤S102具体包括:步骤S201、步骤S202、步骤S203、步骤S204、步骤S205以及步骤S206。As some optional implementation manners of the first embodiment, the above step S102 specifically includes: step S201 , step S202 , step S203 , step S204 , step S205 and step S206 .
在步骤S201中,在本地实体库中获取与查询文本信息相对应的实体数据。In step S201, entity data corresponding to the query text information is acquired in the local entity library.
在本发明实施例中,可通过识别问句中出现内容,获得关键词,并与本地实体库存在的实体进行比较,最终获取关键词与实体相一致的数据,作为该实体数据。In the embodiment of the present invention, the keyword can be obtained by identifying the content in the question, and compared with the entity existing in the local entity database, and finally the data consistent with the keyword and the entity is obtained as the entity data.
在步骤S202中,基于预设权重值确定与实体数据相对应的主题实体词。In step S202, a topic entity word corresponding to the entity data is determined based on a preset weight value.
在本发明实施例中,对步骤S201中找出来的多个实体,选择一个作为主题实体词。通过本地实体中实体间的指向关系,预设每种实体的权重值。将权重大于0的实体作为主题实体词的候选集,按照顺序对每个候选主题词尝试后续操作。In this embodiment of the present invention, one of the multiple entities found in step S201 is selected as the subject entity word. The weight value of each entity is preset through the pointing relationship between entities in the local entity. Entities with weights greater than 0 are used as candidate sets of topic entity words, and subsequent operations are attempted on each candidate topic word in order.
在步骤S203中,将查询文本信息的末端实体数据作为结尾实体词。In step S203, the end entity data of the query text information is used as the end entity word.
在本发明实施例中,将问句结束时要询问的实体作为结尾实体词。当结尾实体词为关系时,尝试进行修正。In this embodiment of the present invention, the entity to be inquired at the end of the question sentence is taken as the ending entity word. When the ending entity word is a relation, try to fix it.
在步骤S204中,分别将主题实体词以及结尾实体词作为初始逻辑文本的首位实体词,获得中间逻辑文本。In step S204, the subject entity word and the ending entity word are respectively used as the first entity word of the initial logical text to obtain an intermediate logical text.
在本发明实施例中,将步骤S202中得到的主题实体词和步骤S203中得到的结尾实体词作为链路的首尾两端,在图谱中进行遍历。得到候选的子图集合。In the embodiment of the present invention, the subject entity word obtained in step S202 and the ending entity word obtained in step S203 are used as the first and last ends of the link to traverse in the graph. Get the candidate subgraph set.
在步骤S205中,在意图数据库中获取与中间逻辑文本相似度最高的最优意图。In step S205, the optimal intent with the highest similarity to the intermediate logical text is obtained in the intent database.
在本发明实施例中,将候选子图与意图库中已有的意图进行相似性判断。相似性通过实体、关系、位置等是否一致来判断。得到最相似的一个意图返回。In the embodiment of the present invention, the similarity judgment is performed between the candidate subgraph and the existing intent in the intent library. Similarity is judged by whether entities, relationships, locations, etc. are consistent. Get the most similar one intent to return.
在步骤S206中,基于最优意图生成逻辑文本信息。In step S206, logical text information is generated based on the optimal intention.
在本发明实施例中,根据意图子图的图结构,生成逻辑形式。In this embodiment of the present invention, a logical form is generated according to the graph structure of the intent subgraph.
在实际应用中,将节点(实体类型)对应到uniary表示规则,class对应实体类型,value对应具体实例值,例如:平安人寿。若没有具体的实体值,uniary表示可以增加value的信息。边(关系、属性实体)对应到binary表示规则。Binary的第一个位置为该边对应的节点信息,第二个位置为边的表示信息,例如:属性实体出险率。第三个位置根据该边为关系还是属性实体分别填充对应的节点信息。例如:该问题中只有一个Binary表示,第二个位置为出险率,即属性实体。此时若存在出险率的属性值,例如出险率的值是否大于20%,大于20%为出险率的属性值。则第三个位置填充>20%,若不存在对应的属性值,则根据逻辑形式的定义,填充指代实体A。In practical applications, the node (entity type) corresponds to the uniary representation rule, the class corresponds to the entity type, and the value corresponds to the specific instance value, such as Ping An Life. If there is no specific entity value, uniform indicates information that can add value. Edges (relationships, attribute entities) correspond to binary representation rules. The first position of Binary is the node information corresponding to the edge, and the second position is the representation information of the edge, such as: attribute entity risk rate. The third position is filled with corresponding node information according to whether the edge is a relationship or an attribute entity. For example: There is only one Binary representation in this problem, and the second position is the risk rate, that is, the attribute entity. At this time, if there is an attribute value of the accident rate, for example, whether the value of the accident rate is greater than 20%, the attribute value of the accident rate is greater than 20%. Then the third position is filled with >20%. If there is no corresponding attribute value, the filling refers to entity A according to the definition of the logical form.
最后得到如下逻辑形式:Finally, the following logical form is obtained:
<V1:Uniary(class=专业公司,value=平安人寿)><V1:Uniary(class=professional company, value=Ping An Life)>
<A:Binary(V1,出险率,A?)><A:Binary(V1, risk rate, A?)>
继续参考图4,示出了图1中步骤S103的实现流程图,为了便于说明,仅示出与本发明相关的部分。Continuing to refer to FIG. 4 , a flow chart of the implementation of step S103 in FIG. 1 is shown. For convenience of description, only the parts related to the present invention are shown.
作为实施例一的一些可选实现方式中,上述步骤S103具体包括:步骤S301、步骤S302以及步骤S303。As some optional implementation manners of the first embodiment, the foregoing step S103 specifically includes: step S301 , step S302 and step S303 .
在步骤S301中,对逻辑文本信息进行语义切分操作,获得语义单元。In step S301, a semantic segmentation operation is performed on the logical text information to obtain a semantic unit.
在步骤S302中,对语义单元进行节点转换操作,获得语义节点。In step S302, a node conversion operation is performed on the semantic unit to obtain a semantic node.
在步骤S303中,基于语义节点构建语义树,获得目标语义树。In step S303, a semantic tree is constructed based on the semantic nodes to obtain a target semantic tree.
在实际应用中,程序会以<>为节点单元将如上述逻辑规则分拆成五个节点。每个节点建立一个树节点对象(每个树节点对象有如下属性:名字,类型,值,左子节点,右子节点,父节点等),例如以<V3:Binary(V2?,交易关系,V1)>节点为例,树节点对象的名字为V3,类型为Binary,值为(V2?,交易关系,V1),左子节点、右子节点、父节点初始化为空。后续描述中,我们以节点对象的名字表示节点名称,如<V1:Uniary(class='机构',value=’XX公司’)>描述为V1节点。In practical applications, the program will use <> as the node unit to split the above logic rules into five nodes. Each node creates a tree node object (each tree node object has the following attributes: name, type, value, left child node, right child node, parent node, etc.), for example, with <V3:Binary(V2?, transaction relationship, V1)> node as an example, the name of the tree node object is V3, the type is Binary, the value is (V2?, transaction relationship, V1), and the left child node, right child node, and parent node are initialized to empty. In the subsequent description, we use the name of the node object to represent the node name. For example, <V1:Uniary(class='organization', value='XX company')> is described as a V1 node.
根据五个树节点对象建立树,主要更新每个树节点的左子节点,右子节点,父节点,例如:Build a tree based on five tree node objects, mainly update the left child node, right child node, and parent node of each tree node, for example:
1)针对V3节点,更新如下数值:V3的左子节点为V2,右子节点为V1,V2的父节点为V3,V1的父节点为V3。1) For the V3 node, update the following values: the left child node of V3 is V2, the right child node is V1, the parent node of V2 is V3, and the parent node of V1 is V3.
2)针对V1节点,更新如下数值:V1的左子节点为空,右子节点为空。2) For the V1 node, update the following values: the left child node of V1 is empty, and the right child node is empty.
3)针对V4节点,更新如下数值:V4的左子节点为V3,右子节点为空,V3的父节点为V4。3) For the V4 node, update the following values: the left child node of V4 is V3, the right child node is empty, and the parent node of V3 is V4.
4)针对A节点,更新如下数值:A节点的左子节点为V4,右子节点为空,V4节点的父子节点为A。4) For node A, update the following values: the left child node of node A is V4, the right child node is empty, and the parent-child node of node V4 is A.
这样就建立树节点之间的引用关系,同时得到根节点为A节点,最终形成的语义树如上述图2所示。In this way, a reference relationship between tree nodes is established, and at the same time, the root node is obtained as node A, and the finally formed semantic tree is shown in Figure 2 above.
继续参考图5,示出了本发明实施例一提供的逻辑校验方法的实现流程图,为了便于说明,仅示出与本发明相关的部分。Continuing to refer to FIG. 5 , a flow chart of the implementation of the logic verification method provided by Embodiment 1 of the present invention is shown. For convenience of description, only parts related to the present invention are shown.
作为实施例一的一些可选实现方式中,上述步骤S103之后,还包括:步骤S401、步骤S402、步骤S403以及步骤S404。As some optional implementation manners of the first embodiment, after the above step S103, it further includes: step S401, step S402, step S403 and step S404.
在步骤S401中,获取目标语义树的节点类型。In step S401, the node type of the target semantic tree is acquired.
在步骤S402中,判断所述本地实体库中是否存在与所述节点类型相对应的实体三元组。In step S402, it is judged whether there is an entity triple corresponding to the node type in the local entity library.
在步骤S403中,若所述本地实体库中存在与所述节点类型相对应的实体三元组,则执行所述将所述目标语义树作为所述智能问答系统的输入内容进行智能问答操作的步骤。In step S403, if there is an entity triple corresponding to the node type in the local entity library, execute the intelligent question answering operation using the target semantic tree as the input content of the intelligent question answering system step.
在步骤S404中,若所述本地实体库中不存在与所述节点类型相对应的实体三元组,则输出节点错误信号。In step S404, if the entity triple corresponding to the node type does not exist in the local entity library, a node error signal is output.
在本发明实施例中,判断是否存在实体三元组的过程是利用后续遍历树搜索算法,自底向上搜索整个树,同时从数据库中取提前定义的概念图谱三元组,对节点进行类型比对,确保每个节点符合定义的三元组,若符合则继续向上搜索,不符合则返回出错节点。逻辑校验的目的在于既可以发现语义的缺失、冗余以及错位(为语义树的修正提供基础),也可以为语义解析模块提供出错信息,做出修正。In the embodiment of the present invention, the process of judging whether there is an entity triple is to use the subsequent tree traversal search algorithm to search the entire tree from the bottom up, and at the same time, take a predefined concept map triple from the database, and compare the nodes by type. Yes, make sure that each node conforms to the defined triple, if so, continue to search upwards, if not, return the error node. The purpose of logic verification is to not only find the lack, redundancy and dislocation of semantics (providing a basis for the revision of the semantic tree), but also to provide error information for the semantic parsing module to make corrections.
综上所述,本发明实施例提供的语义分析方法置至少具有以下有益效果:To sum up, the semantic analysis method provided by the embodiment of the present invention has at least the following beneficial effects:
通过将用户输入的查询文本翻译成逻辑文本,有效帮助我们将自然语言问句转化为机器可识别的表达,澄清了问句中模糊的表述,将问句以更规范、更清晰的规则展现,为后续基于自然语言的功能实现奠定了坚实的基础;并将所述逻辑文本转换成语义树,可以以严谨的逻辑顺序组织语义,逻辑规则与语义树的转换可以使人理解的语言信息转化为计算机可识别的数据结构,为后续执行查询操作提供基础,逻辑规则的校验为语义的检查以及修复提供基础,将语义树作为输入内容进行问答操作,可以结合用户输入的文本的上下文逻辑关系,识别到用户的真实情绪,能够向用户提供更加契合用户需求的回答内容。By translating the query text input by the user into logical text, it effectively helps us convert natural language questions into machine-recognizable expressions, clarifies the vague expressions in questions, and presents questions with more standardized and clearer rules. It lays a solid foundation for the subsequent realization of functions based on natural language; and converts the logical text into a semantic tree, which can organize semantics in a rigorous logical order, and the conversion of logical rules and semantic trees can make understandable language information into The computer-identifiable data structure provides the basis for subsequent query operations. The verification of logic rules provides the basis for semantic inspection and repair. The semantic tree is used as the input content for question-and-answer operations, which can be combined with the contextual logic relationship of the text input by the user. Recognizing the real emotions of users can provide users with answer content that is more in line with user needs.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,该计算机程序可存储于一计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,前述的存储介质可为磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)等非易失性存储介质,或随机存储记忆体(Random Access Memory,RAM)等。Those of ordinary skill in the art can understand that the realization of all or part of the processes in the methods of the above embodiments can be accomplished by instructing relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium, and the program is During execution, it may include the processes of the embodiments of the above-mentioned methods. The aforementioned storage medium may be a non-volatile storage medium such as a magnetic disk, an optical disk, a read-only memory (Read-Only Memory, ROM), or a random access memory (Random Access Memory, RAM).
应该理解的是,虽然附图的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,其可以以其他的顺序执行。而且,附图的流程图中的至少一部分步骤可以包括多个子步骤或者多个阶段,这些子步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,其执行顺序也不必然是依次进行,而是可以与其他步骤或者其他步骤的子步骤或者阶段的至少一部分轮流或者交替地执行。It should be understood that although the various steps in the flowchart of the accompanying drawings are sequentially shown in the order indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless explicitly stated herein, the execution of these steps is not strictly limited to the order and may be performed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but may be executed at different times, and the execution sequence is also It does not have to be performed sequentially, but may be performed alternately or alternately with other steps or at least a portion of sub-steps or stages of other steps.
实施例二Embodiment 2
进一步参考图6,作为对上述图1所示方法的实现,本申请提供了一种语义识别装置的一个实施例,该装置实施例与图1所示的方法实施例相对应,该装置具体可以应用于各种电子设备中。With further reference to FIG. 6 , as an implementation of the method shown in FIG. 1 , the present application provides an embodiment of a semantic recognition device. The device embodiment corresponds to the method embodiment shown in FIG. 1 . Specifically, the device may Used in various electronic devices.
如图6所示,本发明实施例二提供的语义识别装置100包括:请求接收模块110、文本获取模块120、语义转换模块130以及语义输入模块140。其中:As shown in FIG. 6 , the
请求接收模块110,用于接收用户终端针对智能问答系统发送的查询请求,所述查询请求至少携带有查询文本信息;The
文本获取模块120,用于读取本地实体库,基于所述本地实体库以及预设逻辑规则对所述查询文本信息进行翻译操作,获取逻辑文本信息;A
语义转换模块130,用于基于语义树转换规则将所述逻辑文本信息转换成目标语义树;a
语义输入模块140,用于将所述目标语义树作为所述智能问答系统的输入内容进行智能问答操作。The
在本发明实施例中,用户终端可以是诸如移动电话、智能电话、笔记本电脑、数字广播接收器、PDA(个人数字助理)、PAD(平板电脑)、PMP(便携式多媒体播放器)、导航装置等等的移动终端以及诸如数字TV、台式计算机等等的固定终端,应当理解,此处对用户终端的举例仅为方便理解,不用于限定本发明。In the embodiment of the present invention, the user terminal may be such as a mobile phone, a smart phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a navigation device, etc. such as mobile terminals and fixed terminals such as digital TVs, desktop computers, etc., it should be understood that the examples of user terminals here are only for convenience of understanding, and are not intended to limit the present invention.
在本发明实施例中,智能问答系统主要用于精确的定位网站用户所需要的提问知识,通过与网站用户进行交互,为网站用户提供个性化的信息服务。In the embodiment of the present invention, the intelligent question answering system is mainly used to accurately locate the questioning knowledge required by website users, and provide personalized information services for website users by interacting with website users.
在本发明实施例中,查询请求指的是用户通过该用户终端向系统发送的包含用户需要提问的内容的数据流信息,该查询请求可以是文本输入的文本数据,也可以是语音输入的音频数据。当该查询请求为音频数据的时候,需要对该音频数据进行语音识别操作,转换成系统可进行语义分析的文本数据,应当理解,此处对查询请求的举例仅为方便理解,不用于限定本发明。In this embodiment of the present invention, the query request refers to the data stream information that the user sends to the system through the user terminal and contains the content that the user needs to ask. The query request may be text data input by text, or audio input by voice. data. When the query request is audio data, it is necessary to perform speech recognition on the audio data and convert it into text data that the system can perform semantic analysis. invention.
在本发明实施例中,查询文本信息指的是用户输入的文本数据,或者是用户输入的音频数据转换成的文本数据,该查询文本信息为用户最原始的语义内容。In this embodiment of the present invention, the query text information refers to text data input by the user, or text data converted from audio data input by the user, and the query text information is the most original semantic content of the user.
在本发明实施例中,本地实体库主要用于预先存储实体内容的知识库。In this embodiment of the present invention, the local entity library is mainly used to pre-store a knowledge base of entity content.
在本发明实施例中,预设逻辑规则主要用于精确表达自然语言信息,并便于机器进行识别,该预设逻辑规则可根据实际需要进行对应设计。In the embodiment of the present invention, the preset logic rules are mainly used to accurately express natural language information and facilitate machine identification, and the preset logic rules can be correspondingly designed according to actual needs.
在本发明实施例中,翻译操作指的是识别上述查询文本信息后,通过实体连接的方式,将查询文本信息与上述知识库中的实体内容进行对照,获取实体内容一致的文本,并通过基于语义表示的逻辑规则符号集对该文本进行翻译,从而获得上述逻辑文本信息。In the embodiment of the present invention, the translation operation refers to, after identifying the above query text information, by means of entity connection, comparing the query text information with the entity content in the above knowledge base, obtaining the text with the same entity content, The semantically represented logical rule symbol set translates the text, so as to obtain the above-mentioned logical text information.
在本发明实施例中,将问句中出现的最大的排序实体作为该问句的主题实体词,将用户最终询问的实体作为查询图链路的结尾。通过遍历问句中出现的实体、关系、属性,得到从主题实体词到结尾实体词的核心推理链路。针对每一条核心推导链路,将其转化为树结构进行存储,通过比较该树结构与已知意图的相似性,得到与该问句最相似的核心推导链路。最终将该核心推导链路的链接信息解析为查询参数和查询流程。In the embodiment of the present invention, the largest ranking entity that appears in the question is taken as the subject entity word of the question, and the entity finally queried by the user is taken as the end of the query graph link. By traversing the entities, relations and attributes in the question, the core reasoning link from the subject entity word to the ending entity word is obtained. For each core derivation link, it is converted into a tree structure for storage, and the core derivation link that is most similar to the question is obtained by comparing the similarity between the tree structure and the known intent. Finally, the link information of the core derivation link is parsed into query parameters and query process.
在本发明实施例中,语义树转换规则指的是逻辑规则以“<>”表达最小语义。我们首先将逻辑规则切分为一系列最小语义单元,然后将最小语义单元转换为语义树的节点(语义组合与拼装),根据语义单元之间的引用关系建立语义树,这种引用关系代表了查询的先后关系以及知识图谱实体之间的关联方式。In this embodiment of the present invention, the semantic tree conversion rule refers to a logical rule expressing minimal semantics with "<>". We first divide the logic rules into a series of minimum semantic units, and then convert the minimum semantic units into nodes of the semantic tree (semantic combination and assembly), and build the semantic tree according to the reference relationship between the semantic units. This reference relationship represents the The sequence of queries and the way of association between knowledge graph entities.
在实际应用中,叶子节点对应三元组的实体,非叶子节点对应三元组的实体间的关系或者实体的属性,答案节点位于根节点处。以XX公司的交易对手的敞口信息为例,XX公司和交易对手为实体,交易关系为实体间关系,敞口信息为属性,最后的答案节点询问的是属性值,如图2所示。In practical applications, leaf nodes correspond to entities of triples, non-leaf nodes correspond to relationships between entities of triples or attributes of entities, and answer nodes are located at the root node. Taking the exposure information of the counterparty of XX company as an example, XX company and the counterparty are entities, the transaction relationship is an inter-entity relationship, the exposure information is an attribute, and the final answer node asks for the attribute value, as shown in Figure 2.
通过将用户输入的查询文本翻译成逻辑文本,有效帮助我们将自然语言问句转化为机器可识别的表达,澄清了问句中模糊的表述,将问句以更规范、更清晰的规则展现,为后续基于自然语言的功能实现奠定了坚实的基础;并将所述逻辑文本转换成语义树,可以以严谨的逻辑顺序组织语义,逻辑规则与语义树的转换可以使人理解的语言信息转化为计算机可识别的数据结构,为后续执行查询操作提供基础,逻辑规则的校验为语义的检查以及修复提供基础,将语义树作为输入内容进行问答操作,可以结合用户输入的文本的上下文逻辑关系,识别到用户的真实情绪,能够向用户提供更加契合用户需求的回答内容。By translating the query text input by the user into logical text, it effectively helps us convert natural language questions into machine-recognizable expressions, clarifies the vague expressions in questions, and presents questions with more standardized and clearer rules. It lays a solid foundation for the subsequent realization of functions based on natural language; and converts the logical text into a semantic tree, which can organize semantics in a rigorous logical order, and the conversion of logical rules and semantic trees can make understandable language information into The computer-identifiable data structure provides the basis for subsequent query operations. The verification of logic rules provides the basis for semantic inspection and repair. The semantic tree is used as the input content for question-and-answer operations, which can be combined with the contextual logic relationship of the text input by the user. Recognizing the real emotions of users can provide users with answer content that is more in line with user needs.
作为实施例一的一些可选实现方式中,该预设逻辑规则具体包括Unary一元规则、Binary二元规则以及Aggregation聚合规则。As some optional implementation manners of the first embodiment, the preset logic rules specifically include Unary unary rules, Binary binary rules, and Aggregation aggregation rules.
在本发明实施例中,为精确表达自然语言信息,并以机器可识别的逻辑规则展现,设计了三种语义单元模板,分别是Unary一元规则、Binary二元规则以及Aggregation聚合规则,具体规则如下:In the embodiment of the present invention, in order to accurately express natural language information and display it with machine-recognizable logical rules, three semantic unit templates are designed, namely Unary unary rule, Binary binary rule and Aggregation aggregation rule. The specific rules are as follows :
(1)Unary一元规则(1) Unary unary rule
对于问句中的实体e,需要明确实体e表示的是一类实体还是一个实例Instance。若问句中仅出现了实体的类别,表示成<Unary(class=’E’)>;若问句中出现的是实体的实例值,则需找到其对应的实体类别,表示成<Unary(class=’E’,value=’Instance’)>。例如,定义‘机构’为一种实体类型。当问句中出现‘公司’时,表示成<Unary(class=’机构’)>,若问句中出现‘XXX公司’时,则表示成<Unary(class=’机构’,value=’XXX公司’)>。For the entity e in the question, it needs to be clear whether the entity e represents a class of entities or an instance Instance. If only the category of the entity appears in the question, it is expressed as <Unary(class='E')>; if the instance value of the entity appears in the question, the corresponding entity category needs to be found, expressed as <Unary( class='E', value='Instance')>. For example, define 'organization' as an entity type. When 'company' appears in the question, it is expressed as <Unary(class='organization')>, and if 'XXX company' appears in the question, it is expressed as <Unary(class='organization', value='XXX company')>.
(2)Binary二元规则(2) Binary binary rule
Binary主要用于描述三元组的关系,三元组可以理解为(头实体、关系、尾实体),(头实体、属性、属性值)或(关系,关系属性,关系属性值)。Binary规则是已知其中两个元素,求第三个元素,使用‘?’来标记要查询的元素。Binary is mainly used to describe the relationship of triples, and triples can be understood as (head entity, relationship, tail entity), (head entity, attribute, attribute value) or (relation, relationship attribute, relationship attribute value). The Binary rule is to know two of the elements, to find the third element, use '? ' to mark the element to query.
关系类问题,S和E表示的是实体,rel表示的是关系Relationship class problem, S and E represent entities, rel represents relationships
Binary(S,rel?,E)返回的是S和E之间的关系;Binary(S,rel?,E) returns the relationship between S and E;
Binary(S,rel,E?)返回的是S的rel是什么;Binary(S,rel,E?) returns what the rel of S is;
Binary(S?,rel,E)回答的是有哪些实体和E有rel关系;Binary(S?,rel,E) answers which entities have a rel relationship with E;
b)实体属性类问题,S表示实体,PRO表示属性,value表示属性值b) Entity attribute class problem, S means entity, PRO means attribute, value means attribute value
Binary(S,PRO,value?)返回的是S的属性PRO是多少;Binary(S, PRO, value?) returns the property PRO of S;
Binary(S?,PRO,value)求的是属性PRO是value的实体S;Binary(S?,PRO,value) seeks the entity S whose attribute PRO is value;
Binary(S,PRO?,value)求的是value是S的什么属性;Binary(S, PRO?, value) asks what property of S is value;
c)关系属性类问题,R表示关系,RPRO表示关系的属性,value表示属性值c) Relational attribute class problem, R represents the relationship, RPRO represents the attribute of the relationship, and value represents the value of the attribute
Binary(R,RPRO,value?)求的是关系的属性RPRO是多少;Binary(R,RPRO,value?) What is the attribute RPRO of the relationship;
(3)Aggregation聚合规则(3) Aggregation aggregation rules
此处引用了一系列聚合操作符,来表达问句中的运算逻辑和限定逻辑,主要有如下七种:A series of aggregation operators are quoted here to express the operational logic and qualification logic in the question, mainly including the following seven types:
Rank操作Rank operation
参数设置:by—排序的属性;obj—操作的对象;range—排序的返回范围Parameter settings: by—sorted property; obj—operated object; range—sorted return range
用途:排序,用于回答‘前N个’,‘第N个’等问题Purpose: Sorting, used to answer 'Top N', 'Nth' and other questions
Count操作Count operation
参数设置:obj—计数的对象;con—计数时过滤条件Parameter setting: obj—counted object; con—filter condition when counting
用途:统计,用于回答‘有多少个’类似问题Purpose: Statistics, used to answer 'how many' similar questions
Sum操作Sum operation
参数设置:obj—求和的对象;con—加总时过滤条件Parameter setting: obj—the object to be summed; con—the filter condition when adding up
用途:对数值类属性做加总计算Purpose: Summarize numeric attributes
Opr操作Opr operation
参数设置:‘=’--计算方法(+-*/and or);Parameter setting: '='--calculation method (+-*/and or);
S—数值1;E—数值2;con—计算时的过滤条件S—value 1; E—value 2; con—filter condition during calculation
用途:二元计算,用于回答各类计算问题Purpose: Binary computing, used to answer various computing problems
Filter操作Filter operation
参数设置:obj--过滤的对象;con—过滤条件Parameter settings: obj--filtered object; con-filter condition
用途:对于关系的属性进行筛选操作Purpose: to filter the properties of the relationship
Time操作Time operation
参数设置:con—时间限定范围Parameter setting: con—time limit range
用途:用于表示问句的时间跨度Purpose: used to express the time span of a question
Trend&Distribution操作Trend&Distribution operation
参数设置:无Parameter setting: none
用途:分布与变化趋势计算Purpose: Distribution and trend calculation
整个逻辑规则由多个语义单元组成,单个语义单元的语法规范如下:The entire logic rule consists of multiple semantic units, and the syntax specification of a single semantic unit is as follows:
<unit_code:semantic_unit><unit_code:semantic_unit>
逻辑规则构建应遵循了原问句的语序,语义单元的排列顺序应与原问句中该语义所在位置一致。The construction of logical rules should follow the word order of the original question, and the arrangement order of the semantic units should be consistent with the semantic location in the original question.
unit_code代表语义单元的编码,逻辑规则应有且只有一个主单元。主单元表示问句最终要返回的答案内容,用A表示,主单元一定是最后执行的。语义单元编码的原则是从A先向前再向后命名扩展,比如:V5 V4 V3 V2 V1 AV6 V7 V8。unit_code represents the encoding of the semantic unit, and the logic rule should have only one main unit. The main unit indicates the content of the answer to be returned in the final question sentence, which is represented by A. The main unit must be executed last. The principle of semantic unit coding is to name extensions from A to the front and then back, for example: V5 V4 V3 V2 V1 AV6 V7 V8.
semantic_unit即为上单元提到的三元组表示,不再复述。Semantic_unit is the triple representation mentioned in the previous unit, and will not be repeated.
继续参考图7,示出了图6中文本获取模块120的结构示意图为了便于说明,仅示出与本发明相关的部分。Continuing to refer to FIG. 7 , a schematic structural diagram of the
在本发明实施例二的一些可选的实现方式中,文本获取模块120包括:数据获取子模块121、主题确定子模块122、结尾确定子模块123、中间文本获取子模块124、最优意图子模块125以及文本生成子模块126。其中:In some optional implementations of Embodiment 2 of the present invention, the
数据获取子模块121,用于在所述本地实体库中获取与所述查询文本信息相对应的实体数据;A
主题确定子模块122,用于基于预设权重值确定与所述实体数据相对应的主题实体词;a
结尾确定子模块123,用于将所述查询文本信息的末端实体数据作为结尾实体词;The
中间文本获取子模块124,用于分别将所述主题实体词以及结尾实体词作为初始逻辑文本的首位实体词,获得中间逻辑文本;The intermediate
最优意图子模块125,用于在意图数据库中获取与所述中间逻辑文本相似度最高的最优意图;The
文本生成子模块126,用于基于所述最优意图生成所述逻辑文本信息。The text generation sub-module 126 is configured to generate the logical text information based on the optimal intention.
在本发明实施例中,可通过识别问句中出现内容,获得关键词,并与本地实体库存在的实体进行比较,最终获取关键词与实体相一致的数据,作为该实体数据。In the embodiment of the present invention, the keyword can be obtained by identifying the content in the question, and compared with the entity existing in the local entity database, and finally the data consistent with the keyword and the entity is obtained as the entity data.
在本发明实施例中,对主题确定子模块122中找出来的多个实体,选择一个作为主题实体词。通过本地实体中实体间的指向关系,预设每种实体的权重值。将权重大于0的实体作为主题实体词的候选集,按照顺序对每个候选主题词尝试后续操作。In this embodiment of the present invention, one of the multiple entities found in the
在本发明实施例中,将问句结束时要询问的实体作为结尾实体词。当结尾实体词为关系时,尝试进行修正。In this embodiment of the present invention, the entity to be inquired at the end of the question sentence is taken as the ending entity word. When the ending entity word is a relation, try to fix it.
在本发明实施例中,将主题确定子模块122中得到的主题实体词和结尾确定子模块123中得到的结尾实体词作为链路的首尾两端,在图谱中进行遍历。得到候选的子图集合。In the embodiment of the present invention, the subject entity words obtained in the
在本发明实施例中,将候选子图与意图库中已有的意图进行相似性判断。相似性通过实体、关系、位置等是否一致来判断。得到最相似的一个意图返回。In the embodiment of the present invention, the similarity judgment is performed between the candidate subgraph and the existing intent in the intent library. Similarity is judged by whether entities, relationships, locations, etc. are consistent. Get the most similar one intent to return.
在本发明实施例中,根据意图子图的图结构,生成逻辑形式。In this embodiment of the present invention, a logical form is generated according to the graph structure of the intent subgraph.
在实际应用中,将节点(实体类型)对应到uniary表示规则,class对应实体类型,value对应具体实例值,例如:平安人寿。若没有具体的实体值,uniary表示可以增加value的信息。边(关系、属性实体)对应到binary表示规则。Binary的第一个位置为该边对应的节点信息,第二个位置为边的表示信息,例如:属性实体出险率。第三个位置根据该边为关系还是属性实体分别填充对应的节点信息。例如:该问题中只有一个Binary表示,第二个位置为出险率,即属性实体。此时若存在出险率的属性值,例如出险率的值是否大于20%,大于20%为出险率的属性值。则第三个位置填充>20%,若不存在对应的属性值,则根据逻辑形式的定义,填充指代实体A。In practical applications, the node (entity type) corresponds to the uniary representation rule, the class corresponds to the entity type, and the value corresponds to the specific instance value, such as Ping An Life. If there is no specific entity value, uniform indicates information that can add value. Edges (relationships, attribute entities) correspond to binary representation rules. The first position of Binary is the node information corresponding to the edge, and the second position is the representation information of the edge, such as: attribute entity risk rate. The third position is filled with corresponding node information according to whether the edge is a relationship or an attribute entity. For example: There is only one Binary representation in this problem, and the second position is the risk rate, that is, the attribute entity. At this time, if there is an attribute value of the accident rate, for example, whether the value of the accident rate is greater than 20%, the attribute value of the accident rate is greater than 20%. Then the third position is filled with >20%. If there is no corresponding attribute value, the filling refers to entity A according to the definition of the logical form.
最后得到如下逻辑形式:Finally, the following logical form is obtained:
<V1:Uniary(class=专业公司,value=平安人寿)><V1:Uniary(class=professional company, value=Ping An Life)>
<A:Binary(V1,出险率,A?)><A:Binary(V1, risk rate, A?)>
继续参考图8,示出了图6中语义转换模块130的结构示意图,为了便于说明,仅示出与本发明相关的部分。Continuing to refer to FIG. 8 , a schematic structural diagram of the
在本发明实施例二的一些可选的实现方式中,上述语义转换模块130包括:语义切分子模块131、节点转换子模块132以及语义树构建子模块133。其中:In some optional implementations of Embodiment 2 of the present invention, the above-mentioned
语义切分子模块131,用于对所述逻辑文本信息进行语义切分操作,获得语义单元;The
节点转换子模块132,用于对所述语义单元进行节点转换操作,获得语义节点;A
语义树构建子模块133,用于基于所述语义节点构建语义树,获得所述目标语义树。The semantic
在实际应用中,程序会以<>为节点单元将如上述逻辑规则分拆成五个节点。每个节点建立一个树节点对象(每个树节点对象有如下属性:名字,类型,值,左子节点,右子节点,父节点等),例如以<V3:Binary(V2?,交易关系,V1)>节点为例,树节点对象的名字为V3,类型为Binary,值为(V2?,交易关系,V1),左子节点、右子节点、父节点初始化为空。后续描述中,我们以节点对象的名字表示节点名称,如<V1:Uniary(class='机构',value=’XX公司’)>描述为V1节点。In practical applications, the program will use <> as the node unit to split the above logic rules into five nodes. Each node creates a tree node object (each tree node object has the following attributes: name, type, value, left child node, right child node, parent node, etc.), for example, with <V3:Binary(V2?, transaction relationship, V1)> node as an example, the name of the tree node object is V3, the type is Binary, the value is (V2?, transaction relationship, V1), and the left child node, right child node, and parent node are initialized to empty. In the subsequent description, we use the name of the node object to represent the node name. For example, <V1:Uniary(class='organization', value='XX company')> is described as a V1 node.
根据五个树节点对象建立树,主要更新每个树节点的左子节点,右子节点,父节点,例如:Build a tree based on five tree node objects, mainly update the left child node, right child node, and parent node of each tree node, for example:
1)针对V3节点,更新如下数值:V3的左子节点为V2,右子节点为V1,V2的父节点为V3,V1的父节点为V3。1) For the V3 node, update the following values: the left child node of V3 is V2, the right child node is V1, the parent node of V2 is V3, and the parent node of V1 is V3.
2)针对V1节点,更新如下数值:V1的左子节点为空,右子节点为空。2) For the V1 node, update the following values: the left child node of V1 is empty, and the right child node is empty.
3)针对V4节点,更新如下数值:V4的左子节点为V3,右子节点为空,V3的父节点为V4。3) For the V4 node, update the following values: the left child node of V4 is V3, the right child node is empty, and the parent node of V3 is V4.
4)针对A节点,更新如下数值:A节点的左子节点为V4,右子节点为空,V4节点的父子节点为A。4) For node A, update the following values: the left child node of node A is V4, the right child node is empty, and the parent-child node of node V4 is A.
这样就建立树节点之间的引用关系,同时得到根节点为A节点,最终形成的语义树如上述图2所示。In this way, a reference relationship between tree nodes is established, and at the same time, the root node is obtained as node A, and the finally formed semantic tree is shown in Figure 2 above.
在本发明实施例二的一些可选的实现方式中,上述语义分析装置100还包括:类型获取子模块、实体判断子模块、语义输入子模块以及错误信号输出子模块。其中:In some optional implementations of Embodiment 2 of the present invention, the above
类型获取子模块,用于获取所述目标语义树的节点类型;a type acquisition submodule for acquiring the node type of the target semantic tree;
实体判断子模块,用于判断所述本地实体库中是否存在与所述节点类型相对应的实体三元组;an entity judging submodule for judging whether an entity triple corresponding to the node type exists in the local entity library;
语义输入子模块,用于若所述本地实体库中存在与所述节点类型相对应的实体三元组,则执行所述将所述目标语义树作为所述智能问答系统的输入内容进行智能问答操作的步骤;A semantic input sub-module, configured to execute the intelligent question answering using the target semantic tree as the input content of the intelligent question answering system if there is an entity triple corresponding to the node type in the local entity library the steps of the operation;
错误信号输出子模块,用于若所述本地实体库中不存在与所述节点类型相对应的实体三元组,则输出节点错误信号。The error signal output sub-module is configured to output a node error signal if the entity triple corresponding to the node type does not exist in the local entity library.
为解决上述技术问题,本申请实施例还提供计算机设备。具体请参阅图9,图9为本实施例计算机设备基本结构框图。To solve the above technical problems, the embodiments of the present application also provide computer equipment. Please refer to FIG. 9 for details. FIG. 9 is a block diagram of the basic structure of a computer device according to this embodiment.
所述计算机设备9包括通过系统总线相互通信连接存储器91、处理器92、网络接口93。需要指出的是,图中仅示出了具有组件91-93的计算机设备9,但是应理解的是,并不要求实施所有示出的组件,可以替代的实施更多或者更少的组件。其中,本技术领域技术人员可以理解,这里的计算机设备是一种能够按照事先设定或存储的指令,自动进行数值计算和/或信息处理的设备,其硬件包括但不限于微处理器、专用集成电路(ApplicationSpecific Integrated Circuit,ASIC)、可编程门阵列(Field-Programmable GateArray,FPGA)、数字处理器(Digital Signal Processor,DSP)、嵌入式设备等。The computer device 9 includes a
所述计算机设备可以是桌上型计算机、笔记本、掌上电脑及云端服务器等计算设备。所述计算机设备可以与用户通过键盘、鼠标、遥控器、触摸板或声控设备等方式进行人机交互。The computer equipment may be a desktop computer, a notebook computer, a palmtop computer, a cloud server and other computing equipment. The computer device can perform human-computer interaction with the user through a keyboard, a mouse, a remote control, a touch pad or a voice control device.
所述存储器91至少包括一种类型的可读存储介质,所述可读存储介质包括闪存、硬盘、多媒体卡、卡型存储器(例如,SD或DX存储器等)、随机访问存储器(RAM)、静态随机访问存储器(SRAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、可编程只读存储器(PROM)、磁性存储器、磁盘、光盘等。在一些实施例中,所述存储器91可以是所述计算机设备9的内部存储单元,例如该计算机设备9的硬盘或内存。在另一些实施例中,所述存储器91也可以是所述计算机设备9的外部存储设备,例如该计算机设备9上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(FlashCard)等。当然,所述存储器91还可以既包括所述计算机设备9的内部存储单元也包括其外部存储设备。本实施例中,所述存储器91通常用于存储安装于所述计算机设备9的操作系统和各类应用软件,例如X方法的程序代码等。此外,所述存储器91还可以用于暂时地存储已经输出或者将要输出的各类数据。The
所述处理器92在一些实施例中可以是中央处理器(Central Processing Unit,CPU)、控制器、微控制器、微处理器、或其他数据处理芯片。该处理器92通常用于控制所述计算机设备9的总体操作。本实施例中,所述处理器92用于运行所述存储器91中存储的程序代码或者处理数据,例如运行所述X方法的程序代码。In some embodiments, the
所述网络接口93可包括无线网络接口或有线网络接口,该网络接口93通常用于在所述计算机设备9与其他电子设备之间建立通信连接。The
本申请还提供了另一种实施方式,即提供一种计算机可读存储介质,所述计算机可读存储介质存储有X程序,所述X程序可被至少一个处理器执行,以使所述至少一个处理器执行如上述的X方法的步骤。The present application also provides another implementation manner, which is to provide a computer-readable storage medium, where an X program is stored in the computer-readable storage medium, and the X program can be executed by at least one processor, so that the at least one processor A processor executes the steps of method X as described above.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,空调器,或者网络设备等)执行本申请各个实施例所述的方法。From the description of the above embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus a necessary general hardware platform, and of course hardware can also be used, but in many cases the former is better implementation. Based on this understanding, the technical solution of the present application can be embodied in the form of a software product in essence or in a part that contributes to the prior art, and the computer software product is stored in a storage medium (such as ROM/RAM, magnetic disk, CD-ROM), including several instructions to make a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) execute the methods described in the various embodiments of this application.
显然,以上所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例,附图中给出了本申请的较佳实施例,但并不限制本申请的专利范围。本申请可以以许多不同的形式来实现,相反地,提供这些实施例的目的是使对本申请的公开内容的理解更加透彻全面。尽管参照前述实施例对本申请进行了详细的说明,对于本领域的技术人员来而言,其依然可以对前述各具体实施方式所记载的技术方案进行修改,或者对其中部分技术特征进行等效替换。凡是利用本申请说明书及附图内容所做的等效结构,直接或间接运用在其他相关的技术领域,均同理在本申请专利保护范围之内。Obviously, the above-described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. The accompanying drawings show the preferred embodiments of the present application, but do not limit the scope of the patent of the present application. This application may be embodied in many different forms, rather these embodiments are provided so that a thorough and complete understanding of the disclosure of this application is provided. Although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing specific embodiments, or perform equivalent replacements for some of the technical features. . Any equivalent structures made by using the contents of the description and drawings of the present application, which are directly or indirectly used in other related technical fields, are all within the scope of the patent protection of the present application.
Claims (10)
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010477643.0A CN111782781A (en) | 2020-05-29 | 2020-05-29 | A semantic analysis method, device, computer equipment and storage medium |
PCT/CN2020/098939 WO2021135103A1 (en) | 2020-05-29 | 2020-06-29 | Method and apparatus for semantic analysis, computer device, and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010477643.0A CN111782781A (en) | 2020-05-29 | 2020-05-29 | A semantic analysis method, device, computer equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN111782781A true CN111782781A (en) | 2020-10-16 |
Family
ID=72754431
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010477643.0A Pending CN111782781A (en) | 2020-05-29 | 2020-05-29 | A semantic analysis method, device, computer equipment and storage medium |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN111782781A (en) |
WO (1) | WO2021135103A1 (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113778981A (en) * | 2021-03-02 | 2021-12-10 | 北京沃东天骏信息技术有限公司 | Database operation method and device |
CN114490928A (en) * | 2021-12-31 | 2022-05-13 | 广州探迹科技有限公司 | Implementation method, system, computer equipment and storage medium of semantic search |
CN119025720A (en) * | 2024-10-28 | 2024-11-26 | 天津金城银行股份有限公司 | Information query method, system, computer device and readable storage medium |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104142917A (en) * | 2014-05-21 | 2014-11-12 | 北京师范大学 | A method and system for constructing a hierarchical semantic tree for language understanding |
CN104657439A (en) * | 2015-01-30 | 2015-05-27 | 欧阳江 | Generation system and method for structured query sentence used for precise retrieval of natural language |
CN108052547A (en) * | 2017-11-27 | 2018-05-18 | 华中科技大学 | Natural language question-answering method and system based on question sentence and knowledge graph structural analysis |
CN109670033A (en) * | 2019-02-01 | 2019-04-23 | 青岛海信电器股份有限公司 | Search method, device, equipment and the storage medium of content |
CN109684448A (en) * | 2018-12-17 | 2019-04-26 | 北京北大软件工程股份有限公司 | A kind of intelligent answer method |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN100489854C (en) * | 2006-08-01 | 2009-05-20 | 华为技术有限公司 | Search method and system of a natural language |
CN102214232A (en) * | 2011-06-28 | 2011-10-12 | 东软集团股份有限公司 | Method and device for calculating similarity of text data |
CN104750795B (en) * | 2015-03-12 | 2017-09-01 | 北京云知声信息技术有限公司 | A kind of intelligent semantic searching system and method |
CN105868249A (en) * | 2015-12-15 | 2016-08-17 | 乐视网信息技术(北京)股份有限公司 | Data query control method and device |
CN105701253B (en) * | 2016-03-04 | 2019-03-26 | 南京大学 | The knowledge base automatic question-answering method of Chinese natural language question semanteme |
CN107169092A (en) * | 2017-05-12 | 2017-09-15 | 暴风体育(北京)有限责任公司 | Intelligent Recognition and the method and system of sensitive content are handled in interaction |
-
2020
- 2020-05-29 CN CN202010477643.0A patent/CN111782781A/en active Pending
- 2020-06-29 WO PCT/CN2020/098939 patent/WO2021135103A1/en active Application Filing
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104142917A (en) * | 2014-05-21 | 2014-11-12 | 北京师范大学 | A method and system for constructing a hierarchical semantic tree for language understanding |
CN104657439A (en) * | 2015-01-30 | 2015-05-27 | 欧阳江 | Generation system and method for structured query sentence used for precise retrieval of natural language |
CN108052547A (en) * | 2017-11-27 | 2018-05-18 | 华中科技大学 | Natural language question-answering method and system based on question sentence and knowledge graph structural analysis |
CN109684448A (en) * | 2018-12-17 | 2019-04-26 | 北京北大软件工程股份有限公司 | A kind of intelligent answer method |
CN109670033A (en) * | 2019-02-01 | 2019-04-23 | 青岛海信电器股份有限公司 | Search method, device, equipment and the storage medium of content |
Non-Patent Citations (1)
Title |
---|
小菜鸡: "知识图谱问答总结", pages 1 - 13, Retrieved from the Internet <URL:https://octopuscoder.github.io/2018/02/04/知识图谱问答总结/> * |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113778981A (en) * | 2021-03-02 | 2021-12-10 | 北京沃东天骏信息技术有限公司 | Database operation method and device |
CN114490928A (en) * | 2021-12-31 | 2022-05-13 | 广州探迹科技有限公司 | Implementation method, system, computer equipment and storage medium of semantic search |
CN114490928B (en) * | 2021-12-31 | 2023-03-24 | 广州探迹科技有限公司 | Implementation method, system, computer equipment and storage medium of semantic search |
CN119025720A (en) * | 2024-10-28 | 2024-11-26 | 天津金城银行股份有限公司 | Information query method, system, computer device and readable storage medium |
Also Published As
Publication number | Publication date |
---|---|
WO2021135103A1 (en) | 2021-07-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20230142217A1 (en) | Model Training Method, Electronic Device, And Storage Medium | |
US11227118B2 (en) | Methods, devices, and systems for constructing intelligent knowledge base | |
CN107451153B (en) | Method and device for outputting structured query statement | |
CN110727779A (en) | Question-answering method and system based on multi-model fusion | |
US20220391426A1 (en) | Multi-system-based intelligent question answering method and apparatus, and device | |
WO2022142011A1 (en) | Method and device for address recognition, computer device, and storage medium | |
CN116737915B (en) | Semantic retrieval method, device, equipment and storage medium based on knowledge graph | |
KR20200019824A (en) | Entity relationship data generating method, apparatus, equipment and storage medium | |
CN110222194B (en) | Data chart generation method based on natural language processing and related device | |
CN111831911A (en) | Query information processing method and device, storage medium and electronic device | |
CN111782781A (en) | A semantic analysis method, device, computer equipment and storage medium | |
KR102560521B1 (en) | Method and apparatus for generating knowledge graph | |
CN115827819A (en) | Intelligent question and answer processing method and device, electronic equipment and storage medium | |
CN113779062A (en) | SQL statement generation method and device, storage medium and electronic equipment | |
CN117932022A (en) | Intelligent question-answering method and device, electronic equipment and storage medium | |
CN113407677A (en) | Method, apparatus, device and storage medium for evaluating quality of consultation session | |
CN114372157A (en) | Insurance semantic understanding method, device, equipment and medium based on knowledge graph | |
CN118673038A (en) | Index acquisition method, apparatus, electronic device and computer readable storage medium | |
CN118733735A (en) | Question rewriting method, question and answer processing method and corresponding device | |
CN118364117A (en) | Government affair question-answering method based on knowledge graph and related equipment | |
CN112069267B (en) | A data processing method and device | |
CN118796858A (en) | Database statement generation method, electronic device, storage medium and computer product | |
CN114428788B (en) | Natural language processing method, device, equipment and storage medium | |
CN114118049B (en) | Information acquisition method, device, electronic equipment and storage medium | |
CN117112727A (en) | Large language model fine tuning instruction set construction method suitable for cloud computing service |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
REG | Reference to a national code |
Ref country code: HK Ref legal event code: DE Ref document number: 40031284 Country of ref document: HK |
|
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |