Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#6411: Add Rust ranking provider based on CatBoost model
- Loading branch information
1 parent
1048244
commit 7585297
Showing
4 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
ml-completion/src/main/kotlin/org/rust/ml/RustMLRankingProvider.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/* | ||
* Use of this source code is governed by the MIT license that can be | ||
* found in the LICENSE file. | ||
*/ | ||
|
||
package org.rust.ml | ||
|
||
import com.intellij.internal.ml.catboost.CatBoostJarCompletionModelProvider | ||
import com.intellij.lang.Language | ||
import org.rust.lang.RsLanguage | ||
|
||
@Suppress("UnstableApiUsage") | ||
class RustMLRankingProvider : CatBoostJarCompletionModelProvider("Rust", "rust_features", "rust_model") { | ||
override fun isLanguageSupported(language: Language): Boolean = language == RsLanguage | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
ml-completion/src/test/kotlin/org/rust/ml/RustModelMetadataConsistencyTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* | ||
* Use of this source code is governed by the MIT license that can be | ||
* found in the LICENSE file. | ||
*/ | ||
|
||
package org.rust.ml | ||
|
||
import org.junit.Test | ||
|
||
/* | ||
* Use of this source code is governed by the MIT license that can be | ||
* found in the LICENSE file. | ||
*/ | ||
|
||
class RustModelMetadataConsistencyTest { | ||
@Test | ||
fun `test model metadata consistency`() = RustMLRankingProvider().assertModelMetadataConsistent() | ||
} |