I'm new to Machine learning or Ai but I have been a developer for almost 10 years.
I have a news aggregator application that grabs and save articles from news websites, And I have developed an algorithm of my own that categorizes the news based on it's titles.
The way it works is when I grab a new title I split the words of the title and save it in a table called "tags" and I have "categories" table, and then manually I'm going to link some of the tags (those are can be recognized or non stop words) to categories.
then on categories page using SQL I'm classifying the titles. It's all working good and since I'm using and it even works for "America" and "American" words and I only linked the "America" word to the categories and "American" word is not linked to any categories but still knows it belongs to the same category that "America" belongs.
And I read the PHP-ML library that's an AI library for PHP. That's how it uses the same thing as I do as far as I understand it:
// Data for training classifier $samples = [[1, 3], [1, 4], [2, 4], [3, 1], [4, 1], [4, 2]]; // Training samples $labels = ['a', 'a', 'a', 'b', 'b', 'b']; // Initialize the classifier $classifier = new SVC(Kernel::LINEAR, $cost = 1000); // Train the classifier $classifier->train($samples, $labels); $classifier->predict([3, 2]); // return 'b' $classifier->predict([[3, 2], [1, 5]]); // return ['b', 'a']
So it's kinda the same as my algorithm, but the only thing that I don't understand is how this library understand the new words.
so on my own algorithm if there's a new word let's say "Spain" I have to go to the table and link it to the "World" field on categories table.
But if this library is machine learning I think it's supposed to know where "Spain belongs to without my touch. on my database
I Have around twenty thousand words and I have linked almost two thousand of the words to the categories table. so if I use this library can I use it with same data that I have and without my touch anymore or how does this library tell if new word belongs to where? where does it save it? or does it even save it? or if he could predict a new word do I have to make it change the tag to link the categories? or it's kinda the same as my own and I have to teach it every word?