Home Business Intelligence Combine Analytics To Slack With the Assist of ChatGPT

Combine Analytics To Slack With the Assist of ChatGPT

0
Combine Analytics To Slack With the Assist of ChatGPT

[ad_1]

In my earlier article, “Is NLQ the Way forward for Analytics?“, I mentioned the necessity to unify the semantic layer to create more practical pure language processing (NLP) options in analytics. Just a few days after the article’s publication, ChatGPT was introduced, altering the panorama fully. Or did it?

ChatGPT is among the most revolutionary and promising tasks I’ve seen prior to now few years. As I examined it, I found that the semantic layer’s unification could be a necessity in spite of everything. Let’s show it with an instance.

We will outline the state of our database to ChatGTP. In our simplified use case, now we have just one desk, “order_lines.”

We’ll make an SQL question on prime of this desk. First, let’s use ChatGPT to get the SQL question within the Postgres dialect.

ChatGPT returns the proper SQL question. As an instance we migrated our information supply from Postgres to Snowflake and need to question within the Snowflake dialect.

As you possibly can see within the instance above, ChatGPT can deal with totally different SQL dialects, which is mind-blowing and inspiring to combine with ChatGPT.

I promised in my earlier article that I’d make a follow-up article presenting the implementation of the NLP software on prime of the analytics software. Because the title suggests, I’ll current an implementation of ChatGPT within the in style messaging software Slack on the highest of GoodData. Fasten your seatbelts, and let’s go.

Integration

The essential a part of the mixing is the openness of our instruments. Thankfully, each Slack and GoodData present a strong Python SDK and complete documentation. As of writing this text, there’s but to be an official software for ChatGPT that might be used for integration, although OpenAI says that “ChatGPT is coming to our API quickly”. Thankfully, the group, once more, reveals its significance and energy by presenting a reverse-engineered Python bundle that helps ChatGPT.

We’ve got all the pieces we have to begin integrating. Let’s begin with a extra manageable activity — combine Slack with ChatGPT. The instance under reveals that Slackbot efficiently responded because the ChatGPT. The implementation of this integration is trivial and is carried out with only a few strains of code. Yow will discover the code snippet for this use case and different use circumstances in my GitHub repository. The demo would require entry to a operating occasion of GoodData, so be happy to make use of GoodData’s trial for that.

Calling Slackbot and asking it a question that I would like to have answered by ChatGPT.
Calling Slackbot and asking it a query that I want to have answered by ChatGPT.
After posing the same question to ChatGPT, we can confirm that our Slackbot is indeed using ChatGPT to process and answer out questions.
After posing the identical query to ChatGPT, we will verify that our Slackbot is certainly utilizing ChatGPT to course of and reply out questions.

Now comes the trickier half — integrating ChatGPT with GoodData. Let’s say we need to entry data from the analytics platform by way of Slack. Fortunately, we will use ChatGPT to try this. Integrating one thing new into ChatGPT could be a problem. After I initially requested ChatGPT if it might hook up with a SaaS resolution, the reply was no. I then considered how I might train ChatGPT one thing new within the easiest way. I made a decision to strive sending GoodData’s metadata and having ChatGPT analyze it and ask questions associated to it, which labored. Nevertheless, there’s a restrict on the quantity of information that may be despatched to ChatGPT, so sending large chunks of information just isn’t attainable.

When we feed ChatGPT metadata information, we can ask about its content.
Once we feed ChatGPT metadata data, we will ask about its content material.

Let’s attempt to do one thing extra advanced — fetch analytics outcomes. Fortunately, GoodData is predicated on a headless BI idea, and because of the semantic layer, we will use the facility of metrics and never be restricted to data of tables. We are saying what we need to see, and the analytics engine does the remainder.

Let’s take into account the next tables, or datasets, which can be a part of the logical information mannequin.

We want to see values for Area (attribute — string worth), Amount (reality — numeric worth), and Income (metric). We’ve got direct entry to Area and Amount, however we have to outline the Income. We will use metrics for that.

Definition of Revenue metric using GoodData's Analytical Query Language (MAQL).
Definition of Income metric utilizing GoodData’s Analytical Question Language (MAQL).

You’ll be able to see the definition of Income as a metric above. Discover that we don’t must specify the Order standing desk and might reuse the Order Quantity metric.

Definition of Order Amount metric using GoodData's Analytical Query Language (MAQL).
Definition of Order Quantity metric utilizing GoodData’s Analytical Question Language (MAQL).

Now, let’s train ChatGPT the right way to fetch the info. Once more, we have to introduce a small hack to get ChatGPT to do what we wish. We current the API request physique to ChatGPT, which we are going to use to filter attributes, details, and metrics from the enter, after which we will fetch GoodData’s Python SDK to get the info and present them in Slack.

After teaching ChatGPT, we can observe that we retrieved our requested data. Note that the aggregation performed on the fact column quantity is SUM by default.
After instructing ChatGPT, we will observe that we retrieved our requested information. Be aware that the aggregation carried out on the very fact column amount is SUM by default.

Conclusion

Regardless of the present limitations of ChatGPT, there are methods of bypassing them. Nevertheless, for future use, it will be actually helpful if OpenAI would supply an intuitive strategy to enrich the ChatGPT. Personally, I’d prefer to think about an SDK for fine-tuning it or an possibility to supply a file or information with extra data.

ChatGPT’s safety, manufacturing readiness, and efficiency are different features value mentioning. Within the examples now we have coated, we bypassed ChatGPT by exposing GoodData’s metadata which could not be secure – metadata might be delicate.

As for manufacturing readiness, ChatGPT is just a playground, for now, with none particular enterprise aim, which is a pity, and we’d welcome a extra exact specification of its use circumstances sooner or later.

Final however not least is efficiency, which additionally pertains to manufacturing readiness. In manufacturing utilization, we’d welcome a greater latency of responses in addition to a specification of responses resembling their size, format (textual content vs. file), and so on. Retraining additionally pertains to efficiency. This brings us to extra questions. How usually ought to the mannequin be retrained? Ought to we retrain it by session, aka chat, or per occasion?

At the start of this text, I requested concerning the ChatGPT disrupting my thought of unifying the semantic layer for analytics instruments. Nicely, though ChatGPT could also be a recreation changer, we should always nonetheless concentrate on making issues extra accessible not just for chatbots but additionally for ourselves and finish customers.

My final be aware is that I stay up for what else ChatGPT will carry us and what the competitor’s response to ChatGPT goes to be. I’m considering of you, Google! 😉 GPT-4 ought to have an enormous influence, and it must be launched quickly. Let’s be shocked by what it’ll carry us.

I’d be more than pleased should you shared your perspective on this matter with me. Let me know should you tried one thing related and what you’ve gotten discovered.

Wish to strive it for your self?

If you wish to strive ChatGPT integration by your self, register for the free GoodData trial and attempt to arrange the entire course of within the demo repository.

[ad_2]

LEAVE A REPLY

Please enter your comment!
Please enter your name here