abstracts-search is a project about indexing 95 million academic publications into a single semantic search engine. The method behind it is to take the publicly-available abstracts in the OpenAlex dataset and generate embeddings using the all-MiniLM-L6-v2 model provided by sentence-transformers.
プロジェクトは3つのリポジトリに分かれています。
abstracts-search : Hosts build.py and train.py , the embedding and indexing scripts respectivelyabstracts-embeddings : Hosts the raw embeddings (released under CC0) as a Hugging Face Datasetabstracts-index : Hosts the index and app.py , the search interface, as a Hugging Face Space (also released under CC0)出版物(タイトル、要約、著者など)に関連付けられているすべてのデータは、このプロジェクトでは提供されていません。むしろ、OpenAlex IDでラベル付けされた埋め込みのみが含まれており、IDはOpenAlex APIからそのデータを取得するために使用されます。したがって、インターネット接続が常に必要です。それでも、セマンティック検索をローカルで実行することが望ましい場合があります。
If that is the case, the only repo that needs to be cloned is abstracts-index :
git lfs install
git clone https://huggingface.co/spaces/colonelwatch/abstracts-index
cd abstracts-index
pip3 install -r requirements.txt
python3 app.py
すべての建物は、16 GBのRAM(プラス16 GBスワップ)、RTX 2060 6GB、および1 TBのスクラッチディスクを備えたマシンで行われたため、今のところ最小要件を提起します。
There are two ways to build the index: from the abstracts-embeddings (recommended) or from the OpenAlex S3 bucket.
To build from abstracts-embeddings , make sure conda and gcc-12 are available:
git lfs install
git clone https://github.com/colonelwatch/abstracts-search
env CC=gcc-12 conda env create -f environment.yml
conda activate abstracts-search
git submodule update --init abstracts-embeddings
cd abstracts-embeddings
cat embeddings_*.memmap > embeddings.memmap
cd ..
env GIT_LFS_SKIP_SMUDGE=1 git submodule update --init abstracts-index
python train.py
OpenAlex S3バケットから構築したい場合は、GITの履歴を保持することにも興味があるかもしれません。 Again, make sure conda and gcc-12 are available.
git lfs install
git clone https://github.com/colonelwatch/abstracts-search
env CC=gcc-12 conda env create -f environment.yml
conda activate abstracts-search
env GIT_LFS_SKIP_SMUDGE=1 git submodule update --init abstracts-embeddings
rm abstracts-embeddings/embeddings_*.memmap
rm abstracts-embeddings/openalex_ids.txt
python build.py
env GIT_LFS_SKIP_SMUDGE=1 git submodule update --init abstracts-index
python train.py