colonelwatch commited on
Commit
feefb2e
·
1 Parent(s): f82e154

Omnibus update 2023-05-10

Browse files

* Switch from location country to FastText (new texts)
* New OpenAlex snapshot
* Move index to abstracts-index
* Expand README.md

README.md CHANGED
@@ -1,3 +1,37 @@
1
  ---
 
 
2
  license: cc0-1.0
 
 
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ language:
3
+ - en
4
  license: cc0-1.0
5
+ size_categories:
6
+ - 10M<n<100m
7
+ task_categories:
8
+ - text-retrieval
9
+ task_ids:
10
+ - document-retrieval
11
  ---
12
+
13
+ # abstracts-embeddings
14
+
15
+ This is the embeddings of the titles and abstracts of 95 million academic publications taken from the [OpenAlex](https://openalex.org) dataset as of May 5, 2023. The script that generated the embeddings is available on [Github](https://github.com/colonelwatch/abstracts-search/blob/master/build.py), but the general process is as follows:
16
+
17
+ 1. Reconstruct the text of the abstract from the inverted index format
18
+ 2. Construct a single document string in the format `title + ' ' + abstract` or just `abstract` if there is no title
19
+ 3. Determine if the document string is in English using [fastText](https://fasttext.cc/docs/en/language-identification.html)
20
+ 4. If it is in English, compute an embedding using the `all-MiniLM-L6-v2` model provided by [sentence-transformers](https://www.sbert.net/)
21
+
22
+ Though the OpenAlex dataset records 240 million works, not all of these works have abstracts or are in English. However, the `all-MiniLM-L6-v2` model was only trained on English texts, hence the filtering.
23
+
24
+ ## Dataset Structure
25
+
26
+ In the future, this dataset might become a parquet in order to admit all the features offered by Hugging Face Datasets, but it consists only of a text file and a numpy memmap for now. The memmap is an array of many length-384 `np.float16` vectors, and the i-th row vector in this array corresponds with the i-th line in the text file. The text file is just a list of ids that can be used to get more information from the OpenAlex API.
27
+
28
+ ```python
29
+ import numpy as np
30
+
31
+ with open('idxs.txt', 'r') as f:
32
+ idxs = f.read().splitlines()
33
+
34
+ embeddings = np.memmap('embeddings.memmap', dtype=np.float16, mode='r').reshape(-1, 384)
35
+ ```
36
+
37
+ However, the memmap cannot be uploaded to Hugging Face as a single file, so it's split with the command `split -b 3221225472 -d --suffix-length=3 --additional-suffix=.memmap embeddings.memmap embeddings_`. It can be put back together with the command `cat embeddings_*.memmap > embeddings.memmap`.
index.faiss → embeddings_000.memmap RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:15ec18b719ea4cc7c8323e43c9dcb9166f5ddcd701fe95952c4bc1de934aedbf
3
- size 1612129107
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:89ea02177f91bdf87211d2b09fca58d862ec4cca89ea1e7a84042646ada3a62b
3
+ size 3221225472
embeddings.memmap → embeddings_001.memmap RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:29a4f2693147215306bab8fc5014f5cd2d277da1886b8938554a453901b2663a
3
- size 16467630336
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bb6ab47a4ef09c31f81a3c034eb641eb6692a0e44e5afbc9902b147048cd9398
3
+ size 3221225472
embeddings_002.memmap ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2a9b3b120596005ab2f33cc930b13109193ff7c84f0713e144c7235a9dfd0c1e
3
+ size 3221225472
embeddings_003.memmap ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:77593cfaa1f569b7c6df43827a352149e155fc2e58ee2e9394c946c542ad4d47
3
+ size 3221225472
embeddings_004.memmap ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:26437b602d9d1d9dc947c79d6c6aed5f6860e83c821499dcd3a4e14b8a28d7a4
3
+ size 3221225472
embeddings_005.memmap ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4df92db44dbe15a5789e821afbf6d45a252577c8bfb8a4f6c11dce61a71e21d8
3
+ size 3221225472
embeddings_006.memmap ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4293a3baf48f32a909899ed6f4e2a0606c87fc3e74185b63a8b7027a3fda8be2
3
+ size 3221225472
embeddings_007.memmap ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4415ec009c2d09021495086afa337308f4b7f0d995c6bf30016b7f74b178600f
3
+ size 3221225472
embeddings_008.memmap ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:67ab6c0ee01a48a3595c189e715eadd592bc43c82468313b71eb7ab73c51ab25
3
+ size 3221225472
embeddings_009.memmap ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b29f6ffdf6cafd70e5bff0040f0e5358cecbd1b5c52a6a3b498a21b3f0871232
3
+ size 3221225472
embeddings_010.memmap ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f32f5155ebadebae2962514cc9fa8da98eacbb9b4dd4964d073644e22d24e9b1
3
+ size 3221225472
embeddings_011.memmap ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:95b2124edb808e01d18e1fe5ac1c7fa41bf72eab14389ef4d2a1e7dcdf99d73e
3
+ size 3221225472
embeddings_012.memmap ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e1182e8a29e23d86f8535f84a732de99557ccc4888dc2b10753d4a457d86db96
3
+ size 3221225472
embeddings_013.memmap ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:508bcf99594af0032e5e201eddea844b3a1e32d567358fdbf3afe2a599eebeea
3
+ size 3221225472
embeddings_014.memmap ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d6e58b0dc14166451dc1cadeb9537f176ff908837419df5696b21983e6f05add
3
+ size 3221225472
embeddings_015.memmap ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4b09d021abef46030a44cebfba4ff9f986ed5145ee83a1379c33709253172d91
3
+ size 3221225472
embeddings_016.memmap ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d4885c4283beabf9595b2104b710758bbb34e5d3be1a9a8946716ac00c192638
3
+ size 3221225472
embeddings_017.memmap ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2bc5dcdf0ce4a7d4c04250949bf6738f9fe215802576bff91be76146c16e6a5b
3
+ size 3221225472
embeddings_018.memmap ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:49aeb96541c389fccec1ac1c8b8d6486c5414d81962b6fc92864a76a145b20f0
3
+ size 3221225472
embeddings_019.memmap ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:27552a819213b1d43bbb9b6a488a1fd83afae05ab02257326bacde4845a1ef37
3
+ size 3221225472
embeddings_020.memmap ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d6c583d70853c4772b57ad1f5eb7c2effd5670d6df5462cc6bab8750232a8b31
3
+ size 3221225472
embeddings_021.memmap ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a2d2caa5a2036ad6792ba65c5d8a92ca12bc50f6be3aec7a3649bf5526106157
3
+ size 3221225472
embeddings_022.memmap ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f5f0e2466893e11a102d9711ceae45a503465f713fea4f6485838c67c9dc9c13
3
+ size 2392859136
idxs.txt CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:72cfd30be8975f68492ae5006e50dd7f64789a872dcf1e23188e236c61f9682a
3
- size 706654763
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:eeb2e963d4b3e1026ad550ea8a2e4fca92a1b59aa4d6fd005953ec5505415396
3
+ size 3141761935