Blog Archives - Dataflix https://www.dataflix.com/category/blog/ Fri, 28 Apr 2023 06:10:56 +0000 en-US hourly 1 https://wordpress.org/?v=6.5.5 Using Text Analytics and NLP: An Introduction https://www.dataflix.com/intro-text-analytics-nlp/ Sat, 01 Feb 2020 01:49:32 +0000 https://www.dataflix.com/?p=1045 Every business wants to get the most from its data, but unlike legacy data types, today’s rising volume of data is not well structured — especially text data, which includes conversations, social posts, surveys, product reviews, documents, and customer feedback.

Businesses can tap into the power of text analytics and natural language processing (NLP) to extract actionable insights from text data. Here’s how it works.

Text Analytics Basics

Text analytics (also known as text mining or text data mining) is the process of extracting information and uncovering actionable insights from unstructured text.

Text analytics allows data scientists and analysts to evaluate content to determine its relevancy to a specific topic. Researchers mine and analyze text by leveraging sophisticated software developed by computer scientists.

Example business use cases for text analytics include:

  • Customer 360. Analyzing customer email, surveys, call center logs, and social media streams such as blogs, tweets, forum posts, and newsfeeds to understand customers better.
  • Warranty analysis. Understanding text from dealer service professionals, warranty claims, orders, and similar sources.
  • Product or service reviews. Analysis of customer reviews of products or services helps enterprises understand user sentiment or common issues customers are talking about.
  • Recruitment. Keyword analysis (comparing profiles with job descriptions) helps in short-listing suitable candidates.

The Text Analytics Process

There are many ways text analytics can be implemented depending on the business needs, data types, and data sources. All share four key steps.

Step 1: Data Acquisition

Text analytics begins with collecting the text to be analyzed — defining, selecting, acquiring, and storing raw data. This data can include text documents, web pages (blogs, news, etc.), and online reviews, among other sources. Data sources can be internal or external to an organization.

Step 2: Data Preparation

Once data is acquired, the enterprise must prepare it for analysis. The data must be in the proper form to work with machine learning models that will be used for data analysis. There are four stages in data preparation:

  • Text cleansing removes any unnecessary or unwanted information, such as ads from web pages. Text data is restructured to ensure data can be read the same way across the system and to improve data integrity (also known as “text normalization”).
  • Tokenization breaks up a sequence of strings into pieces (such as words, keywords, phrases, symbols, and other elements) called tokens. Semantically meaningful pieces (such as words) will be used for analysis.
  • Part-of-speech tagging (also referred as “PoS”) assigns a grammatical category to the identified tokens. Familiar grammatical categories include noun, verb, adjective, and adverb.
  • Parsing creates syntactic structures from the text based on the tokens and PoS models. Parsing algorithms consider the text’s grammar for syntactic structuring. Sentences with the same meaning but different grammatical structures will result in different syntactic structures.

The Role of Natural Language Processing

NLP is a component of text analytics. Most advanced text analytics platforms and products use NLP algorithms for linguistic (language-driven) analysis that helps machines read text. NLP analyzes words for relevancy, including related words that should be considered equivalent, even if they are expressed differently (e.g., humor vs. humour). It’s the workhorse behind steps 2 and 3 described above.

One popular application of NLP is identifying relevant, quality content for search engines. For example, Google uses NLP in several ways, the most prominent of which is in search engine organization and categorization.

Long ago, a webmaster could achieve a higher rank in Google search results just by stuffing keywords into web content, so Google revised how its search engine processed content using numerous algorithms and NLP. NLP helps Google identify “spammy” content and categorize it. Google may de-index this content, penalize it, or simply rank it much lower than other content.

NLP is also used in email spam filters. Spammers try their best to evade such filters by changing words around, purposely misspelling words, or using synonyms. Email spam filters use a variety of factors to identify and block spam, phishing, and malicious content. Gmail’s filter, for example, incorporates machine learning and NLP to perform “sentiment analysis.” If content is determined to likely be spam, the content is sent to the user’s junk folder. For some content, Gmail deletes the message.

A decade ago, application of NLP was comparatively complicated. AI-based technologies (including NLP and text analytics) have evolved considerably, and there are many cloud services, commercial products, and open source platforms businesses can leverage. Here are few open source NLP applications:

  • Stanford CoreNLP
  • Natural Language Toolkit
  • Apache Lucene and Solr
  • Apache OpenNLP
  • GATE and Apache UIMA

A Final Word

Text analytics isn’t new, but it is still unfamiliar to many organizations. With APIs, cloud-based AI services, and open source platforms available today, your business can leverage the power of text analytics to get a competitive edge by better understanding your customers and improving your brand’s value.

