Telerik blogs

By: Stephen Forte and Mehfuz Hossain

AYLIEN

As a developer, you probably get chills when you think about text analysis. I get them as I remember a huge project I worked on 10 years ago that did some screen scraping and data aggregation with the earliest versions of .NET. I had to use regular expressions or RegEx in order to process the data contained in web pages. Sometimes I would have to write a RegEx like this to strip out HTML tags from text: <(\"[^\"]*\"|'[^']*'|[^'\">])*>. I did so much text analysis that I use to sign my emails with a RegEx since there are three versions of my name: Steve, Steven, or Stephen: Ste((v|ph)en|ve).

RegEx was hard to  learn, a pain to maintain, and prone to bugs. (catastrophic backtracking anyone? ) Today there are even more applications for text analysis. As social media has gone uber mainstream and business models have changed, developers are asked more and more to process text from the web. Some examples are monitoring social media, detecting fraud, customer service, recruitment, content marketing, campaign management, and tons of other scenarios that the marketing department can dream up.

One scenario is looking at press releases, TechCrunch articles, etc, and aggregating the keywords, getting a summary and looking at the sentiment of the article. Take a recent Telerik Press Release about the Verfied Plugin Marketplace at: http://finance.yahoo.com/news/telerik-launches-industry-first-apache-133100112.html

Using text analysis you can get the following returned from the article as a JSON object:



You can also get a suggestion of hashtags:

#Telerik
#CouchbaseServer
#PhoneGap
#Plugin
#AngularJS

And you can also get an analysis of the sentiment of the article:

 

When building your hybrid mobile app, chances are you are going to run into a scenario where you need to do some text analysis.

A new partner of Telerik, AYLIEN, has a text analysis engine that you can use in your apps. By using the verified plug-in built by AYLIEN available in the marketplace, you can build text analysis right into your own apps.

To get started all you need to do is download the plugin or just click on the big “Try Plugin in AppBuilder” button on the AYLIEN plugin page.



When you click the button, you will be brought to AppBuilder and an empty solution will be created with the AYLIEN plugin already loaded and properly configured.



Now that we have our plugin configured it is time to start using it in an app. In addition to the AYLIEN plugin, I have added a social sharing plugin to a sample project. This will allow me to create a simple app that will allow the user to take a URL of an article they read on their device and then suggest to the user hashtags before sharing the article in Twitter or Facebook.

The app looks like the following when completed:

When I press share, the app will capture the input URL and send it to AYLIEN for extraction in the following way:



The plugin defines a global AYLIEN object, which defines various operations that are used for data extraction. Using the hashtag suggestion system, the service gives me a list of highly-relevant tags that will help me get more exposure for my content in social media.

Next, once the content being processed and the callback is completed, I set it in the social sharing plugin that is responsible for calling the device specific social sharing dialog and can send out the message.



Compared to the old school method of screen scraping and regular expression this shows that we have come a long way in terms text analysis and services like AYLIEN makes it even simpler.

Download the AYLIEN verified Cordova plugin today: http://plugins.telerik.com/plugin/AYLIEN-text-analysis-api


About the Author

Steve Forte

 sits on the board of several start-ups including Triton Works. Stephen is also the Microsoft Regional Director for the NY Metro region and speaks regularly at industry conferences around the world. He has written several books on application and database development including Programming SQL Server 2008 (MS Press).

Comments

Comments are disabled in preview mode.