File size: 31,649 Bytes
9bf6b08
5bae759
 
 
 
 
 
 
 
 
 
 
 
 
9bf6b08
663c593
9bf6b08
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
663c593
 
 
 
54daadb
663c593
54daadb
 
 
663c593
 
 
54daadb
44c69d6
54daadb
663c593
54daadb
44c69d6
54daadb
 
 
 
e43aa31
 
663c593
 
e43aa31
 
 
 
27cef73
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5bae759
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9dc2f72
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5bae759
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c25d4f2
 
 
 
 
 
 
 
 
 
 
 
d170fc0
 
 
 
 
 
 
 
 
 
 
 
 
 
a6069e7
 
 
 
 
 
 
 
 
 
 
 
 
 
9bf6b08
 
 
 
 
663c593
 
 
 
27cef73
 
 
 
ea8a321
 
 
 
9dc2f72
 
 
 
6357aea
 
 
 
c25d4f2
 
 
 
d170fc0
 
 
 
a6069e7
 
 
 
9bf6b08
aa45433
11e4df4
 
aa45433
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31f148d
a894a81
31f148d
a894a81
31f148d
 
 
 
e2b0e3e
31f148d
 
 
 
 
aa45433
31f148d
e2b0e3e
31f148d
e2b0e3e
31f148d
e2b0e3e
31f148d
aa45433
 
 
 
 
 
 
 
 
 
 
 
 
 
31f148d
 
 
 
 
aa45433
 
a894a81
31f148d
 
aa45433
31f148d
 
 
 
 
 
aa45433
31f148d
aa45433
31f148d
 
e2b0e3e
31f148d
e2b0e3e
31f148d
e2b0e3e
31f148d
e2b0e3e
31f148d
e2b0e3e
31f148d
 
 
 
 
aa45433
 
 
 
 
 
 
 
 
 
 
 
31f148d
 
 
 
 
 
a894a81
31f148d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a894a81
 
 
31f148d
 
 
 
aa45433
31f148d
 
aa45433
 
 
 
 
 
31f148d
a894a81
31f148d
aa45433
 
31f148d
 
 
 
 
 
 
 
 
 
 
 
 
 
aa45433
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31f148d
 
 
 
 
 
 
aa45433
31f148d
 
 
 
aa45433
 
 
 
 
 
 
 
 
 
 
 
a894a81
31f148d
 
 
aa45433
31f148d
 
 
 
 
 
 
 
 
 
 
 
 
 
aa45433
 
 
 
 
a894a81
31f148d
 
 
 
 
 
 
 
 
 
 
aa45433
 
 
 
 
 
 
 
31f148d
a894a81
31f148d
 
 
 
 
 
 
 
 
aa45433
31f148d
 
 
 
 
 
 
 
 
aa45433
 
 
 
a894a81
31f148d
 
 
 
a894a81
 
 
aa45433
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31f148d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
aa45433
a894a81
aa45433
a894a81
aa45433
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1936aa4
31f148d
 
 
 
aa45433
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
---
annotations_creators:
- no-annotation
language:
- it
multilinguality:
- monolingual
size_categories:
- 100B<n<1T
task_categories:
- text-classification
- text-generation
task_ids:
- language-modeling
dataset_info:
- config_name: OJS
  features:
  - name: journal
    dtype: string
  - name: url
    dtype: string
  - name: metadata
    list:
    - name: Alternative
      dtype: string
    - name: Coverage
      dtype: string
    - name: DOI
      dtype: string
    - name: Description
      dtype: string
    - name: Format
      dtype: string
    - name: ISSN
      dtype: string
    - name: Identifier
      dtype: string
    - name: Issue
      dtype: string
    - name: Language
      dtype: string
    - name: NBN
      dtype: string
    - name: PersonalName
      dtype: string
    - name: Rights
      dtype: string
    - name: Source
      dtype: string
    - name: Sponsor
      dtype: string
    - name: Subject
      dtype: string
    - name: Title
      dtype: string
    - name: Type
      dtype: string
    - name: URI
      dtype: string
    - name: Volume
      dtype: string
    - name: abbrev
      dtype: string
    - name: abstract
      dtype: string
    - name: articleType
      dtype: string
    - name: author
      dtype: string
    - name: authors
      dtype: string
    - name: available
      dtype: string
    - name: created
      dtype: string
    - name: date
      dtype: string
    - name: dateSubmitted
      dtype: string
    - name: doi
      dtype: string
    - name: firstpage
      dtype: string
    - name: institution
      dtype: string
    - name: issn
      dtype: string
    - name: issue
      dtype: string
    - name: issued
      dtype: string
    - name: keywords
      dtype: string
    - name: language
      dtype: string
    - name: lastpage
      dtype: string
    - name: modified
      dtype: string
    - name: nbn
      dtype: string
    - name: pageNumber
      dtype: string
    - name: readable
      dtype: string
    - name: reference
      dtype: string
    - name: spatial
      dtype: string
    - name: temporal
      dtype: string
    - name: title
      dtype: string
    - name: url
      dtype: string
    - name: volume
      dtype: string
  - name: text
    dtype: string
  - name: platform
    dtype: string
  splits:
  - name: train
    num_bytes: 12343533858
    num_examples: 232223
  download_size: 2948236259
  dataset_size: 12343533858
