Seeker38 commited on
Commit
187de42
1 Parent(s): 781dd13

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +33 -0
README.md CHANGED
@@ -66,3 +66,36 @@ Researchers and developers can utilize this dataset for various tasks such as:
66
  - Image Quality: Variation in image quality and resolution may impact model performance.
67
  - Text length imbalance: the longest text has the length of 8903 whereas the shortest is 1. This can create a situation of highly ram usage with using LSTM model,etc..
68
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
66
  - Image Quality: Variation in image quality and resolution may impact model performance.
67
  - Text length imbalance: the longest text has the length of 8903 whereas the shortest is 1. This can create a situation of highly ram usage with using LSTM model,etc..
68
 
69
+ ### View dataset:
70
+ <b>For direct use instead of downloading the dataset to local</b>
71
+ ```python
72
+ from datasets import load_dataset
73
+ dataset = load_dataset("Seeker38/image_text_wikipedia_vi")
74
+ ```
75
+
76
+ <b>For dataset has been downloaded to local</b>
77
+ ```python
78
+ import pandas as pd
79
+ from datasets import Dataset
80
+ parquet_file = 'articles_data.parquet'
81
+
82
+ df = pd.read_parquet(parquet_file)
83
+
84
+ # Convert the pandas DataFrame to a datasets.arrow_dataset.Dataset object
85
+ dataset = Dataset.from_pandas(df)
86
+ ```
87
+ <b>To view the third element's text</b>
88
+ ```python
89
+ dataset[3]["text"]
90
+ ```
91
+ <b>To view,or even use for training the third element's image, you need to contain the convertion step</b>
92
+ ```python
93
+ from PIL import Image
94
+ import io
95
+
96
+ image_bytes = dataset[3]["image"]
97
+
98
+ # Convert bytes to Image
99
+ image = Image.open(io.BytesIO(image_bytes))
100
+ image
101
+ ```