Commands
The commands used in this application are needed to load the data into the memory (cache) and make the user experience fast. Although the movie database is the same used in Chapter 4, Web mining techniques (that is 603 movies rated more than 50 times by 942 users), each movie needs a description to set up an information retrieval system on the movies to rate. The first command we develop takes all the movie titles in the utility matrix used in Chapter 4, Web Mining Techniques and collects the corresponding descriptions from Open Movie Database (OMDb) online service:
from django.core.management.base import BaseCommand import os import optparse import numpy as np import json import pandas as pd import requests class Command(BaseCommand): option_list = BaseCommand.option_list + ( optparse.make_option('-i', '--input', dest='umatrixfile', type='string', action='store', help=('Input utility matrix')), ...