Table of Contents
N-gram transformation
Table of Contents
The N-gram transformation can extract n-grams from free text fields, such as descriptions, and use those n-grams (words) in a LookupCache transformation to find the correct tags. For example, it can take the IPTC description, extract the words, and check them against a keyword list for tagging.
Input: "this is the new Breithorn Release of Fotoware Alto"
NGramTransformation:
- Size: 1
- Minimum word length: 5
- Maximum word length: leave empty
Output: Breithorn Release Fotoware Alto
Input: "this is the new Breithorn Release of Fotoware Alto"
NGramTransformation:
- Size: 2
- Minimum word length: 5
- Maximum word length: leave empty
Output: Breithorn Release
Specific definitions
| fourof | |
|---|---|
| kind | NGramTransformation |
| Size |
The maximum size of n-gram, if set to 3 would produce unigram, bigram, and trigram. The size depends on punctuation and not characters, so size should be set to the longest words in my keyword list. |
| Minimum word length | Minimum word length: minimum length a word must have to be considered for the n-gram production |
| Maximum word length | Maximum word length: maximum length a word can have to be considered for the n-gram production |
Transform the input into 4 words with a minimum of one character
{
"kind": "NGramTransformation",
"size": 4,
"minWordLength": 1,
"maxWordLength": null,
"traceRefId": null
},