Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

This operator works with buildTermCorpusPerGroup operator, where buildTermCorpusPerGroup builds the model and matchSimilarFromCorpusPerGroup operator matches the text to the corpus in the model and adds the columns those kept during building the model.

Operator Usage in Easy Mode

  1. Click + on the parent node.
  2. Enter the Match Similar From Corpus Per Group operator in the search field and select the operator from the Results to open the operator form.
  3. In the Table drop-down, enter or select the name of the table to run this operator on.
  4. In the Model Name drop-down, enter or select the name of the model.
  5. In the Grouping Column drop-down, enter or select the name of the column for grouping.
  6. In the Column drop-down, enter or select the name of the column that contains the text to extract TF-IDF features.
  7. Click Run to view the result.
  8. Click Save to add the operator to the playbook.
  9. Click Cancel to discard the operator form.

Usage Details

Uses the processed corpus from buildTermCorpusPerGroup and a new column of text to return the Cosine similarity.

```cplusplus LQL Command matchSimilarFromCorpusPerGroup(table: TableReference, modelName:String, groupColumn:String, column: String)

**Input Parameters**  
_table_ (TableReference)    -   Table name  
_modelName_ (String)    -   model name  
_groupColumn_ (String) - Column name of a group  
_column_    (String)    -   Column name that contains the text to extract TF-IDF features

**Returns**:  
Returns the greatest Cosine similarity score 'lhub_cosineSimilarity', ranging from 0.0 - 1.0, where 0.0 doesn't match, 1.0 perfectly matches from the TF-IDF terms from the saved corpus along with the columns defined at corpus creation in the columnsKeep argument with 'lhub_' prefix.

## Example

**Input**  
table and model name from buildTermCorpus operator

<style>
  th {
    border: 1px solid #cccccc;
    background-color: #eeeeee;
    padding: 8px 5px 8px 5px;
    text-align: left
  }
</style>

<div><table>
<thead>
<tr>
  <th>server</th>
<th>corpus</th>
</tr>
</thead>
<tbody>
  <tr><td>server1</td><td>h a c d i j b</td></tr>
  <tr><td>server1</td><td>gg aa ff jj c i b</td></tr>
  <tr><td>server2</td><td>k o m p n l q</td></tr>
</tbody>
</tr>
</table></div>

LQL command
``` {java}
matchSimilarFromCorpus(inputTable, "corpusModel", "server")
// table = inputTable
// model name that was created by buildTermCorpus operator = "corpusModel"
// buildTermCorpusPerGroup creates individual operator for each groups in "server" column so during matching it will load those models

Output

servercorpuslabeldomainlhub_confidence
server1h a c d i j bxgoogle more than 0..5
server1gg aa ff jj c i byfacebook more than 0.5
server2k o m p n l qzapplemore than 0.5

lable and domain columns are came from a corpusModel, where in the parameters it was set to keep ["label", "domain"] columns which would be added in the output based on matches. lhub_confidence is the best matches confidence score (e.g. cosine distance).

  • No labels