sdg BLOG

Communicate and Motivate

By: Mike Huang

You’ve identified a key need, made your business case to the suits with the purse strings, and secured a budget. Building your team, you have sought out the best and brightest people throughout the organization, and maybe even recruited outside to find individuals to fill specific needs. If there are smarter people on the planet, they’re either off the grid, retired, or executives at Google.

You’ve taken the time to build an organization that will optimize both creativity and productivity. You’ve spent countless hours fine-tuning your strategy and tactical approach. Nothing has been left to chance.

At this point, you’ve spent considerable time, effort and money to get your team together, trained, and running productively. Processes have been built, tools have been purchased, and development has begun.

You’ve kicked off your project. Excitement is palpable. Your vision will change the world — or at least a small corner of it. With a little luck, this program will make a significant impact in its niche area, and maybe have broader repercussions for many others.

You’re running down the path as quickly as your feet will move, and your team’s fingers can dance across their keyboards. But with many projects, what we hope never happens, does: disaster strikes.

That disaster could be anything ranging from a loss of key funding, a competitor coming out with a competing product that overshadows what your team is working on, or something as personal as a departure or medical issue with a key team member.

In the eyes of many team members, how you handle these events ultimately defines you as a leader.

Are you the type of leader to ignore the critical event and tell them to press on, blowing caution to the wind and put personal feelings aside? Or are you a leader who wants to have a personal meeting with each member of your team to gain an intimate understanding of their concerns, pains, and fears?

Successful leaders will ultimately handle adversity in an honest, positive way.

1. Be Honest

You’ve got intelligent people on your team. That’s why you’ve hired them in the first place. They will see through any unnecessary spin that is put on a bad situation. More importantly, good people will value personal integrity and reciprocate with their loyalty. Things may be bad now, and they may get worse, but smart employees who see that you’re blowing a smokescreen will be more likely to flee rather than stick around to deal with the aftermath. Be honest with what you know (within reason and the law), and what your plans are to rectify the situation.

2. Don’t Bear the Burden Alone

If you could have built your company without anyone else (e.g. architects, engineers, business analysts, quality assurance, marketing, HR, etc.), you surely would have, right? But the reality is that running a business is a team sport, and everyone on your team has a vested stake in the success of your project. Don’t assume that your team can’t help you. Leverage your team’s willingness and ability to help build additional ownership in the solution. This will drive a more effective, concerted effort to get to a better place. If your challenge is the unexpected departure of a team member, they can help develop the plan to fill in the gaps. If competition is making a surprise announcement, your team may have ideas on how to counter the challenge. If funding is an issue, they may volunteer ideas on how to keep the project rolling by cutting costs, improving revenue, or realigning staff.

3. Listen

One of the most difficult skills to master, listening is critical to a modern team’s success. Your team will have concerns, issues, and most importantly, ideas. It’s easy to be the leader who extolls the virtue of your own ideas, the company’s vision, or the plan that was agreed upon by senior management. But capturing good actionable ideas that will help the team move forward (and consequently improve morale) is far more challenging. The payoff is a deeper buy-in from your team, as well as solutions from a different perspective.

4. Stay Focused

What’s the next step to overcome your conundrum? What solutions can you and your team build to get there? How can their skills move the project forward? Keep your eye on the goal — overcome this obstacle and get back on track to your original plan. Or perhaps there’s a newer, better plan that may arise from the ashes of your current project? This wouldn’t be the first time. After all, R.H. Macy had 7 failed businesses before founding Macy’s department stores, and Soichiro Honda was turned down from a job at Toyota before founding Honda Motors. And how many people remember Bill Gates’ and Paul Allen’s first company before Microsoft, “Traf-O-Data?”

Time and time again, history has proven that the most important asset to any successful business is the human capital — people. Respecting your team through honesty and integrity, and empowering them to make decisions while being part of their own destiny has proven to be a winning formula.

So, if and when crisis strikes, be honest with yourself and your team. Let them know that you’re in this with them, and that you’ll get through it together.

Applying Sentiment Analysis to Twitter

By: Greg Case

Although social media has enabled consumers and businesses to connect like never before, it offers its own set of challenges. The sheer flood of information makes it difficult to perform informed decisions. For instance, how is the brand manager of Acme Corp supposed to handle the launch of the new “WonderWidget” line? There could be tens of thousands of tweets that need analyzing. Not to mention Facebook comments, YouTube, Pinterest and Amazon reviews. This is where Sentiment Analysis comes in.

Sentiment Analysis is the process of taking a block of text and determining if the author feels positive, neutral, or negative about a particular topic. It can be an extremely difficult problem to do correctly. For instance, consider the following (naive) approach. This approach simply takes a dictionary of words and assigns a positive or negative weight to each. To determine the overall sentiment of a phrase, simply add up the scores of the words found in the dictionary. Here is an example:

