rasoul-nikbakht commited on
Commit
d45fe25
Β·
1 Parent(s): df5e772

Organize ETSI documents into Working Group folders based on CSV mapping

Browse files
This view is limited to 50 files because it contains too many changes. Β  See raw diff
Files changed (50) hide show
  1. data/part2/ETSICatalog.csv β†’ Grouped_ETSI_Documents_with_Document_Number_by_Working_Group.csv +2 -2
  2. README.md +173 -3
  3. data/{part4 β†’ EG}/10715.pdf +0 -0
  4. data/{part4 β†’ EG}/10715_metadata.txt +0 -0
  5. data/{part3 β†’ EG}/10741.pdf +0 -0
  6. data/{part3 β†’ EG}/10741_metadata.txt +0 -0
  7. data/{part4 β†’ EG}/10742.pdf +0 -0
  8. data/{part4 β†’ EG}/10742_metadata.txt +0 -0
  9. data/{part6 β†’ EG}/10747.pdf +0 -0
  10. data/{part6 β†’ EG}/10747_metadata.txt +0 -0
  11. data/{part2 β†’ EG}/10749.pdf +0 -0
  12. data/{part2 β†’ EG}/10749_metadata.txt +0 -0
  13. data/{part1 β†’ EG}/10822.pdf +0 -0
  14. data/{part1 β†’ EG}/10822_metadata.txt +0 -0
  15. data/{part6 β†’ EG}/10823.pdf +0 -0
  16. data/{part6 β†’ EG}/10823_metadata.txt +0 -0
  17. data/{part3 β†’ EG}/10832.pdf +0 -0
  18. data/{part3 β†’ EG}/10832_metadata.txt +0 -0
  19. data/{part2 β†’ EG}/10888.pdf +0 -0
  20. data/{part2 β†’ EG}/10888_metadata.txt +0 -0
  21. data/{part2 β†’ EG}/10889.pdf +0 -0
  22. data/{part2 β†’ EG}/10889_metadata.txt +0 -0
  23. data/{part1 β†’ EG}/11065.pdf +0 -0
  24. data/{part1 β†’ EG}/11065_metadata.txt +0 -0
  25. data/{part1 β†’ EG}/11089.pdf +0 -0
  26. data/{part1 β†’ EG}/11089_metadata.txt +0 -0
  27. data/{part6 β†’ EG}/11657.pdf +0 -0
  28. data/{part6 β†’ EG}/11657_metadata.txt +0 -0
  29. data/{part1 β†’ EG}/11658.pdf +0 -0
  30. data/{part1 β†’ EG}/11658_metadata.txt +0 -0
  31. data/{part6 β†’ EG}/11668.pdf +0 -0
  32. data/{part6 β†’ EG}/11668_metadata.txt +0 -0
  33. data/{part4 β†’ EG}/11731.pdf +0 -0
  34. data/{part4 β†’ EG}/11731_metadata.txt +0 -0
  35. data/{part3 β†’ EG}/11740.pdf +0 -0
  36. data/{part3 β†’ EG}/11740_metadata.txt +0 -0
  37. data/{part5 β†’ EG}/12143.pdf +0 -0
  38. data/{part5 β†’ EG}/12143_metadata.txt +0 -0
  39. data/{part5 β†’ EG}/12144.pdf +0 -0
  40. data/{part5 β†’ EG}/12144_metadata.txt +0 -0
  41. data/{part3 β†’ EG}/12145.pdf +0 -0
  42. data/{part3 β†’ EG}/12145_metadata.txt +0 -0
  43. data/{part6 β†’ EG}/12912.pdf +0 -0
  44. data/{part6 β†’ EG}/12912_metadata.txt +0 -0
  45. data/{part4 β†’ EG}/12931.pdf +0 -0
  46. data/{part4 β†’ EG}/12931_metadata.txt +0 -0
  47. data/{part5 β†’ EG}/13381.pdf +0 -0
  48. data/{part5 β†’ EG}/13381_metadata.txt +0 -0
  49. data/{part2 β†’ EG}/13383.pdf +0 -0
  50. data/{part2 β†’ EG}/13383_metadata.txt +0 -0
