async function generateContent() {
const sentences = [
"芜湖公司变更是怎样的流程?",
"芜湖公司注销需要多长时间?",
"如何在芜湖注册公司?",
"芜湖公司注册的费用是多少?",
"怎样办理芜湖公司注册手续?",
"芜湖公司注册需要哪些材料?",
"在芜湖注册公司有哪些注意事项?",
"注册公司需要注意哪些费用?",
"在芜湖注册公司可以享受哪些政策支持?",
"芜湖公司登记事项有哪些?"
];
const model = await use.load();
const embeddings = await model.embed(sentences);
const embeddingsArray = await embeddings.array();
const keywords = ['芜湖公司变更', '芜湖公司注销', '芜湖公司注册'];
const content = [];
for (let i = 0; i < embeddingsArray.length; i++) {
const embedding = embeddingsArray[i];
let maxSimilarity = 0;
let keyIndex = -1;
for (let j = 0; j < embedding.length; j++) {
const similarity = dotProduct(embedding, embeddingsArray[keywords.indexOf(keywords[j])]);
if (similarity > maxSimilarity) {
maxSimilarity = similarity;
keyIndex = j;
}
}
if (keyIndex !== -1) {
content.push(sentences[i]);
}
}
document.getElementById('content').innerHTML = `
${content.join('

')}`;
}
function dotProduct(array1, array2) {
let product = 0;
for (let i = 0; i < array1.length; i++) {
product += array1[i] * array2[i];
}
return product;
}
generateContent();

相关产品:芜湖公司变更 , 芜湖公司注销 , 芜湖公司注册
所属分类:
中国商务服务网 /
其他咨询本页链接:https://product.11467.com/info/25157682.htm