Need help with some surprising classifications by naiveBayes We are trying to do a POC on using NaiveBayes to classify an establishment by the category.
We loaded the following  training set in R. 
NAME_1,NAME_2,CHANNEL_5
Vanilla,Bar,Bar &  Grill
Zen,Bar,Bar &  Grill
cafe,havana,Bar &  Grill
cafe,hollywood,Bar &  Grill
monaco,grill,Bar &  Grill
grill,grill,Bar &  Grill
hunai,asian,Bar &  Grill
Apple,Institute,School
devry,Institute,School
usu,College,School
suny,university,School
fashion,school,School
theater,study,School
Burger,King,Hamburger
Mighty,Burger,Hamburger
one,Burger,Hamburger
wendy,sandwich,Hamburger
Burger,Heaven,Hamburger
Burgler,Burger,Hamburger  

Columns 1 & 2 make up the name of the establishment. Column 3 is the class.
library(e1071);

new_training_data <- read.table("C:/Users/test/08_jul_13_training.txt",
header=TRUE , sep="\t");

 model1<-naiveBayes(new_training_data[,1:2],new_training_data[,3],laplace
 =2);

test_data <- read.table("C:/Users/test/test1.txt", header=TRUE , sep="\t");

predict(model1, test_data[,1:2],type = c("class","raw"));

The test_set with the expected category and the actual result from NaiveBayes classifier are given below.
NAME_1,NAME_2,Expected_category,Actual_Result_from_Naive_bayes
my,Bar,Bar &  Grill, Bar &  Grill 
cafe,milano,Bar &  Grill, Hamburger
Teaching,Institute,School, Bar &  Grill
devry,Institute,School, Bar &  Grill
beauty,school,School, Bar &  Grill
fashion,school,School, Bar &  Grill
theater,school,School, Bar &  Grill 
Burger,Baja,Hamburger, Hamburger   
Burger,Big,Hamburger, Hamburger 
Pepsi,Cola,Hamburger, Bar &  Grill
Burger,Supreme,Hamburger, Hamburger 
Burger,King,Hamburger, Hamburger

my bar is correctly classified as Bar & grill. However  Cafe Milano is classified as Hamburger instead of Bar & Grill.
statistically speaking the probability of Bar in my Bar is no different from Cafe in Cafe Milano.
Any pointers in how NaiveBayes is coming up with these results will be greatly appreciated.
 A: I think this is related to factors, which are a data type in R which often behave unexpectedly.
I don't have your test data, but when you use the classifier to predict from a new data point, you have to make sure that the possible levels of NAME_1 and NAME_2 are exactly the levels which appear in the training data. If the training and test data come from different text files, then this is very unlikely to be the case.
Your first three lines of code work fine for me.
Let's just suppose you want to classify a single new data point with NAME_1 = n1 and NAME_2 = n2. Here is how you could do it.
    pred <- function(model, n1, n2, type){
      n1 <- factor(n1, levels = levels(new_training_data[,1])) 
      n2 <- factor(n2, levels = levels(new_training_data[,2]))
      predict(model, data.frame(NAME_1 = n1, NAME_2 = n2), type)      
   }

Now it should work with your model. The following behave for me as expected:
pred(model1, "Teaching", "Institute", "class")
pred(model1, "cafe", "milano", "class")
pred(model1, "beauty", "school", "class")

You could extend this to data frames so you could classify all of your test data at once. I hope it helps!
A: it looks to me like you're doing a multinomial naive bayes.  If you look at the tables component of the model object, you should (according to the docs) see tables of conditional probabilities given the target class.
How many classes are you attempting to predict?  Have you tried 1-3 grams on the incoming words?  It kind of looks like you're using up to two 1-grams; is that correct?
Also, please put your data into tables so we can see which text goes in which column?
