R language do text mining Part1

Source: Internet
Author: User

Part1 Install dependent Packages

The software package for the Chinese analysis in the R language is RWORDSEG,RWORDSEG package dependent Rjava package, Rjava need to have Java installed in this machine.

The first step is to install Java, please install JDK,JRE not. Please download and install 32-bit JDK for the corresponding model. The machine already has JDK of also please change to 32 bit, otherwise can't use rwordseg, try to use 64 bit of, not line.

Http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

Check to see if Java is installed successfully, run cmd, enter java–version, and install correctly if your Java version is displayed properly. Such as:

The second step is to install Rjava, which installs the package directly in R or Rstudio. If you have just finished installing Java, remember to restart your R or Rstudio.

Focus: generally in the installation of R can choose 32-bit or 64-bit, try to install, run Ri386 3.1.2. If you're using Rstudio, set it to 32-bit, set method, Toolbars Tools > Global Options > General,r version, and change to 32-bit.

Direct Input Command installation: Install.packages ("Rjava") or select the installation package directly from the operator interface and select Rjava installation on Cran.

After installation, you need to add the following environment variable configuration under path ( sense path configuration does not work, can not match):

%java_home%\jre\bin\client;

%java_home%\jre\bin\server;

E:\programFiles\R\R-3.1.2\library\rJava\jri

Load the Rjava package, the library ("Rjava"), without prompting the error Rjava installation is successful.

R's: http://cran.rstudio.com/

Rstudio: http://www.rstudio.com/products/rstudio/#Desk

The third step is to install RWORDSEG.

rwordseg The project is currently published in R-forge , you cannot install the package function directly in R or Rstudio. Online has said (refer to Http://jliblog.com/app/rwordseg):

Can be installed directly under the latest version of R:

1
install.packages ("rwordseg"="http://R-Forge.R-project.org")

If it is an older version of the R , you can pass Source the way to install:

1
install.packages ("rwordseg"="http://R-Forge.R-project.org"="source") 

However, this installation is unsuccessful. After trying to download the package locally, it is possible to install it locally.

: Http://R-Forge.R-project.org/bin/windows/contrib/3.0/Rwordseg_0.2-1.zip

After the download is complete, select Install package from local zip file in R or Rstudio. After the installation is complete, load the package library ("Rwordseg"). Try using rwordseg as a simple example:

1
SEGMENTCN (c (" life is movement "" life is everywhere ) ")
[[1]]
[1] "life" is "movement"
[[2]]
[1] "Life" "Everywhere" "All" "scenery"

In addition, the R package in the Chinese document: http://download.csdn.net/detail/cl1143015961/8436741

This document describes in detail the functionality of the package, including how to do word segmentation, how to add deleted words, how to add a delete dictionary, and the dictionaries it supports, in addition to the. dic format, there are also. Scel (Sogou Input Method thesaurus). Sogou Input method of the Thesaurus http://pinyin.sogou.com/dict/, choose your own needs to do the classification to try it!

R language do text mining Part1

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.