WO2020057023A1 - Natural-language semantic parsing method, apparatus, computer device, and storage medium - Google Patents

Natural-language semantic parsing method, apparatus, computer device, and storage medium Download PDF

Info

Publication number
WO2020057023A1
WO2020057023A1 PCT/CN2019/071251 CN2019071251W WO2020057023A1 WO 2020057023 A1 WO2020057023 A1 WO 2020057023A1 CN 2019071251 W CN2019071251 W CN 2019071251W WO 2020057023 A1 WO2020057023 A1 WO 2020057023A1
Authority
WO
WIPO (PCT)
Prior art keywords
semantic
natural language
language information
semantic parsing
initial
Prior art date
Application number
PCT/CN2019/071251
Other languages
French (fr)
Chinese (zh)
Inventor
江琳
杨镭
Original Assignee
深圳壹账通智能科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳壹账通智能科技有限公司 filed Critical 深圳壹账通智能科技有限公司
Publication of WO2020057023A1 publication Critical patent/WO2020057023A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/30Semantic analysis

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

Provided is a data resource-based method for semantic parsing of natural language, comprising: receiving a request for semantic parsing of natural language information sent by a terminal, and obtaining a semantic context corresponding to the natural language information. In the corresponding semantic context, using a preset semantic parsing method to parse the natural language information to obtain an initial semantic parsing result, and, according to a correlation between a preset keyword and a filter value, obtaining a filter value corresponding to the natural language information. The filter value is used to filter the initial semantic parsing result to obtain a semantic parsing result matching the filter value, and the semantic parsing result is sent to the terminal.

Description

