Sorensen–Dice coefficient: Difference between revisions

tidy up task description
m (→‎{{header|Wren}}: Changed to Wren S/H)
(tidy up task description)
Line 1:
{{task}}
 
The [[wp:Sørensen–Dice coefficient|Sørensen–Dice coefficient]], also known as the Sørensen–Dice index (or sdi, or sometimes by one of the individual names: sorensen or dice,) is a statistic used to gauge the similarity of two poulationpopulation samples.
 
The original use was in botany, indexingas a measure of similarity between populations of flora and fauna in different areas, but it has uses in other fields as well. It can be used as a text similarity function somewhat similar to the [[Levenshtein distance|Levenshtein edit distance]] function, though it'sits strengthcharacteristics liesare in aquite different area.
 
[[Levenshtein distance|Levenshtein]] iscan be gooduseful for findingspelling misspellingscorrection, but relies on the tested word /or phrase being prettyquite similar to the desired one, and can be very slow for long words /or phrases.
 
Sørensen–Dice is more useful for 'fuzzy' matching partial, and poorly spelled words /or phrases, possibly in improper order.
 
There are several different methods to tokenize objects for Sørensen–Dice comparisons. The most typical tokenizing scheme for text is to break the words up into bi-grams: groups of two consecutive letters.
Line 22:
 
Sørensen–Dice measures the similarity of two groups by dividing twice the intersection token count by the total token count of both groups.:
 
SDISDC = 2 × (|A ∩ B)| / (|A| + |B|)
For items(objects, populations) A and B:
 
The Sørensen–Dice coefficient is thus a ratio between 0.0 and 1.0 giving the "percent similarity" between the two populations between 0.0 and 1.0.
SDI = 2 × (A ∩ B) / (A ⊎ B)
 
SDISDC ''can'' by used for spellchecking, but it's not really good at it, especially for short words. Where it really shines is for fuzzy matching of short phrases like book or movie titles. It may not return exactly what you are looking for, but often gets remarkably close with some pretty poor inputs.
The Sørensen–Dice coefficient is a "percent similarity" between the two populations between 0.0 and 1.0.
 
SDI ''can'' by used for spellchecking, but it's not really good at it, especially for short words. Where it really shines is for fuzzy matching of short phrases like book or movie titles. It may not return exactly what you are looking for, but often gets remarkably close with some pretty poor inputs.
 
 
Line 41 ⟶ 39:
How you get the task names is peripheral to the task. You can [[:Category:Programming_Tasks|web-scrape]] them or [[Sorensen–Dice coefficient/Tasks|download them to a file]], whatever.
 
If there is a built-in or easily, freely available library implementation for Sørensen–Dice coefficient calculations, it is acceptable to use that with a pointer to where it may be obtained.
 
 
2,462

edits