mawadalla commited on
Commit
703fb21
1 Parent(s): ee0168d

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +71 -0
README.md ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ task_categories:
3
+ - visual-question-answering
4
+ language:
5
+ - en
6
+ pretty_name: Scientific Figures and Captions
7
+ size_categories:
8
+ - 1M<n<10M
9
+ ---
10
+ # Scientific Figures and Captions Dataset from research papers
11
+
12
+ This repository contains the Scientific Figures and Captions dataset, which includes approximately 2.5 million entries of scientific figures and their corresponding captions extracted from academic papers on arXiv. This dataset is intended for research purposes in the fields of computer vision and natural language processing, particularly for tasks related to image captioning and automated figure analysis.
13
+
14
+ ## Dataset Description
15
+
16
+ The dataset is structured as a Parquet dataframe with two columns:
17
+ - `image_filename`: This column contains the relative paths to image files.
18
+ - `caption`: This column contains the textual captions associated with each image.
19
+
20
+ Images are stored under `dataset/figures/` and are compressed into multiple parts (.z01, .z02, ..., .z103) with a final `.zip` file that encompasses all parts. This format is used for efficiently handling large datasets.
21
+
22
+ ## Extraction Instructions
23
+
24
+ To access the images, you must first decompress the multi-part ZIP archive. Make sure you have all parts of the archive (.z01 to .z103 and the .zip file) in the same directory. Most decompression tools will recognize and handle multi-part ZIP files seamlessly.
25
+
26
+ Here is an example using the command line with `unzip`:
27
+ ```bash
28
+ # Navigate to the directory containing the compressed parts
29
+ cd dataset/figures
30
+
31
+ # Use unzip to extract the images
32
+ unzip compressedfigures.zip
33
+ ```
34
+
35
+ This will extract the contents into the `dataset/figures/` directory. Ensure that you have enough storage space to accommodate the uncompressed images.
36
+
37
+ ## Usage Example
38
+
39
+ To use the dataset in your Python projects, you'll need to read the Parquet file into a DataFrame. Here is an example using `pandas`:
40
+ ```python
41
+ import pandas as pd
42
+
43
+ # Load the dataset into a DataFrame
44
+ df = pd.read_parquet('dataset.parquet')
45
+
46
+ # Display the first few entries
47
+ df.head()
48
+ ```
49
+
50
+ Once the dataset is loaded, you can use it as follows:
51
+ ```python
52
+ from PIL import Image
53
+ import matplotlib.pyplot as plt
54
+
55
+ # Example function to display an image with its caption
56
+ def show_image_with_caption(image_path, caption):
57
+ img = Image.open(image_path)
58
+ plt.imshow(img)
59
+ plt.title(caption)
60
+ plt.axis('off') # Hide the axis
61
+ plt.show()
62
+
63
+ # Display the first image and its caption
64
+ first_image_path = df.loc[0, 'path_to_image']
65
+ first_caption = df.loc[0, 'caption']
66
+ show_image_with_caption(first_image_path, first_caption)
67
+ ```
68
+
69
+ ## Acknowledgment
70
+
71
+ Special thanks to arxiv for providing access to all of the research papers.