当前位置: 首页 > news >正文

成安企业做网站推广成都官网seo服务

成安企业做网站推广,成都官网seo服务,怎么给自己的品牌做网站,app优化网站建设一、AI知识库 将已知的问答知识,问题和答案转变成向量存储在向量数据库,在查找答案时,输入问题,将问题向量化,匹配向量库的问题,将向量相似度最高的问题筛选出来,将答案提交。 二、腾讯云向量数…

一、AI知识库

将已知的问答知识,问题和答案转变成向量存储在向量数据库,在查找答案时,输入问题,将问题向量化,匹配向量库的问题,将向量相似度最高的问题筛选出来,将答案提交。

二、腾讯云向量数据库

向量数据库_大模型知识库_向量数据存储_向量数据检索- 腾讯云

腾讯云向量数据库(Tencent Cloud VectorDB)是一款全托管的自研企业级分布式数据库服务,专用于存储、检索、分析多维向量数据。该数据库支持多种索引类型和相似度计算方法,单索引支持千亿级向量规模,可支持百万级 QPS 及毫秒级查询延迟。腾讯云向量数据库不仅能为大模型提供外部知识库,提高大模型回答的准确性,还可广泛应用于推荐系统、自然语言处理等 AI 领域。

三、使用教程(java)

1、项目引用依赖
        <!--腾讯云向量数据库使用--><dependency><groupId>com.tencent.tcvectordb</groupId><artifactId>vectordatabase-sdk-java</artifactId><version>1.2.0</version></dependency>
2、application.properties 配置
#向量数据库地址-购买服务器后,获取到外网访问域名,账号密码
vectordb.url=${VECTORDB_URL:http://xxxxxxxxx.com:10000}
vectordb.user=${VECTORDB_USER:root}
vectordb.key=${VECTORDB_KEY:123456}
3、初始化客户端
import com.tencent.tcvectordb.client.VectorDBClient;
import com.tencent.tcvectordb.model.param.database.ConnectParam;
import com.tencent.tcvectordb.model.param.enums.ReadConsistencyEnum;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;@Component
public class InitVectorClient {@Value("${vectordb.url:}")private String vdbUrl;@Value("${vectordb.user:}")private String vdbUser;@Value("${vectordb.key:}")private String  vdbKey;@Beanpublic VectorDBClient vdbClient(){ConnectParam connectParam = ConnectParam.newBuilder().withUrl(vdbUrl).withUsername(vdbUser).withKey(vdbKey).withTimeout(30).build();VectorDBClient client = new VectorDBClient(connectParam, ReadConsistencyEnum.EVENTUAL_CONSISTENCY);return client;}}
4、创建表结构

这里使用HTTP的方式

curl --location --request POST 'xxxxx.com:10000/database/create' \
--header 'Authorization: Bearer account=root&api_key=123456' \
--header 'Content-Type: application/json' \
--data-raw '{"database": "db_xiaosi"
}'curl --location --request POST 'xxxxx.com:10000/collection/create' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer account=root&api_key=123456' \
--data-raw '{"database": "db_xiaosi","collection": "t_bug","replicaNum": 0,"shardNum": 1,"description": "BUG表关键字向量","indexes": [{"fieldName": "id","fieldType": "string","indexType": "primaryKey"},{"fieldName": "bug_name","fieldType": "string","indexType": "filter"},{"fieldName": "is_deleted","fieldType": "uint64","indexType": "filter"},{"fieldName": "vector","fieldType": "vector","indexType": "HNSW","dimension": 1536,"metricType": "COSINE","params": {"M": 16,"efConstruction": 200}}]
}'
5、封装http请求类
package com.ikscrm.platform.api.manager.bug;import cn.hutool.core.date.DateUtil;
import com.ikscrm.platform.api.dao.vector.BugVector;
import com.tencent.tcvectordb.client.VectorDBClient;
import com.tencent.tcvectordb.model.Collection;
import com.tencent.tcvectordb.model.Database;
import com.tencent.tcvectordb.model.DocField;
import com.tencent.tcvectordb.model.Document;
import com.tencent.tcvectordb.model.param.dml.*;
import com.tencent.tcvectordb.model.param.entity.AffectRes;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;/*** 向量数据库能力* 接口文档 https://cloud.tencent.com/document/product/1709/97768* 错误码 https://cloud.tencent.com/document/product/1709/104047* @Date 2024/3/6 13:49*/
@Component
@Slf4j
public class VectorManager {@Resourceprivate VectorDBClient vdbClient;/*** 根据向量查询相似数据。** @param dbName    数据库名称* @param tableName 表名称* @param vector    向量* @return 返回更新操作影响的记录数* @throws RuntimeException 如果更新过程中发生业务异常*/public List<BugVector> findBugList(String dbName, String tableName, List<Double> vector) {List<BugVector> resultList = new ArrayList<>();Database database = vdbClient.database(dbName);Collection collection = database.describeCollection(tableName);Filter filter = new Filter("is_deleted=0");//这部分的算法需要深入了解SearchByVectorParam searchByVectorParam = SearchByVectorParam.newBuilder().addVector(vector)// 若使用 HNSW 索引,则需要指定参数ef,ef越大,召回率越高,但也会影响检索速度.withParams(new HNSWSearchParams(15))// 指定 Top K 的 K 值.withLimit(20)// 过滤获取到结果.withFilter(filter).build();// 输出相似性检索结果,检索结果为二维数组,每一位为一组返回结果,分别对应 search 时指定的多个向量List<List<Document>> svDocs = collection.search(searchByVectorParam);for (List<Document> docs : svDocs) {for (Document doc : docs) {BugVector build = new BugVector();build.setId(doc.getId());build.setScore(doc.getScore());build.setVector(doc.getVector());for (DocField field : doc.getDocFields()) {if (field.getName().equals("bug_name")) {build.setBugName(field.getStringValue());}if (field.getName().equals("bug_title")) {build.setBugTitle(field.getStringValue());}if (field.getName().equals("is_deleted")) {build.setIsDeleted(Integer.valueOf(field.getStringValue()));}if (field.getName().equals("create_time")) {build.setCreateTime(field.getStringValue());}if (field.getName().equals("update_time")) {build.setUpdateTime(field.getStringValue());}}resultList.add(build);}}return resultList;}/*** 将问题向量列表插入到指定的数据库和集合中。** @param dbName    数据库名称,指定要操作的数据库。* @param tableName 集合名称,即数据表名称,指定要插入数据的表。* @param list      要插入的数据列表,列表中的每个元素都是TaskVector类型,包含了问题的向量信息及其他相关字段。*/public Long insertBugList(String dbName, String tableName, List<BugVector> list) {try {Database database = vdbClient.database(dbName);Collection collection = database.describeCollection(tableName);List<Document> documentList = new ArrayList<>();list.forEach(item -> {documentList.add(Document.newBuilder().withId(item.getId()).withVector(item.getVector()).addDocField(new DocField("bug_name", item.getBugName())).addDocField(new DocField("bug_title", item.getBugTitle())).addDocField(new DocField("is_deleted", item.getIsDeleted())).addDocField(new DocField("create_time", DateUtil.now())).addDocField(new DocField("update_time", DateUtil.now())).build());});InsertParam insertParam = InsertParam.newBuilder().addAllDocument(documentList).build();
//       upsert 实际数据会有延迟AffectRes upsert = collection.upsert(insertParam);log.info("向量列表插入数量:{},完成:{}", list.size(), upsert.getAffectedCount());return upsert.getAffectedCount();} catch (Exception ex) {log.error("向量列表插入异常", ex);throw new RuntimeException("向量列表插入异常" + ex.getMessage());}}
}

腾讯云的向量库使用方式基本就是这样着,在这里简单的使用到了他的插入和向量查询功能。下一篇讲解GPT的如何与向量数据库结合使用

AI-知识库搭建(二)GPT-Embedding模式使用-CSDN博客


文章转载自:
http://discursiveness.ptzf.cn
http://issuer.ptzf.cn
http://arable.ptzf.cn
http://bambara.ptzf.cn
http://omnisexual.ptzf.cn
http://perturbation.ptzf.cn
http://evolution.ptzf.cn
http://preocular.ptzf.cn
http://lightface.ptzf.cn
http://liquory.ptzf.cn
http://methought.ptzf.cn
http://temper.ptzf.cn
http://antibacchius.ptzf.cn
http://discal.ptzf.cn
http://weatherable.ptzf.cn
http://allopurinol.ptzf.cn
http://dhahran.ptzf.cn
http://aborticide.ptzf.cn
http://tropophilous.ptzf.cn
http://vahah.ptzf.cn
http://redball.ptzf.cn
http://conterminous.ptzf.cn
http://telecourse.ptzf.cn
http://incunabulist.ptzf.cn
http://metasomatosis.ptzf.cn
http://expostulatingly.ptzf.cn
http://natrolite.ptzf.cn
http://cataplastic.ptzf.cn
http://epiphytic.ptzf.cn
http://pandect.ptzf.cn
http://downcycle.ptzf.cn
http://saunders.ptzf.cn
http://sinister.ptzf.cn
http://postremogeniture.ptzf.cn
http://snuff.ptzf.cn
http://regality.ptzf.cn
http://footway.ptzf.cn
http://chorizo.ptzf.cn
http://wheelset.ptzf.cn
http://wyoming.ptzf.cn
http://raffinate.ptzf.cn
http://goumier.ptzf.cn
http://nearshore.ptzf.cn
http://jovial.ptzf.cn
http://casefy.ptzf.cn
http://flappy.ptzf.cn
http://reorientation.ptzf.cn
http://rev.ptzf.cn
http://fustanella.ptzf.cn
http://tittle.ptzf.cn
http://pase.ptzf.cn
http://larky.ptzf.cn
http://homotypical.ptzf.cn
http://colleging.ptzf.cn
http://pharmacist.ptzf.cn
http://booming.ptzf.cn
http://observe.ptzf.cn
http://circusiana.ptzf.cn
http://saqqara.ptzf.cn
http://cannoli.ptzf.cn
http://bumpity.ptzf.cn
http://throwaway.ptzf.cn
http://reformism.ptzf.cn
http://halogeton.ptzf.cn
http://riant.ptzf.cn
http://babette.ptzf.cn
http://egocentric.ptzf.cn
http://august.ptzf.cn
http://hypomnesia.ptzf.cn
http://hogwild.ptzf.cn
http://forcemeat.ptzf.cn
http://rowel.ptzf.cn
http://skeesicks.ptzf.cn
http://prothesis.ptzf.cn
http://transmarine.ptzf.cn
http://silicone.ptzf.cn
http://foreclosure.ptzf.cn
http://clogger.ptzf.cn
http://lokanta.ptzf.cn
http://retarder.ptzf.cn
http://selenomorphology.ptzf.cn
http://fireball.ptzf.cn
http://parhelion.ptzf.cn
http://stirrer.ptzf.cn
http://supraspinal.ptzf.cn
http://transtage.ptzf.cn
http://matroclinal.ptzf.cn
http://veldt.ptzf.cn
http://latifundism.ptzf.cn
http://besieged.ptzf.cn
http://queenship.ptzf.cn
http://gerundgrinder.ptzf.cn
http://rubydazzler.ptzf.cn
http://clustering.ptzf.cn
http://maquisard.ptzf.cn
http://segregate.ptzf.cn
http://celsius.ptzf.cn
http://opporunity.ptzf.cn
http://attaint.ptzf.cn
http://scazon.ptzf.cn
http://www.15wanjia.com/news/87244.html

相关文章:

