Performing audio sentiment analysis using DialogFlow

DialogFlow provides a feature for performing sentiment analysis on each of the user expressions. This feature is useful in the context of a call center when the users of a product or service call for assistance. DialogFlow leverages the sentiment analysis engine from Cloud Natural Language. The sentiment analysis can be enabled from the DialogFlow settings menu by navigating to the Advanced settings and clicking Enable sentiment analysis for the current query.

This feature is available in the Enterprise Edition of DialogFlow. DialogFlow also provides integration with the Cloud Natural Language engine for performing sentiment analysis. Each user conversation is a stateful interaction and is uniquely identified by session_id within DialogFlow. It is recommended that you use the same session ID within the API calls for continuous conversation. Here is a code snippet for using the DialogFlow API for performing sentiment analysis based on the user expressions in the conversation: 

def get_sentiment(PROJECT_ID, SESSION_ID, text,language_code): 

import dialogflow_v2 as dialogflow
session_client = dialogflow.SessionsClient()

session_path = session_client.session_path(project_id, session_id)

text_input = dialogflow.types.TextInput(text=text, language_code=language_code)

query_input = dialogflow.types.QueryInput(text=text_input)

sentiment_config = dialogflow.types.SentimentAnalysisRequestConfig(analyze_query_text_sentiment=True)

query_params = dialogflow.types.QueryParameters(sentiment_analysis_request_config=sentiment_config)

response = session_client.detect_intent(session=session_path, query_input=query_input, query_params=query_params)

The sentiment score for the user expression is encapsulated in the response object. This API is handy when there is a need for a smart fulfillment agent that can integrate with external systems and services for providing value-added service through the intelligent conversational agent. The service can integrate with external data sources for the conversations to be more meaningful and useful for the caller. 

This integration makes it possible to build intelligent agents with access to large volumes of external information and services. The platform also provides a closed feedback loop for improving conversations over a period of time as the agent is used for natural conversations. The platform also provides seamless integration with the Natural Language engine for performing sentiment analysis on each of the user expressions that are encountered by the DialogFlow agent. There are enormous possibilities and use cases that can be easily catered for by leveraging DialogFlow. With DialogFlow, machine intelligence and human-like conversation are available to functional teams. 

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
13.59.38.41