pt搜索网站_搜索pt 1简要介绍

news/2024/5/9 0:54:17/文章来源:https://blog.csdn.net/weixin_26756255/article/details/108958275

pt搜索网站

The ability to search the entire web in less than a second for whatever we fancy knowing is one of the greatest achievements of recent history. But how does it work? What are its building blocks? And, most importantly, … can we hack together our own version of it? The latter is important because search is inevitably personal: it is all about our focus, preferences, resources at our disposal and even emotions. Plus, it’s really cool!

只需不到一秒钟的时间,便可以在整个网络中进行搜索,这是最近历史上最伟大的成就之一。 但是它如何工作? 它的构成要素是什么? 而且,最重要的是,……我们可以一起破解我们自己的版本吗? 后者之所以重要,是因为搜索不可避免地是个人化的:这全都与我们的专注,偏好,可支配的资源乃至情感有关。 另外,它真的很棒!

In this three part series, I will:

在这三部分系列中,我将:

  • Pt 1. Provide a gentle introduction to Search using both Google and Elasticsearch as examples

    Pt 1.使用Google和Elasticsearch作为示例,对搜索进行简要介绍

  • Pt 2. We will explain some state-of-the-art NLP techniques, compare results to traditional approaches and discuss pros and cons

    Pt2。我们将介绍一些最新的NLP技术,将结果与传统方法进行比较,并讨论利弊

  • Pt 3. Provide a hacker's guide to building your own search engine with Elasticsearch engine containing 1 million news headlines & employing state-of-the-art NLP for enhanced semantic searches…

    Pt 3.提供黑客指南,以使用Elasticsearch引擎构建您自己的搜索引擎,其中包含100万个新闻标题,并采用最新的NLP进行增强的语义搜索…

搜寻-简而言之 (Search - in a nutshell)

When we talk about search nowadays we often mean Semantic Search. What is semantic search, you ask? Imagine searching for the word “virus threat”. A simple lexical search approach will come back with documents containing the words exactly and with in particular order of importance. Additionally documents about "security threat" will also be considered relevant as they contain part of the query.

如今,当我们谈论搜索时,我们通常指的是语义搜索。 您问什么是语义搜索? 想象一下搜索“病毒威胁”一词。 一种简单的词法搜索方法将返回包含准确且特别重要的单词的文档。 有关“安全威胁”的其他文档也将被视为相关文档,因为它们包含查询的一部分。

Semantic search, on the other hand, is also able to pick up on the idea of “disease”, “infection” and “corona” - we have a far wider and potentially more accurate search reflecting the "meaning" of what we are looking for instead of sticking to its specific keywords. In this section, I have often sourced ideas from the work by Bast, Hannah; Buchhold, Björn; Haussmann, Elmar (2016). “Semantic search on text and knowledge bases”. In that text they state:

另一方面,语义搜索还可以理解“疾病”,“感染”和“电晕”的概念-我们的搜索范围更广,而且可能更准确,反映了我们所查找内容的“含义”而不是坚持使用其特定的关键字。 在本节中,我经常从汉娜·巴斯特的作品中汲取灵感。 比约恩布赫霍尔德; 豪斯曼·埃尔玛(2016)。 “基于文本和知识库的语义搜索” 。 他们在该文本中指出:

Semantic search denotes search with meaning, as distinguished from lexical search where the search engine looks for literal matches of the query words or variants of them, without understanding the overall meaning of the query

语义搜索表示具有含义的搜索,这与词汇搜索不同,后者是搜索引擎在不了解查询整体含义的情况下,查找查询词或它们的变体的字面匹配。

The diagram below shows core components of a search engine of this kind

下图显示了这种搜索引擎的核心组件

Image for post
Image by the author
图片由作者提供

We focus on semantic search on text with some additional annotations (such as names, dates, links, etc) as opposed to say search on structured databases. This is essentially the typical web search we use all the time.

我们专注于对文本进行语义搜索,并带有一些附加的注释(例如名称,日期,链接等),而不是对结构化数据库进行语义搜索。 本质上,这是我们一直使用的典型网络搜索

Please note, the article deals with a search that produces lists of relevant documents or individual facts, not additional steps such as ranking based source quality, eg PageRank, results summarisation, etc.

