victormiller commited on
Commit
3c94849
1 Parent(s): e06d4ad

Update curated.py

Browse files
Files changed (1) hide show
  1. curated.py +74 -100
curated.py CHANGED
@@ -529,7 +529,6 @@ filtering_process = Div(
529
  H3("Wikipedia"),
530
  P("Wikipedia is an encyclopedia form of high-quality text data used for language modeling. We have included filtered and deduplicated versions of complete Wikipedia data directly provided by the Wikipedia Foundation for more than 350 languages."),
531
  P(B("Download and Extraction: "), "The Wikimedia dataset was downloaded from the official snapshot on Huggingface: ", A("https://huggingface.co/datasets/wikimedia/wikipedia/tree/main", href="https://huggingface.co/datasets/wikimedia/wikipedia/tree/main"), ". The", D_code("huggingface dataset.to_json", language="python"), " function was used to convert the original parqet format to the jsonl format."),
532
-
533
  P(B("Filtering: "), "Manual inspection of the dataset demostrated high quality content. Only one filter was used to remove articles with few words. Based normal sentence constructs, the article was kept if it contained 10 or more words. Any article with fewer than 10 words was removed."),
534
  table_div_wikipedia,
535
  Details(
@@ -551,15 +550,13 @@ filtering_process = Div(
551
  Div(
552
  H3("ArXiv"),
553
  P("The ArXiv dataset is a vast collection of preprint research papers primarily in Mathematics, Computer Science, and Physics. Established in 1991, it offers high-quality text and mathematical knowledge, making it an invaluable resource for academic and scientific research. ArXiv papers are typically written in LaTeX, a popular typesetting system for these fields. We have extracted the information from latex and converted it into a text format."),
554
-
555
  P(B("Download and Extraction: "),"All the data was downloaded in original latex format from Arxiv official S3 dump ", A("s3://arxic/src", href="s3://arxic/src"), ". We try to encode the downloaded data into utf-8 or guess encoding using chardet library. After that pandoc was used to extract information from the latex files and saved as markdown format", D_code("pandoc -s {tex} -o out/{out_name}.md --wrap=none", language="python"), ". All markdowns were combined to create jsonl files."),
556
- H4("Filtering"),
557
- P("Multiple filters are used here after manually verifying output of all the filters as suggested by peS2o dataset (citation needed)"),
558
- Ol(
559
- Li("Language Filter: any language other than English are discarded"),
560
- Li("Minimum Word Count Filter: less than 500 words (not inclusive) are discarded"),
561
- Li("Unigram Log Probablity Filter Theshold: -20"),
562
- Li("Note: the Frequency Filter was calculated but not applied. The most frequent word in the paper consists of alpha characters only, and it appears in less than 7.5% of the document. Words are obtained by splitting the text on whitespace."),
563
  ),
564
  table_div_arx,
565
  Details(
@@ -581,18 +578,15 @@ filtering_process = Div(
581
  Div(
582
  H3("S2ORC"),
583
  P("The Semantic Scholar Open Research Corpus (S2ORC) is a comprehensive dataset designed for natural language processing (NLP) and text-mining research over scientific papers. It includes rich metadata, and abstract and full-text content for millions of academic papers across various disciplines. This dataset is further divided into two components, S2ORC abstract and S2ORC full text."),
584
- H4("Download and Extraction"),
585
- Ol(
586
- Li("This was downloaded directly in zip format using S2ORC api key and a get() request: ", D_code("response = urllib.request.urlopen(url)", language = "python")),
587
- ),
588
- H4("Filtering"),
589
- P("1. Multiple filters are used here after manually verifying output of all the filters as suggested by peS2o dataset"),
590
- Ol(
591
- Li("Title and Abstract Filter: must have title and abstract"),
592
- Li("Language Filter: The paper must be in English. To determine the language of each document, we use the pycld3 library. We run pycld3 on the first 2000 characters of each paragraph in the paper. The language of the paper is the most common language of the paragraphs."),
593
- Li("Word Count Filter: less than 500 words (not inclusive) are discarded"),
594
- Li("Paragraph Count Filter: The paper must have at least 5 paragraphs after removing paragraphs with less than -20 average log world probability"),
595
- Li("Frequency Filter: The most frequent word in the paper consists of alpha characters only, and it appears in less than 7.5% of the document. Words are obtained by splitting the text on whitespace."),
596
  ),
597
  table_div_s2o,
598
  Details(
@@ -614,18 +608,15 @@ filtering_process = Div(
614
  Div(
615
  H3("S2ORC Abstract"),
616
  P("The Semantic Scholar Open Research Corpus (S2ORC) is a comprehensive dataset designed for natural language processing (NLP) and text-mining research over scientific papers. It includes rich metadata, and abstract and full-text content for millions of academic papers across various disciplines. This dataset is further divided into two components, S2ORC abstract and S2ORC full text."),
617
- H4("Download and Extraction"),
618
- Ol(
619
- Li("This was downloaded directly in zip format using S2ORC API key and a get() request: ", D_code("response = urllib.request.urlopen(url)", language = "python")),
620
- ),
621
- H4("Filtering"),
622
- P("Multiple filters are used here after manually verifying output of all the filters as suggested by peS2o dataset. The frequency filter was not used as suggested by peS2o because it was removing good samples as inspected manually"),
623
- Ol(
624
- Li("Title and Abstract Filter: must have title and abstract"),
625
- Li("Majority Language Filter: abstract must be in English"),
626
- Li("Minimum Word Count Filter: less than 20 (not inclusive) are discarded"),
627
- Li("Unigram Log Probability Threshold: -20"),
628
- Li("Note: Frequency Filter: The most frequent word in the paper consists of alpha characters only, and it appears in less than 7.5% of the document. Words are obtained by splitting the text on whitespace."),
629
  ),
630
  Details(
631
  Summary("S2ORC Abstract Filtering Examples "),
@@ -647,14 +638,13 @@ filtering_process = Div(
647
  Section(
648
  Div(
649
  H3("PubMed Central and PubMed Abstract"),
650
- P(B("Download and Extraction: "), "All files were downloaded from", A("ttps://ftp.ncbi.nlm.nih.gov/pub/pmc/oa_package/",href="ttps://ftp.ncbi.nlm.nih.gov/pub/pmc/oa_package/"),". PubMed Central (PMC) files are downloaded in an xml.tar format. The tar files are opened and converted to markdown format using pandoc", D_code("pandoc -f jats {nxml} -o {pmcid}.md", language="bash"),". The markdown files are combined to create jsonl files. PubMed Abstract (PMA) files were downloaded in xml. The BeautifulSoup library was used to extract the abstract, title, and PMID. All files were stored in jsonl format."),
651
- H4("Filtering"),
652
- P("1. Multiple filters are used here after manually verifying output of all the filters as suggested by peS2o dataset."),
653
- Ol(
654
- Li("Minimum Word Count Filter: less than 100 words (not inclusive) are discarded, less than 20 words for pubmed abstract"),
655
- Li("Language Filter: any language other than English are discarded"),
656
- Li("Frequency Filter: The most frequent word in the paper consists of alpha characters only, and it appears in less than 7.5% of the document. Words are obtained by splitting the text on whitespace. This filter is not used for pubmed abstract"),
657
- Li("Unigram Log Probability Threshold: -20"),
658
  ),
659
  table_div_med,
660
  Details(
@@ -677,19 +667,19 @@ filtering_process = Div(
677
  H3("Phil Papers"),
678
  P("Papers from the PhilPapers database, a comprehensive index and bibliography of philosophy research maintained by the Center for Digital Philosophy at the University of Western Ontario."),
679
  P(B("Download and Extraction: "), "Original PDF files download from", A("https://philarchive.org/oai.pl", href="https://philarchive.org/oai.pl"), ". All available PDF's were downloaded. Each PDF was converted to text using java", D_code("-jar ../philpapers_resources/src/pdfbox-app-2.0.21.jar ExtractText {f0} {FOUT.name}", language="java"), ". After converting to text formatting, a language was detected and added using the langdetect (citation needed) library."),
680
- H4("Filtering"),
681
  Ul(
682
- Li(P(B("Hyphenation Removal:"), D_code("end-of", language="python"), " becomes ", D_code("end of", language="python")), style = "margin-bottom: 2px"),
683
- Li(P(B("Newline Filtering:"), D_code("This is/na sentence.", language="python"), " becomes ", D_code("This is a sentence.", language="python")), style = "margin-bottom: 2px"),
684
- Li(P(B("Header/Footer Filtering:"), D_code("(c) 2023 Company Name.", language="python"), " is removed ",), style = "margin-bottom: 2px"),
685
- Li(P(B("Double Whitespace Filtering:"), D_code("This is a test.", language="python"), " becomes ", D_code("This is a test.", language="python")), style = "margin-bottom: 2px"),
686
- Li(P(B("Mean Line Length Check: "), "removes paragraphs with an average line length of < 2.0"), style = "margin-bottom: 2px"),
687
- Li(P(B("CID Percentage Filter: "), "removes LaTex heavy paragraphs that contain over 10% “CID” font artifacts."), style = "margin-bottom: 2px"),
688
- Li(P(B("Letterness Filter: "), "discards paragraphs with a low proportion of letters"), style = "margin-bottom: 2px"),
689
- Li(P(B("Removing Leading/Trailing Numbers: "), "removes numbers at the start or end of paragraphs. ", D_code("1 This is a sentence.", language="python"), " becomes ", D_code("This is a sentence.", language="python")), style = "margin-bottom: 2px"),
690
- Li(P(B("Fixing Unicode Issues: "), "fixes Unicode issues."), style = "margin-bottom: 2px"),
691
- Li(P(B("Combining Diacritics Correction: "), D_code("a'", language="python"), " becomes ", D_code("å", language="python")), style = "margin-bottom: 2px"),
692
- Li(P(B("Unigram Log Probability: "), "the document must have higher than -20 average unigram log probability."), style = "margin-bottom: 2px"),
693
  ),
694
  table_div_phil,
695
  Details(
@@ -712,8 +702,7 @@ filtering_process = Div(
712
  H3("Europarl"),
713
  P("A collection of multilingual parallel corpora of parliamentary debates from the European Parliament. This is a high-quality legacy dataset earlier used for translation tasks."),
714
  P(B("Download and Extraction: "), "Original dataset was downloaded from", A("http://www.statmt.org/europarl/v7/europarl.tgz", href="http://www.statmt.org/europarl/v7/europarl.tgz"),". The files were converted to jsonl lines for filtering."),
715
- H4("Filtering"),
716
- P("EuroParl was initially filtered during the download process. Documents with fewer than 200 characters were removed. The documents also contained HTML tags which were removed."),
717
  D_code("""
718
  Raw single line in data: <P> Hi I am speaker
719
  After tag removal: P Hi I am speaker
@@ -724,27 +713,20 @@ filtering_process = Div(
724
  D_code("""
725
  def process_tag(original_tag):
726
  tag = original_tag.strip(">").strip("<")
727
-
728
  # Skip empty tags
729
  if not tag:
730
  return None
731
-
732
  tagname = tag.split()[0]
733
-
734
  # Skip paragraph, break, and chapter tags
735
  if tagname in ["P", "BRK", "CHAPTER", "/P"]:
736
  return None
737
-
738
  # For speaker tags, return the name
739
  if tagname == "SPEAKER":
740
  soup = bs4.BeautifulSoup(original_tag, "html.parser")
741
  name = soup.speaker["name"]
742
  return name
743
-
744
  # Raise a error here if there is a tag we don't know
745
  raise ValueError(f"Unknown tag {tag}")
746
-
747
-
748
  """, style="block", language = "python"),
749
  table_div_up,
750
  Details(
@@ -768,11 +750,11 @@ filtering_process = Div(
768
  P("High-quality dialog-based dataset where user comments on the links as the head post aggregated by Y Combinator."),
769
  P(B("Download and Extraction: "), "The dataset was downloaded from the HackerNews repo here:", A("https://hacker-news.firebaseio.com/v0/item/", href="https://hacker-news.firebaseio.com/v0/item/"), ". The dataset was parsed using the Story ID. In this dataset each post is a story, and each reply is considered subsequent story. Story IDs were considered between ID 1 to 37500000. The URL for all Story IDs was pinged. If that ID returned an error, the ID was removed. Each request was given a 2 second wait to account for network time."),
770
  P("The HackerNews dataset contains a vast amount of stories and is known for lively discussions. Due to the number of replies a story may contain, only longest comment thread for each story was sampled past level 3. All stories included the title (1st level) and all direct replies (2nd level). Replies to the replies (3rd level) are only included for X STORIES."),
771
- H4("Filtering"),
772
  Ul(
773
- Li("Language Filter: English", style = "margin-bottom: 2px"),
774
- Li("Minimum Word Count Filter: 10", style = "margin-bottom: 2px"),
775
- Li("Unigram Log Probability Threshold: -20", style = "margin-bottom: 2px"),
776
  ),
777
  table_div_hn,
778
  ),
@@ -782,11 +764,11 @@ filtering_process = Div(
782
  H3("USPTO"),
783
  P("Patent documents from the United States Patent and Trademark Office."),
784
  P(B("Download and Extraction: "), "Data was downloaded and extracted using tags from", A("https://bulkdata.uspto.gov/data/patent/grant/redbook/fulltext/", href="https://bulkdata.uspto.gov/data/patent/grant/redbook/fulltext/"),". There were three different formats that needed three different functions to download and extract the data based on year:", I("Pre_2002"), ", ", I("2002_to_2004"), " and", I("post_2004"),". We used the exact code used in The Pile (citation needed)."),
785
- H4("Filtering"),
786
- Ol(
787
- Li("Language Filter: English", style = "margin-bottom: 2px"),
788
- Li("Minimum Word Count Filter: 50", style = "margin-bottom: 2px"),
789
- Li("Unigram Log Probability", style = "margin-bottom: 2px"),
790
  ),
791
  table_div_uspto,
792
  ),
@@ -795,8 +777,7 @@ filtering_process = Div(
795
  Div(
796
  H3("FreeLaw"),
797
  P("Legal documents and court cases from various jurisdictions provided by US-registered non-profit firm Free Law Project. We have included data from CourtListener which included millions of legal opinions from federal and state courts."),
798
- H4("Download and Extraction"),
799
- P("The dataset was downloaded from:", A("https://storage.courtlistener.com/bulk-data/", href="https://storage.courtlistener.com/bulk-data/"), ". There are 19 CSV files which contain overlapping content. CSV files can contain content in multiple columns requiring a holistic extraction approach. Text was extracted from the following using html2text function. The block below shows how each text type was extracted."),
800
  D_code("""
801
  ("html", html2text),
802
  ("html_lawbox", html2text),
@@ -807,16 +788,13 @@ filtering_process = Div(
807
  plain_text
808
  """, language ="SQL"),
809
  P("All content was downloaded leading to high number of documents filtered during local deduplication. Following The Pile, priorty was given to plain_text first, followed by the columns in the table in reverse order."),
810
- H4("Filtering"),
811
- Ol(
812
- Li("Language Filter: English", style = "margin-bottom: 2px"),
813
- Li("Minimum Word Count Filter: 50", style = "margin-bottom: 2px"),
814
- Li("Unigram Log Probability", style = "margin-bottom: 2px"),
815
- ),
816
- H4("Local Deduplication Process"),
817
- Ol(
818
- Li("Local dedup was done within freelaw itself which removed 90%+ duplicates"),
819
  ),
 
820
  table_div_freelaw,
821
  Details(
822
  Summary("FreeLaw Filtering Examples"),
@@ -850,9 +828,9 @@ filtering_process = Div(
850
  8. Comment1:
851
  9. Comment2:
852
  """),
853
- H4("Filtering"),
854
- Ol(
855
- Li("Minimum Word Count Filter: 10", style = "margin-bottom: 2px"),
856
  ),
857
  table_div_se,
858
  Details(
@@ -888,11 +866,11 @@ filtering_process = Div(
888
  def clean(x):
889
  return '\n'.join('* ' + line[4:] if line.startswith('===') else line[8:] for line in x.split('\n'))
890
  """, block="block", language="python" ),
891
- H4("Filtering"),
892
- Ol(
893
- Li("Language Filter: English", style = "margin-bottom: 2px"),
894
- Li("Minimum Word Count Filter: 10", style = "margin-bottom: 2px"),
895
- Li("Unigram Log Probability", style = "margin-bottom: 2px"),
896
  ),
897
  table_div_uirc,
898
  ),
@@ -905,13 +883,9 @@ filtering_process = Div(
905
  D_code("""
906
  Question: TEXT
907
  Answer: TEXT""", block="block", language="python"),
908
- H4("Filtering"),
909
- Ol(
910
- Li("No filtering was applied to DM Math"),
911
- ),
912
- H4("Local Deduplication Process"),
913
- Ol(
914
- Li("None"),
915
  ),
916
  table_div_dmm,
917
  Details(
@@ -933,9 +907,9 @@ filtering_process = Div(
933
  Div(
934
  H3("PG-19"),
935
  P("A collection of books from Project Gutenberg, a digital library of public domain works. This contains all the books that were published before 1919."),
936
- P(B("Download and Extraction: "), "The dataset was downloaded directly from Huggingface:", A("https://huggingface.co/datasets/deepmind/pg19", href="https://huggingface.co/datasets/deepmind/pg19"), "."),
937
- H4("Filtering"),
938
- Ol(
939
  Li("Language Filter: English", style = "margin-bottom: -3px"),
940
  Li("Minimum Word Count Filter: 20", style = "margin-bottom: -3px"),
941
  Li("Unigram Log Probability: ", "-20", style = "margin-bottom: -3px"),
 
529
  H3("Wikipedia"),
530
  P("Wikipedia is an encyclopedia form of high-quality text data used for language modeling. We have included filtered and deduplicated versions of complete Wikipedia data directly provided by the Wikipedia Foundation for more than 350 languages."),
531
  P(B("Download and Extraction: "), "The Wikimedia dataset was downloaded from the official snapshot on Huggingface: ", A("https://huggingface.co/datasets/wikimedia/wikipedia/tree/main", href="https://huggingface.co/datasets/wikimedia/wikipedia/tree/main"), ". The", D_code("huggingface dataset.to_json", language="python"), " function was used to convert the original parqet format to the jsonl format."),
 
532
  P(B("Filtering: "), "Manual inspection of the dataset demostrated high quality content. Only one filter was used to remove articles with few words. Based normal sentence constructs, the article was kept if it contained 10 or more words. Any article with fewer than 10 words was removed."),
533
  table_div_wikipedia,
534
  Details(
 
550
  Div(
551
  H3("ArXiv"),
552
  P("The ArXiv dataset is a vast collection of preprint research papers primarily in Mathematics, Computer Science, and Physics. Established in 1991, it offers high-quality text and mathematical knowledge, making it an invaluable resource for academic and scientific research. ArXiv papers are typically written in LaTeX, a popular typesetting system for these fields. We have extracted the information from latex and converted it into a text format."),
 
553
  P(B("Download and Extraction: "),"All the data was downloaded in original latex format from Arxiv official S3 dump ", A("s3://arxic/src", href="s3://arxic/src"), ". We try to encode the downloaded data into utf-8 or guess encoding using chardet library. After that pandoc was used to extract information from the latex files and saved as markdown format", D_code("pandoc -s {tex} -o out/{out_name}.md --wrap=none", language="python"), ". All markdowns were combined to create jsonl files."),
554
+ P(B(" Filters Applied: "), "multiple filters are used here after manually verifying output of all the filters as suggested by peS2o dataset (citation needed)"),
555
+ Ul(
556
+ Li("Language Filter: any language other than English are discarded", style = "margin-bottom: -3px"),
557
+ Li("Minimum Word Count Filter: less than 500 words (not inclusive) are discarded", style = "margin-bottom: -3px"),
558
+ Li("Unigram Log Probablity Filter Theshold: -20", style = "margin-bottom: -3px"),
559
+ Li("Note: the Frequency Filter was calculated but not applied. The most frequent word in the paper consists of alpha characters only, and it appears in less than 7.5% of the document. Words are obtained by splitting the text on whitespace.", style = "margin-bottom: -3px"),
 
560
  ),
561
  table_div_arx,
562
  Details(
 
578
  Div(
579
  H3("S2ORC"),
580
  P("The Semantic Scholar Open Research Corpus (S2ORC) is a comprehensive dataset designed for natural language processing (NLP) and text-mining research over scientific papers. It includes rich metadata, and abstract and full-text content for millions of academic papers across various disciplines. This dataset is further divided into two components, S2ORC abstract and S2ORC full text."),
581
+ H4(""),
582
+ P(B("Download and Extraction: "),"S2ORC was downloaded directly in zip format using S2ORC api key and a get() request: ", D_code("response = urllib.request.urlopen(url)", language = "python")),
583
+ P(B("Filters Applied: "), "Multiple filters are used here after manually verifying output of all the filters as suggested by peS2o dataset"),
584
+ Ul(
585
+ Li("Title and Abstract Filter: must have title and abstract", style = "margin-bottom: -3px"),
586
+ Li("Language Filter: The paper must be in English. To determine the language of each document, we use the pycld3 library. We run pycld3 on the first 2000 characters of each paragraph in the paper. The language of the paper is the most common language of the paragraphs.", style = "margin-bottom: -3px"),
587
+ Li("Word Count Filter: less than 500 words (not inclusive) are discarded", style = "margin-bottom: -3px"),
588
+ Li("Paragraph Count Filter: The paper must have at least 5 paragraphs after removing paragraphs with less than -20 average log world probability", style = "margin-bottom: -3px"),
589
+ Li("Frequency Filter: The most frequent word in the paper consists of alpha characters only, and it appears in less than 7.5% of the document. Words are obtained by splitting the text on whitespace.", style = "margin-bottom: -3px"),
 
 
 
590
  ),
591
  table_div_s2o,
592
  Details(
 
608
  Div(
609
  H3("S2ORC Abstract"),
610
  P("The Semantic Scholar Open Research Corpus (S2ORC) is a comprehensive dataset designed for natural language processing (NLP) and text-mining research over scientific papers. It includes rich metadata, and abstract and full-text content for millions of academic papers across various disciplines. This dataset is further divided into two components, S2ORC abstract and S2ORC full text."),
611
+ P(B("Download and Extraction: "),"S2ORC was downloaded directly in zip format using S2ORC api key and a get() request: ", D_code("response = urllib.request.urlopen(url)", language = "python")),
612
+
613
+ P(B("Filters Applied: "), "multiple filters are used here after manually verifying output of all the filters as suggested by peS2o dataset. The frequency filter was not used as suggested by peS2o because it was removing good samples as inspected manually"),
614
+ Ul(
615
+ Li("Title and Abstract Filter: must have title and abstract", style = "margin-bottom: -3px"),
616
+ Li("Majority Language Filter: abstract must be in English", style = "margin-bottom: -3px"),
617
+ Li("Minimum Word Count Filter: less than 20 (not inclusive) are discarded", style = "margin-bottom: -3px"),
618
+ Li("Unigram Log Probability Threshold: -20", style = "margin-bottom: -3px"),
619
+ Li("Note: Frequency Filter: The most frequent word in the paper consists of alpha characters only, and it appears in less than 7.5% of the document. Words are obtained by splitting the text on whitespace.", style = "margin-bottom: -3px"),
 
 
 
620
  ),
621
  Details(
622
  Summary("S2ORC Abstract Filtering Examples "),
 
638
  Section(
639
  Div(
640
  H3("PubMed Central and PubMed Abstract"),
641
+ P(B("Download and Extraction: "), "All files were downloaded from", A("ttps://ftp.ncbi.nlm.nih.gov/pub/pmc/oa_package/",href="ttps://ftp.ncbi.nlm.nih.gov/pub/pmc/oa_package/"),". PubMed Central (PMC) files are downloaded in an xml.tar format. The tar files are opened and converted to markdown format using pandoc", D_code("pandoc -f jats {nxml} -o {pmcid}.md", language="bash"),". The markdown files are combined to create jsonl files. PubMed Abstract (PMA) files were downloaded in xml. The BeautifulSoup library was used to extract the abstract, title, and PMID. All files were stored in jsonl format."),
642
+ P(B("Filters Applied: "), "Multiple filters are used here after manually verifying output of all the filters as suggested by peS2o dataset."),
643
+ Ul(
644
+ Li("Minimum Word Count Filter: PMC documents with less than 100 words (not inclusive) are discarded; PMA documents less than 20 words are discarded", style = "margin-bottom: -3px"),
645
+ Li("Language Filter: English only", style = "margin-bottom: -3px"),
646
+ Li("Frequency Filter: The most frequent word in the paper consists of alpha characters only, and it appears in less than 7.5% of the document. Words are obtained by splitting the text on whitespace. This filter was not used for PMA", style = "margin-bottom: -3px"),
647
+ Li("Unigram Log Probability Threshold: -20", style = "margin-bottom: -3px"),
 
648
  ),
649
  table_div_med,
650
  Details(
 
667
  H3("Phil Papers"),
668
  P("Papers from the PhilPapers database, a comprehensive index and bibliography of philosophy research maintained by the Center for Digital Philosophy at the University of Western Ontario."),
669
  P(B("Download and Extraction: "), "Original PDF files download from", A("https://philarchive.org/oai.pl", href="https://philarchive.org/oai.pl"), ". All available PDF's were downloaded. Each PDF was converted to text using java", D_code("-jar ../philpapers_resources/src/pdfbox-app-2.0.21.jar ExtractText {f0} {FOUT.name}", language="java"), ". After converting to text formatting, a language was detected and added using the langdetect (citation needed) library."),
670
+ P(B("Filters Applied: ")),
671
  Ul(
672
+ Li(P(B("Hyphenation Removal:"), D_code("end-of", language="python"), " becomes ", D_code("end of", language="python")), style = "margin-bottom: -3px"),
673
+ Li(P(B("Newline Filtering:"), D_code("This is/na sentence.", language="python"), " becomes ", D_code("This is a sentence.", language="python")), style = "margin-bottom: -3px"),
674
+ Li(P(B("Header/Footer Filtering:"), D_code("(c) 2023 Company Name.", language="python"), " is removed ",), style = "margin-bottom: -3px"),
675
+ Li(P(B("Double Whitespace Filtering:"), D_code("This is a test.", language="python"), " becomes ", D_code("This is a test.", language="python")), style = "margin-bottom: -3px"),
676
+ Li(P(B("Mean Line Length Check: "), "removes paragraphs with an average line length of < 2.0"), style = "margin-bottom: -3px"),
677
+ Li(P(B("CID Percentage Filter: "), "removes LaTex heavy paragraphs that contain over 10% “CID” font artifacts."), style = "margin-bottom: -3px"),
678
+ Li(P(B("Letterness Filter: "), "discards paragraphs with a low proportion of letters"), style = "margin-bottom: -3px"),
679
+ Li(P(B("Removing Leading/Trailing Numbers: "), "removes numbers at the start or end of paragraphs. ", D_code("1 This is a sentence.", language="python"), " becomes ", D_code("This is a sentence.", language="python")), style = "margin-bottom: -3px"),
680
+ Li(P(B("Fixing Unicode Issues: "), "fixes Unicode issues."), style = "margin-bottom: -3px"),
681
+ Li(P(B("Combining Diacritics Correction: "), D_code("a'", language="python"), " becomes ", D_code("å", language="python")), style = "margin-bottom: -3px"),
682
+ Li(P(B("Unigram Log Probability: "), "the document must have higher than -20 average unigram log probability."), style = "margin-bottom: -3px"),
683
  ),
684
  table_div_phil,
685
  Details(
 
702
  H3("Europarl"),
703
  P("A collection of multilingual parallel corpora of parliamentary debates from the European Parliament. This is a high-quality legacy dataset earlier used for translation tasks."),
704
  P(B("Download and Extraction: "), "Original dataset was downloaded from", A("http://www.statmt.org/europarl/v7/europarl.tgz", href="http://www.statmt.org/europarl/v7/europarl.tgz"),". The files were converted to jsonl lines for filtering."),
705
+ P(B("Filters Applied: ") ,"EuroParl was initially filtered during the download process. Documents with fewer than 200 characters were removed. The documents also contained HTML tags which were removed."),
 
706
  D_code("""
707
  Raw single line in data: <P> Hi I am speaker
708
  After tag removal: P Hi I am speaker
 
713
  D_code("""
714
  def process_tag(original_tag):
715
  tag = original_tag.strip(">").strip("<")
 
716
  # Skip empty tags
717
  if not tag:
718
  return None
 
719
  tagname = tag.split()[0]
 
720
  # Skip paragraph, break, and chapter tags
721
  if tagname in ["P", "BRK", "CHAPTER", "/P"]:
722
  return None
 
723
  # For speaker tags, return the name
724
  if tagname == "SPEAKER":
725
  soup = bs4.BeautifulSoup(original_tag, "html.parser")
726
  name = soup.speaker["name"]
727
  return name
 
728
  # Raise a error here if there is a tag we don't know
729
  raise ValueError(f"Unknown tag {tag}")
 
 
730
  """, style="block", language = "python"),
731
  table_div_up,
732
  Details(
 
750
  P("High-quality dialog-based dataset where user comments on the links as the head post aggregated by Y Combinator."),
751
  P(B("Download and Extraction: "), "The dataset was downloaded from the HackerNews repo here:", A("https://hacker-news.firebaseio.com/v0/item/", href="https://hacker-news.firebaseio.com/v0/item/"), ". The dataset was parsed using the Story ID. In this dataset each post is a story, and each reply is considered subsequent story. Story IDs were considered between ID 1 to 37500000. The URL for all Story IDs was pinged. If that ID returned an error, the ID was removed. Each request was given a 2 second wait to account for network time."),
752
  P("The HackerNews dataset contains a vast amount of stories and is known for lively discussions. Due to the number of replies a story may contain, only longest comment thread for each story was sampled past level 3. All stories included the title (1st level) and all direct replies (2nd level). Replies to the replies (3rd level) are only included for X STORIES."),
753
+ P(B("Filters Applied: ")),
754
  Ul(
755
+ Li("Language Filter: English", style = "margin-bottom: -3px"),
756
+ Li("Minimum Word Count Filter: 10", style = "margin-bottom: -3px"),
757
+ Li("Unigram Log Probability Threshold: -20", style = "margin-bottom: -3px"),
758
  ),
759
  table_div_hn,
760
  ),
 
764
  H3("USPTO"),
765
  P("Patent documents from the United States Patent and Trademark Office."),
766
  P(B("Download and Extraction: "), "Data was downloaded and extracted using tags from", A("https://bulkdata.uspto.gov/data/patent/grant/redbook/fulltext/", href="https://bulkdata.uspto.gov/data/patent/grant/redbook/fulltext/"),". There were three different formats that needed three different functions to download and extract the data based on year:", I("Pre_2002"), ", ", I("2002_to_2004"), " and", I("post_2004"),". We used the exact code used in The Pile (citation needed)."),
767
+ P(B("Filters Applied: ")),
768
+ Ul(
769
+ Li("Language Filter: English", style = "margin-bottom: -3px"),
770
+ Li("Minimum Word Count Filter: 50", style = "margin-bottom: -3px"),
771
+ Li("Unigram Log Probability", style = "margin-bottom: -3px"),
772
  ),
773
  table_div_uspto,
774
  ),
 
777
  Div(
778
  H3("FreeLaw"),
779
  P("Legal documents and court cases from various jurisdictions provided by US-registered non-profit firm Free Law Project. We have included data from CourtListener which included millions of legal opinions from federal and state courts."),
780
+ P(B("Download and Extraction"), "The dataset was downloaded from:", A("https://storage.courtlistener.com/bulk-data/", href="https://storage.courtlistener.com/bulk-data/"), ". There are 19 CSV files which contain overlapping content. CSV files can contain content in multiple columns requiring a holistic extraction approach. Text was extracted from the following using html2text function. The block below shows how each text type was extracted."),
 
781
  D_code("""
782
  ("html", html2text),
783
  ("html_lawbox", html2text),
 
788
  plain_text
789
  """, language ="SQL"),
790
  P("All content was downloaded leading to high number of documents filtered during local deduplication. Following The Pile, priorty was given to plain_text first, followed by the columns in the table in reverse order."),
791
+ P(B("Filters Applied: ")),
792
+ Ul(
793
+ Li("Language Filter: English", style = "margin-bottom: -3px"),
794
+ Li("Minimum Word Count Filter: 50", style = "margin-bottom: -3px"),
795
+ Li("Unigram Log Probability", style = "margin-bottom: -3px"),
 
 
 
 
796
  ),
797
+ P("Note: Local deduplication within FreeLaw itself removed 90%+ of the dataset as duplicate."),
798
  table_div_freelaw,
799
  Details(
800
  Summary("FreeLaw Filtering Examples"),
 
828
  8. Comment1:
829
  9. Comment2:
830
  """),
831
+ P(B("Filters Applied: ")),
832
+ Ul(
833
+ Li("Minimum Word Count Filter: 10", style = "margin-bottom: -3px"),
834
  ),
835
  table_div_se,
836
  Details(
 
866
  def clean(x):
867
  return '\n'.join('* ' + line[4:] if line.startswith('===') else line[8:] for line in x.split('\n'))
868
  """, block="block", language="python" ),
869
+ P(B("Filters Applied: ")),
870
+ Ul(
871
+ Li("Language Filter: English", style = "margin-bottom: -3px"),
872
+ Li("Minimum Word Count Filter: 10", style = "margin-bottom: -3px"),
873
+ Li("Unigram Log Probability", style = "margin-bottom: -3px"),
874
  ),
875
  table_div_uirc,
876
  ),
 
883
  D_code("""
884
  Question: TEXT
885
  Answer: TEXT""", block="block", language="python"),
886
+ P(B("Filters Applied: ")),
887
+ Ul(
888
+ Li("No filtering was applied to DM Math", style = "margin-bottom: -3px"),
 
 
 
 
889
  ),
890
  table_div_dmm,
891
  Details(
 
907
  Div(
908
  H3("PG-19"),
909
  P("A collection of books from Project Gutenberg, a digital library of public domain works. This contains all the books that were published before 1919."),
910
+ P(B("Download and Extraction: "), "The dataset was downloaded directly from Huggingface: ", A("https://huggingface.co/datasets/deepmind/pg19", href="https://huggingface.co/datasets/deepmind/pg19"), "."),
911
+ P(B("Filters Applied:"))
912
+ Ul(
913
  Li("Language Filter: English", style = "margin-bottom: -3px"),
914
  Li("Minimum Word Count Filter: 20", style = "margin-bottom: -3px"),
915
  Li("Unigram Log Probability: ", "-20", style = "margin-bottom: -3px"),