This is a demo of using the ranking and recommendation framework in javaxsx.
Do you want to write a recommendation system in only 8 lines? Try javaxsx here:
<dependency>
<groupId>com.eroelf</groupId>
<artifactId>javaxsx</artifactId>
<version>${version}</version>
</dependency>
The working flow is defined as the following 8 steps:
-
Parse request parameters.
-
Create a Converter instance for converting back-end data to the front-end data the requester need.
-
Create a FlowHandler instance defining the entire working flow behaviors, including the requester statistics computation, candidates generator, recall Strategies, Modelers for calculating features, and Scorers for running models to give out the final scores.
-
Create an ItemFilterHandler to deal with Item filters.
-
Create an ItemGenerator assembling all the requesting information, the FlowHandler, and the ItemFilterHandler.
-
Invoke the ItemGenerator::generate method to get the featured and scored Item list.
-
Sort the Item list.
-
Use the Converter instance created in step 2 to convert the back-end product (Item) list to a front-end product (Info) list, as well as logging necessary information for each Info object to a logger data structure (InfoLog).
An Enumerable working flow means that the Item candidates can be recalled by one or more simple enumerating progresses.
An Innumerable working flow means that the Item candidates cannot be recalled by enumerating, but only by Strategies, meaning that one cannot obtain all candidates until all those Strategies are executed.
Candidates given by a Strategy can be either enumerable or innumerable. This demo shows both cases.
Please note that the innumerable working flow can also deal with the enumerable working flow, choices would be made due to personal preferences.
-
Enumerable: com.eroelf.demo.modeling.flow.enumerable.Main
-
Innumerable: com.eroelf.demo.modeling.flow.innumerable.Main
One invoking of the main function simulates one request. The demo shows what roles those components play in the whole progress, as well as how the working flow assembles them and works with the data flow.
Please note that since there is no real data, the demo would not give out correct result and even would throw exceptions.
Please refer to the javaxsx Javadoc for further information.