This index is built from the
Wikipedia January 2024 dataset
. Only the first paragraph of the
lead section
from each article is included in the index. This is similar to an abstract of the article.
It also uses
Wikipedia Page Views
data to add a
percentile
field. The
percentile
field can be used
to only match commonly visited pages.
Version 5.4 added support for loading embeddings indexes from the Hugging Face Hub. See the example below.
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""")
Use Cases
An embeddings index generated by txtai is a fully encapsulated index format. It doesn't require a database server or dependencies outside of the Python install.
The Wikipedia index works well as a fact-based context source for retrieval augmented generation (RAG). In other words, search results from this model can be passed to LLM prompts as the context in which to answer questions.
See this
article
for additional examples on how to use this model.
e5-base
is the best performing model for the evaluation set. This highlights the importance of testing models as
e5-base
is far from the leading model on the
MTEB leaderboard
. Benchmark datasets are only a guide.
Build the index
The following steps show how to build this index. These scripts are using the latest data available as of 2024-01-01, update as appropriate.
from datasets import load_dataset
# Data dump date from https://dumps.wikimedia.org/enwiki/
date = "20240101"# Build and save dataset
ds = load_dataset("neuml/wikipedia", language="en", date=date)
ds.save_to_disk(f"wikipedia-{date}")
txtai-wikipedia huggingface.co is an AI model on huggingface.co that provides txtai-wikipedia's model effect (), which can be used instantly with this NeuML txtai-wikipedia model. huggingface.co supports a free trial of the txtai-wikipedia model, and also provides paid use of the txtai-wikipedia. Support call txtai-wikipedia model through api, including Node.js, Python, http.
txtai-wikipedia huggingface.co is an online trial and call api platform, which integrates txtai-wikipedia's modeling effects, including api services, and provides a free online trial of txtai-wikipedia, you can try txtai-wikipedia online for free by clicking the link below.
NeuML txtai-wikipedia online free url in huggingface.co:
txtai-wikipedia is an open source model from GitHub that offers a free installation service, and any user can find txtai-wikipedia on GitHub to install. At the same time, huggingface.co provides the effect of txtai-wikipedia install, users can directly use txtai-wikipedia installed effect in huggingface.co for debugging and trial. It also supports api for free installation.