Dispersion of words
dispersionMeasures how evenly words are distributed across parts of a text to distinguish words spread throughout from those concentrated in one place, since frequency alone cannot.
Instructions
Measure how evenly words are spread over a text (Gries's dispersion).
Use it to tell a word that runs through the whole text from a word gathered in one place: frequency does not tell them apart. The text is divided into the given number of parts of about equal size, and the texts of a query link ests://datasets/...? are the parts themselves, so the measure shows whether a word runs through the texts of the corpus.
The result has "n_words" - the number of words of the text, "n_parts" - the number of parts, and "words" - the words in the order of the query or by decreasing frequency, with the frequency "freq" and the measures of dispersion:
dp: Gries's deviation of proportions DP, the main measure; 0 - the word is spread in proportion to the sizes of the parts, the largest value of about 1 - 1/n_parts - every occurrence in one part.
dp_norm: DP divided by its largest possible value; 1 - every occurrence in the smallest part.
juilland_d: Juilland's D; 1 - even, 0 - in one part.
carroll_d2: Carroll's D2 by the entropy of the distribution; 1 - even, 0 - in one part.
rosengren_s: Rosengren's S; 1 - proportional, about 1/n_parts - in one part.
kl_divergence: Kullback-Leibler divergence in bits; 0 - proportional, grows with concentration. A word absent from the text has the frequency 0 and the measures null. A word less frequent than n_parts cannot get into every part, and its measures show concentration even with the most even spread. The key "warnings" lists the warnings: a text not in Spanish, words absent from the text, words less frequent than the number of parts.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "dispersion"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | Absolute path to a UTF-8 text file on the machine where the server runs, or a link ests://datasets/... from find_texts, instead of text: a long text need not be sent in the argument | |
| text | No | Text in Spanish; path can be given instead | |
| parts | No | Number of parts of the text of about equal size; for a query link ests://datasets/...?<filters> its texts are the parts | |
| top_n | No | Number of the most frequent words if words is not set | |
| words | No | Words whose dispersion is needed; not set - the most frequent words | |
| lemmatize | No | Compare lemmas: the forms of a word count as one word |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||