前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
社区首页 >专栏 >tree2retriever:面向RAG场景的递归摘要树检索器实现

tree2retriever:面向RAG场景的递归摘要树检索器实现

作者头像
致Great
发布于 2024-05-31 04:39:07
发布于 2024-05-31 04:39:07
12800
代码可运行
举报
文章被收录于专栏:自然语言处理自然语言处理
运行总次数:0
代码可运行

tree2retriever

面向RAG场景的递归摘要树检索器实现

Recursive Abstractive Processing for Tree-Organized Retrieval

Github:https://github.com/yanqiangmiffy/tree2retriever

Example

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
import logging
import pickle

from tree2retriever.cluster_tree_builder import ClusterTreeBuilder, ClusterTreeConfig
from tree2retriever.embedding import SBertEmbeddingModel
from tree2retriever.summary import GLMSummarizationModel
from tree2retriever.tree_retriever import TreeRetriever, TreeRetrieverConfig

if __name__ == '__main__':
    tree_builder_type = 'cluster'
    logging.basicConfig(format="%(asctime)s - %(message)s", level=logging.INFO)
    supported_tree_builders = {"cluster": (ClusterTreeBuilder, ClusterTreeConfig)}

    tree_builder_class, tree_builder_config_class = supported_tree_builders[
        tree_builder_type
    ]
    embedding_model = SBertEmbeddingModel(model_name=r"I:\pretrained_models\bert\english\all-mpnet-base-v2")
    summary_model = GLMSummarizationModel(model_name_or_path=r"I:\pretrained_models\llm\chatglm3-6b")
    tree_builder_config = tree_builder_config_class(
        tokenizer=None,
        max_tokens=100,
        num_layers=5,
        threshold=0.5,
        top_k=5,
        selection_mode="top_k",
        summarization_length=100,
        summarization_model=summary_model,
        embedding_models={'sbert': embedding_model},
        cluster_embedding_model="sbert",
    )

    tree_retriever_config = TreeRetrieverConfig(
        tokenizer=None,
        threshold=0.5,
        top_k=5,
        selection_mode="top_k",
        context_embedding_model="sbert",
        embedding_model=embedding_model,
        num_layers=None,
        start_layer=None,
    )

    tree_builder = tree_builder_class(tree_builder_config)

    with open(r'H:\Projects\GoMate\data\docs\sample.txt', 'r') as file:
        text = file.read()
    tree = tree_builder.build_from_text(text=text)
    retriever = TreeRetriever(tree_retriever_config, tree)
    question = '"How did Cinderella reach her happy ending?'

    search_docs = retriever.retrieve(question)
    print(search_docs)

    path = "tree.pkl"
    with open(path, "wb") as file:
        pickle.dump(tree, file)
    logging.info(f"Tree successfully saved to {path}")

运行日志如下:

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
2024-05-30 21:20:29,655 - Load pretrained SentenceTransformer: I:\pretrained_models\bert\english\all-mpnet-base-v2
2024-05-30 21:20:56,691 - Use pytorch device_name: cuda
Loading checkpoint shards: 100%|██████████| 7/7 [07:04<00:00, 60.64s/it]
2024-05-30 21:28:05,104 - Successfully initialized TreeBuilder with Config 
        TreeBuilderConfig:
            Tokenizer: <Encoding 'cl100k_base'>
            Max Tokens: 100
            Num Layers: 5
            Threshold: 0.5
            Top K: 5
            Selection Mode: top_k
            Summarization Length: 100
            Summarization Model: <gomate.modules.refiner.summary.GLMSummarizationModel object at 0x0000015C2BE18C50>
            Embedding Models: {'sbert': <gomate.modules.retrieval.embedding.SBertEmbeddingModel object at 0x0000015C1B25D790>}
            Cluster Embedding Model: sbert
        
        Reduction Dimension: 10
        Clustering Algorithm: RAPTOR_Clustering
        Clustering Parameters: {}
        
