arxiv / README.md
huoju's picture
Update README.md
238fbb6 verified
metadata
license: apache-2.0
task_categories:
  - feature-extraction
language:
  - en
size_categories:
  - 1M<n<10M

arXiv

This is a arXiv dataset for use with the 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.

More details about the dataset can be found here.

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 datasets snapshot of arXiv:

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

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.

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

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) 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 database

You can download the pre-built DuckDB database from here.

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
$ duckdb arxiv.duckdb
  1. Importing arxiv meta table ts_arxiv
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');
  1. Importing vector embeddings table ts_arxiv_embed
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.