« first day (3328 days earlier)      last day (28 days later) » 

user23666587
11:30 AM
import numpy as np
from flask import Flask,request,jsonify,render_template
import pickle
from transformers import pipeline
from collections import Counter
import matplotlib.pyplot as plt
sentiment_pipeline = pipeline("sentiment-analysis")
app =Flask(__name__)
@app.route('/')
def home():
return render_template("Commenting.html")

@app.route('/predict',methods=['POST'])
def predict():
text = [x for x in request.form.values()]
status = []
for sentence in text:
status.append(sentiment_pipeline(sentence)[0]['label'])
 
user23666587
and folloiwng html
 
user23666587
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Sell Weapons</title>
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script type="text/javascript">
google.charts.load("current", {packages:["corechart"]});
google.charts.setOnLoadCallback(drawChart);
function drawChart() {
var data = google.visualization.arrayToDataTable([
{% for key, value in data.items() %}
{% if value is string %}
['{{ key }}', '{{ value }}'],
{% else %}
['{{ key }}', {{ value }}],
 
3 messages moved from Python
 
user23666587
[2024-03-30 15:25:26,977] ERROR in app: Exception on / [GET]
Traceback (most recent call last):
File "C:\Users\User\PycharmProjects\Web_Development\venv\Lib\site-packages\flask\app.py", line 1455, in wsgi_app
response = self.full_dispatch_request()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\User\PycharmProjects\Web_Development\venv\Lib\site-packages\flask\app.py", line 869, in full_dispatch_request
rv = self.handle_user_exception(e)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\User\PycharmProjects\Web_Development\venv\Lib\site-packages\flask\app.py", line 867, in full_dispatch_request
 
1 message moved from Python
 
user23666587
11:42 AM
2
Q: rendering charts with javascript in flask

thunder ligthiningmy task here is to create dynamic chart with help of python/flask and html/javascript, so idea is that customer is writting comments on some product and my task is to collect those comments, classify it by transformer model and build statistical analysis system, which will build chart on the ...

 
user23666587
12:08 PM
0
Q: Create dynamic chart based on user comments

thunder ligthiningi would like to create a userform, which will allows user to enter his/her comments, then with help of python and transformers i will read these questions , analyze their sentiments and build a pie chart, so here is html code : <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8">...

 
1 message moved from Python
 
12:19 PM
1 message moved from Python
 

« first day (3328 days earlier)      last day (28 days later) »