[SOLVED] Problem with tokenize

jose
jose New Altair Community Member
edited November 2024 in Community Q&A
hello!

My question is this, so I have understood the tokenize operator divides the sentences into words. there is some way of dividing the prayers taking two words and not a word as usual the operator tokenize?.
Tagged:

Answers

  • text_miner
    text_miner New Altair Community Member
    Hi Jose,

    Are you asking if you can have terms of more than one word/token?  If so, the answer is yes.  After you tokenize, use the Generate n-Grams (Terms) operator.  This will generate phrases of n sequential tokens.  Note: you will still have the single terms in your term-by-document matrix too.  For example, generating 2-grams you would have "heart", "attack", and "heart attack" in the matrix.
  • jose
    jose New Altair Community Member
    ok, perfect,  thanks
  • km
    km New Altair Community Member
    How can I have only 2-grams and not 1-grams? e.g. "Heart Attack" and not "Heart" + "Attack" in the matrix?
  • MartinLiebig
    MartinLiebig
    Altair Employee
    Hi,

    i think there is no way from preventing it to generate the table. There is the option however to use a clever Regex in Select Attributes and simply remove them.

    ~Martin