请注意,本文涉及的搜索将产生相关文档或单个事实的列表,而不是诸如基于排名的源质量(例如PageRank,结果汇总等)之类的其他步骤。

查询类型 (Query Types)

These can be broken down into:

这些可以分解为:

  • Keyword - these are shorthand searches, not proper sentences but where the set of keywords and sometimes order carries semantic meaning, for instance Neil Armstrong date of birth, pasta recipe under 10mins

    关键字-这些是速记搜索,而不是正确的句子,但是其中的关键字集和有时包含语义含义的命令集,例如尼尔·阿姆斯特朗的生日,不到10分钟的面食食谱

  • Structured/Semi-structured - special syntax used in a query. It can represent either the full query or just refinements to it. For instance, this might be a restriction to only search a specific source, e.g. news from AP only. In other cases this might restrict the languages of the results or state mandatory elements of the query

    结构化/半结构化-查询中使用的特殊语法。 它可以代表完整的查询,也可以只是对其的完善。 例如,这可能是仅搜索特定来源(例如仅来自AP的新闻)的限制 在其他情况下,这可能会限制结果的语言或说明查询中的强制性元素

  • Natural language & natural questions - fully or mostly grammatically formed questions: “What is Neil Armstrong’s date of birth?”. This is the most natural way to interact with search, however, it also poses many difficulties. For instance, we could be asking multiple questions at once "Where can I park and what are opening hours?" or pose philosophical queries instead of fact searching ones "What is the meaning of life?". As you can see from the examples, the scope of questions is quite broad. While those make sense to us, algorithms tend to specialise in narrow tasks, hence the need for various algorithms working in concert that are able to determine which results are appropriate.

    自然语言和自然问题-完全或大部分为语法形式的问题:“尼尔·阿姆斯特朗的生日是什么?”。 这是与搜索进行交互的最自然的方式,但是,这也带来了许多困难。 例如,我们可能一次要问多个问题:“我可以在哪里停车,营业时间是几点?” 或提出哲学问题,而不是进行事实询问: “生命的意义是什么?”。 从示例中可以看到,问题的范围非常广泛。 尽管这些对我们有意义,但是算法往往专注于狭窄的任务,因此需要各种能够协同工作的算法,这些算法能够确定合适的结果。

查询处理 (Query processing)

These are the different types of transformations the system might need to perform on the original entry before passing it on to the search algorithm. Those could be

在将原始条目传递给搜索算法之前,系统可能需要对它们进行不同类型的转换。 那可能是

  • Extractive - where specific names, entities, places are extracted to further help the search and compare with values in the document metadata or against knowledge bases. For instance, in the below query Neil Armstrong the information box on the left is a result from invoking google’s Knowledge Base because the query was successfully matched with an entry from it

    提取-提取特定的名称,实体,地点,以进一步帮助搜索并与文档元数据中的值或知识库进行比较。 例如,在下面的查询尼尔·阿姆斯特朗(Neil Armstrong)中,左侧的信息框是调用Google知识库的结果,因为查询已成功与查询中的条目匹配

Image for post
  • Filters and constraints - in cases where semi-structured queries specify some restrictions on the results, e.g. only news in English, the scope of the search will be translated to the search engine

    过滤器和约束-在半结构化查询对结果指定某些限制的情况下,例如仅英语新闻,搜索范围将转换为搜索引擎

  • Other transformations are modifications to the search, e.g. for wildcard or fuzzy search. In which case the original query may be transformed into one or many variants. For instance, with fuzzy search, we might allow for some number of character modifications to the key words entered until we find the most likely word searched. See below, the result in Google when I look for Neil Armslong. Even though a gentleman by the name Armslong probably exists and is important, the system considers it is far more likely we made a typo.

    其他转换是对搜索的修改,例如用于通配符或模糊搜索。 在这种情况下,原始查询可能会转换为一个或多个变体。 例如,对于模糊搜索,我们可以允许对输入的关键字进行一些字符修改,直到找到最可能搜索到的单词。 参见下文,当我寻找Neil Armslong时在Google中获得的结果。 即使一个名叫Armslong的绅士可能存在并且很重要,系统仍认为我们打错字的可能性更大。

Image for post

搜索和排名 (Search and Rank)

