python--text Feature Extraction Countvectorize

Source: Internet
Author: User

countvectorize

From: Python Learning text feature extraction (ii) Countvectorizer tfidfvectorizer Chinese processing-CSDN Blog

80930801

The commonly used data input form is: list, list element is the string representing the article, a string represents an article, the string is already split goodCountvectorizer is also available in Chinese
parameter Table function
Stop_words to deactivate a glossary; customize the Stop vocabulary
Token_pattern filter rules;

property sheet function
Vocabulary_ A glossary; a typical word.
Get_feature_names () Vocabulary of all text; list type
Stop_words_ Return to Inactive glossary

Countvectorizer is to convert the words in the text to the word frequency matrix by the Fit_transform function, and the matrix element A[i][j] to denote the word frequency of the J words under the I text. That is, the number of occurrences of each word, through get_feature_names () can see all the text of the keyword, through the toarray () can see the results of the word frequency matrix.

Method Table function
Fit_transform (X) Fit the model and return the text matrix

python--text Feature Extraction Countvectorize

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.