Skip to content

Commit

Permalink
add more test
Browse files Browse the repository at this point in the history
  • Loading branch information
BeachWang committed Dec 17, 2024
1 parent 324467f commit 4a3ad39
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
2 changes: 2 additions & 0 deletions data_juicer/ops/mapper/dialog_intent_detection_mapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ def __init__(self,
Initialization method.
:param api_model: API model name.
:param intent_candidates: The output intent candidates. Use the
intent labels of the open domain if it is None.
:param max_round: The max num of round in the dialog to build the
prompt.
:param api_endpoint: URL endpoint for the API.
Expand Down
29 changes: 29 additions & 0 deletions tests/ops/mapper/test_dialog_intent_detection_mapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,35 @@ def test_query(self):
max_round=1)
self._run_op(op, samples, 4)

def test_intent_candidates(self):

samples = [{
'history': [
(
'李莲花有口皆碑',
'「微笑」过奖了,我也就是个普通大夫,没什么值得夸耀的。'
),
(
'是的,你确实是一个普通大夫,没什么值得夸耀的。',
'「委屈」你这话说的,我也是尽心尽力治病救人了。'
),
(
'你自己说的呀,我现在说了,你又不高兴了。',
'or of of of of or or and or of of of of of of of,,, '
),
(
'你在说什么我听不懂。',
'「委屈」我也没说什么呀,就是觉得你有点冤枉我了'
)
]
}]

op = DialogIntentDetectionMapper(
api_model='qwen2.5-72b-instruct',
intent_candidates=['评价', '讽刺', '表达困惑']
)
self._run_op(op, samples, 4)


if __name__ == '__main__':
unittest.main()

0 comments on commit 4a3ad39

Please sign in to comment.