From 6f44ec0ad90baf5c85b6afcbe55dadf04b22bb54 Mon Sep 17 00:00:00 2001 From: Haibin <1400012807@pku.edu.cn> Date: Tue, 17 Dec 2024 15:22:05 +0800 Subject: [PATCH] for test --- data_juicer/ops/mapper/query_intent_detection_mapper.py | 1 + tests/ops/mapper/test_query_intent_detection_mapper.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/data_juicer/ops/mapper/query_intent_detection_mapper.py b/data_juicer/ops/mapper/query_intent_detection_mapper.py index badc7f49..4c24ebd2 100644 --- a/data_juicer/ops/mapper/query_intent_detection_mapper.py +++ b/data_juicer/ops/mapper/query_intent_detection_mapper.py @@ -76,6 +76,7 @@ def process_batched(self, samples, rank=None): self.use_cuda()) results = translater(queries) queries = [item['translation_text'] for item in results] + print(queries) classifier, _ = get_model(self.model_key, rank, self.use_cuda()) results = classifier(queries) diff --git a/tests/ops/mapper/test_query_intent_detection_mapper.py b/tests/ops/mapper/test_query_intent_detection_mapper.py index 8033c4e2..2273c1a0 100644 --- a/tests/ops/mapper/test_query_intent_detection_mapper.py +++ b/tests/ops/mapper/test_query_intent_detection_mapper.py @@ -29,9 +29,9 @@ def test_default(self): samples = [{ 'query': '这样好吗?' },{ - 'query': '把那只笔递给我。' + 'query': '站住!' },{ - 'query': '难道不是这样的吗?' + 'query': '今天阳光灿烂。' } ] targets = [1, 0, -1]