- config_name: blogs
  features:
  - name: title
    dtype: string
  - name: name
    dtype: string
  - name: author
    dtype: string
  - name: date
    dtype: string
  - name: url
    dtype: string
  - name: text
    dtype: string
  - name: category
    dtype: string
  - name: license_guess
    dtype: string
  - name: fasttext_langid
    sequence: string
  - name: fasttext_langprob
    dtype: float64
  - name: __index_level_0__
    dtype: int64
  splits:
  - name: train
    num_bytes: 9735412168.0
    num_examples: 2801966
  download_size: 5079359752
  dataset_size: 9735412168.0
- config_name: books
  features:
  - name: title
    dtype: string
  - name: author
    dtype: string
  - name: url
    dtype: string
  - name: text
    dtype: string
  splits:
  - name: train
    num_bytes: 1567112840
    num_examples: 6167
  download_size: 970007483
  dataset_size: 1567112840
- config_name: forums
  features:
  - name: title
    dtype: string
  - name: author
    dtype: string
  - name: post_id
    dtype: int32
  - name: progressive_number
    dtype: int32
  - name: timestamp
    dtype: string
  - name: forum
    dtype: string
  - name: text
    dtype: string
  - name: image_list
    sequence: int32
  - name: image_file
    dtype: int32
  splits:
  - name: train
    num_bytes: 263411751276
    num_examples: 468698334
  download_size: 103952670799
  dataset_size: 263411751276
- config_name: reddit
  features:
  - name: subreddit
    dtype: string
  - name: author
    dtype: string
  - name: id
    dtype: string
  - name: parent_id
    dtype: string
  - name: created_utc
    dtype: string
  - name: score
    dtype: string
  - name: ups
    dtype: string
  - name: downs
    dtype: string
  - name: text
    dtype: string
  splits:
  - name: train
    num_bytes: 368299927
    num_examples: 4192526
  download_size: 137818471
  dataset_size: 368299927
- config_name: usenet
  features:
  - name: title
    dtype: string
  - name: author
    dtype: string
  - name: id
    dtype: int64
  - name: progressive_number
    dtype: int64
  - name: timestamp
    dtype: timestamp[s]
  - name: newsgroup
    dtype: string
  - name: original_url
    dtype: string
  - name: text
    dtype: string
  splits:
  - name: train
    num_bytes: 75784729153
    num_examples: 89499446
  download_size: 34215328650
  dataset_size: 75784729153
- config_name: websites
  features:
  - name: url
    dtype: string
  - name: text
    dtype: string
  splits:
  - name: train
    num_bytes: 2046525253
    num_examples: 163554
  download_size: 966736330
  dataset_size: 2046525253
- config_name: wikimedia_it
  features:
  - name: title
    dtype: string
  - name: text
    dtype: string
  - name: wiki
    dtype: string
  splits:
  - name: train
    num_bytes: 16019187125
    num_examples: 5408451
  download_size: 7883736990
  dataset_size: 16019187125
- config_name: wikimedia_others
  features:
  - name: title
    dtype: string
  - name: text
    dtype: string
  - name: wiki
    dtype: string
  splits:
  - name: train
    num_bytes: 1837994874
    num_examples: 1043329
  download_size: 814755723
  dataset_size: 1837994874
configs:
- config_name: OJS
  data_files:
  - split: train
    path: OJS/train-*
- config_name: blogs
  data_files:
  - split: train
    path: blogs/train-*
