Question
Using python!!!!!!!!!!!!!!!! Book Recommender System Write a Library class such that libraryDriver.cpp can make use of functions in the Library class to create a book
Using python!!!!!!!!!!!!!!!!
Book Recommender System Write a Library class such that libraryDriver.cpp can make use of functions in the Library class to create a book recommendation system. The Library class should have the following: Instance variables ? book_list : list to store the books read from file. ? user_dictionary: a python dictionary which stores the users and their ratings for the books. Class methods: ? constructor: provide a constructor that takes two filenames (books_filename, ratings_filename) as parameters and creates the required dictionaries and lists as class data members. ? read_books(file_name) method should add entries to a member list variable for books from the file. ? read_users(user_file_name) method should add entries to a member dictionary variable for ratings from the file. You will also provide other methods as described below to provide the recommendations of books to read for a given user. 1. Load book data and user data from text files. After the data is loaded, print the following: Data Loaded successfully! 2. a) Login. (There are no passwords. Anyone can log in as anyone else simply by providing their name.) After the data is loaded, welcome the user to the library and ask them to enter their name. If a user has interacted with the system before, the system should remember the user's previous ratings. 2. b) Add new user. If it is a user's first time interacting with the system, they should be added to the list of users. After welcoming the user, present the user with 4 choices: 1. View your ratings 2. Rate a book 3. Get book recommendations 4. Quit The user is asked to choose one of the menu options by entering one character for each option: v, r, g, q 3. View all your own ratings. A user should be able to see all the books they have provided ratings for. Recall that a rating of 0 means a user has not rated that book and hence shouldnt be displayed. 4. Rate a book. A user should be able to rate books. If the user chooses to rate a book, the user will be prompted first to enter the title of the book along with the rating. If the title of the book does not exist in the system, then the user will be prompted to enter a new title. Even if the user has already rated a book, they should be able to enter a new rating value. 5. See recommended books. To generate recommendations for a user, for example the user named ben: Find the most similar user to ben. Lets say we found claire to be most similar . Find at most 10 books claire has rated with a rating of 3 or 5 that ben has not yet read (rating 0) If there are less than 10 books to recommend, recommend as many as possible. Ben will be presented with 0 to 10 recommendations. 6. Quit. Print "Goodbye!" and terminate the execution of the program
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started