From 290ca48e25f96c64e3da634e28fed606b9ae31b5 Mon Sep 17 00:00:00 2001 From: Bartosz Nitka Date: Thu, 6 Apr 2017 10:50:34 -0700 Subject: [PATCH] Fix 4:23am returning 5:23am Summary: This is the easiest way to fix it, but talking offline with Julien, we may need to revisit. It basically gets rid of time series where we were producing intervals that are not a multiply of the grain. Reviewed By: patapizza Differential Revision: D4841759 fbshipit-source-id: 1c4742a --- Duckling/Ranking/Classifiers/DE.hs | 416 +++++++++++++++-------------- Duckling/Ranking/Classifiers/EN.hs | 138 +++++----- Duckling/Ranking/Classifiers/ES.hs | 106 ++++---- Duckling/Ranking/Classifiers/KO.hs | 31 +-- Duckling/Ranking/Classifiers/PL.hs | 23 +- Duckling/Ranking/Classifiers/PT.hs | 191 ++++++------- Duckling/Time/EN/Corpus.hs | 5 + Duckling/Time/PT/Rules.hs | 2 +- Duckling/Time/Types.hs | 21 +- 9 files changed, 491 insertions(+), 442 deletions(-) diff --git a/Duckling/Ranking/Classifiers/DE.hs b/Duckling/Ranking/Classifiers/DE.hs index ffb09245..3140c029 100644 --- a/Duckling/Ranking/Classifiers/DE.hs +++ b/Duckling/Ranking/Classifiers/DE.hs @@ -183,7 +183,7 @@ classifiers likelihoods = HashMap.fromList [("", 0.0)], n = 1}}), ("at ", Classifier{okData = - ClassData{prior = -0.15415067982725836, + ClassData{prior = -0.20972053098206903, unseen = -4.276666119016055, likelihoods = HashMap.fromList @@ -202,14 +202,13 @@ classifiers -3.56953269648137)], n = 30}, koData = - ClassData{prior = -1.9459101490553135, - unseen = -3.0910424533583156, + ClassData{prior = -1.6650077635889111, unseen = -3.258096538021482, likelihoods = HashMap.fromList - [("time-of-day (latent)", -1.4350845252893227), - (" am|pm", -2.3513752571634776), - ("hour", -1.252762968495368)], - n = 5}}), + [("time-of-day (latent)", -1.6094379124341003), + (" am|pm", -1.8325814637483102), + ("hour", -1.4271163556401458), ("minute", -2.120263536200091)], + n = 7}}), ("absorption of , after named day", Classifier{okData = ClassData{prior = 0.0, unseen = -3.1780538303479458, @@ -355,236 +354,252 @@ classifiers n = 1}}), ("intersect", Classifier{okData = - ClassData{prior = -0.1371338199688892, unseen = -6.799055862058796, + ClassData{prior = -0.24751603072644626, unseen = -6.8001700683022, likelihoods = HashMap.fromList - [("intersect by ','named-month", -4.4953553199808844), - ("hourday", -4.852030263919617), - ("dayhour", -2.4804522994386202), - ("daymonth", -3.332204510175204), + [("intersect by ','named-month", -4.49647076906475), + ("hourday", -4.8531457130034825), + ("dayhour", -2.481567748522486), + ("daymonth", -3.3333199592590694), ("(ordinal) year o'clock", - -6.104793232414985), - ("monthyear", -4.4953553199808844), - ("yearhour", -6.104793232414985), - ("intersect o'clock", -3.9647270689187146), - ("christmasyear", -6.104793232414985), - ("after lunchat ", -6.104793232414985), - ("named-daylast ", -6.104793232414985), - ("intersect by 'of', 'from', 'syear", -5.699328124306821), - (" am|pmintersect", -5.006180943746876), - ("intersect