Warning
This component will be available in the Palette of
Talend Studio on the condition that you have subscribed to one of
the Talend Platform products.
Component family |
Data Quality |
|||
Function |
tSynonymSearch reads input data For further information about how to create a synonym index and For further information about how to access and manage the words For further information about available synonym indexes, see the NoteThe synonym similarity computation is enhanced since the
|
|||
Purpose |
tSynonymSearch searches a given |
|||
Basic settings |
Schema and Edit |
A schema is a row description, it defines the number of fields to be processed and Since version 5.6, both the Built-In mode and the Repository mode are Default columns are provided in the schema of this component in For further information about the default schema columns, see |
||
|
|
Built-in: The schema will be |
||
|
|
Repository: The schema already |
||
|
Limit of each group |
Type in a number to indicate the maximum display of the reference If the entries count exceeds the indicated limit, this component |
||
|
Columns to search |
Complete this table to provide parameters used to match the input The columns to be completed are: – Input column: select the – Reference output column: – Index path: enter, in – Search mode: select the search – Score threshold (available for The score value is returned by the Lucene engine and can be – Min similarity (based on the – Word distance (available for – Limit: type in a number to |
||
Advanced settings |
tStatCatcher Statistics |
Select this check box to collect log data at the Job and the |
||
Connections |
Outgoing links (from this component to another): Row: Main; Reject
Trigger: Run if; On Component Ok; Incoming links (from one component to this one): Row: Main; Reject For further information regarding connections, see |
|||
Global Variables |
ERROR_MESSAGE: the error message generated by the A Flow variable functions during the execution of a component while an After variable To fill up a field or expression with a variable, press Ctrl + For further information about variables, see Talend Studio |
|||
Usage |
This component needs incoming data from the preceding |
This section presents the detailed information about the default schema columns
provided natively with the tSynonymSearch
component.
Columns |
Description |
---|---|
GID |
Group IDs. These IDs are created automatically at runtime to |
GRP_SIZE |
Numbers of the matched reference entries for each group of the |
SCORE |
Lucene score used to measure in total the match degree between |
SCORES |
Lucene scores used to measure the match degree between each |
NB_MATCHED _FIELDS |
Number of the input columns you have selected for the matching |
In addition to the matching-related information presented in the default schema
columns, you need to define more columns in order to output the input data and their
matched reference entries.
In this scenario, a three-component Job reads the provided first name data, searches a
given synonym index for reference entries that match the input data and then outputs the
results.
Create a first-name synonym index for this Job following the procedures outlined in
Scenario 2: Creating a synonym index for people names using tMap.
The three components used in this Job are:
-
tFixedFlowInput: this component generates the
input data you will match against the reference entries in the synonym
index. -
tSynonymSearch: this component searches for
the matched reference entries in the synonym index. -
tLogRow (found): this
component lists the result of this matching search.
-
Drop tFixedFlowInput, tSynonymSearch and tLogRow from the Palette
onto the design workspace.You can change the displayed name of each of these component as what has
been done for the tLogRow component, named
found in this scenario. For further information,
see Talend Studio User Guide. -
Right-click the tFixedFlowInput component
to open the contextual menu and select Row > Main. -
Drop the link on the tSynonymSearch
component to create an connection between these two components. -
Do the same thing to connect tSynonymOutput to tLogRow
(found).
-
Double-click tFixedFlowInput to open its
Basic settings view. -
Next to the Schema field, click the
Edit schema button to open the
[Schema] dialog box, add one column and
name it FIRSTNAME. When done, click OK to validate these changes and close the dialog
box. -
In the Mode area, select the Use Inline Content (delimited file) option, and
supply the following names in the Content
field:1234KristofChrisTonyAnton -
Double-click tSynonymSearch to open its
Basic settings view. -
Click Sync columns to add the schema
columns of its preceding component to the default schema columns of
tSynonymSearch.When prompted, click Yes to propagate the
changes to the next component. -
Click the […] button next to Edit schema to open the [Schema] dialog box, and add one column to the output
schema: matched_fname.This column will hold the matched reference entries in the output
flow.When done, click OK to validate the
setting and accept propagating the changes when prompted. -
In the Limit of each group field, type in
5 to replace the default value. -
Under the Columns to search table, click
the [+] button to add one row and define
the parameters as follows:-
In the Input column column,
select FIRSTNAME from the list of the input
columns. -
In the Reference output column
column, select matched_fname from the list of
the output columns. -
In the Index path column, type in
the path to the synonym index to be used, between double quotation
marks. -
In the Search mode column, select
Match all fuzzy. This will match each word
of the input string against similar word of the index string. -
In the Score threshold column,
enter 0.9 to filter results and list only terms
with higher similarity. -
In the Min similarity column,
keep the default value 0.8 as the minimum
similarities requested in a token to match an index string. When the
value is closer to 1, only terms with higher similarity will be
matched. -
Leave the Word distance column as
it is only for the Match partial mode. -
In the Limit column, leave the
default value 5.
-
-
In the Basic settings view of the
tLogRow component, select the Table option for better readable display of the
Job execution result.
-
Press F6 to run this Job.
The execution result reads as follows in the console of the Run view.
From this result, you can see that each first name of the input string
matches a similar word of the index string. For example, the entry Chris from the input flow is found to fuzzy
match 5 words in the given synonym index. And this
record is recognized as group 2 that has a group size
equal to 5, meaning that five matched reference entries
are found for this group.The SCORE and the SCORES columns
present the same values in this scenario because only one input column is
used.If you want to extract only the input entries that match exactly an index
string, select Match exact in the Search mode column in tSynonymSearch basic settings.
In this scenario, you are going to use the previous Job with slight modifications on
it in order to search two synonym indexes for input data from two columns.
In addition to the index used earlier, another index is used alongside holding the
last name data, for example, Correia, Corria,
Toum, Toom, toom,
Walker, Waker.
To replicate this scenario, open the Job created in the previous section and proceed
as follows:
-
Double-click tFixedFlowInput to open its
Basic settings view. -
Next to Edit schema, click the […] button to open the [Schema] dialog box, and add a second column
LASTNAME next to the FIRSTNAME
column you have defined in the previous scenario.When done, click OK to validate this
change and thus close the dialog box. -
In the Content field of the Mode area, add more first name and last name data
to make the input data read as
follows:123456Kristof;ToumChris;ToomTony;WalkerAnton;CorreiaJim;CorreiaJim;Walker -
Double-click tSynonymSearch to open its
Basic settings view. -
Click Sync columns to synchronize the
columns of this component with the preceding one and click Yes to propagate the changes to the next
component when prompted. -
Click the […] button next to Edit schema to open the [Schema] dialog box, and add two columns to the output
schema: matched_fname and
matched_lname.These columns will hold the matched reference entries in the output
flow.When done, click OK to validate the
setting and accept propagating the changes when prompted. -
In the Limit of each group field, type in
10 to replace the one you have defined in the
previous scenario. -
Under the Columns to search table, click
the [+] button to add a second row and
define the parameters as follows:-
In the Input column column,
select LASTNAME from the drop-down list. -
In the Reference output column
column, select matched_lname from the drop-down
list. -
In the Index path column, type
in, between quotation marks, the path to the synonym index holding
the last name entries. -
In the Search mode column, select
Match exact for both input columns. This
will match the exact input word against an exact index word. -
In the Score threshold column,
enter 0.9 to filter results and list only terms
with higher similarity. -
Leave the Min similarity and
Word distance columns as they
are only for the fuzzy modes and the Match
partial mode respectively. -
In the Limit column of this row,
leave the default value 5.
-
-
Press F6 to run this Job.
The execution result reads as follows in the console of the Run view.
From this result, if you take the input data Chris
Toom for example, you can see that:
-
this record is recognized as group 2 with a group size equal to 3. This
means that 3 pairs of exact match reference entries are found from the two
synonym indexes in use. The exact match for the first name are
Christian, Christiaan and
Christoffel, and the exact match for the last name
are toomx3. -
the SCORES column contains two sub-columns.
These sub-columns present the matching scores in regards to the
matched_fname and to the
matched_lname reference columns respectively. Each
figure listed in the SCORE column is equal to the sum
of the two figures of the same row in the sub-columns of the
SCORES column.