Tuesday, August 26, 2014

Finding a New Pattern: The Composer

I've written a series of blog posts about building a Recommender app by creating the required knowtifacts and dropping them into the Recommender Apperator to generate the app. My example was a Whiskey Recommender, and it was a more complex version of the Recommender pattern I introduced in my book The Shape of Knowledge. Earlier, simpler Recommenders covered in the book were the Beach Town Recommender and the Knowledge Artifact Recommender.

The Recommender knowledge pattern is one I created based on some of the work we've done at Apprentice Systems, building intelligent systems for clients. It is a simple pattern that contains both a triangle/tree (the Context Decision Tree) and a square/table (the Options Table). An optional component is a folder full of images depicting the various options in the table.

Once I defined the Recommender pattern I looked for simple examples I could use to build demo applications. In other words, the Recommender was a pattern looking for problems to solve. Now I am going to switch gears to a new pattern, one I discovered only recently, in the process of solving an important real-world problem. I believe this series of posts will make even clearer the potential of the methods I am laying out in The Shape of Knowledge. I am not espousing these ideas because they are nice to know. I am doing this because I want to make a positive difference in the world.

It was in the spirit of making a positive difference that I visited the local food bank two months ago, to see how I might volunteer. I went ready to pack boxes of food and make food deliveries, but after a brief interview with the volunteer coordinator, she decided I could make the biggest impact by helping them write grants.

Grant writing is actually the process of writing grant proposals to foundations, asking them to grant money to support nonprofits in their efforts. Charities rely on grants for both general support and project-specific support, and many nonprofits could not exist without these funds. Writing grants is a time-consuming and onerous task, and many organizations end up hiring a 'grant writer' to help them in this effort.

There is an industry of individuals and organizations that thrive on the fact that nonprofits have neither the time nor the skills to jump through the hoops of grant writing. Every foundation has their own process, which often includes filling out a custom application -- sometimes in hard copy, often online. The one-off nature of these applications means every grant proposal is usually a cut and paste exercise in Microsoft Word, using past proposals as the raw materials for new proposals. This process can be haphazard and inefficient.

It's also hard to find foundations that are likely to support the request of the charity, based on mission and geographic fit, so database companies have sprung up to meet this need -- for a stiff monthly subscription fee. My personal experience with the quality of the leads coming out of these services would indicate this is not a good investment.

I don't begrudge anyone making a living, but personally I have a problem with so much of a charity's funds being diverted into the process of writing grants. I would like to see the food bank's money going to feed hungry people! I think foundations that support the food bank would want this as well.

I also think that funds should be directed to the nonprofits with the best programs, not the best grant writers. With that principle in mind, I decided that philanthropy is a sector that could benefit from a bit of technology disruption. A high potential piece of that disruption is a pattern I identified by working with the grant writing process -- I call it the Composer.

Monday, August 18, 2014

Deb's Whiskey Recommender

Earlier posts have described the processes, both mental and physical, that I went through to create the knowtifacts necessary for generating a Whiskey Recommender. I used basic Excel skills to create the Options table. I used KnowtShare to generate the Context Decision Tree. I used Google and Bing's image search tools to find suitable images and placed them in a folder. I uploaded these three components into the Recommender Apperator, and it generated "Deb's Whiskey Recommender" for me.

For each of these steps I needed some basic computer skills, but I never needed to write computer code. What was most essential for me to provide was the knowledge of whiskey and an opinion about which type of whiskey was the best choice in different contexts. 

Since I wasn't an actual whiskey expert, I had to use the internet to educate myself. I also realized, too late, that I had taken on a really, really complicated subject for what was supposed to be a simple tutorial! This forced me to make several compromises between completeness and manageability. I had to cut corners. Each time I did, I noted that if I were building a real application I might have made different choices, and suggested how a more complete approach might be pursued.

So what did my efforts get me? Here are some screenshots of Deb's Whiskey Recommender, the app generated by the Recommender Apperator:

