A
knowledge graph path
reachability analysis method based on an attention mechanism includes the following steps: 1, constructing a target triple from a
knowledge base, and obtaining all path relations between a head entity h and a
tail entity t in the triple; 2, carrying out relation coding; 3, performing
entity type coding; 4, repeating the step 2 and the step 3 to calculate a global path mode formed by combining all path
modes, calculating an energy function of a triad formed by a head entity h, a direct relation r and a
tail entity t, calculating the probability whether the direct relation r can connect the head entity and the
tail entity, multiplying the energy function by the probability whether the energy function can be linked, and judging whether the triple is true or not. According to the method, the
utilization rate of entities and relationships is improved, the accuracy of a probability calculation result is improved through an attention mechanism, the accuracy of vectors represented by triples is improved, and the accuracy of a result for predicting whether the entities can be mutually connected or not is improved.