Finally, one or more types of search & ranking approaches may be used. These will either be able to find an answer or return a ranked list of results matching the query. Ranking makes sure that more pertinent results are higher up - those might be results that mention keywords of the search more often than other results or contain relevant information to the query in their title or opening paragraphs. There are:

最后,可以使用一种或多种类型的搜索和排名方法。 这些将能够找到答案或返回与查询匹配的结果的排序列表。 排名可确保相关性更高的结果更高-这些结果可能是比其他结果更频繁提及搜索关键字或在标题或开头段落中包含与查询相关的信息的结果。 有:

  • Keyword searches - the most common types, where exact or very close to literal matches are made. The predominant part of searches is still done this way. What makes them semantic - they would use term occurrences to rank higher documents that appear more relevant to a keyword and recognize when some of the keywords are rare ranks hits on those higher than hits on more 'common' words in the query. A number of algorithms are available: BM25, tf-idf, various Learning to Rank methods, etc.

    关键字搜索-最常见的类型,进行完全匹配或非常接近文字匹配的搜索。 搜索的主要部分仍以这种方式进行。 是什么使它们具有语义-他们会使用术语出现来对看起来与关键字更相关的高级文档进行排名,并识别何时某些关键字在搜索结果中的命中率高于对查询中“常见”单词的命中率。 可以使用多种算法:BM25,tf-idf,各种学习排名方法等。

  • Contextual searches - I refer to any search based on textual embeddings that attempts to use the query entirely and find contextually relevant results. This is opposed to relying on any specific keywords or phrases individually to determine results. We will focus on this a bit more later, as it is central to this series. Some recent advances in NLP techniques here will help us improve the quality of search significantly.

    上下文搜索-我指的是基于文本嵌入的任何搜索,这些搜索试图完全使用查询并查找与上下文相关的结果。 这与单独依赖任何特定的关键字或短语来确定结果相反。 我们将在稍后重点介绍这一点,因为它是本系列的核心。 NLP技术的一些最新进展将帮助我们显着提高搜索质量。

Lets quickly have a face-off - keyword vs contextual search. Searching for “virus thread”, on news headlines, the left set of results are from a keyword approach while the ones on the right are from contextual search. The latter gives us a number of results which are not matching any search term directly like example 5 on the right: “WHO highlights dangers of vector borne diseases”

让我们快速面对面-关键字与上下文搜索。 在新闻标题上搜索“病毒线程”时,左侧的结果来自关键字方法,而右侧的结果来自上下文搜索。 后者为我们提供了许多与任何搜索词都不匹配的结果,如右侧的示例5:“ WHO强调了媒介传播疾病的危险”

Image for post
  • Knowledge base - as seen above, entries from a knowledge base can be matched directly to entries in a knowledge base and used further for generating a result. More advanced techniques can also apply where a keyword or natural language query can be transformed into a query to a knowledge base. For instance, ‘Astronauts on the moon’ would return another knowledge base result

    知识库-如上所示,可以将知识库中的条目直接与知识库中的条目进行匹配,并进一步用于生成结果。 在将关键字或自然语言查询转换为知识库查询的情况下,也可以应用更高级的技术。 例如,“月球上的宇航员”将返回另一个知识库结果

Image for post
  • Question-answering - traditionally, search engines have used modifications from the processing step to transform a natural question to a more keyword-like query and process it as such. More recently, advances in NLP have shown strong performance by algorithms that directly pinpoint whether and where an answer to a natural question can be found within a specific document. Unlike the other search paradigms from above, question answering focuses on providing an actual (single) answer as opposed to a list of documents (like the others in this list). Here is what happens when we ask about the moon landing as a natural question. In addition to a list of answers we get a specific answer.

    回答问题-传统上,搜索引擎使用了处理步骤的修改,将自然问题转换为更像关键字的查询并对其进行处理。 最近,通过直接查明在特定文档中是否可以找到自然问题的答案以及在何处可以找到自然问题的答案,NLP的进步已显示出强大的性能。 与上面的其他搜索范例不同,问题解答的重点是提供实际的(单个)答案,而不是文档列表(类似于此列表中的其他列表)。 这是我们自然而然地询问月球着陆时发生的情况。 除了答案列表,我们还会提供特定的答案。

Image for post

