Greg647465374 commited on
Commit
831253b
·
1 Parent(s): 41c095f

update readme

Browse files
Files changed (1) hide show
  1. README.md +179 -19
README.md CHANGED
@@ -1,20 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  # Rust AST Emoji Dataset
2
 
3
- This dataset contains Rust codebase AST (Abstract Syntax Tree) analysis with emoji mapping for code understanding and visualization.
4
 
5
- ## Dataset Structure
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
 
7
- - **Total Examples**: 15081
8
- - **Total Chunks**: 19
9
- - **Max File Size**: 10KB per chunk
10
- - **Max Files per Directory**: 10,000
11
 
12
- ## Features
13
 
14
- - `file_path`: Path to the original Rust source file
15
- - `timestamp`: Unix timestamp of analysis
16
- - `ast`: Full AST representation in JSON
17
- - `summary`: Analysis summary including:
 
 
 
 
 
18
  - `top_level_nodes`: Number of top-level AST nodes
19
  - `total_nodes`: Total number of AST nodes
20
  - `type_counts`: Count of each AST node type
@@ -23,14 +61,136 @@ This dataset contains Rust codebase AST (Abstract Syntax Tree) analysis with emo
23
  - `word_emoji_counts`: Emoji mapping for words
24
  - `emoji_counts_in_strings`: Emojis found in string literals
25
 
26
- ## Usage
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
 
28
- This dataset can be used for:
29
- - Code understanding and visualization
30
- - AST pattern analysis
31
- - Emoji-based code summarization
32
- - Codebase domain detection (Crypto, Web, i18n, etc.)
 
 
33
 
34
- ## License
35
 
36
- AGPL-3.0 License
 
 
 
 
1
+ ---
2
+ license: agpl-3.0
3
+ task_categories:
4
+ - text-classification
5
+ - code-understanding
6
+ - semantic-analysis
7
+ language:
8
+ - en
9
+ tags:
10
+ - code
11
+ - art
12
+ - biology
13
+ - synthetic
14
+ - rust
15
+ - ast
16
+ - emoji
17
+ - code-analysis
18
+ pretty_name: rust_ast_emoji
19
+ size_categories:
20
+ - 100K<n<1M
21
+ ---
22
+
23
  # Rust AST Emoji Dataset
24
 
25
+ ## Dataset Description
26
 
