Unit-Conversion / README.md
roby1222's picture
Update README.md
e0fa384 verified
|
Raw History Blame Contribute Delete
7.93 kB
metadata
license: cc0-1.0
language:
  - en
  - zh
  - hi
  - es
  - fr
  - ar
  - bn
  - pt
  - ru
  - ur
  - id
  - de
  - ja
  - pcm
  - mr
  - te
  - ta
  - tr
  - vi
  - ko
  - fa
pretty_name: Unit Conversion (21 languages)
size_categories:
  - 10K<n<100K
task_categories:
  - question-answering
  - token-classification
tags:
  - units
  - unit-conversion
  - math
  - multilingual
  - synthetic
configs:
  - config_name: units
    data_files: units.csv
  - config_name: qa
    data_files:
      - split: train
        path: qa/train.csv
      - split: validation
        path: qa/validation.csv
      - split: test
        path: qa/test.csv
  - config_name: ner
    data_files:
      - split: train
        path: ner/train.jsonl
      - split: validation
        path: ner/validation.jsonl
      - split: test
        path: ner/test.jsonl

Unit Conversion (21 languages)

A three-part dataset about unit conversion:

  1. units: a lookup table of 120 units with exact conversion factors to SI, offsets (temperature), names in 21 languages, aliases, and notes.
  2. qa: 59,745 conversion questions in 21 languages, each with a numeric answer and a worked solution.
  3. ner: 16,800 short texts in which quantities and units are annotated with character spans.

Every number is computed by code with exact rational arithmetic (fractions.Fraction) and rounded to 6 significant digits. No language model produced any answer. The generator is included (build_dataset.py, langdata_names.py, langdata_templates.py), so the whole dataset is reproducible (seed 20261105).

Loading

from datasets import load_dataset
units = load_dataset("YOUR_HF_USERNAME/unit-conversion", "units")["train"]
qa    = load_dataset("YOUR_HF_USERNAME/unit-conversion", "qa")
ner   = load_dataset("YOUR_HF_USERNAME/unit-conversion", "ner")

Languages

code language QA rows NER rows my confidence in the text
en English 2,845 800 high
zh Chinese (Mandarin) 2,845 800 high
hi Hindi 2,845 800 high
es Spanish 2,845 800 high
fr French 2,845 800 high
ar Arabic 2,845 800 high
bn Bengali 2,845 800 lower
pt Portuguese 2,845 800 high
ru Russian 2,845 800 high
ur Urdu 2,845 800 lower
id Indonesian 2,845 800 high
de German 2,845 800 high
ja Japanese 2,845 800 high
pcm Nigerian Pidgin 2,845 800 lower
mr Marathi 2,845 800 lower
te Telugu 2,845 800 lower
ta Tamil 2,845 800 lower
tr Turkish 2,845 800 high
vi Vietnamese 2,845 800 high
ko Korean 2,845 800 high
fa Persian 2,845 800 high

One QA/NER row exists per language, not as translations of each other: values and templates are sampled independently, but the split is grouped by unit pair, so no pair is shared across splits in any language.

1. units.csv

SI value = value × to_si_factor + to_si_offset. Conversion between units A and B: (v × factor_A + offset_A − offset_B) / factor_B.

column meaning
unit_id stable identifier (used by the other parts)
dimension length, mass, time, temperature, temperature_difference, area, volume, speed, pressure, energy, power, force, data
name_en, name_en_plural, name_<lang>, symbol names (one column per language) and symbol
to_si_factor, to_si_factor_exact, to_si_offset factor as float, as an exact fraction, and the offset
si_unit the reference unit of the dimension (B for data)
system SI, metric, imperial, imperial_us, us_customary, traditional, ...
aliases `
trap_group common confusion group, if any (see below)
reliability exact, conventional, or traditional_variable
source, notes provenance and remarks

2. qa/

column meaning
id, lang (ISO code, 21 values), task identifiers
question the question text
answer_text, answer_value, answer_unit answer as text, as a float (6 significant digits), and the target unit_id
solution short worked solution in the question language
units_involved, dimension units used and the dimension of the answer
trap_tags traps present in the question (see below)
digits latin or native (Persian, Arabic-Indic, Bengali or Devanagari digits)

Tasks and counts:

task count
convert 45381
fuel_economy 504
word_problem_distance 4620
word_problem_energy 4620
word_problem_volume 4620

Splits: train 47,684, validation 6,118, test 5,943. Splits are grouped by unit pair (for example mi->km): a pair that appears in the test set never appears in train, in any language. For word problems the split is random. So the test set measures generalisation to unseen pairs, not memorisation.

3. ner/

Each row has text and entities, a list of {start, end, text, value, unit_id, dimension, si_value}. Offsets are Python character offsets. An entity spans the quantity and the unit together (for example ۵ کیلومتر). Splits: train 13,418, validation 1,689, test 1,693.

Traps covered (trap_tags)

  • us_vs_uk_volume: US vs UK gallon, pint, fluid ounce.
  • abs_vs_delta_temp: a temperature (20 °C → 68 °F) vs a temperature difference (20 °C → 36 °F).
  • ton_variants: metric tonne, US short ton, UK long ton.
  • binary_vs_decimal: GB vs GiB, MB vs MiB, ...
  • calorie_variants: calorie vs kilocalorie.
  • foot_variants, hp_variants, mmhg_vs_torr, oz_variants: international vs survey foot, mechanical vs metric horsepower, mmHg vs torr, avoirdupois vs troy ounce.
  • regional_traditional: traditional units whose value changed by region and era.
  • reciprocal_scale: fuel economy (mpg vs L/100 km), where the relation is not linear.
  • multi_step: word problems that need several unit steps.

Limitations (please read)

  • Traditional units are conventions. Values such as the mesqal (4.608 g), sir (75 g), man (Tabriz, 2.97 kg), zar (1.04 m), farsang (6 km) and jarib (1000 m²) are common modern values; historical values differed by city and era. They are marked traditional_variable.
  • Text is templated and synthetic. Questions come from a small set of templates per language, so linguistic variety is lower than in real user text. All names and templates were written with the help of an AI assistant and need native-speaker review. Confidence is highest for the large languages and lower for Bengali, Urdu, Marathi, Telugu, Tamil and Nigerian Pidgin (marked lower above).
  • Agreement and case. In Spanish, French, Portuguese, German and Russian the questions write units as symbols after numbers (5 km) to avoid plural and case errors; the units table still has full names. Arabic phrasing is simplified.
  • Traditional Persian units outside Persian and Arabic are written in Latin transliteration (mesqal, sir, man, zar, farsang, jarib).
  • Digits. Native digits are used only for Persian, Arabic, Urdu, Bengali, Hindi and Marathi (digits column); Tamil and Telugu use Latin digits.
  • Some English units that no language has a short everyday name for (e.g. US survey foot) use descriptive names; compound names (square, cubic, per) are built by rule and can sound stiff.
  • Fuel economy is in qa only (not in units) because it is not a linear scale.
  • Answers are rounded to 6 significant digits; compare with a tolerance.
  • Values with a conventional definition (mmHg, cal, BTU, Julian year) follow the cited convention.

License

CC0 1.0 (public domain dedication). Sources of constants: BIPM SI Brochure, NIST SP 811 and Handbook 44, IEC 80000-13.

https://toolshed.click/

license: cc0-1.0