WO2021008180A1 - 面向软件缺陷知识的知识搜索方法 - Google Patents

面向软件缺陷知识的知识搜索方法 Download PDF

Info

Publication number
WO2021008180A1
WO2021008180A1 PCT/CN2020/085878 CN2020085878W WO2021008180A1 WO 2021008180 A1 WO2021008180 A1 WO 2021008180A1 CN 2020085878 W CN2020085878 W CN 2020085878W WO 2021008180 A1 WO2021008180 A1 WO 2021008180A1
Authority
WO
WIPO (PCT)
Prior art keywords
triples
entity
matching
semantic
question
Prior art date
Application number
PCT/CN2020/085878
Other languages
English (en)
French (fr)
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 WO2021008180A1 publication Critical patent/WO2021008180A1/zh

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/33Querying
    • G06F16/3331Query processing
    • G06F16/334Query execution
    • G06F16/3344Query execution using natural language analysis
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/366Software debugging using diagnostics
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Definitions

  • the invention belongs to the field of software development and maintenance, and particularly relates to a knowledge search method for software defect knowledge.
  • Defects are problems that must be faced during software maintenance. With the advent of the network big data era, more and more software development and maintenance personnel are more willing to communicate and search for related defects on the Internet.
  • the traditional keyword-based defect search method has obvious shortcomings: on the one hand, first, users need to specify the keywords they want to search, and if there are multiple keywords, the logical relationship between keywords can only be The relationship between "and" and "or”; secondly, the search results that are matched by such keywords have a wide range and are not related to each other.
  • the natural language input by the user itself has difficulties such as ambiguity and limitation. This often causes the search results to return low-quality and low-relevant content, resulting in a decrease in search quality, and thus increasing user search frequency Decrease, a vicious circle of poor user experience.
  • Traditional search technology is mainly based on keyword matching, but the total amount of defective data is huge and there is a complicated knowledge structure. The results of keyword matching search can no longer meet the needs of users, and the returned results often only reflect words. The direct relationship with words ignores the correlation between defects.
  • the purpose of the present invention is to provide an intelligent knowledge search method for software defect knowledge in combination with the relevant features of the problem sentences in the software defect field.
  • the technical solution to achieve the objective of the present invention is: a knowledge search method for software defect knowledge, including the following steps:
  • Step 1 Preprocessing the search question S entered by the user to form a grammatical dependency tree T of the question;
  • Step 2 Extract the question semantic triples according to the grammatical dependency tree T, the triples include subject, relation and object;
  • Step 3 Match the question semantic triples with the existing software defect knowledge graph triples library to obtain a set of matching triples;
  • Step 4 Construct a search result subgraph based on the set of matching triples and return it to the user.
  • the knowledge search method of the present invention can accept user natural language questions as input. Compared with traditional keyword search, it is convenient for users to describe defect problems more accurately. , So as to precise the scope of the results; 2) Further mining the invisible relationship between the defects through the two perspectives of entities and relationships, and optimize the search results; 3) The search results returned by the method of the present invention are in the form of a triple subgraph, and each entity node is associated Strong performance and more accurate results; 4) Based on the software defect knowledge graph, the present invention returns search results from the perspective of the professional field, which has a better effect than traditional search methods.
  • Fig. 1 is a flowchart of a knowledge search method for software defect knowledge according to the present invention.
  • Figure 2 is a screenshot of the defect report BugID#1387015 corresponding to the input question in the embodiment of the present invention.
  • Figure 3 is a grammatical dependency diagram of the input question according to an embodiment of the present invention.
  • Fig. 4 is a subgraph of search results according to an embodiment of the present invention.
  • the knowledge search method for software defect knowledge of the present invention includes the following steps:
  • Step 1 Preprocessing the search question S entered by the user to form a grammatical dependency tree T of the question;
  • Step 2 Extract the question semantic triples according to the grammatical dependency tree T, the triples include subject, relation and object;
  • Step 3 Match the question semantic triples with the existing software defect knowledge graph triples library to obtain a set of matching triples;
  • Step 4 Construct a search result subgraph based on the set of matching triples and return it to the user.
  • step 1 is specifically natural language processing, including word segmentation, part-of-speech tagging, and syntactic analysis.
  • step 2 the question semantic triples are extracted according to the grammatical dependency tree T, the triples include subject, relation and object, specifically:
  • the grammatical dependency tree T analyze the dependency relationship between words, that is, the grammatical relationship, and identify the verb phrase VP and noun phrase NP in the question S after preprocessing in step 1, so as to extract the question semantic triples as QTripe (NP 1 ,VP 1 ,NP 2 ), where the first noun phrase NP 1 is used as the subject, the second noun phrase NP 2 is used as the object, and the verb phrase VP 1 is used as the semantic relationship between NP 1 and NP 2 .
  • step 3 the question semantic triples are matched with the existing software defect knowledge graph triples library to obtain a matching triple set, specifically:
  • Step 3-1 Perform entity matching between the problem semantic triad and the existing software defect knowledge graph triad library to realize the association of the entity of the problem semantic triad with the entity of the existing software defect knowledge graph to obtain the entity Match the set of triples;
  • Step 3-2 Perform relationship matching by combining the entity matching triple set of step 3-1 to realize the relationship between the problem semantic triples and the relationship between the existing software defect knowledge graph, and obtain the matching triple set.
  • step 3-1 performs entity matching of the question semantic triplet with the existing software defect knowledge graph triplet library, specifically:
  • Step 3-1-1 Perform entity matching at the character level to obtain a preliminary set of entity matching triples, specifically:
  • w 1 and w 2 represent the entity of the problem semantic triplet and the entity in the triplet library of the software defect knowledge graph, respectively, and n(w 1 ,w 2 ) represents the entity w 1 , w 2
  • n(w 1 ,w 2 ) represents the entity w 1 , w 2
  • the number of different characters, l(w 1 ) represents the length of entity w 1 , and l(w 2 ) represents the length of body w 2 ;
  • Step 3-1-2 perform entity matching based on semantic similarity, specifically:
  • each triplet t obtains two entity similarities q 1 , q 2 , judge the entity similarity q 1 , q 2 and the set threshold f the relationship between the two, if q 1, q 2 are greater than the set threshold F 2, then the initial set of triples matching entities in a semantic problem with the triples t triplet match; preliminary matching entities in the set of triples All triples t matching the semantic triples of the question constitute the final set of entity matching triples.
  • step 3-2 the entity matching triple set of step 3-1 is combined to perform relationship matching, so that the relationship between the problem semantic triples and the relationship between the existing software defect knowledge graph are associated, and the matching triple set is obtained ,
  • the relationship between the problem semantic triples and the relationship between the existing software defect knowledge graph are associated, and the matching triple set is obtained ,
  • Tripe(r) ⁇ (e i ,e j ):(e i ,r,e j ) ⁇ T ⁇
  • step 4 constructs a search result subgraph according to the set of matching triples and returns it to the user, specifically:
  • each triplet t as an edge. If the two edges share a certain entity node, merge the entity nodes corresponding to the triplet, and repeat the process until the complete set of matching triples is traversed to match
  • the triple set Tripe(r) is merged into a structured search result subgraph, and the search result subgraph is returned to the user.
  • the present invention is based on a knowledge search method for software defect knowledge, including the following contents:
  • Preprocessing the search question S entered by the user which mainly includes natural language processing steps such as word segmentation, part-of-speech tagging, and syntactic analysis, and finally forms the grammatical dependency tree T of the question.
  • the search question S specifically entered in this embodiment is shown in the title: "Python wheel artifact should not be gzipped" in the defect report BugID#1387015 in Figure 2.
  • the result of preprocessing the input question in this embodiment is shown in Table 1 below, and the generated syntax dependency tree T is shown in FIG. 3.
  • the grammatical dependency tree T analyze the dependency relationship between words, that is, the grammatical relationship, and identify the verb phrase VP and noun phrase NP in the question S after preprocessing, so as to extract the semantic triple of the question as QTripe (NP 1 ,VP 1 ,NP 2 ), where the first noun phrase NP 1 is used as the subject, the second noun phrase NP 2 is used as the object, and the verb phrase VP 1 is used as the semantic relationship between NP 1 and NP 2 .
  • the question semantic triplet generated in this embodiment is: (Python_wheel_artifact, should_not_be, gzip).
  • the method of the present invention performs semantic analysis on the problem conditions that users may search in the field of software defects, and combines knowledge graphs, natural language processing, and these increasingly mature technologies to convert users' problems into structured query languages and integrate them with existing knowledge graphs.
  • the core idea of the present invention is to perform semantic analysis on the user’s natural language first, then extract semantic triples from it through grammatical rules, and establish associations through entity matching, relationship matching, and knowledge graph in turn, and finally convert the semantic triple set into The final structured search subgraph is returned to the user, which can realize a better search interaction process, and can provide a good defect information search platform for the software development and maintenance field to assist the repair process.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Animal Behavior & Ethology (AREA)
  • Artificial Intelligence (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Machine Translation (AREA)

Abstract

一种面向软件缺陷知识的知识搜索方法,属于软件开发与维护领域,包括以下步骤:对用户输入的搜索问句进行预处理以形成问句的语法依赖树;根据语法依赖树抽取问题语义三元组,该三元组包括主语、关系与宾语;将问题语义三元组与现有的软件缺陷知识图谱三元组库进行匹配,获得匹配三元组集合;根据匹配三元组集合构建搜索结果子图,并返回给用户。所述方法针对软件缺陷领域用户可能会搜索的问题条件进行语义分析,并结合知识图谱、自然语言处理这些日益成熟的技术将用户的问题转化成结构化的查询语言并和已有的知识图谱相关联,能够实现更好的搜索交互过程,为软件开发和维护领域提供良好的缺陷信息搜索平台,辅助修复过程。

Description

面向软件缺陷知识的知识搜索方法 技术领域
本发明属于软件开发与维护领域,特别是一种面向软件缺陷知识的知识搜索方法。
背景技术
缺陷是软件维护过程中必须面临的问题。随着网络大数据时代的到来,越来越多的软件开发和维护人员更愿意在网络上交流和搜索相关的缺陷问题。
目前,传统的基于关键词的缺陷搜索方法存在很明显的不足:一方面,首先,用户需要明确自己想要搜索的关键词,并且若是多个关键词,关键词之间的逻辑关系只能是“和”、“或”的关系;其次,这样的关键词匹配到的搜索结果范围广,并且相互之间没有关联性。另一方面,用户输入的自然语言本身又存在多义性、局限性等难点,这往往会造成搜索结果返回的是低质量和相关性低的内容,导致搜索质量的下降,从而使得用户搜索频率降低,用户体验差的恶性循环。传统的搜索技术主要以关键词匹配为核心,但目前缺陷数据总量巨大,并且有着复杂的知识结构,关键词匹配搜索的结果不再能够满足用户的需求,且返回的结果往往只能反应词与词的直接关系,忽视了缺陷之间的关联性。
正是由于基于关键词匹配的传统搜索方式存在返回内容冗余,不精确,用户体验差等问题,智能化的知识搜索成为目前越来越热门的课题。现阶段的智能化搜索工作主要是基于知识图谱开展的。知识图谱这一概念是Google公司为自己的搜索引擎提出的,它具体是描述现实中各种存在关联的实体以及概念,而这对于搜索的智能化有着重要的作用。基于知识图谱进行智能化知识搜索的核心是如何将非结构化的自然语言问句映射到结构化的SPARQL查询语句。目前,解决这一核心问题的思路主要分为三种:首先,“True Knowledge:Open-Domain Question Answering Using Structured Knowledge and Inference”一文通过人工定义模板,将某一类型的问题集映射到对应的结构化查询语句。这一种方法人工定义模板代价高,并且可拓展性差。其次,“Natural language question answering over RDF:a graph data driven approach”一书将自然语言查询语句直接映射到语义查询图的方法。这一种方法通过抽取查询语句的三元组,并将这些三元组中指向同一实体的节点关联起来,该方法只是从实体层面考虑与知识库的关联性,忽略了实体之间关系的重要性。另外,“How to Build Templates for RDF Question/Answering:An Uncertain Graph Similarity Join Approach”一文针对手 工定义模板的工作量提出了一种自动化模板生成方法,但由于缺陷问题数量过大、类型过多,这一方法并不适用于软件开发和维护领域。
综上可知,对于软件开发和维护领域,传统的基于关键词的搜索方式不再适用于复杂且关联性强的缺陷数据,而目前基于知识图谱的智能化搜索方法仍然需要大量的人工且可拓展性差。
发明内容
本发明的目的在于结合软件缺陷领域问题语句的相关特征,提供一种面向软件缺陷知识的智能化知识搜索方法。
实现本发明目的的技术解决方案为:一种面向软件缺陷知识的知识搜索方法,包括以下步骤:
步骤1、对用户输入的搜索问句S进行预处理以形成问句的语法依赖树T;
步骤2、根据语法依赖树T抽取问题语义三元组,该三元组包括主语、关系与宾语;
步骤3、将所述问题语义三元组与现有的软件缺陷知识图谱三元组库进行匹配,获得匹配三元组集合;
步骤4、根据匹配三元组集合构建搜索结果子图,并返回给用户。
本发明与现有技术相比,其显著优点为:1)本发明的知识搜索方法,可以接受用户的自然语言提问作为输入,相比传统的关键词搜索,可以方便用户更准确的描述缺陷问题,从而精确结果范围;2)通过实体和关系两个角度进一步挖掘缺陷之间的隐形关系,优化搜索结果;3)本发明方法返回的搜索结果是三元组子图的形式,各实体节点关联性强,结果更加准确;4)本发明基于软件缺陷知识图谱,从专业领域的角度返回搜索结果,相比于传统搜索方式效果好。
下面结合附图对本发明作进一步详细描述。
附图说明
图1为本发明面向软件缺陷知识的知识搜索方法的流程图。
图2为本发明实施例输入问题对应的缺陷报告BugID#1387015截图。
图3为本发明实施例输入问题的语法依赖图。
图4为本发明实施例的搜索结果子图。
具体实施方式
结合图1,本发明面向软件缺陷知识的知识搜索方法,包括以下步骤:
步骤1、对用户输入的搜索问句S进行预处理以形成问句的语法依赖树T;
步骤2、根据语法依赖树T抽取问题语义三元组,该三元组包括主语、关系与宾语;
步骤3、将所述问题语义三元组与现有的软件缺陷知识图谱三元组库进行匹配,获得匹配三元组集合;
步骤4、根据匹配三元组集合构建搜索结果子图,并返回给用户。
进一步地,步骤1中预处理具体为自然语言处理,包括分词、词性标注以及句法分析。
进一步地,步骤2中根据语法依赖树T抽取问题语义三元组,该三元组包括主语、关系与宾语,具体为:
根据语法依赖树T,分析词与词之间的依存关系即语法关系,并识别经步骤1预处理后问句S中的动词短语VP、名词短语NP,从而抽取出问题语义三元组为QTripe(NP 1,VP 1,NP 2),其中第一名词短语NP 1作为主语,第二名词短语NP 2作为宾语,动词短语VP 1作为NP 1与NP 2两者之间的语义关系。
进一步地,步骤3将问题语义三元组与现有的软件缺陷知识图谱三元组库进行匹配,获得匹配三元组集合,具体为:
步骤3-1、将所述问题语义三元组与现有的软件缺陷知识图谱三元组库进行实体匹配,实现问题语义三元组的实体与现有软件缺陷知识图谱的实体关联,获得实体匹配三元组集合;
步骤3-2、结合步骤3-1的实体匹配三元组集合进行关系匹配,实现问题语义三元组的关系与现有软件缺陷知识图谱的关系相关联,获得匹配三元组集合。
进一步地,步骤3-1将所述问题语义三元组与现有的软件缺陷知识图谱三元组库进行实体匹配,具体为:
步骤3-1-1、在字符层面进行实体匹配,获得初步实体匹配三元组集合,具体为:
(1)求取问题语义三元组中实体与软件缺陷知识图谱三元组库中每个三元组t中实体的相似度P(w 1,w 2),所用公式为:
Figure PCTCN2020085878-appb-000001
式中,w 1、w 2分别表示问题语义三元组的实体、软件缺陷知识图谱三元组库中三元组中的实体,n(w 1,w 2)表示实体w 1、w 2中不同字符的个数,l(w 1)表示实体w 1的长度, l(w 2)表示主体w 2的长度;
由上获得问题语义三元组与软件缺陷知识图谱三元组库中每个三元组t的两个实体相似度P 1、P 2
(2)判断实体相似度P 1、P 2与设定阈值f 1之间的关系,若P 1、P 2均大于设定阈值f 1,则软件缺陷知识图谱三元组库中三元组t与问题语义三元组相匹配;软件缺陷知识图谱三元组库中所有与问题语义三元组匹配的三元组t构成初步实体匹配三元组集合;
步骤3-1-2、基于语义相似度进行实体匹配,具体为:
(1)采用词向量word2vec模型将问题语义三元组中的实体与初步实体匹配三元组集合中每个三元组t中的实体均映射为空间向量;
(2)求取空间向量之间的欧式距离作为实体相似度,每个三元组t均获得两个实体相似度q 1、q 2,判断实体相似度q 1、q 2与设定阈值f 2之间的关系,若q 1、q 2均大于设定阈值f 2,则初步实体匹配三元组集合中三元组t与问题语义三元组相匹配;初步实体匹配三元组集合中所有与问题语义三元组匹配的三元组t构成最终的实体匹配三元组集合。
进一步地,步骤3-2中结合步骤3-1的实体匹配三元组集合进行关系匹配,实现问题语义三元组的关系与现有软件缺陷知识图谱的关系相关联,获得匹配三元组集合,具体为:
针对问题语义三元组的关系r,获取实体匹配三元组集合中所有满足关系r的匹配三元组集合Tripe(r):
Tripe(r)={(e i,e j):(e i,r,e j)∈T}
式中,1≤i≤j≤n,e i、e j均表示缺陷实体节点,r表示缺陷实体对应的关系,n表示软件缺陷知识图谱中缺陷实体总数,T表示实体匹配三元组集合。
进一步地,步骤4根据匹配三元组集合构建搜索结果子图,并返回给用户,具体为:
针对匹配三元组集合Tripe(r)中的每个三元组t:
t=(e s,r t,e m)
式中,1≤s≤m≤n,e s、e m均表示缺陷实体节点,r t表示缺陷实体之间对应的关系;
将每个三元组t表示为一条边,若两个边共享某一个实体节点,则将三元组对应的实体节点合并,重复该过程直至遍历完整个匹配三元组集合,以此将匹配三元组集合Tripe(r)合并为一个结构化的搜索结果子图,并将搜索结果子图返回给用户。
下面结合实施例对本发明作进一步详细的说明。
实施例
结合图1,本发明基于面向软件缺陷知识的知识搜索方法,包括以下内容:
1、对用户输入的搜索问句S进行预处理,主要包括分词、词性标注、以及句法分析等自然语言处理步骤,最终形成问句的语法依赖树T。本实施例中具体输入的搜索问句S如图2缺陷报告BugID#1387015中的title:“Python wheel artifact should not be gzipped”。本实施例对输入问题经过预处理的结果如下表1所示,生成的语法依赖树T如图3所示。
表1输入问题经过预处理的结果
Figure PCTCN2020085878-appb-000002
2、根据语法依赖树T,分析词与词之间的依存关系即语法关系,并识别经预处理后问句S中的动词短语VP、名词短语NP,从而抽取出问题语义三元组为QTripe(NP 1,VP 1,NP 2),其中第一名词短语NP 1作为主语,第二名词短语NP 2作为宾语,动词短语VP 1作为NP 1与NP 2两者之间的语义关系。本实施例中生成的问题语义三元组为:(Python_wheel_artifact,should_not_be,gzip)。
3、依次通过基于字符层面的相似度比较和基于语义相似度的比较,将上述问题语义三元组与现有的软件缺陷知识图谱三元组库进行实体匹配。
4、结合上述问题语义三元组中的关系r:(should_not_be),找到其在软件缺陷知识图谱三元组库所有满足关系r的三元组集合Tripe(r)={(e i,e j):(e i,r,e j)∈T,}。
5、将语义三元组集合Tripe(r)中的任意一个三元组(e i,r k,e j)表示为一条边,若两个边共享某一个实体节点,则将三元组对应的实体节点合并,重复该过程直至遍历完整个匹配三元组集合,以此将匹配三元组集合Tripe(r)合并为一个结构化的搜索结果子图如图4所示,图中的BugID是指缺陷领域图谱中该三元组对应的缺陷报告位置,entity i和 realtion j对应缺陷领域图谱中的实体和关系。通过子图可以将类似的缺陷问题关联起来,从而帮助用户理解缺陷问题。
本发明的方法针对软件缺陷领域用户可能会搜索的问题条件进行语义分析,并结合知识图谱、自然语言处理这些日益成熟的技术将用户的问题转化成结构化的查询语言并和已有的知识图谱相关联。本发明的核心思路是对用户的自然语言先进行语义分析,而后通过语法规则从中抽取语义三元组,并依次通过实体匹配、关系匹配和知识图谱建立关联,最终将语义三元组集合转换成最终的结构化搜索子图返回给用户,能够实现更好的搜索交互过程,可以为软件开发和维护领域提供良好的缺陷信息搜索平台,辅助修复过程。

