Altair RISE
A program to recognize and reward our most engaged community members
Nominate Yourself Now!
Home
Discussions
Community Q&A
In N-Grams How to export to xls only 2, 3, 4 N-Grams Results
jmphillips
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.
Find more posts tagged with
AI Studio
Excel
Text Mining + NLP
Accepted answers
kayman
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.
All comments
kayman
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.
jmphillips
yo do it man !!! really thanks a lot for your help !!!
Regards
Quick Links
All Categories
Recent Discussions
Activity
Unanswered
日本語 (Japanese)
한국어(Korean)
Groups