Published in TDWI UPSIDE.

]]>
Customer Service Chatbots Improve Customer Experience https://www.dataflix.com/bots-for-customer-services-benefits-success/ Fri, 02 Aug 2019 17:32:49 +0000 https://www.dataflix.com/?p=757 Customer Service Chatbots Improve Customer Experience Read More »

]]>

Customer service is an important aspect of customer journey, for businesses of all sizes and industries — and it has become one of the top priorities for executives. Customer service is all about “experience”, and bad experience or customer frustration will lead to churn.

Organizations across the globe are thriving to improve customer experience (CX), while keeping operational costs low. Better CX will result in improved customer satisfaction, loyalty and advocacy.

According to a recent Gartner survey, the top three emerging technologies that are expected to have the biggest impact on CX projects in the next three years include artificial intelligence (53%), virtual customer assistants and chatbots (39%) and omnichannel engagement solutions (37%). Source.

Chatbots & voice-bots are changing the way customers interact with brands & businesses. More than ever customers are attempting to self-serve before they pick up the phone.

For most organizations chatbots are medium-high priority initiatives today, but they are excepted to grow in priority in the near future.

Top 3 reasons to consider AI-powered bots for customer service

Improve Customer Experience

AI-powered chatbots can drastically reduce customer wait time by providing instant answers to most common questions, 24/7. Bots can be designed with persona, emotion and tone — delivering rich conversational experience through chat and voice apps & devices.

In a practical world, bot is still software! Not all questions can be answered by a bot. Customers can easily get frustrated when a bot doesn’t understand the question or cant provide the right answers. Bots can be designed to hand over such conversations to humans in real-time without creating a negative experience.

According to a Gartner survey, 82% of the B2B and 76% of the B2C respondents anticipated that in two years their company would be competing on CX.

According to Esteban Kolsky’s survey, 67% of customers mention bad experiences as a reason for churn, but only 1 out of 26 unhappy customers complain.

Reduce Operational Cost

Chatbots act on behalf of live agents delivering information or performing tasks for customers; thus freeing up time for agents, and enabling them to focus on things that matter. This results in reducing operational costs & human work load.

Growth in volume of questions doesn’t translate to increase in cost. More importantly, chatbots can be made available 24/7 without any additional cost.

According to a survey by Juniper, Chatbots will deliver $8 billion in Cost savings by 2022.

Efficiency & Scale

Chatbots can scale from a single user to hundreds of thousands of users with no major development effort. It’s also easy to scale bots across applications, devices, regions and languages. A well designed chatbot uses NPL and machine learning algorithms to re-train the bot based on user questions. You can effortlessly scale the bot based on your growing business needs.

Key success criteria for building a successful customer service chatbot

Bot is emerging technology — most companies are starting with the ideation phase figuring out the best approach to building scaleable bots.

Here are the key success criteria:

Purpose & Expectation

There are many reasons why customers can reach out to customer service teams, bots cannot be built to solve all the problems. It’s still “software”, and it’s only as good as its code.

A well defined “Purpose” is a good starting point for a successful bot.

With all the hype around bots it’s common for users to expect a lot more than what the bot is designed for. It’s important to set the right expectation about what the bot can do and when customers should talk to a human.

Content

Bots rely on training data to understand user’s intent. It’s a good practice to create at least 15–20 unique expressions (or utterances) for each intent. Training data will be used by NLP module to map user’s message to an intent.

Channels & Conversation Flow

Customers can reach customer service through multiple channels like phone, website, Facebook messenger, WhatsApp, text and more. Some of the channels are not managed or owned by the business, but it’s still extremely important to deliver seamless experience. One single bot can be published to multiple internal & external channels delivering seamless experience.

Well-defined conversation flow helps in enhancing customer experience and increasing adoption rate.

Monitor & Supervision

There will always be questions that the bot fails to answer due to a variety for reasons. It’s important to setup a process to monitor and manually train the bot, this will help in improving training data, which results in higher response confidence levels.

Prepare to Fail

Every customer will have a different understanding of bot, and their experience levels will vary. Expect questions that are out-of-scope. And — be prepared to deal with them! Design good fall back responses to manage out-of-scope conversations & negative sentiment.

Summary

