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
| Obs | Term | Role | Attribute | Freq | numdocs | _keep | Key | Parent | Parent_id | _ispar | Weight |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | all | Alpha | 1 | 1 | Y | 1 | . | 1 | 1 | ||
| 2 | toyota | Alpha | 2 | 1 | Y | 2 | . | 2 | 1 | ||
| 3 | ford | Alpha | 2 | 2 | Y | 3 | . | 3 | 1 | ||
| 4 | tacoma | Alpha | 1 | 1 | Y | 4 | . | 4 | 1 | ||
| 5 | year | Alpha | 3 | 3 | Y | 5 | . | 5 | 1 | ||
| 6 | taurus | Alpha | 2 | 2 | Y | 6 | . | 6 | 1 | ||
| 7 | won | Alpha | 1 | 1 | Y | 7 | . | 7 | 1 | ||
| 8 | honda | Alpha | 1 | 1 | Y | 8 | . | 8 | 1 | ||
| 9 | bright | Alpha | 1 | 1 | Y | 9 | . | 9 | 1 | ||
| 10 | sold | Alpha | 2 | 2 | Y | 10 | . | 10 | 1 | ||
| 11 | colors | Alpha | 1 | 1 | Y | 11 | . | 11 | 1 | ||
| 12 | lime | Alpha | 1 | 1 | Y | 12 | . | 12 | 1 | ||
| 13 | except | Alpha | 1 | 1 | Y | 13 | . | 13 | 1 | ||
| 14 | hyundai | Alpha | 1 | 1 | Y | 14 | . | 14 | 1 | ||
| 15 | in | Alpha | 3 | 3 | Y | 15 | . | 15 | 1 | ||
| 16 | is | Alpha | 2 | 2 | Y | 16 | . | 16 | 1 | ||
| 17 | for | Alpha | 1 | 1 | Y | 17 | . | 17 | 1 | ||
| 18 | world | Alpha | 2 | 2 | Y | 18 | . | 18 | 1 | ||
| 19 | green | Alpha | 2 | 2 | Y | 19 | . | 19 | 1 | ||
| 20 | the | Alpha | 8 | 5 | Y | 20 | . | 20 | 1 | ||
| 21 | of | Alpha | 2 | 2 | Y | 21 | . | 21 | 1 | ||
| 22 | award | Alpha | 1 | 1 | Y | 22 | . | 22 | 1 | ||
| 23 | was | Alpha | 1 | 1 | Y | 23 | . | 23 | 1 | ||
| 24 | car | Alpha | 2 | 2 | Y | 24 | . | 24 | 1 | ||
| 25 | insight | Alpha | 1 | 1 | Y | 25 | . | 25 | 1 | ||
| 26 | last | Alpha | 1 | 1 | Y | 26 | . | 26 | 1 |