Himasree commited on
Commit
cc654c1
·
verified ·
1 Parent(s): 31315d4

Add CodeEmbed model card and project documentation

Browse files
Files changed (1) hide show
  1. README.md +165 -0
README.md ADDED
@@ -0,0 +1,165 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # CodeEmbed
2
+
3
+ ## Overview
4
+
5
+ CodeEmbed is a code retrieval research project developed by Himasree Panku.
6
+
7
+ The project explores neural code retrieval using transformer-based bi-encoder architectures, dense semantic retrieval, BM25 lexical retrieval, and hybrid retrieval strategies.
8
+
9
+ This repository contains trained model checkpoints from the CodeEmbed experiments, including baseline models, dual-encoder experiments, ablation studies, hybrid retrieval experiments, and Phase 7 evaluation models.
10
+
11
+ ## Author
12
+
13
+ **Himasree Panku**
14
+
15
+ The CodeEmbed training experiments, retrieval system implementation, experiment configurations, evaluation workflow, and associated checkpoints were developed as part of this project.
16
+
17
+ ## Project Goals
18
+
19
+ CodeEmbed investigates effective retrieval of source-code functions from natural-language queries.
20
+
21
+ The project explores:
22
+
23
+ - Transformer-based code representations
24
+ - Bi-encoder architectures
25
+ - Dense vector retrieval
26
+ - BM25 lexical retrieval
27
+ - Hybrid dense and lexical retrieval
28
+ - Pooling strategies
29
+ - Temperature experiments
30
+ - Ablation studies
31
+ - FAISS-based retrieval
32
+ - Ranking-based retrieval evaluation
33
+
34
+ ## Dataset
35
+
36
+ The experiments use an AST-cleaned corpus derived from CodeSearchNet-based data.
37
+
38
+ The underlying dataset remains subject to its original licensing and attribution requirements.
39
+
40
+ ## Retrieval Approach
41
+
42
+ CodeEmbed supports hybrid retrieval by combining dense semantic retrieval, BM25 lexical retrieval, and convex interpolation of retrieval scores.
43
+
44
+ One demonstrated configuration uses:
45
+
46
+ - Dense weight (alpha): 0.70
47
+ - BM25 contribution: 0.30
48
+ - Corpus size: 19,632
49
+
50
+ ## Checkpoints
51
+
52
+ The repository contains checkpoints from multiple CodeEmbed experiments.
53
+
54
+ ### Baseline and Dual Encoder Experiments
55
+
56
+ - basic/
57
+ - dual/
58
+ - dual_bm25_hard/
59
+ - dual_fixed/
60
+ - dual_fixed_bm25/
61
+
62
+ ### Ablation Experiments
63
+
64
+ - ablation/
65
+ - ablation_basic_sweep/
66
+ - ablation_dual_sweep/
67
+ - ablation_dual_fixed_sweep/
68
+
69
+ These experiments investigate different pooling strategies and temperature values.
70
+
71
+ ### Shared Models
72
+
73
+ - shared/
74
+ - shared_large/
75
+
76
+ ### Phase 7 Models
77
+
78
+ The Phase 7 experiments include CodeBERT, Jina code model, MiniLM, and UniXcoder.
79
+
80
+ The checkpoints are located under phase7/.
81
+
82
+ ## Phase 7 Evaluation
83
+
84
+ A CodeEmbed Phase 7 CodeBERT experiment was evaluated on a test set containing 19,632 query-code pairs.
85
+
86
+ | Metric | Score |
87
+ | --- | ---: |
88
+ | Test MRR | 0.7658 |
89
+ | Recall@1 | 0.6890 |
90
+ | Recall@5 | 0.8640 |
91
+ | Recall@10 | 0.9060 |
92
+ | NDCG@10 | 0.7976 |
93
+
94
+ The reported validation MRR for the first epoch was 0.7356.
95
+
96
+ These results are specific to the project's evaluation setup and dataset.
97
+
98
+ ## Hybrid Retrieval Results
99
+
100
+ A demonstrated CodeEmbed hybrid retrieval configuration using convex interpolation achieved:
101
+
102
+ - Test MRR: 0.6612
103
+ - Improvement over the corresponding dense configuration: 40.7%
104
+ - Search latency: approximately 216.81 ms
105
+ - Corpus size: 19,632
106
+ - Dense weight: 0.70
107
+ - Observed leakage rate: 1.23%
108
+
109
+ These values are specific to the project's evaluation and demonstration configuration.
110
+
111
+ ## Training Checkpoints
112
+
113
+ The repository preserves both selected model checkpoints and intermediate training checkpoints.
114
+
115
+ Files named `best_*.pt` generally represent the selected checkpoint for an experiment.
116
+
117
+ Files named `checkpoint_epoch_*.pt` and `checkpoint_step_*.pt` represent intermediate training checkpoints.
118
+
119
+ Intermediate checkpoints are retained to preserve the experimental history.
120
+
121
+ ## Third-Party Models
122
+
123
+ Some experiments use or evaluate pretrained or externally developed models, including CodeBERT, UniXcoder, MiniLM, and Jina code models.
124
+
125
+ The inclusion of these checkpoints does not imply ownership of the underlying pretrained models, architectures, tokenizers, or original training data.
126
+
127
+ Third-party models and components remain subject to their respective licenses and terms.
128
+
129
+ ## Attribution and Provenance
130
+
131
+ CodeEmbed and the associated training experiments, retrieval implementation, evaluation workflow, and project-specific checkpoints were developed by Himasree Panku.
132
+
133
+ This Hugging Face repository preserves the trained checkpoint artifacts and provides a versioned record of the uploaded files.
134
+
135
+ Third-party models, datasets, libraries, and other external components remain subject to their original licenses and attribution requirements.
136
+
137
+ ## Reproducibility
138
+
139
+ For complete reproduction, users should obtain the corresponding CodeEmbed source code, configuration files, preprocessing pipeline, tokenizer and model configuration, and dependency environment.
140
+
141
+ ## Repository Structure
142
+
143
+ - ablation/
144
+ - ablation_basic_sweep/
145
+ - ablation_dual_fixed_sweep/
146
+ - ablation_dual_sweep/
147
+ - basic/
148
+ - dual/
149
+ - dual_bm25_hard/
150
+ - dual_fixed/
151
+ - dual_fixed_bm25/
152
+ - phase7/codebert/
153
+ - phase7/jina_v2_code/
154
+ - phase7/minilm_l6/
155
+ - phase7/unixcoder/
156
+ - shared/
157
+ - shared_large/
158
+
159
+ ## License
160
+
161
+ The licensing of individual checkpoints may depend on the underlying pretrained models and third-party components used to produce them.
162
+
163
+ No license is granted here for third-party pretrained models, datasets, or other components beyond the rights provided by their respective licenses.
164
+
165
+ Before redistributing or licensing individual checkpoints, users should verify the applicable third-party licenses and permissions.