Lingua-Identify
view release on metacpan or search on metacpan
You can find more about the likeliness of the results to be accurate by
computing its confidence level.
use Lingua::Identify qw/:language_identification/;
my @results = langof($text);
my $confidence_level = confidence(@results);
# $confidence_level now holds a value between 0.5 and 1; the higher that
# value, the more accurate the results seem to be
The formula used is pretty simple: p1 / (p1 + p2) , where p1 is the
probability of the most likely language and p2 is the probability of
the language which came in second. A couple of examples to illustrate
this:
English 50% Portuguese 10% ...
confidence level: 50 / (50 + 10) = 0.83
Another example:
lib/Lingua/Identify.pm view on Meta::CPAN
You can find more about the likeliness of the results to be accurate by
computing its confidence level.
use Lingua::Identify qw/:language_identification/;
my @results = langof($text);
my $confidence_level = confidence(@results);
# $confidence_level now holds a value between 0.5 and 1; the higher that
# value, the more accurate the results seem to be
The formula used is pretty simple: p1 / (p1 + p2) , where p1 is the
probability of the most likely language and p2 is the probability of
the language which came in second. A couple of examples to illustrate
this:
English 50% Portuguese 10% ...
confidence level: 50 / (50 + 10) = 0.83
Another example:
( run in 1.259 second using v1.01-cache-2.11-cpan-3cd7ad12f66 )