You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

句子主题相似度判定算法开发需求及应用场景问询

Algorithm for Sentence Narrative Coherence Check

I’m working on building an algorithm to assess whether a follow-up sentence fits into an existing narrative sequence. The core task is: given an initial starting sentence, determine if subsequent sentences are appropriate to add as complementary content that maintains the ongoing story or topic thread.

Judgment Examples

  • Valid starting sentence:

    My dog loves to drink water.
    This is a valid opening sentence that meets our baseline requirements.

  • Fitting follow-up (shared subject):

    The dog hates cats.
    This sentence is acceptable—both the starting sentence and this one revolve around the core subject of "the dog," maintaining thematic consistency.

  • Fitting follow-up (clear pronoun reference):

    It enjoys walks on the beach.
    This sentence works because the pronoun "it" clearly refers back to the dog established earlier, aligning with logical narrative flow.

  • Non-fitting follow-up (off-topic):

    Pizza is great with pineapple on top.
    This sentence is not acceptable, as it completely breaks away from the dog-focused narrative thread built by the previous three sentences.

Context & Use Case

I’ve already built a library that generates Markov text chains from input text. After applying grammatical corrections, the library produces syntactically valid sentences—but I need a way to string these sentences together into coherent, thematically consistent paragraphs. This coherence-checking algorithm will be the key technical component to make that possible.


Content of this question originates from Stack Exchange, asked by Bryant Makes Programs

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.28 10:18:13