- config_name: books
  data_files:
  - split: train
    path: books/train-*
- config_name: forums
  data_files:
  - split: train
    path: forums/train-*
- config_name: reddit
  data_files:
  - split: train
    path: reddit/train-*
- config_name: usenet
  data_files:
  - split: train
    path: usenet/train-*
- config_name: websites
  data_files:
  - split: train
    path: websites/train-*
- config_name: wikimedia_it
  data_files:
  - split: train
    path: wikimedia_it/train-*
- config_name: wikimedia_others
  data_files:
  - split: train
    path: wikimedia_others/train-*
---
# Dataset Card for Testimole -- A multi-billion tokens Italian text corpus
![image/jpeg](https://cdn-uploads.huggingface.co/production/uploads/65c27751d2fbc4e846637421/c726oXPuXRbFrLiAZqKs5.jpeg)

Testimole is a large linguistic resource for Italian obtained through a massive web scraping effort. As of June 2024, it is one of the largest datasets for the Italian language, if not the largest, publicly available, consisting of almost 100B tokens counted with the Tiktoken cl100k BPE tokenizer. It consists mainly of conversational data (Italian Usenet hierarchies, Italian message boards, Italian subreddits) but also contains other textual data derived from blogs, wikis, websites, and academic journals. Each data source is separated into a different dataset split.

Testimole is a wordplay combining "Testi" (texts) and "Mole." "Mole" refers to one of the most famous monuments of Torino, the [Mole Antonelliana](https://en.wikipedia.org/wiki/Mole_Antonelliana), where this dataset was conceived and built. Moreover, "mole" means "mass" or "bulk" in Italian, highlighting the large size of this dataset. Testimole is also similar to the word "Testimone" (witness), emphasizing the diachronic quality of the data, thus being a witness of the passage of time in the Italian webosphere.


## Dataset Details

### Dataset Description

The goal of this work is to create a huge linguistic resource for the Italian language that can be used for several NLP applications, including but not limited to language modelling. The dataset is the result of a massive web scraping effort going on from February 2024 to May 2024, so the resources have a cut-off date comprised within this time span. 
There is a project to further expand the dataset, as explained in the "Future Plans" section.

To create the dataset, I developed several scripts using Python3 and libraries such as BeautifulSoup and Selenium; the scripts were mostly written and executed manually, making it an extremely time-consuming project. The texts span different topics and periods, containing several divergent opinions and beliefs, in accordance with the main ideas of the "Perspective Data Manifesto" [1]. It is important to note that these data alone are not enough to train an Italian large language model from scratch, mainly not due to the size of the data but because, even if they span different topics, they are far from covering the broad range of subjects, information, culture, and techniques required to train a state-of-the-art model. Also, as will be better pointed out later, while it is safe to use these data under Fair Use for research purposes, users must investigate potential copyright infringement for other possible purposes. The Tiktoken BPE tokenizer with the cl100k_base model [2] was used for tokenization. This dataset is composed of several sub-datasets, each with different types of data and goals.

## Uses

Because this dataset consists of a large amount of texts in the Italian language, it can be used for all Natural Language applications that seek to improve support for Italian in a multilingual context and require data for training. This includes, but is not limited to, training large language models. Other possible uses are sentiment analysis, diachronic data classification (as the majority of the data is date-tagged), and text classification. Researchers are invited to annotate even small parts of this dataset. In such cases, the data could be used for other tasks as well, such as Named Entity Recognition (NER), Part-of-Speech (POS) tagging, information retrieval, summarization, and more. This versatility makes the dataset a valuable resource for various NLP projects and research endeavors.

### Out-of-Scope Use

By downloading this dataset, users agree not to attempt to identify specific users. This includes refraining from cross-referencing the dataset with other information to ascertain personal identities.

## Dataset Structure


**Conversational (\~ 85 Billions tokens):**

**UsenetArchiveIT**

This is the project that started the entire work: the goal was to
collect the largest possible amount of Usenet posts published in the
hierachies it.\* and italia.\* \[3\], as they were listed on
"www.eternal-september.org" and gathered mainly from Google Groups archive.

This split contains 19.395.579.455 tokens. Texts were not checked for
language, but it is a safe assumption that most of the text contained is
in Italian as the selected Usenet hierarchies target only Italian users.

*General stats:*

\"chars": 59389804791,

\"tokens": 19395579455,

\"sentences": 519535427,

\"posts": 89499446,

\"threads": 14521548


*Columns of the dataset*
* Title: The original title of the thread
* Author: Author of the post
* ID: a unique identifier of the post for the specific newsgroup
* Progressive_id: the progressive id of the single message in the thread
* Timestamp: the time and data of creation of the post, in ISO-8601 format
* Newsgroup: the name of the newsgroup in which the post belong
* Original_url: the URL of the thread
* Text: the text of the message



83GB of JSONL file before the conversion to HuggingFace dataset



**Forum**

The second part of the project is the one that produced the largest
amount of data (62.415.825.978 tokens) A list of Italian message boards based on
different platforms (phpBB, vBulletin, Simple Machines, Invision, Snitz,
XenForo\...) was created using both manual and semi-automatic web
searches. Then, for each forum, a generic script (forum\_scraper.py)
using Python3 and BeautifulSoup was adapted to fit the characteristics
of the forum (such as correct div classes for the different fields and
multiple page mechanisms). Then, the script ran over the entire range of
available pages and output a JSONL file with one post per line.

*General stats:*
{

\"chars": 199436329709,

\"tokens": 62415825978,

\"sentences": 1673025712,

\"posts": 468391746,

\"threads": 25280745,

\"hasImage\": 46071

}

*Columns of the dataset*
* Title: The original title of the thread
* Author: Author of the post
* post_id: a unique identifier of the post for the specific forum
* Progressive_id: the progressive id of the single message in the thread
* Timestamp: the time and data of creation of the post. In the majority of cases, it is in ISO-8601 format but sometime it could be not converted to ISO-8601 and so being in other formats (a good future work is to convert everything to ISO-8601). In rare cases, it is set to None.
* Forum: the name of the forum. If the forum belongs to the Forumfree or Forumcommunity circuit, the name of the circuit is appended to the name of the forum. There are cases of forums belonging to the Forumfree circuit where Forumfree is not appended. This should be fixed in a future release.
* Text: the text of the message
* image_list: experimental multimodal support
* image_file: experimental multimodal support


303GB of JSONL files before the conversion to HuggingFace dataset.

Regarding multimodality, in short: this feature is not very well
implemented. More details will follow, but do not expect too much
regarding this point.

**General notes on conversational datasets:**

The data contained in the "usenet" and "forums" splits were generated by
Italian users of the Internet between 1995 and 2024. For this reason,
they may contain biases, problematic stances with respect to ethics,
grammatically wrong sentences and non-factually true information. On the
other hand, the kind of data can be considered safer than a random crawl
of the Internet, in particular regarding the "forum" subset because in
many forums there is a strict system of moderation that prohibit posts
to go beyond a certain treshold of acceptance (different from forum to
forum) with regards to language and thematics. Because the name of the
forum/newsgroup is always present in the dataset, it is possible for the
users of this dataset to filter the sources of data according to their
needs.

It is also important to note, for people less accustomed to internet
conversations, that data coming from forums are not just generic
conversations but are often a real goldmine of detailed and extremely
specific information about several topics written by people who are
often passionate and very knowledgeable about what they are discussing.
This is especially true for forums that discuss technical and scientific
topics.

This collection of conversational data is useful not only for general
language modelling but also for many NLP tasks that could take
advantages from a very large amount of conversational data, such as
sentiment analysis, hate/misoginy speech detection, parsing and so on;
on the other hand, the diacronic nature of data permits interesting
analysis on diachronic phenomena such as anaylysis of how the Italian
language used in the Internet changed over the year and the most
discussed topics for each historical period, just to mention a couple of
examples.

The post should not contain personal information as in all the forums
internal rules was asked to the user not to share personal information
as they would have been publicly available on the web.

**General**

**OJS**

This split of the dataset contains articles published as Open Access
using the platform OJS. It comprised mainly academic journals from
Italian universities, so it can be considered as a very high-quality
dataset and not problematic regarding biases, apart from very generic biases that may be present in the Italian language in itself or in Academia environments. All the articles are published with Creative Commons licenses,
and the license used for the single article can be retrieved from the
metadata.
*Columns of the dataset*
* Journal:
* url: 
* metadata: 
* text: 
* platform: 

**Blogs**

This resource was gathered by scraping data from blogs and on-line newspapers written in
Italian.

This sub-project started with the goal of collecting only blogs released
under Public Domain or Creative Commons license. However, due do the
automatic nature of the list creation process, I noticed that some blog
having an "All right reserved" license were scraped too. Some of these
license permits the reuse of the information with the only obligation of
mentioning the URL, and the URL is always present in the rows of the
dataset. I created a simple script that tried to guess from the home
page of the blog, but the results are not optimal and a better pipeline
should be implemented. This means that the direct use of this resource
is fine under Fair-Use for research purposes but the possibility of
usage should be checked by whom wants to use this dataset for other
purposes, especially for commercial purposes.

The project started with a collection of blogs regarding
left-wing activism, in order to help another person for his research
project, that it is still work in progress. The list of these blog was
obtained on a blog aggregator. The blogs that fall under this category
are labelled with the category "pol/ant" (Poltics/Antagonism). Because
from a quick analysis it seems that data coming from the "forum"
category are mainly biased toward right political stances (data about
this statement will follow in the next weeks), it could be useful to
integrate these data in a general language-modelling task in the optic
of the "Perspectivist Data Manifesto" \[1\]. The other two categories
are "let/litblog", containing blogs about literature (the list was
obtained from another aggregator) and "inf/linux", a very small category
containing blog posts from Italian Linux User Groups. The rest of the
data, which account for the majority of tokens, is not categorized.

This resource can be considered as a "medium-high" quality dataset,
because it mostly contain blogs post, often from good sources with very
informative content. It is not possible to guarantee a total absence of
undesired content inside the resource, but this, depending from the use
case, probably constitutes a minority.

As for the Conversational data split, also this split is diachronically
annotated so it could be used for diachronic analysis of language and topics too.

Finally, the blog split contains also an annotation for the language
used, as identified by the FastText library.

*Columns of the dataset*
* title: The title of the article/post
* name: The name of the blog
* author: The author of the article/post, if available
* date: The date of the article/post in ISO-8601, if available if not None
* url: The original URL
* text: The text of the article/post
* category: The category of the blog. Only a few blogs are annotated for category up to now.
* license_guess: A guess of the original license of the blog made by an automated and non-perfect script
* fasttext_langid: The most probable language as identified by fasttext
* fasttext_langprob: The probability of the most probable language as identified by fasttext

**Wikimedia**

This split doesn't need many explanation as it is simply a dump of
wikimedia resources in Italian (Wikipedia, Wikibooks, Wikinews,
Wikiquote, Wikisource, Wikiversity, Wikivoyage and Wiktionary) as of May 2024. It can
be very important to include this resource in the training data of a
language model because it contains information, presented in a mostly
neutral language, about many possible subjects and topics that are not
covered by the rest of the dataset.

I decided to create also a category called "wikimedia\_others"
containing data from Wikimedia projects of other regional languages
related with Italian and spoken in Italy, as well as Latin for its
historical importance for Italian language and culture. Languages code
included in this split are: eml (emilian e rumagno) ,fur (furlan) ,la
(latin) ,lij (ligure) ,lld (ladin) ,lmo (lombarda) ,nap (napolitan) ,scn
(sicilianu) ,sc (sardu) and vec (veneto). Using this data, depending
from the goal of the project, could produce very interesting results.

*Columns of the dataset*
* title
* text 
* wiki

**Books**

This collection contains mainly the books coming from LiberLiber's
project "Manuzio" \[2\]. The books were downloaded from the website in
many formats and converted to text. Liber Liber is a project akin to
Project Gutenberg as it contains many books with expired copyright and
thus in Public Domain. Many of these books are considered cornerstones
of Italian culture.

The collection contains also a smaller amount of data coming from other
sources, such as the Creative Commons licensed school books of
"Matematicamente" \[3\] and Oilproject-Weschool \[4\] as well as some
other CC and PD licenses book found online.

*Columns of the dataset*
* title
* author 
* url
* text


**Websites**

I created a very generic script that is able to extract all the text of
a website as well as the text contained in Office, PDF and TeX
documents. Now, the websites section is mainly composed of three very
high-quality and freely licensed websites: ArchivioAntimafia \[5\], that
contains many official documents about Mafia persecution in Italy,
Peacelink \[6\], an historical Italian website about peace activism and
HomoLaicus \[7\] a big collection of texts about various topics (mainly
history and politics) released under a CC license. Also other smaller
and randomly selected (but filtered for quality) websites are included in this collection. This
section has to be considered experimental for two reasons: (1) It
containly only a very small subset of the entire high-quality Italian
web landscape and it could be increased and improved "ad libitum" (2) It
is the only section that can have some bigger issue with deduplication,
that we will discuss in the appropriate section.

Despite these two point, users are encouraged to use this section as it
is composed of medium-high and high quality contents.

*Columns of the dataset*
* url
* text

**Reddit**

It contains a small subsets (4192672 messages) of conversations in some
Italian subreddits.

**Italatex**
Still work in progress. A collection of materials written in LaTeX.

## Dataset Creation

### Curation Rationale
Multilinguality is one of the main challenges for the new AI and NLP revolution that is taking place in the 2020s. Until now, the most advanced models are mostly trained on English or a few other languages, creating a dangerous gap for people speaking other languages (that is, 81.2% of the world population, according to the CIA Factbook of 2022) in accessing these new advanced instruments. Translations from English are not enough to capture the cultural differences of peoples that do not belong to the Anglo-American culture. Thus, it is important for a general model to be truly inclusive by including data that can capture different views of the world and uses of language. These data are not only useful for modeling the Italian language itself but also for gaining insights into Italian culture and the way in which Italian-speaking people engage with various topics.
### Source Data
* Usenet
* Message boards
* Blogs
* Websites
* Open Journal System platforms hosted by Italian universities or included in DOAJ
* LiberLiber
* Wikimedia

#### Data Collection and Processing

The dataset is the result of a massive web scraping effort that was carried out using manually created Python3 scripts using libraries such as BeautifulSoup for HTML parsing and Selenium in the few cases in which Javascript support or browser automatization was required. I have created blueprints of the script, such a generic "forum scraper" or "blog scraper" script but then I had to adapt them almost manually for each resource included in the dataset. Some resources were sharing the same technical platform, so it was trivial to adapt the script, in other case a significant reverse-engineering effort was required. 
The scraping took place on very simple resources: a very old unused 2006 Sony Vaio laptop with an Intel Core2Duo processor connected to a domestic FTTC connection was enough for the majority of websites, while in other cases other resources were rented or borrowed in order to have a speed-up or to aggregate and analyse the entire collection of data. Using such a simple setup was also a way to have a "natural" anti-overload system. Because many web scraping instances were running in parallel, websites were not loaded so much and often timeouts were implemented in order to protect smaller servers. It never happened that a website was slowed down due to this scraping process, that was crafted to be as gentle and slow as possible.
Considering an average power consumption of the laptop of 40W and 100 days of running, circa 96Kwh were used to power the laptop. The laptop was plugged in the Italian-Centre electricity zone, with an average electricity/co2 ratio of 250g per KW with more than 60% of power coming from renewable sources. This means that the laptop Co2 emissions were circa 24KG of Co2, equivalent to a short 150km trip on a small car with emissions of 160g/km. 
All the data were collected in a JSONL format and then merged, cleaned, analyzed and converted to an Hugging Face dataset using an HPC resource that was gently provided to the author.
The vast majority of data coming from forums undergone a process of deduplication in order to avoid the case of having two instances of the same message.


#### Who are the source data producers?

Data is produced by users of the Italian Internet mostly between 1995 and 2024. This resource also contains texts produced before 1995, such as the content of public domain books written by authors from any historical period.

## Recommendations

This dataset could be used along with other Italian natural language resources. A very good list of them is available at the address [https://huggingface.co/collections/gsarti/italian-nlp-resources-64fc606927fb3a92e9ea72f2]. For example, gsarti/clean_mc4_it [https://huggingface.co/datasets/gsarti/clean_mc4_it], being the biggest as-to-date cleaned version of Common Crawl for Italian, could be used to increase the variety of the data for the training of a Large Language Model. 

### Deduplication

The presence of duplicate text can be, depending from the use cases, a
big problem for several machine learning tasks. I tried to avoid as much
as possible the presence of duplicate text in the dataset but still
there are some potential issues to be took into consideration. We will
distinguish two kind of duplications: (A): Full document duplication,
for example, if the same forum post is present more than one time (B):
Strings duplication: if some strings (often garbage) recurr several
times in the data.

Usenet: Safe regarding A-types of duplications; Could contain B-types
duplications, for example: - Users signatures; - Headers such as "reply
to message posted by X at Y";

Forums: Safe regarding A-types of duplications. The most problematic
forums under this respect were deduplicated using an ad-hoc created
script. It shares the same potential problems of Usenet with regard to
B-type duplications;

OJS: it should be safe regarding both A-type and B-type duplications;

Blogs: Safe regarding A-types of duplications and mostly safe regarding
B-type duplications. However, I noticed that some blogs were scraped
along with some html garbage at the beginning or end of the text blob,
that should be identified and removed

Wikimedia: it should be mostly safe, with the exception of the
recurrence of some Wikipedia-specific lexicon such as "this page is a
stub", "this page needs references" and so on;

Books: it should be safe regarding A-types of duplication, but there is
a very simple to identify B-type duplication, that is, the header of
Liber Liber books with a short presentation of the community-driven
project;

Websites: In this case A-type duplication could be in theory present if
some pages share the same content, but it should be rare (with the
exception of Archivio Antimafia, where files to download are often
available in PDF and Word Processing format, so they were downloaded
twice). B-type duplication here could be an issue as it is very present
in the form of 1) header of the website 2) list of links 3) footer of
the website. All the HTML was converted using HTML2TEXT so it should not
contain html code.

