paulwong

2025年9月10日 #

微调案例

我如何用 Prompt 工程将大模型调教成风控专家
https://my.oschina.net/u/4090830/blog/18690981


posted @ 2025-09-10 13:25 paulwong 阅读(6) | 评论 (0)编辑 收藏

2025年9月6日 #

RAG提高召回率秘笈

传统的搜索是全文搜索, 即用户提供关键字, 系统将此关键字去数据库中的文本查找, 看文本是否含此关键字, 如有则返回.
这种有个缺点, 如果提供的是关键字的同义词, 则无法搜索了.

于是最新的人工智能技术能解决这个问题, 即只提供同义词之类的也能找出来.

为什么能查找出来呢, 系统将待搜索的文本转成向量, 再将关键词转成向量, 查找欧氏距离或余弦相似度最近的那组向量, 再将此对应的文本返回.

由于文本长度太长, 通常是将文本切割成文本块, 再逐个存储. 这样会导致返回的文本有缺失.

于是产生不同的存储策略, 将文本的属性作为元数据保存了下来, 如果精准的知道其属性, 则可以直接查属性而找到文本.

也可以将此文本生成一段摘要, 也作为元数据保存下来, 关键字先和摘要匹配, 如果相近即返回.

也可以将文本转成全文索引的格式保存下来, 再以文本是否含此关键字进行搜索, 如有则返回.

这样返回的文本多了, 搜索的准确度自然就提高了.

这里推荐Milvus数据库, 将以上机制都放在服务器端, 用户只需调包即可实现, 大大简化的编程.

代码实现:

https://milvus.io/docs/zh-hant/full_text_search_with_langchain.md


书本代码:
https://github.com/huangjia2019/rag-in-action/blob/master/04-向量存储-VectorDB/Milvus/create_milvus_db.py#L100

https://github.com/Tylersuard/EnterpriseRAG/blob/main/Ch03/upload_sql_records_to_ai_search.py#L10

https://github.com/tomasonjo/kg-rag/blob/main/README.md

posted @ 2025-09-06 15:47 paulwong 阅读(41) | 评论 (0)编辑 收藏

2025年8月26日 #

RAG优化

老王AIGC
https://mp.weixin.qq.com/mp/appmsgalbum?action=getalbum&__biz=MzkzMzc2MjAwOQ==&scene=24&album_id=3853666856078622721&count=3#wechat_redirect


posted @ 2025-08-26 16:57 paulwong 阅读(16) | 评论 (0)编辑 收藏

docker镜像加速


https://github.com/DaoCloud/public-image-mirror

posted @ 2025-08-26 09:59 paulwong 阅读(11) | 评论 (0)编辑 收藏

2025年7月11日 #

支持 A 股、港股!AI 投资炒股「智能体」开源,太绝了。

它部署了多个专业的 AI 大模型智能体,每一个智能体对应交易公司的一个角色。比如有的智能体是基本面分析师、有的是情绪分析师、有的是技术分析师,还有交易员、风险管理员等等。让这些角色的AI智能体在一起叽叽喳喳讨论,最终确定最优的策略。给出买入或者卖出的决策。

https://mp.weixin.qq.com/s/mu1eF1l5ung-siVcUrEsTQ


合集

posted @ 2025-07-11 19:06 paulwong 阅读(62) | 评论 (0)编辑 收藏

2025年7月2日 #

保险核保系统设计

回答用户的问题, 如“醉驾能否赔偿”时, 首先去条款库中匹配是否对得上的条款, 如有直接返回.
上面如果不中, 则走llm回答.
提取关键字, 用一关键字列表, 逐个对照, 如有则返回关键字, 没有则返回默认的车险关键字
拿着此关键字去知识图谱搜索出一堆条款
构造大模型输入的提示词, 即角色+条款列表+问题+请回答, 输入到大模型, 让大模型回答
检查回答是否合规, 如是否有免责字样或没有条款列表, 如不规合则直接返回, “请联系销售代表”字样
如合规, 则提取回答后面的字样作为答案返回
@import url(/css/cuteeditor.css);

posted @ 2025-07-02 00:43 paulwong 阅读(29) | 评论 (0)编辑 收藏

2025年6月23日 #

debian安装python+替换为清华源

sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak

sudo vi /etc/apt/sources.list.d/debian.sources

添加如下内容:
Types: deb
URIs: https://mirrors.tuna.tsinghua.edu.cn/debian/
Suites: bookworm bookworm-updates bookworm-backports
Components: main contrib non-free non-free-firmware
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg

Types: deb
URIs: https://mirrors.tuna.tsinghua.edu.cn/debian-security/
Suites: bookworm-security
Components: main contrib non-free non-free-firmware
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg

更新所有包
sudo apt update

安装python
sudo apt-get install python3

sudo apt-get install python3-pip

命令支持短写
sudo apt install python-is-python3

安装miniconda
wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/Miniconda3-py310_25.3.1-1-Linux-x86_64.sh

bash Miniconda3-py310_25.3.1-1-Linux-x86_64.sh
conda config --set show_channel_urls yes

cat > ~/.condarc <<EOF
channels:
- defaults
show_channel_urls: true
default_channels:
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2
custom_channels:
conda-forge: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
pytorch: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
EOF

清除缓存
conda clean -i

conda --version
conda info # 查看渠道是否显示为清华源




posted @ 2025-06-23 11:32 paulwong 阅读(79) | 评论 (0)编辑 收藏

2025年6月21日 #

最全 Docker 神器集结,让你的服务器瞬间起飞!

https://mp.weixin.qq.com/s/gtyMdmCqBY7LfdBGUBldSA

posted @ 2025-06-21 23:01 paulwong 阅读(33) | 评论 (0)编辑 收藏

2025年6月18日 #

百炼大模型支持深度思考


https://help.aliyun.com/zh/model-studio/deep-thinking#1f5ad51894bvi

posted @ 2025-06-18 23:56 paulwong 阅读(28) | 评论 (0)编辑 收藏

2025年6月13日 #

以非root用户运行docker

sudo useradd -m paul # 创建用户并自动建立家目录
sudo passwd paul # 设置用户密码(需输入两次确认)
sudo usermod -aG wheel paul # CentOS/RHEL
[root@dev69 ~]$ groupadd docker
[root@dev69 ~]$ usermod -aG docker $USER
[root@dev69 ~]$ reboot
[paul@dev69 ~]$ docker run hello-world

posted @ 2025-06-13 16:47 paulwong 阅读(30) | 评论 (0)编辑 收藏

仅列出标题  下一页