This application provides a method for generating discussion threads, an electronic device, and a computer-readable storage medium, relating to the field of
online discussion modeling technology. The method includes: obtaining an initial discussion thread and target comment text, wherein the initial discussion thread includes comment text nodes, which represent historical comment text; determining the node attractiveness of the comment text nodes to the target comment text from multiple attractiveness evaluation dimensions; determining the selection probability corresponding to the comment text nodes based on the node attractiveness, obtaining a selection probability set; determining the parent node corresponding to the target comment text from the comment text nodes based on the selection probability set; and constructing a
target text node connected to the parent node in the initial discussion thread to obtain the target discussion thread, wherein the
target text node corresponds to the target comment text. This application solves the technical problem of poor accuracy in discussion thread modeling in related technologies.