千帆大模型——自定义【知识库】——Embedding式数据

2023-11-22 12:48:17 浏览数 (1)

前言

自定义知识库是自己的库,在做企业信息咨询等应用的时候就会有很大的帮助,这里个人建议使用json数据来导入,数据稍微有些变化,是每行都是一个对象数据,搞成jsonl文件后缀再去上传即可,不然上传后也解析不了的。

创建步骤1、创建应用

这里直接创建一个应用就行,写个名字和用途,默认选择所有的服务。 

创建步骤2、知识库创建

创建的四个步骤:

这里我们选择默认的【Embedding】有这个能返回对应的分数值,看看那些最匹配,做的都是相似度查询。

创建步骤3、导入数据

数据格式有些特殊,注意自己的数据修改。

我这里准备好数据了,可以直接复制使用。

代码语言:javascript复制
{"id": 1, "title": "大唐政府", "skill_name": "为官之道", "skill_info": "基本技能,0-100级"}
{"id": 2, "title": "大唐政府", "skill_name": "嗜血", "skill_info": "制作临时符,为衣甲增添血气,0-100级"}
{"id": 3, "title": "大唐政府", "skill_name": "横扫千军", "skill_info": "攻击目标三次,下一轮休息,0-100级"}
{"id": 4, "title": "大唐政府", "skill_name": "后发制人", "skill_info": "临时提高防御和抵抗封印,下一轮提高伤害,先攻击目标,0-100级"}
{"id": 5, "title": "大唐政府", "skill_name": "破釜沉舟", "skill_info": "攻击多个目标,伤害逐一减少,0-79级"}
{"id": 6, "title": "大唐政府", "skill_name": "一击", "skill_info": "攻击目标,临时提高2轮速度,0-100级"}
{"id": 7, "title": "大唐政府", "skill_name": "万剑归宗", "skill_info": "攻击目标5-9次,气血越低,攻击次数越多。伤害是普通攻击的45%,无法保护。使用后休息一轮。"}
{"id": 8, "title": "化生寺", "skill_name": "小乘佛法", "skill_info": "化生寺基本技能"}
{"id": 9, "title": "化生寺", "skill_name": "唧唧歪歪", "skill_info": "法师攻击多个目标。玩家施法将屠刀附加到第一个目标概率上。"}
{"id": 10, "title": "化生寺", "skill_name": "达摩护体", "skill_info": "在战斗中提高已方多人的生命上限。"}
{"id": 11, "title": "化生寺", "skill_name": "金刚护体", "skill_info": "在战斗中增加友中的物理伤害和防御。"}
{"id": 12, "title": "化生寺", "skill_name": "年花妙指", "skill_info": "制作临时符,增加武器的治疗强度。"}
{"id": 13, "title": "化生寺", "skill_name": "我佛慈悲", "skill_info": "目标是在2轮内免疫一次死亡,免疫后恢复部分气血。"}
{"id": 14, "title": "化生寺", "skill_name": "推气过宫", "skill_info": "回复大量气血两个目标。"}
{"id": 15, "title": "方寸山", "skill_name": "神兵护法", "skill_info": "制作临时符,为头盔增加物理防御。0-100级"}
{"id": 16, "title": "方寸山", "skill_name": "黄庭经", "skill_info": "方寸山基本技能,永久增加封印命中。0-100级"}
{"id": 17, "title": "方寸山", "skill_name": "失心符", "skill_info": "方寸山单体减益技能,0-100级"}
{"id": 18, "title": "方寸山", "skill_name": "离魂符", "skill_info": "方寸山减益技能,目标混乱,命中率低,不分敌我攻击。药物不能解除混乱,0-100级"}
{"id": 19, "title": "方寸山", "skill_name": "五雷咒", "skill_info": "法术攻击多个目标。玩家施法会给第一个目标增加一个小概率的失心符。增加使用时的伤害,技能达到60级攻击4个目标,70级攻击5个目标,90级攻击6个目标。"}
{"id": 20, "title": "方寸山", "skill_name": "定身符", "skill_info": "目标物理和法术临时提高命中率,下一轮封印命中率降低,不能连续使用,0-100级"}
{"id": 21, "title": "方寸山", "skill_name": "失忆符", "skill_info": "让敌人的门派法术自动选择施法对象,与其他封印状态共存。使用后,提高5回合的阴命中率。0-100级"}
{"id": 22, "title": "方寸山", "skill_name": "虚幻咒语", "skill_info": "让自己进入5轮虚幻状态,避免每轮收到的第一次物法攻击,0-120级"}
{"id": 23, "title": "方寸山", "skill_name": "幻音古钟", "skill_info": "向当地五个目标释放随机咒语,首要目标必须中等,其他目标为基本命中率的30%。使用后休息一轮,2级"}
{"id": 24, "title": "女儿村", "skill_name": "飞花摘叶", "skill_info": "女儿村的输出技能,对首要目标的小概率附加微笑倾城状态。请注意,飞花摘叶引发的微笑倾城是单封的,而不是三封。"}
{"id": 25, "title": "女儿村", "skill_name": "一笑倾城", "skill_info": "女儿村三封法术,如果封印成功,封印状态将持续两轮。"}
{"id": 26, "title": "女儿村", "skill_name": "观心镜", "skill_info": "女儿村的单封法术,如果封印命中,封印状态将持续3轮。还有一个额外的状态。当技能被成功偷走时,使用观心镜的女儿村技能列表中的观心镜的位置将被偷走的技能所取代。被盗单位DEBUFF效果也会消失,只有封效果,所以观心镜一次只能偷一个技能。"}
{"id": 27, "title": "女儿村", "skill_name": "召唤花灵", "skill_info": "用单回合召唤一个四色花灵,如果不被杀死,可以有四回合,每回合结束给召唤者一个随机的花灵增益状态。"}
{"id": 28, "title": "女儿村", "skill_name": "镜花隐", "skill_info": "让自己在2轮内无法成为法术的首要目标。可以隐藏人物的失意、横扫、宠物力劈、壁垒、死亡等指向技能。"}
{"id": 29, "title": "女儿村", "skill_name": "递花魂", "skill_info": "治疗单一目标,并将花瓣传递给目标。"}
{"id": 30, "title": "女儿村", "skill_name": "镜花水月", "skill_info": "让自己全隐身一回合,隐身结束时50%/75%/100%的机会得到一片花瓣,使用后休息一回合。"}
{"id": 31, "title": "神木林", "skill_name": "落叶萧萧", "skill_info": "用法术攻击敌人的多个目标。攻击数量=技能等级/35"}
{"id": 32, "title": "神木林", "skill_name": "荆棘舞", "skill_info": "用法术攻击敌方单体目标,造成较高伤害。"}
{"id": 33, "title": "神木林", "skill_name": "尘刃", "skill_info": "用法术攻击敌方单位目标,使目标损失一定HP上限。"}
{"id": 34, "title": "神木林", "skill_name": "冰川愤怒", "skill_info": "用法术攻击敌方目标。攻击召唤兽时,目标有一定的冻结概率。"}
{"id": 35, "title": "神木林", "skill_name": "雾杀", "skill_info": "用法术攻击敌人的单一目标,对敌人造成持续的毒性伤害。"}
{"id": 36, "title": "神木林", "skill_name": "血雨", "skill_info": "消耗自己的气血,对敌人的单一目标造成很大的伤害。使用后,下一轮不能使用法术。"}
{"id": 37, "title": "神木林", "skill_name": "星月之惠", "skill_info": "回复自己HP。"}
{"id": 38, "title": "神木林", "skill_name": "炎症保护", "skill_info": "抵抗50%的气血损伤,每1点消耗1点MP。"}
{"id": 39, "title": "神木林", "skill_name": "叶隐", "skill_info": "平时用,可以瞬间回到自己的门派。"}
{"id": 40, "title": "神木林", "skill_name": "神木胡言", "skill_info": "临时增加鞋子的法术伤害结果。"}
{"id": 41, "title": "神木林", "skill_name": "蜜润", "skill_info": "增加了很多人的法术伤害。"}
{"id": 42, "title": "神木林", "skill_name": "蚂蚁蚀天", "skill_info": "克制凌波城弟子的必杀技。"}
{"id": 43, "title": "天机城", "skill_name": "破击", "skill_info": "努力一击,对目标造成固定伤害"}
{"id": 44, "title": "天机城", "skill_name": "匠心.削铁", "skill_info": "增加队友伤害"}
{"id": 45, "title": "天机城", "skill_name": "匠心.蓄锐", "skill_info": "治疗队友气血"}
{"id": 46, "title": "天机城", "skill_name": "天马星空", "skill_info": "回门派技能。"}
{"id": 47, "title": "天机城", "skill_name": "鬼斧神工", "skill_info": "临时符"}
{"id": 48, "title": "天机城", "skill_name": "移山填海", "skill_info": "克制花果山必杀技"}
{"id": 49, "title": "天机城", "skill_name": "针锋相对", "skill_info": "物理攻击目标,减少目标对非自身单位的伤害。"}
{"id": 50, "title": "天机城", "skill_name": "锋芒必露", "skill_info": "目标使用后,目标本回合的攻击操作强制以自己为目的。"}
{"id": 51, "title": "天机城", "skill_name": "攻防易位", "skill_info": "转换零件的属性。"}
{"id": 52, "title": "狮驼岭", "skill_name": "变身", "skill_info": "狮驼岭基本技能,变身状态下伤害增加。"}
{"id": 53, "title": "狮驼岭", "skill_name": "鹰击", "skill_info": "改变状态,攻击多个目标,下一轮休息。"}
{"id": 54, "title": "狮驼岭", "skill_name": "象形", "skill_info": "在变身状态下,攻击并密封目标,变身结束并休息一轮"}
{"id": 55, "title": "狮驼岭", "skill_name": "狮搏", "skill_info": "在变身状态下,忽略目标部分的防御攻击。"}
{"id": 56, "title": "狮驼岭", "skill_name": "魔术", "skill_info": "让目标继续恢复魔法。"}
{"id": 57, "title": "狮驼岭", "skill_name": "神力无穷", "skill_info": "创造临时符号,增加腰带的愤怒。"}
{"id": 58, "title": "狮驼岭", "skill_name": "逆势象形", "skill_info": "在气血低于最大值50%的情况下,在指定目标中使用象形。"}
{"id": 59, "title": "阴曹地府", "skill_name": "灵魂公式", "skill_info": "永久增加气血"}
{"id": 60, "title": "阴曹地府", "skill_name": "阎罗令", "skill_info": "增加使用时的伤害"}
{"id": 61, "title": "阴曹地府", "skill_name": "六轮", "skill_info": "提高使用效果,永久提高速度。"}
{"id": 62, "title": "阴曹地府", "skill_name": "尸腐毒", "skill_info": "增加伤害和回复效果,永久增加抵抗封印。"}
{"id": 63, "title": "阴曹地府", "skill_name": "鬼眼", "skill_info": "增强使用效果,永久增加速度"}
{"id": 64, "title": "阴曹地府", "skill_name": "尸气满天", "skill_info": "增加临时符效果,永久增加法术伤害。"}
{"id": 65, "title": "阴曹地府", "skill_name": "锁魂法官", "skill_info": "使目标4回合内无法复活。"}
{"id": 66, "title": "魔王寨", "skill_name": "氏族力量", "skill_info": "魔王寨基本技能"}
{"id": 67, "title": "魔王寨", "skill_name": "飞砂走石", "skill_info": "法术攻击多个目标,伤害结果会产生法术波动。"}
{"id": 68, "title": "魔王寨", "skill_name": "火焰印记", "skill_info": "随机召唤火焰印记,可分担一半角色的伤害。"}
{"id": 69, "title": "魔王寨", "skill_name": "守护标志", "skill_info": "随机召唤守护标志,可分担一半角色的伤害。"}
{"id": 70, "title": "魔王寨", "skill_name": "引火乘风", "skill_info": "借助风的力量,增益技能。"}
{"id": 71, "title": "魔王寨", "skill_name": "魔王降临", "skill_info": "附加魔王降临状态,法术暴击和法术波动下限持续上升。"}
{"id": 72, "title": "魔王寨", "skill_name": "祖先印记", "skill_info": "消耗两个普通印记,召唤一个祖先印记,最多召唤一个。"}
{"id": 73, "title": "魔王寨", "skill_name": "飞星流火", "skill_info": "唤天外陨石攻击随机敌人,使用后休息一回合。"}
{"id": 74, "title": "魔王寨", "skill_name": "三昧真火", "skill_info": "法术攻击单个目标,伤害结果会产生法术波动。"}
{"id": 75, "title": "盘丝洞", "skill_name": "盘丝舞", "skill_info": "能临时提高武器的防御效果,下线后效果消失"}
{"id": 76, "title": "盘丝洞", "skill_name": "蜘蛛丝", "skill_info": "是克制方寸山弟子的必杀技"}
{"id": 77, "title": "盘丝洞", "skill_name": "含情脉脉脉", "skill_info": "使对手在一定回合内无法使用物理攻击和法术"}
{"id": 78, "title": "盘丝洞", "skill_name": "瘴气", "skill_info": "在战斗中暂时降低对手的治疗效果"}
{"id": 79, "title": "盘丝洞", "skill_name": "魔音摄魂", "skill_info": "使对手在一定回合内无法恢复气血和疗伤"}
{"id": 80, "title": "盘丝洞", "skill_name": "复苏", "skill_info": "解除并避免天宫封法的影响"}
{"id": 81, "title": "盘丝洞", "skill_name": "天罗地网", "skill_info": "每次攻击都有一定的机会使对手在一定回合内无法使用物理攻击。"}
{"id": 82, "title": "盘丝洞", "skill_name": "姐妹同心", "skill_info": "可以减少对手的魔法值。"}
{"id": 83, "title": "盘丝洞", "skill_name": "幻镜", "skill_info": "一些法术攻击将在持续状态下转移到对方的随机队员。"}
{"id": 84, "title": "无底洞", "skill_name": "移魂化骨", "skill_info": "消耗自身气血,使目标达到吸血效果。"}
{"id": 85, "title": "无底洞", "skill_name": "夺魄令", "skill_info": "使目标在一定回合内无法使用法术。"}
{"id": 86, "title": "无底洞", "skill_name": "邪气诀", "skill_info": "目标不能在回合内部分行动,目标不会受到攻击。"}
{"id": 87, "title": "无底洞", "skill_name": "惊魂掌", "skill_info": "使用后使对手在连续回合内无法受到他人的保护。"}
{"id": 88, "title": "无底洞", "skill_name": "摧心术", "skill_info": "降低敌人两个目标的速度,持续一定回合。"}
{"id": 89, "title": "无底洞", "skill_name": "明光宝烛", "skill_info": "本人多人必须在回合内承受的物理伤害结果减少"}
{"id": 90, "title": "无底洞", "skill_name": "金身舍利", "skill_info": "减少多人在回合内承受的法术伤害。"}
{"id": 91, "title": "无底洞", "skill_name": "万木枯萎", "skill_info": "克制神木林弟子的技能。"}
{"id": 92, "title": "无底洞", "skill_name": "藏地术", "skill_info": "平时用,可以瞬间回到自己的门派。"}
{"id": 93, "title": "无底洞", "skill_name": "杀人咒", "skill_info": "用固定伤害攻击对方多次NPC"}
{"id": 94, "title": "女魃墓", "skill_name": "净世黄火", "skill_info": "牺牲怨灵,恢复气血,缓解异常状态"}
{"id": 95, "title": "女魃墓", "skill_name": "焚魔火焰", "skill_info": "牺牲一个怨灵,对三个单位造成伤害。"}
{"id": 96, "title": "女魃墓", "skill_name": "唤灵·魂火", "skill_info": "召唤(技能等级/125"}
{"id": 97, "title": "女魃墓", "skill_name": "唤魔·堕羽", "skill_info": "牺牲两个怨灵,召唤一个魔"}
{"id": 98, "title": "女魃墓", "skill_name": "唤灵·毒魅", "skill_info": "牺牲召唤兽,召唤魔鬼。"}
{"id": 99, "title": "女魃墓", "skill_name": "唤灵·焚魂", "skill_info": "牺牲召唤兽,召唤六个怨灵。"}
{"id": 100, "title": "女魃墓", "skill_name": "天魔觉醒", "skill_info": "将吸收目标的诅咒转化为魔魔。"}
{"id": 101, "title": "女魃墓", "skill_name": "神秘毒药的束缚", "skill_info": "减少目标造成的伤害和治疗。"}
{"id": 102, "title": "女魃墓", "skill_name": "诡蝙蝠的刑罚", "skill_info": "当目标受到伤害时,它们会被反噬。"}
{"id": 103, "title": "女魃墓", "skill_name": "炽火流离", "skill_info": "伤害单个地方目标,恢复自己的生命;"}
{"id": 104, "title": "女魃墓", "skill_name": "极天炼焰", "skill_info": "克制天机城门派的必杀技。"}
{"id": 105, "title": "五庄观", "skill_name": "周易学", "skill_info": "按技能等级提高MP上限"}
{"id": 106, "title": "五庄观", "skill_name": "潇湘仙雨", "skill_info": "按技能等级提高伤害"}
{"id": 107, "title": "五庄观", "skill_name": "乾坤袖", "skill_info": "包含法术日月乾坤,天地同寿,乾坤妙法。日月乾坤的作用令对手一定回合内无法行动,与怪物战斗中若对方均中此法术则战斗胜利,与玩家对战时类似普通封类法术,是五庄观的主封技能。"}
{"id": 108, "title": "五庄观", "skill_name": "修仙术", "skill_info": "包含炼气化神,生命之泉,太极化生技能"}
{"id": 109, "title": "五庄观", "skill_name": "混元道果", "skill_info": "按技能等级提高灵力"}
{"id": 110, "title": "五庄观", "skill_name": "明性修身", "skill_info": "按技能等级提高防御能力"}
{"id": 111, "title": "五庄观", "skill_name": "七星藏", "skill_info": "按技能等级提高躲避能力"}
{"id": 112, "title": "普陀山", "skill_name": "灵性", "skill_info": "根据技能水平提高灵力"}
{"id": 113, "title": "普陀山", "skill_name": "护法金刚", "skill_info": "根据技能等级提高伤害"}
{"id": 114, "title": "普陀山", "skill_name": "观音咒", "skill_info": "一定回合内减少对方的气血和气血上限。"}
{"id": 115, "title": "普陀山", "skill_name": "五行学说", "skill_info": "日光华,靛沧海,巨岩破,苍茫树,地裂火,施展法术攻击单人,效果由技能等级决定,不受双方灵力影响,对方防御属性为克制属性时同时降低气血上限;对普通怪物(不包括玩家、召唤兽和BOSS级怪物))的伤害有增强效果;如果目标为NPC,则作用多人。"}
{"id": 116, "title": "普陀山", "skill_name": "金刚经", "skill_info": "为队友临时增加灵力。"}
{"id": 117, "title": "普陀山", "skill_name": "五行扭转", "skill_info": "按技能等级提高防御能力"}
{"id": 118, "title": "普陀山", "skill_name": "莲花宝座", "skill_info": "根据技能等级提高躲避能力"}
{"id": 119, "title": "普陀山", "skill_name": "杨柳甘露", "skill_info": "使用后可复活已死队友"}
{"id": 120, "title": "普陀山", "skill_name": "魔咒", "skill_info": "在一定回合内减少对方的气血上限"}
{"id": 121, "title": "普陀山", "skill_name": "灵动九天", "skill_info": "临时为队友增加灵力"}
{"id": 122, "title": "天宫", "skill_name": "天刚气", "skill_info": "按技能等级提高伤害"}
{"id": 123, "title": "天宫", "skill_name": "傲世诀", "skill_info": "按技能等级提高HP上限"}
{"id": 124, "title": "天宫", "skill_name": "清明自由", "skill_info": "按技能等级提高灵力"}
{"id": 125, "title": "天宫", "skill_name": "宁气公式", "skill_info": "按技能等级提高防御能力"}
{"id": 126, "title": "天宫", "skill_name": "乾坤塔", "skill_info": "学习后没有任何附加属性效果,其下包含的法术技能是镇妖,错乱,掌心雷。"}
{"id": 127, "title": "天宫", "skill_name": "混天术", "skill_info": "学习后没有任何附加属性效果,其下包含的法术技能是百万神兵,金刚镯,天雷灌注。"}
{"id": 128, "title": "天宫", "skill_name": "云霄步", "skill_info": "按技能等级提高躲避能力"}
{"id": 129, "title": "龙宫", "skill_name": "九龙决", "skill_info": "按技能等级提高灵力"}
{"id": 130, "title": "龙宫", "skill_name": "破浪决", "skill_info": "按技能等级提高伤害"}
{"id": 131, "title": "龙宫", "skill_name": "呼风唤雨", "skill_info": "龙宫主要群秒技能,对敌方2个目标(技能1级)/3"}
{"id": 132, "title": "龙宫", "skill_name": "龙腾", "skill_info": "龙宫单体点杀技能,对单个目标造成较高伤害。二龙戏珠,飞升后技能,对2个目标造成较高伤害,适合点杀同时守尸。"}
{"id": 133, "title": "龙宫", "skill_name": "逆鳞", "skill_info": "按技能等级提高防御能力"}
{"id": 134, "title": "龙宫", "skill_name": "游龙", "skill_info": "根据技能等级提高躲避率"}
{"id": 135, "title": "龙宫", "skill_name": "龙附", "skill_info": "为武器附加龙附技能等级相同的临时伤害。"}
{"id": 136, "title": "凌波城", "skill_name": "天地无极", "skill_info": "进入战斗获得2点战意,用于发动门派法术。战意点数会增加你的伤害。"}
{"id": 137, "title": "凌波城", "skill_name": "九转玄功", "skill_info": "包含法术不动如山。"}
{"id": 138, "title": "凌波城", "skill_name": "武神显圣", "skill_info": "包含法术碎星诀,镇魂诀。"}
{"id": 139, "title": "凌波城", "skill_name": "潇傲", "skill_info": "按技能等级提高灵力。"}
{"id": 140, "title": "凌波城", "skill_name": "气吞山河", "skill_info": "按技能等级提高伤害"}
{"id": 141, "title": "凌波城", "skill_name": "朱魔", "skill_info": "按技能等级提高防御能力"}
{"id": 142, "title": "凌波城", "skill_name": "法天象地", "skill_info": "按技能等级提高命中率"}
{"id": 143, "title": "花果山", "skill_name": "神通广泛", "skill_info": "花果山弟子在每轮开始时,只能使用三个随机的如意神通。"}
{"id": 144, "title": "花果山", "skill_name": "如意金箍", "skill_info": "按技能等级提高伤害"}
{"id": 145, "title": "花果山", "skill_name": "齐天逞胜", "skill_info": "包含九幽除名,回合结束若处于死亡状态,有一定几率复活,无视锢魂术。成功率受技能等级影响,需要“齐天逞胜”技能达到1级,消耗75点魔法。"}
{"id": 146, "title": "花果山", "skill_name": "金刚之躯", "skill_info": "按技能提高防御能力"}
{"id": 147, "title": "花果山", "skill_name": "灵猴九窍", "skill_info": "按技能等级提高命中率"}
{"id": 148, "title": "花果山", "skill_name": "七十二变", "skill_info": "按技能等级提高法伤合法防范"}
{"id": 149, "title": "花果山", "skill_name": "腾云驾雾", "skill_info": "腾云驾雾是一种能让人物驾驭云雾飞行的神秘能力。使用此技能后,玩家可以在空中疾驰,加快寻路速度。"}

创建成一个jsonl文件,这里不是json,一定要注意啊。

上传它。

创建步骤4、清洗配置

这里看自己的数据来决定清洗方式啊。

创建步骤5、创建主索引

这里需要注意一下分词的使用,做相似度查询,肯定需要使用到技能信息,所以我这里拆分了一下。

等待结果:

结果呈现:

数据量是8k,成功后我们需要进行具体的测试。

命中测试:

这里我们主要使用的是技能介绍的分词,故而匹配度不高,我们可以使用技能介绍再搜索一下。

使用技能介绍的词语就会很准确了,所以我们处理分词的时候需要根据自己数据的格式来做分析。

总结

这里我单独看了一下数据存储是否需要费用,没看到,说明保存数据是没有问题的,免费啊,哈哈,大家都可以试试,相当于一个向量数据来使用。

0 人点赞