这是一个嵌入索引,用于 English edition of Wikipedia
此索引是从 OLM Wikipedia December 2022 dataset 构建的。索引中仅包含每篇文章的第一个段落。类似于文章的摘要。
它还使用 Wikipedia Page Views 数据添加了一个进度字段。进度字段可用于仅匹配常访问的页面。
txtai的版本必须为 installed 才能使用此模型。
版本5.4添加了从Hugging Face Hub加载嵌入索引的支持。请参见下面的示例。
from txtai.embeddings import Embeddings
# Load the index from the HF Hub
embeddings = Embeddings()
embeddings.load(provider="huggingface-hub", container="neuml/txtai-wikipedia")
# Run a search
embeddings.search("Roman Empire")
# Run a search matching only the Top 1% of articles
embeddings.search("""
SELECT id, text, score, percentile FROM txtai WHERE similar('Boston') AND
percentile >= 0.99
""")
由txtai生成的嵌入索引是一个完全封装的索引格式。它不需要数据库服务器或Python安装之外的依赖项。
Wikipedia索引作为基于事实的上下文来源适用于对话式搜索。换句话说,可以将此模型的搜索结果作为LLM提示中用于回答问题的上下文。
有关如何使用此模型的其他示例,请参阅此 article 。