The TEXTMINE Procedure

Example 24.2 Parsing with Stemming

This example uses the data table that is generated in Example 24.1. The following statements run PROC TEXTMINE to parse the documents. Because the NOSTEMMING option is not specified in the PARSE statement, words are stemmed (the default).

/* create data table */
data mycas.CarNominations;
infile datalines delimiter='|' missover;
length text $70 ;
input text$ i;
datalines;
   The Ford Taurus is the World Car of the Year. |1
   Hyundai won the award last year. |2
   Toyota sold the Toyota Tacoma in bright green. |3
   The Ford Taurus is sold in all colors except for lime green. |4
   The Honda Insight was World Car of the Year in 2008. |5
   ;
run;

proc textmine data=mycas.CarNominations;
doc_id i;
var text;
parse
   notagging nonoungroups
   termwgt  = none
   cellwgt  = none
   reducef  = 1
   entities = none
   outparent= mycas.outparent
   outterms = mycas.outterms
   outchild = mycas.outchild
   outconfig= mycas.outconfig
   ;
run;
data outterms; set mycas.outterms; run;
proc print data = outterms; run;

Output 24.2.1 shows the content of the mycas.outterms data table. In this example, words are stemmed. You can see that the term "sold" now stems to the parent term "sell." Also, the mycas.outparent data table and the mycas.outchild data table are different. The parent term "sell" shows up in mycas.outparent (key=11), but not the child term "sold" (key=27). Only "sold" appears in the mycas.outchild data table, and "sell" does not appear.

Output 24.2.1: The mycas.outterms Data Table with Stemming

ObsTermRoleAttributeFreqnumdocs_keepKeyParentParent_id_isparWeight
1all Alpha11Y1.1 1
2win Alpha11Y2.2+1
3toyota Alpha21Y3.3 1
4ford Alpha22Y4.4 1
5tacoma Alpha11Y5.5 1
6year Alpha33Y6.6 1
7taurus Alpha22Y7.7 1
8won Alpha11Y2622.1
9honda Alpha11Y8.8 1
10bright Alpha11Y9.9 1
11be Alpha33Y10.10+1
12sold Alpha22Y271111.1
13sell Alpha22Y11.11+1
14colors Alpha11Y282323.1
15lime Alpha11Y12.12 1
16except Alpha11Y13.13 1
17hyundai Alpha11Y14.14 1
18in Alpha33Y15.15 1
19is Alpha22Y291010.1
20for Alpha11Y16.16 1
21world Alpha22Y17.17 1
22green Alpha22Y18.18 1
23the Alpha85Y19.19 1
24of Alpha22Y20.20 1
25award Alpha11Y21.21 1
26was Alpha11Y301010.1
27car Alpha22Y22.22 1
28color Alpha11Y23.23+1
29insight Alpha11Y24.24 1
30last Alpha11Y25.25 1


Last updated: November 11, 2020