关于问答系统(Q&A)、对话系统(Chatbot)的学与思

在本地使用CPU运行Llama 2模型来实现文档Q&A 虽然LLM展现了出色的能力,但其运行所要求的计算和内存资源较高。为了应对这一问题,我们可以使用Quantization来压缩这些模型,以减少内存占用并加速推理计算过程,同时保持模型的性能和效果。Quantization是一种将用于表示数字或值的位数减少的技术。在LLM的上下文中,它涉及通过将权重存储在较低精度的数据类型中来减少模型参数的精度。由于它减小了模型大小,量化有助于在资源受限的设备上部署模型,例如仅有CPU但没有GPU的设备或嵌入式系统。 阅读详情

AnyQ

AnyQ(ANswer Your Questions) 开源项目主要包含面向FAQ集合的问答系统框架、文本语义匹配工具SimNet。(检索式回答)

AnyQ系统框架主要由Question Analysis、Retrieval、Matching、Re-Rank等部分组成,框架中包含的功能均通过插件形式加入,如Analysis中的中文切词,Retrieval中的倒排索引、语义索引,Matching中的Jaccard特征、SimNet语义匹配特征,当前共开放了20+种插件。AnyQ系统的配置化、插件化设计有助于开发者快速构建、快速定制适用于特定业务场景的FAQ问答系统,加速迭代和升级。 AnyQ的框架结构如下图:

在这里插入图片描述

https://github.com/baidu/AnyQ


单轮对话

单轮对话有三种形式:基于分析、基于检索、基于生成。

基于分析是比如一个单轮对话针对一个分类问题,或者是一个结构预测的问题,那么检索就是一个匹配问题,生成就是一个翻译的问题。这三种不同的方法它背后的区别就是这个有没有显式的语义表达。

  • 基于分析的方法它是有显式的内部表达,基于检索和生成,就是部分有或者没有显性的这个内部的表示,这是这三个不同的方法的特点。
  • 基于检索的方法在聊天机器人中用的多,而问答系统中也是如此,只是将对话局限在问答中。
  • 还有基于生成的方法。在深度学
人工智能对话系统实战:Chatbot与智能客服 Chatbot:Chatbot,即聊天机器人,是一种基于人工智能技术的程序,能够通过文本或语音与用户进行实时交互。它可以模拟人类对话,回答用户的问题、提供信息和服务,甚至进行情感交流。智能客服:智能客服是人工智能技术的重要应用之一,它利用自然语言处理、机器学习等技术,为用户提供自动化的客户服务解决方案。智能客服能够处理大量常见问题,减轻人工客服的压力,提高服务效率。Chatbot和智能客服作为人工智能对话系统的两大应用,正逐渐改变着我们的生活方式。 阅读详情

相关推荐

从头实现深度学习的对话系统--简单chatbot代码实现

从头实现深度学习的对话系统–简单chatbot代码实现 本文的代码都可以到我的github中下载:https://github.com/lc222/seq2seq_chatbot 预训练好的模型可以到我的百度云网盘中下载: 链接:https://pan.baidu.com/s/1hrNxaSk 密码:d2sn 前面几篇文章我们已经介绍了seq2seq模型的理论知识,并且从tensorflo

呜呜哈的博客 1万+

机器学习实验四:深度学习图像生成Q&A(Part one:图像风格迁移)

不许截图我的白鹿嗷! 写在前面: 感谢大家的关注。在此声明:博客的本意是供自己存档实验报告,同时便于同学之间相互交流遇到的问题。 欢迎大家评论和私信自己遇到的问题和解决方案,让我们共同进步。 VGG19模型文件及实验用图下载地址(无需积分,直接下载,如遇404说明资源在审核,csdn审核为2-10个工作日): https://download.youkuaiyun.com/download/qq_43554335/34058130 下面是我在调试代码过程中遇到的一些问题及解决方案,希望对您有所...

蓝多多的小仓库 1444

基于PHP的MyFAQ(5.3.2)开源问答系统源码.zip

基于PHP的MyFAQ(5.3.2)开源问答系统源码.zip

jetson orin nano 使用cuPCL

jetson开发板上使用pcl时,正常使用的是cpu,拖慢了整体的效率。cuPCL有一些库用于使用CUDA处理点云。

weixin_42256401的博客 1020

天融信防火墙NGFW4000(TG-4628)安装配置笔记

