Method for combining entry structures including entry ID, entry text, parent entry and child entry
AssigneeShanghai Yiwei Network Technology Co., Ltd.
InventorsYechi Ma, Hong Tan
Life of this patent
Estimating the term…
Abstract
The present invention discloses a method for combining entry structures, by which similar entry structures can be automatically combined. By this method, the efficiency in both retrieving entries and acquiring knowledge is improved. In a technical solution, this method comprises: converting an entry structure into a text; combining, in the format of text and based on a cosine similarity between entries and a cosine similarity between entries and texts, a plurality of texts into one text; and converting the combined text back to the entry structure.
Claims7
A method for combining entry structures, comprising:
- a first step of converting an entry structure into a text, wherein each entry structure comprises an entry ID, an entry name, an entry text, a parent entry, and a child entry stored in a hierarchical structure;
- a second step of combining, in format of text and based on a cosine similarity between entries and a cosine similarity between entries and texts, a plurality of texts into one text, the second step comprising:
- S1:
- using a first text as a primary combination subject and a second text as a secondary combination subject;
- S2:
- traversing all entries of the first text by a root entry in the second text to obtain corresponding cosine similarities;
- S3:
- comparing the cosine similarities obtained in the S2, to obtain a value of a maximum cosine similarity;
- S4:
- executing S5 if the value of the maximum cosine similarity obtained in the S3 is greater than a first threshold, otherwise executing S7;
- S5:
- recording an entry that corresponds to the value of the maximum cosine similarity in the primary combination subject, and combining a root entry in the secondary combination subject into the recorded corresponding entry in the primary combination subject to execute S6;
- S6:
- calculating a cosine similarity between any two of all sub-entries of the combined entry, combining the two entries if the cosine similarity is greater than the first threshold, and repeating the S6 on the combined entry until the cosine similarity between any two of all sub-entries of the combined entry is less than the first threshold;
- S7:
- using the second text as the primary combination subject and the first text as the secondary combination subject;
- S8:
- traversing all entries in the second text by the root entry in the first text to obtain a corresponding cosine similarity;
- S9:
- comparing the cosine similarities obtained in the S8, to obtain a value of a maximum cosine similarity;
- S10:
- executing S11 if the value of the maximum cosine similarity obtained in the S9 is greater than the first threshold, otherwise executing S13;
- S11:
- recording an entry that corresponds to the value of the maximum cosine similarity in the primary combination subject, and combining a root entry in the secondary combination subject into the recorded corresponding entry in the primary combination subject to execute S12;
- S12:
- calculating a cosine similarity between any two of all sub-entries of the combined entry, combining the two entries if the cosine similarity is greater than the first threshold, and repeating the S12 on the combined entry until the cosine similarity between any two of all sub-entries of the combined entry is less than the first threshold;
- S13:
- again, using the first text as the primary combination subject and the second text as the secondary combination subject;
- S14:
- traversing texts of all entries of the first text by the root entry in the second text to obtain corresponding cosine similarities;
- S15:
- comparing the cosine similarities obtained in the S14, to obtain a value of a maximum cosine similarity;
- S16:
- executing S17 if the value of the maximum cosine similarity obtained in the S15 is greater than a second threshold, otherwise executing S18;
- S17:
- recording an entry that corresponds to the value of the maximum cosine similarity in the primary combination subject, and combining the root entry in the secondary combination subject into the recorded corresponding entry in the primary combination subject;
- S18:
- using the second text as the primary combination subject and the first text as the secondary combination subject;
- S19:
- traversing texts of all entries in the second text by the root entry in the first text to obtain corresponding cosine similarities;
- S20:
- comparing the cosine similarities obtained in the S19, to obtain a value of a maximum cosine similarity;
- S21:
- executing S22 if the value of the maximum cosine similarity obtained in the S20 is greater than the second threshold, otherwise determining that the texts of the two entries are not correlated;
- and
- S22:
- recording an entry that corresponds to the value of the maximum cosine similarity in the primary combination subject, combining the root entry in the secondary combination subject into the recorded corresponding entry in the primary combination subject, and ending the combination;
- and
- a third step of converting the combined text back to the entry structure.
Dependencies are inferred from the claim text.