No public description

PiperOrigin-RevId: 551914786
This commit is contained in:
MediaPipe Team 2023-07-28 12:03:14 -07:00 committed by Copybara-Service
parent 9edb059d9f
commit 3f7752561b
2 changed files with 3 additions and 3 deletions

View File

@ -140,7 +140,7 @@ public class TextEmbedderTest {
TextEmbedder.cosineSimilarity(
result0.embeddingResult().embeddings().get(0),
result1.embeddingResult().embeddings().get(0));
assertThat(similarity).isWithin(DOUBLE_DIFF_TOLERANCE).of(0.3477488707202946);
assertThat(similarity).isWithin(DOUBLE_DIFF_TOLERANCE).of(0.3565317439544432);
}
@Test

View File

@ -37,7 +37,7 @@ _TEST_DATA_DIR = 'mediapipe/tasks/testdata/text'
# Tolerance for embedding vector coordinate values.
_EPSILON = 1e-4
# Tolerance for cosine similarity evaluation.
_SIMILARITY_TOLERANCE = 1e-6
_SIMILARITY_TOLERANCE = 1e-3
class ModelFileType(enum.Enum):
@ -287,7 +287,7 @@ class TextEmbedderTest(parameterized.TestCase):
@parameterized.parameters(
# TODO: The similarity should likely be lower
(_BERT_MODEL_FILE, 0.980880),
(_BERT_MODEL_FILE, 0.98077),
(_USE_MODEL_FILE, 0.780334),
)
def test_embed_with_different_themes(self, model_file, expected_similarity):