Text segmentation method and apparatus, electronic device, and computer-readable storage medium
Патент · WO A1
Полный текст
The present disclosure relates to computer technology, and provides a text segmentation method and apparatus, an electronic device, and a computer-readable storage medium. The method comprises: acquiring a plurality of sentences obtained by performing sentence-level segmentation on target text; by using the first sentence among the plurality of sentences as a starting point and the last sentence as an end point, sliding a preset sliding window multiple times, and upon each sliding, segmenting a plurality of target sentences within the preset sliding window on the basis of semantics to obtain at least one semantic segment; and for the semantic segment obtained by each segmentation, clustering the semantic segment obtained by the current segmentation and the semantic segment obtained by the previous segmentation to obtain, for each target sentence within the preset sliding window after the previous sliding and the current sliding, a target semantic segment to which the target sentence belongs, until, for each sentence among the plurality of sentences, a corresponding semantic segment is obtained. The present disclosure can ensure semantic coherence and improve the accuracy and reliability of question answering in RAG systems.