Claims (7)

  1. 一种面向软件缺陷知识的知识搜索方法,其特征在于,包括以下步骤:
    步骤1、对用户输入的搜索问句S进行预处理以形成问句的语法依赖树T;
    步骤2、根据语法依赖树T抽取问题语义三元组,该三元组包括主语、关系与宾语;
    步骤3、将所述问题语义三元组与现有的软件缺陷知识图谱三元组库进行匹配,获得匹配三元组集合;
    步骤4、根据匹配三元组集合构建搜索结果子图,并返回给用户。
  2. 根据权利要求1所述的面向软件缺陷知识的知识搜索方法,其特征在于,步骤1所述预处理具体为自然语言处理,包括分词、词性标注以及句法分析。
  3. 根据权利要求1或2所述的面向软件缺陷知识的知识搜索方法,其特征在于,步骤2所述根据语法依赖树T抽取问题语义三元组,该三元组包括主语、关系与宾语,具体为:
    根据语法依赖树T,分析词与词之间的依存关系即语法关系,并识别经步骤1预处理后问句S中的动词短语VP、名词短语NP,从而抽取出问题语义三元组为QTripe(NP 1,VP 1,NP 2),其中第一名词短语NP 1作为主语,第二名词短语NP 2作为宾语,动词短语VP 1作为NP 1与NP 2两者之间的语义关系。
  4. 根据权利要求1所述的面向软件缺陷知识的知识搜索方法,其特征在于,步骤3所述将问题语义三元组与现有的软件缺陷知识图谱三元组库进行匹配,获得匹配三元组集合,具体为:
    步骤3-1、将所述问题语义三元组与现有的软件缺陷知识图谱三元组库进行实体匹配,实现问题语义三元组的实体与现有软件缺陷知识图谱的实体关联,获得实体匹配三元组集合;
    步骤3-2、结合步骤3-1的实体匹配三元组集合进行关系匹配,实现问题语义三元组的关系与现有软件缺陷知识图谱的关系相关联,获得匹配三元组集合。
  5. 根据权利要求4所述的面向软件缺陷知识的知识搜索方法,其特征在于,步骤3-1所述将所述问题语义三元组与现有的软件缺陷知识图谱三元组库进行实体匹配,具体为:
    步骤3-1-1、在字符层面进行实体匹配,获得初步实体匹配三元组集合,具体为:
    (1)求取问题语义三元组中实体与软件缺陷知识图谱三元组库中每个三元组t中实体的相似度P(w 1,w 2),所用公式为:
    Figure PCTCN2020085878-appb-100001
    式中,w 1、w 2分别表示问题语义三元组的实体、软件缺陷知识图谱三元组库中三元组中的实体,n(w 1,w 2)表示实体w 1、w 2中不同字符的个数,l(w 1)表示实体w 1的长度,l(w 2)表示主体w 2的长度;
    由上获得问题语义三元组与软件缺陷知识图谱三元组库中每个三元组t的两个实体相似度P 1、P 2
    (2)判断实体相似度P 1、P 2与设定阈值f 1之间的关系,若P 1、P 2均大于设定阈值f 1,则软件缺陷知识图谱三元组库中三元组t与问题语义三元组相匹配;软件缺陷知识图谱三元组库中所有与问题语义三元组匹配的三元组t构成初步实体匹配三元组集合;
    步骤3-1-2、基于语义相似度进行实体匹配,具体为:
    (1)采用词向量word2vec模型将问题语义三元组中的实体与初步实体匹配三元组集合中每个三元组t中的实体均映射为空间向量;
    (2)求取空间向量之间的欧式距离作为实体相似度,每个三元组t均获得两个实体相似度q 1、q 2,判断实体相似度q 1、q 2与设定阈值f 2之间的关系,若q 1、q 2均大于设定阈值f 2,则初步实体匹配三元组集合中三元组t与问题语义三元组相匹配;初步实体匹配三元组集合中所有与问题语义三元组匹配的三元组t构成最终的实体匹配三元组集合。
  6. 根据权利要求5所述的面向软件缺陷知识的知识搜索方法,其特征在于,步骤3-2所述结合步骤3-1的实体匹配三元组集合进行关系匹配,实现问题语义三元组的关系与现有软件缺陷知识图谱的关系相关联,获得匹配三元组集合,具体为:
    针对问题语义三元组的关系r,获取实体匹配三元组集合中所有满足关系r的匹配三元组集合Tripe(r):
    Tripe(r)={(e i,e j):e i,r,e j)∈T}
    式中,1≤i≤j≤n,e i、e j均表示缺陷实体节点,r表示缺陷实体对应的关系,n表示软件缺陷知识图谱中缺陷实体总数,T表示实体匹配三元组集合。
  7. 根据权利要求6所述的面向软件缺陷知识的知识搜索方法,其特征在于,步骤4所述根据匹配三元组集合构建搜索结果子图,并返回给用户,具体为:
    针对匹配三元组集合Tripe(r)中的每个三元组t:
    t=(e s,r t,e m)
    式中,1≤s≤m≤n,e s、e m均表示缺陷实体节点,r t表示缺陷实体之间对应的关系;
    将每个三元组t表示为一条边,若两个边共享某一个实体节点,则将三元组对应的实体节点合并,重复该过程直至遍历完整个匹配三元组集合,以此将匹配三元组集合Tripe(r)合并为一个结构化的搜索结果子图,并将搜索结果子图返回给用户。
