I corrected the code and the exception is now gone but the program gives the output as null instead of printing the category name. I need the program to output the news category of the input text.
I figured out that there is a problem in the predict method of the NaiveBayes class which should return the category name but instead returns null.
Here is a list of all the files in the various packages:
I need help in correcting the predict method of NaivesBayes.java so that it returns the category name as output instead of returning null.
As of now, I am getting the following output:
File1.txt : null
File2.txt : null
File3.txt : null