jonathan-roberts1 commited on
Commit
758366c
1 Parent(s): 9f1fe92

Added example datasets usage

Browse files
Files changed (1) hide show
  1. README.md +45 -0
README.md CHANGED
@@ -24,6 +24,51 @@ figure given a caption. This benchmark was curated from the SciCap dataset, usin
24
  on each question to ensure high-quality,
25
  answerable questions.
26
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
 
28
  ### Source Data
29
 
 
24
  on each question to ensure high-quality,
25
  answerable questions.
26
 
27
+ ### Example Usage
28
+ ```python
29
+ from datasets import load_dataset
30
+
31
+ # load dataset
32
+ dataset = load_dataset("jonathan-roberts1/SciFIBench") # optional: set cache_dir="PATH/TO/MY/CACHE/DIR"
33
+ # figure2caption_dataset = load_dataset("jonathan-roberts1/SciFIBench", split="Figure2Caption")
34
+ # caption2figure_dataset = load_dataset("jonathan-roberts1/SciFIBench", split="Caption2Figure")
35
+ """
36
+ DatasetDict({
37
+ Caption2Figure: Dataset({
38
+ features: ['ID', 'Question', 'Options', 'Answer', 'Category', 'Images'],
39
+ num_rows: 500
40
+ })
41
+ Figure2Caption: Dataset({
42
+ features: ['ID', 'Question', 'Options', 'Answer', 'Category', 'Images'],
43
+ num_rows: 500
44
+ })
45
+ })
46
+ """
47
+
48
+ # select task
49
+ figure2caption_dataset = dataset['Figure2Caption']
50
+ """
51
+ Dataset({
52
+ features: ['ID', 'Question', 'Options', 'Answer', 'Category', 'Images'],
53
+ num_rows: 500
54
+ })
55
+ """
56
+
57
+ # query items
58
+ figure2caption_dataset[40] # e.g., the 41st element
59
+ """
60
+ {'ID': 40,
61
+ 'Question': 'Which caption best matches the image?',
62
+ 'Options': ['A) ber vs snr for fft size=2048 using ls , lmmse , lr-lmmse .',
63
+ 'B) ber vs snr for fft size=1024 using ls , lmmse , lr-lmmse algorithms .',
64
+ 'C) ber vs snr for fft size=512 using ls , lmmse , lr-lmmse algorithms .',
65
+ 'D) ber vs snr for fft size=256 using ls , lmmse , lr-lmmse algorithms with a 16 qam modulation .',
66
+ 'E) ber vs snr for a bpsk modulation .'],
67
+ 'Answer': 'D',
68
+ 'Category': 'other cs',
69
+ 'Images': [<PIL.PngImagePlugin.PngImageFile image mode=RGB size=501x431>]}
70
+ """
71
+ ```
72
 
73
  ### Source Data
74