惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

W
WeLiveSecurity
T
The Exploit Database - CXSecurity.com
C
CXSECURITY Database RSS Feed - CXSecurity.com
S
Security @ Cisco Blogs
T
Threat Research - Cisco Blogs
TaoSecurity Blog
TaoSecurity Blog
Recent Commits to openclaw:main
Recent Commits to openclaw:main
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
腾讯CDC
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
T
The Blog of Author Tim Ferriss
Microsoft Azure Blog
Microsoft Azure Blog
罗磊的独立博客
F
Full Disclosure
博客园 - 【当耐特】
C
CERT Recently Published Vulnerability Notes
Engineering at Meta
Engineering at Meta
Application and Cybersecurity Blog
Application and Cybersecurity Blog
T
Threatpost
I
Intezer
V2EX - 技术
V2EX - 技术
H
Hackread – Cybersecurity News, Data Breaches, AI and More
The Hacker News
The Hacker News
小众软件
小众软件
Google DeepMind News
Google DeepMind News
T
Tailwind CSS Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
B
Blog RSS Feed
Microsoft Security Blog
Microsoft Security Blog
N
News | PayPal Newsroom
MyScale Blog
MyScale Blog
AI
AI
Vercel News
Vercel News
Spread Privacy
Spread Privacy
美团技术团队
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
The GitHub Blog
The GitHub Blog
V
Vulnerabilities – Threatpost
Schneier on Security
Schneier on Security
Cyberwarzone
Cyberwarzone
G
GRAHAM CLULEY
Help Net Security
Help Net Security
Hacker News: Ask HN
Hacker News: Ask HN
Google DeepMind News
Google DeepMind News
MongoDB | Blog
MongoDB | Blog
L
LINUX DO - 热门话题
U
Unit 42
L
LangChain Blog
Recent Announcements
Recent Announcements

博客园 - 程序猿101

2024年总结。。。。2025年规划。 八皇后问题c语言版(xcode下通过) 对分布式一些理解 观察者模式 用redis实现悲观锁(后端语言以php为例) 只用200行Go代码写一个自己的区块链!(转) 用户中心 - 博客园 php的生命周期的概述 linux网络编程1 最简单的socket编程 mysql 慢查询 2016年终总结。。。六年从创业到技术的历程 Linux下chkconfig命令详解 这个简单明了啊 JS的prototype和__proto__ Constructor vagrant homestead laravel 编程环境搭建 发现一个百度的密码。。。记最近一段时间的php感想 mysql 的简单优化 百度的面试题 合并两个有序的数组 PHP性能优化工具–xhprof安装 Ecshop :后台添加新功能 菜单及 管理权限 配置
百度面试题 字符串相似度 算法 similar_text 和页面相似度算法
程序猿101 · 2016-03-03 · via 博客园 - 程序猿101

在百度的面试,简直就是花样求虐。

首先在面试官看简历的期间,除了一个自己定义字符串相似度,并且写出求相似度的算法。

。。。这个确实没听说过,php的similar_text函数也是闻所未闻的。之前看seo的时候,到简单了解了一下页面的相似度,百度算法中很常见的需要判断页面是否是重复的,重复的肯定就不收录了,做seo很重的一个工作就是写原创文章,以保持网站的更新,吸引百度的收录,以增加流量。

页面的相似度,是纯数学的,因为百度的主要是收录中文,所以中文需要先拆词,然后计算词语的在文章中出现的频度。然后这些词组加权,求出一个向量,然后求两个页面的余弦值。这个东西反正肯定不会,扯淡还是扯的。

这里的字符串的相似度,是譬如abacbcd和abcbcd之类的没有意义的纯字符串。

既然让自己定义,肯定定义一个简单的了,主要就是查找最大相同的字符串及长度。(漏掉好多可能)

回来自己查了一下。才发现如下:

这个similar_text分为三步

第一步

以后接着写。