Businesses are competing on customer experience to drive brand loyalty. In customer service, technology matters. AI-powered chatbots deliver low-effort experience that improve customer satisfaction rates, while keeping the operational & maintenance costs in control.

]]>
AI/Robots do not Threaten Humans, but Super Humans do https://www.dataflix.com/ai-robots-do-not-threaten-humans-but-super-humans-do/ Mon, 03 Jun 2019 17:15:02 +0000 https://www.dataflix.com/?p=619 AI/Robots do not Threaten Humans, but Super Humans do Read More »

]]>
A common question we hear everywhere these days is  - ”Will AI/Robots replace humans?”

What do you think?

One of the last subjects Stephen Hawking wrote was not as widely reported as perhaps it should have been. The physicist, who had previously warned about the potential threat artificial intelligence posed, more recently suggested that humans faced an even greater and more immediate threat. Sometime in the foreseeable future, he said, the human race could divide into two: those with an average intelligence level by today’s standards and those with super intelligence. The latter breed will have bodies improved by genetic engineering and brains improved by artificial intelligence (AI). These “superhumans”, as they are called, will be relatively few in number, but will pose a serious threat to normal humans.
If “Super Humans” exist in future, the super intelligent might be few in number because genetic engineering of humans’ brains and bodies will be very expensive, and only the very wealthy (or wealthiest) will be able to afford it. The result will be the gradual consigning of most humans to the role of a subservient class, less healthy and less intelligent than the others. In a few generations the superhumans’ progeny will begin to inherit the enhanced traits and, so, medical intervention to engineer those enhancements will become less necessary.
Some experts believe AI is a serious threat because machines will eventually become conscious, develop more sophisticated brains than humans, and decide humans are dispensable. Yet despite such dystopian warnings about AI, nobody knows if machines will ever become conscious, indeed nobody really knows what consciousness is. The idea of machines becoming smarter than humans and threatening the human race is pure speculation and most experts believe it’s unlikely to happen this century, if at all. The creation of superhuman beings, however, is less speculative. Already, humans can be improved by genetic engineering and most experts accept that greatly improving the human brain’s cognitive abilities by both genetic engineering and electronic implantation will happen sooner than most people think. Hawking suggests that anticipated advances in genetics will enable people to acquire improved memory and intelligence, as well as improved disease resistance and longer lifespans.
Talking about “Super Humans”, two solutions floating across internet are - To give every person the same chance to become superhuman. The second is to ban the technology. Neither of these solutions will work. First one is simply not practical, not affordable and could be the biggest threat for human race. Later one will just stop human evolution. History is not reassuring on either count.
In summary, AI/Robots might not be a treat to humanity nor will replace humans, at least in this century. AI will augment human workforce.
The use of AI and Robots should be highly regulated knowing the potential they have, to create negative impact to humans and world at large. Regulations should also help in restricting inventions/discoveries that are a treat to human race, like “Super Humans”.Article published on becominghuman.ai – https://becominghuman.ai/ai-robots-do-not-threaten-humans-but-super-humans-do-21c29ea455db

]]>
Using Text Analytics and NLP: An Introduction https://www.dataflix.com/text-analytics-nlp/ Mon, 03 Jun 2019 17:14:05 +0000 https://www.dataflix.com/?p=657 Using Text Analytics and NLP: An Introduction Read More »

]]>
Every business wants to get the most from its data, but unlike legacy data types, today’s rising volume of data is not well structured — especially text data, which includes conversations, social posts, surveys, product reviews, documents, and customer feedback. Businesses can tap into the power of text analytics and natural language processing (NLP) to extract actionable insights from text data. Here’s how it works.

Read the full article on TDWI.

]]>
Chatbot Trends You Need to Know Before Investing https://www.dataflix.com/chatbot-trends-you-need-to-know-before-investing/ Thu, 02 May 2019 16:01:14 +0000 https://www.dataflix.com/?p=615 “Chatbot” doesn’t need an introduction! According to research by Juniper, chatbots will save businesses up to $8 billion by 2022.

That’s a significant impact for businesses of all sizes. If you are an executive or a business owner who wants to put the power of AI-powered chatbots to work for your business, it is imperative you understand what is happening in the world of chatbots.