自然语言的语义解析方法、装置、计算机设备和存储介质Method, device, computer equipment and storage medium for semantic analysis of natural language
相关申请的交叉引用Cross-reference to related applications
本申请要求于2018年9月18日提交中国专利局,申请号为2018110895444,申请名称为“自然语言的语义解析方法、装置、计算机设备和存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of a Chinese patent application filed on September 18, 2018 with the Chinese Patent Office under the application number 2018110895444. The application name is "Semantic Parsing Method, Apparatus, Computer Equipment, and Storage Medium for Natural Language." Incorporated by reference in this application.
技术领域Technical field
本申请涉及一种自然语言的语义解析方法、装置、计算机设备和存储介质。The present application relates to a method, an apparatus, a computer device, and a storage medium for semantic analysis of natural language.
背景技术Background technique
随着计算机科学技术的快速发展,出现了通过利用自然语言处理,以实现人与计算机之间进行有效通信的方式。实现人机间自然语言通信,需要使得计算机既能理解自然语言文本的意义,还能以自然语言表达给定的意图和思想。但由于自然语言文本在不同的场景或不同的语境下,存在各式的歧义性和多义性,将自然语言存储至计算机系统内之前,还需对其进行整理和分析,根据相应的场景和语境消除其所具有的歧义,并转化成符合计算机内部存储要求的格式。With the rapid development of computer science and technology, there have been ways to achieve effective communication between people and computers by using natural language processing. To achieve natural language communication between humans and computers, it is necessary for computers to understand the meaning of natural language texts and to express given intentions and ideas in natural language. However, because natural language texts have various ambiguities and ambiguities in different scenarios or different contexts, before storing natural language in a computer system, it needs to be organized and analyzed, according to the corresponding scene And context to disambiguate it and transform it into a format that meets the computer's internal storage requirements.
传统的自然语言的语义分析,通过接收用户输入的自然语言信息,并根据所接收的自然语言信息确定语义场景类型,在所确定的语义场景类型下,利用预设的语义解析方式对自然语言进行语义解析,获得解析结果。Traditional natural language semantic analysis, by receiving the natural language information input by the user, and determining the type of the semantic scene according to the received natural language information, under the determined type of the semantic scene, the natural language is performed using a preset semantic analysis method Semantic parsing to obtain parsing results.
然而,发明人意识到,由于自然语言本身存在的歧义,当语义场景类型的确定出现失误时,容易得到完全错误的语义解析结果,降低了用户理解的偏差,需要反复进行操作,导致浪费大量资源。However, the inventors realized that due to the ambiguity of natural language itself, when there is a mistake in the determination of the type of the semantic scene, it is easy to get a completely wrong semantic parsing result, reducing the bias of user understanding, requiring repeated operations, resulting in a waste of a large amount of resources .
发明内容Summary of the Invention
根据本申请公开的各种实施例,提供一种自然语言的语义解析方法、装置、计算机设备和存储介质。According to various embodiments disclosed in the present application, a method, an apparatus, a computer device, and a storage medium for a semantic analysis of a natural language are provided.
一种自然语言的语义解析方法包括:A natural language semantic analysis method includes:
接收终端发送的对自然语言信息的语义解析请求;Receiving a semantic parsing request for natural language information sent by a terminal;
获取所述自然语言信息对应的语义场景;Acquiring a semantic scene corresponding to the natural language information;
在所述对应的语义场景下,利用预设的语义解析方式对所述自然语言信息进行解析,获得初始语义解析结果;Parsing the natural language information by using a preset semantic parsing method under the corresponding semantic scenario to obtain an initial semantic parsing result;
根据预设的关键字和筛选值之间的对应关系,获取与所述自然语言信息对应的筛选值;及Obtaining a filtering value corresponding to the natural language information according to a preset correspondence between keywords and filtering values; and
利用所述筛选值对所述初始语义解析结果进行筛选,得到符合所述筛选值的语义解析结果,并将所述语义解析结果发送至终端。The initial semantic parsing result is filtered using the screening value to obtain a semantic parsing result that matches the filtered value, and the semantic parsing result is sent to a terminal.
一种自然语言的语义解析装置包括:A semantic analysis device for natural language includes:
接收终端发送的对自然语言信息的语义解析请求;Receiving a semantic parsing request for natural language information sent by a terminal;
获取所述自然语言信息对应的语义场景;Acquiring a semantic scene corresponding to the natural language information;
在所述对应的语义场景下,利用预设的语义解析方式对所述自然语言信息进行解析,获得初始语义解析结果;Parsing the natural language information by using a preset semantic parsing method under the corresponding semantic scenario to obtain an initial semantic parsing result;
根据预设的关键字和筛选值之间的对应关系,获取与所述自然语言信息对应的筛选值;及Obtaining a filtering value corresponding to the natural language information according to a preset correspondence between keywords and filtering values; and
利用所述筛选值对所述初始语义解析结果进行筛选,得到符合所述筛选值的语义解析结果,并将所述语义解析结果发送至终端。The initial semantic parsing result is filtered using the screening value to obtain a semantic parsing result that matches the filtered value, and the semantic parsing result is sent to a terminal.
一种计算机设备,包括存储器和一个或多个处理器,所述存储器中储存有计算机可读指令,所述计算机可读指令被所述处理器执行时,使得所述一个或多个处理器执行以下步骤:A computer device includes a memory and one or more processors. The memory stores computer-readable instructions. When the computer-readable instructions are executed by the processor, the one or more processors are executed. The following steps:
接收终端发送的对自然语言信息的语义解析请求;Receiving a semantic parsing request for natural language information sent by a terminal;
获取所述自然语言信息对应的语义场景;Acquiring a semantic scene corresponding to the natural language information;
在所述对应的语义场景下,利用预设的语义解析方式对所述自然语言信息进行解析,获得初始语义解析结果;Parsing the natural language information by using a preset semantic parsing method under the corresponding semantic scenario to obtain an initial semantic parsing result;
根据预设的关键字和筛选值之间的对应关系,获取与所述自然语言信息对应的筛选值;及Obtaining a filtering value corresponding to the natural language information according to a preset correspondence between keywords and filtering values; and
利用所述筛选值对所述初始语义解析结果进行筛选,得到符合所述筛选值的语义解析结果,并将所述语义解析结果发送至终端。The initial semantic parsing result is filtered using the screening value to obtain a semantic parsing result that matches the filtered value, and the semantic parsing result is sent to a terminal.
一个或多个存储有计算机可读指令的非易失性计算机可读存储介质,计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器执行以下步骤:One or more non-volatile computer-readable storage media storing computer-readable instructions. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the following steps:
接收终端发送的对自然语言信息的语义解析请求;Receiving a semantic parsing request for natural language information sent by a terminal;
获取所述自然语言信息对应的语义场景;Acquiring a semantic scene corresponding to the natural language information;
在所述对应的语义场景下,利用预设的语义解析方式对所述自然语言信息进行解析,获得初始语义解析结果;Parsing the natural language information by using a preset semantic parsing method under the corresponding semantic scenario to obtain an initial semantic parsing result;
根据预设的关键字和筛选值之间的对应关系,获取与所述自然语言信息对应的筛选值;及Obtaining a filtering value corresponding to the natural language information according to a preset correspondence between keywords and filtering values; and
利用所述筛选值对所述初始语义解析结果进行筛选,得到符合所述筛选值的语义解析结果,并将所述语义解析结果发送至终端。The initial semantic parsing result is filtered using the screening value to obtain a semantic parsing result that matches the filtered value, and the semantic parsing result is sent to a terminal.
本申请的一个或多个实施例的细节在下面的附图和描述中提出。本申请的其它特征和优点将从说明书、附图以及权利要求书变得明显。Details of one or more embodiments of the present application are set forth in the accompanying drawings and description below. Other features and advantages of the application will become apparent from the description, the drawings, and the claims.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其它的附图。In order to explain the technical solutions in the embodiments of the present application more clearly, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application. Those of ordinary skill in the art can obtain other drawings according to the drawings without paying creative labor.
图1为根据一个或多个实施例中自然语言的语义解析方法的应用场景图。FIG. 1 is an application scenario diagram of a semantic parsing method of natural language according to one or more embodiments.
图2为根据一个或多个实施例中自然语言的语义解析方法的流程示意图。FIG. 2 is a schematic flowchart of a semantic parsing method of natural language according to one or more embodiments.
图3为根据一个或多个实施例中获取自然语言信息的语义场景的流程示意图。FIG. 3 is a schematic flowchart of a semantic scenario for acquiring natural language information according to one or more embodiments.
图4为根据一个或多个实施例中自然语言的语义解析装置的框图。FIG. 4 is a block diagram of a semantic parsing apparatus for natural language according to one or more embodiments.
图5为根据一个或多个实施例中计算机设备的框图。FIG. 5 is a block diagram of a computer device according to one or more embodiments.
具体实施方式detailed description
为了使本申请的技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。In order to make the technical solution and advantages of the present application more clear and clear, the present application is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the application, and are not used to limit the application.
本申请提供的自然语言的语义解析方法,可以应用于如图1所示的应用环境中。终端102与服务器104通过网络进行通信。服务器104接收终端102发送的对自然语言信息的语义解析请求,并获取自然语言信息对应的语义场景。在对应的语义场景下,服务器104利用预设的语义解析方式对自然语言信息进行解析,获得初始语义解析结果。根据预设的关键字和筛选值之间的对应关系,获取与自然语言信息对应的筛选值,并利用筛选值对初始语义解析结果进行筛选,得到符合筛选值的语义解析结果,将语义解析结果发送至终端102。终端102可以但不限于是各种个人计算机、笔记本电脑、智能手机和平板电脑,服务器104可以用独立的服务器或者是多个服务器组成的服务器集群来实现。The semantic parsing method provided by the present application can be applied to the application environment shown in FIG. 1. The terminal 102 and the server 104 communicate through a network. The server 104 receives a semantic analysis request for natural language information sent by the terminal 102, and acquires a semantic scene corresponding to the natural language information. In the corresponding semantic scenario, the server 104 parses natural language information by using a preset semantic parsing method to obtain an initial semantic parsing result. According to the preset correspondence between keywords and filtered values, obtain filtered values corresponding to natural language information, and use the filtered values to filter the initial semantic parsing results to obtain semantic parsing results that match the filtered values. Send to terminal 102. The terminal 102 may be, but is not limited to, various personal computers, notebook computers, smart phones, and tablet computers. The server 104 may be implemented by an independent server or a server cluster composed of multiple servers.
在其中一个实施例中,如图2所示,提供了一种自然语言的语义解析方法,以该方法应用于图1中的服务器为例进行说明,包括以下步骤:In one embodiment, as shown in FIG. 2, a method for semantic parsing of natural language is provided. The method is applied to the server in FIG. 1 as an example, and includes the following steps:
S202,服务器接收终端发送的对自然语言信息的语义解析请求。S202. The server receives a semantic parsing request for natural language information sent by the terminal.
相对于计算机应用的人工语言,比如程序设计语言、机器语言、受控检索语言等而言,自然语言表示人们日常使用的口头语言以及书面语言。语义解析请求表示对于用户输入的自然语言信息进行语义解析的请求,服务器获取到用户在终端输入的自然语言信息,并根据终端发送的语义解析请求,对对应的自然语言信息进行语义解析。Relative to the artificial languages of computer applications, such as programming languages, machine languages, controlled retrieval languages, etc., natural languages represent spoken and written languages that people use every day. The semantic parsing request means a request for semantic parsing of the natural language information input by the user. The server obtains the natural language information input by the user at the terminal, and performs semantic parsing of the corresponding natural language information according to the semantic parsing request sent by the terminal.
具体地,服务器接收用户在终端输入的自然语言信息,并接收终端发送的对自然语言信息的语义解析请求,根据语义解析请求对接收到的自然语言信息进行语义解析。但由于自然语言信息在不同的场景或不同的语境下,存在各式的歧义性和多义性,对自然语言信息进行语义解析之前,还需对其进行整理和分析,根据相应的场景和语境消除其所具有的歧义,并转化成符合计算机内部存储要求的格式,在计算机内部对符合预设要求的自然语言信息进行语义解析。Specifically, the server receives the natural language information input by the user at the terminal, and receives a semantic analysis request for the natural language information sent by the terminal, and performs semantic analysis on the received natural language information according to the semantic analysis request. However, natural language information has various ambiguities and ambiguities in different scenarios or different contexts. Before semantic analysis of natural language information, it needs to be sorted and analyzed. According to the corresponding scene and Context eliminates its ambiguity, and transforms it into a format that meets the internal storage requirements of the computer, and performs semantic analysis on the natural language information that meets the preset requirements in the computer.
进一步地,以用户输入的自然语言信息为“深圳大学生的贷款分布”为例。用户在终端输入“深圳大学生的贷款分布”,终端向服务器发送对“深圳大学生的贷款分布”进行语义解析的语义解析请求,服务器接收语义解析请求,并根据语义解析请求对“深圳大学生的贷款分布”进行语义解析。而针对不同的场景或语境,自然语言信息“深圳大学生的贷款分布”可表示的语义包括:“深圳贷款大学生的教育机构分布”、“深圳大学生贷款与否的情况”、“深圳大学生的贷款数额分布”以及“深圳大学生贷款种类分布”等多种情况。针对多种可能的情况,在一定的语境和应用场景下,对自然语言信息进行分析和整理,获得不同语境或应用场景下,对应的自然语言信息表示的语义。Further, the natural language information input by the user is "the loan distribution of Shenzhen university students" as an example. The user enters "Shenzhen University Student Loan Distribution" in the terminal, and the terminal sends to the server a semantic analysis request for semantic analysis of the "Shenzhen University Student Loan Distribution". The server receives the semantic analysis request, and according to the semantic analysis request, the "Shenzhen University Student Loan Distribution" "For semantic parsing. According to different scenarios or contexts, the semantics of the natural language information “Shenzhen University Student Loan Distribution” can include: “Shenzhen University Student Loan Education Institution Distribution”, “Shenzhen University Student Loan Situation”, “Shenzhen University Student Loan” Amount distribution "and" Shenzhen university student loan types distribution "and other situations. For a variety of possible situations, the natural language information is analyzed and arranged in a certain context and application scenario, and the semantics of the corresponding natural language information representation in different contexts or application scenarios are obtained.
S204,服务器获取自然语言信息对应的语义场景。S204. The server obtains a semantic scene corresponding to the natural language information.
具体地,服务器分别计算自然语言信息和不同语义场景之间的关联度值,根据关联度值的大小对语义场景进行排序,并获取最大关联度值对应的语义场景。Specifically, the server separately calculates the relevance value between the natural language information and different semantic scenes, sorts the semantic scenes according to the magnitude of the relevance value, and obtains the semantic scene corresponding to the maximum relevance value.
关联度值用于判断用户输入的自然语言信息与多个语义场景之间的关联程度。服务器通过计算用户输入的自然语言信息和不同语义场景之间的关联度值,获得自然语言信息和语义场景之间的关联程度。进而将计算得到的关联度值按照从大至小的方式进行排序,获取最大的关联度值对应的语义场景,作为与用户输入的自然语言信息最相关的语义场景,即关联程度最高的语义场景。The relevance value is used to judge the relevance between the natural language information input by the user and multiple semantic scenes. The server obtains the degree of association between the natural language information and the semantic scene by calculating the correlation value between the natural language information input by the user and the different semantic scenes. The calculated relevance values are sorted in ascending order, and the semantic scene corresponding to the largest relevance value is obtained as the semantic scene most relevant to the natural language information input by the user, that is, the semantic scene with the highest degree of relevance. .
进一步地,以用户输入的自然语言信息为“深圳小额借款人区域分布”,可选的语义场景包括:小额借贷、贷款以及大额借贷等,分别计算“深圳小额借款人区域分布”,与小额借贷、贷款以及大额借贷之间的关联度值,并将语义场景按照关联度值的大小进行排序,获得的最大关联度值对应的语义场景为小额借贷。Further, taking the natural language information entered by the user as "Shenzhen small borrower regional distribution", optional semantic scenarios include: small loans, loans, and large loans, etc., respectively, to calculate "Shenzhen small borrower regional distribution" , The degree of relevance to small loans, loans, and large loans, and the semantic scenes are sorted according to the value of the relevance degree, and the semantic scene corresponding to the obtained maximum relevance value is a small loan.
S206,服务器在对应的语义场景下,利用预设的语义解析方式对自然语言信息进行解析,获得初始语义解析结果。S206: The server parses the natural language information by using a preset semantic parsing method in a corresponding semantic scene to obtain an initial semantic parsing result.
不同的语义场景对应不同的语义解析方式,服务器可获取预先设置的语义场景和语义解析方式之间的对应关系,并根据所获取的预先设置的语义场景和语义解析方式之间的对应关系,获取与语义场景对应的语义解析方式。服务器在对应的语义场景下,利用与语义场景对应的语义解析方式,对用户输入的自然语言信息进行语义解析。Different semantic scenarios correspond to different semantic parsing methods. The server can obtain the correspondence between the preset semantic scenes and semantic parsing methods, and obtain according to the obtained correspondence between the preset semantic scenes and semantic parsing methods. The semantic parsing method corresponding to the semantic scene. The server uses the semantic parsing method corresponding to the semantic scene to semantically parse the natural language information input by the user under the corresponding semantic scene.
具体地,服务器根据最大关联度值对应的语义场景和语义解析方式之间的对应关系,来获取与最大关联度值对应的语义场景对应的语义解析方式。根据语义解析方式对自然语言信息进行解析,获得原始语义解析结果。利用预设的检验规则对原始语义解析结果进行初始检验,获取符合预设的检验规则的原始语义解析结果,并根据符合预设的检验规则的原始语义解析结果,得到初始语义解析结果。Specifically, the server obtains the semantic parsing mode corresponding to the semantic scene corresponding to the maximum relevance value according to the correspondence between the semantic scene corresponding to the maximum relevance value and the semantic parsing mode. Parse natural language information according to the semantic parsing method to obtain the original semantic parsing result. Initial inspection is performed on the original semantic parsing result by using a preset inspection rule, and the original semantic parsing result that conforms to the preset inspection rule is obtained, and the initial semantic parsing result is obtained according to the original semantic parsing result that conforms to the preset inspection rule.
预设的检验规则用于对原始语义解析结果进行初始检验,包括对原始语义解析结果的完整性和有效性进行检验,判断原始语义解析结果是否完整及有效。若原始语义解析结果,包括对用户输入的自然语言信息的所有关键字的语义解析,表示该原始语义解析结果通过检验规则所进行的完整性检验。若原始语义解析结果对自然语言信息的关键字的语义 解析,可有效表达自然语言信息的原始输入,表示该原始语义解析结果通过检验规则所进行的有效性检验。The preset inspection rules are used for initial inspection of the original semantic parsing results, including checking the integrity and validity of the original semantic parsing results, and determining whether the original semantic parsing results are complete and valid. If the original semantic parsing result includes the semantic parsing of all keywords of the natural language information input by the user, it means that the original semantic parsing result passes the integrity check performed by the inspection rule. If the original semantic parsing result parses the keywords of natural language information semantically, it can effectively express the original input of natural language information, indicating that the original semantic parsing result has passed the validity check by the inspection rules.
进一步地,以用户的自然语言信息对应的语义场景为借贷场景时为例。服务器获取用户输入的自然语言信息“深圳大学生小额借贷分布”,并根据用户输入的自然语言信息中的关键字所属的关键字类别,获取对应的语义场景为“小额借贷”,根据预设的语义场景和语义解析方式之间的对应关系,获取与语义场景为“小额借贷”对应的语义解析方式,对自然语言信息“深圳大学生小额借贷分布”进行语义解析,获得的初始语义解析结果可包括如下情形:“深圳大学生小额借贷的数额分布”、“深圳大学生小额借贷的区域分布”以及“深圳大学生是否进行小额借贷”等。Further, the case where the semantic scene corresponding to the user's natural language information is a borrowing scene is taken as an example. The server obtains the natural language information “Shenzhen university student micro-loan distribution” input by the user, and according to the keyword category to which the keywords in the natural language information entered by the user, obtains the corresponding semantic scene as “micro-loan”, according to the preset The corresponding relationship between the semantic scene and the semantic parsing method, to obtain the semantic parsing method corresponding to the semantic scene as "small loan", and perform a semantic parsing on the natural language information "Shenzhen university student small loan distribution" to obtain the initial semantic analysis The results can include the following situations: "Shenzhen university students' small loan amount distribution", "Shenzhen university students' small loan area distribution" and "Shenzhen university students' small loan".
S208,服务器根据预设的关键字和筛选值之间的对应关系,获取与自然语言信息对应的筛选值。S208. The server obtains a filtering value corresponding to the natural language information according to a preset correspondence between the keywords and the filtering value.
具体地,服务器通过获取与关键字对应的筛选机制,并根据预设的筛选机制和筛选值之间的对应关系,获取与自然语言信息对应的筛选值。Specifically, the server obtains a filtering value corresponding to the natural language information by acquiring a filtering mechanism corresponding to the keywords and according to a preset relationship between the preset filtering mechanism and the filtering value.
关键字和筛选机制之间存在对应关系,不同的关键字对应不同的筛选机制。筛选机制和筛选值之间存在预设的对应关系,可根据筛选机制和筛选值之间存在的对应关系,获取与筛选机制对应的筛选值。同时,由于不同的自然语言信息和关键字之间存在对应关系,可根据关键字和筛选机制之间的对应关系,以及筛选机制和筛选值之间的对应关系,获取与关键字对应的筛选值,进而,所获取得到的筛选值即为与自然语言信息对应的筛选值。There is a correspondence between keywords and filtering mechanisms, and different keywords correspond to different filtering mechanisms. There is a preset correspondence between the screening mechanism and the screening value. According to the mapping relationship between the screening mechanism and the screening value, a screening value corresponding to the screening mechanism can be obtained. At the same time, due to the correspondence between different natural language information and keywords, the filtering value corresponding to the keywords can be obtained according to the correspondence between the keywords and the filtering mechanism and the correspondence between the filtering mechanism and the filtering value. Furthermore, the obtained filtering value is a filtering value corresponding to natural language information.
进一步地,以服务器获取到用户输入的自然语言信息为“深圳大学生小额借贷分布”为例。服务器获取用户输入的自然语言信息,并提取自然语言信息中的关键字“小额借贷”,获取与关键字“小额借贷”对应的筛选机制“借贷筛选”,并根据筛选机制和筛选值之间的预设对应关系,获取与筛选机制“借贷筛选”对应的筛选值“数额”。Further, taking the natural language information input by the user obtained by the server as “Shenzhen university student small loan distribution” as an example. The server obtains the natural language information input by the user, and extracts the keyword "small loan" in the natural language information, obtains a filtering mechanism "loan screening" corresponding to the keyword "small loan", and according to the filtering mechanism and the filter value. The preset correspondence relationship between them is obtained by the screening value "amount" corresponding to the screening mechanism "debit screening".
S210,服务器利用筛选值对初始语义解析结果进行筛选,得到符合筛选值的语义解析结果,并将语义解析结果发送至终端。S210: The server uses the filtering value to filter the initial semantic parsing result, obtains a semantic parsing result that matches the filtering value, and sends the semantic parsing result to the terminal.
具体地,服务器获取与初始语义解析结果对应的初始解析数据,并利用与关键字对应的筛选值,对初始解析数据进行筛选操作,获取通过筛选操作的初始解析数据。服务器获取与通过筛选操作的初始解析数据,对应的初始语义解析结果,并根据通过筛选操作的初始解析数据对应的初始语义解析结果,得到语义解析结果,并将语义解析结果发送至终端。Specifically, the server obtains the initial parsing data corresponding to the initial semantic parsing result, and uses the filtering value corresponding to the keyword to perform a filtering operation on the initial parsing data to obtain the initial parsing data through the filtering operation. The server obtains the initial semantic parsing result corresponding to the initial parsing data that passed the filtering operation, obtains the semantic parsing result according to the initial semantic parsing result corresponding to the initial parsing data that passes the filtering operation, and sends the semantic parsing result to the terminal.
筛选值用于对于初始语义解析结果对应的初始解析数据进行筛选,不同自然语言信息对应不同的筛选值,通过利用筛选值可筛选得到与自然语言信息符合的语义解析结果。初始语义解析结果对应的初始解析数据,包括对自然语言信息进行解析的初始数据。The filtering value is used to filter the initial parsing data corresponding to the initial semantic parsing result. Different natural language information corresponds to different filtering values. The filtering value can be used to obtain the semantic parsing result consistent with the natural language information. The initial parsing data corresponding to the initial semantic parsing result includes the initial data for parsing natural language information.
进一步地,以服务器获取用户输入的自然语言信息为“深圳大学生小额借贷分布”为例。服务器根据针对小额借贷语义场景下的语义解析方式,对自然语言信息“深圳大学生小额借贷分布”进行语义解析,获得的初始语义解析结果可包括如下情形:“深圳大学 生小额借贷的数额分布”、“深圳大学生小额借贷的区域分布”以及“深圳大学生是否进行小额借贷”等。Further, taking the natural language information input by the user as the “Shenzhen university student small loan distribution” as an example. The server performs a semantic analysis on the natural language information “Shenzhen University Students’ Small Loan Distribution ”according to the semantic analysis method in the context of small loans. The initial semantic analysis results obtained include the following situations:“ Shenzhen University Students ’Small Loan Amount Distribution "," Regional distribution of Shenzhen university students 'small loans "and" Shenzhen university students' small loans ".
服务器利用获取的筛选值,对多个可能的初始语义解析结果进行筛选,获取符合筛选值的初始语义结果。在本实施例中,可获得的与自然语言信息对应的筛选值为“数额”,即针对自然语言信息“深圳大学生小额借贷分布”,利用筛选值“数额”对多个可能的初始语义解析结果进行筛选,获得的符合筛选值“数额”的初始语义解析结果即为“深圳大学生小额借贷的数额分布”。The server uses the obtained filtering value to filter a plurality of possible initial semantic parsing results, and obtains the initial semantic results that match the filtering value. In this embodiment, the available filtering value corresponding to the natural language information is “amount”, that is, for the natural language information “Shenzhen University Student Small Loan Distribution”, using the filtering value “amount” to analyze a plurality of possible initial semantics The results were screened, and the initial semantic parsing result that matched the screened value "amount" was "the distribution of the amount of small loans of Shenzhen university students".
上述自然语言的语义解析方法中,服务器通过接收终端发送的对自然语言信息的语义解析请求,并取自然语言信息对应的语义场景。在对应的语义场景下,利用预设的语义解析方式对自然语言信息进行解析,获得初始语义解析结果。根据预设的关键字和筛选值之间的对应关系,获取与自然语言信息对应的筛选值,利用筛选值对初始语义解析结果进行筛选,得到符合筛选值的语义解析结果,并将语义解析结果发送至终端。从而可在将语义解析结果发送至终端之前,通过利用筛选值实现对语义解析结果的进一步筛选,提高了语义解析结果的准确率,避免反复进行语义解析,节约了资源,降低了消耗。In the above semantic language parsing method, the server receives a semantic parsing request for natural language information sent by the terminal, and takes a semantic scene corresponding to the natural language information. In the corresponding semantic scenario, natural language information is parsed by using a preset semantic parsing method to obtain an initial semantic parsing result. According to the preset correspondence between keywords and filtered values, obtain filtered values corresponding to natural language information, and use the filtered values to filter the initial semantic parsing results to obtain the semantic parsing results that match the filtered values. Send to terminal. Therefore, before the semantic parsing result is sent to the terminal, further screening of the semantic parsing result is realized by using the filtering value, which improves the accuracy of the semantic parsing result, avoids repeated semantic parsing, saves resources, and reduces consumption.
在其中一个实施例中,如图3所示提供了一种获取自然语言信息的语义场景的步骤,包括:In one embodiment, as shown in FIG. 3, a step for acquiring a semantic scene of natural language information is provided, including:
S302,服务器提取自然语言信息中的关键字,并获取不同关键字对应的关键字属性。S302. The server extracts keywords in the natural language information, and obtains keyword attributes corresponding to different keywords.
具体地,服务器可在接收到终端发送的语义解析请求后,获取用户在终端输入的自然语言信息,并提取自然语言信息中的关键字。由于自然语言信息中的关键字对应不同的关键字属性,服务器可通过获取关键字和关键字属性之间的对应关系,进而根据键字和关键字属性之间的对应关系,获取与关键字对应的关键字属性。Specifically, after receiving the semantic parsing request sent by the terminal, the server can obtain the natural language information input by the user on the terminal, and extract keywords in the natural language information. Since keywords in natural language information correspond to different keyword attributes, the server can obtain the correspondence between keywords and keyword attributes, and then obtain the correspondence with keywords according to the correspondence between keywords and keyword attributes. Keyword attributes.
S304,服务器获取预设的关键字类别,并获取关键字类别对应的类别属性。S304. The server obtains a preset keyword category, and obtains a category attribute corresponding to the keyword category.
S306,服务器根据预设的类别属性和关键字属性之间的对应关系,将自然语言信息中的关键字按照类别属性进行分类。S306. The server classifies keywords in the natural language information according to the category attribute according to a preset correspondence relationship between the category attribute and the keyword attribute.
具体地,服务器预先设置多个关键字类别,并分别为多个关键字类别设置对应的类别属性。由于关键字属性和关键字类别对应的类别属性之间,存在对应关系,可根据预设的类别属性和关键字属性之间的对应关系,获得各个关键字所属的关键字类别,并将各个关键字按照对应类别进行分类。Specifically, the server sets a plurality of keyword categories in advance, and respectively sets corresponding category attributes for the plurality of keyword categories. Because there is a correspondence relationship between the keyword attribute and the category attribute corresponding to the keyword category, the keyword category to which each keyword belongs can be obtained according to the preset correspondence relationship between the category attribute and the keyword attribute, and each key Words are classified according to the corresponding category.
S308,服务器根据预设的关键字类别和语义场景之间的对应关系,获取与不同关键字类别对应的语义场景。S308: The server obtains semantic scenes corresponding to different keyword categories according to a preset correspondence relationship between the keyword categories and semantic scenes.
具体地,不同的关键字类别对应不同的语义场景,服务器可根据预设的关键字类别和语义场景之间的对应关系,获取与自然语言信息中不同关键字所属的关键字类别对应的语义场景。Specifically, different keyword categories correspond to different semantic scenarios, and the server may obtain a semantic scenario corresponding to a keyword category to which different keywords belong in the natural language information according to a preset correspondence relationship between the keyword categories and the semantic scenarios. .
进一步地,以用户在终端输入的自然语言信息为“上海男性借款人学历分布如何”为例。服务器获取用户在终端输入的自然语言信息,并接收终端发送的对自然语言信息的 语义解析请求,根据自然语言信息“上海男性借款人学历分布如何”,获取其中的关键字“上海”、“男性借款人”以及“学历分布”,获取各个关键字所属关键字类别,“上海”表示地域的类别,用于对执行主体的地域限制,“男性借款人”属于行为主语的类别,用于限定执行自然语言信息中的操作的主体,“学历分布”表示对于所需要检索的问题的进一步限定。服务器将自然语言信息中的各个关键字按照关键字类别进行分类后,获取与关键字类别对应的语义场景。在本实施例中,针对用户输入的自然语言信息“上海男性借款人学历分布如何”,获得的与关键字类别对应的语义场景为借贷场景。Further, the natural language information input by the user at the terminal is "how is the education distribution of male borrowers in Shanghai" as an example. The server obtains the natural language information input by the user on the terminal, and receives a semantic parsing request for the natural language information sent by the terminal. According to the natural language information "how is the distribution of the education of male borrowers in Shanghai", the keywords "Shanghai", "male" "Borrowers" and "educational distribution" to obtain the keyword category to which each keyword belongs. "Shanghai" represents the geographical category and is used to restrict the geographical scope of the executing subject. "Male borrower" belongs to the category of behavior subject and is used to limit execution The subject of operations in natural language information, "educational distribution" represents a further definition of the question to be retrieved. After the server classifies each keyword in the natural language information according to the keyword category, it obtains a semantic scene corresponding to the keyword category. In this embodiment, for the natural language information “how is the education of male borrowers in Shanghai distributed” input by the user, the semantic scene corresponding to the keyword category is the loan scene.
上述获取自然语言信息的语义场景的步骤中,服务器通过提取自然语言信息中的关键字,并获取不同关键字对应的关键字属性。获取预设的关键字类别,并获取关键字类别对应的类别属性。进而根据预设的类别属性和关键字属性之间的对应关系,将自然语言信息中的关键字按照类别属性进行分类,根据预设的关键字类别和语义场景之间的对应关系,获取与不同关键字类别对应的语义场景。可通过获取到与自然语言信息中关键字对应的语义场景,实现对应语义场景下的针对性的语义解析,进一步提高了语义解析的准确性。In the above step of acquiring a semantic scene of natural language information, the server extracts keywords in the natural language information and obtains keyword attributes corresponding to different keywords. Obtain a preset keyword category, and obtain category attributes corresponding to the keyword category. Furthermore, according to the preset correspondence between the category attribute and the keyword attribute, the keywords in the natural language information are classified according to the category attribute, and according to the preset correspondence between the keyword category and the semantic scene, the difference is obtained. Semantic scenes corresponding to keyword categories. By obtaining the semantic scene corresponding to the keywords in the natural language information, the targeted semantic parsing in the corresponding semantic scene can be achieved, which further improves the accuracy of the semantic parsing.
在其中一个实施例中,提供了一种获取自然语言信息对应的语义场景的步骤,包括:In one embodiment, a step of obtaining a semantic scene corresponding to natural language information is provided, including:
服务器分别计算自然语言信息和不同语义场景之间的关联度值;根据关联度值的大小对语义场景进行排序,并获取最大关联度值对应的语义场景。The server calculates the relevance value between the natural language information and different semantic scenes respectively; sorts the semantic scenes according to the magnitude of the relevance value, and obtains the semantic scene corresponding to the maximum relevance value.
关联度值用于判断用户输入的自然语言信息与多个语义场景之间的关联程度。服务器通过计算用户输入的自然语言信息和不同语义场景之间的关联度值,获得自然语言信息和语义场景之间的关联程度。进而将计算得到的关联度值按照从大至小的方式进行排序,获取最大的关联度值对应的语义场景,作为与用户输入的自然语言信息最相关的语义场景,即关联程度最高的语义场景。The relevance value is used to judge the relevance between the natural language information input by the user and multiple semantic scenes. The server obtains the degree of association between the natural language information and the semantic scene by calculating the correlation value between the natural language information input by the user and the different semantic scenes. The calculated relevance values are sorted in ascending order, and the semantic scene corresponding to the largest relevance value is obtained as the semantic scene most relevant to the natural language information input by the user, that is, the semantic scene with the highest degree of relevance. .
进一步地,以用户输入的自然语言信息为“深圳小额借款人区域分布”,可选的语义场景包括:小额借贷、贷款以及大额借贷等,分别计算“深圳小额借款人区域分布”,与小额借贷、贷款以及大额借贷之间的关联度值,并将语义场景按照关联度值的大小进行排序,获得的最大关联度值对应的语义场景为小额借贷。Further, taking the natural language information entered by the user as "Shenzhen small borrower regional distribution", optional semantic scenarios include: small loans, loans, and large loans, etc., respectively, to calculate "Shenzhen small borrower regional distribution" , The degree of relevance to small loans, loans, and large loans, and the semantic scenes are sorted according to the value of the relevance degree, and the semantic scene corresponding to the obtained maximum relevance value is a small loan.
上述获取自然语言信息的语义场景的步骤,服务器通过分别计算自然语言信息和不同语义场景之间的关联度值,并根据关联度值的大小对语义场景进行排序,进而可获取最大关联度值对应的语义场景。由于获取到与自然语言信息关联程度最高的语义场景,可在进行语义解析之前,判断语义场景是否符合对应的自然语言信息的要求,进一步提高语义解析的准确性。In the above step of obtaining the semantic scene of natural language information, the server calculates the correlation degree values between the natural language information and different semantic scenes separately, and sorts the semantic scenes according to the magnitude of the correlation degree value, so as to obtain the maximum correlation value corresponding Semantic scene. Since the semantic scene with the highest degree of relevance to natural language information is obtained, it is possible to determine whether the semantic scene meets the requirements of the corresponding natural language information before performing semantic parsing, and further improve the accuracy of semantic parsing.
在其中一个实施例中,提供了一种在对应的语义场景下,利用预设的语义解析方式对自然语言信息进行解析,获得初始语义解析结果的步骤,包括:In one embodiment, a step of parsing natural language information to obtain an initial semantic parsing result by using a preset semantic parsing method in a corresponding semantic scene is provided, including:
服务器获取最大关联度值对应的语义场景和语义解析方式之间的对应关系,并获取与最大关联度值对应的语义场景对应的语义解析方式;根据语义解析方式对自然语言信息进行解析,获得原始语义解析结果;利用预设的检验规则对原始语义解析结果进行初始检 验,获取符合预设的检验规则的原始语义解析结果;根据符合预设的检验规则的原始语义解析结果,得到初始语义解析结果。The server obtains the correspondence between the semantic scene corresponding to the maximum relevance value and the semantic parsing mode, and obtains the semantic parsing mode corresponding to the semantic scene corresponding to the maximum relevance value; parses the natural language information according to the semantic parsing mode to obtain the original Semantic analysis results; use the preset inspection rules to perform initial inspection on the original semantic analysis results to obtain the original semantic analysis results that meet the preset inspection rules; and obtain the initial semantic analysis results based on the original semantic analysis results that meet the preset inspection rules .
具体地,预设的检验规则用于对原始语义解析结果进行初始检验,包括对原始语义解析结果的完整性和有效性进行检验,判断原始语义解析结果是否完整及有效。若原始语义解析结果,包括对用户输入的自然语言信息的所有关键字的语义解析,表示该原始语义解析结果通过检验规则所进行的完整性检验。若原始语义解析结果对自然语言信息的关键字的语义解析,可有效表达自然语言信息的原始输入,表示该原始语义解析结果通过检验规则所进行的有效性检验。Specifically, the preset inspection rules are used for initial inspection of the original semantic parsing results, including checking the integrity and validity of the original semantic parsing results, and determining whether the original semantic parsing results are complete and valid. If the original semantic parsing result includes the semantic parsing of all keywords of the natural language information input by the user, it means that the original semantic parsing result passes the integrity check performed by the inspection rule. If the original semantic parsing result parses the keywords of natural language information semantically, it can effectively express the original input of natural language information, indicating that the original semantic parsing result has passed the validity check by the inspection rules.
进一步地,以用户的自然语言信息对应的语义场景为借贷场景时为例。服务器获取用户输入的自然语言信息“深圳大学生小额借贷分布”,并根据用户输入的自然语言信息中的关键字所属的关键字类别,获取对应的语义场景为“小额借贷”,根据预设的语义场景和语义解析方式之间的对应关系,获取与语义场景为“小额借贷”对应的语义解析方式,对自然语言信息“深圳大学生小额借贷分布”进行语义解析。Further, the case where the semantic scene corresponding to the user's natural language information is a borrowing scene is taken as an example. The server obtains the natural language information “Shenzhen university student micro-loan distribution” input by the user, and according to the keyword category to which the keywords in the natural language information entered by the user, obtains the corresponding semantic scene as “micro-loan”, according to the preset The corresponding relationship between the semantic scenes and the semantic parsing methods is used to obtain the semantic parsing method corresponding to the semantic scene as "small loans", and the natural language information "Shenzhen university students' small loan distribution" is semantically analyzed.
上述获得初始语义解析结果的步骤,服务器通过获取与最大关联度值对应的语义场景对应的语义解析方式,并根据语义解析方式对自然语言信息进行解析,获得原始语义解析结果。进而利用预设的检验规则对原始语义解析结果进行初始检验,获取符合预设的检验规则的初始语义解析结果。可实现对原始语义解析结果的完整性和有效性检验,获得符合预设要求的初始语义解析结果,进一步实现了初始语义解析结果的多方面的检测,提高了初始语义解析结果的准确度。In the above step of obtaining the initial semantic parsing result, the server obtains the original semantic parsing result by obtaining the semantic parsing method corresponding to the semantic scene corresponding to the maximum relevance value, and analyzing the natural language information according to the semantic parsing method. Furthermore, a preset inspection rule is used to perform initial inspection on the original semantic parsing result to obtain an initial semantic parsing result that conforms to the preset inspection rule. It can test the completeness and validity of the original semantic parsing result, and obtain the initial semantic parsing result that meets the preset requirements. It further realizes the multi-faceted detection of the initial semantic parsing result, and improves the accuracy of the initial semantic parsing result.
在其中一个实施例中,提供了一种根据预设的关键字和筛选值之间的对应关系,获取与自然语言信息对应的筛选值的步骤,包括:In one embodiment, a step of obtaining a filtering value corresponding to natural language information according to a preset correspondence between a keyword and a filtering value is provided, including:
服务器获取与关键字对应的筛选机制;根据预设的筛选机制和筛选值之间的对应关系,获取与自然语言信息对应的筛选值。The server obtains a filtering mechanism corresponding to the keywords; and obtains a filtering value corresponding to the natural language information according to the preset relationship between the filtering mechanism and the filtering value.
关键字和筛选机制之间存在对应关系,不同的关键字对应不同的筛选机制。筛选机制和筛选值之间存在预设的对应关系,可根据筛选机制和筛选值之间存在的对应关系,获取与筛选机制对应的筛选值。同时,由于不同的自然语言信息和关键字之间存在对应关系,可根据关键字和筛选机制之间的对应关系,以及筛选机制和筛选值之间的对应关系,获取与关键字对应的筛选值,进而,所获取得到的筛选值即为与自然语言信息对应的筛选值。There is a correspondence between keywords and filtering mechanisms, and different keywords correspond to different filtering mechanisms. There is a preset correspondence between the screening mechanism and the screening value. According to the mapping relationship between the screening mechanism and the screening value, a screening value corresponding to the screening mechanism can be obtained. At the same time, due to the correspondence between different natural language information and keywords, the filtering value corresponding to the keywords can be obtained according to the correspondence between the keywords and the filtering mechanism and the correspondence between the filtering mechanism and the filtering value. Furthermore, the obtained filtering value is a filtering value corresponding to natural language information.
上述获取与自然语言信息对应的筛选值的步骤,服务器通过获取与关键字对应的筛选机制,并根据预设的筛选机制和筛选值之间的对应关系,获取与自然语言信息对应的筛选值。可实现对关键字和筛选值之间的关联关系的进一步确定,保证所获得的筛选值与用户输入的自然语言信息对应,提高工作效率。In the above step of obtaining the filtering value corresponding to the natural language information, the server obtains the filtering value corresponding to the natural language information by acquiring the filtering mechanism corresponding to the keywords and according to the preset relationship between the filtering mechanism and the filtering value. It is possible to further determine the association relationship between keywords and filter values, ensure that the obtained filter values correspond to natural language information input by the user, and improve work efficiency.
在其中一个实施例中,提供了一种利用筛选值对初始语义解析结果进行筛选,得到符合筛选值的语义解析结果,并将语义解析结果发送至终端的步骤,包括:In one embodiment, a step of filtering an initial semantic parsing result by using a filtering value to obtain a semantic parsing result that meets the filtering value, and sending the semantic parsing result to a terminal includes:
服务器获取与初始语义解析结果对应的初始解析数据;利用与关键字对应的筛选值, 对初始解析数据进行筛选操作;获取通过筛选操作的初始解析数据,并获取与通过筛选操作的初始解析数据对应的初始语义解析结果;根据通过筛选操作的初始解析数据对应的初始语义解析结果,得到语义解析结果,并将语义解析结果发送至终端。The server obtains the initial parsing data corresponding to the initial semantic parsing result; uses the filtering value corresponding to the keyword to perform the filtering operation on the initial parsing data; obtains the initial parsing data that passes the filtering operation, and obtains the corresponding parsing data that passes the filtering operation The initial semantic parsing result of the; based on the initial semantic parsing result corresponding to the initial parsing data through the filtering operation to obtain the semantic parsing result and send the semantic parsing result to the terminal.
筛选值用于对于初始语义解析结果对应的初始解析数据进行筛选,不同自然语言信息对应不同的筛选值,通过利用筛选值可筛选得到与自然语言信息符合的语义解析结果。初始语义解析结果对应的初始解析数据,包括对自然语言信息进行解析的初始数据。The filtering value is used to filter the initial parsing data corresponding to the initial semantic parsing result. Different natural language information corresponds to different filtering values. The filtering value can be used to obtain the semantic parsing result consistent with the natural language information. The initial parsing data corresponding to the initial semantic parsing result includes the initial data for parsing natural language information.
上述得到符合筛选值的语义解析结果的步骤,服务器通过获取与初始语义解析结果对应的初始解析数据,并利用与关键字对应的筛选值,对初始解析数据进行筛选操作。从而可通过实现对于初始语义解析结果的筛选,符合筛选值的初始语义解析结果,并根据符合筛选值的初始语义解析结果生成语义解析结果,进一步保证了语义解析结果的准确性。In the above step of obtaining a semantic parsing result that matches the filtering value, the server obtains the initial parsing data corresponding to the initial semantic parsing result and uses the filtering value corresponding to the keyword to perform a filtering operation on the initial parsing data. Therefore, by implementing the screening of the initial semantic parsing results, the initial semantic parsing results matching the filtered values, and generating the semantic parsing results according to the initial semantic parsing results matching the filtered values, further ensuring the accuracy of the semantic parsing results.
应该理解的是,虽然图2-3的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,图2-3中的至少一部分步骤可以包括多个子步骤或者多个阶段,这些子步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些子步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤的子步骤或者阶段的至少一部分轮流或者交替地执行。It should be understood that although the steps in the flowchart of FIG. 2-3 are sequentially displayed in accordance with the directions of the arrows, these steps are not necessarily performed in the order indicated by the arrows. Unless explicitly stated in this document, the execution of these steps is not strictly limited, and these steps can be performed in other orders. Moreover, at least a part of the steps in Figure 2-3 may include multiple sub-steps or stages. These sub-steps or stages are not necessarily performed at the same time, but may be performed at different times. These sub-steps or stages The execution order of is not necessarily performed sequentially, but may be performed in turn or alternately with at least a part of another step or a sub-step or stage of another step.
在其中一个实施例中,如图4所示,提供了一种自然语言的语义解析装置,包括:接收模块402、语义场景获取模块404、初始语义解析结果获取模块406、筛选值获取模块408和语义解析结果获取模块410,其中:In one embodiment, as shown in FIG. 4, a natural language semantic parsing device is provided, including: a receiving module 402, a semantic scene acquisition module 404, an initial semantic parsing result acquisition module 406, a filtering value acquisition module 408, and The semantic parsing result obtaining module 410, wherein:
接收模块402,用于接收终端发送的对自然语言信息的语义解析请求。The receiving module 402 is configured to receive a semantic parsing request for natural language information sent by a terminal.
语义场景获取模块404,用于获取自然语言信息对应的语义场景。The semantic scene acquisition module 404 is configured to acquire a semantic scene corresponding to natural language information.
初始语义解析结果获取模块406,用于在对应的语义场景下,利用预设的语义解析方式对自然语言信息进行解析,获得初始语义解析结果。The initial semantic parsing result acquisition module 406 is configured to parse natural language information by using a preset semantic parsing method in a corresponding semantic scene to obtain an initial semantic parsing result.
筛选值获取模块408,用于根据预设的关键字和筛选值之间的对应关系,获取与自然语言信息对应的筛选值。The filtering value obtaining module 408 is configured to obtain a filtering value corresponding to natural language information according to a preset correspondence between a keyword and a filtering value.
语义解析结果获取模块410,用于利用筛选值对初始语义解析结果进行筛选,得到符合筛选值的语义解析结果,并将语义解析结果发送至终端。The semantic parsing result acquisition module 410 is configured to filter the initial semantic parsing result by using the screening value to obtain a semantic parsing result that matches the screening value, and send the semantic parsing result to the terminal.
上述自然语言的语义解析装置中,服务器通过接收终端发送的对自然语言信息的语义解析请求,并取自然语言信息的语义场景。在对应的语义场景下,利用预设的语义解析方式对自然语言信息进行解析,获得初始语义解析结果。根据预设的关键字和筛选值之间的对应关系,获取与自然语言信息对应的筛选值,利用筛选值对初始语义解析结果进行筛选,得到符合筛选值的语义解析结果,并将语义解析结果发送至终端。从而可在将语义解析结果发送至终端之前,通过利用筛选值实现对语义解析结果的进一步筛选,提高了语义解析结果的准确率,避免反复进行语义解析,节约了资源,降低了消耗。In the above-mentioned natural language semantic analysis device, the server receives a semantic analysis request for natural language information sent by the terminal, and takes a semantic scene of the natural language information. In the corresponding semantic scenario, natural language information is parsed by using a preset semantic parsing method to obtain an initial semantic parsing result. According to the preset correspondence between keywords and filtered values, obtain filtered values corresponding to natural language information, and use the filtered values to filter the initial semantic parsing results to obtain the semantic parsing results that match the filtered values. Send to terminal. Therefore, before the semantic parsing result is sent to the terminal, further screening of the semantic parsing result is realized by using the filtering value, which improves the accuracy of the semantic parsing result, avoids repeated semantic parsing, saves resources, and reduces consumption.
在其中一个实施例中,提供了一种语义场景获取模块,用于:In one embodiment, a semantic scene acquisition module is provided for:
提取自然语言信息中的关键字,并获取不同关键字对应的关键字属性;获取预设的关键字类别,并获取关键字类别对应的类别属性;根据预设的类别属性和关键字属性之间的对应关系,将自然语言信息中的关键字按照类别属性进行分类;根据预设的关键字类别和语义场景之间的对应关系,获取与不同关键字类别对应的语义场景。Extract keywords in natural language information, and obtain keyword attributes corresponding to different keywords; obtain preset keyword categories, and obtain category attributes corresponding to keyword categories; according to the preset category attributes and keyword attributes The corresponding relationship is used to classify keywords in natural language information according to category attributes; according to a preset correspondence relationship between keyword categories and semantic scenes, semantic scenes corresponding to different keyword categories are obtained.
上述语义场景获取模块,服务器通过提取自然语言信息中的关键字,并获取不同关键字对应的关键字属性。获取预设的关键字类别,并获取关键字类别对应的类别属性。进而根据预设的类别属性和关键字属性之间的对应关系,将自然语言信息中的关键字按照类别属性进行分类,根据预设的关键字类别和语义场景之间的对应关系,获取与不同关键字类别对应的语义场景。可通过获取到与自然语言信息中关键字对应的语义场景,实现对应语义场景下的针对性的语义解析,进一步提高了语义解析的准确性。In the above semantic scene acquisition module, the server extracts keywords in natural language information and obtains keyword attributes corresponding to different keywords. Obtain a preset keyword category, and obtain category attributes corresponding to the keyword category. Furthermore, according to the preset correspondence between the category attribute and the keyword attribute, the keywords in the natural language information are classified according to the category attribute, and according to the preset correspondence between the keyword category and the semantic scene, the difference is obtained. Semantic scenes corresponding to keyword categories. By obtaining the semantic scene corresponding to the keywords in the natural language information, the targeted semantic parsing in the corresponding semantic scene can be achieved, which further improves the accuracy of the semantic parsing.
在其中一个实施例中,提供了一种语义场景获取模块,还用于:In one embodiment, a semantic scene acquisition module is provided, which is further used for:
分别计算自然语言信息和不同语义场景之间的关联度值;根据关联度值的大小对语义场景进行排序,并获取最大关联度值对应的语义场景。Calculate the relevance value between natural language information and different semantic scenes; sort the semantic scenes according to the magnitude of the relevance value, and obtain the semantic scene corresponding to the maximum relevance value.
上述语义场景获取模块,服务器通过分别计算自然语言信息和不同语义场景之间的关联度值,并根据关联度值的大小对语义场景进行排序,进而可获取最大关联度值对应的语义场景。由于获取到与自然语言信息关联程度最高的语义场景,可在进行语义解析之前,判断语义场景是否符合对应的自然语言信息的要求,进一步提高语义解析的准确性。In the above semantic scene acquisition module, the server calculates the correlation degree values between the natural language information and different semantic scenes separately, and sorts the semantic scenes according to the magnitude of the correlation degree values, so as to obtain the semantic scene corresponding to the maximum correlation degree value. Since the semantic scene with the highest degree of relevance to natural language information is obtained, it is possible to determine whether the semantic scene meets the requirements of the corresponding natural language information before performing semantic parsing, and further improve the accuracy of semantic parsing.
在其中一个实施例中,提供了一种初始语义解析结果获取模块,用于:In one of the embodiments, an initial semantic parsing result acquisition module is provided for:
获取最大关联度值对应的语义场景和语义解析方式之间的对应关系,并获取与最大关联度值对应的语义场景对应的语义解析方式;根据语义解析方式对自然语言信息进行解析,获得原始语义解析结果;利用预设的检验规则对原始语义解析结果进行初始检验,获取符合预设的检验规则的原始语义解析结果;根据符合预设的检验规则的原始语义解析结果,得到初始语义解析结果。Obtain the correspondence between the semantic scene corresponding to the maximum relevance value and the semantic parsing mode, and obtain the semantic parsing mode corresponding to the semantic scene corresponding to the maximum relevance value; parse the natural language information according to the semantic parsing mode to obtain the original semantics Analyze the results; use the preset inspection rules to perform initial inspection on the original semantic parsing results to obtain the original semantic parsing results that meet the preset inspection rules; and obtain the initial semantic parsing results according to the original semantic parsing results that conform to the preset inspection rules.
上述初始语义解析结果获取模块,服务器通过获取与最大关联度值对应的语义场景对应的语义解析方式,并根据语义解析方式对自然语言信息进行解析,获得原始语义解析结果。进而利用预设的检验规则对原始语义解析结果进行初始检验,获取符合预设的检验规则的初始语义解析结果。可实现对原始语义解析结果的完整性和有效性检验,获得符合预设要求的初始语义解析结果,进一步实现了初始语义解析结果的多方面的检测,提高了初始语义解析结果的准确度。In the above initial semantic parsing result acquisition module, the server obtains the original semantic parsing result by acquiring the semantic parsing method corresponding to the semantic scene corresponding to the maximum relevance value, and analyzing the natural language information according to the semantic parsing method. Furthermore, a preset inspection rule is used to perform initial inspection on the original semantic parsing result to obtain an initial semantic parsing result that conforms to the preset inspection rule. It can test the completeness and validity of the original semantic parsing result, and obtain the initial semantic parsing result that meets the preset requirements. It further realizes the multi-faceted detection of the initial semantic parsing result, and improves the accuracy of the initial semantic parsing result.
在其中一个实施例中,提供了一种筛选值获取模块,用于:In one embodiment, a filtering value obtaining module is provided, which is used for:
获取与关键字对应的筛选机制;据预设的筛选机制和筛选值之间的对应关系,获取与自然语言信息对应的筛选值。Obtain the filtering mechanism corresponding to the keywords; according to the corresponding relationship between the preset filtering mechanism and the filtering value, obtain the filtering value corresponding to the natural language information.
上述筛选值获取模块,服务器通过获取与关键字对应的筛选机制,并根据预设的筛选机制和筛选值之间的对应关系,获取与自然语言信息对应的筛选值。可实现对关键字和 筛选值之间的关联关系的进一步确定,保证所获得的筛选值与用户输入的自然语言信息对应,提高工作效率。In the above-mentioned filtering value acquisition module, the server obtains a filtering value corresponding to natural language information by acquiring a filtering mechanism corresponding to a keyword, and according to a correspondence relationship between a preset filtering mechanism and the filtering value. It is possible to further determine the relationship between keywords and filtered values, ensure that the obtained filtered values correspond to natural language information input by the user, and improve work efficiency.
在其中一个实施例中,提供了一种语义解析结果获取模块,用于:In one of the embodiments, a semantic parsing result acquisition module is provided for:
获取与初始语义解析结果对应的初始解析数据;利用与关键字对应的筛选值,对初始解析数据进行筛选操作;获取通过筛选操作的初始解析数据,并获取与通过筛选操作的初始解析数据对应的初始语义解析结果;根据通过筛选操作的初始解析数据对应的初始语义解析结果,得到语义解析结果,并将语义解析结果发送至终端。Obtain initial parsing data corresponding to the initial semantic parsing result; use the filtering value corresponding to the keyword to perform the filtering operation on the initial parsing data; obtain the initial parsing data that passes the filtering operation, and obtain the parsing data that corresponds to the initial parsing data that passes the filtering operation Initial semantic parsing result; obtain the semantic parsing result according to the initial semantic parsing result corresponding to the initial parsing data through the filtering operation, and send the semantic parsing result to the terminal.
上述语义解析结果获取模块,服务器通过获取与初始语义解析结果对应的初始解析数据,并利用与关键字对应的筛选值,对初始解析数据进行筛选操作。从而可通过实现对于初始语义解析结果的筛选,符合筛选值的初始语义解析结果,并根据符合筛选值的初始语义解析结果生成语义解析结果,进一步保证了语义解析结果的准确性。In the above semantic parsing result acquisition module, the server obtains the initial parsing data corresponding to the initial semantic parsing result, and uses the filtering value corresponding to the keyword to perform a filtering operation on the initial parsing data. Therefore, by implementing the screening of the initial semantic parsing results, the initial semantic parsing results matching the filtered values, and generating the semantic parsing results according to the initial semantic parsing results matching the filtered values, further ensuring the accuracy of the semantic parsing results.
关于自然语言的语义解析装置的具体限定可以参见上文中对于自然语言的语义解析方法的限定,在此不再赘述。上述自然语言的语义解析装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。For the specific limitation of the semantic parsing device of natural language, please refer to the limitation on the semantic parsing method of natural language mentioned above, which will not be repeated here. Each module in the above-mentioned natural language semantic parsing device may be implemented in whole or in part by software, hardware, and a combination thereof. The above-mentioned modules may be embedded in the hardware form or independent of the processor in the computer device, or may be stored in the memory of the computer device in the form of software, so that the processor calls and performs the operations corresponding to the above modules.
在其中一个实施例中,提供了一种计算机设备,该计算机设备可以是服务器,其内部结构图可以如图5所示。该计算机设备包括通过系统总线连接的处理器、存储器、网络接口和数据库。该计算机设备的处理器用于提供计算和控制能力。该计算机设备的存储器包括非易失性计算机可读存储介质、内存储器。该非易失性计算机可读存储介质存储有操作系统、计算机可读指令和数据库。该内存储器为非易失性计算机可读存储介质中的操作系统和计算机可读指令的运行提供环境。该计算机设备的数据库用于存储自然语言的语义解析数据。该计算机设备的网络接口用于与外部的终端通过网络连接通信。该计算机可读指令被处理器执行时以实现一种自然语言的语义解析方法。In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. 5. The computer device includes a processor, a memory, a network interface, and a database connected through a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile computer-readable storage medium and an internal memory. The non-volatile computer-readable storage medium stores an operating system, computer-readable instructions, and a database. The internal memory provides an environment for operating systems and computer-readable instructions in a non-volatile computer-readable storage medium. The database of the computer equipment is used to store semantic parsing data of natural language. The network interface of the computer device is used to communicate with an external terminal through a network connection. The computer-readable instructions are executed by a processor to implement a natural language semantic parsing method.
本领域技术人员可以理解,图5中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定,具体的计算机设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。Those skilled in the art can understand that the structure shown in FIG. 5 is only a block diagram of a part of the structure related to the solution of the application, and does not constitute a limitation on the computer equipment to which the solution of the application is applied. The specific computer equipment may be Include more or fewer parts than shown in the figure, or combine certain parts, or have a different arrangement of parts.
一种计算机设备,包括存储器和一个或多个处理器,存储器中存储有计算机可读指令,计算机可读指令被处理器执行时实现本申请任意一个实施例中提供的不平衡样本数据预处理方法的步骤。A computer device includes a memory and one or more processors. The memory stores computer-readable instructions. When the computer-readable instructions are executed by the processor, the method for preprocessing the imbalanced sample data provided in any one of the embodiments of the present application is implemented. A step of.
一个或多个存储有计算机可读指令的非易失性计算机可读存储介质,计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器实现本申请任意一个实施例中提供的不平衡样本数据预处理方法的步骤。One or more non-volatile computer-readable storage media storing computer-readable instructions, and when the computer-readable instructions are executed by one or more processors, the one or more processors implement one of the embodiments of the present application Provides steps for pre-processing methods for unbalanced sample data.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机可读指令来指令相关的硬件来完成,所述的计算机可读指令可存储于一非易失性计算机可读取存储介质中,该计算机可读指令在执行时,可包括如上述各方法的实施例的流程。本申请所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM)或者外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDRSDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)等。Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be implemented by computer-readable instructions to instruct related hardware. The computer-readable instructions can be stored in a non-volatile computer. In the readable storage medium, the computer-readable instructions, when executed, may include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous chain Synchlink DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
以上实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。The technical features of the above embodiments can be arbitrarily combined. In order to make the description concise, all possible combinations of the technical features in the above embodiments have not been described. However, as long as there is no contradiction in the combination of these technical features, they should be It is considered to be the range described in this specification.
以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。The above-mentioned embodiments only express several implementation manners of the present application, and their descriptions are more specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be noted that, for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can be made, which all belong to the protection scope of the present application. Therefore, the protection scope of this application patent shall be subject to the appended claims.

