Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

资料库包含tag应该怎么整理 #7

Closed
vivian940425 opened this issue Mar 14, 2023 · 1 comment
Closed

资料库包含tag应该怎么整理 #7

vivian940425 opened this issue Mar 14, 2023 · 1 comment

Comments

@vivian940425
Copy link

vivian940425 commented Mar 14, 2023

比如像 Notion 中自己关于某个 topic 的笔记,就应该记成类似如下形式吗?

{
    title: "某个领域的研究",
    text: "具体的某个研究的内容,可能非常复杂和杂碎"
}

另外就是,很多知识库都会有 tag 系统,我对某个内容会进行 tag,这个信息怎么纳入知识库或者 vector 中?

@GanymedeNil
Copy link
Owner

GanymedeNil commented Mar 14, 2023

比如像 Notion 中自己关于某个 topic 的笔记,就应该记成类似如下形式吗?

{
    title: "某个领域的研究",
    text: "具体的某个研究的内容,可能非常复杂和杂碎"
}

另外就是,很多知识库都会有 tag 系统,我对某个内容会进行 tag,这个信息怎么纳入知识库或者 vector 中?

格式没有问题

因为目前我还没考虑到tag这个内容,但如果我自己做这个功能我会这么考虑:

  1. 如果tags可以覆盖一篇文章的核心主题内容,那么可以尝试将tags通过一定方式组合起来生成vector,然后把文章内容当作payload数据,在搜索的时候匹配tags,进而找到对应的文章,然后拼接这些文章形成提示词进行后续操作。
  2. 如果tags只是对文章的一个分类,那可以考虑在payload中加上tags字段,然后在搜索的时候配合向量数据库的filter对tag和text进行联合搜索,以提升匹配度。
  3. 你也可以更粗暴一点将这两个内容都生成为vector,然后同一个搜索条件同时去匹配这两个vector(这可能需要向量数据库的支持)。qdrant 的多向量操作

关于我上述的操作,如果是使用的qdrant,你可以参考qdrant documentation来改写代码,从而达成你的需求。如果你使用的是其他的向量数据库,可以参考你使用的向量数据库来达成你的目的。

@GanymedeNil GanymedeNil changed the title 资料库应该怎么整理 资料库包含tag应该怎么整理 Mar 14, 2023
@GanymedeNil GanymedeNil pinned this issue Mar 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants