Keywords
keynessIdentify words or phrases significantly more or less frequent in a Spanish text than a reference dictionary or another text, revealing distinctive vocabulary.
Instructions
Find the keywords of a text - words significantly more (or less) frequent in it than in a reference.
Use it to see how the vocabulary of a text differs from the language at large (the default reference is the frequency dictionary, downloaded by the command ests-mcp download) or from another text (reference or reference_path). Against the dictionary the words of the text are read in the context of their sentences and compared by the lemmas of the dictionary (a verb takes the first of its verb analyses: fue - ser, also in fue a casa), a proper noun by the lemma of its form taken alone, under which the dictionary counts the proper nouns as well, so a name that is also a form of another word appears as that word's lemma (Tomás - tomar, Batiste - batir); numbers and words with a hyphen, a period or letters outside Spanish are left out, and a word outside the dictionary gets its smallest frequency, so names, terms and typos get into the keywords. Against a text the words are compared in lower case, the lemmas by esMorph in the context of the sentence; with n from 2 - phrases of n consecutive words, which do not run across the end of a sentence nor the boundary of the texts of a query link ests://datasets/...?.
The result has "n_words" - the number of words of the text compared with the reference, "reference" - the reference, "measure" - the measure of the sorting and how to read it, and "keywords" - the words by decreasing measure: the frequency in the text "freq_target" and in the reference "freq_reference", the same per million words "ipm_target" and "ipm_reference", the log-likelihood "g2" (the significance, negative - the word is more frequent in the reference) with its p-value "p_value", Log Ratio "log_ratio" (the effect size; with a zero frequency in the reference - an estimate with the correction 0.5, can be below 0) and the value of the measure "score". p_value is not corrected for the number of words tested: p < 0.0001 (g2 from 15.13) is more reliable. The key "warnings" lists the warnings: a text not in Spanish, no keywords.
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": "keyness"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| n | No | Length of the n-grams: 1 - words, 2-3 - phrases of consecutive words within a sentence, only against a reference text; with lemmatize these are phrases of lemmas (el casa), and kwic finds them with by_lemma=true | |
| 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 | |
| top_n | No | Number of keywords in the response | |
| measure | No | Measure of the sorting: log_likelihood - the significance of the difference, log_ratio - how many times more frequent the word is | log_likelihood |
| min_freq | No | Smallest frequency of a word where it is more frequent | |
| positive | No | Words more frequent in the text; false - more frequent in the reference | |
| lemmatize | No | Compare lemmas; against the frequency dictionary lemmas are always compared | |
| reference | No | Reference text; not set (nor reference_path) - the frequency dictionary of Google Books Ngram (Spanish books of 1980-2019) | |
| reference_path | No | Absolute path to a file with the reference text or a link ests://datasets/... from find_texts instead of reference; a query link - all its texts as one reference |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||