2019 looks to be the year when chatbots emerge as a viable business-building growth tool. Rather than creating a mobile app for their business, many businesses will opt for an easy-to-develop (and deploy) chatbot to connect with consumers.
The following are seven top chatbot trends you need to know before investing in building one.

  1. Expect to see an explosion of the following
    1. BOTs, both chat and voice enabled.
    2. New use cases across all functions of an organization (some crazy ones too).
    3. New chatbots products, platforms and services.
    4. Market consolidation (M&As)
    5. Potentially new laws around how AI & chatbots should be used. Example: California B.O.T. Act of 2018, effective July 1st, 2018.
  2. Chatbots and IoT are a match made in heaven. As more devices become internet-connected, expect to see an influx of IoT-enabled chatbots. Whether it is learning how to use your new wearable device or user-onboarding for enterprise clients managing an IoE (internet of everything) device, chatbots will play a critical role going forward.
  3. There will be increasing usage of chatbots on company websites. While chatbots on social networking platforms like Facebook are already popular, a growing number of businesses want to “own” these conversations and keep communication happening on their website instead of a third-party platform.
  4. Online businesses will discover the power and potential of chatbots for driving sales, improving customer satisfaction ratings, and customer education. Expect to see a growing number of developers offering chatbots for specific e-commerce platforms like Shopify. (apps.shopify.com/search/query?utf8=%E2%9C%93&q=chatbot).
  5. Business leaders who want to increase the effectiveness of their sales funnel will start to use chatbots to a greater degree to appropriately funnel potential customers to the right departments. The more a company can learn about a consumer’s needs before speaking to a live person, the better they can help that consumer by connecting them with the right person from the start.
  6. As artificial intelligence SDKs and APIs (programmableweb.com/search/artificial%20intelligence) become increasingly refined, expect to see an explosion of interest from companies who want to put the power of AI to work for their business. From IBM’s Watson to Apple’s Siri, the number of AI tools for developers is surging. The more tools savvy developers have at their disposal, the greater the products they can create for organizations on the hunt for chatbots.
  7. Open-source code will play a significant role in the proliferation of chatbots. From Botpress.io to Rasa.com, there is already growth happening in the open-source chatbot sector. The more businesses develop a hunger for chatbots, the more significant impetus there will be for developers to code their creations.

Understanding upcoming chatbot trends is critical if you want to harness the power of chatbots for your company. The better you understand what the future holds for chatbots, the faster you can capitalize on a trend before your competitors.

Are Chatbots part of your 2019 growth strategy? If so, good luck in creating new conversational experience for your prospects and customers.
Article published on Chatbotslife.com – https://chatbotslife.com/chatbot-trends-you-need-to-know-before-investing-8cd037bea463

]]>
A Brief Primer on Data Science and What It Can Do for Your Business https://www.dataflix.com/brief-primer-on-data-science/ Mon, 01 Apr 2019 16:36:29 +0000 https://www.dataflix.com/?p=160 A Brief Primer on Data Science and What It Can Do for Your Business Read More »

]]>
What is Data Science?

A simple definition of data science is that it’s the study of analyzing information and predicting outcomes. The predictions are mainly made using machine learning, but just one model can take months of data extraction, cleanup, coding, and deployment. Data science requires much larger reservoirs of data than a standard application using basic algorithms. You can’t use a few dozen stored records to analyze data accurately. You need millions of records to build and test a model. The first step for a data scientist to work with any organization is to gather and clean data. You’ve probably heard of “big data” and may even use the technology in your current applications. Big data is unstructured, but it’s perfect for data science. Unstructured data technologies grab as many records as possible and store them in a database such as MongoDB. This data can be anything, but just as an example consider a website and each of its pages. A crawler finds pages on a website and stores its text, images, and links in an unstructured record. You can scrape an entire site and get its data without worrying about structuring the data as you crawl as long as you use a database that supports unstructured formats. The next step is to clean the data, which is probably the most tedious part of data science. Most scientists clean the data and load it into a CSV file, which is a comma-delimited list of values. These files are easy to import either into another database or code, and any operating system supports After collecting the data, it’s time to figure out its functions. The data scientist first analyzes the data he has and asks a question. For instance, maybe you want to know what products are more likely to attract customers. You could take data from your e-commerce store and use previous customer orders to determine which products are most popular and which ones could be popular during the holidays to improve your sales and focus marketing efforts. Data science models could answer this question for you and make predictions using machine learning to contribute to improving your sales.

Building a Model

After the data scientist and the business determine the question to be answered, it’s time to build a model. A model is a unit of code that represents the “answer” to the question. The answer is usually represented in a graph to make it easier for the public to consume and understand the information. The visuals are typically a part of a library imported into the project, but the data scientist must ensure that the analysis that transforms data to a graph is acc. One of two main programming languages often is chosen to create the models. R is the language of math and statistics, so is the likely choice if your scientists have a mathematics educational background. More people understand Python, which is suitable for other development projects and is more popular among data scientists. Colleges teach Python, and because of its wide use within programming circles, you might find it easier to implement with a smaller learning. The data scientist creates the model with the question in mind. Using the e-commerce example, here’s how it works: The data scientist would review the data and set it up as rows and columns to import into Python code, which then calculates and displays it as a graph. The graph can be any number of plots, charts, and even visualization tools such as Excel or PowerPoint. The visual output is used to present information to the business for them to sign off on the results. Once the analysis is shown to be accurate, the data scientist can move on to the next step, which is creating the. The foundation for the model is logistic code that takes the data stored in a CSV file and runs it through the data scientist’s algorithms. The algorithms could be open-source or custom made by the scientist. It’s not uncommon for a developer to also dive into the analytics to better understand what must be dep. Although every model is different, you can just think of them as a module of code that represents the answer to a question. The business asks the question, and the data scientist develops a solution in the form of a model.

