From 3217fa39cd4312833f47003c721e7274d43909c8 Mon Sep 17 00:00:00 2001 From: Al Date: Wed, 25 Nov 2015 14:54:41 -0500 Subject: [PATCH] [fix] add country randomly in the formatted language training data in cases where country is not present --- scripts/geodata/osm/osm_address_training_data.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/geodata/osm/osm_address_training_data.py b/scripts/geodata/osm/osm_address_training_data.py index 933af991..fe028cd8 100644 --- a/scripts/geodata/osm/osm_address_training_data.py +++ b/scripts/geodata/osm/osm_address_training_data.py @@ -709,6 +709,8 @@ def build_address_format_training_data_limited(language_rtree, infile, out_dir): if have_country and random.random() < 0.4: have_country = False + elif not have_country and random.random() < 0.2: + have_country = True if not value: continue