Package gobay implements Naive Bayesian Classifier for sentiment analysis. (Naive Bayesian Classifier - Wikipedia)
go get github.com/gyuho/gobay
bay/ # Naive Bayesian Classifier
data/ # Training Data
example/ # Example Code
slm/ # Slice, Map Operations
func Test_NBC_2(test *testing.T) {
DATA_amazon := bay.GetStruct("../data/train - amazon.csv")
include := bay.GetInclFt("../data/filter - include.csv")
exclude := bay.GetExcFt("../data/filter - exclude.csv")
// Totally unfamiliar sentence
// (Correct Classification!)
// Now this data is trained
bay.Print(DATA_amazon, include, exclude, "High quality code samples. It must be said: Mark Summerfield is a REALLY good programmer. All of the code in this book gives the impression of being well thought out. The other books had a lot of cargo cult programming, meaning the authors were going through the motions without thinking about what they were doing.")
// Output:
// Positive: High quality code samples. It must be said: Mark Summerfield is a REALLY good programmer. All of the code in this book gives the impression of being well thought out. The other books had a lot of cargo cult programming, meaning the authors were going through the motions without thinking about what they were doing.
}
Training and filter data are to be frequentyly updated, directly on GitHub and Google Docs.
-
- sample: amazon.com review, city review models...
- range from 1 to 10; 10 is most positive
- We can add any category(class) you want; sports, newspaper, ...
-
- feature candidate word selection
- signal words
- Update Bayesian algorithms for some exceptional cases