How #AzureML and #MachineLearning are helping managing my Inbox–Part I

In this post, how to build an AzureML model to auto suggest folders/labels for email classification & archiving. How to consume AzureML web service directly on Outlook.

note: sample AzureML experiments now published on the brand new AzureML gallery. Email Classifier-Training & Email Classifier – Scoring

Context: for years I’ve opted for an archive by folders strategy to handle my Inbox (not obsessed with inbox zero but  I try to keep it below ~50 inbox mails, and instead use inbox like a buffer – since my first contact with David Allen GTD years ago). true: once in a while I try to test the single  archive folder, but until now…always reverted back to my folders to organize so many parallel projects and threads going on

For this to work, I think one thing  is absolutely mandatory, very fast folder archiving and switching. Although have tried a few tools for this  I ended up coding some Outlook macros over the years to fit this… “peculiar” way of working and unproductive task switching…. 

So to archive a mail I just press alt-4, this window popups up, I type my search terms, enter, and it’s done. mail Archived

image

Or to switch context to a specific project or fast search, just press alt-3, search, enter and I’m there with the latest thread mails immediately available.

image

(that can admit, I obsess over searching…. “as you type” kind of search :) )

Fast forward to “the present”, #MachineLearning #DataIntelligence #AzureML era. I now have a few thousand “labeled” mails (to use machine learning terms) on several active folders. My macros were needing an improvement….  :)

So I exported my archive mails in the form:   |from | to | subject | time offset since fixed day|  format to a csv (tsv in fact)

image

and let AzureML do the heavy lifting of building my very personal email classifier suggestion web service, putting some multiclass classification models & also text handling /feature hashing AzureML features to work in a more useful scenario than classifying flowers :)

 

image

Sticking with the neural network model for now (default params), created and adjusted the scoring experiment & published the web service.

image

image

Used the VBA code sample from the new cool AzureML generated Excel files,

image

few lines of code added on my Outlook macros, based on AzureML Excel VBA code/macros

image

and we get a pretty impressive auto classifier ready to use & help manage our inbox, suggesting the folders where the message belongs when archiving.(note: also triggered when sending messages, archiving both sent and original message if needed.)

So for example,  if I’m disturbing Joana with another annoying mail :) about SmartCharts new features AzureML advises me:

image

On the other hand, if it were an help request to Romano on some stream analytics samples AzureML would opt for:

image

press Enter, for now it’s needed…:) ,  and that’s done. How cool is that? :)

(have to say that the accuracy is not 100% obviously , but pretty damn useful already)

All this running on a free AzureML workspace. Up & running & minutes, from training to online web service

(excluding the time to slightly adapt AzureML VBA code to call the web service & get my mail properly exported)

Training & scoring experiments are available in AzureML gallery fo you to test drive. Off course I loaded a small sample of my mail in those, so you will have to load your own to really see how it works.

…now, to be close to perfection this would benefit from automated data update & model retraining, and that will be the case for use the new AzureML training APIs.

But that will have to wait! :) (true, reduced some time processing my inbox, but not that much…!)

btw- hope to get feedback on this scenario, ex: feature engineering tips and model tuning suggestions to improve the model results

Cheers

Rui

And Now, for something completely different… Outlook folder “speed dial”, or “Jump To Folder” Macro :)

So maybe this can be a little off topic on my “Business Intelligence” blog, but really BI it’s all about getting information… as fast and as simply as possible! So for me, it’s certainly related after all. Indulge me. :)

Maybe you use some “GTDish” mantra, maybe you just like to store your work/personal mail in proper folders, maybe you use a auto filling tool like the awesome Clear Context Add-In… maybe you use Microsoft CRM for Outlook… In the end you’ll have lots of folders, wasting lots of time to browse to the folder you’re looking for.

Enter an old, almost forgotten, friend: VBA, Forms & Outlook Extensibility! So with a lo…little copy paste from scripts I found, a little tweaking, almost none optimization… and that’s done. That was really the end of endless and frustrating outlook folder searching for me!

Just press alt-3, type the search words for the folder you’re looking and press enter. That simple! The search box is live, working as you type. Best of all, it’s free and with (average quality I’m afraid… :)  ) source code available.

Some Usage Examples

Looking for that folder???

Press alt-3 (note third button on the quick access tollbar), type what you’re looking for:

maybe it’s some Gmail folder..?

looking for spam???

or even some Microsoft CRM for Outlook folder?

So now press enter and it’s done!!

Other features & notes

  • Fast as needed on my laptop, with aprox. 800-900 (….) folders from Exchange Mailbox, local pst archives, gmail isapi and CRM Add-In folders.
  • First time is a little “slow” because it stores all folders available. If you need to refresh de folder cache press shift when activating the clickable menu option
  • It will select the folder on enter only when the search returns one item only, tweak the vba as you wish :)
  • Escape to Cancel
  • I’ve used keystate vba module (modKeyState) By Chip Pearson, www.cpearson.com/Excel/KeyTest.aspx

Setup

  • Download the files here
  • Activate the developer tab on Outlook
  • Enable macros on Outlook
  • Open VBA on developer tab and import the downloaded files (JumpToFolderForm, JumpToFolderStore,KeyState)
  • Add option to Ribbon using standard customize Ribbon option, ex (2010)
  • Test it
  • Need an hot key? Just add it also on quick access toolbar!

      o

      o

      o

      o

  • Now just press Alt-3 and you’re done!!

So that’s it for tonight. I must say that this feature was inspired by QuickJump for Windows (awesome tool, worth every $ I’ve paid) and like a good companion to ClearContext for Outlook.

Comming soon (on this blog):

  • Are you doing Business Intelligence, or only “Data Intelligence”, what’s the difference and why it matters??? (aka rant on the rather strange “consensual” adoption of the “business intelligence” term)
  • and some others… :)

Note: “soon” is a rather “overrated” term I’m afraid ;)

Best regards,

Rui