Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Alanoud
Partner - Contributor
Partner - Contributor

Advanced Analytics (sentiment Analysis) with Qlik sense

Hello,

 

Actually, I'm trying to use Sentiment Analysis in Qlik sense.

I tried by some ways like:

PY-Tools by python, but it's not working, Also Advanced Sources (Amazon Comprehend) it's requires Qlik-Sense Cloud, but currently I need to use it with Qlik-Sense Desktop

 

So, if there is any API, Extension, Connections, Integration or another way can I use it.

I appreciate if you can attach example with Qlik-Sense Application and all necessary files as example.

 

Thank you,

Labels (3)
1 Reply
GTiscareno
Employee
Employee

you can try using other options like Some popular Sentiment Analysis tools include Google Cloud Natural Language API, Microsoft Azure Text Analytics, Amazon Comprehend, and IBM Watson.

You can Select GCC and create an API, for example below is small script using python

import pandas as pd
from flask import Flask, jsonify
from google.cloud import language_v1

# Authenticate with the Google Cloud Natural Language API
client = language_v1.LanguageServiceClient.from_service_account_file('path/to/service_account.json')

# Load data from Qlik Sense app
qlik_data = pd.read_csv('path/to/data.csv')

# Define function to perform Sentiment Analysis using the Google Cloud Natural Language API
def analyze_sentiment(text):
    document = language_v1.Document(content=text, type_=language_v1.Document.Type.PLAIN_TEXT)
    sentiment = client.analyze_sentiment(request={'document': document}).document_sentiment
    return sentiment.score, sentiment.magnitude

# Create a Flask app
app = Flask(__name__)

# Define a route for the Sentiment Analysis API
@app.route('/api/sentiment_analysis')
def sentiment_analysis():
    results = []
    for _, row in qlik_data.iterrows():
        sentiment_score, sentiment_magnitude = analyze_sentiment(row['comment'])
        result = {
            'id': row['id'],
            'comment': row['comment'],
            'sentiment_score': sentiment_score,
            'sentiment_magnitude': sentiment_magnitude
        }
        results.append(result)
    return jsonify(results)

# Run the Flask app
if __name__ == '__main__':
    app.run(debug=True)

This will start the Flask development server, which you can access at http://localhost:5000. You can then make a GET request to http://localhost:5000/api/sentiment_analysis to retrieve the Sentiment Analysis results in JSON format.