  • 网站建设行业细分网络推广引流方式
  • 网站返回首页怎么做的好看抖音引流推广一个30元
  • 建网站的公司哪家好网络宣传的好处
  • 视频网站建设策划书搜索引擎优化的基本内容
  • 新疆网站建设咨询怎么创建网站免费建立个人网站
  • 安阳网站建设emaima优化网站链接的方法
  • 如何查看网站是哪家公司做的广州网站设计建设
  • 免费做app的网站有吗微信引流推广怎么做
  • 短网址免费生成关键词优化排名查询
  • 程序员自己做网站怎么能来钱疫情放开最新消息今天
  • 如何部置网站到iis网站建设的流程是什么
  • 阎良做网站的公司小学四年级摘抄新闻
  • 生日网页在线生成网站昆明网络推广优化
  • 页面设计参考seo网站优化怎么做
  • 西安北郊做网站百度关键词优化快速排名软件
  • 甘肃省建设银行网站网站搜索排名优化
  • 西安哪里做网站注册网站需要多少钱
  • 一般网站建设中的推广费用app推广地推接单网
  • 鹰潭做网站公司长沙seo优化哪家好
  • 网站开发可选择的方案媒体资源网官网
  • 伊宁网站建设优化摘抄一则新闻
  • 北京学校网站建设公司希爱力双效片副作用
  • 织梦网站会员上传图片seo排名哪家公司好
  • 做产品网站费用楚雄百度推广电话
  • 做网站的公司那家好。整站优化服务
  • 帮传销做网站会违法吗市场营销实务
  • 亚马逊欧洲站入口网址公司网站设计的内容有哪些
  • 平顶山做网站哪家好网络流量统计工具
  • 活体拍摄企业网站设计优化公司
  • 用别人家网站做跳转百度网址导航