AI and Email text generation

81% of SMBs use email campaigns to nurture their audiences.

Email is the most important tool for any business communication. The key to great e-mail communication is crafting content that people actually want in their inboxes and that speaks to each customer separately, instead of a single e-mail sent to one and all. A badly written email, rather than speeding up communication, proposal or instruction slows down business processes. However generating a proper email content for any business discussion is a difficult task. It needs lots of experience and practice with multiple iteration. The future of e-mail is real-time, behavior-based personalization.

With advancement of AI related tools and methodologies, there are efforts to assist in email content generation. Can AI help or fully automate content generation? I would be covering couple of my experience on this subject.

Artificial intelligence (AI) and machine learning (ML) are fascinating in that they benefit every facet of content marketing. Specifically, through advanced machine learning technology, the process of creating content marketing strategies becomes easier.

Developing such systems have two types, one is static type of check typos, grammar and syntax and second type of a complete AI solution, an adaptive system to generate content based on a set of questionnaire.

There are tools, like browser plugin Grammarly to highlight any grammatical mistakes, tone of your email as you compose your emails. There is a javascript based SDK https://www.inboxsdk.com/ to be used for developing such mail plugins. You can use gmail plugin development framework for developing such mail plugins too.

Its AI everywhere and its time to use the power of AI and machine learning to assist in content generation for business. The very first step of a successful AI system depends upon the quality of training data set and methodology used.

Content of an email would be different based on the context – domain. Likewise, training data is also context dependent. Email training data set for finance domain is different than retail domain. There need to have a general training set and then domain specific training sets. User will be prompted with set of questionnaire to aid in text generation. Or user can enter a set of keywords – domain specific. Based on the user feedback, appropriate training set would be used, or a hybrid of multiple training set would be used to generate email content.

Recently google has introduced text suggestions in their gmail platform, when user types any sentence, the AI engine would prompt auto suggestion. It helps commonly used to words to complete the sentence.

There are some neural network based libraries to help in character level prediction like char-rnn – https://github.com/karpathy/char-rnn the model takes one text file as input and trains a Recurrent Neural Network that learns to predict the next character in a sequence. The RNN can then be used to generate text character by character that will look like the original training data.

https://github.com/jcjohnson/torch-rnn torch-rnn provides high-performance, reusable RNN and LSTM modules for torch7, and uses these modules for character-level language modeling similar to char-rnn.

There are some RNN – Recurrent neural network based text generation libarries like textgenrnn – https://github.com/minimaxir/textgenrnn – a library developed on top of Keras/TensorFlow , easy to train and can be integrated quickly. Then we come across OpenAI’s text generation framework https://openai.com/blog/gpt-2-1-5b-release/ , Gpt-2 from OpenAI is the most powerful text generation framework. OpenAI unveiled its new AI language system, GPT-2, and TalkToTransformer is a slimmed-down, accessible version of that same technology, which has been made accessible only to select scientists and journalists in the pastIn the beginning, it was not released completely with fear that it might be used for anti-social activities.

In a nutshell, AI based email text generation is a long way to go and there are some good libraries to help you. GPT-2 language modeling system from OpenAI would be the most innovative text generation system.

GPT-2 is a large transformer-based language model with 1.5 billion parameters, trained on a dataset of 8 million web pages. GPT-2 is trained with a simple objective: predict the next word, given all of the previous words within some text

Generating title of any email, especially business email is a tricky task. The very first thing User sees is the subject of email. There is a Neural Network based library NLU Email Title to help in email subject generation.

Survey : Developer Circle

I just came across thinksters survey of developers preferences and usage. Its quite interesting to the survey result. Some of the result that will change your perception that, almost nobody is using BlockChain, its all hype. I’m going to take a moment here and break down what I think are some of the most interesting and surprising results.

 1. jQuery and JavaScript still rule the world

For all the talk we make about Angular being around forever, and React is all that anyone uses anymore, the reality is that jQuery is the most used web framework (I know it’s a stretch to call it a framework, but go with me on this) Languages:

Web Frameworks:

2. For the first time, React is more used than Angular (see the chart above)

Most people will be surprised by this, since it seems like everyone already thinks that React is the only web framework used, but the reality is much different. Another example of thought bubbles.  3. Rust is the most loved language by its usersRust has a CLEAR lead on all other languages as the one most loved by those who use it. I guess I should spend a bit more time learning Rust? Good thing Thinkster has a Rust course coming out soon!!

3. Rust is the most loved language by its users

