--- license: apache-2.0 task_categories: - feature-extraction language: - en size_categories: - 1MMore details about the dataset can be found [here](https://github.com/Intelligent-Internet/ii-commons-local/blob/main/DATASETS.md). ### 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. ## 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-Local` The easiest way to use the arXiv dataset is to use the [`II-Commons-Local`(ii-commons-desktop Semantic Search API)](https://github.com/Intelligent-Internet/ii-commons-local) 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).