The TEXTMINE Procedure

Example 24.1 Parsing with No Options Turned On

This example parses five documents, which are in a generated data table. The following DATA step generates the five documents:

/* 1)  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;

The following statements run PROC TEXTMINE to parse the documents.

/* 2) starting code */
proc textmine data=mycas.CarNominations;
doc_id i;
var text;
parse
   nostemming notagging nonoungroups
   termwgt        = none
   cellwgt        = none
   reducef        = 1
   entities       = none
   outparent      = mycas.outparent
   outterms       = mycas.outterms
   outchild       = mycas.outchild
   outconfig      = mycas.outconfig
   ;
run;

/* 3) print outterms data table */
data outterms; set mycas.outterms; run;
proc print data=outterms; run;

Output 24.1.1 shows the content of the mycas.outterms data table. In this example, stemming, part-of-speech tagging, and noun group extraction are suppressed and NONE is specified for entity identification, term and cell weighting, and term filtering. No synonym list, multiterm list, or stop list is specified. As a result of this configuration, there is no child term in the mycas.outterms data table. Also, the mycas.outparent data table and the mycas.outchild data table are exactly the same. The TEXTMINE procedure automatically drops punctuation and numbers.

Output 24.1.1: The mycas.outterms Data Table

ObsTermRoleAttributeFreqnumdocs_keepKeyParentParent_id_isparWeight
1all Alpha11Y1.1 1
2toyota Alpha21Y2.2 1
3ford Alpha22Y3.3 1
4tacoma Alpha11Y4.4 1
5year Alpha33Y5.5 1
6taurus Alpha22Y6.6 1
7won Alpha11Y7.7 1
8honda Alpha11Y8.8 1
9bright Alpha11Y9.9 1
10sold Alpha22Y10.10 1
11colors Alpha11Y11.11 1
12lime Alpha11Y12.12 1
13except Alpha11Y13.13 1
14hyundai Alpha11Y14.14 1
15in Alpha33Y15.15 1
16is Alpha22Y16.16 1
17for Alpha11Y17.17 1
18world Alpha22Y18.18 1
19green Alpha22Y19.19 1
20the Alpha85Y20.20 1
21of Alpha22Y21.21 1
22award Alpha11Y22.22 1
23was Alpha11Y23.23 1
24car Alpha22Y24.24 1
25insight Alpha11Y25.25 1
26last Alpha11Y26.26 1


Last updated: November 11, 2020