Beispiel #1
0
def create_review():
    """
    Creates an review.
    """
    form = ReviewForm()
    print(request.get_json())
    # Get the csrf_token from the request cookie and put it into the
    # form manually to validate_on_submit can be used
    form['csrf_token'].data = request.cookies['csrf_token']
    print('<<<<<<<<<<<< csrf', form['csrf_token'].data)
    if form.validate_on_submit():
        print('validated form')
        app_id = form.data['application_id']
        first_rev = Review.query.filter(
            Review.application_id == app_id).first()
        review = Review(writer_id=form.data['writer_id'],
                        reviewee_id=form.data['reviewee_id'],
                        application_id=form.data['application_id'],
                        content=form.data['content'],
                        score=form.data['score'])
        db.session.add(review)
        db.session.commit()
        if first_rev:
            first_rev.response_id = review.id
            db.session.add(first_rev)
            db.session.commit()
        rev = review.to_dict()
        order_id = rev['order_id']
        order = Order.query.filter(Order.id == order_id).first()
        order.status = "Complete"
        db.session.add(order)
        db.session.commit()
        return review.to_dict()
    return 'invalid form'
Beispiel #2
0
def movie_details(id):
    m = Movie.query.get_or_404(id)
    reviews = Review.query\
        .with_entities(User.username, Review.grade, Review.feelings, Review.thoughts,
            Review.timestamp, Review.user_id, User.image)\
        .filter(Review.movie_id == id)\
        .join(User)\
        .limit(4)\
        .all()
    form = ReviewForm()
    if form.validate_on_submit():
        review = Review(grade=form.grade.data,
                        thoughts=form.thoughts.data,
                        feelings=form.feelings.data,
                        user_id=current_user.id,
                        movie_id=id)
        db.session.add(review)
        db.session.commit()
        flash('Review sent succesfully')
        return redirect(url_for('main.movie_details', id=id))
    return render_template('movie_details.html',
                           title='movie_details',
                           movie=m,
                           reviews=reviews,
                           form=form)
def addReview():
    """
    Posts a New Review
    """
    form = ReviewForm()
    form['csrf_token'].data = request.cookies['csrf_token']
    print('Request', request.json)
    print('Form', form.data)
    if form.validate_on_submit():
        print('Current User', current_user)
        review = Review(user_id=(form.data['user']),
                        restaurant_id=(form.data['restaurant']),
                        body=form.data['body'],
                        rating=(form.data['rating']),
                        bags=form.data['bags'],
                        utensils=form.data['utensils'],
                        napkins=form.data['napkins'],
                        cups=form.data['cups'],
                        bowls=form.data['bowls'],
                        straws=form.data['straws'],
                        created=datetime.datetime.now(),
                        updated=datetime.datetime.now())
        print('Review', review)
        db.session.add(review)
        db.session.commit()
        return review.to_dict()
    return {'errors': validation_errors_to_error_messages(form.errors)}
def makeReview(id):
    form = ReviewForm()
    print("successfulqwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww post",
          form.data)
    form['csrf_token'].data = request.cookies['csrf_token']
    print(",,,,,,,,,,,,,,,,,,,,,,,,,,,", form['csrf_token'].data)
    print("the return boy", form.data)
    print("the return boy", form.data['reviews'])
    print("the return boy", form.data['ratings'])
    reviewData = form.data['reviews']
    ratingData = form.data['ratings']

    existing_Product = UserProduct.query.filter_by(users_id=current_user.id,
                                                   products_id=id).first()
    print("existddddddddddddddddddddddddddddddddddddddddddddddddddin product",
          existing_Product.reviews)
    if existing_Product:
        existing_Product.reviews = reviewData,
        existing_Product.ratings = ratingData
        db.session.add(existing_Product)
        db.session.commit()

    if form.validate_on_submit():
        review = UserProduct(users_id=current_user.id,
                             products_id=int(id),
                             reviews=reviewData,
                             ratings=ratingData)
        db.session.add(review)
        db.session.commit()
        return UserProduct.to_dict_product(review)
    return "Bad Data"