However, the technique works similarly from a not-so-natural question ‘year of first moon landing’

但是,该技术的作用类似一个不太自然的问题,即“首次登陆月球的年份”

Image for post

Finally, slight modifications to the query can break the result and we no longer get an explicit answer, we even land somewhere else completely

最后,对查询的轻微修改可能会破坏结果,我们不再获得明确的答案,甚至完全将其降落到其他地方

Image for post

全部放在一起(Putting it all together)

To summarize, any query type can pass through a number of different modifications and be run through any of a number of search mechanisms to produce candidate results. Each of these approaches will express the confidence in their results, however, different confidence scores may not be comparable between different algorithms. At this stage, a further decision algorithm will be able to determine which answers are well suited and "confident" enough to be passed on to the user as the final list of answers.

总而言之,任何查询类型都可以进行多种不同的修改,并可以通过多种搜索机制中的任何一种来生成候选结果。 这些方法中的每一种都将表达对其结果的置信度,但是,不同算法之间的不同置信度得分可能无法比较。 在这一阶段,另一种决策算法将能够确定哪些答案非常合适并且“足够有信心”,可以作为最终答案列表传递给用户。

Image for post
Image by the author
图片由作者提供

A functioning search engine can have any or at least one of each of the three steps of the process. We have seen that Google uses most of them under the hood, but what about making our own...

运行正常的搜索引擎可以具有该过程的三个步骤中的任何一个或至少一个。 我们已经看到Google在幕后使用了大多数工具,但是如何制作自己的工具呢?

我应该透露我的秘密议程… (I should reveal my secret agenda…)

I actually wanted to hack my own search engine all along.

我实际上一直都想破解自己的搜索引擎。

The tool of choice is Elasticsearch, primarily because it actually comes out of the box with a lot of search features. At the same time, it is very well supported and gets you a long way in terms of open source features.

选择的工具是Elasticsearch,主要是因为它实际上具有很多搜索功能,是开箱即用的。 同时,它得到了很好的支持,使您在开源功能方面走了很长一段路。

Here is a diagram of what we get out of the box with Elastic for the purposes of this discussion. Note that you should not trust me on this summary completeness as I have a specific objective in mind.

这是我们出于讨论目的而使用Elastic开箱即用的图表。 请注意,由于我有一个特定的目标,因此您不应该相信我的摘要完整性。

Image for post
Image by the author
图片由作者提供

You will notice that Elastic can handle any query type (even though they will all be handled by default by a keyword search mechanism) and allows for further modifying your queries to fuzzy, wildcard and quite a few others. If the data allows this, one can also apply any number of structured conditions on the results: date of publishing, source, etc.

您会注意到,Elastic可以处理任何查询类型(即使默认情况下将由关键字搜索机制处理所有查询类型),并允许您进一步将查询修改为模糊,通配符和许多其他查询。 如果数据允许,还可以对结果应用任意数量的结构化条件:发布日期,来源等。

In terms of search & ranking, there is a lot of flexibility to keyword search but not much else.

在搜索和排名方面,关键字搜索具有很大的灵活性,但没有太多其他灵活性。

Overall, this is a very impressive list of out of the box features. As it turns out, with some extra legwork we can even add contextual search. Which is what we will do next...

总体而言,这是非常令人印象深刻的现成功能列表。 事实证明,通过一些额外的工作,我们甚至可以添加上下文搜索。 接下来我们要做的是...

结论 (Conclusion)

We have explored the major building blocks of search, how they work together and the impact on search results. Different types of queries may trigger different search algorithms with a result that is a mixture of approaches. Looking at examples from Google we see that the same user experience (typing into a simple text box) is serviced by a number of techniques.

我们探索了搜索的主要组成部分,它们如何协同工作以及对搜索结果的影响。 不同类型的查询可能会触发不同的搜索算法,其结果是多种方法的混合。 查看Google的示例,我们可以看到,通过多种技术可以提供相同的用户体验(在简单的文本框中键入内容)。

In the following articles, we will compare contextual and keyword search side-by-side (Pt 2) and finally in will combine a few different tools to extend the capabilities of Elasticsearch with additional contextual capabilities to build our own semantic search engine (Pt 3).

在接下来的文章中,我们将并行比较上下文搜索和关键字搜索( Pt 2 ),最后将结合一些不同的工具来扩展Elasticsearch的功能以及其他上下文功能以构建我们自己的语义搜索引擎( Pt 3 )。

Btw, Neil Armslong

顺便说一句,尼尔·阿姆斯隆

I hope you enjoyed reading this, we will be back with more in Pt 2, next week. In the meantime if you feel like saying Hi or just like to tell me I am wrong, feel free to reach out via LinkedIn

希望您喜欢阅读本文,下周我们将在Pt 2中提供更多信息。 同时,如果您想打招呼或只是想告诉我我错了,请随时通过LinkedIn与我们联系

Special thanks to Rich Knuszka for valuable feedback.

特别感谢Rich Knuszka的宝贵反馈。

Please note that I have no affiliation with Google or Elasticsearch and the opinions and analysis are my own

请注意,我与Google或Elasticsearch没有任何隶属关系,观点和分析属于我个人

翻译自: https://towardsdatascience.com/search-pt-1-a-gentle-introduction-335656c0f814

pt搜索网站

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.luyixian.cn/news_show_854796.aspx

如若内容造成侵权/违法违规/事实不符,请联系dt猫网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

小白搭建网站

1. 第一步:使用Flask搭建微型的 Web 框架 Flask是Python中一个微型的Web开发框架。 建立一个工程 flaskr_meitu,我们来做一个美图网站init.py 是应用文件config.py 是配置文件view.py 是视图文件,实现网站请求功能templates/layout.html 是网…

各大型网站架构分析收集

各大型网站架构分析收集 标签: youtubescalability服务器理财web数据库服务器 2008-11-26 14:46 25992人阅读 评论(9) 收藏 举报 分类: Others(20) 版权声明:本文为博主原创文章,未经博主允许不得转载。…

取代cookie的网站追踪技术:“帆布指纹识别”初探

首页 精选文章 活动日历 行业招聘 关于我们 HTML5梦工场原文链接: QQ安全中心 取代cookie的网站追踪技术:“帆布指纹识别”初探 【前言】 一般情况下,网站或者广告联盟都会非常想要一种技术方式可以在网络上精确定位到每一个个体&#xf…

pdf在线分享网站

本文介绍如何将PDF文件在线分享。 所谓的把PDF文件生成一个链接并不是指普通的pdf转换成HTML,而是指将PDF文件变成一个可以打开的URL。这是大家关心的问题,我在网上看到好多人提问该问题,但都是回答的转换功能 找一个普通的pdf文件即可。 进…

SEO优化外链发布-麦瓜海报

对于网站SEO优化人员来说,网站程序和布局方面内部优化做好后,一是做好网站的内容,二是做好网站的外链。网站外链发布有哪些方法呢?还能不能发外链? 做SEO优化离不开外链建设,然而为什么要发外链呢&#xf…

免费发外链的网站

对于网站SEO优化人员来说,网站程序和布局方面内部优化做好后,一是做好网站的内容,二是做好网站的外链。网站外链发布有哪些方法呢?还能不能发外链? .撰写软文 在发布SEO软文的时候,首先要保证所发的软文外…

挖坑指南:网站http请求全变https?

前言 开发的后台单页系统,上到线上测试时,需要配置为php文件。 开始 测试的地址,未使用https,但是vue项目打包后的资源请求都是https的。导致页面加载时,请求不到资源。 实践 最后在页面中发现配置了一个meta: &…

网站重定向-http怎么重定向到https最全解决方案

前言: 本教程主要是对 网站http重定向到https,其中包括目前市面上常用各种服务器环境(Apache,Ngnix,IIS7系列)设置方法。 下面不啰嗦,直接上干货!!! 第一“IIS7” 环境中的设置方法…

同样可用来建站,云服务器和硅云虚拟主机到底哪个更好?

云主机和云虚拟主机都是在近十年很火的云产品,随着云计算技术不断向前推进,传统IDC服务的地盘已经越来越少。 对于个人和企业来说,云服务器和云虚拟主机都可以用来建站,但云服务器和云虚拟主机又有什么区别呢?二者如何区分开来?…

使用虚拟主机建站适合网站优化吗?

网络的不断发展,不少企业都会使用搜索引擎进行网络营销。为了能够让目标用户在利用搜索引擎搜索时能更容易找到自己的企业网站,不少企业纷纷用自己企业名称或与业务相关的关键词,进行搜索引擎推广,提高网站浏览量,为自…

手把手教你用vuepress搭建自己的网站(1)

虽互不曾谋面,但希望能和您成为笔尖下的朋友以读书,技术,生活为主,偶尔撒点鸡汤不作,不敷衍,意在真诚吐露,用心分享点击左上方,可关注本刊标星公众号(ID:itclanCoder)如果不知道如何操作点击这里,标星不迷路(https://coder.itclan.cn/)前言如…

手把手教你用vuepress搭建自己的网站(2)

虽互不曾谋面,但希望能和您成为笔尖下的朋友以读书,技术,生活为主,偶尔撒点鸡汤不作,不敷衍,意在真诚吐露,用心分享点击左上方,可关注本刊标星公众号(ID:itclanCoder)如果不知道如何操作点击这里,标星不迷路页面具体内容配置 基本配置要让你的…

手把手教你用vuepress搭建自己的网站(3)

虽互不曾谋面,但希望能和您成为笔尖下的朋友以读书,技术,生活为主,偶尔撒点鸡汤不作,不敷衍,意在真诚吐露,用心分享点击左上方,可关注本刊标星公众号(ID:itclanCoder)如果不知道如何操作点击这里,标星不迷路配置插件 有时候,我们想让我们的网…

手把手教你用vuepress搭建自己的网站(4)

部署到github平台 前提条件 文档放置在项目的 docs目录中 使用的是默认的构建输出位置 VuePress 以本地依赖的形式被安装到你的项目中,并且配置了如下的npm scripts:,然后在itclan/package.json文件中 添加如下命令 本地若没有安装vuepress非全局安装,pwa以及其他…

vuepress建站过程中遇到的一些问题

页面显示-404 在 vuepress说明了文件路径与页面路由之间的映射关系 文件的相对路径页面路由地址/README.md//guide/README/guide//README.md//config.md/config.html当你访问 /guide/而 404 时,这是由于guide目录下缺乏了它对应的 README.md文件 侧边栏显示的是文件路径&#x…

让自己的网站支持第三方支付能力(支持支付宝与微信支付)

前言 对于建站,相信很多小伙伴,一方面是希望自己有个知识的沉淀的载体,另一种程度上也是建立自我品牌的开始,当然也希望网站能够带来一些隐性或者显性的收入,例如:吸引广告商,贴片广告,付费阅读,自产自卖等 您将在本篇中读完get到 在vuepress中如何注入全局组件 实现置顶与置底…

如何将代码部署到腾讯云网站静态托管

虽互不曾谋面,但希望能和您成为笔尖下的朋友以读书,技术,生活为主,偶尔撒点鸡汤不作,不敷衍,意在真诚吐露,用心分享点击左上方,可关注本刊标星公众号(ID:itclanCoder)(上)(下)前言之前将网站代码部署到 coding 上,并成功迁移到腾讯云上存储桶…

如何通过一行代码实现等待指定若干秒后自动跳转到指定的网站上

背景前天,老板提了一个需求,提供给用户的下载说明文档,当用户打开之后,等待5秒后自动跳转到公司的官网上,那这个是怎么实现?方法1-使用定时器实现setTimeout(()> {window.location.href "https://itclan.cn"; },5000)() // 等价于 var timer setTimeout(() &g…

针对网站链接-使用rel=”nofollow”属性提升网站seo

虽互不曾谋面,但希望能和您成为笔尖下的朋友以读书,技术,生活为主,偶尔撒点鸡汤不作,不敷衍,意在真诚吐露,用心分享点击左上方,可关注本刊标星公众号(ID:itclanCoder)seo的优化做得好,毫无疑问可以提升网站的排名,增强百度,Google,搜狗等搜索…

网站被qq拦截应该怎么处理

虽互不曾谋面,但希望能和您成为笔尖下的朋友以读书,技术,生活为主,偶尔撒点鸡汤不作,不敷衍,意在真诚吐露,用心分享点击左上方,可关注本刊标星公众号(ID:itclanCoder)在浏览器中输入网站可以直接打开,但是在qq中,发现,被qq给拦截了的,提示“非…