Sentiment analysis of short texts such as single sentence has been a research hotspot of naturallanguage processing (NLP). There still exists the challenge of effectively handling the problem with limited contextual information and semantic features. Hence, in this paper, an attention-based bidirectional LSTM neural network (AB-BiLSTM) is proposed to solve the problem. The proposed model can attend the qualitative and informative parts and learn semantic features from both directions of a sentence to perform sentiment analysis of short texts. The proposed model mainly contributes to take advantage of the attention mechanism to capture the informative parts of a sentence without any syntactic features and lexicon features. The model is conducted on the Stanford Sentiment Treebank dataset and the Movie Review Data provided by Cornell University for single sentence sentiment analysis of binary classification. The experimental results indicate that the proposal in this study has superior performances over theexisting methods, without taking the attention mechanism into account.