Skip to content

Commit

Permalink
feat: added new Time rules (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
RajanMehtaClinc authored Mar 24, 2021
1 parent 690c33b commit 34b1dda
Show file tree
Hide file tree
Showing 16 changed files with 532 additions and 487 deletions.
75 changes: 39 additions & 36 deletions Duckling/Ranking/Classifiers/EN_AU.hs
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ classifiers
likelihoods = HashMap.fromList [("", 0.0)], n = 3}}),
("integer (numeric)",
Classifier{okData =
ClassData{prior = -0.5266362297926329, unseen = -6.222576268071369,
likelihoods = HashMap.fromList [("", 0.0)], n = 502},
ClassData{prior = -0.5233945245011044, unseen = -6.230481447578482,
likelihoods = HashMap.fromList [("", 0.0)], n = 506},
koData =
ClassData{prior = -0.8930338697098877, unseen = -5.857933154483459,
ClassData{prior = -0.8977287140140955, unseen = -5.857933154483459,
likelihoods = HashMap.fromList [("", 0.0)], n = 348}}),
("<year> (bc|ad)",
Classifier{okData =
Expand Down Expand Up @@ -569,18 +569,17 @@ classifiers
likelihoods = HashMap.fromList [("", 0.0)], n = 1}}),
("in|during <named-month>|year",
Classifier{okData =
ClassData{prior = -0.2744368457017603,
unseen = -3.8066624897703196,
ClassData{prior = -0.21511137961694557, unseen = -4.04305126783455,
likelihoods =
HashMap.fromList
[("<year> (bc|ad)", -1.9924301646902063),
("October", -3.0910424533583156),
("year (latent)", -1.2992829841302609),
("year", -0.9509762898620451), ("March", -2.6855773452501515),
("month", -2.3978952727983707)],
n = 19},
[("<year> (bc|ad)", -2.2335922215070942),
("October", -3.332204510175204),
("year (latent)", -1.252762968495368),
("year", -0.9808292530117262), ("March", -2.4159137783010487),
("month", -2.2335922215070942)],
n = 25},
koData =
ClassData{prior = -1.4271163556401458,
ClassData{prior = -1.6422277352570913,
unseen = -2.9444389791664407,
likelihoods =
HashMap.fromList
Expand Down Expand Up @@ -685,8 +684,8 @@ classifiers
likelihoods = HashMap.fromList [], n = 0}}),
("month (grain)",
Classifier{okData =
ClassData{prior = 0.0, unseen = -3.6888794541139363,
likelihoods = HashMap.fromList [("", 0.0)], n = 38},
ClassData{prior = 0.0, unseen = -3.713572066704308,
likelihoods = HashMap.fromList [("", 0.0)], n = 39},
koData =
ClassData{prior = -infinity, unseen = -0.6931471805599453,
likelihoods = HashMap.fromList [], n = 0}}),
Expand Down Expand Up @@ -1426,8 +1425,8 @@ classifiers
likelihoods = HashMap.fromList [], n = 0}}),
("year (grain)",
Classifier{okData =
ClassData{prior = 0.0, unseen = -3.6635616461296463,
likelihoods = HashMap.fromList [("", 0.0)], n = 37},
ClassData{prior = 0.0, unseen = -3.6888794541139363,
likelihoods = HashMap.fromList [("", 0.0)], n = 38},
koData =
ClassData{prior = -infinity, unseen = -0.6931471805599453,
likelihoods = HashMap.fromList [], n = 0}}),
Expand Down Expand Up @@ -1565,25 +1564,29 @@ classifiers
likelihoods = HashMap.fromList [("", 0.0)], n = 1}}),
("the <cycle> of <time>",
Classifier{okData =
ClassData{prior = -0.40546510810816444,
unseen = -3.044522437723423,
ClassData{prior = -0.3184537311185346, unseen = -3.367295829986474,
likelihoods =
HashMap.fromList
[("week (grain)<named-month>|<named-day> <day-of-month> (ordinal)",
-1.8971199848858813),
("weekmonth", -1.8971199848858813),
("week (grain)October", -1.8971199848858813),
[("yearyear", -2.639057329615259),
("monthmonth", -2.639057329615259),
("week (grain)<named-month>|<named-day> <day-of-month> (ordinal)",
-2.2335922215070942),
("weekmonth", -2.2335922215070942),
("week (grain)October", -2.2335922215070942),
("month (grain)March", -2.639057329615259),
("year (grain)year (latent)", -2.639057329615259),
("week (grain)<named-month> <day-of-month> (non ordinal)",
-1.8971199848858813),
("weekday", -1.3862943611198906)],
n = 6},
-2.2335922215070942),
("weekday", -1.7227665977411035)],
n = 8},
koData =
ClassData{prior = -1.0986122886681098, unseen = -2.70805020110221,
ClassData{prior = -1.2992829841302609,
unseen = -2.9444389791664407,
likelihoods =
HashMap.fromList
[("second (grain) March", -1.9459101490553135),
("secondmonth", -1.252762968495368),
("second (grain) this|last|next <cycle>", -1.540445040947149)],
[("second (grain) March", -2.1972245773362196),
("secondmonth", -1.5040773967762742),
("second (grain) this|last|next <cycle>", -1.791759469228055)],
n = 3}}),
("number.number hours",
Classifier{okData =
Expand Down Expand Up @@ -1668,14 +1671,14 @@ classifiers
likelihoods = HashMap.fromList [], n = 0}}),
("year (latent)",
Classifier{okData =
ClassData{prior = -0.13743003304017992, unseen = -5.43372200355424,
ClassData{prior = -0.1351747783682526, unseen = -5.4510384535657,
likelihoods =
HashMap.fromList
[("integer (numeric)", -2.6668247082161294e-2),
("intersect 2 numbers", -4.04305126783455)],
n = 224},
[("integer (numeric)", -2.6202372394024072e-2),
("intersect 2 numbers", -4.060443010546419)],
n = 228},
koData =
ClassData{prior = -2.05256852342874, unseen = -3.6375861597263857,
ClassData{prior = -2.068012845856213, unseen = -3.6375861597263857,
likelihoods =
HashMap.fromList
[("integer (numeric)", -1.5314763709643884),
Expand Down Expand Up @@ -3212,8 +3215,8 @@ classifiers
n = 9}}),
("March",
Classifier{okData =
ClassData{prior = 0.0, unseen = -3.4011973816621555,
likelihoods = HashMap.fromList [("", 0.0)], n = 28},
ClassData{prior = 0.0, unseen = -3.4657359027997265,
likelihoods = HashMap.fromList [("", 0.0)], n = 30},
koData =
ClassData{prior = -infinity, unseen = -0.6931471805599453,
likelihoods = HashMap.fromList [], n = 0}}),
Expand Down
75 changes: 39 additions & 36 deletions Duckling/Ranking/Classifiers/EN_BZ.hs
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ classifiers
likelihoods = HashMap.fromList [("", 0.0)], n = 3}}),
("integer (numeric)",
Classifier{okData =
ClassData{prior = -0.5266362297926329, unseen = -6.222576268071369,
likelihoods = HashMap.fromList [("", 0.0)], n = 502},
ClassData{prior = -0.5233945245011044, unseen = -6.230481447578482,
likelihoods = HashMap.fromList [("", 0.0)], n = 506},
koData =
ClassData{prior = -0.8930338697098877, unseen = -5.857933154483459,
ClassData{prior = -0.8977287140140955, unseen = -5.857933154483459,
likelihoods = HashMap.fromList [("", 0.0)], n = 348}}),
("<year> (bc|ad)",
Classifier{okData =
Expand Down Expand Up @@ -569,18 +569,17 @@ classifiers
likelihoods = HashMap.fromList [("", 0.0)], n = 1}}),
("in|during <named-month>|year",
Classifier{okData =
ClassData{prior = -0.2744368457017603,
unseen = -3.8066624897703196,
ClassData{prior = -0.21511137961694557, unseen = -4.04305126783455,
likelihoods =
HashMap.fromList
[("<year> (bc|ad)", -1.9924301646902063),
("October", -3.0910424533583156),
("year (latent)", -1.2992829841302609),
("year", -0.9509762898620451), ("March", -2.6855773452501515),
("month", -2.3978952727983707)],
n = 19},
[("<year> (bc|ad)", -2.2335922215070942),
("October", -3.332204510175204),
("year (latent)", -1.252762968495368),
("year", -0.9808292530117262), ("March", -2.4159137783010487),
("month", -2.2335922215070942)],
n = 25},
koData =
ClassData{prior = -1.4271163556401458,
ClassData{prior = -1.6422277352570913,
unseen = -2.9444389791664407,
likelihoods =
HashMap.fromList
Expand Down Expand Up @@ -685,8 +684,8 @@ classifiers
likelihoods = HashMap.fromList [], n = 0}}),
("month (grain)",
Classifier{okData =
ClassData{prior = 0.0, unseen = -3.6888794541139363,
likelihoods = HashMap.fromList [("", 0.0)], n = 38},
ClassData{prior = 0.0, unseen = -3.713572066704308,
likelihoods = HashMap.fromList [("", 0.0)], n = 39},
koData =
ClassData{prior = -infinity, unseen = -0.6931471805599453,
likelihoods = HashMap.fromList [], n = 0}}),
Expand Down Expand Up @@ -1426,8 +1425,8 @@ classifiers
likelihoods = HashMap.fromList [], n = 0}}),
("year (grain)",
Classifier{okData =
ClassData{prior = 0.0, unseen = -3.6635616461296463,
likelihoods = HashMap.fromList [("", 0.0)], n = 37},
ClassData{prior = 0.0, unseen = -3.6888794541139363,
likelihoods = HashMap.fromList [("", 0.0)], n = 38},
koData =
ClassData{prior = -infinity, unseen = -0.6931471805599453,
likelihoods = HashMap.fromList [], n = 0}}),
Expand Down Expand Up @@ -1565,25 +1564,29 @@ classifiers
likelihoods = HashMap.fromList [("", 0.0)], n = 1}}),
("the <cycle> of <time>",
Classifier{okData =
ClassData{prior = -0.40546510810816444,
unseen = -3.044522437723423,
ClassData{prior = -0.3184537311185346, unseen = -3.367295829986474,
likelihoods =
HashMap.fromList
[("week (grain)<named-month>|<named-day> <day-of-month> (ordinal)",
-1.8971199848858813),
("weekmonth", -1.8971199848858813),
("week (grain)October", -1.8971199848858813),
[("yearyear", -2.639057329615259),
("monthmonth", -2.639057329615259),
("week (grain)<named-month>|<named-day> <day-of-month> (ordinal)",
-2.2335922215070942),
("weekmonth", -2.2335922215070942),
("week (grain)October", -2.2335922215070942),
("month (grain)March", -2.639057329615259),
("year (grain)year (latent)", -2.639057329615259),
("week (grain)<named-month> <day-of-month> (non ordinal)",
-1.8971199848858813),
("weekday", -1.3862943611198906)],
n = 6},
-2.2335922215070942),
("weekday", -1.7227665977411035)],
n = 8},
koData =
ClassData{prior = -1.0986122886681098, unseen = -2.70805020110221,
ClassData{prior = -1.2992829841302609,
unseen = -2.9444389791664407,
likelihoods =
HashMap.fromList
[("second (grain) March", -1.9459101490553135),
("secondmonth", -1.252762968495368),
("second (grain) this|last|next <cycle>", -1.540445040947149)],
[("second (grain) March", -2.1972245773362196),
("secondmonth", -1.5040773967762742),
("second (grain) this|last|next <cycle>", -1.791759469228055)],
n = 3}}),
("number.number hours",
Classifier{okData =
Expand Down Expand Up @@ -1668,14 +1671,14 @@ classifiers
likelihoods = HashMap.fromList [], n = 0}}),
("year (latent)",
Classifier{okData =
ClassData{prior = -0.13743003304017992, unseen = -5.43372200355424,
ClassData{prior = -0.1351747783682526, unseen = -5.4510384535657,
likelihoods =
HashMap.fromList
[("integer (numeric)", -2.6668247082161294e-2),
("intersect 2 numbers", -4.04305126783455)],
n = 224},
[("integer (numeric)", -2.6202372394024072e-2),
("intersect 2 numbers", -4.060443010546419)],
n = 228},
koData =
ClassData{prior = -2.05256852342874, unseen = -3.6375861597263857,
ClassData{prior = -2.068012845856213, unseen = -3.6375861597263857,
likelihoods =
HashMap.fromList
[("integer (numeric)", -1.5314763709643884),
Expand Down Expand Up @@ -3212,8 +3215,8 @@ classifiers
n = 9}}),
("March",
Classifier{okData =
ClassData{prior = 0.0, unseen = -3.4011973816621555,
likelihoods = HashMap.fromList [("", 0.0)], n = 28},
ClassData{prior = 0.0, unseen = -3.4657359027997265,
likelihoods = HashMap.fromList [("", 0.0)], n = 30},
koData =
ClassData{prior = -infinity, unseen = -0.6931471805599453,
likelihoods = HashMap.fromList [], n = 0}}),
Expand Down
Loading

0 comments on commit 34b1dda

Please sign in to comment.