File size: 6,466 Bytes
fb47ce1
 
 
 
 
 
 
 
 
 
 
 
2ca0e78
fb47ce1
 
 
 
93f2281
 
 
238fbb6
fb47ce1
 
 
 
 
8117919
bc6beec
 
 
 
26d48b9
bc6beec
 
 
 
 
 
 
fb47ce1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
238fbb6
fb47ce1
238fbb6
fb47ce1
7b83d5e
fb47ce1
7b83d5e
fb47ce1
7b83d5e
 
 
 
 
fb47ce1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b935fa7
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
---
license: apache-2.0
task_categories:
- feature-extraction
language:
- en
size_categories:
- 1M<n<10M
---

# `arXiv`

This is a [arXiv](https://arxiv.org/) dataset for use with the [II-Commons-Store](https://github.com/Intelligent-Internet/II-Commons-Store) project.

## Dataset Details

### Dataset Description

This dataset comprises a curated arXiv dataset. We provide a series of pre-computed embedding vector datasets based on ArXiv paper data to help users quickly start and test the semantic search API. These datasets contain paper metadata, text from certain sections, and optimized embedding vectors. They can be downloaded and used directly, eliminating the need for time-consuming local embedding calculations.

<i>More details about the dataset can be found [here](https://github.com/Intelligent-Internet/ii-commons-store/blob/main/DATASETS.md).</i>

### Dataset Sources

This dataset is derived and organized from arXiv. The original license information for the image can be found in the corresponding entry of the original database.

We merged two major [OAI](https://info.arxiv.org/help/oa/index.html) datasets snapshot of arXiv:

- [github.com/mattbierbaum/arxiv-public-datasets](https://github.com/mattbierbaum/arxiv-public-datasets/releases)
    - 1.5M+ papers
    - cutoff at 2019-03-01
    - categories: ALL.
- [kaggle.com/datasets/Cornell-University/arxiv](https://www.kaggle.com/datasets/Cornell-University/arxiv/data)
    - 1.7M+ papers
    - cutoff at 2025-03-13
    - categories: math, statistics, electrical engineering, quantitative biology, and economics.

<i>We are still working on this dataset and more fresh data will be added soon.</i>

## Dataset Structure

### `ts_arxiv`

- id: A unique identifier for the paper.
- paper_id: The arXiv paper ID. 
- submitter: The submitter of the paper.
- authors: The authors of the paper.
- title: The title of the paper.
- comments: The comments of the paper.
- journal_ref: The journal reference of the paper.
- doi: The DOI of the paper.
- report_no: The report number of the paper.
- versions: The versions of the paper.
- url: The URL of the paper.
- license: The license of the paper.
- abstract: The abstract of the paper.
- introduction: The introduction of the paper. [1]
- conclusion: The conclusion of the paper. [1]
- categories_flat: The categories of the paper.

<i>[1] We only populate the introduction and conclusion fields if the paper uses a CC license.</i>

### `ts_arxiv_embed`

- id: A unique identifier for the paper.
- abstract_vector: The vector embedding of the abstract of the paper.
- introduction_vector: The vector embedding of the introduction of the paper.
- conclusion_vector: The vector embedding of the conclusion of the paper.

## How to use

### Use `II-Commons-Store`

The easiest way to use the arXiv dataset is to use the [`II-Commons-Store`(ii-commons-store Semantic Search API)](https://github.com/Intelligent-Internet/ii-commons-store) project. The project is a high-performance semantic search and storage API built with FastAPI and DuckDB. It allows you to store text data, generate vector embeddings for it, and perform efficient semantic searches.

### Use the pre-built [DuckDB](https://duckdb.org/) database

You can download the pre-built DuckDB database from [here](https://huggingface.co/datasets/Intelligent-Internet/arxiv/tree/main/duckdb).

### Build your own DuckDB database from exported csv files

You can export the csv files from the DuckDB database using the following command:

1. Creating DuckDB database

```bash
$ duckdb arxiv.duckdb
```

2. Importing arxiv meta table `ts_arxiv`

```sql
CREATE TABLE ts_arxiv(
    id BIGINT,
    paper_id VARCHAR,
    submitter VARCHAR[],
    authors VARCHAR[],
    title VARCHAR,
    comments VARCHAR,
    journal_ref VARCHAR,
    doi VARCHAR,
    report_no VARCHAR,
    versions VARCHAR[],
    url VARCHAR,
    license VARCHAR,
    abstract VARCHAR,
    introduction VARCHAR,
    conclusion VARCHAR,
    categories_flat VARCHAR[]
);

INSERT INTO ts_arxiv (
    id, paper_id, submitter, authors, title, comments, journal_ref, doi, report_no, versions, url, license, abstract, introduction, conclusion, categories_flat
) SELECT
    id, paper_id, submitter, authors, title, comments, journal_ref, doi, report_no, versions, url, license, abstract, introduction, conclusion, categories_flat
FROM read_csv_auto('lite/ts_arxiv/0000000.csv');
```

3. Importing vector embeddings table `ts_arxiv_embed`

```sql
CREATE TABLE ts_arxiv_embed (
    id BIGINT,
    abstract_vector UTINYINT[128],
    introduction_vector UTINYINT[128],
    conclusion_vector UTINYINT[128]
);

INSERT INTO ts_arxiv_embed (id, abstract_vector, introduction_vector, conclusion_vector)
SELECT
    id,
    CASE
        WHEN abstract_vector IS NULL OR abstract_vector = '' OR abstract_vector = '[]' THEN NULL
        WHEN trim(trim(abstract_vector, '[]'), ' ') = '' THEN CAST([] AS UTINYINT[])
        ELSE list_transform(list_filter(
            string_split(trim(trim(abstract_vector, '[]'), ' '), ' '),
            element -> element <> '' AND element IS NOT NULL
        ), x -> CAST(x AS UTINYINT))
    END AS abstract_vector,
    CASE
        WHEN introduction_vector IS NULL OR introduction_vector= '' OR introduction_vector = '[]' THEN NULL
        WHEN trim(trim(introduction_vector, '[]'), ' ') = '' THEN CAST([] AS UTINYINT[])
        ELSE list_transform( list_filter(
            string_split(trim(trim(introduction_vector, '[]'), ' '), ' '),
            element -> element <> '' AND element IS NOT NULL
        ), x -> CAST(x AS UTINYINT))
    END AS introduction_vector,
    CASE
        WHEN conclusion_vector IS NULL OR conclusion_vector= '' OR conclusion_vector = '[]' THEN NULL
        WHEN trim(trim(conclusion_vector, '[]'), ' ') = '' THEN CAST([] AS UTINYINT[])
        ELSE list_transform( list_filter(
            string_split(trim(trim(conclusion_vector, '[]'), ' '), ' '),
            element -> element <> '' AND element IS NOT NULL
        ), x -> CAST(x AS UTINYINT))
      END AS conclusion_vector
FROM read_csv_auto(
    'lite/ts_arxiv_embed_section_text/0000000.csv',
    types={'abstract_vector': 'VARCHAR', 'introduction_vector': 'VARCHAR', 'conclusion_vector':'VARCHAR'}
);
```

### Use the full PostgreSQL version database

We also provide a full PostgreSQL version un-trimmed database. You can download it from [here](https://huggingface.co/datasets/Intelligent-Internet/arxiv/tree/main/data).