mshojaei77 commited on
Commit
118cf0e
·
verified ·
1 Parent(s): 0403169

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +74 -69
README.md CHANGED
@@ -25,92 +25,79 @@ task_categories:
25
 
26
  ### Dataset Summary
27
 
28
- The Persian Document Corpus is a comprehensive collection of Persian academic and scientific documents extracted from PDF sources. The corpus contains a diverse range of academic texts, research papers, and scientific documents in Persian, making it valuable for Persian language processing tasks, academic research, and machine learning applications.
29
 
30
- ### Languages
31
 
32
- - Persian (fa)
 
 
33
 
34
- ### Dataset Structure
35
 
36
- ```python
37
- DatasetDict({
38
- 'train': Dataset({
39
- features: ['text', 'file_name'],
40
- num_rows: xxx
41
- })
42
- })
43
- ```
44
 
45
- ### Data Fields
 
 
 
46
 
47
- - `text`: The full text content of the document
48
- - `file_name`: Original filename of the document (without extension)
49
 
50
- ### Data Splits
51
 
52
- The dataset is provided as a single training split.
53
 
54
  ### Source Data
55
 
56
- #### Initial Data Collection and Normalization
57
-
58
- - The documents were initially collected using the Exa API to search for Persian academic PDFs
59
- - PDFs were downloaded and converted to text format
60
- - The text underwent cleaning and normalization processes to ensure consistency
61
- - Special characters and formatting artifacts from PDF conversion were removed
62
- - Documents were stored with UTF-8 encoding
63
-
64
- ### Considerations for Using the Data
65
 
66
- #### Social Impact of Dataset
 
 
 
 
 
67
 
68
- This dataset aims to:
69
- - Improve accessibility to Persian academic content
70
- - Support development of Persian language processing tools
71
- - Enable research in Persian text mining and analysis
72
- - Facilitate creation of Persian language models
73
 
74
- #### Discussion of Biases
75
 
76
- The dataset may contain certain biases:
77
- - Academic language bias: Contains formal academic writing style
78
- - Topic bias: May have uneven distribution of academic subjects
79
- - Source bias: Limited to publicly accessible academic documents
80
 
81
- #### Other Known Limitations
 
 
 
82
 
83
- - Some texts may contain artifacts from PDF conversion
84
- - Document lengths may vary significantly
85
- - Some technical terms might be mixed with English or other languages
86
 
87
- ### Additional Information
 
 
 
 
88
 
89
- #### Dataset Curators
90
 