The logic I embedded in the Context Decision Tree is transformed into a simple wizard.





As the user makes choices, those choices are placed into the 'breadcrumbs' at the top of the page. This navigation device not only makes it clear which path has been taken through the tree, it makes it simple to backtrack to any one of the decisions and change it. When a user clicks on a prior choice, he or she will be taken to that spot in the wizard.

From a 'Shape of Knowledge' perspective, it is worth noting that the Context Decision knowledge is captured in a triangle shape, a tree, but the user interface serves that knowledge up in a linear fashion. This is an example of one of the best practices I talk about in my book: use the best knowledge shape for capturing the knowledge, but use the simplest shape possible when presenting it to a user. In this case, the triangular knowledge is flattened to a line by the wizard-like UI.

Based on this particular set of decisions, a long list of whiskeys is recommended. This path takes the user to the bourbons, both Tennessee Whiskey and Kentucky Straight Bourbon. Here is a sample of the recommended list:


The baseball card format lays out information from the Options Table. Shown are three of the many Kentucky Straight Bourbons in the Whiskey Table. At this point, the implications of the compromises I made become clear: everything on these three cards is identical, except for the brand name. Because all three whiskeys are from the same manufacturer, they have the same image. Because they are all the same type of whiskey, they have the same taste profile. Even though the price levels were calculated individually, they all happen to fall into the same price group. It would have been nicer if I had documented this information down to the individual brand level, but with 450 brands in the data table that wasn't feasible.

The options for knowledge authors building future Recommenders are these: pick a simpler topic, with fewer options; crowd-source the information in the Options Table; or be prepared to do a whole lot of work yourself, which is worth it if you are creating a Recommender to sell, establish your expertise, or to create competitive advantage. 

Meanwhile, it is important to remember that the amount of effort required to create a complete data table is minor compared to the effort required to build this sort of application from scratch! The data has to be there, in any case -- there's no avoiding that work. But the ease of building the decision logic in KnowtShare is unparalleled, and the user interface and the computer logic that knits the pieces together comes for free. 

This demo application achieved my goals: to document the process of building a Recommender, and to demonstrate that a potentially sophisticated application can be created based solely on domain expertise, no computer code required.

Tuesday, August 5, 2014

Creating the Whiskey Context Decision Tree - Part Two

My last post described the general challenges of building a context decision tree, and the specific challenges surrounding my search for expertise regarding whiskey selection. In the end, I decided I would have to rely on my own ideas, developed during the many hours of research I conducted while building the other inputs to the Whiskey Recommender. My immediate need was to create a context decision tree so the Recommender Apperator could generate a Whiskey Recommender app. Once that example is published, I hope to find some real, live whiskey experts that can help me build other, alternative Whiskey Recommenders.

I created my decision tree using our free KnowtShare web application. KnowtShare was designed to make it easy to build tree-shaped models. We, at Apprentice Systems, know from our many years of building intelligent systems that trees - hierarchical, non-cyclical models - are essential for capturing several modes of reasoning. Classification, composition and multi-pronged evaluation are all best described using trees. The branching behavior of a decision tree is also easy to document with this sort of model.

While some trees are best built bottom-up, a decision tree is usually built top-down. In other words, you decide the first question you are going to ask, list the possible choices, then determine what choices will be presented based on that first choice, and so on. The tree will document all the possible paths through the context collection process, but users will only travel one of those paths each time they use the application. At the end of each path, a 'leaf' on the tree, will be a recommended option - in this case, a type of whiskey.

I decided, pretty easily in fact, what the first question in my decision tree would be: "Are you going to mix your whiskey or drink it straight up?" I think this is a good first question because most whiskey connoisseurs agree that if you are going to mix your whiskey with Coke, it really doesn't much matter what you drink! Just don't waste a good Scotch! Of course, there are those who will mix an expensive whiskey with Coke, and I need to allow for that possibility as well.