## Citation

### Citation Information

```
@software{testimole,
  author = {Rinaldi},
  title = {TestiMole},
  month = May,
  year = 2024,
  url = {https://huggingface.co/datasets/mrinaldi/TestiMole}
}

```
## Future work
The dataset could be enhanced in several ways:
* Increasing the amount of data (scraping): this could be done both by recycling the same scripts for other forums, blogs and websites or by writing new scraping scripts. It is important to understand that, even if the dataset is big, it only capture a small amount of the entire Italian webosphere;
* Increasing the amount of data (not by scraping): we have projects in mind to increase the dataset with high quality contents coming from different sources, expecially from Italian Universities;
* Cleaning the data: deduplication, as explained in the appropriate section, is probably the top-priority work that should be done on this dataset;
* Much more :) You are warmly invited to collaborate with me in this effort.

## Statistics
More statistics will be added in the near future. In the "asset" directory, JSONL files contain precomputed token counts for each subcategory (e.g., single forum, newsgroup, or blog), allowing anyone interested to easily craft more detailed statistics.

# Conversational aggregated tokens per year:

![image/png](https://cdn-uploads.huggingface.co/production/uploads/65c27751d2fbc4e846637421/VTyRGgjgyOFZkCp6xkowA.png)

# Forum tokens per year: 

![image/png](https://cdn-uploads.huggingface.co/production/uploads/65c27751d2fbc4e846637421/ThgfDRWxfu2JqkPbu6VOi.png)

# Usenet tokens per year:

![image/png](https://cdn-uploads.huggingface.co/production/uploads/65c27751d2fbc4e846637421/PzBZb5lhDMX05QQ8US7mn.png)

# Usenet hierarchies breakdown:

![image/png](https://cdn-uploads.huggingface.co/production/uploads/65c27751d2fbc4e846637421/_uSTThPiuY_upujSyIZNG.png)

# Usenet and Forum in diachronic perspective: 

![image/png](https://cdn-uploads.huggingface.co/production/uploads/65c27751d2fbc4e846637421/D5PGNdX9t1aWsBhhaJgnO.png)

# Blogs tokens per year: 

![image/png](https://cdn-uploads.huggingface.co/production/uploads/65c27751d2fbc4e846637421/T_7-Le3o-hQFK0QSfegMG.png)

## Contributions
Special thanks to [Viviana Patti](https://www.unito.it/persone/vpatti) and [Valerio Basile](https://valeriobasile.github.io/), professors at the Computer Science Department, NLP group, at the University of Turin, Italy who are significantly supporting me and my projects. Grazie mille :)
Thanks also to [ruggsea](https://huggingface.co/ruggsea), who helped in the first stage of the creation of the Usenet dataset by converting the first JSONL files to parquet and giving some resources to download part of the dataset. Thanks to the entire [mii-community](https://huggingface.co/mii-community) who supported and expressed interest in the project. Thanks to Luisa for plugging the old laptop, giving me SSH access and reboot it in cases such as power surges or crashes.

## References (partial)
 
\* \[1\] <https://pdai.info/>

\* \[2\] https://github.com/openai/tiktoken

\* \[3\] <https://xmau.com/usenet/>