Can tell you the difference between positive and negative movie reviews using Machine Learning
|
|
9 年之前 | |
|---|---|---|
| .gitignore | 9 年之前 | |
| README.md | 9 年之前 | |
| labeledTrainData.tsv | 9 年之前 | |
| learned_negative.csv | 9 年之前 | |
| learned_negative_2000S.csv | 9 年之前 | |
| learned_negative_3000S.csv | 9 年之前 | |
| learned_positive.csv | 9 年之前 | |
| learned_positive_2000S.csv | 9 年之前 | |
| learned_positive_3000S.csv | 9 年之前 | |
| main.R | 9 年之前 | |
| testData.tsv | 9 年之前 | |
| threaded.R | 9 年之前 | |
| unlabeledTrainData.tsv | 9 年之前 |
Can tell you the difference between positive and negative movie reviews using Machine Learning.
Keep in mind that it took me several days/weeks and beers to create this project So please be kind and give me credits for this code. I won't bite
Now that you know your legal rights after reading the 2 lines above we can finally start this journey to machine learning and letting your computer tell you if a movie review is positive or negative
I haven't come up with a name yet, so if you can make up one, please let me know.
The program is very nice and willing to learn, but you need to train him/her. It's just like Pokemon. Except that I work Naive Base and the you can train me from data in datasets instead of TM's of your TM CASE
In order to use me, simply run main.R. Now you can call a variaty of commands, let's start at the beginning:
learn.load()learn.teach()learn.load() first and then learn.teach()
sentiment.test() function.sentiment.test.threaded() (This will currently not show a progressbar but is much faster, duhhh)
sentiment.calc(<your review string>) functionlearn.save() function
You just need to ask nicely:
console.ask(string, type=string) => Internal use only, ask for a string or integer
* console.confirm(string) => Internal use only, ask a true/false question
* learn.load() => Let's dig in my memory to see what I learned before
* learn.save() => Let me remember everything I just learned
* learn.teach() => Teach me new stuff
* sentiment.calc(string, progress=boolean) => Check if a string is positive or negative, with or without a progressbar
* sentiment.split(string) => Internal use only, splits a string
* sentiment.test() => Dare to test me
* sentiment.train(string, 0|1) => Learn me that string is positive (1) or negative (0)
* set.import(string) => Import csv from given path
sentiment.test.threaded() => Dare to test me. Progressbar currently NOT showing