python - 如何在 Haystack 中指定预测列?

标签 python rename opensearch nlp-question-answering haystack

我正在使用 OpenSearchDocumentStore 来存储我的数据并将其提供给我的 Haystack 管道,数据包括 uuid 和其他信息,这些信息与预测无关,但需要堆叠在 DocumentStore(有人告诉我)。现在我想知道是否有一种方法或需要为检索器和阅读器指定一个特殊的输入文本“列”。

最佳答案

与检索无关的其他信息应保留在文档的meta字段中。例如,您可以创建如下文档:

doc = Document(
    content="this is relevant for retrieval", 
    meta={"uuid": "1234",  "comment": "this won't be used for retrieval"}
)

关于python - 如何在 Haystack 中指定预测列?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72211841/

相关文章:

xcode - 重命名 xcode 4 项目和实际文件夹

Ruby 重命名文件

bash - 如何使用前缀/后缀重命名?

api - 使用 OpenSearch Python bulk api 将数据插入多个索引

python - Heroku django 使用环境设置管理 shell (db, vars)

python - 处理 IPython 集群中的各种资源需求

Python 四叉树

python - 当前 URL 与其中任何一个都不匹配