Datasets:
Update README.md
Browse files
README.md
CHANGED
|
@@ -8,19 +8,27 @@ language:
|
|
| 8 |
---
|
| 9 |
|
| 10 |
# typescript-chunks
|
| 11 |
-
A processed
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
|
| 13 |
-
Each source file is parsed with the TypeScript AST and split into 'semantic chunks'. Then, each chunk is traversed to gather comments.
|
| 14 |
|
| 15 |
-
Types:
|
| 16 |
-
- FunctionDeclaration
|
| 17 |
-
- ArrowFunction
|
| 18 |
-
- ClassDeclaration
|
| 19 |
-
- InterfaceDeclaration
|
| 20 |
-
- EnumDeclaration
|
| 21 |
-
- TypeAliasDeclaration
|
| 22 |
-
- MethodDeclaration
|
| 23 |
-
- ModuleDeclaration
|
| 24 |
|
| 25 |
# Dataset Structure
|
| 26 |
```python
|
|
@@ -29,8 +37,8 @@ load_dataset("bleugreen/typescript-chunks")
|
|
| 29 |
|
| 30 |
DatasetDict({
|
| 31 |
train: Dataset({
|
| 32 |
-
features: ['repo', 'path', '
|
| 33 |
-
num_rows:
|
| 34 |
})
|
| 35 |
})
|
| 36 |
```
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
# typescript-chunks
|
| 11 |
+
A dataset of TypeScript snippets, processed from the typescript subset of [the-stack-smol](https://huggingface.co/datasets/bigcode/the-stack-smol).
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
# Processing
|
| 15 |
+
- Each source file is parsed with the TypeScript AST and queried for 'semantic chunks' of the following types.
|
| 16 |
+
```
|
| 17 |
+
FunctionDeclaration ---- 8327
|
| 18 |
+
ArrowFunction --------- 37971
|
| 19 |
+
ClassDeclaration ------- 5864
|
| 20 |
+
InterfaceDeclaration -- 13426
|
| 21 |
+
EnumDeclaration --------- 531
|
| 22 |
+
TypeAliasDeclaration --- 3657
|
| 23 |
+
MethodDeclaration ----- 27079
|
| 24 |
+
ModuleDeclaration ------ 1174
|
| 25 |
+
```
|
| 26 |
+
- Leading comments are added to the front of `content`
|
| 27 |
+
- Removed all chunks over max sequence length (2048)
|
| 28 |
+
- Deduplicated / cleaned up
|
| 29 |
+
- Generated instructions / summaries with `gpt-3.5-turbo`
|
| 30 |
|
|
|
|
| 31 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
|
| 33 |
# Dataset Structure
|
| 34 |
```python
|
|
|
|
| 37 |
|
| 38 |
DatasetDict({
|
| 39 |
train: Dataset({
|
| 40 |
+
features: ['repo', 'path', 'type', 'content', 'summary', 'instruction'],
|
| 41 |
+
num_rows:
|
| 42 |
})
|
| 43 |
})
|
| 44 |
```
|