Beispiel #1
0
def setupDB():
	for index in range(0, len(reviews)):
		review = m.Review(reviews[index]['id'], 
			reviews[index]['text'], 
			reviews[index]['stars'], 
			s.indi_sentimentR(s.singularTokenize(reviews[index]['text'])))
		m.db.session.add(review)
		m.db.session.commit()
Beispiel #2
0
def setupDB():
    for index in range(0, len(reviews)):
        review = m.Review(
            reviews[index]['id'], reviews[index]['text'],
            reviews[index]['stars'],
            s.indi_sentimentR(s.singularTokenize(reviews[index]['text'])))
        m.db.session.add(review)
        m.db.session.commit()
Beispiel #3
0
def receive_review_add():
	review = request.form['review']
	stars = request.form['stars']
	length = len(m.Review.query.all())
	sentiment = s.indi_sentimentR(s.singularTokenize(review))
	reviewAdd = m.Review(length, review, stars, sentiment)
	m.db.session.add(reviewAdd)
	m.db.session.commit()
	return ('', 202)
Beispiel #4
0
def receive_review_add():
    review = request.form['review']
    stars = request.form['stars']
    length = len(m.Review.query.all())
    sentiment = s.indi_sentimentR(s.singularTokenize(review))
    reviewAdd = m.Review(length, review, stars, sentiment)
    m.db.session.add(reviewAdd)
    m.db.session.commit()
    return ('', 202)
Beispiel #5
0
def review_prediction(review):
	sent_tok = s.singularTokenize(review)
	average = s.indi_sentimentR(sent_tok)
	return s.predictor(average)
Beispiel #6
0
def review_prediction(review):
    sent_tok = s.singularTokenize(review)
    average = s.indi_sentimentR(sent_tok)
    return s.predictor(average)