File size: 6,317 Bytes
831253b
 
 
 
dec3021
 
 
 
 
831253b
 
dec3021
831253b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
41c095f
 
831253b
41c095f
777c4c3
831253b
 
 
 
 
 
 
 
 
 
 
 
 
 
41c095f
831253b
41c095f
831253b
41c095f
831253b
 
 
 
 
 
 
 
 
41c095f
 
 
 
 
 
 
 
831253b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
777c4c3
831253b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
777c4c3
831253b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
41c095f
831253b
 
 
 
 
 
 
41c095f
831253b
41c095f
831253b
 
 
 
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
---
license: agpl-3.0
task_categories:
- text-classification
- feature-extraction
- text-generation

sub_categories:
- text-classification
- code-understanding
- semantic-analysis

language:
- en
tags:
- code
- art
- biology
- synthetic
- rust
- ast
- emoji
- code-analysis
pretty_name: rust_ast_emoji
size_categories:
- 100K<n<1M
---

# Rust AST Emoji Dataset

## Dataset Description

- **Repository:** [GitHub Repository](https://github.com/meta-introspector/solfunmeme-dioxus)
- **Paper:** [If applicable]
- **Point of Contact:** [Your contact information]
- **Huggingface Hub:** [Dataset link when published]

### Dataset Summary

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.

### Supported Tasks and Leaderboards

- **Code Understanding:** Analyze code structure through emoji patterns
- **Code Classification:** Identify code domains (Crypto, Web, i18n, etc.) through emoji signatures
- **Code Visualization:** Create emoji-based code summaries and visualizations
- **Pattern Recognition:** Discover common coding patterns through emoji frequency analysis

### Languages

The dataset contains Rust source code with English comments and identifiers.

## Dataset Structure

### Data Instances

Each instance contains:
- **file_path:** Path to the original Rust source file
- **timestamp:** Unix timestamp of analysis
- **ast:** Full AST representation in JSON format
- **summary:** Analysis summary including:
  - `top_level_nodes`: Number of top-level AST nodes
  - `total_nodes`: Total number of AST nodes
  - `type_counts`: Count of each AST node type
  - `string_literals`: Extracted string literals
  - `word_counts`: Word frequency analysis
  - `word_emoji_counts`: Emoji mapping for words
  - `emoji_counts_in_strings`: Emojis found in string literals

### Data Fields

- `file_path` (string): Path to the original Rust source file
- `timestamp` (int64): Unix timestamp of analysis
- `ast` (string): Full AST representation in JSON
- `summary` (map): Analysis summary with nested fields:
  - `top_level_nodes` (int64): Number of top-level AST nodes
  - `total_nodes` (int64): Total number of AST nodes
  - `type_counts` (map): Count of each AST node type
  - `string_literals` (sequence): Extracted string literals
  - `word_counts` (map): Word frequency analysis
  - `word_emoji_counts` (map): Emoji mapping for words
  - `emoji_counts_in_strings` (map): Emojis found in string literals

### Data Splits

- **train:** All analyzed Rust files

## Dataset Creation

### Source Data

#### Initial Data Collection and Normalization

The dataset was created by analyzing Rust source files from the solfunmeme-dioxus project, which includes:
- Core application code
- Vendor dependencies
- Generated code
- Test files

#### Who are the source language producers?

The source code was written by developers working on the solfunmeme-dioxus project, including contributions from the open-source community.

### Annotations

#### Annotation process

The annotation process involved:
1. **AST Parsing:** Using syn crate to parse Rust source files into ASTs
2. **Emoji Mapping:** Mapping AST node types and extracted words to emojis based on semantic categories
3. **Analysis:** Extracting string literals, word frequencies, and emoji patterns
4. **Chunking:** Splitting large datasets into manageable chunks (1MB each)

#### Who are the annotators?

The annotations were generated automatically using a custom Rust script that implements emoji mapping based on predefined categories.

### Personal and Sensitive Information

The dataset contains only code analysis data and does not include personal or sensitive information. All file paths are relative to the project structure.

## Additional Information

### Dataset Curators

The dataset was curated as part of the solfunmeme-dioxus project development process.

### Licensing Information

This dataset is licensed under AGPL-3.0, the same license as the source codebase.

### Citation Information

```bibtex
@dataset{rust_ast_emoji,
  title={Rust AST Emoji Dataset},
  author={solfunmeme-dioxus contributors},
  year={2024},
  url={https://github.com/meta-introspector/solfunmeme-dioxus}
}
```

### Contributions

Contributions to improve the dataset, emoji mappings, or analysis methods are welcome through the project's GitHub repository.

## Usage Examples

### Basic Usage

```python
from datasets import load_dataset

# Load the dataset
dataset = load_dataset("h4/solfunmeme-dioxus-reports")

# Access a sample
sample = dataset["train"][0]
print(f"File: {sample['file_path']}")
print(f"Top-level nodes: {sample['summary']['top_level_nodes']}")
print(f"Total nodes: {sample['summary']['total_nodes']}")
```

### Emoji Analysis

```python
# Analyze emoji patterns
emoji_counts = sample['summary']['word_emoji_counts']
for emoji, count in emoji_counts.items():
    print(f"{emoji}: {count}")
```

### Code Domain Detection

The dataset enables detection of code domains through emoji patterns:
- 🌡 (Agave): Solana/blockchain code
- 🎨 (CSS): Frontend/styling code  
- πŸ”’ (Crypto): Security/cryptography code
- 🌐 (i18n): Internationalization code

## Technical Details

### Chunking Strategy

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.

### Emoji Mapping Categories

The emoji mapping covers several categories:
- **Rust Core:** Basic Rust language constructs (πŸ¦€βš™οΈ, πŸ›οΈπŸ§±, etc.)
- **Web/CSS:** Frontend and styling concepts (πŸ“, 🧭, etc.)
- **Crypto/Security:** Cryptography and security (πŸ”’, πŸ”‘, etc.)
- **Project-Specific:** Domain-specific terms (🌡, 🌞, etc.)
- **Internationalization:** i18n and localization (🌐, 🌍, etc.)
- **Testing/Benchmarking:** Testing and performance (⏱️, πŸ‹οΈ, etc.)

### Performance Considerations

The dataset is optimized for:
- **Memory efficiency:** Compact JSON serialization
- **Accessibility:** Small chunk sizes for easy loading
- **Scalability:** Organized directory structure for large datasets