PCT/CN2020/085878 2019-07-16 2020-04-21 面向软件缺陷知识的知识搜索方法 WO2021008180A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910641797.6A CN110413732B (zh) 2019-07-16 2019-07-16 面向软件缺陷知识的知识搜索方法
CN201910641797.6 2019-07-16

Publications (1)

Publication Number Publication Date
WO2021008180A1 true WO2021008180A1 (zh) 2021-01-21

Family

ID=68361632

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/085878 WO2021008180A1 (zh) 2019-07-16 2020-04-21 面向软件缺陷知识的知识搜索方法

Country Status (2)

Country Link
CN (1) CN110413732B (zh)
WO (1) WO2021008180A1 (zh)

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112860263A (zh) * 2021-03-08 2021-05-28 东南大学 一种基于智能合约知识图谱的合约缺陷检测方法
CN113011461A (zh) * 2021-02-19 2021-06-22 中国科学院软件研究所 通过知识学习增强基于分类的软件需求跟踪链接恢复方法及电子装置
CN113032577A (zh) * 2021-03-21 2021-06-25 国网河南省电力公司电力科学研究院 一种电力系统知识图谱的构建、缺陷目标识别方法及系统
CN113094512A (zh) * 2021-04-08 2021-07-09 达而观信息科技(上海)有限公司 一种工业生产制造中故障分析系统及方法
CN113255918A (zh) * 2021-04-13 2021-08-13 国家计算机网络与信息安全管理中心 强化聚合知识指导的生成常识推理方法
CN113297089A (zh) * 2021-06-09 2021-08-24 南京大学 一种基于知识图谱的众测助理实现方法
CN113963748A (zh) * 2021-09-28 2022-01-21 华东师范大学 一种蛋白质知识图谱向量化方法
CN114780083A (zh) * 2022-06-17 2022-07-22 之江实验室 一种知识图谱系统的可视化构建方法及装置
CN115630697A (zh) * 2022-10-26 2023-01-20 泸州职业技术学院 一种可区分单双相情感障碍症的知识图谱构建方法及系统
CN116303976A (zh) * 2023-05-12 2023-06-23 中国人民解放军国防科技大学 基于网络安全知识图谱的渗透测试问答方法、系统及介质
CN117150138A (zh) * 2023-09-12 2023-12-01 广东省华南技术转移中心有限公司 一种基于高维空间映射的科技资源组织方法及系统
CN117540799A (zh) * 2023-10-20 2024-02-09 上海歆广数据科技有限公司 一种个案图谱创建生成方法及系统
CN117556920A (zh) * 2023-10-23 2024-02-13 星环信息科技(上海)股份有限公司 一种大模型幻觉治理方法、装置、设备及存储介质
CN117556920B (zh) * 2023-10-23 2024-05-31 星环信息科技(上海)股份有限公司 一种大模型幻觉治理方法、装置、设备及存储介质

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110413732B (zh) * 2019-07-16 2023-11-24 扬州大学 面向软件缺陷知识的知识搜索方法
CN111309865B (zh) * 2020-02-12 2024-03-22 扬州大学 相似缺陷报告推荐方法、系统、计算机设备和存储介质
CN111597347B (zh) * 2020-04-24 2023-11-10 扬州大学 知识嵌入的缺陷报告重构方法及装置
CN111666395A (zh) * 2020-05-18 2020-09-15 扬州大学 面向软件缺陷的可解释问答方法、装置、计算机设备和存储介质
CN111459973B (zh) * 2020-06-16 2020-10-23 四川大学 一种基于案情三元组信息的类案检索方法及系统
CN112256835B (zh) * 2020-10-29 2021-07-23 东南大学 一种精准描述知识图谱中元素语义的子图抽取方法
CN112380298A (zh) * 2020-12-03 2021-02-19 成都航天科工大数据研究院有限公司 一种油气管道缺陷修复的知识图谱构建方法及系统
CN112347271A (zh) * 2020-12-04 2021-02-09 国网天津市电力公司电力科学研究院 基于文字语义识别的配电物联网设备缺陷辅助录入方法
CN113204957B (zh) * 2021-03-24 2023-06-16 中国南方电网有限责任公司超高压输电公司广州局 缺陷信息处理方法、装置、设备及存储介质
CN113326062A (zh) * 2021-05-25 2021-08-31 扬州大学 一种面向软件缺陷的多轮自动问答方法、系统、计算机设备和存储介质
CN113434418A (zh) * 2021-06-29 2021-09-24 扬州大学 知识驱动的软件缺陷检测与分析方法及系统
CN113590782B (zh) * 2021-07-28 2024-02-09 北京百度网讯科技有限公司 推理模型的训练方法、推理方法及装置

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150378984A1 (en) * 2014-06-30 2015-12-31 International Business Machines Corporation Augmenting semantic models based on morphological rules
CN105868313A (zh) * 2016-03-25 2016-08-17 浙江大学 一种基于模板匹配技术的知识图谱问答系统及方法
CN107748757A (zh) * 2017-09-21 2018-03-02 北京航空航天大学 一种基于知识图谱的问答方法
CN108804521A (zh) * 2018-04-27 2018-11-13 南京柯基数据科技有限公司 一种基于知识图谱的问答方法及农业百科问答系统
CN110413732A (zh) * 2019-07-16 2019-11-05 扬州大学 面向软件缺陷知识的知识搜索方法

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109241538B (zh) * 2018-09-26 2022-12-20 上海德拓信息技术股份有限公司 基于关键词和动词依存的中文实体关系抽取方法

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150378984A1 (en) * 2014-06-30 2015-12-31 International Business Machines Corporation Augmenting semantic models based on morphological rules
CN105868313A (zh) * 2016-03-25 2016-08-17 浙江大学 一种基于模板匹配技术的知识图谱问答系统及方法
CN107748757A (zh) * 2017-09-21 2018-03-02 北京航空航天大学 一种基于知识图谱的问答方法
CN108804521A (zh) * 2018-04-27 2018-11-13 南京柯基数据科技有限公司 一种基于知识图谱的问答方法及农业百科问答系统
CN110413732A (zh) * 2019-07-16 2019-11-05 扬州大学 面向软件缺陷知识的知识搜索方法