Now, taking this table, we can assign values to the following sentences:

  • The movie was great! Excellent explosions! 5 + 10 = 15
  • I thought the movie was terrible. Boring! -5 + (-3) = -8

So far so good, for these completely contrived and unrealistic examples. But notice how quickly we run into trouble. For instance, the word “sick” can mean different things in context:

  • I got sick after I ate Taco Bell.
  • These rhymes are sick!

Our naïve approach would treat both of these as negative sentiments, even though the latter is expressing approval of some “sick rhymes.” Additionally, the subject of phrase greatly affects what a positive viewpoint means. For instance, I’d love to read an unpredictable mystery novel, but would stay away from a car with unpredictable brakes.

Clearly the dictionary approach has some significant limitations. In order to do a proper job of sentiment analysis, some natural language processing needs to be done. Natural language processing takes human input, whether textual or spoken, and converts it to a form where a computer can infer some meaning. However, going into the methods and science of natural language processing is beyond the scope of this article, and frankly, well beyond the understanding of this author. The good news is, there are several companies that provide this service.

For the purposes of this article, we’ll be using AlchemyAPI.

AlchemyAPI provides a REST interface which will analyze the provided text and give a result as follows. To sign up for a developer key (necessary for running any of the sample code) you can register here.

Let’s use the service to analyze this actual tweet by John Carmick about the new Iron Man 3 movie:

To do so, we need to generate a POST to http://access.alchemyapi.com/calls/text/TextGetTextSentiment with the following parameters:


In this case, we get back the following response:

 {
    "status": "OK",
    "language": "english",
    "docSentiment": {
        "type": "positive",
        "score": "0.0434121",
        "mixed": "1"
    }
}

As you can see, the API determines the language the text was written in, and then provides an analysis of whether or not the text was positive, negative, or neutral overall. Scores range from -1.0 to +1.0. In addition, if it appears the tweet has both positive and negative aspects, a “mixed” flag with a value of 1 will be provided. Compare that response to this one, for the much more straightforward, negative review:

results in:

{
    "status": "OK",
    "language": "english",
    "docSentiment": {
        "type": "negative",
        "score": "-0.123076"
    }
}

As you can see, this service does an admirable job of analyzing the sentiment of these tweets. So now let’s get to some code. Full source code can be found here. The project is using Spring, Spring Data, Hibernate, Jackson, Twitter4j, and is built with Maven.

We’ll do a brief overview of the code, starting with our simple data model.

public enum Mood {
    POSITIVE,  NEUTRAL, NEGATIVE
}

@Embeddable
public class Sentiment {

    private Mood mood;

    private float confidence;

    //implementation omitted
}

/**
* A topic is what users which to search twitter for.
*/
@Entity
public class Topic {

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long topicId;

    private String name;

}

@Entity
public class Tweet {

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long tweetId;

    /** statusId is the unique key assigned by Twitter */
    private Long statusId;

    private String text;

    private String username;

    private Date date;

    private Sentiment sentiment;

    //implementation omitted
}

We’re going to use a library called Twitter4j to stream results from Twitter that match a given Topic. The full code is lengthy and can be found at TopicListener.java, but this is the part we’re most concerned with:

The TweetSink is nothing more than an interface that can consume a Tweet. We happen to have AnalyzingTweetSink implementation. It uses an Executor to dispatch the analysis of a Tweet to a SentimentAnalyzer interface. This code is using a simple single threaded Executor, as we don’t want to overwhelm the service just for this demonstration. You can also see that we are using a class called SentimentStats, which is just there to aggregate the Sentiments we’ve generated for the tweets and provide some useful metrics.  Here is the code the Executor will run for each Tweet:

class AnalyzeWorker implements Runnable {

      private final Tweet tweet;

      AnalyzeWorker(Tweet tweet) {
          this.tweet = tweet;
      }

      @Override
      public void run() {

          Tweet existing = tweetRepository.findByStatusId(tweet.getStatusId());
          if (existing != null) {
              logger.warn("Already seen this tweet, skipping");
              return;
          }

          Sentiment sentiment = analyzer.analyze(tweet.getText());
          logger.info("{} Sentiment: {}", tweet.getText(), sentiment);

          if (sentiment != null) {
              stats.add(sentiment);
              tweet.setSentiment(sentiment);
              tweetRepository.save(tweet);
          }
      }
  }

As you can see, it checks to see if the Tweet has already been analyzed, just in case our stream hiccups or our server restarts. It then uses our injected SentimentAnalyzer to determine the Sentiment, and finally persists the Tweet. The SentimentAnalyzer implementation itself is AlchemyApiSentimentAnalyzer. It’s not exactly pretty, but it works.