27
+ - **Repository:** [GitHub Repository](https://github.com/your-repo/solfunmeme-dioxus)
28
+ - **Paper:** [If applicable]
29
+ - **Point of Contact:** [Your contact information]
30
+ - **Huggingface Hub:** [Dataset link when published]
31
+
32
+ ### Dataset Summary
33
+
34
+ This dataset contains Rust codebase AST (Abstract Syntax Tree) analysis with emoji mapping for code understanding and visualization. The dataset provides a unique perspective on code structure by mapping AST node types and extracted words to emojis, enabling creative code analysis and visualization.
35
+
36
+ ### Supported Tasks and Leaderboards
37
+
38
+ - **Code Understanding:** Analyze code structure through emoji patterns
39
+ - **Code Classification:** Identify code domains (Crypto, Web, i18n, etc.) through emoji signatures
40
+ - **Code Visualization:** Create emoji-based code summaries and visualizations
41
+ - **Pattern Recognition:** Discover common coding patterns through emoji frequency analysis
42
 
43
+ ### Languages
 
 
 
44
 
45
+ The dataset contains Rust source code with English comments and identifiers.
46
 
47
+ ## Dataset Structure
48
+
49
+ ### Data Instances
50
+
51
+ Each instance contains:
52
+ - **file_path:** Path to the original Rust source file
53
+ - **timestamp:** Unix timestamp of analysis
54
+ - **ast:** Full AST representation in JSON format
55
+ - **summary:** Analysis summary including:
56
  - `top_level_nodes`: Number of top-level AST nodes
57
  - `total_nodes`: Total number of AST nodes
58
  - `type_counts`: Count of each AST node type
 
61
  - `word_emoji_counts`: Emoji mapping for words
62
  - `emoji_counts_in_strings`: Emojis found in string literals
63
 
64
+ ### Data Fields
65
+
66
+ - `file_path` (string): Path to the original Rust source file
67
+ - `timestamp` (int64): Unix timestamp of analysis
68
+ - `ast` (string): Full AST representation in JSON
69
+ - `summary` (map): Analysis summary with nested fields:
70
+ - `top_level_nodes` (int64): Number of top-level AST nodes
71
+ - `total_nodes` (int64): Total number of AST nodes
72
+ - `type_counts` (map): Count of each AST node type
73
+ - `string_literals` (sequence): Extracted string literals
74
+ - `word_counts` (map): Word frequency analysis
75
+ - `word_emoji_counts` (map): Emoji mapping for words
76
+ - `emoji_counts_in_strings` (map): Emojis found in string literals
77
+
78
+ ### Data Splits
79
+
80
+ - **train:** All analyzed Rust files
81
+
82
+ ## Dataset Creation
83
+
84
+ ### Source Data
85
+
86
+ #### Initial Data Collection and Normalization
87
+
88
+ The dataset was created by analyzing Rust source files from the solfunmeme-dioxus project, which includes:
89
+ - Core application code
90
+ - Vendor dependencies
91
+ - Generated code
92
+ - Test files
93
+
94
+ #### Who are the source language producers?
95
+
96
+ The source code was written by developers working on the solfunmeme-dioxus project, including contributions from the open-source community.
97
+
98
+ ### Annotations
99
+
100
+ #### Annotation process
101
+
102
+ The annotation process involved:
103
+ 1. **AST Parsing:** Using syn crate to parse Rust source files into ASTs
104
+ 2. **Emoji Mapping:** Mapping AST node types and extracted words to emojis based on semantic categories
105
+ 3. **Analysis:** Extracting string literals, word frequencies, and emoji patterns
106
+ 4. **Chunking:** Splitting large datasets into manageable chunks (1MB each)
107
+
108
+ #### Who are the annotators?
109
+
110
+ The annotations were generated automatically using a custom Rust script that implements emoji mapping based on predefined categories.
111
+
112
+ ### Personal and Sensitive Information
113
+
114
+ The dataset contains only code analysis data and does not include personal or sensitive information. All file paths are relative to the project structure.
115
+
116
+ ## Additional Information
117
+
118
+ ### Dataset Curators
119
+
120
+ The dataset was curated as part of the solfunmeme-dioxus project development process.
121
+
122
+ ### Licensing Information
123
+
124
+ This dataset is licensed under AGPL-3.0, the same license as the source codebase.
125
+
126
+ ### Citation Information
127
+
128
+ ```bibtex
129
+ @dataset{rust_ast_emoji,
130
+ title={Rust AST Emoji Dataset},
131
+ author={solfunmeme-dioxus contributors},
132
+ year={2024},
133
+ url={https://github.com/your-repo/solfunmeme-dioxus}
134
+ }
135
+ ```
136
+
137
+ ### Contributions
138
+
139
+ Contributions to improve the dataset, emoji mappings, or analysis methods are welcome through the project's GitHub repository.
140
+
141
+ ## Usage Examples
142
+
143
+ ### Basic Usage
144
+
145
+ ```python
146
+ from datasets import load_dataset
147
+
148
+ # Load the dataset
149
+ dataset = load_dataset("your-username/rust_ast_emoji")
150
+
151
+ # Access a sample
152
+ sample = dataset["train"][0]
153
+ print(f"File: {sample['file_path']}")
154
+ print(f"Top-level nodes: {sample['summary']['top_level_nodes']}")
155
+ print(f"Total nodes: {sample['summary']['total_nodes']}")
156
+ ```
157
+
158
+ ### Emoji Analysis
159
+
160
+ ```python
161
+ # Analyze emoji patterns
162
+ emoji_counts = sample['summary']['word_emoji_counts']
163
+ for emoji, count in emoji_counts.items():
164
+ print(f"{emoji}: {count}")
165
+ ```
166
+
167
+ ### Code Domain Detection
168
+
169
+ The dataset enables detection of code domains through emoji patterns:
170
+ - 🌵 (Agave): Solana/blockchain code
171
+ - 🎨 (CSS): Frontend/styling code
172
+ - 🔒 (Crypto): Security/cryptography code
173
+ - 🌐 (i18n): Internationalization code
174
+
175
+ ## Technical Details
176
+
177
+ ### Chunking Strategy
178
+
179
+ The dataset is split into chunks of maximum 1MB each to comply with Hugging Face and GitHub file size limits. Each chunk contains multiple code analysis examples.
180
+
181
+ ### Emoji Mapping Categories
182
 
183
+ The emoji mapping covers several categories:
184
+ - **Rust Core:** Basic Rust language constructs (🦀⚙️, 🏛️🧱, etc.)
185
+ - **Web/CSS:** Frontend and styling concepts (📏, 🧭, etc.)
186
+ - **Crypto/Security:** Cryptography and security (🔒, 🔑, etc.)
187
+ - **Project-Specific:** Domain-specific terms (🌵, 🌞, etc.)
188
+ - **Internationalization:** i18n and localization (🌐, 🌍, etc.)
189
+ - **Testing/Benchmarking:** Testing and performance (⏱️, 🏋️, etc.)
190
 
191
+ ### Performance Considerations
192
 
193
+ The dataset is optimized for:
194
+ - **Memory efficiency:** Compact JSON serialization
195
+ - **Accessibility:** Small chunk sizes for easy loading
196
+ - **Scalability:** Organized directory structure for large datasets