配置一台全新的天融信防火墙NGFW4000,配置完后,内网用户10.10.1.0/24和10.10.2.0/24可以通过防火墙上网,外网用户可以通过访问防火墙的外网接口地址来访问内网的WEB服务器10.10.1.200,并且内网用户也可以通过WEB服务器的外网地址进行访问。 网络说明: 防火墙外网接口地址:218.90.123.121/30 防火墙内网接口地址:19...

weixin_33671935的博客 4459

树莓派Bookworm系统避坑指南:3种方法解决pip install报错externally-managed-environment

本文详细解析树莓派Bookworm系统中pip install报错externally-managed-environment的成因,并提供三种实用解决方案:使用虚拟环境(venv)隔离项目依赖、通过pipx管理全局Python工具,以及理解风险后的系统安装方法。帮助开发者安全高效地管理Python环境,避免系统冲突。

android的专栏 766

3D 结构光相机工作原理全解 | 从编码投射到三维重建,原理 + 代码 + 工业实战一站式掌握

本文从3D结构光相机的整体架构出发,层层拆解了编码投射、相位计算、相位解包裹、三维重建的核心原理,补充了工业实战所需的公式推导、代码实现、参数调优、设备选型和案例落地,核心总结如下:相位是3D结构光成像的“灵魂”,其精度、稳定性直接决定3D重建的效果,包裹相位与绝对相位的区分的是工业实战的基础;编码投射的核心是“正弦条纹+格雷码条纹”组合,正弦条纹负责高精度相位提取,格雷码条纹辅助解包裹,适配工业场景的精度与稳定性需求;

getusushu的博客 417

车牌识别系统

随这图形图像技术的发展,现在的车牌识别技术准确率越来越高,识别速度越来越快。无论何种形式的车牌识别系统,它们都是由触发、图像采集、图像识别模块、辅助光源和通信模块组成的。车牌识别系统涉及光学、电器、电子控制、数字图像处理、计算视觉、人工智能等多项技术。触发模块负责在车辆到达合适位置时,给出触发信号,控制抓拍。辅助光源提供辅助照明,保证系统在不同的光照条件下都能拍摄到高质量的图像。图像预处理程序对抓拍的图像进行处理,去除噪声,并进行参数调整。然后通过车牌定位、字符识别,最后将识别结果输出。 牌照自动识别是一

FPGA/MATLAB学习教程/源码/项目合作开发 2万+

无线传感网络的Matlab实现

Matlab是一种功能强大的数值计算和数据分析工具,也可以用于无线传感网络的建模和仿真。根据实际需求,可以进一步扩展和优化模型,例如考虑节点能量消耗、网络路由、数据融合等方面的问题。函数用于绘制节点之间的连接关系,其中第一个参数是邻接矩阵,描述了节点之间的连接关系。这里使用了一个4个节点的简单例子,可以根据实际需求修改节点数量和连接关系。可以使用Matlab中的图形绘制函数来可视化节点的位置和连接关系。在无线传感网络中,节点的能量是一个关键因素。通过计算节点的剩余能量,可以评估节点的能量消耗情况。

2301_79331387的博客 250

Cleo Synchronization接口任意文件读取漏洞CVE-2024-50623 附POC

微信公众号搜索:南风漏洞复现文库该文章 南风漏洞复现文库 公众号首发Cleo。

nnn2188185的博客 480

硬件基础知识-电机知识

步进电机存在空载启动频率,所以步进电机可以低速正常运转,但若高于一定速度时就无法启动,并伴有尖锐的啸叫声;在非超载的情况下,电机的转速、停止的位置只取决于脉冲信号的频率和脉冲数。给电机两根线供电,电机就可以旋转,给正电压,电机正转,给相反电压,电机反转;电压越大,电机转得越快,电压越小,转速也变小。是一种直流电机,有刷电机的定子上安装有固定的主磁极和电刷,转子上安装有电枢绕组和换向器。控制器:使用专用的电子控制器来监测和控制电机的转速、电流和方向。线圈电流方向的交替变化是随电机转动的换相器和电刷来完成的。

weixin_46969363的博客 2296

OV9734 DATASHEET,完整规格书

OV9734完整规格书,包括电气参数,尺寸规格,寄存器配置表等

迈瑞BS系列全自动生化分析仪LIS协议接口手册(内含HL7和ASTM)

迈瑞BS系列全自动生化分析仪LIS协议接口手册,内含HL7和ASTM)

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

上一篇: 关于智能运维(AIOps)的学与思
下一篇: 关于信息检索(IR)、搜索引擎的学与思
Shingle_
博客等级 码龄10年 185粉丝 191原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值