和顺 / 知白 返回所属 Agent
ZB-05.02

误解辨认

原能力

找出双方对同一句话、期待或边界的不同理解,形成可直接核对的问句。(细化版 p.2–3)

首选项目

Taguette(BSD-3-Clause)。 Taguette

匹配范围

分别标注双方原话,导出有出处的并列表。

源码

Taguette · class Highlight

taguette/database/models.py · 592–605 行。 在 GitHub 查看源码 · 许可证与声明

源码片段
class Highlight(Base):
    __tablename__ = 'highlights'
    __table_args__ = ({'sqlite_autoincrement': True},)

    id = Column(Integer, primary_key=True)
    document_id = Column(Integer, ForeignKey('documents.id',
                                             ondelete='CASCADE'),
                         nullable=False, index=True)
    document = relationship('Document', back_populates='highlights')
    start_offset = Column(Integer, nullable=False)
    end_offset = Column(Integer, nullable=False)
    snippet = Column(Text, nullable=False)
    tags = relationship('Tag', secondary='highlight_tags',
                        back_populates='highlights')

Taguette · def _get_highlights_for_export(

taguette/export.py · 74–87 行。 在 GitHub 查看源码 · 许可证与声明

源码片段
def _get_highlights_for_export(db, project_id, path):
    if path:
        t_highlight = database.Highlight.__table__
        t_highlight_tag = database.highlight_tags
        t_tag = database.Tag.__table__
        t_document = database.Document.__table__
        # Join with tags a second time to find highlights that match the
        # given path, while returning all tags for those highlights
        t_highlight_tag_m = database.highlight_tags.alias()
        t_tag_m = database.Tag.__table__.alias()
        query = (
            sqlalchemy.select([
                t_highlight.c.id,
                t_highlight.c.snippet,

实现与验收要点

识别同词异义、角色期待与边界分歧,拟定非诱导核对问题。