data/part2/ETSICatalog.csv β†’ Grouped_ETSI_Documents_with_Document_Number_by_Working_Group.csv RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:9b6bb4906959860fc54691c15ea521f80a971f7072e664311255fd5124c1c391
3
- size 14763843
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:93daf53cf1a66e4be6e708697ac0e51c0f520b7f6d3de503e0b0d47305aedb5e
3
+ size 1965944
README.md CHANGED
@@ -1,3 +1,173 @@
1
- ---
2
- license: cc-by-nc-4.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: cc-by-nc-4.0
3
+ language:
4
+ - en
5
+ tags:
6
+ - telecom
7
+ - LLM
8
+ - ETSI
9
+ size_categories:
10
+ - 1B<n<10B
11
+ ---
12
+
13
+ # πŸ“ Network Spec for LLM Understanding
14
+
15
+ ## πŸ“„ Overview
16
+
17
+ This repository houses a comprehensive collection of ETSI (European Telecommunications Standards Institute) documents, systematically downloaded, processed, and organized for streamlined access and analysis. Each ETSI deliverable is paired with its corresponding metadata to ensure thorough information management.
18
+
19
+ ## πŸ” Data Processing Workflow
20
+
21
+ The data processing involves two main scripts that automate the downloading and organization of ETSI documents:
22
+
23
+ 1. **Download Documents**:
24
+ - **Script**: `organize_etsi_documents.py`
25
+ - **Functionality**:
26
+ - Reads the `ETSICatalog.csv` file to extract document information and download links.
27
+ - Downloads each PDF document from the provided links.
28
+ - Saves associated metadata for each document in a corresponding `_metadata.txt` file.
29
+ - Implements pause and resume capabilities to handle large downloads efficiently.
30
+
31
+ 2. **Organize by Working Group**:
32
+ - **Script**: `organize_by_working_group.py`
33
+ - **Functionality**:
34
+ - Reads the `Grouped_ETSI_Documents_with_Document_Number_by_Working_Group.csv` file to map each document to its respective **Working Group** (e.g., `GR`, `GS`).
35
+ - Validates the existence of both PDF and metadata files for each document.
36
+ - Creates dedicated folders for each Working Group within the `data/` directory.
37
+ - Moves the PDF and metadata files into their corresponding Working Group folders.
38
+ - Logs any missing or problematic files for review.
39
+
40
+ ## πŸ“ Directory Structure
41
+
42
+ ```
43
+ β”œβ”€β”€ data/
44
+ β”‚ β”œβ”€β”€ GR/
45
+ β”‚ β”‚ β”œβ”€β”€ 64372.pdf
46
+ β”‚ β”‚ β”œβ”€β”€ 64372_metadata.txt
47
+ β”‚ β”‚ β”œβ”€β”€ 61992.pdf
48
+ β”‚ β”‚ β”œβ”€β”€ 61992_metadata.txt
49
+ β”‚ β”‚ └── ...
50
+ β”‚ β”œβ”€β”€ GS/
51
+ β”‚ β”‚ β”œβ”€β”€ 63040.pdf
52
+ β”‚ β”‚ β”œβ”€β”€ 63040_metadata.txt
53
+ β”‚ β”‚ β”œβ”€β”€ 62010.pdf
54
+ β”‚ β”‚ β”œβ”€β”€ 62010_metadata.txt
55
+ β”‚ β”‚ └── ...
56
+ β”‚ └── ...
57
+ β”œβ”€β”€ ETSICatalog.csv
58
+ β”œβ”€β”€ Grouped_ETSI_Documents_with_Document_Number_by_Working_Group.csv
59
+ β”œβ”€β”€ organize_etsi_documents.py
60
+ β”œβ”€β”€ organize_by_working_group.py
61
+ β”œβ”€β”€ requirements.txt
62
+ β”œβ”€β”€ missing_files.log
63
+ β”œβ”€β”€ organize_by_working_group.log
64
+ └── README.md
65
+ ```
66
+
67
+ - **data/**: Contains all downloaded PDFs and their corresponding metadata files, organized into subdirectories based on **Working Groups** (`GR`, `GS`, etc.).
68
+ - **ETSICatalog.csv**: Original CSV file containing metadata and download links for ETSI documents.
69
+ - **Grouped_ETSI_Documents_with_Document_Number_by_Working_Group.csv**: CSV file categorizing documents by Working Group and Concept.
70
+ - **organize_etsi_documents.py**: Python script for downloading ETSI documents and generating metadata files.
71
+ - **organize_by_working_group.py**: Python script for organizing downloaded documents into Working Group folders.
72
+ - **requirements.txt**: Lists Python dependencies required to run the scripts.
73
+ - **missing_files.log**: Logs detailing any missing or problematic files encountered during the organization process.
74
+ - **organize_by_working_group.log**: Detailed log of the `organize_by_working_group.py` script's execution.
75
+ - **README.md**: This documentation file.
76
+
77
+ ## πŸ› οΈ Prerequisites
78
+
79
+ - **Python 3.x**: Ensure Python is installed on your system. Download it from [python.org](https://www.python.org/downloads/).
80
+ - **Git LFS**: Required for handling large files. Install Git LFS from [git-lfs.github.com](https://git-lfs.github.com/).
81
+
82
+ ## πŸš€ Setup Instructions
83
+
84
+ 1. **Clone the Repository** (if not already cloned):
85
+
86
+ ```bash
87
+ git clone https://hf.co/datasets/rasoul-nikbakht/NetSpec-LLM.git
88
+ cd NetSpec-LLM
89
+ ```
90
+
91
+ 2. **Install Required Python Packages**:
92
+
93
+ It's recommended to use a virtual environment:
94
+
95
+ ```bash
96
+ # Create a virtual environment
97
+ python3 -m venv venv
98
+
99
+ # Activate the virtual environment
100
+ # On macOS/Linux:
101
+ source venv/bin/activate
102
+ # On Windows:
103
+ venv\Scripts\activate
104
+
105
+ # Upgrade pip
106
+ pip install --upgrade pip
107
+
108
+ # Install dependencies
109
+ pip install -r requirements.txt
110
+ ```
111
+
112
+ *Alternatively, install directly without a virtual environment:*
113
+
114
+ ```bash
115
+ pip install pandas tqdm
116
+ ```
117
+
118
+ 3. **Initialize Git LFS**:
119
+
120
+ ```bash
121
+ git lfs install
122
+ ```
123
+
124
+ 4. **Verify File Placement**:
125
+
126
+ - Ensure the CSV file `Grouped_ETSI_Documents_with_Document_Number_by_Working_Group.csv` is in the root directory of the repository.
127
+ - Ensure all PDF and metadata files are located within the `data/` directory.
128
+
129
+ ## πŸ“ How to Use
130
+
131
+ ### 1. **Download and Organize ETSI Documents**
132
+
133
+ Ensure that `ETSICatalog.csv` is placed in the root directory of the repository.
134
+
135
+ ```bash
136
+ python organize_etsi_documents.py
137
+ ```
138
+
139
+ *Note: The download process may take some time depending on the number of documents and your internet connection.*
140
+
141
+ ### 2. **Categorize Documents by Working Group**
142
+
143
+ Ensure that `Grouped_ETSI_Documents_with_Document_Number_by_Working_Group.csv` and `process-ETSI.ipynb` are correctly formatted and placed in the root directory.
144
+
145
+ Run the appropriate cell in the Jupyter notebook to group the documents by Working Group.
146
+
147
+ *Note: The script will move PDFs and metadata files into their respective Working Group folders. Any missing files or errors will be logged in `missing_files.log` and `organize_by_working_group.log`.*
148
+
149
+ ### 3. **Review the Results**
150
+
151
+ - **Check the Organized Directories**:
152
+ - Navigate to the `data/` directory to see subfolders for each Working Group (`GR`, `GS`, etc.) containing the relevant files.
153
+
154
+ - **Inspect Log Files**:
155
+ - `organize_by_working_group.log`: Contains detailed logs of the script's execution, including moved files and any errors.
156
+ - `missing_files.log`: Details any missing files or issues encountered during the move process.
157
+
158
+ ## πŸ›‘οΈ Additional Notes
159
+
160
+ - **Backup Your Data**:
161
+ - Before running the scripts, it's advisable to back up your `data/` directory to prevent accidental data loss.
162
+
163
+ - **Handling Missing Files**:
164
+ - If `missing_files.log` contains entries, review them to identify and address any missing or problematic files.
165
+
166
+ - **Extensibility**:
167
+ - The scripts are designed to handle additional Working Groups seamlessly. Simply update the CSV file with new entries, and rerun the script to organize new documents.
168
+
169
+
170
+
171
+ ## πŸ“œ License
172
+
173
+ This project is licensed under the [MIT License](LICENSE).
data/{part4 β†’ EG}/10715.pdf RENAMED
File without changes
data/{part4 β†’ EG}/10715_metadata.txt RENAMED
File without changes
data/{part3 β†’ EG}/10741.pdf RENAMED
File without changes
data/{part3 β†’ EG}/10741_metadata.txt RENAMED
File without changes
data/{part4 β†’ EG}/10742.pdf RENAMED
File without changes
data/{part4 β†’ EG}/10742_metadata.txt RENAMED
File without changes
data/{part6 β†’ EG}/10747.pdf RENAMED
File without changes
data/{part6 β†’ EG}/10747_metadata.txt RENAMED
File without changes
data/{part2 β†’ EG}/10749.pdf RENAMED
File without changes
data/{part2 β†’ EG}/10749_metadata.txt RENAMED
File without changes
data/{part1 β†’ EG}/10822.pdf RENAMED
File without changes
data/{part1 β†’ EG}/10822_metadata.txt RENAMED
File without changes
data/{part6 β†’ EG}/10823.pdf RENAMED
File without changes
data/{part6 β†’ EG}/10823_metadata.txt RENAMED
File without changes
data/{part3 β†’ EG}/10832.pdf RENAMED
File without changes
data/{part3 β†’ EG}/10832_metadata.txt RENAMED
File without changes
data/{part2 β†’ EG}/10888.pdf RENAMED
File without changes
data/{part2 β†’ EG}/10888_metadata.txt RENAMED
File without changes
data/{part2 β†’ EG}/10889.pdf RENAMED
File without changes
data/{part2 β†’ EG}/10889_metadata.txt RENAMED
File without changes
data/{part1 β†’ EG}/11065.pdf RENAMED
File without changes
data/{part1 β†’ EG}/11065_metadata.txt RENAMED
File without changes
data/{part1 β†’ EG}/11089.pdf RENAMED
File without changes
data/{part1 β†’ EG}/11089_metadata.txt RENAMED
File without changes
data/{part6 β†’ EG}/11657.pdf RENAMED
File without changes
data/{part6 β†’ EG}/11657_metadata.txt RENAMED
File without changes
data/{part1 β†’ EG}/11658.pdf RENAMED
File without changes
data/{part1 β†’ EG}/11658_metadata.txt RENAMED
File without changes
data/{part6 β†’ EG}/11668.pdf RENAMED
File without changes
data/{part6 β†’ EG}/11668_metadata.txt RENAMED
File without changes
data/{part4 β†’ EG}/11731.pdf RENAMED
File without changes
data/{part4 β†’ EG}/11731_metadata.txt RENAMED
File without changes
data/{part3 β†’ EG}/11740.pdf RENAMED
File without changes
data/{part3 β†’ EG}/11740_metadata.txt RENAMED
File without changes
data/{part5 β†’ EG}/12143.pdf RENAMED
File without changes
data/{part5 β†’ EG}/12143_metadata.txt RENAMED
File without changes
data/{part5 β†’ EG}/12144.pdf RENAMED
File without changes
data/{part5 β†’ EG}/12144_metadata.txt RENAMED
File without changes
data/{part3 β†’ EG}/12145.pdf RENAMED
File without changes
data/{part3 β†’ EG}/12145_metadata.txt RENAMED
File without changes
data/{part6 β†’ EG}/12912.pdf RENAMED
File without changes
data/{part6 β†’ EG}/12912_metadata.txt RENAMED
File without changes
data/{part4 β†’ EG}/12931.pdf RENAMED
File without changes
data/{part4 β†’ EG}/12931_metadata.txt RENAMED
File without changes
data/{part5 β†’ EG}/13381.pdf RENAMED
File without changes
data/{part5 β†’ EG}/13381_metadata.txt RENAMED
File without changes
data/{part2 β†’ EG}/13383.pdf RENAMED
File without changes
data/{part2 β†’ EG}/13383_metadata.txt RENAMED
File without changes