EssayTools
SimilarityScore
compares essays and rates their similarity
Calling Sequence
Parameters
Description
Examples
Compatibility
SimilarityScore( essay1, essay2 )
SimilarityScore( essays )
essay1, essay2, essays
-
strings, or lists of strings: the essays to be compared
binarycount
(optional) truefalse
methods
(optional) list of procedures
tobaseline
filter
(optional) procedure or literal name lemma, stem, or none
symmetric
The SimilarityScore command compares the word use in two or more essays, and returns a matrix of scores such that location [i,j] rates the similarity of essays i and essays j. A score of zero indicates there is no overlap between the two essays. A score of 1 indicates that there is complete overlap between the two essays (which does not necessarily mean the essays are identical).
If essay1 and essay2 are lists or arrays of essays, each essay in the first list will be compared to each essay in the second list. If essay2 is not given, every essay in the essay1 list will be compared to each other.
There are many different methods available for comparing the word use similarity score. The methods option can be used to select a custom procedure, or one or more of the builtin procedures: CosineCoefficient, JaccardCoefficient, DiceCoefficient, or their binary counterparts.
The binarycount option, when set to true, will force the word count vectors used to record which words are present in the compared essays to contain only 1's and 0's to indicate the presence or absence of words rather than a count of the number of occurrences.
The filter option specifies the definition of a "word". The default is filter=lemma which reduces the set of words based on their meaning. Other options are filter=stem which applies a stemming algorithm, and filter=none. Custom filters can also be applied, such as filter=StringTools:-LowerCase.
When comparing multiple essays the tobaseline option controls the list of words used in comparison. When tobaseline = true, the pool of words consists of all words from all essays. When tobaseline = false the pool of words consists of just the words found in the two essays being compared at each step.
The symmetric option can be set to true as an optimization if you know that f(essay[i],essay[j]) = f(essay[j],essay[i]) in all cases. Specifying this option will compute only the results where i≤j, and store the results twice.
This function is part of the EssayTools package, so it can be used in the short form SimilarityScore(..) only after executing the command with(EssayTools). However, it can always be accessed through the long form of the command by using EssayTools[SimilarityScore](..).
Hemingway≔Nothing happened. The fish just moved away slowly and the old man could not raise him an inch. His line was strong and made for heavy fish and he held it against his hack until it was so taut that beads of water were jumping from it. Then it began to make a slow hissing sound in the water and he still held it, bracing himself against the thwart and leaning back against the pull. The boat began to move slowly off toward the north-west.:
Melville≔I see in him outrageous strength, with an inscrutable malice sinewing it. That inscrutable thing is chiefly what I hate; and be the white whale agent, or be the white whale principal, I will wreak that hate upon him.:
Anderson≔They were six beautiful children; but the youngest was the prettiest of them all; her skin was as clear and delicate as a rose-leaf, and her eyes as blue as the deepest sea; but, like all the others, she had no feet, and her body ended in a fish's tail.:
with⁡EssayTools:
SimilarityScore⁡Hemingway,Melville
0.1025641026
SimilarityScore⁡Hemingway,Melville,Anderson
1.0.10256410260.081395348840.10256410261.0.083333333330.081395348840.083333333331.
SimilarityScore⁡Hemingway,Melville,Anderson,methods=EssayTools:-CosineCoefficient
1.0000000000.35835660010.38115956420.35835660011.0000000000.29123258430.38115956420.29123258431.000000000
SimilarityScore⁡a b c,a b c,a a a,b c d,x y z
1.0.33333333330.50000000000.
The EssayTools[SimilarityScore] command was introduced in Maple 17.
For more information on Maple 17 changes, see Updates in Maple 17.
See Also
EssayTools[CosineCoefficient]
EssayTools[DiceCoefficient]
EssayTools[JaccardCoefficient]
EssayTools[Lemma]
StringTools
Download Help Document