Claims (20)

  1. 一种自然语言的语义解析方法,包括:A natural language semantic analysis method, including:
    接收终端发送的对自然语言信息的语义解析请求;Receiving a semantic parsing request for natural language information sent by a terminal;
    获取所述自然语言信息对应的语义场景;Acquiring a semantic scene corresponding to the natural language information;
    在所述对应的语义场景下,利用预设的语义解析方式对所述自然语言信息进行解析,获得初始语义解析结果;Parsing the natural language information by using a preset semantic parsing method under the corresponding semantic scenario to obtain an initial semantic parsing result;
    根据预设的关键字和筛选值之间的对应关系,获取与所述自然语言信息对应的筛选值;及Obtaining a filtering value corresponding to the natural language information according to a preset correspondence between keywords and filtering values; and
    利用所述筛选值对所述初始语义解析结果进行筛选,得到符合所述筛选值的语义解析结果,并将所述语义解析结果发送至终端。The initial semantic parsing result is filtered using the screening value to obtain a semantic parsing result that matches the filtered value, and the semantic parsing result is sent to a terminal.
  2. 根据权利要求1所述的方法,其特征在于,所述获取所述自然语言信息对应的语义场景,包括:The method according to claim 1, wherein the acquiring a semantic scene corresponding to the natural language information comprises:
    分别计算自然语言信息和不同语义场景之间的关联度值;及Calculate the degree of relevance between natural language information and different semantic scenes; and
    根据所述关联度值的大小对所述语义场景进行排序,并获取最大关联度值对应的语义场景。Sort the semantic scenes according to the magnitude of the relevance degree value, and obtain the semantic scene corresponding to the largest relevance degree value.
  3. 根据权利要求1所述的方法,其特征在于,所述在所述对应的语义场景下,利用预设的语义解析方式对所述自然语言信息进行解析,获得初始语义解析结果,包括:The method according to claim 1, wherein the parsing the natural language information by using a preset semantic parsing method under the corresponding semantic scene to obtain an initial semantic parsing result comprises:
    获取最大关联度值对应的语义场景和语义解析方式之间的对应关系,并获取与所述最大关联度值对应的语义场景对应的语义解析方式;Acquiring the correspondence between the semantic scene corresponding to the maximum relevance value and the semantic parsing mode, and acquiring the semantic parsing mode corresponding to the semantic scene corresponding to the maximum relevance value;
    根据所述语义解析方式对所述自然语言信息进行解析,获得原始语义解析结果;Parse the natural language information according to the semantic parsing method to obtain the original semantic parsing result;
    利用预设的检验规则对所述原始语义解析结果进行初始检验,获取符合预设的检验规则的原始语义解析结果;及Perform an initial inspection on the original semantic analysis result using a preset inspection rule to obtain an original semantic analysis result that conforms to the preset inspection rule; and
    根据所述符合预设的检验规则的原始语义解析结果,得到初始语义解析结果。An initial semantic parsing result is obtained according to the original semantic parsing result that conforms to a preset inspection rule.
  4. 根据权利要求1至2任意一项所述的方法,其特征在于,所述根据预设的关键字和筛选值之间的对应关系,获取与所述自然语言信息对应的筛选值,包括:The method according to any one of claims 1 to 2, wherein the acquiring a filtering value corresponding to the natural language information according to a preset correspondence between a keyword and a filtering value comprises:
    获取与所述关键字对应的筛选机制;及Obtaining a filtering mechanism corresponding to the keywords; and
    根据预设的筛选机制和筛选值之间的对应关系,获取与所述自然语言信息对应的筛选值。A filtering value corresponding to the natural language information is obtained according to a preset relationship between a preset filtering mechanism and a filtering value.
  5. 根据权利要求1至2任意一项所述的方法,其特征在于,所述利用所述筛选值对所述初始语义解析结果进行筛选,得到符合所述筛选值的语义解析结果,并将所述语义解析结果发送至终端,包括:The method according to any one of claims 1 to 2, wherein the initial semantic parsing result is filtered by using the filtering value to obtain a semantic parsing result that matches the filtering value, and the The semantic parsing results are sent to the terminal, including:
    获取与所述初始语义解析结果对应的初始解析数据;Acquiring initial parsing data corresponding to the initial semantic parsing result;
    利用与所述关键字对应的筛选值,对所述初始解析数据进行筛选操作;Performing a filtering operation on the initial parsed data by using a filtering value corresponding to the keyword;
    获取通过所述筛选操作的初始解析数据,并获取与通过所述筛选操作的初始解析数据对应的初始语义解析结果;及Acquiring initial parsing data that passed the filtering operation, and acquiring initial semantic parsing results corresponding to the initial parsing data that passed the filtering operation; and
    根据通过所述筛选操作的初始解析数据对应的初始语义解析结果,得到语义解析结果,并将所述语义解析结果发送至终端。Obtaining a semantic parsing result according to an initial semantic parsing result corresponding to the initial parsing data through the filtering operation, and sending the semantic parsing result to a terminal.
  6. 根据权利要求1所述的方法,其特征在于,所述获取所述自然语言信息的语义场景,包括:The method according to claim 1, wherein the acquiring a semantic scene of the natural language information comprises:
    提取所述自然语言信息中的关键字,并获取不同所述关键字对应的关键字属性;Extract keywords in the natural language information, and obtain keyword attributes corresponding to different keywords;
    获取预设的关键字类别,并获取所述关键字类别对应的类别属性;Acquiring a preset keyword category, and acquiring category attributes corresponding to the keyword category;
    根据预设的类别属性和关键字属性之间的对应关系,将所述自然语言信息中的关键字按照类别属性进行分类;及根据预设的关键字类别和语义场景之间的对应关系,获取与不同所述关键字类别对应的语义场景。Classify keywords in the natural language information according to a category attribute according to a preset correspondence relationship between category attributes and keyword attributes; and obtain according to a preset correspondence relationship between keyword categories and semantic scenes Semantic scenes corresponding to different said keyword categories.
  7. 一种自然语言的语义解析装置,包括:A semantic parsing device for natural language, including:
    接收模块,用于接收终端发送的对自然语言信息的语义解析请求;A receiving module, configured to receive a semantic parsing request for natural language information sent by a terminal;
    语义场景获取模块,用于获取所述自然语言信息的语义场景;A semantic scene acquisition module, configured to acquire a semantic scene of the natural language information;
    初始语义解析结果获取模块,用于在对应的所述语义场景下,利用预设的语义解析方式对所述自然语言信息进行解析,获得初始语义解析结果;An initial semantic parsing result acquisition module, configured to parse the natural language information by using a preset semantic parsing method under the corresponding semantic scenario to obtain an initial semantic parsing result;
    筛选值获取模块,用于根据预设的关键字和筛选值之间的对应关系,获取与所述自然语言信息对应的筛选值;及A filtering value obtaining module, configured to obtain a filtering value corresponding to the natural language information according to a preset correspondence between a keyword and the filtering value; and
    语义解析结果获取模块,用于利用所述筛选值对所述初始语义解析结果进行筛选,得到符合所述筛选值的语义解析结果,并将所述语义解析结果发送至终端。The semantic parsing result acquisition module is configured to filter the initial semantic parsing result by using the screening value to obtain a semantic parsing result that matches the filtered value, and send the semantic parsing result to a terminal.
  8. 根据权利要求7所述的装置,其特征在于,所述语义场景获取模块,还用于:The apparatus according to claim 7, wherein the semantic scene acquisition module is further configured to:
    提取所述自然语言信息中的关键字,并获取不同所述关键字对应的关键字属性;Extract keywords in the natural language information, and obtain keyword attributes corresponding to different keywords;
    获取预设的关键字类别,并获取所述关键字类别对应的类别属性;Acquiring a preset keyword category, and acquiring category attributes corresponding to the keyword category;
    根据预设的类别属性和关键字属性之间的对应关系,将所述自然语言信息中的关键字按照类别属性进行分类;及Classifying keywords in the natural language information according to a category attribute according to a preset correspondence relationship between category attributes and keyword attributes; and
    根据预设的关键字类别和语义场景之间的对应关系,获取与不同所述关键字类别对应的语义场景。According to a preset correspondence relationship between a keyword category and a semantic scene, a semantic scene corresponding to a different keyword category is obtained.
  9. 根据权利要求7所述的装置,其特征在于,所述初始语义解析结果获取模块,还用于:The apparatus according to claim 7, wherein the initial semantic parsing result obtaining module is further configured to:
    获取最大关联度值对应的语义场景和语义解析方式之间的对应关系,并获取与所述最大关联度值对应的语义场景对应的语义解析方式;Acquiring the correspondence between the semantic scene corresponding to the maximum relevance value and the semantic parsing mode, and acquiring the semantic parsing mode corresponding to the semantic scene corresponding to the maximum relevance value;
    根据所述语义解析方式对所述自然语言信息进行解析,获得原始语义解析结果;Parse the natural language information according to the semantic parsing method to obtain the original semantic parsing result;
    利用预设的检验规则对所述原始语义解析结果进行初始检验,获取符合预设的检验规则的原始语义解析结果;及Perform an initial inspection on the original semantic analysis result using a preset inspection rule to obtain an original semantic analysis result that conforms to the preset inspection rule; and
    根据所述符合预设的检验规则的原始语义解析结果,得到初始语义解析结果。An initial semantic parsing result is obtained according to the original semantic parsing result that conforms to a preset inspection rule.
  10. 一种计算机设备,包括存储器及一个或多个处理器,所述存储器中储存有计算机可读指令,所述计算机可读指令被所述一个或多个处理器执行时,使得所述一个或多个处 理器执行以下步骤:A computer device includes a memory and one or more processors. The memory stores computer-readable instructions. When the computer-readable instructions are executed by the one or more processors, the one or more processors are Each processor performs the following steps:
    接收终端发送的对自然语言信息的语义解析请求;Receiving a semantic parsing request for natural language information sent by a terminal;
    获取所述自然语言信息对应的语义场景;Acquiring a semantic scene corresponding to the natural language information;
    在所述对应的语义场景下,利用预设的语义解析方式对所述自然语言信息进行解析,获得初始语义解析结果;Parsing the natural language information by using a preset semantic parsing method under the corresponding semantic scenario to obtain an initial semantic parsing result;
    根据预设的关键字和筛选值之间的对应关系,获取与所述自然语言信息对应的筛选值;及Obtaining a filtering value corresponding to the natural language information according to a preset correspondence between keywords and filtering values; and
    利用所述筛选值对所述初始语义解析结果进行筛选,得到符合所述筛选值的语义解析结果,并将所述语义解析结果发送至终端。The initial semantic parsing result is filtered using the screening value to obtain a semantic parsing result that matches the filtered value, and the semantic parsing result is sent to a terminal.
  11. 根据权利要求10所述的计算机设备,其特征在于,所述处理器执行所述计算机可读指令时还执行以下步骤:The computer device according to claim 10, wherein the processor further executes the following steps when executing the computer-readable instructions:
    分别计算自然语言信息和不同语义场景之间的关联度值;及Calculate the degree of relevance between natural language information and different semantic scenes; and
    根据所述关联度值的大小对所述语义场景进行排序,并获取最大关联度值对应的语义场景。Sort the semantic scenes according to the magnitude of the relevance degree value, and obtain the semantic scene corresponding to the largest relevance degree value.
  12. 根据权利要求10所述的计算机设备,其特征在于,所述处理器执行所述计算机可读指令时还执行以下步骤:The computer device according to claim 10, wherein the processor further executes the following steps when executing the computer-readable instructions:
    获取最大关联度值对应的语义场景和语义解析方式之间的对应关系,并获取与所述最大关联度值对应的语义场景对应的语义解析方式;Acquiring the correspondence between the semantic scene corresponding to the maximum relevance value and the semantic parsing mode, and acquiring the semantic parsing mode corresponding to the semantic scene corresponding to the maximum relevance value;
    根据所述语义解析方式对所述自然语言信息进行解析,获得原始语义解析结果;Parse the natural language information according to the semantic parsing method to obtain the original semantic parsing result;
    利用预设的检验规则对所述原始语义解析结果进行初始检验,获取符合预设的检验规则的原始语义解析结果;及Perform an initial inspection on the original semantic analysis result using a preset inspection rule to obtain an original semantic analysis result that conforms to the preset inspection rule; and
    根据所述符合预设的检验规则的原始语义解析结果,得到初始语义解析结果。An initial semantic parsing result is obtained according to the original semantic parsing result that conforms to a preset inspection rule.
  13. 根据权利要求10至11任一项所述的计算机设备,其特征在于,所述处理器执行所述计算机可读指令时还执行以下步骤:The computer device according to any one of claims 10 to 11, wherein the processor further executes the following steps when executing the computer-readable instructions:
    获取与所述关键字对应的筛选机制;及Obtaining a filtering mechanism corresponding to the keywords; and
    根据预设的筛选机制和筛选值之间的对应关系,获取与所述自然语言信息对应的筛选值。A filtering value corresponding to the natural language information is obtained according to a preset relationship between a preset filtering mechanism and a filtering value.
  14. 根据权利要求10至11任一项所述的计算机设备,其特征在于,所述处理器执行所述计算机可读指令时还执行以下步骤:The computer device according to any one of claims 10 to 11, wherein the processor further executes the following steps when executing the computer-readable instructions:
    获取与所述初始语义解析结果对应的初始解析数据;Acquiring initial parsing data corresponding to the initial semantic parsing result;
    利用与所述关键字对应的筛选值,对所述初始解析数据进行筛选操作;Performing a filtering operation on the initial parsed data by using a filtering value corresponding to the keyword;
    获取通过所述筛选操作的初始解析数据,并获取与通过所述筛选操作的初始解析数据对应的初始语义解析结果;及Acquiring initial parsing data that passed the filtering operation, and acquiring initial semantic parsing results corresponding to the initial parsing data that passed the filtering operation; and
    根据通过所述筛选操作的初始解析数据对应的初始语义解析结果,得到语义解析结果,并将所述语义解析结果发送至终端。Obtaining a semantic parsing result according to an initial semantic parsing result corresponding to the initial parsing data through the filtering operation, and sending the semantic parsing result to a terminal.
  15. 根据权利要求10所述的计算机设备,其特征在于,所述处理器执行所述计算机可读指令时还执行以下步骤:The computer device according to claim 10, wherein the processor further executes the following steps when executing the computer-readable instructions:
    提取所述自然语言信息中的关键字,并获取不同所述关键字对应的关键字属性;Extract keywords in the natural language information, and obtain keyword attributes corresponding to different keywords;
    获取预设的关键字类别,并获取所述关键字类别对应的类别属性;Acquiring a preset keyword category, and acquiring category attributes corresponding to the keyword category;
    根据预设的类别属性和关键字属性之间的对应关系,将所述自然语言信息中的关键字按照类别属性进行分类;及根据预设的关键字类别和语义场景之间的对应关系,获取与不同所述关键字类别对应的语义场景。Classify keywords in the natural language information according to a category attribute according to a preset correspondence relationship between category attributes and keyword attributes; and obtain according to a preset correspondence relationship between keyword categories and semantic scenes Semantic scenes corresponding to different said keyword categories.
  16. 一个或多个存储有计算机可读指令的非易失性计算机可读存储介质,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行以下步骤:One or more non-transitory computer-readable storage media storing computer-readable instructions that, when executed by one or more processors, cause the one or more processors to perform the following steps:
    接收终端发送的对自然语言信息的语义解析请求;Receiving a semantic parsing request for natural language information sent by a terminal;
    获取所述自然语言信息对应的语义场景;Acquiring a semantic scene corresponding to the natural language information;
    在所述对应的语义场景下,利用预设的语义解析方式对所述自然语言信息进行解析,获得初始语义解析结果;Parsing the natural language information by using a preset semantic parsing method under the corresponding semantic scenario to obtain an initial semantic parsing result;
    根据预设的关键字和筛选值之间的对应关系,获取与所述自然语言信息对应的筛选值;及Obtaining a filtering value corresponding to the natural language information according to a preset correspondence between keywords and filtering values; and
    利用所述筛选值对所述初始语义解析结果进行筛选,得到符合所述筛选值的语义解析结果,并将所述语义解析结果发送至终端。The initial semantic parsing result is filtered using the screening value to obtain a semantic parsing result that matches the filtered value, and the semantic parsing result is sent to a terminal.
  17. 根据权利要求16所述的存储介质,其特征在于,所述计算机可读指令被所述处理器执行时还执行以下步骤:The storage medium according to claim 16, wherein when the computer-readable instructions are executed by the processor, the following steps are further performed:
    分别计算自然语言信息和不同语义场景之间的关联度值;及Calculate the degree of relevance between natural language information and different semantic scenes; and
    根据所述关联度值的大小对所述语义场景进行排序,并获取最大关联度值对应的语义场景。Sort the semantic scenes according to the magnitude of the relevance degree value, and obtain the semantic scene corresponding to the largest relevance degree value.
  18. 根据权利要求16所述的存储介质,其特征在于,所述计算机可读指令被所述处理器执行时还执行以下步骤:The storage medium according to claim 16, wherein when the computer-readable instructions are executed by the processor, the following steps are further performed:
    获取最大关联度值对应的语义场景和语义解析方式之间的对应关系,并获取与所述最大关联度值对应的语义场景对应的语义解析方式;Acquiring the correspondence between the semantic scene corresponding to the maximum relevance value and the semantic parsing mode, and acquiring the semantic parsing mode corresponding to the semantic scene corresponding to the maximum relevance value;
    根据所述语义解析方式对所述自然语言信息进行解析,获得原始语义解析结果;Parse the natural language information according to the semantic parsing method to obtain the original semantic parsing result;
    利用预设的检验规则对所述原始语义解析结果进行初始检验,获取符合预设的检验规则的原始语义解析结果;及Perform an initial inspection on the original semantic analysis result using a preset inspection rule to obtain an original semantic analysis result that conforms to the preset inspection rule; and
    根据所述符合预设的检验规则的原始语义解析结果,得到初始语义解析结果。An initial semantic parsing result is obtained according to the original semantic parsing result that conforms to a preset inspection rule.
  19. 根据权利要求16至17任一项所述的存储介质,其特征在于,所述计算机可读指令被所述处理器执行时还执行以下步骤:The storage medium according to any one of claims 16 to 17, wherein when the computer-readable instructions are executed by the processor, the following steps are further performed:
    获取与所述关键字对应的筛选机制;及Obtaining a filtering mechanism corresponding to the keywords; and
    根据预设的筛选机制和筛选值之间的对应关系,获取与所述自然语言信息对应的筛选值。A filtering value corresponding to the natural language information is obtained according to a preset relationship between a preset filtering mechanism and a filtering value.
  20. 根据权利要求16至17任一项所述的存储介质,其特征在于,所述计算机可读指令被所述处理器执行时还执行以下步骤:The storage medium according to any one of claims 16 to 17, wherein when the computer-readable instructions are executed by the processor, the following steps are further performed:
    提取所述自然语言信息中的关键字,并获取不同所述关键字对应的关键字属性;Extract keywords in the natural language information, and obtain keyword attributes corresponding to different keywords;
    获取预设的关键字类别,并获取所述关键字类别对应的类别属性;Acquiring a preset keyword category, and acquiring category attributes corresponding to the keyword category;
    根据预设的类别属性和关键字属性之间的对应关系,将所述自然语言信息中的关键字按照类别属性进行分类;及根据预设的关键字类别和语义场景之间的对应关系,获取与不同所述关键字类别对应的语义场景。Classify keywords in the natural language information according to a category attribute according to a preset correspondence relationship between category attributes and keyword attributes; and obtain according to a preset correspondence relationship between keyword categories and semantic scenes Semantic scenes corresponding to different said keyword categories.
