Home >Backend Development >PHP Tutorial >How to automatically obtain keywords in PHP CMS_PHP Tutorial

How to automatically obtain keywords in PHP CMS_PHP Tutorial

WBOY
WBOYOriginal
2016-07-15 13:30:21840browse

How to learn correctlyHow can a PHP CMS automatically obtain keywords? The main steps can be divided into the following three steps:

1 , PHP CMS separates the title and content through word segmentation algorithms, and extracts keywords and frequencies

In the word segmentation stage of content, the two main algorithms currently are ICTCLAS of the Chinese Academy of Sciences and Hidden Malar Kov model. But both of them are too high-end, have certain thresholds, and both only support C++/JAVA. There are currently two recommended PSCWS and HTTPCWS based on PHP.

SCWS released the official version 1.0.0 on 2008-03-08, and now the latest version has reached 1.0.4. PSCWS is its PHP version.

HTTPCWS was developed by Zhang Yan and was previously called PHPCWS. PHPCWS first uses the API of "ICTCLAS 3.0 Shared Edition Chinese Word Segmentation Algorithm" for initial word segmentation processing, and then uses the self-written "Reverse Maximum Matching Algorithm" to segment and merge words, and adds a punctuation filtering function to obtain the word segmentation results. Currently only Linux/Unix systems are supported.

2. The PHP CMS compares the extraction results with the existing lexicon to get the keywords that best comply with the rules

The main thing here is to look at the lexicon. We can define our own lexicon or use an existing mature lexicon.

3, and then the PHP CMS compares the two sets of keywords to get the keywords that best fit the current content

At this stage, it is a detailed analysis of the specific situation. . Currently, all PHP CMSs have their own keyword extraction systems. Among them, the word segmentation source code of DEDECMS is the most widely circulated on the Internet. I have also tested it on my POPCMS, and the effect is very good. The frequency of meaningless words like "we" being extracted and listed as keywords is too high. , and sometimes HTML with spaces is even used as keywords, which needs improvement urgently. But as an auxiliary function, it is already very good.

In addition, the automatic keyword extraction function of PHP CMS and DISCUZ is also very powerful.


www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/446301.htmlTechArticleHow to correctly learn how PHP CMS can automatically obtain keywords? The main steps can be divided into the following Three steps: 1. PHP CMS separates the title and content through word segmentation algorithm...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn