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.
프로젝트는 세 가지 리포지토리로 나뉩니다.
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
모든 건물은 16GB의 RAM (16GB 스왑), RTX 2060 6GB 및 1TB 스크래치 디스크가있는 기계에서 수행되었으므로 현재 최소 요구 사항이 제기됩니다.
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