Skip to main content
Glama

Сравнение корпусов

compare_texts
Read-onlyIdempotent

Compares two text corpora across stylometric features and ranks the strongest differences for authorship attribution, genre, translation, or human-vs-model analysis.

Instructions

Сравнить два корпуса текстов по признакам стиля и найти, чем они различаются сильнее всего.

Используйте для атрибуции авторства, сравнения жанров, переводов, текстов человека и модели. Тексты режутся подряд на окна ровно по window слов (whole_texts - тексты целиком), у каждого окна считаются около 150 признаков ruTS, и распределения признака в корпусах A и B сравниваются. Остаток текста короче окна и текст короче окна отбрасываются: ответ предупреждает о таких текстах и о потере больше 10 % слов корпуса на остатках. Для сравнения нужно хотя бы по два окна в каждом корпусе. Тексты из файлов передавайте через a_paths и b_paths.

Признаки по префиксам: basic_ - доли длинных, сложных, одно- и многосложных слов, букв, пробелов и знаков, буквы и слоги на слово; readability_ - формулы удобочитаемости; diversity_ - меры лексического разнообразия; morph_ - доли частей речи, отрицаний и кратких форм от слов (morph_pos_NOUN, morph_polarity_Neg, morph_style_variant_Short) и значений остальных признаков внутри признака (morph_case_Gen, morph_tense_Past); sents_ - средняя длина предложения в словах, ее стандартное отклонение, коэффициент вариации и автокорреляция соседних длин; punct_ - знаки по типам на 1000 слов и доля буквы ё; cohesion_ - статистики связности: повторы между предложениями, местоимения, данность, повтор времени и вида, коннекторы на 1000 слов.

В результате "window" - размер окна (null - тексты целиком), "n_windows" и "n_texts" - число окон и текстов в A и B, "features" - признаки по убыванию модуля дельты Клиффа, при равной дельте - по относительной разности медиан: средние по окнам "mean_a" и "mean_b", разность медиан A - B "median_diff" с 95% бутстрэп-интервалом "ci_low" - "ci_high", дельта Клиффа "cliff_delta" (от -1 до 1: доля пар окон, где в A больше, минус доля, где меньше; по модулю от 0,147 - малый, от 0,33 - средний, от 0,474 - большой эффект, Romano и др. 2006) и p-значение U-критерия Манна-Уитни с поправкой Холма на число признаков "p_holm". Окна одного текста не независимы: p_holm считает их независимыми и занижено, если текстов в корпусе мало, а бутстрэп-интервал берет целые тексты и при одном тексте в корпусе не определен. Ключ "warnings" - предупреждения: корпус не на русском языке, тексты корпусов разной длины при whole_texts, тексты или их остатки не вошли в сравнение, в корпусе один текст, ни одно различие не значимо.

Input Schema

NameRequiredDescriptionDefault
aNoТексты первого корпуса (A)
bNoТексты второго корпуса (B)
top_nNoЧисло признаков с наибольшим различием
windowNoРазмер окна в словах; не задано - не больше 1000 и такой, чтобы самый короткий текст делился хотя бы на два окна, но не меньше 100
a_pathsNoАбсолютные пути к файлам с текстами корпуса A, вместе с a или вместо
b_pathsNoАбсолютные пути к файлам с текстами корпуса B, вместе с b или вместо
whole_textsNoСравнивать тексты целиком, без окон; нужно хотя бы по два текста

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.3/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Beyond the readOnly/idempotent annotations, the description discloses the windowing mechanism, the ~150 ruTS features, corpus truncation behavior, warnings for dropped remainders and >10% word loss, and minimum two-window requirements. It also explains output semantics including Cliff's delta thresholds, Holm correction, bootstrap caveats about non-independent windows, and warnings. This is exceptionally rich behavioral context for a complex analysis tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is long but well-structured: purpose and usage are front-loaded, followed by mechanics, feature prefixes, and result semantics. The density is justified by the statistical complexity, though several sentences are verbose and could be tightened without losing information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a complex corpus-comparison tool with 7 parameters and an output schema, the description covers usage, input requirements, windowing behavior, feature families, result fields, statistical caveats, and warnings. An agent has enough context to call it correctly and interpret the response.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the baseline is 3, but the description adds meaningful semantics beyond the schema: it explains how window defaults are chosen when unset, that whole_texts means texts are compared in full, and that a_paths/b_paths are for file-based corpora. top_n is only implicitly covered through the result-ordering explanation, so it is not a full 5.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The first sentence states a specific verb and resource: compare two text corpora by style features and identify the strongest differences. The use-case list (authorship attribution, genre/translation/human-vs-model comparison) further clarifies intent. It does not explicitly distinguish itself from the sibling keyness tool, which also compares corpora, so it stops short of a 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives concrete usage contexts: authorship attribution, genre comparison, translation comparison, and human-vs-model text comparison. It also states input requirements such as at least two windows per corpus and passing file texts via a_paths/b_paths. It lacks explicit when-not-to-use guidance or named alternatives, so it is clear but not exhaustive.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.