Skip to content

Instantly share code, notes, and snippets.

View jtejido's full-sized avatar
💭
Hello all you happy people...

jtejido

💭
Hello all you happy people...
View GitHub Profile
@jtejido
jtejido / RiemannSiegel.java
Created April 17, 2019 06:37 — forked from matthewshawnkehoe/RiemannSiegel.java
RiemannSiegel.java
/**************************************************************************
**
** Riemann-Siegel Formula for roots of Zeta(s) on critical line.
**
**************************************************************************
** Matthew Kehoe
** 07/31/2015
**
** This program finds the roots of Zeta(s) using the well known Riemann-
** Siegel formula. The RiemannSiegel theta function is approximated
@jtejido
jtejido / VectorSpaceModel.php
Created January 11, 2018 14:34
VectorSpaceModel extension for php-nlp-tools
<?php
namespace App\Utilities\Search;
use App\Library\InverseDocumentFrequency;
use App\Utilities\Search\TfIdfFeatureFactory;
use NlpTools\Documents\TrainingSet;
/**
@jtejido
jtejido / SearchWithBM25.php
Created January 8, 2018 14:12
BM25 thin wrapper for general scoring of documents.
<?php
namespace App\Utilities\Search;
use App\Utilities\Search\BM25;
use NlpTools\Tokenizers\WhitespaceTokenizer;
use NlpTools\Documents\TrainingSet;
use NlpTools\Documents\TokensDocument;
use NlpTools\Utils\Normalizers\Normalizer;
@jtejido
jtejido / InverseDocumentFrequency.php
Created January 8, 2018 13:29
InverseDocumentFrequency extension for php-nlp-tools
<?php
namespace App\Utilities;
use NlpTools\FeatureFactories\DataAsFeatures;
use NlpTools\Documents\TrainingSet;
class InverseDocumentFrequency
{
@jtejido
jtejido / TermFrequency.php
Last active January 11, 2018 14:46
TermFrequency extension for php-nlp-tools
<?php
namespace App\Library;
use NlpTools\Analysis\FreqDist;
class TermFrequency extends FreqDist
{
@jtejido
jtejido / BM25.php
Last active October 25, 2024 03:48
Okapi BM25 extension for php-nlp-tools
<?php
namespace App\Utilities\Search;
use App\Library\TermFrequency;
use NlpTools\Documents\TrainingSet;
/**
* BM25 is a class for ranking documents against a query.
@jtejido
jtejido / TverskyIndex.php
Created January 2, 2018 02:30
TverskyIndexSimilarity extension for php-nlp-tools
<?php
namespace App\Utilities;
/**
* http://en.wikipedia.org/wiki/Tversky_index
*/
class TverskyIndex
{
@jtejido
jtejido / DiceSimilarity.php
Created January 2, 2018 02:29
DiceSimilarity extension for php-nlp-tools
<?php
namespace App\Utilities;
/**
* http://en.wikipedia.org/wiki/Sørensen–Dice_coefficient
*/
class DiceSimilarity
{
@jtejido
jtejido / OverlapCoefficient.php
Created January 2, 2018 02:27
OverlapCoefficientSimilarity extension for php-nlp-tools
<?php
namespace App\Utilities;
/**
* https://en.wikipedia.org/wiki/Overlap_coefficient
* AKA Szymkiewicz-Simpson coefficient
*/
class OverlapCoefficient
@jtejido
jtejido / LevenshteinDistance.php
Created January 2, 2018 02:25
LevenshteinDistance extension for php-nlp-tools
<?php
namespace App\Utilities;
/**
* This class implements the LevenshteinDistance distance of two strings or sets.
* This accepts strings of arbitrary lengths.
*
*/