2024-05-30 21:28:05,104 - Successfully initialized ClusterTreeBuilder with Config 
        TreeBuilderConfig:
            Tokenizer: <Encoding 'cl100k_base'>
            Max Tokens: 100
            Num Layers: 5
            Threshold: 0.5
            Top K: 5
            Selection Mode: top_k
            Summarization Length: 100
            Summarization Model: <gomate.modules.refiner.summary.GLMSummarizationModel object at 0x0000015C2BE18C50>
            Embedding Models: {'sbert': <gomate.modules.retrieval.embedding.SBertEmbeddingModel object at 0x0000015C1B25D790>}
            Cluster Embedding Model: sbert
        
        Reduction Dimension: 10
        Clustering Algorithm: RAPTOR_Clustering
        Clustering Parameters: {}
        
2024-05-30 21:28:05,120 - Creating Leaf Nodes
Batches: 100%|██████████| 1/1 [00:01<00:00,  1.50s/it]
Batches: 100%|██████████| 1/1 [00:00<00:00, 58.82it/s]
Batches: 100%|██████████| 1/1 [00:00<00:00, 66.66it/s]
Batches: 100%|██████████| 1/1 [00:00<00:00, 68.96it/s]
Batches: 100%|██████████| 1/1 [00:00<00:00, 66.66it/s]
Batches: 100%|██████████| 1/1 [00:00<00:00, 68.97it/s]
Batches: 100%|██████████| 1/1 [00:00<00:00, 64.49it/s]
Batches: 100%|██████████| 1/1 [00:00<00:00, 62.51it/s]
Batches: 100%|██████████| 1/1 [00:00<00:00, 54.06it/s]
Batches: 100%|██████████| 1/1 [00:00<00:00, 60.60it/s]
Batches: 100%|██████████| 1/1 [00:00<00:00, 68.96it/s]
Batches: 100%|██████████| 1/1 [00:00<00:00, 71.42it/s]
Batches: 100%|██████████| 1/1 [00:00<00:00, 68.97it/s]
Batches: 100%|██████████| 1/1 [00:00<00:00, 57.14it/s]
Batches: 100%|██████████| 1/1 [00:00<00:00, 57.14it/s]
Batches: 100%|██████████| 1/1 [00:00<00:00, 52.63it/s]
Batches: 100%|██████████| 1/1 [00:00<00:00, 47.63it/s]
Batches: 100%|██████████| 1/1 [00:00<00:00, 68.96it/s]
Batches: 100%|██████████| 1/1 [00:00<00:00, 68.94it/s]
Batches: 100%|██████████| 1/1 [00:00<00:00, 68.97it/s]
Batches: 100%|██████████| 1/1 [00:00<00:00, 68.97it/s]
Batches: 100%|██████████| 1/1 [00:00<00:00, 68.97it/s]
Batches: 100%|██████████| 1/1 [00:00<00:00, 66.67it/s]
Batches: 100%|██████████| 1/1 [00:00<00:00, 62.49it/s]
Batches: 100%|██████████| 1/1 [00:00<00:00, 66.67it/s]
Batches: 100%|██████████| 1/1 [00:00<00:00, 47.62it/s]
Batches: 100%|██████████| 1/1 [00:00<00:00, 60.61it/s]
Batches: 100%|██████████| 1/1 [00:00<00:00, 64.51it/s]
Batches: 100%|██████████| 1/1 [00:00<00:00, 62.50it/s]
Batches: 100%|██████████| 1/1 [00:00<00:00, 66.67it/s]
Batches: 100%|██████████| 1/1 [00:00<00:00, 62.50it/s]
Batches: 100%|██████████| 1/1 [00:00<00:00, 66.70it/s]
Batches: 100%|██████████| 1/1 [00:00<00:00, 66.67it/s]
Batches: 100%|██████████| 1/1 [00:00<00:00, 66.66it/s]
Batches: 100%|██████████| 1/1 [00:00<00:00, 14.08it/s]
2024-05-30 21:28:07,312 - Created 35 Leaf Embeddings
2024-05-30 21:28:07,312 - Building All Nodes
2024-05-30 21:28:07,314 - Using Cluster TreeBuilder
2024-05-30 21:28:07,314 - Constructing Layer 0
2024-05-30 21:28:14,750 - Summarization Length: 100
C:\Users\yanqiang\.cache\huggingface\modules\transformers_modules\chatglm3-6b\modeling_chatglm.py:226: UserWarning: 1Torch was not compiled with flash attention. (Triggered internally at C:\cb\pytorch_1000000000000\work\aten\src\ATen\native\transformers\cuda\sdp_utils.cpp:455.)
  context_layer = torch.nn.functional.scaled_dot_product_attention(query_layer, key_layer, value_layer,
2024-05-30 21:28:27,157 - The story is about a rich man's wife who is sick and near death. She advises her daughter to be good and pious, and promises to look down on her from heaven. The daughter is devoted and remains pious, even when her mother passes away.

Every day, the daughter goes to her mother's grave and weeps. One day, the snow covers the grave, but when the sun melts it away, the man has already taken another wife. This new wife brings two daughters who are beautiful but evil-hearted.

The step-child is treated poorly and is told to go out into the garden and pick the good seeds for the dish. The birds, including two white pigeons and turtle-doves, come to help her. The pigeons and turtle-doves gather the good seeds and eat them before the half-hour is over. The step-child is delighted and believes she will now be allowed to go to the wedding.
2024-05-30 21:28:27,158 - Node Texts Length: 563, Summarized Text Length: 187
Batches: 100%|██████████| 1/1 [00:00<00:00, 55.55it/s]
2024-05-30 21:28:34,895 - The story is about a beautiful maiden who is forced to work hard and suffer abuse by her step-mother and two sisters. She is taken away from her pretty clothes and given an old grey bedgown and wooden shoes. The sisters mock and injuries are mentioned, but the maiden remains resilient. One day a prince approaches her and they dance together. The prince wants to see who the beautiful maiden belongs to and ends up following her. She escapes from him and runs into the garden behind the house. There, she finds a tree with the most magnificent pears and climbs it nimbly. The prince becomes anxious to go with her, but she escape quickly. The next day, the prince gives her a golden shoe that fits perfectly. The step-mother and sisters are horrified and become pale with rage.
2024-05-30 21:28:34,895 - Node Texts Length: 477, Summarized Text Length: 162
Batches: 100%|██████████| 1/1 [00:00<00:00, 64.51it/s]
2024-05-30 21:28:38,211 - The two step-sisters are excited about going to the wedding at the king's palace, but Cinderella wants to go with them. However, her step-mother prevents her from going, saying that Cinderella has no clothes and cannot dance. Cinderella cries and goes to her mother's grave to comfort herself.
2024-05-30 21:28:38,212 - Node Texts Length: 194, Summarized Text Length: 63
Batches: 100%|██████████| 1/1 [00:00<00:00, 64.51it/s]
2024-05-30 21:28:47,037 - Cinderella is a young woman who lives in a house with her step-parents. She is treated poorly and is not allowed to attend the king's ball, where she believes she will be able to find true love. Instead, her step-parents go to the ball and Cinderella is left behind. While at the ball, a magical pumpkin transforms into a carriage, and Cinderella is taken to the palace and meets the king's son, who is in search of a bride. Cinderella is able to go to the ball and attend the wedding thanks to the intervention of a magical bird, who throws down golden and silver items to her when she expresses a wish. At the wedding, Cinderella's step-sisters and step-mother do not recognize her, and believe she is a foreign princess. Eventually, Cinderella is discovered and is able to live happily ever after with the king's son.
2024-05-30 21:28:47,037 - Node Texts Length: 614, Summarized Text Length: 182
Batches: 100%|██████████| 1/1 [00:00<00:00, 64.51it/s]
2024-05-30 21:28:55,399 - A summary of the story of Cinderella:

Cinderella is a young woman who is forced to live in the household of her cruel and heartless step-mother. She is mistreated and has little in life, but is kind and kind-hearted. One day, a royal prince invites Cinderella to a ball, but she is unable to go because she has no clothes or shoes. Cinderella's step-mother refuses to let her attend, saying that she will be laughed at. Cinderella is desperate, and manages to pick two dishes of lentils out of the ashes for her step-mother in one hour, earning her ticket to the ball. At the ball, Cinderella is revealed to be a beautiful princess, and the prince marries her. The step-mother is punished for her cruelty, and Cinderella lives happily ever after.
2024-05-30 21:28:55,400 - Node Texts Length: 471, Summarized Text Length: 171
Batches: 100%|██████████| 1/1 [00:00<00:00, 62.50it/s]
2024-05-30 21:29:07,644 - The king asked his two step-daughters what they wanted him to bring back from his journey, and they both wished for beautiful dresses, pearls, and jewels. The king then bought these things for his step-daughters, but on his way home, a hazel twig knocked off his hat. He broke off the branch and took it with him, then gave his step-daughters the gifts they had wished for. He also gave the branch to Cinderella, who thanked him and planted it on her mother's grave. Cinderella then went to the pigeon-house, where the king's son thought she had leapt into it. No one was inside, so he had to have an axe and pickaxe brought to break down the pigeon-house. Cinderella was found laying in the ashes, and when her parents and sisters returned home, she was again found there. She took a beautiful dress from a bird on a little hazel-tree and put on her grey gown. On the third day, Cinderella went to her mother's grave and said to the tree, "Shiver and quiver, my little tree, silver and gold throw down over me."
2024-05-30 21:29:07,645 - Node Texts Length: 477, Summarized Text Length: 232
Batches: 100%|██████████| 1/1 [00:00<00:00, 50.06it/s]
2024-05-30 21:29:23,328 - The story is about a young woman who is determined to find a wife for herself, but she has specific requirements for the perfect bride. She wants someone whose foot fits a certain golden slipper. Her two sisters are excited about the prospect of finding a bride, and they try to help her find the perfect one.

The eldest sister tries on the slipper, but it is too small for her, so her mother cuts off the toe and forces her foot into the shoe. The eldest sister endures the pain and goes out to the king's son, who takes her on his horse as his bride.

However, as they pass by a hazel-tree, the two pigeons sitting on it cry out that the shoe is too small and the true bride is still waiting. The king's son realizes that the eldest sister is not the true bride and takes her back home.

The second sister tries on the shoe and fits it perfectly, but her heel is too large, so her mother cuts off a bit and forces her foot into the shoe. The second sister endures the pain and goes out to the king's son, who takes her on his horse as his bride.

Again, as they pass by the hazel-tree, the two pigeons cry out that the shoe is too small and the true bride is still waiting. The king's son realizes that the second sister is not the true bride and takes her back home.

Therefore, the two sisters are left without finding a bride, and the king's son is left with a false bride who is not suitable for his queen.
2024-05-30 21:29:23,329 - Node Texts Length: 485, Summarized Text Length: 317
Batches: 100%|██████████| 1/1 [00:00<00:00, 57.15it/s]
2024-05-30 21:29:23,349 - Constructing Layer 1
2024-05-30 21:29:23,349 - Stopping Layer construction: Cannot Create More Layers. Total Layers in tree: 1
2024-05-30 21:29:23,350 - Successfully initialized TreeRetriever with Config 
        TreeRetrieverConfig:
            Tokenizer: <Encoding 'cl100k_base'>
            Threshold: 0.5
            Top K: 5
            Selection Mode: top_k
            Context Embedding Model: sbert
            Embedding Model: <gomate.modules.retrieval.embedding.SBertEmbeddingModel object at 0x0000015C1B25D790>
            Num Layers: None
            Start Layer: None
        
2024-05-30 21:29:23,350 - Using collapsed_tree
Batches: 100%|██████████| 1/1 [00:00<00:00, 29.41it/s]
2024-05-30 21:29:23,393 - Tree successfully saved to tree.pkl
A summary of the story of Cinderella:  Cinderella is a young woman who is forced to live in the household of her cruel and heartless step-mother. She is mistreated and has little in life, but is kind and kind-hearted. One day, a royal prince invites Cinderella to a ball, but she is unable to go because she has no clothes or shoes. Cinderella's step-mother refuses to let her attend, saying that she will be laughed at. Cinderella is desperate, and manages to pick two dishes of lentils out of the ashes for her step-mother in one hour, earning her ticket to the ball. At the ball, Cinderella is revealed to be a beautiful princess, and the prince marries her. The step-mother is punished for her cruelty, and Cinderella lives happily ever after.

Cinderella is a young woman who lives in a house with her step-parents. She is treated poorly and is not allowed to attend the king's ball, where she believes she will be able to find true love. Instead, her step-parents go to the ball and Cinderella is left behind. While at the ball, a magical pumpkin transforms into a carriage, and Cinderella is taken to the palace and meets the king's son, who is in search of a bride. Cinderella is able to go to the ball and attend the wedding thanks to the intervention of a magical bird, who throws down golden and silver items to her when she expresses a wish. At the wedding, Cinderella's step-sisters and step-mother do not recognize her, and believe she is a foreign princess. Eventually, Cinderella is discovered and is able to live happily ever after with the king's son.

Then the bird threw a gold and silver dress down to her, and slippers embroidered with silk and silver   She put on the dress with all speed, and went to the wedding   Her step-sisters and the step-mother however did not know her, and thought she must be a foreign princess, for she looked so beautiful in the golden dress They never once thought of cinderella, and believed that she was sitting at home in the dirt, picking lentils out of the ashes   The

And now the bird threw down to her a dress which was more splendid and magnificent than any she had yet had, and the slippers were golden   And when she went to the festival in the dress, no one knew how to speak for astonishment   The king's son danced with her only, and if any one invited her to dance, he said this is my partner When evening came, cinderella wished to leave, and the king's

 Thrice a day cinderella went and sat beneath it, and wept and prayed, and a little white bird always came on the tree, and if cinderella expressed a wish, the bird threw down to her what she had wished for It happened, however, that the king gave orders for a festival which was to last three days, and to which all the beautiful young girls in the country were invited, in order that his son might choose himself a bride

the step-sisters had gone once more, cinderella went to the hazel-tree and said -      shiver and quiver, my little tree,      silver and gold throw down over me Then the bird threw down a much more beautiful dress than on the preceding day  And when cinderella appeared at the wedding in this dress, every one was astonished at her beauty   The king's son had waited until she came, and instantly took her by the hand

and emptied her peas and lentils into the ashes, so that she was forced to sit and pick them out again   In the evening when she had worked till she was weary she had no bed to go to, but had to sleep by the hearth in the cinders   And as on that account she always looked dusty and dirty, they called her cinderella It happened that the father was once going to the fair, and he

a dim little oil-lamp was burning on the mantle-piece, for cinderella had jumped quickly down from the back of the pigeon-house and had run to the little hazel-tree, and there she had taken off her beautiful clothes and laid them on the grave, and the bird had taken them away again, and then she had seated herself in the kitchen amongst the ashes in her grey gown Next day when the festival began afresh, and her parents and

however, took cinderella on his horse and rode away with her   As they passed by the hazel-tree, the two white doves cried -      turn and peep, turn and peep,      no blood is in the shoe,      the shoe is not too small for her,      the true bride rides with you, and when they had cried that, the two came flying down and placed themselves on cinderella's shoulders, one on the right,

kitchen, cinderella lay there among the ashes, as usual, for she had jumped down on the other side of the tree, had taken the beautiful dress to the bird on the little hazel-tree, and put on her grey gown On the third day, when the parents and sisters had gone away, cinderella went once more to her mother's grave and said to the little tree -      shiver and quiver, my little tree,      silver and gold throw down over me

Reference

  • RAPTOR: Recursive Abstractive Processing for Tree-Organized Retrieval
本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2024-05-30,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
暂无评论
推荐阅读
编辑精选文章
换一批
深度学习实战:tensorflow训练循环神经网络让AI创作出模仿莎士比亚风格的作品
答案是后者!上面这篇文章是一个经过TensorFlow训练的循环神经网络的产物,经过30个epoch的训练,并给出了一颗“FLORIZEL:”的种子。在本文中,我将解释并给出如何训练神经网络来编写莎士比亚戏剧或任何您希望它编写的东西的代码!
deephub
2020/05/09
8090
深度学习实战:tensorflow训练循环神经网络让AI创作出模仿莎士比亚风格的作品
PyTorch 2.2 中文官方教程(七)
在本教程中,我们将展示如何使用 torchtext 库构建文本分类分析的数据集。用户将有灵活性
ApacheCN_飞龙
2024/02/05
6890
PyTorch 2.2 中文官方教程(七)
检索增强生成(RAG)实践:基于LlamaIndex和Qwen1.5搭建智能问答系统
LLM 会产生误导性的 “幻觉”,依赖的信息可能过时,处理特定知识时效率不高,缺乏专业领域的深度洞察,同时在推理能力上也有所欠缺。
汀丶人工智能
2024/05/07
4.1K0
检索增强生成(RAG)实践:基于LlamaIndex和Qwen1.5搭建智能问答系统
智谱免费GLM-4V-Flash助力多模态RAG实现
多模态检索增强生成(RAG)技术正快速发展,但部署成本较高。智谱科技开放的GLM-4V-Flash作为免费多模态大模型,具备图文理解、知识检索等能力,为构建RAG系统提供了经济实惠的选择。
致Great
2024/12/28
4800
智谱免费GLM-4V-Flash助力多模态RAG实现
Word2vec原理浅析及tensorflow实现
词向量的重要意义在于将自然语言转换成了计算机能够理解的向量。相对于词袋模型、TF-IDF等模型,词向量能抓住词的上下文、语义,衡量词与词的相似性,在文本分类、情感分析等许多自然语言处理领域有重要作用。
用户1332428
2018/07/30
6310
Word2vec原理浅析及tensorflow实现
AI智能体(四)
以往,我们都是直接跟大模型进行交互,没有办法系统的实现记忆。langchain给出了一个系统级的解决方案,如上图中,用户提出问题,系统会先在存储器(如上图中的redis)中查询相关的文档返回系统,系统会带着用户的问题以及查询到的文档碎片一起提交给大模型,然后再将答案返回给用户。其中存储器充当了大脑记忆的部分。在上图的左下角,就是我们之前说的各种文档(pdf,word,excel等)通过向量化后存储进存储器。比起直接向大模型提问,langchain相当于多了一个外挂系统。
算法之名
2025/02/06
830
AI智能体(四)
双编码器的自然语言图像搜索
该示例演示了如何构建一个双编码器(也称为双塔)神经网络模型,以使用自然语言搜索图像。该模型的灵感来自于Alec Radford等人提出的CLIP方法,其思想是联合训练一个视觉编码器和一个文本编码器,将图像及其标题的表示投射到同一个嵌入空间,从而使标题嵌入位于其描述的图像的嵌入附近。
LiveVideoStack
2021/09/01
1.2K0
双编码器的自然语言图像搜索
05.序列模型 W2.自然语言处理与词嵌入(作业:词向量+Emoji表情生成)
这些结果反映了某些性别歧视。例如,“computer 计算机”更接近“man 男人”,“literature 文学”更接近“woman 女人”。
Michael阿明
2021/02/19
7610
序列模型第二周作业2:Emojify!
在读取data/glove.6B.50d.txt你可能会遇到这样一个问题: 'gbk' codec can't decode byte 0x93 in position 3136 解压作业文件夹同名压缩包,并更改w2v_utils.py文件中的读取函数的with open部分如下:
Steve Wang
2019/05/28
2K0
序列模型第二周作业2:Emojify!
详解如何通过稀疏向量优化信息检索
在信息检索方法的发展历程中,我们见证了从传统的统计关键词匹配到如 BERT 这样的深度学习模型的转变。虽然传统方法提供了坚实的基础,但往往难以精准捕捉文本的语义关系。如 BERT 这样的稠密检索方法通过利用高维向量捕获文本的上下文语义,为搜索技术带来了显著进步。然而,由于这些方法依赖于特定领域的知识,它们在处理领域外(out-of-domain)问题时可能会遇到困难。
Zilliz RDS
2024/07/20
4881
详解如何通过稀疏向量优化信息检索
“巨人的肩膀” 海量CTR模型的高效高性能实现 FuxiCTR
CTR预估模型是现代大规模工业推荐系统的核心,往往扮演着“精排”的角色。当下主流的CTR预估模型采用双分支的并行结构,一个分支以深度模型DNN为主,另外一个分支以特征交叉网络为主。特别是自Wide&Deep之后的工作,包括DeepFM、xDeepFM、DCN等撑起了工业推荐系统的一片天。宏观来看,CTR预估模型的整体结构往往并不复杂,其动机也通常易于理解。但是,在实际的落地效果中,代码实现上的细小差异可能对最终的结果会有显著的影响。所以,戏称调模型、调参数为“炼丹”也不足为奇。不过,站在巨人的肩膀上去学习甚至改进CTR模型倒是入门推荐系统的捷径。即使是对于有多年的炼丹经验的算法工程师而言,停下来回顾一下过往的经典模型,或许也能从中得到启发。
Houye
2021/12/06
8020
“巨人的肩膀” 海量CTR模型的高效高性能实现 FuxiCTR
深度学习之RNN循环神经网络(理论+图解+Python代码部分)[通俗易懂]
前段时间实验室人手一本《Deep Learning》,本文章结合这本圣经和博客上各类知识以及我自己的理解和实践,针对RNN循环神经网络作出总结。
全栈程序员站长
2022/11/03
7.8K0
PyTorch 2.2 中文官方教程(六)
此教程已移至pytorch.org/audio/stable/tutorials/audio_io_tutorial.html
ApacheCN_飞龙
2024/02/05
9400
PyTorch 2.2 中文官方教程(六)
【RAG落地利器】向量数据库Milvus教程:如何实现MetaData检索过滤
Milvus 在 Milvus 存储库中提供了 Docker Compose 配置文件。要使用 Docker Compose 安装 Milvus,只需运行
致Great
2025/01/21
4840
【RAG落地利器】向量数据库Milvus教程:如何实现MetaData检索过滤
使用小尺寸大模型和 Dify 清洗数据:Qwen 2.5 7B
本篇文章,我们聊聊如何使用最近发布的 Qwen 2.5 7B 模型来做日常低成本的数据清理工作。
soulteary
2024/10/08
3700
使用小尺寸大模型和 Dify 清洗数据:Qwen 2.5 7B
PyTorch 2.2 中文官方教程(八)
这个教程将带你了解深度强化学习的基础知识。最后,你将实现一个能够自己玩游戏的 AI 马里奥(使用双深度 Q 网络)。
ApacheCN_飞龙
2024/02/05
3600
PyTorch 2.2 中文官方教程(八)
【tensorflow2.0】处理文本数据-imdb数据
训练集有20000条电影评论文本,测试集有5000条电影评论文本,其中正面评论和负面评论都各占一半。
西西嘛呦
2020/08/26
1.1K0
【tensorflow2.0】处理文本数据-imdb数据
一文了解 TKG 如何使用 GPU 资源池
相关文章: 有了这个办法,跑AI任务再也不用在机器上插GPU卡了 随着科技进步和产业变革的加速演进,人工智能(AI)已经成为兵家必争之地。在政府、学术机构、企业等各个层面,AI都受到高度重视,其在学术研究、技术创新、人才教育等方面的发展都呈现全新发展态势。作为AI市场中的重要组成,以 GPU 技术为主的 AI 加速市场也得到了快速的发展,与此同时,由于 GPU 硬件价格昂贵,传统使用 GPU 算力的独占式使用方式缺乏灵活性和经济性,同时随着云原生技术的发展,细粒度,快速交付切分 GPU 算力需求,急需经济
Henry Zhang
2023/04/04
1.5K0
一文了解 TKG 如何使用 GPU 资源池
Emojify_v2a
Welcome to the second assignment of Week 2. You are going to use word vector representations to build an Emojifier.
列夫托尔斯昊
2020/08/25
1.5K0
Emojify_v2a
PyTorch 2.2 中文官方教程(二十)
语义图像分割是一种计算机视觉任务,使用语义标签标记输入图像的特定区域。PyTorch 语义图像分割DeepLabV3 模型可用于使用20 个语义类别标记图像区域,包括自行车、公共汽车、汽车、狗和人等。图像分割模型在自动驾驶和场景理解等应用中非常有用。
ApacheCN_飞龙
2024/02/05
5980
PyTorch 2.2 中文官方教程(二十)
推荐阅读
相关推荐
深度学习实战:tensorflow训练循环神经网络让AI创作出模仿莎士比亚风格的作品
更多 >
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档
本文部分代码块支持一键运行,欢迎体验
本文部分代码块支持一键运行,欢迎体验