Shuu12121 commited on
Commit
1cefdd2
·
verified ·
1 Parent(s): a5c0020

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +87 -585
README.md CHANGED
@@ -1,621 +1,123 @@
1
  ---
2
  tags:
3
- - sentence-transformers
4
- - sentence-similarity
5
- - feature-extraction
6
- - generated_from_trainer
7
- - dataset_size:2022217
8
- - loss:MultipleNegativesRankingLoss
 
 
9
  base_model: Shuu12121/CodeModernBERT-Crow
10
- widget:
11
- - source_sentence: 'Clone value to a new instance
12
-
13
-
14
- @private
15
-
16
- @param {*} val
17
-
18
- @returns {*}'
19
- sentences:
20
- - "function _copy(val) {\n const type = $type(val);\n\n if (type == 'object')\
21
- \ {\n val = _extend({}, val, true);\n } else if (type == 'array') {\n\
22
- \ val = val.slice(0);\n }\n\n return val;\n}"
23
- - "function (data) {\n data = data || {};\n\n this.category = data.hasOwnProperty('category')\
24
- \ ? data.category : 'No category';\n this.id = data.hasOwnProperty('id') ?\
25
- \ data.id : '';\n this.group = data.hasOwnProperty('group') ? data.group :\
26
- \ '';\n this.lines = data.hasOwnProperty('lines') ? data.lines : 0;\n this.name\
27
- \ = data.hasOwnProperty('name') ? data.name : '';\n this.options = data.hasOwnProperty('options')\
28
- \ ? data.options : {};\n this.origin = data.hasOwnProperty('origin') ? data.origin\
29
- \ : '';\n this.resources = data.hasOwnProperty('resources') ? data.resources\
30
- \ : Object.assign({}, getDefaultOptions().resources);\n this.usage = data.hasOwnProperty('usage')\
31
- \ ? data.usage : [];\n this.viewId = data.hasOwnProperty('viewId') ? data.viewId\
32
- \ : '';\n}"
33
- - "public function relativeMove($model, $position)\n {\n $conditionAttributes\
34
- \ = (array)$this->conditionAttributes;\n $owner = $this->owner;\n\n \
35
- \ if (!empty($conditionAttributes)) {\n $sameCondition = true;\n\
36
- \ foreach ($conditionAttributes as $attr) {\n if ($owner->getAttribute($attr)\
37
- \ != $model->getAttribute($attr)) {\n $sameCondition = false;\n\
38
- \ break;\n }\n }\n if\
39
- \ (!$sameCondition) {\n // move in other condition category\n \
40
- \ $this->moveToTop();\n // update condition attribute\n\
41
- \ $condition = [];\n foreach ($conditionAttributes\
42
- \ as $attr) {\n $condition[$attr] = $model->getAttribute($attr);\n\
43
- \ }\n $condition[$this->sortAttribute] = $owner->find()->andWhere($this->getCondition())->count()\
44
- \ - 1;\n $owner->updateAttributes($condition);\n }\n\
45
- \ }\n // calculate pos change\n $currentPos = $owner->getAttribute($this->sortAttribute);\n\
46
- \ $destinationPos = $model->getAttribute($this->sortAttribute);\n \
47
- \ if ($position == 'after') {\n $newPos = $destinationPos > $currentPos\
48
- \ ? $destinationPos - 1 : $destinationPos;\n } else {\n $newPos\
49
- \ = $destinationPos > $currentPos ? $destinationPos : $destinationPos + 1;\n \
50
- \ }\n $this->moveToPosition($newPos);\n }"
51
- - source_sentence: '/*
52
-
53
- Realize an asynchronous squeue command on slurm according a parameter (or not).
54
-
55
- Data are formated into a literal.
56
-
57
- @paramSqueue {string} optional. For example : '' -o "%j %i" '' // not implemented
58
- yet'
59
- sentences:
60
- - "function(paramSqueue) {\n if (!paramSqueue) paramSqueue = '';\n paramSqueue\
61
- \ = ''; // to remove when it will be take into account in the implementation\n\
62
- \ var emitter = new events.EventEmitter();\n var squeueRes_dict = {\n \
63
- \ 'id': [],\n 'partition': [],\n 'nameUUID': [],\n 'status':\
64
- \ []\n }\n\n // squeue command\n var exec_cmd = require('child_process').exec;\n\
65
- \ exec_cmd(queueBinary + ' -o \\\"\\%i \\%P \\%j \\%t\\\" ' + paramSqueue,\
66
- \ function(err, stdout, stderr) {\n if (err) {\n emitter.emit('listError',\
67
- \ err);\n return;\n }\n var squeueRes_str = ('' + stdout).replace(/\\\
68
- \"/g, ''); // squeue results\n squeueRes_str.split('\\n')\n \
69
- \ .filter(function(jobArray, i) {\n return jobArray.length > 0\
70
- \ && i > 0;\n })\n .map(function(jobLine, i) { // for each\
71
- \ job\n return test = jobLine.split(' ').filter(function(val) {\n\
72
- \ return val != ''; // keep values that are not empty\n \
73
- \ });\n })\n .map(function(jobArray, i) { //\
74
- \ save each field in the corresponding array of dict\n squeueRes_dict.id.push(jobArray[0]);\
75
- \ // job ID gived by slurm\n squeueRes_dict.partition.push(jobArray[1]);\
76
- \ // gpu, cpu, etc.\n squeueRes_dict.nameUUID.push(jobArray[2]);\
77
- \ // unique job ID gived by Nslurm (uuid)\n squeueRes_dict.status.push(jobArray[3]);\
78
- \ // P, R, CF, CG, etc.\n });\n emitter.emit('data', squeueRes_dict);\n\
79
- \ });\n return emitter;\n}"
80
- - "function(node, state, leaving) {\n for (let i = 0; i < state.currentSegments.length;\
81
- \ ++i) {\n const segInternal = state.currentSegments[i].internal;\n\
82
- \n if (leaving) {\n segInternal.exitNodes.push(node);\n\
83
- \ } else {\n segInternal.nodes.push(node);\n \
84
- \ }\n }\n\n debug([\n `${state.currentSegments.map(getId).join(\"\
85
- ,\")})`,\n `${node.type}${leaving ? \":exit\" : \"\"}`\n ].join(\"\
86
- \ \"));\n }"
87
- - "private void checkForGenerator(final Class<?> clazz, Field field, GeneratedValue\
88
- \ generatedValue, String schemaName)\n\n {\n\n TableGenerator tableGenerator\
89
- \ = field.getAnnotation(TableGenerator.class);\n SequenceGenerator sequenceGenerator\
90
- \ = field.getAnnotation(SequenceGenerator.class);\n if (tableGenerator\
91
- \ == null || !tableGenerator.name().equals(generatedValue.generator()))\n \
92
- \ {\n tableGenerator = clazz.getAnnotation(TableGenerator.class);\n\
93
- \ }\n if (sequenceGenerator == null || !sequenceGenerator.name().equals(generatedValue.generator()))\n\
94
- \ {\n sequenceGenerator = clazz.getAnnotation(SequenceGenerator.class);\n\
95
- \ }\n\n if ((tableGenerator == null && sequenceGenerator == null)\n\
96
- \ || (tableGenerator != null && !tableGenerator.name().equals(generatedValue.generator()))\n\
97
- \ || (sequenceGenerator != null && !sequenceGenerator.name().equals(generatedValue.generator())))\n\
98
- \ {\n\n throw new RuleValidationException(\"Unknown Id.generator:\
99
- \ \" + generatedValue.generator());\n\n }\n else if ((tableGenerator\
100
- \ != null && !tableGenerator.schema().isEmpty() && !tableGenerator.schema().equals(\n\
101
- \ schemaName))\n || (sequenceGenerator != null &&\
102
- \ !sequenceGenerator.schema().isEmpty() && !sequenceGenerator.schema()\n \
103
- \ .equals(schemaName)))\n {\n\n throw new\
104
- \ RuleValidationException(\"Generator \" + generatedValue.generator() + \" in\
105
- \ entity : \"\n + clazz.getName() + \" has different schema\
106
- \ name ,it should be same as entity have\");\n\n }\n\n }"
107
- - source_sentence: '@param $param1
108
-
109
- @param null $param2
110
-
111
- @param null $param3
112
-
113
-
114
- @return array|int|mixed
115
-
116
- @throws DbException'
117
- sentences:
118
- - "func (s *GetReservationUtilizationOutput) SetUtilizationsByTime(v []*UtilizationByTime)\
119
- \ *GetReservationUtilizationOutput {\n\ts.UtilizationsByTime = v\n\treturn s\n\
120
- }"
121
- - "public static function ask($param1, $param2 = null, $param3 = null) {\n \
122
- \ self::init();\n if(is_array($param1)) {\n return self::smartSelect($param1,\
123
- \ $param2, $param3);\n } else {\n switch(substr($param1, 0,\
124
- \ 1)) {\n case '>':\n case '/':\n \
125
- \ return self::smartQuery($param1, $param2);\n break;\n\
126
- \ case '?':\n return self::smartSelect(substr($param1,\
127
- \ 1), $param2, $param3);\n break;\n default:\n\
128
- \ if(is_array($param3)) {\n return self::smartUpdate($param1,\
129
- \ $param2, $param3);\n } else {\n return\
130
- \ self::smartInsert($param1, $param2);\n }\n }\n\
131
- \ }\n }"
132
- - "void printStates() {\n int c; // input \"character\"\n \
133
- \ int n; // state number\n\n System.out.print(\"state |\
134
- \ i n p u t s y m b o l s \\n\");\n System.out.print(\"\
135
- \ | Acc LA Tag\");\n for (c=0; c<fRB.fSetBuilder.getNumCharCategories();\
136
- \ c++) {\n RBBINode.printInt(c, 3);\n }\n System.out.print(\"\
137
- \\n\");\n System.out.print(\" |---------------\");\n \
138
- \ for (c=0; c<fRB.fSetBuilder.getNumCharCategories(); c++) {\n System.out.print(\"\
139
- ---\");\n }\n System.out.print(\"\\n\");\n\n for\
140
- \ (n=0; n<fDStates.size(); n++) {\n RBBIStateDescriptor sd = fDStates.get(n);\n\
141
- \ RBBINode.printInt(n, 5);\n System.out.print(\" |\
142
- \ \");\n\n RBBINode.printInt(sd.fAccepting, 3);\n \
143
- \ RBBINode.printInt(sd.fLookAhead, 4);\n RBBINode.printInt(sd.fTagsIdx,\
144
- \ 6);\n System.out.print(\" \");\n for (c=0; c<fRB.fSetBuilder.getNumCharCategories();\
145
- \ c++) {\n RBBINode.printInt(sd.fDtran[c], 3);\n \
146
- \ }\n System.out.print(\"\\n\");\n }\n System.out.print(\"\
147
- \\n\\n\");\n }"
148
- - source_sentence: 'Performs a forward, allowing page-relative paths and setting all
149
- values
150
-
151
- compatible with &lt;ao:forward&gt; tag.
152
-
153
-
154
- @param args The arguments for the page, make unmodifiable and accessible as
155
- request-scope var "arg"
156
-
157
-
158
- @see #forward(java.lang.String, javax.servlet.RequestDispatcher, javax.servlet.http.HttpServletRequest,
159
- javax.servlet.http.HttpServletResponse, java.util.Map)'
160
- sentences:
161
- - "public static void forward(\n\t\tServletContext servletContext,\n\t\tString page,\n\
162
- \t\tHttpServletRequest request,\n\t\tHttpServletResponse response,\n\t\tMap<String,?>\
163
- \ args\n\t) throws ServletException, IOException {\n\t\t// Resolve the dispatcher\n\
164
- \t\tString contextRelativePath = ServletUtil.getAbsolutePath(getCurrentPagePath(request),\
165
- \ page);\n\t\tRequestDispatcher dispatcher = servletContext.getRequestDispatcher(contextRelativePath);\n\
166
- \t\tif(dispatcher==null) throw new LocalizedServletException(accessor, \"Dispatcher.dispatcherNotFound\"\
167
- , contextRelativePath);\n\t\tforward(contextRelativePath, dispatcher, request,\
168
- \ response, args);\n\t}"
169
- - "public function getConnection($name = ''): QueryBuilderInterface\n\t{\n\t\t//\
170
- \ If the parameter is a string, use it as an array index\n\t\tif (is_scalar($name)\
171
- \ && isset($this->connections[$name]))\n\t\t{\n\t\t\treturn $this->connections[$name];\n\
172
- \t\t}\n\t\telse if (empty($name) && ! empty($this->connections)) // Otherwise,\
173
- \ return the last one\n\t\t{\n\t\t\treturn end($this->connections);\n\t\t}\n\n\
174
- \t\t// You should actually connect before trying to get a connection...\n\t\t\
175
- throw new InvalidArgumentException('The specified connection does not exist');\n\
176
- \t}"
177
- - "func (c *Context) Untrack(class, id string) error {\n\tfullID := payload.BuildID(class,\
178
- \ id)\n\tlogger.Tracef(\"Calling untrack on payload context %q\", fullID)\n\n\t\
179
- res, err := c.api.Untrack(fullID)\n\tif err != nil {\n\t\treturn errors.Trace(err)\n\
180
- \t}\n\t// TODO(ericsnow) We should not ignore a 0-len result.\n\tif len(res) >\
181
- \ 0 && res[0].Error != nil {\n\t\treturn errors.Trace(res[0].Error)\n\t}\n\tdelete(c.payloads,\
182
- \ id)\n\n\treturn nil\n}"
183
- - source_sentence: /* PRIVATE
184
- sentences:
185
- - "void activate(ProtocolVersion helloVersion) throws IOException {\n if\
186
- \ (activeProtocols == null) {\n activeProtocols = getActiveProtocols();\n\
187
- \ }\n\n if (activeProtocols.collection().isEmpty() ||\n \
188
- \ activeProtocols.max.v == ProtocolVersion.NONE.v) {\n throw\
189
- \ new SSLHandshakeException(\n \"No appropriate protocol (protocol\
190
- \ is disabled or \" +\n \"cipher suites are inappropriate)\"\
191
- );\n }\n\n if (activeCipherSuites == null) {\n activeCipherSuites\
192
- \ = getActiveCipherSuites();\n }\n\n if (activeCipherSuites.collection().isEmpty())\
193
- \ {\n throw new SSLHandshakeException(\"No appropriate cipher suite\"\
194
- );\n }\n\n // temporary protocol version until the actual protocol\
195
- \ version\n // is negotiated in the Hello exchange. This affects the record\n\
196
- \ // version we sent with the ClientHello.\n if (!isInitialHandshake)\
197
- \ {\n protocolVersion = activeProtocolVersion;\n } else {\n\
198
- \ protocolVersion = activeProtocols.max;\n }\n\n if (helloVersion\
199
- \ == null || helloVersion.v == ProtocolVersion.NONE.v) {\n helloVersion\
200
- \ = activeProtocols.helloVersion;\n }\n\n // We accumulate digests\
201
- \ of the handshake messages so that\n // we can read/write CertificateVerify\
202
- \ and Finished messages,\n // getting assurance against some particular\
203
- \ active attacks.\n Set<String> localSupportedHashAlgorithms =\n \
204
- \ SignatureAndHashAlgorithm.getHashAlgorithmNames(\n getLocalSupportedSignAlgs());\n\
205
- \ handshakeHash = new HandshakeHash(!isClient, needCertVerify,\n \
206
- \ localSupportedHashAlgorithms);\n\n // Generate handshake input/output\
207
- \ stream.\n input = new HandshakeInStream(handshakeHash);\n if (conn\
208
- \ != null) {\n output = new HandshakeOutStream(protocolVersion, helloVersion,\n\
209
- \ handshakeHash, conn);\n conn.getAppInputStream().r.setHandshakeHash(handshakeHash);\n\
210
- \ conn.getAppInputStream().r.setHelloVersion(helloVersion);\n \
211
- \ conn.getAppOutputStream().r.setHelloVersion(helloVersion);\n }\
212
- \ else {\n output = new HandshakeOutStream(protocolVersion, helloVersion,\n\
213
- \ handshakeHash, engine);\n \
214
- \ engine.inputRecord.setHandshakeHash(handshakeHash);\n engine.inputRecord.setHelloVersion(helloVersion);\n\
215
- \ engine.outputRecord.setHelloVersion(helloVersion);\n }\n\n\
216
- \ // move state to activated\n state = -1;\n }"
217
- - "function _error(coreIndex, cores) {\n var errMsg =\n '[cpu-stats] Error:\
218
- \ Core \"' + coreIndex + '\" not found, use one of ' +\n '[0, ' + (cores -\
219
- \ 1) + '], ' +\n 'since your system has a total of ' + cores + ' cores.';\n\
220
- \ console.log(errMsg);\n}"
221
- - "function _drawLine(v0, v1, color) {\n var p = new Primitive();\n\n \
222
- \ p.vertices = [v0, v1];\n p.color = toColor(color);\n\n renderer.addPrimitive(p);\n\
223
- \ }"
224
  pipeline_tag: sentence-similarity
225
  library_name: sentence-transformers
 
 
 
 
 
 
 
 
 
 
 
 
226
  ---
 
227
 
228
- # SentenceTransformer based on Shuu12121/CodeModernBERT-Crow
229
-
230
- This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [Shuu12121/CodeModernBERT-Crow](https://huggingface.co/Shuu12121/CodeModernBERT-Crow). It maps sentences & paragraphs to a 768-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, text classification, clustering, and more.
231
-
232
- ## Model Details
233
-
234
- ### Model Description
235
- - **Model Type:** Sentence Transformer
236
- - **Base model:** [Shuu12121/CodeModernBERT-Crow](https://huggingface.co/Shuu12121/CodeModernBERT-Crow) <!-- at revision fa8af97f22c9bf631506435c994e724f82747e67 -->
237
- - **Maximum Sequence Length:** 1024 tokens
238
- - **Output Dimensionality:** 768 dimensions
239
- - **Similarity Function:** Cosine Similarity
240
- <!-- - **Training Dataset:** Unknown -->
241
- <!-- - **Language:** Unknown -->
242
- <!-- - **License:** Unknown -->
243
-
244
- ### Model Sources
245
-
246
- - **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
247
- - **Repository:** [Sentence Transformers on GitHub](https://github.com/UKPLab/sentence-transformers)
248
- - **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)
249
-
250
- ### Full Model Architecture
251
-
252
- ```
253
- SentenceTransformer(
254
- (0): Transformer({'max_seq_length': 1024, 'do_lower_case': False}) with Transformer model: ModernBertModel
255
- (1): Pooling({'word_embedding_dimension': 768, 'pooling_mode_cls_token': True, 'pooling_mode_mean_tokens': False, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False, 'pooling_mode_weightedmean_tokens': False, 'pooling_mode_lasttoken': False, 'include_prompt': True})
256
- )
257
- ```
258
-
259
- ## Usage
260
-
261
- ### Direct Usage (Sentence Transformers)
262
-
263
- First install the Sentence Transformers library:
264
-
265
- ```bash
266
- pip install -U sentence-transformers
267
- ```
268
-
269
- Then you can load this model and run inference.
270
- ```python
271
- from sentence_transformers import SentenceTransformer
272
-
273
- # Download from the 🤗 Hub
274
- model = SentenceTransformer("sentence_transformers_model_id")
275
- # Run inference
276
- sentences = [
277
- '/* PRIVATE',
278
- 'function _error(coreIndex, cores) {\n var errMsg =\n \'[cpu-stats] Error: Core "\' + coreIndex + \'" not found, use one of \' +\n \'[0, \' + (cores - 1) + \'], \' +\n \'since your system has a total of \' + cores + \' cores.\';\n console.log(errMsg);\n}',
279
- 'function _drawLine(v0, v1, color) {\n var p = new Primitive();\n\n p.vertices = [v0, v1];\n p.color = toColor(color);\n\n renderer.addPrimitive(p);\n }',
280
- ]
281
- embeddings = model.encode(sentences)
282
- print(embeddings.shape)
283
- # [3, 768]
284
-
285
- # Get the similarity scores for the embeddings
286
- similarities = model.similarity(embeddings, embeddings)
287
- print(similarities.shape)
288
- # [3, 3]
289
- ```
290
-
291
- <!--
292
- ### Direct Usage (Transformers)
293
-
294
- <details><summary>Click to see the direct usage in Transformers</summary>
295
 
296
- </details>
297
- -->
298
 
299
- <!--
300
- ### Downstream Usage (Sentence Transformers)
 
301
 
302
- You can finetune this model on your own dataset.
303
-
304
- <details><summary>Click to expand</summary>
305
-
306
- </details>
307
- -->
308
-
309
- <!--
310
- ### Out-of-Scope Use
311
-
312
- *List how the model may foreseeably be misused and address what users ought not to do with the model.*
313
- -->
314
-
315
- <!--
316
- ## Bias, Risks and Limitations
317
 
318
- *What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
319
- -->
320
 
321
- <!--
322
- ### Recommendations
323
 
324
- *What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
325
- -->
326
 
327
- ## Training Details
 
 
 
 
 
328
 
329
- ### Training Dataset
 
 
 
 
 
 
330
 
331
- #### Unnamed Dataset
332
 
333
- * Size: 2,022,217 training samples
334
- * Columns: <code>sentence_0</code>, <code>sentence_1</code>, and <code>label</code>
335
- * Approximate statistics based on the first 1000 samples:
336
- | | sentence_0 | sentence_1 | label |
337
- |:--------|:------------------------------------------------------------------------------------|:--------------------------------------------------------------------------------------|:--------------------------------------------------------------|
338
- | type | string | string | float |
339
- | details | <ul><li>min: 3 tokens</li><li>mean: 48.56 tokens</li><li>max: 1024 tokens</li></ul> | <ul><li>min: 30 tokens</li><li>mean: 171.79 tokens</li><li>max: 1024 tokens</li></ul> | <ul><li>min: 1.0</li><li>mean: 1.0</li><li>max: 1.0</li></ul> |
340
- * Samples:
341
- | sentence_0 | sentence_1 | label |
342
- |:------------------------------------------------------------------------------------------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:-----------------|
343
- | <code>// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise.</code> | <code>func (a *App) GetNodeID() string {<br> if a == nil || a.NodeID == nil {<br> return ""<br> }<br> return *a.NodeID<br>}</code> | <code>1.0</code> |
344
- | <code>// _NET_WM_STRUT_PARTIAL set</code> | <code>func WmStrutPartialSet(xu *xgbutil.XUtil, win xproto.Window,<br> struts *WmStrutPartial) error {<br><br> rawStruts := make([]uint, 12)<br> rawStruts[0] = struts.Left<br> rawStruts[1] = struts.Right<br> rawStruts[2] = struts.Top<br> rawStruts[3] = struts.Bottom<br> rawStruts[4] = struts.LeftStartY<br> rawStruts[5] = struts.LeftEndY<br> rawStruts[6] = struts.RightStartY<br> rawStruts[7] = struts.RightEndY<br> rawStruts[8] = struts.TopStartX<br> rawStruts[9] = struts.TopEndX<br> rawStruts[10] = struts.BottomStartX<br> rawStruts[11] = struts.BottomEndX<br><br> return xprop.ChangeProp32(xu, win, "_NET_WM_STRUT_PARTIAL", "CARDINAL",<br> rawStruts...)<br>}</code> | <code>1.0</code> |
345
- | <code>//GetQyAccessToken 获取access_token</code> | <code>func (ctx *Context) GetQyAccessToken() (accessToken string, err error) {<br> ctx.accessTokenLock.Lock()<br> defer ctx.accessTokenLock.Unlock()<br><br> accessTokenCacheKey := fmt.Sprintf("qy_access_token_%s", ctx.AppID)<br> val := ctx.Cache.Get(accessTokenCacheKey)<br> if val != nil {<br> accessToken = val.(string)<br> return<br> }<br><br> //从微信服务器获取<br> var resQyAccessToken ResQyAccessToken<br> resQyAccessToken, err = ctx.GetQyAccessTokenFromServer()<br> if err != nil {<br> return<br> }<br><br> accessToken = resQyAccessToken.AccessToken<br> return<br>}</code> | <code>1.0</code> |
346
- * Loss: [<code>MultipleNegativesRankingLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#multiplenegativesrankingloss) with these parameters:
347
- ```json
348
- {
349
- "scale": 20.0,
350
- "similarity_fct": "cos_sim"
351
- }
352
- ```
353
 
354
- ### Training Hyperparameters
355
- #### Non-Default Hyperparameters
356
 
357
- - `per_device_train_batch_size`: 256
358
- - `per_device_eval_batch_size`: 256
359
- - `num_train_epochs`: 5
360
- - `fp16`: True
361
- - `multi_dataset_batch_sampler`: round_robin
 
362
 
363
- #### All Hyperparameters
364
- <details><summary>Click to expand</summary>
 
 
 
 
 
365
 
366
- - `overwrite_output_dir`: False
367
- - `do_predict`: False
368
- - `eval_strategy`: no
369
- - `prediction_loss_only`: True
370
- - `per_device_train_batch_size`: 256
371
- - `per_device_eval_batch_size`: 256
372
- - `per_gpu_train_batch_size`: None
373
- - `per_gpu_eval_batch_size`: None
374
- - `gradient_accumulation_steps`: 1
375
- - `eval_accumulation_steps`: None
376
- - `torch_empty_cache_steps`: None
377
- - `learning_rate`: 5e-05
378
- - `weight_decay`: 0.0
379
- - `adam_beta1`: 0.9
380
- - `adam_beta2`: 0.999
381
- - `adam_epsilon`: 1e-08
382
- - `max_grad_norm`: 1
383
- - `num_train_epochs`: 5
384
- - `max_steps`: -1
385
- - `lr_scheduler_type`: linear
386
- - `lr_scheduler_kwargs`: {}
387
- - `warmup_ratio`: 0.0
388
- - `warmup_steps`: 0
389
- - `log_level`: passive
390
- - `log_level_replica`: warning
391
- - `log_on_each_node`: True
392
- - `logging_nan_inf_filter`: True
393
- - `save_safetensors`: True
394
- - `save_on_each_node`: False
395
- - `save_only_model`: False
396
- - `restore_callback_states_from_checkpoint`: False
397
- - `no_cuda`: False
398
- - `use_cpu`: False
399
- - `use_mps_device`: False
400
- - `seed`: 42
401
- - `data_seed`: None
402
- - `jit_mode_eval`: False
403
- - `use_ipex`: False
404
- - `bf16`: False
405
- - `fp16`: True
406
- - `fp16_opt_level`: O1
407
- - `half_precision_backend`: auto
408
- - `bf16_full_eval`: False
409
- - `fp16_full_eval`: False
410
- - `tf32`: None
411
- - `local_rank`: 0
412
- - `ddp_backend`: None
413
- - `tpu_num_cores`: None
414
- - `tpu_metrics_debug`: False
415
- - `debug`: []
416
- - `dataloader_drop_last`: False
417
- - `dataloader_num_workers`: 0
418
- - `dataloader_prefetch_factor`: None
419
- - `past_index`: -1
420
- - `disable_tqdm`: False
421
- - `remove_unused_columns`: True
422
- - `label_names`: None
423
- - `load_best_model_at_end`: False
424
- - `ignore_data_skip`: False
425
- - `fsdp`: []
426
- - `fsdp_min_num_params`: 0
427
- - `fsdp_config`: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
428
- - `tp_size`: 0
429
- - `fsdp_transformer_layer_cls_to_wrap`: None
430
- - `accelerator_config`: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
431
- - `deepspeed`: None
432
- - `label_smoothing_factor`: 0.0
433
- - `optim`: adamw_torch
434
- - `optim_args`: None
435
- - `adafactor`: False
436
- - `group_by_length`: False
437
- - `length_column_name`: length
438
- - `ddp_find_unused_parameters`: None
439
- - `ddp_bucket_cap_mb`: None
440
- - `ddp_broadcast_buffers`: False
441
- - `dataloader_pin_memory`: True
442
- - `dataloader_persistent_workers`: False
443
- - `skip_memory_metrics`: True
444
- - `use_legacy_prediction_loop`: False
445
- - `push_to_hub`: False
446
- - `resume_from_checkpoint`: None
447
- - `hub_model_id`: None
448
- - `hub_strategy`: every_save
449
- - `hub_private_repo`: None
450
- - `hub_always_push`: False
451
- - `gradient_checkpointing`: False
452
- - `gradient_checkpointing_kwargs`: None
453
- - `include_inputs_for_metrics`: False
454
- - `include_for_metrics`: []
455
- - `eval_do_concat_batches`: True
456
- - `fp16_backend`: auto
457
- - `push_to_hub_model_id`: None
458
- - `push_to_hub_organization`: None
459
- - `mp_parameters`:
460
- - `auto_find_batch_size`: False
461
- - `full_determinism`: False
462
- - `torchdynamo`: None
463
- - `ray_scope`: last
464
- - `ddp_timeout`: 1800
465
- - `torch_compile`: False
466
- - `torch_compile_backend`: None
467
- - `torch_compile_mode`: None
468
- - `include_tokens_per_second`: False
469
- - `include_num_input_tokens_seen`: False
470
- - `neftune_noise_alpha`: None
471
- - `optim_target_modules`: None
472
- - `batch_eval_metrics`: False
473
- - `eval_on_start`: False
474
- - `use_liger_kernel`: False
475
- - `eval_use_gather_object`: False
476
- - `average_tokens_across_devices`: False
477
- - `prompts`: None
478
- - `batch_sampler`: batch_sampler
479
- - `multi_dataset_batch_sampler`: round_robin
480
 
481
- </details>
482
 
483
- ### Training Logs
484
- | Epoch | Step | Training Loss |
485
- |:------:|:-----:|:-------------:|
486
- | 0.0633 | 500 | 0.8015 |
487
- | 0.1266 | 1000 | 0.1036 |
488
- | 0.1899 | 1500 | 0.0973 |
489
- | 0.2532 | 2000 | 0.0921 |
490
- | 0.3165 | 2500 | 0.0876 |
491
- | 0.3797 | 3000 | 0.0861 |
492
- | 0.4430 | 3500 | 0.0843 |
493
- | 0.5063 | 4000 | 0.0841 |
494
- | 0.5696 | 4500 | 0.0788 |
495
- | 0.6329 | 5000 | 0.0794 |
496
- | 0.6962 | 5500 | 0.0782 |
497
- | 0.7595 | 6000 | 0.077 |
498
- | 0.8228 | 6500 | 0.0749 |
499
- | 0.8861 | 7000 | 0.0749 |
500
- | 0.9494 | 7500 | 0.0724 |
501
- | 1.0127 | 8000 | 0.0658 |
502
- | 1.0759 | 8500 | 0.0385 |
503
- | 1.1392 | 9000 | 0.0381 |
504
- | 1.2025 | 9500 | 0.0383 |
505
- | 1.2658 | 10000 | 0.0381 |
506
- | 1.3291 | 10500 | 0.0382 |
507
- | 1.3924 | 11000 | 0.0384 |
508
- | 1.4557 | 11500 | 0.0384 |
509
- | 1.5190 | 12000 | 0.039 |
510
- | 1.5823 | 12500 | 0.0391 |
511
- | 1.6456 | 13000 | 0.0401 |
512
- | 1.7089 | 13500 | 0.0383 |
513
- | 1.7722 | 14000 | 0.0392 |
514
- | 1.8354 | 14500 | 0.0371 |
515
- | 1.8987 | 15000 | 0.0387 |
516
- | 1.9620 | 15500 | 0.0385 |
517
- | 2.0253 | 16000 | 0.0298 |
518
- | 2.0886 | 16500 | 0.0171 |
519
- | 2.1519 | 17000 | 0.0174 |
520
- | 2.2152 | 17500 | 0.0171 |
521
- | 2.2785 | 18000 | 0.0169 |
522
- | 2.3418 | 18500 | 0.0174 |
523
- | 2.4051 | 19000 | 0.0177 |
524
- | 2.4684 | 19500 | 0.0175 |
525
- | 2.5316 | 20000 | 0.0171 |
526
- | 2.5949 | 20500 | 0.017 |
527
- | 2.6582 | 21000 | 0.0172 |
528
- | 2.7215 | 21500 | 0.0178 |
529
- | 2.7848 | 22000 | 0.0167 |
530
- | 2.8481 | 22500 | 0.0176 |
531
- | 2.9114 | 23000 | 0.0175 |
532
- | 2.9747 | 23500 | 0.0178 |
533
- | 3.0380 | 24000 | 0.0129 |
534
- | 3.1013 | 24500 | 0.0099 |
535
- | 3.1646 | 25000 | 0.0097 |
536
- | 3.2278 | 25500 | 0.0097 |
537
- | 3.2911 | 26000 | 0.0101 |
538
- | 3.3544 | 26500 | 0.0098 |
539
- | 3.4177 | 27000 | 0.0099 |
540
- | 3.4810 | 27500 | 0.0096 |
541
- | 3.5443 | 28000 | 0.0095 |
542
- | 3.6076 | 28500 | 0.0094 |
543
- | 3.6709 | 29000 | 0.0097 |
544
- | 3.7342 | 29500 | 0.01 |
545
- | 3.7975 | 30000 | 0.0096 |
546
- | 3.8608 | 30500 | 0.0098 |
547
- | 3.9241 | 31000 | 0.0095 |
548
- | 3.9873 | 31500 | 0.0094 |
549
- | 4.0506 | 32000 | 0.0079 |
550
- | 4.1139 | 32500 | 0.0074 |
551
- | 4.1772 | 33000 | 0.0072 |
552
- | 4.2405 | 33500 | 0.0073 |
553
- | 4.3038 | 34000 | 0.0071 |
554
- | 4.3671 | 34500 | 0.0073 |
555
- | 4.4304 | 35000 | 0.007 |
556
- | 4.4937 | 35500 | 0.0072 |
557
- | 4.5570 | 36000 | 0.0071 |
558
- | 4.6203 | 36500 | 0.0071 |
559
- | 4.6835 | 37000 | 0.0072 |
560
- | 4.7468 | 37500 | 0.0072 |
561
- | 4.8101 | 38000 | 0.0069 |
562
- | 4.8734 | 38500 | 0.007 |
563
- | 4.9367 | 39000 | 0.007 |
564
- | 5.0 | 39500 | 0.007 |
565
 
 
 
 
 
 
 
 
566
 
567
- ### Framework Versions
568
- - Python: 3.11.11
569
- - Sentence Transformers: 3.4.1
570
- - Transformers: 4.51.3
571
- - PyTorch: 2.5.1+cu124
572
- - Accelerate: 1.3.0
573
- - Datasets: 3.5.0
574
- - Tokenizers: 0.21.0
575
 
576
- ## Citation
577
 
578
- ### BibTeX
579
 
580
- #### Sentence Transformers
581
- ```bibtex
582
- @inproceedings{reimers-2019-sentence-bert,
583
- title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
584
- author = "Reimers, Nils and Gurevych, Iryna",
585
- booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
586
- month = "11",
587
- year = "2019",
588
- publisher = "Association for Computational Linguistics",
589
- url = "https://arxiv.org/abs/1908.10084",
590
- }
591
- ```
592
 
593
- #### MultipleNegativesRankingLoss
594
- ```bibtex
595
- @misc{henderson2017efficient,
596
- title={Efficient Natural Language Response Suggestion for Smart Reply},
597
- author={Matthew Henderson and Rami Al-Rfou and Brian Strope and Yun-hsuan Sung and Laszlo Lukacs and Ruiqi Guo and Sanjiv Kumar and Balint Miklos and Ray Kurzweil},
598
- year={2017},
599
- eprint={1705.00652},
600
- archivePrefix={arXiv},
601
- primaryClass={cs.CL}
602
- }
603
  ```
604
 
605
- <!--
606
- ## Glossary
607
 
608
- *Clearly define terms in order to be accessible across audiences.*
609
- -->
610
 
611
- <!--
612
- ## Model Card Authors
 
613
 
614
- *Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
615
- -->
616
 
617
- <!--
618
- ## Model Card Contact
619
 
620
- *Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
621
- -->
 
1
  ---
2
  tags:
3
+ - code
4
+ - python
5
+ - php
6
+ - java
7
+ - javascript
8
+ - go
9
+ - ruby
10
+ - rust
11
  base_model: Shuu12121/CodeModernBERT-Crow
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  pipeline_tag: sentence-similarity
13
  library_name: sentence-transformers
14
+ license: apache-2.0
15
+ datasets:
16
+ - Shuu12121/python-codesearch-filtered
17
+ - Shuu12121/ruby-codesearch-filtered
18
+ - Shuu12121/java-codesearch-filtered
19
+ - Shuu12121/go-codesearch-filtered
20
+ - Shuu12121/rust-codesearch-filtered
21
+ - Shuu12121/javascript-codesearch-filtered
22
+ - Shuu12121/php-codesearch-filtered
23
+ - code-search-net/code_search_net
24
+ language:
25
+ - en
26
  ---
27
+ # Shuu12121/CodeSearch-ModernBERT-Crow-Plus-1.0 🐦‍⬛
28
 
29
+ このモデルは、`Shuu12121/CodeModernBERT-Crow` をベースにした Sentence Transformer モデルであり、**PHPとGoのクリーン版データセット**を新たに加えることで、さらに高精度な多言語コード検索を実現しています。
30
+ 本バージョン(1.0)では、前バージョン (`Crow-Plus`) に対して若干の性能向上が確認されています。
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31
 
32
+ > This is an enhanced version of `CodeSearch-ModernBERT-Crow-Plus`, based on `CodeModernBERT-Crow`, incorporating clean PHP and Go datasets for improved multilingual code search performance.
 
33
 
34
+ 開発者 (Developer): [Shuu12121](https://huggingface.co/Shuu12121)
35
+ ベースモデル (Base Model): [Shuu12121/CodeModernBERT-Crow](https://huggingface.co/Shuu12121/CodeModernBERT-Crow)
36
+ ライセンス (License): Apache-2.0
37
 
38
+ ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
39
 
40
+ ## 📊 評価 / Evaluation
 
41
 
42
+ 本モデルは、内部評価として MTEB (Massive Text Embedding Benchmark) 相当の環境でテストされ、
43
+ 前バージョンよりもさらに高い精度を達成しています。
44
 
45
+ ### **CodeSearchNetRetrieval (標準版) 成績**
 
46
 
47
+ | メトリクス | スコア |
48
+ |--------------------|-----------|
49
+ | **nDCG@10** | **0.8946** |
50
+ | Recall@10 | 0.9597 |
51
+ | MAP@10 | 0.8731 |
52
+ | MRR@10 | 0.8731 |
53
 
54
+ 詳細スコア(抜粋):
55
+ - `ndcg_at_1`: 0.8175
56
+ - `ndcg_at_3`: 0.8810
57
+ - `ndcg_at_5`: 0.8888
58
+ - `recall_at_20`: 0.9672
59
+ - `recall_at_100`: 0.9807
60
+ - `recall_at_1000`: 1.0
61
 
62
+ > 前バージョン (`Crow-Plus`) 比較で nDCG@10 がわずかに向上(+0.17pt)しており、より安定した高リコールが得られています。
63
 
64
+ ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
65
 
66
+ ### **COIRCodeSearchNetRetrieval 成績**
 
67
 
68
+ | メトリクス | スコア |
69
+ |--------------------|-----------|
70
+ | **nDCG@10** | **0.8001** |
71
+ | Recall@10 | 0.8806 |
72
+ | MAP@10 | 0.7742 |
73
+ | MRR@10 | 0.7742 |
74
 
75
+ 詳細スコア(抜粋):
76
+ - `ndcg_at_1`: 0.7168
77
+ - `ndcg_at_3`: 0.7775
78
+ - `ndcg_at_5`: 0.7896
79
+ - `recall_at_20`: 0.9057
80
+ - `recall_at_100`: 0.9495
81
+ - `recall_at_1000`: 0.9782
82
 
83
+ > こちらも、従来版より全体的に Recall 向上がみられ、特に Top-20、Top-100段階での検索精度に安定性が出ています。
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
84
 
85
+ ---
86
 
87
+ ## モデル変更点 / Improvements
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
88
 
89
+ | 項目 | Crow-Plus | Crow-Plus-1.0 |
90
+ |:---|:---|:---|
91
+ | 学習データ | 従来データセット | PHP・Goのクリーン版追加 |
92
+ | COIR nDCG@10 | 0.7988 | 0.8001 (+0.13pt) |
93
+ | CodeSearchNet nDCG@10 | 0.8930 | 0.8946 (+0.16pt) |
94
+ | Recall@10 | 0.9610 | 0.9597 (ほぼ同等) |
95
+ | 特徴 | 標準構成 | データ品質向上による安定化 |
96
 
97
+ - MTEB公式には提出していないため、**非公式記録**です。
 
 
 
 
 
 
 
98
 
 
99
 
100
+ ## 使い方 / How to Use
101
 
102
+ 従来と同様に、`sentence-transformers`ライブラリを用いて簡単に利用可能です。
103
+ (※詳しい使用例はベース版に準じますので省略)
 
 
 
 
 
 
 
 
 
 
104
 
105
+ ```python
106
+ from sentence_transformers import SentenceTransformer
107
+ model = SentenceTransformer("Shuu12121/CodeSearch-ModernBERT-Crow-Plus-1.0")
 
 
 
 
 
 
 
108
  ```
109
 
110
+ ---
 
111
 
112
+ ## 注意事項 / Limitations
 
113
 
114
+ - 関数レベルのコード検索に最適化されており、巨大なファイルや不完全コードには注意が必要です。
115
+ - クリーン版追加による改善はあくまで「一般傾向」であり、特定ドメインにおいては追加チューニングが効果的な場合もあります。
116
+ - 本バージョンの結果はMTEB公式には提出されていないため、**あくまで参考記録**である点にご留意ください。
117
 
118
+ ---
 
119
 
120
+ ## 連絡先 / Contact
 
121
 
122
+ ご質問・フィードバックは、開発者 [Shuu12121](https://huggingface.co/Shuu12121) までご連絡ください。
123
+ 📧 shun0212114@outlook.jp