You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Inside that function, it's actually first getting the content ids that it's matching. To help us prepare for a future implementation that allows returning more information, it might be useful to provide a test/debug API that returns the content ids.
hash/content -> [content_ids[id, ?distance]]
This could help inform a future implementation that uses the ids.
On Distance
SignalType has a concept of distance, which currently lives here.
So now let's bubble up the distance to the REST API.
An index might returning you a distance object which is stringable, or an "empty distance" which strings to " - ".
Dealers choice about whether the API should either:
Always return distance if it has it
Optionally brute force the distance from the id based on a param (include_distance=True)
Followups
It's unclear what the "default" output of matching should be. It seems like most potential users are interested in the metadata of the match (not just the banks), and so returning the bank content id seems like it might be needed in every case.
The text was updated successfully, but these errors were encountered:
Dcallies
changed the title
Write issue for Distance on the match API
[hma] Add optional distance parameter in match API
Mar 27, 2024
Currently the only match API is based on banks:
hash/content -> [banks]
Inside that function, it's actually first getting the content ids that it's matching. To help us prepare for a future implementation that allows returning more information, it might be useful to provide a test/debug API that returns the content ids.
hash/content -> [content_ids[id, ?distance]]
This could help inform a future implementation that uses the ids.
On Distance
SignalType has a concept of distance, which currently lives here.
However, not all indices are capable of returning distance, though it seems that PDQ does, unlike what I had said in an earlier discussion: https://github.com/facebook/ThreatExchange/blob/main/python-threatexchange/threatexchange/signal_type/pdq/pdq_index.py#L49-L61
So now let's bubble up the distance to the REST API.
An index might returning you a distance object which is stringable, or an "empty distance" which strings to " - ".
Dealers choice about whether the API should either:
Followups
It's unclear what the "default" output of matching should be. It seems like most potential users are interested in the metadata of the match (not just the banks), and so returning the bank content id seems like it might be needed in every case.
The text was updated successfully, but these errors were encountered: