[ml-completion] ML-2636 Integrate completion ranking model for new terminal

GitOrigin-RevId: 0ad89ea2de8595001d8697a5dc1d437dee89a0b6
This commit is contained in:
Alexey Kalina
2024-02-05 16:30:39 +01:00
committed by intellij-monorepo-bot
parent 1854279d75
commit 8d8e6176c5
7 changed files with 45 additions and 1 deletions

View File

@@ -1222,6 +1222,7 @@ object CommunityLibraryLicenses {
jetbrainsLibrary("completion-ranking-ruby-exp"), jetbrainsLibrary("completion-ranking-ruby-exp"),
jetbrainsLibrary("completion-ranking-rust-exp"), jetbrainsLibrary("completion-ranking-rust-exp"),
jetbrainsLibrary("completion-ranking-scala-exp"), jetbrainsLibrary("completion-ranking-scala-exp"),
jetbrainsLibrary("completion-ranking-sh-exp"),
jetbrainsLibrary("completion-ranking-swift-exp"), jetbrainsLibrary("completion-ranking-swift-exp"),
jetbrainsLibrary("completion-ranking-typescript-exp"), jetbrainsLibrary("completion-ranking-typescript-exp"),
jetbrainsLibrary("debugger-agent"), jetbrainsLibrary("debugger-agent"),

View File

@@ -299,5 +299,23 @@
</SOURCES> </SOURCES>
</library> </library>
</orderEntry> </orderEntry>
<orderEntry type="module-library">
<library name="completion-ranking-sh-exp" type="repository">
<properties include-transitive-deps="false" maven-id="org.jetbrains.intellij.deps.completion:completion-ranking-sh:0.0.1">
<verification>
<artifact url="file://$MAVEN_REPOSITORY$/org/jetbrains/intellij/deps/completion/completion-ranking-sh/0.0.1/completion-ranking-sh-0.0.1.jar">
<sha256sum>2ab8007555b8fdedb7efce607cc77c03da85fcf4ea2e8376b9a352bed5f04f4a</sha256sum>
</artifact>
</verification>
</properties>
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/intellij/deps/completion/completion-ranking-sh/0.0.1/completion-ranking-sh-0.0.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/intellij/deps/completion/completion-ranking-sh/0.0.1/completion-ranking-sh-0.0.1-sources.jar!/" />
</SOURCES>
</library>
</orderEntry>
</component> </component>
</module> </module>

View File

@@ -30,5 +30,6 @@
<completion.ml.model implementation="com.jetbrains.completion.ml.ranker.ExperimentCidrMLRankingProvider"/> <completion.ml.model implementation="com.jetbrains.completion.ml.ranker.ExperimentCidrMLRankingProvider"/>
<completion.ml.model implementation="com.jetbrains.completion.ml.ranker.ExperimentalHTMLMLRankingProvider"/> <completion.ml.model implementation="com.jetbrains.completion.ml.ranker.ExperimentalHTMLMLRankingProvider"/>
<completion.ml.model implementation="com.jetbrains.completion.ml.ranker.ExperimentalCSSMLRankingProvider"/> <completion.ml.model implementation="com.jetbrains.completion.ml.ranker.ExperimentalCSSMLRankingProvider"/>
<completion.ml.model implementation="com.jetbrains.completion.ml.ranker.ExperimentalShMLRankingProvider"/>
</extensions> </extensions>
</idea-plugin> </idea-plugin>

View File

@@ -13,3 +13,4 @@ ml.completion.experiment.model.swift=Swift
ml.completion.experiment.model.cidr=C/C++ ml.completion.experiment.model.cidr=C/C++
ml.completion.experiment.model.html=HTML ml.completion.experiment.model.html=HTML
ml.completion.experiment.model.css=CSS ml.completion.experiment.model.css=CSS
ml.completion.experiment.model.sh=Shell Script

View File

@@ -0,0 +1,14 @@
// Copyright 2000-2024 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.jetbrains.completion.ml.ranker
import com.intellij.completion.ml.ranker.ExperimentModelProvider
import com.intellij.internal.ml.catboost.CatBoostJarCompletionModelProvider
import com.intellij.lang.Language
class ExperimentalShMLRankingProvider : CatBoostJarCompletionModelProvider(
CompletionRankingModelsBundle.message("ml.completion.experiment.model.sh"), "sh_features_exp", "sh_model_exp"), ExperimentModelProvider {
override fun isLanguageSupported(language: Language): Boolean = language.id.compareTo("shell script", ignoreCase = true) == 0
override fun experimentGroupNumber(): Int = 13
}

View File

@@ -1,4 +1,4 @@
// Copyright 2000-2022 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. // Copyright 2000-2024 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.jetbrains.completion.ml.ranker package com.jetbrains.completion.ml.ranker
import org.junit.Test import org.junit.Test
@@ -51,4 +51,7 @@ class MetadataConsistencyTest {
@Test @Test
fun testCSSMetadata() = ExperimentalCSSMLRankingProvider().assertModelMetadataConsistent() fun testCSSMetadata() = ExperimentalCSSMLRankingProvider().assertModelMetadataConsistent()
@Test
fun testShMetadata() = ExperimentalShMLRankingProvider().assertModelMetadataConsistent()
} }

View File

@@ -219,6 +219,12 @@
"experimentBucketsCount": 4, "experimentBucketsCount": 4,
"includeGroups": [ 7, 22, 28, 24 ], "includeGroups": [ 7, 22, 28, 24 ],
"shouldLogElementFeatures": true "shouldLogElementFeatures": true
},
{
"id": "shell script",
"experimentBucketsCount": 4,
"includeGroups": [ 7, 12, 13 ],
"shouldLogElementFeatures": true
} }
] ]
} }