Basic Pega NLP exercise for Twitter


Here I am sharing a small, basic Natural Language Processing (NLP) exercise using Pega Infinity V84 to analyze the Twitter's tweet data and capture the sentiments into a Pega case. Before we start this exercise, we need to have twitter's API keys. For that, we need to login into the Twitter's developer site using twitter login credentials and create an app in it.

Here is the details for your info and below are the simple steps to be followed to work on this exercise J

1) We need to build a Data Flow: TwitterDataFlow to capture the Twitter configuration (TwitterDS) , Text analyzer process (TweetsAnalyzer) and a Pega case (TwitterCase) to be used to capture the data

2) Took the Pega NLP model: TwitterSentimentModels and used in the Text analyzer step and created a sample NL file (TwitterSentimentLexicon) in csv format to recognize the words/sentiments

3) Create a sample model(TwitterSentimentModels) by using the Predictive analytics process from Prediction Studio given by Pega

4) Finally, capture the tweet data into a Pega case (TwitterCase) after text analysis done

Here is the snapshot of all the used rules for this simple work and you can follow the arrows & text to understand the above steps clearly J



To test the above work, here is the sample tweets used from my Twitter acct and captured the sentiments è Positive, Negative and Neutral based on the Lexicon file used above. Of course, we can use different language texts for identifying the sentiments and we need to mention the corresponding Language code in the csv file while importing into that Lexicon rule. Used a simple tag => #pisupati and analyze the tweet’s text from the posted tweets and those tweets data is processed from Pega NLP process to create sample Twitter case to store in work item J




Though the whole exercise looks very simple after seeing  the above explanation but there is some hard work involved to bring this exercise in a simplified format J. Those who are not aware of what is NLP and where it is used in AI etc etc, can be checked from Pega community or google them.

References:
1) Pega Community Site
2) Pega Developer's Help
3) Google.com

Popular posts from this blog

Connecting Claude to Pega Infinity 25.1.3 via MCP — Step-by-Step

itextpdf API to generate PDF doc from an image file using Pega PE

Understanding of Hugging Face platform for AI/ML platform