# Term merging Part of [MBDef](https://huggingface.co/datasets/mediabiasgroup/MBDef). Kept terms are merged when their labels are the same up to spelling (the Label Match rule). Merged terms are the rows of `concepts` and `terms`. ## The rule The rule: - ignores case, hyphens and spacing ("click-bait" = "clickbait"), quotation marks, a leading article, and stop words between content words; - treats an acronym given in brackets as the same label ("fake news (FN)" = "fake news"); - treats word order as irrelevant ("bias in the media" = "media bias"); - maps British to American spelling ("judgement" = "judgment"); - reduces plurals to the singular. When a word has two possible singulars that both occur ("refugees": "refugee" or "refuge"), it takes the one that more labels end with. It also covers "-ses" plurals ("crises"), "-ics" plurals ("infodemics"), and irregular plurals ("phenomena", "criteria"). Plurals that name something else stay apart ("news media" and "new media", "ethics" and "ethic"). It does not merge synonyms with different words ("news bias" and "media bias" stay separate). It does not split one spelling that is used with different meanings. ## What it did here The spelling groups are formed once over all 67,394 term-in-paper rows of the corpus, then restricted to the kept rows. When a label is kept in some papers and dropped in others, its concept contains only the papers where it was kept. Before Step 5, the 67,394 rows formed 38,407 groups: - 34,150 were kept whole; - 3,491 were dropped whole; - 766 were split, kept in some papers and dropped in others. The 62,066 kept rows use 41,127 distinct spellings and form 34,916 concepts: 28,210 have a single term-in-paper row and 6,706 have more than one. The largest is “fake news”, with 659 term-in-paper rows. ## Tracing a merge Every row records how its term was normalised, and every concept records why its spellings were joined: - **The row.** In `instances`, row `m55924b58dc8cff3e` has the term “refugees”. Its `normalisation` reads “plural 'refugees' -> 'refugee' (-s, ends 2 labels and occurs in 4, against 1 and 1 for 'refuge')”, giving `word_set_key` “refugee” and `spacing_key` “refugee”. - **The concept.** That puts it in the concept “refugee” (`g250d8c26ae4a`, 9 rows). The concept's spellings are “refugee”, “refugees”, “Refugee”, “Refugees”. - **Why they were joined.** Its `joined_by` says: the spacing key “refugee” is shared by “Refugee”, “Refugees”, “refugee”, “refugees”; the word-set key “refugee” is shared by “Refugee”, “Refugees”, “refugee”, “refugees”. - **Flags.** Its `merge_flags`: “plural with two possible singulars”. The columns are explained in [Columns](https://huggingface.co/datasets/mediabiasgroup/MBDef/blob/main/docs/columns.md). Merging is by spelling only; the [paper](https://arxiv.org/abs/XXXX.XXXXX) lists the merges that may join different meanings.