Collocations
collocationsIdentify word pairs that co-occur more often than chance in Spanish text to reveal set phrases, terminology, and a target word's typical neighbors.
Instructions
Find the collocations of a text - pairs of words that occur together more often than by chance.
Use it for set phrases, terminology and the company of a word (the parameter node; side - only the words before or after it). A pair is ordered: the right word stands at most window words after the left one. The lemmas are those of esMorph in the context of the sentence, as kwic finds them with by_lemma. The texts of a query link ests://datasets/...? go one after another, and at the junction of two texts the pairs are made of the words of both: the company within one text is more exact by a link to it.
The result has "n_words" - the number of words of the text, "measure" - the measure and how to read it, and "collocations" - the pairs by decreasing measure: the left word "left", the right word "right", their frequencies "freq_left" and "freq_right", the frequency of the pair "freq_pair" and the value of the measure "score". freq_pair is the number of pairs of positions where the right word stands in the window after the left one: a word repeated in the window gives several pairs, so freq_pair can exceed the frequency of a word, and such a pair is a repetition, not a set phrase. The key "warnings" lists the warnings: a text not in Spanish, the word node is not in the text, no pairs of such frequency.
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": "collocations"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| node | No | Word whose company is needed; not set - all the pairs | |
| 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 | |
| side | No | Side of the company of node: left - the words before it, right - after it; not set - on both sides | |
| text | No | Text in Spanish; path can be given instead | |
| top_n | No | Number of collocations in the response | |
| window | No | Largest distance between the words of a pair; 1 - bigrams | |
| measure | No | Association measure: logdice - the strength of a pair, independent of the size of the text; mi overrates rare pairs; mi3 and t_score favour frequent ones | logdice |
| min_freq | No | Smallest freq_pair - the number of pairs of positions in the window | |
| lemmatize | No | Compare lemmas: estado de ánimo and estados de ánimo give one pair |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||