In N-Grams How to export to xls only 2, 3, 4 N-Grams Results
jmphillips
New Altair Community Member
Hello community: can you help me with this problem...... I want see in the end of the process in excel for example, only 2-Grams, or 3-Grams results.
Thanks a lot !
Regards.
Thanks a lot !
Regards.
Tagged:
0
Best Answer
-
Use filter tokens.
The logic of n-grams is that it adds underscores, so if you have 1 underscore you know it's a bigram, 2 is a trigram and so on.
So a regex as below would filter out bigrams, but you can extend to add additional grams.
^[^_]+_[^_]+$
Read as : start at beginning of word, take everything except an underscore, an underscore, and again everything except an underscore until the end of the word. So whatever matches must be a bigram.5
Answers
-
Use filter tokens.
The logic of n-grams is that it adds underscores, so if you have 1 underscore you know it's a bigram, 2 is a trigram and so on.
So a regex as below would filter out bigrams, but you can extend to add additional grams.
^[^_]+_[^_]+$
Read as : start at beginning of word, take everything except an underscore, an underscore, and again everything except an underscore until the end of the word. So whatever matches must be a bigram.5 -
yo do it man !!! really thanks a lot for your help !!!
Regards1