mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-20 05:21:29 +07:00
ML in SE: Do not calculate cosine similarity for items not from semantic contributors anywhere except EAP builds
GitOrigin-RevId: ac6cb3f9ea441705b1b3f5e7bb104b51d9564902
This commit is contained in:
committed by
intellij-monorepo-bot
parent
73be146d26
commit
c8bd8198d4
@@ -11,6 +11,7 @@ import com.intellij.internal.statistic.eventLog.events.EventFields
|
||||
import com.intellij.internal.statistic.eventLog.events.EventPair
|
||||
import com.intellij.openapi.actionSystem.ActionManager
|
||||
import com.intellij.openapi.actionSystem.AnAction
|
||||
import com.intellij.openapi.application.ApplicationManager
|
||||
import com.intellij.openapi.progress.runBlockingMaybeCancellable
|
||||
import com.intellij.platform.ml.embeddings.search.services.ActionEmbeddingsStorage
|
||||
import com.intellij.platform.ml.embeddings.utils.generateEmbeddingBlocking
|
||||
@@ -66,7 +67,7 @@ internal class SearchEverywhereGeneralActionFeaturesProvider
|
||||
if (similarityScore != null) {
|
||||
data.add(SIMILARITY_SCORE.with(roundDouble(similarityScore!!)))
|
||||
}
|
||||
else {
|
||||
else if (ApplicationManager.getApplication().isEAP) { // for now, we can collect the data only from EAP builds
|
||||
val action = extractAction(element)
|
||||
val actionEmbedding = getActionEmbedding(action, valueName)
|
||||
val queryEmbedding = getQueryEmbedding(searchQuery, split = false)
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.intellij.internal.statistic.eventLog.events.EventPair
|
||||
import com.intellij.internal.statistic.local.LanguageUsageStatistics
|
||||
import com.intellij.lang.Language
|
||||
import com.intellij.lang.LanguageUtil
|
||||
import com.intellij.openapi.application.ApplicationManager
|
||||
import com.intellij.openapi.application.ReadAction
|
||||
import com.intellij.openapi.util.io.FileUtil
|
||||
import com.intellij.platform.ml.embeddings.utils.convertNameToNaturalLanguage
|
||||
@@ -78,7 +79,7 @@ internal class SearchEverywherePsiElementFeaturesProvider : SearchEverywhereElem
|
||||
if (similarityScore != null) {
|
||||
result.add(SIMILARITY_SCORE.with(roundDouble(similarityScore!!)))
|
||||
}
|
||||
else {
|
||||
else if (ApplicationManager.getApplication().isEAP) { // for now, we can collect the data only from EAP builds
|
||||
val elementName = getElementName(item)
|
||||
val elementEmbedding = elementName?.let { generateEmbeddingBlocking(convertNameToNaturalLanguage(it)) }
|
||||
val queryEmbedding = getQueryEmbedding(searchQuery, split = true)
|
||||
|
||||
Reference in New Issue
Block a user