The TEXTMINE Procedure

Example 24.8 Selecting Parts of Speech and Entities to Ignore

This example uses the data table that is generated in Example 24.1. If you want to eliminate prepositions, determiners, and proper nouns from your analysis, you can add a SELECT statement that lists these part-of-speech labels. If you also want to eliminate entities that are labeled "nlpDate," you can add another SELECT statement that includes "nlpDate" in the label list.

/* 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
   termwgt    = none
   cellwgt    = none
   reducef    = 1
   entities   = std
   outparent  = mycas.outparent
   outterms   = mycas.outterms
   outchild   = mycas.outchild
   outconfig  = mycas.outconfig
   ;
select "PPOS" "DET" "PN"/ignore;
select "nlpDate"/group="entities" ignore;
run;

data outterms; set mycas.outterms; run;
proc print data= outterms; run;

Output 24.8.1 shows the content of the mycas.outterms data table. You can see that prepositions, determiners, and proper nouns are excluded. Terms that are labeled "nlpDate" are also excluded.

Output 24.8.1: The mycas.outterms Data Table Ignoring Specified Parts of Speech and Entities

ObsTermRoleAttributeFreqnumdocs_keepKeyParentParent_id_isparWeight
1isVAlpha22Y191616.1
2wasVAlpha11Y201616.1
3brightAAlpha11Y1.1 1
4taurusNAlpha22Y2.2 1
5wonVAlpha11Y211212.1
6lime greennlpNounGroupAlpha11Y3.3 1
7limeAAlpha11Y4.4 1
8exceptVAlpha11Y5.5 1
9bright greennlpNounGroupAlpha11Y6.6 1
10colorNAlpha11Y7.7+1
11hyundainlpOrganizationEntity11Y8.8 1
12soldVAlpha22Y221717.1
13toyotanlpOrganizationEntity21Y9.9 1
14fordnlpOrganizationEntity22Y10.10 1
15allAAlpha11Y11.11 1
16winVAlpha11Y12.12+1
17colorsNAlpha11Y2377.1
18awardNAlpha11Y13.13 1
19lastAAlpha11Y14.14 1
20greenNAlpha22Y15.15 1
21beVAlpha33Y16.16+1
22sellVAlpha22Y17.17+1
23yearNAlpha33Y18.18 1


Last updated: November 11, 2020