Model Deployment

One of the toughest parts of the entire data science workflow is deploying a model. The scientist must work with a developer to convert the model (written in R or Python) into the local application’s language, which can be any language such as C#, JavaScript, PHP, or VB. The developer might not be an analytics expert, and it’s up to the scientist to explain the model in a way that makes it easy for the developer to convert it. Statistically, most models never even make it to the application. Developers are hesitant to deploy machine learning code into an application without fully understanding what the code does, but it’s necessary for the business to take advantage of each. A good example of a machine learning module and local applications is in the finance industry. When you go to a cashier and want credit at the department store, you give her some information about yourself without telling your life story. From just your social security number, name and birth date, an algorithm can decide whether or not to give you credit. These financial decisions are made using data science models. The question that the model answers is: “Are you a trustworthy candidate for credit, and does your data history indicate that you will pay the money back?” You know that the response to a credit application is either yes or no. Data models written by data scientists make this decision, and they use machine learning to pick up on patterns within millions of records.

Integrating Data Science into Business Code

Building a new data team is costly, takes time, and there is a learning curve for your developers. The benefits far outweigh the disadvantages, and you can work with project managers and agencies to help get you started.

If you’ve thought of taking your business analytics to the next level, adding a data scientist to your current IT team is the way to go. Your developers will learn new skills, your business will make more money, and you can take advantage of the latest in code design and database storage technologies.

]]>
Integrate Dialogflow Chatbots with Websites using Dataflix Messenger https://www.dataflix.com/google-dialogflow-dataflix-messenger/ Fri, 01 Mar 2019 23:18:20 +0000 https://www.dataflix.com/?p=573 Integrate Dialogflow Chatbots with Websites using Dataflix Messenger Read More »

]]>
The need for chatbots is growing across multiple functions and industries. Chatbots deliver variety of benefits to businesses including saving cost, improving customer experience, increasing conversion rate, and providing 24/7 support. Few common chatbot use cases are customer support bots, website sales chatbots, personal assistants, travel agents, help desk assistant and HR assistant.

Google Dialogflow (formerly api.ai) is one of the best platforms to build bots (a.k.a agents). Dialogflow provides interesting out-of-the-box features like inline editor for fulfillment, one-click integrations, small talk, and more. Chatbots built on Dialogflow can be delivered via multiple communication platforms like Facebook messenger, Telegram, Twilio, Skype, Google Assistant and Kik using one-click integrations provided by Dialogflow. Explore all integrations here: https://cloud.google.com/dialogflow-enterprise/docs/integrations/

Use cases that demand integrating Dialogflow chatbots into websites or web applications would require a chat app that seamlessly integrates with Dialogflow. That is Dataflix Messenger (DM), a chat app designed for humans to interact with chatbots built on Google Dialogflow. Businesses can integrate Dialogflow agents (chatbots) into websites and web applications using DM, delivering rich conversational experiences. Key Features

  • Guided conversation with quick replies
  • Seamless integrations – websites, apps, portals
  • Fully hosted, server less architecture
  • Deploy anywhere – cloud or on-prem
  • Two step configuration with Google Dialogflow
  • Easy customization and re-banding

WordPress Integration Dataflix Messenger app can be integrated into WordPress websites using simple Java code that comes with DM, and plugins like “Insert Header and Footer”. Check out the live demo at the bottom of this page (right). Configuring Dataflix Messenger to your Dialogflow agent and integrating chatbot into your website is a simple three step process –

  1. Host DM in the cloud or in your data center. DM can be hosted in any cloud service that allows hosting static websites, including Google Cloud Storage and AWS S3. SSL needs to be enabled to ensure communication between the browser and website is secure and encrypted.
  2. Configure DM to integrate with a Dialogflow agent using Client Access Token and Developer Access Token. Both the tokens are specific to an agent, and can be found under “Settings” tab in the Dialogflow console.
  3. Chatbot can be integrated into any website or web application using Java code / iframe that comes with DM and URL from step 2.