PCT/CN2019/071251 2018-09-18 2019-01-11 Natural-language semantic parsing method, apparatus, computer device, and storage medium WO2020057023A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201811089544.4 2018-09-18
CN201811089544.4A CN109359295A (en) 2018-09-18 2018-09-18 Semantic analytic method, device, computer equipment and the storage medium of natural language

Publications (1)

Publication Number Publication Date
WO2020057023A1 true WO2020057023A1 (en) 2020-03-26

Family

ID=65351120

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/071251 WO2020057023A1 (en) 2018-09-18 2019-01-11 Natural-language semantic parsing method, apparatus, computer device, and storage medium

Country Status (2)

Country Link
CN (1) CN109359295A (en)
WO (1) WO2020057023A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110232189B (en) * 2019-06-11 2023-06-02 上海喜马拉雅科技有限公司 Semantic analysis method, device, equipment and storage medium
CN110969007A (en) * 2019-11-26 2020-04-07 北京声智科技有限公司 Information analysis method, platform and computer readable storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102968987A (en) * 2012-11-19 2013-03-13 百度在线网络技术(北京)有限公司 Speech recognition method and system
CN104199810A (en) * 2014-08-29 2014-12-10 科大讯飞股份有限公司 Intelligent service method and system based on natural language interaction
CN104360994A (en) * 2014-12-04 2015-02-18 科大讯飞股份有限公司 Natural language understanding method and natural language understanding system
CN107832286A (en) * 2017-09-11 2018-03-23 远光软件股份有限公司 Intelligent interactive method, equipment and storage medium
CN108345610A (en) * 2017-01-24 2018-07-31 北京搜狗科技发展有限公司 It is a kind of to obtain the method and apparatus of data resource, the device for obtaining data resource

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103020047A (en) * 2012-12-31 2013-04-03 威盛电子股份有限公司 Method for revising voice response and natural language dialogue system
CN107798032B (en) * 2017-02-17 2020-05-19 平安科技(深圳)有限公司 Method and device for processing response message in self-service voice conversation
CN107644642B (en) * 2017-09-20 2021-01-15 Oppo广东移动通信有限公司 Semantic recognition method and device, storage medium and electronic equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102968987A (en) * 2012-11-19 2013-03-13 百度在线网络技术(北京)有限公司 Speech recognition method and system
CN104199810A (en) * 2014-08-29 2014-12-10 科大讯飞股份有限公司 Intelligent service method and system based on natural language interaction
CN104360994A (en) * 2014-12-04 2015-02-18 科大讯飞股份有限公司 Natural language understanding method and natural language understanding system
CN108345610A (en) * 2017-01-24 2018-07-31 北京搜狗科技发展有限公司 It is a kind of to obtain the method and apparatus of data resource, the device for obtaining data resource
CN107832286A (en) * 2017-09-11 2018-03-23 远光软件股份有限公司 Intelligent interactive method, equipment and storage medium