Beispiel #5
0
def rate_story(story_id):

	story = Story.query.filter(Story.id==story_id).scalar()
	if not story:
		flash(gettext('Story not found in database! Wat?'))
		return redirect(url_for('index'))


	form = ReviewForm()
	if form.validate_on_submit():
		print("Post request. Validating")
		haverated = Ratings.query                           \
			.filter(Ratings.nickname == form.nickname.data) \
			.filter(Ratings.story == story.id)              \
			.scalar()
		if haverated:
			flash(gettext('You seem to have already rated this story!'))

		else:
			apply_review(form, story.id)
			flash(gettext('Thanks for giving the author feedback! Your rating has been added'))

	average_ratings = {
		'overall'    : 0 if len(story.ratings) == 0 else sum([tmp.overall    for tmp in story.ratings]) / len(story.ratings),
		'be_ctnt'    : 0 if len(story.ratings) == 0 else sum([tmp.be_ctnt    for tmp in story.ratings]) / len(story.ratings),
		'chars_ctnt' : 0 if len(story.ratings) == 0 else sum([tmp.chars_ctnt for tmp in story.ratings]) / len(story.ratings),
		'technical'  : 0 if len(story.ratings) == 0 else sum([tmp.technical  for tmp in story.ratings]) / len(story.ratings),
	}
	return render_template(
		'add-view-reviews.html',
		average_ratings = average_ratings,
		form            = form,
		story           = story,
		)
Beispiel #6
0
def review(movieId):
    if current_user.is_anonymous:
        return redirect(url_for('login'))
    form = ReviewForm()
    if form.validate_on_submit():
        if len(form.comment.data) == 0:
            rating = Reviews(user_id=current_user.id,
                             movie_id=movieId,
                             rating=form.rating.data)
            db.session.add(rating)
            db.session.commit()
        else:
            rating_comment = Reviews(user_id=current_user.id,
                                     movie_id=movieId,
                                     rating=form.rating.data,
                                     comment=form.comment.data)
            db.session.add(rating_comment)
            db.session.commit()
    movie = Movies.query.filter_by(movieId=movieId).first()
    comments = Reviews.query.filter_by(movie_id=movieId).join(
        Movies, Reviews.movie_id == Movies.movieId).join(
            User,
            Reviews.user_id == User.id).add_columns(Movies.title,
                                                    Movies.movieId,
                                                    Reviews.comment,
                                                    User.username).all()
    return render_template('review.html',
                           movie=movie,
                           title='Review',
                           form=form,
                           comments=comments)
Beispiel #7
0
def handle_review(id):

    review = Review.query.filter(Review.id == id).first()

    if review is not None:

        if request.method == "DELETE":
            db.session.delete(review)
            db.session.commit()
            return {"message": "Review deleted"}, 200
        if request.method == "PATCH":

            form = ReviewForm()
            form['csrf_token'].data = request.cookies['csrf_token']

            if form.validate_on_submit():
                # form populate obj
                review.product_id = request.form.get("product_id")
                review.user_id = request.form.get("user_id")
                review.content = request.form.get("content")
                review.roast_rating = request.form.get("roast_rating")
                review.updated_at = datetime.now()

                db.session.add(review)
                db.session.commit()
                return review.to_dict(), 200

            return {
                "errors": validation_errors_to_error_messages(form.errors)
            }, 400

    return {"error": "Review does not exist"}, 404
Beispiel #8
0
def book_page(isbn):
    """page with the book's details and reviews, with an option to leave a new review"""
    # Make sure book exists
    book = Book.query.get(isbn)
    if book is None:
        flash("No such book. Search again.")
        return redirect(url_for('index'))
    form = ReviewForm()
    success = None
    if form.validate_on_submit():
        score = int(form.score.data)
        text = form.text.data
        user_name = current_user.username
        success = book.add_review(user=user_name, score=score, text=text)
        if not success:
            flash("You can only rate a book once.")
        else:
            flash("Your review was added.")
    # Get all book reviews
    reviews = book.reviews
    return render_template("book.html",
                           book=book,
                           reviews=reviews,
                           form=form,
                           title="Book Page",
                           success=success)
Beispiel #9
0
def new_review(course_id):
    course = Course.query.get(course_id)
    if not course:
        abort(404)
    user = current_user
    review = Review.query.filter_by(course=course, author=user).first()
    if not review:
        review = Review()
        review.course = course
        review.author = user
        is_new = True
    else:
        is_new = False

    message = ''
    form = ReviewForm(request.form)
    if request.method == 'POST':
        if form.validate_on_submit():
            # check validity of term
            if str(form.term.data) not in course.term_ids:
                abort(404)

            if form.is_mobile.data:
                form.content.data = markdown.markdown(form.content.data)
            form.content.data, mentioned_users = editor_parse_at(form.content.data)
            form.content.data = sanitize(form.content.data)
            form.populate_obj(review)

            if is_new:
                review.add()
                for user in set(current_user.followers + course.followers + course.joined_users):
                    user.notify('review', review, ref_display_class='Course')
                # users can only receive @ notifications for new reviews
                for user in mentioned_users:
                    user.notify('mention', review)
            else:
                review.save()
            return redirect(url_for('course.view_course',course_id=course_id))
        else: # invalid submission, try again
            if form.content.data:
                review.content = sanitize(form.content.data)
            if form.difficulty.data:
                review.difficulty = form.difficulty.data
            if form.homework.data:
                review.homework = form.homework.data
            if form.gain.data:
                review.gain = form.gain.data
            if form.rate.data:
                review.rate = form.rate.data
            message = '提交失败,请编辑后重新提交!'

    polls = [
        {'name': 'difficulty', 'display': '课程难度', 'options': ['简单', '中等', '困难'] },
        {'name': 'homework', 'display': '作业多少', 'options': ['不多', '中等', '超多'] },
        {'name': 'grading', 'display': '给分好坏', 'options': ['超好', '厚道', '杀手'] },
        {'name': 'gain', 'display': '收获多少', 'options': ['很多', '一般', '没有'] },
    ]
    return render_template('new-review.html', form=form, course=course, review=review, polls=polls, message=message, is_new=is_new)
Beispiel #10
0
def write_review(film_id):
    form = ReviewForm()
    if not form.validate_on_submit():
        return redirect(url_for('movie', film_id=film_id))
    film = Film()
    user = User()
    body = form.review.data
    user_id = user.current_user(session['__auth'])
    film.write_review(body=body, user_id=user_id, film_id=film_id)
    return redirect(url_for('movie', film_id=film_id))
Beispiel #11
0
def review():
    form = ReviewForm()
    if form.validate_on_submit():
        review = Reviews(name=form.name.data,
                         title=form.title.data,
                         review=form.review.data)
        db.session.add(review)
        db.session.commit()
        flash('Thank you for the post!')
    return render_template('review.html', title='Reviews.', form=form)
Beispiel #12
0
def review():
    form = ReviewForm()
    if form.validate_on_submit():
        review = Review(body=form.review.data, author=current_user)
        headline = Review(body=form.headline.data, author=current_user)
        db.session.add(review)
        db.session.add(headline)
        db.session.commit()
        flash('Your review is now live!')

    return render_template('review.html', title='Review', form=form)
Beispiel #13
0
def new_review(foodseller_id):
    form = ReviewForm()
    if form.validate_on_submit():
        review = Review(vote=form.vote.data, text=form.text.data,
                        customer_id=current_user.id, foodseller_id=foodseller_id)
        db.session.add(review)
        db.session.commit()
        foodsellerName=review.foodseller.foodsellerName
        flash('Review created!')
        return redirect(url_for('foodseller_reviews', foodsellerName=foodsellerName))
    return render_template('create_review.html', title='New Review', form=form, legend='New Review')
Beispiel #14
0
def create_review():
    form = ReviewForm()
    form['csrf_token'].data = request.cookies['csrf_token']
    if form.validate_on_submit():
        data = Review()
        form.populate_obj(data)
        print(str(form))
        data.assigneeId = current_user.id
        db.session.add(data)
        db.session.commit()
        return data.to_dict()
    return('Invalid Info')
Beispiel #15
0
def submit_review():
    form = ReviewForm()
    form['csrf_token'].data = request.cookies['csrf_token']
    if form.validate_on_submit():
        review = Review(
            rate=form.data['rate'],
            title=form.data['title'],
            comment=form.data['comment'],
            user_id=form.data['user_id'],
            service_id=form.data['service_id']
        )
    db.session.add(review)
    db.session.commit()
    return review.to_dict()
Beispiel #16
0
def submitReview(business_id):
    form = ReviewForm()
    form['csrf_token'].data = request.cookies['csrf_token']
    if form.validate_on_submit():
        data = request.json
        review = Review(user_id=data['user_id'],
                        business_id=data['business_id'],
                        title=form.data['title'],
                        body=form.data['body'],
                        rating=form.data['rating'])
        db.session.add(review)
        db.session.commit()
        return review.to_dict()
    return {'errors': validation_errors_to_error_messages(form.errors)}
Beispiel #17
0
def create_review():

    form = ReviewForm()
    form['csrf_token'].data = request.cookies['csrf_token']
    # form populate obj
    if form.validate_on_submit():
        review = Review(product_id=request.form.get("product_id"),
                        user_id=request.form.get("user_id"),
                        content=request.form.get("content"),
                        roast_rating=request.form.get("roast_rating"))
        db.session.add(review)
        db.session.commit()

        return review.to_dict(), 201
    return {"errors": validation_errors_to_error_messages(form.errors)}, 400
def makeReview(id):
    form = ReviewForm()
    form['csrf_token'].data = request.cookies['csrf_token']
    print("successful post")
    print("the return boy", form.data)
    if form.validate_on_submit():
        reviewData = form.data['reviews']
        ratingData = form.data['ratings']
        review = UserProduct(users_id=current_user.id,
                             products_id=int(id),
                             reviews=reviewData,
                             ratings=ratingData)
        db.session.add(review)
        db.session.commit()
        return UserProduct.to_dict_product(review)
    return "Bad Data"
Beispiel #19
0
def new_review(id):
    form = ReviewForm()
    movie = get_movie(id)

    if form.validate_on_submit():
        title = form.title.data
        review = form.review.data
        new_review = Review(movie.id, title, movie.poster, review)
        new_review.save_review()
        return redirect(url_for('movie', id=movie.id))

    title = f'{movie.title} review'
    return render_template('new_review.html',
                           title=title,
                           review_form=form,
                           movie=movie)
Beispiel #20
0
def review_item(item_id):
    item = Item.query.get(item_id)
    buyer = User.query.get(current_user.id)
    form = ReviewForm()
    if form.validate_on_submit():
        review = Review(title = form.title.data, body = form.body.data, rating = form.rating.data)
        db.session.add(review)
        db.session.commit()
        review.add_review(buyer, item)
        total = 0
        for i in item.reviews:
            total += i.rating
        item.rating = (total / item.reviews.count())
        db.session.commit()
        flash('Your review has been recorded.')
        return redirect('/clear_search')
    return render_template('review.html', title='Review Item', form=form)
Beispiel #21
0
def review(ID):
    form = ReviewForm()
    if form.validate_on_submit():
        review = Ratings(User_id=current_user.id,
                         Score_given=form.score.data,
                         Film_id=ID)
        db.session.add(review)
        db.session.commit()
        f = open('ratings.csv', 'w')
        out = csv.writer(f)
        out.writerow(['User_id', 'Film_id', 'Score_given'])
        for item in Ratings.query.all():
            out.writerow([item.User_id, item.Film_id, item.Score_given])
        f.close()
        flash('Review DB updated - Thanks for your review!')
        return redirect(url_for('index'))
    return render_template('review.html', title='Review Page', form=form)
Beispiel #22
0
def review(username):
    user = User.query.filter_by(username=username).first()
    if not user.can_be_reviewed_by(current_user):
        flash('You cannot review this user!')
        return redirect(url_for('user', username=username))
    post = user.posts.filter(db.and_(Post.purchased==True, Post.purchaser==current_user)).first()
    form = ReviewForm()
    if form.validate_on_submit():
        review = Review(reviewer=current_user, post_id=post.id,
                        rating=form.rating.data, body=form.body.data,
                        reviewee_id=post.user_id)
        post.expired = True
        db.session.add(review)
        db.session.commit()
        flash('Thank you for your review!')
        return redirect(url_for('user', username=username))
    return render_template('review.html', title='Review', form=form)
