[go: up one dir, main page]

CN114416912A - Event description text prediction method, device, device and storage medium - Google Patents

Event description text prediction method, device, device and storage medium Download PDF

Info

Publication number
CN114416912A
CN114416912A CN202210082422.2A CN202210082422A CN114416912A CN 114416912 A CN114416912 A CN 114416912A CN 202210082422 A CN202210082422 A CN 202210082422A CN 114416912 A CN114416912 A CN 114416912A
Authority
CN
China
Prior art keywords
event
text
target
node
sample
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.)
Granted
Application number
CN202210082422.2A
Other languages
Chinese (zh)
Other versions
CN114416912B (en
Inventor
张跃威
文浩宇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN202210082422.2A priority Critical patent/CN114416912B/en
Publication of CN114416912A publication Critical patent/CN114416912A/en
Application granted granted Critical
Publication of CN114416912B publication Critical patent/CN114416912B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/31Indexing; Data structures therefor; Storage structures
    • G06F16/316Indexing structures
    • G06F16/322Trees
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/3331Query processing
    • G06F16/3332Query translation
    • G06F16/3334Selection or weighting of terms from queries, including natural language queries
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/3331Query processing
    • G06F16/334Query execution
    • G06F16/3344Query execution using natural language analysis
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/3331Query processing
    • G06F16/334Query execution
    • G06F16/3347Query execution using vector based model
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/38Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
    • G06F16/387Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using geographical or spatial information, e.g. location
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/22Matching criteria, e.g. proximity measures
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/30Semantic analysis

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Computational Linguistics (AREA)
  • Artificial Intelligence (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Evolutionary Computation (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Software Systems (AREA)
  • Evolutionary Biology (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Library & Information Science (AREA)
  • Health & Medical Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • General Health & Medical Sciences (AREA)
  • Machine Translation (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application provides a method, a device, equipment and a computer readable storage medium for predicting description texts of events, wherein the method comprises the following steps: acquiring an event description text of a target event from a source terminal; performing semantic analysis on the event description text to obtain key verbs and key nouns; determining the matching degree of the key verb and a first node of the nodes in the event relation tree based on the event relation tree; determining a target node in the event relation tree according to the first node matching degree to obtain a target first text and a target second text; determining a first degree of association of the nouns in the target first text with the nouns in the target second text; determining a target noun corresponding to the key noun according to the first association degree and the key noun; and carrying out noun replacement processing on the target second text according to the target noun to obtain a target description text, and sending the target description text to the target terminal. The application also relates to blockchain technology, and the target description text can be stored in the blockchain.

Description

事件的描述文本预测方法、装置、设备及存储介质Event description text prediction method, device, device and storage medium

技术领域technical field

本申请涉及文本预测的技术领域,尤其涉及一种事件的描述文本预测方 法、装置、设备及计算机可读存储介质。The present application relates to the technical field of text prediction, and in particular, to a method, apparatus, device, and computer-readable storage medium for event description text prediction.

背景技术Background technique

随着近年来突发事件频繁发生,全社会对突发事件的关注度越来越高。 在没有充分准备的情况下,突发事件往往令人措手不及,如果涉及到生命安 全,则时间就是生命。因此,只有快速、准确地应对,才能为生命安全保驾 护航。在越来越多突发事件的情况处理中积累的相关经验就可以作为应对未 来突发事件的预准备措施,而事件发展情况就可以为突发事件预测提供巨大 帮助。With the frequent occurrence of emergencies in recent years, the whole society is paying more and more attention to emergencies. Without adequate preparation, emergencies are often caught off guard, and when life safety is involved, time is life. Therefore, only quick and accurate responses can escort life safety. The relevant experience accumulated in the handling of more and more emergencies can be used as a preparatory measure to deal with future emergencies, and the development of events can provide great help for the prediction of emergencies.

现在的工作大多都是使用基于词语共现关系的概率统计的相关方法来描 述事件之间的逻辑规律和行为模式。例如给定一个事件的上下文和若干个候 选的后续事件,从这些后续事件中挑选唯一正确的后续事件。但这种事件预 测方法并不适用于一些事件间存在隐含因果关系的情况,如在文本中并未出 现“因果”相关的词语的事件对,对于存在隐含关系的情况并没有合理的应 用事件间存在的因果关系,而是通过事件间的共现概率来判断结果事件与原 因事件出现在同篇上下文的可能性,这样预测得到的事件可能会出现与原因 事件不符合客观事实的情况,从而导致预测得到的事件描述文本的不合理, 可参考性不高。Most of the current work uses probabilistic and statistical correlation methods based on word co-occurrence relationships to describe the logical laws and behavior patterns between events. For example, given the context of an event and several candidate follow-up events, select the only correct follow-up event from these follow-up events. However, this event prediction method is not suitable for situations where there is an implicit causal relationship between some events. For example, the event pair for which there is no word related to "causality" in the text does not have a reasonable application to the situation where there is an implicit relationship. The causal relationship exists between events, but the possibility of the resulting event and the causal event appearing in the same context is judged by the co-occurrence probability between the events, so that the predicted event may appear inconsistent with the causal event. As a result, the predicted event description text is unreasonable, and the reference is not high.

发明内容SUMMARY OF THE INVENTION

本申请的主要目的在于提供一种事件的描述文本预测方法、装置、设备 及计算机可读存储介质,旨在提高预测得到的事件描述文本的合理性和准确 性。The main purpose of this application is to provide an event description text prediction method, apparatus, device and computer-readable storage medium, aiming to improve the rationality and accuracy of the predicted event description text.

第一方面,本申请提供一种事件的描述文本预测方法,所述事件的描述 文本预测方法包括以下步骤:In a first aspect, the present application provides a description text prediction method for an event, and the event description text prediction method includes the following steps:

从源终端获取目标事件的事件描述文本;Obtain the event description text of the target event from the source terminal;

对所述事件描述文本进行语义解析,得到关键动词和关键名词;Semantically parse the event description text to obtain key verbs and key nouns;

基于事件关系树,确定所述关键动词与所述事件关系树中节点的第一节 点匹配度,其中,所述节点用于指示第一文本及与所述第一文本对应的第二 文本,所述第一文本为原因事件描述文本,所述第二文本为结果事件描述文 本;Based on the event relationship tree, determine the degree of matching between the key verb and the node in the event relationship tree, wherein the node is used to indicate the first text and the second text corresponding to the first text, and the The first text is the cause event description text, and the second text is the result event description text;

根据所述第一节点匹配度,在所述事件关系树中确定目标节点,得到所 述目标节点所指示的目标第一文本及目标第二文本;According to the first node matching degree, determine the target node in the event relationship tree, and obtain the target first text and the target second text indicated by the target node;

基于预设的名词关系数据库,确定所述目标第一文本中名词与所述目标 第二文本中名词的第一关联程度;Based on a preset noun relation database, determining the first degree of association between the nouns in the target first text and the nouns in the target second text;

基于预设的语义网络,根据所述第一关联程度和所述关键名词,确定与 所述关键名词对应的目标名词,其中,所述目标名词与所述关键名词的第二 关联程度大于或等于所述第一关联程度;Based on a preset semantic network, according to the first degree of association and the key noun, determine the target noun corresponding to the key noun, wherein the second degree of association between the target noun and the key noun is greater than or equal to the first degree of association;

根据所述目标名词对所述目标第二文本进行名词替换处理,得到目标描 述文本,并将目标描述文本发送至目标终端。Perform noun replacement processing on the target second text according to the target noun to obtain target description text, and send the target description text to the target terminal.

第二方面,本申请还提供一种事件的描述文本预测装置,所述事件的描 述文本预测装置包括:In a second aspect, the present application also provides a description text prediction device for an event, and the event description text prediction device includes:

文本获取模块,用于从源终端获取目标事件的事件描述文本;The text acquisition module is used to acquire the event description text of the target event from the source terminal;

语义解析模块,用于对所述事件描述文本进行语义解析,得到关键动词 和关键名词;A semantic parsing module is used to perform semantic parsing on the event description text to obtain key verbs and key nouns;

第一节点匹配度确定模块,用于基于事件关系树,确定所述关键动词与 所述事件关系树中节点的第一节点匹配度,其中,所述节点用于指示第一文 本及与所述第一文本对应的第二文本,所述第一文本为原因事件描述文本, 所述第二文本为结果事件描述文本;The first node matching degree determination module is used to determine the first node matching degree between the key verb and the node in the event relationship tree based on the event relationship tree, wherein the node is used to indicate the first text and the The second text corresponding to the first text, the first text is the cause event description text, and the second text is the result event description text;

目标节点确定模块,用于根据所述第一节点匹配度,在所述事件关系树 中确定目标节点,得到所述目标节点所指示的目标第一文本及目标第二文本;The target node determination module is used to determine the target node in the event relationship tree according to the first node matching degree, and obtain the target first text and the target second text indicated by the target node;

第一关联程度确定模块,用于基于预设的名词关系数据库,确定所述目 标第一文本中名词与所述目标第二文本中名词的第一关联程度;The first degree of association determination module is used to determine the first degree of association between nouns in the target first text and nouns in the target second text based on a preset noun relation database;

目标名词确定模块,用于基于预设的语义网络,根据所述第一关联程度 和所述关键名词,确定与所述关键名词对应的目标名词,其中,所述目标名 词与所述关键名词的第二关联程度大于或等于所述第一关联程度;A target noun determination module is configured to, based on a preset semantic network, determine a target noun corresponding to the key noun according to the first degree of association and the key noun, wherein the target noun and the key noun are the same as the key noun. The second degree of association is greater than or equal to the first degree of association;

目标描述文本确定模块,用于根据所述目标名词对所述目标第二文本进 行名词替换处理,得到目标描述文本,并将目标描述文本发送至目标终端。A target description text determination module, configured to perform a noun replacement process on the target second text according to the target noun to obtain a target description text, and send the target description text to the target terminal.

第三方面,本申请还提供一种计算机设备,所述计算机设备包括处理器、 存储器、以及存储在所述存储器上并可被所述处理器执行的计算机程序,其 中所述计算机程序被所述处理器执行时,实现如上述的事件的描述文本预测 方法的步骤。In a third aspect, the present application also provides a computer device comprising a processor, a memory, and a computer program stored on the memory and executable by the processor, wherein the computer program is executed by the When executed by the processor, the steps of the method for describing the text prediction as described above are realized.

第四方面,本申请还提供一种计算机可读存储介质,所述计算机可读存 储介质上存储有计算机程序,其中所述计算机程序被处理器执行时,实现如 上述的事件的描述文本预测方法的步骤。In a fourth aspect, the present application further provides a computer-readable storage medium on which a computer program is stored, wherein when the computer program is executed by a processor, the above-mentioned method for predicting a description text of an event is implemented A step of.

本申请提供一种事件的描述文本预测方法、装置、设备及计算机可读存 储介质,方法包括从源终端获取目标事件的事件描述文本;对事件描述文本 进行语义解析,得到关键动词和关键名词;基于事件关系树,确定关键动词 与事件关系树中节点的第一节点匹配度,其中,节点用于指示第一文本及与 第一文本对应的第二文本,第一文本为原因事件描述文本,第二文本为结果 事件描述文本;根据第一节点匹配度,在事件关系树中确定目标节点,得到 目标节点所指示的目标第一文本及目标第二文本;基于预设的名词关系数据库,确定目标第一文本中名词与目标第二文本中名词的第一关联程度;基于 预设的语义网络,根据第一关联程度和关键名词,确定与关键名词对应的目 标名词,其中,目标名词与关键名词的第二关联程度大于或等于第一关联程 度;根据目标名词对目标第二文本进行名词替换处理,得到目标描述文本, 并将目标描述文本发送至目标终端。本申请通过在事件关系树中确定与目标 事件关联的目标节点,并在目标节点所包含的原因描述文本和结果描述文本 确定文本中名词的关联关系,以在对目标事件进行预测时能够保留事件之间 的关系,从而提高预测得到的事件描述文本的合理性和可参考性。The present application provides an event description text prediction method, device, device and computer-readable storage medium. The method includes acquiring an event description text of a target event from a source terminal; performing semantic analysis on the event description text to obtain key verbs and key nouns; Based on the event relationship tree, determine the first node matching degree between the key verb and the node in the event relationship tree, wherein the node is used to indicate the first text and the second text corresponding to the first text, and the first text is the cause event description text, The second text is the result event description text; according to the matching degree of the first node, the target node is determined in the event relationship tree, and the target first text and the target second text indicated by the target node are obtained; based on the preset noun relation database, determine The first degree of association between the nouns in the target first text and the nouns in the second target text; based on the preset semantic network, according to the first association degree and key nouns, determine the target nouns corresponding to the key nouns, where the target noun and the key noun are determined. The second association degree of the noun is greater than or equal to the first association degree; the target second text is subjected to noun replacement processing according to the target noun to obtain the target description text, and the target description text is sent to the target terminal. The present application determines the target node associated with the target event in the event relationship tree, and determines the association between the nouns in the text in the reason description text and the result description text contained in the target node, so that the event can be preserved when predicting the target event. Therefore, the rationality and reference of the predicted event description text can be improved.

附图说明Description of drawings

为了更清楚地说明本申请实施例技术方案,下面将对实施例描述中所需 要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本申请的一 些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下, 还可以根据这些附图获得其他的附图。In order to explain the technical solutions of the embodiments of the present application more clearly, the following briefly introduces the accompanying drawings used in the description of the embodiments. For those of ordinary skill, other drawings can also be obtained from these drawings without any creative effort.

图1为本申请实施例提供的一种事件的描述文本预测方法的流程示意图;1 is a schematic flowchart of a method for predicting a description text of an event according to an embodiment of the present application;

图2为实施本申请提供的事件的描述文本预测方法的一场景示意图;2 is a schematic diagram of a scenario for implementing the method for predicting the description text of an event provided by the present application;

图3为实施本申请提供的事件的描述文本预测方法的另一场景示意图;3 is a schematic diagram of another scenario for implementing the method for predicting the description text of an event provided by the present application;

图4为本申请实施例提供的一种事件的描述文本预测装置的示意性框图;4 is a schematic block diagram of an event description text prediction apparatus provided by an embodiment of the present application;

图5为本申请一实施例涉及的计算机设备的结构示意框图。FIG. 5 is a schematic structural block diagram of a computer device according to an embodiment of the present application.

具体实施方式Detailed ways

下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行 清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是 全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创 造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative work, all belong to the scope of protection of this application.

附图中所示的流程图仅是示例说明,不是必须包括所有的内容和操作/步 骤,也不是必须按所描述的顺序执行。例如,有的操作/步骤还可以分解、组 合或部分合并,因此实际执行的顺序有可能根据实际情况改变。The flow charts shown in the figures are illustrative only and do not necessarily include all contents and operations/steps, nor do they have to be performed in the order described. For example, some operations/steps can be decomposed, combined or partially combined, so the actual execution order may change according to the actual situation.

本申请实施例提供一种事件的描述文本预测方法、装置、计算机设备及 计算机可读存储介质。其中,该事件的描述文本预测方法可应用于终端设备 中,该终端设备可以是平板电脑、笔记本电脑、台式电脑等电子设备。也可 以应用于服务器中,该服务器可以是单独的服务器,也可以是提供云服务、 云数据库、云计算、云函数、云存储、网络服务、云通信、中间件服务、域 名服务、安全服务、内容分发网络(Content Delivery Network,CDN)、以及大 数据和人工智能平台等基础云计算服务的云服务器。Embodiments of the present application provide a description text prediction method, apparatus, computer device, and computer-readable storage medium for an event. The method for predicting the description text of the event can be applied to a terminal device, and the terminal device can be an electronic device such as a tablet computer, a notebook computer, and a desktop computer. It can also be applied to a server. The server can be a separate server, or it can provide cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, Content Delivery Network (CDN), and cloud servers for basic cloud computing services such as big data and artificial intelligence platforms.

下面结合附图,对本申请的一些实施方式作详细说明。在不冲突的情况 下,下述的实施例及实施例中的特征可以相互组合。Some embodiments of the present application will be described in detail below with reference to the accompanying drawings. The following embodiments and features of the embodiments may be combined with each other without conflict.

请参照图1,图1为本申请的实施例提供的一种事件的描述文本预测方法 的流程示意图。Please refer to FIG. 1, which is a schematic flowchart of a method for predicting a description text of an event according to an embodiment of the present application.

如图1所示,该事件的描述文本预测方法包括步骤S101至步骤S107。As shown in FIG. 1 , the method for predicting the description text of the event includes steps S101 to S107 .

步骤S101、从源终端获取目标事件的事件描述文本。Step S101 , acquiring the event description text of the target event from the source terminal.

示例性的,如图2所示,在终端中,可以响应于用户的输入操作,生成 目标事件的描述文本,以使服务器或进行文本预测的终端可以从源终端中获 取目标事件的描述文本。并在服务器或进行文本预测的终端预测得到目标描 述文本后,将目标描述文本发送至目标终端。Exemplarily, as shown in FIG. 2 , in the terminal, the description text of the target event can be generated in response to the user's input operation, so that the server or the terminal performing text prediction can obtain the description text of the target event from the source terminal. And after the server or the terminal that performs text prediction predicts and obtains the target description text, the target description text is sent to the target terminal.

示例性的,目标事件可以是某一灾害事件或会导致另一事件发生的原因 事件,描述文本可以用于描述这一事件,可以理解的,在描述文本中包括多 个。可以理解的,目标事件的描述文本包括但不限于中文或英文。Exemplarily, the target event may be a certain disaster event or a causal event that will cause another event to occur, and the description text may be used to describe this event. It can be understood that the description text includes multiple events. It can be understood that the description text of the target event includes but is not limited to Chinese or English.

示例性的,目标事件的描述文本可以由语音转化而得到,具体的,获取 用户用于描述目标事件的描述语音,通过训练好的文本转化模型,将描述语 音转化为文本,从而得到目标事件的描述文本。可以理解的,可以在源终端 中对语音转化为文本,以使服务器或进行文本预测的终端从源终端获取到目 标事件的描述文本。Exemplarily, the description text of the target event can be obtained by voice conversion. Specifically, the description voice used by the user to describe the target event is obtained, and the text conversion model is trained to convert the description voice into text, so as to obtain the description voice of the target event. Description text. It can be understood that the speech can be converted into text in the source terminal, so that the server or the terminal performing text prediction can obtain the description text of the target event from the source terminal.

可以理解的,目标事件的描述文本中的词包括多种词性,可以例如是, 名词、动词、介词,具体的,目标事件的描述文本可以例如是A国家发生地 震,在该目标事件的描述文本中,A国家为名词,发生地震为动词。并能够 通过对“A国家发生地震”这一目标事件的描述文本进行预测,以预测得到 将会发生的灾害事件或其他受这次地震影响的事件。可以理解的,前述目标 事件的描述文本仅为举例说明,并不对目标事件的描述文本予以限定。It can be understood that the words in the description text of the target event include various parts of speech, which may be, for example, nouns, verbs, and prepositions. Specifically, the description text of the target event may be, for example, that an earthquake occurs in country A, and the description text of the target event Among them, country A is a noun and an earthquake is a verb. And it can predict the disaster events or other events that will be affected by this earthquake by predicting the description text of the target event "A country has an earthquake". It can be understood that the foregoing description text of the target event is only an example, and does not limit the description text of the target event.

步骤S102、对所述事件描述文本进行语义解析,得到关键动词和关键名 词。Step S102: Perform semantic analysis on the event description text to obtain key verbs and key nouns.

示例性的,可以将事件描述文本输入至语义解析模型中,以使语义解析 模型对目标事件的描述文本进行语义解析,得到多个关键词,并从确定各个 关键词的词性,以得到关键动词和关键名词。Exemplarily, the event description text may be input into the semantic parsing model, so that the semantic parsing model performs semantic parsing on the description text of the target event to obtain multiple keywords, and determines the part of speech of each keyword to obtain key verbs. and key nouns.

例如,在语义解析模型中,通过语义解析模型的分词子模型对目标事件 的描述文本进行分词处理,得到至少两个关键词;以及通过语义解析模型的 词性确定子模型确定各关键词的词性,得到关键动词和关键名词。For example, in the semantic parsing model, word segmentation is performed on the description text of the target event by the word segmentation sub-model of the semantic parsing model to obtain at least two keywords; and the part of speech of each keyword is determined by the part of speech determination sub-model of the semantic parsing model, Get key verbs and key nouns.

示例性的,在词性确定子模型中,可以通过预设语法模板,确定每一个 关键词的词性,具体的,在预设语法模板中,可以包括各词之间的上下文关 系,从而在预设语法模板与具有语序的关键词匹配中,能够确定各个关键词 的词性。Exemplarily, in the part-of-speech determination sub-model, the part-of-speech of each keyword can be determined by using a preset grammar template. The part-of-speech of each keyword can be determined in the matching between the grammar template and the keyword with word order.

示例性的,预设语法模板可以是关注动词的语法模板,具体的,动词可 以通过VevbNet(动词网络)词汇表来识别,不同的动词对应不同的预设语法 模板,可以理解的,在VevbNet(动词网络)词汇表识别到描述文本中的动词 后,通过对应的预设语法模板识别描述文本中余下的关键词对应的词性。例 如,在某一个动词语法模板中,位于动词前一位词的词性为名词,位于动词 后一位词的词性为程度副词,则可以确定与该动词语法模板匹配的句子中, 位于关键动词前一位词为关键名词,位于关键动词后一位词为程度副词。Exemplarily, the preset grammar template may be a grammar template that focuses on verbs. Specifically, verbs can be identified through a VevbNet (verb network) vocabulary, and different verbs correspond to different preset grammar templates. It can be understood that in VevbNet ( After the verbs in the description text are identified by the verb network) vocabulary, the parts of speech corresponding to the remaining keywords in the description text are identified through the corresponding preset grammar templates. For example, in a verb grammar template, the part of speech of the word before the verb is a noun, and the part of speech of the word after the verb is an adverb of degree, then it can be determined that in the sentence matching the verb grammar template, before the key verb A word is a key noun, and a word after a key verb is an adverb of degree.

通过动词语法模板对目标事件的描述文本进行匹配,可以提高识别关键 动词和关键名词的准确度。Matching the description text of the target event through the verb grammar template can improve the accuracy of identifying key verbs and key nouns.

步骤S103、基于事件关系树,确定所述关键动词与所述事件关系树中节 点的第一节点匹配度,其中,所述节点用于指示第一文本及与所述第一文本 对应的第二文本,所述第一文本为原因事件描述文本,所述第二文本为结果 事件描述文本。Step S103, based on the event relationship tree, determine the first node matching degree between the key verb and the node in the event relationship tree, wherein the node is used to indicate the first text and the second corresponding to the first text. text, the first text is the cause event description text, and the second text is the result event description text.

示例性的,事件关系树可以为树状结构,可以理解的,事件关系树包括 一个根节点,以及多个根节点的子节点,其中,多个根节点的子节点存在相 同的层级关系,每一个节点可以用于指示一个因果事件对的描述文本。因果 事件对的描述文本包括用于描述原因事件的第一文本以及用于描述与原因事 件对应的结果事件的第二文本,例如第一文本为:B国家发生地震,第二文 本为:C地区(B国家的首都)受灾。Exemplarily, the event relationship tree may have a tree-like structure. It can be understood that the event relationship tree includes a root node and multiple child nodes of the root node, wherein the child nodes of multiple root nodes have the same hierarchical relationship, and each A node can be used to indicate the description text of a causal event pair. The description text of the causal event pair includes a first text for describing a causal event and a second text for describing a resultant event corresponding to the causal event, for example, the first text is: an earthquake occurs in country B, and the second text is: region C (the capital of country B) was devastated.

示例性的,可以通过关键动词与事件关系树中节点所指示的第一文本中 的动词进行匹配,以得到关键动词与事件关系树的节点的第一节点匹配度。 并通过第一节点匹配度,在事件关系树中确定与目标事件描述文本匹配的第 一文本。Exemplarily, the key verb may be matched with the verb in the first text indicated by the node in the event relationship tree, so as to obtain the first node matching degree between the key verb and the node of the event relationship tree. And through the first node matching degree, the first text matching the description text of the target event is determined in the event relation tree.

例如,将第一节点匹配度最高的节点中的第一文本确定为与目标事件的 描述文本匹配的第一文本。For example, the first text in the node with the highest matching degree of the first node is determined as the first text matching the description text of the target event.

在一些实施例中,基于事件关系树,确定关键动词与事件关系树中节点 的第一匹配度,包括:获取事件关系树的各个节点对应的第一文本中的动词; 基于预设的余弦相似性算法,对关键动词和第一文本中的动词进行相似度计 算,得到关键动词与各个第一文本的相似度,并将相似度作为关键词和节点 的第一节点匹配度。In some embodiments, determining the first degree of matching between key verbs and nodes in the event relationship tree based on the event relationship tree includes: acquiring verbs in the first text corresponding to each node of the event relationship tree; based on a preset cosine similarity A gender algorithm is used to calculate the similarity between the key verb and the verb in the first text, to obtain the similarity between the key verb and each first text, and use the similarity as the matching degree of the first node between the keyword and the node.

示例性的,遍历事件关系树的节点,并获取各个节点所指示的第一文本 中的动词,通过获取到的第一文本的动词与关键动词进行相似性计算,得到 关键动词与第一文本的动词的相似度,以确定关键动词与事件关系树各个节 点的第一节点匹配度。Exemplarily, traverse the nodes of the event relationship tree, obtain the verbs in the first text indicated by each node, and perform similarity calculation between the obtained verbs of the first text and the key verbs to obtain the relationship between the key verbs and the first text. The similarity of verbs is used to determine the degree of matching between the key verb and each node of the event relation tree.

示例性的,基于预设的余弦相似性算法,对关键动词和第一文本中的动 词进行相似度计算可以例如是,对关键动词进行向量化处理,得到关键动词 向量,以及对第一文本中的动词进行向量化处理,得到第一文本动词向量, 并根据以下式子计算关键动词向量和第一文本动词向量的相似度:Exemplarily, based on a preset cosine similarity algorithm, calculating the similarity between the key verb and the verb in the first text may be, for example, performing vectorization processing on the key verb to obtain a key verb vector, and calculating the similarity between the key verb and the verb in the first text. The verbs of are vectorized to obtain the first text verb vector, and the similarity between the key verb vector and the first text verb vector is calculated according to the following formula:

Figure BDA0003486422830000071
Figure BDA0003486422830000071

其中,Ai用于指示关键动词向量,Bi用于指示第一文本动词向量,i为向 量中位于第i个位置的向量元,n为向量中的向量元个数,cosθ用于指示相 似度。Among them, A i is used to indicate the key verb vector, B i is used to indicate the first text verb vector, i is the vector element at the ith position in the vector, n is the number of vector elements in the vector, and cosθ is used to indicate the similarity Spend.

通过上述预设余弦相似性算法,可以得到关键动词与各个节点所指示的 第一文本中的动词的相似度,从而确定关键动词与事件关系树的各个节点的 第一匹配度。Through the above preset cosine similarity algorithm, the similarity between the key verb and the verb in the first text indicated by each node can be obtained, so as to determine the first matching degree between the key verb and each node of the event relationship tree.

步骤S104、根据所述第一节点匹配度,在所述事件关系树中确定目标节 点,得到所述目标节点中的目标第一文本及目标第二文本。Step S104, according to the matching degree of the first node, determine the target node in the event relationship tree, and obtain the target first text and the target second text in the target node.

示例性的,计算得到关键词与各个节点的第一匹配度后,根据第一匹配 度在所述事件关系树中确定关键动词对应的目标节点,以得到目标节点所指 示的目标第一文本和目标第二文本。Exemplarily, after calculating the first matching degree between the keyword and each node, the target node corresponding to the key verb is determined in the event relationship tree according to the first matching degree, so as to obtain the target first text and the target first text indicated by the target node. Target second text.

可以理解的,将第一匹配度最高的节点作为关键动词的目标节点。Understandably, the node with the highest first matching degree is used as the target node of the key verb.

示例性的,若关键动词与多个节点所指示的第一文本中的动词的相似度 相同,则通过预设的embbeding网络,确定节点所指示的原因事件与结果事 件的关联强度,具体的,关联强度可以用于指示原因事件发生后,结果事件 发生的概率,若原因事件发生后,结果事件发生的概率为1,确定该节点的权 重值为1;若原因事件发生后,结果事件发生的概率为50%,确定该节点的权 重值为50%,以在动词相似度相同时仍能够确定目标节点。可以理解的,发 生的概率可以根据历史发生的原因事件以及历史发生的结果事件确定。Exemplarily, if the similarity between the key verb and the verb in the first text indicated by the multiple nodes is the same, then through the preset embedding network, determine the correlation strength between the cause event and the result event indicated by the node, specifically, The correlation strength can be used to indicate the probability of the occurrence of the consequential event after the occurrence of the causal event. If the probability of the occurrence of the consequential event after the occurrence of the causal event is 1, the weight of the node is determined to be 1; The probability is 50%, and the weight value of the node is determined to be 50%, so that the target node can still be determined when the verb similarity is the same. Understandably, the probability of occurrence can be determined according to historically occurring causal events and historically occurring resultant events.

通过原因事件和结果事件的关联强度确定第一节点匹配度的权重值。将 关键动词与节点所指示第一文本中的动词的相似度与对应的权重值相乘,得 到第一节点匹配度,以确定目标节点。The weight value of the matching degree of the first node is determined by the correlation strength of the cause event and the result event. The similarity between the key verb and the verb in the first text indicated by the node is multiplied by the corresponding weight value to obtain the first node matching degree to determine the target node.

在一些实施例中,事件关系树至少包括两个层级,所述根据第一节点匹 配度,在事件关系树中确定目标节点,包括:确定关键动词与事件关系树第N 层的各个节点的第一节点匹配度,其中,N为大于0的自然数且N不大于事 件关系树的总层数;将第一节点匹配度大于节点匹配阈值的节点确定为待计 算节点;当N小于所述事件关系树的总层数时,确定所述关键动词与所述待 计算节点的子节点的第二节点匹配度;若所述待计算节点的子节点的第二匹 配度小于所述待计算节点的第一匹配度,将所述待计算节点确定为目标节点。In some embodiments, the event relationship tree includes at least two levels, and determining the target node in the event relationship tree according to the first node matching degree includes: determining the key verb and each node of the Nth level of the event relationship tree. A node matching degree, where N is a natural number greater than 0 and N is not greater than the total number of layers of the event relationship tree; the node whose first node matching degree is greater than the node matching threshold is determined as the node to be calculated; when N is less than the event relationship When the total number of layers of the tree, determine the degree of matching between the key verb and the second node of the child node of the node to be calculated; if the second degree of matching of the child node of the node to be calculated is smaller than the first As a matching degree, the node to be calculated is determined as the target node.

示例性的,事件关系树为树状结构,至少包括两个层数,且除事件关系 树的根节点所处的层之外,其余层中包括至少两个节点,可以理解的,事件 关系树中除根节点外的节点均是根节点的子节点。Exemplarily, the event relationship tree is a tree structure, including at least two layers, and except for the layer where the root node of the event relationship tree is located, the other layers include at least two nodes. It can be understood that the event relationship tree All nodes except the root node are child nodes of the root node.

示例性的,根节点位于第一层,根节点的子节点为第一子节点且位于第 二层,第一子节点的子节点为第二子节点且位于第三层,以此类推构成事件 关系树,其中,事件关系树的总层数为M。Exemplarily, the root node is located at the first layer, the child nodes of the root node are the first child node and are located at the second layer, the child nodes of the first child node are the second child node and are located at the third layer, and so on to constitute an event. A relational tree, wherein the total number of layers of the event relational tree is M.

示例性的,关键动词可以从事件关系树的第N层开始进行相似度的计算, 也可以从事件关系树的根节点开始进行相似度的计算。可以理解的,当关键 动词从事件关系树的第N层开始进行相似度的计算时,得到关键动词与事件 关系树的第N层中各个节点的第一节点匹配度,并将各个节点的第一节点匹 配度与预设的节点匹配阈值进行对比,将第一节点匹配度大于预设的节点匹 配阈值的节点作为待计算节点,并对待计算节点的子节点进行匹配度的计算。Exemplarily, the key verbs can be calculated from the Nth level of the event relationship tree, and the similarity can also be calculated from the root node of the event relationship tree. It is understandable that when the similarity calculation of the key verb starts from the Nth layer of the event relationship tree, the matching degree of the key verb and the first node of each node in the Nth layer of the event relationship tree is obtained, and the first node matching degree of each node is obtained. A node matching degree is compared with a preset node matching threshold, and a node whose first node matching degree is greater than the preset node matching threshold is regarded as the node to be calculated, and the matching degree is calculated for the child nodes of the node to be calculated.

可以理解的,当N小于M时,对待计算节点的子节点进行匹配度的计算, 其中,待计算节点的子节点位于N+1层。当N等于M时,待计算节点没有对 应的子节点,将待计算节点确定为目标节点。可以理解的,若待计算节点没 有子节点,且至少两个待计算节点的第一节点匹配度相同,可以通过上述的 通过节点所指示的原因事件与结果事件的关联强度计算权重值,以在待计算 节点中确定目标节点。It can be understood that when N is less than M, the calculation of the matching degree is performed on the child nodes of the node to be calculated, wherein the child nodes of the node to be calculated are located at layer N+1. When N is equal to M, the node to be calculated has no corresponding child node, and the node to be calculated is determined as the target node. It can be understood that if the node to be calculated has no child nodes, and the first nodes of at least two nodes to be calculated have the same degree of matching, the weight value can be calculated by the above-mentioned correlation strength between the cause event and the result event indicated by the node to be used in the calculation. Determine the target node among the nodes to be calculated.

示例性的,若关键动词与待计算节点子节点的第二匹配度小于第一匹配 度,根据待计算节点确定目标节点,例如,确定第一匹配度最高的待计算节 点,并确定为目标节点。Exemplarily, if the second degree of matching between the key verb and the child node of the node to be calculated is less than the first degree of matching, the target node is determined according to the node to be calculated, for example, the node to be calculated with the highest first degree of matching is determined, and is determined as the target node. .

若所述待计算节点的子节点的第二匹配度大于所述待计算节点的第一匹 配度,将N加1。If the second matching degree of the child nodes of the node to be calculated is greater than the first matching degree of the node to be calculated, add 1 to N.

示例性的,若待计算节点的子节点的第二匹配度大于第一匹配度,将N 加1,以使关键动词继续与事件关系树中的节点进行匹配度的计算,直到N=M 或待计算节点的子节点的第二匹配度小于第一匹配度,通过上述步骤确定目 标节点结束,在此不再撰述。Exemplarily, if the second matching degree of the child node of the node to be calculated is greater than the first matching degree, add 1 to N, so that the key verb continues to calculate the matching degree with the node in the event relation tree until N=M or If the second matching degree of the child nodes of the node to be calculated is smaller than the first matching degree, it is determined that the target node ends through the above steps, which will not be described here.

在一些实施方式中,关键动词在N+1层中,通过关键动词与待计算的子 节点计算匹配度,也即是,在事件关系树的N+1层中除了待计算的子节点, 其余节点均不进行计算,直到计算到事件关系树的M层或待计算的子节点的 第二匹配度小于第一匹配度时,通过上述步骤确定目标节点,停止计算。In some embodiments, the key verb is in the N+1 layer, and the matching degree is calculated by the key verb and the child node to be calculated, that is, in the N+1 layer of the event relationship tree, except for the child node to be calculated, the rest No node is calculated until the second matching degree is calculated to the M level of the event relationship tree or the child node to be calculated is smaller than the first matching degree, the target node is determined through the above steps, and the calculation is stopped.

在另一些实施方式中,将关键动词与N+1层中的所有节点进行匹配度的 计算,并确定是否存在节点对应的第三匹配度大于待计算节点的子节点的第 二匹配度;若不存在且N+1小于M,计算关键动词与待计算节点的子节点的 匹配度;若存在,将第三匹配度大于第二匹配度的节点确定为待计算子节点, 并计算待计算子节点的父节点对应的第四匹配度以及子节点的第六匹配度, 具体步骤如上所述,在此不再撰述。In some other implementations, the key verbs and all the nodes in the N+1 layer are used to calculate the matching degree, and it is determined whether there is a third matching degree corresponding to the node that is greater than the second matching degree of the child nodes of the node to be calculated; if If it does not exist and N+1 is less than M, calculate the matching degree between the key verb and the child nodes of the node to be calculated; if it exists, determine the node whose third matching degree is greater than the second matching degree as the child node to be calculated, and calculate the child node to be calculated. The specific steps of the fourth matching degree corresponding to the parent node of the node and the sixth matching degree of the child node are as described above, and will not be described here.

通过匹配度确定目标节点,可以提高目标节点确定的准确性。By determining the target node by the matching degree, the accuracy of determining the target node can be improved.

步骤S105、基于预设的名词关系数据库,确定所述目标第一文本中名词 与所述目标第二文本中名词的第一关联程度。Step S105: Determine the first degree of association between the nouns in the target first text and the nouns in the target second text based on a preset noun relation database.

示例性的,确定目标节点之后,根据目标节点所指示的第一文本和第二 文本,并基于名词关系数据库,确定目标节点所指示的第一文本中的第一名 词和第二文本中的第二名词的第一关联程度,可以理解的,关联程度可以通 过关联信息来表征,包括但不限于地理位置的关联信息,人物关联信息,物 品之间的关联信息,例如,用于指示父子关联信息的名词关联程度大于用于 指示叔侄关联信息的名词关联程度,可以理解的,在实际应用中,可以根据 需求设定名词之间的关联信息对应的关联程度,本申请在此不予限定。Exemplarily, after the target node is determined, according to the first text and the second text indicated by the target node, and based on the noun relation database, the first noun in the first text indicated by the target node and the first noun in the second text are determined. The first degree of association between two nouns, it can be understood that the degree of association can be characterized by association information, including but not limited to the association information of geographic locations, person association information, and association information between items, for example, used to indicate parent-child association information The noun association degree is greater than the noun association degree used to indicate uncle and nephew association information. It can be understood that in practical applications, the association degree corresponding to the association information between nouns can be set according to requirements, which is not limited in this application.

在一些实施例中,基于预设的名词关系数据库,确定所述目标第一文本 中名词与所述目标第二文本中名词的第一关联程度,包括:获取所述目标第 一文本中的第一名词,以及获取所述目标第二文本中的第二名词;根据所述 第一名词,在所述名词关系数据库中确定多个待选名词三元组,其中,所述 待选名词三元组包含与所述第一名词相同的名词;确定所述待选名词三元组 中是否存在所述第二名词;从存在所述第二名词的待选名词三元组中确定所 述第一关联程度。In some embodiments, determining the first degree of association between the nouns in the target first text and the nouns in the target second text based on a preset noun relation database includes: obtaining the first degree of association between the nouns in the target first text a noun, and obtain a second noun in the target second text; according to the first noun, determine multiple noun triples to be selected in the noun relational database, wherein the noun triples to be selected are group contains the same noun as the first noun; determine whether the second noun exists in the candidate noun triplet; determine the first noun from the candidate noun triplet in which the second noun exists degree of association.

示例性的,名词关系库包括多个名词三元组(v1,v2,l),其中,v1用于指示 名词,v2用于指示与v1存在某种关联的名词,l用于指示v1与v2的关联信息, 例如v1为A国家,v2为B地区,l为国家首都。Exemplarily, the noun relation library includes multiple noun triples (v 1 , v 2 , l), where v 1 is used to indicate a noun, v 2 is used to indicate a noun that is related to v 1 , and l is used to indicate a noun. It is used to indicate the association information of v 1 and v 2 , for example, v 1 is the country of A, v 2 is the region of B, and l is the capital of the country.

示例性的,从目标节点所指示的第一文本中获取第一名词,以及从同一 目标节点所指示的第二文本中获取第二名词,并在名词关系数据库中查找与 第一名词、第二名词相同的名词三元组,并基于名词三元组中的关联信息确 定第一名词和第二名词之间的第一关联程度。Exemplarily, the first noun is obtained from the first text indicated by the target node, and the second noun is obtained from the second text indicated by the same target node, and the noun relation database is searched for the relationship between the first noun and the second noun. Noun triples with the same noun, and the first degree of association between the first noun and the second noun is determined based on association information in the noun triple.

例如,通过第一名词在名词关系数据库中确定若干待选三元组,可以理 解的,待选三元组中的其中一个名词与第一名词相同,由于一个名词可以与 多个名词存在不同的关联,因而通过第二名词从多个待选三元组中确定目标 三元组,将存在与第一名词以及第二名词相同的名词的三元组确定为目标三 元组。并在目标三元组中获取第一名词与第二名词的第一关联信息,并基于 预设的关联信息与关联程度的映射关系,确定第一名词与第二名词的第一关 联程度。For example, a number of triples to be selected are determined in the noun relational database by the first noun. It is understandable that one of the nouns in the triplet to be selected is the same as the first noun, because one noun may have different names from multiple nouns. Therefore, the target triplet is determined from the plurality of candidate triples by the second noun, and the triplet with the same noun as the first noun and the second noun is determined as the target triplet. And obtain the first association information of the first noun and the second noun in the target triplet, and determine the first association degree of the first noun and the second noun based on the mapping relationship between the preset association information and the association degree.

示例性的,可以通过名词关系数据库中的名词三元组的关联信息确定名 词之间的关联程度,以提高目标名词确定的准确性,从而提升预测得到的目 标描述文本的合理性。Exemplarily, the degree of association between nouns can be determined by the association information of noun triples in the noun relational database, so as to improve the accuracy of target noun determination, thereby improving the rationality of the predicted target description text.

步骤S106、基于预设的语义网络,根据所述第一关联程度和所述关键名 词,确定与所述关键名词对应的目标名词,其中,所述目标名词与所述关键 名词的第二关联程度大于或等于所述第一关联程度。Step S106 , based on the preset semantic network, according to the first degree of association and the key noun, determine the target noun corresponding to the key noun, wherein the second degree of association between the target noun and the key noun greater than or equal to the first degree of association.

示例性的,预设的语义网络可以例如是开源的Wordnet,通过关键名词以 及与第一关联程度,可以确定与该关键名词对应的目标名词,其中,关键名 词与目标名词的第二关联程度大于第一关联程度,例如,第一关联信息为国 家的首都,可以确定第一关联程度为五级,国家的重要城市的关联程度为四 级,因而,第二关联程度需要大于或等于第一关联程度,也即是第二关联程 度对应的第二关联信息也是用于指示国家的首都,而不可以为用于指示国家 的重要城市的关联信息。Exemplarily, the preset semantic network can be, for example, the open source Wordnet, and the target noun corresponding to the key noun can be determined by the key noun and the first degree of association, wherein the second degree of association between the key noun and the target noun is greater than The first degree of association, for example, the first association information is the capital of the country, it can be determined that the first association degree is level 5, and the association degree of important cities of the country is level 4, therefore, the second association degree needs to be greater than or equal to the first association degree. The degree, that is, the second association information corresponding to the second association degree is also used to indicate the capital of the country, and may not be the association information used to indicate the important city of the country.

例如,关键名词为C国家,第一关联信息是国家首都,则目标名词应当 是C国家的首都D地区,可以理解的,关键名词也可以是其他名词,例如指 示家庭关系的名词父亲,第一、第二关联信息也可以是其他关系,如家庭关 系,在此并不对关键名词、第一、第二关联信息以及目标名词予以限定。For example, if the key noun is country C and the first related information is the capital of the country, the target noun should be the capital D region of country C. It is understandable that the key noun can also be other nouns, such as the noun indicating family relationship father, the first , and the second related information can also be other relationships, such as family relationships, and the key nouns, the first and second related information, and the target noun are not limited here.

步骤S107、根据所述目标名词对所述目标第二文本进行名词替换处理, 得到目标描述文本,并将目标描述文本发送至目标终端。Step S107: Perform noun replacement processing on the target second text according to the target noun to obtain a target description text, and send the target description text to the target terminal.

示例性的,确定目标名词之后,对目标节点所指示的第二文本中的名词 进行替换,以得到目标描述文本,其中,目标描述文本用于描述与目标事件 对应的结果事件。并将目标描述文本发送至目标终端。Exemplarily, after the target noun is determined, the noun in the second text indicated by the target node is replaced to obtain the target description text, wherein the target description text is used to describe the result event corresponding to the target event. And send the target description text to the target terminal.

例如,目标事件为C国家地震,而与目标事件匹配的目标节点所指示第 一文本为A国家地震,第二文本为B地区(A国家的首都)受灾;通过语义 网络确定目标名词为C国家的首都D地区;获取目标节点所指示的第二文本: B地区受灾;并将第二文本中的名词替换为目标名词,得到目标描述文本:D 地区受灾;从而完成目标事件对应的结果事件的预测。并将得到的目标描述 文本发送至目标终端,以使对应的人员能够获知预测得到的目标描述文本, 以获知对应的信息,从而设定相应的预防方针或执行相应的应对方针。For example, the target event is the earthquake in country C, and the first text indicated by the target node matching the target event is the earthquake in the country A, and the second text is the disaster in the region B (the capital of the country A); the target noun is determined as the country C through the semantic network. The capital D area of is obtained; obtain the second text indicated by the target node: area B is affected by disaster; replace the noun in the second text with the target noun, and get the target description text: area D is affected by disaster; thus complete the result event corresponding to the target event. predict. The obtained target description text is sent to the target terminal, so that the corresponding personnel can know the predicted target description text, so as to obtain the corresponding information, so as to set the corresponding preventive policy or execute the corresponding response policy.

在一些实施方式中,目标描述文本还可以存储于区块链中,以使在目标 终端设备需要获取目标描述文本时,能够通过向区块链进行广播以获取目标 描述文本。本申请所指区块链是分布式数据存储、点对点传输、共识机制、 加密算法等计算机技术的新型应用模式。区块链(Blockchain),本质上是一个 去中心化的数据库,是一串使用密码学方法相关联产生的数据块,每一个数 据块中包含了一批次网络交易的信息,用于验证其信息的有效性(防伪)和生成 下一个区块。区块链可以包括区块链底层平台、平台产品服务层以及应用服 务层等。In some embodiments, the target description text can also be stored in the blockchain, so that when the target terminal device needs to obtain the target description text, it can obtain the target description text by broadcasting to the blockchain. The blockchain referred to in this application is a new application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, and encryption algorithm. Blockchain, essentially a decentralized database, is a series of data blocks associated with cryptographic methods. Each data block contains a batch of network transaction information to verify its Validity of information (anti-counterfeiting) and generation of the next block. The blockchain can include the underlying platform of the blockchain, the platform product service layer, and the application service layer.

在一些实施例中,在所述基于事件关系树,确定所述关键动词与所述事 件关系树中节点的第一节点匹配度之前,还包括:获取样本事件对的描述文 本数据集,其中,所述样本事件对包括样本第一文本及与样本第一文本对应 的样本第二文本,所述样本第一文本为样本原因事件描述文本,所述样本第 二文本为样本结果事件描述文本;根据样本事件对所包含的所述样本第一文 本以及所述样本第二文本,对多个所述样本事件对进行聚类,得到所述事件 关系树。In some embodiments, before the determining the degree of matching between the key verb and the first node of the nodes in the event relationship tree based on the event relationship tree, the method further includes: acquiring a description text data set of sample event pairs, wherein, The sample event pair includes sample first text and sample second text corresponding to the sample first text, the sample first text is the sample cause event description text, and the sample second text is the sample result event description text; according to The sample first text and the sample second text included in the sample event pair are clustered on a plurality of the sample event pairs to obtain the event relationship tree.

示例性的,建立事件关系树,以通过目标事件描述文本的关键动词能够 在事件关系树中确定与目标事件描述文本匹配的第一文本,具体的,可以通 过样本事件对的描述文本数据集,建立事件关系树。可以理解的,样本事件 对的描述文本数据集包括多个因果关系事件对的描述文本,其中,因果关系 事件对包括样本第一文本和样本第二文本,样本第一文本为样本原因事件描 述文本,样本第二文本为样本原因事件对应的结果事件的样本结果事件描述 文本。Exemplarily, an event relationship tree is established, so that the first text matching the target event description text can be determined in the event relationship tree through the key verbs of the target event description text. Specifically, the description text data set of the sample event pair can be used, Build an event relationship tree. It can be understood that the description text dataset of sample event pairs includes description texts of multiple causal event pairs, wherein the causal event pairs include sample first text and sample second text, and the sample first text is the sample causal event description text. , the second sample text is the sample result event description text of the result event corresponding to the sample cause event.

示例性的,对多个事件对进行聚类,以得到事件关系树中的节点,从而 得到事件关系树。可以理解的,每一个聚类可以视为一个节点,聚类之前的 事件对也可视为一个节点,从而能够得到多个节点,并通过多个节点构建得 到事件关系树。Exemplarily, a plurality of event pairs are clustered to obtain nodes in an event relationship tree, thereby obtaining an event relationship tree. It can be understood that each cluster can be regarded as a node, and the event pair before the clustering can also be regarded as a node, so that multiple nodes can be obtained, and an event relationship tree can be obtained through the construction of multiple nodes.

可以理解的,建立好的事件关键树也可以存储于区块链中。Understandably, the established event key tree can also be stored in the blockchain.

在一些实施例中,所述根据样本事件对所包含的所述样本第一文本以及 所述样本第二文本,对多个所述样本事件对进行聚类,得到所述事件关系树, 包括:对所述样本第一文本进行向量化处理,得到第一样本文本向量,以及 对所述样本第二文本进行向量化处理,得到第二样本文本向量;基于预设向 量距离计算公式,根据各所述样本事件对对应的第一样本文本向量和第二样 本文本向量,确定各所述样本事件对之间的向量距离;根据各所述样本事件 对之间的向量距离,将各所述样本事件对分类至多个事件对第一聚类中,其中,每个所述事件对第一聚类至少包括两个样本事件对;计算各所述事件对 第一聚类之间的向量距离,并根据各所述事件对第一聚类之间的向量距离, 将各所述对第一聚类分类至多个事件对第二聚类中,其中,每个所述事件对 第二聚类至少包括两个所述事件对第一聚类;根据各所述事件对第一聚类和 各所述事件对第二聚类,确定所述事件关系树。In some embodiments, according to the sample first text and the sample second text included in the sample event pair, the plurality of sample event pairs are clustered to obtain the event relationship tree, including: Perform vectorization processing on the sample first text to obtain a first sample text vector, and perform vectorization processing on the sample second text to obtain a second sample text vector; based on the preset vector distance calculation formula, according to each The first sample text vector and the second sample text vector corresponding to the sample event pairs, determine the vector distance between the sample event pairs; The sample event pairs are classified into multiple first clusters of event pairs, wherein each of the first clusters of event pairs includes at least two sample event pairs; the vector distance between each of the first clusters of the event pairs is calculated, and according to the vector distance between the first clusters of the event pairs, classifying the first clusters of the pairs into a plurality of second clusters of the event pairs, wherein each of the second clusters of the event pairs at least Two first clusters of the event pairs are included; the event relationship tree is determined according to each of the first clusters of the event pairs and each of the second clusters of the event pairs.

示例性的,对每一个样本事件对中的样本第一文本以及样本第二文本进 行向量化处理,得到对应的样本第一文本向量和样本第二文本向量,并基于 预设向量距离计算公式,对不同的样本事件对的样本第一文本向量和样本第 二文本向量进行向量距离的计算,可以理解的,不同样本事件对对应的样本 第一文本向量之间的距离以及样本第二文本向量之间的距离之和可以表征不 同样本事件对之间的向量距离,如下式所示:Exemplarily, performing vectorization processing on the sample first text and the sample second text in each sample event pair to obtain the corresponding sample first text vector and sample second text vector, and based on the preset vector distance calculation formula, Calculate the vector distance between the sample first text vector and the sample second text vector of different sample event pairs. It is understandable that the distance between the sample first text vector corresponding to different sample event pairs and the difference between the sample second text vector The sum of the distances can represent the vector distance between different sample event pairs, as shown in the following formula:

SIM(<ci,ei>,<cj,ej>)=SIM(ci,cj)+SIM(ei,ej)SIM(<c i ,e i >,<c j ,e j >)=SIM(c i ,c j )+SIM(e i ,e j )

其中,SIM用于指示向量距离,ci表示第i个样本事件对的样本第一文本 向量,ei表示第i个样本事件对的样本第二文本向量;cj表示第j个样本事件 对的样本第一文本向量,ej表示第j个样本事件对的样本第二文本向量。Among them, SIM is used to indicate the vector distance, c i represents the sample first text vector of the ith sample event pair, e i represents the sample second text vector of the ith sample event pair; c j represents the j th sample event pair The sample first text vector of , e j represents the sample second text vector of the jth sample event pair.

可以理解的,计算得到不同样本事件对之间的向量距离后,可以通过不 同样本事件对之间的向量距离,对多个样本事件对进行分类处理,如图3所 示,得到多个第一聚类;以及计算多个第一聚类之间的向量距离,对多个第 一聚类进行分类处理,以得到多个第二聚类,并依次类推,以建立事件关系 树。It can be understood that after calculating the vector distances between different sample event pairs, multiple sample event pairs can be classified and processed through the vector distances between different sample event pairs, as shown in Figure 3, to obtain a plurality of first clustering; and calculating the vector distance between the plurality of first clusters, and classifying the plurality of first clusters to obtain a plurality of second clusters, and by analogy, to establish an event relationship tree.

在一些实施例中,所述根据各所述样本事件对之间的向量距离,将各所 述样本事件对分类至多个事件对第一聚类中,包括:确定第一样本事件对, 以及将在所述本事件对的描述文本数据集中除所述第一样本事件对之外的样 本事件对依次作为目标样本事件对;计算所述第一样本事件对与所述目标样 本事件对的向量距离;确定与所述第一样本事件对的向量距离最小的目标样 本事件对为第二样本事件对,并将所述第一样本事件对和所述第二样本事件 对分类至同一个事件对第一聚类中。In some embodiments, classifying each of the sample event pairs into a first cluster of a plurality of event pairs according to a vector distance between each of the sample event pairs includes: determining a first sample event pair, and Taking the sample event pairs other than the first sample event pair in the descriptive text data set of the current event pair as the target sample event pair in turn; calculating the first sample event pair and the target sample event pair Determine the target sample event pair with the smallest vector distance from the first sample event pair as the second sample event pair, and classify the first sample event pair and the second sample event pair into The same event pair is in the first cluster.

示例性的,确定向量距离最小的两个样本事件对,进行聚类,得到事件 对第一聚类;具体的,设定一个样本事件对为目标样本事件对,计算其余的 样本事件对与目标样本事件对之间的向量距离,确定其余样本事件对中,与 目标样本事件对的向量距离最小的样本事件对,并将该样本事件对与目标样 本事件对进行聚类,得到事件对第一聚类;在聚类之后剩下的样本事件对中, 再次确定目标样本事件对,重复上述计算,从而得到多个事件对第一聚类。Exemplarily, two sample event pairs with the smallest vector distance are determined, and clustering is performed to obtain the first cluster of event pairs; specifically, one sample event pair is set as the target sample event pair, and the remaining sample event pairs and the target are calculated. The vector distance between the sample event pairs, determine the sample event pair with the smallest vector distance from the target sample event pair among the remaining sample event pairs, and cluster the sample event pair with the target sample event pair to obtain the first event pair. Clustering; in the remaining sample event pairs after clustering, the target sample event pair is determined again, and the above calculation is repeated to obtain a first cluster of multiple event pairs.

示例性的,将事件对第一聚类所包含的样本事件对对应的样本第一文本 向量以及样本第二文本向量进行相加,得到事件对第一聚类对应的样本第三 文本向量和样本第四文本向量,并通过事件对第一聚类对应的样本第三文本 向量和样本第四文本向量计算各个事件对第一聚类之间的向量距离,以确定 事件对第二聚类,以此计算方式类推,直到得到事件对第N聚类,能够包括 样本事件对数据集中的所有样本事件对,可以理解的,N也用于指示事件关 系树的层数。Exemplarily, the sample first text vector and the sample second text vector corresponding to the sample event included in the first cluster of the event pair are added to obtain the sample third text vector and the sample corresponding to the first cluster of the event pair. The fourth text vector, and the vector distance between the first clusters of each event pair is calculated through the sample third text vector and the sample fourth text vector corresponding to the first cluster of the event pair, so as to determine the second cluster of the event pair, with This calculation method is analogous until the Nth cluster of event pairs is obtained, which can include all sample event pairs in the sample event pair dataset. It can be understood that N is also used to indicate the number of layers of the event relationship tree.

示例性的,事件对第N聚类可以用于指示事件关系树的节点,可以理解 的,节点所指示的第一文本以及第二文本应当能够包括该节点的子节点的第 一文本以及第二文本所指示的信息,因而,得到事件对第N聚类时,需要对 第N聚类所包含的第一文本以及第二文本进行泛化处理,以确定第N聚类, 也即是节点对应的第一文本和第二文本。Exemplarily, the event pair Nth cluster can be used to indicate the node of the event relationship tree. It can be understood that the first text and the second text indicated by the node should be able to include the first text and the second text of the child nodes of the node. The information indicated by the text, therefore, when the event pair Nth cluster is obtained, it is necessary to generalize the first text and the second text contained in the Nth cluster to determine the Nth cluster, that is, the node corresponding to the first text and the second text.

具体的,可以通过基于分词模型,对样本第一文本进行分词,得到多个 关键词;基于语义泛化模型,对各关键词进行语义泛化处理,得到与每一个 关键词对应的属性概念词,其中,属性概念词用于描述关键词的属性或类别; 基于实体词数据库,对属性概念词进行实体匹配,得到与属性概念词对应的 实体词,实体词为与属性概念词的属性或类别关联的词;对每一个实体词进 行拼接,得到样本第一文本所处节点的父节点所指示的第一文本;同样的, 可以对样本第二文本进行相同的处理,以得到所处节点的父节点所指示的第二文本,从而得到事件对第N聚类对应的节点所指示的第一文本和第二文本, 并通过多个节点建立事件关系树。Specifically, based on the word segmentation model, the first text of the sample can be segmented to obtain multiple keywords; based on the semantic generalization model, the semantic generalization of each keyword can be performed to obtain the attribute concept word corresponding to each keyword. , where the attribute concept word is used to describe the attribute or category of the keyword; based on the entity word database, entity matching is performed on the attribute concept word to obtain the entity word corresponding to the attribute concept word, and the entity word is the attribute or category of the attribute concept word. associated words; splicing each entity word to obtain the first text indicated by the parent node of the node where the first text of the sample is located; similarly, the second text of the sample can be processed in the same way to obtain the The second text indicated by the parent node is obtained, thereby obtaining the first text and the second text indicated by the node corresponding to the Nth cluster of the event, and establishing an event relation tree through multiple nodes.

上述实施例提供的事件的描述文本预测方法,通过事件关系树中确定与 目标事件描述文本匹配的第一文本,以及利用该第一文本对应的第二文本、 第一文本和第二文本中名词的第一关联程度进行目标事件对应的结果事件的 目标描述文本的预测,以使事件之间存在的关系能够保留,从而提高预测得 到的目标描述文本的合理性和可参考性。The method for predicting the description text of the event provided by the above-mentioned embodiment, determines the first text matching the description text of the target event in the event relation tree, and uses the second text corresponding to the first text, the first text and the nouns in the second text. Predict the target description text of the result event corresponding to the target event, so that the existing relationship between the events can be preserved, thereby improving the rationality and reference of the predicted target description text.

请参阅图4,图4是本申请一实施例提供的一种事件的描述文本预测装置 的示意图,该事件的描述文本预测装置可以配置于服务器或终端中,用于执 行前述的事件的描述文本预测方法。Please refer to FIG. 4 . FIG. 4 is a schematic diagram of an event description text prediction device provided by an embodiment of the present application. The event description text prediction device may be configured in a server or a terminal for executing the aforementioned event description text. method of prediction.

如图4所示,该事件的描述文本预测装置100,包括:文本获取模块110、 语义解析模块120、第一节点匹配度确定模块130、目标节点确定模块140、 第一关联程度确定模块150、目标名词确定模块160、目标描述文本确定模块 170。As shown in FIG. 4, the description text prediction device 100 of the event includes: a text acquisition module 110, a semantic analysis module 120, a first node matching degree determination module 130, a target node determination module 140, a first correlation degree determination module 150, The target noun determination module 160 and the target description text determination module 170 .

文本获取模块110,用于从源终端获取目标事件的事件描述文本。The text obtaining module 110 is configured to obtain the event description text of the target event from the source terminal.

语义解析模块120,用于对所述事件描述文本进行语义解析,得到关键动 词和关键名词。The semantic parsing module 120 is configured to perform semantic parsing on the event description text to obtain key verbs and key nouns.

第一节点匹配度确定模块130,用于基于事件关系树,确定所述关键动词 与所述事件关系树中节点的第一节点匹配度,其中,所述节点用于指示第一 文本及与所述第一文本对应的第二文本,所述第一文本为原因事件描述文本, 所述第二文本为结果事件描述文本;The first node matching degree determination module 130 is configured to determine, based on the event relationship tree, the first node matching degree between the key verb and the node in the event relationship tree, wherein the node is used to indicate the first text and the second text corresponding to the first text, the first text is the cause event description text, and the second text is the result event description text;

目标节点确定模块140,用于根据所述第一节点匹配度,在所述事件关系 树中确定目标节点,得到所述目标节点所指示的目标第一文本及目标第二文 本。The target node determination module 140 is configured to determine a target node in the event relationship tree according to the matching degree of the first node, and obtain the target first text and the target second text indicated by the target node.

第一关联程度确定模块150,用于基于预设的名词关系数据库,确定所述 目标第一文本中名词与所述目标第二文本中名词的第一关联程度。The first association degree determination module 150 is configured to determine the first association degree between the nouns in the target first text and the nouns in the target second text based on a preset noun relation database.

目标名词确定模块160,用于基于预设的语义网络,根据所述第一关联程 度和所述关键名词,确定与所述关键名词对应的目标名词,其中,所述目标 名词与所述关键名词的第二关联程度大于或等于所述第一关联程度。A target noun determination module 160, configured to determine a target noun corresponding to the key noun according to the first degree of association and the key noun based on a preset semantic network, wherein the target noun and the key noun The second degree of association is greater than or equal to the first degree of association.

目标描述文本确定模块170,用于根据所述目标名词对所述目标第二文本 进行名词替换处理,得到目标描述文本,并将目标描述文本发送至目标终端。The target description text determination module 170 is configured to perform noun replacement processing on the target second text according to the target noun to obtain target description text, and send the target description text to the target terminal.

示例性的,第一节点匹配度确定模块130还包括动词获取子模块、相似 度计算子模块。Exemplarily, the first node matching degree determination module 130 further includes a verb acquisition sub-module and a similarity degree calculation sub-module.

动词获取子模块,用于获取所述事件关系树的各个节点对应的第一文本 中的动词。The verb acquisition submodule is used to acquire verbs in the first text corresponding to each node of the event relationship tree.

相似度计算子模块,用于基于预设的余弦相似性算法,对所述关键动词 和所述第一文本中的动词进行相似度计算,得到所述关键动词与各所述第一 文本的相似度,并将所述相似度作为所述关键动词与所述节点的第一节点匹 配度。A similarity calculation sub-module, used for calculating the similarity between the key verb and the verb in the first text based on a preset cosine similarity algorithm, to obtain the similarity between the key verb and each of the first texts degree, and use the similarity degree as the first node matching degree of the key verb and the node.

示例性的,目标节点确定模块140还用于:Exemplarily, the target node determination module 140 is further configured to:

确定所述关键动词与所述事件关系树第N层的各个节点的第一节点匹配 度,其中,N为大于0的自然数且N不大于所述事件关系树的总层数;Determine the first node matching degree of the key verb and each node of the Nth layer of the event relationship tree, wherein, N is a natural number greater than 0 and N is not greater than the total number of layers of the event relationship tree;

将第一节点匹配度大于节点匹配阈值的节点确定为待计算节点;Determining a node whose first node matching degree is greater than the node matching threshold as a node to be calculated;

当N小于所述事件关系树的总层数时,确定所述关键动词与所述待计算 节点的子节点的第二节点匹配度;When N is less than the total number of layers of the event relationship tree, determine the second node matching degree of the key verb and the child node of the node to be calculated;

若所述待计算节点的子节点的第二匹配度小于所述待计算节点的第一匹 配度,根据所述待计算节点确定目标节点;If the second matching degree of the child node of the node to be calculated is less than the first matching degree of the node to be calculated, determine the target node according to the node to be calculated;

若所述待计算节点的子节点的第二匹配度大于所述待计算节点的第一匹 配度,将N加1。If the second matching degree of the child nodes of the node to be calculated is greater than the first matching degree of the node to be calculated, add 1 to N.

示例性的,第一关联程度确定模块150包括名词获取子模块,名词三元 组确定子模块,第二名词判断子模块。Exemplarily, the first association degree determination module 150 includes a noun acquisition submodule, a noun triplet determination submodule, and a second noun judgment submodule.

名词获取子模块,用于获取所述目标第一文本中的第一名词,以及获取 所述目标第二文本中的第二名词;A noun acquisition submodule for acquiring the first noun in the first text of the target, and acquiring the second noun in the second text of the target;

名词三元组确定子模块,用于根据所述第一名词,在所述名词关系数据 库中确定多个待选名词三元组,其中,所述待选名词三元组包含与所述第一 名词相同的名词;A noun triplet determination submodule is used to determine a plurality of noun triples to be selected in the noun relation database according to the first noun, wherein the noun triples to be selected include the same as the first noun. nouns with the same noun;

第二名词判断子模块,用于确定所述待选名词三元组中是否存在所述第 二名词;The second noun judging submodule is used to determine whether the second noun exists in the noun triplet to be selected;

第一关联程度确定模块150还用于从存在所述第二名词的待选名词三元 组中确定所述第一关联程度。The first degree of association determination module 150 is further configured to determine the first degree of association from the candidate noun triples in which the second noun exists.

示例性的,事件的描述文本预测装置100还包括样本描述文本获取模块, 事件关系树建立模块。Exemplarily, the event description text prediction apparatus 100 further includes a sample description text acquisition module and an event relationship tree establishment module.

样本描述文本获取模块,用于获取样本事件对的描述文本数据集,其中, 所述样本事件对包括样本第一文本及与样本第一文本对应的样本第二文本, 所述样本第一文本为样本原因事件描述文本,所述样本第二文本为样本结果 事件描述文本;The sample description text acquisition module is used to obtain the description text data set of the sample event pair, wherein the sample event pair includes the sample first text and the sample second text corresponding to the sample first text, and the sample first text is Sample cause event description text, the second sample text is sample result event description text;

事件关系树建立模块,用于根据样本事件对所包含的所述样本第一文本 以及所述样本第二文本,对多个所述样本事件对进行聚类,得到所述事件关 系树。The event relationship tree building module is used for clustering a plurality of the sample event pairs according to the sample first text and the sample second text included in the sample event pair to obtain the event relationship tree.

示例性的,事件关系树建立模块包括向量处理子模块,向量距离计算子 模块,事件对分类子模块,聚类分类子模块。Exemplarily, the event relationship tree building module includes a vector processing submodule, a vector distance calculation submodule, an event pair classification submodule, and a cluster classification submodule.

向量处理子模块,用于对所述样本第一文本进行向量化处理,得到样本 第一文本向量,以及对所述样本第二文本进行向量化处理,得到样本第二文 本向量。The vector processing submodule is configured to perform vectorization processing on the first text of the sample to obtain the first text vector of the sample, and perform vectorization processing on the second text of the sample to obtain the second text vector of the sample.

向量距离计算子模块,用于基于预设向量距离计算公式,根据各所述样 本事件对对应的样本第一文本向量和样本第二文本向量,确定各所述样本事 件对之间的向量距离;The vector distance calculation submodule is used to determine the vector distance between each described sample event pair based on the preset vector distance calculation formula, according to the sample first text vector and the sample second text vector corresponding to each described sample event pair;

事件对分类子模块,用于根据各所述样本事件对之间的向量距离,将各 所述样本事件对分类至多个事件对第一聚类中,其中,每个所述事件对第一 聚类至少包括两个样本事件对;The event pair classification submodule is configured to classify each of the sample event pairs into a first cluster of a plurality of event pairs according to the vector distance between the sample event pairs, wherein each of the event pairs is the first cluster The class includes at least two sample event pairs;

聚类分类子模块,用于计算各所述事件对第一聚类之间的向量距离,并 根据各所述事件对第一聚类之间的向量距离,将各所述对第一聚类分类至多 个事件对第二聚类中,其中,每个所述事件对第二聚类至少包括两个所述事 件对第一聚类;A cluster classification sub-module is used to calculate the vector distance between each of the event pairs of the first cluster, and according to the vector distance between each of the event pairs of the first cluster, classify each of the pairs of the first cluster Classifying into a plurality of second clusters of event pairs, wherein each of the second clusters of event pairs includes at least two of the first clusters of event pairs;

事件关系树建立模块还用于根据各所述事件对第一聚类和各所述事件对 第二聚类,确定所述事件关系树。The event relationship tree establishing module is further configured to determine the event relationship tree according to the first clustering of each of the event pairs and the second clustering of each of the event pairs.

示例性的,事件对分类子模块还包括目标样本事件对确定子模块、事件 对向量距离计算子模块、标识比对子模块。Exemplarily, the event pair classification submodule further includes a target sample event pair determination submodule, an event pair vector distance calculation submodule, and an identification comparison submodule.

标识确定子模块,用于确定第一样本事件对,以及将在所述本事件对的 描述文本数据集中除所述第一样本事件对之外的样本事件对依次作为目标样 本事件对。An identification determination submodule is used to determine a first sample event pair, and the sample event pairs other than the first sample event pair in the description text data set of the current event pair are sequentially used as the target sample event pair.

待选语种标识确定子模块,用于计算所述第一样本事件对与所述目标样 本事件对的向量距离。A language identification determination sub-module for calculating the vector distance between the first sample event pair and the target sample event pair.

事件对分类子模块,还用于确定与所述第一样本事件对的向量距离最小 的目标样本事件对为第二样本事件对,并将所述第一样本事件对和所述第二 样本事件对分类至同一个事件对第一聚类中。The event pair classification submodule is further configured to determine the target sample event pair with the smallest vector distance from the first sample event pair as the second sample event pair, and combine the first sample event pair with the second sample event pair The sample event pairs are classified into the same event pair first cluster.

需要说明的是,所属领域的技术人员可以清楚地了解到,为了描述的方 便和简洁,上述描述的装置和各模块、单元的具体工作过程,可以参考前述 方法实施例中的对应过程,在此不再赘述。It should be noted that those skilled in the art can clearly understand that, for the convenience and brevity of description, for the specific working process of the above-described device and each module and unit, reference may be made to the corresponding process in the foregoing method embodiments. No longer.

本申请的方法,可用于众多通用或专用的计算机系统环境或配置中。例 如:个人计算机、服务器计算机、手持设备或便携式设备、平板型设备、多 处理器系统、基于微处理器的系统、置顶盒、可编程的消费电子设备、网络 PC、小型计算机、大型计算机、包括以上任何系统或设备的分布式计算环境 等等。本申请可以在由计算机执行的计算机可执行指令的一般上下文中描述, 例如程序模块。一般地,程序模块包括执行特定任务或实现特定抽象数据类 型的例程、程序、对象、组件、数据结构等等。也可以在分布式计算环境中 实践本申请,在这些分布式计算环境中,由通过通信网络而被连接的远程处 理设备来执行任务。在分布式计算环境中,程序模块可以位于包括存储设备 在内的本地和远程计算机存储介质中。The methods of the present application can be used in numerous general purpose or special purpose computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, including A distributed computing environment for any of the above systems or devices, and the like. The application may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The application may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including storage devices.

请参阅图5,图5为本申请实施例提供的一种计算机设备的结构示意性框 图。该计算机设备可以为服务器或终端。Please refer to FIG. 5. FIG. 5 is a schematic block diagram of the structure of a computer device according to an embodiment of the present application. The computer equipment can be a server or a terminal.

如图5所示,该计算机设备包括通过系统总线连接的处理器、存储器和 网络接口,其中,存储器可以包括存储介质和内存储器。As shown in Figure 5, the computer device includes a processor, memory, and a network interface connected by a system bus, wherein the memory may include a storage medium and an internal memory.

存储介质可存储操作系统和计算机程序。该计算机程序包括程序指令, 该程序指令被执行时,可使得处理器执行任意一种事件的描述文本预测方法。The storage medium may store an operating system and a computer program. The computer program includes program instructions that, when executed, can cause the processor to execute any description text prediction method for events.

处理器用于提供计算和控制能力,支撑整个计算机设备的运行。The processor is used to provide computing and control capabilities to support the operation of the entire computer equipment.

内存储器为存储介质中的计算机程序的运行提供环境,该计算机程序被 处理器执行时,可使得处理器执行任意一种事件的描述文本预测方法。The internal memory provides an environment for running a computer program in the storage medium, and when the computer program is executed by the processor, the processor can cause the processor to execute any description text prediction method for events.

该网络接口用于进行网络通信,如发送分配的任务等。本领域技术人员 可以理解,图中示出的结构,仅仅是与本申请方案相关的部分结构的框图, 并不构成对本申请方案所应用于其上的计算机设备的限定,具体的计算机设 备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不 同的部件布置。The network interface is used for network communication, such as sending assigned tasks. Those skilled in the art can understand that the structure shown in the figure is only a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer equipment to which the solution of the present application is applied. The specific computer equipment may include There are more or fewer components than shown in the figures, or some components are combined, or have a different arrangement of components.

应当理解的是,处理器可以是中央处理单元(Central Processing Unit, CPU),该处理器还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、 现场可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程 逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。其中,通用处理 器可以是微处理器或者该处理器也可以是任何常规的处理器等。It should be understood that the processor may be a central processing unit (Central Processing Unit, CPU), and the processor may also be other general-purpose processors, digital signal processors (Digital Signal Processors, DSP), application specific integrated circuits (Application Specific Integrated Circuits) Circuit, ASIC), Field-Programmable Gate Array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, and the like. Wherein, the general-purpose processor can be a microprocessor or the processor can also be any conventional processor or the like.

其中,在一个实施例中,所述处理器用于运行存储在存储器中的计算机 程序,以实现如下步骤:Wherein, in one embodiment, described processor is used for running the computer program stored in the memory, to realize the following steps:

从源终端获取目标事件的事件描述文本;Obtain the event description text of the target event from the source terminal;

对所述事件描述文本进行语义解析,得到关键动词和关键名词;Semantically parse the event description text to obtain key verbs and key nouns;

基于事件关系树,确定所述关键动词与所述事件关系树中节点的第一节 点匹配度,其中,所述节点用于指示第一文本及与所述第一文本对应的第二 文本,所述第一文本为原因事件描述文本,所述第二文本为结果事件描述文 本;Based on the event relationship tree, determine the degree of matching between the key verb and the node in the event relationship tree, wherein the node is used to indicate the first text and the second text corresponding to the first text, and the The first text is the cause event description text, and the second text is the result event description text;

根据所述第一节点匹配度,在所述事件关系树中确定目标节点,得到所 述目标节点所指示的目标第一文本及目标第二文本;According to the first node matching degree, determine the target node in the event relationship tree, and obtain the target first text and the target second text indicated by the target node;

基于预设的名词关系数据库,确定所述目标第一文本中名词与所述目标 第二文本中名词的第一关联程度;Based on a preset noun relation database, determining the first degree of association between the nouns in the target first text and the nouns in the target second text;

基于预设的语义网络,根据所述第一关联程度和所述关键名词,确定与 所述关键名词对应的目标名词,其中,所述目标名词与所述关键名词的第二 关联程度大于或等于所述第一关联程度;Based on a preset semantic network, according to the first degree of association and the key noun, determine the target noun corresponding to the key noun, wherein the second degree of association between the target noun and the key noun is greater than or equal to the first degree of association;

根据所述目标名词对所述目标第二文本进行名词替换处理,得到目标描 述文本,并将目标描述文本发送至目标终端。Perform noun replacement processing on the target second text according to the target noun to obtain target description text, and send the target description text to the target terminal.

在一个实施例中,所述处理器在实现基于事件关系树,确定所述关键动 词与所述事件关系树中节点的第一节点匹配度时,用于实现:In one embodiment, when the processor determines the first node matching degree of the key verb and the node in the event relationship tree based on the event relationship tree, it is used to realize:

获取所述事件关系树的各个节点对应的第一文本中的动词;acquiring the verbs in the first text corresponding to each node of the event relationship tree;

基于预设的余弦相似性算法,对所述关键动词和所述第一文本中的动词 进行相似度计算,得到所述关键动词与各所述第一文本的相似度,并将所述 相似度作为所述关键动词与所述节点的第一节点匹配度。Based on a preset cosine similarity algorithm, calculate the similarity between the key verb and the verb in the first text to obtain the similarity between the key verb and each of the first texts, and calculate the similarity between the key verbs and the first texts. As the key verb and the first node matching degree of the node.

在一个实施例中,所述处理器在实现根据所述第一节点匹配度,在所述 事件关系树中确定目标节点时,用于实现:In one embodiment, when the processor determines the target node in the event relationship tree according to the first node matching degree, it is used to realize:

确定所述关键动词与所述事件关系树第N层的各个节点的第一节点匹配 度,其中,N为大于0的自然数且N不大于所述事件关系树的总层数;Determine the first node matching degree of the key verb and each node of the Nth layer of the event relationship tree, wherein, N is a natural number greater than 0 and N is not greater than the total number of layers of the event relationship tree;

将第一节点匹配度大于节点匹配阈值的节点确定为待计算节点;Determining a node whose first node matching degree is greater than the node matching threshold as a node to be calculated;

当N小于所述事件关系树的总层数时,确定所述关键动词与所述待计算 节点的子节点的第二节点匹配度;When N is less than the total number of layers of the event relationship tree, determine the second node matching degree of the key verb and the child node of the node to be calculated;

若所述待计算节点的子节点的第二匹配度小于所述待计算节点的第一匹 配度,根据所述待计算节点确定目标节点;If the second matching degree of the child node of the node to be calculated is less than the first matching degree of the node to be calculated, determine the target node according to the node to be calculated;

若所述待计算节点的子节点的第二匹配度大于所述待计算节点的第一匹 配度,将N加1。If the second matching degree of the child nodes of the node to be calculated is greater than the first matching degree of the node to be calculated, add 1 to N.

在一个实施例中,所述处理器在实现基于预设的名词关系数据库,确定 所述目标第一文本中名词与所述目标第二文本中名词的第一关联程度时,用 于实现:In one embodiment, when the processor determines the first degree of association between the nouns in the target first text and the nouns in the target second text based on a preset noun relational database, the processor is configured to:

获取所述目标第一文本中的第一名词,以及获取所述目标第二文本中的 第二名词;Obtain the first noun in the target first text, and obtain the second noun in the target second text;

根据所述第一名词,在所述名词关系数据库中确定多个待选名词三元组, 其中,所述待选名词三元组包含与所述第一名词相同的名词;According to the first noun, a plurality of noun triples to be selected are determined in the noun relation database, wherein the noun triples to be selected include the same noun as the first noun;

确定所述待选名词三元组中是否存在所述第二名词;determining whether the second noun exists in the candidate noun triplet;

从存在所述第二名词的待选名词三元组中确定所述第一关联程度。The first degree of association is determined from candidate noun triples in which the second noun exists.

在一个实施例中,所述处理器在实现基于事件关系树,确定所述关键动 词与所述事件关系树中节点的第一节点匹配度之前,用于实现:In one embodiment, the processor is used to realize before determining the matching degree of the key verb and the first node of the node in the event relationship tree based on the event relationship tree:

获取样本事件对的描述文本数据集,其中,所述样本事件对包括样本第 一文本及与样本第一文本对应的样本第二文本,所述样本第一文本为样本原 因事件描述文本,所述样本第二文本为样本结果事件描述文本;Obtain a description text data set of a sample event pair, wherein the sample event pair includes a sample first text and a sample second text corresponding to the sample first text, the sample first text is a sample cause event description text, and the The second text of the sample is the description text of the sample result event;

根据样本事件对所包含的所述样本第一文本以及所述样本第二文本,对 多个所述样本事件对进行聚类,得到所述事件关系树。According to the sample first text and the sample second text contained in the sample event pair, a plurality of the sample event pairs are clustered to obtain the event relationship tree.

在一个实施例中,所述处理器在实现根据样本事件对所包含的所述样本 第一文本以及所述样本第二文本,对多个所述样本事件对进行聚类,得到所 述事件关系树时,用于实现:In one embodiment, the processor implements clustering a plurality of the sample event pairs according to the sample first text and the sample second text included in the sample event pair to obtain the event relationship tree, used to implement:

对所述样本第一文本进行向量化处理,得到样本第一文本向量,以及对 所述样本第二文本进行向量化处理,得到样本第二文本向量;The first text of the sample is vectorized to obtain the first text vector of the sample, and the second text of the sample is vectorized to obtain the second text vector of the sample;

基于预设向量距离计算公式,根据各所述样本事件对对应的样本第一文 本向量和样本第二文本向量,确定各所述样本事件对之间的向量距离;Based on the preset vector distance calculation formula, according to the sample first text vector and the sample second text vector corresponding to each of the sample event pairs, determine the vector distance between each of the sample event pairs;

根据各所述样本事件对之间的向量距离,将各所述样本事件对分类至多 个事件对第一聚类中,其中,每个所述事件对第一聚类至少包括两个样本事 件对;According to the vector distance between the sample event pairs, each of the sample event pairs is classified into a first cluster of multiple event pairs, wherein each of the first cluster of event pairs includes at least two sample event pairs ;

计算各所述事件对第一聚类之间的向量距离,并根据各所述事件对第一 聚类之间的向量距离,将各所述对第一聚类分类至多个事件对第二聚类中, 其中,每个所述事件对第二聚类至少包括两个所述事件对第一聚类;Calculate the vector distance between the first clusters of each of the event pairs, and classify each of the first pairs of clusters into a plurality of event pairs of the second cluster according to the vector distance between the first clusters of the event pairs. In the class, wherein, each of the event pair second cluster includes at least two of the event pair first cluster;

根据各所述事件对第一聚类和各所述事件对第二聚类,确定所述事件关 系树。The event relationship tree is determined based on each of the event pairs of the first cluster and each of the event pairs of the second cluster.

在一个实施例中,所述处理器在实现根据各所述样本事件对之间的向量 距离,将各所述样本事件对分类至多个事件对第一聚类中时,用于实现:In one embodiment, when the processor implements classifying each of the sample event pairs into a first cluster of multiple event pairs according to the vector distance between each of the sample event pairs, it is used to implement:

确定第一样本事件对,以及将在所述本事件对的描述文本数据集中除所 述第一样本事件对之外的样本事件对依次作为目标样本事件对;Determine the first sample event pair, and use the sample event pairs other than the first sample event pair in the description text data set of this event pair as the target sample event pair in turn;

计算所述第一样本事件对与所述目标样本事件对的向量距离;Calculate the vector distance between the first sample event pair and the target sample event pair;

确定与所述第一样本事件对的向量距离最小的目标样本事件对为第二样 本事件对,并将所述第一样本事件对和所述第二样本事件对分类至同一个事 件对第一聚类中。Determine the target sample event pair with the smallest vector distance from the first sample event pair as the second sample event pair, and classify the first sample event pair and the second sample event pair into the same event pair in the first cluster.

需要说明的是,所属领域的技术人员可以清楚地了解到,为了描述的方 便和简洁,上述描述事件的描述文本预测的具体工作过程,可以参考前述事 件的描述文本预测控制方法实施例中的对应过程,在此不再赘述。It should be noted that those skilled in the art can clearly understand that, for the convenience and brevity of the description, for the specific working process of the description text prediction of the above-mentioned events, you can refer to the corresponding descriptions in the description text prediction control method embodiments of the aforementioned events. The process is not repeated here.

本申请实施例还提供一种计算机可读存储介质,所述计算机可读存储介 质上存储有计算机程序,所述计算机程序中包括程序指令,所述程序指令被 执行时所实现的方法可参照本申请事件的描述文本预测方法的各个实施例。Embodiments of the present application further provide a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, the computer program includes program instructions, and the method implemented when the program instructions are executed may refer to this document Various embodiments of description text prediction methods for application events.

其中,所述计算机可读存储介质可以是前述实施例所述的计算机设备的 内部存储单元,例如所述计算机设备的硬盘或内存。所述计算机可读存储介 质也可以是所述计算机设备的外部存储设备,例如所述计算机设备上配备的 插接式硬盘,智能存储卡(SmartMedia Card,SMC),安全数字(Secure Digital, SD)卡,闪存卡(Flash Card)等。Wherein, the computer-readable storage medium may be an internal storage unit of the computer device described in the foregoing embodiments, such as a hard disk or a memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a smart memory card (SmartMedia Card, SMC), a secure digital (Secure Digital, SD) equipped on the computer device card, flash card (Flash Card) and so on.

应当理解,在此本申请说明书中所使用的术语仅仅是出于描述特定实施 例的目的而并不意在限制本申请。如在本申请说明书和所附权利要求书中所 使用的那样,除非上下文清楚地指明其它情况,否则单数形式的“一”、“一个” 及“该”意在包括复数形式。It should be understood that the terminology used in the specification of the present application is for the purpose of describing particular embodiments only and is not intended to limit the present application. As used in this specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural unless the context clearly dictates otherwise.

还应当理解,在本申请说明书和所附权利要求书中使用的术语“和/或” 是指相关联列出的项中的一个或多个的任何组合以及所有可能组合,并且包 括这些组合。需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他 变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物 品或者系统不仅包括那些要素,而且还包括没有明确列出的其他要素,或者 是还包括为这种过程、方法、物品或者系统所固有的要素。在没有更多限制 的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者系统中还存在另外的相同要素。It should also be understood that, as used in this specification and the appended claims, the term "and/or" refers to and including any and all possible combinations of one or more of the associated listed items. It should be noted that, herein, the terms "comprising", "comprising" or any other variation thereof are intended to encompass non-exclusive inclusion, such that a process, method, article or system comprising a series of elements includes not only those elements, It also includes other elements not expressly listed or inherent to such a process, method, article or system. Without further limitation, an element qualified by the statement "comprising a..." does not preclude the presence of additional identical elements in the process, method, article or system that includes the element.

上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。以上所述, 仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉 本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到各种等效的 修改或替换,这些修改或替换都应涵盖在本申请的保护范围之内。因此,本 申请的保护范围应以权利要求的保护范围为准。The above-mentioned serial numbers of the embodiments of the present application are only for description, and do not represent the advantages or disadvantages of the embodiments. The above are only specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art can easily think of various equivalents within the technical scope disclosed in the present application. Modifications or substitutions shall be covered by the protection scope of this application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (10)

1.一种事件的描述文本预测方法,其特征在于,包括:1. a description text prediction method of an event, is characterized in that, comprises: 从源终端获取目标事件的事件描述文本;Obtain the event description text of the target event from the source terminal; 对所述事件描述文本进行语义解析,得到关键动词和关键名词;Semantically parse the event description text to obtain key verbs and key nouns; 基于事件关系树,确定所述关键动词与所述事件关系树中节点的第一节点匹配度,其中,所述节点用于指示第一文本及与所述第一文本对应的第二文本,所述第一文本为原因事件描述文本,所述第二文本为结果事件描述文本;Based on the event relationship tree, determine the degree of matching between the key verb and the node in the event relationship tree, wherein the node is used to indicate the first text and the second text corresponding to the first text, and the The first text is the cause event description text, and the second text is the result event description text; 根据所述第一节点匹配度,在所述事件关系树中确定目标节点,得到所述目标节点所指示的目标第一文本及目标第二文本;According to the matching degree of the first node, a target node is determined in the event relationship tree, and the target first text and the target second text indicated by the target node are obtained; 基于预设的名词关系数据库,确定所述目标第一文本中名词与所述目标第二文本中名词的第一关联程度;determining the first degree of association between the nouns in the target first text and the nouns in the target second text based on a preset noun relation database; 基于预设的语义网络,根据所述第一关联程度和所述关键名词,确定与所述关键名词对应的目标名词,其中,所述目标名词与所述关键名词的第二关联程度大于或等于所述第一关联程度;Based on a preset semantic network, according to the first degree of association and the key noun, determine the target noun corresponding to the key noun, wherein the second degree of association between the target noun and the key noun is greater than or equal to the first degree of association; 根据所述目标名词对所述目标第二文本进行名词替换处理,得到目标描述文本,并将目标描述文本发送至目标终端。Perform noun replacement processing on the target second text according to the target noun to obtain target description text, and send the target description text to the target terminal. 2.如权利要求1所述的事件的描述文本预测方法,其特征在于,所述基于事件关系树,确定所述关键动词与所述事件关系树中节点的第一节点匹配度,包括:2. The method for predicting the description text of an event as claimed in claim 1, wherein the determining the degree of first node matching between the key verb and a node in the event relationship tree based on the event relationship tree comprises: 获取所述事件关系树的各个节点对应的第一文本中的动词;acquiring the verbs in the first text corresponding to each node of the event relationship tree; 基于预设的余弦相似性算法,对所述关键动词和所述第一文本中的动词进行相似度计算,得到所述关键动词与各所述第一文本的相似度,并将所述相似度作为所述关键动词与所述节点的第一节点匹配度。Based on a preset cosine similarity algorithm, calculate the similarity between the key verb and the verb in the first text to obtain the similarity between the key verb and each of the first texts, and calculate the similarity between the key verbs and the first texts. As the key verb and the first node matching degree of the node. 3.如权利要求1所述的事件的描述文本预测方法,其特征在于,所述事件关系树至少包括两个层级,所述根据所述第一节点匹配度,在所述事件关系树中确定目标节点,包括:3 . The method for predicting the description text of an event according to claim 1 , wherein the event relationship tree comprises at least two levels, and the event relationship tree is determined according to the first node matching degree in the event relationship tree. 4 . target node, including: 确定所述关键动词与所述事件关系树第N层的各个节点的第一节点匹配度,其中,N为大于0的自然数且N不大于所述事件关系树的总层数;Determine the first node matching degree between the key verb and each node of the Nth layer of the event relationship tree, wherein N is a natural number greater than 0 and N is not greater than the total number of layers of the event relationship tree; 将第一节点匹配度大于节点匹配阈值的节点确定为待计算节点;Determining a node whose first node matching degree is greater than the node matching threshold as a node to be calculated; 当N小于所述事件关系树的总层数时,确定所述关键动词与所述待计算节点的子节点的第二节点匹配度;When N is less than the total number of layers of the event relationship tree, determine the degree of matching between the key verb and the second node of the child node of the node to be calculated; 若所述待计算节点的子节点的第二匹配度小于所述待计算节点的第一匹配度,根据所述待计算节点确定目标节点;If the second matching degree of the child nodes of the node to be calculated is smaller than the first matching degree of the node to be calculated, determine the target node according to the node to be calculated; 若所述待计算节点的子节点的第二匹配度大于所述待计算节点的第一匹配度,将N加1。If the second matching degree of the child nodes of the node to be calculated is greater than the first matching degree of the node to be calculated, add 1 to N. 4.如权利要求1所述的事件的描述文本预测方法,其特征在于,所述基于预设的名词关系数据库,确定所述目标第一文本中名词与所述目标第二文本中名词的第一关联程度,包括:4. The method for predicting the description text of an event according to claim 1, wherein, based on a preset noun relation database, determining the number of nouns in the target first text and the nouns in the target second text. a degree of association, including: 获取所述目标第一文本中的第一名词,以及获取所述目标第二文本中的第二名词;Obtain the first noun in the target first text, and obtain the second noun in the target second text; 根据所述第一名词,在所述名词关系数据库中确定多个待选名词三元组,其中,所述待选名词三元组包含与所述第一名词相同的名词;According to the first noun, a plurality of noun triples to be selected are determined in the noun relation database, wherein the noun triples to be selected include the same noun as the first noun; 确定所述待选名词三元组中是否存在所述第二名词;determining whether the second noun exists in the candidate noun triplet; 从存在所述第二名词的待选名词三元组中确定所述第一关联程度。The first degree of association is determined from candidate noun triples in which the second noun exists. 5.如权利要求1-3任一项所述的事件的描述文本预测方法,其特征在于,在所述基于事件关系树,确定所述关键动词与所述事件关系树中节点的第一节点匹配度之前,还包括:5. The method for predicting the description text of an event according to any one of claims 1-3, wherein, in the event-based relationship tree, determining the key verb and the first node of the node in the event relationship tree Before match, also includes: 获取样本事件对的描述文本数据集,其中,所述样本事件对包括样本第一文本及与样本第一文本对应的样本第二文本,所述样本第一文本为样本原因事件描述文本,所述样本第二文本为样本结果事件描述文本;Obtain a description text data set of a sample event pair, wherein the sample event pair includes a sample first text and a sample second text corresponding to the sample first text, the sample first text is a sample cause event description text, and the The second text of the sample is the description text of the sample result event; 根据样本事件对所包含的所述样本第一文本以及所述样本第二文本,对多个所述样本事件对进行聚类,得到所述事件关系树。According to the sample first text and the sample second text contained in the sample event pair, a plurality of the sample event pairs are clustered to obtain the event relationship tree. 6.如权利要求5所述的事件的描述文本预测方法,其特征在于,所述根据样本事件对所包含的所述样本第一文本以及所述样本第二文本,对多个所述样本事件对进行聚类,得到所述事件关系树,包括:6 . The method for predicting the description text of an event according to claim 5 , wherein, according to the sample first text and the sample second text included in the sample event, for a plurality of the sample events. 7 . Perform clustering on the pair to obtain the event relationship tree, including: 对所述样本第一文本进行向量化处理,得到样本第一文本向量,以及对所述样本第二文本进行向量化处理,得到样本第二文本向量;Perform vectorization processing on the sample first text to obtain a sample first text vector, and perform vectorization processing on the sample second text to obtain a sample second text vector; 基于预设向量距离计算公式,根据各所述样本事件对对应的样本第一文本向量和样本第二文本向量,确定各所述样本事件对之间的向量距离;Based on a preset vector distance calculation formula, according to the sample first text vector and the sample second text vector corresponding to each sample event pair, determine the vector distance between each of the sample event pairs; 根据各所述样本事件对之间的向量距离,将各所述样本事件对分类至多个事件对第一聚类中,其中,每个所述事件对第一聚类至少包括两个样本事件对;According to the vector distance between the sample event pairs, each of the sample event pairs is classified into a first cluster of multiple event pairs, wherein each of the first cluster of event pairs includes at least two sample event pairs ; 计算各所述事件对第一聚类之间的向量距离,并根据各所述事件对第一聚类之间的向量距离,将各所述对第一聚类分类至多个事件对第二聚类中,其中,每个所述事件对第二聚类至少包括两个所述事件对第一聚类;Calculate the vector distance between the first clusters of each of the event pairs, and classify each of the first pairs of clusters into a plurality of event pairs of the second cluster according to the vector distance between the first clusters of the event pairs. class, wherein each of the event pair second clusters includes at least two of the event pair first clusters; 根据各所述事件对第一聚类和各所述事件对第二聚类,确定所述事件关系树。The event relationship tree is determined according to each of the first clusters of the event pairs and each of the event pairs to the second cluster. 7.如权利要求6所述的事件的描述文本预测方法,其特征在于,所述根据各所述样本事件对之间的向量距离,将各所述样本事件对分类至多个事件对第一聚类中,包括:7 . The method for predicting the description text of events according to claim 6 , wherein, according to the vector distance between the sample event pairs, the sample event pairs are classified into a plurality of event pairs first clustering. 8 . class, including: 确定第一样本事件对,以及将在所述本事件对的描述文本数据集中除所述第一样本事件对之外的样本事件对依次作为目标样本事件对;determining a first sample event pair, and sequentially taking the sample event pairs other than the first sample event pair in the description text data set of the current event pair as the target sample event pair; 计算所述第一样本事件对与所述目标样本事件对的向量距离;Calculate the vector distance between the first sample event pair and the target sample event pair; 确定与所述第一样本事件对的向量距离最小的目标样本事件对为第二样本事件对,并将所述第一样本事件对和所述第二样本事件对分类至同一个事件对第一聚类中。Determine the target sample event pair with the smallest vector distance from the first sample event pair as the second sample event pair, and classify the first sample event pair and the second sample event pair into the same event pair in the first cluster. 8.一种事件的描述文本预测装置,其特征在于,所述事件的描述文本预测装置包括:8. An event description text prediction device, wherein the event description text prediction device comprises: 文本获取模块,用于从源终端获取目标事件的事件描述文本;The text acquisition module is used to acquire the event description text of the target event from the source terminal; 语义解析模块,用于对所述事件描述文本进行语义解析,得到关键动词和关键名词;a semantic parsing module, used for semantic parsing of the event description text to obtain key verbs and key nouns; 第一节点匹配度确定模块,用于基于事件关系树,确定所述关键动词与所述事件关系树中节点的第一节点匹配度,其中,所述节点用于指示第一文本及与所述第一文本对应的第二文本,所述第一文本为原因事件描述文本,所述第二文本为结果事件描述文本;The first node matching degree determination module is used to determine the first node matching degree between the key verb and the node in the event relationship tree based on the event relationship tree, wherein the node is used to indicate the first text and the The second text corresponding to the first text, the first text is the cause event description text, and the second text is the result event description text; 目标节点确定模块,用于根据所述第一节点匹配度,在所述事件关系树中确定目标节点,得到所述目标节点所指示的目标第一文本及目标第二文本;a target node determination module, configured to determine a target node in the event relationship tree according to the first node matching degree, and obtain the target first text and the target second text indicated by the target node; 第一关联程度确定模块,用于基于预设的名词关系数据库,确定所述目标第一文本中名词与所述目标第二文本中名词的第一关联程度;a first degree of association determination module, configured to determine a first degree of association between nouns in the target first text and nouns in the target second text based on a preset noun relation database; 目标名词确定模块,用于基于预设的语义网络,根据所述第一关联程度和所述关键名词,确定与所述关键名词对应的目标名词,其中,所述目标名词与所述关键名词的第二关联程度大于或等于所述第一关联程度;A target noun determination module is configured to, based on a preset semantic network, determine a target noun corresponding to the key noun according to the first degree of association and the key noun, wherein the target noun and the key noun are the same as the key noun. The second degree of association is greater than or equal to the first degree of association; 目标描述文本确定模块,用于根据所述目标名词对所述目标第二文本进行名词替换处理,得到目标描述文本,并将目标描述文本发送至目标终端。A target description text determination module, configured to perform noun replacement processing on the target second text according to the target noun, obtain target description text, and send the target description text to the target terminal. 9.一种计算机设备,其特征在于,所述计算机设备包括处理器、存储器、以及存储在所述存储器上并可被所述处理器执行的计算机程序,其中所述计算机程序被所述处理器执行时,实现如权利要求1至7中任一项所述的事件的描述文本预测方法的步骤。9. A computer device comprising a processor, a memory, and a computer program stored on the memory and executable by the processor, wherein the computer program is executed by the processor When executed, the steps of the method for descriptive text prediction of events as claimed in any one of claims 1 to 7 are implemented. 10.一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储有计算机程序,其中所述计算机程序被处理器执行时,实现如权利要求1至7中任一项所述的事件的描述文本预测方法的步骤。10. A computer-readable storage medium, characterized in that, a computer program is stored on the computer-readable storage medium, and when the computer program is executed by the processor, the computer program as claimed in any one of claims 1 to 7 is implemented. Describe the steps of the text prediction method for the described event.
CN202210082422.2A 2022-01-24 2022-01-24 Method, device, equipment and storage medium for predicting descriptive text of event Active CN114416912B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210082422.2A CN114416912B (en) 2022-01-24 2022-01-24 Method, device, equipment and storage medium for predicting descriptive text of event

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210082422.2A CN114416912B (en) 2022-01-24 2022-01-24 Method, device, equipment and storage medium for predicting descriptive text of event

Publications (2)

Publication Number Publication Date
CN114416912A true CN114416912A (en) 2022-04-29
CN114416912B CN114416912B (en) 2024-10-29

Family

ID=81277924

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210082422.2A Active CN114416912B (en) 2022-01-24 2022-01-24 Method, device, equipment and storage medium for predicting descriptive text of event

Country Status (1)

Country Link
CN (1) CN114416912B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116821276A (en) * 2022-10-26 2023-09-29 中移(苏州)软件技术有限公司 Text processing method, device, electronic equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108920447A (en) * 2018-05-07 2018-11-30 国家计算机网络与信息安全管理中心 A kind of Chinese event abstracting method towards specific area
CN113590774A (en) * 2021-06-22 2021-11-02 北京百度网讯科技有限公司 Event query method, device and storage medium
CN113822069A (en) * 2021-09-17 2021-12-21 国家计算机网络与信息安全管理中心 Emergency early warning method and device based on meta-knowledge and electronic device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108920447A (en) * 2018-05-07 2018-11-30 国家计算机网络与信息安全管理中心 A kind of Chinese event abstracting method towards specific area
CN113590774A (en) * 2021-06-22 2021-11-02 北京百度网讯科技有限公司 Event query method, device and storage medium
CN113822069A (en) * 2021-09-17 2021-12-21 国家计算机网络与信息安全管理中心 Emergency early warning method and device based on meta-knowledge and electronic device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116821276A (en) * 2022-10-26 2023-09-29 中移(苏州)软件技术有限公司 Text processing method, device, electronic equipment and storage medium
CN116821276B (en) * 2022-10-26 2025-08-29 中移(苏州)软件技术有限公司 Text processing method, device, electronic device and storage medium

Also Published As

Publication number Publication date
CN114416912B (en) 2024-10-29

Similar Documents

Publication Publication Date Title
CN112507715B (en) Methods, devices, equipment and storage media for determining association relationships between entities
WO2021017721A1 (en) Intelligent question answering method and apparatus, medium and electronic device
US11017178B2 (en) Methods, devices, and systems for constructing intelligent knowledge base
WO2020001373A1 (en) Method and apparatus for ontology construction
Kolajo et al. Real-time event detection in social media streams through semantic analysis of noisy terms
CN112650858B (en) Emergency assistance information acquisition method and device, computer equipment and medium
CN104951458A (en) Method and equipment for helping processing based on semantic recognition
CN114417865B (en) Description text processing method, device and equipment for disaster event and storage medium
US12288391B2 (en) Image grounding with modularized graph attentive networks
CN114330335A (en) Keyword extraction method, device, equipment and storage medium
CN113722484A (en) Rumor detection method, device, equipment and storage medium based on deep learning
CN111782781A (en) A semantic analysis method, device, computer equipment and storage medium
CN114742051A (en) Log processing method, device, computer system and readable storage medium
CN119646022A (en) Log query method, device, equipment, medium and program product
CN116737947A (en) Entity relationship diagram construction method, device, equipment and storage medium
US11113300B2 (en) System and method for enabling interoperability between a first knowledge base and a second knowledge base
CN114416912B (en) Method, device, equipment and storage medium for predicting descriptive text of event
CN111930949B (en) Search string processing method and device, computer readable medium and electronic equipment
CN114385777A (en) Text data processing method and device, computer equipment and storage medium
CN114385919A (en) Medical content recommendation method, device, equipment and storage medium
CN118349621A (en) Index establishment method, index retrieval method and electronic equipment
CN116226541B (en) Knowledge graph-based network hotspot information recommendation method, system and equipment
US20230297217A1 (en) Multi-location copying and context based pasting
SCALIA Network-based content geolocation on social media for emergency management
CN115062136A (en) Event Disambiguation Method and Related Equipment Based on Graph Neural Network

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant