gpt4 book ai didi

php - 以编程方式从域名中提取关键字

转载 作者:可可西里 更新时间:2023-11-01 13:09:06 25 4
gpt4 key购买 nike

假设我有一个要分析的域名列表。除非域名带有连字符,否则我看不到一种特别简单的方法来“提取”域中使用的关键字。然而,我看到它在 DomainTools.com、Estibot.com 等网站上完成。例如:

ilikecheese.com becomes "i like cheese"
sanfranciscohotels.com becomes "san francisco hotels"
...

对于有效地完成此任务有什么建议吗?

编辑:我想用 PHP 编写。

最佳答案

好的,我运行了为 this SO question 编写的脚本,有几个小的变化——使用对数概率来避免下溢,并将其修改为读取多个文件作为语料库。

对于我的语料库,我从 Gutenberg 项目下载了一堆文件——没有真正的方法,只是从 etext00、etext01 和 etext02 中抓取了所有英语文件。

下面是结果,我为每个组合保存了前三名。

expertsexchange: 97 possibilities -  experts exchange -23.71 -  expert sex change -31.46 -  experts ex change -33.86penisland: 11 possibilities -  pen island -20.54 -  penis land -22.64 -  pen is land -25.06choosespain: 28 possibilities -  choose spain -21.17 -  chooses pain -23.06 -  choose spa in -29.41kidsexpress: 15 possibilities -  kids express -23.56 -  kid sex press -32.65 -  kids ex press -34.98childrenswear: 34 possibilities -  children swear -19.85 -  childrens wear -25.26 -  child ren swear -32.70dicksonweb: 8 possibilities -  dickson web -27.09 -  dick son web -30.51 -  dicks on web -33.63

关于php - 以编程方式从域名中提取关键字,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1315373/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com