Cited By (23)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113011461A (zh) * 2021-02-19 2021-06-22 中国科学院软件研究所 通过知识学习增强基于分类的软件需求跟踪链接恢复方法及电子装置
CN113011461B (zh) * 2021-02-19 2022-08-05 中国科学院软件研究所 通过知识学习增强基于分类的软件需求跟踪链接恢复方法及电子装置
CN112860263A (zh) * 2021-03-08 2021-05-28 东南大学 一种基于智能合约知识图谱的合约缺陷检测方法
CN113032577A (zh) * 2021-03-21 2021-06-25 国网河南省电力公司电力科学研究院 一种电力系统知识图谱的构建、缺陷目标识别方法及系统
CN113094512A (zh) * 2021-04-08 2021-07-09 达而观信息科技(上海)有限公司 一种工业生产制造中故障分析系统及方法
CN113094512B (zh) * 2021-04-08 2024-05-24 达观数据有限公司 一种工业生产制造中故障分析系统及方法
CN113255918A (zh) * 2021-04-13 2021-08-13 国家计算机网络与信息安全管理中心 强化聚合知识指导的生成常识推理方法
CN113297089B (zh) * 2021-06-09 2023-06-20 南京大学 一种基于知识图谱的众测助理实现方法
CN113297089A (zh) * 2021-06-09 2021-08-24 南京大学 一种基于知识图谱的众测助理实现方法
CN113963748B (zh) * 2021-09-28 2023-08-18 华东师范大学 一种蛋白质知识图谱向量化方法
CN113963748A (zh) * 2021-09-28 2022-01-21 华东师范大学 一种蛋白质知识图谱向量化方法
US11907390B2 (en) 2022-06-17 2024-02-20 Zhejiang Lab Method and apparatus for visual construction of knowledge graph system
CN114780083B (zh) * 2022-06-17 2022-10-18 之江实验室 一种知识图谱系统的可视化构建方法及装置
CN114780083A (zh) * 2022-06-17 2022-07-22 之江实验室 一种知识图谱系统的可视化构建方法及装置
CN115630697B (zh) * 2022-10-26 2023-04-07 泸州职业技术学院 一种可区分单双相情感障碍症的知识图谱构建方法及系统
CN115630697A (zh) * 2022-10-26 2023-01-20 泸州职业技术学院 一种可区分单双相情感障碍症的知识图谱构建方法及系统
CN116303976A (zh) * 2023-05-12 2023-06-23 中国人民解放军国防科技大学 基于网络安全知识图谱的渗透测试问答方法、系统及介质
CN116303976B (zh) * 2023-05-12 2023-08-08 中国人民解放军国防科技大学 基于网络安全知识图谱的渗透测试问答方法、系统及介质
CN117150138A (zh) * 2023-09-12 2023-12-01 广东省华南技术转移中心有限公司 一种基于高维空间映射的科技资源组织方法及系统
CN117540799A (zh) * 2023-10-20 2024-02-09 上海歆广数据科技有限公司 一种个案图谱创建生成方法及系统
CN117540799B (zh) * 2023-10-20 2024-04-09 上海歆广数据科技有限公司 一种个案图谱创建生成方法及系统
CN117556920A (zh) * 2023-10-23 2024-02-13 星环信息科技(上海)股份有限公司 一种大模型幻觉治理方法、装置、设备及存储介质
CN117556920B (zh) * 2023-10-23 2024-05-31 星环信息科技(上海)股份有限公司 一种大模型幻觉治理方法、装置、设备及存储介质

