我在过去几天一直在研究一个项目,在这个项目中有一个我实际上不知道该怎么做的任务,该项目包括分析网页以找到表征页面的标签.
嘿哥们,你的意思是什么?通过说标签我的意思是关键词,总结了网页的内容.例如,在这里你写了你自己的标签,这样人们就可以更好地发现你的问题了.我所说的是构建一个算法来分析网页,通过页面中的文本找到它的标签.
我开始从页面获取文本 – >完成
一般我正在寻找一种方法来找到关于结束网页的关键词
但是,我真的不知道接下来该做什么.有没有人有建议?
对于一个非常基本的方法,您可以使用
TF-IDF算法查找页面中最重要的单词
Quick overlook from wikipedia:
The tf–idf weight (term frequency–inverse document frequency) is a
weight often used in information retrieval and text mining. This
weight is a statistical measure used to evaluate how important a word
is to a document in a collection or corpus. The importance increases
proportionally to the number of times a word appears in the document
but is offset by the frequency of the word in the corpus. Variations
of the tf–idf weighting scheme are often used by search engines as a
central tool in scoring and ranking a document’s relevance given a
user query. tf–idf can be successfully used for stop-words filtering
in various subject fields including text summarization and
classification
找到页面中最重要的单词后,您可以将它们用作标签.
如果您想改进标签并使其更具相关性.
有很多方法可以继续,但您可以按以下步骤操作:
>从中提取一堆您知道主要标签的文本.
>对于所有这些文本运行TF-IDF算法并使用.创建一个向量
得分最高的人.
>尝试找到所有这些向量的主要方向. (运行ACP
例如,或任何机器学习工具)
>并使用此标记表示主方向的单词集. (ACP的最大载体)
希望它是可以理解的,它有所帮助