
NLP
文章平均质量分 85
XianxinMao
可提供咨询,欢迎私信交流
展开
-
检索增强生成(RAG)与长上下文模型在AI应用中的比较
在实际应用中,可能需要将两种方法结合使用,比如在高效快速的RAG系统中获取关键数据后,利用长上下文模型进行深入分析。这种组合能够利用RAG的快速性与长上下文模型的详细分析能力,从而实现更高效的结果原创 2024-12-05 09:31:00 · 373 阅读 · 0 评论 -
长上下文情境下RoPE面临的挑战以及BFloat16带来的影响
BFloat16(Brain Floating Point 16-bit)是一种用于深度学习的数值格式,旨在通过减少每个浮点数所占的内存空间来加速模型训练和推理。尽管其内存效率高,但BFloat16的有限精度限制在某些情况下可能导致数值计算中的误差,尤其是在涉及相对位置编码的任务中。这一问题在Rotary Position Embedding(RoPE)下的长上下文训练中尤为明显。原创 2024-12-03 15:43:07 · 1262 阅读 · 0 评论 -
依赖向量嵌入的检索增强生成(RAG)系统的失败原因分析
向量嵌入在RAG系统中的应用存在根本性缺陷,这些问题严重影响了系统的实用性和可靠性。要提升RAG系统的效果,需要采用更全面的方法,结合多种检索技术,而不是仅仅依赖向量嵌入。这对于提升用户体验和系统准确性都至关重要。原创 2024-12-03 09:49:37 · 545 阅读 · 0 评论 -
讨论在本地运行AI时是否需要GPU或NPU
在运行大型语言模型(LLM)推理过程中,不同硬件的选择对性能、效率和成本都有显著影响。以下是对主要硬件类型(CPU、GPU、NPU)在LLM推理中优缺点的详细分析,以及选择合适硬件的建议。原创 2024-12-02 11:06:53 · 2057 阅读 · 0 评论 -
A very simple framework for state-of-the-art Natural Language Processing (NLP) ------ note-2
flairNLP-1Let’s use a pre-trained model for named entity recognition (NER). This model was trained over the English CoNLL-03 task and can recognize 4 different entity types.All you need to do is use the predict() method of the tagger on a sentence. This原创 2021-12-04 22:51:50 · 385 阅读 · 0 评论 -
A very simple framework for state-of-the-art Natural Language Processing (NLP) ------ note-1
flairNLPFlair is:A powerful NLP library. Flair allows you to apply our state-of-the-art natural language processing (NLP) models to your text, such as named entity recognition (NER), part-of-speech tagging (PoS), special support for biomedical data, sen原创 2021-12-04 22:50:55 · 608 阅读 · 0 评论 -
知识图谱笔记(三)
知识图谱笔记(三)知识图谱基础之RDF,RDFS与OWL本文将结合实例,对RDF和RDFS/OWL,这两种知识图谱基础技术作进一步的介绍。其实,RDF、RDFS/OWL是类语义网概念背后通用的基本技术,而知识图谱是其中最广为人知的概念RDF(Resource Description Framework),即资源描述框架,其本质是一个数据模型(Data Model)。它提供了一个统一的标准,用于描述实体/资源。简单来说,就是表示事物的一种方法和手段。RDF形式上表示为SPO三元组,有时候也称为一条语句(原创 2021-11-23 11:06:33 · 380 阅读 · 0 评论 -
知识图谱笔记(二)
知识图谱笔记(二)对于初学者来讲,这个概念很容易和语义网(Semantic Web)相混淆。为了行文一致,除非特别说明,语义网络指Semantic Network,语义网指Semantic Web语义网络是由Quillian于上世纪60年代提出的知识表达模式,其用相互连接的节点和边来表示知识。节点表示对象、概念,边表示节点之间的关系语义网络的优点:容易理解和展示相关概念容易聚类语义网络的缺点:节点和边的值没有标准,完全是由用户自己定义多源数据融合比较困难,因为没有标准无法区分概念节原创 2021-11-22 18:50:06 · 358 阅读 · 0 评论 -
知识图谱笔记(一)
知识图谱笔记(一)为什么需要知识图谱?什么是知识图谱?——KG的前世今生第一个部分介绍我们为什么需要知识图谱,第二个部分介绍知识图谱的相关概念及其形式化表示之所以举这样一个例子,是因为,计算机一直面临着这样的困境——无法获取网络文本的语义信息如同上面的例子,机器看到文本的反应和我们看到罗纳尔多葡萄牙语原名的反应别无二致。为了让机器能够理解文本背后的含义,我们需要对可描述的事物(实体)进行建模,填充它的属性,拓展它和其他事物的联系,即,构建机器的先验知识机器拥有了这样的先验知识,当它再次看到Ron原创 2021-11-22 16:25:32 · 493 阅读 · 0 评论 -
Text classification with TensorFlow Hub: Movie reviews
This notebook classifies movie reviews as positive or negative using the text of the review. This is an example of binary—or two-class—classification, an important and widely applicable kind of machine learning problem.The tutorial demonstrates the basic原创 2021-07-31 19:53:06 · 257 阅读 · 0 评论 -
Building deep retrieval models
In the featurization tutorial we incorporated multiple features into our models, but the models consist of only an embedding layer. We can add more dense layers to our models to increase their expressive power. In general, deeper models are capable of lear原创 2021-07-30 23:03:29 · 230 阅读 · 0 评论 -
Taking advantage of context features
In the featurization tutorial we incorporated multiple features beyond just user and movie identifiers into our models, but we haven't explored whether those features improve model accuracy.Many factors affect whether features beyond ids are useful in a原创 2021-07-30 20:26:55 · 212 阅读 · 0 评论 -
Using side features: feature preprocessing
One of the great advantages of using a deep learning framework to build recommender models is the freedom to build rich, flexible feature representations.These need to be appropriately transformed in order to be useful in building models: User and ite原创 2021-07-30 14:26:47 · 472 阅读 · 1 评论 -
Recommending movies: retrieval
Real-world recommender systems are often composed of two stages: The retrieval stage is responsible for selecting an initial set of hundreds of candidates from all possible candidates. The main objective of this model is to efficiently weed out all cand原创 2021-07-28 13:38:08 · 265 阅读 · 0 评论 -
用RNN进行文本分类
本教程的目的是带领大家学会用 RNN 进行文本分类本次用到的数据集是 IMDB,一共有 50000 条电影评论,其中 25000 条是训练集,另外 25000 条是测试集首先我们需要加载数据集,可以通过 TFDS 很简单的把数据集下载过来,如下代码所示dataset, info = tfds.load('imdb_reviews', with_info=True, as_supervised=True)train_dataset, test_dataset = dataset['trai原创 2021-07-26 10:41:09 · 9814 阅读 · 0 评论 -
根据译文片段预测翻译作者
本教程的目的是带领大家学会,根据译文片段预测翻译作者本次用到的数据集是三个 txt 文本,分别是 cowper.txt、derby.txt、butler.txt ,该文本已经经过一些预处理,去除了表头,页眉等接下来我们加载数据,这里我们使用 tf.data.TextLineDataset API,而不是之前使用的 text_dataset_from_directory,两者的区别是,前者加载 txt 文件里的每一行作为一个样本,后者是加载整个 txt 文件作为一个样本DIRECTORY_URL原创 2021-07-23 11:35:29 · 254 阅读 · 2 评论 -
stack overflow 问题分类
本教程的目的是带领大家学会如何给 stack overflow 上的问题进行打标签首先我们需要导入要用到的函数库import matplotlib.pyplot as pltimport osimport reimport shutilimport stringimport numpy as npimport tensorflow as tffrom tensorflow.keras import layersfrom tensorflow.keras import los原创 2021-07-21 22:39:25 · 1194 阅读 · 1 评论