Also Published As

Publication number Publication date
CN110413732B (zh) 2023-11-24
CN110413732A (zh) 2019-11-05

Similar Documents

Publication Publication Date Title
WO2021008180A1 (zh) 面向软件缺陷知识的知识搜索方法
WO2020233261A1 (zh) 一种基于自然语言生成技术的知识图谱辅助理解系统
CN108804521B (zh) 一种基于知识图谱的问答方法及农业百科问答系统
WO2021164226A1 (zh) 法律案件知识图谱查询方法、装置、设备及存储介质
JP6309644B2 (ja) スマート質問回答の実現方法、システム、および記憶媒体
CN110825881B (zh) 一种建立电力知识图谱的方法
CN107436864B (zh) 一种基于Word2Vec的中文问答语义相似度计算方法
CN108121829B (zh) 面向软件缺陷的领域知识图谱自动化构建方法
CN110162591B (zh) 一种面向数字教育资源的实体对齐方法及系统
CN105975625A (zh) 一种面向英文搜索引擎的中式英文查询纠错方法和系统
CN111488467B (zh) 地理知识图谱的构建方法、装置、存储介质及计算机设备
CN107092605B (zh) 一种实体链接方法及装置
CN106874441A (zh) 智能问答方法和装置
CN108681574A (zh) 一种基于文本摘要的非事实类问答答案选择方法及系统
CN111522910A (zh) 一种基于文物知识图谱的智能语义检索方法
CN113742446A (zh) 一种基于路径排序的知识图谱问答方法及系统
Galitsky et al. Parse thicket representation for multi-sentence search
US11487795B2 (en) Template-based automatic software bug question and answer method
CN113434659B (zh) 一种在协同设计过程中隐性冲突感知方法
Wang et al. Automatic scoring of Chinese fill-in-the-blank questions based on improved P-means
CN113868382A (zh) 从中文自然语言中抽取结构化知识的方法和装置
Song et al. Semantic query graph based SPARQL generation from natural language questions
CN117076636A (zh) 一种智能客服的信息查询方法、系统和设备
CN111309930A (zh) 一种基于表示学习的医学知识图谱实体对齐方法
CN106776590A (zh) 一种获取词条译文的方法及系统

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

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

Country of ref document: EP

Kind code of ref document: A1