fix(bridge): 商品链接兜底与强制检索
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
'use strict';
|
||||
|
||||
const test = require('node:test');
|
||||
const assert = require('node:assert/strict');
|
||||
const { quickClassify, INTENTS } = require('../src/intent');
|
||||
|
||||
test('intent: bare product category word is a product search', () => {
|
||||
for (const q of ['戒指', '项链', '耳环', '手链', '珠宝', 'rings', 'necklace', 'earrings', 'oorbellen', 'halskette']) {
|
||||
assert.equal(quickClassify(q), INTENTS.PRODUCT_SEARCH, q);
|
||||
}
|
||||
});
|
||||
|
||||
test('intent: product noun inside a sentence is a product search', () => {
|
||||
assert.equal(quickClassify('有没有不锈钢戒指'), INTENTS.PRODUCT_SEARCH);
|
||||
assert.equal(quickClassify('do you sell stainless steel rings'), INTENTS.PRODUCT_SEARCH);
|
||||
});
|
||||
|
||||
test('intent: other intents keep priority', () => {
|
||||
assert.equal(quickClassify('我的订单到哪了'), INTENTS.ORDER_TRACKING);
|
||||
assert.equal(quickClassify('我要转人工'), INTENTS.ESCALATE);
|
||||
assert.equal(quickClassify('怎么退货'), INTENTS.POLICY_FAQ);
|
||||
assert.equal(quickClassify('你好'), INTENTS.GENERAL);
|
||||
});
|
||||
Reference in New Issue
Block a user