Concepts and glossary¶
This page explains terms used across the guides and evaluation reports. Metric definitions apply to general reference and prediction data. Examples illustrate their interpretation. Methodology specifies the benchmark's matching, exclusions and handling of undefined scores. Named dictionaries, their sources and editions are documented in Dictionaries.
Records and text processing¶
GKG¶
The Global Knowledge Graph (GKG) is structured news dataset mintained by the GDELT Project. This is an open-data initiative that monitors the world's broadcast, print, and web news in over 100 languages. It updates every 15 minutes, mapping global themes, emotions, organizations, locations, and structural connections across planet-scale events to help researchers process all what is happening in the world. Its has specific record format built by multiple natural language processing algorithms. See GKG field reference for the columns and their encodings.
Codebook¶
V2.1 Codebook is the source of truth for GKG field formatting and implmentation. It explains what GKG is, main ideas of it, formatting and content encoded into each field. Exception is V2.1ENHANCEDDATES, where the format is derived from the original GDELT GKG files rather than the codebook.
Native and reconstructed¶
Native and Reconstructed notations were introduced for benchmarking purposes. Native output is the archived record produced by GDELT. Reconstructed output is generated by this library. Differences can arise from article text, dictionaries, models, translation and extraction rules. See Limitations and intended use.
Metadata¶
Metadata describes an article or record, such as its identifier, source and timestamps. Translation metadata identifies the original language and translation engine. Resource versions and model settings describe how the text was processed and help make an analysis reproducible. See Generate records and Translation.
Wire order¶
Wire order is the fixed order of fields in a serialized record. Serialization converts structured values into their stored or transmitted representation. The library declares the GKG column order as GKG_COLUMNS and writes headerless, tab-separated values (TSV). Individual cells can contain their own separators. See GKG field reference.
Enhanced fields and offsets¶
An offset is a position in a particular text. A span identifies a region with a start and an end. This library uses zero-based character positions and an exclusive end, so text[start:end] returns the span. For example, in "Rain in Rome.", the span (8, 12) selects "Rome".
Enhanced GKG fields describe occurrences and add offsets into the exact analyzed English body. Editing or translating that body changes which positions identify the original mentions. See Translation for storing analyzed text and each field page for its encoding.
Unavailable and empty values¶
An unavailable value means the required input or result is missing. An available empty value means the input was processed or supplied and contains no items. In record generation, None denotes unavailable and "" denotes an available empty cell. Strict generation rejects incomplete records. Exporting unavailable cells as empty strings loses that distinction. See Generate records.
Resources and configuration¶
Resources¶
Resources are the dictionaries, rules, geographic references and recognizer used during extraction. Resources combines these inputs for record generation. A resource directory holds compiled files and defaults.json, which selects profiles. Downloaded source archives are inputs to resource builds. Extraction uses the compiled outputs. See Build resources.
Dictionaries and lexicons¶
A dictionary or lexicon associates words and phrases with categories or numeric ratings. A match can contribute a category occurrence, a count or a lexical score. Imported vocabularies can include phrases, wildcards and exclusions. The compiled lexicon is the representation loaded by an analyzer. See Dictionaries for individual vocabularies and their source terms.
Profile¶
A profile is a prepared configuration of dictionaries or rules for an analyzer. Selecting a profile selects its vocabulary and matching behavior. A versioned profile fixes a particular configuration so it can be reproduced. See Build GCAM resources for available profiles and selection commands.
Build recipe¶
A build recipe specifies source editions and transformations used to produce a profile. A filename label identifies an output file. Changing the filename suffix does not change the recipe's contents. See Build resources.
Gazetteer¶
A gazetteer is a geographic lookup containing place names and attributes such as country codes, coordinates and feature identifiers. It resolves recognized place names to geographic entries. Its geographic coverage depends on the places in the reference data. See Locations for resolution behavior and Build gazetteers for custom references.
Overrides¶
An override explicitly replaces a configured input or an output value. Its precedence depends on the interface. Explicit resource objects take precedence over directory defaults. Encoded record overrides replace selected output cells. Analysis needed by other fields can still run. See Generate records.
Caches and checkpoints¶
A cache stores results for reuse. A checkpoint saves completed work so a long-running process can resume. Reuse depends on compatibility with the inputs, models and settings that produced the stored result. The benchmark saves compatible predictions in its workspace, while translation caches store reusable translations. See Benchmarking and Performance.
GCAM and dimensions¶
Global Content Analysis Measures (GCAM) groups dictionaries for emotional, psychological and topical language. A dimension is one category or numeric measure in its codebook. A category's count and value keys count as one dimension. Source-backed dimensions use imported vocabulary. Approximate dimensions use authored rules or estimated scores. See Dictionaries for the inventory and coverage breakdown.
Vocabulary coverage¶
Vocabulary coverage is the share of a reference inventory represented by a configuration:
For example, a configuration representing 80 of 100 dimensions has 80% vocabulary coverage. This describes what can be represented. Agreement metrics evaluate the values actually produced.
Build coverage reports distinguish source-backed supported_dimensions from total compiled_dimensions, which also include approximations. Runtime implemented dimensions can include both. Keep these populations distinct when comparing coverage figures. See Build GCAM resources.
Evaluation and metrics¶
Reference and prediction¶
A reference supplies comparison values. A prediction is the output being evaluated. For item matching, the matching rule defines when two items agree, including any normalization or tolerance. For numeric metrics below, \(y_i\) is reference value \(i\), \(\hat{y}_i\) is its paired prediction, and \(n\) is the number of valid pairs. Define the signed error as \(e_i = \hat{y}_i - y_i\). Values must be comparable and expressed in the same units. Metrics requiring an average are undefined when there are no valid pairs.
F1 scores¶
Precision measures the fraction of predicted items that match the reference. Recall measures the fraction of reference items recovered. The counts used in these calculations are:
| Symbol | Meaning |
|---|---|
| \(TP\) | True positives: matched items. |
| \(FP\) | False positives: predicted items without a reference match. |
| \(FN\) | False negatives: reference items without a prediction match. |
In item matching, reference support is \(TP + FN\) and prediction support is \(TP + FP\).
The F1 score is the harmonic mean of precision \(P\) and recall \(R\):
Higher is better, with 1 denoting perfect item agreement. For example, three matches, one extra prediction and two missed reference items give \(P = 3/4\), \(R = 3/5\) and \(F_1 = 2/3\).
A zero denominator makes the corresponding metric undefined. The direct count formula gives \(F_1 = 0\) when there are unmatched items but no matches. When both sides are empty, there are no items from which to calculate F1. Methodology describes empty and undefined cases in reports.
Micro, macro and per-article averages¶
Pooled micro-F1 sums matches and errors across articles before calculating the score. With article index \(d\):
Label-macro F1 calculates one F1 score per label and averages across \(L\) labels:
Micro-F1 gives more influence to frequently occurring items. Label-macro F1 gives each included label equal weight. Mean per-article F1 instead calculates one score for each included article and averages those scores. These summaries answer different questions. The benchmark's label population and treatment of both-empty articles are specified in Methodology.
Jaccard similarity¶
Jaccard similarity measures the overlap between two sets, \(A\) and \(B\):
A value of 1 means identical nonempty sets, and 0 means no overlap. For example, sets sharing three items with six items in their union have Jaccard similarity \(3/6 = 0.5\). The formula is undefined when both sets are empty. The benchmark excludes those pairs from mean per-article Jaccard and reports them separately. Exact set agreement measures the share of articles whose entire sets agree, including both-empty pairs.
MAE¶
Mean absolute error (MAE) is the average magnitude of paired numeric errors:
It uses the original measurement units. Lower is better, with 0 meaning every paired value agrees. For reference values \((10, 20)\) and predictions \((12, 18)\), the absolute errors are \((2, 2)\) and MAE is 2 units. MAE has no universal acceptable threshold. Its interpretation depends on the measurement scale and the intended use.
RMSE¶
Root mean square error (RMSE) takes the square root of the mean squared error:
It uses the original units and gives larger errors more influence than MAE does. Lower is better. For errors \((0, 4)\), MAE is 2 units while RMSE is \(\sqrt{8} \approx 2.83\) units.
Bias¶
For paired measurements, bias is the mean signed error, using prediction minus reference:
Positive bias indicates average overprediction and negative bias indicates average underprediction. Opposing errors can cancel. Reference values \((10, 20)\) and predictions \((12, 18)\) have zero bias despite an MAE of 2 units.
CCC¶
Lin's concordance correlation coefficient (CCC) measures numerical agreement by combining association with similarity in level and scale:
Here \(\bar{y}\) and \(\bar{\hat{y}}\) are the two arithmetic means. \(\operatorname{Var}\) denotes variance, which measures spread around a mean. \(\operatorname{Cov}\) denotes covariance, which measures how paired values vary together. For CCC and Pearson correlation, the benchmark uses moments divided by \(n\):
CCC ranges from −1 to 1, with 1 denoting perfect concordance. For reference values \((10, 20)\) and predictions \((12, 18)\), the means agree but the prediction spread is smaller. CCC is \(30/34 \approx 0.882\), even though their Pearson correlation is 1. The benchmark reports undefined CCC for fewer than two valid pairs or a zero denominator, including identical constant sequences.
Correlation¶
Pearson correlation measures linear association:
It ranges from −1 to 1. A value of 1 means a perfect positive linear relationship, which can include a shift or change of scale. Spearman correlation applies Pearson correlation to the ranked values, using average ranks for ties. It measures monotonic association. Both are undefined when either sequence is constant. CCC additionally accounts for differences in level and scale.
WAPE¶
Weighted absolute percentage error (WAPE) expresses total absolute error relative to the total absolute reference magnitude:
Lower is better, and WAPE can exceed 100%. It is undefined when all reference values are zero. For reference values \((10, 20)\) and predictions \((12, 18)\), WAPE is \(100\% \times 4/30 \approx 13.33\%\). This divides the totals before expressing a percentage. It is not the average of individual percentage errors.
The benchmark applies WAPE to nonnegative counts, where \(|y_i| = y_i\). The report's selection of comparable observations is described in Methodology.
Aggregate prediction/reference ratio¶
This ratio compares the total predicted quantity with the total reference quantity over the same observations:
For nonnegative quantities with a positive reference total, values above 1 indicate aggregate overprediction and values below 1 indicate underprediction. A ratio of 1 means equal totals. Individual errors can still cancel, as in the pairs \((10, 20)\) and \((12, 18)\). The ratio is undefined when the reference total is zero.
Counts, scores and densities¶
A count records how many matching occurrences were found. A presence indicator records only whether a match occurred. A lexical score associates a numeric rating with a matched word or phrase. A weighted mean combines ratings \(v_j\) with nonnegative weights \(w_j\):
For example, two occurrences rated 1 and one rated 4 have a mean rating of \((2\times1 + 1\times4)/3 = 2\). A mean with no total weight is undefined.
A density normalizes a count \(c\) by a size \(N\). Per 100 units:
Five matches in 200 tokens give 2.5 matches per 100 tokens. Density errors depend on both the count and the size used as denominator. A change from 2% to 3% is 1 percentage point, or a 50% relative increase.
Sign agreement¶
For a neutral threshold \(\tau \geq 0\), define the thresholded sign function:
Sign agreement is the share of valid pairs whose thresholded signs match:
The indicator \(\mathbf{1}\) is 1 when the condition holds and 0 otherwise. Values at either boundary, \(-\tau\) and \(\tau\), are neutral. With \(\tau = 0\), \(s_\tau\) is the ordinary sign function. The threshold is part of the metric definition and applies equally to reference and prediction values. For example, with \(\tau = 0.5\), values 1 and 100 have the same positive sign despite a large numerical difference. Read sign agreement alongside error metrics.
Limits of agreement¶
Bland–Altman limits of agreement describe the spread of paired differences. With mean error \(\bar{e}\) and sample variance \(\operatorname{Var}_{\mathrm{sample}}(e)\), the usual approximate limits are:
The 95% interpretation assumes approximately normally distributed differences and an appropriate sampling model. These limits describe individual differences. A confidence interval for mean bias instead describes uncertainty in the mean. The benchmark reports undefined limits when fewer than two paired differences are available.
The sample variance of the differences uses \(n-1\) in the denominator:
Sampling and uncertainty¶
Subsets and held-out data¶
A subset contains observations selected by a rule, such as language, date or document length. Filtering changes which population a result describes. Development or training data is used to fit rules, validation data to select configurations, and held-out test data to evaluate the frozen choices. Test observations should be separate from the data used to make those choices. See Tone refinement for one application.
Retention and selection¶
Retention is the share of attempted observations included after acquisition and filtering:
For example, retaining 60 of 100 attempted articles gives 60% retention. State what was attempted and which filters determined inclusion. Systematic differences between included and excluded observations can introduce selection bias. Retention alone does not quantify the resulting bias in a metric.
Quantiles and percentiles¶
A quantile marks a position in an ordered distribution. The quantile \(q_p\) is the value at cumulative probability \(p\). The median is \(q_{0.5}\), or the 50th percentile. P90 is \(q_{0.9}\), or the 90th percentile. Estimates from a finite sample can interpolate between observed values.
Bootstrap intervals¶
Bootstrap resampling repeatedly samples the observed data with replacement and recalculates a statistic \(T\). For \(B\) resampled estimates \(T_1^*,\ldots,T_B^*\), a percentile 95% interval uses their 2.5th and 97.5th percentiles:
The function \(q_p\) returns the quantile at probability \(p\). Cluster bootstrap resamples groups together, preserving related observations within each selected group. For example, publisher-cluster resampling keeps articles from a sampled publisher together. The interval reflects the observed sample and the chosen resampling model. Retrieval bias, changed inputs and missing dictionary coverage require separate assessment.