Created
December 22, 2013 18:57
-
-
Save rjurney/8086790 to your computer and use it in GitHub Desktop.
Working sentence tokenization in Pig/varaha!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
reviews = LOAD '/tmp/reviews.avro' USING AvroStorage(); | |
reviews = LIMIT reviews 1000; | |
bar = FOREACH reviews GENERATE business_id, FLATTEN(varaha.text.SentenceTokenize(text)) AS sentences; | |
DUMP bar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(7kAXbY8hjHhC-nZKR2Embg,{(I),(remember),(Golf),(Digest),(did),(a),(list),(of),(Top),(25),(College),(Courses),(and),(this),(did),(n't),(make),(it),(,),(which),(I),(thought),(was),(nuts),(.)}) | |
(7kAXbY8hjHhC-nZKR2Embg,{(My),(only),(complaint),(is),(that),(the),(course),(is),(n't),(really),(as),(luxurious),(as),(the),(peak),(season),(rate),(would),(indicate),(.)}) | |
(7kAXbY8hjHhC-nZKR2Embg,{(Also),(,),(as),(the),(other),(guys),(who),(reviewed),(this),(mentioned),(,),(there),(is),(some),(fantastic),(ASU),(swag),(available),(in),(the),(shop),(if),(you),(are),(a),(fan),(,),(they),(probably),(have),(every),(variety),(you),(could),(ever),(imagine),(.)}) | |
(7kAXbY8hjHhC-nZKR2Embg,{(Have),(n't),(eaten),(there),(but),(Ted),('s),(Hot),(Dogs),(is),(close),(enough),(that),(you),('d),(be),(crazy),(not),(to),(go),(there),(after),(your),(round),(.)}) | |
(7lbvsGKzhjuX3oJtaXJvOg,{(This),(store),(has),(the),(most),(pleasant),(employees),(of),(any),(Forever),(21),(I),(have),(ever),(been),(to),(.)}) | |
(7lbvsGKzhjuX3oJtaXJvOg,{(The),(girls),(are),(always),(smiling),(and),(they),(take),(the),(time),(to),(esquire),(if),(you),(need),(help),(.)}) | |
(7lbvsGKzhjuX3oJtaXJvOg,{(The),(other),(day),(,),(I),(went),(in),(and),(an),(employee),(spent),(over),(10),(minutes),(helping),(me),(locate),(a),(particular),(skirt),(my),(sister),(wanted),(for),(Christmas),(.)}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment