@Singleton @Path(value="/similarity") public final class Similarity extends AbstractOryxResource
Responds to a GET request to
/similarity/[itemID1](/[itemID2]/...)(?howMany=n)(&offset=o)(&rescorerParams=...)
Results are items that are most similar to a given item. Outputs contain item and score pairs, where the score is an opaque value where higher values mean more relevant to recommendation.
howMany
and offset
behavior, and output, are as in Recommend
.
Default output is CSV format, containing id,value
per line.
JSON format can also be selected by an appropriate Accept
header. It returns
an array of similarities, each of which has an "id" and "value" entry, like
[{"id":"I2","value":0.141348009071816},...]
INPUT_PRODUCER_KEY, MODEL_MANAGER_KEY
Constructor and Description |
---|
Similarity() |
Modifier and Type | Method and Description |
---|---|
List<IDValue> |
get(List<javax.ws.rs.core.PathSegment> pathSegmentsList,
int howMany,
int offset,
List<String> rescorerParams) |
check, check, checkExists, checkNotReadOnly, getServingModel, isReadOnly, maybeBuffer, maybeBuffer, maybeDecompress, parseMultipart, sendInput
getInputProducer, getServingModelManager, init
@GET @Path(value="{itemID : .+}") @Produces(value={"text/plain","text/csv","application/json"}) public List<IDValue> get(@PathParam(value="itemID") List<javax.ws.rs.core.PathSegment> pathSegmentsList, @DefaultValue(value="10") @QueryParam(value="howMany") int howMany, @DefaultValue(value="0") @QueryParam(value="offset") int offset, @QueryParam(value="rescorerParams") List<String> rescorerParams) throws OryxServingException
OryxServingException
Copyright © 2014–2018. All rights reserved.