Fingerprints
Smart Filters (called Fingerprints in the API for legacy reasons) enable concept search over Items in a project.
Methods
Fingerprint CRUD
List Fingerprints
GET https://squirro-endpoint/api/topic/v0/(string: tenant)/projects/(id: project_id)/fingerprints
Returns an array of all fingerprints on the project.
Parameters: |
|
---|---|
Headers: | See Common Headers. |
Status Codes: |
See also Common Status Codes. |
Returns: | Array of fingerprints. Only the permanent fingerprints are returned (where [ { "temporary": false, "name": "WBC-AX", "noise_level": null, "type_id": "lgw6KXANRnKJOTM9MCShpg", "title": "WBC.AX", "manual": false, "locked": false, "type": "project", "tags": "stock" } ] |
Create Unnamed Fingerprint
POST https://squirro-endpoint/api/topic/v0/(string: tenant)/fingerprint/{string: type}/{string: type_id}
Creates a new, empty and temporary fingerprint. The fingerprint can be trained separately and to save it permanently, it will need to be moved.
Parameters: |
|
---|---|
JSON Data: | Data is passed in as a JSON object. Valid object keys (all optional):
|
Headers: | See Common Headers. |
Status Codes: |
See also Common Status Codes. |
Returns: | The created fingerprint. { "config": { "features": {}, "filter_min_score": null, "default_manual_features_lang": null, "gdfs_type": "", "coefficients": { "item_recentness": 0.0, "item_score": 0.0, "item_lang": 0.0, "features_similarity": 1.0 }, "basetopic": [], "smartfilter_query": null, "manual_features": null, "items": [], "max_features_per_language": 30, "exclude_features": {}, "negative_items": [], "features_similarity_score_min": null, "features_similarity_score_max": null, "content": [] }, "temporary": true, "name": "smart-filter-2", "noise_level": null, "tags": null, "type_id": "lgw6KXANRnKJOTM9MCShpg", "manual": false, "title": "WBC.AX", "type": "project", "locked": false } |
Get Fingerprint
GET https://squirro-endpoint/api/topic/v0/(string: tenant)/fingerprint/{string: type}/{string: type_id}/{string: name}
Returns details of a fingerprint.
Parameters: |
|
---|---|
Headers: | See Common Headers. |
Status Codes: |
See also Common Status Codes. |
Returns: | The fingerprint. { "temporary": false, "name": "WBC-AX", "noise_level": null, "tags": null, "type": "project", "title": "WBC.AX", "manual": false, "records": { "positive": [ { "lang": "en", "text": "Westpac Banking Corporation (Westpac), is a banking organization. Westpac provides …", "created_at": "2014-12-16T17:28:58", "id": "L1H8BxRGRgakrrs_Dmbg_A", "source": "content" } ] }, "type_id": "lgw6KXANRnKJOTM9MCShpg", "locked": false, "config": { "smartfilter_query": null, "features": { "en": [ { "weight": 4.7, "value": "\"financial service\"", "label": "\"financial services\"" }, { "weight": 4.6, "value": "\"westpac banking\"", "label": "\"Westpac Banking\"" }, { "weight": 4.4, "value": "westpac", "label": "Westpac" } ] }, "exclude_features": {}, "items": [], "max_features_per_language": 30, "negative_items": [], "content": [ { "lang": "en", "text": "Westpac Banking Corporation (Westpac), is a banking organization. Westpac provides …", "created_at": "2014-12-16T17:28:58", "id": "L1H8BxRGRgakrrs_Dmbg_A", "source": "content" } ], "features_similarity_score_min": null, "filter_min_score": null, "features_similarity_score_max": null, "default_manual_features_lang": null, "gdfs_type": "", "manual_features": null, "coefficients": { "item_recentness": 0.0, "item_score": 0.0, "item_lang": 0.0, "features_similarity": 1.0 }, "basetopic": [] } } |
Create Named Fingerprint
POST https://squirro-endpoint/api/topic/v0/(string: tenant)/fingerprint/{string: type}/{string: type_id}/{string: name}
Creates a new, empty and temporary fingerprint with a specific name. The fingerprint can be trained separately and to save it permanently, it will need to be moved.
Parameters: |
|
---|---|
JSON Data: | Data is passed in as a JSON object. The same data is valid as for the Create Unnamed Fingerprint method. |
Headers: | See Common Headers. |
Status Codes: |
See also Common Status Codes. |
Returns: | The created fingerprint. { "config": { "features": {}, "filter_min_score": null, "default_manual_features_lang": null, "gdfs_type": "", "coefficients": { "item_recentness": 0.0, "item_score": 0.0, "item_lang": 0.0, "features_similarity": 1.0 }, "basetopic": [], "smartfilter_query": null, "manual_features": null, "items": [], "max_features_per_language": 30, "exclude_features": {}, "negative_items": [], "features_similarity_score_min": null, "features_similarity_score_max": null, "content": [] }, "temporary": true, "name": "WBC-AX", "noise_level": null, "tags": null, "type_id": "lgw6KXANRnKJOTM9MCShpg", "manual": false, "title": "WBC.AX", "type": "project", "locked": false } |
Update Fingerprint
PUT https://squirro-endpoint/api/topic/v0/(string: tenant)/fingerprint/{string: type}/{string: type_id}/{string: name}
Updates a fingerprint.
Parameters: |
|
---|---|
JSON Data: | Data is passed in as a JSON object. The same data is valid as for the Create Unnamed Fingerprint method. |
Headers: | See Common Headers. |
Status Codes: |
See also Common Status Codes. |
Returns: | The modified fingerprint. { "config": { "features": {}, "filter_min_score": null, "default_manual_features_lang": null, "gdfs_type": "", "coefficients": { "item_recentness": 0.0, "item_score": 0.0, "item_lang": 0.0, "features_similarity": 1.0 }, "basetopic": [], "smartfilter_query": null, "manual_features": null, "items": [], "max_features_per_language": 30, "exclude_features": {}, "negative_items": [], "features_similarity_score_min": null, "features_similarity_score_max": null, "content": [] }, "temporary": true, "name": "WBC-AX", "noise_level": null, "tags": null, "type_id": "lgw6KXANRnKJOTM9MCShpg", "manual": false, "title": "WBC.AX", "type": "project", "locked": false } |
Delete Fingerprint
DELETE https://squirro-endpoint/api/topic/v0/(string: tenant)/fingerprint/{string: type}/{string: type_id}/{string: name}
Deletes the fingerprint of the given name.
Parameters: |
|
---|---|
Headers: | See Common Headers. |
Status Codes: |
See also Common Status Codes. |
Copy Fingerprint
POST https://squirro-endpoint/api/topic/v0/(string: tenant)/fingerprint/{string: type}/{string: type_id}/{string: name}/copy
Creates a copy of the fingerprint with a new name. The resulting copy is temporary fingerprint with a specific name. To save it permanently, it needs to be moved.
Parameters: |
|
---|---|
Headers: | See Common Headers. |
Status Codes: |
See also Common Status Codes. |
Returns: | The new fingerprint. { "config": { "features": {}, "filter_min_score": null, "default_manual_features_lang": null, "gdfs_type": "", "coefficients": { "item_recentness": 0.0, "item_score": 0.0, "item_lang": 0.0, "features_similarity": 1.0 }, "basetopic": [], "smartfilter_query": null, "manual_features": null, "items": [], "max_features_per_language": 30, "exclude_features": {}, "negative_items": [], "features_similarity_score_min": null, "features_similarity_score_max": null, "content": [] }, "temporary": true, "name": "WBC-AX-copy-4", "noise_level": null, "tags": null, "type_id": "lgw6KXANRnKJOTM9MCShpg", "manual": false, "title": "WBC.AX", "type": "project", "locked": false } |
Move Fingerprint
POST https://squirro-endpoint/api/topic/v0/(string: tenant)/fingerprint/{string: type}/{string: type_id}/{string: name}/move
Moves a fingerprint over an existing fingerprint. The resulting copy is temporary fingerprint with a specific name. Moving results in the fingerprint being permanent, so this action needs to be executed on a temporary fingerprint to save it permanently.
Parameters: |
|
---|---|
JSON Data: | Data is passed in as a JSON object. Valid object keys:
|
Headers: | See Common Headers. |
Status Codes: |
See also Common Status Codes. |
Returns: | The fingerprint. { "config": { "features": {}, "filter_min_score": null, "default_manual_features_lang": null, "gdfs_type": "", "coefficients": { "item_recentness": 0.0, "item_score": 0.0, "item_lang": 0.0, "features_similarity": 1.0 }, "basetopic": [], "smartfilter_query": null, "manual_features": null, "items": [], "max_features_per_language": 30, "exclude_features": {}, "negative_items": [], "features_similarity_score_min": null, "features_similarity_score_max": null, "content": [] }, "temporary": false, "name": "WBC-AX", "noise_level": null, "tags": null, "type_id": "lgw6KXANRnKJOTM9MCShpg", "manual": false, "title": "WBC.AX", "type": "project", "locked": false } |
Change Fingerprint Locking
PUT https://squirro-endpoint/api/topic/v0/(string: tenant)/fingerprint/{string: type}/{string: type_id}/{string: name}/protection
Changes the locking state of a fingerprint. A locked fingerprint can not be modified, except if the lock is first remove.
Parameters: |
|
---|---|
JSON Data: | Data is passed in as a JSON object. Valid object keys:
|
Headers: | See Common Headers. |
Status Codes: |
See also Common Status Codes. |
Validate Fingerprint
POST https://squirro-endpoint/api/topic/v0/fingerprint/validate
Validates a fingerprint without saving. This is useful when providing an editing interface for the manual fingerprint to give the user some feedback.
JSON Data: | Data is passed in as a JSON object. Valid object keys:
|
---|---|
Headers: | See Common Headers. |
Status Codes: |
See also Common Status Codes. |
Returns: | The validation result. In case of success: en empty dictionary. {} In case of an attribute error an error message is returned: {"error": "invalid attribute value"} If the manual features have an error, a list of errors is returned: [ { "line": 1, "value": "foo,en", "error": "weight must be numeric" } ] |
Training
Fingerprints are trained with text documents.
Train from Text
POST https://squirro-endpoint/api/topic/v0/(string: tenant)/fingerprint/{string: type}/{string: type_id}/{string: name}/content
Adds a new training document to the fingerprint.
Parameters: |
|
---|---|
JSON Data: | Data is passed in as a JSON list. Each list entry is a dictionary with these keys:
|
Headers: | See Common Headers. |
Status Codes: |
See also Common Status Codes. |
Update Training from Content
POST https://squirro-endpoint/api/topic/v0/(string: tenant)/fingerprint/{string: type}/{string: type_id}/{string: name}/content/{string: record_id}
Edits a training document in the fingerprint.
Parameters: |
|
---|---|
JSON Data: | Data is passed in as a JSON object. The same input is used as the individual entries of Train from Text. |
Headers: | See Common Headers. |
Status Codes: |
See also Common Status Codes. |
Delete Training Content
DELETE https://squirro-endpoint/api/topic/v0/(string: tenant)/fingerprint/{string: type}/{string: type_id}/{string: name}/content/{string: record_id}
Deletes a training document from the fingerprint.
Parameters: |
|
---|---|
Headers: | See Common Headers. |
Status Codes: |
See also Common Status Codes. |
Train from Item
POST https://squirro-endpoint/api/topic/v0/(string: tenant)/fingerprint/{string: type}/{string: type_id}/{string: name}/items
A Squirro item can be added directly to a fingerprint for training with this method.
Parameters: |
|
---|---|
JSON Data: | Data is passed in as a JSON object. Valid object keys:
|
Headers: | See Common Headers. |
Status Codes: |
See also Common Status Codes. |
Delete Training Item
DELETE https://squirro-endpoint/api/topic/v0/(string: tenant)/fingerprint/{string: type}/{string: type_id}/{string: name}/items/{string: record_id}
Deletes a training item from the fingerprint.
Parameters: |
|
---|---|
Headers: | See Common Headers. |
Status Codes: |
See also Common Status Codes. |