mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-14 18:05:27 +07:00
[ai-completion] ML-3769 use relaxed match as a secondary metric in reports
GitOrigin-RevId: a627b2db311d143beff96c388f0b67505910dbdb
This commit is contained in:
committed by
intellij-monorepo-bot
parent
5df70be0ba
commit
28f446816d
@@ -90,7 +90,7 @@ abstract class BaseRelaxedMetric(showByDefault: Boolean) : LineSimularityMetric(
|
||||
override fun computeExpected(lookup: Lookup, expectedText: String): Double = RelaxedSimilarityUtils.RelaxedResult.MULTI.weight
|
||||
}
|
||||
|
||||
class RelaxedExactMatchOnlyAlphanum(showByDefault: Boolean) : BaseRelaxedMetric(showByDefault) {
|
||||
class RelaxedExactMatchOnlyAlphanum(showByDefault: Boolean = false) : BaseRelaxedMetric(showByDefault) {
|
||||
override val name: String = "Relaxed alphanumeric-only exact match"
|
||||
override val description: String =
|
||||
"Checks that for any the suggested lines of the completion, at least one of the lines from middle matches it."
|
||||
@@ -101,7 +101,7 @@ class RelaxedExactMatchOnlyAlphanum(showByDefault: Boolean) : BaseRelaxedMetric(
|
||||
/**
|
||||
* Note that the default threshold value is picked experimenatlly.
|
||||
*/
|
||||
class RelaxedEditDistanceOnlyAlphanum(showByDefault: Boolean, threshold: Double = 0.767) : BaseRelaxedMetric(showByDefault) {
|
||||
class RelaxedEditDistanceOnlyAlphanum(showByDefault: Boolean = false, threshold: Double = 0.767) : BaseRelaxedMetric(showByDefault) {
|
||||
override val name: String = "Relaxed alphanumeric-only edit distance"
|
||||
override val description: String =
|
||||
"Checks that for any the suggested lines of the completion, there is a line from middle that has a normalized edit distance less than $threshold."
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
package com.intellij.cce.report
|
||||
|
||||
import com.intellij.cce.core.Session
|
||||
import com.intellij.cce.metric.CharFScore
|
||||
import com.intellij.cce.metric.CharFScoreFirstLine
|
||||
import com.intellij.cce.metric.Metric
|
||||
import com.intellij.cce.metric.RelaxedExactMatchOnlyAlphanum
|
||||
import com.intellij.cce.metric.TotalLatencyMetric
|
||||
import com.intellij.cce.workspace.storages.FeaturesStorage
|
||||
import kotlinx.html.*
|
||||
@@ -56,6 +56,6 @@ class MultiLineFileReportGenerator(
|
||||
private val PRIMARY_METRIC = CharFScoreFirstLine()
|
||||
private const val PRIMARY_COLORING_SCALER = 120
|
||||
|
||||
private val SECONDARY_METRIC = CharFScore()
|
||||
private val SECONDARY_METRIC = RelaxedExactMatchOnlyAlphanum()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user