Rust has a CLEAR lead on all other languages as the one most loved by those who use it. I guess I should spend a bit more time learning Rust? Good thing Thinkster has a Rust course coming out soon!!

4. Devs fear VBA (Visual Basic for Applications)

I totally get this. I’ve done VBA.

5. VS Code is the most dominant winner in any category

This is the “most loved IDE” category. VS Code has such a strong lead over the next item. No other list has a single winner that has such a huge lead over the pack. Microsoft has created a fantastic tool with VS Code and really solved problems that developers truly have. Not surprising that they created #1 and #2 in this category.

6. Almost nobody is using Blockchain

Even though nobody can stop talking about it. I’m glad the crypto currency hype seems to be wearing down a bit.

7. Devs like their jobs (not much of a surprise here IMHO)

8. Devs change jobs quickly

Most programmers have changed jobs in the last 2 years. I had 20 different jobs the first 20 years of my career as a professional developer. At some point I will write about the benefits of managing your career like this.

9. The tech & the language is the most important job factor

I get this. For all the lip service we give to things like culture and flexible schedule, many of us are simply driven by shiny new toys.

10. Most devs want to work in the office

This one surprised me quite a bit. “where do you want to work”:

11. If you’re all about the Benjamins, learn Clojure

Clojure is the best paying language. By a very reasonable margin. more than 10% higher than the #2 language.

12 Most devs enjoy development

This is not so much surprising as just interesting to ruminate about. I love the idea of a world where people work in jobs that they would do as a hobby. 4 out of 5 developers spend time coding as a hobby. That speaks really well to not only the passion of most developers for their job, but also the state of the world today. 

Upgrade to python3 on CentOS

While working on machine learning, I faced issues to use NLTK 3. Event some libraries need python3 to run. I use alibaba cloud with centos6. Here are the steps to follow to install python 3.x and pip3

First, install minimum necessary tools:

$ sudo yum install yum-utils

Then using yum-builddep, set up a necessary build environment for python3 and install missing dependencies. The following command will automatically take care of that.

$ sudo yum-builddep python

Now download the latest python3 (e.g., python 3.5) from https://www.python.org/ftp/python/

$ curl -O https://www.python.org/ftp/python/3.5.0/Python-3.5.0.tgz

Finally, build and install python3 as follows. The default installation directory is /usr/local. If you want to change this to some other directory, pass “–prefix=/alternative/path” parameter to configure before running make.

$ tar xf Python-3.5.0.tgz
$ cd Python-3.5.0
$ ./configure
$ make
$ sudo make install

This will install python3, pip3, setuptools as well as python3 libraries on your CentOS system.

$ python3 –version

alias python=’/usr/local/bin/python3.5′

Method Two: Install Python3 from EPEL Repository

The latest EPEL 7 repository offers python3 (python 3.4 to be exact). Thus if you are using CentOS 7 or later, you can easily install python3 by enabling EPEL repository as follows.

$ sudo yum install epel-release

Then install python 3.4 and its libraries using yum:

$ sudo yum install python34

Note that this will not install matching pip. To install pip and setuptools, you need to install them separately as follows.

$ curl -O https://bootstrap.pypa.io/get-pip.py
$ sudo /usr/bin/python3.4 get-pip.py

Method Three: Install Python3 from Software Collections (SCL)

Another way to install python3 is via enabling Software Collections (SCL) repository. The SCL repository is available for CentOS 6.5 or later, and the latest SCL offers python 3.3. Once you enable the SCL repository, go ahead and install python3 as follows.

$ sudo yum install python33

To use python3 from the SCL, you need to enable python3 on a per-command basis as follows.

$ scl enable python33 <command>

You can also invoke a bash shell with python3 enabled as the default Python interpreter:

$ scl enable python33 bash
Source: http://ask.xmodulo.com/install-python3-centos.html
How to use pip to use virtualenv for packages

python3 -m virtualenv pyeztask/

Enable .htaccess directive in httpd CentOS

Make sure AccessFileName set to .htaccess

Search httpd.conf for AccessFileName directive. It defines name of the distributed configuration file:

grep -i AccessFileName httpd.conf

Make sure users are allowed to use .htaccess file

What you can put in these files is determined by the AllowOverride directive. This directive specifies, in categories, what directives will be honored if they are found in a .htaccess file. If this directive is set to None, then .htaccess files are completely ignored. In this case, the server will not even attempt to read .htaccess files in the filesystem.

grep -i AllowOverride httpd.conf

When this directive is set to All, then any directive which has the .htaccess Context is allowed in .htaccess files: AllowOverride All

Save and close the file. Restart httpd:

service httpd restart