dominguesm commited on
Commit
c323a60
·
verified ·
1 Parent(s): 640e079

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +80 -15
README.md CHANGED
@@ -2,15 +2,15 @@
2
  language: pt
3
  license: cc-by-4.0
4
  multilinguality:
5
- - monolingual
6
  task_categories:
7
- - text-generation
8
- - fill-mask
9
  task_ids:
10
- - language-modeling
11
- - masked-language-modeling
12
  size_categories:
13
- - 100M<n<1B
14
  dataset_info:
15
  features:
16
  - name: url
@@ -33,6 +33,7 @@ dataset_info:
33
  num_examples: 342818651
34
  download_size: 1087713663056
35
  dataset_size: 1087519823221
 
36
  ---
37
 
38
  <p align="center">
@@ -40,7 +41,7 @@ dataset_info:
40
  </p>
41
 
42
  <p align="center">
43
- <a href="https://github.com/DominguesM/canarim">[🐱 Github]</a>
44
  </p>
45
 
46
  <hr>
@@ -60,13 +61,13 @@ An example looks as follows:
60
 
61
  ```json
62
  {
63
- 'url': '...',
64
- 'content_languages': 'por',
65
- 'warc_filename': 'crawl-data/CC-MAIN-2023-06/segments/1674764500041.18/warc/CC-MAIN-20230202200542-20230202230542-00352.warc.gz',
66
- 'warc_record_offset': 971279893,
67
- 'warc_record_length': 3873,
68
- 'text': '...',
69
- 'crawl_timestamp': '2023-02-02T20:28:21Z'
70
  }
71
  ```
72
 
@@ -94,7 +95,71 @@ The Canarim database employs the [`Trafilatura`](https://trafilatura.readthedocs
94
  <a href="https://github.com/DominguesM/canarim/blob/main/assets/extracted_text.md" target="_blank">Extracted Text</a>
95
  </p>
96
 
 
97
 
 
98
 
 
 
99
 
100
- WIP
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  language: pt
3
  license: cc-by-4.0
4
  multilinguality:
5
+ - monolingual
6
  task_categories:
7
+ - text-generation
8
+ - fill-mask
9
  task_ids:
10
+ - language-modeling
11
+ - masked-language-modeling
12
  size_categories:
13
+ - 100M<n<1B
14
  dataset_info:
15
  features:
16
  - name: url
 
33
  num_examples: 342818651
34
  download_size: 1087713663056
35
  dataset_size: 1087519823221
36
+ pretty_name: Canarim
37
  ---
38
 
39
  <p align="center">
 
41
  </p>
42
 
43
  <p align="center">
44
+ <a href="https://huggingface.co/datasets/dominguesm/canarim">[🐱 HuggingFace]</a>
45
  </p>
46
 
47
  <hr>
 
61
 
62
  ```json
63
  {
64
+ "url": "...",
65
+ "content_languages": "por",
66
+ "warc_filename": "crawl-data/CC-MAIN-2023-06/segments/1674764500041.18/warc/CC-MAIN-20230202200542-20230202230542-00352.warc.gz",
67
+ "warc_record_offset": 971279893,
68
+ "warc_record_length": 3873,
69
+ "text": "...",
70
+ "crawl_timestamp": "2023-02-02T20:28:21Z"
71
  }
72
  ```
73
 
 
95
  <a href="https://github.com/DominguesM/canarim/blob/main/assets/extracted_text.md" target="_blank">Extracted Text</a>
96
  </p>
97
 
98
+ ## Usage
99
 
100
+ Below is an example of how to quickly explore just a few samples from a dataset using the `datasets` library.
101
 
102
+ ```python
103
+ !pip install -q datasets
104
 
105
+ from datasets import load_dataset
106
+
107
+ ds = load_dataset(
108
+ "dominguesm/canarim",
109
+ # Filter only the data from the `train split`
110
+ split="train",
111
+ # Filter only the files that contain the prefix `train/data-0019` and the suffix `-of-00192.arrow`
112
+ data_files="train/data-0019*-of-00192.arrow",
113
+ # Load the dataset without downloading the data (Streaming mode)
114
+ streaming=True
115
+ )
116
+
117
+ # From the returned data, filter only the data where the `url` value starts with `https://g1.globo.com/`
118
+ ds_globo = ds.filter(
119
+ lambda example: example['url'].startswith("https://g1.globo.com/")
120
+ )
121
+
122
+ # Return the first 10 examples from the applied filter.
123
+ data = list(ds_globo.take(10))
124
+
125
+ print(data[0])
126
+
127
+ # {
128
+ # "url": "https://g1.globo.com/ac/acre/(...)",
129
+ # "content_languages": "por",
130
+ # "warc_filename": "crawl-data/CC-MAIN-2023-06/segments/1674764499919.70/warc/CC-MAIN-20230201081311-20230201111311-00552.warc.gz",
131
+ # "warc_record_offset": 281625400,
132
+ # "warc_record_length": 192934,
133
+ # "text": "Parque Zoobotânico da Ufac guarda uma grande variedade espécies de árvores em Rio Branco — Foto: Arquivo/Ufac (...)",
134
+ # "crawl_timestamp": "2023-02-01T10:38:52Z"
135
+ # }
136
+ ```
137
+
138
+ ## Dataset Statistics
139
+
140
+ | Split | # Samples | # Size (bytes) | # Size (GB) |
141
+ | ------ | --------- | -------------- | ----------- |
142
+ | Train | 342,818,651 | 1,087,519,823,221 | 1087,51 |
143
+
144
+ ## Citing
145
+
146
+ If you use Canarim in your research, please cite the following.
147
+
148
+ ```bibtex
149
+ @misc {maicon_domingues_2024,
150
+ author = { {Maicon Domingues} },
151
+ title = { canarim (Revision 640e079) },
152
+ year = 2024,
153
+ url = { https://huggingface.co/datasets/dominguesm/canarim },
154
+ doi = { 10.57967/hf/1605 },
155
+ publisher = { Hugging Face }
156
+ }
157
+ ```
158
+
159
+ ## License
160
+
161
+ This dataset is licensed under the [Creative Commons Attribution 4.0 International (CC BY 4.0)](https://creativecommons.org/licenses/by/4.0/). You can use the dataset for any purpose, but you must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
162
+
163
+ ## Contact
164
+
165
+ For any questions or suggestions, please contact [Maicon Domingues](https://nlp.rocks/).