Also Published As

Publication number Publication date
CN109359295A (en) 2019-02-19

Similar Documents

Publication Publication Date Title
WO2021042503A1 (en) Information classification extraction method, apparatus, computer device and storage medium
WO2020057022A1 (en) Associative recommendation method and apparatus, computer device, and storage medium
WO2020077896A1 (en) Method and apparatus for generating question data, computer device, and storage medium
CN110457431B (en) Knowledge graph-based question and answer method and device, computer equipment and storage medium
CN108595695B (en) Data processing method, data processing device, computer equipment and storage medium
WO2022142613A1 (en) Training corpus expansion method and apparatus, and intent recognition model training method and apparatus
CN109063217B (en) Work order classification method and device in electric power marketing system and related equipment thereof
WO2020057021A1 (en) Data table processing method and device, computer device and storage medium
EP3848797A1 (en) Automatic parameter value resolution for api evaluation
CN113609261B (en) Vulnerability information mining method and device based on knowledge graph of network information security
CN110362798B (en) Method, apparatus, computer device and storage medium for judging information retrieval analysis
CN110674131A (en) Financial statement data processing method and device, computer equipment and storage medium
WO2021121158A1 (en) Official document file processing method, apparatus, computer device, and storage medium
CN114186019A (en) Enterprise project auditing method and device combining RPA and AI
CN112652295A (en) Language model training method, device, equipment and medium, and video subtitle checking method, device and medium
CN112559526A (en) Data table export method and device, computer equipment and storage medium
WO2020057023A1 (en) Natural-language semantic parsing method, apparatus, computer device, and storage medium
TW202123026A (en) Data archiving method, device, computer device and storage medium
CN114579523A (en) Double-recording file quality inspection method and device, computer equipment and storage medium
WO2020132933A1 (en) Short text filtering method and apparatus, medium and computer device
WO2019148797A1 (en) Natural language processing method, device, computer apparatus, and storage medium
US20210342530A1 (en) Framework for Managing Natural Language Processing Tools
CN112732423B (en) Process migration method, device, equipment and medium
US20210141819A1 (en) Server and method for classifying entities of a query
CN114580398A (en) Text information extraction model generation method, text information extraction method and device

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205 DATED 12.07.2021)

122 Ep: pct application non-entry in european phase

Ref document number: 19863391

Country of ref document: EP

Kind code of ref document: A1