<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Advanced Analytics (sentiment Analysis) with Qlik sense in Integration, Extension &amp; APIs</title>
    <link>https://community.qlik.com/t5/Integration-Extension-APIs/Advanced-Analytics-sentiment-Analysis-with-Qlik-sense/m-p/2067887#M18519</link>
    <description>&lt;P&gt;you can try using other options like&amp;nbsp;&lt;SPAN&gt;Some popular Sentiment Analysis tools include Google Cloud Natural Language API, Microsoft Azure Text Analytics, Amazon Comprehend, and IBM Watson.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You can Select GCC and create an API, for example below is small script using python&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;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)
&lt;/LI-CODE&gt;
&lt;P&gt;&lt;SPAN&gt;This will start the Flask development server, which you can access at &lt;/SPAN&gt;&lt;CODE&gt;&lt;A href="http://localhost:5000" target="_blank"&gt;http://localhost:5000&lt;/A&gt;&lt;/CODE&gt;&lt;SPAN&gt;. You can then make a GET request to &lt;/SPAN&gt;&lt;CODE&gt;&lt;A href="http://localhost:5000/api/sentiment_analysis" target="_blank"&gt;http://localhost:5000/api/sentiment_analysis&lt;/A&gt;&lt;/CODE&gt;&lt;SPAN&gt; to retrieve the Sentiment Analysis results in JSON format.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 04 May 2023 21:32:32 GMT</pubDate>
    <dc:creator>GTiscareno</dc:creator>
    <dc:date>2023-05-04T21:32:32Z</dc:date>
    <item>
      <title>Advanced Analytics (sentiment Analysis) with Qlik sense</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Advanced-Analytics-sentiment-Analysis-with-Qlik-sense/m-p/2060982#M18421</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Actually, I'm trying to use &lt;STRONG&gt;Sentiment Analysis&lt;/STRONG&gt; in Qlik sense.&lt;/P&gt;
&lt;P&gt;I tried by some ways like:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;PY-Tools&lt;/STRONG&gt;&amp;nbsp;by python, but it's not working, Also Advanced Sources (Amazon Comprehend) it's requires Qlik&lt;STRONG&gt;-Sense Cloud&lt;/STRONG&gt;, but currently I need to use it with &lt;STRONG&gt;Qlik-Sense Desktop&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, if there is any &lt;STRONG&gt;API&lt;/STRONG&gt;, &lt;STRONG&gt;Extension, Connections, Integration&lt;/STRONG&gt; or another way can I use it.&lt;/P&gt;
&lt;P&gt;I appreciate if you can attach example with Qlik-Sense Application and all&amp;nbsp;necessary files as example.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you,&lt;/P&gt;</description>
      <pubDate>Mon, 17 Apr 2023 12:43:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Advanced-Analytics-sentiment-Analysis-with-Qlik-sense/m-p/2060982#M18421</guid>
      <dc:creator>Alanoud</dc:creator>
      <dc:date>2023-04-17T12:43:22Z</dc:date>
    </item>
    <item>
      <title>Re: Advanced Analytics (sentiment Analysis) with Qlik sense</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Advanced-Analytics-sentiment-Analysis-with-Qlik-sense/m-p/2067887#M18519</link>
      <description>&lt;P&gt;you can try using other options like&amp;nbsp;&lt;SPAN&gt;Some popular Sentiment Analysis tools include Google Cloud Natural Language API, Microsoft Azure Text Analytics, Amazon Comprehend, and IBM Watson.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You can Select GCC and create an API, for example below is small script using python&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;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)
&lt;/LI-CODE&gt;
&lt;P&gt;&lt;SPAN&gt;This will start the Flask development server, which you can access at &lt;/SPAN&gt;&lt;CODE&gt;&lt;A href="http://localhost:5000" target="_blank"&gt;http://localhost:5000&lt;/A&gt;&lt;/CODE&gt;&lt;SPAN&gt;. You can then make a GET request to &lt;/SPAN&gt;&lt;CODE&gt;&lt;A href="http://localhost:5000/api/sentiment_analysis" target="_blank"&gt;http://localhost:5000/api/sentiment_analysis&lt;/A&gt;&lt;/CODE&gt;&lt;SPAN&gt; to retrieve the Sentiment Analysis results in JSON format.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 May 2023 21:32:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Advanced-Analytics-sentiment-Analysis-with-Qlik-sense/m-p/2067887#M18519</guid>
      <dc:creator>GTiscareno</dc:creator>
      <dc:date>2023-05-04T21:32:32Z</dc:date>
    </item>
  </channel>
</rss>

