WO2021143014A1 - Method and device for generating knowledge graph, and computer readable storage medium - Google Patents

Method and device for generating knowledge graph, and computer readable storage medium Download PDF

Info

Publication number
WO2021143014A1
WO2021143014A1 PCT/CN2020/093056 CN2020093056W WO2021143014A1 WO 2021143014 A1 WO2021143014 A1 WO 2021143014A1 CN 2020093056 W CN2020093056 W CN 2020093056W WO 2021143014 A1 WO2021143014 A1 WO 2021143014A1
Authority
WO
WIPO (PCT)
Prior art keywords
text information
punctuation
knowledge graph
generating
punctuation marks
Prior art date
Application number
PCT/CN2020/093056
Other languages
French (fr)
Chinese (zh)
Inventor
张�杰
付骁弈
于皓
陈栋
吴信东
Original Assignee
北京明略软件***有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 北京明略软件***有限公司 filed Critical 北京明略软件***有限公司
Publication of WO2021143014A1 publication Critical patent/WO2021143014A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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/36Creation of semantic tools, e.g. ontology or thesauri
    • G06F16/367Ontology

Definitions

  • the embodiments of the present invention relate to, but are not limited to, the field of data processing, in particular to a method and device for generating a knowledge graph, and a computer-readable storage medium.
  • the embodiment of the present invention provides a method and device for generating a knowledge graph and a computer-readable storage medium, which can directly convert speech into a knowledge graph and improve the accuracy of the knowledge graph.
  • the embodiment of the present invention provides a method for generating a knowledge graph, including:
  • the method further includes:
  • Generating a knowledge graph based on the corrected text information of the spoken language includes:
  • the knowledge graph is generated according to the adjusted text information of sentence segmentation and punctuation.
  • adding punctuation marks between two adjacent sentences in the text information after sentence segmentation includes:
  • the oral correction of the text information with punctuation marks includes:
  • generating a knowledge graph based on the adjusted text information of sentence segmentation and punctuation includes:
  • the list of triples is drawn as a knowledge graph in a visual form.
  • the embodiment of the present invention provides a device for generating a knowledge graph, which includes a processor and a computer-readable storage medium.
  • the computer-readable storage medium stores instructions. When the instructions are executed by the processor, it realizes any of the above-mentioned knowledge graphs. Generation method.
  • the processor is further configured to execute the following steps:
  • the colloquial and punctuation adjustments are performed on the colloquially revised text information
  • the processor is used for generating a knowledge graph based on the corrected text information of the spoken language through the following steps: generating a knowledge graph based on the adjusted text information of sentence segmentation and punctuation.
  • the processor is further configured to add punctuation marks between two adjacent sentences in the text information after sentence segmentation through the following steps:
  • the processor is further configured to implement the oral correction of the text information added with punctuation through the following steps:
  • the embodiment of the present invention provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the steps of any of the above-mentioned methods for generating a knowledge graph are realized.
  • the embodiment of the present invention includes: converting the speech signal into text information; segmenting the text information, adding punctuation marks between two adjacent sentences in the text information after the segmentation; performing oral correction on the text information with punctuation marks; The corrected text information of the spoken language generates a knowledge graph.
  • the text information is segmented, punctuation marks and spoken language correction are added, and then a knowledge graph is generated.
  • FIG. 1 is a flowchart of a method for generating a knowledge graph proposed by an embodiment of the present invention
  • FIG. 2 is a schematic diagram of the structural composition of a device for generating a knowledge graph according to another embodiment of the present invention.
  • an embodiment of the present invention proposes a method for generating a knowledge graph, including:
  • Step 100 Convert the voice signal into text information.
  • Step 101 Perform sentence segmentation on the text information, and add punctuation marks between two adjacent sentences in the text information after the sentence segmentation.
  • adding punctuation marks between two adjacent sentences in the sentenced text information includes: sequentially inputting the sentenced text information into the trained punctuation prediction model to predict the difference between two adjacent sentences. Between the punctuation marks (such as comma, period, ellipsis, etc.), the predicted punctuation marks are added between two adjacent sentences.
  • the punctuation prediction model can be trained in any of the following ways.
  • Treat the punctuation prediction problem as a language model problem treat the punctuation marks as ordinary words, train the n-gram language model according to the corpus, and calculate the first n words, the next one is the punctuation mark Probability. In other words, given the first n words, calculate the probability of the n+1th word, and select the word with the highest occurrence probability as the n+1th word among all the candidate words.
  • the classification model can use Long Short-Term Memory (LSTM) to continuously input characters into the LSTM, and each time it is judged whether the next character is a punctuation mark, and if so, which punctuation mark should be.
  • LSTM Long Short-Term Memory
  • the classification model can also choose Bi-LSTM as a training model. Compared with LSTM, this model has the advantage of not only being able to use the above characters, but also the following characters as features. Predict whether the current character should be followed by punctuation marks.
  • Step 102 Perform oral correction on the text information added with punctuation marks.
  • performing oral correction on the punctuation-added text information includes: removing any one or more of the mood word and the mantra in the punctuation-added text information.
  • the modal particle may be: “um”, “ah”, etc.
  • the mantra may be: “this”, “that”, “right”, “right”, etc.
  • a dictionary of modal particles and mantras is used to store pre-obtained modal particles and mantras, such as: “this, that” with modal particles before and after; consecutive "um, ah, ah,” shortened For one.
  • Step 103 Generate a knowledge graph based on the corrected text information of the spoken language.
  • generating a knowledge graph based on the corrected text information of the spoken language includes:
  • the knowledge elements are extracted from the corrected text information of the spoken language, and the knowledge elements are expressed in the form of a list of triples, and the list of triples is drawn on a graph in a visual form, and the drawn graph is a knowledge graph.
  • the above-mentioned knowledge elements may include, but are not limited to: concepts, entities, relationships, and attributes.
  • the foregoing triplet may include but is not limited to: parameter 1, relationship, parameter 2.
  • parameter 1 is a noun representing an entity, concept or attribute
  • parameter 2 is a noun representing an entity or concept, or a specific value, geographic location, date, etc.
  • a relationship is a verb or noun representing a relationship.
  • the method further includes:
  • the generating a knowledge graph based on the corrected text information of the spoken language includes:
  • the knowledge graph is generated according to the adjusted text information of sentence segmentation and punctuation.
  • the complete voice signal after receiving the complete voice signal, the complete voice signal can be converted into text information, and the subsequent process can be executed; the voice signal can also be converted into text information in real time during the process of receiving the voice signal , And execute subsequent processes in real time.
  • generating a knowledge graph based on the adjusted text information of sentence segmentation and punctuation includes:
  • the knowledge elements are extracted from the text information after the adjustment of sentence segmentation and punctuation, and the knowledge elements are expressed in the form of a list of triples, and the list of triples is drawn on a graph in a visual form.
  • the drawn graph is Knowledge graph.
  • the text information is segmented, punctuation marks and spoken language correction are added, and then a knowledge graph is generated. Because the text information is segmented, adding punctuation marks and spoken language correction is helpful for word segmentation , Part-of-speech analysis and syntactic analysis, and word segmentation, part-of-speech analysis and syntactic analysis are often required in the process of generating knowledge graphs, thereby improving the accuracy of knowledge graphs.
  • Another embodiment of the present invention provides an apparatus for generating a knowledge graph, which includes a processor and a computer-readable storage medium.
  • the computer-readable storage medium stores instructions. When the instructions are executed by the processor, Realize any of the above-mentioned methods for generating knowledge graphs.
  • Another embodiment of the present invention provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the steps of any of the above-mentioned methods for generating a knowledge graph are realized.
  • FIG. 2 another embodiment of the present invention provides a knowledge graph generating device, including:
  • the speech recognition module 201 is configured to convert the speech signal into text information
  • the text processing module 202 is configured to segment the text information, add punctuation marks between two adjacent sentences in the text information after the sentence segmentation; and make oral corrections to the text information with the added punctuation marks;
  • the knowledge graph generating module 203 is configured to generate a knowledge graph based on the corrected text information of the spoken language.
  • the text processing module 202 is specifically configured to add punctuation marks between two adjacent sentences in the segmented text information in the following manner: input the segmented text information into the trained punctuation marks in sequence
  • the prediction model predicts the punctuation between two adjacent sentences (such as comma, period, ellipsis, etc.), and adds the predicted punctuation between two adjacent sentences.
  • the text processing module 202 may use any of the following methods to train the punctuation prediction model.
  • Treat the punctuation prediction problem as a language model problem treat the punctuation marks as ordinary words, train the n-gram language model according to the corpus, and calculate the first n words, the next one is the punctuation mark Probability. In other words, given the first n words, calculate the probability of the n+1th word, and select the word with the highest occurrence probability as the n+1th word among all the candidate words.
  • the classification model can use Long Short-Term Memory (LSTM) to continuously input characters into the LSTM, and each time it is judged whether the next character is a punctuation mark, and if so, which punctuation mark should be.
  • LSTM Long Short-Term Memory
  • the classification model can also choose Bi-LSTM as a training model. Compared with LSTM, this model has the advantage of not only being able to use the above characters, but also the following characters as features. Predict whether the current character should be followed by punctuation marks.
  • the text processing module 202 is specifically configured to implement the oral correction of the punctuation-added text information in the following manner: removing any one or more of the mood word and the mantra in the punctuation-added text information.
  • the modal particle may be "um”, “ah”, etc., and the mantra may be: “this”, “that”, “right”, “right”, etc.
  • a dictionary of modal particles and mantras is used to store pre-obtained modal particles and mantras, such as: “this, that” with modal particles before and after; consecutive "um, ah, ah,” shortened For one.
  • the knowledge graph generation module 203 is specifically configured as:
  • the knowledge elements are extracted from the corrected text information of the spoken language, and the knowledge elements are expressed in the form of a list of triples, and the list of triples is drawn on a graph in a visual form, and the drawn graph is a knowledge graph.
  • the above-mentioned knowledge elements may include, but are not limited to: concepts, entities, relationships, and attributes.
  • the foregoing triplet may include but is not limited to: parameter 1, relationship, parameter 2.
  • parameter 1 is a noun representing an entity, concept or attribute
  • parameter 2 is a noun representing an entity or concept, or a specific value, geographic location, date, etc.
  • a relationship is a verb or noun representing a relationship.
  • the text processing module 202 is further configured to:
  • the knowledge graph generation module 203 is specifically set as follows:
  • the knowledge graph is generated according to the adjusted text information of sentence segmentation and punctuation.
  • the complete voice signal after receiving the complete voice signal, the complete voice signal can be converted into text information, and the subsequent process can be executed; the voice signal can also be converted into text information in real time during the process of receiving the voice signal , And execute the follow-up process in real time.
  • the knowledge graph generation module 203 is specifically configured as:
  • the knowledge elements are extracted from the text information after the adjustment of sentence segmentation and punctuation, and the knowledge elements are expressed in the form of a list of triples, and the list of triples is drawn on a graph in a visual form.
  • the drawn graph is Knowledge graph.
  • the text information is segmented, punctuation marks and spoken language correction are added, and then a knowledge graph is generated. Because the text information is segmented, adding punctuation marks and spoken language correction is helpful for word segmentation , Part-of-speech analysis and syntactic analysis, and word segmentation, part-of-speech analysis and syntactic analysis are often required in the process of generating knowledge graphs, thereby improving the accuracy of knowledge graphs.
  • the division between functional modules/units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may consist of several physical components.
  • the components are executed cooperatively.
  • Some or all of the components may be implemented as software executed by a processor, such as a digital signal processor or a microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit.
  • Such software may be distributed on a computer-readable medium, and the computer-readable medium may include a computer storage medium (or a non-transitory medium) and a communication medium (or a transitory medium).
  • computer storage medium includes volatile and non-volatile data implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data).
  • Information such as computer-readable instructions, data structures, program modules, or other data.
  • Computer storage media include but are not limited to RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disk (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or Any other medium used to store desired information and that can be accessed by a computer.
  • communication media usually contain computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as carrier waves or other transmission mechanisms, and may include any information delivery media. .
  • the foregoing computer-readable storage medium may be configured to store a computer program for executing the following steps:
  • the text information is segmented, and punctuation marks are added between two adjacent sentences in the text information after the segmentation;
  • the integrated unit in the foregoing embodiment is implemented in the form of a software functional unit and sold or used as an independent product, it may be stored in the foregoing computer-readable storage medium.
  • the technical solution of the present invention essentially or the part that contributes to the related technology or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including Several instructions are used to make one or more computer devices (which may be personal computers, servers, or network devices, etc.) execute all or part of the steps of the methods described in the various embodiments of the present invention.
  • the disclosed client can be implemented in other ways.
  • the device embodiments described above are only illustrative.
  • the division of the units is only a logical function division.
  • there may be other division methods for example, multiple units or components may be combined or may be Integrate into another system, or some features can be ignored or not implemented.
  • the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, units or modules, and may be in electrical or other forms.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
  • the functional units in the various embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the above-mentioned integrated unit can be implemented in the form of hardware or software functional unit.
  • the embodiment of the present invention includes: converting the speech signal into text information; segmenting the text information, adding punctuation marks between two adjacent sentences in the text information after the segmentation; performing oral correction on the text information with punctuation marks; The corrected text information of the spoken language generates a knowledge graph.
  • the text information is segmented, punctuation marks and spoken language correction are added, and then a knowledge graph is generated.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Animal Behavior & Ethology (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Machine Translation (AREA)

Abstract

A method and device for generating a knowledge graph, and a computer readable storage medium. The method comprises: converting a voice signal into text information (100); performing sentence segmentation on the text information, and adding a punctuation mark between every two adjacent sentences in the text information subjected to the sentence segmentation (101); performing spoken language correction on the text information added with the punctuation marks (102); and generating a knowledge graph according to the text information subjected to the spoken language correction (103). According to the method, voice information is converted into text information, sentence segmentation is performed on the text information, punctuation marks are added and spoken language correction is performed, and then a knowledge graph is generated; word segmentation, part-of-speech analysis, and syntactic analysis are facilitated due to the sentence segmentation, punctuation mark addition and spoken language correction of the text information, and word segmentation, part-of-speech analysis, and syntactic analysis are often needed in a knowledge graph generation process, so that the accuracy of the knowledge graph is improved.

Description

一种知识图谱的生成方法和装置及计算机可读存储介质Method and device for generating knowledge graph and computer readable storage medium 技术领域Technical field
本发明实施例涉及但不限于数据处理领域,尤指一种知识图谱的生成方法和装置及计算机可读存储介质。The embodiments of the present invention relate to, but are not limited to, the field of data processing, in particular to a method and device for generating a knowledge graph, and a computer-readable storage medium.
背景技术Background technique
随着2012年谷歌在其搜索引擎中引入知识图谱,该项技术得到越来越广泛的关注和应用。知识图谱以图的形式可视化的展示知识片段之间的关系,相较于语音和文字,更加简洁、清晰,更符合人类的思维方式。然而,人们在表达内容的时候,更常用的、更自然的方式还是使用语音,因此如何在人们交谈时有效甚至实时将语音转换成知识图谱成为一个亟待解决的问题。With the introduction of knowledge graphs by Google in its search engine in 2012, this technology has received more and more attention and applications. The knowledge map visually displays the relationship between knowledge fragments in the form of graphs. Compared with speech and text, it is more concise and clear, and more in line with human thinking. However, when people express content, the more common and more natural way is to use voice, so how to effectively or even real-time convert voice into knowledge graph when people are talking has become an urgent problem to be solved.
目前没有直接将语音转换为知识图谱的技术和产品,而且这两项技术的简单结合生成的知识图谱往往准确率较低,这是由于语音识别的误差在生成知识图谱的过程中会被放大,导致最终的知识图谱的准确率比较低。发明内容Currently, there is no technology or product that directly converts speech into a knowledge map, and the simple combination of these two technologies often generates a knowledge map with low accuracy. This is because the error of speech recognition will be amplified in the process of generating the knowledge map. As a result, the accuracy of the final knowledge map is relatively low. Summary of the invention
本发明实施例提供了一种知识图谱的生成方法和装置及计算机可读存储介质,能够直接将语音转换为知识图谱,且提高知识图谱的准确率。The embodiment of the present invention provides a method and device for generating a knowledge graph and a computer-readable storage medium, which can directly convert speech into a knowledge graph and improve the accuracy of the knowledge graph.
本发明实施例提供了一种知识图谱的生成方法,包括:The embodiment of the present invention provides a method for generating a knowledge graph, including:
将语音信号转换为文本信息;Convert the voice signal into text information;
对文本信息进行断句,在断句后的文本信息中相邻两个句子之间添加标点符号;To segment the text information, add punctuation marks between two adjacent sentences in the text information after the segmentation;
对添加标点符号的文本信息进行口语修正;Oral correction of the text information with punctuation marks;
根据口语修正后的文本信息生成知识图谱。Generate a knowledge graph based on the corrected text information of the spoken language.
在本发明实施例中,对添加标点符号的文本信息进行口语修正后,在根据口语修正后的文本信息生成知识图谱之前,该方法还包括:In the embodiment of the present invention, after the colloquial correction is performed on the text information to which the punctuation marks are added, before generating a knowledge graph based on the colloquial correction text information, the method further includes:
对口语修正后的文本信息进行断句和标点符号的调整;Adjust the sentence segmentation and punctuation of the corrected text information of the spoken language;
根据口语修正后的文本信息生成知识图谱包括:Generating a knowledge graph based on the corrected text information of the spoken language includes:
根据进行断句和标点符号的调整后的文本信息生成知识图谱。The knowledge graph is generated according to the adjusted text information of sentence segmentation and punctuation.
在本发明实施例中,在断句后的文本信息中相邻两个句子之间添加标点符号包括:In the embodiment of the present invention, adding punctuation marks between two adjacent sentences in the text information after sentence segmentation includes:
将断句后的文本信息依次输入到训练好的标点符号预测模型中预测相邻两个句子之间的标点符号;Input the text information after segmentation into the trained punctuation prediction model to predict the punctuation between two adjacent sentences;
将预测的标点符号添加到相邻两个句子之间。Add the predicted punctuation marks between two adjacent sentences.
在本发明实施例中,对添加标点符号的文本信息进行口语修正包括:In the embodiment of the present invention, the oral correction of the text information with punctuation marks includes:
去除添加标点符号的文本信息中的语气词和口头禅中的任意一个或多个。Remove any one or more of the tone words and mantras in the text information with punctuation marks.
在本发明实施例中,根据进行断句和标点符号的调整后的文本信息生成知识图谱包括:In the embodiment of the present invention, generating a knowledge graph based on the adjusted text information of sentence segmentation and punctuation includes:
从进行断句和标点符号的调整后的文本信息中抽取出知识要素,并以三元组列表的形式表达知识要素;Extract knowledge elements from the adjusted text information of sentence segmentation and punctuation, and express the knowledge elements in the form of a list of triples;
将三元组列表以可视化的形式绘制为知识图谱。The list of triples is drawn as a knowledge graph in a visual form.
本发明实施例提出了一种知识图谱的生成装置,包括处理器和计算机可读存储介质,计算机可读存储介质中存储有指令,当指令被处理器执行时,实现上述任一种知识图谱的生成方法。The embodiment of the present invention provides a device for generating a knowledge graph, which includes a processor and a computer-readable storage medium. The computer-readable storage medium stores instructions. When the instructions are executed by the processor, it realizes any of the above-mentioned knowledge graphs. Generation method.
在本发明实施例中,处理器还用于执行以下步骤:In the embodiment of the present invention, the processor is further configured to execute the following steps:
对添加标点符号的文本信息进行口语修正后,在根据口语修正后的文本信息生成知识图谱之前,对口语修正后的文本信息进行断句和标点符号的调整;After the colloquial correction of the text information with punctuation marks, before generating the knowledge graph based on the colloquial text information, the colloquial and punctuation adjustments are performed on the colloquially revised text information;
处理器用于通过以下步骤实现根据口语修正后的文本信息生成知识图谱:根据进行断句和标点符号的调整后的文本信息生成知识图谱。The processor is used for generating a knowledge graph based on the corrected text information of the spoken language through the following steps: generating a knowledge graph based on the adjusted text information of sentence segmentation and punctuation.
在本发明实施例中,处理器还用于通过以下步骤实现在断句后的文本信息中相邻两个句子之间添加标点符号:In the embodiment of the present invention, the processor is further configured to add punctuation marks between two adjacent sentences in the text information after sentence segmentation through the following steps:
将断句后的文本信息依次输入到训练好的标点符号预测模型中预测相邻两个句子之间的标点符号;Input the text information after segmentation into the trained punctuation prediction model to predict the punctuation between two adjacent sentences;
将预测的标点符号添加到相邻两个句子之间。Add the predicted punctuation marks between two adjacent sentences.
在本发明实施例中,处理器还用于通过以下步骤实现对添加标点符号的文本信息进行口语修正:In the embodiment of the present invention, the processor is further configured to implement the oral correction of the text information added with punctuation through the following steps:
去除添加标点符号的文本信息中的语气词和口头禅中的任意一个或多个。Remove any one or more of the tone words and mantras in the text information with punctuation marks.
本发明实施例提出了一种计算机可读存储介质,其上存储有计算机程序,计算机程序被处理器执行时实现上述任一种知识图谱的生成方法的步骤。The embodiment of the present invention provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the steps of any of the above-mentioned methods for generating a knowledge graph are realized.
本发明实施例包括:将语音信号转换为文本信息;对文本信息进行断句,在断句后的文本信息中相邻两个句子之间添加标点符号;对添加标点符号的文本信息进行口语修正;根据口语修正后的文本信息生成知识图谱。本发明实施例在将语音信息转换为文本信息后,对文本信息进行断句,添加标点符号和口语修正后,再生成知识图谱,由于对文本信息进行断句,添加标点符号和口语修正有助于分词,词性分析和句法分析,而生成知识图谱过程中往往需要进行分词,词性分析和句法分析,从而提高了知识图谱的准确率。The embodiment of the present invention includes: converting the speech signal into text information; segmenting the text information, adding punctuation marks between two adjacent sentences in the text information after the segmentation; performing oral correction on the text information with punctuation marks; The corrected text information of the spoken language generates a knowledge graph. In the embodiment of the present invention, after converting voice information into text information, the text information is segmented, punctuation marks and spoken language correction are added, and then a knowledge graph is generated. Because the text information is segmented, adding punctuation marks and spoken language correction is helpful for word segmentation , Part-of-speech analysis and syntactic analysis, and word segmentation, part-of-speech analysis and syntactic analysis are often required in the process of generating knowledge graphs, thereby improving the accuracy of knowledge graphs.
本发明实施例的其它特征和优点将在随后的说明书中阐述,并且,部分地从说明书中变得显而易见,或者通过实施本发明实施例而了解。本发明实施例的目的和其他优点可通过在说明书、权利要求书以及附图中所特别指出的结构来实现和获得。Other features and advantages of the embodiments of the present invention will be described in the following description, and partly become obvious from the description, or understood by implementing the embodiments of the present invention. The objectives and other advantages of the embodiments of the present invention can be realized and obtained through the structures specifically pointed out in the specification, claims and drawings.
附图说明Description of the drawings
附图用来提供对本发明实施例技术方案的进一步理解,并且构成说明书的一部分,与本发明实施例的实施例一起用于解释本发明实施例的技术方案,并不构成对本发明实施例技术方案的限制。The accompanying drawings are used to provide a further understanding of the technical solutions of the embodiments of the present invention, and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the technical solutions of the embodiments of the present invention, and do not constitute a technical solution to the embodiments of the present invention. limits.
图1为本发明一个实施例提出的知识图谱的生成方法的流程图;FIG. 1 is a flowchart of a method for generating a knowledge graph proposed by an embodiment of the present invention;
图2为本发明另一个实施例提出的知识图谱的生成装置的结构组成示意图。FIG. 2 is a schematic diagram of the structural composition of a device for generating a knowledge graph according to another embodiment of the present invention.
具体实施方式Detailed ways
下文中将结合附图对本发明实施例进行详细说明。需要说明的是,在不冲突的情况下,本发明中的实施例及实施例中的特征可以相互任意组合。Hereinafter, the embodiments of the present invention will be described in detail with reference to the accompanying drawings. It should be noted that, in the case of no conflict, the embodiments of the present invention and the features in the embodiments can be combined with each other arbitrarily.
在附图的流程图示出的步骤可以在诸如一组计算机可执行指令的计算机***中执行。并且,虽然在流程图中示出了逻辑顺序,但是在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤。The steps shown in the flowcharts of the drawings may be executed in a computer system such as a set of computer-executable instructions. And, although a logical sequence is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than here.
参见图1,本发明一个实施例提出了一种知识图谱的生成方法,包括:Referring to Fig. 1, an embodiment of the present invention proposes a method for generating a knowledge graph, including:
步骤100、将语音信号转换为文本信息。Step 100: Convert the voice signal into text information.
步骤101、对文本信息进行断句,在断句后的文本信息中相邻两个句子之间添加标点符号。Step 101: Perform sentence segmentation on the text information, and add punctuation marks between two adjacent sentences in the text information after the sentence segmentation.
在一个示例性实例中,在断句后的文本信息中相邻两个句子之间添加标点符号包括:将断句后的文本信息依次输入到训练好的标点符号预测模型中预测相邻两个句子之间的标点符号(如逗号、句号、省略号等),将预测的标点符号添加到相邻两个句子之间。In an exemplary example, adding punctuation marks between two adjacent sentences in the sentenced text information includes: sequentially inputting the sentenced text information into the trained punctuation prediction model to predict the difference between two adjacent sentences. Between the punctuation marks (such as comma, period, ellipsis, etc.), the predicted punctuation marks are added between two adjacent sentences.
在一个示例性实例中,标点符号预测模型可以采用以下任意一种方式训练。In an illustrative example, the punctuation prediction model can be trained in any of the following ways.
(一)将标点符号预测问题当作语言模型问题,把标点符号作为普通的单词对待,根据语料集训练n-gram语言模型,计算给定前n个单词的条件下,下一个为标点符号的概率。也就是说,给定前边n个单词,计算第n+1个单词的概率,在候选的所有词中,选择出现概率最高的单词作为 第n+1个单词。(1) Treat the punctuation prediction problem as a language model problem, treat the punctuation marks as ordinary words, train the n-gram language model according to the corpus, and calculate the first n words, the next one is the punctuation mark Probability. In other words, given the first n words, calculate the probability of the n+1th word, and select the word with the highest occurrence probability as the n+1th word among all the candidate words.
(二)将标点符号预测问题当作分类问题,对于无标点符号的句子中的每个位置,根据其前边n个字符判断当前位置是否应该添加标点符号。分类模型可以使用长短期记忆网络(LSTM,Long Short-Term Memory),不断将字符依次输入该LSTM,每次判断输出下一个字符是否为标点符号,如果是的话应该是哪个标点符号。另外,分类模型还可以选择双向长短期记忆网络(Bi-LSTM)作为训练模型,该模型与LSTM相比,其优点是不但能够使用上文中的字符,还能够使用下文中的字符作为特征,去预测当前字符的后边是否应接标点符号。(2) Regarding the punctuation prediction problem as a classification problem, for each position in a sentence without punctuation, judge whether the current position should add punctuation according to the n characters in front of it. The classification model can use Long Short-Term Memory (LSTM) to continuously input characters into the LSTM, and each time it is judged whether the next character is a punctuation mark, and if so, which punctuation mark should be. In addition, the classification model can also choose Bi-LSTM as a training model. Compared with LSTM, this model has the advantage of not only being able to use the above characters, but also the following characters as features. Predict whether the current character should be followed by punctuation marks.
步骤102、对添加标点符号的文本信息进行口语修正。Step 102: Perform oral correction on the text information added with punctuation marks.
在一个示例性实例中,对添加标点符号的文本信息进行口语修正包括:去除添加标点符号的文本信息中的语气词和口头禅中的任意一个或多个。In an exemplary embodiment, performing oral correction on the punctuation-added text information includes: removing any one or more of the mood word and the mantra in the punctuation-added text information.
在一个示例性实例中,语气词可以为:“嗯”、“啊”等,口头禅可以为:“这个”、“那个”、“对吧”、“是吧”等。In an exemplary example, the modal particle may be: "um", "ah", etc., and the mantra may be: "this", "that", "right", "right", etc.
在一个示例性实例中,使用语气词和口头禅的词典来存储预先获得的语气词和口头禅,如:前后都是语气词的“这个、那个”;连续的“嗯嗯嗯、啊啊啊”缩短为一个。In an exemplary example, a dictionary of modal particles and mantras is used to store pre-obtained modal particles and mantras, such as: "this, that" with modal particles before and after; consecutive "um, ah, ah," shortened For one.
步骤103、根据口语修正后的文本信息生成知识图谱。Step 103: Generate a knowledge graph based on the corrected text information of the spoken language.
在一个示例性实例中,根据口语修正后的文本信息生成知识图谱包括:In an illustrative example, generating a knowledge graph based on the corrected text information of the spoken language includes:
从口语修正后的文本信息中抽取出知识要素,以三元组列表的形式表达知识要素,将三元组列表以可视化的形式绘制在一张图上,所绘制的图为知识图谱。The knowledge elements are extracted from the corrected text information of the spoken language, and the knowledge elements are expressed in the form of a list of triples, and the list of triples is drawn on a graph in a visual form, and the drawn graph is a knowledge graph.
在一个示例性实例中,上述知识要素可以包括但不限于:概念、实体、关系、属性。In an exemplary instance, the above-mentioned knowledge elements may include, but are not limited to: concepts, entities, relationships, and attributes.
在一个示例性实例中,上述三元组可以包括但不限于:参数1,关系,参数2。In an exemplary example, the foregoing triplet may include but is not limited to: parameter 1, relationship, parameter 2.
在一个示例性实例中,参数1为表示实体、概念或属性的名词,参数 2为表示实体或概念的名词,或者具体的数值、地理位置、日期等,关系为表示关系的动词或名词。In an exemplary example, parameter 1 is a noun representing an entity, concept or attribute, parameter 2 is a noun representing an entity or concept, or a specific value, geographic location, date, etc., and a relationship is a verb or noun representing a relationship.
例如,(M科学院,成立于,2018年),(M科学院,定位,人工智能研究与落地),(M科学院,发力点,大数据),(M科学院,发力点,大知识),(M科学院,发力点,大智慧)均为三元组。For example, (M Academy of Sciences, established in 2018), (M Academy of Sciences, positioning, artificial intelligence research and landing), (M Academy of Sciences, power point, big data), (M Academy of Sciences, power point, big knowledge), (M Academy of Sciences, Power Point, Great Wisdom) are all triples.
在本发明另一个实施例中,对添加标点符号的文本信息进行口语修正后,在根据口语修正后的文本信息生成知识图谱之前,该方法还包括:In another embodiment of the present invention, after the colloquial correction is performed on the text information to which the punctuation marks are added, before generating a knowledge graph based on the colloquial correction text information, the method further includes:
对口语修正后的文本信息进行断句和标点符号的调整;Adjust the sentence segmentation and punctuation of the corrected text information of the spoken language;
相应的,所述根据口语修正后的文本信息生成知识图谱包括:Correspondingly, the generating a knowledge graph based on the corrected text information of the spoken language includes:
根据进行断句和标点符号的调整后的文本信息生成所述知识图谱。The knowledge graph is generated according to the adjusted text information of sentence segmentation and punctuation.
在本发明实施例中,可以在接收到完整的语音信号后,再将完整的语音信号转换为文本信息,并执行后续流程;也可以在接收语音信号的过程中实时将语音信号转换为文本信息,并实时执行后续流程。In the embodiment of the present invention, after receiving the complete voice signal, the complete voice signal can be converted into text information, and the subsequent process can be executed; the voice signal can also be converted into text information in real time during the process of receiving the voice signal , And execute subsequent processes in real time.
当在接收语音信号的过程中实时将语音信号转换为文本信息,并实时执行后续流程时,随着文本信息的增长,需要对之前的结果做断句和标点符号的调整,进一步提高准确度。When the voice signal is converted into text information in real time during the process of receiving the voice signal, and the subsequent process is executed in real time, as the text information grows, it is necessary to make adjustments to the previous results and punctuation to further improve the accuracy.
在一个示例性实例中,根据进行断句和标点符号的调整后的文本信息生成知识图谱包括:In an exemplary embodiment, generating a knowledge graph based on the adjusted text information of sentence segmentation and punctuation includes:
从进行断句和标点符号的调整后的文本信息中抽取出知识要素,以三元组列表的形式表达知识要素,将三元组列表以可视化的形式绘制在一张图上,所绘制的图为知识图谱。The knowledge elements are extracted from the text information after the adjustment of sentence segmentation and punctuation, and the knowledge elements are expressed in the form of a list of triples, and the list of triples is drawn on a graph in a visual form. The drawn graph is Knowledge graph.
本发明实施例在将语音信息转换为文本信息后,对文本信息进行断句,添加标点符号和口语修正后,再生成知识图谱,由于对文本信息进行断句,添加标点符号和口语修正有助于分词,词性分析和句法分析,而生成知识图谱过程中往往需要进行分词,词性分析和句法分析,从而提高了知识图谱的准确率。In the embodiment of the present invention, after converting voice information into text information, the text information is segmented, punctuation marks and spoken language correction are added, and then a knowledge graph is generated. Because the text information is segmented, adding punctuation marks and spoken language correction is helpful for word segmentation , Part-of-speech analysis and syntactic analysis, and word segmentation, part-of-speech analysis and syntactic analysis are often required in the process of generating knowledge graphs, thereby improving the accuracy of knowledge graphs.
本发明另一个实施例提出了一种知识图谱的生成装置,包括处理器和 计算机可读存储介质,所述计算机可读存储介质中存储有指令,当所述指令被所述处理器执行时,实现上述任一种知识图谱的生成方法。Another embodiment of the present invention provides an apparatus for generating a knowledge graph, which includes a processor and a computer-readable storage medium. The computer-readable storage medium stores instructions. When the instructions are executed by the processor, Realize any of the above-mentioned methods for generating knowledge graphs.
本发明另一个实施例提出了一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现上述任一种知识图谱的生成方法的步骤。Another embodiment of the present invention provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the steps of any of the above-mentioned methods for generating a knowledge graph are realized.
参见图2,本发明另一个实施例提出了一种知识图谱的生成装置,包括:Referring to Fig. 2, another embodiment of the present invention provides a knowledge graph generating device, including:
语音识别模块201,设置为将语音信号转换为文本信息;The speech recognition module 201 is configured to convert the speech signal into text information;
文本处理模块202,设置为对文本信息进行断句,在断句后的文本信息中相邻两个句子之间添加标点符号;对添加标点符号的文本信息进行口语修正;The text processing module 202 is configured to segment the text information, add punctuation marks between two adjacent sentences in the text information after the sentence segmentation; and make oral corrections to the text information with the added punctuation marks;
知识图谱生成模块203,设置为根据口语修正后的文本信息生成知识图谱。The knowledge graph generating module 203 is configured to generate a knowledge graph based on the corrected text information of the spoken language.
在一个示例性实例中,文本处理模块202具体设置为采用以下方式实现在断句后的文本信息中相邻两个句子之间添加标点符号:将断句后的文本信息依次输入到训练好的标点符号预测模型中预测相邻两个句子之间的标点符号(如逗号、句号、省略号等),将预测的标点符号添加到相邻两个句子之间。In an exemplary example, the text processing module 202 is specifically configured to add punctuation marks between two adjacent sentences in the segmented text information in the following manner: input the segmented text information into the trained punctuation marks in sequence The prediction model predicts the punctuation between two adjacent sentences (such as comma, period, ellipsis, etc.), and adds the predicted punctuation between two adjacent sentences.
在一个示例性实例中,文本处理模块202可以采用以下任意一种方式训练标点符号预测模型。In an illustrative example, the text processing module 202 may use any of the following methods to train the punctuation prediction model.
(一)将标点符号预测问题当作语言模型问题,把标点符号作为普通的单词对待,根据语料集训练n-gram语言模型,计算给定前n个单词的条件下,下一个为标点符号的概率。也就是说,给定前边n个单词,计算第n+1个单词的概率,在候选的所有词中,选择出现概率最高的单词作为第n+1个单词。(1) Treat the punctuation prediction problem as a language model problem, treat the punctuation marks as ordinary words, train the n-gram language model according to the corpus, and calculate the first n words, the next one is the punctuation mark Probability. In other words, given the first n words, calculate the probability of the n+1th word, and select the word with the highest occurrence probability as the n+1th word among all the candidate words.
(二)将标点符号预测问题当作分类问题,对于无标点符号的句子中的每个位置,根据其前边n个字符判断当前位置是否应该添加标点符号。 分类模型可以使用长短期记忆网络(LSTM,Long Short-Term Memory),不断将字符依次输入该LSTM,每次判断输出下一个字符是否为标点符号,如果是的话应该是哪个标点符号。另外,分类模型还可以选择双向长短期记忆网络(Bi-LSTM)作为训练模型,该模型与LSTM相比,其优点是不但能够使用上文中的字符,还能够使用下文中的字符作为特征,去预测当前字符的后边是否应接标点符号。(2) Regarding the punctuation prediction problem as a classification problem, for each position in a sentence without punctuation, judge whether the current position should add punctuation according to the n characters in front of it. The classification model can use Long Short-Term Memory (LSTM) to continuously input characters into the LSTM, and each time it is judged whether the next character is a punctuation mark, and if so, which punctuation mark should be. In addition, the classification model can also choose Bi-LSTM as a training model. Compared with LSTM, this model has the advantage of not only being able to use the above characters, but also the following characters as features. Predict whether the current character should be followed by punctuation marks.
在一个示例性实例中,文本处理模块202具体设置为采用以下方式实现对添加标点符号的文本信息进行口语修正:去除添加标点符号的文本信息中的语气词和口头禅中的任意一个或多个。In an exemplary embodiment, the text processing module 202 is specifically configured to implement the oral correction of the punctuation-added text information in the following manner: removing any one or more of the mood word and the mantra in the punctuation-added text information.
在一个示例性实例中,语气词可以为“嗯”、“啊”等,口头禅可以为:“这个”、“那个”、“对吧”、“是吧”等。In an exemplary example, the modal particle may be "um", "ah", etc., and the mantra may be: "this", "that", "right", "right", etc.
在一个示例性实例中,使用语气词和口头禅的词典来存储预先获得的语气词和口头禅,如:前后都是语气词的“这个、那个”;连续的“嗯嗯嗯、啊啊啊”缩短为一个。In an exemplary example, a dictionary of modal particles and mantras is used to store pre-obtained modal particles and mantras, such as: "this, that" with modal particles before and after; consecutive "um, ah, ah," shortened For one.
在一个示例性实例中,知识图谱生成模块203具体设置为:In an exemplary embodiment, the knowledge graph generation module 203 is specifically configured as:
从口语修正后的文本信息中抽取出知识要素,以三元组列表的形式表达知识要素,将三元组列表以可视化的形式绘制在一张图上,所绘制的图为知识图谱。The knowledge elements are extracted from the corrected text information of the spoken language, and the knowledge elements are expressed in the form of a list of triples, and the list of triples is drawn on a graph in a visual form, and the drawn graph is a knowledge graph.
在一个示例性实例中,上述知识要素可以包括但不限于:概念、实体、关系、属性。In an exemplary instance, the above-mentioned knowledge elements may include, but are not limited to: concepts, entities, relationships, and attributes.
在一个示例性实例中,上述三元组可以包括但不限于:参数1,关系,参数2。In an exemplary example, the foregoing triplet may include but is not limited to: parameter 1, relationship, parameter 2.
在一个示例性实例中,参数1为表示实体、概念或属性的名词,参数2为表示实体或概念的名词,或者具体的数值、地理位置、日期等,关系为表示关系的动词或名词。In an exemplary example, parameter 1 is a noun representing an entity, concept or attribute, parameter 2 is a noun representing an entity or concept, or a specific value, geographic location, date, etc., and a relationship is a verb or noun representing a relationship.
例如,(M科学院,成立于,2018年),(M科学院,定位,人工智能研究与落地),(M科学院,发力点,大数据),(M科学院,发力 点,大知识),(M科学院,发力点,大智慧)均为三元组。For example, (M Academy of Sciences, established in 2018), (M Academy of Sciences, positioning, artificial intelligence research and landing), (M Academy of Sciences, power point, big data), (M Academy of Sciences, power point, big knowledge), (M Academy of Sciences, Power Point, Great Wisdom) are all triples.
在本发明另一个实施例中,文本处理模块202还设置为:In another embodiment of the present invention, the text processing module 202 is further configured to:
对口语修正后的文本信息进行断句和标点符号的调整;Adjust the sentence segmentation and punctuation of the corrected text information of the spoken language;
知识图谱生成模块203具体设置为:The knowledge graph generation module 203 is specifically set as follows:
根据进行断句和标点符号的调整后的文本信息生成所述知识图谱。The knowledge graph is generated according to the adjusted text information of sentence segmentation and punctuation.
在本发明实施例中,可以在接收到完整的语音信号后,再将完整的语音信号转换为文本信息,并执行后续流程;也可以在接收语音信号的过程中实时将语音信号转换为文本信息,并实时执行后续流程。In the embodiment of the present invention, after receiving the complete voice signal, the complete voice signal can be converted into text information, and the subsequent process can be executed; the voice signal can also be converted into text information in real time during the process of receiving the voice signal , And execute the follow-up process in real time.
当在接收语音信号的过程中实时将语音信号转换为文本信息,并实时执行后续流程时,随着文本信息的增长,需要对之前的结果做断句和标点符号的调整,进一步提高准确度。When the voice signal is converted into text information in real time during the process of receiving the voice signal, and the subsequent process is executed in real time, as the text information grows, it is necessary to make adjustments to the previous results and punctuation to further improve the accuracy.
在一个示例性实例中,知识图谱生成模块203具体设置为:In an exemplary embodiment, the knowledge graph generation module 203 is specifically configured as:
从进行断句和标点符号的调整后的文本信息中抽取出知识要素,以三元组列表的形式表达知识要素,将三元组列表以可视化的形式绘制在一张图上,所绘制的图为知识图谱。The knowledge elements are extracted from the text information after the adjustment of sentence segmentation and punctuation, and the knowledge elements are expressed in the form of a list of triples, and the list of triples is drawn on a graph in a visual form. The drawn graph is Knowledge graph.
本发明实施例在将语音信息转换为文本信息后,对文本信息进行断句,添加标点符号和口语修正后,再生成知识图谱,由于对文本信息进行断句,添加标点符号和口语修正有助于分词,词性分析和句法分析,而生成知识图谱过程中往往需要进行分词,词性分析和句法分析,从而提高了知识图谱的准确率。In the embodiment of the present invention, after converting voice information into text information, the text information is segmented, punctuation marks and spoken language correction are added, and then a knowledge graph is generated. Because the text information is segmented, adding punctuation marks and spoken language correction is helpful for word segmentation , Part-of-speech analysis and syntactic analysis, and word segmentation, part-of-speech analysis and syntactic analysis are often required in the process of generating knowledge graphs, thereby improving the accuracy of knowledge graphs.
本领域普通技术人员可以理解,上文中所公开方法中的全部或某些步骤、***、装置中的功能模块/单元可以被实施为软件、固件、硬件及其适当的组合。A person of ordinary skill in the art can understand that all or some of the steps, functional modules/units in the system, and apparatus in the methods disclosed above can be implemented as software, firmware, hardware, and appropriate combinations thereof.
在硬件实施方式中,在以上描述中提及的功能模块/单元之间的划分不一定对应于物理组件的划分;例如,一个物理组件可以具有多个功能,或者一个功能或步骤可以由若干物理组件合作执行。某些组件或所有组件可以被实施为由处理器,如数字信号处理器或微处理器执行的软件,或者被 实施为硬件,或者被实施为集成电路,如专用集成电路。这样的软件可以分布在计算机可读介质上,计算机可读介质可以包括计算机存储介质(或非暂时性介质)和通信介质(或暂时性介质)。In the hardware implementation, the division between functional modules/units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may consist of several physical components. The components are executed cooperatively. Some or all of the components may be implemented as software executed by a processor, such as a digital signal processor or a microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on a computer-readable medium, and the computer-readable medium may include a computer storage medium (or a non-transitory medium) and a communication medium (or a transitory medium).
如本领域普通技术人员公知的,术语计算机存储介质包括在用于存储信息(诸如计算机可读指令、数据结构、程序模块或其他数据)的任何方法或技术中实施的易失性和非易失性、可移除和不可移除介质。计算机存储介质包括但不限于RAM、ROM、EEPROM、闪存或其他存储器技术、CD-ROM、数字多功能盘(DVD)或其他光盘存储、磁盒、磁带、磁盘存储或其他磁存储装置、或者可以用于存储期望的信息并且可以被计算机访问的任何其他的介质。此外,本领域普通技术人员公知的是,通信介质通常包含计算机可读指令、数据结构、程序模块或者诸如载波或其他传输机制之类的调制数据信号中的其他数据,并且可包括任何信息递送介质。As is well known to those of ordinary skill in the art, the term computer storage medium includes volatile and non-volatile data implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Sexual, removable and non-removable media. Computer storage media include but are not limited to RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disk (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or Any other medium used to store desired information and that can be accessed by a computer. In addition, as is well known to those of ordinary skill in the art, communication media usually contain computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as carrier waves or other transmission mechanisms, and may include any information delivery media. .
可选地,在本实施例中,上述计算机可读的存储介质可以被设置为存储用于执行以下步骤的计算机程序:Optionally, in this embodiment, the foregoing computer-readable storage medium may be configured to store a computer program for executing the following steps:
S1,将语音信号转换为文本信息;S1: Convert the voice signal into text information;
S2,对文本信息进行断句,在断句后的文本信息中相邻两个句子之间添加标点符号;S2, the text information is segmented, and punctuation marks are added between two adjacent sentences in the text information after the segmentation;
S3,对添加标点符号的文本信息进行口语修正;S3, make oral corrections to the text information with punctuation marks;
S4,根据口语修正后的文本信息生成知识图谱。S4, generating a knowledge graph based on the corrected text information of the spoken language.
上述本发明实施例序号仅仅为了描述,不代表实施例的优劣。The sequence numbers of the above-mentioned embodiments of the present invention are only for description, and do not represent the advantages and disadvantages of the embodiments.
上述实施例中的集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在上述计算机可读取的存储介质中。基于这样的理解,本发明的技术方案本质上或者说对相关技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在存储介质中,包括若干指令用以使得一台或多台计算机设备(可为个人计算机、服务器或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。If the integrated unit in the foregoing embodiment is implemented in the form of a software functional unit and sold or used as an independent product, it may be stored in the foregoing computer-readable storage medium. Based on this understanding, the technical solution of the present invention essentially or the part that contributes to the related technology or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including Several instructions are used to make one or more computer devices (which may be personal computers, servers, or network devices, etc.) execute all or part of the steps of the methods described in the various embodiments of the present invention.
在本发明的上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。In the above-mentioned embodiments of the present invention, the description of each embodiment has its own focus. For parts that are not described in detail in an embodiment, reference may be made to related descriptions of other embodiments.
在本申请所提供的几个实施例中,应该理解到,所揭露的客户端,可通过其它的方式实现。其中,以上所描述的装置实施例仅仅是示意性的,例如所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个***,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,单元或模块的间接耦合或通信连接,可以是电性或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed client can be implemented in other ways. The device embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods, for example, multiple units or components may be combined or may be Integrate into another system, or some features can be ignored or not implemented. In addition, the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, units or modules, and may be in electrical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。虽然本发明实施例所揭露的实施方式如上,但所述的内容仅为便于理解本发明实施例而采用的实施方式,并非用以限定本发明实施例。任何本发明实施例所属领域内的技术人员,在不脱离本发明实施例所揭露的精神和范围的前提下,可以在实施的形式及细节上进行任何的修改与变化,但本发明实施例的专利保护范围,仍须以所附的权利要求书所界定的范围为准。In addition, the functional units in the various embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or software functional unit. Although the implementation manners disclosed in the embodiments of the present invention are as described above, the contents described are only implementation manners used to facilitate the understanding of the embodiments of the present invention, and are not intended to limit the embodiments of the present invention. Any person skilled in the art of the embodiments of the present invention can make any modifications and changes in the implementation form and details without departing from the spirit and scope disclosed by the embodiments of the present invention. The scope of patent protection shall still be subject to the scope defined by the appended claims.
工业实用性Industrial applicability
本发明实施例包括:将语音信号转换为文本信息;对文本信息进行断句,在断句后的文本信息中相邻两个句子之间添加标点符号;对添加标点符号的文本信息进行口语修正;根据口语修正后的文本信息生成知识图谱。本发明实施例在将语音信息转换为文本信息后,对文本信息进行断句,添加标点符号和口语修正后,再生成知识图谱,由于对文本信息进行断句, 添加标点符号和口语修正有助于分词,词性分析和句法分析,而生成知识图谱过程中往往需要进行分词,词性分析和句法分析,从而提高了知识图谱的准确率。The embodiment of the present invention includes: converting the speech signal into text information; segmenting the text information, adding punctuation marks between two adjacent sentences in the text information after the segmentation; performing oral correction on the text information with punctuation marks; The corrected text information of the spoken language generates a knowledge graph. In the embodiment of the present invention, after converting the voice information into text information, the text information is segmented, punctuation marks and spoken language correction are added, and then a knowledge graph is generated. Because the text information is segmented, adding punctuation marks and spoken language correction is helpful for word segmentation , Part-of-speech analysis and syntactic analysis, and word segmentation, part-of-speech analysis and syntactic analysis are often required in the process of generating knowledge graphs, thereby improving the accuracy of knowledge graphs.

Claims (10)

  1. 一种知识图谱的生成方法,包括:A method for generating knowledge graphs, including:
    将语音信号转换为文本信息;Convert the voice signal into text information;
    对文本信息进行断句,在断句后的文本信息中相邻两个句子之间添加标点符号;To segment the text information, add punctuation marks between two adjacent sentences in the text information after the segmentation;
    对添加标点符号的文本信息进行口语修正;Oral correction of the text information with punctuation marks;
    根据口语修正后的文本信息生成知识图谱。Generate a knowledge graph based on the corrected text information of the spoken language.
  2. 根据权利要求1所述的生成方法,其中,所述对添加标点符号的文本信息进行口语修正后,在根据口语修正后的文本信息生成知识图谱之前,该方法还包括:The generating method according to claim 1, wherein after the oral correction is performed on the text information with punctuation marks, the method further comprises: before generating a knowledge graph based on the corrected text information of the spoken language, the method further comprises:
    对口语修正后的文本信息进行断句和标点符号的调整;Adjust the sentence segmentation and punctuation of the corrected text information of the spoken language;
    所述根据口语修正后的文本信息生成知识图谱包括:The generating a knowledge graph based on the corrected text information of the spoken language includes:
    根据进行断句和标点符号的调整后的文本信息生成所述知识图谱。The knowledge graph is generated according to the adjusted text information of sentence segmentation and punctuation.
  3. 根据权利要求1或2所述的生成方法,其中,所述在断句后的文本信息中相邻两个句子之间添加标点符号包括:The generating method according to claim 1 or 2, wherein the adding punctuation marks between two adjacent sentences in the text information after the sentence segmentation comprises:
    将断句后的文本信息依次输入到训练好的标点符号预测模型中预测相邻两个句子之间的标点符号;Input the text information after segmentation into the trained punctuation prediction model to predict the punctuation between two adjacent sentences;
    将预测的标点符号添加到相邻两个句子之间。Add the predicted punctuation marks between two adjacent sentences.
  4. 根据权利要求1或2所述的生成方法,其中,所述对添加标点符号的文本信息进行口语修正包括:The generating method according to claim 1 or 2, wherein said correcting the text information added with punctuation marks in spoken language comprises:
    去除所述添加标点符号的文本信息中的语气词和口头禅中的任意一个或多个。Remove any one or more of modal particles and mantras in the punctuation-added text information.
  5. 根据权利要求2所述的生成方法,其中,所述根据进行断句和标点符号的调整后的文本信息生成所述知识图谱包括:The generating method according to claim 2, wherein the generating the knowledge graph according to the adjusted text information of sentence segmentation and punctuation includes:
    从进行断句和标点符号的调整后的文本信息中抽取出知识要素,并以 三元组列表的形式表达所述知识要素;Extract knowledge elements from the text information after the adjustment of sentence segmentation and punctuation marks, and express the knowledge elements in the form of a list of triples;
    将所述三元组列表以可视化的形式绘制为所述知识图谱。The list of triples is drawn as the knowledge graph in a visual form.
  6. 一种知识图谱的生成装置,包括处理器和计算机可读存储介质,所述计算机可读存储介质中存储有指令,当所述指令被所述处理器执行时,实现如权利要求1~5任一项所述的知识图谱的生成方法。A device for generating a knowledge graph, comprising a processor and a computer-readable storage medium. The computer-readable storage medium stores instructions. When the instructions are executed by the processor, any of claims 1 to 5 can be implemented. The method for generating the knowledge graph described in one item.
  7. 根据权利要求6所述的生成装置,其中,所述处理器还用于执行以下步骤:The generating device according to claim 6, wherein the processor is further configured to perform the following steps:
    所述对添加标点符号的文本信息进行口语修正后,在根据口语修正后的文本信息生成知识图谱之前,对口语修正后的文本信息进行断句和标点符号的调整;After the colloquial correction of the text information with punctuation marks is performed, sentence segmentation and punctuation adjustment are performed on the colloquial correction text information before generating a knowledge graph based on the colloquial text information;
    所述处理器用于通过以下步骤实现所述根据口语修正后的文本信息生成知识图谱:根据进行断句和标点符号的调整后的文本信息生成所述知识图谱。The processor is configured to realize the generating of the knowledge graph based on the corrected text information of the spoken language by the following steps: generating the knowledge graph based on the adjusted text information of sentence segmentation and punctuation.
  8. 根据权利要求6或7所述的生成装置,其中,所述处理器还用于通过以下步骤实现所述在断句后的文本信息中相邻两个句子之间添加标点符号:The generating device according to claim 6 or 7, wherein the processor is further configured to implement the adding punctuation marks between two adjacent sentences in the text information after sentence segmentation through the following steps:
    将断句后的文本信息依次输入到训练好的标点符号预测模型中预测相邻两个句子之间的标点符号;Input the text information after segmentation into the trained punctuation prediction model to predict the punctuation between two adjacent sentences;
    将预测的标点符号添加到相邻两个句子之间。Add the predicted punctuation marks between two adjacent sentences.
  9. 根据权利要求6或7所述的生成装置,其中,所述处理器还用于通过以下步骤实现所述对添加标点符号的文本信息进行口语修正:The generating device according to claim 6 or 7, wherein the processor is further configured to implement the oral correction of the text information with punctuation marks through the following steps:
    去除所述添加标点符号的文本信息中的语气词和口头禅中的任意一个或多个。Remove any one or more of modal particles and mantras in the punctuation-added text information.
  10. 一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现如权利要求1~5任一项所述的知识图谱的生成方法的步骤。A computer-readable storage medium with a computer program stored thereon, and when the computer program is executed by a processor, the steps of the method for generating a knowledge graph according to any one of claims 1 to 5 are realized.
PCT/CN2020/093056 2020-01-14 2020-05-28 Method and device for generating knowledge graph, and computer readable storage medium WO2021143014A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010038200.1 2020-01-14
CN202010038200.1A CN111259163A (en) 2020-01-14 2020-01-14 Knowledge graph generation method and device and computer readable storage medium

Publications (1)

Publication Number Publication Date
WO2021143014A1 true WO2021143014A1 (en) 2021-07-22

Family

ID=70952839

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/093056 WO2021143014A1 (en) 2020-01-14 2020-05-28 Method and device for generating knowledge graph, and computer readable storage medium

Country Status (2)

Country Link
CN (1) CN111259163A (en)
WO (1) WO2021143014A1 (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6598043B1 (en) * 1999-10-04 2003-07-22 Jarg Corporation Classification of information sources using graph structures
CN106156365A (en) * 2016-08-03 2016-11-23 北京智能管家科技有限公司 A kind of generation method and device of knowledge mapping
CN107633005A (en) * 2017-08-09 2018-01-26 广州思涵信息科技有限公司 A kind of knowledge mapping structure, comparison system and method based on class teaching content
CN110297907A (en) * 2019-06-28 2019-10-01 谭浩 Generate method, computer readable storage medium and the terminal device of interview report
CN110543574A (en) * 2019-08-30 2019-12-06 北京百度网讯科技有限公司 knowledge graph construction method, device, equipment and medium

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8407165B2 (en) * 2011-06-15 2013-03-26 Ceresis, Llc Method for parsing, searching and formatting of text input for visual mapping of knowledge information
CN104142915B (en) * 2013-05-24 2016-02-24 腾讯科技(深圳)有限公司 A kind of method and system adding punctuate
CN107247706B (en) * 2017-06-16 2021-06-25 中国电子技术标准化研究院 Text sentence-breaking model establishing method, sentence-breaking method, device and computer equipment
CN108549628B (en) * 2018-03-16 2021-08-27 云知声智能科技股份有限公司 Sentence-breaking device and method for stream type natural language information
CN109255115B (en) * 2018-10-19 2023-04-07 科大讯飞股份有限公司 Text punctuation adjustment method and device
CN109708256B (en) * 2018-12-06 2020-07-03 珠海格力电器股份有限公司 Voice determination method and device, storage medium and air conditioner
CN109684638B (en) * 2018-12-24 2023-08-11 北京金山安全软件有限公司 Clause method and device, electronic equipment and computer readable storage medium
CN110457466A (en) * 2019-06-28 2019-11-15 谭浩 Generate method, computer readable storage medium and the terminal device of interview report

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6598043B1 (en) * 1999-10-04 2003-07-22 Jarg Corporation Classification of information sources using graph structures
CN106156365A (en) * 2016-08-03 2016-11-23 北京智能管家科技有限公司 A kind of generation method and device of knowledge mapping
CN107633005A (en) * 2017-08-09 2018-01-26 广州思涵信息科技有限公司 A kind of knowledge mapping structure, comparison system and method based on class teaching content
CN110297907A (en) * 2019-06-28 2019-10-01 谭浩 Generate method, computer readable storage medium and the terminal device of interview report
CN110543574A (en) * 2019-08-30 2019-12-06 北京百度网讯科技有限公司 knowledge graph construction method, device, equipment and medium

Also Published As

Publication number Publication date
CN111259163A (en) 2020-06-09

Similar Documents

Publication Publication Date Title
US10176804B2 (en) Analyzing textual data
US12039286B2 (en) Automatic post-editing model for generated natural language text
US10672391B2 (en) Improving automatic speech recognition of multilingual named entities
US9805718B2 (en) Clarifying natural language input using targeted questions
US9317501B2 (en) Data security system for natural language translation
JP6334815B2 (en) Learning apparatus, method, program, and spoken dialogue system
WO2018045646A1 (en) Artificial intelligence-based method and device for human-machine interaction
US11699074B2 (en) Training sequence generation neural networks using quality scores
US10997223B1 (en) Subject-specific data set for named entity resolution
US10896222B1 (en) Subject-specific data set for named entity resolution
WO2020133039A1 (en) Entity identification method and apparatus in dialogue corpus, and computer device
WO2021027029A1 (en) Data processing method and device, computer apparatus, and storage medium
WO2020052069A1 (en) Method and apparatus for word segmentation
US10474747B2 (en) Adjusting time dependent terminology in a question and answer system
JP6306376B2 (en) Translation apparatus and translation method
US11961515B2 (en) Contrastive Siamese network for semi-supervised speech recognition
US20190005950A1 (en) Intention estimation device and intention estimation method
US11620981B2 (en) Speech recognition error correction apparatus
JP2013083897A (en) Recognition device, recognition program, recognition method, generation device, generation program and generation method
US10319378B2 (en) Interaction apparatus and method
KR20190074508A (en) Method for crowdsourcing data of chat model for chatbot
CN111126084A (en) Data processing method and device, electronic equipment and storage medium
WO2021143014A1 (en) Method and device for generating knowledge graph, and computer readable storage medium
JP2022088586A (en) Voice recognition method, voice recognition device, electronic apparatus, storage medium computer program product and computer program
CN114218431A (en) Video searching method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20913401

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20913401

Country of ref document: EP

Kind code of ref document: A1

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

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

122 Ep: pct application non-entry in european phase

Ref document number: 20913401

Country of ref document: EP

Kind code of ref document: A1