Content recommendation API Using Python3
docker-compose up --build
. This will download the needed packages and run the app in the foreground.Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)
when it is done.curl localhost:5000/api/recommend/v1.0/<corpus_name> -X GET -d 'url=http://www.symmetrymagazine.org/article/scientists-salvage-insights-from-lost-satellite'
, you should see a json document returned from the engine. See the list of available corpora below, you will need to add it to the API call.The available corpora are:
wiki-simple
: this currently returns the document ids and scores of the 5 most relevant articles from the simple wikipedia corpus.If you write a new recommendation engine, it needs to inherit from Recommender
base class, see /app/recommender/base.py. The API currently picks a recommendation engine randomly. To register your engine, add the module to the /app/recommender/ directory. Then, explicitly import the class in /app/app.py. This way, the class will be added to the list of subclasses of the Recommender base class.