Now that we’ve run through the code, let’s stick a couple of topics at it. Here is Iron Man 3:

Total: 89
Negative: 11, average confidence: -0.17
Neutral: 46
Positive: 32, average confidence: 0.18
Overall Mood: Positive, confidence: 0.09

And here is what it returns for the IRS (Spoiler alert: Most people don’t like the IRS):

Total: 101
Negative: 59, average confidence: -0.18
Neutral: 15
Positive: 27, average confidence: 0.11
Overall Mood: Negative, confidence: -0.09

Now that we have a skeleton of an application, there are a number of different directions we could take. One can imagine a service where a brand manager could configure a number of topics to monitor. Negative messages could trigger a follow-up with a Customer Support Specialist. Or it could be used to gauge the effectiveness of a new ad campaign in real time. Topics could be monitored for a sudden upswing or downswing in sentiment, perhaps indicating something has gone viral. Or the service could even be used for purchase decisions, pitting Honda against Toyota and seeing which one has a greater positive sentiment. And the list goes on…

Developers: How to Make your BA more Effective

By: Lori Most

At a time when “speed to market” is at the top of every stakeholder’s list, we need to produce solid solutions in shorter and shorter timeframes.  And, there’s no reason to hide it:  you want to get your hands on the requirements ASAP.  The business typically has a pre-defined go-live, and analysis time cuts into your valuable coding time!

Luckily there is something you can do to help speed up the analysis process, and quickly make your Business Analyst more effective.  Make sure your BA knows your technology and the way you plan to implement it.  No matter how technical your BA, they cannot know the details of your architecture or coding standards without guidance from the development team.  In addition, let the BA know your development methods/processes.

You may be skeptical that you’ll be SAVING time by taking up even MORE time walking through the technical details, but I assure you that your ROI will be worth every minute spent.  Here are some of the immediate benefits:

  • Reduce the need for extra discussions between the users and the developers by giving the BA enough technical information to understand what the options might be given your technology abilities or constraints
  • Increase stakeholder acceptance of new solutions by enabling the BA to create more accurate designs and prototypes
  • Decrease the amount of technical gotchas that often emerge well after coding starts
  • Increase system performance with more awareness of impacts of technical controls and data retrieval
  • Streamline developer workloads to ensure top priorities are addressed first, and developers don’t waste time on “nice to haves”

I’ve listed examples below of technical details that I find helpful to understand when starting a new project, along with examples of how a BA could translate that information into more effective analysis:

Server Configurations/Capacity

How many servers in the farm, what else is running on them, how much memory and CPU capacity do we have for this solution?

How can a BA use this information?  For planning animations, choosing colors, helping to determine how much high-priority data can stored in memory- and which will need to be retrieved from the DB, etc.

Database Architecture

What is the overall database set up, is all required data in the same database and/or server, does any data need to come from a data warehouse structure?

How can a BA use this information?  To query data, determine which teams need to be involved, help business understand which data is easily accessible-and which will require more work and/or a possible lag in response times

Software Solution Architecture

Where is the business layer, how is validation handled, what is being cached (and how)?

How can a BA use this information?  To understand what types of changes require a UI release v. a back-end update, help to identify caching candidates, write better use and test cases based on validation strategy.

Data Retrieval

How is the data pulled, how often, what types of calls are used, are there any data type restrictions, what is the data integrity, are there data delays?

How can a BA use this information?  To determine which data is reliable for the business’ highest needs, determine how quickly time-sensitive data can be retrieved, help determine display for the data (reports, grid, search results, etc.), determine data delivery (email, self-serve, system alerts).

Development Process

Is the same person doing UI and Backend, is there a split with UI-only developers and Back-end only developers,  is there a Lead programmer, do the developers want design input, what is the developer definition of done?

How can a BA use this information?  To determine methods of communication and documentation with the developers, determine continuity in where the business logic resides, align expectations for final product and level of testing needed.

Development Daily Status Updates

If you typically have developer status update meetings — What is everyone working on today, what questions came up yesterday, what is the status of the next milestone?

How can a BA use this information?  To help outline functional priorities (as they change), and if developers are having a difficult time with a piece of planned functionality, the BA may be able to re-assess on the spot, and update the requirement to better align the ROI based on new/unexpected Development timelines.

Important Disclaimer:  Adding the BA to technical meetings or discussions does not mean that the BA should now stop consulting with the Architects and Developers for the overall solution design.  Collaboration is key to any software solution.

BA’s with a deep understanding of their users and the latest analysis techniques make some of the most valuable assets on a Development Team.  But a BA with an understanding of the capabilities or limitations of the technology and/or development team could make your BA move much more quickly on the front end of your project, leaving you with more true design and coding time.