Here is the 'mix it' side of my whiskey decision tree:


The next set of choices I present are using a flavorless mixer (water or club soda) versus a flavored mixer. You can still be a whiskey purist, of sorts, if you only use water or club soda. If your whiskey is to become part of a cocktail, however, it will be difficult to taste the whiskey itself - which is perhaps one of the goals of drinking a cocktail.

I'm pretty comfortable with these first few questions; I think I am on safe ground. Now the going gets much more difficult. I knew the 'flavored mixer' path was taking me towards the cheaper whiskeys, such as Canadian and American blended whiskeys, so I created the next set of choices: do you care more about price or status? If the user selects 'status', I decided to recommend either a Kentucky Straight Bourbon (like Wild Turkey) or a Tennessee Whiskey (like Jack Daniels). Picking 'price' leads to a variety of inexpensive American and Canadian options.

The real puzzler is the next set of options for the non-flavored mixer path. Remember, choices have to be presented in a language that represents the user's perspective (this was covered in the last post). Waxing poetic about the process differences between Scotch, Irish Whiskey and Bourbon won't work here! The target audience of the Whiskey Recommender is someone who is new to the world of whiskey, not an expert. Newbies couldn't care less about the finer points of distilling whiskey, especially since their palates probably can't distinguish the taste differences that result. So I decided to keep things simple, and make the next set of choices "do you prefer American products, or not?"

Finally, at the next level, I reached a point in the tree where I relied on taste profiles to make a distinction. American products were split into 'spicy', which leads to American Rye, and 'sweet', which leads to the bourbons. The non-American choice was split into 'light and smooth' (Irish Blended and Canadian Single Malt) and 'smokey and robust' (Scotch Blended and Single Grain).

This is the point where I need to reiterate an important message from the last post: this is all subjective! Even if I were a whiskey expert, which I'm not, this would still just reflect my opinion. A recommendation, by definition, exists in the world of subjectivity. Otherwise, this would be an 'Answerer', not a Recommender.

The power of the Recommender pattern is that I can create "Deb's Whiskey Recommender" just by building this tree in KnowtShare and combining it with the Whiskey Data Table in the apperator. Then my friend Richard, a real whiskey expert, can generate "Richard's Whiskey Recommender" by creating his own decision tree. He can even reuse my Whiskey Data Table. Better yet, in the future we can crowd source a much more complete data table and make that a community asset we all tap into when we build our own unique Whiskey Recommenders. That's the vision.

Back to my Recommender. Let's take a look at the other major branch of my decision tree, the 'straight up' branch:


I reused the 'do you prefer American products' choice again, and early on in the question sequence, because I needed to account for American Single Malts and I can't do it through a taste profile. American Single Malts are all over the board, taste-wise, because American distillers are using a wide variety of processes to create their single malts. Some are following the Scottish methods, and beating high-end Scotches in blind taste tests. Some are creating their own unique processes that are leading to unique taste profiles. All that binds them together is their country of origin, and that American origin is important to some people, including me. I like our underdog status in the Single Malt arena, and I like to support these distillers when I can.

As for the rest of the 'straight up' branch, it is a taste-driven breakdown between Irish Whiskey and Scotch, and within Scotch, a breakdown into the various regions. While some regions have distinct flavor profiles (like Islay) and some are more diverse (like the Highlands), taste is still the easiest way to direct a Scotch drinker to a particular region.

A real Whiskey Recommender, as opposed to this demo application I am building, could recommend specific Scotch brands, like Laphroaig. To keep things manageable, I have decided to stop my recommendations at a type of whiskey, like Islay Single Malt Scotch. If you've read the other posts about building the Whiskey Recommender, you will know that this is one of many simplifying assumptions I have made during this process.

Now that I've built my Whiskey Context Decision Tree and saved my KnowtShare file, I have all of the knowtifacts necessary to generate my app. The next step will be to enter them into the Recommender Apperator and generate my own custom web app.