Beispiel #23
0
def book(bookisbn):
    book = db.execute("SELECT * FROM books WHERE isbn = :bookisbn", {
        "bookisbn": bookisbn
    }).fetchone()
    if book is None:
        flash("Book not found")
        return redirect(url_for("index"))

    book_reviews = db.execute(
        "SELECT users.username, body, rating FROM users INNER JOIN reviews on users.id = reviews.user_id WHERE book_isbn = :bookisbn",
        {
            "bookisbn": bookisbn
        }).fetchall()

    # Goodreads API call
    goodreads_call = "https://www.goodreads.com/book/review_counts.json?isbns=%2c{}&key={}".format(
        bookisbn, os.getenv('GOODREADS_KEY'))
    goodreads_info = requests.get(goodreads_call).json()

    # when review is submitted
    form = ReviewForm()
    if form.validate_on_submit():
        review_check = db.execute("SELECT * FROM reviews WHERE user_id = :id",
                                  {
                                      "id": session["user_id"]
                                  }).fetchone()
        if review_check is not None:
            flash('Review already submitted')
            return redirect(url_for('index'))
        review = db.execute(
            "INSERT INTO reviews (user_id, book_isbn, body, rating ) VALUES \
            (:user_id, :book_isbn, :body, :rating)", {
                "user_id": session["user_id"],
                "book_isbn": book.isbn,
                "body": form.body.data,
                "rating": form.rating.data
            })
        db.commit()
        flash('Your review of the book {} is now live!'.format(book.title))
        return redirect(url_for('index'))
    return render_template('book.html',
                           form=form,
                           book=book,
                           book_reviews=book_reviews,
                           goodreads_info=goodreads_info)
Beispiel #24
0
def post_reviews(isbn):
    if not current_user.is_authenticated:
        return redirect(url_for('login'))

    book = query.query_book(isbn)
    form = ReviewForm()
    if form.validate_on_submit():
        score = int(form.score.data)

        current_user_review = query.query_review_user(current_user.user_id, book.book_id)
        if current_user_review is None:
            query.query_add_review(form.body.data, score, book.book_id, current_user.user_id)
            message = 'Your review has been posted!'
            return render_template("success_review.html", message=message, isbn=isbn, title='Successful Review')
        else:
            return render_template("errors.html", message="You have already reviewed this book.", title='Error')

    return render_template('books.html', form=form, title=book.title, book=book)
Beispiel #25
0
def rate_story(story_id):

    story = Story.query.filter(Story.id == story_id).scalar()
    if not story:
        flash(gettext('Story not found in database! Wat?'))
        return redirect(url_for('index'))

    form = ReviewForm()
    if form.validate_on_submit():
        print("Post request. Validating")
        haverated = Ratings.query                           \
         .filter(Ratings.nickname == form.nickname.data) \
         .filter(Ratings.story == story.id)              \
         .scalar()
        if haverated:
            flash(gettext('You seem to have already rated this story!'))

        else:
            apply_review(form, story.id)
            flash(
                gettext(
                    'Thanks for giving the author feedback! Your rating has been added'
                ))

    average_ratings = {
        'overall':
        0 if len(story.ratings) == 0 else
        sum([tmp.overall for tmp in story.ratings]) / len(story.ratings),
        'be_ctnt':
        0 if len(story.ratings) == 0 else
        sum([tmp.be_ctnt for tmp in story.ratings]) / len(story.ratings),
        'chars_ctnt':
        0 if len(story.ratings) == 0 else
        sum([tmp.chars_ctnt for tmp in story.ratings]) / len(story.ratings),
        'technical':
        0 if len(story.ratings) == 0 else
        sum([tmp.technical for tmp in story.ratings]) / len(story.ratings),
    }
    return render_template(
        'add-view-reviews.html',
        average_ratings=average_ratings,
        form=form,
        story=story,
    )
Beispiel #26
0
def new_review(id):
    form = ReviewForm()
    movie = get_movie(id)
    if form.validate_on_submit():
        title = form.title.data
        review = form.review.data
        new_review = Review(movie_id=movie.id,
                            movie_title=title,
                            image_path=movie.poster,
                            movie_review=review,
                            author=current_user)
        new_review.save_review()
        return redirect(url_for('.movie', id=movie.id))

    title = f'{movie.title} review'
    return render_template('new_review.html',
                           title=title,
                           review_form=form,
                           movie=movie)
Beispiel #27
0
def review():
    form = ReviewForm()
    if form.validate_on_submit():
        productId = request.args.get('product_id')
        review = Review(ratings=form.ratings.data,
                        comments=form.comments.data,
                        user_id=current_user.id,
                        product_id= productId)
        all_reviews = Review.query.filter_by(product_id = productId).all()
        no_of_reviews = len(all_reviews)
        product = Product.query.filter_by(id=productId).first()
        if product.avg_ratings is None:
            product.avg_ratings = review.ratings
        else:
            product.avg_ratings = (product.avg_ratings * no_of_reviews + int(review.ratings))/(no_of_reviews + 1)  
        db.session.add(review)
        db.session.commit()
        return redirect(url_for('product', id=request.args.get('product_id')))
    return render_template('review.html', form=form)