Interested in exploring and deploying Dataflix Messenger in your website for no cost?

]]>
Write-back to database using Looker Data Actions https://www.dataflix.com/write-back-in-looker/ Fri, 09 Nov 2018 21:23:03 +0000 https://www.dataflix.com/?p=434 What is write-back?
Write-back in this context refers to manipulating data in a database from Looker web UI, without having to code. Primarily designed for business users, common use cases include –

  • Adding comments to dashboards.
  • Users managing tables (pricing, etc.).
  • Audit applications.
  • Feedback forms.

How can this be accomplished with Looker?
By using Actions by Looker.

What should you be familiar with?                                

  • Python (or NodeJS)
  • LookML

What should you have?

  • Permissions to manage Google Cloud Functions in your GCP.
  • Looker Dev Access

Have them all? Let’s get started.

Example use case:

Consider the following table:

actions_ad_data

Users should be able to update the information/add comments in this table directly from Looker dashboards. This article walks you through the process of achieving that functionality.

As a part of that, to catch all the entered comments, a new table has to be created on the database, similar to this one:

actions_comments

And on Looker, create a view on the comments table, and join it with the initial ad_data explore, as follows:

view: actions_comments {
  sql_table_name: !@#$%^&*.actions_comments ;;
  dimension: ad_id {
    type: number
    sql: ${TABLE}.ad_id ;;
  }
  dimension: comment {
    type: string
    sql: ${TABLE}.comment ;;
  }
  dimension: p_key {
    type: string
    primary_key: yes
    sql: ${ad_id}|| '' || ${time_raw} ;;
  }
  dimension_group: time {
    type: time
    timeframes: [
      raw,
      time,
      date,
      week,
      month,
      quarter,
      year
    ]
    sql: ${TABLE}.time ;;
  }
  dimension: u_name {
    type: string
    sql: ${TABLE}.u_name ;;
  }
  measure: count {
    type: count
    drill_fields: [u_name]
  }
}
connection: "!@#$%^&*"
include: "*.view.lkml"
explore: actions_ad_data {
  label: "Ad Data"
  description: "Created just to try Data Actions."
join: actions_comments {
  sql_on: ${actions_ad_data_dt.ad_id} = ${actions_comments.ad_id} ;;
  relationship: one_to_many
  type: left_outer
}
}

Before moving on with actual implementation, here is a high-level illustration of the entire writeback process using Data Actions:
Within a Looker Action, all the parameters and forms are bundled together as a JSON. And when a cloud function is triggered by that action, that cloud function collects the bundled information from Looker, validates it and posts the data onto the database according to the given instructions. Make sure to give those instructions good and accurate.

Now, assuming that all of the important visualizations will be including the actions_ad_data.ad_id, two data actions were added to that dimension, as follows:

view: actions_ad_data {
  sql_table_name: !@#$%^&*.actions_ad_data ;;
.
.
.
dimension: ad_id {
    type: number
    primary_key: yes
    sql: ${TABLE}.ad_id ;;

   action: {
      label: "Update Money Spent"
      url: "https://!@#$%^&*.cloudfunctions.net/changeamount_actions"
     param: {
        name:"id"
        value: "{{value}}"
      }
     form_param: {
        name: "changeamount"
        type: string
        label: "Amount"
        description: "Enter new amount above."
        required: yes
      }
    }


   action: {
      label: "Add comment"
      url: "https://!@#$%^&*.cloudfunctions.net/changeamount_comments"
     param: {
        name:"id"
        value: "{{value}}"
      }
     user_attribute_param: {
        user_attribute: user_attribute_name
        name: "username"
      }
     form_param: {
        name: "comment"
        type: textarea
        label: "Enter the comment"
        required: yes
      }
    }
  }
.
.
.
}

The two actions are “Update Money Spent” and “Add comment”. They are almost the same but understand that the target URLs are different, targeting a cloud function relevant to the action. Here are the cloud functions that are up and running on the Google Cloud:
Here is “changeamount_actions” function configuration:

Note: Don’t forget to mention ‘google-cloud-bigquery==1.5.0’ in requirements.txt of each cloud functions. Also, this function can be done using NodeJS as well.

And it’s source code:

from google.cloud import bigquery     # DO NOT FORGET THIS
import datetime
import time

def changeamount(request):
r = request.get_json() # Fetch the data action JSON

client = bigquery.Client()
dataset_id = '!@#$%^&*' # Replace with name of your BQ dataset
table_id = 'actions_ad_data'  # replace with your table ID
table_ref = client.dataset(dataset_id).table(table_id)
table = client.get_table(table_ref)

# getting the data
id = r['data']['id']
amount = r['form_params']['changeamount']
sys_time = int(time.time())

row_to_update = [
(
id,
amount,
datetime.datetime.fromtimestamp(sys_time).strftime('%Y-%m-%d %H:%M:%S')
)
]

row = client.insert_rows(table, row_to_update)  # API request to insert row
return '{"looker": {"success": true,"refresh_query": true}}' # return success response to Looker forcing it to refresh

[/vc_column_text][vc_column_text css=”.vc_custom_1541804171616{margin-bottom: 0px !important;}”]The other Cloud Function’s configuration is similar to the first one, and so here is the source code of it:

from google.cloud import bigquery
import datetime
import time

def addcomment(request):
r = request.get_json() # Fetch the data action JSON

client = bigquery.Client()
dataset_id = 'learning' # Replace with name of the BQ dataset 
table_id = 'actions_comments' # replace with your table ID
table_ref = client.dataset(dataset_id).table(table_id)
table = client.get_table(table_ref) # API request

# request variables
id = r['data']['id']
u_name = r['data']['username']
comment = r['form_params']['comment']
sys_time = int(time.time())

row_to_update = [
(
comment,
u_name,
datetime.datetime.fromtimestamp(sys_time).strftime('%Y-%m-%d %H:%M:%S'),
id
)
]
row = client.insert_rows(table, row_to_update) # API request to insert row
return '{"looker": {"success": true,"refresh_query": true}}' # return success response to Looker

Breaking down the code:

Take a look at the “Update Money Spent” action declaration in actions_ad_data.

Within that action, param and form_param contain the data that might be required to be sent to the server (which in this case is the Cloud Function). Read about param and form_param in this link.

The second action is “Add comment”, which is similar to the first one, but with a new user_attribute_param, which just contains the user attributes, and in this case the full name of currently logged in user. This can also be achieved by using ‘liquid’.

Now, on the cloud function, the dataset_id and table_id onto which the data is to be written is hard-coded into specific variables. And also, the function tries to retrieve data from the JSON, store it within appropriate variables and then tries inserting all the variables together onto the table as a new row.

 

Here is a video of Data Actions on an example dashboard created on the example data:

 

Remember:

#1

BigQuery is append-only. So, new rows will be added, instead of updating existing rows. Here is one way to avoid showing duplicates on Looker:

  • Make sure the table have timestamps.
  • Create a PDT to retrieve the latest information of each pkey, and set a sql_trigger on the timestamp field.

#2

Do not share the Cloud Function’s URL. Anyone with the URL can write data to your BigQuery instance. Try adding some checks/validation that the request is coming from Looker.

#3

Make sure the end-user knows where the data actions are, and how they’re supposed to be used.

 

Other Useful links:

Joins in Looker: https://docs.looker.com/data-modeling/learning-lookml/working-with-joins

About Datagroups: https://docs.looker.com/reference/model-params/datagroup

Another example: https://discourse.looker.com/t/update-write-back-data-on-bigquery-from-looks/9408/2

This blog was developed in collaboration with Looker’s Customer Success Engineer Jesse Carah.

]]>
7 Ways Artificial Intelligence Will Influence the Future of Your Business https://www.dataflix.com/7-ways-artificial-intelligence-will-influence-the-future-of-your-business/ Sun, 01 Jul 2018 16:40:50 +0000 https://www.dataflix.com/?p=165 7 Ways Artificial Intelligence Will Influence the Future of Your Business Read More »

]]>
If you think artificial intelligence is some far-off notion that won’t have an impact on how you grow your business, you’re wrong. Regardless of whether you operate on online e-commerce business or a brick-and-mortar store, AI will influence your company in a myriad of ways.The sooner today’s business owners prepare for an AI-enabled future, the sooner they will be able to optimize their growth strategy to account for AI’s impact on their company. If you’re a savvy business owner who wants to prepare for the artificial intelligence future, following are seven ways that AI might influence the future of your company.From assistants like Alexa and Siri to chatbot interfaces on your website, digital assistants use artificial intelligence to improve their effectiveness. Whether you add a chatbot to your e-commerce store to improve your customer service outreach or you automate business activities like email via your smartphone, AI will seep into your daily business practices on a continual basis. Once you understand just how beneficial AI is for managing your company, you will start looking for ways to add even more AI-powered tools into your business management efforts.In the same way, AI-enabled digital assistants will become commonplace in businesses, so too will AI-enabled internet of things devices. The number of devices connected to the internet continues to skyrocket. Security cameras, alarm systems, work stations, and wearable devices are all available with internet connectivity. As internet connectivity becomes cheaper to enable, expect the number of business tools without internet connectivity to decrease. You just might find that in the near future, most tools you use for your business will automatically connect to the internet and will be AI-enabled for even greater performance.Search engine optimization will be significantly influenced by artificial intelligence. Search engine algorithms, keyword optimization, and natural language processing will all influence how brands use SEO for business growth in the future. If you want to get a jump on your competitors, diving into data on AI-enabled SEO is highly recommended.Artificial intelligence will also influence how your business receives the products you sell. AI will impact the way robots are trained to process orders, in order to maximize efficiency within a warehouse. The way your shipments are routed to carriers and even how your orders are placed on a truck for delivery will all be influenced by artificial intelligence data and algorithms. Even if your business offers a service instead of a product, anything you have shipped to your company, i.e. paper supplies, will be distributed via artificial intelligence.AI will have a huge impact on the future of content marketing. AI-enabled data analytics tools are becoming more refined by the day. Conduct a web search for the term ‘content analytics startup’ or ‘data/text analysis startup’ and you’ll be amazed by the number of companies already creating AI-enabled analytics tools for content marketers. The smarter the data used in content marketing, the greater the ROI is likely to be. If you want to improve the effectiveness of your inbound marketing efforts, integrating AI-enabled data analytics tools into your strategy is a must.The future of automation is definitely going to be influenced by artificial intelligence. From automation tools like IFTTT and Zapier to automated social media marketing tools and email marketing platforms, the future of business is automated. Business owners can already use automation for everything from sales lead generation to managing the lights and thermostats in their offices.Artificial intelligence will continue to have a significant impact on cybersecurity advances. AI-enabled algorithms will help business owners better protect their company’s data from hackers. Startup companies are already creating a cornucopia of AI-enabled cybersecurity tools. The future of cybersecurity and AI go hand-in-hand, which is great news for business owners.The more business builders realize the power and potential of artificial intelligence, the better prepared they will be to capitalize on this growing technology. If you are a business owner who wants to future-proof your company, investigating innovations within the artificial intelligence sector is one of the smartest moves you can make.

]]>
5 Up-and-Coming Automation Trends Business Owners Should Know About https://www.dataflix.com/5-up-and-coming-automation-trends-business-owners-should-know-about/ Sun, 01 Jul 2018 16:35:58 +0000 https://www.dataflix.com/?p=153 5 Up-and-Coming Automation Trends Business Owners Should Know About Read More »

]]>
Paying attention to what is happening in the automation sector is crucial for growth-focused business owners. Entrepreneurs and developers are launching a variety of innovative automation resources for business owners who want to maximize productivity. With global spending on BPA (business process automation) expected to exceed 12 billion dollars by 2021, it is essential for today’s business owners to know the automation options they have at their disposal (statista.com/statistics/740593/worldwide-business-process-automation-market-size). If you want a peek at the future of business productivity, check out the following up-and-coming automation trends.Expect to see increasing activity in the industrial internet of things automation sector. As more devices become internet-enabled, startups within the IoT sector will continue to develop software solutions to maximize the efficiency of these connected devices. Be on the lookout for industrial IoT automation of everything from warehouse robots to smart buildings.There is growing interest in the automation of human resources activities like candidate profiling and resume reviewing. Be prepared for continued innovation in this sector as companies look to streamline as many of their talent acquisition duties as possible. Human resources management can be extremely time-consuming for today’s business owners. When they can automate repetitive tasks like candidate screening, watch for startup companies to develop solutions to meet the demand.The chatbot revolution is just getting started. Everyone from bloggers to international corporations are utilizing chatbots for real-time conversations with their audiences. Expect to see increased development of AI-enabled chatbots for marketing automation as artificial intelligence APIs become more fine-tuned and affordable for everyday use.Automation technology for sales departments will continue to grow in popularity as accounting teams look to automate repetitive and costly sales activities like lead generation and follow-up. As software technology allows businesses to automate processes once conducted by sales personnel, expect to see a growing shift towards AI-enabled sales automation processes.Voice-enabled automation is likely to be one of the hottest areas in the automation sector. Tools like Amazon’s Alexa are already being integrated into home and business atmospheres with increasing frequency. As individuals become accustomed to voice-activated computing, this new audio interface will make its way into the automation sector. Think voice-enabled customer service automation, voice-enabled smart building automation, and voice-enabled robots programmed to automatically complete business tasks.These five trends are just some of the automation advances business owners should have on their radar. The more a business owner knows about the future of automation, the better prepared they are to put these up-and-coming automation trends to work for their company’s benefit.

]]>