Spaces:
Runtime error
Runtime error
HamidBekam
commited on
Commit
•
9a3b700
1
Parent(s):
bc3b53f
Update app.py
Browse files
app.py
CHANGED
@@ -24,12 +24,12 @@ classifier = pipeline('sentiment-analysis')
|
|
24 |
# Extract sentiment labels for the movie reviews
|
25 |
reviews = conn.execute('SELECT text FROM movie_reviews limit 10')
|
26 |
for i, row in enumerate(reviews):
|
27 |
-
review = row[0]
|
28 |
-
sentiment = classifier(review[:512])[0]['label']
|
29 |
-
if sentiment == 'POSITIVE':
|
30 |
-
|
31 |
-
else:
|
32 |
-
|
33 |
conn.execute('UPDATE movie_reviews SET sentiment = ? WHERE rowid = ?', (label, i+1))
|
34 |
conn.commit()
|
35 |
|
|
|
24 |
# Extract sentiment labels for the movie reviews
|
25 |
reviews = conn.execute('SELECT text FROM movie_reviews limit 10')
|
26 |
for i, row in enumerate(reviews):
|
27 |
+
review = row[0]
|
28 |
+
sentiment = classifier(review[:512])[0]['label']
|
29 |
+
if sentiment == 'POSITIVE':
|
30 |
+
label = 1
|
31 |
+
else:
|
32 |
+
label = 0
|
33 |
conn.execute('UPDATE movie_reviews SET sentiment = ? WHERE rowid = ?', (label, i+1))
|
34 |
conn.commit()
|
35 |
|