Beispiel #28
0
def post_reviews():
    form = ReviewForm()
    form['csrf_token'].data = request.cookies['csrf_token']
    if form.validate_on_submit():
        # print(form.data['userId'])
        review = Review(
            userId=form.data['userId'],
            itemId=form.data['itemId'],
            score=form.data['score'],
            review=form.data['review'],
        )
        db.session.add(review)
        db.session.commit()

        reviews = db.session.query(Review).options(selectinload(
            Review.user)).filter_by(userId=form.data['userId']).order_by(
                desc(Review.createdAt)).limit(1).first()
        return {**reviews.to_dict(), "user": review.user.to_dict()}
    return {'errors': validation_errors_to_error_messages(form.errors)}
Beispiel #29
0
def new_review(journal_name):
    journal_name = journal_name.replace('_', ' ')
    form = ReviewForm()
    if form.validate_on_submit():
        user = User.query.filter_by(id=current_user.get_id()).first()
        journal = Journal.query.filter_by(title=journal_name).first()
        current_time = datetime.now()
        review = Review(review_rating=form.rating.data,
                        review_text=form.text.data,
                        time_stamp=current_time,
                        user=user,
                        journal=journal)
        db.session.add(review)
        db.session.commit()
        journal_name = journal_name.replace(' ', '_')
        return redirect(url_for('journal_info', journal_name=journal_name))
    return render_template('new_review.html',
                           form=form,
                           journal_name=journal_name,
                           logged_in=current_user.is_authenticated)
def review():
    form = ReviewForm()
    if form.validate_on_submit():
        global processor
        flash('You might enjoy these beers!')
        beer_df = processor.predict(form.beer_review.data)
        # Retuned DF with the beers to be recommended
        for brew_beer in beer_df['brew_beer']:
            row = beer_df[beer_df['brew_beer']==brew_beer]
            flash('Brewery: {} Beer: {} Rating: {}'.format(
                row['brewery'].iloc[0], row['beer'].iloc[0],
                row['rating'].iloc[0]
            ))
        # clean_review = processor.clean_review(form.beer_review.data)
        # tf_idf_vec = processor.get_tfidf_vector(clean_review)
        # topic_vec = processor.get_topic_vector(tf_idf_vec)
        # reviews = processor.get_top_ten_reviews(argmax(topic_vec))
        # for beer, overall in zip(reviews['beer'], reviews['overall']):
        #         flash(beer + ' ' + str(overall))
        # print(processor.get_top_ten_reviews(argmax(topic_vec)).columns)
        return redirect(url_for('review'))
    return render_template(url_for('review'), title='Check a Review', form=form)
Beispiel #31
0
def index():
    stop = stopwords.words('english')
    form = ReviewForm()
    if form.validate_on_submit():
        review = remove_punctuations(form.reviewText.data)
        review = ' '.join(
            [word for word in review.split() if word not in (stop)])
        if len(review.split()) == 0:
            return render_template('index.html',
                                   title='Home',
                                   form=form,
                                   not_enough=True)
        typeClassification = typeClassifier.predict([review])[0]
        overallClassification = overallClassifier.predict([review])[0]
        helpfulClassification = helpfulClassifier.predict([review])[0]
        reviewTokens = tokenize(review)
        type_keywords = ", ".join(
            list(
                set(type_class_words.get(typeClassification)).intersection(
                    set(reviewTokens))))

        if form.resultPresentation.data == 'tt':
            topThree = topThreePredictions(typeClassifier, review)
            return render_template('index.html',
                                   title='Home',
                                   form=form,
                                   topThree=topThree,
                                   overallClassification=overallClassification,
                                   helpfulClassification=helpfulClassification,
                                   type_keywords=type_keywords)
        return render_template('index.html',
                               title='Home',
                               form=form,
                               typeClassification=typeClassification,
                               overallClassification=overallClassification,
                               helpfulClassification=helpfulClassification,
                               type_keywords=type_keywords)
    return render_template('index.html', title='Home', form=form)