Simple Cosine Similarity for PHP
I have just uploaded a single file to github which computes cosine similarity of two files.
Cosine similarity is a widely used similarity measure of two texts. This simple code computes cosine similarity of two text files given as parameters. To use this, php-cli (PHP command line interpreter) must be working. The output is written to the STDOUT. I have made the cosine similarity code work in PHP. I have not implemented all of the code. The code is developed using the ideas and piece of codes in various web sites.
I used this code in identification of topics of a microblog post set which was introduced in this post.
Usage:
php computeCosine.php file1 file2