91
- This dataset was curated by [Mohammad Shojaei](https://huggingface.co/mshojaei77).
 
 
92
 
93
- #### Licensing Information
94
 
95
- This dataset is released under the [GNU General Public License v3.0 (GPL-3.0)](https://www.gnu.org/licenses/gpl-3.0.en.html).
96
 
97
- #### Citation Information
98
 
99
- If you use this dataset in your research, please cite:
100
 
101
- ```bibtex
102
- @misc{persian-document-corpus2024,
103
- title={Persian Document Corpus},
104
- author={Mohammad Shojaei},
105
- year={2024},
106
- publisher={Hugging Face},
107
- howpublished={\url{https://huggingface.co/datasets/mshojaei77/persian-document-corpus}}
108
- }
109
- ```
110
 
111
- ### Usage Examples
112
 
113
- Here's a simple example of how to load and use the dataset:
114
 
115
  ```python
116
  from datasets import load_dataset
@@ -121,19 +108,37 @@ dataset = load_dataset("mshojaei77/persian-document-corpus")
121
  # Access the first few examples
122
  for example in dataset['train'].select(range(3)):
123
  print(f"File: {example['file_name']}")
124
- print(f"Text preview: {example['text'][:200]}...")
125
  print("-" * 50)
 
 
 
 
 
 
 
 
 
126
  ```
127
 
128
- ### Dataset Creation
 
 
 
 
129
 
130
- The dataset creation process involved:
131
- 1. Searching for Persian academic PDFs using the Exa API
132
- 2. Downloading and converting PDFs to text format
133
- 3. Cleaning and normalizing the text content
134
- 4. Organizing the documents into a structured dataset
135
- 5. Publishing to the Hugging Face Hub
 
 
 
 
 
136
 
137
- ### Maintenance
138
 
139
- This dataset is actively maintained. For issues, questions, or contributions, please visit the [dataset repository](https://huggingface.co/datasets/mshojaei77/persian-document-corpus).
 
25
 
26
  ### Dataset Summary
27
 
28
+ The Persian Document Corpus (PDC) is a large collection of Persian documents, comprising **over 13,000 files**, gathered from publicly accessible PDFs across a wide array of knowledge domains. This corpus includes research articles, theses, dissertations, scientific reports, and book chapters, offering a rich and diverse resource for the Persian Natural Language Processing (NLP) community. It is designed to facilitate the training and evaluation of NLP models for a broad spectrum of tasks and applications in various fields.
29
 
30
+ The documents span a **diverse range of subjects**, reflecting the breadth of Persian scholarly and professional output. The corpus is expected to include documents from the following fields:
31
 
32
+ * **Science and Technology:** This category encompasses Mathematics, Physics (including Quantum Physics), Chemistry, Computer Science, Engineering, Information Technology (including Blockchain, Cryptocurrencies, Metaverse, NFTs, Smart Contracts), Automotive Engineering, and other technical domains.
33
+ * **Social Sciences and Humanities:** This area includes Sociology, Political Science, Economics, Law (particularly Women's Rights), Philosophy, History (especially Iranian History), Education, Linguistics (including Persian and English Language Learning), Library Science, Media Studies (including Podcasts and Film), Literature, and potentially Psychology and Gender Studies (Feminism, Women's Studies).
34
+ * **Applied Sciences and Practical Domains:** This section covers Medicine and Health (including topics like Pregnancy, Menstruation, Dermatology - Acne, Ophthalmology - Eye Diseases, Cosmetics - Perfume, Nail Care, Masks), Agriculture (including Poultry - Chicken, Floriculture - Flowers), Business and Finance (Stock Market, Real Estate, E-commerce - Online Classifieds), Culinary Arts (Recipes), Home Improvement, and potentially Career Development (Employment, Migration), as well as general interest topics like Games, Music, and Lifestyle.
35
 
36
+ This dataset is particularly valuable for tasks that require the analysis of formal Persian language, specialized terminology, and structured writing styles across these diverse domains.
37
 
38
+ ### Supported Tasks
 
 
 
 
 
 
 
39
 
40
+ * **Language Modeling:** Train Persian language models on a wide variety of formal texts.
41
+ * **Information Retrieval:** Develop and evaluate Persian information retrieval systems.
42
+ * **Keyword Extraction:** Extract key terms and build domain-specific vocabularies for various fields.
43
+ * **Text Summarization:** Summarize Persian documents from diverse subject areas.
44
 
45
+ ## Dataset Creation
 
46
 
47
+ ### Curation Rationale
48
 
49
+ This dataset was created to address the need for a large, publicly available Persian text corpus covering a diverse range of subjects. Existing Persian datasets often lack sufficient content representing the breadth of knowledge domains, which is essential for training robust models for various NLP tasks. The PDC aims to bridge this gap and support advancements in Persian NLP research and applications across diverse fields of study.
50
 
51
  ### Source Data
52
 
53
+ #### Data Collection and Processing
 
 
 
 
 
 
 
 
54
 
55
+ - **Data Acquisition:** Documents were discovered and collected through web searches using a curated list of [Persian search queries](https://huggingface.co/datasets/mshojaei77/persian-search-queries) designed to target publicly available Persian PDF documents across a wide range of topics. These topics span Science, Technology, Social Sciences, Humanities, and applied fields. Examples of subjects include "Mathematics," "Chemistry," "Feminism," "Migration Studies," and "Persian Podcasts," among many others. The search queries combined subject keywords (e.g., 'Mathematics', 'Feminism') with terms indicating document types (e.g., 'article', 'thesis', 'dissertation', 'book', 'guide') to refine searches and ensure relevance to informative content.
56
+ - **PDF Download and Conversion:** Relevant PDFs identified through search queries were downloaded and then converted to plain text format. This conversion process utilized a combination of tools optimized for Persian text, which can be challenging due to its right-to-left script and complex layouts.
57
+ - **Text Cleaning and Normalization:** The extracted text underwent several cleaning and normalization steps to improve data quality and consistency:
58
+ - **PDF Artifact Removal:** Headers, footers, page numbers, watermarks, and other extraneous elements introduced during PDF conversion were removed using regular expressions and rule-based methods.
59
+ - **Character Normalization:** Character encodings were standardized to UTF-8, and inconsistencies in Persian characters were addressed. This also included normalizing diacritics and vowel markings for uniformity.
60
+ - **Whitespace Normalization:** Multiple whitespace characters (spaces, tabs, newlines) were consolidated into single spaces, and leading/trailing whitespace was removed from lines and documents.
61
 
 
 
 
 
 
62
 
63
+ ## Considerations for Using the Data
64
 
65
+ ### Social Impact
 
 
 
66
 
67
+ This dataset is intended to have a positive social impact by:
68
+ - **Democratizing Access to Persian Knowledge:** Providing a large, freely available collection of Persian texts from various fields to researchers, students, and developers globally.
69
+ - **Advancing Persian Language Technology:** Serving as a valuable resource for developing and enhancing Persian language processing tools and models, benefiting Persian speakers in education, research, and various professional domains.
70
+ - **Enabling Interdisciplinary Research on Persian Content:** Facilitating the computational analysis of Persian content across disciplines, leading to insights into research trends, knowledge dissemination, and the evolution of information within Persian-speaking communities in diverse fields of study.
71
 
72
+ ### Dataset Bias
 
 
73
 
74
+ Users should be aware of potential biases in this dataset:
75
+ - **Formal Language Bias:** The corpus primarily consists of formal and structured writing, which may differ significantly from informal Persian or other genres. Models trained on this data might perform optimally on formal text but less effectively on other types of Persian text.
76
+ - **Topical Bias:** While aiming for broad topical coverage, the distribution of subjects may not perfectly represent the entire spectrum of Persian knowledge production or interests. The subject list in [Persian Search Queries Dataset](https://huggingface.co/datasets/mshojaei77/persian-search-queries) indicates the intended scope, but topic representation may vary based on the online availability of PDFs and the search queries used. For example, topics like "Games," "Songs," or "Fortune Telling" might be less represented in structured documents compared to core science or social science subjects, despite being included in the subject queries. Further analysis of the corpus's topic distribution is recommended to understand the actual topical balance.
77
+ - **Source Bias:** The dataset is limited to publicly accessible documents found through web searches, potentially excluding documents behind paywalls, in private repositories, or not indexed by search engines. This may bias the corpus towards institutions and individuals more likely to publish their work online in PDF format.
78
+ - **Geographic and Institutional Bias:** The origin of documents might be skewed towards specific geographic regions or institutions more active in online publishing of information and research.
79
 
80
+ ### Known Limitations
81
 
82
+ - **PDF Conversion Artifacts:** Despite cleaning efforts, some documents may still contain residual artifacts from PDF conversion, such as layout inconsistencies, broken characters, or misidentified text elements. Users should expect to handle some noise in the data.
83
+ - **Document Length Variability:** The dataset includes documents of varying lengths, from short articles to lengthy dissertations and books. This variation may need consideration depending on the specific NLP task.
84
+ - **Language Mixing:** While primarily in Persian, some documents may contain technical terms, citations, or abstracts in English or other languages, which is common in academic and technical writing.
85
 
86
+ ## Additional Information
87
 
88
+ ### Dataset Curator
89
 
90
+ This dataset was curated by [Mohammad Shojaei](https://huggingface.co/mshojaei77).
91
 
92
+ ### Dataset Statistics
93
 
94
+ - **Number of Documents:** 13k
95
+ - **Total Token Count:** Approximately 1 billion tokens
96
+ - **Number of Subjects:** 1313
 
 
 
 
 
 
97
 
98
+ ### Usage Example
99
 
100
+ Here's a basic example of loading and using the dataset with the `datasets` library from Hugging Face:
101
 
102
  ```python
103
  from datasets import load_dataset
 
108
  # Access the first few examples
109
  for example in dataset['train'].select(range(3)):
110
  print(f"File: {example['file_name']}")
111
+ print(f"Text preview (first 200 characters):\n{example['text'][:200]}...")
112
  print("-" * 50)
113
+
114
+ # Example: Iterate through all documents and count words (basic example)
115
+ def count_words(example):
116
+ words = example['text'].split() # Simple word splitting; more sophisticated tokenization may be needed
117
+ return {'word_count': len(words)}
118
+
119
+ dataset = dataset.map(count_words)
120
+ total_word_count = sum(dataset['train']['word_count'])
121
+ print(f"\nTotal word count in the dataset (approximate): {total_word_count}")
122
  ```
123
 
124
+ ### Licensing Information
125
+
126
+ This dataset is released under the [GNU General Public License v3.0 (GPL-3.0)](https://www.gnu.org/licenses/gpl-3.0.en.html). This license permits free use, distribution, and modification, even for commercial purposes, provided that derivative works are also licensed under GPL-3.0.
127
+
128
+ ### Citation Information
129
 
130
+ If you utilize this dataset in your research or applications, please cite it as follows:
131
+
132
+ ```bibtex
133
+ @misc{persian-document-corpus2024,
134
+ title={Persian Document Corpus},
135
+ author={Mohammad Shojaei},
136
+ year={2024},
137
+ publisher={Hugging Face},
138
+ howpublished={\url{https://huggingface.co/datasets/mshojaei77/persian-document-corpus}}
139
+ }
140
+ ```
141
 
142
+ ### Contributions
143
 
144
+ For questions, issues, or to contribute to the dataset, please open issues or submit pull requests. Contributions to improve the dataset and its documentation are welcomed.